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

RUDRA IP Practical File XII

The document outlines a series of SQL queries related to two tables, EMPLOYEE and JOB, focusing on employee data management. It includes tasks such as displaying employee information based on hobbies, age, and salary, as well as modifying table structures and records. The queries aim to analyze employee demographics and financial data while ensuring data integrity and adherence to specified constraints.

Uploaded by

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

RUDRA IP Practical File XII

The document outlines a series of SQL queries related to two tables, EMPLOYEE and JOB, focusing on employee data management. It includes tasks such as displaying employee information based on hobbies, age, and salary, as well as modifying table structures and records. The queries aim to analyze employee demographics and financial data while ensuring data integrity and adherence to specified constraints.

Uploaded by

heyy.shivo
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

SQL

SQL Queries
21. With reference to the following relations (tables)
EMPLOYEE and JOB complete all the queries in your
practical file, Create following tables EMPLOYEE and JOB
Empno and Sno are not null and unique, name is never
blank, Area and Native place is valid, hobby, dept is not
empty.
TABLE: EMPLOYEE

TABLE : JOB

RUDRA
XII-F
RUDRA
XII-F
1. Show empno, name and salary of those who have Sports as
hobby.
OUTPUT :

2. Show name of the eldest employee.


OUTPUT :

3. Show number of employee area wise.


OUTPUT :

RUDRA
XII-F
4. Show youngest employees from each Native place.
OUTPUT :

5. Show Sno, name, hobby and salary in descending order of salary.


OUTPUT :

6. Show the hobbies of those whose name pronounces as ‘Abhay’.


OUTPUT :

RUDRA
XII-F
7. Show the appointment date and native place of those whose
name starts with ‘A’ or ends in ‘d’.
OUTPUT :

8. Show the salary expense with suitable column heading of those


who shall retire after 20-jan-2006.
OUTPUT :

9. Show an additional burden on the company in case the salary of


employees having a hobby as sports, is increased by 10%.
RUDRA
XII-F
OUTPUT :

10. Show the hobby of which there are 2 or more employees.


OUTPUT :

11. Show how many employee shall retire today if maximum length
of service is 20 years.
OUTPUT :

12. Show those employee name and date of birth who have served
more than 17 years as on date.
OUTPUT :
RUDRA
XII-F
13. Show names of those who earn more than all of the employees
of Sales dept.
OUTPUT :

14. Show names of those who earn more than at least one of the
employees of Marketing dept.
OUTPUT :

RUDRA
XII-F
15. Increase salary of the employees by 5 % of their present salary
with hobby as Music or they have completed atleast 3 years of
service.
OUTPUT :

16. Show the maximum salary and the hobby of employee.


OUTPUT :

RUDRA
XII-F
17. Count the number of employees in each department.
OUTPUT :

18. To display the maximum, minimum, sum and average salary of


each department.
OUTPUT :
RUDRA
XII-F
19. To display ename in lower case and job in upper case.
OUTPUT :

20. To display employees name, salary and Area of all the


employees working in Agra.
OUTPUT :

RUDRA
XII-F
21. Add a new tuple(row) in the table essentially with hobby as
Music.
OUTPUT :

22. Insert a new column email in job table


OUTPUT :

23. Create a table with values of columns empno, name, and hobby.
OUTPUT :

RUDRA
XII-F
24. Erase the records of employee from job table whose hobby is
not Sports.
OUTPUT :

25. Remove the table EMPLOYEE.

RUDRA
XII-F

You might also like