Changes between Version 2 and Version 3 of RelationalDesign


Ignore:
Timestamp:
05/18/26 19:38:13 (9 days ago)
Author:
232012
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RelationalDesign

    v2 v3  
    11= Relational Design
    22
    3 Descriptive representation of the relational schema (syntax as used in lectures/exercises - listed relational schemas, attributes, marked primary and secondary keys)
     3==== Notation:
     4* **Primary keys** - underlined with bold lettering
     5* **Foreign keys** - marked with a * after the key name
     6* **Required attributes** - bold lettering
    47
    5 == DDL script for creating the database schema and objects:
     8== Tables
    69
    7 * The script should (re-)create the schema, all the tables, with all constraints, and all other relevant database objects.
    8 * The script should work in an empty database to fully construct everything needed for the project, and should also work in a database where the schema, tables and other objects are already created and they need to be re-created. So drop existing objects and create them again.
    9 * The script should be named schema_creation.sql
    10 * Link the script in this section in the !RelationalDesign wiki page as an attachment to the page.
     10{{{#!div style="text-align: justify; width: 100%;"
    1111
    12 == DML script for filling tables with data:
     121. USER (**__user_id__**, **username**, **email**, **password**, **date_created**, shipping_address, telephone_number)
    1313
    14 * The script should (re-)create all the data in your tables
    15 * The script should work with empty tables to fully load all needed data for the project, and should also work in a database where the tables already have data and need to be emptied and the data should be imported again.
    16 * The script should be named data_load.sql
    17 * Link the script in this section in the !RelationalDesign wiki page as an attachment to the page.
     142. ADMIN (**__user_id*__**[USER], discount_percentage, type)
     15
     163. CONSUMER (**__user_id*__**[USER], points_collected)
     17
     184. WISHLIST (**__wishlist_id__**, **__user_id*__**[USER])
     19
     205. PRODUCT (product_id, price, format, description, stock)
     21
     226. RELEASE (release_id, product_id*[PRODUCT]?????, title, release_date, genre, record_label, cover_photo)
     23
     247. ALBUM (release_id*[RELEASE])
     25
     268. SINGLE (release_id*[RELEASE], duration)
     27
     289. SONG (song_id, song_name, duration)
     29
     3010. ORDER (order_id, user_id*[USER], purchase_date, status, payment_method, points_used, points_earned)
     31
     3211. ORDER_ITEM (order_id*[ORDER], product_id*[PRODUCT], quantity, price_at_purchase)
     33
     3412. ARTIST (artist_id, artist_name, photo, description)
     35
     3613. MODIFICATION (modification_id, user_id*[ADMIN], date_modified, discount)
     37}}}
     38
     39
     40==== DDL script for creating the database schema and objects:
     41
     42==== DML script for filling tables with data:
    1843
    1944== Relational diagram
    20 
    21 * DBeaver is the recommended tool for working with the assigned database, if you follow the instructions for connecting to the database.
    22 * In DBeaver it is possible to create a relational schema diagram for the entire project schema. Double click on the project schema to open it's properties dialog, then switch to the ER diagram tab. The diagram will be automatically created based on the created objects in the schema.
    23 * Switch the diagram to use crow-feet notation.
    24 * Visually adjust the diagram to have the same positioning of tables and relations as the corresponding entities and relations in the ER diagram in the previous phase.
    25 * Export the diagram to a file named relational_schema.jpg and attach it in this section.