Question: Please answer completely and correctly. 1. Consider the following schema of an EMPLOYEE database and answer the questions that follow: DEPARTMENTS (DEPARTMENT ID, DEPARTMENT-NAME, MANAGER-ID,

 Please answer completely and correctly. 1. Consider the following schema of
Please answer completely and correctly.

1. Consider the following schema of an EMPLOYEE database and answer the questions that follow: DEPARTMENTS (DEPARTMENT ID, DEPARTMENT-NAME, MANAGER-ID, LOCATION-ID); EMPLOYEES (EMPLOYEE ID, FIRST NAME, LAST_NAME, EMAIL, PHONE NUMBER, HIRE DATE, JOB ID, SALARY, COMMISSION PCT, MANAGER ID, DEPARTMENT ID) LOCATIONS (LOCATION ID, STREET ADDRESS, POSTAL CODE, CITY, STATE PROVINCE, COUNTRY ID) It is up to you to decide on the appropriate data types to use for the various fields in the three tables listed above. 1.1) Write a single SQL query to list all employees' FIRST NAME, LAST NAME, PHONE NUMBER, HIRE DATE, DEPARTMENT ID, with results fitered by DEPARTMENT ID 50 and sorted by LAST NAME and FIRST NAME 1.2) What is the likely data sparsity of the DEPARTMENT ID column? How about LAST NAME and FIRST, NAME? 1.3) Should you create index(es) for the query? Why or 2. Consider the following query hy or why not? If yes, write the required SQL statement(s) to create index(es). SELECT LAST NAME, FIRST, NAME, HIRE DATE, to charHIRE DATE, 'ww) AS HIRE YEAR FROM EMPLOYEES WHERE to char(HIRE DATE, wy)-2006 Note that the to_char) function returns the year portion of HIRE DATE 2.1) What is the likely data sparsity of the HIRE DATE column? 2.2) Should you create any index to improve the above query? Why or why not? 2.3) What type of database /O operations will likely be used by the query? Your answer should be based on what action you take in b). answer should be based on what action you tak

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!