T
Tom Ellison
Dear friends:
The Northwind database is a useful example of a database. It seems
sometimes to be an example of how NOT to do things, but that wouldn't be the
impression a beginning programmer might get. Perhaps you won't agree with
this, but that's the purpose of this post.
In this database, there are autonumber values as identity keys to Employees
and Orders that perform, effectively, as the Employee Number and the Order
Number. I would not consider this to be a preferred practice.
In a practical sense, this can cause problems.
Consider a business where there are several locations. At each location,
there are sales being made. Allow that some of these locations do not have
computers connected to the network. They must take orders and submit them
(by fax or mail perhaps). They would very probably have pre-numbered order
pads, with order numbers. These could be printed by the "main office" and
sent out. Thus, each sub office has an assigned sequence of order numbers.
Or, any salesman in the field would be taking orders on his order pad.
Barring some error in printing, these hand written orders would have an
Order Number assigned from the time they are hand written. As written,
Northwind doesn't permit such practice.
I'm preparing a set of Northwind back-end variants, both with and without
autonumber primary keys. I am strongly considering having an entered
OrderNumber and EmployeeNumber column in them. I'd like to do a
sufficiently good job that these variants could become examples much like
the existing Northwind has been, but demonstrating different approaches that
can be used. My hope is to have these be an excellent display of good
practices, so when I see something in the existing Northwind I do not like,
I'd like to bring it here for comments. Any alternatives that seem proper
may become part of one of these variants, so I'd appreciate your input.
Thanks, everyone.
Tom Ellison
The Northwind database is a useful example of a database. It seems
sometimes to be an example of how NOT to do things, but that wouldn't be the
impression a beginning programmer might get. Perhaps you won't agree with
this, but that's the purpose of this post.
In this database, there are autonumber values as identity keys to Employees
and Orders that perform, effectively, as the Employee Number and the Order
Number. I would not consider this to be a preferred practice.
In a practical sense, this can cause problems.
Consider a business where there are several locations. At each location,
there are sales being made. Allow that some of these locations do not have
computers connected to the network. They must take orders and submit them
(by fax or mail perhaps). They would very probably have pre-numbered order
pads, with order numbers. These could be printed by the "main office" and
sent out. Thus, each sub office has an assigned sequence of order numbers.
Or, any salesman in the field would be taking orders on his order pad.
Barring some error in printing, these hand written orders would have an
Order Number assigned from the time they are hand written. As written,
Northwind doesn't permit such practice.
I'm preparing a set of Northwind back-end variants, both with and without
autonumber primary keys. I am strongly considering having an entered
OrderNumber and EmployeeNumber column in them. I'd like to do a
sufficiently good job that these variants could become examples much like
the existing Northwind has been, but demonstrating different approaches that
can be used. My hope is to have these be an excellent display of good
practices, so when I see something in the existing Northwind I do not like,
I'd like to bring it here for comments. Any alternatives that seem proper
may become part of one of these variants, so I'd appreciate your input.
Thanks, everyone.
Tom Ellison