0% found this document useful (0 votes)
7 views

Data_Dictionary

The document outlines a data dictionary for a database containing tables for users, admins, user addresses, products, categories, orders, and order items. Each table includes fields with their types and descriptions, detailing the structure and relationships within the database. Key attributes include primary keys, foreign keys, and various data types for user information, product details, and order processing.

Uploaded by

Sidra Kalam
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
0% found this document useful (0 votes)
7 views

Data_Dictionary

The document outlines a data dictionary for a database containing tables for users, admins, user addresses, products, categories, orders, and order items. Each table includes fields with their types and descriptions, detailing the structure and relationships within the database. Key attributes include primary keys, foreign keys, and various data types for user information, product details, and order processing.

Uploaded by

Sidra Kalam
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/ 3

Data Dictionary

users Table
Field Type Description

id int Primary key, auto-incremented unique user ID

username varchar(50) Username of the user, cannot be null

password varchar(255) Password of the user, cannot be null

created_at timestamp Timestamp of account creation, defaults to curre

admin Table
Field Type Description

id int Primary key, auto-incremented admin ID

username varchar(50) Admin username, must be unique

password varchar(255) Admin password, cannot be null

user_addresses Table
Field Type Description

address_id int Primary key, auto-incremented unique address I

user_id int Foreign key linking to users table

full_name varchar(100) Full name of the address owner

mobile varchar(15) Mobile number of the address owner

email varchar(100) Email address

address_line1 varchar(255) First line of the address

address_line2 varchar(255) Second line of the address (optional)

city varchar(100) City of the address

state varchar(100) State of the address

pincode varchar(10) Pincode of the address


is_default tinyint(1) Indicates if the address is the default one (0 = N

product Table
Field Type Description

product_id int Primary key, auto-incremented unique product I

product_name varchar(255) Name of the product

product_description text Detailed description of the product (optional)

product_actual_price decimal(10,2) Actual price of the product

product_discount_percentage decimal(5,2) Discount percentage on the product

product_discounted_price decimal(10,2) Discounted price, stored as a generated value

offer_details text Offer details (optional)

category_id int Foreign key linking to categories table

size json Available sizes for the product (optional)

product_images longtext URLs for product images

created_at timestamp Timestamp of product creation, defaults to curre

categories Table
Field Type Description

category_id int Primary key, auto-incremented unique category

category_name varchar(100) Name of the category, must be unique

image_path varchar(255) Path to the category image (optional)

created_at timestamp Timestamp of category creation, defaults to curr

orders Table
Field Type Description

order_id int Primary key, auto-incremented unique order ID

user_id int Foreign key linking to users table

address_id int Foreign key linking to user_addresses table


total_price decimal(10,2) Total price of the order

payment_method varchar(50) Payment method used (e.g., Credit Card, PayPa

status varchar(20) Order status (e.g., Pending, Shipped, Complete

order_date timestamp Timestamp when the order was placed

order_items Table
Field Type Description

order_item_id int Primary key, auto-incremented unique order item

order_id int Foreign key linking to orders table

product_id int Foreign key linking to product table

quantity int Quantity of the product in the order

price decimal(10,2) Price of the product at the time of the order

You might also like