Created
February 3, 2017 19:45
-
-
Save kracekumar/322a2fd5ea09ee952e8a7720fd386184 to your computer and use it in GitHub Desktop.
Return JSON natively from Postgres in Python
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
CREATE TABLE author ( | |
id INTEGER NOT NULL, | |
name VARCHAR(255) NOT NULL, | |
PRIMARY KEY (id) | |
); | |
CREATE TABLE book ( | |
id INTEGER NOT NULL, | |
name VARCHAR(255) NOT NULL, | |
author_id INTEGER, | |
PRIMARY KEY (id), | |
FOREIGN KEY(author_id) REFERENCES author (id) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment