zoukankan      html  css  js  c++  java
  • sql 语句

    create database StuInfo

    create table Course(
    Cno char(10) ,Cname char(30),Ccredit real
    )
    create table Score ([Cno] [nchar](10) NULL,
     [Sno] [char](10) NULL,
     [Grade] [real] NULL)
     CREATE TABLE Student(
     [Sno] [char](10) NOT NULL,
     [Sname] [nchar](10) NULL,
     [Sex] [char](10) NULL,
     [Birthday] [datetime] NULL,
     [Sdept] [nchar](10) NULL,
     [memo] [varchar](200) NULL)
    insert into Student values('008','过放电','男','2012-5-2','如见','')
    alter table Student add  memo varchar(200)
    alter table Student  drop column memo
    alter table Score alter column Sno char(10)
    alter table Student alter column Sno char(10) not null
    alter table Student add primary key(Sno)
    alter table Student alter column memo varchar(300)
    alter table Score ADD FOREIGN KEY(Sno)  REFERENCES  Student  (Sno)
    delete from Student where Sno='008'


    alter table Score  add constraint fk_sc1 foreign key(Sno) references Student(Sno)

  • 相关阅读:
    ref和out的区别
    final、finally、finalize的区别
    get和post的区别
    什么是事务
    锁的详细
    什么是游标
    什么是存储过程
    委托的来由
    多线程的秘密
    String str=null; 和String str=""的区别
  • 原文地址:https://www.cnblogs.com/czsl/p/2758332.html
Copyright © 2011-2022 走看看