读书人

新初学者提问之一

发布时间: 2012-02-01 16:58:19 作者: rapoo

新菜鸟提问之一!
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)

读书人网 >SQL Server

热点推荐