A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Should an order details table have autonumber field orderdetailsID?



 
 
Thread Tools Display Modes
  #1  
Old August 25th, 2005, 12:15 PM
Will
external usenet poster
 
Posts: n/a
Default Should an order details table have autonumber field orderdetailsID?

I have tblOrder with the fields OrderID, OrderDate & CustomerID. I have
just made tblOrderDetails with the fields OrderDetailsID, OrderID, ItemNo,
Quantity. My question is do I need the OrderDetailsID (autonumber) field?
are there any advantages to it?

thanks in advance


  #2  
Old August 25th, 2005, 12:28 PM
Rick Brandt
external usenet poster
 
Posts: n/a
Default

Will wrote:
I have tblOrder with the fields OrderID, OrderDate & CustomerID. I
have just made tblOrderDetails with the fields OrderDetailsID,
OrderID, ItemNo, Quantity. My question is do I need the
OrderDetailsID (autonumber) field? are there any advantages to it?

thanks in advance


Every table in a proper database needs a Primary Key. If you have other
field(s) that you can use as a PK then the AN is not necessary. Some people
would not want an Order to list the same ItemNo on more than one line of an
Order. For them a PK consisting of OrderID and ItemNo would work just fine.
Others might want the capability to enter the same ItemNo on more than one line
so they would need "some" other field added to the table to establish uniquness.
In that case an AN would solve the problem.


--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


  #3  
Old August 25th, 2005, 01:53 PM
Haris Rashid
external usenet poster
 
Posts: n/a
Default

hi, If the Order ID and Item number are unique for each row then you don't
need any oderdetail ID and you can use the Order_ID and Item_Number as the
concatenated key. However if this is not so then you should create the Order
detailID as the key and it will be useful to have it auto-numbered.
--
Haris
http://www.manage-systems.com


"Will" wrote:

I have tblOrder with the fields OrderID, OrderDate & CustomerID. I have
just made tblOrderDetails with the fields OrderDetailsID, OrderID, ItemNo,
Quantity. My question is do I need the OrderDetailsID (autonumber) field?
are there any advantages to it?

thanks in advance



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Options Group Patty Stoddard Using Forms 19 August 4th, 2005 02:30 PM
Seeking some expert advice. HD87glide Using Forms 14 March 23rd, 2005 10:11 PM
Design help, please SillySally Using Forms 27 March 6th, 2005 04:11 AM
Access 2000, autonumber fields Zyberg74 General Discussion 3 November 17th, 2004 04:24 PM
Autonumber Ally H. General Discussion 7 August 27th, 2004 04:51 PM


All times are GMT +1. The time now is 11:40 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.