Consider the following relations: Students Name Type Netld VARCHAR(10) FirstName VARCHAR(255) LastName VARCHAR(255) Department VARCHAR(100) Enrollments Notes and Hints: Name Type Netld VARCHAR(10) CRN INT Credits INT Score REAL • Do not use views. Courses Name CRN Title Type INT We want to nominate "STAR" students for a scholarship. STAR students are students who scored at least 90% of the highest score in a course they took. For example, if a student took 'CS101' and the highest score in this course was 99, then the student would be considered STAR if their score in 'CS101' was at least 90% of 99, i.e., 89.1. STAR students do not have to score high in all of thier courses. As long as they satisfy this criterion for at least one course, we want them on our list. VARCHAR(255) Department VARCHAR(100) Instructor VARCHAR(255) Write an SQL query that returns, for every STAR student, the student's NetId, LastName and the average Score (as AverageScore) of this student (taken across all courses that the student is enrolled in). While calculating the average score, weight the scores by the credits of the courses. That is, AverageScore = [ (Score * Credits) / Σ (Credits). Finally, ROUND AverageScore to the nearest 2 digits using a call to ROUND (???, 2). Return the results in the decreasing order of AverageScore and increasing order of NetId.

Oh no! Our experts couldn't answer your question.

Don't worry! We won't leave you hanging. Plus, we're giving you back one question for the inconvenience.

Submit your question and receive a step-by-step explanation from our experts in as fast as 30 minutes.
You have no more questions left.
Message from our expert:
Thank you for taking the time to provide feedback! Please let us know more here so we will not miss it. We have credited a question to your account.
Your Question:
Consider the following relations:
Students
Name
Type
Netld
VARCHAR(10)
FirstName VARCHAR(255)
LastName VARCHAR(255)
Department VARCHAR(100)
Enrollments
Notes and Hints:
Name Type
Netld VARCHAR(10)
CRN INT
Credits INT
Score REAL
• Do not use views.
Courses
Name
CRN
Title
Type
INT
We want to nominate "STAR" students for a scholarship. STAR students are students who scored at least
90% of the highest score in a course they took. For example, if a student took 'CS101' and the highest score
in this course was 99, then the student would be considered STAR if their score in 'CS101' was at least 90%
of 99, i.e., 89.1. STAR students do not have to score high in all of thier courses. As long as they satisfy this
criterion for at least one course, we want them on our list.
VARCHAR(255)
Department VARCHAR(100)
Instructor
VARCHAR(255)
Write an SQL query that returns, for every STAR student, the student's NetId, LastName and the average
Score (as AverageScore) of this student (taken across all courses that the student is enrolled in). While
calculating the average score, weight the scores by the credits of the courses. That is, AverageScore = [
(Score * Credits) / Σ (Credits). Finally, ROUND AverageScore to the nearest 2 digits using a call to
ROUND (???, 2).
Return the results in the decreasing order of AverageScore and increasing order of NetId.
Transcribed Image Text:Consider the following relations: Students Name Type Netld VARCHAR(10) FirstName VARCHAR(255) LastName VARCHAR(255) Department VARCHAR(100) Enrollments Notes and Hints: Name Type Netld VARCHAR(10) CRN INT Credits INT Score REAL • Do not use views. Courses Name CRN Title Type INT We want to nominate "STAR" students for a scholarship. STAR students are students who scored at least 90% of the highest score in a course they took. For example, if a student took 'CS101' and the highest score in this course was 99, then the student would be considered STAR if their score in 'CS101' was at least 90% of 99, i.e., 89.1. STAR students do not have to score high in all of thier courses. As long as they satisfy this criterion for at least one course, we want them on our list. VARCHAR(255) Department VARCHAR(100) Instructor VARCHAR(255) Write an SQL query that returns, for every STAR student, the student's NetId, LastName and the average Score (as AverageScore) of this student (taken across all courses that the student is enrolled in). While calculating the average score, weight the scores by the credits of the courses. That is, AverageScore = [ (Score * Credits) / Σ (Credits). Finally, ROUND AverageScore to the nearest 2 digits using a call to ROUND (???, 2). Return the results in the decreasing order of AverageScore and increasing order of NetId.
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY