A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 50 companion flashcards using spaced repetition.
A database is an organized collection of structured data stored and accessed electronically from a computer system. To work with this data efficiently, applications rely on a Datab...
Inside a relational database, the table is the primary unit of structured storage. A table is composed of rows, which are individual records, and columns, which are named attribute...
Data Definition Language, or DDL, is the part of SQL used to define and manage the structure of a database, including tables, indexes, and views. The three commands at the heart of...
Data Manipulation Language, or DML, is the part of SQL used to read and change the data stored in tables. Its four main commands are SELECT for reading, INSERT for adding new rows,...
SQL is not limited to reading individual rows. Aggregate functions such as COUNT(), SUM(), AVG(), MAX(), and MIN() perform calculations across sets of rows, producing summary value...
As tables grow, raw scans become expensive, and indexes are the primary tool for speeding up lookups. An index is a data structure, much like the index at the back of a book, that...
A transaction is a unit of work that takes the database from one consistent state to another, and it must satisfy the ACID properties. Atomicity guarantees that all of the operatio...
The choice between SQL and NoSQL databases depends on the shape of the data and the demands of the application. SQL databases are relational and use a fixed schema, making them ide...