Ⅰ 在Access2003中用sql创建这个表 创建一个“雇员”表,包括雇员号、姓名、性别、出生日期、部门、备注字段
create table 雇员(
num varchar(10) primary key,
name varchar(10),
sex varchar(2),
);
就在查询框里写,然后执行就行了。应该就可以,没装Acess2003 ,你自己试试吧!希望有帮助!
Ⅱ 如何用SQL创建一个表格
1、打开SQL Server,在数据库处,右键数据库,点击新建数据库。
Ⅲ 编写SQL语句
1,建立表
create table Employees
(
ssn varchar(50) Not null unique,
name varchar(200),
sex char(2) check (sex='男' or sex='女'),
age int check ( age>0),
Department varchar(50)
)
2,插入数据
insert into Employees (ssn,name,sex,age,department)
values('07216008','笑笑','女',24,'cs')
3,修改
update Employees set age=26 where name='笑笑' and ssn='07126008'
4,查询
select name,sex,department from Employees
5 授权
grant select on Employees to simon with grant option
Ⅳ Test数据库中,用T-SQL语句创建员工工资表,各列的要求如 下表所示
CREATE TABLE [dbo].[员工工资表](
[NO] [int] NOT NULL,
[Xm] [varchar](30) NOT NULL,
[Gz] [decimal](8, 2) NULL,
[YwJj] [decimal](8, 2) NULL,
[Sds] [decimal](8, 2) NULL,
[SfGz] AS (([Gz]+[YwJj])-[Sds]),
CONSTRAINT [PK_员工工资表] PRIMARY KEY CLUSTERED
(
[NO] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编号、主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'员工工资表', @level2type=N'COLUMN',@level2name=N'NO'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'姓名' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'员工工资表', @level2type=N'COLUMN',@level2name=N'Xm'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'工资' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'员工工资表', @level2type=N'COLUMN',@level2name=N'Gz'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'业务奖金' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'员工工资表', @level2type=N'COLUMN',@level2name=N'YwJj'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'所得税' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'员工工资表', @level2type=N'COLUMN',@level2name=N'Sds'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实发=Gz+YwJj-Sds' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'员工工资表', @level2type=N'COLUMN',@level2name=N'SfGz'
Ⅳ 建立三张表:雇员表、部门表、工作表。
create database work on ( NAME=work1, FILENAME='e:\data1.mdf', SIZE=1 MB, MAXSIZE=UNLIMITED, FILEGROWTH=15% ) LOG ON ( NAME=work2, FILENAME='d:\wordlog.ldf', SIZE=1 MB, MAXSIZE=UNLIMITED, FILEGROWTH=15% )GOCREATE TABLE gyb(gyh Varchar(4) not null primary key, xm Char(8) not null, nl SmallInt check(nl>18 and nl<55), dz Varchar(10) null , xs int check(xs >1000 and xs<50000))goCREATE TABLE bmb(bmh Char(4) not null primary key, bmm Nvarchar(5) not null unique, bmjl Varchar(8) not null)goCREATE TABLE gzb(gyh Char(4) not null primary key, bmh Char(4) not null references bmb(bmh), gznx SmallInt)这是sql2000的,直接把上面代码复制到查徇分析器中运行就可以了,关闭查徇分析器时它会提示你保存,保存成.sql,OK。