https://www.youtube.com/watch?v=tvKXCAvUUpM
Na het installeren van WAMP kan je de deze databank aanmaken in phpMyAdmin.
Indien je gevraagd wordt bij het inloggen een gebruikersnaam en wachtwoord op te geven dan is de gebruikersnaam root , het paswoord laat je leeg.
Kopieer onderstaande code in het venster SQL. Een databank met de naam "cursussql" zal aangemaakt worden met de verschillende tabellen.
--
-- Databank: `cursussql`
--
CREATE DATABASE `cursussql` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci;
USE `cursussql`;
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `tblleveranciers`
--
CREATE TABLE IF NOT EXISTS `tblleveranciers` (
`leveranciersnummer` int(1) NOT NULL DEFAULT '0',
`naam` varchar(10) DEFAULT NULL,
`straat` varchar(16) DEFAULT NULL,
`postcode` text,
PRIMARY KEY (`leveranciersnummer`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Gegevens worden uitgevoerd voor tabel `tblleveranciers`
--
INSERT INTO `tblleveranciers` (`leveranciersnummer`, `naam`, `straat`, `postcode`) VALUES
(1, 'Jansens', 'Bruul 18', '2800'),
(2, 'Peeters', 'Oude Markt 62', '1000'),
(3, 'Merckx', 'Wollemarkt 36', '2800'),
(4, 'Vermeulen', 'Leuvensestraat 1', '3100'),
(5, 'Vermaelen', 'Heistsebaan 71', '2220');
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `tblpostcodes`
--
CREATE TABLE IF NOT EXISTS `tblpostcodes` (
`postcode` varchar(4) NOT NULL,
`plaats` varchar(17) NOT NULL DEFAULT '',
PRIMARY KEY (`postcode`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Gegevens worden uitgevoerd voor tabel `tblpostcodes`
--
INSERT INTO `tblpostcodes` (`postcode`, `plaats`) VALUES
('1000', 'Brussel'),
('2000', 'Antwerpen'),
('2220', 'Heist-op-den-Berg'),
('2800', 'Mechelen'),
('3100', 'Leuven');
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `tblwerknemers`
--
CREATE TABLE IF NOT EXISTS `tblwerknemers` (
`werknemersnr` int(11) NOT NULL AUTO_INCREMENT,
`naam` text NOT NULL,
`voornaam` text NOT NULL,
`straat` text NOT NULL,
`postcode` text NOT NULL,
`telefoon` text NOT NULL,
`geboortedatum` date NOT NULL,
`brutoloon` float NOT NULL,
`gehuwd` tinyint(1) NOT NULL,
PRIMARY KEY (`werknemersnr`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
--
-- Gegevens worden uitgevoerd voor tabel `tblwerknemers`
--
INSERT INTO `tblwerknemers` (`werknemersnr`, `naam`, `voornaam`, `straat`, `postcode`, `telefoon`, `geboortedatum`, `brutoloon`, `gehuwd`) VALUES
(1, 'De Grote', 'Karel', 'Bruul 45', '2800', '0486 254785', '1977-03-03', 3245.12, 0),
(2, 'De Meeuw', 'Filip', 'Grote Nieuwendijk 12', '2800', '015 235475', '1982-08-08', 3125.25, 0),
(3, 'De Kerpel', 'Nicole', 'Veemarkt 45', '2800', '0483 624785', '1971-02-03', 4245.12, 1),
(4, 'Van den Broeck', 'Els', 'Steenweg 45', '3100', '0482 324785', '1980-12-13', 4545.2, 1),
(5, 'Jansens', 'Pierre', 'Nieuwstraat 45', '1000', '02 2541245', '1966-08-01', 5412.3, 1);
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `tblwijnen`
--
CREATE TABLE IF NOT EXISTS `tblwijnen` (
`artnr` int(5) NOT NULL DEFAULT '0',
`artom` varchar(25) DEFAULT NULL,
`soort` int(1) DEFAULT NULL,
`jaar` int(4) DEFAULT NULL,
`prijs` decimal(4,3) DEFAULT NULL,
`stock` int(3) DEFAULT NULL,
`leverancier` int(1) DEFAULT NULL,
`maximalestock` int(3) DEFAULT NULL,
`minimalestock` int(3) DEFAULT NULL,
PRIMARY KEY (`artnr`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Gegevens worden uitgevoerd voor tabel `tblwijnen`
--
INSERT INTO `tblwijnen` (`artnr`, `artom`, `soort`, `jaar`, `prijs`, `stock`, `leverancier`, `maximalestock`, `minimalestock`) VALUES
(65217, 'Chateau HAUTERIVE', 1, 1988, '3.000', 220, 2, 300, 100),
(65218, 'Bresane', 1, 1986, '5.250', 125, 1, 500, 200),
(65350, 'Chateau L''HERMITAGE', 3, 1989, '1.750', 155, 2, 175, 135),
(65522, 'Chateau LA PAROISSE', 4, 1988, '2.370', 0, 2, 200, 150),
(65630, 'Moulin à vent', 4, 1991, '3.750', 240, 2, 260, 220),
(65710, 'Bourgogne Passetoutgrain', 5, 1991, '2.750', 150, 1, 170, 130),
(65718, 'Hautes Côtes de Beaune', 5, 1984, '4.000', 260, 2, 280, 240),
(65723, 'Hautes Côtes de Nuits', 5, 1984, '2.500', 275, 3, 295, 255),
(66077, 'Chateau ST-SAUVEUR', 1, 1988, '2.150', 240, 2, 260, 220),
(66080, 'Chateau QUIMPER', 1, 1990, '6.000', 155, 3, 175, 135),
(66258, 'Chateau TOUR BALADOZ', 3, 1989, '4.250', 280, 1, 300, 260),
(66263, 'Chateau CANON', 3, 1987, '6.870', 0, 3, 100, 0),
(67086, 'Chateau POTENSAC', 1, 1989, '4.000', 300, 1, 320, 280),
(67091, 'Chateau LOUDENNE', 1, 1987, '3.250', 250, 2, 270, 230),
(67264, 'Chateau L''EGLISE', 3, 1988, '3.500', 250, 1, 270, 230),
(67293, 'Chateau BELAIR', 2, 1989, '5.500', 370, 2, 390, 350),
(67297, 'La combe brune', 2, 1989, '5.000', 345, 3, 365, 325),
(67298, 'Chateau LA POINTE', 2, 1989, '6.625', 465, 3, 485, 445),
(67407, 'Chiroubles', 4, 1988, '3.125', 220, 1, 240, 200),
(67408, 'Julienas', 4, 1988, '2.875', 220, 2, 240, 200),
(68098, 'Chateau VIRDIGNAN', 1, 1989, '4.250', 275, 2, 295, 255),
(68236, 'Chateau YON FIGEAC', 3, 1988, '6.000', 390, 2, 410, 370),
(68245, 'Chateau PAVIE', 3, 1987, '6.250', 410, 2, 430, 390),
(68275, 'Chateau de Lussac', 3, 1991, '2.625', 160, 1, 180, 140),
(68301, 'Chateau MOULIN LAVAUD', 2, 1990, '2.750', 190, 1, 210, 170),
(68371, 'Nuits-St-Georges', 5, 1987, '8.125', 470, 2, 490, 450),
(68376, 'Gevrey-Chambertin', 5, 1986, '7.625', 450, 2, 470, 430),
(68409, 'Fleurie', 4, 1989, '3.000', 220, 3, 240, 200),
(69101, 'Chateau LA TOUR CARNET', 1, 1988, '6.120', 400, 2, 420, 380),
(69107, 'Chateau TOUR DU MOULIN', 1, 1988, '3.870', 275, 1, 295, 255),
(69254, 'Chateau LASSEGUE', 3, 1988, '4.620', 270, 2, 290, 250),
(69255, 'Chateau TOURANS', 3, 1989, '4.000', 275, 1, 295, 255),
(69291, 'Clos RENE', 2, 1987, '5.250', 330, 2, 350, 310),
(69299, 'Chateau LAFAURIE', 2, 1989, '2.620', 190, 1, 210, 170),
(69300, 'Chateau CHAINGNEAU', 2, 1989, '2.370', 190, 3, 210, 170),
(69385, 'Savigny les Beaune', 5, 1990, '4.370', 340, 2, 360, 320),
(69393, 'Côtes de Beaune-Villages', 5, 1989, '4.500', 317, 1, 300, 100),
(69396, 'Mercurey', 5, 1988, '5.370', 400, 2, 400, 200),
(69404, 'Beaujolais - Villages', 4, 1991, '2.120', 0, 1, 200, 50),
(69405, 'Chateau de Corcelles', 4, 1990, '4.000', 250, 2, 270, 230),
(69418, 'Morgon', 4, 1991, '2.870', 210, 3, 230, 190),
(69423, 'Chenas', 4, 1991, '2.250', 170, 2, 190, 150);
Ga door naar de volgende bladzijde in de cursus: SELECT (1 tabel)