-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsql.txt
148 lines (121 loc) · 4.57 KB
/
sql.txt
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
-- phpMyAdmin SQL Dump
-- version 4.2.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Oct 27, 2015 at 01:59 PM
-- Server version: 5.5.38
-- PHP Version: 5.6.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `wots`
--
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`id` varchar(8) NOT NULL,
`firstName` varchar(30) NOT NULL,
`surName` varchar(30) NOT NULL,
`email` varchar(255) NOT NULL,
`telephone` varchar(30) NOT NULL,
`addressFirstLine` varchar(50) NOT NULL,
`addressSecondLine` varchar(50) NOT NULL,
`addressTownCity` varchar(50) NOT NULL,
`addressCounty` varchar(50) NOT NULL,
`addressCountry` varchar(50) NOT NULL,
`addressPostcode` varchar(45) NOT NULL,
`availableCredit` double(8,2) NOT NULL,
`cardNumber` varchar(16) NOT NULL,
`cardName` varchar(50) NOT NULL,
`cardExpiry` varchar(4) NOT NULL,
`cardSecNum` varchar(3) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`id`, `firstName`, `surName`, `email`, `telephone`, `addressFirstLine`, `addressSecondLine`, `addressTownCity`, `addressCounty`, `addressCountry`, `addressPostcode`, `availableCredit`, `cardNumber`, `cardName`, `cardExpiry`, `cardSecNum`) VALUES
('CUS00001', 'Philip', 'Stevenson', '[email protected]', '07754319562', 'Beech House', 'Brucefield Road', 'Blairgowrie', 'Perthshire', 'Scotland', 'PH106LA', 10000.00, '1234123412341234', 'MR PHILIP A STEVENSON', '0915', '123'),
('CUS00002', 'Eddard', 'Stark', '[email protected]', '999', 'The Keep', 'Winterfell', 'Winterfell', 'The North', 'Westeros', 'N98 W23', 5999.00, '086512376537', 'LORD EDDARD STARK', '2145', '123');
-- --------------------------------------------------------
--
-- Table structure for table `custorder`
--
CREATE TABLE `custorder` (
`id` varchar(8) NOT NULL,
`custID` varchar(8) NOT NULL,
`dateTime` varchar(45) NOT NULL,
`zone` varchar(45) DEFAULT NULL,
`status` varchar(45) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `custorder`
--
INSERT INTO `custorder` (`id`, `custID`, `dateTime`, `zone`, `status`) VALUES
('COR00001', 'CUS00001', 'Thu Oct 22 13:09:46 BST 2015', 'PH10', 'Incomplete'),
('COR00002', 'CUS00001', 'Thu Oct 22 15:40:20 BST 2015', 'PH10', 'Incomplete'),
('COR00003', 'CUS00001', 'Thu Oct 22 16:54:36 BST 2015', 'PH10', 'Incomplete'),
('COR00004', 'CUS00001', 'Thu Oct 22 16:54:59 BST 2015', 'PH10', 'Incomplete'),
('COR00005', 'CUS00001', 'Thu Oct 22 16:56:36 BST 2015', 'PH10', 'Incomplete'),
('COR00006', 'CUS00001', 'Thu Oct 22 16:58:48 BST 2015', 'PH10', 'Incomplete'),
('COR00007', 'CUS00002', 'Thu Oct 22 17:15:22 BST 2015', 'N98 ', 'Incomplete');
-- --------------------------------------------------------
--
-- Table structure for table `orderline`
--
CREATE TABLE `orderline` (
`orderID` varchar(8) NOT NULL,
`productID` varchar(8) NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `orderline`
--
INSERT INTO `orderline` (`orderID`, `productID`, `quantity`) VALUES
('COR00001', 'PRO00001', 50),
('COR00001', 'PRO00005', 1);
-- --------------------------------------------------------
--
-- Table structure for table `product`
--
CREATE TABLE `product` (
`id` varchar(8) NOT NULL,
`name` varchar(50) NOT NULL,
`description` text NOT NULL,
`price` double(5,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product`
--
INSERT INTO `product` (`id`, `name`, `description`, `price`) VALUES
('PRO00001', 'Halfpint Ben Gnome', 'A Gnome designed from the famous character Halfpint Ben.', 0.56),
('PRO00002', 'Physics Joe Gnome', 'A Gnome of Joe who studied physics', 69.00),
('PRO00003', 'The Rampant Mabbett Gnome', 'oh Mabbett', 22.50),
('PRO00004', 'Mediterranean Dan Gnome', 'Disclaimer: NOT Mediterranean', 45.21),
('PRO00005', 'The Colm it Down Gnome', 'Colm the gnome is a fictional charachter who works the long lost trade of NETbuilder', 500.50),
('PRO00006', 'Bill and Ben Gnomes', 'Inspired by the ledgend of bilal and Ben from Coding Tiger Compiling Dragon', 79.99);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `custorder`
--
ALTER TABLE `custorder`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `orderline`
--
ALTER TABLE `orderline`
ADD PRIMARY KEY (`orderID`,`productID`);
--
-- Indexes for table `product`
--
ALTER TABLE `product`
ADD PRIMARY KEY (`id`);