很基础的sql语句的使用示例

用SQL语句创建如下三个基本表:学生表(Student)、课程表(Course)、学生选课表(SC),结构如下所示

Student表结构

Create table Student ( )

Course

表结构

Create table course ( )

SC表结构

Cno varchar(10) primary key, Cname varchar(20) not null, Ccredit int check(Sctedit>0), Semester int check(Semester>0), Period int check(Period>0)

Sno varchar(7) primary key, Sname varchar(10) not null,

Ssex char (2) check(Ssex=‘男’or Ssex=’女’), Sage int check(Sage between 15 and 45), Sdept varchar(20) default(‘计算机系’)

更多推荐

mysql的学生信息建表语句_SQL语句创建学生信息数据库表的示例