代码拉取完成,页面将自动刷新
select Sno,Sname,Smajor from Student
select Sname,Sbirthdate,Smajor from Student
SELECT Sno
FROM SC
GROUP BY Sno//按学号分组
HAVING COUNT(Cno) >=3
select SUM(Grade)Sum_credit from Student s left join SC on s.Sno='20180001'
select Sno,Sname from Student where Smajor like '%信息系统%'
select Sname from Student where Sname not like '%刘%'
DATEDIFF(year,Sbitthday.GETDATE())
select Sname from Student where DATEDIFF(year,Sbirthdate,GETDATE()) < 20 and Smajor like'计算机'
INSERT INTO Student (Sno, Sname, Ssex, Sbirthdate)
VALUES ('20180009', '李刚', '男', '2001-5-6');
select Sname from Student where DATEDIFF(year,Sbirthdate,GETDATE()) < 20
SELECT COUNT(*) AS TotalStudents
FROM Student
WHERE Sbirthdate >= '2000-01-01';
SELECT COUNT(*) AS TotalStudents
FROM Student
WHERE Sbirthdate >= '2000-01-01';
select * ,DATEDIFF(year,Sbirthdate,GETDATE()) as sage from Student where Sbirthdate >= '2000-01-01';
SELECT Sname
FROM Student
WHERE Sno IN (SELECT Sno FROM Sc WHERE Grade >= 80);
SELECT *
FROM Student
WHERE Sbirthdate >= '2000-01-01' AND Sbirthdate <= '2001-12-31';
SELECT Sname,Ssex
FROM Student
WHERE Smajor <> '信息管理与系统' AND Smajor <> '计算机科学与技术';
SELECT COUNT(*) AS Scount
FROM Student
WHERE DATEDIFF(year,Sbirthdate,GETDATE()) > 20
SELECT *
FROM Student
WHERE Sname LIKE '王__';
update SC set grade=NULL where sno=20180001 and cno=81001
select * from Student s left join SC sc on s.Sno = sc.sno order by Smajor asc,Sbirthdate desc
select Cno,COUNT(1)as hehe from Student s left join SC sc on s.Sno = sc.sno where Cno is not null group by Cno
select AVG(Grade)avg_grade from student s left join SC on s.Sno = SC.Sno where Cno = '81001'
SELECT Cno
FROM Course
GROUP BY Cno;
update [Student] set Sbirthdate = DATEADD(YEAR,1,Sbirthdate) where Ssex = '女'
SELECT MAX(Grade) AS max_grade
FROM Sc
WHERE Cno = 81001;
select distinct Sno from sc
SELECT COUNT(DISTINCT Sno) AS Scount
FROM sc;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。