-
Notifications
You must be signed in to change notification settings - Fork 2
/
store.sql
152 lines (125 loc) · 4.43 KB
/
store.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
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
149
150
151
152
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 27, 2021 at 01:54 PM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
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: `store`
--
-- --------------------------------------------------------
--
-- Table structure for table `codes`
--
DROP TABLE IF EXISTS `codes`;
CREATE TABLE IF NOT EXISTS `codes` (
`name` varchar(20) NOT NULL,
`value` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `codes`
--
INSERT INTO `codes` (`name`, `value`) VALUES
('SUB40', 40),
('NEWGUY10', 10),
('TAKEITALL', 30);
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
DROP TABLE IF EXISTS `items`;
CREATE TABLE IF NOT EXISTS `items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`price` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `items`
--
INSERT INTO `items` (`id`, `name`, `price`) VALUES
(1, 'Cannon EOS', 36000),
(2, 'Nikon DSLR', 40000),
(3, 'Sony DSLR', 45000),
(4, 'Olympus DSLR', 50000),
(5, 'Titan Model #301', 13000),
(6, 'Titan Model #201', 3000),
(7, 'HMT Milan', 8000),
(8, 'Faber Luba #111', 18000),
(9, 'H&W', 800),
(10, 'Luis Phil', 1000),
(11, 'John Zok', 1500),
(12, 'Jhalsani', 1300);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`contact` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`SUB40` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `contact`, `city`, `address`, `SUB40`) VALUES
(1, 'Archit Chitre', '[email protected]', 'archit', '12112001', 'Thane', 'Runwal Garden City', 0),
(2, 'Ishaan', '[email protected]', 'ishaan', '12032005', 'Atlanta', 'Georgia', 0),
(3, 'Atharva', '[email protected]', 'atharva', '1022006', 'Thane', 'Lakshman Apartments', 1),
(4, 'Athang', '[email protected]', 'athang', '12081999', 'Pune', 'Swastik Heights', 0),
(5, 'Rashi', '[email protected]', 'd41d8cd98f00b204e9800998ecf8427e', '12052002', 'Mulund', 'Galaxy Apartments', 0),
(6, 'Ashish Chitre', '[email protected]', '7b69ad8a8999d4ca7c42b8a729fb0ffd', '08031973', 'Thane', 'Runwal Garden City', 0),
(7, 'Priyal Chitre', '[email protected]', '6453b3c8efc15b6f72c03f172cd4dee7', '21061977', 'Atlanta', 'Georgia', 1),
(8, 'Shivam Nair', '[email protected]', 'd41d8cd98f00b204e9800998ecf8427e', '22334455', 'Chennai', 'Salt Lake City', 1),
(9, 'Athang', '[email protected]', '6fa08270bcfae27e3f9fe851d5a2f43c', '123456', 'Pune', 'Pimpri Chinchwad\r\n', 0);
-- --------------------------------------------------------
--
-- Table structure for table `users_items`
--
DROP TABLE IF EXISTS `users_items`;
CREATE TABLE IF NOT EXISTS `users_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`status` enum('Added to Cart','Confirmed') NOT NULL,
PRIMARY KEY (`id`),
KEY `item_id` (`item_id`),
KEY `user_id` (`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users_items`
--
INSERT INTO `users_items` (`id`, `user_id`, `item_id`, `status`) VALUES
(1, 1, 1, 'Confirmed'),
(5, 7, 7, 'Confirmed'),
(13, 7, 3, 'Added to Cart'),
(14, 8, 1, 'Added to Cart');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `users_items`
--
ALTER TABLE `users_items`
ADD CONSTRAINT `users_items_ibfk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`id`),
ADD CONSTRAINT `users_items_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `users` (`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 */;