1 Star 0 Fork 48

邓德城/SQL Server作业仓库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SQLQuery1.sql 2.31 KB
一键复制 编辑 原始数据 按行查看 历史
邓德城 提交于 2021-03-07 15:01 . 第三课作业
create database Studet
go
use Studet
--创建班级信息
create table Class
(
primary key(ClassID),
ClassID int identity(1,1),
ClassName nvarchar(10),
ClassTime nvarchar(20),
ClassDescribe nvarchar(500)
)
--创建学生信息
create table student
(
StudentID int identity(1,1),
primary key(StudentID),
StudentName nvarchar(20),
StudentSex nvarchar(2),
StudentAge nvarchar(2),
StudentHome nvarchar(100),
StudentClass nvarchar(2)
)
--创建课程信息
create table Course
(
CourseID int identity(1,1),
primary key(CourseID),
CourseName nvarchar(10),
CourseDescribe nvarchar(100)
)
--创建成绩信息
create table Grade
(
GradeID int identity(1,1),
primary key(GradeID),
GradeStudentID int,
foreign key(GradeStudentID) references Student(StudentID),
GradeCoursesID int,
foreign key(GradeCoursesID) references Course(CourseID),
Grade int
)
--2.
create database TestDB
on(
name='TestDB',
size=6MB,
filegrowth=1MB,
maxsize=unlimited,
filename='E:\DATA\TestDB.mdf'
),
(
name='TestDB1',
size=6MB,
filegrowth=1MB,
maxsize=unlimited,
filename='E:\DATA\TestDB1.ndf'
)
log on
(
name='TestDB_log',
size=3MB,
filegrowth=1MB,
maxsize=unlimited,
filename='E:\DATA\TestDB_log.ldf'
)
use TestDB
--创建会员类别表
create table TypenInfo
(
TypeID int identity(1,1),
primary key(TypeID),
TypeName varchar(10),
)
--创建登录用户表
create table LoginInfo
(
LoginID int identity(1,1),
LoginName nvarchar(10),
LoginPwd nvarchar(20),
Sex bit,
Birthday date,
MemberType nvarchar
)
--3.
create database Company
on(
name='Company',
size=6MB,
filegrowth=1MB,
maxsize=unlimited,
filename='E:\DATA\Company.mdf'
),
(
name='Company1',
size=6MB,
filegrowth=1MB,
maxsize=unlimited,
filename='E:\DATA\Company1.ndf'
)
log on(
name='Company_log',
size=2MB,
filegrowth=1MB,
maxsize=unlimited,
filename='E:\DATA\Company_log.ldf'
)
use Company
--创建部门信息表
create table SectionInfo
(
SectionID int identity(1,1),
primary key(SectionID),
SectionName varchar(10),
)
--创建员工信息表
create table UserInfo
(
UserNo int identity(1,1),
UserName varchar(10),
UserSex varchar(2),
UserAge int,
UserAddress varchar(50),
UserSection int,
)
--创建员工考勤表
create table WorkInfo
(
WorkID int identity(1,1),
primary key(WorkID),
UserID int,
WorkTime datetime,
WorkDescription varchar(40),
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/deng-decheng/sql-server-job-warehouse.git
[email protected]:deng-decheng/sql-server-job-warehouse.git
deng-decheng
sql-server-job-warehouse
SQL Server作业仓库
master

搜索帮助