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

SQL Queries Table Name:-Employee: Empi D Empnam E Departmen T Contactno Emailid Empheadi D

The document describes tables in a database containing employee, department, salary, project, and employee-project data. It includes sample data and 10 SQL queries to retrieve information from the tables such as selecting employees by name, counting permanent employees by salary, filtering employees by email domain, and analyzing projects by year and duration.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
292 views

SQL Queries Table Name:-Employee: Empi D Empnam E Departmen T Contactno Emailid Empheadi D

The document describes tables in a database containing employee, department, salary, project, and employee-project data. It includes sample data and 10 SQL queries to retrieve information from the tables such as selecting employees by name, counting permanent employees by salary, filtering employees by email domain, and analyzing projects by year and duration.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

SQL Queries

Table Name:- Employee

Empi EmpNam Departmen EmpHeadI


ContactNo EmailId
d e t d
123456789
101 Isha E-101 [email protected] 105
0
123456789
102 Priya E-104 [email protected] 103
0
123456789
103 Neha E-101 [email protected] 101
0
123456789
104 Rahul E-102 [email protected] 105
0
123456789 [email protected]
105 Abhishek E-101 102
0 m

Table :- EmpDept

DeptId DeptName Dept_off DeptHead


E-101 HR Monday 105
E-102 Development Tuesday 101
E-103 Hous Keeping Saturday 103
E-104 Sales Sunday 104
E-105 Purchage Tuesday 104

Table :- EmpSalary

EmpId Salary IsPermanent


101 2000 Yes
102 10000 Yes
103 5000 No
104 1900 Yes
105 2300 Yes

Table :- Project

ProjectId Duration
p-1 23
p-2 15
p-3 45
p-4 2
p-5 30

Table :- EmpProject

EmpId ProjectId ClientID StartYear EndYear


101 p-1 Cl-1 2010 2010
102 p-2 Cl-2 2010 2012
103 p-1 Cl-3 2013
104 p-4 Cl-1 2014 2015
105 p-4 Cl-5 2015
1. Select the detail of the employee whose name start with P.

2. How many permanent candidate take salary more than 5000.

3. Select the detail of employee whose emailId is in gmail.

4. Select the details of the employee who work either for department E-
104 or E-102.

5. What is the department name for DeptID E-102?

6. What is total salarythat is paid to permanent employees?

7. List name of all employees whose name ends with a.

8. List the number of department of employees in each project.

9. How many project started in year 2010.

10. How many project started and finished in the same year.

You might also like