-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 22, 2024 at 03:37 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.4.29

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: `finalproject`
--

-- --------------------------------------------------------

--
-- Table structure for table `cars`
--

CREATE TABLE `cars` (
  `car_id` int(11) NOT NULL,
  `model_name` varchar(255) DEFAULT NULL,
  `year` int(11) DEFAULT NULL,
  `image_link` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `cars`
--

INSERT INTO `cars` (`car_id`, `model_name`, `year`, `image_link`) VALUES
(1, 'Acura MDX', 2000, 'Acura_MDX.png'),
(2, 'Alfa Romeo Giulia', 1962, 'Alfa_Romeo.png'),
(3, 'Aston Martin DB11', 2016, 'Aston_Martin_DB11.png'),
(4, 'Audi A4', 2022, 'Audi_A4.png'),
(5, 'Bentley Continental GT', 2022, 'Bentley_Continental_GT.png'),
(6, 'BMW 3 Series', 2019, 'BMW_3_Series.png'),
(7, 'Bugatti Chiron', 2016, 'Bugatti_Chiron.png'),
(8, 'Buick Enclave', 2022, 'Buick_Enclave.png'),
(9, 'Cadillac Escalade', 2022, 'Cadillac_Escalade.png'),
(10, 'Chevrolet Corvette', 2020, 'Chevrolet_Corvette.png'),
(11, 'Chrysler Pacifica', 2017, 'Chrysler_Pacifica.png'),
(12, 'Citroen C4 Picasso', 2019, 'Citroen_C4_Picasso.png'),
(13, 'Dacia Sandero', 2022, 'Dacia_Sandero.png'),
(14, 'Dodge Challenger', 2023, 'Dodge_Challenger.png'),
(15, 'Ferrari 488', 2019, 'Ferrari_488.png');

-- --------------------------------------------------------

--
-- Table structure for table `car_features`
--

CREATE TABLE `car_features` (
  `feature_id` int(11) NOT NULL,
  `car_id` int(11) DEFAULT NULL,
  `feature_name` varchar(255) DEFAULT NULL,
  `feature_value` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `car_features`
--

INSERT INTO `car_features` (`feature_id`, `car_id`, `feature_name`, `feature_value`) VALUES
(1, 1, 'Seating Capacity', '4 People'),
(2, 1, 'Fuel Type', 'Hybrid'),
(3, 1, 'Fuel Efficiency', '7,98km / 1-litre'),
(4, 1, 'Transmission', 'Automatic'),
(5, 2, 'Seating Capacity', '4 People'),
(6, 2, 'Fuel Type', 'Gasoline'),
(7, 2, 'Fuel Efficiency', '9,3 km / 1-litre'),
(8, 2, 'Transmission', 'Automatic'),
(9, 3, 'Seating Capacity', '2 People'),
(10, 3, 'Fuel Type', 'Gasoline'),
(11, 3, 'Fuel Efficiency', '7,5-10 km / 1-litre'),
(12, 3, 'Transmission', 'Automatic'),
(13, 4, 'Seating Capacity', '4 People'),
(14, 4, 'Fuel Type', 'Gasoline'),
(15, 4, 'Fuel Efficiency', '12-16 km / 1-litre'),
(16, 4, 'Transmission', 'Automatic'),
(17, 5, 'Seating Capacity', '2 People'),
(18, 5, 'Fuel Type', 'Gasoline'),
(19, 5, 'Fuel Efficiency', '9,26km / 1-litre'),
(20, 5, 'Transmission', 'Automatic'),
(21, 6, 'Seating Capacity', '4 People'),
(22, 6, 'Fuel Type', 'Gasoline'),
(23, 6, 'Fuel Efficiency', '8-14km / 1-litre'),
(24, 6, 'Transmission', 'Automatic'),
(25, 7, 'Seating Capacity', '2 People'),
(26, 7, 'Fuel Type', 'Gasoline'),
(27, 7, 'Fuel Efficiency', '420 km/jam'),
(28, 7, 'Transmission', 'Automatic'),
(29, 8, 'Seating Capacity', '4 People'),
(30, 8, 'Fuel Type', 'Gasoline'),
(31, 8, 'Fuel Efficiency', '7,6-8,9 km / 1-litre'),
(32, 8, 'Transmission', 'Automatic'),
(33, 9, 'Seating Capacity', '7 People'),
(34, 9, 'Fuel Type', 'Gasoline'),
(35, 9, 'Fuel Efficiency', '5,9-6,3km / 1-litre'),
(36, 9, 'Transmission', 'Automatic'),
(37, 10, 'Seating Capacity', '2 People'),
(38, 10, 'Fuel Type', 'Gasoline'),
(39, 10, 'Fuel Efficiency', '8-10km / 1-litre'),
(40, 10, 'Transmission', 'Automatic'),
(41, 11, 'Seating Capacity', '6 People'),
(42, 11, 'Fuel Type', 'Gasoline'),
(43, 11, 'Fuel Efficiency', '15-20km / 1-litre'),
(44, 11, 'Transmission', 'Automatic'),
(45, 12, 'Seating Capacity', '4 People'),
(46, 12, 'Fuel Type', 'Gasoline'),
(47, 12, 'Fuel Efficiency', '20-25km / 1-litre'),
(48, 12, 'Transmission', 'Automatic'),
(49, 13, 'Seating Capacity', '4 People'),
(50, 13, 'Fuel Type', 'Gasoline'),
(51, 13, 'Fuel Efficiency', '12-15km/ 1-litre'),
(52, 13, 'Transmission', 'Automatic'),
(53, 14, 'Seating Capacity', '2 People'),
(54, 14, 'Fuel Type', 'Gasoline'),
(55, 14, 'Fuel Efficiency', '8-10km / 1-litre'),
(56, 14, 'Transmission', 'Automatic'),
(57, 15, 'Seating Capacity', '2 People'),
(58, 15, 'Fuel Type', 'Gasoline'),
(59, 15, 'Fuel Efficiency', '4-6km / 1-litre'),
(60, 15, 'Transmission', 'Automatic');

-- --------------------------------------------------------

--
-- Table structure for table `sales`
--

CREATE TABLE `sales` (
  `sale_id` int(11) NOT NULL,
  `customer_id` int(11) DEFAULT NULL,
  `car_id` int(11) DEFAULT NULL,
  `sale_date` date DEFAULT NULL,
  `price` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `sales`
--

INSERT INTO `sales` (`sale_id`, `customer_id`, `car_id`, `sale_date`, `price`) VALUES
(1, 54643, 4, '2022-06-15', 840000000),
(2, 135790, 4, '2022-06-17', 840000000),
(3, 135862, 4, '2022-06-19', 840000000),
(4, 197354, 4, '2022-06-20', 840000000),
(5, 207853, 6, '2022-06-22', 900000000),
(6, 216459, 6, '2022-06-24', 900000000),
(7, 276941, 3, '2022-07-01', 3324080000),
(8, 284615, 3, '2022-07-03', 3324080000),
(9, 351628, 10, '2022-07-05', 1000000000),
(10, 361087, 10, '2022-07-07', 1000000000),
(11, 362159, 10, '2022-07-09', 1000000000),
(12, 395871, 7, '2022-07-10', 57600000000),
(13, 419085, 7, '2022-07-12', 57600000000),
(14, 425861, 15, '2022-07-14', 8000000000),
(15, 430975, 15, '2022-07-16', 8000000000),
(16, 480156, 15, '2022-07-18', 8000000000),
(17, 509612, 14, '2022-07-20', 1000000000),
(18, 527983, 14, '2022-07-22', 1000000000),
(19, 589624, 14, '2022-07-24', 1000000000),
(20, 590614, 14, '2022-07-26', 1000000000),
(21, 642308, 9, '2022-07-28', 1084860000),
(22, 671324, 9, '2022-07-30', 1084860000),
(23, 724139, 9, '2022-08-01', 1084860000),
(24, 769420, 9, '2022-08-03', 1084860000),
(25, 786234, 9, '2022-08-05', 1084860000),
(26, 851624, 2, '2022-08-07', 2340000000),
(27, 3610888, 2, '2022-08-09', 2340000000),
(28, 123872399, 2, '2022-08-11', 2340000000);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `cars`
--
ALTER TABLE `cars`
  ADD PRIMARY KEY (`car_id`);

--
-- Indexes for table `car_features`
--
ALTER TABLE `car_features`
  ADD PRIMARY KEY (`feature_id`),
  ADD KEY `car_id` (`car_id`);

--
-- Indexes for table `sales`
--
ALTER TABLE `sales`
  ADD PRIMARY KEY (`sale_id`),
  ADD KEY `car_id` (`car_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `cars`
--
ALTER TABLE `cars`
  MODIFY `car_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `car_features`
--
ALTER TABLE `car_features`
  MODIFY `feature_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=61;

--
-- AUTO_INCREMENT for table `sales`
--
ALTER TABLE `sales`
  MODIFY `sale_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `car_features`
--
ALTER TABLE `car_features`
  ADD CONSTRAINT `car_features_ibfk_1` FOREIGN KEY (`car_id`) REFERENCES `cars` (`car_id`);

--
-- Constraints for table `sales`
--
ALTER TABLE `sales`
  ADD CONSTRAINT `sales_ibfk_1` FOREIGN KEY (`car_id`) REFERENCES `cars` (`car_id`);
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 */;
