본문내용
create database db_hell;
use db_hell;
#학부 테이블 생성
create table dept
(
deptcode VARCHAR(10),
deptname VARCHAR(20),
depttel VARCHAR(15),
primary key(deptcode)
);
#교수 테이블 생성
create table professor
(
professorcode VARCHAR(10),
pname VARCHAR(20),
ssn VARCHAR(14),
majorcode VARCHAR(10),
pwd VARCHAR(10),
address VARCHAR(60),
lab VARCHAR(20),
salary INTEGER(10),
deptcode VARCHAR(10),
sex VARCHAR(2),
age INTEGER(3),
primary key(professorcode),
foreign key(deptcode) references dept(deptcode)
);
#학생 테이블 생성
create table stu
(
stunumber INTEGER(8) NOT NULL,
pname VARCHAR(20),
pwd VARCHAR(10),
address VARCHAR(60),
professorcode VARCHAR(10),
deptcode VARCHAR(10),
sex VARCHAR(2),
age INTEGER(3),
ssn VARCHAR(14),
primary key(stunumber),
foreign key(professorcode) references professor(professorcode),
foreign key(deptcode) references dept(deptcode)
);
# 과목 등록
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1099", 2008, "임베디드H/W실험", "전필", 3 , 1, 2,1);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1023", 2008, "운영체제", "전필", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("BA0028", 2008, "이산수학", "기필" , 2, 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1094", 2008, "데이터베이스 및 설계", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1049", 2008, "마이크로프로세서", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1048", 2008, "전자시스템", "전선", 2 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1047", 2008, "자바프로그래밍 응용", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1038", 2008, "멀티미디엉응용", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("LA0257", 2008, "경영학원론", "교필" ,3, 1, 2,2);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1046", 2008, "웹시스템응용", "전선", 2 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1045", 2008, "커널프로그래밍", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1050", 2008, "컴파일러", "전선", 4 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1051", 2008, "데이터구조 및 알고리즘", "전필", 2 , 1, 3,3);
use db_hell;
#학부 테이블 생성
create table dept
(
deptcode VARCHAR(10),
deptname VARCHAR(20),
depttel VARCHAR(15),
primary key(deptcode)
);
#교수 테이블 생성
create table professor
(
professorcode VARCHAR(10),
pname VARCHAR(20),
ssn VARCHAR(14),
majorcode VARCHAR(10),
pwd VARCHAR(10),
address VARCHAR(60),
lab VARCHAR(20),
salary INTEGER(10),
deptcode VARCHAR(10),
sex VARCHAR(2),
age INTEGER(3),
primary key(professorcode),
foreign key(deptcode) references dept(deptcode)
);
#학생 테이블 생성
create table stu
(
stunumber INTEGER(8) NOT NULL,
pname VARCHAR(20),
pwd VARCHAR(10),
address VARCHAR(60),
professorcode VARCHAR(10),
deptcode VARCHAR(10),
sex VARCHAR(2),
age INTEGER(3),
ssn VARCHAR(14),
primary key(stunumber),
foreign key(professorcode) references professor(professorcode),
foreign key(deptcode) references dept(deptcode)
);
# 과목 등록
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1099", 2008, "임베디드H/W실험", "전필", 3 , 1, 2,1);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1023", 2008, "운영체제", "전필", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("BA0028", 2008, "이산수학", "기필" , 2, 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1094", 2008, "데이터베이스 및 설계", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1049", 2008, "마이크로프로세서", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1048", 2008, "전자시스템", "전선", 2 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1047", 2008, "자바프로그래밍 응용", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1038", 2008, "멀티미디엉응용", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("LA0257", 2008, "경영학원론", "교필" ,3, 1, 2,2);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1046", 2008, "웹시스템응용", "전선", 2 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1045", 2008, "커널프로그래밍", "전선", 3 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1050", 2008, "컴파일러", "전선", 4 , 1, 3,3);
INSERT INTO openingsubject(subjectcode,openingyear,subjectname,classification,academicyear,semaster,lecturetimenum,credit)
VALUES("SC1051", 2008, "데이터구조 및 알고리즘", "전필", 2 , 1, 3,3);
추천자료
스포츠 리그를 위해 팀들과 게임에 대한 정보를 관리하는 데이터베이스
MS ACCESS 를 이용한 자바 데이터베이스 프로그래밍
데이터베이스 DB Design Project ( 삼국지 개념의 국가, 인재, 성의 정보를 관리하는 데이터...
소프트웨어시스템 실험 데이터베이스 개요
액세스(ACCESS)로 구연한 온라인게임 데이터베이스 도큐먼트파일 (프로젝트)
데이터베이스
MS SQL2005와 비쥬얼베이직을 연동한 건설현장인부관리 데이터베이스 텀프로젝트
데이터베이스 관리시스템과 SQL
[특허][이중출원][웹데이터베이스][표준화][진보성]특허의 개념, 특허의 분류, 특허의 요건, ...
대학교 중고책거래 DB 데이터베이스 구축 보고서
[MFC] 일정관리 프로그램 (다이어리) 데이터베이스
인터넷 정보검색효율의 측정방법, 인터넷 정보검색효율과 최적화, 인터넷 정보검색효율과 인...
DBMS[데이터베이스 관리시스템]
데이터베이스 관리와 실습 MS SQL Server 2008(연습문제4장_mssql결과)
소개글