· 7 years ago · Dec 19, 2018, 03:56 PM
1SELECT CMS.StudentID, EMC.CertificateID
2 FROM coursemodulestudent CMS
3 LEFT JOIN course C ON CMS.CourseID = C.CourseID
4 LEFT JOIN educationmodulecertificate EMC ON C.EducationID = EMC.EducationID
5
6
7
8DROP TABLE IF EXISTS `module`;
9CREATE TABLE IF NOT EXISTS `module` (
10 `ModuleID` int(19) NOT NULL,
11 `Modulename` varchar(50) NOT NULL,
12 PRIMARY KEY (`ModuleID`)
13) ENGINE=MyISAM DEFAULT CHARSET=latin1;
14
15--
16-- Gegevens worden geëxporteerd voor tabel `module`
17--
18
19INSERT INTO `module` (`ModuleID`, `Modulename`) VALUES
20(1, 'Theory'),
21(2, 'practice'),
22(3, 'tools'),
23(4, 'material'),
24(5, 'code');
25
26-- --------------------------------------------------------
27
28--
29-- Tabelstructuur voor tabel `student`
30--
31
32DROP TABLE IF EXISTS `student`;
33CREATE TABLE IF NOT EXISTS `student` (
34 `StudentID` int(19) NOT NULL AUTO_INCREMENT,
35 `lastname` varchar(50) NOT NULL,
36 `firstname` varchar(50) NOT NULL,
37 `datebirth` date NOT NULL,
38 PRIMARY KEY (`StudentID`)
39) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;
40
41--
42-- Gegevens worden geëxporteerd voor tabel `student`
43--
44
45INSERT INTO `student` (`StudentID`, `lastname`, `firstname`, `datebirth`) VALUES
46(1, 'Johnson', 'John', '1990-10-10'),
47(2, 'Adams', 'Tim', '1980-09-09'),
48(3, 'Gates', 'Mary', '1970-09-09'),
49(4, 'Donna', 'Summer', '1985-07-07');