Version 5 (modified by 7 days ago) ( diff ) | ,
---|
Логички и физички дизајн - Креирање база податоци (со SQL DDL)
Ознаки
- Со * се означени надворешни клучеви
- Примарните клучеви се подвлечени и болдирани
Табели
Ентитети
- USERS (user_id, user_name, user_surname, user_email, user_mobile, city_id*)
- * референцира до CITY (city_id)
- VEHICLE (vehicle_id, vehicle_carry_weight, vehicle_service_interval, vehicle_kilometers, vehicle_last_service, driver_id*, warehouse_id**)
- * референцира до DRIVER (user_id)
- ** референцира до WAREHOUSE (warehouse_id)
- DELIVERY (delivery_id, delivery_status, delivery_date_created, delivery_date, vehicle_id*)
- * референцира до VEHICLE (vehicle_id)
- PRO_FORMA (pro_forma_id, pro_forma_status, pro_forma_deadline, pro_forma_date_created, order_id*)
- * референцира до ORDERS (order_id)
- ARTICLE (article_id, article_price, article_image, article_name, article_weight, category_id*)
- * референцира до CATEGORY (category_id)
- ORDERS (order_id, order_date, order_status, order_sum, order_fulfillment_date, delivery_id*, pro_forma_id**, customer_id***)
- * референцира до DELIVERY (delivery_id)
- ** референцира до PRO_FORMA (pro_forma_id)
- *** референцира до CUSTOMER(user_id)
- CITY (city_id, city_name)
- MANAGER (user_id*', warehouse_id**)
- * референцира до USER (user_id)
- ** референцира до WAREHOUSE (warehouse_id)
- CUSTOMER (user_id*', customer_EDB, customer_company_name, customer_address, customer_open_time, customer_close_time, customer_representative_image)
- * референцира до USER (user_id)
- DRIVER (user_id*', vehicle_id**)
- * референцира до USER (user_id)
- ** референцира до VEHICLE (vehicle_id)
- WAREHOUSE (warehouse_id, warehouse_address, manager_id*, city_id**)
- * референцира до MANAGER (user_id)
- ** референцира до CITY (city_id)
- CATEGORY (category_id, category_name)
- ARTICLE_UNIT (unit_id, unit_expiration_date, unit_serial_number, unit_batch_number, unit_manufacture_date, unit_cost_price, article_id*, order_id**)
- * референцира до ARTICLE (article_id)
- ** референцира до ORDERS (order_id)
Релации
- IN_STOCK (city_id*, warehouse_id**)
- * референцира до CITY (city_id)
- ** референцира до WAREHOUSE (warehouse_id)
DDL скрипта за креирање и бришење на табелите
DML скрипта за полнење на табелите со податоци
Дијаграм на табелите од DBeaver
Attachments (2)
- kreiranje.sql (4.5 KB ) - added by 7 days ago.
- DB_Scheme_SQL.png (96.7 KB ) - added by 7 days ago.
Download all attachments as: .zip
Note:
See TracWiki
for help on using the wiki.