J
jackersun
Unregistered / Unconfirmed
GUEST, unregistred user!
如下一段SQL语句
create table teacher(
id char(6) not null,
name varchar(20) not null,
department char(2) not null');
alter table teacher
add constraint teacher_id
primary key(id);
create table course(
id char(10) not null,
name varchar(50) not null,
teacher char(6) not null,
credit_hour smallint default 0,
period smallint default 0,
classtime varchar(20),
classroom varchar(20),
intro varchar(4000),
state char(1));
alter table course
add constraint course_id
primary key(id);
alter table course
add constraint teacher
foreign key (teacher)
references teacher;
该如何建立,请给出详细代码,好不好,本人初学DELPHI,希望得到大家的帮助。
create table teacher(
id char(6) not null,
name varchar(20) not null,
department char(2) not null');
alter table teacher
add constraint teacher_id
primary key(id);
create table course(
id char(10) not null,
name varchar(50) not null,
teacher char(6) not null,
credit_hour smallint default 0,
period smallint default 0,
classtime varchar(20),
classroom varchar(20),
intro varchar(4000),
state char(1));
alter table course
add constraint course_id
primary key(id);
alter table course
add constraint teacher
foreign key (teacher)
references teacher;
该如何建立,请给出详细代码,好不好,本人初学DELPHI,希望得到大家的帮助。