Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2159139
  • 博文数量: 556
  • 博客积分: 11457
  • 博客等级: 上将
  • 技术积分: 5973
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-24 22:33
文章分类

全部博文(556)

文章存档

2013年(22)

2012年(74)

2011年(460)

分类: 数据库开发技术

2011-10-12 21:43:57

  1. create table Course
  2. (
  3.    Cno char(4) primary key,
  4.    Cname char(40),
  5.    Cpno char(4),
  6.    Ccredit smallint,
  7.    foreign key (Cpno) references Course(Cno)
  8. )

  9. create table SC
  10. (
  11.   Sno char(9),
  12.   Cno char(4),
  13.   Grade smallint,
  14.   primary key(Sno,Cno),
  15.   foreign key(Sno) references Student(Sno),
  16.   foreign key(Cno) references Course(Cno)
  17. )

  18. insert into Student values('3030','ff','男',20,'CS')


  19. update Student set Sdept='Math' where Sno='3030'

  20. alter table Student add S_entrance datetime

  21. delete from Student where Sdept='Math'
备注:SQL第一次上机报告。
阅读(868) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~