Created
October 4, 2012 18:52
-
-
Save mapmeld/3835623 to your computer and use it in GitHub Desktop.
Code Enforcement on MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sign into MySQL | |
mysql -u root -p | |
# Create a code enforcement database | |
CREATE DATABASE codeenf; | |
USE codeenf; | |
# Make a table for code enforcement cases | |
CREATE TABLE cases(id INT NOT NULL AUTO_INCREMENT, PRIMARY KEY(id), address VARCHAR(100), cleanaddress VARCHAR(50), streetname VARCHAR(40), action VARCHAR(30), opendate VARCHAR(8), closedate VARCHAR(8), ecd_id VARCHAR(10), inspectcodes VARCHAR(20), reason VARCHAR(50), latitude FLOAT(10,6), longitude FLOAT(10,6), neighborhood VARCHAR(20)); | |
# Add a sample case | |
INSERT INTO cases (address, cleanaddress, streetname, action, opendate, closedate, ecd_id, inspectcodes, reason, latitude, longitude, neighborhood) VALUES(" 2273,OLLIE DR, Macon, GA 31217", "2273 ollie dr", "olliedr", "BIC", "20090108", "20100301", "200900020", "HC,Y/P", "Anonymous", 32.860039, -83.590141, "East Macon"); | |
# Confirm that this is working | |
SELECT * FROM cases; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment