Tuesday 4 November 2014

SQLite3 Quirks

CHAR & VARCHAR do not exist

VARCHAR gets treated as TEXT

Primary Keys get some additional automagic functionality when they are INTEGER
 1) They autoincrement
plus Something Weird?




Monday 3 November 2014

Reminder of the b******g obvious in SQL



1) Foreign Key : a column (or a combination of columns) whose values match a Primary Key in a different table.

i.e. There has to be a Primary Key in this table which matches the foreign key in that table (or vice versa)

Someone else's looser definition:
A foreign key is a column (or columns) that references a column (most often the primary key) of another table. The purpose of the foreign key is to ensure referential integrity of the data. In other words, only values that are supposed to appear in the database are permitted.

i.e attributes in table A must hold a value listed in table B


2) All values in a Primary Key have to be unique