-- phpMyAdmin SQL Dump
-- version 4.6.5
-- https://www.phpmyadmin.net/
--
-- Host: mysql.phpibdestudents.com
-- Generation Time: Mar 27, 2017 at 07:05 AM
-- Server version: 5.6.34-log
-- PHP Version: 7.1.0

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
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: `angelaibde2016`
--

-- --------------------------------------------------------

--
-- Table structure for table `author`
--

CREATE TABLE `author` (
  `id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `email` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `author`
--

INSERT INTO `author` (`id`, `name`, `email`) VALUES
(1, 'Brian N. Young', 'brian@example.com'),
(2, 'Joan Smith', 'jsmith@example.net'),
(5, 'Francine Henderson', 'fhenderson@email.com');

-- --------------------------------------------------------

--
-- Table structure for table `category`
--

CREATE TABLE `category` (
  `id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `category`
--

INSERT INTO `category` (`id`, `name`) VALUES
(1, 'Knock-knock'),
(2, 'Cross the road'),
(3, 'Lawyers'),
(4, 'WAlk into bar'),
(5, 'Lightbulb');

-- --------------------------------------------------------

--
-- Table structure for table `joke`
--

CREATE TABLE `joke` (
  `id` int(11) NOT NULL,
  `joketext` text,
  `jokedate` date NOT NULL,
  `authorid` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `joke`
--

INSERT INTO `joke` (`id`, `joketext`, `jokedate`, `authorid`) VALUES
(1, 'Why did the chicken cross the road? To get to the other side!', '2010-04-01', 1),
(2, '\'Knock knock!\'', '2010-05-15', 1),
(3, 'A man walks into a bar, Ouch!', '2010-09-09', 2),
(5, 'Two lawyers walk into a bar...', '2016-07-17', 2),
(6, 'What is the difference between a snowman and a snowwoman?\r\n-\r\nSnowballs.\r\n', '2016-07-17', 1);

-- --------------------------------------------------------

--
-- Table structure for table `jokecategory`
--

CREATE TABLE `jokecategory` (
  `jokeid` int(11) NOT NULL,
  `categoryid` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `jokecategory`
--

INSERT INTO `jokecategory` (`jokeid`, `categoryid`) VALUES
(1, 2),
(2, 1),
(2, 5),
(3, 4),
(5, 3),
(5, 4),
(6, 5);

-- --------------------------------------------------------

--
-- Table structure for table `newsletter`
--

CREATE TABLE `newsletter` (
  `id` int(11) NOT NULL,
  `fname` text,
  `lname` text,
  `city` text,
  `country` text,
  `email` text,
  `signup` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `newsletter`
--

INSERT INTO `newsletter` (`id`, `fname`, `lname`, `city`, `country`, `email`, `signup`) VALUES
(1, 'John', 'Smith', 'San Fransico', 'USA', 'john.smith@mail.com', '2015-05-01'),
(2, 'Kadie', 'Snodgrass', 'Long Island', 'USA', 'babykadie@mail.com', '2015-04-22'),
(3, 'Harry', 'Loggins', 'Toronto', 'Canada', 'harryloggins25@mail.com', '2016-01-25'),
(4, 'Jerry', 'White', 'Cape Town', 'USA', 'jwhite201@mail.com', '2016-02-11'),
(5, 'Tony', 'Bradshaw', 'Kitchener', 'Canada', 'breakersrus@mail.com', '2015-11-09'),
(6, 'Laura', 'Lockhart', 'Saskatoon', 'Canada', 'great2know@mail.com', '2016-04-13'),
(7, 'Casey', 'Knorr', 'Long Beach', 'USA', 'heatinup002@gmail.com', '2016-02-14'),
(8, 'Kiki', 'Bates', 'Ottawa', 'Canada', 'cutiekiki2@mail.com', '2015-12-21'),
(9, 'Warren', 'Fowler', 'Moncton', 'Canada', 'warrentheman@mail.com', '2016-03-30'),
(10, 'Bobby', 'Moore', 'Cape Cod', 'USA', 'justbobby@mail.com', '2016-05-19');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `author`
--
ALTER TABLE `author`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `category`
--
ALTER TABLE `category`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `joke`
--
ALTER TABLE `joke`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `jokecategory`
--
ALTER TABLE `jokecategory`
  ADD PRIMARY KEY (`jokeid`,`categoryid`);

--
-- Indexes for table `newsletter`
--
ALTER TABLE `newsletter`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `author`
--
ALTER TABLE `author`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `category`
--
ALTER TABLE `category`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `joke`
--
ALTER TABLE `joke`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `newsletter`
--
ALTER TABLE `newsletter`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
/*!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 */;
