CREATE DATABASE  IF NOT EXISTS `sir` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `sir`;
-- MySQL dump 10.13  Distrib 5.6.13, for Win32 (x86)
--
-- Host: localhost    Database: sir
-- ------------------------------------------------------
-- Server version	5.6.14

/*!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 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `accounts`
--

DROP TABLE IF EXISTS `accounts`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `accounts` (
  `ID` decimal(11,0) NOT NULL DEFAULT '0',
  `ID_UTENTE` decimal(11,0) DEFAULT NULL,
  `USERNAME` varchar(255) DEFAULT NULL,
  `PASSWORD` varchar(255) DEFAULT NULL,
  `DATA_CREAZIONE` date DEFAULT NULL,
  `DATA_SCADENZA` date DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_ACCO_UTEN` (`ID_UTENTE`),
  CONSTRAINT `FK_ACCO_UTEN` FOREIGN KEY (`ID_UTENTE`) REFERENCES `utenti` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `accounts`
--

LOCK TABLES `accounts` WRITE;
/*!40000 ALTER TABLE `accounts` DISABLE KEYS */;
INSERT INTO `accounts` VALUES (1,NULL,'a','3104',NULL,NULL);
/*!40000 ALTER TABLE `accounts` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `categorie_prodotti`
--

DROP TABLE IF EXISTS `categorie_prodotti`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categorie_prodotti` (
  `ID` decimal(11,0) NOT NULL DEFAULT '0',
  `NOME` varchar(255) DEFAULT NULL,
  `DESCRIZIONE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `categorie_prodotti`
--

LOCK TABLES `categorie_prodotti` WRITE;
/*!40000 ALTER TABLE `categorie_prodotti` DISABLE KEYS */;
INSERT INTO `categorie_prodotti` VALUES (1,'Pizzeria',NULL),(2,'Insalate',NULL),(3,'Panini',NULL),(4,'Antipasti',NULL),(5,'Primi',NULL),(6,'Secondi',NULL),(7,'Contorni',NULL),(8,'Frutta',NULL),(9,'Dessert',NULL),(10,'Bevande',NULL),(11,'Bar',NULL),(12,'Menu',NULL);
/*!40000 ALTER TABLE `categorie_prodotti` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `categorie_utenti`
--

DROP TABLE IF EXISTS `categorie_utenti`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `categorie_utenti` (
  `ID` decimal(11,0) NOT NULL DEFAULT '0',
  `NOME` varchar(255) DEFAULT NULL,
  `DESCRIZIONE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `categorie_utenti`
--

LOCK TABLES `categorie_utenti` WRITE;
/*!40000 ALTER TABLE `categorie_utenti` DISABLE KEYS */;
/*!40000 ALTER TABLE `categorie_utenti` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `prodotti`
--

DROP TABLE IF EXISTS `prodotti`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `prodotti` (
  `ID` decimal(11,0) NOT NULL DEFAULT '0',
  `CODICE` varchar(255) DEFAULT NULL,
  `NOME` varchar(255) DEFAULT NULL,
  `DESCRIZIONE` varchar(255) DEFAULT NULL,
  `ID_CATEGORIA` decimal(11,0) DEFAULT NULL,
  `PREZZO_BASE` decimal(11,5) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_PROD_CAPR` (`ID_CATEGORIA`),
  CONSTRAINT `FK_PROD_CAPR` FOREIGN KEY (`ID_CATEGORIA`) REFERENCES `categorie_prodotti` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `prodotti`
--

LOCK TABLES `prodotti` WRITE;
/*!40000 ALTER TABLE `prodotti` DISABLE KEYS */;
INSERT INTO `prodotti` VALUES (1,'123','Suppli',NULL,1,1.49000),(2,NULL,'Acqua minerale',NULL,10,1.00000),(3,NULL,'Brioche',NULL,11,1.00000),(4,NULL,'Caffe','',11,0.80000),(5,NULL,'Cappuccino',NULL,11,0.90000),(6,NULL,'Coca Cola lattina',NULL,10,2.00000),(7,NULL,'Frutta fresca',NULL,8,2.50000),(8,NULL,'Hamburger',NULL,6,4.00000),(9,NULL,'Hot dog',NULL,3,3.00000),(10,NULL,'Insalata nizzarda',NULL,2,3.50000),(11,NULL,'Insalata verde',NULL,7,2.50000),(12,NULL,'Menu cena',NULL,12,5.00000),(13,NULL,'Menu pranzo',NULL,12,6.00000),(14,NULL,'Menu colazione',NULL,12,2.50000),(15,NULL,'Omelette',NULL,6,3.00000),(16,NULL,'Pasta al ragu',NULL,5,2.00000),(17,NULL,'Pasta fredda',NULL,5,2.00000),(18,NULL,'Risotto',NULL,5,2.50000),(19,NULL,'Pizza margherita',NULL,1,3.00000),(20,NULL,'Prosciutto crudo',NULL,3,3.00000),(21,NULL,'Spremuta arancia',NULL,11,2.50000),(22,NULL,'Vetrino',NULL,11,1.00000),(23,NULL,'Tiramisu',NULL,8,NULL);
/*!40000 ALTER TABLE `prodotti` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tariffe`
--

DROP TABLE IF EXISTS `tariffe`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tariffe` (
  `ID` decimal(11,0) NOT NULL DEFAULT '0',
  `NUMERO` varchar(255) DEFAULT NULL,
  `DATA_EMISSIONE` date DEFAULT NULL,
  `DATA_SCADENZA` date DEFAULT NULL,
  `ID_PROFILO_TARIFFA` decimal(11,0) DEFAULT NULL,
  `ID_UTENTE` decimal(11,0) DEFAULT NULL,
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tariffe`
--

LOCK TABLES `tariffe` WRITE;
/*!40000 ALTER TABLE `tariffe` DISABLE KEYS */;
/*!40000 ALTER TABLE `tariffe` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `tessere`
--

DROP TABLE IF EXISTS `tessere`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tessere` (
  `ID` decimal(11,0) NOT NULL DEFAULT '0',
  `NUMERO` varchar(255) DEFAULT NULL,
  `DATA_EMISSIONE` date DEFAULT NULL,
  `DATA_SCADENZA` date DEFAULT NULL,
  `ID_PROFILO_TARIFFA` decimal(11,0) DEFAULT NULL,
  `ID_UTENTE` decimal(11,0) DEFAULT NULL,
  `CREDITO` decimal(11,5) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_TESS_UTEN` (`ID_UTENTE`),
  CONSTRAINT `FK_TESS_UTEN` FOREIGN KEY (`ID_UTENTE`) REFERENCES `utenti` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `tessere`
--

LOCK TABLES `tessere` WRITE;
/*!40000 ALTER TABLE `tessere` DISABLE KEYS */;
/*!40000 ALTER TABLE `tessere` ENABLE KEYS */;
UNLOCK TABLES;

