home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.databases.ms-sqlserver      Notorious Rube Goldberg contraption      19,505 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 19,020 of 19,505   
   Erland Sommarskog to Tony Johansson   
   Re: Is it good to have a price column im   
   27 Feb 14 08:06:51   
   
   From: esquel@sommarskog.se   
      
   Tony Johansson (johansson.andersson@telia.com) writes:   
   > Now to my question is it good to have a price column in the OrderLine   
   > table. ?   
   > If we have a price will that mean the total price per line such as if we   
   > have ordered 3 shoes and this specific shoes cost 10 the price field in   
   > OrderLine would be 30   
      
   All this depends on business rules, but yes, I would expect a price column   
   in a Orderline table. That gives the price for that specific order. The   
   customer may have gotten a discount. And more importantly, if you change the   
   price for the product, you don't want that to affect old orders.   
      
   Although, in your example I would store 10 in the Price column in the   
   Orderline table. If it was called Amount I would store 30. But that's more of   
   a language issue.   
      
      
   --   
   Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se   
      
   Books Online for SQL Server 2005 at   
   http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx   
   Books Online for SQL Server 2000 at   
   http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca