Created
May 4, 2021 09:30
-
-
Save lolaodelola/f5bd660d0ec42e2190871ce3b9c6f42e to your computer and use it in GitHub Desktop.
tables.rb
This file contains 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.