MySQL Questions
Date : 16-04-2025
Create necessary tables and insert values on your own before attempting the
following questions.
1. How do you create a database in MySQL?
2. How do you remove a column from a database?
3. How do you view a database in MySQL?
4. How to Delete Data From a MySQL Table?
5. How do you Insert Data Into MySQL?
6. How do you create a table using MySQL?
7. Write a query to sort employees by salary in descending order.
8. Write a query to count the number of employees.
9. Write a query to find the average salary.
10. Write a query to find the highest and lowest salary.
11. Write a query to calculate the total salary ?
12. Write a query to count employees
13. Write a query to join employees and departments on department_id.
14. Write a query to get employees who earn more than the average salary.
15. Write a query to get employees working in the same department as 'John'.
16. Write a query to get the second highest salary.
17. Write a query to convert student names to uppercase.
18. Write a query to convert city names to lowercase .
19. Write a query to extract the first 3 letters of student names .
20. Write a query to get the length of each student name.
21. Write a query to get the current date.
22. Write a query to get the current time.
23. Write a query to get the current date and time .
24. Write a query to calculate age by subtracting year of birth from current year.
25. Write a query to count total students .
26. Write a query to get the average marks
27. Write a query to get the total marks .
28. Write a query to get the highest marks.
29. Write a query to get the lowest marks .
30. Write a query to add 7 days to a date
31. Write a query to subtract 1 month from a date .