Questions of SQL Assignment
Questions of SQL Assignment
Questions of SQL Assignment
FALL 2022
Assignment
Course Code: CL-1000 Course Name: Intro to Info & Comm. Technologies
Instructor Name: Tooba Qazi Total Marks : 10
Q1. What is the main difference between Primary Key, Unique Key, and Foreign Key?
Q2. What is the purpose of a JOIN statement? Also, explain the different types of JOIN
clauses supported in SQL.
Q3. What are the main points that differentiate between the “delete”, “truncate” and “drop”
commands?
1. Create table for workers, Titles and Bonus, don’t forget to mention data type. Sample is
attached.
2. Insert same values in all three tables as above.
3. Write an SQL query to fetch “FIRST_NAME” from Worker table using the alias name as
<WORKER_NAME>.
4. Write an SQL query to fetch “FIRST_NAME” from Worker table in upper case.
5. Write an SQL query to fetch unique values of DEPARTMENT from Worker table.
6. Write an SQL query to print all Worker details from the Worker table order by
FIRST_NAME Ascending.
7. Write an SQL query to print all Worker details from the Worker table order by
FIRST_NAME Ascending and DEPARTMENT Descending.
8. Write an SQL query to print details for Workers with the first name as “Vipul” from
Worker table.
9. Write an SQL query to print details of the Workers whose FIRST_NAME contains ‘s’.
10. Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘a’.
11. Write an SQL query to fetch the count of employees working in the department ‘Admin’.
12. Write an SQL query to print details of the Workers whose SALARY greater than 100000.