Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

-Person (Name, ID, Address, DOB) - Instructor (InstructorID, Rank, Salary) - Stu

ID: 3626360 • Letter: #

Question


-Person (Name, ID, Address, DOB)
- Instructor (InstructorID, Rank, Salary)
- Student (StudentID, Classification, GPA, MentorID, CreditHours)
-Course (CourseCode, CourseName, PreReq)
-Offering (CourseCode, SectionNo, InstructorID)
- Enrollment (CourseCode, SectionNo, StudentID, Grade)
Note:PreReq=Pre-Requirest

From the SQL tables commands above,use the English statement below the write SQL statements
(a). List the name and rank for mentors of all freshmen.
(b). Find the total salary of all instructors who are offering some courses.
(c). List all the names and DOBs of students who were born in 1978. The expression "Year(x.DOB) = 1978", checks if x is born in the year 1978.
(d). List the mentor names of students who has got at least three A's in his/her grades.

Explanation / Answer

a)select Person.name,Instructor.rank from Person,Instructor where Person.ID=Instructor.InstructorID

b) Select sum(Salary) from Instructor,Offering where Instructor.InstructorID=Offering.InstructorID

c)select Person.name,DOB from Person,Student where Person.ID=Student.StudentID and Year(Person.DOB) = 1978

d)select from Person,Instructor where 3=>(select count(Grade) from Instructor,Offering,Enrollment where Instructor.InstructorID=Offering.InstructorID and Offering.CourseCode=Enrollment.CourseCode and Grade='A')