0% found this document useful (0 votes)
4 views

Medical_Shop_Management_System_MySQL_Outputs

Uploaded by

maharshirajput15
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Medical_Shop_Management_System_MySQL_Outputs

Uploaded by

maharshirajput15
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Medical Shop Management System - MySQL Outputs

1. Adding Data to Medicines Table

SQL Query:

INSERT INTO Medicines (MedicineID, Name, Quantity, Price, ExpiryDate)

VALUES ('M021', 'Antibiotic', 50, 10.00, '2025-12-31');

Output (after SELECT * FROM Medicines):

+------------+------------+----------+-------+------------+

| MedicineID | Name | Quantity | Price | ExpiryDate |

+------------+------------+----------+-------+------------+

| M001 | Paracetamol| 50 | 1.50 | 2024-12-31 |

| M002 | Ibuprofen | 30 | 2.00 | 2024-10-15 |

| M021 | Antibiotic | 50 | 10.00 | 2025-12-31 |

+------------+------------+----------+-------+------------+

2. Recording a Sale

SQL Queries:

INSERT INTO Customers (Name, Contact) VALUES ('John Doe', '9876543210');

INSERT INTO Sales (MedicineID, CustomerID, QuantitySold, DateOfSale)

VALUES ('M001', 1, 5, '2024-12-03');

UPDATE Medicines SET Quantity = Quantity - 5 WHERE MedicineID = 'M001';

Output (after SELECT * FROM Sales):


+--------+------------+------------+--------------+------------+

| SaleID | MedicineID | CustomerID | QuantitySold | DateOfSale |

+--------+------------+------------+--------------+------------+

| 1 | M001 | 1 | 5 | 2024-12-03 |

+--------+------------+------------+--------------+------------+

3. Viewing Remaining Medicines

SQL Query:

SELECT * FROM Medicines;

Output:

+------------+------------+----------+-------+------------+

| MedicineID | Name | Quantity | Price | ExpiryDate |

+------------+------------+----------+-------+------------+

| M001 | Paracetamol| 45 | 1.50 | 2024-12-31 |

| M002 | Ibuprofen | 30 | 2.00 | 2024-10-15 |

| M021 | Antibiotic | 50 | 10.00 | 2025-12-31 |

+------------+------------+----------+-------+------------+

You might also like