Challenge

Project 1

-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 17, 2022 at 12:56 PM
-- Server version: 10.4.24-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: `e-commerse`
--

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

--
-- Table structure for table `catagory`
--

CREATE TABLE `catagory` (
`catagory_Id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`catagory_name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `customer`
--

CREATE TABLE `customer` (
`CUSTOMER_ID` int(11) NOT NULL,
`Name` varchar(20) NOT NULL,
`address` varchar(20) NOT NULL,
`payment_Id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`Gender` varchar(20) NOT NULL,
`DOB` date NOT NULL,
`city` int(20) NOT NULL,
`contact` int(20) NOT NULL,
`current & prev order details` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `order`
--

CREATE TABLE `order` (
`order_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`shipper_id` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`ordernumber` int(11) NOT NULL,
`order_date` date NOT NULL,
`shipper_date` date NOT NULL,
`required_date` date NOT NULL,
`paid` int(11) NOT NULL,
`payment_date` date NOT NULL,
`delivery_expect_date` date NOT NULL,
`deleviry_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `order_details`
--

CREATE TABLE `order_details` (
`orderdetails_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`ordernumber` int(11) NOT NULL,
`price` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`discout` int(11) NOT NULL,
`total` int(11) NOT NULL,
`shippind_date` date NOT NULL,
`bill_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `payment`
--

CREATE TABLE `payment` (
`payment_Id` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`payment date & Time` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `product`
--

CREATE TABLE `product` (
`product_id` int(11) NOT NULL,
`product_name` varchar(20) NOT NULL,
`ITEM_PRICE` int(11) NOT NULL,
`ITEM_QUANTITY` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`product_color` int(11) NOT NULL,
`size` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`cost` int(11) NOT NULL,
`discount` int(11) NOT NULL,
`delivery_status` varchar(20) NOT NULL,
`features` varchar(20) NOT NULL,
`popularity_index` varchar(20) NOT NULL,
`avg_rating` int(11) NOT NULL,
`total_rating` int(11) NOT NULL,
`review_rating` int(11) NOT NULL,
`onsale` varchar(40) NOT NULL,
`catagories` varchar(50) NOT NULL,
`brand` varchar(50) NOT NULL,
`image` blob NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `seller`
--

CREATE TABLE `seller` (
`seller_id` int(11) NOT NULL,
`password` varchar(20) NOT NULL,
`seller_name` varchar(20) NOT NULL,
`catagore_name` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

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

--
-- Table structure for table `shippers`
--

CREATE TABLE `shippers` (
`shipper_Id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`company name` varchar(20) NOT NULL,
`contact` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `catagory`
--
ALTER TABLE `catagory`
ADD KEY `catagory_Id` (`catagory_Id`);

--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`CUSTOMER_ID`);

--
-- Indexes for table `order`
--
ALTER TABLE `order`
ADD KEY `order_id` (`order_id`);

--
-- Indexes for table `order_details`
--
ALTER TABLE `order_details`
ADD KEY `orderdetails_id` (`orderdetails_id`);

--
-- Indexes for table `payment`
--
ALTER TABLE `payment`
ADD KEY `payment_Id` (`payment_Id`);

--
-- Indexes for table `product`
--
ALTER TABLE `product`
ADD KEY `product_id` (`product_id`);

--
-- Indexes for table `seller`
--
ALTER TABLE `seller`
ADD PRIMARY KEY (`seller_id`);

--
-- Indexes for table `shippers`
--
ALTER TABLE `shippers`
ADD KEY `shipper_Id` (`shipper_Id`);

--
-- Constraints for dumped tables
--

--
-- Constraints for table `catagory`
--
ALTER TABLE `catagory`
ADD CONSTRAINT `catagory_ibfk_1` FOREIGN KEY (`catagory_Id`) REFERENCES `product` (`product_id`),
ADD CONSTRAINT `catagory_ibfk_2` FOREIGN KEY (`catagory_Id`) REFERENCES `seller` (`seller_id`);

--
-- Constraints for table `customer`
--
ALTER TABLE `customer`
ADD CONSTRAINT `customer_ibfk_1` FOREIGN KEY (`CUSTOMER_ID`) REFERENCES `product` (`product_id`);

--
-- Constraints for table `order`
--
ALTER TABLE `order`
ADD CONSTRAINT `order_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `product` (`product_id`);

--
-- Constraints for table `order_details`
--
ALTER TABLE `order_details`
ADD CONSTRAINT `order_details_ibfk_1` FOREIGN KEY (`orderdetails_id`) REFERENCES `order` (`order_id`);

--
-- Constraints for table `payment`
--
ALTER TABLE `payment`
ADD CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`payment_Id`) REFERENCES `order_details` (`orderdetails_id`);

--
-- Constraints for table `product`
--
ALTER TABLE `product`
ADD CONSTRAINT `product_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `customer` (`CUSTOMER_ID`),
ADD CONSTRAINT `product_ibfk_2` FOREIGN KEY (`product_id`) REFERENCES `seller` (`seller_id`);

--
-- Constraints for table `shippers`
--
ALTER TABLE `shippers`
ADD CONSTRAINT `shippers_ibfk_1` FOREIGN KEY (`shipper_Id`) REFERENCES `customer` (`CUSTOMER_ID`),
ADD CONSTRAINT `shippers_ibfk_2` FOREIGN KEY (`shipper_Id`) REFERENCES `seller` (`seller_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 */;

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.