Home > database >  Great god advice on how to write the SQL statement of personal, small white one
Great god advice on how to write the SQL statement of personal, small white one

Time:10-10

CodePudding user response:

 SELECT Student. Sno, Student, Sname, course. Name 
The FROM Student
The JOIN scores
ON Sno=scores. Sno
The JOIN Course
ON Cno=scores. Cno
WHERE sudent. Name='zhang'

CodePudding user response:

reference 1/f, February 16 response:
 SELECT Student. The Sno, Student, Sname, course. Name 
The FROM Student
The JOIN scores
ON Sno=scores. Sno
The JOIN Course
ON Cno=scores. Cno
WHERE sudent. Name='zhang'

Thank you, but also have to add the name of the table before sno and cno ON student. The sno=scores. The sno ON course. The cno=scores. Cno

CodePudding user response:

reference 1/f, February 16 response:
 SELECT Student. The Sno, Student, Sname, course. Name 
The FROM Student
The JOIN scores
ON Sno=scores. Sno
The JOIN Course
ON Cno=scores. Cno
WHERE sudent. Name='zhang'

The second what to do, a great god, and ask for advice

CodePudding user response:

 SELECT dbo. Student. Sno, name, t1. Ccount FROM (
SELECT TOP 10 * FROM (
SELECT sno, COUNT (1) the AS ccount FROM scores
T1) t ORDER BY tc count DESC) JOIN dbo. Student ON t.s no=dbo. Student. Sno
Next:o
  • Related