CREATE USER "TOY" IDENTIFIED BY "VB6DB";

GRANT DBA TO "TOY";

CREATE TABLE "TOY"."CONDITIONQUESTIONS"("TYPEID" NUMBER(10) NOT NULL, "SEQ" NUMBER(10) NOT NULL, "QUESTION" VARCHAR2(64), "WEIGHT" NUMBER(10), "RESPONSES" NUMBER(10)) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;

CREATE TABLE "TOY"."CUSTOMERS"("CUSTOMERID" NUMBER(10) NOT NULL, "NAME" VARCHAR2(64), "STREET" VARCHAR2(64), "CITY" VARCHAR2(64), "STATE" CHAR(2), "ZIP" NUMBER(10), "PHONE" VARCHAR2(32), "EMAILADDRESS" VARCHAR2(128) NOT NULL, "DATEADDED" DATE, "DATEUPDATED" DATE, "MAILINGLIST" NUMBER(2) NOT NULL, "COMMENTS" VARCHAR2(256)) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;

CREATE TABLE "TOY"."MANUFACTURERS"("MANUFACTURERID" NUMBER(10) NOT NULL, "NAME" VARCHAR2(64)) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING; 

CREATE TABLE "TOY"."INVENTORY"("INVENTORYID" NUMBER(10) NOT NULL, "TOYTYPEID" NUMBER(10), "MODELLINE" VARCHAR2(64), "NAME" VARCHAR2(64), "MANUFACTURERID" NUMBER(10), "YEARISSUED" DATE, "DESCRIPTION" VARCHAR2(1024), "MINTVALUE" NUMBER(19, 4), "CONDITION" NUMBER(10), "CONDITIONMASK" VARCHAR2(64), "TRUEVALUE" NUMBER(19, 4), "DATEPURCHASED" DATE, "PURCHASEPRICE" NUMBER(19, 4), "ASKINGPRICE" NUMBER(19, 4), "BUYINGPRICE" NUMBER(19, 4), "WANTED" NUMBER(2) NOT NULL, "FORSALE" NUMBER(2) NOT NULL, "COMMENTS" VARCHAR2(256), "DATEUPDATED" DATE) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;

CREATE TABLE "TOY"."IMAGES"("INVENTORYID" NUMBER(10) NOT NULL, "SEQ" NUMBER(10) NOT NULL, "IMAGE" LONG RAW) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;

CREATE TABLE "TOY"."ORDERDETAILS"("ORDERID" NUMBER(10) NOT NULL, "SEQ" NUMBER(10) NOT NULL, "INVENTORYID" NUMBER(10), "PURCHASEPRICE" NUMBER(19, 4)) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;

CREATE TABLE "TOY"."ORDERS"("ORDERID" NUMBER(10) NOT NULL, "CUSTOMERID" NUMBER(10), "ORDERTYPE" NUMBER(10), "SHIPPINGCOST" NUMBER(19, 4), "SALESTAX" NUMBER(19, 4), "HOWPAID" NUMBER(10), "CREDITCARDNUMBER" VARCHAR2(32), "EXPDATE" VARCHAR2(16), "ORDERSTATUS" NUMBER(10), "DATEORDERED" DATE, "DATESHIPPED" DATE, "DATERECEIVED" DATE) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;

CREATE TABLE "TOY"."STATES"("STATE" CHAR(2) NOT NULL, "STATENAME" VARCHAR2(64), "SALESTAXRATE" NUMBER(9, 4)) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;

CREATE TABLE "TOY"."TOYTYPES"("TYPEID" NUMBER(10) NOT NULL, "DESCRIPTION" VARCHAR2(256)) TABLESPACE "TOOLS" PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 STORAGE ( INITIAL 32K NEXT 32K MINEXTENTS 1 MAXEXTENTS 4096 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1) LOGGING;
