Hey -- I'm just learning SQL and I've been writing queries on some test data that is set up with these six tables:create table Person ( Name char (20), ID char (9) not null, Address char (30), DOB date, Primary key (ID)); create table Instructor ( InstructorID char (9) not null references Person(ID), Rank char (12), Salary integer, Primary key (InstructorID)); create table Student ( StudentID char (9) not null references Person(ID), Classification char (10), GPA double, MentorID char (9) references Instructor(InstructorID), CreditHours integer, primary key (StudentID)); create table Course ( CourseCode char (6) not null, CourseName char (50), PreReq char (6)); create table Offering ( CourseCode char(6) not null, SectionNo integer not null, InstructorID char(9) not null references Instructor(InstructorID), Primary Key (CourseCode,SectionNo)); create table Enrollment ( CourseCode char(6) NOT NULL, SectionNo integer NOT NULL, StudentID char(9) NOT NULL references Student, Grade char(4) NOT NULL, primary key (CourseCode,StudentID), foreign key (CourseCode, SectionNo) references Offering);
I'm stuck on figuring out how to do these queries though:1. Report the course with lowest enrollments -- I want to output both the course code and the number of students enrolled in that course.2. List the IDs and Mentor IDs of students who are taking some course, offered by their mentor.3. List the student id, name, and completed credit hours of all freshman born in or after 1976.Any help on these would be greatly appreciated. Thanks