设计一个SQL Server数据库Student,在其中建立一个数据表StudentInfo
有字段学号、姓名、性别、出生日期、班级、注册日期、相片Url。向数据表中输入10条记录,(注:字段“相片Url”用来记录学生相片文件文件地址)需要详细的数据库...
有字段学号、姓名、性别、出生日期、班级、注册日期、相片Url。向数据表中输入10条记录,(注:字段“相片Url”用来记录学生相片文件文件地址)
需要详细的数据库 展开
需要详细的数据库 展开
2个回答
展开全部
我把数据库表帮你建好了 你把下面复制 然后建个Student 再查询执行下面命令表就能生成了,后面你可以再加入数据
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[StudentInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[StudentInfo](
[studentNo] [int] NOT NULL,
[Name] [varchar](50) NOT NULL,
[Sex] [varchar](50) NOT NULL,
[Birthday] [datetime] NOT NULL,
[Class] [varchar](50) NOT NULL,
[RegTime] [datetime] NOT NULL,
[PicUrl] [varchar](50) NOT NULL,
CONSTRAINT [PK_StudentInfo] PRIMARY KEY CLUSTERED
(
[studentNo] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[StudentInfo]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[StudentInfo](
[studentNo] [int] NOT NULL,
[Name] [varchar](50) NOT NULL,
[Sex] [varchar](50) NOT NULL,
[Birthday] [datetime] NOT NULL,
[Class] [varchar](50) NOT NULL,
[RegTime] [datetime] NOT NULL,
[PicUrl] [varchar](50) NOT NULL,
CONSTRAINT [PK_StudentInfo] PRIMARY KEY CLUSTERED
(
[studentNo] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
END
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询