Masalahnya bukan buruh pelabuhan, SQL
Anda berkas tidak valid. Anda membuat tabel di bawah ini di file Anda dan tabel referensi di awal skrip.
Memeriksa log wadah buruh pelabuhan Anda.
use studienarbeit;
CREATE TABLE `buchtyp` (
`Buchid` int(11) NOT NULL AUTO_INCREMENT,
`Autor` varchar(45) NOT NULL,
`Titel` varchar(45) NOT NULL,
`ISBN` int(11) NOT NULL,
PRIMARY KEY (`Buchid`),
UNIQUE KEY `ISBN_UNIQUE` (`ISBN`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `person` (
`PersonID` int(11) NOT NULL AUTO_INCREMENT,
`Typ` varchar(45) NOT NULL,
`Name` varchar(45) NOT NULL,
`Vorname` varchar(45) NOT NULL,
`Faku` varchar(45) DEFAULT NULL,
`Matrikelnr` int(11) DEFAULT NULL,
`Gruppe` varchar(45) DEFAULT NULL,
`Straße` varchar(45) DEFAULT NULL,
`Hausnummer` varchar(45) DEFAULT NULL,
`Ort` varchar(45) DEFAULT NULL,
`Plz` varchar(45) DEFAULT NULL,
PRIMARY KEY (`PersonID`),
UNIQUE KEY `PersonID_UNIQUE` (`PersonID`),
UNIQUE KEY `Matrikelnr_UNIQUE` (`Matrikelnr`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `student` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(45) NOT NULL,
`Gruppe` varchar(45) NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `buchexemplar` (
`Seriennummer` int(11) NOT NULL,
`Buchstatus` varchar(45) NOT NULL,
`buchid` int(11) NOT NULL,
PRIMARY KEY (`Seriennummer`),
KEY `buchid_idx` (`buchid`),
CONSTRAINT `buchid` FOREIGN KEY (`buchid`) REFERENCES `buchtyp` (`buchid`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE `buchausleihe` (
`ausleihnummer` int(11) NOT NULL AUTO_INCREMENT,
`Name` varchar(45) NOT NULL,
`Typ` varchar(45) NOT NULL,
`personid` int(11) NOT NULL,
`seriennummer` int(11) NOT NULL,
`Ausleihdatum` varchar(45) NOT NULL,
`Rückgabedatum` varchar(45) NOT NULL,
UNIQUE KEY `ausleihnummer_UNIQUE` (`ausleihnummer`),
UNIQUE KEY `seriennummer_UNIQUE` (`seriennummer`),
KEY `personid_idx` (`personid`),
CONSTRAINT `personid` FOREIGN KEY (`personid`) REFERENCES `person` (`personid`) ON DELETE CASCADE,
CONSTRAINT `seriennummer` FOREIGN KEY (`seriennummer`) REFERENCES `buchexemplar` (`seriennummer`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;