-- phpMyAdmin SQL Dump
-- version 5.2.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 15, 2022 at 06:53 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: `testprog3`
--

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

--
-- Table structure for table `client_master`
--

CREATE TABLE `client_master` (
  `clientid` int(100) NOT NULL,
  `clientname` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `client_master`
--

INSERT INTO `client_master` (`clientid`, `clientname`) VALUES
(1000, 'Hartron'),
(2000, 'SBI Life'),
(3000, 'PNB');

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

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

CREATE TABLE `order_details` (
  `orderid` int(100) NOT NULL,
  `clientid` int(100) NOT NULL,
  `productid` int(100) NOT NULL,
  `noofbottle` int(100) NOT NULL,
  `productdate` date DEFAULT NULL,
  `billvalue` float(100,2) DEFAULT NULL,
  `discount` float(100,2) DEFAULT NULL,
  `totalvalue` float(100,2) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `order_details`
--

INSERT INTO `order_details` (`orderid`, `clientid`, `productid`, `noofbottle`, `productdate`, `billvalue`, `discount`, `totalvalue`) VALUES
(1, 1000, 400, 15, '2022-09-01', 525.00, 26.25, 498.75),
(2, 1000, 400, 18, '2022-09-02', 630.00, 31.50, 598.50),
(3, 1000, 400, 50, '2022-09-01', 1750.00, 0.00, 1750.00),
(4, 1000, 300, 50, '2022-09-01', 1500.00, 0.00, 1500.00),
(5, 1000, 300, 50, '2022-09-01', 1500.00, 0.00, 1500.00),
(6, 1000, 300, 50, '2022-09-01', 1500.00, 0.00, 1500.00),
(7, 1000, 300, 50, '2022-09-01', 1500.00, 0.00, 1500.00),
(8, 2000, 400, 40, '2022-09-01', 1400.00, 70.00, 1330.00),
(9, 1000, 400, 20, '2022-09-01', 700.00, 0.00, 700.00),
(10, 1000, 300, 150, '2022-09-01', 4500.00, 0.00, 4500.00),
(11, 1000, 100, 60, '2022-09-01', 600.00, 0.00, 600.00);

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

--
-- Table structure for table `product_master`
--

CREATE TABLE `product_master` (
  `productid` int(100) NOT NULL,
  `productname` varchar(100) NOT NULL,
  `cost` int(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

--
-- Dumping data for table `product_master`
--

INSERT INTO `product_master` (`productid`, `productname`, `cost`) VALUES
(100, '1_ltr_bottle', 10),
(200, '2_ltr_bottle', 20),
(300, '3_ltr_bottle', 30),
(400, '4_ltr_bottle', 35),
(500, '5_ltr_bottle', 40);

--
-- Indexes for dumped tables
--

--
-- Indexes for table `client_master`
--
ALTER TABLE `client_master`
  ADD UNIQUE KEY `clientid` (`clientid`);

--
-- Indexes for table `order_details`
--
ALTER TABLE `order_details`
  ADD PRIMARY KEY (`orderid`),
  ADD KEY `clientid` (`clientid`),
  ADD KEY `productid` (`productid`);

--
-- Indexes for table `product_master`
--
ALTER TABLE `product_master`
  ADD UNIQUE KEY `productid` (`productid`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `order_details`
--
ALTER TABLE `order_details`
  MODIFY `orderid` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `order_details`
--
ALTER TABLE `order_details`
  ADD CONSTRAINT `order_details_ibfk_1` FOREIGN KEY (`clientid`) REFERENCES `client_master` (`clientid`),
  ADD CONSTRAINT `order_details_ibfk_2` FOREIGN KEY (`productid`) REFERENCES `product_master` (`productid`);
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 */;
