Class - 12 CBSE Computer Science Important Output Questions 2025
Dr. Kavita has created a database for a hospital's pharmacy. The database includes a table named MEDICINE whose column (attribute) names are mentioned below:
MID: Shows the unique code for each medicine.
MED_NAME: Specifies the medicine name.
SUPP_CITY: Specifies the city where the supplier is located.
STOCK: Indicates the quantity of medicine available.
DEL_DATE: Specifies the date when the medicine was delivered.
Table: MEDICINE
| MID | MED_NAME | SUPP_CITY | STOCK | DEL_DATE |
|---|---|---|---|---|
| M01 | PARACETAMOL | MUMBAI | 200 | 2023-06-15 |
| M02 | AMOXICILLIN | KOLKATA | 50 | 2023-03-21 |
| M03 | COUGH SYRUP | BENGALURU | 120 | 2023-02-10 |
| M04 | INSULIN | CHENNAI | 135 | 2023-01-25 |
| M05 | IBUPROFEN | AHMEDABAD | 30 | 2023-04-05 |
Write the output of the following SQL Queries.
I. Select LENGTH(MED_NAME) from MEDICINE where STOCK > 100;
II. Select MED_NAME from MEDICINE where month(DEL_DATE) = 4;
III. Select MED_NAME from MEDICINE where STOCK between 120 and 200;
IV. Select max(DEL_DATE) from MEDICINE;
SQL Queries
1 Like
Answer
I.
Output
+------------------+
| LENGTH(MED_NAME) |
+------------------+
| 11 |
| 11 |
| 7 |
+------------------+
II.
Output
+-----------+
| MED_NAME |
+-----------+
| IBUPROFEN |
+-----------+
III.
Output
+-------------+
| MED_NAME |
+-------------+
| PARACETAMOL |
| COUGH SYRUP |
| INSULIN |
+-------------+
IV.
Output
+---------------+
| max(DEL_DATE) |
+---------------+
| 2023-06-15 |
+---------------+
Answered By
1 Like