Prev | Current Page 189 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

This is not in contradiction with
the relational character of the database.
Figure 5-1 depicts a simple representation of three data tables, including some selected
sample data.
Figure 5-1. Unrelated departments, categories, and products
Ta Table with Department le Departments
Ta Table with Cate le Categorie ories
Ta Table with Pro le Produ duct cts
Name
Name
Name
Re Regional ional
Nat Nature re
Sea easonal onal
French
Italian
Iri Irish
Animal
Flower
Chri Christma tmas
Valentine??™ Valentine??™s
Ha Haute Co te Couture re
Gallic Cock
allic Tankanyika Giraffe iraffe
Weather Vane
Altar Piece
Bir Birds ds
...
?
?
?
CHAPTER 5 ?–  CREATING THE PRODUCT CATALOG: PART 2 114
When two tables are said to be related, this more specifically means that the records of
those tables are related. So, if the products table is related to the categories table, this translates
into each product record being somehow related to one of the records in the categories
table.
Figure 5-1 doesn??™t show the physical representation of the database, so we didn??™t list the
table names there. Diagrams like this are used to decide what needs to be stored in the database.
After you know what to store, the next step is to decide how the listed data is related, which
leads to the physical structure for the database. Although Figure 5-1 shows three kinds of data
that you want to store, you??™ll learn later that to implement this structure in the database, you??™ll
actually use four tables.


Pages:
177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201