source: trunk/de.ugoe.cs.swe.exercises/schema/exercises-mysql.sql @ 3

Last change on this file since 3 was 3, checked in by zeiss, 15 years ago
File size: 6.9 KB
RevLine 
[3]1-- phpMyAdmin SQL Dump
2-- version 3.2.2
3-- http://www.phpmyadmin.net
4--
5-- Host: localhost
6-- Erstellungszeit: 19. Oktober 2009 um 10:53
7-- Server Version: 5.0.51
8-- PHP-Version: 5.2.6-1+lenny3
9
10SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
11
12
13/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
14/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
15/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
16/*!40101 SET NAMES utf8 */;
17
18--
19-- Datenbank: `xprakt1`
20--
21
22-- --------------------------------------------------------
23
24--
25-- Tabellenstruktur fÃŒr Tabelle `exercise`
26--
27
28CREATE TABLE IF NOT EXISTS `exercise` (
29  `id` int(11) NOT NULL auto_increment,
30  `title` varchar(256) NOT NULL,
31  `complexity` tinyint(4) NOT NULL,
32  `revisionnumber` int(11) NOT NULL,
33  PRIMARY KEY  (`id`)
34) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=288 ;
35
36-- --------------------------------------------------------
37
38--
39-- Tabellenstruktur fÃŒr Tabelle `exercisesheet`
40--
41
42CREATE TABLE IF NOT EXISTS `exercisesheet` (
43  `id` int(11) NOT NULL auto_increment,
44  `number` int(11) NOT NULL,
45  `complexityvalue` tinyint(4) NOT NULL,
46  `revisionnumber` int(11) NOT NULL,
47  `examination` tinyint(1) NOT NULL default '0',
48  `lectureevent` int(11) NOT NULL,
49  `numOfExercises` int(11) NOT NULL,
50  PRIMARY KEY  (`id`),
51  KEY `lectureevent` (`lectureevent`)
52) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=149 ;
53
54-- --------------------------------------------------------
55
56--
57-- Tabellenstruktur fÃŒr Tabelle `exercisesheet_exercise`
58--
59
60CREATE TABLE IF NOT EXISTS `exercisesheet_exercise` (
61  `exercisesheet` int(11) NOT NULL,
62  `exercise` int(11) NOT NULL,
63  `revisionnumber` int(11) NOT NULL,
64  UNIQUE KEY `exercisesheet_2` (`exercisesheet`,`exercise`),
65  KEY `exercise` (`exercise`)
66) ENGINE=InnoDB DEFAULT CHARSET=latin1;
67
68-- --------------------------------------------------------
69
70--
71-- Tabellenstruktur fÃŒr Tabelle `keyword_exercise`
72--
73
74CREATE TABLE IF NOT EXISTS `keyword_exercise` (
75  `id` int(11) NOT NULL auto_increment,
76  `word` varchar(30) NOT NULL,
77  `exercise` int(11) NOT NULL,
78  PRIMARY KEY  (`id`),
79  KEY `exercise` (`exercise`)
80) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=245 ;
81
82-- --------------------------------------------------------
83
84--
85-- Tabellenstruktur fÃŒr Tabelle `keyword_exercisesheet`
86--
87
88CREATE TABLE IF NOT EXISTS `keyword_exercisesheet` (
89  `id` int(11) NOT NULL auto_increment,
90  `word` varchar(30) NOT NULL,
91  `exercisesheet` int(11) NOT NULL,
92  PRIMARY KEY  (`id`),
93  KEY `exercisesheet` (`exercisesheet`)
94) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=134 ;
95
96-- --------------------------------------------------------
97
98--
99-- Tabellenstruktur fÃŒr Tabelle `keyword_lecture`
100--
101
102CREATE TABLE IF NOT EXISTS `keyword_lecture` (
103  `id` int(11) NOT NULL auto_increment,
104  `word` varchar(30) NOT NULL,
105  `lecture` int(11) NOT NULL,
106  PRIMARY KEY  (`id`),
107  KEY `lecture` (`lecture`)
108) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=229 ;
109
110-- --------------------------------------------------------
111
112--
113-- Tabellenstruktur fÃŒr Tabelle `lecture`
114--
115
116CREATE TABLE IF NOT EXISTS `lecture` (
117  `id` int(11) NOT NULL auto_increment,
118  `name` varchar(80) NOT NULL,
119  PRIMARY KEY  (`id`)
120) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=94 ;
121
122-- --------------------------------------------------------
123
124--
125-- Tabellenstruktur fÃŒr Tabelle `lectureevent`
126--
127
128CREATE TABLE IF NOT EXISTS `lectureevent` (
129  `id` int(11) NOT NULL auto_increment,
130  `semester` int(11) NOT NULL,
131  `ss_ws` varchar(2) NOT NULL,
132  `lecture` int(11) NOT NULL,
133  PRIMARY KEY  (`id`),
134  KEY `lecture` (`lecture`)
135) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=162 ;
136
137-- --------------------------------------------------------
138
139--
140-- Tabellenstruktur fÃŒr Tabelle `lectureevent_lecturer`
141--
142
143CREATE TABLE IF NOT EXISTS `lectureevent_lecturer` (
144  `lectureevent` int(11) NOT NULL,
145  `lecturer` int(11) NOT NULL,
146  UNIQUE KEY `lectureevent_2` (`lectureevent`,`lecturer`),
147  KEY `lecturer` (`lecturer`)
148) ENGINE=InnoDB DEFAULT CHARSET=latin1;
149
150-- --------------------------------------------------------
151
152--
153-- Tabellenstruktur fÃŒr Tabelle `lecturer`
154--
155
156CREATE TABLE IF NOT EXISTS `lecturer` (
157  `id` int(11) NOT NULL auto_increment,
158  `lastname` varchar(30) NOT NULL,
159  `firstname` varchar(30) NOT NULL,
160  `title` varchar(20) NOT NULL,
161  PRIMARY KEY  (`id`)
162) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=111 ;
163
164-- --------------------------------------------------------
165
166--
167-- Tabellenstruktur fÃŒr Tabelle `lecture_exercise`
168--
169
170CREATE TABLE IF NOT EXISTS `lecture_exercise` (
171  `lecture` int(11) NOT NULL,
172  `exercise` int(11) NOT NULL,
173  UNIQUE KEY `lecture_2` (`lecture`,`exercise`),
174  KEY `exercise` (`exercise`)
175) ENGINE=InnoDB DEFAULT CHARSET=latin1;
176
177--
178-- Constraints der exportierten Tabellen
179--
180
181--
182-- Constraints der Tabelle `exercisesheet`
183--
184ALTER TABLE `exercisesheet`
185  ADD CONSTRAINT `exercisesheet_ibfk_1` FOREIGN KEY (`lectureevent`) REFERENCES `lectureevent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
186
187--
188-- Constraints der Tabelle `exercisesheet_exercise`
189--
190ALTER TABLE `exercisesheet_exercise`
191  ADD CONSTRAINT `exercisesheet_exercise_ibfk_1` FOREIGN KEY (`exercisesheet`) REFERENCES `exercisesheet` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
192  ADD CONSTRAINT `exercisesheet_exercise_ibfk_2` FOREIGN KEY (`exercise`) REFERENCES `exercise` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
193
194--
195-- Constraints der Tabelle `keyword_exercise`
196--
197ALTER TABLE `keyword_exercise`
198  ADD CONSTRAINT `keyword_exercise_ibfk_1` FOREIGN KEY (`exercise`) REFERENCES `exercise` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
199
200--
201-- Constraints der Tabelle `keyword_exercisesheet`
202--
203ALTER TABLE `keyword_exercisesheet`
204  ADD CONSTRAINT `keyword_exercisesheet_ibfk_1` FOREIGN KEY (`exercisesheet`) REFERENCES `exercisesheet` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
205
206--
207-- Constraints der Tabelle `keyword_lecture`
208--
209ALTER TABLE `keyword_lecture`
210  ADD CONSTRAINT `keyword_lecture_ibfk_1` FOREIGN KEY (`lecture`) REFERENCES `lecture` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
211
212--
213-- Constraints der Tabelle `lectureevent`
214--
215ALTER TABLE `lectureevent`
216  ADD CONSTRAINT `lectureevent_ibfk_1` FOREIGN KEY (`lecture`) REFERENCES `lecture` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
217
218--
219-- Constraints der Tabelle `lectureevent_lecturer`
220--
221ALTER TABLE `lectureevent_lecturer`
222  ADD CONSTRAINT `lectureevent_lecturer_ibfk_1` FOREIGN KEY (`lectureevent`) REFERENCES `lectureevent` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
223  ADD CONSTRAINT `lectureevent_lecturer_ibfk_2` FOREIGN KEY (`lecturer`) REFERENCES `lecturer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
224
225--
226-- Constraints der Tabelle `lecture_exercise`
227--
228ALTER TABLE `lecture_exercise`
229  ADD CONSTRAINT `lecture_exercise_ibfk_1` FOREIGN KEY (`lecture`) REFERENCES `lecture` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
230  ADD CONSTRAINT `lecture_exercise_ibfk_2` FOREIGN KEY (`exercise`) REFERENCES `exercise` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
Note: See TracBrowser for help on using the repository browser.