Changes between Version 2 and Version 3 of DatabaseCreation


Ignore:
Timestamp:
05/04/26 11:50:23 (3 weeks ago)
Author:
231141
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DatabaseCreation

    v2 v3  
    1 Database createion
    2 DDL
    3 DdlScript
    4 DML
    5 DmlScript
     1= Database Creation =
     2
     3== DDL ==
     4 * '''Script:''' DdlScript 
     5 Defines the database schema, including tables, relationships, constraints, and indexes.
     6
     7
     8== DML ==
     9 * '''Script:''' DmlScript 
     10
     11This DML script simulates the real behavior of the application over time, rather than inserting all data at once. The key idea is that several parts of the system are interdependent, especially offer pricing, badges, and reviews.
     12
     13The price of each offer is not purely random—it depends on the worker’s badge in the corresponding category. As workers progress through badge levels over time based on their reviews, offer pricing must remain aligned with their current badge status. For this reason, data generation was performed in monthly batches, enabling periodic badge recalculation and corresponding updates to price ranges.
     14
     15The badge itself is calculated based on the worker’s average ratings derived from reviews accumulated over time. In other words, there is a clear dependency chain:
     16
     17 * '''reviews → badges → offer price'''
     18
     19Because of this dependency, the data cannot be generated in a single step. Instead, the script simulates the application timeline, where data is created in a realistic order:
     20
     21 1. TaskRequests are created first 
     22 2. Offers are generated 
     23 3. One offer per task is accepted and Tasks are created 
     24 4. Tasks are completed 
     25 5. Reviews are added 
     26 6. Badges are recalculated 
     27
     28This process runs in monthly batches (e.g., February → March), allowing reviews to accumulate gradually and workers to progress naturally through badge levels.
     29
     30For simplicity and performance reasons, badge recalculation is not triggered after every change (such as each new review). Instead, it is performed at the end of each month, which significantly reduces computational overhead while still preserving realistic system behavior.
     31
     32
     33== Conclusion ==
     34This DML script acts as a time-based simulation of the application lifecycle, ensuring that dependencies between reviews, badges, and offer pricing are respected while maintaining efficiency.