talla table stores available size options for clothing items. Sizes are referenced by products through the id_talla foreign key, ensuring consistent sizing across the inventory system.
Table Structure
Primary key - Auto-incrementing unique identifier for each size
Size code (e.g., “ch”, “m”, “g”, “ech”, “eg”)
SQL Definition
TiendaRopa.sql
Sample Data
The database includes these default size options:Size Code Reference
CH - Chico
ID: 1 - Small size
M - Mediano
ID: 2 - Medium size
G - Grande
ID: 3 - Large size
ECH - Extra Chico
ID: 7 - Extra small size
EG - Extra Grande
ID: 8 - Extra large size
Size codes use Spanish abbreviations: ch (chico/small), m (mediano/medium), g (grande/large), ech (extra chico/extra small), eg (extra grande/extra large)
Relationships
Referenced By
prenda Table
Products reference sizes through
id_talla foreign keyCommon Queries
List All Sizes
Products by Size
Size Distribution
Products by Category and Size
The database has a composite index
idx_prenda_cat_talla on (id_categoria, id_talla) that optimizes queries filtering by both category and size.Usage in Application
Sizes are managed throughtallas.php:
- Create: Add new size codes
- Update: Edit existing size codes via modal dialog
- Delete: Remove sizes (only if not referenced by products)
- View: Display all sizes in a sortable table
Create Operation
tallas.php
Update Operation
tallas.php
Delete Operation
tallas.php
Business Rules
- Lowercase Convention: Size codes are stored in lowercase for consistency
- Abbreviations: Use standardized Spanish abbreviations (ch, m, g, ech, eg)
- Deletion Constraints: Sizes cannot be deleted if referenced by products
- Unique Codes: Avoid duplicate size codes to prevent confusion
Extension Possibilities
International Sizing
International Sizing
Add columns for international size equivalents:
Measurement Ranges
Measurement Ranges
Store measurement ranges for each size:
Size Categories
Size Categories
Categorize sizes by type (adult, child, infant):
Gender-Specific Sizing
Gender-Specific Sizing
Distinguish between men’s and women’s sizing:
Analytics Queries
Stock Value by Size
Low Stock by Size
Related Documentation
prenda Table
Product catalog that references sizes
Catalog Management
Using the size management interface
Database Indexes
Composite index for category+size queries
Managing Categories
User guide for catalog management