What is a database system?
A database management system (DBMS) stores data so it can be queried, updated and shared safely. Most use the relational model: data sits in tables of rows and columns, linked by keys, and is queried with SQL.
PostgreSQL, MySQL, Oracle, SQL Server and SQLite are relational. NoSQL systems such as MongoDB, Redis and Cassandra trade some guarantees for flexible schemas or massive scale.
Ask the table a question
SQL is declarative: you describe the result you want, and the database works out how to get it. Click the clauses and watch the query and its answer change.
SELECT name, city, scoreFROM studentsWHERE city = 'Leeds'ORDER BY score DESC;
Scan everything, or use an index?
Without an index, finding one customer means checking rows one by one. A B-tree index is like a library catalogue: a short, wide tree where each node points to around a hundred children. Grow the table and compare.