-
Notifications
You must be signed in to change notification settings - Fork 0
/
uniproject.sql
157 lines (125 loc) · 3.47 KB
/
uniproject.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
153
154
155
156
157
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 11, 2019 at 08:50 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
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: `uniproject`
--
-- --------------------------------------------------------
--
-- Table structure for table `course`
--
CREATE TABLE `course` (
`courseID` int(5) NOT NULL,
`courseName` varchar(30) NOT NULL,
`courseCredit` int(5) NOT NULL,
`departmentID` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `department`
--
CREATE TABLE `department` (
`departmentID` int(5) NOT NULL,
`departmentName` varchar(30) NOT NULL,
`explanation` varchar(50) NOT NULL,
`mail` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `student`
--
CREATE TABLE `student` (
`studentID` int(5) NOT NULL,
`studentName` varchar(30) NOT NULL,
`studentSurname` varchar(30) NOT NULL,
`departmentID` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `studentcourse`
--
CREATE TABLE `studentcourse` (
`studentCourseID` int(5) NOT NULL,
`studentID` int(5) NOT NULL,
`courseID` int(5) NOT NULL,
`grade` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `teacher`
--
CREATE TABLE `teacher` (
`teacherID` int(5) NOT NULL,
`teacherName` varchar(30) NOT NULL,
`teacherSurname` varchar(30) NOT NULL,
`departmentID` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `teachercourse`
--
CREATE TABLE `teachercourse` (
`teacherCourseID` int(5) NOT NULL,
`teacherID` int(5) NOT NULL,
`courseID` int(5) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `course`
--
ALTER TABLE `course`
ADD PRIMARY KEY (`courseID`),
ADD KEY `course_fk0` (`departmentID`);
--
-- Indexes for table `department`
--
ALTER TABLE `department`
ADD PRIMARY KEY (`departmentID`),
ADD UNIQUE KEY `departmentID` (`departmentID`);
--
-- Indexes for table `student`
--
ALTER TABLE `student`
ADD PRIMARY KEY (`studentID`);
--
-- Indexes for table `studentcourse`
--
ALTER TABLE `studentcourse`
ADD PRIMARY KEY (`studentCourseID`);
--
-- Indexes for table `teacher`
--
ALTER TABLE `teacher`
ADD PRIMARY KEY (`teacherID`);
--
-- Indexes for table `teachercourse`
--
ALTER TABLE `teachercourse`
ADD PRIMARY KEY (`teacherCourseID`);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `course`
--
ALTER TABLE `course`
ADD CONSTRAINT `course_fk0` FOREIGN KEY (`departmentID`) REFERENCES `department` (`departmentID`);
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 */;