[G_SQL] Sample Database

2012.05.20 23:52

가을의 곰을... 조회 수:96083

[G_SQL] Sample Database


* Students 테이블

student

각 학생에 대한 학번  

student_name

학생의 이름

address

학생의 주소

city

도시의 이름

state

주의 이름 (약어)

zip

학생의 우편번호

gender

학생의 성별 (M/F)

student : PK

 


* Teachers 테이블

teacher

교수번호

teacher_name

교수이름

phone

전화번호

salary

연봉

teacher : PK

 

* Courses 테이블

course

각 과목에 대한 과목코드

course_name

과목명

dapartment

해당 과목을 개설한 학과

num_credit

과목에 대한 학점 수

course : PK

 

 

* Sections : 한 과목이 여러 반으로 분반되어 있음

course

과목코드 : 분반이 있는 과목에 대한 코드

section

분반이름

teacher

이 반을 담당하는 교수번호

num_student

등록가능한 학생 수

course + section : PK

 

 

* Enrolls : 학생이 수강하는 과목에 대한 학점을 기록하는 테이블

course

반드시 courses 테이블에 있는 과목명만이 이 테이블에 과목코드로 올 수 있다

section

반드시 sections 테이블에 있는 분반 이름만이 이 테이블에 반번호로 올 수 있다

student

students 테이블에 있는 학생만이 올 수 있다

grade

학생이 수강하는 과목에 대한 학점이다. 4는 A, 3은 B, 2는 C, 1은 D

course + section + student : PK


 

 CREATE TABLE  courses  (

   ID  int NOT NULL  ,

   course  int NOT NULL,

   course_name  varchar(255) DEFAULT NULL,

   department  varchar(255) DEFAULT NULL,

   num_credits  varchar(255) DEFAULT NULL);


INSERT INTO courses VALUES (3, 290, 'English Composition', 'English', '3');

INSERT INTO courses VALUES (1, 450, 'Western Civilization', 'History', '3');

INSERT INTO courses VALUES (4, 480, 'Compiler Writing', 'Computer Science', '3');

INSERT INTO courses VALUES (5, 550, 'Art History', 'History', '3');

INSERT INTO courses VALUES (2, 730, 'Calculus IV', 'Math', '4');


경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

CREATE TABLE  enrolls  (

   ID  int NOT NULL  ,

   course  int DEFAULT NULL,

   section  int DEFAULT NULL,

   student  int DEFAULT NULL,

   grade  varchar(255) DEFAULT NULL);


INSERT INTO enrolls VALUES (1, 730, 1, 148, '3');

INSERT INTO enrolls VALUES (2, 450, 2, 210, '3');

INSERT INTO enrolls VALUES (3, 730, 1, 210, '1');

INSERT INTO enrolls VALUES (4, 290, 1, 298, '3');

INSERT INTO enrolls VALUES (5, 480, 2, 298, '3');

INSERT INTO enrolls VALUES (6, 730, 1, 348, '2');

INSERT INTO enrolls VALUES (7, 290, 1, 349, '4');

INSERT INTO enrolls VALUES (8, 480, 1, 358, '4');

INSERT INTO enrolls VALUES (9, 480, 1, 410, '2');

INSERT INTO enrolls VALUES (10, 450, 1, 473, '2');

INSERT INTO enrolls VALUES (11, 730, 1, 473, '3');

INSERT INTO enrolls VALUES (12, 480, 2, 473, '0');

INSERT INTO enrolls VALUES (13, 290, 1, 548, '2');

INSERT INTO enrolls VALUES (14, 730, 1, 558, '3');

INSERT INTO enrolls VALUES (15, 730, 1, 649, '4');

INSERT INTO enrolls VALUES (16, 480, 1, 649, '4');

INSERT INTO enrolls VALUES (17, 450, 1, 654, '4');

INSERT INTO enrolls VALUES (18, 450, 2, 548, NULL);


CREATE TABLE  sections  (

   ID  int NOT NULL  ,

   section  int DEFAULT NULL,

   teacher  int DEFAULT NULL,

   course  int DEFAULT NULL,

   num_students  int DEFAULT NULL);


INSERT INTO sections VALUES (1, 1, 303, 450, 2);

INSERT INTO sections VALUES (5, 2, 560, 450, 2);

INSERT INTO sections VALUES (6, 2, 784, 480, 2);

INSERT INTO sections VALUES (3, 1, 430, 290, 3);

INSERT INTO sections VALUES (4, 1, 180, 480, 3);

INSERT INTO sections VALUES (2, 1, 290, 730, 6);


CREATE TABLE  students  (

   ID  int NOT NULL  ,

   student  int NOT NULL,

   student_name  varchar(255) DEFAULT NULL,

   address  varchar(255) DEFAULT NULL,

   zip  int DEFAULT NULL,

   city  varchar(255) DEFAULT NULL,

   state  varchar(255) DEFAULT NULL,

   gender  varchar(255) DEFAULT NULL);


INSERT INTO students VALUES (1, 148, 'Susan Powell', '534 East River Dr.', 19041, 'Haverford', 'PA', 'F');

INSERT INTO students VALUES (2, 210, 'Bob Dawson', '120 South Jefferson', 2891, 'Newport', 'RI', 'M');

