Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
38.6k views
in Computer by (79.3k points)
edited by

Consider the following table :

                          Table: PharmaDB

RxID DrugID DrugName Price Pharmacy Name Pharmacylocation
R1000 5476 Amlodipine 100.00 Rx Pharmacv Pitampura, Delhi
R1001 2345 Paracetamol 15.00 Raj Medicos Bahadurgarh, Haryana
R1002 1235 Nebistar 60.00 Mv Chemist Rajouri Garden, Delhi
R1003 6512 Vita Plus 150.00 My Chemist Curgaon, Haryana
R1004 5631 Levocitrezine 110.00 Rx Pharmacy South Extension, Delhi

Write 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.

1 Answer

+1 vote
by (76.4k points)
selected by
 
Best 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;

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...