0% found this document useful (0 votes)
5 views1 page

Pizza Order and Reservation Database

The document contains SQL commands to create three tables: 'nomepizza' for pizza details, 'ordini' for orders, and 'prenotazioni' for reservations. It includes the structure of each table with their respective fields and primary keys, as well as sample data inserts for pizzas, orders, and reservations. The data includes pizza names, prices, order quantities, and reservation details such as table ID, date, and time.

Uploaded by

rebeccasuisola
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Pizza Order and Reservation Database

The document contains SQL commands to create three tables: 'nomepizza' for pizza details, 'ordini' for orders, and 'prenotazioni' for reservations. It includes the structure of each table with their respective fields and primary keys, as well as sample data inserts for pizzas, orders, and reservations. The data includes pizza names, prices, order quantities, and reservation details such as table ID, date, and time.

Uploaded by

rebeccasuisola
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

CREATE TABLE `nomepizza` (

`IDPizza` varchar(10) NOT NULL,


`Nome` varchar(45) NOT NULL,
`Prezzo` double NOT NULL,
PRIMARY KEY (`IDPizza`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `nomepizza` VALUES ('P1','Margherita',4),('P2','Marinara',3.5),


('P3','Calzone Napoletano',5),('P4','Calzone Romano',5.5),('P5','Prosciutto e
Funghi',6),('P6','Boscaiola',6),('P7','Contadina',6),('P8','Pizza Calzone',8);

CREATE TABLE `ordini` (


`IDPren` varchar(10) NOT NULL,
`IDPizza` varchar(10) NOT NULL DEFAULT '',
`Quantita` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`IDPren`,`IDPizza`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `ordini` VALUES ('A2','P6',3),('A3','P1',3),('A3','P4',2),


('A4','P1',1),('A5','P2',2);

CREATE TABLE `prenotazioni` (


`IDPren` varchar(10) NOT NULL,
`IDTavolo` int(11) NOT NULL,
`data` date NOT NULL,
`ora` time NOT NULL,
PRIMARY KEY (`IDPren`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

INSERT INTO `prenotazioni` VALUES ('A1',2,'2019-07-02','19:30:00'),('A2',2,'2019-


07-02','21:00:00'),('A3',4,'2019-07-02','22:00:00'),('A4',2,'2019-07-
05','21:00:00'),('A5',3,'2019-07-04','17:30:00');

You might also like