Consider the table ‘PERSONS’ given below. Write commands in SQL for (i) to (iv) and write output for (v) to (vii).
Table: PERSONS
Attachments:
Answers
Answered by
12
(i) To display the SurName, FirstName and city of people residing in Udhamwara City.
- Select SurName, FirstName, City from Persons where City = 'Udhamwara';
(ii) To display the PID, City and PinCode in descending order of Pincode.
- Select PID, City, PinCode from Persons order by PinCode desc;
(iii) To display the FirstName and City of all the females getting BasicSalary above 40000.
- Select FirstName, City from Persons where Gender = 'F' and BasicSalary > 40000;
(iv) To display the FirstName and BasicSalary of all persons whose FirstName starts with 'G'.
- Select FirstName, BasicSalary from Persons where FirstName like 'G%';
(v) Output for: Select SurName from Persons where BasicSalary >= 50000;
(vi) Output for: Select Sum(BasicSalary) from Persons where Gender = 'F';
(vii) Output for: Select Gender, Min(BasicSalary) from Persons group by Gender;
(viii) Output for: Select Gender, Count(*) from Persons group by Gender;
Answered by
0
Answer:
this is your photo open this
Attachments:
Similar questions