I'm currently working on a little project for a friend of mine. He runs a computer shop and needs a small application to register sales and print out a sales ticket. I've done this in Open Office and it works fine (hey, stop throwing things at me!). The problem is that I have to store sales in a database and be able to print out a sales list at the end of each month.
I have an idea about a database that holds 3 tables:
- customer details
- product details
- sale details
I believe the names are self-explanatory.
I have some problems designing the third table ("sale details"). A customer can buy an arbitrary number of different products and an arbitrary number of each of those at once. What would be the best way to design the table? My best guess would be to insert a new row for each type of product and to somehow connect it to other rows with a sale ID.