Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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,

image text in transcribed
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

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_2

Step: 3

blur-text-image_3

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions

Question

What are the priorities for change?

Answered: 1 week ago