Skip to content

Instantly share code, notes, and snippets.

@johnfkneafsey
Created January 4, 2017 12:20
Show Gist options
  • Save johnfkneafsey/233162cfd349f14a6626ace250ee8649 to your computer and use it in GitHub Desktop.
Save johnfkneafsey/233162cfd349f14a6626ace250ee8649 to your computer and use it in GitHub Desktop.
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