-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.sql
838 lines (698 loc) · 28.2 KB
/
script.sql
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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
--
-- PostgreSQL database dump
--
-- Dumped from database version 14.1
-- Dumped by pg_dump version 14.1
-- Started on 2022-03-31 17:30:54
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_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;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- TOC entry 209 (class 1259 OID 34673)
-- Name: cash_transaction; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.cash_transaction (
ct_id bigint NOT NULL,
amount double precision NOT NULL,
transaction_time bigint NOT NULL,
transaction_type integer NOT NULL,
user_id bigint
);
ALTER TABLE public.cash_transaction OWNER TO postgres;
--
-- TOC entry 215 (class 1259 OID 34718)
-- Name: hibernate_sequence; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.hibernate_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.hibernate_sequence OWNER TO postgres;
--
-- TOC entry 210 (class 1259 OID 34678)
-- Name: limit_order_transaction; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.limit_order_transaction (
order_id bigint NOT NULL,
quantity bigint NOT NULL,
rate double precision NOT NULL,
total_amount double precision NOT NULL,
transaction_time bigint NOT NULL,
transaction_type integer NOT NULL,
stock_id bigint,
user_id bigint
);
ALTER TABLE public.limit_order_transaction OWNER TO postgres;
--
-- TOC entry 220 (class 1259 OID 34773)
-- Name: market_schedule; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.market_schedule (
id integer NOT NULL,
dates date,
end_time bigint NOT NULL,
is_holiday integer NOT NULL,
start_time bigint NOT NULL
);
ALTER TABLE public.market_schedule OWNER TO postgres;
--
-- TOC entry 211 (class 1259 OID 34688)
-- Name: stock_price; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.stock_price (
sp_id bigint NOT NULL,
open_price double precision NOT NULL,
pre_close double precision NOT NULL,
price double precision NOT NULL,
today_high double precision NOT NULL,
today_low double precision NOT NULL,
updated_time bigint NOT NULL,
stock_id bigint
);
ALTER TABLE public.stock_price OWNER TO postgres;
--
-- TOC entry 216 (class 1259 OID 34719)
-- Name: stock_price_sequence; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.stock_price_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.stock_price_sequence OWNER TO postgres;
--
-- TOC entry 212 (class 1259 OID 34693)
-- Name: stocks; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.stocks (
stock_id bigint NOT NULL,
creation_time bigint NOT NULL,
name character varying(255),
price double precision NOT NULL,
purchased_quantity bigint NOT NULL,
stock_symbol character varying(255),
total_quantity bigint NOT NULL
);
ALTER TABLE public.stocks OWNER TO postgres;
--
-- TOC entry 217 (class 1259 OID 34720)
-- Name: stocks_limitorder_sequence; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.stocks_limitorder_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.stocks_limitorder_sequence OWNER TO postgres;
--
-- TOC entry 218 (class 1259 OID 34721)
-- Name: stocks_sequence; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.stocks_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.stocks_sequence OWNER TO postgres;
--
-- TOC entry 219 (class 1259 OID 34722)
-- Name: stocks_transaction_sequence; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE public.stocks_transaction_sequence
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public.stocks_transaction_sequence OWNER TO postgres;
--
-- TOC entry 213 (class 1259 OID 34700)
-- Name: transaction_dtl; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.transaction_dtl (
tid bigint NOT NULL,
purchased_rate double precision NOT NULL,
quantity bigint NOT NULL,
total_amount double precision NOT NULL,
transaction_time bigint NOT NULL,
transaction_type integer NOT NULL,
stock_id bigint,
user_id bigint
);
ALTER TABLE public.transaction_dtl OWNER TO postgres;
--
-- TOC entry 214 (class 1259 OID 34705)
-- Name: user_dtl; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.user_dtl (
user_id bigint NOT NULL,
cash_balance double precision NOT NULL,
creation_time bigint NOT NULL,
email character varying(255),
firstname character varying(255),
lastname character varying(255),
pwd character varying(255),
used_cash double precision NOT NULL,
user_role integer,
username character varying(255)
);
ALTER TABLE public.user_dtl OWNER TO postgres;
--
-- TOC entry 3357 (class 0 OID 34673)
-- Dependencies: 209
-- Data for Name: cash_transaction; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.cash_transaction (ct_id, amount, transaction_time, transaction_type, user_id) FROM stdin;
9 5000 1648701425118 0 8
10 500 1648701441394 1 8
13 5000 1648702216669 0 12
14 500 1648702235276 1 12
16 5000 1648703196534 0 15
17 500 1648703219943 1 15
19 5000 1648770418602 0 18
20 500 1648770438041 1 18
\.
--
-- TOC entry 3358 (class 0 OID 34678)
-- Dependencies: 210
-- Data for Name: limit_order_transaction; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.limit_order_transaction (order_id, quantity, rate, total_amount, transaction_time, transaction_type, stock_id, user_id) FROM stdin;
18 2 355.5 711 1648702337406 0 7 12
\.
--
-- TOC entry 3368 (class 0 OID 34773)
-- Dependencies: 220
-- Data for Name: market_schedule; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.market_schedule (id, dates, end_time, is_holiday, start_time) FROM stdin;
1 2022-02-23 1645650000000 0 1645624800000
2 2022-02-24 1645736400000 0 1645711200000
3 2022-02-25 1645822800000 0 1645797600000
4 2022-02-26 1645909200000 1 1645884000000
5 2022-02-27 1645995600000 1 1645970400000
6 2022-02-28 1646082000000 0 1646056800000
7 2022-03-01 1646168400000 0 1646143200000
8 2022-03-02 1646254800000 0 1646229600000
9 2022-03-03 1646341200000 0 1646316000000
10 2022-03-04 1646427600000 0 1646402400000
11 2022-03-05 1646514000000 1 1646488800000
12 2022-03-06 1646600400000 1 1646575200000
13 2022-03-07 1646686800000 0 1646661600000
14 2022-03-08 1646773200000 0 1646748000000
15 2022-03-09 1646859600000 0 1646834400000
16 2022-03-10 1646946000000 0 1646920800000
17 2022-03-11 1647032400000 0 1647007200000
18 2022-03-12 1647118800000 1 1647093600000
19 2022-03-13 1647205200000 1 1647180000000
20 2022-03-14 1647291600000 0 1647266400000
21 2022-03-15 1647378000000 0 1647352800000
22 2022-03-16 1647464400000 0 1647439200000
23 2022-03-17 1647550800000 0 1647525600000
24 2022-03-18 1647637200000 0 1647612000000
25 2022-03-19 1647723600000 1 1647698400000
26 2022-03-20 1647810000000 1 1647784800000
27 2022-03-21 1647896400000 0 1647871200000
28 2022-03-22 1647982800000 0 1647957600000
29 2022-03-23 1648069200000 0 1648044000000
30 2022-03-24 1648155600000 0 1648130400000
31 2022-03-25 1648242000000 0 1648216800000
32 2022-03-26 1648328400000 1 1648303200000
33 2022-03-27 1648414800000 1 1648389600000
34 2022-03-28 1648501200000 0 1648476000000
35 2022-03-29 1648587600000 0 1648562400000
38 2022-04-01 1648846800000 0 1648821600000
39 2022-04-02 1648933200000 1 1648908000000
40 2022-04-03 1649019600000 1 1648994400000
41 2022-04-04 1649106000000 0 1649080800000
42 2022-04-05 1649192400000 0 1649167200000
43 2022-04-06 1649278800000 0 1649253600000
44 2022-04-07 1649365200000 0 1649340000000
45 2022-04-08 1649451600000 0 1649426400000
46 2022-04-09 1649538000000 1 1649512800000
47 2022-04-10 1649624400000 1 1649599200000
48 2022-04-11 1649710800000 0 1649685600000
49 2022-04-12 1649797200000 0 1649772000000
50 2022-04-13 1649883600000 0 1649858400000
51 2022-04-14 1649970000000 0 1649944800000
52 2022-04-15 1650056400000 0 1650031200000
53 2022-04-16 1650142800000 1 1650117600000
54 2022-04-17 1650229200000 1 1650204000000
55 2022-04-18 1650315600000 0 1650290400000
56 2022-04-19 1650402000000 0 1650376800000
57 2022-04-20 1650488400000 0 1650463200000
58 2022-04-21 1650574800000 0 1650549600000
59 2022-04-22 1650661200000 0 1650636000000
60 2022-04-23 1650747600000 1 1650722400000
61 2022-04-24 1650834000000 1 1650808800000
62 2022-04-25 1650920400000 0 1650895200000
63 2022-04-26 1651006800000 0 1650981600000
64 2022-04-27 1651093200000 0 1651068000000
65 2022-04-28 1651179600000 0 1651154400000
66 2022-04-29 1651266000000 0 1651240800000
67 2022-04-30 1651352400000 1 1651327200000
68 2022-05-01 1651438800000 1 1651413600000
69 2022-05-02 1651525200000 0 1651500000000
70 2022-05-03 1651611600000 0 1651586400000
71 2022-05-04 1651698000000 0 1651672800000
72 2022-05-05 1651784400000 0 1651759200000
73 2022-05-06 1651870800000 0 1651845600000
74 2022-05-07 1651957200000 1 1651932000000
75 2022-05-08 1652043600000 1 1652018400000
76 2022-05-09 1652130000000 0 1652104800000
77 2022-05-10 1652216400000 0 1652191200000
78 2022-05-11 1652302800000 0 1652277600000
79 2022-05-12 1652389200000 0 1652364000000
80 2022-05-13 1652475600000 0 1652450400000
81 2022-05-14 1652562000000 1 1652536800000
82 2022-05-15 1652648400000 1 1652623200000
83 2022-05-16 1652734800000 0 1652709600000
84 2022-05-17 1652821200000 0 1652796000000
85 2022-05-18 1652907600000 0 1652882400000
86 2022-05-19 1652994000000 0 1652968800000
87 2022-05-20 1653080400000 0 1653055200000
88 2022-05-21 1653166800000 1 1653141600000
89 2022-05-22 1653253200000 1 1653228000000
90 2022-05-23 1653339600000 0 1653314400000
91 2022-05-24 1653426000000 0 1653400800000
92 2022-05-25 1653512400000 0 1653487200000
93 2022-05-26 1653598800000 0 1653573600000
94 2022-05-27 1653685200000 0 1653660000000
95 2022-05-28 1653771600000 1 1653746400000
96 2022-05-29 1653858000000 1 1653832800000
97 2022-05-30 1653944400000 0 1653919200000
98 2022-05-31 1654030800000 0 1654005600000
99 2022-06-01 1654117200000 0 1654092000000
100 2022-06-02 1654203600000 0 1654178400000
101 2022-06-03 1654290000000 0 1654264800000
102 2022-06-04 1654376400000 1 1654351200000
103 2022-06-05 1654462800000 1 1654437600000
104 2022-06-06 1654549200000 0 1654524000000
105 2022-06-07 1654635600000 0 1654610400000
106 2022-06-08 1654722000000 0 1654696800000
107 2022-06-09 1654808400000 0 1654783200000
108 2022-06-10 1654894800000 0 1654869600000
109 2022-06-11 1654981200000 1 1654956000000
110 2022-06-12 1655067600000 1 1655042400000
111 2022-06-13 1655154000000 0 1655128800000
112 2022-06-14 1655240400000 0 1655215200000
113 2022-06-15 1655326800000 0 1655301600000
114 2022-06-16 1655413200000 0 1655388000000
115 2022-06-17 1655499600000 0 1655474400000
116 2022-06-18 1655586000000 1 1655560800000
117 2022-06-19 1655672400000 1 1655647200000
118 2022-06-20 1655758800000 0 1655733600000
119 2022-06-21 1655845200000 0 1655820000000
120 2022-06-22 1655931600000 0 1655906400000
121 2022-06-23 1656018000000 0 1655992800000
122 2022-06-24 1656104400000 0 1656079200000
123 2022-06-25 1656190800000 1 1656165600000
124 2022-06-26 1656277200000 1 1656252000000
125 2022-06-27 1656363600000 0 1656338400000
126 2022-06-28 1656450000000 0 1656424800000
127 2022-06-29 1656536400000 0 1656511200000
128 2022-06-30 1656622800000 0 1656597600000
129 2022-07-01 1656709200000 0 1656684000000
130 2022-07-02 1656795600000 1 1656770400000
131 2022-07-03 1656882000000 1 1656856800000
132 2022-07-04 1656968400000 0 1656943200000
133 2022-07-05 1657054800000 0 1657029600000
134 2022-07-06 1657141200000 0 1657116000000
135 2022-07-07 1657227600000 0 1657202400000
136 2022-07-08 1657314000000 0 1657288800000
37 2022-03-31 1648774800000 0 1648735200000
137 2022-07-09 1657400400000 1 1657375200000
138 2022-07-10 1657486800000 1 1657461600000
139 2022-07-11 1657573200000 0 1657548000000
140 2022-07-12 1657659600000 0 1657634400000
141 2022-07-13 1657746000000 0 1657720800000
142 2022-07-14 1657832400000 0 1657807200000
143 2022-07-15 1657918800000 0 1657893600000
144 2022-07-16 1658005200000 1 1657980000000
145 2022-07-17 1658091600000 1 1658066400000
146 2022-07-18 1658178000000 0 1658152800000
147 2022-07-19 1658264400000 0 1658239200000
148 2022-07-20 1658350800000 0 1658325600000
149 2022-07-21 1658437200000 0 1658412000000
150 2022-07-22 1658523600000 0 1658498400000
151 2022-07-23 1658610000000 1 1658584800000
152 2022-07-24 1658696400000 1 1658671200000
153 2022-07-25 1658782800000 0 1658757600000
154 2022-07-26 1658869200000 0 1658844000000
155 2022-07-27 1658955600000 0 1658930400000
156 2022-07-28 1659042000000 0 1659016800000
157 2022-07-29 1659128400000 0 1659103200000
158 2022-07-30 1659214800000 1 1659189600000
159 2022-07-31 1659301200000 1 1659276000000
160 2022-08-01 1659387600000 0 1659362400000
161 2022-08-02 1659474000000 0 1659448800000
162 2022-08-03 1659560400000 0 1659535200000
163 2022-08-04 1659646800000 0 1659621600000
164 2022-08-05 1659733200000 0 1659708000000
165 2022-08-06 1659819600000 1 1659794400000
166 2022-08-07 1659906000000 1 1659880800000
167 2022-08-08 1659992400000 0 1659967200000
168 2022-08-09 1660078800000 0 1660053600000
169 2022-08-10 1660165200000 0 1660140000000
170 2022-08-11 1660251600000 0 1660226400000
171 2022-08-12 1660338000000 0 1660312800000
172 2022-08-13 1660424400000 1 1660399200000
173 2022-08-14 1660510800000 1 1660485600000
174 2022-08-15 1660597200000 0 1660572000000
175 2022-08-16 1660683600000 0 1660658400000
176 2022-08-17 1660770000000 0 1660744800000
177 2022-08-18 1660856400000 0 1660831200000
178 2022-08-19 1660942800000 0 1660917600000
179 2022-08-20 1661029200000 1 1661004000000
180 2022-08-21 1661115600000 1 1661090400000
181 2022-08-22 1661202000000 0 1661176800000
182 2022-08-23 1661288400000 0 1661263200000
183 2022-08-24 1661374800000 0 1661349600000
184 2022-08-25 1661461200000 0 1661436000000
185 2022-08-26 1661547600000 0 1661522400000
186 2022-08-27 1661634000000 1 1661608800000
187 2022-08-28 1661720400000 1 1661695200000
188 2022-08-29 1661806800000 0 1661781600000
189 2022-08-30 1661893200000 0 1661868000000
190 2022-08-31 1661979600000 0 1661954400000
191 2022-09-01 1662066000000 0 1662040800000
192 2022-09-02 1662152400000 0 1662127200000
193 2022-09-03 1662238800000 1 1662213600000
194 2022-09-04 1662325200000 1 1662300000000
195 2022-09-05 1662411600000 0 1662386400000
196 2022-09-06 1662498000000 0 1662472800000
197 2022-09-07 1662584400000 0 1662559200000
198 2022-09-08 1662670800000 0 1662645600000
199 2022-09-09 1662757200000 0 1662732000000
200 2022-09-10 1662843600000 1 1662818400000
201 2022-09-11 1662930000000 1 1662904800000
202 2022-09-12 1663016400000 0 1662991200000
203 2022-09-13 1663102800000 0 1663077600000
204 2022-09-14 1663189200000 0 1663164000000
205 2022-09-15 1663275600000 0 1663250400000
206 2022-09-16 1663362000000 0 1663336800000
207 2022-09-17 1663448400000 1 1663423200000
208 2022-09-18 1663534800000 1 1663509600000
209 2022-09-19 1663621200000 0 1663596000000
210 2022-09-20 1663707600000 0 1663682400000
211 2022-09-21 1663794000000 0 1663768800000
212 2022-09-22 1663880400000 0 1663855200000
213 2022-09-23 1663966800000 0 1663941600000
214 2022-09-24 1664053200000 1 1664028000000
215 2022-09-25 1664139600000 1 1664114400000
216 2022-09-26 1664226000000 0 1664200800000
217 2022-09-27 1664312400000 0 1664287200000
218 2022-09-28 1664398800000 0 1664373600000
219 2022-09-29 1664485200000 0 1664460000000
220 2022-09-30 1664571600000 0 1664546400000
221 2022-10-01 1664658000000 1 1664632800000
222 2022-10-02 1664744400000 1 1664719200000
223 2022-10-03 1664830800000 0 1664805600000
224 2022-10-04 1664917200000 0 1664892000000
225 2022-10-05 1665003600000 0 1664978400000
226 2022-10-06 1665090000000 0 1665064800000
227 2022-10-07 1665176400000 0 1665151200000
228 2022-10-08 1665262800000 1 1665237600000
229 2022-10-09 1665349200000 1 1665324000000
230 2022-10-10 1665435600000 0 1665410400000
231 2022-10-11 1665522000000 0 1665496800000
232 2022-10-12 1665608400000 0 1665583200000
233 2022-10-13 1665694800000 0 1665669600000
234 2022-10-14 1665781200000 0 1665756000000
235 2022-10-15 1665867600000 1 1665842400000
236 2022-10-16 1665954000000 1 1665928800000
237 2022-10-17 1666040400000 0 1666015200000
238 2022-10-18 1666126800000 0 1666101600000
239 2022-10-19 1666213200000 0 1666188000000
240 2022-10-20 1666299600000 0 1666274400000
241 2022-10-21 1666386000000 0 1666360800000
242 2022-10-22 1666472400000 1 1666447200000
243 2022-10-23 1666558800000 1 1666533600000
244 2022-10-24 1666645200000 0 1666620000000
245 2022-10-25 1666731600000 0 1666706400000
246 2022-10-26 1666818000000 0 1666792800000
247 2022-10-27 1666904400000 0 1666879200000
248 2022-10-28 1666990800000 0 1666965600000
249 2022-10-29 1667077200000 1 1667052000000
250 2022-10-30 1667163600000 1 1667138400000
251 2022-10-31 1667250000000 0 1667224800000
252 2022-11-01 1667336400000 0 1667311200000
253 2022-11-02 1667422800000 0 1667397600000
254 2022-11-03 1667509200000 0 1667484000000
255 2022-11-04 1667595600000 0 1667570400000
256 2022-11-05 1667682000000 1 1667656800000
257 2022-11-06 1667768400000 1 1667743200000
258 2022-11-07 1667854800000 0 1667829600000
259 2022-11-08 1667941200000 0 1667916000000
260 2022-11-09 1668027600000 0 1668002400000
261 2022-11-10 1668114000000 0 1668088800000
262 2022-11-11 1668200400000 0 1668175200000
263 2022-11-12 1668286800000 1 1668261600000
264 2022-11-13 1668373200000 1 1668348000000
265 2022-11-14 1668459600000 0 1668434400000
266 2022-11-15 1668546000000 0 1668520800000
267 2022-11-16 1668632400000 0 1668607200000
268 2022-11-17 1668718800000 0 1668693600000
269 2022-11-18 1668805200000 0 1668780000000
270 2022-11-19 1668891600000 1 1668866400000
271 2022-11-20 1668978000000 1 1668952800000
272 2022-11-21 1669064400000 0 1669039200000
273 2022-11-22 1669150800000 0 1669125600000
274 2022-11-23 1669237200000 0 1669212000000
275 2022-11-24 1669323600000 0 1669298400000
276 2022-11-25 1669410000000 0 1669384800000
277 2022-11-26 1669496400000 1 1669471200000
278 2022-11-27 1669582800000 1 1669557600000
279 2022-11-28 1669669200000 0 1669644000000
280 2022-11-29 1669755600000 0 1669730400000
281 2022-11-30 1669842000000 0 1669816800000
282 2022-12-01 1669928400000 0 1669903200000
283 2022-12-02 1670014800000 0 1669989600000
284 2022-12-03 1670101200000 1 1670076000000
285 2022-12-04 1670187600000 1 1670162400000
286 2022-12-05 1670274000000 0 1670248800000
287 2022-12-06 1670360400000 0 1670335200000
288 2022-12-07 1670446800000 0 1670421600000
289 2022-12-08 1670533200000 0 1670508000000
290 2022-12-09 1670619600000 0 1670594400000
291 2022-12-10 1670706000000 1 1670680800000
292 2022-12-11 1670792400000 1 1670767200000
293 2022-12-12 1670878800000 0 1670853600000
294 2022-12-13 1670965200000 0 1670940000000
295 2022-12-14 1671051600000 0 1671026400000
296 2022-12-15 1671138000000 0 1671112800000
297 2022-12-16 1671224400000 0 1671199200000
298 2022-12-17 1671310800000 1 1671285600000
299 2022-12-18 1671397200000 1 1671372000000
300 2022-12-19 1671483600000 0 1671458400000
301 2022-12-20 1671570000000 0 1671544800000
302 2022-12-21 1671656400000 0 1671631200000
303 2022-12-22 1671742800000 0 1671717600000
304 2022-12-23 1671829200000 0 1671804000000
305 2022-12-24 1671915600000 1 1671890400000
306 2022-12-25 1672002000000 1 1671976800000
307 2022-12-26 1672088400000 0 1672063200000
308 2022-12-27 1672174800000 0 1672149600000
309 2022-12-28 1672261200000 0 1672236000000
310 2022-12-29 1672347600000 0 1672322400000
36 2022-03-30 1648706400000 0 1648648800000
\.
--
-- TOC entry 3359 (class 0 OID 34688)
-- Dependencies: 211
-- Data for Name: stock_price; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.stock_price (sp_id, open_price, pre_close, price, today_high, today_low, updated_time, stock_id) FROM stdin;
7 422.63572943320736 450 422.18116792872917 422.96282224712536 321.65 1648697525455 7
10 300.64016939010804 0 300.9562538200276 301.7975566222608 250.45650000426235 1648700267750 10
12 52.5 0 52.38421158587859 52.52175946745809 52.3272511685133 1648770231888 12
8 157.50199953899372 0 157.43512847053557 157.72003097434512 124.05763440861132 1648697582710 8
9 265.7122361585115 0 266.4327274840803 266.6914199649569 206.23 1648697653269 9
6 1104.9031022718143 950 1107.9722225984638 1108.7668780175484 851.0536126015978 1648697451275 6
11 2753.0995450577466 0 2761.6431013727147 2762.1407285108403 2300.5 1648700805433 11
\.
--
-- TOC entry 3360 (class 0 OID 34693)
-- Dependencies: 212
-- Data for Name: stocks; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.stocks (stock_id, creation_time, name, price, purchased_quantity, stock_symbol, total_quantity) FROM stdin;
9 1648697653269 Apple Computers 206.23 55000 APPLE 650000
10 1648700267750 Intel Inc 250.5 5000 INTEL 200000
11 1648700805433 Amazon 2300.5 100000 AMZN 600000
6 1648697451275 Tesla Inc 853.25 50001 TESLA 120000
7 1648697525455 Netflix Inc 321.65 6003 NFLEX 250000
12 1648770231888 Bank of America 52.5 5000 BOA 100000
8 1648697582710 Advanced Micro Devices 124.36 5003 AMD 50000
\.
--
-- TOC entry 3361 (class 0 OID 34700)
-- Dependencies: 213
-- Data for Name: transaction_dtl; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.transaction_dtl (tid, purchased_rate, quantity, total_amount, transaction_time, transaction_type, stock_id, user_id) FROM stdin;
17 929.1407235380728 1 929.1407235380728 1648701730863 0 6 8
18 362.4595740526055 5 1812.2978702630276 1648702376441 0 7 12
19 363.84243964156235 2 727.6848792831247 1648702568302 1 7 12
20 136.5463384538214 5 682.7316922691069 1648703378311 0 8 15
21 136.9148398276211 2 273.8296796552422 1648703436646 1 8 15
22 157.2484064475986 10 1572.484064475986 1648770546412 0 8 18
23 157.18636906993524 10 1571.8636906993524 1648770610866 1 8 18
\.
--
-- TOC entry 3362 (class 0 OID 34705)
-- Dependencies: 214
-- Data for Name: user_dtl; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.user_dtl (user_id, cash_balance, creation_time, email, firstname, lastname, pwd, used_cash, user_role, username) FROM stdin;
8 3570.859276461927 1648701363483 [email protected] Kathan gajjar jass1234 2872.859276461927 0 kgajjar123
11 0 1648702042874 [email protected] Darshan Kansara jassmin1234 0 0 drk44211
12 2704.387009020097 1648702143161 [email protected] Dhrumil Modi jass1234 5584.612990979904 0 modi1234
15 4091.097987386135 1648703120800 [email protected] Vinay Nanani jass1234 3556.6020126138646 0 vnanani123
18 4499.379626223366 1648770363476 [email protected] Meet Patel jass1234 3749.2703737766333 0 meetpatel
1 69115820.65734737 1648676713088 [email protected] Jashmin Patel jass123 -69037252.62911534 1 JashminPatel
\.
--
-- TOC entry 3374 (class 0 OID 0)
-- Dependencies: 215
-- Name: hibernate_sequence; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.hibernate_sequence', 20, true);
--
-- TOC entry 3375 (class 0 OID 0)
-- Dependencies: 216
-- Name: stock_price_sequence; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.stock_price_sequence', 12, true);
--
-- TOC entry 3376 (class 0 OID 0)
-- Dependencies: 217
-- Name: stocks_limitorder_sequence; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.stocks_limitorder_sequence', 20, true);
--
-- TOC entry 3377 (class 0 OID 0)
-- Dependencies: 218
-- Name: stocks_sequence; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.stocks_sequence', 12, true);
--
-- TOC entry 3378 (class 0 OID 0)
-- Dependencies: 219
-- Name: stocks_transaction_sequence; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('public.stocks_transaction_sequence', 23, true);
--
-- TOC entry 3193 (class 2606 OID 34677)
-- Name: cash_transaction cash_transaction_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.cash_transaction
ADD CONSTRAINT cash_transaction_pkey PRIMARY KEY (ct_id);
--
-- TOC entry 3195 (class 2606 OID 34682)
-- Name: limit_order_transaction limit_order_transaction_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.limit_order_transaction
ADD CONSTRAINT limit_order_transaction_pkey PRIMARY KEY (order_id);
--
-- TOC entry 3209 (class 2606 OID 34777)
-- Name: market_schedule market_schedule_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.market_schedule
ADD CONSTRAINT market_schedule_pkey PRIMARY KEY (id);
--
-- TOC entry 3197 (class 2606 OID 34692)
-- Name: stock_price stock_price_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.stock_price
ADD CONSTRAINT stock_price_pkey PRIMARY KEY (sp_id);
--
-- TOC entry 3199 (class 2606 OID 34699)
-- Name: stocks stocks_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.stocks
ADD CONSTRAINT stocks_pkey PRIMARY KEY (stock_id);
--
-- TOC entry 3203 (class 2606 OID 34704)
-- Name: transaction_dtl transaction_dtl_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.transaction_dtl
ADD CONSTRAINT transaction_dtl_pkey PRIMARY KEY (tid);
--
-- TOC entry 3201 (class 2606 OID 34715)
-- Name: stocks uk3rr8ninft13rsl2jsadb301s7; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.stocks
ADD CONSTRAINT uk3rr8ninft13rsl2jsadb301s7 UNIQUE (name, stock_symbol);
--
-- TOC entry 3205 (class 2606 OID 34717)
-- Name: user_dtl uk8mvh9jydh1693ta13bwih9lh2; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_dtl
ADD CONSTRAINT uk8mvh9jydh1693ta13bwih9lh2 UNIQUE (username, email);
--
-- TOC entry 3211 (class 2606 OID 34779)
-- Name: market_schedule uklqu1rxd8b064wt0ad9a0g27on; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.market_schedule
ADD CONSTRAINT uklqu1rxd8b064wt0ad9a0g27on UNIQUE (dates);
--
-- TOC entry 3207 (class 2606 OID 34711)
-- Name: user_dtl user_dtl_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.user_dtl
ADD CONSTRAINT user_dtl_pkey PRIMARY KEY (user_id);
--
-- TOC entry 3213 (class 2606 OID 34728)
-- Name: limit_order_transaction fke4pu72788qx4uwwygpso7jwkp; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.limit_order_transaction
ADD CONSTRAINT fke4pu72788qx4uwwygpso7jwkp FOREIGN KEY (stock_id) REFERENCES public.stocks(stock_id);
--
-- TOC entry 3216 (class 2606 OID 34743)
-- Name: transaction_dtl fkivt0bt3mj0ypw7qkawofgowec; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.transaction_dtl
ADD CONSTRAINT fkivt0bt3mj0ypw7qkawofgowec FOREIGN KEY (stock_id) REFERENCES public.stocks(stock_id);
--
-- TOC entry 3214 (class 2606 OID 34733)
-- Name: limit_order_transaction fkm9it54im1cgyd5p5efcdf2ef; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.limit_order_transaction
ADD CONSTRAINT fkm9it54im1cgyd5p5efcdf2ef FOREIGN KEY (user_id) REFERENCES public.user_dtl(user_id);
--
-- TOC entry 3215 (class 2606 OID 34738)
-- Name: stock_price fknetkc6jd2fqjke45n31ejdvk; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.stock_price
ADD CONSTRAINT fknetkc6jd2fqjke45n31ejdvk FOREIGN KEY (stock_id) REFERENCES public.stocks(stock_id);
--
-- TOC entry 3217 (class 2606 OID 34748)
-- Name: transaction_dtl fks5eh27n5xv7t5vvpvsuibn9lf; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.transaction_dtl
ADD CONSTRAINT fks5eh27n5xv7t5vvpvsuibn9lf FOREIGN KEY (user_id) REFERENCES public.user_dtl(user_id);
--
-- TOC entry 3212 (class 2606 OID 34723)
-- Name: cash_transaction fksgj6vph1og41x3majra0mtk86; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.cash_transaction
ADD CONSTRAINT fksgj6vph1og41x3majra0mtk86 FOREIGN KEY (user_id) REFERENCES public.user_dtl(user_id);
-- Completed on 2022-03-31 17:30:55
--
-- PostgreSQL database dump complete
--