1 Star 0 Fork 48

路人/SQL Server作业仓库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SQLQuery5.sql 1.53 KB
一键复制 编辑 原始数据 按行查看 历史
五星好市民.林 提交于 2021-03-07 17:45 . 林程铭第3次作业
--创建数据库
create database company
on primary
(
--主数据文件参数设置
name='company',
filename='C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\company.mdf',
size=5MB,
filegrowth=1MB,
maxsize=unlimited
),
(
--次数据文件参数设置
name='company',
filename='C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\company1.ndf',
size=5MB,
filegrowth=1MB,
maxsize=unlimited
),
filegroup group1
(
--日志文件参数设置
name='company_log',
filename='C:\Program Files\Microsoft SQL Server\MSSQL12.SQLEXPRESS\MSSQL\DATA\company.ldf',
size=2MB,
filegrowth=10%,
maxsize=unlimited
)
------------------------
--创建数据表
--创建部门信息表
create table sectionInfo
(
sectionID int identity(1,1) primary key,
sectionName varchar(10) not null
)
--创建员工信息表
create table userInfo
(
userNO int identity(1,1) primary key not null,
userName varchar(10) unique not null,
userSex varchar(2) not null,--(只能填写男女)
userAge int check(userAge>=1 and userAge<=100),--(范围在1-100之间)
uesrAddress varchar(50) default('湖北'),
userSection int references sectioninfo(sectionid)
)
--创建员工考勤表
create table workInfo
(
workId int identity(1,1) primary key,
userId int references userinfo(userNo) not null ,
workTime datetime not null,
workDescription varchar(40) not null check(workDescription='迟到' or workDescription='早退' or workDescription='旷工' or workDescription='病假' or workDescription='事假')
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/passers-bye/sql-server-job-warehouse.git
git@gitee.com:passers-bye/sql-server-job-warehouse.git
passers-bye
sql-server-job-warehouse
SQL Server作业仓库
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385