Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 Is this data redundant?

Author  Topic 

X-Factor
Constraint Violating Yak Guru

392 Posts

Posted - 2009-08-31 : 18:04:38
Hi there,

I've got an online shop that sells tickets for music events which are put on at a holiday camp. There's the usual orders table which is referenced by order details which themselves reference a product which is assigned to an event!

Now, when someone buys a ticket online for an event, their order's details need to be assigned to a ticket in the ticket table which is itself assigned to a chalet at the holiday camp.

There are multiple events so eventually the ticket table contains multiple tickets assigned to the same chalet - each ticket which shares a chalet is obviously going to be for a different event but at the same venue.

The question is, in order to determine which event a ticket is for, does each ticket row in the ticket table reference the event or does the system trace back to the orders that are assigned to the ticket and work out which event the order's detail's products are assigned to?

I think the former is more simple for queries and makes it easy to set up a unique constraint on the tickets table to stop the same chalet being assigned more than once for a single event.

Also, if there was a mix up with multiple orders being assigned to a single ticket (a user can pay a deposit followed by a balance) where the products assigned to the ticket were for different events, then the ticket's own event reference could be used as the definitive event identity.

Still, I have a nagging suspicion that I'm repeating data.

Any thoughts, XF.

ScottWhigham
Starting Member

49 Posts

Posted - 2009-09-03 : 09:45:04
Whoa - I got confused just reading the first two paragraphs so I can imagine it is a complex design :)

I need schema (and, if possible, the DDL to create, DML to load, and an example showing the desired output) to understand this...

========================================================

I have about 1,000 video tutorials on SQL Server 2008, 2005, and 2000 over at http://www.learnitfirst.com/Database-Professionals.aspx
Go to Top of Page
   

- Advertisement -