-- MySQL dump 10.13  Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: localhost    Database: javadb
-- ------------------------------------------------------
-- Server version	5.7.20-log

/*!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 */;
 SET NAMES utf8 ;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `orderitem`
--

DROP TABLE IF EXISTS `orderitem`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
 SET character_set_client = utf8mb4 ;
CREATE TABLE `orderitem` (
  `ORDERITEM_ID` int(10) NOT NULL AUTO_INCREMENT,
  `NAME` varchar(45) NOT NULL,
  `PRICE` int(10) NOT NULL,
  `QUANTITY` int(10) NOT NULL,
  `CATEGORY_ID` int(10) NOT NULL,
  `SUBCATEGORY_ID` int(10) NOT NULL,
  `ORDER_ID` bigint(64) NOT NULL,
  `PRODUCT_ID` int(10) NOT NULL,
  PRIMARY KEY (`ORDERITEM_ID`),
  KEY `fk_category_ot_idx` (`CATEGORY_ID`),
  KEY `fk_subcategory_ot_idx` (`SUBCATEGORY_ID`),
  KEY `fk_order_ot_idx` (`ORDER_ID`),
  KEY `fk_product_ot_idx` (`PRODUCT_ID`),
  CONSTRAINT `fk_category_ot` FOREIGN KEY (`CATEGORY_ID`) REFERENCES `category` (`CATEGORY_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_ordderid_ot` FOREIGN KEY (`ORDER_ID`) REFERENCES `orders` (`ORDER_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_product_ot` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `product` (`PRODUCT_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION,
  CONSTRAINT `fk_subcategory_ot` FOREIGN KEY (`SUBCATEGORY_ID`) REFERENCES `subcategory` (`SUBCATEGORY_ID`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=2039 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `orderitem`
--

LOCK TABLES `orderitem` WRITE;
/*!40000 ALTER TABLE `orderitem` DISABLE KEYS */;
INSERT INTO `orderitem` VALUES (2017,'iPhone 5 32GB',45000,1,1000125,1000100,54681640,104),(2018,'iPhone 5 32GB',45000,1,1000125,1000100,54934112,104),(2019,'Immortals of Meluha - Secret of Nagas',135,1,1000126,1000101,71573416,122),(2020,'Immortals of Meluha - Secret of Nagas',135,1,1000126,1000101,74932864,122),(2021,'Immortals of Meluha - Secret of Nagas',135,1,1000126,1000101,75308552,122),(2022,'World of Warcraft - Rise of the Horde',450,1,1000126,1000101,77844144,124),(2023,'Sony Xperia M2 Silver',45000,1,1000125,1000115,80499328,112),(2024,'Immortals of Meluha - Oath of Vayuputras',135,1,1000126,1000101,2122640,123),(2034,'Motorola Moto E',7000,3,1000125,1000101,24703328,106),(2035,'Motorola Moto X2',35000,1,1000125,1000101,24703328,110),(2036,'Sony Xperia Black',35000,1,1000125,1000115,31467524,116),(2037,'iPhone 5 32GB',45000,2,1000125,1000100,31467524,104),(2038,'Sony Xperia M2 Black',40000,3,1000125,1000115,31467524,111);
/*!40000 ALTER TABLE `orderitem` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2019-05-25 18:57:44
