Having this information. Students Attribute Name Data Type StudentID char(11) FirstName varchar(20) LastName varchar(20) Gender char(1) DateofBirth date Courses Attribute Name Data Type CourseCode varchar(6) CourseName varchar(70) Level char(2) Credits int Registration Attribute Name Data Type StudentID char(11) CourseCode varchar(6) Grade decimal(2, 1) Write SQL code to: 1. Find the students who have not registered any course yet. 2. Find the student (studentID only), the sum of grade, and the average of grade, for each student who has registered courses and the average of grade is below 3. 3. Find the student who has registered the most number of courses. If there are multiple students who have registered the most number of courses, just take one student (To take only one record - the 1st record in the returned result, use ‘limit 1’ at the end of your SQL code). 4.Find the students (studentID only) who have taken either “PHY210” or “BIO001”.
Having this information.
Students
Attribute Name Data Type
StudentID char(11)
FirstName varchar(20)
LastName varchar(20)
Gender char(1)
DateofBirth date
Courses
Attribute Name Data Type
CourseCode varchar(6)
CourseName varchar(70)
Level char(2)
Credits int
Registration
Attribute Name Data Type
StudentID char(11)
CourseCode varchar(6)
Grade decimal(2, 1)
Write SQL code to:
1. Find the students who have not registered any course yet.
2. Find the student (studentID only), the sum of grade, and the average of grade,
for each student who has registered courses and the average of grade is below 3.
3. Find the student who has registered the most number of courses. If there are
multiple students who have registered the most number of courses, just take one
student (To take only one record - the 1st record in the returned result, use ‘limit 1’ at
the end of your SQL code).
4.Find the students (studentID only) who have taken either “PHY210” or
“BIO001”.
Step by step
Solved in 4 steps