﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Tom Thomson  / Second Normal Form / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 22 May 2013 18:08:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]David Portas (7/17/2011)[/b][hr]I think it is important to be clear on definitions given what you said in your previous article about 1NF permitting nulls. If a reader mistakenly thinks that 2NF and other normal forms apply equally well to a table with nulls as to a table without them then they may want to know what a functional dependency means in a table with nulls.[/quote]Actually I think it is far more important to explain the fundamental underlying concept - that the business rules so constrain values that knowing values for some attributes guarantees that you also know the values for some others - than to mess about with the mathematical abstraction "functional dependency", which has no meaning at all to almost everyone involved in database development.  That underlying concept is what matters in the real world of database design.  You may be one of those people who think better in terms of mathematical abstractions than in terms of the real world phenomena they model - if so, you are not part of the audience I was writing for.  I don't want to tell my audience that they have to learn a lot of pure mathematics to understand normalisation (which is NOT part of relational theory, but part of real world database design).  Nor do I want to arrive at a situation where my audience ends up, by the end of the article series, foolishly believing that maximum decomposition is more imprtant than accurate representation (so you'll really hate at least one of the later articles in the series).  Nor do I want my audience to believe that normalisation can't be applied to their real-world databases where missing values are inevitable so they have NULLs, because that would deprive them of a valuable tool-kit for improving their schema designs.  Perhaps you will understand my position better if I use an analogy: "look, we want to keep the baby - so be careful when you discard the bathwater"?  While "permit NULL only when it is absolutely necessary (and be extremely sure that it really is absolutely necessary)" is a good rule that every schema designer should follow, "forbid NULL everywhere" is nonsense perfectionism (at least until we have better ideas for NULL elimination - a research topic which anti-NULL purists have ignored ever since Date's bizarre "default values will always work in place of NULL" idea) of the same order as "make all your schemas conform to DKNF" (which is, as Date pointed out [url=http://www.dbdebunk.com/page/page/621935.htm][i]here, starting about 20 lines down[/i][/url], provably impossible in many practical cases; in fact we don't even approach understanding where it is possible).[quote]I will take Codd's word for it when he says "The concepts and rules of functional dependence, multi-valued dependence, and join dependence were all developed without considering missing db-values. All the normal forms based on these dependencies were also developed without considering missing dbvalues."[1]. Whether or not nulls were actually in his mind at the time, he chose to leave them out of what he published. Codd's goes on to say:[quote]"the normalization concepts do NOT apply, and should NOT be applied, globally to those combinations of attributes and tuples containing [null] marks. Instead, they should be applied [...] to a conceptual version of the database in which tuples containing missing-but-applicable information in the pertinent attributes have been removed"[/quote][/quote][quote]I don't mean to imply that I agree wtih Codd's view. I think it's a terrible suggestion. It completely ignores the very real possibility that the kind of redundancy and resulting anomalies which the NFs were designed to eliminate can also occur when some rows include nulls. What bothers me is that you didn't mention either this or any other strategy for dealing with the nulls that you say you want to permit. Your readers are left in the dark about it.[/quote]Then what do you mean to imply?  That I should provide about 16000 words of abstruse mathematics to demonstrate the several ways (one of which is the way Codd mentioned and you apparently failed to notice in the quotation you used - you apparently also failed to notice that the informal approach in the article exactly followed that way except for an insistence on banning NULL in all prime attributes, which I think Codd probably intended although he didn't actually mention it that sentence) in which the formal theory can be adapted, instead of sticking to the actual design issues that the formal theory is intended to deal with and model?  When I was very young I might have taken that approach - I was a pure mathematician - but since then I have become an applied mathematican/computer scientist/engineer and gained experience by applying and teaching people to apply mathematics in industry; this has taught me that going back to the real world things that are being modelled and talking about them is where I need to be if I want to teach effectively.  It has also taught me that I understand the mathematics much better and have far more insight into the abstract theory if I approach it that practical way.  Anyway, I don't think it's useful to try to hijack this discussion (as you have successfully hijacked others) into a debate on whether NULL is a bad thing.  We know it's a bad thing.  That it's also a necessary thing is something that is unfortunate, and it's even more unfortunate that some people can't accept that we must live with that necessity.</description><pubDate>Sun, 17 Jul 2011 14:22:12 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]Tom.Thomson (7/14/2011)[/b][hr]That's sort of true.  But Occam's razor is a useful tool when trying to present things in a simple manner, and what a functional dependency is all about is that some values are fixed by some other values; at least I hope that's what you mean by a functional dependency (it's what every academic paper I've read that contained the term used it for).[/quote]I think it is important to be clear on definitions given what you said in your previous article about 1NF permitting nulls. If a reader mistakenly thinks that 2NF and other normal forms apply equally well to a table with nulls as to a table without them then they may want to know what a functional dependency means in a table with nulls. The concept of functional dependency was developed without considering the impact of nulls and I think that pretty much every other text I've read on the topic excludes the possibility of nulls being part of any FD. You have opened the door to nulls in your first article but now you seem to be ignoring the consequences.[quote]It's important to remember that Codd and Heath were discussing NULL (not two different NULLs, just one) way back when they were preparing their early papers on normalisation, so that it is extremely unlikely that NULLs weren't considered at all.[/quote]I will take Codd's word for it when he says "The concepts and rules of functional dependence, multi-valued dependence, and join dependence were all developed without considering missing db-values. All the normal forms based on these dependencies were also developed without considering missing dbvalues."[1]. Whether or not nulls were actually in his mind at the time, he chose to leave them out of what he published. Codd goes on to say:[quote]"the normalization concepts do NOT apply, and should NOT be applied, globally to those combinations of attributes and tuples containing [null] marks. Instead, they should be applied [...] to a conceptual version of the database in which tuples containing missing-but-applicable information in the pertinent attributes have been removed"[/quote][1] Missing Informatlon (Applicable and Inapplicable) in Relational Databases, SIGMOD RECORD, Vol. 15, No. 4, December 1986So despite what you say, in Codd's view 2NF [i]does[/i] exclude nulls. You haven't said in your article that 2NF applies only to a version of a database without nulls but you haven't suggested any alternative way of evaluating 2NF for a database [i]with[/i] nulls either.I don't mean to imply that I agree wtih Codd's view. I think it's a terrible suggestion. It completely ignores the very real possibility that the kind of redundancy and resulting anomalies which the NFs were designed to eliminate can also occur when some rows include nulls. What bothers me is that you didn't mention either this or any other strategy for dealing with the nulls that you say you want to permit. Your readers are left in the dark about it.[quote]Just a fortnight ago one of you anti-NULL purists was claiming that there was no such term as "primary key" in relational theory, only in SQL! (Complete nonsense, as you will agree.)I think most people will understand that I used "the primary key" in the sense used in the paper which introduced the relational model to the world - it is a primary key that has been chosen to be "the" primary key as opposed to just "a" primary key and it is a perfectly sensible description of a candidate key to say that it is something that can be so chosen, both because that's why the word "candidate" is there - a candidate is something that can be chosen (whether by fate, by a schema designer, or otherwise) and since the term "candidate key" was in fact introduced as a replacement for "primary key" rather later. The concept of superkey is of course completely superfluous.[/quote]Sure, but the science and the language have moved on since Codd used the term "primary key". Almost no-one today uses that phrase to refer to any or all keys of a relation and using it to mean just one key is completely redundant in a discussion about normalization.If the person you mentioned was confused about primary keys then I'm not surprised and he's not the only one. In the previous 1NF article discussion you said "SQL has a restriction that there can be only one primary key". Taken literally that statement is obviously untrue. By expecting us to guess each time whether you mean "the primary key" or "a primary key" you are committing the same linguistic folly that Codd did. Please let's leave "primary" keys out of a discussion about normal forms.</description><pubDate>Sun, 17 Jul 2011 12:59:18 GMT</pubDate><dc:creator>sqlvogel</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote] Look at Esteban Zimányi's 2006 paper "Temporal Aggregates and Temporal Universal Quantiﬁcation in Standard SQL" (available on pages 16 to 25 of [url=http://www.sigmod.org/publications/sigmod-record/0606/sigmod-record.june2006.pdf][i]this pdf doc[/i][/url], or get hold of the book "Temporal Data and the Relational Model" by Date, Darwen and Lorentzos if you are heavily into data warehousing with history requirements.  For a brief discussion the normal form level of some table types that may be useful there is [url=http://www.anchormodeling.com/wp-content/uploads/2010/08/6nf.pdf][i]this[/i][/url] but be warned it's aimed at showing that their chosen table forms are all in 6NF, rather than showing how to do anything useful with them; but if you like it, or the tables it describes, you may want to read up on anchor modelling more generally.[/quote]Thanks a lot Mr. Thomson...I have learned some new things about database design like Temporal Data and 6th Normal Form. I have downloaded your suggested papers and also I managed to get the Date's Book "Temporal Data and the Relational Model". I have started reading all about temporal data and I am very excited to know this new terminology (at least for me it is new). Thanks a lot to add some new things into my knowledge horizon :)</description><pubDate>Sat, 16 Jul 2011 00:36:56 GMT</pubDate><dc:creator>fazalkhansb</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Good post ... although I must say that the first paragraph has no learning value, but it does establish your 'geek credentials' ;-)One informal analogy I use when thinking about 2NF is 'being on subject', or 'topicality':Tables store data about things, and that thing, or 'topic' or 'subject', should be as narrowly defined as possible. Ideally, the table name should tersely convey this topic. You can then ask the question 'is this field topical to the table?' or 'is it on subject?'. In your example, when viewing 'Current_Assignment' as a topic name, it becomes clear that fields 'PayGrade' and 'YearsInGrade' aren't topical: they belong to the employee, and don't add anything to the subject of 'projects employees are assigned to'. A candidate key then becomes a minimal set of facts required to say something truly unique about the topic. If your candidate key is 'Employee and Project', then again it becomes clear that saying something about just the employee adds nothing new to the topic of project assignments.</description><pubDate>Fri, 15 Jul 2011 09:38:35 GMT</pubDate><dc:creator>kismert</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote]Look at Esteban Zimányi's 2006 paper "Temporal Aggregates and Temporal Universal Quantiﬁcation in Standard SQL" (available on pages 16 to 25 of [url=http://www.sigmod.org/publications/sigmod-record/0606/sigmod-record.june2006.pdf][i]this pdf doc[/i][/url], ...[/quote]Wow that's great...thanks for the link Tom. George</description><pubDate>Fri, 15 Jul 2011 05:18:54 GMT</pubDate><dc:creator>George H.</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]fazalkhansb (7/15/2011)[/b][hr]Greate article and the disscussion about historical data, here I am going to say something and need your help. [quote]I would also add effectiveStartDate and effectiveEndDate fields to the PayGrade_Details table so that you could see that Charlie Fixit spent 3 years at paygrade 12 and then got bumped up to paygrade 13 and when it happened. Then I would just grab the paygrade record whose start date/end date falls within the proper date range that I need...I'm not sure if that is the correct way to do it or what NF that is but that's the way I've been doing it[/quote]I am also doing this fromdate/todate technique to store historical data, but I am not sure that this is the good one to do this... In this particular way we need to keep NULL value or any predefined default value into 'todate' column untill the row is treated as the current... please advice any other way to mange the historical data...[quote]I could also use a historical or archive paygrade table and move the old records into that table when they are changed...but I'm not sure which way is the recognized "proper" way to do it.[/quote]I haven't try it till now, I think it could be better than first one. because there is no NULL value stored here......Thanks[/quote]As I said in an earlier message, this is an area where my experience is limited.  You can choose to  distinguish historical and current data either by the historical data in a separate table (which complicates the introduction of a new value - the old one has to be moved) or by not recording the end date at all because it is redundant - the previous value's reign ends when the next value begins (but then you have to be wary of performance - watch out for "triangular joins") or by using a special value (or NULL, but that's usually not a good idea) for the end date to distinguish current data (that may be the best option - but don't use a date anywhere in the feasible lifetime of your database as that special value).  Look at Esteban Zimányi's 2006 paper "Temporal Aggregates and Temporal Universal Quantiﬁcation in Standard SQL" (available on pages 16 to 25 of [url=http://www.sigmod.org/publications/sigmod-record/0606/sigmod-record.june2006.pdf][i]this pdf doc[/i][/url], or get hold of the book "Temporal Data and the Relational Model" by Date, Darwen and Lorentzos if you are heavily into data warehousing with history requirements.  For a brief discussion the normal form level of some table types that may be useful there is [url=http://www.anchormodeling.com/wp-content/uploads/2010/08/6nf.pdf][i]this[/i][/url] but be warned it's aimed at showing that their chosen table forms are all in 6NF, rather than showing how to do anything useful with them; but if you like it, or the tables it describes, you may want to read up on anchor modelling more generally.</description><pubDate>Fri, 15 Jul 2011 03:29:50 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Greate article and the disscussion about historical data, here I am going to say something and need your help. [quote]I would also add effectiveStartDate and effectiveEndDate fields to the PayGrade_Details table so that you could see that Charlie Fixit spent 3 years at paygrade 12 and then got bumped up to paygrade 13 and when it happened. Then I would just grab the paygrade record whose start date/end date falls within the proper date range that I need...I'm not sure if that is the correct way to do it or what NF that is but that's the way I've been doing it[/quote]I am also doing this fromdate/todate technique to store historical data, but I am not sure that this is the good one to do this... In this particular way we need to keep NULL value or any predefined default value into 'todate' column untill the row is treated as the current... please advice any other way to mange the historical data...[quote]I could also use a historical or archive paygrade table and move the old records into that table when they are changed...but I'm not sure which way is the recognized "proper" way to do it.[/quote]I haven't try it till now, I think it could be better than first one. because there is no NULL value stored here......Thanks,</description><pubDate>Fri, 15 Jul 2011 01:42:12 GMT</pubDate><dc:creator>fazalkhansb</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]Jan Van der Eecken (7/14/2011)[/b][hr]Hi Tom,Again a nice article, and looking forward to 3NF. Are you contemplating going to go any further than that?[/quote]I'm planning/hoping to do three articles after the 3NF one: one on normal forms intermediate between 3NF and 4NF and how the representation principle may get violated somewhere in that space (which is perhaps the most important article in the series, because understanding the representation principle in its various forms is the core concept of normalisation), one on 4NF and one on 5NF which will probably include a definition of 6NF but certainly no examples of 6NF (that will be Date's 6NF, not Fagin's 6NF - Fagin's 6NF aka DKNF may get a mention in the representation principle article, or not, depending on how I work the article out).[quote]Just one question, further above in the discussion you mention Bernstein's Algorithm. Never heard of that, and a (rather quick) search on Google didn't yield any useful results. Could you elaborate a little bit on that?[/quote]The article describing the algorithm was published in ACM ToDS 1/4 (December 1976) beginning at page 277, the author was P.A.Bernstein and it was titled "Synthesizing Third Normal Form relations from functional dependencies"; I don't know of any way of getting it without paying the ACM (they deserved paymenty for the original publication, but given that they are a learned society and that ToDSis supposed to be a genuine technical joyrnal I think that this long afterwards http://www.gnu.org/philosophy/right-to-read.html is relevant).  A related article is "A New Normal Form for the Design of Relational Database Schemata" by Carlo Zaniolo, in ACM ToDS 7/3 (Sept 1982), which is available without charge somewhere on the web (I'll not say where, in case the US copyright mafia sue me - stating facts is now a serious act entailing punitive damages in American law, and since it is also classified in the USA as a criminal offence and we have a crazy extradition treaty with the US the lunatics in charge of the US Asylum can extradite Brits from Britain for offenses committed in Europe against US law which are perfectly legal acts in Europe).</description><pubDate>Thu, 14 Jul 2011 18:47:58 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Hi Tom,Again a nice article, and looking forward to 3NF. Are you contemplating going to go any further than that?Just one question, further above in the discussion you mention Bernstein's Algorithm. Never heard of that, and a (rather quick) search on Google didn't yield any useful results. Could you elaborate a little bit on that?Regards,Jan</description><pubDate>Thu, 14 Jul 2011 15:02:03 GMT</pubDate><dc:creator>Jan Van der Eecken</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]Tom.Thomson (7/14/2011)[/b][hr][quote][b]Lempster (7/14/2011)[/b][hr]I must admit that I got a bit lost by the description in your first paragraph, but the example that you gave made it clear and confirmed to me that 2NF was what I thought it was - phew!Thanks very much, looking forward to 3NF and beyond...[/quote]Thanks for that.I should have used a betterl description (the form of words I used was pretty poor).  Something like "If X is a set of prime attributes and A is a non-prime attribute and the value of A is determined by the values of X then X contains the whole of at least one candidate key".  Your comment made me read that first paragraph again and I found it confusing me this time and I'm not sure what I wrote is actually right (it looks a bit too much like a definition of 3NF).EDIT: I provided Steve with new text for the definition and it is now incorporated in teh article.  Thanks' Lemperer, for helping make this a better article.[/quote]TOM: I have never seen 2NF explained without a VIN diagram or a Set Diagram before.  Not Bad. Mere mortals might have grasped this faster with a Set diagram, but the examples and descriptions taught the reader what this is in Data Relation theory, not Set math.  NICE! :cool:</description><pubDate>Thu, 14 Jul 2011 12:26:42 GMT</pubDate><dc:creator>SanDroid</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]Smendle (7/14/2011)[/b][hr]Great article, didnt read any previous articles before (assuming you started at 1).  It should be noted that with any production DB system, even one that seems simple, changing it to conform to DB Normalization rules will create a lot of other work like fixing queries against said DB, reports will be broken, space will increase etc...[/quote]That's why you should try to do all the normalisation while designing the schema, before writing code for queries and reports.Peronally I recommend that when you have a rough schema design you list all the business rules that you would like the schema to enforce for you without requiring code to do it, express those rules as functional dependencies where you can do so, and then use Bernsteins algorithm to derive a schema which conforms to 3NF (actually it will conform to EKNF, which is better than 3NF, even though Bernstein was only targetting 3NF when he designed the algorithm).  Check and make sure that all business rules are now covered by key constraints (which will involve adding NOT NULL constraints, UNIQUE constraints, and Foreign Key constraints as needed - it may also involve adding some auxiliary tables if any of the weird cases for which BCNF was intended exist: this is usually a better bet than actually going to BCNF, since in those cases BCNF can't enforce all the functional dependencies, while EKNF can if you add the auxiliary tables). Then look at any business rules which couldn't be expressed as functional dependencies: if you didn't have to add auxiliary tables to enforce FDs without going to BCNF, you can normalise to 4NF to get a schema which enforces any business rules expressed as multivalued dependencies as well as those expressed as functional dependencies; or if you are lucky you may find that the multi-valued dependencies have no impact on the bits of the schema that needed the auxiliary tables, so you can enforce the multi-valued dependencies by taking the other parts of the schema to 4NF (there is no easy way like Bernstein's algorithm to get to 4NF - or even to BCNF -  so this is a bit of a slog).  At worst you will end up with an EKNF schema with bits of it in 4NF and some bits not in 4NF, and there the only advice I can offer is to examine each unenforced multi-valued dependency very carefully and decide whether to enforce it (taking another part of the schema to 4NF but losing some enforcement of simple FDs) or not - either way you will need code (either a good stored procedure-based interface with no direct access from the application to tables and views, only to SPs, or a set of triggers) to enforce the business rules that the key constraints can't enforce (obviously check constraints can help sometimes, but they can't do the whole job); then look and see if any of your tables have any non-trivial join dependencies, and if so are they implied by the candidate keys or not; if there are any not implied by the candidate keys, you may want to split those tables (ie go to 5NF) - but as with the MVDs, there can be a trade-off here, since the split may lose enforcement of FDs (and you may find that the number of tables involved in joins is getting too big, potentially making the code hard to understand).  If you want to have a lot of time-dependent information - lots of things have values associated with a period in time, and you want to retain all the history - you may want to elimainate all non-trivial dependencies (go to 6NF) but I can't offer any advice there, it's not within my field of competence.Anyway, once you've done all that hard work of schema design, always being sure to allow as much flexibility as possible since the business rules may change next week (or next year, or whenever) you will find it's enormously easier to write simple and bug-free code than if you hadn't done it.  If you just throw something together without any thought for normalisation you will find that you get some very complex code, and probably find it hard to maintain, hard to emhance, and discover that you need to normalise to survive - but it is now much harder that it was up front.</description><pubDate>Thu, 14 Jul 2011 10:34:03 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]Smendle (7/14/2011)[/b][hr]Great article, didnt read any previous articles before (assuming you started at 1).  It should be noted that with any production DB system, even one that seems simple, changing it to conform to DB Normalization rules will create a lot of other work like fixing queries against said DB, reports will be broken, space will increase etc...[/quote]True. However to play devil's advocate:  - the report is already "broken" since it (potentially) returns bad data.  - space usage would likely DECREASE, since you're not duplicating all of the employee-dependent data.It's definitively a non-trivial task to do this after the fact, but - there is a gain to be found in there.</description><pubDate>Thu, 14 Jul 2011 09:40:49 GMT</pubDate><dc:creator>Matt Miller (#4)</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Great article, didnt read any previous articles before (assuming you started at 1).  It should be noted that with any production DB system, even one that seems simple, changing it to conform to DB Normalization rules will create a lot of other work like fixing queries against said DB, reports will be broken, space will increase etc...</description><pubDate>Thu, 14 Jul 2011 07:55:12 GMT</pubDate><dc:creator>Smendle</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Great Post....</description><pubDate>Thu, 14 Jul 2011 07:35:25 GMT</pubDate><dc:creator>chakrirajini</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Tom,Great article...although I too was a little lost by the first paragraph but your example made it clear.I would also add effectiveStartDate and effectiveEndDate fields to the PayGrade_Details table so that you could see that Charlie Fixit spent 3 years at paygrade 12 and then got bumped up to paygrade 13 and when it happened. Then I would just grab the paygrade record whose start date/end date falls within the proper date range that I need...I'm not sure if that is the correct way to do it or what NF that is but that's the way I've been doing itThat way I can pull historical reports...I guess I could also use a historical or archive paygrade table and move the old records into that table when they are changed...but I'm not sure which way is the recognized "proper" way to do it.But I digress...Thanks, George</description><pubDate>Thu, 14 Jul 2011 05:20:06 GMT</pubDate><dc:creator>George H.</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]David Portas (7/14/2011)[/b][hr]The author's point about A being "fixed by" the values of X presumably means a [i]functional dependency[/i] of the form X-&amp;gt;A. Functional dependencies are the basis of 2NF. [/quote]That's sort of true.  But Occam's razor is a useful tool when trying to present things in a simple manner, and what a functional dependency is all about is that some values are fixed by some other values; at least I hope that's what you mean by a functional dependency (it's what every academic paper I've read that contained the term used it for).If I were intending to write about formal theory rather that something useful for practical database people, I would of course treat FDs as a special case of MVFDs (an FD is an MVFD where the range value set is a singleton) and then for 2NF (and 3NF too) discuss only a special case of FDs (where the range domain is a 1-tuple).  I don't think that would be much use to most of the SQLServerCentral audience, who are practitioners not theorists.[quote]It 's important to remember that the concept of functional dependency was developed without regard for nulls and it is an assumption of 2NF (and 3NF, BCNF, etc) that relations consist only of values and not nulls.[/quote]It's important to remember that Codd and Heath were discussing NULL (not two different NULLs, just one) way back when they were preparing their early papers on normalisation, so that it is extremely unlikely that NULLs weren't considered at all.  They didn't work out the effect of nulls on normalisation at that point - which is why Codd later wrote that their introduction had meant that the normalisation had had to be revisited - but certainly there are no grounds now, three decades after NULLs were first proposed, for claiming that relational theory has no room for them or that 2NF, 3NF, BCNF and etc (presumably "etc" means EKNF, 4NF, various 5NFs, DKNF and Date's 6NF) exclude them (for example, if 5NF had been intended to exclude NULL, the paper introducing it would have said so - its author, Ron Fagin, was working with Codd and had just reviewed Codd's RM-T and "...Capture more Meaning" papers for him, so he certainly knew all about NULLs. For 6NF, I imagine Date did intend that NULL be forbidden - but that's the only one I believe does exclude NULL.[quote]The definition of a candidate key as a set of columns that "could reasonably be used as the primary key" is a bit strange. A candidate key is quite precisely a minimal superkey. There is no difference at all between a candidate key and a primary key (or even "the" primary key) so I'm not sure what is meant by a "reasonable choice" in that context. It's a pity the explanation of candidate keys isn't spelt out more clearly because it is very often a point of confusion for some people.[/quote]Just a fortnight ago one of you anti-NULL purists was claiming that there was no such term as "primary key" in relational theory, only in SQL! (Complete nonsense, as you will agree.)I think most people will understand that I used "the primary key" in the sense used in the paper which introduced the relational model to the world - it is a primary key that has been chosen to be "the" primary key as opposed to just "a" primary key and it is a perfectly sensible description of a candidate key to say that it is something that can be so chosen, both because that's why the word "candidate" is there - a candidate is something that can be chosen (whether by fate, by a schema designer, or otherwise) and since the term "candidate key" was in fact introduced as a replacement for "primary key" rather later.  The concept of superkey is of course completely superfluous.</description><pubDate>Thu, 14 Jul 2011 05:05:01 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Nice article, thanks Tom.Looking forward to the rest of the series.</description><pubDate>Thu, 14 Jul 2011 04:52:55 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]martin-1049293 (7/14/2011)[/b][hr]Great explanation - however in this case I think you would agree it would be prudent to strre the Rate_Applying and Years_Applying in the Current Assignment table to prevent them being implicitly changed retrospectively when they were changed in the PayGradeDetails table. This appears to be a violation but is essential to retain correct data over time.[/quote]I think I would keep the rate history for each person in the PayGradeDetails table, and assignment history in a third table, if there was any question of trying to reconstruct historical charges.  But the ability to do historical reconstructions is non-trivial, and doing it safely requires extra normalisation.Of course concern for time-dependent data is what led Chris Date to invent his version of 6NF, and maybe one day there will be an SQL Server Central article on that (if there is it won't be written by me - I have no practical experience of using 6NF, so it's just theory to me, and I don't believe people should write articles on parts of normalisation that they have no practical knowledge of).</description><pubDate>Thu, 14 Jul 2011 02:49:41 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>The author's point about A being "fixed by" the values of X presumably means a [i]functional dependency[/i] of the form X-&amp;gt;A. Functional dependencies are the basis of 2NF. It 's important to remember that the concept of functional dependency was developed without regard for nulls and it is an assumption of 2NF (and 3NF, BCNF, etc) that relations consist only of values and not nulls.The definition of a candidate key as a set of columns that "could reasonably be used as the primary key" is a bit strange. A candidate key is quite precisely a minimal superkey. There is no difference at all between a candidate key and a primary key (or even "the" primary key) so I'm not sure what is meant by a "reasonable choice" in that context. It's a pity the explanation of candidate keys isn't spelt out more clearly because it is very often a point of confusion for some people.</description><pubDate>Thu, 14 Jul 2011 02:41:22 GMT</pubDate><dc:creator>sqlvogel</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>[quote][b]Lempster (7/14/2011)[/b][hr]I must admit that I got a bit lost by the description in your first paragraph, but the example that you gave made it clear and confirmed to me that 2NF was what I thought it was - phew!Thanks very much, looking forward to 3NF and beyond...[/quote]Thanks for that.I should have used a betterl description (the form of words I used was pretty poor).  Something like "If X is a set of prime attributes and A is a non-prime attribute and the value of A is determined by the values of X then X contains the whole of at least one candidate key".  Your comment made me read that first paragraph again and I found it confusing me this time and I'm not sure what I wrote is actually right (it looks a bit too much like a definition of 3NF).EDIT: I provided Steve with new text for the definition and it is now incorporated in teh article.  Thanks' Lemperer, for helping make this a better article.</description><pubDate>Thu, 14 Jul 2011 02:38:34 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>I must admit that I got a bit lost by the description in your first paragraph, but the example that you gave made it clear and confirmed to me that 2NF was what I thought it was - phew!Thanks very much, looking forward to 3NF and beyond...</description><pubDate>Thu, 14 Jul 2011 01:48:52 GMT</pubDate><dc:creator>Lempster</dc:creator></item><item><title>RE: Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Great explanation - however in this case I think you would agree it would be prudent to strre the Rate_Applying and Years_Applying in the Current Assignment table to prevent them being implicitly changed retrospectively when they were changed in the PayGradeDetails table. This appears to be a violation but is essential to retain correct data over time.</description><pubDate>Thu, 14 Jul 2011 01:27:20 GMT</pubDate><dc:creator>martin-1049293</dc:creator></item><item><title>Second Normal Form</title><link>http://www.sqlservercentral.com/Forums/Topic1141462-2681-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/articles/Normalization/74381/"&gt;Second Normal Form&lt;/A&gt;[/B]</description><pubDate>Wed, 13 Jul 2011 21:20:41 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item></channel></rss>