#

/** PTD

	Database state of all 5 fruit Tables
        prior running fruitView.sql.html

	you need to run fruitAlter.sql.html and then create the two views
	
	note table:orders has only date column, after fruitAlter.sql.html
	it has two columns startDate and shipDate

 */

-- phpMyAdmin SQL Dump
-- version 2.11.8.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 24, 2008 at 10:28 AM
-- Server version: 5.0.51
-- PHP Version: 5.2.6

SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";


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

--
-- Table structure for table `orderLine`
--

drop table if exists `orderLine`;
CREATE TABLE IF NOT EXISTS `orderLine` (
  `orderID` int(11) NOT NULL COMMENT 'foriegn key to orders table',
  `fruitID` smallint(6) unsigned NOT NULL COMMENT 'foreign key to fruit table',
  `quantity` int(11) NOT NULL COMMENT 'units ordered'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `orderLine`
--

INSERT INTO `orderLine` (`orderID`, `fruitID`, `quantity`) VALUES
(23, 1, 100),
(23, 2, 50),
(24, 3, 100),
(24, 5, 20),
(24, 2, 50);

--
-- Table structure for table `orders`
--

drop table if exists `orders`;
CREATE TABLE IF NOT EXISTS `orders` (
  `orderID` int(4) NOT NULL COMMENT 'Primary Key for table:orders',
  `customerID` int(11) NOT NULL COMMENT 'foreign key to customer table',
  `startDate` date NOT NULL COMMENT 'date order was registered',
  PRIMARY KEY  (`orderID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `orders`
--

INSERT INTO `orders` (`orderID`, `customerID`, `startDate`) VALUES
(23, 120, '2012-08-30'),
(24, 130, '2012-09-01');

--
-- Table structure for table `inventory`
--

drop table if exists inventory;
CREATE TABLE IF NOT EXISTS `inventory` (
  `fruitID` smallint(6) unsigned NOT NULL COMMENT 'foreign key to fruit table',
  `quantity` int(11) NOT NULL COMMENT 'quantity of current shipment'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `inventory`
--

INSERT INTO `inventory` (`fruitID`, `quantity`) VALUES
(1, 100),
(3, 500),
(2, 100),
(5, 10),
(1, 250),
(2, 200);


CREATE TABLE IF NOT EXISTS `fruit` (
  `fruitID` smallint(6) unsigned  NOT NULL auto_increment COMMENT 'Primary Key for fruit',
  `name` varchar(8) default NULL COMMENT 'full name of fruit',
  `price` double(5,2) default NULL COMMENT 'current market price for fruit',
  PRIMARY KEY  (`fruitID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=9 ;

--
-- Dumping data for table `fruit`
--

INSERT INTO `fruit` (`fruitID`, `name`, `price`) VALUES
(1, 'apple', 2.50),
(2, 'pear', 3.00),
(4, 'grape', 0.75),
(3, 'banana', 1.00),
(6, 'plum', 1.25),
(8, 'pluot', 4.50),
(5, 'peach', 1.25);

--
-- Table structure for table `customer`
--
drop table if exists customer;

CREATE TABLE IF NOT EXISTS `customer` (
  `customerID` int(11) COMMENT 'Primary Key for customer',
  `name` varchar(32) NOT NULL COMMENT 'customer name',
  `password` char(40) NOT NULL COMMENT 'Password for customer',
  `email` varchar(64) NOT NULL COMMENT 'customer email',
  PRIMARY KEY  (`customerID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=131 ;

--
-- Dumping data for table `customer`
--

INSERT INTO `customer` (`customerID`, `name`, `password`, `email`) VALUES
(100, 'Minnie Mouse', '51b27e8e57be94200897a71ba136099542d925bc', 'mmouse0@cim.saddleback.edu'),
(120, 'Joe Student', '3a5e2f520b038d308f4486613a6a6bbd3ab3c860', 'jstudent0@cim.saddleback.edu'),
(130, 'premiere', '3a5e2f520b038d308f4486613a6a6bbd3ab3c860', 'premiere@cim.saddleback.edu');


#