Dalia Quiles
ISM 4212 791
7/23/2021
Smallville Database Build
Data Dictionary
Table: Customer
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
CustomerID PK; Unique int Y Y
sequential
customer ID
number
FirstName First name of nvarhcar 50
customer
LastName Last name of nvarchar 50
customer
Street Street address nvarchar 50
of customer
City City of nvarchar 20
customer
State State of char 2 FL [State]
customer LIKE
‘[A-Z]
[A-Z]’
Zip Zip code of char 5 [Zip]
customer LIKE
‘[0-9]
[0-9]
[0-9]
[0-9]
[0-9]’
Phone Phone char 14 [Phone] Y
number of LIKE
customer ‘[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]’
Email Email address nvarchar 50
of customer
Table: CustomerEmployeeEvent
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
CustomerID CPK; FK to int
Customer
Table
EmployeeID CPK; FK to int
Employee
Table
Description Description of nvarchar 50
event
DateTime Date and time DateTime
of event
Table: CustomerProductOrder
Column Description Data Size Identity Unique Default Rule Check Allow Index
Name Type Nulls
OrderNo PK; Unique int Y Y
sequential
order ID
number
ProductNo CPK; FK to int
Product
Table
Quantity Quantity of int
product
ordered by
customer
QuotedPrice Quoted money
price of
product
ordered
NetSale NetSale of computed ([Quantity]*
entire order. [QuotedPrice])
Calculated
from
quantity and
quoted
price.
OrderDate Order date date
of product
CustomerID FK to int Y
Customer
Table
SalesRep FK to int Y
Employee
Table;
Synonym for
EmployeeID
Table: Employee
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
EmployeeID PK; Unique int Y Y
sequential
employee ID
number
FirstName First name of nvarchar 50
employee
LastName Last name of nvarchar 50
employee
Street Street address nvarchar 50
of employee
City City of nvarchar 20
employee
State State of char 2 FL [State]
employee LIKE
‘[A-Z]
[A-Z]’
Zip Zip code of char 5 [Zip]
employee LIKE
‘[0-9]
[0-9]
[0-9]
[0-9]
[0-9]’
Phone Phone char 14 [Phone] Y
number of LIKE
employee ‘[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]’
Email Email address nvarchar 50
of empoyee
ManagerID FK; Recursive int Y
FK to
Employee
Table,
Synonym for
EmployeeID
Table: Hourly
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
EmployeeID CPK; FK to int Y
Employee
Table
HourlyRate Hourly rate of money
pay for hourly
employee
Table: HourlyTracker
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
ShiftID PK; Unique int Y Y Y
sequential
shift ID
number
EmployeeID Employee ID int Y
of hourly
worker
StartTime Start time of time 7
employee shift
EndTime End time of times 7
employee shift
TotalHours Total hours decimal (4,2)
worked by
employee on
shift
Table: Product
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
ProductNo PK; Unique int Y Y
sequential
product ID
number
Name Name of nvarchar 50
product
Description Description nvarchar 50
of product
QuantityOnHand Quantity of int
product
actually on
hand
BackOrder Status of char 1 [BackOrder]
back order LIKE ‘[Y]’ OR
of product [BackOrder]
LIKE ‘[N]’
ListPrice List price of Money
the
product
DiscountRate Discount decimal (4,2) Y
rate of the
product
ActualPrice Actual computed ([ListPrice]-
price of the [ListPrice]*
product. [DiscountRate])
Calculated
from list
price and
discount
rate
Table: Salary
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
EmployeeID CPK; FK to Int
Employee
Table
AnnualWage Annual wage money
of salaried
employee
Table: SalesRep
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
EmployeeID CPK; FK to int
Employee
Table
CommissionRate Commission decimal (6,2)
rate of sales
rep employee
Table: Supplier
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
SupplierID PK; Unique int
sequential
supplier ID
number
Name Company nvarchar
name of
supplier
Street Street address nvarchar
of supplier
City City of nvarchar
supplier
State State of char FL [State]
supplier LIKE
‘[A-Z]
[A-Z]’
Zip Zip code of char [Zip]
supplier LIKE
‘[0-9]
[0-9]
[0-9]
[0-9]
[0-9]’
Phone Phone char [Phone] Y
number of LIKE
supplier ‘[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]
[0-9]’
Table: SupplierProductOrder
Column Name Description Data Size Identity Unique Default Rule Check Allow Index
Type Nulls
SupplierID CPK; FK to int Y
Supplier
Table
ProductNo CPK; FK to int Y
Product
Table
Quantity Quantity of int
product
ordered
from
supplier
OrderDate Order date date
of product
from
supplier
ExpectedArrival Expected computed (dateadd(d,
arrival date 5,
of product OrderDate))
from
supplier.
Calculated
from
Database Diagram
INSERT SELECTS
Customer Table
CustomerEmployeeEvent Table
CustomerProductOrder Table
Employee Table
Hourly Table
HourTracker Table
Product Table
Salary Table
SalesRep Table
Supplier Table
SupplierProductOrder Table
Reporting Queries
Query 1
Query 2
Query 3
Query 4
Query 5
Query 6
Query 7
Query 8
Query 9