public
Created

  • Download Gist
gistfile1.sql
SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
-- using SQLite3
-- create the table
CREATE TABLE census_data (
image_ref TEXT,
line_number INT,
forenames TEXT,
surname TEXT,
relationship TEXT
);
 
-- load the Tucker data
INSERT INTO census_data VALUES (12345,1,"Richard","Tucker","farther");
INSERT INTO census_data VALUES (12345,2,"Sarah Ann","Tucker","mother");
INSERT INTO census_data VALUES (12345,3,"Elizabeth Hannah",NULL,"daughter");
INSERT INTO census_data VALUES (12345,4,"Ellen Lewis",NULL,"daughter");
 
-- load the Smith data
INSERT INTO census_data VALUES (67890,1,"Richard","Smith","farther");
INSERT INTO census_data VALUES (67890,2,"Sarah Ann","Smith","mother");
INSERT INTO census_data VALUES (67890,3,"Elizabeth Hannah",NULL,"daughter");
INSERT INTO census_data VALUES (67890,4,"Ellen Lewis",NULL,"daughter");
 
-- I'm almost 100% sure you can fill in the missing surnames in pure
-- SQL, it just escapes my miniscule grey cells at the moment :(

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.