| | 1 | = Relational Design for OPLMS= |
| | 2 | |
| | 3 | == Notation == |
| | 4 | |
| | 5 | * Primary keys are bolded and underlined. |
| | 6 | * Foreign keys are marked with `*` at the end of their name and the referenced entity is written in parentheses. |
| | 7 | * Complex attributes are bolded, and their containing attributes are following the, made italic. |
| | 8 | * Multivalued attributes have their own table |
| | 9 | |
| | 10 | == Tables == |
| | 11 | |
| | 12 | 1. **USER** (**(User_ID, First_Name, last_Name, Email, Password)) |
| | 13 | * image (multi-valued attribute, see table **COLORS**) |
| | 14 | * color (multi-valued attribute, see table **IMAGE**) |
| | 15 | |
| | 16 | 2. **IMAGE** (__**{{{product_code*}}}**__ (PRODUCT), __**{{{image}}}**__) |
| | 17 | |
| | 18 | 3. **COLOR** (**__{{{product_code*}}}__** (PRODUCT), **__{{{color}}}__**) |
| | 19 | |
| | 20 | 4. **STORE** (**__{{{store_ID}}}__**, {{{name}}}, {{{date_of_founding}}}, {{{physical_address}}}, {{{store_email}}}, {{{rating}}}) |
| | 21 | |
| | 22 | 5. **PERSONAL** (**__{{{SSN}}}__**, **{{{name}}}**, ''{{{first_name}}}'', ''{{{last_name}}}'', {{{email}}}, {{{password}}}) |
| | 23 | * permissions (complex, multi-valued attribute, see table **PERMISSIONS**) |
| | 24 | |
| | 25 | 6. **PERMISSIONS** (**__{{{personal_SSN*}}}__** (PERSONAL), **__{{{type}}}__**, {{{authorisation}}}) |
| | 26 | |
| | 27 | 7. **BOSS** (**__{{{boss_SSN*}}}__** (PERSONAL)) |
| | 28 | |
| | 29 | 8. **EMPLOYEES** (**__{{{employee_SSN*}}}__** (PERSONAL), {{{date_of_hire}}}) |
| | 30 | |
| | 31 | 9. **CLIENT** (**__{{{client_ID}}}__**, **{{{name}}}**, ''{{{first_name}}}'', ''{{{last_name}}}'', {{{email}}}, {{{password}}}) |
| | 32 | * delivery_address (multi-valued attribute, see table **DELIVERY_ADDRESS**) |
| | 33 | |
| | 34 | 10. **DELIVERY_ADDRESS** (**__{{{client_ID}}}__** (CLIENT), **__{{{address}}}__**) |
| | 35 | |
| | 36 | 11. **ORDER** (**__{{{order_num}}}__**,{{{client_ID*}}} (CLIENT), {{{quantity}}}, {{{status}}}, {{{last_date_mod}}}, {{{payment_method}}}, {{{discount}}}) |
| | 37 | |
| | 38 | 12. **REPORT** (**__{{{date}}}__**, **__{{{store_ID*}}}__** (STORE), {{{overall_profit}}}, {{{sales_trend}}}, {{{marketing_growth}}}, {{{owner_signature}}}) |
| | 39 | * monthly_profit (multi-valued attribute, see table **MONTHLY_PROFIT**) |
| | 40 | |
| | 41 | 13. **MONTHLY_PROFIT** (**__{{{report_date*}}}__** (REPORT), **__{{{store_ID*}}}__** (REPORT), {{{month_and_year}}}, {{{profit}}}) |
| | 42 | |
| | 43 | 14. **REQUEST** (**__{{{request_num}}}__**, {{{date_and_time}}}, {{{problem}}}, {{{notes_of_communication}}}, {{{costumer_satisfaction}}}) |
| | 44 | |
| | 45 | |
| | 46 | === DDL скрипта за креирање и бришење на табелите === |
| | 47 | |
| | 48 | [wiki:ddlScript.sql DDL скрипта] |
| | 49 | |
| | 50 | === DML скрипта за полнење на табелите со податоци === |
| | 51 | |
| | 52 | [wiki:dmlScript.sql DML скрипта] |
| | 53 | |
| | 54 | === Релациски дијаграм изваден од DBeaver === |
| | 55 | [[Image(DBeaverExportVer2.png)]] |