]> gitweb.michael.orlitzky.com - dead/census-tools.git/blobdiff - sql/create-blocks-table.sql
Added the SQL scripts to combine the sf1_blocks and tiger_blocks tables.
[dead/census-tools.git] / sql / create-blocks-table.sql
diff --git a/sql/create-blocks-table.sql b/sql/create-blocks-table.sql
new file mode 100644 (file)
index 0000000..97d8f2f
--- /dev/null
@@ -0,0 +1,17 @@
+/*
+  Create a new "blocks" table to comprise the
+  sf1_blocks and tiger_blocks tables.
+*/
+
+CREATE TABLE blocks (
+       id                 SERIAL           PRIMARY KEY,
+       state             varchar(2)       NOT NULL,
+       county             varchar(3)       NOT NULL,
+       tract             varchar(6)       NOT NULL,
+       block             varchar(4)       NOT NULL,
+       blkidfp00         varchar(15)      NOT NULL,
+       pop100            integer          NOT NULL,
+       total_area        double precision NOT NULL,
+       population_density double precision NOT NULL,
+       the_geom                  geometry         NOT NULL
+);