Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

SQL+Assignment

Uploaded by

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

SQL+Assignment

Uploaded by

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

Problem Statement:

Consider yourself to be Sam, who is in his first semester of college. You have a course named
DBMS and have been given an assignment to complete over the weekend. You have to answer
the questions below to get good grades in the assignment.

Datasets Used:

Employee:

Roles:

Q1. Implement Inner Join on the ‘Employee’ and ‘Roles’ tables. The inner join
needs to be on the basis of ‘empCode’ column. The result should have
‘empName’ from Employee table and ‘designation’ from roles table.

Q.2 From the above resultant table, order the rows on the basis of ‘empName’
column.

Q3. Implement Left Join on the ‘Employee’ and ‘Roles’ tables. The left join needs
to be on the basis of ‘empCode’ column. The result should have ‘empName’ and
‘city’ from Employee table and ‘designation’ and ‘department’ from roles table.

Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.
Q4. From the above resultant table, order the rows on the basis of ‘department’
column.

Q.5 Implement Right Join on the ‘Employee’ and ‘Roles’ tables. The Right join
needs to be on the basis of ‘empCode’ column. The result should have
‘empCode’, ‘state’ and ‘salary’ from Employee table and ‘department’ and
‘managerCode’ from roles table.

Q6. From the above resultant table, order the rows on the basis of ‘salary’
column.

Q.7 Write a sub-query in SQL to extract all records from employee table where
country is equal to ‘India’

Q.8 Write a sub-query in SQL to extract all records from employee table table
where department is not equal to ‘Content’

Proprietary content. © Great Learning. All Rights Reserved. Unauthorized use or distribution prohibited.

You might also like