Test数据库中,用T-SQL语句创建员工工资表,各列的要求如 下表所示
展开全部
CREATE TABLE dbo.员工工资
(
No int NOT NULL IDENTITY (1, 1),
Xm varchar(30) NOT NULL,
Gz decimal(8, 2) NOT NULL,
YwJj decimal(8, 2) NOT NULL,
Sds decimal(8, 2) NOT NULL,
SfGz AS Gz+YwJj-Sds
) ON [PRIMARY]
GO
DECLARE @v sql_variant
SET @v = N'员工工资'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'员工工资', NULL, NULL
GO
DECLARE @v sql_variant
SET @v = N'编号'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'员工工资', N'COLUMN', N'No'
GO
DECLARE @v sql_variant
SET @v = N'姓名'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'员工工资', N'COLUMN', N'Xm'
GO
DECLARE @v sql_variant
SET @v = N'工资'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'员工工资', N'COLUMN', N'Gz'
GO
DECLARE @v sql_variant
SET @v = N'业务奖金'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'员工工资', N'COLUMN', N'YwJj'
GO
DECLARE @v sql_variant
SET @v = N'所得税'
EXECUTE sp_addextendedproperty N'MS_Description', @v, N'SCHEMA', N'dbo', N'TABLE', N'员工工资', N'COLUMN', N'Sds'
GO
ALTER TABLE dbo.员工工资 ADD CONSTRAINT
PK_员工工资 PRIMARY KEY CLUSTERED
(
No
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE dbo.员工工资 SET (LOCK_ESCALATION = TABLE)
GO
ZESTRON
2024-09-04 广告
2024-09-04 广告
表界面分析在材料科学及化学领域占据核心地位,它深入探索物质表面与界面的微观结构、化学组成及相互作用。通过电商平台射线光电子能谱(电商平台PS)、扫描电子显微镜(SEM)及原子力显微镜(AFM)等先进技术手段,我们Dr. O.K. Wack ...
点击进入详情页
本回答由ZESTRON提供
展开全部
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'
[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'
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询