-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcars.sql
194 lines (161 loc) · 7.04 KB
/
cars.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
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 03, 2020 at 02:31 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.5
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: `cars`
--
-- --------------------------------------------------------
--
-- Table structure for table `carcategories`
--
CREATE TABLE `carcategories` (
`category` varchar(20) NOT NULL,
`pid` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `carcategories`
--
INSERT INTO `carcategories` (`category`, `pid`) VALUES
('sports', 10),
('sports', 11),
('hatch', 12),
('hatch', 13),
('sedan', 14),
('sedan', 15),
('suv', 16),
('suv', 17),
('minivan', 18),
('minivan', 19);
-- --------------------------------------------------------
--
-- Table structure for table `cardata`
--
CREATE TABLE `cardata` (
`category` varchar(20) NOT NULL,
`pid` int(10) NOT NULL,
`make` varchar(50) NOT NULL,
`model` varchar(50) NOT NULL,
`trim` varchar(50) NOT NULL,
`color` varchar(20) NOT NULL,
`year` int(18) NOT NULL,
`odo` varchar(60) NOT NULL,
`gearbox` varchar(30) NOT NULL,
`engine` varchar(30) NOT NULL,
`price` varchar(50) NOT NULL,
`location` varchar(80) NOT NULL,
`description` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `cardata`
--
INSERT INTO `cardata` (`category`, `pid`, `make`, `model`, `trim`, `color`, `year`, `odo`, `gearbox`, `engine`, `price`, `location`, `description`) VALUES
('sports', 10, 'Chevrolet', 'Corvette Z06', 'LZ3', 'Yellow', 2016, '19000', 'Automatic', '6.2 8cyl', '60000', 'Tustin, CA', 'One owner example, Highway miles, AC, NAV, Supercharger, Heated Leather Seats, 20in Alloy Wheels, Paddle Shifters, Sunroof'),
('sports', 11, 'Lotus', 'Esprit', 'V8', 'Silver', 2003, '50000', 'Manual', '3.5 8cyl', '40000', 'Scottsdale, AZ', 'Family owned for 17 years, mostly highway miles, always maintained at lotus dealership. Very rare twin turbo v8 version, this is one of the last affordable exotic cars.'),
('hatch', 12, 'Honda', 'Fit', 'Sport', 'Blue', 2011, '90000', 'Manual', '1.5 4cyl', '5300', 'Oakland, CA', 'Commuter car, lots of space, folding seats, sport trim with zippy performance, always serviced on time, fuel efficient, very reliable.'),
('hatch', 13, 'Kia', 'Rio 4DR Hatchback', 'LX', 'Red', 2014, '40000', 'Manual', '1.6 4cyl', '7500', 'Washington, DC', 'Reliable car, Economic 35mpg, electric windows, beige interior, cargo net, cargo tray, carpet floor mats.'),
('sedan', 14, 'Ford', 'Fusion', 'SE', 'Black', 2017, '9800', 'Automatic', '1.5 4cyl', '14000', 'Milpitas, CA', 'Sunroof, NAV/GPS, Backup Camera, Black leather interior, heated front seats, ecoboost 30mpg combined.'),
('sedan', 15, 'Toyota', 'Camry', 'XLE', 'White', 2007, '120000', 'Automatic', '3.5 6cyl', '6000', 'Boise, ID', 'One owner, powerful engine, recently serviced, v6 33mpg combined, GPS/NAV.'),
('suv', 16, 'Kia', 'Sportage AWD', 'EX', 'Black', 2013, '73000', 'Automatic', '2.4 4cyl', '10000', 'Chicago, IL', 'AWD model, leather seats, heated front seats, Sirius traffic, push-button start, panoramic moonroof, homelink.'),
('suv', 17, 'Cadillac', 'Escalade', 'Platinum', 'Silver', 2018, '51800', 'Automatic', '6.2 8cyl', '52300', 'Little Rock, AR', '4WD, black leather seats, 16 speaker sound system, 3rd row seating, split bench, adaptive cruise control, SiriusXM, lane change assist, adaptive electronic suspension.'),
('minivan', 18, 'Honda', 'Odyssey', 'EX', 'Grey', 2013, '77000', 'Automatic', '3.5 6cyl', '11200', 'Atlanta, GA', '27 highway mpg, bluetooth connectivity, CD/DVD player, premium sound system, electric tilt wheel.'),
('minivan', 19, 'Chrysler', 'Town and Country', 'Touring', 'White', 2009, '140200', 'Automatic', '3.6 6cyl', '5720', 'Gary, IN', 'keyless entry, DVD player, usb audio interface, power liftgate, folding mirrors, power sliding doors, rear AC, third row seating, movable rows.');
-- --------------------------------------------------------
--
-- Table structure for table `carimages`
--
CREATE TABLE `carimages` (
`pid` int(10) NOT NULL,
`main_img` varchar(200) NOT NULL,
`sub_img` varchar(200) NOT NULL,
`int_img` varchar(200) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `carimages`
--
INSERT INTO `carimages` (`pid`, `main_img`, `sub_img`, `int_img`) VALUES
(10, './img/sports/csp10/1.jpg', './img/sports/csp10/2.jpg', './img/sports/csp10/3.jpg'),
(11, './img/sports/csp11/1.jpg', './img/sports/csp11/2.jpg', './img/sports/csp11/3.jpg'),
(12, './img/hatch/ch10/1.jpg', './img/hatch/ch10/2.jpg', './img/hatch/ch10/3.jpg'),
(13, './img/hatch/ch11/1.jpg', './img/hatch/ch11/2.jpg', './img/hatch/ch11/3.jpg'),
(14, './img/sedan/cse10/1.jpg', './img/sedan/cse10/2.jpg', './img/sedan/cse10/3.jpg'),
(15, './img/sedan/cse11/1.jpg', './img/sedan/cse11/2.jpg', './img/sedan/cse11/3.jpg'),
(16, './img/suv/csu10/1.jpg', './img/suv/csu10/2.jpg', './img/suv/csu10/3.jpg'),
(17, './img/suv/csu11/1.jpg', './img/suv/csu11/2.jpg', './img/suv/csu11/3.jpg'),
(18, './img/minivan/cmi10/1.jpg', './img/minivan/cmi10/2.jpg', './img/minivan/cmi10/3.jpg'),
(19, './img/minivan/cmi11/1.jpg', './img/minivan/cmi11/2.jpg', './img/minivan/cmi11/3.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE `orders` (
`model` varchar(300) NOT NULL,
`order_id` int(30) NOT NULL,
`fullname` varchar(300) NOT NULL,
`phone` varchar(100) NOT NULL,
`email` varchar(200) NOT NULL,
`method` varchar(30) NOT NULL,
`country` varchar(200) DEFAULT NULL,
`address` varchar(200) DEFAULT NULL,
`card` int(40) NOT NULL,
`cvv` int(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `carcategories`
--
ALTER TABLE `carcategories`
ADD KEY `pid` (`pid`);
--
-- Indexes for table `cardata`
--
ALTER TABLE `cardata`
ADD PRIMARY KEY (`pid`);
--
-- Indexes for table `carimages`
--
ALTER TABLE `carimages`
ADD KEY `pid` (`pid`);
--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`order_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `order_id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `carcategories`
--
ALTER TABLE `carcategories`
ADD CONSTRAINT `carcategories_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `cardata` (`pid`);
--
-- Constraints for table `carimages`
--
ALTER TABLE `carimages`
ADD CONSTRAINT `carimages_ibfk_1` FOREIGN KEY (`pid`) REFERENCES `cardata` (`pid`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;