I have this db below. I wonder how I should use the ID to identify each record.
Everything is connected from the classified_table
!
Two Questions:
Should I use AI on every PK in this case?
Could somebody give me the FULL code for selecting an entire classified from only an ad_id
("bmw_330ci_8939483" for example)?
I am new to normalized db and making a good database work, so detailed instructions is very much appreciated... Also if you notice any 'wrongs' in this db please let me know.
category table:
cat_id (PK)
cat_name
category_options table:
option_id (PK)
cat_id (FK)
option_name
option_values table:
value_id (PK)
option_id (FK)
value
classifieds table:
classified_id (PK)
ad_id (VARCHAR) something like "Bmw330ci_28238239832" which will appear in URL
poster_id (FK)
cat_id (FK)
area_id (FK)
headline
description
price
etc....
posters table:
poster_id (PK)
name
email
tel
password
area table:
area_id (PK)
area
community
Thanks