· 7 years ago · Jan 12, 2019, 10:30 AM
1/*****************************************
2* Create the projectWayne database
3*****************************************/
4DROP DATABASE IF EXISTS projectWayne;
5CREATE DATABASE projectWayne;
6USE projectWayne; -- MySQL command
7
8-- create the tables
9CREATE TABLE `pages` (
10 `id` int(11) NOT NULL auto_increment,
11 `subject_id` int(11) NOT NULL,
12 `menu_name` varchar(30) NOT NULL,
13 `position` int(3) NOT NULL,
14 `visible` tinyint(1) NOT NULL,
15 `content` text NOT NULL,
16 PRIMARY KEY (`id`)
17);
18
19CREATE TABLE `subjects` (
20 `id` int(11) NOT NULL auto_increment,
21 `menu_name` varchar(30) NOT NULL,
22 `position` int(3) NOT NULL,
23 `visible` tinyint(1) NOT NULL,
24 PRIMARY KEY (`id`)
25);
26
27CREATE TABLE `users` (
28 `id` int(11) NOT NULL auto_increment,
29 `username` varchar(50) NOT NULL,
30 `hashed_password` varchar(40) NOT NULL,
31 PRIMARY KEY (`id`)
32);