0% found this document useful (0 votes)
4 views12 pages

SQL Queries for Student and Employee Management

The document outlines a series of SQL tasks related to creating and manipulating student and employee tables. It includes instructions for creating tables, inserting records, displaying records based on various criteria, and performing aggregate functions. The tasks cover a range of operations such as filtering, ordering, and grouping data.

Uploaded by

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

SQL Queries for Student and Employee Management

The document outlines a series of SQL tasks related to creating and manipulating student and employee tables. It includes instructions for creating tables, inserting records, displaying records based on various criteria, and performing aggregate functions. The tasks cover a range of operations such as filtering, ordering, and grouping data.

Uploaded by

amritbba23
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Create a table student with the following fields, student-id, student- name,
address, marks;

2. Insert at least 5 records into the student table.

3. Create a table employee with fields: emp-id, emp-name, department, salary.

4. Insert 5 employee record into the employee table.


5. Display all records from the student table

6. Display student_name and marks of all students.

7. Display students whose address is Kathmandu.


8. Display employees whose salary is greater than 30000.

9. Display employees working in the ‘sales’ department.

10. Display the total number of student.s

+
+
11. Find the minimum marks obtained by students..

12. Find the maximum marks obtained by students.

13. Find the sum of all student marks.


14. Display the total number of employees in the EMPLOYEE table.

15. Display all students ordered by marks in ascending order.


16. Display all employees ordered by salary in descending order.

17. Display Student names ordered alphabetically.

18. Display employees ordered by department name.


19. Display course having more than 2 students.

20. Display department where the total salary is greater than 60000

21. Display courses where the maximum marks are greater than 80.
22. Display departments having more than 1 employee.

23. Display all students ordered by marks in ascending order.


24. Display employees ordered by salary in descending order.

25. Display students ordered by course name.

26. Display employees ordered by department and salary.


27. Display the number of students in each course, ordered by count.

28. Display the total salary of each departments , ordered by total salary in descending order.
29. Display courses where average marks are above 65.

30. Display departments where minimum salary is greater than 25000.

31. Display student details where marks are greater than 60 , ordered by marks.
32. Display employee details grouped by department having more than 2 employees, ordered by
department name.

You might also like