--
-- Table structure for table `utenti`
--

DROP TABLE IF EXISTS `utenti`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `utenti` (
  `ID` decimal(11,0) NOT NULL DEFAULT '0',
  `COGNOME` varchar(255) DEFAULT NULL,
  `NOME` varchar(255) DEFAULT NULL,
  `CODICE_FISCALE` varchar(16) DEFAULT NULL,
  `DATA_DI_NASCITA` date DEFAULT NULL,
  `ID_LUOGO_NASCITA` decimal(11,0) DEFAULT NULL,
  `INDIRIZZO` varchar(255) DEFAULT NULL,
  `CAP` varchar(255) DEFAULT NULL,
  `ID_LUOGO_RESIDENZA` decimal(11,0) DEFAULT NULL,
  `TELEFONO` varchar(20) DEFAULT NULL,
  `E_MAIL` varchar(255) DEFAULT NULL,
  `ID_CATEGORIA` decimal(11,0) DEFAULT NULL,
  `MATRICOLA` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `FK_UTEN_CAUT` (`ID_CATEGORIA`),
  CONSTRAINT `FK_UTEN_CAUT` FOREIGN KEY (`ID_CATEGORIA`) REFERENCES `categorie_utenti` (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `utenti`
--

LOCK TABLES `utenti` WRITE;
/*!40000 ALTER TABLE `utenti` DISABLE KEYS */;
/*!40000 ALTER TABLE `utenti` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2013-10-30 18:38:02
