->(Sno char(10),Cno char(10),Grade real,
->constraint pk foreign key(Sno)
->references student(Sno),
->constraint pk1 foreign key(Cno)
->references Course(Cno))
Query OK, 0 rows affected (0.01 sec)
2.增加、修改和删除字段,要求:
(1)给Student表增塌塌加一个memo(备注)字段,类型为Varchar(200)
mysql>alter table student add memo varchar(200)
Query OK, 0 rows affected (0.25 sec)
Records: 0 Duplicates: 0 Warnings: 0
(拍笑2)将memo字段的类型修改为袭衫含Varchar(300)
mysql>alter table student
->modify memo varchar(300)
Query OK, 0 rows affected (0.06 sec)
(3)删除memo 字段
mysql>alter table student drop memo
Query OK, 0 rows affected (0.02 sec)
我答帆弊案不保证全对啊欢迎分享,转载请注明来源:内存溢出
评论列表(0条)