Advertisement
Guest User

Untitled

a guest
Apr 1st, 2019
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.28 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.7.9
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Host: localhost
  6. -- Generation Time: May 12, 2018 at 12:30 AM
  7. -- Server version: 10.1.31-MariaDB
  8. -- PHP Version: 7.2.3
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. SET AUTOCOMMIT = 0;
  12. START TRANSACTION;
  13. SET time_zone = "+00:00";
  14.  
  15.  
  16. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  17. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  18. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  19. /*!40101 SET NAMES utf8mb4 */;
  20.  
  21. --
  22. -- Database: `webber`
  23. --
  24.  
  25. -- --------------------------------------------------------
  26.  
  27. --
  28. -- Table structure for table `activities`
  29. --
  30.  
  31. CREATE TABLE `activities` (
  32. `ActivitiesID` int(11) NOT NULL,
  33. `ActivityTitle` varchar(20) NOT NULL,
  34. `ActivityDescription` mediumtext NOT NULL,
  35. `StandardPrice` decimal(10,2) NOT NULL,
  36. `IsAvailble` set('TRUE','FALSE') NOT NULL,
  37. `Discountfactor` decimal(10,2) NOT NULL
  38. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  39.  
  40. --
  41. -- Dumping data for table `activities`
  42. --
  43.  
  44. INSERT INTO `activities` (`ActivitiesID`, `ActivityTitle`, `ActivityDescription`, `StandardPrice`, `IsAvailble`, `Discountfactor`) VALUES
  45. (1, 'Football', 'Play football', '5.00', 'TRUE', '0.90'),
  46. (2, 'Netball', 'Play netball', '4.50', 'TRUE', '0.90'),
  47. (3, 'Hockey', 'Play hockey', '6.00', 'TRUE', '0.90'),
  48. (4, 'Party', 'Have a party', '4.00', 'TRUE', '0.90'),
  49. (5, 'Tennis', 'Play tennis', '6.50', 'TRUE', '0.90'),
  50. (6, 'Badminton', 'Play badminton', '4.25', 'TRUE', '0.90'),
  51. (7, 'Pilates class', 'Do some stretching ', '7.00', 'TRUE', '0.90');
  52.  
  53. -- --------------------------------------------------------
  54.  
  55. --
  56. -- Table structure for table `address`
  57. --
  58.  
  59. CREATE TABLE `address` (
  60. `AddressID` int(11) NOT NULL,
  61. `AddressLine1` varchar(30) NOT NULL,
  62. `AddressLine2` varchar(30) DEFAULT NULL,
  63. `County` char(30) NOT NULL,
  64. `Postcode` varchar(7) NOT NULL
  65. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  66.  
  67. --
  68. -- Dumping data for table `address`
  69. --
  70.  
  71. INSERT INTO `address` (`AddressID`, `AddressLine1`, `AddressLine2`, `County`, `Postcode`) VALUES
  72. (1, '213 London road', '', 'Staffordshire', 'ST37EN'),
  73. (2, '129 Ulverston road', 'Newstead', 'Staffordshire', 'ST33NE'),
  74. (3, '229 Trentham road', 'Trentham', 'Staffordshire', 'ST34EJ'),
  75. (4, '26 Chamberlain street', 'Shelton', 'Staffordshire', 'ST61AF'),
  76. (5, '99 Oulton road', '', 'Stone', 'ST41NF'),
  77. (6, '7 Gladys street', 'Coedely', 'Rhondda Cynon Taff', 'CF398BN'),
  78. (7, '56 Longlane close', 'Lightwood', 'Staffordshire', 'ST37NE'),
  79. (8, 'Ivy cottage', 'Woodpark lane', 'Staffordshire', 'ST37EM'),
  80. (9, '149 Belgrave road', 'Dresden', 'Staffordshire', 'ST34EF'),
  81. (10, '77 Elven', 'Burslem', 'Cheshire', 'ST94DN');
  82.  
  83. -- --------------------------------------------------------
  84.  
  85. --
  86. -- Table structure for table `booking`
  87. --
  88.  
  89. CREATE TABLE `booking` (
  90. `BookingID` int(11) NOT NULL,
  91. `Discount` set('TRUE','FALSE') NOT NULL,
  92. `BookingDate` date NOT NULL,
  93. `BookingTime` time(6) NOT NULL,
  94. `fk1_MemberID` int(11) NOT NULL,
  95. `fk2_ActivitiesID` int(11) NOT NULL
  96. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  97.  
  98. --
  99. -- Dumping data for table `booking`
  100. --
  101.  
  102. INSERT INTO `booking` (`BookingID`, `Discount`, `BookingDate`, `BookingTime`, `fk1_MemberID`, `fk2_ActivitiesID`) VALUES
  103. (3, 'TRUE', '2018-12-02', '11:11:00.000000', 8, 1),
  104. (8, 'TRUE', '2018-05-17', '00:00:00.000000', 5, 7);
  105.  
  106. -- --------------------------------------------------------
  107.  
  108. --
  109. -- Table structure for table `member`
  110. --
  111.  
  112. CREATE TABLE `member` (
  113. `MemberID` int(11) NOT NULL,
  114. `GivenName` char(25) NOT NULL,
  115. `Surname` char(25) NOT NULL,
  116. `Gender` char(18) NOT NULL,
  117. `DateOfBirth` date NOT NULL,
  118. `DateJoined` date NOT NULL,
  119. `DateTerminated` date NOT NULL,
  120. `TelNumber` varchar(12) NOT NULL,
  121. `Email` mediumtext NOT NULL,
  122. `Premium` set('TRUE','FALSE') NOT NULL,
  123. `fk1_AddressID` int(11) NOT NULL
  124. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  125.  
  126. --
  127. -- Dumping data for table `member`
  128. --
  129.  
  130. INSERT INTO `member` (`MemberID`, `GivenName`, `Surname`, `Gender`, `DateOfBirth`, `DateJoined`, `DateTerminated`, `TelNumber`, `Email`, `Premium`, `fk1_AddressID`) VALUES
  131. (1, 'Keith', 'Farse', 'Male', '1988-04-09', '2018-04-11', '0000-00-00', '09876523454', 'Kfarse@12mail.com', 'FALSE', 1),
  132. (2, 'Phillipe', 'Trapeze', 'Male', '1990-03-05', '2018-01-15', '0000-00-00', '0123341234', 'Phillitrap@gmail.com', 'TRUE', 2),
  133. (3, 'Richard', 'Johnson', 'Male', '1964-01-17', '2017-08-06', '0000-00-00', '0124145151', 'LargeRooster@yahoomail.com', 'FALSE', 3),
  134. (4, 'Alice', 'Gardner', 'Female', '1956-01-15', '2014-04-24', '0000-00-00', '0213456478', 'Agardner@gmail.com', 'FALSE', 4),
  135. (5, 'Alexander', 'Leonidas', 'Male', '1995-04-09', '2012-02-12', '0000-00-00', '0432345678', 'outalpha@gmail.com', 'TRUE', 5),
  136. (6, 'Lucille', 'Farah', 'Female', '1999-12-12', '2018-04-16', '2018-04-25', '0331243342', 'Lucifar@Smail.com', 'FALSE', 6),
  137. (7, 'Ellie', 'Lowe', 'Female', '1990-02-04', '2017-04-22', '0000-00-00', '0231414141', 'Ello@gmail.com', 'FALSE', 7),
  138. (8, 'Tony', 'Bigguns', 'Male', '1978-12-12', '2015-12-12', '0000-00-00', '03214524212', 'Largearmstone@hotmail.com', 'FALSE', 8),
  139. (9, 'Mike', 'Mcgub', 'Male', '1978-12-15', '2014-04-12', '0000-00-00', '0876543222', 'Gubme@gmail.com', 'FALSE', 9),
  140. (10, 'Mike', 'Chang', 'Male', '1993-04-02', '2017-10-16', '0000-00-00', '087654678', 'MikeChangAbs@Gmail.com', 'TRUE', 10);
  141.  
  142. -- --------------------------------------------------------
  143.  
  144. --
  145. -- Table structure for table `notes`
  146. --
  147.  
  148. CREATE TABLE `notes` (
  149. `NotesID` int(11) NOT NULL,
  150. `Description` text,
  151. `fk1_BookingID` int(11) DEFAULT NULL,
  152. `last modified` date NOT NULL
  153. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  154.  
  155. --
  156. -- Dumping data for table `notes`
  157. --
  158.  
  159. INSERT INTO `notes` (`NotesID`, `Description`, `fk1_BookingID`, `last modified`) VALUES
  160. (2, 'Applying for coaching position', 8, '2018-05-10');
  161.  
  162. --
  163. -- Indexes for dumped tables
  164. --
  165.  
  166. --
  167. -- Indexes for table `activities`
  168. --
  169. ALTER TABLE `activities`
  170. ADD PRIMARY KEY (`ActivitiesID`);
  171.  
  172. --
  173. -- Indexes for table `address`
  174. --
  175. ALTER TABLE `address`
  176. ADD PRIMARY KEY (`AddressID`);
  177.  
  178. --
  179. -- Indexes for table `booking`
  180. --
  181. ALTER TABLE `booking`
  182. ADD PRIMARY KEY (`BookingID`),
  183. ADD KEY `fk2_ActivitiesID` (`fk2_ActivitiesID`),
  184. ADD KEY `fk1_MemberID` (`fk1_MemberID`);
  185.  
  186. --
  187. -- Indexes for table `member`
  188. --
  189. ALTER TABLE `member`
  190. ADD PRIMARY KEY (`MemberID`),
  191. ADD KEY `fk1_AddressID` (`fk1_AddressID`);
  192.  
  193. --
  194. -- Indexes for table `notes`
  195. --
  196. ALTER TABLE `notes`
  197. ADD PRIMARY KEY (`NotesID`),
  198. ADD UNIQUE KEY `fk1_BookingID` (`fk1_BookingID`);
  199.  
  200. --
  201. -- AUTO_INCREMENT for dumped tables
  202. --
  203.  
  204. --
  205. -- AUTO_INCREMENT for table `activities`
  206. --
  207. ALTER TABLE `activities`
  208. MODIFY `ActivitiesID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
  209.  
  210. --
  211. -- AUTO_INCREMENT for table `address`
  212. --
  213. ALTER TABLE `address`
  214. MODIFY `AddressID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  215.  
  216. --
  217. -- AUTO_INCREMENT for table `booking`
  218. --
  219. ALTER TABLE `booking`
  220. MODIFY `BookingID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
  221.  
  222. --
  223. -- AUTO_INCREMENT for table `member`
  224. --
  225. ALTER TABLE `member`
  226. MODIFY `MemberID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
  227.  
  228. --
  229. -- AUTO_INCREMENT for table `notes`
  230. --
  231. ALTER TABLE `notes`
  232. MODIFY `NotesID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
  233.  
  234. --
  235. -- Constraints for dumped tables
  236. --
  237.  
  238. --
  239. -- Constraints for table `booking`
  240. --
  241. ALTER TABLE `booking`
  242. ADD CONSTRAINT `booking_ibfk_1` FOREIGN KEY (`fk2_ActivitiesID`) REFERENCES `activities` (`ActivitiesID`) ON DELETE CASCADE ON UPDATE CASCADE,
  243. ADD CONSTRAINT `booking_ibfk_3` FOREIGN KEY (`fk1_MemberID`) REFERENCES `member` (`MemberID`) ON DELETE CASCADE ON UPDATE CASCADE;
  244.  
  245. --
  246. -- Constraints for table `member`
  247. --
  248. ALTER TABLE `member`
  249. ADD CONSTRAINT `member_ibfk_1` FOREIGN KEY (`fk1_AddressID`) REFERENCES `address` (`AddressID`) ON DELETE CASCADE ON UPDATE CASCADE;
  250.  
  251. --
  252. -- Constraints for table `notes`
  253. --
  254. ALTER TABLE `notes`
  255. ADD CONSTRAINT `notes_ibfk_1` FOREIGN KEY (`fk1_BookingID`) REFERENCES `booking` (`BookingID`) ON DELETE CASCADE ON UPDATE CASCADE;
  256. COMMIT;
  257.  
  258. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  259. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  260. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement