Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write SQL queries to solve the following problems. We will be using the university database. All queries should involve only the instructor table. After you

Write SQL queries to solve the following problems. We will be using the university database. All queries should involve only the instructor table. After you are done, save your work as .sql file and turn in the .sql file into Moodle for grading.
Write a SQL statement to display all columns using the SQL asterisk (*) wild-card character.
Write a SQL statement to display ID and name of the instructors (ID appears first).
Write a SQL statement to display department names.
Write a SQL statement to display unique department names. (expect 7 rows returned)
Write a SQL statement to display all info about instructors having a salary greater than 75000.(expect 6 rows returned)
Write a SQL statement to display department name, instructor name, and salary for instructors that have a salary less than 70000. Sort the results in ascending order by department name. (expect 4 rows returned)
Write a SQL statement to display name, department name, and salary for instructors that have a salary less than 90000 and are in the department of History. Sort the results in ascending order by department name and in descending order by salary. (expect 2 rows returned)
Write an SQL statement to display ID, name, and salary for all instructors having a salary greater than 61000 and less than 80000.(expect 4 rows returned)
Write a SQL statement to show everything for all instructor with an ID starting with 76.(expect 2 rows returned) Note: The ID field of the instructor table is a varchar type instead of int to make this query valid.
Write a SQL statement to show ID and name for all instructors with a department name that includes the word Sci.(expect 3 rows returned)
Write a SQL statement to show ID and name for all instructors with an a in the second position from the left in their names. (expect 2 rows returned)
Format

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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions