CLOSE
Updated on 17 Jun, 20252 mins read 18 views

Databases are systems designed to store, organize, and manage data efficiently, enabling users and applications to retrieve, update, and analyze information.

Query Processing

When a user submits a query (e.g., SELECT * FROM Users WHERE age > 30), the DBMS:

  1. Parses & Validates: Checks syntax and table/column existence.
  2. Optimizes: Generates the most efficient execution plan (e.g., choosing indexes or join order).
  3. Executes:
    1. Reads data from disk/memory.
    2. Applies filters, joins, and aggregations.
    3. Returns results to the user.

Example Query Workflow:

SELECT name FROM Users WHERE country = 'USA' ORDER BY name;  
  • Steps:
    • Scan the Users table.
    • Filter rows where country = ‘USA’.
    • Sort results by name.
    • Return the name column.