Click here to Skip to main content
       

Database

 
QuestionI want to ask query related to mysql Pinmembermanisharathore5-Jan-13 7:32 
AnswerRe: I want to ask query related to mysql PinmemberMycroft Holmes5-Jan-13 11:03 
Questionproblem in ado.net with access 2010 PinmemberAchilles843-Jan-13 23:20 
AnswerRe: problem in ado.net with access 2010 PinmemberMycroft Holmes4-Jan-13 13:55 
Questionhow to cast real data type in sql server 2005 PinmemberAuf Klarung2-Jan-13 22:55 
QuestionRe: how to cast real data type in sql server 2005 PinmemberEddy Vluggen4-Jan-13 22:52 
QuestionSql server like clause Pinmemberrubonkumar28-Dec-12 4:44 
AnswerRe: Sql server like clause PinmvpRichard MacCutchan28-Dec-12 6:05 
AnswerRe: Sql server like clause [modified] PinmemberPIEBALDconsult28-Dec-12 6:38 
GeneralRe: Sql server like clause PinmemberMike Meinz28-Dec-12 6:49 
GeneralRe: Sql server like clause Pinmemberrubonkumar28-Dec-12 19:08 
AnswerRe: Sql server like clause Pinmemberrajarao3044-Jan-13 0:50 
QuestionDatabase design question PinmemberDavidCrow27-Dec-12 15:22 
AnswerRe: Database design question PinmemberPIEBALDconsult27-Dec-12 15:52 
Instead of having one price record per item, have many records with history so you can see what the price was when the order was placed.
 
Something like:
Item: ItemId,Name,Description,Supplier,etc.
 
1,Widget,A standard widget,Widget Co,...
 
ItemPrice: PriceId,ItemId,FromDate,ToDate,Price
 
1,1,2012-01-01,2012-07-01,1.00
2,1,2012-07-01,null,1.50

 
When a new price is added, the FromDate of the new record and the ToDate of the previous price are set as Now.
You find the current price by WHERE ToDate IS NULL
To find a price for an order you can use WHERE orderdate BETWEEN FromDate and ISNULL(ToDate,Now)
You may add NextPrice and PreviousPrice fields if you need to do a lot of lookups.
 
(Specific syntax depends on the particular database in use.)
AnswerRe: Database design question Pinmemberjschell28-Dec-12 10:16 
GeneralRe: Database design question PinmemberPIEBALDconsult28-Dec-12 14:42 
GeneralRe: Database design question Pinmemberjschell30-Dec-12 8:28 
AnswerRe: Database design question PinmemberMycroft Holmes28-Dec-12 11:05 
QuestionImporting of Huge fixed width text file in sql server table Pinmemberibrahim sharief27-Dec-12 9:24 
AnswerRe: Importing of Huge fixed width text file in sql server table PinmemberPIEBALDconsult27-Dec-12 14:08 
AnswerRe: Importing of Huge fixed width text file in sql server table PinmemberDeepak Kr130-Dec-12 20:29 
AnswerRe: Importing of Huge fixed width text file in sql server table Pinmemberjschell31-Dec-12 9:14 
Questionshow Sum(Balance) as ob on Rows Header and add next rows balance in ob Pinmemberhadeed147227-Dec-12 6:52 
AnswerRe: show Sum(Balance) as ob on Rows Header and add next rows balance in ob Pinmemberdjj5527-Dec-12 7:53 
GeneralRe: show Sum(Balance) as ob on Rows Header and add next rows balance in ob Pinmemberhadeed147227-Dec-12 8:03 
QuestionSQL BulkCopy using IDataReader - how can you cast the fields? PinmemberAllan Watkins26-Dec-12 19:12 
AnswerRe: SQL BulkCopy using IDataReader - how can you cast the fields? PinmemberMycroft Holmes26-Dec-12 20:32 
GeneralRe: SQL BulkCopy using IDataReader - how can you cast the fields? PinmemberAllanW1111127-Dec-12 6:02 
AnswerRe: SQL BulkCopy using IDataReader - how can you cast the fields? PinmemberPIEBALDconsult27-Dec-12 8:48 
QuestionSubquery returns more than 1 row PinmemberJassim Rahma24-Dec-12 1:02 
AnswerRe: Subquery returns more than 1 row PinmemberEddy Vluggen24-Dec-12 1:29 
AnswerRe: Subquery returns more than 1 row PinmemberMaulikDusara24-Dec-12 21:44 
GeneralRe: Subquery returns more than 1 row PinmemberEddy Vluggen25-Dec-12 2:41 
GeneralRe: Subquery returns more than 1 row PinmemberMycroft Holmes26-Dec-12 11:17 
GeneralRe: Subquery returns more than 1 row PinmemberMaulikDusara26-Dec-12 18:45 
GeneralRe: Subquery returns more than 1 row PinmemberEddy Vluggen27-Dec-12 4:24 
QuestionOn the Naming of Columns for Lookup tables. PinmemberBrady Kelly17-Dec-12 22:44 
AnswerRe: On the Naming of Columns for Lookup tables. PinmemberMycroft Holmes17-Dec-12 23:19 
GeneralRe: On the Naming of Columns for Lookup tables. PinmemberBrady Kelly17-Dec-12 23:26 
GeneralRe: On the Naming of Columns for Lookup tables. PinmemberMycroft Holmes18-Dec-12 1:11 
GeneralRe: On the Naming of Columns for Lookup tables. PinmemberBrady Kelly18-Dec-12 1:15 
AnswerRe: On the Naming of Columns for Lookup tables. PinmemberPIEBALDconsult18-Dec-12 4:05 
GeneralRe: On the Naming of Columns for Lookup tables. PinmemberBrady Kelly18-Dec-12 4:12 
GeneralRe: On the Naming of Columns for Lookup tables. PinmemberPIEBALDconsult18-Dec-12 4:46 
GeneralRe: On the Naming of Columns for Lookup tables. PinmemberBrady Kelly18-Dec-12 5:34 
QuestionOn Strategies to Spell Check the Structure of a Database. PinmemberBrady Kelly14-Dec-12 3:02 
JokeRe: On Strategies to Spell Check the Structure of a Database. PinmemberChris Meech14-Dec-12 4:31 
AnswerRe: On Strategies to Spell Check the Structure of a Database. PinmemberSimon_Whale14-Dec-12 4:52 
AnswerRe: On Strategies to Spell Check the Structure of a Database. PinmemberMycroft Holmes14-Dec-12 13:12 
GeneralRe: On Strategies to Spell Check the Structure of a Database. PinmemberBrady Kelly14-Dec-12 16:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web02 | 2.8.140814.1 | Last Updated 21 Aug 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid