上机一:
--INSERT dbo.Student(StudentNo,LoginPwd,StudentName,Sex,GradeId,Phone,Address,BornDate,Email)
--VALUES('S1201302001','zhangsan','张三',1,'01062768866','解放路','1997-1-1','[email protected]')
--INSERT dbo.Student(StudentNo,LoginPwd,StudentName,Sex,GradeId,Phone,Address,BornDate)
--VALUES ('S1201302002','lisi89','李四','男',1,'1381245678','长春路','1996-2-1')
--INSERT dbo.Student(StudentNo,LoginPwd,StudentName,Sex,GradeId,Phone,Address,BornDate)
--VALUES ('S11201302003',DEFAULT,'王五','男',1,'13912345678',DEFAULT,'1994-2-1')
--INSERT dbo.Student(StudentNo,LoginPwd,StudentName,Sex,GradeId,Phone,Address,BornDate,Email)
--VALUES ('S12013020104','wanglili','王丽丽','女',1,'13112345678',DEFAULT,'1994-5-3','[email protected]')
--INSERT dbo.Student(StudentNo,LoginPwd,StudentName,Sex,GradeId,Phone,Address,BornDate)
--VALUES ('S1201302005',DEFAULT,'张三','男',1,'1312345678',DEFAULT,'1991-8-8')
上机二:
SELECT TOP 1000 [Id]
,[Sname]
,[Phone]
,[Address]
,[Email]
FROM [MySchool].[dbo].[Address]
use MySchool
INSERT Address(Id,Sname,Phone,Address,Email)
VALuES (6,'王','123456','ffsd','[email protected]');
上机三:
SELECT TOP 1000 [科目名称]
,[课时]
,[所属年级]
FROM [MySchool].[dbo].[GRead]
--INSERT dbo.GRead(科目名称,课时,所属年级)
-- VALUES('走进java编程世界','40',1)
-- INSERT dbo.GRead(科目名称,课时,所属年级)
-- VALUES('HTML和CSS网页设计','60',1)
INSERT dbo.GRead(科目名称,课时,所属年级)
VALUES('C#语言和数据库技术','70',1)
上机四:
SELECT TOP 1000 [StudentNo]
,[所考科目]
,[分数]
,[考试日期分数]
FROM [MySchool].[dbo].[Table_2]
INSERT dbo.Table_2(StudentNo,所考科目,分数,考试日期分数)
VALUES ('S11201302003',1,80,'2013-9-13')
INSERT dbo.Table_2(StudentNo,所考科目,分数,考试日期分数)
VALUES ('S12010302004',1,90,'2013-9-18')
上机四/上机五:
SELECT TOP 1000 [StudentNo]
,[所考科目]
,[分数]
,[考试日期分数]
FROM [MySchool].[dbo].[Table_2]
INSERT dbo.Table_2(StudentNo,所考科目,分数,考试日期分数)
VALUES ('S11201302003',1,80,'2013-9-13')
INSERT dbo.Table_2(StudentNo,所考科目,分数,考试日期分数)
VALUES ('S12010302004',1,90,'2013-9-18')
--修改
-- UPDATE dbo.Table_2 SET 分数=10
--WHERE 分数=80
--添加
DELETE from dbo.Table_2
WHERE 分数=80