Hey there SQL MASTERS, here are some questions i was posed in an interview/assessment thing, dunno how well i did....Coud u answer these questions? i dont know how easy/difficut they are for u, all i know is that i had SERIOUS trouble with them! thanks alot!EMPLOYEEEmployee_id number NOT NULL (Primary Key)Employee_name VarChar(30) NOT NULL Dept_id number NOT NULL (Foreign Key to DEPARTMENT)Manager_id number NOT NULL (Foreign Key to EMPLOYMENT)Salary number NOT NULLDate_of_Birth date NOT NULLDEPARTMENTDept_id number NOT NULL (Primary Key)Dept_name (varchar30) NOT NULLAbove is the info given...Following are some of the questions posed....i.e we had to write the code using SELECT, UPDATE, INSERT etc...1. Update the salary to double its current value for every employee who worksin the COMPUTER department or has the string MC at the start of their name.2. Add your details (John Smith for example)to the EMPLOYEE table with an Employee_id one higher than the exsisting highest. Your Salary is $100,000 and you will work in the accounts department under \'Jed Teolut\' (Hint: Embed Subqueries in the values clause).3. List the name of each employee and the name of his/her department... I thought it was this.... am i right?SELECT Employee_name, Dept_idFROM EMPLOYEEORDER BY 2, 3;4. List names of employees in PERSONNEL dept whose salarie exceed $20,000a) using a joinb) sub-query (\'in\' or \'any\' clause)c) Using a correlated (exists clause)5. Update the salary of each manager to be double the average salary of the employees he/she manages (assume manager have a manager_id of NULL sub-query)6. List the highest salary, the lowest salry, the average salary and the total salaries of employees.
-
Interview Candidate
- Dec 6th, 2005
- 7
- 4797
Showing Answers 1 - 7 of 7 Answers
Related Answered Questions
Related Open Questions
Hey there SQL MASTERS, here are some questions i was posed in an interview/assessment thing, dunno how well i did....Coud u answer these questions? i dont know how easy/difficut they are for u, all i know is that i had SERIOUS trouble with them! thanks alot!EMPLOYEEEmployee_id number NOT NULL (Primary Key)Employee_name VarChar(30) NOT NULL Dept_id number NOT NULL (Foreign Key to DEPARTMENT)Manager_id number NOT NULL (Foreign Key to EMPLOYMENT)Salary number NOT NULLDate_of_Birth date NOT NULLDEPARTMENTDept_id number NOT NULL (Primary Key)Dept_name (varchar30) NOT NULLAbove is the info given...Following are some of the questions posed....i.e we had to write the code using SELECT, UPDATE, INSERT etc...1. Update the salary to double its current value for every employee who worksin the COMPUTER department or has the string MC at the start of their name.2. Add your details (John Smith for example)to the EMPLOYEE table with an Employee_id one higher than the exsisting highest. Your Salary is $100,000 and you will work in the accounts department under \'Jed Teolut\' (Hint: Embed Subqueries in the values clause).3. List the name of each employee and the name of his/her department... I thought it was this.... am i right?SELECT Employee_name, Dept_idFROM EMPLOYEEORDER BY 2, 3;4. List names of employees in PERSONNEL dept whose salarie exceed $20,000a) using a joinb) sub-query (\'in\' or \'any\' clause)c) Using a correlated (exists clause)5. Update the salary of each manager to be double the average salary of the employees he/she manages (assume manager have a manager_id of NULL sub-query)6. List the highest salary, the lowest salry, the average salary and the total salaries of employees.
Related Answered Questions
Related Open Questions