-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
99 lines (79 loc) · 3.19 KB
/
database.sql
File metadata and controls
99 lines (79 loc) · 3.19 KB
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
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 02, 2012 at 02:48 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
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 utf8 */;
--
-- Database: `pml`
--
-- --------------------------------------------------------
--
-- Table structure for table `class`
--
CREATE TABLE IF NOT EXISTS `class` (
`id_class` mediumint(8) NOT NULL AUTO_INCREMENT,
`class_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id_class`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `entry`
--
CREATE TABLE IF NOT EXISTS `entry` (
`id_entry` mediumint(8) NOT NULL AUTO_INCREMENT,
`id_reason` mediumint(8) NOT NULL DEFAULT '0',
`id_student` mediumint(8) NOT NULL DEFAULT '0',
`id_teacher` mediumint(8) NOT NULL DEFAULT '0',
`entry_date` int(10) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_entry`),
UNIQUE KEY `id_student` (`id_student`,`id_entry`),
UNIQUE KEY `id_teacher` (`id_teacher`,`id_entry`),
KEY `id_reason` (`id_reason`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `reason`
--
CREATE TABLE IF NOT EXISTS `reason` (
`id_reason` mediumint(8) NOT NULL AUTO_INCREMENT,
`reason_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`reason_type` smallint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_reason`),
KEY `reason_type` (`reason_type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `student`
--
CREATE TABLE IF NOT EXISTS `student` (
`id_student` mediumint(8) NOT NULL AUTO_INCREMENT,
`id_class` mediumint(8) NOT NULL DEFAULT '0',
`student_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`student_surname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id_student`),
UNIQUE KEY `id_class` (`id_class`,`id_student`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `teacher`
--
CREATE TABLE IF NOT EXISTS `teacher` (
`id_teacher` mediumint(8) NOT NULL AUTO_INCREMENT,
`teacher_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`teacher_surname` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`teacher_alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`teacher_password` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
PRIMARY KEY (`id_teacher`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!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 */;