Saturday, June 6, 2020

31. Perform a query using alter command to drop/add field and a constraint in Employee table. (COMPANY DATABASE NAVATHE BOOK)

31. Perform a query using alter command to drop/add field and a constraint in Employee table. (COMPANY DATABASE NAVATHE BOOK)

30. Delete an employee from Employee table with ssn = „12345‟( make sure that this employee has some dependents, is working on some project, is a manager of some department and is supervising some employees). Check and display the cascading effect on Dependent and Works on table. In Department table MGRSSN should be set to default value and in Employee table SUPERSSN should be set to NULL(COMPANY DATABASE NAVATHE BOOK)

30. Delete an employee from Employee table with ssn = „12345‟( make sure that this employee has some dependents, is working on some project, is a manager of some department and is supervising some employees). Check and display the cascading effect on Dependent and Works on table. In Department table MGRSSN should be set to default value and in Employee table SUPERSSN should be set to NULL(COMPANY DATABASE NAVATHE BOOK)

29. Delete all dependents of employee whose ssn is „123456789‟.(COMPANY DATABASE NAVATHE BOOK)

29. Delete all dependents of employee whose ssn is „123456789‟.(COMPANY DATABASE NAVATHE BOOK)

28. Insert a record in Project table which violates referential integrity constraint with respect to Department number. Now remove the violation by making necessary insertion in the Department table.(COMPANY DATABASE NAVATHE BOOK)

28. Insert a record in Project table which violates referential integrity constraint with respect to Department number. Now remove the violation by making necessary insertion in the Department table.(COMPANY DATABASE NAVATHE BOOK)

27. For each department having more than 10 employees, retrieve the department no, no of employees(COMPANY DATABASE NAVATHE BOOK) drawing more than 40,000 as salary.

27. For each department having more than 10 employees, retrieve the department no, no of employees(COMPANY DATABASE NAVATHE BOOK) drawing more than 40,000 as salary.


26. Change the location and controlling department number for all projects having more than 5 employees to „Bellaire‟ and 6 respectively.(COMPANY DATABASE NAVATHE BOOK)

26. Change the location and controlling department number for all projects having more than 5 employees to „Bellaire‟ and 6 respectively.(COMPANY DATABASE NAVATHE BOOK)



25. For each project, retrieve the project number, the project name, and the number of employees who work on that project.(COMPANY DATABASE NAVATHE BOOK)

25. For each project, retrieve the project number, the project name, and the number of employees who work on that project.(COMPANY DATABASE NAVATHE BOOK)


24. For each department, retrieve the department number, the number of employees in the department, and their average salary.(COMPANY DATABASE NAVATHE BOOK)

24. For each department, retrieve the department number, the number of employees in the department, and their average salary.(COMPANY DATABASE NAVATHE BOOK)


23. Select the names of employees whose salary is greater than the average salary of all employees in department 10.(COMPANY DATABASE NAVATHE BOOK)

23. Select the names of employees whose salary is greater than the average salary of all employees in department 10.(COMPANY DATABASE NAVATHE BOOK)


22. Find the sum of the salaries and number of employees of all employees of the „Marketing‟ department, as well as the maximum salary, the minimum salary, and the average salary in this department.(COMPANY DATABASE NAVATHE BOOK)

22. Find the sum of the salaries and number of employees of all employees of the „Marketing‟ department, as well as the maximum salary, the minimum salary, and the average salary in this department.(COMPANY DATABASE NAVATHE BOOK)