sql server安装及使用全流程(图文详解)

  Use Master;

  GO

  CREATE Database MyDatabase1;

  GO

  Use MyDatabase1;

  GO

  CREATE TABLE student

  (

  学号 char(8) PRIMARY KEY,

  姓名 varchar(8) NOT NULL,

  性别 char(2) CHECK( 性别 = '男' OR 性别 = '女'),

  成绩 numeric(4,1) CHECK( 成绩 >= 0 AND 成绩 <= 100)

  );

  GO

  INSERT INTO student VALUES('20102001',' 阎妮','女', 98);

  INSERT INTO student VALUES('20102002',' 张有来','男', 58);

  INSERT INTO student VALUES('20102003',' 王文喜','男', 72);

  INSERT INTO student VALUES('20102004',' 赵敏','女', 66);

  INSERT INTO student VALUES('20102005',' 罗莎','女', 88.5);

  INSERT INTO student VALUES('20102006',' 蒙恬','男', 93);

  GO