create database newsub2;

use newsub2;

create table customers
(
customerid int unsigned not null auto_increment primary key,
firstname char(40) not null,
lastname char(40) not null,
title char(20),
company char(30),
address1 char(40) not null,
address2 char(40),
city char(20) not null,
state char(15) not null,
zip  char(10),
country char(20),
telephone char(20),
fax char(20),
email char(30)
);


create table orders
(
orderid int unsigned not null auto_increment primary key,
customerid int unsigned not null,
amount float(6,2),
date date not null,
orderstatus char(10),
shipname char(40) not null,
shipaddress char(40),
shipcity char(20),
shipstate char(15),
shipzip char(10),
shicountry char(20) not null
);


create table admin
(
username char(16) not null primary key,
password char(16) not null
);

create table headings
(
 tablename char(12) not null primary key,
 field1 char(12),
 field2 char(12),
 field3 char(12),
 field4 char(12),
 field5 char(12),
 field6 char(12),
 field7 char(12),
 field8 char(12),
 field9 char(12),
 field10 char(12),
 field11 char(12),
 field12 char(12),
 field13 char(12)
 );


grant select, insert, update, delete
on newsub.*
to root@localhost;