Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Order and Order details table
Message
 
To
11/04/2006 11:21:20
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
01112440
Message ID:
01112455
Views:
16
I'd denormalize the data. What I'd do is to have only one table and add a field in the items (products & services) table to indicate its kind because most fields in both table are common. I'd also add a Track_StockLevel field to indicate if the item needs to calculate its stock with every transaction.

You may also want a type table where you indicate the different types of items just in case you want to add more than just services & products, let's say for example "no billable".

This just from the top of my head.

HTH,

Enmanuel

>I am in the process of a logical database desing and I am not sure how to go about the design of the following tables :
>(This tables are for a Spa and Salon. )
>
>I have normalized the tables and I came up with the following :
>
>1 - Ticket ( nTicket_id int)
>2 - Ticket Details ( I have to determine the primary key, maybe a cluster index?)
>3 - Products (nProduct_id int)( ex. Shampoos, Conditioners )
>4 - Services (cService_id char, 4)( Hair cut, manicure )
>
>Well here is the question:
>
>Should I denormalize the Products and Services table into one table. This way I can reduce the number of required joins?.
>
>In this case I would have one table called ProductsServices and on the 'Ticket Details' table I would have the ProductsServices_id ( from ProductsServices table ). Also I would be able to have a clusteded index on the 'Ticket Details' table( nTicket_id + ProductsServices_id ).
>
>Is this the right approach?. Should I have the Products and Services data in two separate tables. If I do have two separate tables then I will have to create two fields in the 'Ticket Details' table ( nProducts_id and cService_id).
>
>Any feedback is appreciated.
>
>Thanks,
>Sergio Ortiz
I'm a mixture of Albert Einstein and Arnold Schwarzenegger. The only trouble is that I got Einstein's body and Schwarzenegger's brain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform