You are on page 1of 2

DATA DEFINITION LANGUAGE

CREATE TABLE Customer (


CustomerID CHAR(5) Primary Key,
CustomerName VARCHAR(100) Not NULL,
CustomerAddress VARCHAR(150) Not NULL,
CustomerPhone INT
)

CREATE TABLE Order (


OrderID CHAR(5) Primary Key,
Qty INTNot NULL,
CustomerID CHAR(5) Not NULL
)

CREATE TABLE Purchase_Invoice (


InvoiceNo CHAR(5) Primary Key,
OrderID CHAR(5) Not NULL,
CustomerID CHAR(5) Not NULL,
Disc INT Not NULL,
TotalPrice INT Not NULL,
Tax INT Not NULL
)

CREATE TABLE Staff (


StaffID CHAR(5) Primary Key,
StaffName VARCHAR(150) Not NULL,
Position VARCHAR (10) Not NULL
)

CREATE TABLE Sales_Invoice (


SalesInvoiceNo CHAR(5) Primary Key,
OrderID CHAR(5) Not NULL,
InvoiceDate DATE ,
DueDATE DATE,
Total INT Not NULL,
Tax INT Not NULL
)

CREATE TABLE Business_Owner (


BusinessOwnerID CHAR(5) Primary Key,
BusinessOwnerName VARCHAR(100) Not NULL
)
CREATE TABLE DELIVERY_INVOICE(
DeliveryInvoiceNo CHAR(5) Primary Key,
SrtjalanNo INT Not NULL,
SalesInvoiceNo CHAR(5) Not NULL,
Inventory INT Not NULL,
Keterangan VARCHAR(255)
)

CREATE TABLE ITEM(


ItemID CHAR(5) Primary Key,
ItemName INT Not NULL,
Price INT Not NULL,
Units INT Not NULL,
Type INT Not NULL
)

You might also like