-- MySQL dump 10.13 Distrib 5.1.40, for Win32 (ia32) -- -- Host: localhost Database: bookis7 -- ------------------------------------------------------ -- Server version 5.1.40-community /*!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 `author` -- DROP TABLE IF EXISTS `author`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `author` ( `AuthorNr` int(10) unsigned NOT NULL AUTO_INCREMENT, `Name` varchar(50) NOT NULL, `Yearofbirth` int(10) unsigned DEFAULT NULL, `Yearofdeath` int(10) unsigned DEFAULT NULL, PRIMARY KEY (`AuthorNr`) ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `author` -- LOCK TABLES `author` WRITE; /*!40000 ALTER TABLE `author` DISABLE KEYS */; INSERT INTO `author` VALUES (1,'Richard Monson-Hafael',1955,NULL),(2,'Charles Johnson',1960,NULL),(3,'Elaine H. Pagels',1974,NULL),(4,'Jane Alison',1966,NULL),(5,'Jane Butler-Biggs',1962,NULL),(6,'Alison Daniels',1967,NULL),(7,'George Reese',1938,2003),(8,'Randy Jay Yarger',1971,NULL),(9,'Tim King',1935,2002),(10,'Rasmus Lerdorf',1954,NULL),(11,'Kevin Tatroe',1958,NULL),(12,'Matthew Woodring Stover',1966,NULL),(13,'Jude Watson',1974,NULL); /*!40000 ALTER TABLE `author` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `book` -- DROP TABLE IF EXISTS `book`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `book` ( `BookNr` int(10) unsigned NOT NULL AUTO_INCREMENT, `Title` varchar(200) NOT NULL, `Price` decimal(10,0) NOT NULL, `Year` int(10) unsigned NOT NULL, PRIMARY KEY (`BookNr`) ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `book` -- LOCK TABLES `book` WRITE; /*!40000 ALTER TABLE `book` DISABLE KEYS */; INSERT INTO `book` VALUES (1,'Enterprise JavaBeans','600',2003),(2,'Turning the Wheel: Essays on Buddhism and Writing','440',2002),(3,'Beyond Belief','175',2001),(4,'The Marriage of the Sea: A Novel ','200',1998),(5,'The Love-Artist : A Novel','210',2000),(6,'The Feng Shui Directory','330',2003),(7,'Feng Shui in 10 Simple Lessons','160',1998),(8,'Feng Shui Fusion: Jane Butler-Biggs','250',1993),(9,'Java Database Best Practices','450',1998),(10,'Managing and Using MySQL','195',2002),(11,'MySQL Pocket Reference','110',1999),(12,'Database Programming with JDBC and Java','260',2001),(13,'MySQL and mSQL','300',2000),(14,'Programming PHP','299',2001),(15,'Star Wars: Shatterpoint','175',2003),(16,'The Jedi Quest: Master of Disguise','55',2002); /*!40000 ALTER TABLE `book` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `booksubject` -- DROP TABLE IF EXISTS `booksubject`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `booksubject` ( `BookNr` int(10) unsigned NOT NULL, `SubjectNr` int(10) unsigned NOT NULL, PRIMARY KEY (`BookNr`,`SubjectNr`), KEY `FK_BookSubject_2` (`SubjectNr`), CONSTRAINT `FK_BookSubject_1` FOREIGN KEY (`BookNr`) REFERENCES `book` (`BookNr`), CONSTRAINT `FK_BookSubject_2` FOREIGN KEY (`SubjectNr`) REFERENCES `subject` (`SubjectNr`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `booksubject` -- LOCK TABLES `booksubject` WRITE; /*!40000 ALTER TABLE `booksubject` DISABLE KEYS */; INSERT INTO `booksubject` VALUES (15,1),(16,1),(1,2),(7,2),(9,2),(10,2),(12,2),(14,2),(6,3),(7,3),(8,3),(3,4),(4,4),(5,4),(16,4),(1,5),(9,5),(10,5),(11,5),(12,5),(13,5),(14,5),(2,6),(6,6),(4,8); /*!40000 ALTER TABLE `booksubject` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `coauthor` -- DROP TABLE IF EXISTS `coauthor`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `coauthor` ( `BookNr` int(10) unsigned NOT NULL, `AuthorNr` int(10) unsigned NOT NULL, PRIMARY KEY (`BookNr`,`AuthorNr`), KEY `FK_CoAuthor_2` (`AuthorNr`), CONSTRAINT `FK_CoAuthor_1` FOREIGN KEY (`BookNr`) REFERENCES `book` (`BookNr`), CONSTRAINT `FK_CoAuthor_2` FOREIGN KEY (`AuthorNr`) REFERENCES `author` (`AuthorNr`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `coauthor` -- LOCK TABLES `coauthor` WRITE; /*!40000 ALTER TABLE `coauthor` DISABLE KEYS */; INSERT INTO `coauthor` VALUES (1,1),(2,2),(3,3),(4,4),(5,4),(6,5),(7,5),(8,5),(6,6),(9,7),(10,7),(11,7),(12,7),(13,7),(13,8),(13,9),(14,10),(14,11),(15,12),(16,13); /*!40000 ALTER TABLE `coauthor` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `customer` -- DROP TABLE IF EXISTS `customer`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `customer` ( `CustomerNr` int(10) unsigned NOT NULL AUTO_INCREMENT, `Name` varchar(50) NOT NULL, `Address` varchar(50) NOT NULL, `City` varchar(25) NOT NULL, `Country` varchar(30) NOT NULL, PRIMARY KEY (`CustomerNr`) ) ENGINE=InnoDB AUTO_INCREMENT=20 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `customer` -- LOCK TABLES `customer` WRITE; /*!40000 ALTER TABLE `customer` DISABLE KEYS */; INSERT INTO `customer` VALUES (1,'Anna Book','Granvägen 4','Stockholm','Sweden'),(2,'Putte Rask','Tångvägen 6','Stockholm','Sweden'),(3,'Sonja Hurtig','Box 1906','Umeå','Sweden'),(4,'Niklas Holm','Byvägen 112','Malmö','Sweden'),(5,'Svea Sund','Bergsvägen 12','Uppsala','Sweden'),(6,'Pontus Grip','Hjortbacken 6','Uppsala','Sweden'),(7,'Gerge Lucas','Lucas Mansion','Hollywood','USA'),(8,'Bill Gates','Gates Estate','Seattle','USA'),(9,'Michael Jackson','MJWorld','Jacksonville','USA'),(10,'Homer Simpson','Mainstreet 43','Springfield','USA'),(11,'Clark Kent','Baker street 12','Smallville','USA'),(12,'Mike Myers','Bacon Avenue 54','Ontario','Canada'),(13,'Ricky Martin','Avda. Reyes de España 25-27','Salamanca','Spain'),(14,'Yulia Volkova','Pavilion 4','Moscow','Russia'),(19,'Lisa Andersson','Solstigen 37','Kista','Sweden'); /*!40000 ALTER TABLE `customer` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `customerorder` -- DROP TABLE IF EXISTS `customerorder`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `customerorder` ( `OrderNr` int(10) unsigned NOT NULL AUTO_INCREMENT, `Date` date NOT NULL, `CustomerNr` int(10) unsigned NOT NULL, PRIMARY KEY (`OrderNr`), KEY `FK_Order_1` (`CustomerNr`), CONSTRAINT `FK_Order_1` FOREIGN KEY (`CustomerNr`) REFERENCES `customer` (`CustomerNr`) ) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `customerorder` -- LOCK TABLES `customerorder` WRITE; /*!40000 ALTER TABLE `customerorder` DISABLE KEYS */; INSERT INTO `customerorder` VALUES (10,'2003-09-05',1),(11,'2003-09-06',1),(12,'2003-01-04',2),(13,'2003-04-06',6),(14,'2003-09-09',4),(15,'2003-02-02',7),(16,'2003-09-09',6),(17,'2003-11-22',8),(18,'1998-05-05',5),(19,'2002-09-09',9),(20,'2001-05-07',4),(21,'2001-01-04',2),(22,'2002-07-08',1); /*!40000 ALTER TABLE `customerorder` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `orderitem` -- DROP TABLE IF EXISTS `orderitem`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `orderitem` ( `OrderNr` int(10) unsigned NOT NULL, `BookNr` int(10) unsigned NOT NULL, `Amount` int(10) unsigned NOT NULL DEFAULT '1', `Price` decimal(10,0) NOT NULL, PRIMARY KEY (`OrderNr`,`BookNr`), KEY `FK_OrderItem_2` (`BookNr`), CONSTRAINT `FK_OrderItem_1` FOREIGN KEY (`OrderNr`) REFERENCES `customerorder` (`OrderNr`), CONSTRAINT `FK_OrderItem_2` FOREIGN KEY (`BookNr`) REFERENCES `book` (`BookNr`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `orderitem` -- LOCK TABLES `orderitem` WRITE; /*!40000 ALTER TABLE `orderitem` DISABLE KEYS */; INSERT INTO `orderitem` VALUES (10,1,1,'600'),(11,6,1,'330'),(11,7,1,'160'),(12,3,1,'175'),(13,11,2,'110'),(13,14,1,'299'),(14,15,1,'175'),(15,15,10,'150'),(15,16,5,'40'),(16,1,1,'600'),(17,1,1,'600'),(17,3,1,'175'),(18,8,1,'169'),(19,2,3,'500'),(20,9,1,'400'),(20,11,1,'200'),(21,3,1,'240'),(21,4,1,'250'),(22,4,1,'300'),(22,16,1,'79'); /*!40000 ALTER TABLE `orderitem` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `subject` -- DROP TABLE IF EXISTS `subject`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `subject` ( `SubjectNr` int(10) unsigned NOT NULL AUTO_INCREMENT, `Subject` varchar(55) NOT NULL, PRIMARY KEY (`SubjectNr`) ) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `subject` -- LOCK TABLES `subject` WRITE; /*!40000 ALTER TABLE `subject` DISABLE KEYS */; INSERT INTO `subject` VALUES (1,'Science Fiction'),(2,'Educational'),(3,'Meditation'),(4,'Romance'),(5,'Technology'),(6,'Religion'),(7,'Cooking'),(8,'Nature'),(9,'Art'); /*!40000 ALTER TABLE `subject` 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 2010-02-10 12:52:01