Given the following relational schema (Hint: the bold text represents a primary key), Department (dept_code, dept_name, emp_num, dept_address, dept_ext) Student(stu_num, stu_fname, stu_lname, stu_dob, stu_class, stu_gpa, emp_num, dept_code) Write the SQL statement to list all department names their highest GPA of the student in the department. The result must have two columns: dept_name and "max GPA" and is ranked from the highest GPA value to the lowest one
Given the following relational schema (Hint: the bold text represents a primary key),
Department (dept_code, dept_name, emp_num, dept_address, dept_ext)
Student(stu_num, stu_fname, stu_lname, stu_dob, stu_class, stu_gpa, emp_num, dept_code)
Write the SQL statement to list all department names their highest GPA of the student in the department.
The result must have two columns: dept_name and "max GPA" and is ranked from the highest GPA value to the lowest one
From the above question, we have the condition as ,dept_code and stu_num are primary keys that means they have unique values.We have two tables named Departmet and Student.The table Department contains the attributes as dept_code,dept_name, emp_num, dept_address, dept_ext.The table Student contains the attributes as stu_num, stu_fname, stu_lname, stu_dob, stu_class, stu_gpa, emp_num, dept_code.
Step by step
Solved in 3 steps with 1 images