May 2019
Intermediate to advanced
542 pages
13h 37m
English
SQL databases are made of relations, also known as tables. A table is a two-dimensional data structure made of rows and columns. Each row in the table represents a single item about which we have information, and each column represents a type of information we are storing.
Tables are defined using the CREATE TABLE command, like so:
CREATE TABLE coffees ( id INTEGER PRIMARY KEY, coffee_brand TEXT NOT NULL, coffee_name TEXT NOT NULL, UNIQUE(coffee_brand, coffee_name) );
The CREATE TABLE statement is followed by a table name and a list of column definitions. In this example, coffees is the name of the table we're creating, and the column definitions are inside the parentheses. Each column has a name, a data type, and any number ...
Read now
Unlock full access