Changes between Version 10 and Version 11 of ddlScript-with-help-of-AI.sql


Ignore:
Timestamp:
09/20/26 07:26:19 (9 days ago)
Author:
235018
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ddlScript-with-help-of-AI.sql

    v10 v11  
    9393-- Create PERMISSIONS table
    9494CREATE TABLE permissions (
    95     personal_is VARCHAR(10) PRIMARY KEY REFERENCES personal(id)
     95    personal_id VARCHAR(10) PRIMARY KEY REFERENCES personal(id)
    9696        ON DELETE CASCADE,
    9797    type VARCHAR(50) NOT NULL,
    … …  
    139139-- Create ORDER table
    140140CREATE TABLE "order" (
    141     order_num VARCHAR(11) PRIMARY KEY,                   -- In the format: 3 digits for store ID, 3 digits for year when order is placed, 5 digits for the number of order for that store in that year
     141    order_num VARCHAR(11) PRIMARY KEY,    -- In the format: 3 digits for store ID, 3 digits for year when order is placed, 5 digits for the number of order for that store in that year
    142142    client_ID INTEGER REFERENCES client(client_ID)
    143143        ON DELETE CASCADE,
    144144    status VARCHAR(20) NOT NULL DEFAULT 'placed order',
    145145    last_date_mod TIMESTAMP NOT NULL,
    146     payment_method VARCHAR (250) NOT NULL,                  -- Format : "credit card, **** **** **** 6750" , or "cash", or "paypal, user@gmail.com",... Contains important information that are going to be needed when issuing a refund
     146    payment_method VARCHAR (250) NOT NULL,              -- Format : "credit card, **** **** **** 6750" , or "cash", or "paypal, user@gmail.com",... Contains important information that are going to be needed when issuing a refund
    147147    discount DECIMAL(5,2) DEFAULT 0.0 CHECK(discount>=0.0 AND discount<= 100.00),
    148148    CONSTRAINT check_status (status IN ('placed order', 'being processed', 'shipping', 'delivered', 'canceled'))
    … …  
    168168    amount DECIMAL(5,2) NOT NULL,
    169169    status VARCHAR(100) NOT NULL DEFAULT 'requested refund',
    170     CONSTRAINT check_refund_status (status IN ('requested refund', 'being revied', 'approved', 'not approved', 'processed'))
     170    CONSTRAINT check_refund_status (status IN ('requested refund', 'being reviewed', 'approved', 'not approved', 'processed'))
    171171
    172172);