July 22, 2019
Instructor: Andy Hong, PhD
Lead Urban Health Scientist
The George Institute for Global Health
University of Oxford
Relational DB | Non-relational DB |
---|---|
|
|
Andys-MacBook-Pro$ sqlite3 seattle_crime_data.db
SQLite version 3.13.0 2016-05-18 10:57:30
Enter ".help" for usage hints.
sqlite> .headers on
sqlite> .mode column
sqlite> .tables
sqlite> .schema crime
CREATE TABLE crime(
"ID" TEXT,
"GeneralOffenseNumber" TEXT,
"OffenseCode" TEXT,
"OffenseCodeExtension" TEXT,
"OffenseType" TEXT,
"SummaryOffenseCode" TEXT,
"SummarizedOffenseDescription" TEXT,
"DateReported" TEXT,
"OccurredDateorDateRangeStart" TEXT,
"OccurredDateRangeEnd" TEXT,
"HundredBlockLocation" TEXT,
"DistrictSector" TEXT,
"ZoneBeat" TEXT,
"CensusTract2000" TEXT,
"Longitude" REAL,
"Latitude" REAL,
"Location" TEXT,
"Month" INTEGER,
"Year" INTEGER
);
sqlite> SELECT Year, OffenseType FROM crime LIMIT 10;
Year OffenseType
---------- ------------
Year Offense Type
2010 PROPERTY DAM
2012 THEFT-SHOPLI
2012 THEFT-OTH
2014 VEH-THEFT-TR
2014 BURGLARY-FOR
2010 ROBBERY-STRE
2014 VEH-THEFT-AU
2014 VEH-THEFT-AU
2014 ROBBERY-BUSI