USE [lichangtong] GO /****** Object: Table [dbo].[Student] Script Date: 06/07/2023 15:23:36 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[Student]( [Sno] [char](9) NOT NULL, [Sname] [char](20) NULL, [Ssex] [char](2) NULL, [Sage] [smallint] NULL, [Sdept] [char](20) NULL, PRIMARY KEY CLUSTERED ( [Sno] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY], UNIQUE NONCLUSTERED ( [Sname] 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 SET ANSI_PADDING OFF GO
时间: 2024-01-01 19:04:08 浏览: 224
将count(*)值写入另一个表中的方法
这段代码是创建了一个名为"Student"的表,该表包含了Sno、Sname、Ssex、Sage和Sdept五个列。其中Sno是主键,不为空;Sname列可以为空,但是其值必须是唯一的,因此在该代码中还定义了一个非聚集唯一索引索引来保证这个要求。Ssex、Sage和Sdept三个列都可以为空。该表用于存储学生的信息。
阅读全文