I am new to PLSQL and I have to answer three questions to which I tried my best but i could not do it any more please help.
Here are the tables and the data:
TABLE FACULTY_P( faculty_id, fac_name, office, salary);
TABLE STUDENT_P( student_id, std_name, home_phone, total_credits, gpa, advisor_id );
TABLE COURSE_P( course#, credit_hours, location, faculty_id);
TABLE ENROLLMENT_P(student_id, course#, grade);
Here is the first question:
Give the student name and the gpa for the student with the highest gpa than all colleagues with the same total credit hours,
I wrote the following: select std_name, gpa
from student_p s, course_p c1, course_p c2
where c1.credit_hours = c2. credit_hours
I wrote several statement none of them worked.
For each student name the list course numbers that the student obtained the lowest grade
Iwrote the following: select course# from Enrollment_p e1, Enrollment_p e2 where e1.course# = e2.course# and e1.grade < e2.grade;
Statement not working either.
Third question: Give the names of faculty who do not advise any students.
I wrote: select fac_name from faculty_p f, student_p s where
f.faculty_id <> s.advisor_id;
Not working either.
Please i need your help it is urgent that i solve this before tuesday.
Thank you for your help