DBMS

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

MAHARAJA MANINDRA CHANDRA COLLEGE DEPARTMENT OF COMPUTER SCIENCE

3RD YEAR DBMS LAB ASSIGNMENT NO 01

1.

Create a table with the following attributes: Column Name empno empname address dob (date of birth) doj (date of join) salary Declare empno as primary key. Type varchar2 varchar2 varchar2 date date number Width 5 10 20

2.

Insert the following records in the table: empno empname a-101 suman a-103 bobby b-101 shekhar c-101 bobby a-105 sugoutam a-104 bikas a-109 sumanta address 20 convent road p. p. colony bidhannagarh kol-66 behala cal-34 new market cal-71 p. p. colony p. p. colony dob 03/02/76 07/05/73 08/09/71 07/05/70 08/05/68 07/05/73 07/05/73 doj 05/05/03 07/05/02 07/07/02 07/05/02 03/07/02 07/05/02 07/05/02 salary 20000 12000 14000 5000 15000 11000 12000

3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.

Write SQL query to select all employee whose salary is greater than 12000. Write SQL query to see the information of all employee. Write SQL query to select all employee whose name is bobby. Write SQL query to change the salary of bikas to15000 Delete the record of the employee whose empno is a-109 Alter the table employee adds a new column category (char (1)). Alter the table employee increase the width of the column empno to 8. Write SQL column to drop a column from a table. Write a SQL that will drop multiple columns from a table. Create a read only view that will show empno, empname, address, salary Write a SQL Query to find the Average and Minimum and Sum of Salary of the Employee. Write a SQL Query to find the Maximum Salary of the employees and it will display Column as Maximum Salary. Write a SQL Query to find the Average Salary of the Employees.

Page 1 of 2

MAHARAJA MANINDRA CHANDRA COLLEGE DEPARTMENT OF COMPUTER SCIENCE


3RD YEAR DBMS LAB ASSIGNMENT NO 01

16. 17. 18. 19. 20. 21. 22.

23. 24. 25. 26. 27. 28.

Write a SQL Query which will show all employees (the empno, empname, Address) whose Salary is greater than the average Salary of the employee. Write a SQL Query to count the number of employee whose salary is greater than Rs.10000. Write a SQL Query to find the names of all employees whose name start with S And ends with n. Write a SQL Query to compute 5*6, 4 to the power 3. Write a SQL Query to find the current time. Write a SQL Query to list all employees in ascending order of their salary. Write a SQL Query that will set category to a) A if salary of employee is>20000. b) B if salary of employee is>=10000 but <20000. c) C if Salary of employee is <10000 but >=7000. d) D if salary of employee is<7000. Write a SQL Query to find all employee names in whose name there are two Consecutive o. Write a SQL Query to find sum of salary of employee grouped by category with a minimum sum of 30000. Write a SQL Query to show the list of employee whose salary is between 7000 and 15000. Write a SQL Query to show the list of employee whose category is A or B or C. Write a SQL Query to show the fields of employee separated by ,. Write a SQL Query to show employee list where empname=B.Jana and dob= 07/05/73 will be displayed as B. Jana born on seventh May 1973.

_________________

Page 2 of 2

You might also like