-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstore.sql
129 lines (107 loc) · 3.48 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
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Mar 27, 2020 at 03:30 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
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 `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, 'Canon DSLR EOS', 20000),
(2, 'Powershot SX540', 30000),
(3, 'Nikon coolpix P530', 16000),
(4, 'Raymond Classic', 3500),
(5, 'Allen Solly', 3500),
(6, 'Armani vintage', 2500),
(7, 'Tissot X edition', 30000),
(8, 'Adam Kimmel Designer edition', 50000),
(9, 'Diamond Dier', 50000),
(10, 'Woodland', 3500),
(11, 'Hush Puppies', 3000),
(12, 'Sneazy Sneakers', 2000);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(50) 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,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `contact`, `city`, `address`) VALUES
(1, 'shobhi', '[email protected]', 'fuck', '4545', 'bokaro', 'somewhere'),
(2, 'tapish', '[email protected]', 'tapish', '4646', 'tirupati', 'boys hostel'),
(4, 'tapish', '[email protected]', 'tapish', '4545', 'Tirupati', 'boys hostel');
-- --------------------------------------------------------
--
-- 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,
`product_id` int(11) NOT NULL,
`status` enum('confirmed','Added to Cart') NOT NULL,
PRIMARY KEY (`id`),
KEY `user_id` (`user_id`),
KEY `product_id` (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=53 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users_items`
--
INSERT INTO `users_items` (`id`, `user_id`, `product_id`, `status`) VALUES
(36, 4, 7, 'Added to Cart'),
(38, 1, 12, 'confirmed'),
(39, 1, 4, 'confirmed'),
(46, 1, 8, 'confirmed'),
(48, 1, 2, 'Added to Cart'),
(49, 1, 5, 'Added to Cart'),
(51, 1, 4, 'Added to Cart'),
(52, 1, 9, 'Added to Cart');
--
-- Constraints for dumped tables
--
--
-- Constraints for table `users_items`
--
ALTER TABLE `users_items`
ADD CONSTRAINT `users_items_ibfk_1` FOREIGN KEY (`product_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 */;