1 Star 0 Fork 48

曾建亮/SQL Server作业仓库

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
第7次作业.sql 1.30 KB
一键复制 编辑 原始数据 按行查看 历史
方桂龙 提交于 2021-03-21 11:06 . 方桂龙第7次
create database Student
use Student
go
create table Student(
StuNO nvarchar(20) primary key,
StuName nvarchar(20),
StuAge int,
StuAddress nvarchar(20),
StuSeat int identity(1,1),
StuSex nvarchar(1),--1是男 2是女
)
insert into Student (StuNO,StuName,StuAge,StuAddress,StuSex)
values
('s2501','张秋丽',20,'美国硅谷',1),
('s2502','李斯文',18,'湖北武汉',0),
('s2503','马文才',22,'湖南长沙',1),
('s2504','欧阳俊雄',21,'湖北武汉',0),
('s2505','梅超风',20,'湖北武汉',1),
('s2506','陈旋风',19,'美国硅谷',1),
('S2507','陈风',20,'美国硅谷',0)
select*from Student
select StuNO 学生编号,StuName 姓名,StuAge 年龄,StuAddress 家庭住址,StuSex 性别, StuSeat 排序 from Student
select StuName ,StuAge ,StuAddress from Student
select StuNO,StuName,StuAddress from Student
select StuNo+'@'+StuName+StuAddress 邮箱 from Student
go
create table Exam(
examNo int identity(1,1),
StuNO nvarchar(20) references Student(StuNO),
writtenExam int,
labExam int,
)
insert into Exam(StuNO,writtenExam,labExam)
values('s2501',50,70),
('s2502',60,65),
('s2503',86,85),
('s2504',40,80),
('s2505',70,85),
('s2506',85,90)
select examNo 学号 from Exam
select 笔试=writtenExam from Exam
select labExam as 机试 from Exam
select examNO,labExam,StuNO,writtenExam from Exam
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zeng-jianliang/sql-server-job-warehouse.git
[email protected]:zeng-jianliang/sql-server-job-warehouse.git
zeng-jianliang
sql-server-job-warehouse
SQL Server作业仓库
master

搜索帮助