Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Completing the CREATE TABLE statements Address Column Data Type Rules addressID INT IDENTITY addressLine VARCHAR(100) NOT NULL suburb VARCHAR(50) NOT NULL postcode VARCHAR(10) NOT NULL
- Completing the CREATE TABLE statements
Address | ||
Column | Data Type | Rules |
addressID | INT | IDENTITY |
addressLine | VARCHAR(100) | NOT NULL |
suburb | VARCHAR(50) | NOT NULL |
postcode | VARCHAR(10) | NOT NULL |
region | VARCHAR(50) | NOT NULL |
country | VARCHAR(50) | NOT NULL |
Customers | |||
Column | Data Type | Rules | |
customerID | INT | IDENTITY | |
firstName | VARCHAR(100) | NOT NULL | |
lastName | VARCHAR(100) | NOT NULL | |
VARCHAR(100) | NOT NULL | ||
mainPhoneNumber | VARCHAR(15) | NOT NULL | |
secondaryPhoneNumber | VARCHAR(15) | ||
addressID | INT | FK |
ItemCategories | ||
Column | Data Type | Rules |
categoryID | INT | IDENTITY |
parentCategoryID | INT | FK |
categoryName | VARCHAR(100) | NOT NULL |
Items | |||
Column | Data Type | Rules | |
itemID | INT | IDENTITY | |
itemName | VARCHAR(150) | NOT NULL | |
itemDescription | VARCHAR(MAX) | NOT NULL | |
itemCost | DECIMAL(10,2) | NOT NULL | |
itemImage | VARCHAR(MAX) | NOT NULL | |
categoryID | INT | FK |
CustomerOrders | ||
Column | Data Type | Rules |
orderNumber | INT | IDENTITY |
customerID | INT | FK |
orderDate | DATE | NOT NULL, DEFAULT GetDate() |
totalValue | DECIMAL(10,2) | NOT NULL |
datePaid | DATE |
ItemsInOrder | |||
Column | Data Type | Rules | |
orderNumber | INT | FK | |
ItemID | INT | FK | |
numberOf | INT | NOT NULL, DEFAULT 1 |
Reviews | ||
Columns | Data Type | Rules |
customerID | INT | FK |
itemID | INT | FK |
reviewDate | DATE | NOT NULL, DEFAULT GetDate() |
rating | INT | NOT NULL, CHECK(1-5) |
reviewDescription | VARCHAR(MAX) | NOT NULL |
- Running the Queries
- Load SQL Management Studio which you should have installed at this point.
- Connect to your default Server (usually selected by default) by clicking "Connect"
Connect to Server Microsoft SQL Server 2012 Server type: Server name: Authentication: User name: Password: Connect Database Engine P112-02\SQLEXPRESS Windows Authentication UNINET kellydr Remember password Cancel Help x Options >>
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started