[go: up one dir, main page]

0% found this document useful (0 votes)
11 views3 pages

DB Practice

The document outlines several database tables related to employees, departments, salaries, projects, countries, clients, and employee assignments to projects. It includes specific queries to retrieve employee details based on criteria such as name, email, department, and salary. Additionally, it provides insights into the number of permanent employees and projects initiated in a particular year.

Uploaded by

uh123465
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views3 pages

DB Practice

The document outlines several database tables related to employees, departments, salaries, projects, countries, clients, and employee assignments to projects. It includes specific queries to retrieve employee details based on criteria such as name, email, department, and salary. Additionally, it provides insights into the number of permanent employees and projects initiated in a particular year.

Uploaded by

uh123465
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Table Name: Employee

Em
EmpName Department ContactNo EmailId EmpHeadId
pid
123456789
101 Isha E-101 isha@gmail.com 105
0
123456789
102 Priya E-104 priya@yahoo.com 103
0
123456789
103 Neha E-101 neha@gmail.com 101
0
123456789
104 Rahul E-102 rahul@yahoo.com 105
0
123456789
105 Abhishek E-101 abhishek@gmail.com 102
0

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
PId Duration
p-1 23
p-2 15
p-3 45
p-4 2
p-5 30

Table : Country
cid cname
c-1 India
c-2 USA
c-3 China
c-4 Pakistan
c-5 Russia

Table : ClientTable

ClientId ClientName cid


cl-1 ABC Group c-1
cl-2 PQR c-1
cl-3 XYZ c-2
cl-4 tech altum c-3
cl-5 mnp c-5

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

Queries:
1. Select the detail of the employee whose name start with P.
2. How many permanent candidates 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. Select the details of the employee who work either for
department E-104 or E-102.
6. What is total salary that is paid to permanent employees?
7. How many project started in year 2010.
8. How many project started in year 2010.

You might also like