Q. Consider the following table and answer the questions that follow.
Table: TEACHER
ID | Name | Department | Hiredate | Category | Gender | Salary |
---|---|---|---|---|---|---|
1 | Tanya Nanda | SocialStudies | 1994-03-17 | TGT | F | 25000 |
2 | Saurabh Sharma | Art | 1990-02-12 | PRT | M | 20000 |
3 | Nandita Arora | English | 1980-05-16 | PGT | F | 30000 |
4 | James Jacob | English | 1989-10-16 | TGT | M | 25000 |
5 | Jaspreet Kaur | Hindi | 1990-08-01 | PRT | F | 22000 |
6 | Disha Sehgal | Math | 1980-03-17 | PRT | F | 21000 |
7 | Sonali Mukherjee | Math | 1980-11-17 | TGT | F | 24500 |
Write the command/output for the following:
(a) To display all information about the teacher of PGT category.
(b) To list the names of female teachers of Hindi department.
(c) To list names, departments and date of hiring of all the teachers in ascending order of date of joining.
(d) To count the number of teachers in English Department.
(e) Display the department and hire date of all the female teachers whose salary is more than 25000.
(f) Display the list of teachers whose name starts with J.
(g) select count(*) from TEACHER where Category='PGT';
(h) select avg(salary) from TEACHER group by Gender;
Answer :-
(a) Select * from Teacher where category= “PGT” ;
(b) Select Name from Teacher where gender = “F” and department = “Hindi” ;
(c) Select name, department, hiredate from Teacher order by hiredate ;
(d) Select count(*) from Teacher where Department = “English” ;
(e) Select Department , hiredate from Techer where gender = “F” and salary > 25000 ;
(f) Select * from Teacher name like “J%” ;
(g)
count(*) |
---|
1 |
(h)
avg(salary) |
---|
24500 |
22500 |
how to Insert the given records into the table from the table
ReplyDeleteinsert into table_2
DeleteSelect * from table_1 ;
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )