Answered step by step
Verified Expert Solution
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
For each Computer Sciences class, print the cno, sectno and the average gpa of the students enrolled in the class. pts
Print the course names, course numbers and section numbers of all classes with less than six students enrolled in them. pts
Print the names of departments that have one or more majors who are under years old. pts
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, eg an empty string, as hisher 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. pts
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. pts
Print the names of students who are taking both a Computer Sciences course and a Mathematics course. pts
Print the age difference between the oldest and youngest Computer Sciences majors pts
For each department that has one or more majors with a GPA under print the name of the department and the average GPA of its majors. pts
Print the ids, names, and GPAs of the students who are currently taking all of the Civil Engineering courses. pts
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started