Assignment.2 Database
Assignment.2 Database
Q1.Attempt All Questions. (Questions from 1 to 14 carry 1 marks while 15 th and 16th questions carry 3
marks.)
1. Apply given sub query by creating the two tables Employee and Department.
SELECT emp_last_name "Last Name", emp_first_name "First Name"
FROM employee WHERE emp_ssn IN
(SELECT dep_emp_ssn FROM dependent WHERE dep_gender = 'M');
2. Select the name, job and start date of employees hired between February 20, 2000and
May 1, 2001. Order the query in ascending order by start date.
3. Display the employee name and department number of all employees in department
50 and 80 in alphabetic order by name.
4. Apply inner and Outer joins on Student, Faculty and Department Tables.
5. Display the name, salary and commission for all employees who earn commission.
Sort data in descending order of salary and commission.
6. Display the name, salary and commission of all employees whose job is CLERK or
ANALYST and their salary is not equal to $1000, $3000 or $5000.
7. Display the name concatenated with the job, separated by comma and space. Also
name the column with the label of “Employee and Title”.
8. Display the name and job of all employees where the third letter of their name is an
A.
9. Insert two rows in the employee table and generate the trigger that new rows are
inserted.
10. Apply the clustered and non -clustered indexes on the employee table attributes.
11. Create the view of the employee and department table where peter and Smith work in
CS department and department id is 40.
12. Create the view of Faculty, Student and Course table where Assistant professor teach
Web Programming, Data Structure and OS course to the BS 3rd semester students.
13. Apply joins on faculty and student tables.
14. Apply Wild Operators on student table by using the city and name attribute.
15. XML Documents, DTD, and XML Schema
16. Storing and Extracting XML Documents from Databases