Home > database >  Sql server
Sql server

Time:09-29

Of raw material "0169" class student id, name and the optional course gate number, average,
(beginner, want to ask you, thank you)

CodePudding user response:

Probably mean it
 SELECT student id, 
Name,
COUNT (1) AS gate number,
AVG (mark) AS average
FROM the students watch
The JOIN elective table
Table ON students. Student id=elective courses table. Student id
GROUP BY student id,
The name;