/*
SQLyog Enterprise - MySQL GUI v8.12 
MySQL - 5.5.18 : Database - labpaksu_lissupport
*********************************************************************
*/




CREATE DATABASE /*!32312 IF NOT EXISTS*/`apvision_apvisions` /*!40100 DEFAULT CHARACTER SET latin1 */;

USE `apvision_apvisions`;

/*Table structure for table `country` */


CREATE TABLE `country` (
  `country_code` char(2) NOT NULL,
  `country_name` varchar(60) NOT NULL,
  PRIMARY KEY (`country_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

/*Data for the table `country` */

insert  into `country`(`country_code`,`country_name`) values ('ad','Andorra'),('ae','United Arab Emirates'),('af','Afghanistan'),('ag','Antigua and Barbuda'),('ai','Anguilla'),('al','Albania'),('am','Armenia'),('an','Netherlands Antilles'),('ao','Angola'),('ap','Asia/Pacific Region'),('aq','Antarctica'),('ar','Argentina'),('as','American Samoa'),('at','Austria'),('au','Australia'),('aw','Aruba'),('ax','Aland Islands'),('az','Azerbaijan'),('ba','Bosnia and Herzegovina'),('bb','Barbados'),('bd','Bangladesh'),('be','Belgium'),('bf','Burkina Faso'),('bg','Bulgaria'),('bh','Bahrain'),('bi','Burundi'),('bj','Benin'),('bm','Bermuda'),('bn','Brunei Darussalam'),('bo','Bolivia'),('br','Brazil'),('bs','Bahamas'),('bt','Bhutan'),('bv','Bouvet Island'),('bw','Botswana'),('by','Belarus'),('bz','Belize'),('ca','Canada'),('cc','Cocos (Keeling) Islands'),('cd','Congo, The Democratic Republic of the'),('cf','Central African Republic'),('cg','Congo'),('ch','Switzerland'),('ci','Cote d\'Ivoire'),('ck','Cook Islands'),('cl','Chile'),('cm','Cameroon'),('cn','China'),('co','Colombia'),('cr','Costa Rica'),('cu','Cuba'),('cv','Cape Verde'),('cx','Christmas Island'),('cy','Cyprus'),('cz','Czech Republic'),('de','Germany'),('dj','Djibouti'),('dk','Denmark'),('dm','Dominica'),('do','Dominican Republic'),('dz','Algeria'),('ec','Ecuador'),('ee','Estonia'),('eg','Egypt'),('eh','Western Sahara'),('er','Eritrea'),('es','Spain'),('et','Ethiopia'),('fi','Finland'),('fj','Fiji'),('fk','Falkland Islands (Malvinas)'),('fm','Micronesia, Federated States of'),('fo','Faroe Islands'),('fr','France'),('ga','Gabon'),('gb','United Kingdom'),('gd','Grenada'),('ge','Georgia'),('gf','French Guiana'),('gg','Guernsey'),('gh','Ghana'),('gi','Gibraltar'),('gl','Greenland'),('gm','Gambia'),('gn','Guinea'),('gp','Guadeloupe'),('gq','Equatorial Guinea'),('gr','Greece'),('gs','South Georgia and the South Sandwich Islands'),('gt','Guatemala'),('gu','Guam'),('gw','Guinea-Bissau'),('gy','Guyana'),('hk','Hong Kong'),('hm','Heard Island and McDonald Islands'),('hn','Honduras'),('hr','Croatia'),('ht','Haiti'),('hu','Hungary'),('id','Indonesia'),('ie','Ireland'),('il','Israel'),('im','Isle of Man'),('in','India'),('io','British Indian Ocean Territory'),('iq','Iraq'),('ir','Iran, Islamic Republic of'),('is','Iceland'),('it','Italy'),('je','Jersey'),('jm','Jamaica'),('jo','Jordan'),('jp','Japan'),('ke','Kenya'),('kg','Kyrgyzstan'),('kh','Cambodia'),('ki','Kiribati'),('km','Comoros'),('kn','Saint Kitts and Nevis'),('kp','Korea, Democratic People\'s Republic of'),('kr','Korea, Republic of'),('kw','Kuwait'),('ky','Cayman Islands'),('kz','Kazakhstan'),('la','Lao People\'s Democratic Republic'),('lb','Lebanon'),('lc','Saint Lucia'),('li','Liechtenstein'),('lk','Sri Lanka'),('lr','Liberia'),('ls','Lesotho'),('lt','Lithuania'),('lu','Luxembourg'),('lv','Latvia'),('ly','Libyan Arab Jamahiriya'),('ma','Morocco'),('mc','Monaco'),('md','Moldova, Republic of'),('me','Montenegro'),('mg','Madagascar'),('mh','Marshall Islands'),('mk','Macedonia'),('ml','Mali'),('mm','Myanmar'),('mn','Mongolia'),('mo','Macao'),('mp','Northern Mariana Islands'),('mq','Martinique'),('mr','Mauritania'),('ms','Montserrat'),('mt','Malta'),('mu','Mauritius'),('mv','Maldives'),('mw','Malawi'),('mx','Mexico'),('my','Malaysia'),('mz','Mozambique'),('n','?'),('na','Namibia'),('nc','New Caledonia'),('ne','Niger'),('nf','Norfolk Island'),('ng','Nigeria'),('ni','Nicaragua'),('nl','Netherlands'),('no','Norway'),('np','Nepal'),('nr','Nauru'),('nu','Niue'),('nz','New Zealand'),('om','Oman'),('pa','Panama'),('pe','Peru'),('pf','French Polynesia'),('pg','Papua New Guinea'),('ph','Philippines'),('pk','Pakistan'),('pl','Poland'),('pm','Saint Pierre and Miquelon'),('pn','Pitcairn'),('pr','Puerto Rico'),('ps','Palestinian Territory'),('pt','Portugal'),('pw','Palau'),('py','Paraguay'),('qa','Qatar'),('re','Reunion'),('ro','Romania'),('rs','Serbia'),('ru','Russian Federation'),('rw','Rwanda'),('sa','Saudi Arabia'),('sb','Solomon Islands'),('sc','Seychelles'),('sd','Sudan'),('se','Sweden'),('sg','Singapore'),('sh','Saint Helena'),('si','Slovenia'),('sj','Svalbard and Jan Mayen'),('sk','Slovakia'),('sl','Sierra Leone'),('sm','San Marino'),('sn','Senegal'),('so','Somalia'),('sr','Suriname'),('st','Sao Tome and Principe'),('sv','El Salvador'),('sy','Syrian Arab Republic'),('sz','Swaziland'),('tc','Turks and Caicos Islands'),('td','Chad'),('tf','French Southern Territories'),('tg','Togo'),('th','Thailand'),('tj','Tajikistan'),('tk','Tokelau'),('tl','Timor-Leste'),('tm','Turkmenistan'),('tn','Tunisia'),('to','Tonga'),('tr','Turkey'),('tt','Trinidad and Tobago'),('tv','Tuvalu'),('tw','Taiwan'),('tz','Tanzania, United Republic of'),('ua','Ukraine'),('ug','Uganda'),('um','United States Minor Outlying Islands'),('us','United States'),('uy','Uruguay'),('uz','Uzbekistan'),('va','Holy See (Vatican City State)'),('vc','Saint Vincent and the Grenadines'),('ve','Venezuela'),('vg','Virgin Islands, British'),('vi','Virgin Islands, U.S.'),('vn','Vietnam'),('vu','Vanuatu'),('wf','Wallis and Futuna'),('ws','Samoa'),('ye','Yemen'),('yt','Mayotte'),('za','South Africa'),('zm','Zambia'),('zw','Zimbabwe');

/*Table structure for table `orders` */


CREATE TABLE `orders` (
  `Order_Unique` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique Order ID',
  `Order_DT` datetime DEFAULT NULL COMMENT 'Date Time of this order',
  `Order_Owner` int(11) DEFAULT NULL COMMENT 'Owner of Order (0= End Customer, else Distributor ID)',
  `Order_ID` int(11) DEFAULT NULL COMMENT 'if Owner = 0, Cust_Unique, else ignore',
  `Order_Qty` int(11) DEFAULT NULL COMMENT 'Number of Licenses purchased',
  `Order_Price` decimal(10,0) DEFAULT NULL COMMENT 'Price paid or to pay, Current List Price of Product selected',
  `Order_Product` int(11) DEFAULT NULL COMMENT 'Product Purchased',
  `Order_Discount` decimal(10,0) DEFAULT NULL COMMENT 'Discount from List price',
  `Order_Branded` int(11) DEFAULT NULL COMMENT 'Location of the setup.exe to download for the selected product in download table',
  PRIMARY KEY (`Order_Unique`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

/*Data for the table `orders` */

/*Table structure for table `products` */


CREATE TABLE `products` (
  `Product_ID` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique Product ID',
  `Product_Name` varchar(30) DEFAULT NULL COMMENT 'Product Name',
  `Product_Exclude` int(2) DEFAULT NULL COMMENT '0 = Use, 1 = Exclude from Items available for purchase',
  `Product_PriceDate` datetime DEFAULT NULL COMMENT 'Date and Time product pricing was updated, If NULL then this is the first price',
  `Product_Price` decimal(10,2) DEFAULT NULL COMMENT 'Current List Price of the product',
  `Product_OldPrice` decimal(10,2) DEFAULT NULL COMMENT 'Last list price of the product',
  PRIMARY KEY (`Product_ID`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;

/*Data for the table `products` */

insert  into `products`(`Product_ID`,`Product_Name`,`Product_Exclude`,`Product_PriceDate`,`Product_Price`,`Product_OldPrice`) values (1,'Start a Support Incident',NULL,'2012-02-17 00:00:00','79.95',NULL),(2,'LabPak Patient Demographics Ex',NULL,'2012-02-17 00:00:00','699.99',NULL),(3,'LabPak Patient Report Archive ',NULL,'2012-02-17 00:00:00','599.99',NULL),(4,'LabPak Patient Archive Report ',NULL,'2012-02-17 00:00:00','999.99',NULL),(5,'AP-URO Urology Anatomic Pathol',NULL,'2012-02-17 00:00:00','1999.99',NULL);

/*Table structure for table `state` */


CREATE TABLE `state` (
  `state_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'PK: Unique state ID',
  `state` varchar(32) NOT NULL COMMENT 'State name with first letter capital',
  `state_abbr` varchar(8) DEFAULT NULL COMMENT 'Optional state abbreviation (US is 2 capital letters)',
  PRIMARY KEY (`state_id`)
) ENGINE=InnoDB AUTO_INCREMENT=52 DEFAULT CHARSET=utf8;

/*Data for the table `state` */

insert  into `state`(`state_id`,`state`,`state_abbr`) values (1,'Alabama','AL'),(2,'Alaska','AK'),(3,'Arizona','AZ'),(4,'Arkansas','AR'),(5,'California','CA'),(6,'Colorado','CO'),(7,'Connecticut','CT'),(8,'Delaware','DE'),(9,'District of Columbia','DC'),(10,'Florida','FL'),(11,'Georgia','GA'),(12,'Hawaii','HI'),(13,'Idaho','ID'),(14,'Illinois','IL'),(15,'Indiana','IN'),(16,'Iowa','IA'),(17,'Kansas','KS'),(18,'Kentucky','KY'),(19,'Louisiana','LA'),(20,'Maine','ME'),(21,'Maryland','MD'),(22,'Massachusetts','MA'),(23,'Michigan','MI'),(24,'Minnesota','MN'),(25,'Mississippi','MS'),(26,'Missouri','MO'),(27,'Montana','MT'),(28,'Nebraska','NE'),(29,'Nevada','NV'),(30,'New Hampshire','NH'),(31,'New Jersey','NJ'),(32,'New Mexico','NM'),(33,'New York','NY'),(34,'North Carolina','NC'),(35,'North Dakota','ND'),(36,'Ohio','OH'),(37,'Oklahoma','OK'),(38,'Oregon','OR'),(39,'Pennsylvania','PA'),(40,'Rhode Island','RI'),(41,'South Carolina','SC'),(42,'South Dakota','SD'),(43,'Tennessee','TN'),(44,'Texas','TX'),(45,'Utah','UT'),(46,'Vermont','VT'),(47,'Virginia','VA'),(48,'Washington','WA'),(49,'West Virginia','WV'),(50,'Wisconsin','WI'),(51,'Wyoming','WY');

