· 7 years ago · Jan 17, 2019, 06:40 AM
1--
2-- Table structure for table `groups`
3--
4
5CREATE TABLE IF NOT EXISTS `groups` (
6 `group_id` int(6) NOT NULL AUTO_INCREMENT,
7 `group_name` varchar(255) NOT NULL,
8 PRIMARY KEY (`group_id`)
9) ENGINE=InnoDB DEFAULT CHARSET=latin1;
10
11-- --------------------------------------------------------
12
13--
14-- Table structure for table `users`
15--
16
17CREATE TABLE IF NOT EXISTS `users` (
18 `user_id` int(6) NOT NULL AUTO_INCREMENT,
19 `user_name` varchar(255) NOT NULL,
20 `user_address` varchar(255) NOT NULL,
21 PRIMARY KEY (`user_id`)
22) ENGINE=InnoDB DEFAULT CHARSET=latin1;
23
24-- --------------------------------------------------------
25
26--
27-- Table structure for table `user_groups`
28--
29
30CREATE TABLE IF NOT EXISTS `user_groups` (
31 `user_group_id` int(6) NOT NULL AUTO_INCREMENT,
32 `user_id` int(6) NOT NULL,
33 `group_id` int(6) NOT NULL,
34 PRIMARY KEY (`user_group_id`),
35 KEY `user_id` (`user_id`,`group_id`)
36) ENGINE=InnoDB DEFAULT CHARSET=latin1;