A)  Write a query which shows the employee IDs that are unique to the employee table. Order the employee IDs in descending order. An employee ID Is the same in both tables if the integer value of the ID matches.

Database Systems: Design, Implementation, & Management
11th Edition
ISBN:9781285196145
Author:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Chapter8: Advanced Sql
Section: Chapter Questions
Problem 20P
icon
Related questions
icon
Concept explainers
Question

(A)  Write a query which shows the employee IDs that are unique to the employee table. Order the employee IDs in descending order. An employee ID Is the same in both tables if the integer value of the ID matches.

(B) We want to add a new column to the employee table. We want to provide a new column with a more complete phone number. Right now the PHONENO column only shows the last 4 digits. We want a new column which is called PHONE and consists of ###-###-####. The last 4-digits are already in the PHONENO column. The first three digits should be 416 and the next three should be 123. To improve clarity in the table, we also want to rename the PHONENO column to PHONEEXT. Show all the commands used to accomplish this, then, select all data for employees who have the last name of 'smith' (case insensitive).

(C) Show a list of employee id, names, department, years and job of any employee in the staff table who makes a total amount more than their manager or has more years of service than their manager. Make sure to include both salary and commission when calculating the total amount someone makes. Exclude staff in department 10 from the query. Order the results by department then name

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Query Syntax
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.
Recommended textbooks for you
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781285196145
Author:
Steven, Steven Morris, Carlos Coronel, Carlos, Coronel, Carlos; Morris, Carlos Coronel and Steven Morris, Carlos Coronel; Steven Morris, Steven Morris; Carlos Coronel
Publisher:
Cengage Learning
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781305627482
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr