Changes between Version 10 and Version 11 of ddlScript-with-help-of-AI.sql
- Timestamp:
- 09/20/26 07:26:19 (9 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
ddlScript-with-help-of-AI.sql
v10 v11 93 93 -- Create PERMISSIONS table 94 94 CREATE TABLE permissions ( 95 personal_i sVARCHAR(10) PRIMARY KEY REFERENCES personal(id)95 personal_id VARCHAR(10) PRIMARY KEY REFERENCES personal(id) 96 96 ON DELETE CASCADE, 97 97 type VARCHAR(50) NOT NULL, … … 139 139 -- Create ORDER table 140 140 CREATE 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 year141 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 142 142 client_ID INTEGER REFERENCES client(client_ID) 143 143 ON DELETE CASCADE, 144 144 status VARCHAR(20) NOT NULL DEFAULT 'placed order', 145 145 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 refund146 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 147 147 discount DECIMAL(5,2) DEFAULT 0.0 CHECK(discount>=0.0 AND discount<= 100.00), 148 148 CONSTRAINT check_status (status IN ('placed order', 'being processed', 'shipping', 'delivered', 'canceled')) … … 168 168 amount DECIMAL(5,2) NOT NULL, 169 169 status VARCHAR(100) NOT NULL DEFAULT 'requested refund', 170 CONSTRAINT check_refund_status (status IN ('requested refund', 'being revie d', 'approved', 'not approved', 'processed'))170 CONSTRAINT check_refund_status (status IN ('requested refund', 'being reviewed', 'approved', 'not approved', 'processed')) 171 171 172 172 );
