wiki:RelationalDesign

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

Ознаки

  • Примарните клучеви се означени со bold и underline
  • Надворешните клучеви се означени со *,#,%,&
  • Задолжителни атрибути, односно not null со bold

Табели

  • users (ID_user, username, password, first_name, last_name, address, contact_number, date_created)
  • workers(ID_worker*(users), position, work_hours_from, work_hours_to, ID_cinema#(cinemas))
  • customers(ID_customer*(users), points)
  • salaries(ID_salary, sum, date_from, date_to, ID_worker*(Workers))
  • films(ID_film, name, duration, actors, genre, age_category, director, start_date, end_date, description)
  • cinemas(ID_Cinema, name, location)
  • events(ID_event, theme, duration, repeating, start_dates)
  • projections(ID_projection, date_time_start, type_of_technology, date_time_end, ID_film**(Films), ID_discount#(Discounts), ID_event%(Events))
  • tickets(ID_ticket, price , ID_customer*(Customer), ID_projection&(Projections), ID_discount#(Discounts), ID_seat%(Seats))
  • discounts(ID_discount, validity, code, type, percent)
  • seats(ID_seat, seat_number, ID_room*(Projection_Rooms) , ID_category&(Categories))
  • projection_rooms(ID_room, number_of_seats ,projection_room_number, ID_cinema*(Cinemas))
  • categories(ID_category, name, extra_amount)
  • work_hours_weekly(ID_work_hours, ID_worker*(Workers), week_number, year_num, hours_from, hours_to,check_in)
  • customer_rates_film(ID_customer*(Customer),ID_film&(Films),rating)
  • cinema_plays_film(ID_cinema*(Cinemas),ID_film&(Films))
  • cinema_organizes_event(ID_cinema*(Cinemas),ID_Event&(Events))
  • projection_is_played_in_room(ID_projection*(Projections),ID_Room&(Projection_Rooms))
  • customer_is_interested_in_event(ID_customer*(Customers),ID_event&(Events))

DDL скрипта за бришење на табелите и креирање на табелите

kreiranje.sql

DML скрипта за полнење на табелите со податоци

polnenje.sql

Релациски дијаграм изваден од DBeaver

Историјат

  1. Додавање на end_date и start_date променливи кај films за да се означи почетокот и крајот на покажувањето на филмот во киното.
  1. Додавање на релација помеѓу customers и events.
  1. Додавање на табела за следење на смените на вработените.
Last modified 17 months ago Last modified on 12/26/22 13:56:01

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.