-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump.sql
More file actions
263 lines (194 loc) · 11.1 KB
/
Copy pathdump.sql
File metadata and controls
263 lines (194 loc) · 11.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
--
-- PostgreSQL database dump
--
\restrict gR6MGfbIPNDTNAf6XkhaxWJlKbMTcT2Wjgld173mTap4omIH4cl1cmSHBB0DS4o
-- Dumped from database version 18.4
-- Dumped by pg_dump version 18.4 (Homebrew)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET transaction_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: pgcrypto; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
--
-- Name: EXTENSION pgcrypto; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION pgcrypto IS 'cryptographic functions';
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: customers; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.customers (
customer_id uuid DEFAULT gen_random_uuid() NOT NULL,
full_name character varying(100) NOT NULL,
email character varying(120) NOT NULL,
loyalty_tier character varying(20),
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT customers_loyalty_tier_check CHECK (((loyalty_tier)::text = ANY ((ARRAY['BRONZE'::character varying, 'SILVER'::character varying, 'GOLD'::character varying, 'PLATINUM'::character varying])::text[])))
);
ALTER TABLE public.customers OWNER TO postgres;
--
-- Name: orders; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.orders (
order_id uuid DEFAULT gen_random_uuid() NOT NULL,
customer_id uuid,
product_id uuid,
quantity integer,
total_amount numeric(10,2),
order_status character varying(30),
delivered_date date,
damaged boolean DEFAULT false,
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT orders_order_status_check CHECK (((order_status)::text = ANY ((ARRAY['processing'::character varying, 'shipped'::character varying, 'delivered'::character varying, 'cancelled'::character varying, 'returned'::character varying])::text[]))),
CONSTRAINT orders_quantity_check CHECK ((quantity > 0))
);
ALTER TABLE public.orders OWNER TO postgres;
--
-- Name: products; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.products (
product_id uuid DEFAULT gen_random_uuid() NOT NULL,
product_name character varying(120) NOT NULL,
category character varying(50),
price numeric(10,2),
final_sale boolean DEFAULT false
);
ALTER TABLE public.products OWNER TO postgres;
--
-- Name: refund_requests; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.refund_requests (
refund_id uuid DEFAULT gen_random_uuid() NOT NULL,
order_id uuid,
customer_id uuid,
request_reason text,
refund_status character varying(30),
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT refund_requests_refund_status_check CHECK (((refund_status)::text = ANY ((ARRAY['approved'::character varying, 'denied'::character varying, 'pending'::character varying, 'escalated'::character varying])::text[])))
);
ALTER TABLE public.refund_requests OWNER TO postgres;
--
-- Data for Name: customers; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.customers (customer_id, full_name, email, loyalty_tier, created_at) FROM stdin;
c319324e-bcd7-48cf-9b69-dc8ad30c3772 Rahul Gupta rahul@example.com GOLD 2026-05-27 13:53:26.713063
03abfd11-1f66-46bd-81df-cbc285b0b584 Sarah Johnson sarah@example.com SILVER 2026-05-27 13:53:26.713063
959f225a-2510-41d4-ac07-d516d261816a Mike Ross mike@example.com BRONZE 2026-05-27 13:53:26.713063
dca19d1f-1051-41af-9728-7482ce831340 Emma Watson emma@example.com PLATINUM 2026-05-27 13:53:26.713063
890b4911-836c-4c74-b785-6ec45d9d43d2 Alex Carter alex@example.com GOLD 2026-05-27 13:53:26.713063
579fef35-0a5d-4357-ac4a-b6f7850f5eb0 John Miller john@example.com BRONZE 2026-05-27 13:53:26.713063
91a27953-9bc4-4ca3-9b95-4f61b3dedc9b Lisa Ray lisa@example.com SILVER 2026-05-27 13:53:26.713063
449654f7-4724-4d33-ba4d-cd673c840dbe David Warner david@example.com GOLD 2026-05-27 13:53:26.713063
b6a4d8c1-39da-4cb0-bcee-dcc8bc4d0c51 Nina Patel nina@example.com PLATINUM 2026-05-27 13:53:26.713063
a8815271-4da0-4a29-9312-55638b4631e6 Chris Evans chris@example.com BRONZE 2026-05-27 13:53:26.713063
4b9f0666-bd2b-415b-b6c8-368b28f77ea2 Priya Sharma priya@example.com GOLD 2026-05-27 13:53:26.713063
169c427a-a851-42e3-8e3e-bb5c8597e089 Omar Hassan omar@example.com SILVER 2026-05-27 13:53:26.713063
3f3079ac-4393-496b-a9f6-1bcfa7989eb1 Sophia Lee sophia@example.com BRONZE 2026-05-27 13:53:26.713063
ba118a36-c076-48e1-a17d-bd8fac51596b Kevin Brown kevin@example.com SILVER 2026-05-27 13:53:26.713063
9924e63d-b7bf-4f6a-8a68-f06d2901ba63 Aisha Khan aisha@example.com PLATINUM 2026-05-27 13:53:26.713063
\.
--
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.orders (order_id, customer_id, product_id, quantity, total_amount, order_status, delivered_date, damaged, created_at) FROM stdin;
5274cfa7-39ae-4cc7-b4f5-5e503b4c6302 c319324e-bcd7-48cf-9b69-dc8ad30c3772 cf1a3881-7192-43f1-98ae-4f13efc79189 1 180.00 delivered 2026-05-17 f 2026-05-27 13:53:26.713063
25f83a89-ae54-46ad-a605-9d81d05436d7 03abfd11-1f66-46bd-81df-cbc285b0b584 ebc9e01b-4262-4948-897a-90f9a9aa0907 1 90.00 delivered 2026-05-22 t 2026-05-27 13:53:26.713063
e58abf0d-e7d6-4a33-b73c-f309c49060a3 959f225a-2510-41d4-ac07-d516d261816a a300b212-4828-4383-a2a0-9b74fa895ba5 1 320.00 delivered 2026-05-20 f 2026-05-27 13:53:26.713063
c4000963-3ca2-4119-8b3d-31ca58a0fcf1 dca19d1f-1051-41af-9728-7482ce831340 236f7b76-7846-4eb5-900f-017e4fdb13a5 1 210.00 delivered 2026-04-12 f 2026-05-27 13:53:26.713063
154b2940-6f48-4335-b674-2b3d067f4c15 890b4911-836c-4c74-b785-6ec45d9d43d2 d5b7450e-bf10-46d7-967d-f62f3379c9ad 2 120.00 delivered 2026-05-24 f 2026-05-27 13:53:26.713063
5298b84b-45bc-4f2f-8cbd-0432ecf4e02a 579fef35-0a5d-4357-ac4a-b6f7850f5eb0 4a3ed4cf-1f94-4aff-b87c-34eeb4e077b1 1 2400.00 delivered 2026-05-23 f 2026-05-27 13:53:26.713063
18e68fc5-1885-481a-9ad5-493988055133 449654f7-4724-4d33-ba4d-cd673c840dbe 2ca0acf9-d294-4017-a4b2-8410dd1fe2e0 1 300.00 cancelled \N f 2026-05-27 13:53:26.713063
24151525-dccb-4ec0-8834-b8ccf4856c99 3f3079ac-4393-496b-a9f6-1bcfa7989eb1 cd293e50-ae06-46f3-ac9f-77b20b4d7e31 1 45.00 delivered 2026-05-25 f 2026-05-27 13:53:26.713063
fc526088-216b-4b96-b696-1b5c30e24f9a ba118a36-c076-48e1-a17d-bd8fac51596b 51988a59-3575-4369-b308-d653858b6881 1 650.00 shipped \N f 2026-05-27 13:53:26.713063
dd5ad56e-c30f-4876-9da6-349e04786915 4b9f0666-bd2b-415b-b6c8-368b28f77ea2 4ed5d4b4-5ee1-4f5f-ab20-3adc6cc1fd2c 1 250.00 delivered 2026-05-21 f 2026-05-27 13:53:26.713063
\.
--
-- Data for Name: products; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.products (product_id, product_name, category, price, final_sale) FROM stdin;
cf1a3881-7192-43f1-98ae-4f13efc79189 Nike Air Max Footwear 180.00 f
4a3ed4cf-1f94-4aff-b87c-34eeb4e077b1 MacBook Pro 16 Electronics 2400.00 f
a300b212-4828-4383-a2a0-9b74fa895ba5 Limited Edition Hoodie Fashion 320.00 t
ebc9e01b-4262-4948-897a-90f9a9aa0907 Gaming Mouse Electronics 90.00 f
0d78efb5-c63e-4677-ba6d-a180c838a68c Luxury Watch Accessories 1200.00 f
cd293e50-ae06-46f3-ac9f-77b20b4d7e31 Organic Lipstick Cosmetics 45.00 f
236f7b76-7846-4eb5-900f-017e4fdb13a5 Wireless Earbuds Electronics 210.00 f
5130add5-4261-42a1-a12a-421ecc421997 Leather Jacket Fashion 450.00 f
d5b7450e-bf10-46d7-967d-f62f3379c9ad Yoga Mat Fitness 60.00 f
d3a1f61a-3b49-4646-8967-0505a7e5aa10 Smartphone Electronics 999.00 f
a2d9f123-6d52-4be7-b9a3-ff45a8008d62 Bluetooth Speaker Electronics 150.00 f
4ed5d4b4-5ee1-4f5f-ab20-3adc6cc1fd2c Final Sale Sneakers Footwear 250.00 t
2ca0acf9-d294-4017-a4b2-8410dd1fe2e0 Desk Chair Furniture 300.00 f
51988a59-3575-4369-b308-d653858b6881 Coffee Machine Appliances 650.00 f
aec77de8-e4da-4628-8228-e897e18ba202 Perfume Kit Cosmetics 120.00 f
\.
--
-- Data for Name: refund_requests; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.refund_requests (refund_id, order_id, customer_id, request_reason, refund_status, created_at) FROM stdin;
55718d7f-6be3-4d90-9288-b7b3a73c9855 25f83a89-ae54-46ad-a605-9d81d05436d7 03abfd11-1f66-46bd-81df-cbc285b0b584 Product arrived damaged approved 2026-05-27 13:53:26.713063
f9ff32f8-3abe-4dd6-84b8-6eadb6aac467 e58abf0d-e7d6-4a33-b73c-f309c49060a3 959f225a-2510-41d4-ac07-d516d261816a Want refund for final sale item denied 2026-05-27 13:53:26.713063
1902aa56-7807-4a65-ac02-e791a205a5d9 c4000963-3ca2-4119-8b3d-31ca58a0fcf1 dca19d1f-1051-41af-9728-7482ce831340 Refund requested after policy window denied 2026-05-27 13:53:26.713063
759bf9da-0223-4983-a291-b5e80884c349 5298b84b-45bc-4f2f-8cbd-0432ecf4e02a 579fef35-0a5d-4357-ac4a-b6f7850f5eb0 High-value refund request escalated 2026-05-27 13:53:26.713063
8bc724a7-283c-4588-9d65-facb383ac443 dd5ad56e-c30f-4876-9da6-349e04786915 4b9f0666-bd2b-415b-b6c8-368b28f77ea2 Duplicate refund attempt pending 2026-05-27 13:53:26.713063
\.
--
-- Name: customers customers_email_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.customers
ADD CONSTRAINT customers_email_key UNIQUE (email);
--
-- Name: customers customers_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.customers
ADD CONSTRAINT customers_pkey PRIMARY KEY (customer_id);
--
-- Name: orders orders_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders
ADD CONSTRAINT orders_pkey PRIMARY KEY (order_id);
--
-- Name: products products_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.products
ADD CONSTRAINT products_pkey PRIMARY KEY (product_id);
--
-- Name: refund_requests refund_requests_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.refund_requests
ADD CONSTRAINT refund_requests_pkey PRIMARY KEY (refund_id);
--
-- Name: orders orders_customer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders
ADD CONSTRAINT orders_customer_id_fkey FOREIGN KEY (customer_id) REFERENCES public.customers(customer_id);
--
-- Name: orders orders_product_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.orders
ADD CONSTRAINT orders_product_id_fkey FOREIGN KEY (product_id) REFERENCES public.products(product_id);
--
-- Name: refund_requests refund_requests_customer_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.refund_requests
ADD CONSTRAINT refund_requests_customer_id_fkey FOREIGN KEY (customer_id) REFERENCES public.customers(customer_id);
--
-- Name: refund_requests refund_requests_order_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.refund_requests
ADD CONSTRAINT refund_requests_order_id_fkey FOREIGN KEY (order_id) REFERENCES public.orders(order_id);
--
-- PostgreSQL database dump complete
--
\unrestrict gR6MGfbIPNDTNAf6XkhaxWJlKbMTcT2Wjgld173mTap4omIH4cl1cmSHBB0DS4o