-
Notifications
You must be signed in to change notification settings - Fork 21
/
testhib.sql
122 lines (95 loc) · 3.06 KB
/
testhib.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
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 22, 2012 at 10:54 AM
-- Server version: 5.5.24-log
-- PHP Version: 5.4.3
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Database: `testhib`
--
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE IF NOT EXISTS `customer` (
`CUST_ID` int(10) NOT NULL,
`NAME` varchar(20) NOT NULL,
`AGE` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`CUST_ID`, `NAME`, `AGE`) VALUES
(1, 'testing', 28),
(2, 'test', 28);
-- --------------------------------------------------------
--
-- Table structure for table `product`
--
CREATE TABLE IF NOT EXISTS `product` (
`PRODUCT_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`PRODUCT_CODE` varchar(20) NOT NULL,
`PRODUCT_DESC` varchar(255) NOT NULL,
PRIMARY KEY (`PRODUCT_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
--
-- Dumping data for table `product`
--
INSERT INTO `product` (`PRODUCT_ID`, `PRODUCT_CODE`, `PRODUCT_DESC`) VALUES
(2, 'ABC', 'This is product ABC'),
(3, 'ABC', 'This is product ABC'),
(4, 'Test', 'This is product of Test');
-- --------------------------------------------------------
--
-- Table structure for table `product_qoh`
--
CREATE TABLE IF NOT EXISTS `product_qoh` (
`QOH_ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`PRODUCT_ID` bigint(20) unsigned NOT NULL,
`QTY` int(10) unsigned NOT NULL,
PRIMARY KEY (`QOH_ID`),
KEY `FK_product_qoh_product_id` (`PRODUCT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
--
-- Dumping data for table `product_qoh`
--
INSERT INTO `product_qoh` (`QOH_ID`, `PRODUCT_ID`, `QTY`) VALUES
(1, 2, 100),
(2, 3, 100),
(3, 4, 100);
-- --------------------------------------------------------
--
-- Table structure for table `stock`
--
CREATE TABLE IF NOT EXISTS `stock` (
`STOCK_ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`STOCK_CODE` varchar(10) NOT NULL,
`STOCK_NAME` varchar(20) NOT NULL,
PRIMARY KEY (`STOCK_ID`) USING BTREE,
UNIQUE KEY `UNI_STOCK_NAME` (`STOCK_NAME`),
UNIQUE KEY `UNI_STOCK_ID` (`STOCK_CODE`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ;
--
-- Dumping data for table `stock`
--
INSERT INTO `stock` (`STOCK_ID`, `STOCK_CODE`, `STOCK_NAME`) VALUES
(15, '7669', 'Hamam');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `product_qoh`
--
ALTER TABLE `product_qoh`
ADD CONSTRAINT `FK_product_qoh_product_id` FOREIGN KEY (`PRODUCT_ID`) REFERENCES `product` (`PRODUCT_ID`);
/*!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 */;