Hello I need a bit of advice regarding the design of part of my database. I am doing it as a hobby
I am designing a customers-bookings databse in SQL Server Management Studio Express, and designing the front end in VS2008 (
vb.net) using bindingsources and datagridviews to display the data.
My database has 4 related tables which are displayed in their own datagridviews -
tblCustomers
customerID (pk)
customerName
customerAddress
tblBookings
bookingsID (pk)
customerID
dateofbooking
tblBookingsItems
bookingsItemsID (pk)
bookingsID
stockID
quantityRequested
tblStock
StockID (pk)
stockTitle
Description
NumberInStock
When I select a customerID (via the Customer datagridview) I can view the related BookingsID's in the bookings DGV. Then I can select a BookingsID to view the related BookingsItemsID's in the bookingsItems DGV. This allows for a single booking to have more than one stockID added to it.
What I cannot do is select a BookingsItemsID from bookingsItems DGV and view the particular StockID they have booked in the Stock DGV. I CAN do it the other way around - select a StockID to view all the BookingsItemsID for that stockID.
I think it is becuse my DB is designed so one StockID has many BookingsItemsId's.
What do I need to alter? Do I need to add another table called say "tblStockItems" and add the stockID and create a new field called say "stockItemsID" linked to tblBookingsItems? Or should I use a Query to show tblbookingsitems and related items on tblstock?