Skip to content
Think & Reflect · Q6

Q.Think and list few examples from your daily life where storing the data in the database and querying the same can be helpful.

CBSENCERTSubjective· 2mImportance★★★★★
57% · 54/95 Questions
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

Databases organize real-world information so we can store it once, retrieve it efficiently, and answer questions that matter in daily life — from tracking expenses to managing school records.

Why databases matter in everyday life

A database is simply a structured way to store information so you can ask questions later. Instead of scattering data across notebooks, spreadsheets, or sticky notes, you centralize it in tables with rows and columns. The power comes from querying — writing precise questions (in SQL or through an interface) to filter, sort, aggregate, and join that data.

Think of any situation where you repeatedly need to find, count, or compare information. That is where a database shines.


Real-life examples

1. Personal expense tracker

What you store:

A table Expenses with columns Date, Category (Food, Transport, Entertainment), Amount, PaymentMode (Cash, UPI, Card).

Queries that help:

  • "How much did I spend on food this month?"
    SELECT SUM(Amount) FROM Expenses 
    WHERE Category = 'Food' AND MONTH(Date) = 11;
    
  • "Which category consumed the most money last quarter?"
    SELECT Category, SUM(Amount) AS Total 
    FROM Expenses 
    WHERE Date BETWEEN '2024-08-01' AND '2024-10-31'
    GROUP BY Category 
    ORDER BY Total DESC 
    LIMIT 1;
    

Why it beats a notebook: You can instantly see spending patterns, set budgets, and catch overspending without manually adding rows.


2. School library management

What you store:

  • Books(BookID, Title, Author, Genre, CopiesAvailable)
  • Members(MemberID, Name, Class, Phone)
  • Issues(IssueID, BookID, MemberID, IssueDate, ReturnDate)

Queries that help:

  • "Which books are currently overdue?"
    SELECT Title, Name, IssueDate 
    FROM Issues I 
    JOIN Books B ON I.BookID = B.BookID 
    JOIN Members M ON I.MemberID = M.MemberID 
    WHERE ReturnDate IS NULL AND DATEDIFF(CURDATE(), IssueDate) > 14;
    
  • "How many times was 'To Kill a Mockingbird' issued this year?"
    SELECT COUNT(*) FROM Issues I 
    JOIN Books B ON I.BookID = B.BookID 
    WHERE B.Title = 'To Kill a Mockingbird' AND YEAR(IssueDate) = 2024;
    

Why it beats a register: Instant lookups, no duplicate entries, automatic fine calculation, and you can track reading trends.


3. Online food delivery (like Swiggy/Zomato)

What you store:

  • Restaurants(RestID, Name, Cuisine, Rating, DeliveryTime)
  • Orders(OrderID, RestID, CustomerID, Items, TotalAmount, OrderTime, Status)
  • Customers(CustomerID, Name, Address, Phone)

Queries that help:

  • "Show all Italian restaurants with rating ≥ 4.0 that deliver in under 30 minutes."
    SELECT Name, Rating, DeliveryTime 
    FROM Restaurants 
    WHERE Cuisine = 'Italian' AND Rating >= 4.0 AND DeliveryTime < 30;
    
  • "What is the average order value for customer ID 1023 in the last month?"
    SELECT AVG(TotalAmount) 
    FROM Orders 
    WHERE CustomerID = 1023 AND OrderTime >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH);
    

Why it beats a spreadsheet: Millions of orders, real-time updates, personalized recommendations, and instant search.


4. Hospital appointment system

What you store:

  • Doctors(DoctorID, Name, Specialization, AvailableDays)
  • Patients(PatientID, Name, Age, Phone)
  • Appointments(AppointmentID, DoctorID, PatientID, Date, Time, Status)

Queries that help:

  • "Find all cardiologists available on Monday."
    SELECT Name FROM Doctors 
    WHERE Specialization = 'Cardiology' AND AvailableDays LIKE '%Monday%';
    
  • "How many appointments does Dr. Sharma have tomorrow?"
    SELECT COUNT(*) FROM Appointments 
    WHERE DoctorID = (SELECT DoctorID FROM Doctors WHERE Name = 'Dr. Sharma') 
      AND Date = '2024-11-16';
    

Why it beats a diary: No double-booking, automated reminders, patient history at a glance.


5. E-commerce order history (Amazon, Flipkart)

What you store:

  • Products(ProductID, Name, Category, Price, Stock)
  • Customers(CustomerID, Name, Email, Address)
  • Orders(OrderID, CustomerID, ProductID, Quantity, OrderDate, DeliveryStatus)

Queries that help:

  • "Show me all my orders from the last six months."
    SELECT O.OrderID, P.Name, O.Quantity, O.OrderDate 
    FROM Orders O 
    JOIN Products P ON O.ProductID = P.ProductID 
    WHERE O.CustomerID = 5001 AND O.OrderDate >= DATE_SUB(CURDATE(), INTERVAL 6 MONTH);
    
  • "Which product category had the highest sales in Diwali week?"
    SELECT P.Category, SUM(O.Quantity * P.Price) AS Revenue 
    FROM Orders O 
    JOIN Products P ON O.ProductID = P.ProductID 
    WHERE O.OrderDate BETWEEN '2024-10-20' AND '2024-10-27' 
    GROUP BY P.Category 
    ORDER BY Revenue DESC 
    LIMIT 1;
    

Why it beats a receipt box: Instant refunds, trend analysis, personalized ads, inventory management.


6. Fitness tracker (steps, calories, workouts)

What you store: …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.