Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider a database schema with the following tables: CREATE TABLE Students ( StudentID INT PRIMARY KEY, Name VARCHAR ( 5 0 ) , Age INT,
Consider a database schema with the following tables:
CREATE TABLE Students
StudentID INT PRIMARY KEY,
Name VARCHAR
Age INT,
GPA FLOAT ;
CREATE TABLE Courses
CourseID INT PRIMARY KEY,
CourseName VARCHAR;
CREATE TABLE Enrollments
EnrollmentID INT PRIMARY KEY,
StudentID INT,
CourseID INT,
Grade FLOAT,
FOREIGN KEY StudentID REFERENCES StudentsStudentID
FOREIGN KEY CourseID REFERENCES CoursesCourselD;
Solve the following SQL problems by nesting queries.
Write an query to find the names of students who are enrolled in the
course 'Mathematics' and have a GPA greater than
Assuming the same database schema, write an query to find the average
GPA of students who have enrolled in the course 'Physics'.
Extend the previous query to find the average GPA of students who have
enrolled in the course 'Physics' and whose age is less than
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started