Verified Commit 2ef2e21c authored by Kiryuu Sakuya's avatar Kiryuu Sakuya 🎵
Browse files

Add No.2 Example Database

parent 30aa10f8
-- MariaDB dump 10.17 Distrib 10.4.11-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: test2
-- ------------------------------------------------------
-- Server version 10.4.11-MariaDB
/*!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 utf8mb4 */;
/*!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 `A`
--
DROP TABLE IF EXISTS `A`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `A` (
`Ano` int(11) NOT NULL COMMENT '演员编号',
`Aname` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '演员姓名',
`Aaddress` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '演员地址',
`Agender` varchar(6) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '演员性别',
`Abirthday` date NOT NULL COMMENT '演员生日',
PRIMARY KEY (`Ano`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `A`
--
LOCK TABLES `A` WRITE;
/*!40000 ALTER TABLE `A` DISABLE KEYS */;
INSERT INTO `A` VALUES (10001,'Nicolas Cage','1640 Riverside Drive, Hill Valley, California','Male','1964-01-07'),(10002,'Ellen Burstyn','214 Caldwell Road, Buffalo, New York','Female','1932-12-07'),(10003,'Kate Beahan','4725 Longview Avenue, Brooklyn, New York','Female','1974-10-12'),(10004,'Leelee Sobieski','2787 Larry Street, Milwaukee, Wisconsin','Female','1983-06-10'),(10005,'赵薇','北京市海淀区西土城路4号','Female','1976-03-12'),(10006,'陈坤','重庆市巴南区龙庭街5号城南未来三期1-2-5号','Male','1976-02-04'),(10007,'胡军','北京市东城区东棉花胡同39号','Male','1968-03-18'),(10008,'房祖名','香港湾仔皇后大道东281号','Male','1982-12-03'),(10009,'Joaquin Phoenix','3856 Maple Avenue, Stockton, California','Male','1974-10-28'),(10010,'Robert De Niro','1276 Oak Drive, Ellenburg Depot, New York','Male','1943-08-17'),(10011,'Zazie Beetz','Brandenburgische Straße 75, Berlin Pankow, Berlin','Female','1991-05-25'),(10012,'Frances Conroy','626 College Street, Atlanta, Georgia','Female','1953-11-13');
/*!40000 ALTER TABLE `A` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `C`
--
DROP TABLE IF EXISTS `C`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `C` (
`Cno` int(11) NOT NULL COMMENT '电影公司编号',
`Cname` varchar(30) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '公司名称',
`Caddress` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '公司地址',
`Ctel` varchar(15) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '公司电话',
PRIMARY KEY (`Cno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `C`
--
LOCK TABLES `C` WRITE;
/*!40000 ALTER TABLE `C` DISABLE KEYS */;
INSERT INTO `C` VALUES (20001,'Warner Bros','Burbank, US (HQ) 4000 Warner Blvd.','+18189543000'),(20002,'星光国际传媒(集团)有限公司','北京市朝阳区建国路112号4层A1008','+8601085970999');
/*!40000 ALTER TABLE `C` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `I`
--
DROP TABLE IF EXISTS `I`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `I` (
`Ino` int(11) NOT NULL COMMENT '上映信息编号',
`Mno` int(11) NOT NULL COMMENT '电影编号',
`Itime` date NOT NULL COMMENT '上映时间',
`Iprice` double NOT NULL COMMENT '电影票价',
PRIMARY KEY (`Ino`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `I`
--
LOCK TABLES `I` WRITE;
/*!40000 ALTER TABLE `I` DISABLE KEYS */;
INSERT INTO `I` VALUES (40001,30001,'2006-09-01',85.33),(40002,30002,'2009-11-27',36),(40003,30003,'2019-10-04',132.65);
/*!40000 ALTER TABLE `I` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `M`
--
DROP TABLE IF EXISTS `M`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `M` (
`Mno` int(11) NOT NULL COMMENT '电影编号',
`Mname` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '电影名称',
`Mlength` int(11) NOT NULL COMMENT '电影长度',
`Myear` year(4) NOT NULL COMMENT '电影制作年份',
`Cno` int(11) NOT NULL COMMENT '电影公司编号',
PRIMARY KEY (`Mno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `M`
--
LOCK TABLES `M` WRITE;
/*!40000 ALTER TABLE `M` DISABLE KEYS */;
INSERT INTO `M` VALUES (30001,'The Wicker Man',102,2006,20001),(30002,'花木兰',114,2009,20002),(30003,'Joker',122,2019,20001);
/*!40000 ALTER TABLE `M` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `R`
--
DROP TABLE IF EXISTS `R`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `R` (
`Rno` int(11) NOT NULL COMMENT '关系编号',
`Mno` int(11) NOT NULL COMMENT '电影编号',
`Ano` int(11) NOT NULL COMMENT '演员编号',
`Rrole` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '演员在电影中饰演角色名称',
`Rtime` int(11) NOT NULL COMMENT '演员在电影中出现时间',
PRIMARY KEY (`Rno`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `R`
--
LOCK TABLES `R` WRITE;
/*!40000 ALTER TABLE `R` DISABLE KEYS */;
INSERT INTO `R` VALUES (50001,30001,10001,'Edward Malus',90),(50002,30001,10002,'Sister Summersisle',90),(50003,30001,10003,'Sister Willow Woodward',80),(50004,30001,10004,'Sister Honey',35),(50005,30002,10005,'花木兰',100),(50006,30002,10006,'拓跋宏',85),(50007,30002,10006,'文泰',15),(50008,30002,10007,'门独',80),(50009,30002,10008,'费小虎',64),(50010,30003,10009,'Joker',105),(50011,30003,10010,'Murray Franklin',90),(50012,30003,10011,'Sophie Dumond',84),(50013,30003,10012,'Penny Fleck',78);
/*!40000 ALTER TABLE `R` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Temporary table structure for view `nicolas_cage_only`
--
DROP TABLE IF EXISTS `nicolas_cage_only`;
/*!50001 DROP VIEW IF EXISTS `nicolas_cage_only`*/;
SET @saved_cs_client = @@character_set_client;
SET character_set_client = utf8;
/*!50001 CREATE TABLE `nicolas_cage_only` (
`Mname` tinyint NOT NULL,
`Mlength` tinyint NOT NULL,
`Itime` tinyint NOT NULL,
`Iprice` tinyint NOT NULL
) ENGINE=MyISAM */;
SET character_set_client = @saved_cs_client;
--
-- Final view structure for view `nicolas_cage_only`
--
/*!50001 DROP TABLE IF EXISTS `nicolas_cage_only`*/;
/*!50001 DROP VIEW IF EXISTS `nicolas_cage_only`*/;
/*!50001 SET @saved_cs_client = @@character_set_client */;
/*!50001 SET @saved_cs_results = @@character_set_results */;
/*!50001 SET @saved_col_connection = @@collation_connection */;
/*!50001 SET character_set_client = utf8mb4 */;
/*!50001 SET character_set_results = utf8mb4 */;
/*!50001 SET collation_connection = utf8mb4_unicode_ci */;
/*!50001 CREATE ALGORITHM=UNDEFINED */
/*!50013 DEFINER=`root`@`localhost` SQL SECURITY DEFINER */
/*!50001 VIEW `nicolas_cage_only` AS select `M`.`Mname` AS `Mname`,`M`.`Mlength` AS `Mlength`,`I`.`Itime` AS `Itime`,`I`.`Iprice` AS `Iprice` from (((`I` left join `M` on(`M`.`Mno` = 30001)) left join `C` on(`C`.`Cno` = 20001)) left join `A` on(`A`.`Aname` = 'Nicolas Cage')) where `I`.`Ino` = 40001 */;
/*!50001 SET character_set_client = @saved_cs_client */;
/*!50001 SET character_set_results = @saved_cs_results */;
/*!50001 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 2019-12-17 21:34:34
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment