SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
CREATE TABLE `Customer` ( `customer_number` Int auto_increment, `order_number` Int, `fname` varchar(255), `lname` varchar(255), `street_number` Int, `street_name` varchar(255), `city` varchar(255), `state` varchar(255), `zip` Int, `phone_number` varchar(15), `payment_ID` Int, PRIMARY KEY (`customer_number`, `order_number`) ); CREATE TABLE `Driver` ( `driver_ID` Int auto_increment, `fname` varchar(255), `lname` varchar(255), `phone_number` Int, `license_plate` varchar(255), `drivers_license_number` varchar(255), `payment_ID` Int, `order_number` Int, PRIMARY KEY (`driver_ID`, `order_number`) ); CREATE TABLE `Resturant` ( `resturant_number` Int auto_increment, `order_number` Int, `name` varchar(255), `payment_ID` Int, `street_number` Int, `street_name` varchar(255), `city` varchar(255), `state` varchar(255), `zip` Int, `phone_number` Int, `cusine` varchar(255), PRIMARY KEY (`resturant_number`, `order_number`) ); CREATE TABLE `Ordered` ( `order_number` Int auto_increment not null, `resturant_number` Int auto_increment, `customer_number` Int, `time_stamp` varchar(255), `order_status` varchar(255), `driver_ID` Int, PRIMARY KEY (`order_number`), FOREIGN KEY (`resturant_number`) REFERENCES `Resturant`(`resturant_number`), FOREIGN KEY (`customer_number`) REFERENCES `Customer`(`customer_number`), FOREIGN KEY (`driver_ID`) REFERENCES `Driver`(`driver_ID`) ); insert into Customer(fname, lname, street_number, street_name, city, state, zip, phone_number, payment_ID) values ('April','Ludgate', 123, 'S 55 Ave', 'Omaha', 'NE', 68132, '402-553-4397', 23456); select * from Customer; select * from Driver; select * from Resturant; select * from Ordered;

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear