Skip to content

Instantly share code, notes, and snippets.

@atayahmet
Last active July 29, 2016 17:12
Show Gist options
  • Save atayahmet/4e3f0e87c1ac6f9c69cff02a6868ee49 to your computer and use it in GitHub Desktop.
Save atayahmet/4e3f0e87c1ac6f9c69cff02a6868ee49 to your computer and use it in GitHub Desktop.

Category Relations

category table:

id name
1 Giyim
2 Aksesuar
3 Kozmetik

category relation table:

id category_id relation_id
1 1 (Giyim) 2 (Aksesuar)
2 1 (Giyim) 3 (Kozmetik)
3 2 (Aksesuar) 3 Kozmetik

product table:

id name
1 Kırmızı Etek
2 Mavi Etek
3 Siyah Gömlek
4 Yeşil Pantolon
5 Siyah Kemer
6 Metal Kemer
7 Siyah El Çantası
8 Yeşil Gömlek

product category relation table:

id category_id product_id
1 1 (Giyim) 1 (Kırmızı Etek)
2 1 (Giyim) 3 (Mavi Etek)
3 2 (Aksesuar) 5 (Siyah Kemer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment