Question: Write the SQL code for each given query. Use the prompt and ERD below 1. List the minimum GPA, average GPA, and maximum GPA for
Write the SQL code for each given query. Use the prompt and ERD below

1.
| List the minimum GPA, average GPA, and maximum GPA for all students. The headers for your three aggregate fucntions should be MIN_GPA, AVG_GPA, and MAX_GPA. |
2.
| Write a query to calculate the total credit hours taught in Fall 2002 (i.e., number of students enrolled in each class in Fall 2002 times the number of credit hours for the class). Assume that each course is 3 credits. The header for the total credit hours should be named HOURS. |
3.
| The student ID, first name, last name, and major of every student. |
4.
| The student ID, first name, last name, and major of every student who has a last name of Smith. |
5.
| The student ID, first name, last name, major, and GPA of all ACTG majors. |
6.
| The student ID, first name, last name, major, rank, and GPA of all students with a GPA at or above 3.0 in order from the highest GPA to the lowest GPA. |
7.
| The last name and first name of all seniors. |
8.
| Write a query to return the average GPA of all seniors. The header for the column with the average GPA should be named AVG_GPA. |
9.
| Write a query to return the number of students who have received an A or a B. The header for the column with the number of students should be named NUM_STUDENTS. |
Students PK SID Courses PK CourseNum H- Name Credits Sections PK Term OPK IndexNum Enrollments FK1 CourseNum Days PK,FK1SID StartTime Faculty HOPK,FK2 Term EndTime PK,FK2 IndexNum --- Location PK FID FK2 Instructor Grade Name Phone Last First Middle Major Sex Phone Birthday GPA Rank
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
