Difference between the 2 graphics

Assignment Help Programming Languages
Reference no: EM13948508

Read the article https://www.orafaq.com/articles/archives/000031.htm then answer the following questions:

1. Post a summary of the essential points in the article.
2. The author discusses "...three fundamental demands on the candidate keys that we must never deviate from, if it is to become the subject for a primary key." Do you agree with this statement? Justify answer.

Article:

Candidate keys: Choosing the right primary key
It is the business that has the knowledge about their entities (things of importance) and what kind of unique information that separate them (invoice numbers, customer IDs, and so on).
Your role as an analyst/designer is to validate such properties, and to fit them into a normalized database model that reflects the needs of the business.
During this, you will discover many candidate keys and issues concerning how primary keys should be defined. With wrong primary key decisions, chances are high that you will have a worse job in normalizing the database model, as well as achieve a high performing database in the end. (Read our separate eBook on database normalization.).
Three absolute demands on the candidate primary key, if it is to be regarded as a possible primary key.
There are three fundamental demands on the candidate keys that we must never deviate from, if it is to become the subject for a primary key:
1. The candidate key must be unique within its domain (the entity it represents, and beyond, if you also intend to
access external entities).
2. The candidate key can not hold NULL values (NULL is not zero. Zero is a number. NULL is 'nonexistent value').
3. The candidate key can never change. It must hold the same value for a given occurrence of an entity for the lifetime of that entity.
In 1., we say that the main purpose of the candidate key is to help us to identify one single row in a table, regardless of whether there exists billions of row. This sets high demands on the flexibility in terms of delivering uniqueness.
In 2., we say that a candidate key always, without exception, must hold a value. Without it, we break post 1.
In 3., we say that no matter what happens, inside our business or outside of it, we are not allowed to change the value of the candidate key. Adding an attribute (expanding) the candidate key, would pose a change. Some say that you should be able to change the primary key, and do a 'cascade update' to all underlying tables.
We will deal with that in a later chapter.
If the candidate key can withstand all these three demands, we have most likely identified our primary key. As we proceed in this eBook, we will keep these three demands in our minds.
You may also find interest in reading 'A Relational Model of Data for Large Shared Data Banks' by E.F. Codd himself (the founder/co-founder of the relational theory): A Relational Model of Data for Large Shared Data Banks
Notations in graphic examples.
Throughout this eBook, we will be using logical models; Entity Relationship diagrams, as well as physical models; what is called Server diagrams in Oracle Designer. We will also exemplify the different constructions with SELECT statements where appropriate. First, a few words about notation in the logical model:
Fig. 2:

In this figure, a # in front of an attribute means the attribute is (part of) the primary key. Likewise is the horizontal bar over the crow-foot in the drawing of the relationship between departments and accounts a sign that the primary key from departments is also a part of the primary key in the accounts entity. How smart that is, is a totally different issue: (ACCOUNTS is breaking 2nd Normal Form: Name is dependent on ACCOUNT_NO alone, not DEPT_ID).
A * in front of an attribute signs that this attribute is mandatory (always must have a value filled in), while an o in front of an attribute tells that it is optional to give the attribute a value. Likewise with the physical model:
Fig. 3:

Notice the difference between the two graphics: in the physical model in Fig.3, the relationship in Fig. 2 is incorporated in the accounts table. The relationship in Fig. 3 now indicates that there exists an unconditional constraint between the two tables: You are not allowed to enter a value into DEPT_ID in accounts if it doesn't exist in the departments table. The horizontal line above the crow-bar does not necessarily indicate participation in the primary key of that table: only the # tells you if a column is a part of the primary key.
By the way, Fig. numbers do not start at Fig. 1, because this is just an excerpt from the eBook. you can check it out here: Primary and Foreign Keys.
We have also used the plural form on entity names as well as table names. The normal is singular form for entities, and plural for tables. We have done this exception for reading purposes only.
Details on uniqueness
A primary key is, as stated earlier in post 1, a column, or a collection of columns, that together give us the ability to uniquely read one single row from a table, no matter how many rows that exists in that table. In the logical world this is just theory, but in the physical, we get into a lot of trouble if we are unable to do that.
Consider a simple example:
You want to give a 10% pay raise to your top DBA, John Wilson.
You do that by writing:
UPDATE EMPLOYEES
SET SALARY = SALARY * 1.1
WHERE NAME = 'John Wilson';
If you have two employees with that name, they both get a pay raise. Not exactly what you intended...
Names are very unlikely candidates for primary keys.
You need something unique, and names are not unique. Never.
Details on null values
In post 2, about not null values in a primary key: How can you identify something you don't know? This point should go without saying, but I bring it up, because, believe or not, I have read articles claiming that there exists the possibility of a weak primary key; meaning null values are allowed. Absolutely nonsense!
All meaning of the term primary key vanishes into thin air (or above). Most serious database systems will actually disclose your attempts and deny you to go further on that path, and with very good reason.
If you ever come across this situation, just defy it. It is a path of failure. Actually, it is a non-sense discussion.
Details on no change
Think about Africa. After 2. World War, and the end of colonialism, how many countries have changed their names? A more recent example: There is no longer a country called The Union of Soviet Socialist Republics; Today we call it Russia.
We even have standards for naming countries: the former Russia was known all over the world as USSR, and Russia is abbreviated as RUS today (or is it?). Look at these two fantastic tables:
Fig. 4: Country definitions from the United Nations

Fig:5: Another table of country definitions from the ISO standardization organization:

