Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A . Queries ( Student Database ) Write SQL queries that answer the questions below ( one query per question ) . The query answers

A. Queries (Student Database)
Write SQL queries that answer the questions below (one query per question). The query answers must not contain duplicates, but you should use the SQL keyword distinct ONLY when necessary. Submit both the queries (text form) and the screen shot of the execution of each query including the returned results. Your queries will be graded based on both the correctness and the succinctness. If your query does not compile at all, no point will be awarded.
Questions
1. For each Computer Sciences class, print the cno, sectno, and the average gpa of the students enrolled in the class. (6 pts)
2. Print the course names, course numbers and section numbers of all classes with less than six students enrolled in them. (8 pts)
3. Print the names of departments that have one or more majors who are under 18 years old. (8 pts)
4. Print the names and majors of students who are taking one of the College Geometry courses. For students who do not have a major, print out some special string, e.g., an empty string, as his/her major. (Hint: You'll need to use the "like" predicate and the string matching character in your query. You also likely need to use SET operations.)(12 pts)
5. For those departments that have no majors taking a College Geometry course, print the department name and the number of PhD students in the department. (12 pts)
6. Print the names of students who are taking both a Computer Sciences course and a Mathematics course. (12 pts)
7. Print the age difference between the oldest and youngest Computer Sciences major(s).(10 pts)
8. For each department that has one or more majors with a GPA under 1.0, print the name of the department and the average GPA of its majors. (15 pts)
9. Print the ids, names, and GPAs of the students who are currently taking all of the Civil Engineering courses. (15 pts)

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

More Books

Students also viewed these Databases questions

Question

Evaluate the integral. dt t4 + 2

Answered: 1 week ago