wiki:Logical and Physical Design - Database creation (with SQL Scripts)

Логички и физички дизајн

Релациска шема (со мапирачка трансформација)

Регуларни ентитети: Login, User, Receptionist, Server, Guests, Chef, Prepared_Meal, Meal, Product, Payment, On_site, Online, Reservation, Villa, Service, Beverage, Rooms, Events, Activities

  • Примарни клучеви: underline and bold
  • Надворешни клучеви: bold, со ознака *
  • Not null атрибути: bold
  • Останати атрибути: без ознака
  1. Reservation (reservation_id, start_date, end_date, number_guests, adults, children, villa_id*, payment_id*, room_id*)
    • *Референцира villa_id кон Villa
    • *Референцира payment_id кон Payment
    • *Референцира room_id од Rooms
  2. Events (event_id, event_type, price, number_of_interested_guests)
  3. Activities (activity_id, activity_type, price, number_of_interested_guests, activity_location)
  4. Rooms (room_id, room_type, price,availability, villa_id*)
    • *Референцира villa_id од Villa
  5. Service (service_id, service_type, price, user_id*, room_id*)
    • *Референцира user_id од Waiter
    • *Референцира room_id од Rooms
  6. Payment (payment_id, total_payment, pay_date, rec_id, customer_id, user_id*)
    • *Референцира user_id од Guests
  7. Villa (villa_id, location, name, villa_view_type)
  8. Beverage (beverage_id, beverage_type, price)
  9. Product (product_id, number_of_products, product_type)
  10. Meal (meal_id, price, meal_type)
  11. Log_in (login_id, vreme_na_najava , user_id*)
    • *Референцира user_id од User_table
  12. User_table (user_id, EMBG, full_name, address, password, username, email, phone_number)
  13. Waiter (user_id*, shift, salary)
    • *Референцира user_id од User_table
  14. Receptionist (user_id*, shift, salary)
    • *Референцира user_id од User_table
  15. Chef (user_id*, shift, salary)
    • *Референцира user_id од User_table
  16. Guests (user_id*, passport_number)
    • *Референцира user_id од User_table
  17. Prepared_Meal (prepared_meal_id, meal_id*, user_id*)
    • *Референцира meal_id од Meal
    • *Референцира user_id од Chef
  18. On_Site (payment_id*, currency, payment_type, user_id*)
    • *Референцира user_id од Receptionist
    • *Референцира payment_id од Payment
  19. Online (payment_id*, card_number)
  1. reservation_for_events (reservation_id*, event_id*)
    • *Референцира reservation_id од Reservation
    • *Референцира event_id од Event
  2. reservation_for_activity (reservation_id*, activity*_id)
    • *Референцира reservation_id од Reservation
    • *Референцира activity_id од Activities
  3. reservation_for_prepared_meal (reservation_id*, (prepared_meal_id*, meal_id*), quantity)
    • *Референцира reservation_id од Reservation
    • *Референцира meal_id и prepared_meal_id од Prepared_Meal
  4. service_for_beverages (service_id*, beverage_id*, quantity)
    • *Референцира service_id од Service
    • *Референцира beverage_id од Beverage
  5. meal_made_of_product (meal_id*,product_id*)
    • *Референцира meal_id од Meal
    • *Референцира product_id од Product
  6. guests_make_reservation (user_id*,reservation_id*)
    • *Референцира user_id од Guests
    • *Референцира reservation_id од Reservation
  7. reservation_for_service (reserevation_id*, service_id*)
    • *Референцира reservation_id од Reservation
    • *Референцира service_id од Service

Креирање на табели

DDL1.sql

Полнење на пример податоци

DML1.sql

Дијаграм

Last modified 16 months ago Last modified on 01/28/23 01:01:04

Attachments (6)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.