0% found this document useful (0 votes)
41 views

Dbms File Index

This document contains 27 queries related to creating, populating, and manipulating tables in an Oracle database. The queries create EMP and DEPT tables, insert data, display structure and contents, perform various selections and updates, add/drop columns, add constraints, and derive computed values from the tables.

Uploaded by

maanish singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

Dbms File Index

This document contains 27 queries related to creating, populating, and manipulating tables in an Oracle database. The queries create EMP and DEPT tables, insert data, display structure and contents, perform various selections and updates, add/drop columns, add constraints, and derive computed values from the tables.

Uploaded by

maanish singh
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Serial No. Query Page No.

1 Create an Employee and Department table named EMP and DEPT 1


with declaration of primary and foreign key.

2 Insert values in the DEPT and EMP tables. 1-4

3 List all the data from the EMP and DEPT tables. 4-5

4 List all the tables created in the Oracle Database. 5-9

5 Display the structure of EMP and DEPT tables 9

6 List all Employee's name and salaries from the EMP table. 10

7 List the all information about the Employee's whose salary 10-11
is more than 20000

8 List the name and salary of all Employees whose salary is 11


more than 20000.

9 List the jobs of all Employee's from the EMP table. 11

10 List the Employee number , Employee name and salary in 11-12


ascending order of salary.

11 Delete all records from the EMP table. 12-13

12 Delete the record of all Photographers from the EMP table. 13-15

13 Update the Commission column of each Employee to 500. 15

14 Update the department number of Employee 'Vipul' to 10. 15-16

15 Alter table EMP and add a new column Contact number. 16

16 Alter table EMP and delete the column Contact number. 16-17

Serial No. Query Page No.


17 Update the Emp_No column to size 4 in the EMP table. 17

18 Rename the column Job to Job_Type in the EMP table. 17

19 Rename the EMP table to EMPLOYEE table. 17

20 Delete the EMPLOYEE table. 17-18

21 Add unique key on Hire_date in the EMPLOYEE table. 18

22 Alter the Job_type column in EMPLOYEE table and add NOT NULL 18
constraint.

23 Add CHECK UPPER constraint on the Emp_name column in 20


EMPLOYEE table.

24 Derive the Employee name, Salary, Provident Fund, House Rent 20


Allowance, Dearness Allowance and Gross from the EMPLOYEE
table.

25 List the name of employees who served for more than 2 years 21
in the organisation from the EMPLOYEE table.

26 List the name of employees who are eligible for Commission 21


from the EMPLOYEE table.

27 List all details of employees whose Salary is greater than 21-22


20000 and commission IS NOT NULL.

You might also like