SQL concepts
SQL databases are made up of tables. A table is something like a CSV or spreadsheet file, in that it has rows representing individual items and columns representing data values associated with each item. A SQL table has some important differences from a spreadsheet, though:
- First, each column in the table is assigned a data type, which is strictly enforced. Just as Python will produce an error when you try to convert
"abcd"
to anint
or0.03
into adate
, a SQL database will return an error if you try to insert letters into a numeric column or decimal values into a date column. SQL databases typically support basic data types like text, numbers, dates and times, Boolean values, and binary data; in addition, some implementations have specialized data types for things like IP addresses, JSON data, currency, or images. - SQL tables can also have constraints, which further enforce the validity of data inserted into the table. For example, a column...