Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in sql Problem 1 1 A . What is the department name and a total credit earned by a student Boyle? Return ONLY the

Write in sql
Problem 1
1A. What is the department name and a total credit earned by a student Boyle? Return ONLY the department name and the total credit for that student.
1B. What OTHER students are in the SAME department that student Boyle is in? Display their names, IDs and total credit ordered by name in descending order. (use a sub-query)
1C. What grades has the student Boyle got in the years 2017 and 2018? List ONLY his course IDs and grades.
Problem 2
2A. Add two new students Frodo and Gandalf that just got accepted to the Marketing department. Assign IDs as 1111 and 1112, assign NULL to the number of credits.
2B. Student Gandalf started studying with 100 total credits (transferred from another university). Reflect that in the database.
2C. Student Frodo was expelled for being late too many times. Reflect that in the database. University policy for the expelled students is that their record is deleted.
Problem 3
3A. Find out how many courses are offered by each department that starts with the letter "C". Return ONLY the department name as well as the number of courses offered.
3B. What is the department(s) that offers the greatest number of courses among all the departments in the University? Return ONLY the name of this department and its number of courses offered.
Problem 4
A. Find the name, id and building of instructors whose department office is located in the building which name contains Lamb.
B. These instructors cannot be student's advisors any longer. Delete them from the table advisor using one single SQL statement (hint: use where referring to a sub-query similar to the previous one)
Problem 5
All instructors with salary lower than 40,000 are in fact new Ph.D. students in the same department, but that information is missing from the student table. Fix that problem by creating appropriate student records; use 0 credits as the total credit.

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

Step: 3

blur-text-image

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

Database 101

Authors: Guy Kawasaki

1st Edition

0938151525, 978-0938151524

More Books

Students also viewed these Databases questions