I am going to create a person to person store with Laravel, a website where its users can share and sell their product or their mobile, TV, Computer, Shoes, Shirts, Books, Cars, Bags, Animal, etc.
I am going to create a table named products and other tables about products are, for example, bugs, Animals, Cars, Shirts, Shoes, Computers.
products table:
product_id | cat_id | title | cost | timestamp
cars table:
id | product_fk | brand | model | type | Fuel | ...
computers table:
id | product_fk | brand | type | CPU | GPU | hard_disk | ...
I will create other tables with this way.
I want to search database by titles and their type , I mean I just search the products table
I want to know
- Is there any other way (better and easier) to do this?
- What do you think about this structure?
4
You can use this structure too…
Products:
--------
ProductID | CategoryID | Title | Cost | TimeStamp
1 | 1 | Audi | $0 | -----
Specifications
--------------
SpecificationID | Specification
1 | Model
2 | Fuel
3 | HardDisk
ProductSpecifications:
----------------------
ProductSpecificationID | ProductID | SpecificationID | Value
1 | 1 | 1 | xyz
1 | 1 | 2 | abc
1