0% found this document useful (0 votes)
5 views2 pages

My SQL Questions (1 Table)

The document outlines a SQL assignment focused on a Teacher relation with various tasks, including querying, inserting, updating, and displaying data. Specific SQL commands are required to retrieve information about teachers based on different criteria such as department, gender, age, and salary. Additionally, it includes tasks to manipulate the table structure and perform aggregate functions.

Uploaded by

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

My SQL Questions (1 Table)

The document outlines a SQL assignment focused on a Teacher relation with various tasks, including querying, inserting, updating, and displaying data. Specific SQL commands are required to retrieve information about teachers based on different criteria such as department, gender, age, and salary. Additionally, it includes tasks to manipulate the table structure and perform aggregate functions.

Uploaded by

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

ONE TABLE SQL ASSIGNMENT

MY SQL ASSIGNMENT

Write SQL commands for all on the basis of Teacher relation given below.

gend
No Name Age Department Date OF Join Salary
er
1. Jigal 34 Computer 10/01/97 12000 M
2. Sharmila 31 History 24/03/98 20000 F
3. Sandeep 32 Maths 12/12/96 30000 M
4. Sangeeta 35 History 01/07/99 40000 F
5. Rakesh 42 Maths 05/09/97 25000 M
6. Shyam 50 History 27/02/97 30000 M
7. Shiv NULL NULL NULL NULL NULL
8. Om 44 Computer 25/02/97 21000 M
9. Shalakha 33 Maths 31/07/97 20000 F

1. To show all information about the teacher of history department.


2. To list the names of female teachers who are in Maths department
3. To list names of all teachers with their date of joining in ascending order.
4. To display teachers name, age department and salary for male teacher only
5. To count the number of teachers with age>23.
6. To insert a new row in the teacher table with the following data:
9,”raja”,26,”computer”,13/05/95,2300,”m”.
7. To insert a new row in the teacher table with the following data: 19,”amit kumar”.
8. To show all information about the teachers in this table
9. Add a new column named “Address” with size 50
10. Arrange the whole table in the alphabetical order to name
11. Display the age of the teachers whose name starts with ‘S’.
12. Display name and age in ascending order using age
13. Count number of departments present in table
14. Count number of record’s present in table

15. Display sum of all salaries


16. Display avg of all salaries
17. Display min and max salary
18. Display all record whose gender female
19.Display all name from department of History and Maths .
20. Display age between 35 to 50
21. Display distinct departments
22. Display distinct age

23. Display distinct salary


24. Count number of teachers from math’s dept
25. Update age by 2 which age grater then 40.
26. Display all record where name start with ‘O’
27. Display all record where name start with ‘R’
28. Display name and age in descending order.
GIVE THE OUTPUT OF FOLLOWING STATEMENT:
29. select count(distinct department) from teacher.
30. select max(age)from teacher where gender=”f”
31. select avg(salary) from teacher where dateofjoin<12/07/96
32. select sum(salary) from teacher where dateofjoin<12/07/96
33. select sysdate from dual;
34. select name from teacher where name like “%a”;
35. select min(salary) from teacher;
36. select department, count(*) from teacher where count(*)<2;
37. select name, age ,gender from teacher where age >45;
38. select distinct(salary) from teacher group by department;
39. select distinct(age) from teacher group by age;
40. select distinct(gender)

You might also like