You are on page 1of 15

VIRTUAL UNIVERSITY OF

THE STATE OF

NAME:

ENROLLMEN
T:

uveg
of the state of quanaiuabo
GUANAJUATO

MODULE: DATABASE FUNDAMENTALS


CHALLENGE 5: STANDARDIZATION OF MY DATABASE
PREPARATION: TUESDAY, NOVEMBER 16, 2021.
PROBLEM STATEMENT
• We want to design a database for a clothing store Modarte S.A. de C.V. to correctly perform
inventory control and sales management. This marketing company has several products for
women, men, boys and girls; therefore, it is necessary to keep information on Products,
Employees, Customers and Sales in a timely manner.

• Products can be sold by many Employees and are purchased by many Customers; for Product
information such as product code, product name, type, size, date of purchase, date of sale and
quantity in stock is required.
• Employees can make many sales, these sales can have many Products; for Employee you
need information such as employee ID, employee name, address, phone and CURP.
• A Customer can make many sales, for the customer is necessary information
such as customer number, customer name, address, e-mail, payment method
and RFC for invoicing.
•A Sale can have many products, a product can appear in many sales, an
employee can make many sales, and a customer can participate in many
sales. The following information must be considered for sales: sales code,
date of sale, method of payment and total due.
DEFINITION OF
TABLES
Products
CodProd Unique 5-digit number, identifies the product
NomProd Product description text
Type Text indicating the type
Size Character indicating product size
FechComp Date product was purchased
DateVent Date on which the product was sold to customer
QtyExist Number indicating quantity of units in stock
DEFINITION OF
TABLES

Employees
IdEmp Unique 5-digit number, identifies the employee.
NomEm
p
Text consisting of name and surname
Address Text consisting of street, number, neighborhood, municipality, and
state of the
n employee
Telephone Number indicating employee's telephone number
CURP Text formed with the employee's unique population registry key
DEFINITION OF
TABLES

Customer
NumClient
Unique 5-digit number, identifies the customer
ClientName
Text consisting of name and surname
Text consisting of street, number, neighborhood, municipality and state
Address of the client.
E-mail Text indicating the customer's email address
FormPago Text indicating the customer's method of payment
RFC Text with customer's federal taxpayer registration
DEFINITION OF
TABLES

Sales
CodVenta Unique 5-digit number, identifies the customer
FechVenta Text consisting of name and surname
Text consisting of street, number, neighborhood, municipality and state
FormPago of the client.
TotalPay Text indicating the customer's method of payment
DEFINITION OF
TABLES

Sales
CodVenta Unique 5-digit number, identifies the customer
CodProd
Unique 5-digit number, identifies the product
RELATIONSHIP ENTITY
MODEL
FechVenta CodVent
a

Sales
N 1:N

FormPago TotalPay

It has Perform
CantExist

1:N Address

NomPro
CodProd Participa
te

NumClient
FormPago Employe CURP
FechVent Products Size e

NomEmplead Employee_I
RFC Custom E-mail
o D
FechComp Typ ers
e

Address NomClient
Employee
RELATIONAL MODEL Customer
NumClient Int PK
Employee_Id Int Pk
CustomerNa Varchar (30) Not Null
NomEmpleado Varchar(30) Not Null
1:N 1:N me
Varchar (30) Not Null
Address Varchar(30) Not Null Address
Varchar (15) Not Null
Phone Varchar(15) Not Null FormPago
Varchar (15) Not Null
CURP Varchar(15) Not Null RFC
Varchar (20) Not Null
E-mail
For sale
CodVent Int PK
FechVent Date Not Null
1:N
FormPago Varchar(15) Not Null

TotalPay Double Not Null


IdEmployee Int FK
IdCustomer Int FK Products
CodProd Int PK
NomProd Varchar(30) Not Null

Type Varchar(15) Not Null


FechVent Date Not Null
FechComp Date Not Null

Sales_product CantExist Int Not Null


1:N
CodVent Int FK
CodPro In F
d t K
FIRST NORMAL FORM Custo
mer
NumClient
Employee e Int PK

