Im working on a project to learn database and client design and I'm a bit stuck. My order table consists of:
- order_id(int(11)) - This is the primary key and is auto incrementing.
- customer_id(int(11)) - A foreign key to the customer table
- bike_id(int(11)) - A foreign key to the bikes table
- equipment_id(int(11)) - A foreign key to the equipment table.
- date_from(datetime)
- date_to(datetime)
What im trying to do is allowing a customer to have multiple bike_ids inside the order_id separated by a comma like so "6, 8, 10" - same goes for equipment_ids
I suspect it might be the datatype for bike_id which is an int and that it does not allow anything other than a single whole number.
Im starting to feel like this might be poor database design, but I dont see any other way of doing this at the moment. This is also going to be one of the main features of the system - so I want to get it right. I have no problem reading documentation, so perhaps someone can give me some pointers to how this kind of problem should be solved?