当前位置: 代码迷 >> Sql Server >> 新初学者提问之一
  详细解决方案

新初学者提问之一

热度:227   发布时间:2016-04-27 19:28:28.0
新菜鸟提问之一!
sql2000,查询分析器里:
输入“create database student;"新建一个数据库,我接下来想在这个数据库中新建一个表,应该怎么写,
create table Student(Sno int primary key,Sname char(8) unique,Ssex char(2),Sage smallint);
谢谢各位大侠!

------解决方案--------------------
建表:
SQL code
create table A(姓名 nvarchar(10),工资 int)insert A select '小王',    2000union all select       '小张',    1200union all select       '小非',    2000union all select       '小赵',    5000union all select       '大张',    5000union all select       '大非',    4000union all select       '大赵',    6000
------解决方案--------------------
create database student

use student

create table Student(Sno int primary key,Sname char(8) ,Ssex char(2),Sage smallint)
  相关解决方案