/*
SQLyog Community Edition- MySQL GUI v5.22a
Host - 5.1.36-community-log : Database - hqlinvoice
*********************************************************************
Server version : 5.1.36-community-log
*/


/*!40101 SET NAMES utf8 */;

/*!40101 SET SQL_MODE=''*/;

create database if not exists `hqlinvoice`;

USE `hqlinvoice`;

/*!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' */;

/*Table structure for table `customers` */

DROP TABLE IF EXISTS `customers`;

CREATE TABLE `customers` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `customer_name` varchar(50) DEFAULT NULL,
  `customer_phone` varchar(100) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;

/*Data for the table `customers` */

insert  into `customers`(`id`,`customer_name`,`customer_phone`) values (1,'Deepak','222222222');
insert  into `customers`(`id`,`customer_name`,`customer_phone`) values (2,'Ravi','6565666877878');
insert  into `customers`(`id`,`customer_name`,`customer_phone`) values (3,'John','154545655');
insert  into `customers`(`id`,`customer_name`,`customer_phone`) values (4,'Dermot','455666');
insert  into `customers`(`id`,`customer_name`,`customer_phone`) values (5,'Raju','5454555');
insert  into `customers`(`id`,`customer_name`,`customer_phone`) values (6,'Dinesh','455455454');

/*Table structure for table `invoice` */

DROP TABLE IF EXISTS `invoice`;

CREATE TABLE `invoice` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `cust_id` int(11) DEFAULT NULL,
  `invoice_date` datetime DEFAULT NULL,
  `dispatch_status` varchar(1) DEFAULT NULL,
  `invoice_amount` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;

/*Data for the table `invoice` */

insert  into `invoice`(`id`,`cust_id`,`invoice_date`,`dispatch_status`,`invoice_amount`) values (1,1,'2010-10-15 14:28:36','N',150);
insert  into `invoice`(`id`,`cust_id`,`invoice_date`,`dispatch_status`,`invoice_amount`) values (2,2,'2010-10-25 14:30:55','N',160);
insert  into `invoice`(`id`,`cust_id`,`invoice_date`,`dispatch_status`,`invoice_amount`) values (3,3,'2010-10-30 14:33:15','N',380);

/*Table structure for table `invoice_item` */

DROP TABLE IF EXISTS `invoice_item`;

CREATE TABLE `invoice_item` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `invoice_id` int(11) DEFAULT NULL,
  `item_id` int(11) DEFAULT NULL,
  `quantity` int(11) DEFAULT NULL,
  `rate` int(11) DEFAULT NULL,
  `amount` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;

/*Data for the table `invoice_item` */

insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (1,1,1,1,50,50);
insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (2,1,2,1,45,45);
insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (3,1,3,1,55,55);
insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (4,2,2,1,45,45);
insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (5,2,3,1,55,60);
insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (6,3,3,2,55,110);
insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (7,3,4,2,45,90);
insert  into `invoice_item`(`id`,`invoice_id`,`item_id`,`quantity`,`rate`,`amount`) values (8,3,5,3,60,180);

/*Table structure for table `products` */

DROP TABLE IF EXISTS `products`;

CREATE TABLE `products` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `product_name` varchar(20) DEFAULT NULL,
  `productprice` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

/*Data for the table `products` */

insert  into `products`(`id`,`product_name`,`productprice`) values (1,'Learn Java',50);
insert  into `products`(`id`,`product_name`,`productprice`) values (2,'Learn JSP',45);
insert  into `products`(`id`,`product_name`,`productprice`) values (3,'Learn JSF',55);
insert  into `products`(`id`,`product_name`,`productprice`) values (4,'Learn Hibernate',45);
insert  into `products`(`id`,`product_name`,`productprice`) values (5,'Learn HTML',60);

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
