Using SQL, develop and execute the following queries:

CMPTR
3rd Edition
ISBN:9781337681872
Author:PINARD
Publisher:PINARD
Chapter18: Maintaining And Querying A Database
Section: Chapter Questions
Problem 2QY
icon
Related questions
Question
100%
Using SQL, develop and execute the following queries:
1- For each student with GPA between 2.5 (included) and 3.5 (included), display the student's name and
id.
2- Display unique enrollments (by student's name and Course's name) of June2020 for students from the
Computer Science department.
3- Display students, by name and date of birth, sorted by GPA in descending order.
4- Display the students, by name and GPA, enrolled in the Operating SystemLs course sorted by GPA in
descending order then students' names in Ascending order.
Transcribed Image Text:Using SQL, develop and execute the following queries: 1- For each student with GPA between 2.5 (included) and 3.5 (included), display the student's name and id. 2- Display unique enrollments (by student's name and Course's name) of June2020 for students from the Computer Science department. 3- Display students, by name and date of birth, sorted by GPA in descending order. 4- Display the students, by name and GPA, enrolled in the Operating SystemLs course sorted by GPA in descending order then students' names in Ascending order.
Task Description: consider the following relations for a university:
Student
(sid: integer, sname: string, GPA: real, dateOfBirth: date)
Department (did: integer, dname: string, capacity: integer)
Course
(cid: integer, cname: string, credit: integer)
Enroll
(studentID: integer, courselD: integer, departmentID: Integer, enrollmentDate: date)
studentlD, courselD, and departmentID in Enroll are foreign keys referencing the primary keys of the
student, course, and department relations, respectively.
Transcribed Image Text:Task Description: consider the following relations for a university: Student (sid: integer, sname: string, GPA: real, dateOfBirth: date) Department (did: integer, dname: string, capacity: integer) Course (cid: integer, cname: string, credit: integer) Enroll (studentID: integer, courselD: integer, departmentID: Integer, enrollmentDate: date) studentlD, courselD, and departmentID in Enroll are foreign keys referencing the primary keys of the student, course, and department relations, respectively.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
Knowledge Booster
Single Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
CMPTR
CMPTR
Computer Science
ISBN:
9781337681872
Author:
PINARD
Publisher:
Cengage
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage