I have three tables as follows:
Items:
-----------------------------------------------------
| itemID | itemName | categoryID | sellerID |
-----------------------------------------------------
| 1 | item1 | c1 | s1 |
| 2 | item2 | c1 | s2 |
| 3 | item3 | c3 | s2 |
| 4 | item4 | c2 | s3 |
-----------------------------------------------------
Categories:
---------------------------------
| categoryID | categoryName |
---------------------------------
| c1 | category1 |
| c2 | category2 |
| c3 | category3 |
---------------------------------
Seller:
-----------------------------
| sellerID | sellerName |
-----------------------------
| s1 | seller1 |
| s2 | seller2 |
| s3 | seller3 |
-----------------------------
I want to select items from the Items
table where categoryID is c1
and display it as follows:
----------------------------------------------
| itemName | categoryName | sellerName |
----------------------------------------------
| item1 | category1 | seller1 |
| item2 | category1 | seller2 |
----------------------------------------------
I can't figure out how to do it. Kindly help me out.