CBSE Computer Science - Revision Tour(Solved) CBSE Guess > eBooks > Class XII > CBSE Computer Science Structure Query Language Solved Revision Tour By Mr. Ravi Kiran COMPUTER SCIENCE STRUCTURED QUERY LANGUAGE DELHI 2005: (5) Consider the following tables EMPLOYEES and EMPSALARY. write SQL commands for the Statements (i) to (iv) and give outputs for SQL quires (v) to (viii).
EMPSALRAY
(i) To display Firstname, Lastname, Address and City of all employees living in Paris from the table EMPLOYEES. Ans: Select Firstname,Lastname,Address,City from Employees where City=”Paris” (ii) To display the content of EMPLOYEES table in descending order of FIRSTNAME. Ans: Select * from Employees Order By Firstname Desc (iii) To display the Firstname, Lastname, and Total Salary of all managers from the tables, where Total Salary is calculated as Salary+Benifts. Ans: Select Firstname,Lastname,Salary+Benefits from Employees, Empsalary where Designation=”Manager” and Employees.EmpId=EmpSalary.EmpId (iv) To display the Maximum salary among Managers and Clerks from the table EMPSALARY. Ans: Select Designation,max(Salary) from EmpSalary where Designation=”Manager” or Designation=”Clerk”
CBSE Computer Science Solved Revision Tour By Mr. Ravi Kiran ( [email protected] ) |
|