Isn't this great?
Western Samoa is abbreviated WSM in the United Nations, and it is abbreviated WS is ISO! It has even 3 identifiers in ISO; WS, WSM and 882!
Take a look at USSR (Sorry, RUS): In United Nations they call it RUS, while ISO use RUS, RU, 643, and on Internet it's .ru. But according to FIPS 10-4 it should be abbreviated RS! How can we identify a country by using standards from these helpful people?
If you do a search on Google for the term 'standard country codes' (without the quotes), you will find the sites for these two tables among the first ten hits. Do not go to the ISO page; they actually want you to walk around with a shopping cart and pay for it.
In fig.4, every column is a candidate key: No two countries have the same name or any other shortcuts of the name, but they differ all the same, if you put on a broader perspective: In ISO, the name is Russia and the (latest determined standard) abbreviation is RU; but in the United Nations, the name for the same country is Russian Federation,
and their abbreviation is RUS. Furthermore, in FIPS 10-4, the abbreviation is RS. Do they never meet to talk with each other?
Looking at it isolated, all columns in Fig. 5 are also candidate keys. But not if you want to match entries in Fig. 4 and Fig. 5.
Actually, I can find only one common denominator here: Both ISO and UN give Russia a common number: 643. Here is something to investigate. Are all the other abbreviations and names meant only for each organization, while they share the 643 number for identification? Have they been talking to each other, after all?
It should be clear by now that we cannot rely on any of the character columns in either organization: While each of them are candidate keys in their own world, we would soon get into trouble if we tried to use them to talk to all the world (that is, outside the scope of our little application).
As you can see, defining (or choosing) the right primary keys is not necessarily a simple, straight-forward task.
--

How about another case:
You are a manufacturer, and one of your customers places an order on behalf of his customer, asking you to use his customer's customer number as identification: How long will it take before another of your customers does the same, and by sheer coincidence, they supply you with the same id (let us say cust_no 1000), but they are totally different companies?
You will have to organize your system in such a way that you can uniquely identify all information going into the system, regardless of external systems, and regardless of external changes. That's the bottom line: You have to make the primary key foolproof.

Reference no: EM13948508

Questions Cloud

Describe the problem and present the data : The financial team has assembled to review labor data for a new engine. Designed for efficiency, the new engine's power to weight ratio and low drag geometry promised great things. Dashiell kicked off the meeting. "Folks, this is radical. For the ..
Convenient way to document a system events : A use case is a convenient way to document a system's events. It serves as a kind of table of contents for the business events and activities that must be supported by the system. It will be used to identify how the system will be used and which a..
Did the business show a negative cash balance for june : Did the business show a negative cash balance for June? Assuming that the owner has no hope of establishing a line of credit for the business, what recommendations would you give the owner for dealing with a negative cash balance?
Determine the speed and direction of the wind : A car is traveling north along a straight road  at 50 km>h. An instrument in the car indicates that the wind is coming from the east. If the car's speed is 80 km>h, the instrument indicates that the wind is coming from the northeast. Determine the..
Difference between the 2 graphics : It is the business that has the knowledge about their entities (things of importance) and what kind of unique information that separate them (invoice numbers, customer IDs, and so on).
Determine velocity and acceleration of end of cord : The cord is attached to the pin at C and passes over the two pulleys at A and D. The pulley at A is attached to the smooth collar that travels along the vertical rod. Determine the velocity and acceleration of the end of the cord at B if at the ins..
What is the population mean you are trying to estimate : Suppose you are trying to estimate the average miles per gallon for a new brand of car. You take a random sample of 40 cars, and, for this sample, the average miles per gallon is 32 and the standard deviation for this sample is 2.2. Answer the fol..
Coefficient of restitution between block and rod : A 2-lb block, sliding on a smooth horizontal surface with a velocity of 12 ft> s, strikes the rod at its end B. Determine the velocity of the block immediately after the collision. The coefficient of restitution between the block and the rod at B i..
What is the budget for the inspection activity : Suppose that Olsen budgets 50,000 units for production for the coming year. What is the budget for the inspection activity? Now assume that the budget is 60,000 units. Prepare a budget for inspection for this level of activity.

Reviews

Write a Review

Programming Languages Questions & Answers

  How do we convert string values from keyboard to numeric

Let's discuss how to use the Java I/O classes such as the system and the scanner classes to do console IO and the JOptionPane class to do dialog based IO. How do we convert string values from keyboard to numeric values

  Program to retrieve records based on last name-first name

Customer service representatives wish to be able to retrieve records based on Last Name + First Name, Product Number, or State fields. Write down steps involved in your analysis of this problem?

  Pseudocode that will generate reports from data files

Develop a mock-up of each of these reports, and get customer approval of these mock-ups. Write pseudo code that will generate these reports from the data files, using a CASE tool;

  Produce a store procedure to accept parameters

Produce a store procedure named spBalanceRange which accepts three optional parameters. Procedure returns the result set consisting of VendorName,

  Ruby program that continuously reads in number

Write down Ruby program that continuously reads in number, x, from screen, and then calculates and displays its: factorial, if x is less than 15.

  Develop a c# console application that compute pythogorus

Develop a C# console application that computes the hypotenuse of a right triangle

  Classifications and descriptions information to enter record

Use the Job classifications and descriptions information to enter records into the Job Title table for the following titles:

  Write down a program that will predict the size of a

write a program that will predict the size of a population of organisms. the program should ask for the starting number

  Use one-dimensional array to read in twenty numbers

Use the one-dimensional array to solve problem: Read in 20 numbers, each of which is between 10 and 100. As each number is read, print it only if it is not duplicate of number which has already been read.

  In software engineering one can find out different life

in software engineering one can find various life cycle models. some examples include the waterfall model agile

  Fortran-77 to sort an array of numbers entered

Write a program in Fortran-77 to sort an array of numbers entered from the keyboard and then using binary search, search for a number in the array.

  Program to ask how many games are being purchased

Your program should ask the store clerk how many games are being purchased and calculate a total due (with 6% tax). The total number of games, the discount amount.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd