Wednesday, 7 September 2016


Table : LabReport
SNO LabID Test PatientName Charges TestDate RepoDate Payment
1 L001 Sugar fasting Ritu Aggarwal 200 2-Feb-2016 2-Feb-2016 Cash
2 L002 TSH Simran Kaur 600 2-Feb-2016 2-Feb-2016 Credit Card
3 L003 HB Suresh Kumar 250 2-Mar-2016 2-Mar-2016 Cash
4 L004 Profile Neeta Lamba 3000 4-Feb-2016 4-Feb-2016 Credit Card
5 L005 Calcium Kiran Verma 1400 5-Feb-2016 5-Feb-2016 Credit Card
6 L002 Sugar fasting Mohit Lal 200 6-Feb-2016 6-Feb-2016 Cash
7 L002 Sugar PP Mohit Lal 250 6-Feb-2016 6-Feb-2016 Cash
8 L001 Sugar PP Ritu Aggarwal 250 2-Feb-2016 2-Feb-2016 Cash
9 L001 TSH Kamya Sachdeva 600 3-Feb-2016 3-Feb-2016 Cash
10 L001 HB Rohan Sachdeva 250 7-Feb-2016 7-Feb-2016 Cash
A. Write the SQL statements to do the following tasks : 5
1 Write the statement to create the above mentioned table
2 Display details of all female employees who are permanent in ascending order of their name
3 Display name, designation and empID of all employees who have joined in the year 2000
4 Display name,designtion and department of all employee having basicpay more than30000 and less 
than 60000
5 Display EmpID, name and Birthdate of all male employees born in the month of september
B. Write the Output generated by the following commands : 3
1 Select Left(empname,5), empID from employee where basic pay>65000;
2 Select empID as "Employee ID", empname, basicpay+1000 from employee where designation="A%";
3 update employee set status ="permanent" where year(apptdate)>2005;

No comments:

Post a Comment