Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lolaodelola/f5bd660d0ec42e2190871ce3b9c6f42e to your computer and use it in GitHub Desktop.
Save lolaodelola/f5bd660d0ec42e2190871ce3b9c6f42e to your computer and use it in GitHub Desktop.
tables.rb
create_table "hotels", force: :cascade do |t|
t.string "name"
t.string "location"
t.string "h_type"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "review_details", force: :cascade do |t|
t.integer "review_id"
t.string "category"
t.integer "rating"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "reviews", force: :cascade do |t|
t.integer "hotel_id"
t.integer "user_id"
t.integer "year"
t.string "date"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
create_table "users", force: :cascade do |t|
t.string "username"
t.string "email"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
end
@lolaodelola
Copy link
Author

Find the name and email of each user who in 2018 submitted reviews for at least 2 hotels more than the number of hotels that user reviewed in 2017. If a user submits multiple reviews for a hotel in a year, that should be treated as a review of one hotel.

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