Created
September 12, 2018 13:26
-
-
Save ojles/6d7a2d1b637dfc0e73ef13b186990469 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| * ER diagrams | |
| * create schema and insert some data | |
| * postgresql domains | |
| * constraints | |
| * indexes | |
| drop table if exists ad_agency; | |
| drop table if exists customer; | |
| drop table if exists advertisement; | |
| drop table if exists ad_campaign; | |
| create table ad_agency ( | |
| id serial primary key, | |
| name varchar(100), | |
| address varchar(150) | |
| ); | |
| create table customer ( | |
| id serial primary key, | |
| agency_id serial references ad_agency(id) on update cascade on delete cascade, | |
| first_name varchar(50), | |
| last_name varchar(50), | |
| email varchar(254), | |
| phone_number varchar(15) | |
| ); | |
| create table ad_campaign ( | |
| id serial primary key, | |
| description text, | |
| create table advertisement ( | |
| id serial primary key, | |
| description text, | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment