create database college; college¶ó´Â µ¥ÀÌÅÍ º£À̽º ¸¸µë.
use college ;
show tables ; tableÀ» º¸¿©ÁÜ.
create table student <===Çлý Å×À̺í
(snum int(10) not null,
sname char(15),
major char(20),
level char(2),
age int(2),
primary key(snum));
create table class <====¹Ý Å×À̺í
(cname char(7) not null,
room char(5),
fid int(5),
primary key(cname));
create table enrolled <===enrolled Å×À̺í
(snum int(10) not null,
cname char(7),
primary key(snum));
create table faculty <===faculty Å×À̺í
(fid int(5) not null,
fname char(10),
deptid int(5),
primary key(fid));
LOAD DATA LOCAL INFILE `student_file.sql` INTO TABLE student; <=student.Sql Å×ÀÌºí °¢°¢ ¿£Æ¼Æ¼·Î ÀúÀå
LOAD DATA LOCAL INFILE `class_file.sql` INTO TABLE class;<=class.Sql Å×ÀÌºí °¢°¢ ¿£Æ¼Æ¼·Î ÀúÀå
LOAD DATA LOCAL INFILE `enrolled_file.sql` INTO TABLE en¡¦(»ý·«)
|
el | electronics | SR | 24 |
| 20xxx08 | david | sociology | FR | 20 |
| 20xxx09 | steve | math | SR | 29 |
| 20xxx11 | lincoln | sociology | SO | 22 |
| 20xxx12 | dustin | linguistics | JR | 24 |
| 20xxx14 | bill | electronics | SO | 18 |
| 20xxx15 | jacky | history | SR | 24 |
| 20xxx17 | gale | electronics | JR | 23 |
| 20xxx18 | bush | math | SR | 25 |
| 20xxx20 | gehrig | history | FR | 19 |
| 20xxx21 | zvieli | sociology | JR | 22 |
| 20xxx22 | mike | electronics | FR | 19 |
| 20xxx23 | andrew | math | FR | 18 |
| 20xxx24 | gunther | electronics | JR | 25 |
| 20xxx25 | garland | electronics | FR | 18 |