100% found this document useful (1 vote)
402 views18 pages

Dalia Quiles Smallville Database Build

The document provides data dictionaries for 7 tables in a Smallville database: Customer, CustomerEmployeeEvent, CustomerProductOrder, Employee, Hourly, HourlyTracker. The tables track customer, employee and order information for a company. Key details include primary keys, foreign keys, data types, sizes, default values, checks and indexes for each column in the tables.

Uploaded by

api-573686577
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
402 views18 pages

Dalia Quiles Smallville Database Build

The document provides data dictionaries for 7 tables in a Smallville database: Customer, CustomerEmployeeEvent, CustomerProductOrder, Employee, Hourly, HourlyTracker. The tables track customer, employee and order information for a company. Key details include primary keys, foreign keys, data types, sizes, default values, checks and indexes for each column in the tables.

Uploaded by

api-573686577
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

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

You might also like