# For this assignment, use the university database use university; # This assignment involves more than one table. # It would be very helpful to review the content in each table so you know how they are related. select * from instructor; select * from teaches; select * from course; select * from department; select * from student; select * from takes; # Write SQL statement to complete the following tasks # 1. Find the lowest salary of any instructor # 2. Find the names of all instructors earning the lowest salary (there may be more than one with the same salary). # 3. Find all instructors whose salary information is not null # 4. List the instructor names and the course title that an instructor has taught. # Remove duplicate. Sort by instructor name alphabetically. # Hint: you need the data from three tables: instructor, teaches, course. Expect 14 rows. # 5. Using the IN keyword, list all course titles that are taught by Mozart and Srinivasan. # Hint: you need the data from three tables: instructor, teaches, course. Expect 4 rows. # 6. For each department, find the maximum salary of instructors in that department. # You may assume that every department has at least one instructor. # 7. Find the lowest, across all departments, of the per-department maximum salary computed by the preceding query. # Give the resulting column a meaningful name, like "lowest_dept_cap". # Hint: MySQL asks each derived table to have its own alias. That is, you need to give alias to subqueries. # 8. Write an SQL query to find the names and budgets of those departments # whose budget is higher than that of Music. List them by budget from lowest to highest. # Hint: department budget is stored in department table, expect 4 rows. # 9. Find the number of department that is located in any building. # In result list only building names and the number of department in that bulding. # Hint: query the department table. Expect 4 rows # 10. Based on previous query, list only buildings that have at least 2 departments in it # 11. For each student who has taken a course at least twice, # show the student's ID and the course ID. # Hint: use takes table, think first how you can list how many times a student has taken a course

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
# For this assignment, use the university database use university; # This assignment involves more than one table. # It would be very helpful to review the content in each table so you know how they are related. select * from instructor; select * from teaches; select * from course; select * from department; select * from student; select * from takes; # Write SQL statement to complete the following tasks # 1. Find the lowest salary of any instructor # 2. Find the names of all instructors earning the lowest salary (there may be more than one with the same salary). # 3. Find all instructors whose salary information is not null # 4. List the instructor names and the course title that an instructor has taught. # Remove duplicate. Sort by instructor name alphabetically. # Hint: you need the data from three tables: instructor, teaches, course. Expect 14 rows. # 5. Using the IN keyword, list all course titles that are taught by Mozart and Srinivasan. # Hint: you need the data from three tables: instructor, teaches, course. Expect 4 rows. # 6. For each department, find the maximum salary of instructors in that department. # You may assume that every department has at least one instructor. # 7. Find the lowest, across all departments, of the per-department maximum salary computed by the preceding query. # Give the resulting column a meaningful name, like "lowest_dept_cap". # Hint: MySQL asks each derived table to have its own alias. That is, you need to give alias to subqueries. # 8. Write an SQL query to find the names and budgets of those departments # whose budget is higher than that of Music. List them by budget from lowest to highest. # Hint: department budget is stored in department table, expect 4 rows. # 9. Find the number of department that is located in any building. # In result list only building names and the number of department in that bulding. # Hint: query the department table. Expect 4 rows # 10. Based on previous query, list only buildings that have at least 2 departments in it # 11. For each student who has taken a course at least twice, # show the student's ID and the course ID. # Hint: use takes table, think first how you can list how many times a student has taken a course
AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution

Knowledge Booster
SQL Query
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education