Concetti Chiave
- Il codice sorgente è un dump SQL generato da phpMyAdmin per gestire le prenotazioni.
- Definisce la struttura della tabella "spettacoli", con colonne per id, titolo, orari di inizio e fine, e costo.
- Include dati di esempio inseriti nella tabella "spettacoli" con informazioni sugli spettacoli e i relativi costi.
- L'id della tabella "spettacoli" è impostato come chiave primaria e utilizza l'AUTO_INCREMENT.
- Il set di istruzioni SQL è in formato compatibile con versioni specifiche di MySQL e PHP.
Questo articolo contiene un codice sorgente di un database che si potrebbe utilizzare per gestire le prenotazioni.
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: ****
-- Generation Time: Apr 07, 2015 alle 12:06
-- Versione del server: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `prenotazioni`
--
-- --------------------------------------------------------
--
-- Struttura della tabella `spettacoli`
--
CREATE TABLE IF NOT EXISTS `spettacoli` (
`id` int(255) NOT NULL,
`titolo` varchar(100) NOT NULL,
`orario_i` datetime NOT NULL,
`orario_f` datetime NOT NULL,
`costo` double(60,2) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1;
--
-- Dump dei dati per la tabella `spettacoli`
--
INSERT INTO `spettacoli` (`id`, `titolo`, `orario_i`, `orario_f`, `costo`) VALUES
(1, 'Titolo1', '2015-08-04 15:00:00', '2015-08-04 15:50:00', 10.00),
(2, 'Titolo2', '2015-04-05 00:00:00', '2015-04-05 00:50:00', 5.00),
(3, 'Titolo1', '2015-08-04 15:00:00', '2015-08-04 15:00:00', 50.00),
(4, 'Titolo1', '2015-08-04 15:00:00', '2015-08-04 15:00:00', 50.00),
(5, 'Titolo1', '2015-08-04 15:00:00', '2015-08-04 15:00:00', 50.00),
(6, 'Titolo1', '2015-08-04 15:00:00', '2015-08-04 15:00:00', 50.00),
(7, 'Titolo1', '2015-08-04 15:00:00', '1924-10-02 06:21:44', 5.00),
(8, 'Titolo1', '2015-08-04 15:00:00', '2015-08-04 15:50:00', 50.00),
(9, 'Titolo1', '2015-07-04 11:00:00', '2015-07-04 13:00:00', 20.00),
(10, 'Titolo1', '2015-04-07 11:00:00', '2015-04-07 13:00:00', 20.00);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `spettacoli`
--
ALTER TABLE `spettacoli`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `spettacoli`
--
ALTER TABLE `spettacoli`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=11;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;