Employee_Id Int Pk NomClient Not


Varchar (30)
e Null
Not
NomEmpleado Varchar(30) Null Not Null
Address Varchar (30)
Last namePat varchar(30) Not null
LastNamePat
Last nameMat varchar(30) Not null 1:N 1:N LastNameMat
varchar(30) Not null
Street varchar(30) Not null varchar(30) Not null
Number varchar(30) Not null Street varchar(30) Not null
Colony varchar(30) Not null Number varchar(30) Not null
City varchar(30) Not null Colony varchar(30) Not null
Not For sale City varchar(30) Not null
Phone Varchar(15) Null Not Null
CodVent Int PK RFC Varchar (15)
Not
CURP Varchar(15) Null
Not
FechVent Date E-mail Varchar (20) Not Null
Null
FormPago Varchar(15) Not
Null
TotalPay Double Not
Null
IdEmployee Int FK
IdClient Int FK Products
CodProd Int PK
1:N m
NomProd Varchar(30) Not Null
Type Varchar(15) Not Null
FechVent Date Not Null
4
FechComp
1:N Date Not Null
Product — sale CantExist Int Not Null
CodVent F
Int K

CodProd Int
PK
Custome
Not Null
Not Null
SECOND NORMAL FORM NumClient r
Int
Employee e
Not Null
Employee_Id Int Pk NomClient Varchar (30)
Not Null
Not Null e
NomEmpleado
Not Null Varchar(30)
PK
Address Varchar (30)
Last namePat varchar(30) Not null
Last nameMat varchar(30) Not null 1:N 1:N Last namePat varchar(30)
Not
Null
Street varchar(30) Not null Last nameMat varchar(30)
Number varchar(30) Not null Street varchar(30) Not
Colony varchar(30) Not null Number varchar(30) Null
City varchar(30) Not null Colony varchar(30) Not null
Not Null For sale City varchar(30) Not null
Phone Varchar(15) Not null
CodVent Int PK RFC Varchar (15) Not null
Not Null Not null
CURP Varchar(15)
FechVent Date
Not
Null
1 ™
E-mail Varchar (20) Not null
Not null
Not null
FormPago Varchar(15 Not
) Null Not
Null
TotalPay Double Not
Null Not
Null
1:N IdEmployee Int FK
IdCustomer m Int FK Products
CodProd Int

NomProd Varchar(30)
f/

Product sale
Type Varchar(15)
CodVent Int FK 1:N
EK FechVent Date
CodProd Int FK FechCom
Date
FK p
CantExist Int
Custo
THIRD NORMAL FORM NumClient mer
Int PK
Employee e
Product sales
NomClient Not
Employee_Id Int Pk CodVent Int FK Varchar
e Null
(30)
Not FK Not
NomEmpleado Varchar(30) Null Address Varchar
CodProd Int FK Null
Last namePat varchar(30) Not null (30)
SurnamePat varchar(30) Not null
Last nameMat varchar(30) Not null FK
SurnameMat varchar(30) Not null
Street varchar(30) Not null Not null
Number varchar(30) Not null 1: 1: Street
Number
varchar(30)
varchar(30) Not null
Colony
City
varchar(30)
varchar(30)
Not null
Not null
N N Colonia varchar(30) Not null
Not null
City varchar(30)
varchar(30) Not null
Phone Varchar(15)
Not F Not null
Null RFC Varchar
CodVent o
Int PK (15) Not
Not
CURP Varchar(15) Null r Not E-mail Varchar
Null
FechVent Date Null (20) Not
s Not
Null
FormPago Varchar(15)
a Null
l Not
TotalPay Double
e Null
IdEmployee Int FK
Products
1:N IdCustomer Int FK

CodProd Int PK
Not
NomProd Varchar(30) Nul
Product sale lNot
Type Varchar(15) Nul
CodVent Int FK 1: l
Not
FK N FechVent Date Nul
lNot
CodProd Int FK
FechCom p Date Nul
FK l
Not
CantExist Int

You might also like