Skip to content

Instantly share code, notes, and snippets.

@phlco
Last active December 25, 2015 00:29
Show Gist options
  • Select an option

  • Save phlco/6888427 to your computer and use it in GitHub Desktop.

Select an option

Save phlco/6888427 to your computer and use it in GitHub Desktop.
afternoon psql

OH SNAP

Let's practice some SQL

CREATE DATABASES based on the following Classes

# create a db called middle_earth_db
class Hobbit
  attr_accessor :name, age, :is_couragous
end
# create a db called amazon_db and a table called books
class Product
  def initialize(price, description)
    @price = price
    @description = description
  end
end

class Book < Product
  attr_accessor :title, :author, :published_on
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment