I've heard it's best to have a meaningless primary key (such as an
autonumber field) as opposed to a pk that contains volatile data. This
sounds reasonable enough. In fact, I think I'd need a good reason *not* to
use an autonumber field for a pk. But how do I normalize with an autonumber
pk? My guess is I pick a field to use as a "pseudo pk" when defining
dependencies.
Let's say I follow the single field, autonumber pk philosophy. I'll never
have a composite pk and thus won't be concerned with 2NF, but will be
concerned with columns that are not dependant upon the pk (or rather the
"pseudo pk") for 3NF normalization.
If I have an "Accounts" table, for example, I might have an AcctNumber
(Long) field and an Acct_ID (Autonumber) pk field. The Acct_ID is
meaningless, so I'd have to ask, "What data is this table designed to
store?" - easy enough: Account numbers. So when adding new fields I
normalize to the AcctNumber field (whether it's indexed or not). This means
fields like Account Type and Creation Date might be added to the table, but
Customer Name and Telephone Number would go in a separate table.
Does this sound about right?
Thanks in advance for your comments. 5 2227
deko wrote: I've heard it's best to have a meaningless primary key (such as an autonumber field) as opposed to a pk that contains volatile data.
This sounds reasonable enough. In fact, I think I'd need a good reason
*not* to use an autonumber field for a pk. But how do I normalize with an
autonumber pk? My guess is I pick a field to use as a "pseudo pk" when defining dependencies.
Let's say I follow the single field, autonumber pk philosophy. I'll
never have a composite pk and thus won't be concerned with 2NF, but will be concerned with columns that are not dependant upon the pk (or rather
the "pseudo pk") for 3NF normalization.
If I have an "Accounts" table, for example, I might have an
AcctNumber (Long) field and an Acct_ID (Autonumber) pk field. The Acct_ID is meaningless, so I'd have to ask, "What data is this table designed to store?" - easy enough: Account numbers. So when adding new fields I normalize to the AcctNumber field (whether it's indexed or not).
This means fields like Account Type and Creation Date might be added to the
table, but Customer Name and Telephone Number would go in a separate table.
Does this sound about right?
Thanks in advance for your comments.
deko wrote: I've heard it's best to have a meaningless primary key (such as an autonumber field) as opposed to a pk that contains volatile data. This sounds reasonable enough. In fact, I think I'd need a good reason *not* to use an autonumber field for a pk. But how do I normalize with an autonumber pk? My guess is I pick a field to use as a "pseudo pk" when defining dependencies.
Let's say I follow the single field, autonumber pk philosophy. I'll never have a composite pk and thus won't be concerned with 2NF, but will be concerned with columns that are not dependant upon the pk (or rather the "pseudo pk") for 3NF normalization.
If I have an "Accounts" table, for example, I might have an AcctNumber (Long) field and an Acct_ID (Autonumber) pk field. The Acct_ID is meaningless, so I'd have to ask, "What data is this table designed to store?" - easy enough: Account numbers. So when adding new fields I normalize to the AcctNumber field (whether it's indexed or not). This means fields like Account Type and Creation Date might be added to the table, but Customer Name and Telephone Number would go in a separate table.
Does this sound about right?
Sounds exactly right. The AcctNumber identifies the Account relation.
Everything in the Account relation should be dependent on the AcctNumber.
The Acct_ID autonumber is thrown in, not really as part of the
Account relation, but as a device to uniquely identify a physical
record stored by the database system.
> > Does this sound about right? Sounds exactly right. The AcctNumber identifies the Account relation.
I assume you're using the term relation in a generic sense - i.e. if I have
an Accounts table and a Transactions table you're *not* saying a
relationship should be established using the AcctNumber field.
Everything in the Account relation should be dependent on the AcctNumber.
Do you mean everything in the Accounts *table* should be dependent on the
AcctNumber?
What do you mean by "Account relation"?
The Acct_ID autonumber is thrown in, not really as part of the Account relation, but as a device to uniquely identify a physical record stored by the database system.
Yes, and relationships between tables (e.g. between Accounts and
Transactions) are built using the tblAccounts.Acc t_ID (one) and the foreign
key tblTransactions .Acct_ID (many).
As an aside, a foreign key is simply a field that is the "many" side of a
one-to-many relationship - is this correct?
deko wrote: Does this sound about right?
Sounds exactly right. The AcctNumber identifies the Account relation.
I assume you're using the term relation in a generic sense - i.e. if I have an Accounts table and a Transactions table you're *not* saying a relationship should be established using the AcctNumber field.
Right again. A relation is what more or less becomes the structure of a
normalized table. Everything in the Account relation should be dependent on the AcctNumber.
Do you mean everything in the Accounts *table* should be dependent on the AcctNumber? What do you mean by "Account relation"?
O.K. Just substitute table for relation. When you are deciding what
belongs in an Accounts table you don't decide that based on the fact
that an autonumber will identify the physical row in the database.
The concept of an Account does not include an autonumber that no
human will ever see. It includes an Account number that they will.
A bank check does not have the autonumber generated by the database
being used printed on it. You don't have to write your account
autonumber on the back of a third party check in order to cash it.
Account type is in the table because it denotes the type of account
AcctNumber identifies. Creation Date is in the table because it
establishes when the account identfied by AcctNumber was created.
The primary key of the Customer table is in the table because it
establishes a relationship to the customer that owns the account
identfied by AcctNumber. The Acct_ID autonumber is thrown in, not really as part of the Account relation, but as a device to uniquely identify a physical record stored by the database system.
Yes, and relationships between tables (e.g. between Accounts and Transactions) are built using the tblAccounts.Acc t_ID (one) and the foreign key tblTransactions .Acct_ID (many).
Right again. If you have decided to buy into the theory that all tables
that are going to be related to other tables should have an autonumber
primary key.
> >>>Does this sound about right? Sounds exactly right. The AcctNumber identifies the Account relation.
I assume you're using the term relation in a generic sense - i.e. if I
have an Accounts table and a Transactions table you're *not* saying a relationship should be established using the AcctNumber field.
Right again. A relation is what more or less becomes the structure of a normalized table.
Everything in the Account relation should be dependent on the
AcctNumber.
Do you mean everything in the Accounts *table* should be dependent on
the AcctNumber? What do you mean by "Account relation"?
O.K. Just substitute table for relation. When you are deciding what belongs in an Accounts table you don't decide that based on the fact that an autonumber will identify the physical row in the database. The concept of an Account does not include an autonumber that no human will ever see. It includes an Account number that they will. A bank check does not have the autonumber generated by the database being used printed on it. You don't have to write your account autonumber on the back of a third party check in order to cash it.
Account type is in the table because it denotes the type of account AcctNumber identifies. Creation Date is in the table because it establishes when the account identfied by AcctNumber was created. The primary key of the Customer table is in the table because it establishes a relationship to the customer that owns the account identfied by AcctNumber. The Acct_ID autonumber is thrown in, not really as part of the Account relation, but as a device to uniquely identify a physical record stored by the database system.
Yes, and relationships between tables (e.g. between Accounts and Transactions) are built using the tblAccounts.Acc t_ID (one) and the
foreign key tblTransactions .Acct_ID (many).
Right again. If you have decided to buy into the theory that all tables that are going to be related to other tables should have an autonumber primary key.
Sounds good. Thanks for the feedback! This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: SuryaPrakash Patel via SQLMonster.com |
last post by:
Dear All,
How to reach to the highest level of normalization for database designing?
Guide Lines Needed.
What will be the characteristics of a database of a completely normalized databae?
Check List needed.
|
by: Adrian |
last post by:
Normalization Question - Please bear with me, hopefully things will be
clear at the end of the question.
Given a treaty table containg treaties; Treaty1, Treaty2 etc and a
benefit table; Benefit1, Benefit2 etc. A treaty can only have certain
benefits:-
For example Treaty 1 can process Benefit1 and Benefit2.
To maintain this relationship a new table TreatyBenefit has been
|
by: John Welch |
last post by:
I have three tables and the way they are currently set up violates good
normalization, but I'm having trouble figuring out a better way. Can someone
suggest a more elegant solution?
My tables are:
tblCompanies:
CompanyID - PK
other fields like address, type of business, etc
|
by: MP |
last post by:
Greets,
context: vb6/ado/.mdb/jet 4.0 (no access)/sql
beginning learner, first database, planning stages
(I think the underlying question here is whether to normalize or not to
normalize this one data field - but i'm not sure)
:-)
Background info:
|
by: Richard Hollenbeck |
last post by:
I have a recipe database that I've been building but I haven't yet put any
of the ingredients in because of a little problem of normalization. If I
build a table of ingredients, all the recipes will have one or more
ingredient(s), but no set number of ingredients, so that doesn't seem
possible to normalize it. Any given recipe would use one, some, or all of
the ingredients within the ingredients table, so I can't imagine an
indefinite...
| |
by: No Spam Man |
last post by:
Hi,
I am not a programmer and in the past have only created very simple, flat
file databases. Although I'm a newbie, I think I could probably figure out
basic Boolean logic and financial functions.
The database I want to create would import quite a few records -- maybe as
many as 100,000. I would be importing them from an Internet source (comma
delimited) to my desktop so that I could manipulate the data how I wanted.
Despite the...
|
by: pbmods |
last post by:
Heya.
I'm adding features to a pre-existing project, and I was curious about the way I've been going about designing my database additions.
My methodology is to keep my stuff separate from the other guy's stuff as much as possible. That way, I know that if it breaks, it is definitely my code's fault (or at least, 85% of the time it is... who HIRES these people?!).
Likewise, on the database side, there's a pre-existing CMS in there, and...
|
by: weird0 |
last post by:
I know that is not the appropriate group for asking this question,
but I do not know of any better forum.
Can anyone plz explain clearly what normalization is? The first three
normal forms upto 3NF and BCNF. I know the first one but the remaining
ones are really confusing. The language changes dramatically into
functional dependencies x---y, all that, and normalization, the real
topic is lost in between.
Decent explanation or good...
|
by: Shravani |
last post by:
I've been assigned a task to carry out the following exercise using C
code:
Functional Dependencies & Normalization:
a. Specifying & testing Functional Dependencies on a relation
b. Normalization based on Functional Dependencies
c. Testing for lossless decomposition
d. Testing for dependency preservation
For this I've taken a books database that consists of the following
|
by: FooFighter |
last post by:
I was going to make a database to store a list of my DVD's. I have a question about the table structure though.
I want to have some fields for actors. I'm thinking 4 or 5 would be plenty. From what I understand it wouldn't be proper to have fields like Actor1 Actor2 and so on. As I would want to be able to search for a movie based on an actor, how would I structure my tables for this and keep things normalized? I was thinking perhaps another...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |