Changes between Initial Version and Version 1 of RelationalDesign


Ignore:
Timestamp:
12/01/26 22:11:12 (9 hours ago)
Author:
231190
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RelationalDesign

    v1 v1  
     1Логички и физички дизајн – Креирање база податоци (со SQL DDL)
     2Релациско мапирање
     3Ознаки
     4- Примарните клучеви се означени со bold и underline.
     5- Надворешните клучеви се означени со FK*, а во заграда е наведена табелата што ја референцираат.
     6- Задолжителните атрибути се означени со bold.
     7- Кај сложените примарни клучеви, сите атрибути што го сочинуваат клучот се означени.
     8Табели
     91. Customers (customer_id, name, type, tax_id, payment_terms_days)
     10
     112. Locations (location_id, name, city, country, customer_id FK*(Customers))
     12
     133. Users (user_id, username, email)
     14
     154. Roles (role_id, name)
     16
     175. Has_Role (user_id FK*(Users), role_id FK(Roles)*, assigned_on)
     18
     196. Drivers (driver_id, first_name, last_name, embg, status)
     20
     217. DriverDocuments (driver_id FK*(Drivers), doc_no, doc_type, expires_on)
     22
     238. Vehicles (vehicle_id, plate, vin, vehicle_type, status)
     24
     259. VehicleDocuments (vehicle_id FK*(Vehicles), doc_no, doc_type, expires_on)
     26
     2710. Orders (order_id, order_no, order_date, status, customer_id FK*(Customers))
     28
     2911. Loads (order_id FK*(Orders), load_no, cargo_description, weight_kg, agreed_price, status)
     30
     3112. Stops (order_id FK*(Loads), load_no FK(Loads)*, seq_no, stop_type, planned_time, actual_time, location_id FK*(Locations))
     32
     3313. Shipments (order_id FK*(Loads), load_no FK(Loads)*, shipment_no, description, weight_kg, status, stop_order_id FK*(Stops), stop_load_no FK*(Stops), stop_seq_no FK*(Stops)**)
     34
     3514. StatusHistory (order_id FK*(Loads), load_no FK(Loads)*, changed_at, status, note, user_id FK*(Users))
     36
     3715. Assignments (assignment_id, planned_start, planned_end, status, order_id FK*(Loads), load_no FK*(Loads), driver_id FK*(Drivers), truck_id FK*(Vehicles), trailer_id FK*(Vehicles))
     38
     3916. Expenses (expense_id, expense_date, amount, note, vehicle_id FK*(Vehicles), order_id FK*(Loads), load_no FK*(Loads), assignment_id FK*(Assignments))
     40
     4117. FuelEntries (expense_id FK*(Expenses), liters, price_per_liter, odometer_km)
     42
     4318. Services (expense_id FK*(Expenses), service_type, workshop, odometer_km)
     44
     4519. Tolls (expense_id FK*(Expenses), road_section, country)
     46
     4720. Invoices (invoice_id, invoice_no, issue_date, due_date, customer_id FK*(Customers), user_id FK*(Users))
     48
     4921. Includes (invoice_id FK*(Invoices), order_id FK(Loads)*, load_no FK(Loads)*, amount, description)
     50
     5122. Payments (payment_id, payment_date, amount, method, invoice_id FK*(Invoices))