Theory Questions
1. What is SQL?
2. What is the difference between DBMS and RDBMS?
3. What is a Primary Key? Can a table have more than one?
4. What is a Foreign Key?
5. Difference between WHERE and HAVING clause?
6. What are JOINs? Name different types.
7. What is normalization? Why is it important?
8. Explain GROUP BY and ORDER BY clauses.
9. What is a View? Why do we use it?
10. What are Aggregate Functions? Name a few.
SQL Practical Questions
1️⃣ Create a table for storing employee details.
• Fields: EmpID, EmpName, Designation, Salary, City.
2️⃣ Insert at least 5 records into the Employee table.
3️⃣ Display all employees who are working as 'Developer'.
4️⃣ Display employees whose salary is more than 3️0,000.
5⃣ Display employee names in alphabetical order.
6️⃣ Find the total number of employees in each city.
7️⃣ Find the employee(s) with the highest salary.
8️⃣ Update the salary of an employee with EmpID = 3️ to 4️5,000.
9️⃣ Delete all records where the city is 'Pune'.
Create another table called Department
• Fields: DeptID, DeptName, EmpID.
1️⃣1️⃣ Write a query to display employee names along with their department names (using JOIN).
1️⃣2️⃣ Find the average salary of all employees.
1️⃣3️⃣ Write a query to fetch records of employees whose names start with ‘A’.
1️⃣4️⃣ Show the number of employees working as 'Tester'.
1️⃣5⃣ Select all employees whose names end with 'n'.
1️⃣6️⃣ Write a query to list employees, ordered by Salary (highest to lowest).
1️⃣7️⃣ Write a query to count the number of employees in each Designation.
1️⃣8️⃣ Write a query to display only distinct City names from the employee table.