InterviewSolution
Saved Bookmarks
| 1. |
Consider the following table : Table: PharmaDBRxIDDrugIDDrugNamePricePharmacy NamePharmacylocationR10005476Amlodipine100.00Rx PharmacvPitampura, DelhiR10012345Paracetamol15.00Raj MedicosBahadurgarh, HaryanaR10021235Nebistar60.00Mv ChemistRajouri Garden, DelhiR10036512Vita Plus150.00My ChemistCurgaon, HaryanaR10045631Levocitrezine110.00Rx PharmacySouth Extension, DelhiWrite commands in SQL for (i) to (iv):(i) To increase the price of "Amlodipine" by 50.(ii) To display all those medicines whose price is in the range 100 to 150.(iii) To display the Maximum price offered by pharmacy located in "Gurgaon"(iv) To display the Drug ID, DrugName and Pharmacy Name of all the records in descending order of their price. |
|
Answer» (i) Update PharmaDB set Price = price+50 Where DrugName = "Amlodipine"; (ii) Select * From PharmaDB where price between 100 and 150; (iii) Select Max(Price) from pharmaDB where Pharmacylocation like "% Gurgaon %" ; (iv) Select Drug ID, DrugName, pharmacyName from PharmaDB order by price desc; |
|