Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- phpMyAdmin SQL Dump
- -- version 4.7.9
- -- https://www.phpmyadmin.net/
- --
- -- Host: localhost
- -- Generation Time: May 12, 2018 at 12:30 AM
- -- Server version: 10.1.31-MariaDB
- -- PHP Version: 7.2.3
- SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
- SET AUTOCOMMIT = 0;
- START TRANSACTION;
- SET time_zone = "+00:00";
- /*!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 */;
- --
- -- Database: `webber`
- --
- -- --------------------------------------------------------
- --
- -- Table structure for table `activities`
- --
- CREATE TABLE `activities` (
- `ActivitiesID` int(11) NOT NULL,
- `ActivityTitle` varchar(20) NOT NULL,
- `ActivityDescription` mediumtext NOT NULL,
- `StandardPrice` decimal(10,2) NOT NULL,
- `IsAvailble` set('TRUE','FALSE') NOT NULL,
- `Discountfactor` decimal(10,2) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
- --
- -- Dumping data for table `activities`
- --
- INSERT INTO `activities` (`ActivitiesID`, `ActivityTitle`, `ActivityDescription`, `StandardPrice`, `IsAvailble`, `Discountfactor`) VALUES
- (1, 'Football', 'Play football', '5.00', 'TRUE', '0.90'),
- (2, 'Netball', 'Play netball', '4.50', 'TRUE', '0.90'),
- (3, 'Hockey', 'Play hockey', '6.00', 'TRUE', '0.90'),
- (4, 'Party', 'Have a party', '4.00', 'TRUE', '0.90'),
- (5, 'Tennis', 'Play tennis', '6.50', 'TRUE', '0.90'),
- (6, 'Badminton', 'Play badminton', '4.25', 'TRUE', '0.90'),
- (7, 'Pilates class', 'Do some stretching ', '7.00', 'TRUE', '0.90');
- -- --------------------------------------------------------
- --
- -- Table structure for table `address`
- --
- CREATE TABLE `address` (
- `AddressID` int(11) NOT NULL,
- `AddressLine1` varchar(30) NOT NULL,
- `AddressLine2` varchar(30) DEFAULT NULL,
- `County` char(30) NOT NULL,
- `Postcode` varchar(7) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
- --
- -- Dumping data for table `address`
- --
- INSERT INTO `address` (`AddressID`, `AddressLine1`, `AddressLine2`, `County`, `Postcode`) VALUES
- (1, '213 London road', '', 'Staffordshire', 'ST37EN'),
- (2, '129 Ulverston road', 'Newstead', 'Staffordshire', 'ST33NE'),
- (3, '229 Trentham road', 'Trentham', 'Staffordshire', 'ST34EJ'),
- (4, '26 Chamberlain street', 'Shelton', 'Staffordshire', 'ST61AF'),
- (5, '99 Oulton road', '', 'Stone', 'ST41NF'),
- (6, '7 Gladys street', 'Coedely', 'Rhondda Cynon Taff', 'CF398BN'),
- (7, '56 Longlane close', 'Lightwood', 'Staffordshire', 'ST37NE'),
- (8, 'Ivy cottage', 'Woodpark lane', 'Staffordshire', 'ST37EM'),
- (9, '149 Belgrave road', 'Dresden', 'Staffordshire', 'ST34EF'),
- (10, '77 Elven', 'Burslem', 'Cheshire', 'ST94DN');
- -- --------------------------------------------------------
- --
- -- Table structure for table `booking`
- --
- CREATE TABLE `booking` (
- `BookingID` int(11) NOT NULL,
- `Discount` set('TRUE','FALSE') NOT NULL,
- `BookingDate` date NOT NULL,
- `BookingTime` time(6) NOT NULL,
- `fk1_MemberID` int(11) NOT NULL,
- `fk2_ActivitiesID` int(11) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
- --
- -- Dumping data for table `booking`
- --
- INSERT INTO `booking` (`BookingID`, `Discount`, `BookingDate`, `BookingTime`, `fk1_MemberID`, `fk2_ActivitiesID`) VALUES
- (3, 'TRUE', '2018-12-02', '11:11:00.000000', 8, 1),
- (8, 'TRUE', '2018-05-17', '00:00:00.000000', 5, 7);
- -- --------------------------------------------------------
- --
- -- Table structure for table `member`
- --
- CREATE TABLE `member` (
- `MemberID` int(11) NOT NULL,
- `GivenName` char(25) NOT NULL,
- `Surname` char(25) NOT NULL,
- `Gender` char(18) NOT NULL,
- `DateOfBirth` date NOT NULL,
- `DateJoined` date NOT NULL,
- `DateTerminated` date NOT NULL,
- `TelNumber` varchar(12) NOT NULL,
- `Email` mediumtext NOT NULL,
- `Premium` set('TRUE','FALSE') NOT NULL,
- `fk1_AddressID` int(11) NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
- --
- -- Dumping data for table `member`
- --
- INSERT INTO `member` (`MemberID`, `GivenName`, `Surname`, `Gender`, `DateOfBirth`, `DateJoined`, `DateTerminated`, `TelNumber`, `Email`, `Premium`, `fk1_AddressID`) VALUES
- (1, 'Keith', 'Farse', 'Male', '1988-04-09', '2018-04-11', '0000-00-00', '09876523454', 'Kfarse@12mail.com', 'FALSE', 1),
- (2, 'Phillipe', 'Trapeze', 'Male', '1990-03-05', '2018-01-15', '0000-00-00', '0123341234', 'Phillitrap@gmail.com', 'TRUE', 2),
- (3, 'Richard', 'Johnson', 'Male', '1964-01-17', '2017-08-06', '0000-00-00', '0124145151', 'LargeRooster@yahoomail.com', 'FALSE', 3),
- (4, 'Alice', 'Gardner', 'Female', '1956-01-15', '2014-04-24', '0000-00-00', '0213456478', 'Agardner@gmail.com', 'FALSE', 4),
- (5, 'Alexander', 'Leonidas', 'Male', '1995-04-09', '2012-02-12', '0000-00-00', '0432345678', 'outalpha@gmail.com', 'TRUE', 5),
- (6, 'Lucille', 'Farah', 'Female', '1999-12-12', '2018-04-16', '2018-04-25', '0331243342', 'Lucifar@Smail.com', 'FALSE', 6),
- (7, 'Ellie', 'Lowe', 'Female', '1990-02-04', '2017-04-22', '0000-00-00', '0231414141', 'Ello@gmail.com', 'FALSE', 7),
- (8, 'Tony', 'Bigguns', 'Male', '1978-12-12', '2015-12-12', '0000-00-00', '03214524212', 'Largearmstone@hotmail.com', 'FALSE', 8),
- (9, 'Mike', 'Mcgub', 'Male', '1978-12-15', '2014-04-12', '0000-00-00', '0876543222', 'Gubme@gmail.com', 'FALSE', 9),
- (10, 'Mike', 'Chang', 'Male', '1993-04-02', '2017-10-16', '0000-00-00', '087654678', 'MikeChangAbs@Gmail.com', 'TRUE', 10);
- -- --------------------------------------------------------
- --
- -- Table structure for table `notes`
- --
- CREATE TABLE `notes` (
- `NotesID` int(11) NOT NULL,
- `Description` text,
- `fk1_BookingID` int(11) DEFAULT NULL,
- `last modified` date NOT NULL
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
- --
- -- Dumping data for table `notes`
- --
- INSERT INTO `notes` (`NotesID`, `Description`, `fk1_BookingID`, `last modified`) VALUES
- (2, 'Applying for coaching position', 8, '2018-05-10');
- --
- -- Indexes for dumped tables
- --
- --
- -- Indexes for table `activities`
- --
- ALTER TABLE `activities`
- ADD PRIMARY KEY (`ActivitiesID`);
- --
- -- Indexes for table `address`
- --
- ALTER TABLE `address`
- ADD PRIMARY KEY (`AddressID`);
- --
- -- Indexes for table `booking`
- --
- ALTER TABLE `booking`
- ADD PRIMARY KEY (`BookingID`),
- ADD KEY `fk2_ActivitiesID` (`fk2_ActivitiesID`),
- ADD KEY `fk1_MemberID` (`fk1_MemberID`);
- --
- -- Indexes for table `member`
- --
- ALTER TABLE `member`
- ADD PRIMARY KEY (`MemberID`),
- ADD KEY `fk1_AddressID` (`fk1_AddressID`);
- --
- -- Indexes for table `notes`
- --
- ALTER TABLE `notes`
- ADD PRIMARY KEY (`NotesID`),
- ADD UNIQUE KEY `fk1_BookingID` (`fk1_BookingID`);
- --
- -- AUTO_INCREMENT for dumped tables
- --
- --
- -- AUTO_INCREMENT for table `activities`
- --
- ALTER TABLE `activities`
- MODIFY `ActivitiesID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
- --
- -- AUTO_INCREMENT for table `address`
- --
- ALTER TABLE `address`
- MODIFY `AddressID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
- --
- -- AUTO_INCREMENT for table `booking`
- --
- ALTER TABLE `booking`
- MODIFY `BookingID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
- --
- -- AUTO_INCREMENT for table `member`
- --
- ALTER TABLE `member`
- MODIFY `MemberID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
- --
- -- AUTO_INCREMENT for table `notes`
- --
- ALTER TABLE `notes`
- MODIFY `NotesID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
- --
- -- Constraints for dumped tables
- --
- --
- -- Constraints for table `booking`
- --
- ALTER TABLE `booking`
- ADD CONSTRAINT `booking_ibfk_1` FOREIGN KEY (`fk2_ActivitiesID`) REFERENCES `activities` (`ActivitiesID`) ON DELETE CASCADE ON UPDATE CASCADE,
- ADD CONSTRAINT `booking_ibfk_3` FOREIGN KEY (`fk1_MemberID`) REFERENCES `member` (`MemberID`) ON DELETE CASCADE ON UPDATE CASCADE;
- --
- -- Constraints for table `member`
- --
- ALTER TABLE `member`
- ADD CONSTRAINT `member_ibfk_1` FOREIGN KEY (`fk1_AddressID`) REFERENCES `address` (`AddressID`) ON DELETE CASCADE ON UPDATE CASCADE;
- --
- -- Constraints for table `notes`
- --
- ALTER TABLE `notes`
- ADD CONSTRAINT `notes_ibfk_1` FOREIGN KEY (`fk1_BookingID`) REFERENCES `booking` (`BookingID`) ON DELETE CASCADE ON UPDATE CASCADE;
- COMMIT;
- /*!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 */;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement