Skip to content

Instantly share code, notes, and snippets.

@charliegerard
Last active August 29, 2015 13:57
Show Gist options
  • Save charliegerard/9497433 to your computer and use it in GitHub Desktop.
Save charliegerard/9497433 to your computer and use it in GitHub Desktop.

#Day 13

###Date In pry

require 'date' today = Date.today today.tuesday?

birthday = Date.new(1990/10/18) age = today - birthdate

###Postgres

In the terminal, start PostGres with "psql" ans type "\l" to have a list of our databases, "\c database name" to connect to a database.

"\d" to check relations.

####Datatypes

"bigint" store a number 2^64. Range of numbers from -2^32 to 2^32 "bigserial" "box" "varchar(7)" "char" "date" | "timestamp" will keep track of when you created a record and last time it was updated. "integer" "money" "text" "xml" - particular kind of text "json"

primary keys / foreign keys --> primary keys are the keys used in the pimary tables and foreign keys are the same keys alled in another table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment