1 Star 0 Fork 48

段文杰/SQL Server作业仓库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
SQLQuery10.sql 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
五星好市民.林 提交于 2021-03-16 21:48 . 林程铭第5次作业
create database staff--创建职工数据库
use staff
go
create table staffinfo--创建职工数据表
(
staffid int identity primary key not null,--职工工号
staffname nvarchar(20) not null,--职工姓名
staffsex varchar(2) not null,--职工性别
staffgrate nvarchar(10) default(1) not null,--职工等级,当职工等级为一时则为新员工
staffphone nvarchar(20),--职工电话
staffadd nvarchar(max)--职工住址
);
go
---------
--使用职工数据
select * from staffinfo
go
--职工信息备份
select staffid,staffname,staffsex,staffgrate,staffphone,staffadd
into staffinfo1
from staffinfo
go
select * from staffinfo1
--添加部分新职工数据
insert into staffinfo(staffname,staffsex,staffgrate)
values('小曹','男',1),
('小李','女',1),
('小伟','男',1)
--删除旧职工数据
insert into staffinfo(staffname,staffsex,staffgrate)
values('小啥','男',1),
('小危','女',1),
('小望','男',1)
select * from staffinfo
--删除退休职工记录
delete from staffinfo where staffid=4
------------------
create table staffsalarise--创建职工工资表
(
staffsaid int identity references staffinfo(staffid) ,
staffsalarises nvarchar(8),
staffsagood nvarchar(8)
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/duan-wenjie/sql-server-job-warehouse.git
git@gitee.com:duan-wenjie/sql-server-job-warehouse.git
duan-wenjie
sql-server-job-warehouse
SQL Server作业仓库
master

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385