Advertisement
sunilaleti

Untitled

Apr 19th, 2022
1,102
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE DATABASE CARRENTAL;
  2. USE CARRENTAL;
  3. CREATE TABLE CUSTOMER(
  4. CustID int AUTO_INCREMENT PRIMARY KEY,
  5. Name varchar(50),
  6. Phone varchar(15)
  7. );
  8. CREATE TABLE RATE(
  9. Type ENUM("1","2","3","4","5","6") NOT NULL,
  10. Category ENUM("0","1") NOT NULL,
  11. Weekly double NOT NULL,
  12. Daily double NOT NULL
  13. );
  14. CREATE TABLE VEHICLE(
  15. VehicleID varchar(50) PRIMARY KEY,
  16. Description varchar(100),
  17. Year YEAR,
  18. Type ENUM("1","2","3","4","5","6") NOT NULL ,
  19. Category ENUM("0","1") NOT NULL
  20. );
  21. CREATE TABLE RENTAL(
  22. CustID int not null,
  23. VehicleID varchar(25) not null,
  24. StartDate DATE not null,
  25. OrderDate DATE not null,
  26. RentalType int,
  27. Qty int not null,
  28. ReturnDate DATE,
  29. TotalAmount DOUBLE,
  30. PaymentDate DATE
  31. );
  32. INSERT INTO CUSTOMER
  33.   (`Name`, `Phone`)
  34. VALUES
  35.   ('A. Parks', '(214) 555-0127'),
  36.   ('S. Patel', '(849) 811-6298'),
  37.   ('A. Hernandez', '(355) 572-5385'),
  38.   ('G. Carver', '(753) 763-8656'),
  39.   ('Sh. Byers', '(912) 925-5332'),
  40.   ('L. Lutz', '(931) 966-1775'),
  41.   ('L. Bernal', '(884) 727-0591'),
  42.   ('I. Whyte', '(811) 979-7345'),
  43.   ('L. Lott', '(954) 706-2219'),
  44.   ('G. Clarkson', '(309) 625-1838'),
  45.   ('Sh. Dunlap', '(604) 581-6642'),
  46.   ('H. Gallegos', '(961) 265-8638'),
  47.   ('L. Perkins', '(317) 996-3104'),
  48.   ('M. Beach', '(481) 422-0282'),
  49.   ('C. Pearce', '(599) 881-5189'),
  50.   ('A. Hess', '(516) 570-6411'),
  51.   ('M. Lee', '(369) 898-6162'),
  52.   ('R. Booker', '(730) 784-6303'),
  53.   ('A. Crowther', '(325) 783-4081'),
  54.   ('H. Mahoney', '(212) 262-8829'),
  55.   ('J. Brown', '(644) 756-0110'),
  56.   ('H. Stokes', '(931) 969-7317'),
  57.   ('J. Reeves', '(940) 981-5113'),
  58.   ('A. Mcghee', '(838) 610-5802'),
  59.   ('L. Mullen', '(798) 331-7777'),
  60.   ('R. Armstrong', '(325) 783-4081'),
  61.   ('J. Greenaway', '(212) 262-8829'),
  62.   ('K. Kaiser Acosta', '(228) 576-1557'),
  63.   ('D. Kirkpatrick', '(773) 696-8009'),
  64.   ('A. Odonnell', '(439) 536-8929'),
  65.   ('K. Kay', '(368) 336-5403');
  66. INSERT INTO RATE
  67.   (`Type`, `Category`, `Weekly`, `Daily`)
  68. VALUES
  69.   ('1', '0', '480', '80'),
  70.   ('1', '1', '600', '100'),
  71.   ('2', '0', '530', '90'),
  72.   ('2', '1', '660', '110'),
  73.   ('3', '0', '600', '100'),
  74.   ('3', '1', '710', '120'),
  75.   ('4', '0', '685', '115'),
  76.   ('4', '1', '800', '135'),
  77.   ('5', '0', '780', '130'),
  78.   ('6', '0', '685', '115');
  79.  
  80.  
  81. INSERT INTO RENTAL
  82.   (`CustID`, `VehicleID`, `StartDate`, `OrderDate`, `RentalType`, `Qty`, `ReturnDate`, `TotalAmount`, `PaymentDate`)
  83. VALUES
  84.   ('203', 'JM3KE4DY4F0441471', '2019-09-09', '2019-05-22', '1', '4', '2019-09-13', '460', '2019-09-09'),
  85.   ('210', '19VDE1F3XEE414842', '2019-11-01', '2019-10-28', '7', '2', '2019-11-15', '1200', NULL),
  86.   ('210', 'JTHFF2C26F135BX45', '2019-05-01', '2019-04-15', '7', '1', '2019-05-08', '600', '2019-05-08'),
  87.   ('210', 'JTHFF2C26F135BX45', '2019-11-01', '2019-10-28', '7', '2', '2019-11-15', '1200', NULL),
  88.   ('210', 'WAUTFAFH0E0010613', '2019-11-01', '2019-10-28', '7', '2', '2019-11-15', '1200', NULL),
  89.   ('210', 'WBA3A9G51ENN73366', '2019-11-01', '2019-10-28', '7', '2', '2019-11-15', '1200', NULL),
  90.   ('210', 'WBA3B9C59EP458859', '2019-11-01', '2019-10-28', '7', '2', '2019-11-15', '1200', NULL),
  91.   ('210', 'WDCGG0EB0EG188709', '2019-11-01', '2019-10-28', '7', '2', '2019-11-15', '1200', NULL),
  92.   ('212', '19VDE1F3XEE414842', '2019-06-10', '2019-04-15', '7', '3', '2019-07-01', '1800', '2019-06-10'),
  93.   ('216', '1N6BF0KM0EN101134', '2019-08-02', '2019-03-15', '7', '4', '2019-08-30', '2740', '2019-08-02'),
  94.   ('216', '1N6BF0KM0EN101134', '2019-08-30', '2019-03-15', '1', '2', '2019-09-01', '230', '2019-08-02'),
  95.   ('221', '19VDE1F3XEE414842', '2019-07-01', '2019-06-12', '7', '1', '2019-07-08', '600', '2019-07-01'),
  96.   ('221', '19VDE1F3XEE414842', '2019-07-09', '2019-06-12', '1', '2', '2019-07-11', '200', '2019-07-01'),
  97.   ('221', '19VDE1F3XEE414842', '2020-01-01', '2019-12-15', '7', '4', '2020-01-29', '2400', NULL),
  98.   ('221', 'JTHFF2C26F135BX45', '2020-01-01', '2019-12-15', '7', '4', '2020-01-29', '2400', NULL),
  99.   ('221', 'WAUTFAFH0E0010613', '2019-07-01', '2019-06-12', '7', '1', '2019-07-08', '600', '2019-07-01'),
  100.   ('221', 'WAUTFAFH0E0010613', '2019-07-09', '2019-06-12', '1', '2', '2019-07-11', '200', '2019-07-01'),
  101.   ('221', 'WAUTFAFH0E0010613', '2020-01-01', '2019-12-15', '7', '4', '2020-01-29', '2400', NULL),
  102.   ('221', 'WBA3A9G51ENN73366', '2020-01-01', '2019-12-15', '7', '4', '2020-01-29', '2400', NULL),
  103.   ('221', 'WBA3B9C59EP458859', '2020-01-01', '2019-12-15', '7', '4', '2020-01-29', '2400', NULL),
  104.   ('221', 'WDCGG0EB0EG188709', '2020-01-01', '2019-12-15', '7', '4', '2020-01-29', '2400', NULL),
  105.   ('229', '19VDE1F3XEE414842', '2019-05-06', '2019-04-12', '1', '4', '2019-05-10', '400', '2019-05-06'),
  106.   ('229', 'WAUTFAFH0E0010613', '2019-05-06', '2019-04-12', '1', '4', '2019-05-10', '400', '2019-05-06');
  107. INSERT INTO VEHICLE
  108.   (`VehicleID`, `Description`, `Year`, `Type`, `Category`)
  109. VALUES
  110.   ('19VDE1F3XEE414842', 'Acura ILX', '2014', '1', '1'),
  111.   ('1FDEE3FL6EDA29122', 'Ford E 350', '2014', '6', '0'),
  112.   ('1FDRF3B61FEA87469', 'Ford Super Duty Pickup', '2015', '5', '0'),
  113.   ('1FTNF1CF2EKE54305', 'Ford F Series Pickup', '2014', '5', '0'),
  114.   ('1G1JD5SB3E4240835', 'Chevrolet Optra', '2014', '1', '0'),
  115.   ('1GB3KZCG1EF117132', 'Chevrolet Silverado', '2014', '5', '0'),
  116.   ('1HGCR2E3XEA305302', 'Honda Accord', '2014', '2', '0'),
  117.   ('1N4AB7AP2EN855026', 'Nissan Sentra', '2014', '1', '0'),
  118.   ('1N6BA0EJ9EN516565', 'Nissan Titan', '2014', '5', '0'),
  119.   ('1N6BF0KM0EN101134', 'Nissan NV', '2014', '6', '0'),
  120.   ('1VWCH7A3XEC037969', 'Volkswagen Passat', '2014', '2', '1'),
  121.   ('2HGFB2F94FH501940', 'Honda Civic', '2015', '1', '0'),
  122.   ('2T3DFREV0FW317743', 'Toyota RAV4', '2015', '4', '0'),
  123.   ('3MZBM1L74EM109736', 'Mazda 3', '2014', '1', '0'),
  124.   ('3N1CE2CP0FL409472', 'Nissan Versa Note', '2015', '1', '0'),
  125.   ('3N1CN7APXEK444458', 'Nissan Versa', '2014', '1', '0'),
  126.   ('3VW2A7AU1FM012211', 'Volkswagen Golf', '2015', '1', '0'),
  127.   ('4S4BRCFC1E3203823', 'Subaru Outback', '2014', '4', '0'),
  128.   ('4S4BSBF39F3261064', 'Subaru Outback', '2015', '4', '0'),
  129.   ('4S4BSELC0F3325370', 'Subaru Outback', '2015', '4', '0'),
  130.   ('5J6RM4H90FL028629', 'Honda CR-V', '2015', '4', '0'),
  131.   ('5N1AL0MM8EL549388', 'Infiniti JX35', '2014', '4', '1'),
  132.   ('5NPDH4AE2FH565275', 'Hyundai Elantra', '2015', '1', '0'),
  133.   ('5TDBKRFH4ES26D590', 'Toyota Highlander', '2014', '4', '0'),
  134.   ('5XYKT4A75FG610224', 'Kia Sorento', '2015', '4', '0'),
  135.   ('5XYKU4A7XFG622415', 'Kia Sorento', '2015', '4', '0'),
  136.   ('5XYKUDA77EG449709', 'Kia Sorento', '2014', '4', '0'),
  137.   ('JF1GPAA61F8314971', 'Subaru Impreza', '2015', '1', '0'),
  138.   ('JH4KC1F50EC800004', 'Acura RLX', '2014', '3', '1'),
  139.   ('JH4KC1F56EC000095', 'Acura RLX', '2014', '3', '1'),
  140.   ('JM1BM1V35E1210570', 'Mazda 3', '2014', '1', '0'),
  141.   ('JM3KE4DY4F0441471', 'Mazda CX5', '2015', '4', '0'),
  142.   ('JM3TB3DV0E0015742', 'Mazda CX9', '2014', '4', '0'),
  143.   ('JN8AS5MV0FW760408', 'Nissan Rogue Select', '2015', '4', '0'),
  144.   ('JTEZUEJR7E5081641', 'Toyota 4Runner', '2014', '4', '0'),
  145.   ('JTHBW1GG1F120DU53', 'Lexus ES 300h', '2015', '2', '1'),
  146.   ('JTHCE1BL3F151DE04', 'Lexus GS 350', '2015', '2', '1'),
  147.   ('JTHDL5EF9F5007221', 'Lexus LS 460', '2015', '3', '1'),
  148.   ('JTHFF2C26F135BX45', 'Lexus IS 250C', '2015', '1', '1'),
  149.   ('JTJHY7AX2F120EA11', 'Lexus LX 570', '2015', '4', '1'),
  150.   ('JTJJM7FX2E152CD75', 'Lexus GX460', '2014', '4', '1'),
  151.   ('JTMBFREV1FJ019885', 'Toyota RAV4', '2015', '4', '0'),
  152.   ('KM8SN4HF0FU107203', 'Hyundai Santa Fe', '2015', '4', '0'),
  153.   ('KMHJT3AF1FU028211', 'Hyundai Tucson', '2015', '4', '0'),
  154.   ('KMHTC6AD8EU998631', 'Hyundai Veloster', '2014', '1', '0'),
  155.   ('KNAFZ4A86E5195865', 'KIA Sportage', '2014', '4', '0'),
  156.   ('KNAFZ4A86E5195895', 'KIA Forte', '2014', '1', '0'),
  157.   ('KNAGN4AD2F5084324', 'Kia Optima Hybrid', '2015', '2', '0'),
  158.   ('KNALN4D75E5A57351', 'Kia Cadenza', '2014', '3', '0'),
  159.   ('KNALU4D42F6025717', 'Kia K900', '2015', '3', '0'),
  160.   ('KNDPCCA65F7791085', 'KIA Sportage', '2015', '4', '0'),
  161.   ('WA1LGAFE8ED001506', 'Audi Q7', '2014', '4', '1'),
  162.   ('WAU32AFD8FN005740', 'Audi A8', '2015', '3', '1'),
  163.   ('WAUTFAFH0E0010613', 'Audi A5', '2014', '1', '1'),
  164.   ('WBA3A9G51ENN73366', 'BMW 3 Series', '2014', '1', '1'),
  165.   ('WBA3B9C59EP458859', 'BMW 3 Series', '2014', '1', '1'),
  166.   ('WBAVL1C57EVR93286', 'BMW X1', '2014', '4', '1'),
  167.   ('WDCGG0EB0EG188709', 'Mercedes_Benz GLK', '2014', '1', '1'),
  168.   ('YV440MDD6F2617077', 'Volvo XC60', '2015', '4', '1'),
  169.   ('YV4940NB5F1191453', 'Volvo XC70', '2015', '4', '1');
Advertisement
RAW Paste Data Copied
Advertisement