Answered step by step
Verified Expert Solution
Link Copied!

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(50),
Age INT,
GPA FLOAT );
CREATE TABLE Courses (
CourseID INT PRIMARY KEY,
CourseName VARCHAR(50));
CREATE TABLE Enrollments (
EnrollmentID INT PRIMARY KEY,
StudentID INT,
CourseID INT,
Grade FLOAT,
FOREIGN KEY (StudentID) REFERENCES Students(StudentID),
FOREIGN KEY (CourseID) REFERENCES Courses(CourselD));
Solve the following SQL problems by nesting queries.
Write an SQL query to find the names of students who are enrolled in the
course 'Mathematics' and have a GPA greater than 3.5.
Assuming the same database schema, write an SQL 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 25.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

What are the main objectives of Inventory ?

Answered: 1 week ago

Question

Explain the various inventory management techniques in detail.

Answered: 1 week ago