Course Hero Logo

Query 13 create a temporary table named temp1 whose

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 12 - 17 out of 17 pages.

Query 13. Create a temporary table named TEMP_1 whose structure is composed of the EMP_2 attributesEMP_NUM and EMP_PCT.
Query 14. Write the SQL code required to list all employees whose last names start with Smith. In other words, therows for both Smith and Smithfield should be included in the listing. (Hint: Use LIKE operator).
Query 15. Write the SQL code to find the average bonus percentage in the EMP_2 table
Query 16. Write the SQL code that will produce a listing for the data in the EMP_2 table in ascending order by thebonus percentage. (ORDER BY clause)
Query 17. Write the SQL code that will list only the distinct project numbers found in the EMP_2 table.
Query 18. Write the SQL code to calculate the ASSIGN_CHARGE values in the ASSIGNMENT. ASSIGN_CHARGE is aderived attribute that is calculated by multiplying ASSIGN_CHG_HR by ASSIGN_HOURS.UPDATE ASSIGNMENT SET ASSIGN_CHARGE = ASSIGN_CHG_HR * ASSIGN_HOURS;SELECT * from ASSIGNMENT;
Query 19. Write a query to produce the total number of hours and charges for each of the projects represented inthe ASSIGNMENT table. The output is shown in Figure P7.23.Figure P7.23 Total hour and charges by projectAnswer to the Query 19:SELECT ASSIGNMENT.PROJ_NUM, Sum(ASSIGNMENT.ASSIGN_HOURS) AS SumOfASSIGN_HOURS,Sum(ASSIGNMENT.ASSIGN_CHARGE) AS SumOfASSIGN_CHARGEFROM ASSIGNMENTGROUP BY ASSIGNMENT.PROJ_NUM
Query 20. Write the SQL code to generate the total hours worked and the total charges made by all employees. Theresults are shown in Figure P7.24.This is a nested query.
End of preview. Want to read all 17 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
N/A
Tags
SQL code, Smithfield, William Smithfield

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture