| | 1 | == Browse Products and Categories |
| | 2 | |
| | 3 | ==== Actors: **Guest User / Registered User** |
| | 4 | |
| | 5 | **1.** The user opens the product catalog. |
| | 6 | |
| | 7 | **2.** The system retrieves product data from the database. |
| | 8 | {{{#!sql |
| | 9 | SELECT product.code, product.price, product.description, category.name AS category, store.name AS store FROM product |
| | 10 | JOIN category ON product.category_id = category.id |
| | 11 | JOIN store ON product.store_id = store.store_ID; |
| | 12 | |
| | 13 | }}} |
| | 14 | |
| | 15 | **3.** If the user is interested in a product, the system can provide more data about it. |
| | 16 | |
| | 17 | {{{#!sql |
| | 18 | SELECT product.code, product.price, product.description, category.name AS category, store.name AS store, image.image AS product_image, color.color AS product_color FROM product |
| | 19 | JOIN category ON product.category_id = category.id |
| | 20 | JOIN store ON product.store_id = store.store_ID |
| | 21 | JOIN image ON product.code = image.product_code |
| | 22 | JOIN color ON product.code = color.product_code |
| | 23 | WHERE product.code='00100001'; |
| | 24 | |
| | 25 | }}} |