-
Notifications
You must be signed in to change notification settings - Fork 0
/
marau.sql
1331 lines (939 loc) · 74.1 KB
/
marau.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
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Feb 09, 2022 at 11:49 AM
-- Server version: 5.7.31
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `marau`
--
CREATE DATABASE IF NOT EXISTS `marau` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `marau`;
DELIMITER $$
--
-- Procedures
--
DROP PROCEDURE IF EXISTS `Add_Account`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Add_Account` (IN `Username` VARCHAR(50), IN `fName` VARCHAR(100), IN `mName` VARCHAR(100), IN `lName` VARCHAR(100), IN `PasswordHash` VARCHAR(256), IN `EmailAddress` VARCHAR(256), IN `Gender` CHAR(1), IN `BirthDate` DATE, IN `AccountType` INT, IN `Country` VARCHAR(100), IN `ContactEmail` VARCHAR(256), IN `addID` INT) BEGIN
declare Account_ID int;
declare Last_ID int;
INSERT INTO accounts(Username, fName,mName,lName, PasswordHash, EmailAddress, Gender, BirthDate,Status)
VALUES (Username,fName,mName,lName,PasswordHash, EmailAddress,Gender,BirthDate,0);
set Account_ID = LAST_INSERT_ID();
if AccountType = 0 then
insert into buyers(AccountId,Country,ContactEmail,Strikes,Balance) values (Account_ID,Country,ContactEmail,0,0);
set Last_ID = LAST_INSERT_ID();
elseif AccountType=1 then
insert into sellers(AccountId,Country,ContactEmail,Strikes,Balance) values (Account_ID,Country,ContactEmail,0,0);
set Last_ID = LAST_INSERT_ID();
else
insert into moderators (AccountId,addedbyid) values (Account_ID,addID);
UPDATE accounts SET Status=1 WHERE AccountId=Account_Id;
set Last_ID = LAST_INSERT_ID();
END IF;
select Account_ID,Last_ID;
END$$
DROP PROCEDURE IF EXISTS `Add_Bid`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Add_Bid` (IN `BidBuyerId` INT, IN `BidAuctionId` INT, IN `BidAmount` DOUBLE) BEGIN
DECLARE _HighestBidAmount int;
DECLARE _StartDate datetime;
DECLARE _EndDate datetime;
DECLARE _BuyerId int;
DECLARE _BuyerBalance double;
SET @_CurrTime = NOW();
SELECT auction_details.HighestBidAmount, auction_details.StartDate, auction_details.EndDate, auction_details.HighestBidBuyerId INTO _HighestBidAmount, _StartDate, _EndDate, _BuyerId FROM auction_details WHERE auction_details.AuctionId = BidAuctionId;
SELECT buyers.Balance INTO _BuyerBalance FROM buyers WHERE buyers.BuyerId = BidBuyerId;
IF (_HighestBidAmount < BidAmount AND _EndDate > @_CurrTime AND _StartDate < @_CurrTime AND _BuyerBalance >= BidAmount) THEN
INSERT INTO bids (bids.BuyerId, bids.AuctionId, bids.BidAmount, bids.Date)
VALUES (BidBuyerId, BidAuctionId, BidAmount, NOW());
UPDATE buyers
SET buyers.Balance = buyers.Balance + _HighestBidAmount
WHERE buyers.BuyerId = _BuyerId;
UPDATE buyers
SET buyers.Balance = buyers.Balance - BidAmount
WHERE buyers.BuyerId = BidBuyerId;
UPDATE auctions
SET auctions.HighestBidId = LAST_INSERT_ID()
WHERE auctions.AuctionId = BidAuctionId;
SELECT LAST_INSERT_ID() AS ID;
ELSE
SELECT -1 as ID;
END IF;
END$$
DROP PROCEDURE IF EXISTS `Add_Currency`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Add_Currency` (`Id` INT, `amount` INT) BEGIN
update buyers
set Balance = Balance + amount
where BuyerId = Id;
END$$
DROP PROCEDURE IF EXISTS `Add_Game`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Add_Game` (IN `sellerId` INT, IN `name` VARCHAR(100), IN `description` VARCHAR(250), IN `releaseDate` DATETIME, IN `price` DOUBLE, IN `version` VARCHAR(10), IN `type` VARCHAR(50), IN `sale` DOUBLE) BEGIN
declare result int;
declare ID int;
insert into games (SellerId,Name,Description,ReleaseDate,Price,Version,Type,Sale)
values (sellerId, name, description, releaseDate, price, version, type, sale);
set ID = LAST_INSERT_ID();
INSERT INTO auctions (GameId,StartDate,EndDate)
Values (ID,now(),DATE_ADD(NOW(), INTERVAL 1 HOUR));
Select ID;
END$$
DROP PROCEDURE IF EXISTS `Add_Game_Requirements`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Add_Game_Requirements` (`GameId` INT, `OperatingSystem` VARCHAR(50), `MinimumCPU` VARCHAR(50), `RecommendedCPU` VARCHAR(50), `MinimumGPU` VARCHAR(50), `RecommendedGPU` VARCHAR(50), `MinimumRam` INT, `RecommendedRam` INT, `Storage` INT) BEGIN
insert into requirements
values (GameId, OperatingSystem, MinimumCPU, RecommendedCPU, MinimumGPU, RecommendedGPU, MinimumRam, RecommendedRam, Storage);
END$$
DROP PROCEDURE IF EXISTS `Add_Review`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Add_Review` (`gId` INT, `bId` INT, `rText` VARCHAR(100), `rRating` DOUBLE) BEGIN
insert into reviews
values (gId, bId, rText, rRating);
END$$
DROP PROCEDURE IF EXISTS `Approved_By`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Approved_By` (IN `Account_ID` INT, IN `mod_id` INT) BEGIN
UPDATE sellers set ApprovedBy=mod_id WHERE AccountId=Account_ID;
UPDATE buyers set ApprovedBy=mod_id WHERE AccountId=Account_ID;
END$$
DROP PROCEDURE IF EXISTS `AveragePriceallgames`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `AveragePriceallgames` () BEGIN
SELECT AVG(Price) as average_price
from games;
END$$
DROP PROCEDURE IF EXISTS `BidOnAuction`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `BidOnAuction` (IN `BidBuyerId` INT, IN `BidAuctionId` INT, IN `BidAmount` DOUBLE) BEGIN
DECLARE _HighestBidAmount int;
DECLARE _EndDate datetime;
DECLARE _BuyerId int;
SELECT _HighestBidAmount = auction_details.HighestBidAmount, _EndDate = auction_details.EndDate, _BuyerId = auction_details.HighestBidBuyerId FROM auction_details WHERE auction_details.AuctionId = BidAuctionId;
INSERT INTO bids (bids.BuyerId, bids.AuctionId, bids.BidAmount, bids.Date)
VALUES (BidBuyerId, BidAuctionId, BidAmount, NOW());
END$$
DROP PROCEDURE IF EXISTS `Change_Password`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Change_Password` (IN `Account_ID` INT, IN `_password` VARCHAR(256)) UPDATE accounts SET PasswordHash=_password WHERE Account_ID=AccountId$$
DROP PROCEDURE IF EXISTS `ClaimGame`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `ClaimGame` (IN `WinnerAuctionId` INT) BEGIN
DECLARE _BuyerId int;
DECLARE _GameId int;
DECLARE _EndDate datetime;
DECLARE _Amount double;
SELECT auction_details.HighestBidBuyerId, auction_details.GameId, auction_details.EndDate, auction_details.HighestBidAmount
INTO _BuyerId, _GameId, _EndDate, _Amount
FROM auction_details
WHERE auction_details.AuctionId = WinnerAuctionId;
IF(NOW() > _EndDate) THEN
INSERT INTO orders VALUES (_BuyerId, _GameId, _EndDate, _Amount);
UPDATE games SET games.FirstOwner = _BuyerId WHERE games.GameId = _GameId;
update sellers
set Balance = Balance + _Amount
where SellerId = (select SellerId from games where GameId = _GameId);
END IF;
END$$
DROP PROCEDURE IF EXISTS `delete_gamebyid`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_gamebyid` (IN `id_games` INT) BEGIN
DELETE FROM games
WHERE games.GameId = id_games;
END$$
DROP PROCEDURE IF EXISTS `delete_review`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_review` (IN `id_games` INT, IN `id_buyer` INT) BEGIN
DELETE FROM reviews
WHERE reviews.GameId = id_games
AND reviews.BuyerId = id_buyer;
END$$
DROP PROCEDURE IF EXISTS `Edit_Account`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Edit_Account` (IN `Account_Id` INT, IN `Username` VARCHAR(50), IN `fName` VARCHAR(100), IN `mName` VARCHAR(100), IN `lName` VARCHAR(100), IN `EmailAddress` VARCHAR(256), IN `Gender` CHAR(1), IN `BirthDate` DATE, IN `AccountType` INT, IN `Country` VARCHAR(100), IN `ContactEmail` VARCHAR(256)) BEGIN
UPDATE accounts SET Username=Username,fName=fName,mName=mName,lName=lName,EmailAddress=EmailAddress, Gender=Gender, BirthDate=BirthDate
WHERE AccountId=Account_Id;
if AccountType = 0 then
UPDATE buyers SET Country=Country,ContactEmail=ContactEmail WHERE AccountId=Account_Id;
else
UPDATE sellers SET Country=Country,ContactEmail=ContactEmail WHERE AccountId=Account_Id;
END IF;
END$$
DROP PROCEDURE IF EXISTS `Edit_Game`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Edit_Game` (`GameId` INT, `Name` VARCHAR(100), `Description` VARCHAR(250), `ReleaseDate` DATE, `Price` DOUBLE, `Version` VARCHAR(10), `Type` VARCHAR(50), `Sale` DOUBLE) BEGIN
update games
set games.Name = Name ,
games.Name = Name ,
games.Description = Description ,
games.ReleaseDate = ReleaseDate ,
games.Price = Price ,
games.Version = Version ,
games.Type = Type ,
games.Sale = Sale
where games.GameId = GameId;
END$$
DROP PROCEDURE IF EXISTS `Edit_Game_Requirements`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Edit_Game_Requirements` (`GameId` INT, `OperatingSystem` VARCHAR(50), `MinimumCPU` VARCHAR(50), `RecommendedCPU` VARCHAR(50), `MinimumGPU` VARCHAR(50), `RecommendedGPU` VARCHAR(50), `MinimumRam` INT, `RecommendedRam` INT, `Storage` INT) BEGIN
update requirements
set requirements.OperatingSystem = OperatingSystem,
requirements.MinimumCPU = MinimumCPU,
requirements.RecommendedCPU = RecommendedCPU,
requirements.MinimumGPU = MinimumGPU,
requirements.RecommendedGPU = RecommendedGPU,
requirements.MinimumRam = MinimumRam,
requirements.RecommendedRam = RecommendedRam,
requirements.Storage = Storage
where requirements.GameId = GameId;
END$$
DROP PROCEDURE IF EXISTS `Edit_Review`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Edit_Review` (`gId` INT, `bId` INT, `rText` VARCHAR(100), `rRating` DOUBLE) BEGIN
update reviews
set Text = rText,
Rating = rRating
where GameId = gId and BuyerId = bId;
END$$
DROP PROCEDURE IF EXISTS `GameCountAccordingToSeller`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `GameCountAccordingToSeller` () BEGIN
SELECT COUNT(games.GameId) as games_count, Username
from games, sellers,accounts
WHERE games.SellerId = sellers.SellerId
AND sellers.AccountId = accounts.AccountId
GROUP BY games.SellerId ORDER by COUNT(games.GameId) limit 10;
END$$
DROP PROCEDURE IF EXISTS `GamesCountAccordingToType`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `GamesCountAccordingToType` () BEGIN
SELECT Type, COUNT(*) as games_count
from games
GROUP BY Type limit 10;
END$$
DROP PROCEDURE IF EXISTS `GamesOrderedByNumberOfOrders`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `GamesOrderedByNumberOfOrders` () BEGIN
SELECT games.Name , COUNT(*) as orders_count
from games, orders
WHERE games.GameId = orders.GameId
GROUP BY games.Name,games.GameId
ORDER BY orders_count DESC limit 10;
END$$
DROP PROCEDURE IF EXISTS `general_statistics`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `general_statistics` () BEGIN
SELECT (SELECT COUNT(*)
from buyers) as 'Buyers',(SELECT COUNT(*)
from sellers) as 'Sellers',(SELECT COUNT(*)
from games) as 'Games';
END$$
DROP PROCEDURE IF EXISTS `get_all_countries`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_countries` () BEGIN
select country,count(1) as 'Count' from Account_info group by country having Country <> "" limit 10;
END$$
DROP PROCEDURE IF EXISTS `Get_Buyer_Games`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Get_Buyer_Games` (IN `Buyer_id` INT) BEGIN
SELECT games_details.GameId,games_details.Name
from games_details,orders
WHERE orders.GameId = games_details.GameId
AND orders.BuyerId = Buyer_id;
END$$
DROP PROCEDURE IF EXISTS `Get_Seller_Games`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Get_Seller_Games` (IN `Seller_id` INT) BEGIN
SELECT games_details.GameId,games_details.Name,games_details.Rating
from games_details
WHERE games_details.SellerId = Seller_id;
END$$
DROP PROCEDURE IF EXISTS `Order_Game`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Order_Game` (`bId` INT, `gId` INT) BEGIN
declare gamePrice int;
declare bbalance int;
IF (select count(*) from orders where BuyerId = bId and GameId = gId) = 0 then
set gamePrice = (select ( Price * ((100 - Sale) / 100 )) from games where GameId = gId);
set bbalance = (select Balance from buyers where BuyerId = bId);
IF bbalance >= gamePrice then
update buyers
set Balance = Balance - gamePrice
where BuyerId = bId;
insert into orders
values (bId,gId,now(),gamePrice);
update sellers
set Balance = Balance + gamePrice
where SellerId = (select SellerId from games where GameId = gId);
select 1 as ID;
ELSE
select 0 as ID;
END IF;
END IF;
END$$
DROP PROCEDURE IF EXISTS `Set_Account_Status`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Set_Account_Status` (IN `Account_Id` INT, IN `S` INT) BEGIN
UPDATE accounts SET Status=s WHERE AccountId=Account_Id;
END$$
DROP PROCEDURE IF EXISTS `Strike`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Strike` (IN `Account_ID` INT) if EXISTS( SELECT Strikes FROM sellers WHERE AccountId=Account_ID) then UPDATE sellers set strikes=strikes+1 WHERE AccountId=Account_ID;
elseif EXISTS( SELECT Strikes FROM buyers WHERE AccountId=Account_ID) then UPDATE buyers set strikes=strikes+1 WHERE AccountId=Account_ID;
end if$$
DROP PROCEDURE IF EXISTS `Strike_Buyer`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Strike_Buyer` (IN `Buyer_Id` INT) BEGIN
UPDATE buyers set strikes=strikes+1 WHERE BuyerId=Buyer_Id;
IF (SELECT Strikes FROM buyers WHERE buyerId=Buyer_Id)>=3 THEN
call Set_Account_Status((SELECT AccountId FROM buyers WHERE buyerId=Buyer_Id),0);
END IF;
END$$
DROP PROCEDURE IF EXISTS `Strike_Seller`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `Strike_Seller` (IN `Seller_Id` INT) BEGIN
UPDATE sellers set strikes=strikes+1 WHERE sellerId=Seller_Id;
IF (SELECT Strikes FROM sellers WHERE sellerId=Seller_Id)>=3 THEN
call Set_Account_Status((SELECT AccountId FROM sellers WHERE sellerId=Seller_Id),0);
END IF;
END$$
DROP PROCEDURE IF EXISTS `TotalBidsForEveryAuctions`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `TotalBidsForEveryAuctions` () BEGIN
SELECT games.Name , COUNT(*) as bids_count
from games, auctions,bids
WHERE games.GameId = auctions.GameId
AND bids.AuctionId = auctions.AuctionId
GROUP BY auctions.AuctionId
ORDER BY bids_count DESC limit 5;
END$$
DROP PROCEDURE IF EXISTS `TotalNumberofBuyers`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `TotalNumberofBuyers` () BEGIN
SELECT COUNT(*) as buyers_count
from buyers;
END$$
DROP PROCEDURE IF EXISTS `TotalNumberofGames`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `TotalNumberofGames` () BEGIN
SELECT COUNT(*) as games_count
from games;
END$$
DROP PROCEDURE IF EXISTS `TotalNumberOfOrders`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `TotalNumberOfOrders` () BEGIN
SELECT COUNT(*) as orders_count
from orders;
END$$
DROP PROCEDURE IF EXISTS `TotalNumberofSellers`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `TotalNumberofSellers` () BEGIN
SELECT COUNT(*) as sellers_count
from sellers;
END$$
DELIMITER ;
-- --------------------------------------------------------
--
-- Table structure for table `accounts`
--
DROP TABLE IF EXISTS `accounts`;
CREATE TABLE IF NOT EXISTS `accounts` (
`AccountId` int(11) NOT NULL AUTO_INCREMENT,
`Username` varchar(50) CHARACTER SET utf8mb4 NOT NULL,
`fName` varchar(100) CHARACTER SET utf8mb4 DEFAULT NULL,
`mName` varchar(100) DEFAULT NULL,
`lName` varchar(100) DEFAULT NULL,
`PasswordHash` varchar(256) CHARACTER SET utf8mb4 NOT NULL,
`EmailAddress` varchar(256) NOT NULL,
`Gender` char(1) NOT NULL,
`BirthDate` date NOT NULL,
`Status` char(1) DEFAULT NULL,
PRIMARY KEY (`AccountId`),
UNIQUE KEY `UQ_Accounts_Username` (`Username`),
UNIQUE KEY `UQ_Email_Username` (`EmailAddress`(255))
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `accounts`
--
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(7, 'Kotp911', 'Mohamed', 'Kotp', 'A', '$2y$10$E8U5E70FdNHuRFnhTWvNCusVTcZkHON6Dea1Ye6Ed8l3H1SxqxWwq', '[email protected]', 'M', '2021-11-28', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(9, 'Kotp123', 'Mohamed', 'Kotp', 'Amer', '$2y$10$Fu8D/MWOqPdpbHYiUiRPjuwpm2HONGVh9AWmamefpvdo3l5dFyGQi', '[email protected]', 'M', '2000-01-01', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(11, 'Sakr911', 'Mohamed', 'asd', 'Kamal', '$2y$10$pnHppX0Y4JK./KpolLlUpuO3HU2Q9FGDaYnOxATebOopmaYqwIDV6', '[email protected]', 'M', '2021-11-28', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(12, 'Kotp12223', 'Mohamed', 'Mohamed', 'Mohamed', '$2y$10$6mX147csf8pbdVAVa0zRk.rxzsC/glWKP.cFzMpTqLxTrah2LP6XS', '[email protected]', 'M', '2021-11-28', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(13, 'ZED', 'Mohamed', 'Kamal', 'Kamal', '$2y$10$qg55D0uV7PKvl/8obs9kIeiBX8pXDIF0HVcMKp71l6x5VqjI7B6g2', '[email protected]', 'M', '2021-11-28', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(14, 'testacc', 'Test', 'Testm', 'testl', '$2y$10$96KwmbuthVkCvULEUA2ceOVVPeVicPo4r5TtSEfI8rUpQW.eDVyom', '[email protected]', 'F', '2021-12-24', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(15, 'Ahmed', 'Ahmed', 'Hany', 'Farouk', '$2y$10$Jyd/sHY.dKAvcN43n.kAwueQuVc2vC2spwYTt7RjIXkp1gvO1vAzi', '[email protected]', 'M', '2001-11-30', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(16, 'Ahmed1', 'Ahmed', 'Hany', 'Farouk', '$2y$10$Eo/AQMlyNGAHuH8mjeu6IeefSnivrBzINmUaazFuZxu92NKhr75nK', '[email protected]', 'M', '2001-11-30', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(17, 'Ahmed2', 'Ahmed', 'Hany', 'Farouk', '$2y$10$sPgpRfUMzIRGQdia2kQboezfhGFUlaiYKjLT8RGC7D6mXaA2xka2W', '[email protected]', 'M', '2001-11-30', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(18, 'Ahmed3', 'Ahmed', 'Hany', 'Farouk', '$2y$10$Eq.sI1BKxQkcoavLTpGh1OY5cEZbH5rhCA2jJ/6MW9hMfCFiNOk8.', '[email protected]', 'M', '2001-11-30', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(20, 'tt', 'Mohamedt', 't', 't', '$2y$10$jatKdSpqIYYhM3GIyHrhnOKM/rLWS2ek2J0Xtit3jQKfVqImHzZl2', '[email protected]', 'M', '2021-11-28', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(21, 'Administrator', 'General', 'Website', 'Admin', '$2y$10$EMCyFyqdW7dlK5P4xslImuHfFfA16JF.rgbQ3JWxO6VhNkj7ru9Ju', '[email protected]', 'M', '2000-01-01', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(22, 'Moderator', 'Mod1', 'Mod1', 'Mod1', '$2y$10$r/EphkoO2HFYTXNKVvV4I.X9Age5zFrc.WqHdG8LtX6qHaZlVpPN.', '[email protected]', 'M', '2021-11-28', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(23, 'Moderator2', 'Mod2', 'Mod2', 'Mod2', '$2y$10$xmNCTIXkHzA4SGBx3IzGxeR9tFGy4qm4RkWbsARtVkQhgLwbpaT2S', '[email protected]', 'M', '2021-11-28', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(24, 'buyerOne', 'buyer', 'b', 'buyer', '$2y$10$7b2v6Fs4z9J4y9eAPCjGLeTWytV9tsRBqmSPuXacxjYhE07/4h1Zm', '[email protected]', 'M', '2010-02-11', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(25, 'H', 'Ahmed', 'Hany', 'Farouk', '$2y$10$17Dxc3JG6HoKyHZZNfXrgePPp4ZqQ8sTl6KQFrTDiWgxOi4iGHmny', '[email protected]', 'M', '2001-11-30', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(26, 'Rand', 'Buyer', 'Test', 'Account', '$2y$10$OtUoALei/EXIdF5HHqgWLefrnkYO5VJRpGV4NfvaFHyQYYtFNb6Um', '[email protected]', 'M', '2022-01-06', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(27, 'Rand2', 'Buyer', 'Test', 'Account2', '$2y$10$aeedr4ZM4mnHmT643SLkh.FfC0nR6YiNouadjqehitK9NUHL0XdDG', '[email protected]', 'M', '2022-01-06', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(28, 'Moderator3', 'Mohamed', 'Kamal', 'Othman', '$2y$10$UbX1VDvHphVjs02vTk8T3OXYAvhMR6qwpNBdB9k4CSM5WHKWAzdSe', '[email protected]', 'M', '2000-05-09', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(29, 'misterX', 'Mohamed', 'Kamal', 'Moderator2', '$2y$10$LtEnPU2w.G1aCtll8BEaDuAHkOXKfDIM0ddjASQl69Mzdy2n7WQiu', '[email protected]', 'M', '2000-05-07', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(30, 'H123', 'Ahmed', 'Hany', 'Farouk', '$2y$10$CuruNhA/3u4dq00jZ3INlOLOtopCN98PsNlskV0.QoAih1wcDAaFm', '[email protected]', 'M', '2001-11-30', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(31, 'h123b', 'Ahmed', 'Hany', 'Farouk', '$2y$10$fbizoggtt2VGVLMK0K5Ug.FrDL3d0X5mpSF9TAqIxwJpwLITrrI8O', '[email protected]', 'M', '2022-01-07', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(33, 'Kamal', 'Mohamed', 'Kotp', 'Kamal', '$2y$10$CcSQP.avs.lS.udNQwg2J.vpMTdg0eCTwPyW4XQM2UsQ0VxLzrHVe', '[email protected]', 'M', '2021-12-26', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(34, 'BJohnson', 'Becky', 'J', 'Johnson', '$2y$10$vJo3It1I5WwIeKaIpkI8zuPlI5H5UaN/17w.DpraJXISlWXVi2Eti', '[email protected]', 'F', '1969-05-09', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(35, 'Moreland', 'Mark', 'M', 'Moreland', '$2y$10$U3fgeveC9HmRe3..K6gwsO.eBLchTLtbXkX/y/Ex5tBbYg0U.nwTK', '[email protected]', 'M', '1989-06-20', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(36, 'Shealey99', 'Alta', 'P', 'Shealey', '$2y$10$0tOIsBCEtSZw5mUGxv/n2uJ.wNIQ1bO/wLueJBSpMvAfFwczXs1cu', '[email protected]', 'F', '2000-02-15', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(37, 'Brett', 'Brett', 'M', 'Ladd', '$2y$10$BVzJLEXKTXEosGv1EE3nvOLJG.Q4f3MPRc2LBLyuZAKavg1BEk3sq', '[email protected]', 'M', '1999-06-09', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(38, 'Loretta', 'Loretta', 'J', 'Gibbs', '$2y$10$flMutPTLWc6mJr0J4wBw.uryyhFPIZ3FoghL70wPtax3BGPDKAXwO', '[email protected]', 'F', '1995-06-29', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(39, 'H12345', 'Ahmed', 'Hany', 'Farouk', '$2y$10$eQxCmLr3aiLfaHLEbSI2G.e/IyAVz7lyeOZcYXibEENz2VIrQiYbG', '[email protected]', 'M', '2022-01-09', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(40, 'H12399', 'Ahmed', 'Hany', 'Farouk', '$2y$10$Xft/YYa6SyfRV5R633CbWupJrz1cgKQRYOtp5NqMx2k06GPwML2Qe', '[email protected]', 'M', '2022-01-09', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(41, 'bobvirgo', 'Timothy', 'R', 'Alexander', '$2y$10$oY5CERcMFVmeoF/iE2Eq5OZmgm77H6UFrm7Uc7Rz.I/T63ngFbnKi', '[email protected]', 'M', '1990-11-29', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(42, 'BigBeow55', 'Julie', 'J', 'Gallagher', '$2y$10$iitwnKLEA5.zS3ptq6eqSukF9.mKhsdzm1wTDgblRYltfDOZ33Euu', '[email protected]', 'F', '1981-09-27', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(43, 'garland_ok1994', 'Ethel', 'J', 'Rodriguez', '$2y$10$47PGXNBF1G1jIo4EAFZk6.U/NATJUAZPicVOD6cCH1zyrBKZ1RffC', '[email protected]', 'F', '1971-03-15', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(44, 'Rockstar', 'Rockstar', 'R', 'Games', '$2y$10$pqfeCIlqltQ8vwyY7dlo6.xSGXjTlPXAbUm9BgeVImQwho8SHbqxi', '[email protected]', 'M', '1998-12-01', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(45, 'ReviewStriker', 'Reviews', 's', 'Striker', '$2y$10$4sD2hPYUH4NNuvGzEoPp0OgUz6LQq3KRV.7yNHqjywoZdbBsozon2', '[email protected]', 'M', '1990-08-09', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(46, 'CrystalDynamics', 'Crystal', 'C', 'Dynamics', '$2y$10$IdnJJcMPtXtdmpI76ogNYuIQ9YB7IALytCFR7lvd5flflAz9CGG6.', '[email protected]', 'M', '2000-05-20', '1');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(48, 'H99', 'Ahmed', 'Hany', 'Farouk', '$2y$10$ItybWYwAqDzr7MkO64owMeePz87qbJWGhoYm/0iRCJIm/6LWXt45i', '[email protected]', 'M', '2022-01-09', '0');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(49, 'John', 'John ', 'M', 'Hannum', '$2y$10$A9/SbY.HL61QbQjxLUXnGurIeFP46qYNMfWozZbmAKvQCYs3SfVnq', '[email protected]', 'M', '1992-11-16', '0');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(50, 'hasd', 'Richard', 'E', 'Turner', '$2y$10$PUlrddb7zZiLfcBebFqGwOl1NYWjXOqjmloxHmCapX5HGBcF3cwEu', '[email protected]', 'M', '2022-01-04', '0');
INSERT INTO `accounts` (`AccountId`, `Username`, `fName`, `mName`, `lName`, `PasswordHash`, `EmailAddress`, `Gender`, `BirthDate`, `Status`) VALUES(51, 'HRose', 'Rose', 'G', 'Briese', '$2y$10$13BfoeWJuRPB4RyrNLg34eIY5..MhswsH5bQHr0iKnEen7FmtrYZ2', '[email protected]', 'F', '2016-02-03', '0');
-- --------------------------------------------------------
--
-- Stand-in structure for view `account_info`
-- (See below for the actual view)
--
DROP VIEW IF EXISTS `account_info`;
CREATE TABLE IF NOT EXISTS `account_info` (
`AccountType` varchar(9)
,`AccountId` int(11)
,`Username` varchar(50)
,`fName` varchar(100)
,`mName` varchar(100)
,`lName` varchar(100)
,`PasswordHash` varchar(256)
,`EmailAddress` varchar(256)
,`Gender` char(1)
,`BirthDate` date
,`Status` char(1)
,`Country` varchar(100)
,`ContactEmail` varchar(256)
,`Strikes` bigint(20)
,`Balance` double
,`ID` int(11)
);
-- --------------------------------------------------------
--
-- Table structure for table `admins`
--
DROP TABLE IF EXISTS `admins`;
CREATE TABLE IF NOT EXISTS `admins` (
`AdminId` int(11) NOT NULL AUTO_INCREMENT,
`AccountId` int(11) NOT NULL,
PRIMARY KEY (`AdminId`),
KEY `FK_Admins_Accounts` (`AccountId`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `admins`
--
INSERT INTO `admins` (`AdminId`, `AccountId`) VALUES(1, 21);
-- --------------------------------------------------------
--
-- Stand-in structure for view `all_orders`
-- (See below for the actual view)
--
DROP VIEW IF EXISTS `all_orders`;
CREATE TABLE IF NOT EXISTS `all_orders` (
`OrderDate` datetime(6)
,`Buyer` varchar(50)
,`Seller` varchar(50)
,`Game` varchar(100)
,`PaidAmount` double
);
-- --------------------------------------------------------
--
-- Table structure for table `auctions`
--
DROP TABLE IF EXISTS `auctions`;
CREATE TABLE IF NOT EXISTS `auctions` (
`AuctionId` int(11) NOT NULL AUTO_INCREMENT,
`GameId` int(11) NOT NULL,
`HighestBidId` int(11) DEFAULT NULL,
`StartDate` datetime(6) NOT NULL,
`EndDate` datetime(6) NOT NULL,
PRIMARY KEY (`AuctionId`),
KEY `FK_Auctions_Bids` (`HighestBidId`),
KEY `FK_Auctions_Games` (`GameId`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `auctions`
--
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(2, 12, 8, '2022-01-05 20:51:54.000000', '2022-01-06 07:51:54.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(3, 13, 10, '2022-01-06 16:28:53.000000', '2022-01-06 15:28:53.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(5, 15, 18, '2022-01-07 15:54:46.000000', '2022-01-07 13:54:46.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(10, 20, 22, '2022-01-08 18:50:40.000000', '2022-01-08 13:50:40.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(11, 21, 25, '2022-01-09 12:46:25.000000', '2022-01-09 13:46:25.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(12, 22, 26, '2022-01-09 12:49:38.000000', '2022-01-09 13:49:38.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(13, 23, NULL, '2022-01-09 13:13:50.000000', '2022-01-09 14:13:50.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(14, 24, 27, '2022-01-09 13:15:26.000000', '2022-01-09 14:15:26.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(15, 25, 28, '2022-01-09 13:19:05.000000', '2022-01-09 14:19:05.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(16, 26, NULL, '2022-01-09 14:42:55.000000', '2022-01-09 15:42:55.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(17, 27, NULL, '2022-01-09 14:45:31.000000', '2022-01-09 15:45:31.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(18, 28, NULL, '2022-01-09 14:49:37.000000', '2022-01-09 15:49:37.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(19, 29, NULL, '2022-01-09 14:51:59.000000', '2022-01-09 15:51:59.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(20, 30, NULL, '2022-01-09 14:53:16.000000', '2022-01-09 15:53:16.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(21, 31, NULL, '2022-01-09 15:31:28.000000', '2022-01-09 16:31:28.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(22, 32, 29, '2022-01-09 15:55:16.000000', '2022-01-09 16:55:16.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(23, 33, 30, '2022-01-09 16:36:42.000000', '2022-01-09 17:36:42.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(24, 34, 31, '2022-01-09 16:39:56.000000', '2022-01-09 17:39:56.000000');
INSERT INTO `auctions` (`AuctionId`, `GameId`, `HighestBidId`, `StartDate`, `EndDate`) VALUES(25, 35, NULL, '2022-01-09 17:16:39.000000', '2022-01-09 18:16:39.000000');
-- --------------------------------------------------------
--
-- Stand-in structure for view `auction_details`
-- (See below for the actual view)
--
DROP VIEW IF EXISTS `auction_details`;
CREATE TABLE IF NOT EXISTS `auction_details` (
`AuctionId` int(11)
,`StartDate` datetime(6)
,`EndDate` datetime(6)
,`Status` int(2)
,`GameId` int(11)
,`GameName` varchar(100)
,`GameDescription` varchar(250)
,`HighestBidId` int(11)
,`HighestBidBuyerId` int(11)
,`HighestBidAmount` double
,`HighestBidBuyerUserName` varchar(50)
,`HighestBidDate` datetime(6)
);
-- --------------------------------------------------------
--
-- Table structure for table `bids`
--
DROP TABLE IF EXISTS `bids`;
CREATE TABLE IF NOT EXISTS `bids` (
`BidId` int(11) NOT NULL AUTO_INCREMENT,
`BuyerId` int(11) NOT NULL,
`AuctionId` int(11) NOT NULL,
`BidAmount` double NOT NULL,
`Date` datetime(6) NOT NULL,
PRIMARY KEY (`BidId`),
KEY `FK_Bids_Auctions` (`AuctionId`),
KEY `FK_Bids_Buyers` (`BuyerId`)
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `bids`
--
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(2, 5, 2, 123, '2022-01-05 21:41:12.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(3, 5, 2, 1234, '2022-01-05 21:41:37.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(4, 7, 2, 234, '2022-01-06 12:49:46.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(5, 8, 2, 400, '2022-01-06 12:55:54.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(6, 8, 2, 500, '2022-01-06 12:57:25.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(7, 8, 2, 600, '2022-01-06 13:03:17.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(8, 7, 2, 700, '2022-01-06 13:04:35.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(9, 7, 3, 1500, '2022-01-06 16:44:25.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(10, 8, 3, 5000, '2022-01-06 16:44:46.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(15, 7, 5, 1231, '2022-01-07 16:02:18.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(16, 6, 5, 2000, '2022-01-07 16:03:35.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(17, 7, 5, 2001, '2022-01-07 16:03:53.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(18, 6, 5, 2003, '2022-01-07 16:05:18.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(19, 6, 10, 3000, '2022-01-08 18:50:59.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(20, 9, 10, 3001, '2022-01-08 18:52:21.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(21, 6, 10, 20221, '2022-01-08 18:52:50.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(22, 9, 10, 20222, '2022-01-08 18:53:40.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(23, 10, 12, 12, '2022-01-09 13:06:05.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(24, 10, 11, 123, '2022-01-09 13:06:30.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(25, 12, 11, 1234, '2022-01-09 13:23:09.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(26, 12, 12, 1090, '2022-01-09 13:23:28.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(27, 12, 14, 10000, '2022-01-09 13:23:51.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(28, 12, 15, 6000, '2022-01-09 13:23:58.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(29, 10, 22, 1234, '2022-01-09 16:49:20.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(30, 10, 23, 1500, '2022-01-09 16:49:31.000000');
INSERT INTO `bids` (`BidId`, `BuyerId`, `AuctionId`, `BidAmount`, `Date`) VALUES(31, 5, 24, 1, '2022-01-09 17:21:48.000000');
-- --------------------------------------------------------
--
-- Table structure for table `buyers`
--
DROP TABLE IF EXISTS `buyers`;
CREATE TABLE IF NOT EXISTS `buyers` (
`BuyerId` int(11) NOT NULL AUTO_INCREMENT,
`AccountId` int(11) NOT NULL,
`ApprovedBy` int(11) DEFAULT NULL,
`Country` varchar(100) NOT NULL,
`ContactEmail` varchar(256) NOT NULL,
`Strikes` int(11) NOT NULL,
`Balance` double NOT NULL DEFAULT '0',
PRIMARY KEY (`BuyerId`),
KEY `FK_Buyers_Accounts` (`AccountId`),
KEY `ApprovedBy` (`ApprovedBy`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `buyers`
--
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(3, 7, 1, 'Egypt', '[email protected]', 0, 2200);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(4, 20, 1, 'Egypt', '[email protected]', 0, 2500);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(5, 24, 1, 'Egypt', '[email protected]', 2, 18877);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(6, 25, 1, 'Egypt', '[email protected]', 0, 63221);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(7, 26, 1, 'Algeria', '[email protected]', 1, 7752);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(8, 27, 1, 'Bangladesh', '[email protected]', 0, 300);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(9, 29, 1, 'Egypt', '[email protected]', 0, 9398);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(10, 34, 1, 'United States of America', '[email protected]', 0, 26266);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(11, 35, 3, 'United States of America', '[email protected]', 0, 0);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(12, 36, 1, 'Palestine', '[email protected]', 3, 1676);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(13, 37, 5, 'Azerbaijan', '[email protected]', 0, 2000);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(14, 41, 5, 'United States of America', '[email protected]', 0, 6010);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(15, 42, 2, 'Canada', '[email protected]', 0, 22920);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(16, 43, 1, 'France', '[email protected]', 0, 8800);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(17, 48, NULL, 'Zimbabwe', '[email protected]', 0, 0);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(18, 49, NULL, 'Zambia', '[email protected]', 0, 0);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(19, 50, NULL, 'Yemen', '[email protected]', 0, 0);
INSERT INTO `buyers` (`BuyerId`, `AccountId`, `ApprovedBy`, `Country`, `ContactEmail`, `Strikes`, `Balance`) VALUES(20, 51, NULL, 'Uraguay', '[email protected]', 0, 0);
-- --------------------------------------------------------
--
-- Table structure for table `games`
--
DROP TABLE IF EXISTS `games`;
CREATE TABLE IF NOT EXISTS `games` (
`GameId` int(11) NOT NULL AUTO_INCREMENT,
`SellerId` int(11) NOT NULL,
`FirstOwner` int(11) DEFAULT NULL,
`Name` varchar(100) CHARACTER SET utf8mb4 NOT NULL,
`Description` varchar(250) CHARACTER SET utf8mb4 NOT NULL,
`ReleaseDate` date NOT NULL,
`Price` double NOT NULL,
`Version` varchar(10) NOT NULL,
`Type` varchar(50) NOT NULL,
`Sale` double NOT NULL,
PRIMARY KEY (`GameId`),
KEY `FK_Games_Buyers` (`FirstOwner`),
KEY `FK_Games_Sellers` (`SellerId`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `games`
--
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(10, 2, NULL, 'Second Game Edited', 'Second Game Second Game Second Game\r\nSecond Game Second Game Second Game', '2000-11-11', 750, '1.1.0', 'Adventure', 25);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(12, 2, 7, 'Minecraft', 'Minecraft is a sandbox video game developed by the Swedish video game developer Mojang Studios. The game was created by Markus \"Notch\" Persson in the Java programming language.', '2022-01-05', 260, '1.8', 'Open World', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(13, 2, 8, 'GTA 5', 'Grand Theft Auto V is a 2013 action-adventure game developed by Rockstar North and published by Rockstar Games. It is the seventh main entry in the Grand Theft Auto series,', '2022-01-06', 100, '1', 'Open World', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(15, 2, 6, 'XTrivia', 'Are you smarter than the average BuzzFeeder? I bet you are. Find out with our endless trivia quizzes.', '2022-01-07', 1200, '1', 'Strategy', 14);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(20, 14, 9, 'Fortnite', 'Fortnite is a free-to-play Battle Royale game with numerous game modes for every type of game player. Watch a concert, build an island or fight.', '2022-01-01', 1100, '1', 'Shooter', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(21, 15, NULL, 'The Legend of Zelda: Ocarina of Time', 'As a young boy, Link is tricked by Ganondorf, the King of the Gerudo Thieves. The evil human uses Link to gain access to the Sacred Realm, where he places his tainted hands on Triforce and transforms the beautiful Hyrulean landscape.', '2022-01-09', 1500, '1', 'Adventure', 12);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(22, 15, NULL, 'Super Mario', 'A plumber named Mario and his brother Luigi travel through the Mushroom Kingdom to save the princess from the evil Bowser. ... But one day, evil cast a shadow over the land and the evil King Bowser Koopa emerged with his army of Goombas.', '2022-01-09', 1000, '1', 'Adventure', 13);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(23, 15, NULL, 'Among Us', 'Among Us is a 2018 online multiplayer social deduction game developed and published by American game studio Innersloth. The game was inspired by the party game Mafia and the science fiction horror film The Thing.', '2022-01-09', 1200, '1', 'Strategy', 90);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(24, 15, 12, 'God of War', 'God of War is an action-adventure game developed by Santa Monica Studio and published by Sony Interactive Entertainment. It was released worldwide on April 20, 2018', '2022-01-09', 5000, '3', 'Adventure', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(25, 15, NULL, 'Death Stranding', 'Death Stranding is a 2019 action game developed by Kojima Productions. It is the first game from director Hideo Kojima and a Kojima Productions reborn as independent developer after Kojima\'s split from Konami in 2015', '2022-01-09', 6000, '1', 'Adventure', 50);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(26, 16, NULL, 'Call Of Duty', 'Call of Duty is a first-person shooter video game franchise published by Activision.', '2022-01-09', 500, '1', 'Shooter', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(27, 16, NULL, 'Assassin\'s Creed 3', 'Assassin\'s Creed III is a 2012 action-adventure video game developed by Ubisoft Montreal and published by Ubisoft for PlayStation 3, Xbox 360, Wii U, and Microsoft Windows.', '2022-01-09', 200, '1', 'Adventure', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(28, 17, NULL, 'squid game', 'korean game', '2022-01-09', 500, '2', 'Adventure', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(29, 17, NULL, 'Micky', 'Micky is interactive drama horror video game developed by Supermassive Games and published by Sony Computer Entertainment ', '2022-01-09', 200, '2', 'Action', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(30, 17, NULL, '8086 game', 'Intel Corporation is an American multinational corporation and technology company headquartered in Santa Clara, California. It is the world\'s largest semiconductor chip manufacturer by revenue.', '2022-01-09', 500, '1', 'Strategy', 0);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(31, 2, NULL, 'Cyberpunk 2077', 'Cyberpunk 2077 is an action role-playing video game developed and published by CD Projekt. The story takes place in Night City, an open world set in the Cyberpunk universe.', '2022-01-09', 1000, '1', 'Adventure', 1);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(32, 18, NULL, 'Red Dead Redemption 2', 'Red Dead Redemption 2 is a 2018 action-adventure game developed and published by Rockstar Games. The game is the third entry in the Red Dead series and is a prequel to the 2010 game Red Dead Redemption', '2018-10-05', 1000, '1.0.0', 'RD2', 20);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(33, 19, NULL, 'Rise of the Tomb Raider', 'Rise of the Tomb Raider is a 2015 action-adventure video game developed by Crystal Dynamics and published by Microsoft Studios and Square Enix\'s European subsidiary. ', '1998-06-15', 2500, '1.0.0', 'Adventure', 25);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(34, 19, NULL, 'Shadow of the Tomb Raider', 'Shadow of the Tomb Raider is a 2018 action-adventure video game developed by Eidos-Montréal and published by Square Enix\'s European subsidiary', '2000-05-15', 2600, '2.0.0', 'Action', 20);
INSERT INTO `games` (`GameId`, `SellerId`, `FirstOwner`, `Name`, `Description`, `ReleaseDate`, `Price`, `Version`, `Type`, `Sale`) VALUES(35, 18, NULL, 'Max Payne 3', 'Max Payne 3 is a third-person shooter video game developed by Rockstar Studios and published by Rockstar Games', '1999-06-23', 100, '2.0.0', 'Strategy', 10);
-- --------------------------------------------------------
--
-- Stand-in structure for view `games_details`
-- (See below for the actual view)
--
DROP VIEW IF EXISTS `games_details`;
CREATE TABLE IF NOT EXISTS `games_details` (
`OperatingSystem` varchar(50)
,`MinimumCPU` varchar(50)
,`RecommendedCPU` varchar(50)
,`MinimumGPU` varchar(50)
,`MinimumRam` int(11)
,`RecommendedRam` int(11)
,`RecommendedGPU` varchar(50)
,`Storage` int(11)
,`Sale` double
,`Type` varchar(50)
,`Version` varchar(10)
,`Price` double
,`ReleaseDate` date
,`Description` varchar(250)
,`Name` varchar(100)
,`FirstOwner` int(11)
,`SellerId` int(11)
,`GameId` int(11)
,`FirstOwnerName` varchar(302)
,`SellerName` varchar(302)
,`RatingCount` bigint(21)
,`NumberOfOrders` bigint(21)
,`Rating` double
,`LastOrderDate` datetime(6)
,`CanBeBought` int(1)
);
-- --------------------------------------------------------
--
-- Stand-in structure for view `games_reviews_details`
-- (See below for the actual view)
--
DROP VIEW IF EXISTS `games_reviews_details`;
CREATE TABLE IF NOT EXISTS `games_reviews_details` (
`GameId` int(11)
,`Name` varchar(100)
,`BuyerId` int(11)
,`BuyerUserName` varchar(50)
,`Rating` double
,`Text` varchar(100)
);
-- --------------------------------------------------------
--
-- Table structure for table `moderators`
--
DROP TABLE IF EXISTS `moderators`;
CREATE TABLE IF NOT EXISTS `moderators` (
`ModeratorId` int(11) NOT NULL AUTO_INCREMENT,