You are a database engineer and the client wants you to solve the following business problem for a database system: "For each course find the number of students that got a grade of 90% or better. Show the title of the courses and the average GPA of all the students in those courses (taking into account only students with GPA greater than 3.0)* After analyzing the problem, you came up with two possible queries that may lead to the correct output: "SELECT Course.title as Course, avg(Student.gpa) as StudentGPA FROM Student, Enrollment, Course WHERE Course.id = Enrollment.course_id AND Student.id = Enrollment.student_id AND Course.name = "CSC675" AND Enrollment.grade >= 90 GROUP BY Course.title HAVING StudentGPA > 3.0"; "SELECT Course.title as Course, avg(Student.gpa) as Student GPA FROM Student JOIN Enrollment ON Student.id = Enrollment.student_id JOIN Course ON Course.id = Enrollment.course_id WHERE Course.name = X AND Enrollment.grade >= 90 AND StudentGPA > 3.0 GROUP BY Course.title"; Which of the queries is the one that will output the correct data for this business problem? a. None of them b. Both of them c. The first query d. The second query
You are a database engineer and the client wants you to solve the following business problem for a database system: "For each course find the number of students that got a grade of 90% or better. Show the title of the courses and the average GPA of all the students in those courses (taking into account only students with GPA greater than 3.0)* After analyzing the problem, you came up with two possible queries that may lead to the correct output: "SELECT Course.title as Course, avg(Student.gpa) as StudentGPA FROM Student, Enrollment, Course WHERE Course.id = Enrollment.course_id AND Student.id = Enrollment.student_id AND Course.name = "CSC675" AND Enrollment.grade >= 90 GROUP BY Course.title HAVING StudentGPA > 3.0"; "SELECT Course.title as Course, avg(Student.gpa) as Student GPA FROM Student JOIN Enrollment ON Student.id = Enrollment.student_id JOIN Course ON Course.id = Enrollment.course_id WHERE Course.name = X AND Enrollment.grade >= 90 AND StudentGPA > 3.0 GROUP BY Course.title"; Which of the queries is the one that will output the correct data for this business problem? a. None of them b. Both of them c. The first query d. The second query
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question

Transcribed Image Text:You are a database engineer and the client wants you to solve the following business problem for a database system: "For each course find the number of students that got a grade of 90% or better. Show the title of the courses
and the average GPA of all the students in those courses (taking into account only students with GPA greater than 3.0)*
After analyzing the problem, you came up with two possible queries that may lead to the correct output:
"SELECT Course.title as Course, avg(Student.gpa) as StudentGPA FROM Student, Enrollment, Course WHERE Course.id = Enrollment.course_id AND Student.id = Enrollment.student_id AND Course.name = "CSC675" AND
Enrollment.grade >= 90 GROUP BY Course.title HAVING StudentGPA > 3.0";
"SELECT Course.title as Course, avg(Student.gpa) as Student GPA FROM Student JOIN Enrollment ON Student.id = Enrollment.student_id JOIN Course ON Course.id = Enrollment.course_id WHERE Course.name = X AND
Enrollment.grade >= 90 AND StudentGPA > 3.0 GROUP BY Course.title";
Which of the queries is the one that will output the correct data for this business problem?
a. None of them
b. Both of them
c. The first query
d. The second query
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps

Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education