text: CREATE DATABASE  IF NOT EXISTS `ContestService` /*!40100 DEFAULT CHARACTER SET utf8 */;
  USE `ContestService`;
  -- MySQL dump 10.13  Distrib 5.5.9, for Win32 (x86)
  --
  -- Host: localhost    Database: ContestService
  -- ------------------------------------------------------
  -- Server version	5.1.63-0ubuntu0.11.10.1
  
  /*!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 `Leader_Book_Room`
  --
  
  DROP TABLE IF EXISTS `Leader_Book_Room`;
  /*!40101 SET @saved_cs_client     = @@character_set_client */;
  /*!40101 SET character_set_client = utf8 */;
  CREATE TABLE `Leader_Book_Room` (
    `User_id` int(11) NOT NULL,
    `Room_id` int(11) NOT NULL,
    `Count` int(11) DEFAULT NULL,
    PRIMARY KEY (`User_id`,`Room_id`),
    KEY `fk_User_has_Room_Room1` (`Room_id`),
    KEY `fk_User_has_Room_User1` (`User_id`),
    CONSTRAINT `fk_User_has_Room_Room1` FOREIGN KEY (`Room_id`) REFERENCES `Room` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `fk_User_has_Room_User1` FOREIGN KEY (`User_id`) REFERENCES `User` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  /*!40101 SET character_set_client = @saved_cs_client */;
  
  --
  -- Dumping data for table `Leader_Book_Room`
  --
  
  LOCK TABLES `Leader_Book_Room` WRITE;
  /*!40000 ALTER TABLE `Leader_Book_Room` DISABLE KEYS */;
  /*!40000 ALTER TABLE `Leader_Book_Room` ENABLE KEYS */;
  UNLOCK TABLES;
  /*!50003 SET @saved_cs_client      = @@character_set_client */ ;
  /*!50003 SET @saved_cs_results     = @@character_set_results */ ;
  /*!50003 SET @saved_col_connection = @@collation_connection */ ;
  /*!50003 SET character_set_client  = utf8 */ ;
  /*!50003 SET character_set_results = utf8 */ ;
  /*!50003 SET collation_connection  = utf8_general_ci */ ;
  /*!50003 SET @saved_sql_mode       = @@sql_mode */ ;
  /*!50003 SET sql_mode              = 'STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER' */ ;
  DELIMITER ;;
  /*!50003 CREATE*/ /*!50017 DEFINER=`root`@`localhost`*/ /*!50003 TRIGGER delete_book_room BEFORE DELETE ON `ContestService`.`Leader_Book_Room` FOR EACH ROW
  BEGIN
      UPDATE `Room` SET `Room`.`Booked`=`Room`.`Booked`-OLD.`Count` WHERE OLD.`Room_Id`=`Room`.`Id`;
  END */;;
  DELIMITER ;
  /*!50003 SET sql_mode              = @saved_sql_mode */ ;
  /*!50003 SET character_set_client  = @saved_cs_client */ ;
  /*!50003 SET character_set_results = @saved_cs_results */ ;
  /*!50003 SET collation_connection  = @saved_col_connection */ ;
  /*!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 2012-09-19  6:59:52
  