I would like your thoughts on my database structure. I am kind of a rookie but I am trying. All of your suggestions, alternatives, ideas, additions are welcome. Thank you.CREATE TABLE `buy` (  `PurchaseID` int(10) unsigned NOT NULL AUTO_INCREMENT,  `PurchaseTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,  `CashMachineCode` int(10) unsigned NOT NULL,  PRIMARY KEY (`PurchaseID`),  KEY `CashMachineCode` (`CashMachineCode`),  CONSTRAINT `buy_ibfk_1` FOREIGN KEY (`CashMachineCode`) REFERENCES `cashmachine` (`CashMachineCode`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `buying` (  `CustomerID` int(10) unsigned NOT NULL,  `PurchaseID` int(10) unsigned NOT NULL,  PRIMARY KEY (`CustomerID`,`PurchaseID`),  KEY `PurchaseID` (`PurchaseID`),  CONSTRAINT `buying_ibfk_1` FOREIGN KEY (`CustomerID`) REFERENCES `customer` (`CreditCardCode`) ON DELETE CASCADE ON UPDATE CASCADE,  CONSTRAINT `buying_ibfk_2` FOREIGN KEY (`PurchaseID`) REFERENCES `buy` (`PurchaseID`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `shift` (  `CashierCode` int(10) unsigned NOT NULL,  `CashMachineCode` int(10) unsigned NOT NULL,  `ShiftStart` time NOT NULL,  `ShiftEnd` time DEFAULT NULL,  PRIMARY KEY (`CashierCode`,`CashMachineCode`,`ShiftStart`),  KEY `CashMachineCode` (`CashMachineCode`),  CONSTRAINT `shift_ibfk_1` FOREIGN KEY (`CashierCode`) REFERENCES `employee` (`EmployeeID`) ON DELETE CASCADE ON UPDATE CASCADE,  CONSTRAINT `shift_ibfk_2` FOREIGN KEY (`CashMachineCode`) REFERENCES `cashmachine` (`CashMachineCode`) ON DELETE CASCADE ON UPDATE CASCADE) CREATE TABLE `availability` (  `ShopID` int(10) unsigned NOT NULL,  `ProductID` int(10) unsigned NOT NULL,  PRIMARY KEY (`ProductID`,`ShopID`),  KEY `ShopID` (`ShopID`),  CONSTRAINT `availability_ibfk_1` FOREIGN KEY (`ShopID`) REFERENCES `shop` (`ShopID`) ON DELETE CASCADE ON UPDATE CASCADE,  CONSTRAINT `availability_ibfk_2` FOREIGN KEY (`ProductID`) REFERENCES `product` (`ProductID`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `director` (  `EmployeeID` int(10) unsigned NOT NULL,  PRIMARY KEY (`EmployeeID`),  CONSTRAINT `director_ibfk_1` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `WorksOn` (  `EmployeeID` int(10) unsigned NOT NULL,  `ShopID` int(10) unsigned NOT NULL,  PRIMARY KEY (`EmployeeID`),  KEY `ShopID` (`ShopID`),  CONSTRAINT `WorksOn_ibfk_1` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON DELETE CASCADE ON UPDATE CASCADE,  CONSTRAINT `WorksOn_ibfk_2` FOREIGN KEY (`ShopID`) REFERENCES `shop` (`ShopID`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `shop` (  `ShopID` int(10) unsigned NOT NULL AUTO_INCREMENT,  `Name` varchar(45) DEFAULT NULL,  `Address` varchar(100) DEFAULT NULL,  PRIMARY KEY (`ShopID`))CREATE TABLE `customer` (  `CreditCardCode` int(10) unsigned NOT NULL AUTO_INCREMENT,  `CustomerName` varchar(45) DEFAULT NULL,  `CustomerSurname` varchar(45) DEFAULT NULL,  `Address` varchar(100) DEFAULT NULL,  PRIMARY KEY (`CreditCardCode`))CREATE TABLE `contains` (  `PurchaseID` int(10) unsigned NOT NULL,  `ProductID` int(10) unsigned NOT NULL,  `Quantity` int(10) unsigned NOT NULL,  `ProductPrice` decimal(10,2) unsigned NOT NULL,  PRIMARY KEY (`PurchaseID`,`ProductID`),  KEY `ProductID` (`ProductID`),  CONSTRAINT `contains_ibfk_1` FOREIGN KEY (`PurchaseID`) REFERENCES `buy` (`PurchaseID`) ON DELETE CASCADE ON UPDATE CASCADE,  CONSTRAINT `contains_ibfk_2` FOREIGN KEY (`ProductID`) REFERENCES `product` (`ProductID`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `product` (  `ProductID` int(10) unsigned NOT NULL,  `Description` varchar(100) DEFAULT NULL,  PRIMARY KEY (`ProductID`))CREATE TABLE `cashmachine` (  `CashMachineCode` int(10) unsigned NOT NULL AUTO_INCREMENT,  `Number` int(11) NOT NULL,  `ShopID` int(10) unsigned NOT NULL,  PRIMARY KEY (`CashMachineCode`),  KEY `ShopID` (`ShopID`),  CONSTRAINT `cashmachine_ibfk_1` FOREIGN KEY (`ShopID`) REFERENCES `shop` (`ShopID`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `cashier` (  `EmployeeID` int(10) unsigned NOT NULL,  PRIMARY KEY (`EmployeeID`),  CONSTRAINT `cashier_ibfk_1` FOREIGN KEY (`EmployeeID`) REFERENCES `employee` (`EmployeeID`) ON DELETE CASCADE ON UPDATE CASCADE)CREATE TABLE `employee` (  `EmployeeID` int(10) unsigned NOT NULL AUTO_INCREMENT,  `EmployeeName` varchar(45) DEFAULT NULL,  `EmployeeSurname` varchar(45) DEFAULT NULL,  PRIMARY KEY (`EmployeeID`))
Cash Register database structure
sql;mysql