Question: Under each requirement listed below, please write just ONE select, update or insert statement to meet that re- quirement. Although they are not needed, you

 Under each requirement listed below, please write just ONE select, updateor insert statement to meet that re- quirement. Although they are not

Under each requirement listed below, please write just ONE select, update or insert statement to meet that re- quirement. Although they are not needed, you may use spe cial functions in the SQL92 standard of a database vendor (identify the vendor). If you can think of more than one so lution, provide the one you consider more efficient or con- cise. Please note that a join is often a simpler alternative to a correlated sub-query. Do not worry about date formats or date conversions. NOTE: at least one solution requires a self join. The answers only involve the tables "EMPLOYEE" and "DE- PARTMENT". These tables record details of employees and departments as might be found in a typical organisation. They are defined as follows: EMPLOYEE Employee_ID number NOT NULL (primary key) Employee_Name varchar(30) NOT NULL Dept_ID number NOT NULL (foreign key to DE PARTMENT) Manager_ID number NULL (foreign key to EM- PLOYEE) Salary number NOT NULL Date_of_Birth date NOT NULL DEPARTMENT Dept_ID number NOT NULL (primary key) Dept_Name varchar(30) NOT NULL 1. List in alphabetical order the name of employees whose names begin with D' and who were born after Janu- ary 1"1980. 2. Update the salary to double its current value for every em- ployee who works in the "COMPUTER department or has the string "MC at the start of their name. 3. Add your details to the EMPLOYEE table with an Em ployee_ID one higher the existing highest. Your salary is $100,000, and you will work in the Accounts Department under 'JED TEUTOLA' (Hint: embed sub-queries in the values clause) 4. List the name of each employee and the name of his/her de- partment 5. List names of employees in the PERSONNEL' department whose salaries exceed $20,000. sa using a join: sb using a sub-query('in' or 'any' clause) 50 . using a correlated sub-query('exists' clause). 6. List the names of those departments which have more than 10 employees: 6a Using a join with a group by: 6b Using a sub query without a group by Hint: re- member COUNT(*) 7. List the name of every department giving the highest, lowest, average and total salary of its employees. 8. List the name of each employee and the name of his/her man ager. (Advice: assume managers have a Manager_ID of NULL) 9. List the name of each manager, the number of employees he/she manages, and the total and average salary of those employees. 10. Update the salary of each manager to be double the average salary of the employees he/she manages (Advice: assume managers have a Manager_ID of NULL Hint: use a sub-query]

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!