Relational Database Management Systems (PostgreSQL, MySQL, SQLite) store data in structured tables containing rows (records) and columns (attributes). The SELECT statement specifies which columns to retrieve, FROM indicates the source table, and WHERE filters records matching strict criteria.
Entity state & role in architecture: Table: students (10,000 rows)
-- Query high-performing students enrolled in Computer Science
SELECT
student_id,
first_name,
last_name,
gpa,
enrollment_year
FROM students
WHERE major = 'Computer Science'
AND gpa >= 3.8
ORDER BY gpa DESC
LIMIT 5;SELECT student_id, first_name ...Projects only the required column fields rather than expensive SELECT *.
WHERE major = 'CS' AND gpa >= 3.8Applies boolean predicate logic to filter rows.
ORDER BY gpa DESC LIMIT 5;Sorts highest first and caps payload to the top 5 records.