Changes between Version 1 and Version 2 of Logical and Physical Design – Database Creation


Ignore:
Timestamp:
08/26/25 20:42:05 (7 days ago)
Author:
221531
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Logical and Physical Design – Database Creation

    v1 v2  
    11
    22== Relational Mapping - Relational Schema and DDL
     3\\
     4=== Notation
     5- Entities are denoted with capital letters and their attributes are defined (a1, a2, ..., an) where n is the number of attributes the entity has.
     6- Primary keys are denoted with underscore and boldness.
     7- Foreign keys are denoted with asterisk suffixing the attribute.
     8\\
     9=== Relations - Relational Schema
     10**USER**(**__user_id__**, first_name, last_name, email, password, phone)
     11\\
     12**RESTAURANT_OWNER**(**__user_id*__**(USER))
     13\\
     14**DELIVERY_MAN**(**__user_id*__**(USER))
     15\\
     16**CUSTOMER**(**__user_id*__**(USER))
     17\\
     18**ORDER**(**__order_id__**, **user_id***(USER), order_date, comment, status)
     19\\
     20**ITEM**(**__item_id__**, image_url, name, price, description)
     21\\
     22**ORDER_ITEMS**(**__order_id*__**(ORDER), **__item_id__**(ITEM), quantity, total_price)
     23\\
     24**INGREDIENT**(**__ingredient_id__**, name)
     25\\
     26**ITEM_INGREDIENT**(**__item_id*__**(ITEM), **__ingredient_id*__**(INGREDIENT), quantity)
     27\\
     28**DELIVERY_FIRM**(**__deliveryfirm_id__**, name)
     29\\
     30**DELIVERY_ASSIGNMENT**(**__deliveryfirm_id*__**(DELIVERY_FIRM), **__user_id*__**(DELIVERY_MAN))
     31\\
     32**RESTAURANT**(**__restaurant__id**, name, website_url, opening_time, closing_time, email, phone_number)
     33\\
     34**RESTAURANT_OWNERS**(**__user_id*__**(RESTAURANT_OWNER), **__restaurant_id*__**(RESTAURANT))
     35\\
     36**COSTS**(**__cost_id__**, **__restaurant_id*__**(RESTAURANT), date, amount, type)
     37\\
     38**EARNINGS**(**__earning_id__**, **__restaurant_id*__**(RESTAURANT), date, amount, source)
     39\\
     40**MENU**(**__menu_id__**, **__restaurant_id*__**(RESTAURANT), created_at, updated_at, name)
     41\\
     42**CATEGORY**(**__category_id__**, name, description)
     43\\
     44**RESTAURANT_CATEGORY**(**__category_id*__**(CATEGORY), **__restaurant_id*__**(RESTAURANT))
     45\\
     46**ITEM_CATEGORY**(**__category_id*__**(CATEGORY), **__item_id*__**(ITEM))
     47\\
     48**ADDRESS**(**__address_id__**, city, street, postal_code)
     49\\
     50**USER_ADDRESSES**(**__address_id*__**(ADDRESS), **__user_id*__**(USER))
     51
     52