INSERT INTO students VALUES (3, 298, 'Howard Mansfield', '290 Wynkoop Drive', 22180, 'Vienna', 'VA', 'M');

INSERT INTO students VALUES (4, 348, 'Susan Pugh', '534 East Hampton Dr.', 6107, 'Hartford', 'CT', 'F');

INSERT INTO students VALUES (5, 349, 'Joe Adams', '473 Emmerson Street', 19702, 'Newark', 'DE', 'M');

INSERT INTO students VALUES (6, 354, 'Janet Ladd', '441 10th Street', 18073, 'Pennsburg', 'PA', 'F');

INSERT INTO students VALUES (7, 410, 'Bill Jones', '120 South Harrison', 92660, 'Newport', 'CA', 'M');

INSERT INTO students VALUES (8, 473, 'Carol Dean', '983 Park Avenue', 2169, 'Boston', 'MA', 'F');

INSERT INTO students VALUES (9, 548, 'Allen Thomas', '238 West ox Road', 60624, 'Chicago', 'IL', 'M');

INSERT INTO students VALUES (10, 558, 'Val Shipp', '238 Westport Road', 60556, 'Chicago', 'IL', 'F');

INSERT INTO students VALUES (11, 649, 'John Anderson', '473 Emmory Street', 10008, 'New York', 'NY', 'M');

INSERT INTO students VALUES (12, 654, 'Janet Thomas', '441 6th Street', 16510, 'Erie', 'PA', 'F');


CREATE TABLE  teachers  (

   ID  int NOT NULL  ,

   teacher#  int DEFAULT NULL,

   teacher_name  varchar(255) DEFAULT NULL,

   phone  varchar(255) DEFAULT NULL,

   salary  FLOAT(14,2) DEFAULT NULL);


INSERT INTO teachers VALUES (1, 303, 'Dr. Horn', '257-3049', 27540);

INSERT INTO teachers VALUES (2, 290, 'Dr. Lowe', '257-2390', 31450);

INSERT INTO teachers VALUES (3, 430, 'Dr. Engle', '256-4621', 38200);

INSERT INTO teachers VALUES (4, 180, 'Dr. Cooke', '257-8088', 29560);

INSERT INTO teachers VALUES (5, 560, 'Dr. Olsen', '257-8086', 31778);

INSERT INTO teachers VALUES (6, 784, 'Dr. Scango', '257-3046', 32098);

INSERT INTO teachers VALUES (7, 213, 'Dr. Wright', '257-3393', 35000);









본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
공지 오라클 기본 샘플 데이터베이스 졸리운_곰 2014.01.02 87155
공지 [SQL컨셉] 서적 "SQL컨셉"의 샘플 데이타 베이스 SAMPLE DATABASE of ORACLE 가을의 곰을... 2013.02.10 79364
» [G_SQL] Sample Database 가을의 곰을... 2012.05.20 96083
704 [oracle] oracle 함수 간단 정리 file 졸리운_곰 2020.05.03 1483
703 [oracle] sub-query 서브쿼리 file 졸리운_곰 2020.05.03 1630
702 [oracle] 서브쿼리, Sub Query 졸리운_곰 2020.05.03 1218
701 [oracle] 서브쿼리(SUB QUERY) 정리 file 졸리운_곰 2020.05.03 1130
700 [oracle] ORA-00979: GROUP BY 표현식이 아닙니다 file 졸리운_곰 2020.05.01 1651
699 [Oracle] ORA-00979: GROUP BY 표현식이 아닙니다 졸리운_곰 2020.05.01 1339
698 [oracle] ORA-00979: GROUP BY 표현식이 아닙니다 졸리운_곰 2020.05.01 1201
697 [oracle]오라클 group by, rollup file 졸리운_곰 2020.05.01 1325
696 [oracle] Introduction to Oracle GROUP BY clause file 졸리운_곰 2020.05.01 987
695 [oracle] GROUP BY 절과 HAVING 절 졸리운_곰 2020.05.01 1124
694 ORACLE 오라클 CASE문 사용법 CASE WHEN THEN END file 졸리운_곰 2020.04.27 1715
693 [ORACLE] CASE WHEN ~ THEN ~ ELSE END file 졸리운_곰 2020.04.27 1227
692 Generative Adversarial Network : DCGAN을 이용한 이미지 생성 file 졸리운_곰 2020.04.20 1519
691 [Oracle|오라클] PLS-00323: 부프로그램 또는 '******' 커서는 패키지 지정에 정의되고 패키지 본체에 나타나야합니다 졸리운_곰 2020.04.16 1129
690 Question answering with TensorFlow file 졸리운_곰 2020.04.06 1410
689 [오류] ORA-01861 literal does not match format string (리터럴이 형식 문자열과 일치하지 않음) 졸리운_곰 2020.03.12 1038
688 ORA-01861: literal does not match format string file 졸리운_곰 2020.03.12 1422
687 개발자 환장하는 "ORA-01861: literal does not match format string" 졸리운_곰 2020.03.12 1235
686 [Oracle|오라클] INTERVAL 날짜 년 빼기 더하기 (ADD_YEARS) file 졸리운_곰 2020.03.11 1544
685 SQLD 기출 문제 및 요약 정리 모음 졸리운_곰 2020.03.06 2884
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED