Created
January 4, 2017 12:20
-
-
Save johnfkneafsey/233162cfd349f14a6626ace250ee8649 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
1) | |
create table if not exists TABLENAME ( | |
id serial primary key, | |
//add additional columns | |
2) | |
insert into TABLENAME (COLUMN1NAME, COLUMN2NAME) | |
values ('VALUEFORCOLUMN1', 'VALUEFORCOLUMN2); | |
3) | |
select(COLUMN1NAME, COLUMN2NAME) | |
from TABLENAME | |
where name='VALUE'; | |
4) | |
A primary key is a column or set of columns that uniquely identify a row in a table. | |
A foreign key is a field or collection of fields in a table whose value is required to match the value of the primary key for a second table. | |
5) | |
Joins find rows with related columns in two tables and combine the rows together. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment