Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.databases.ms-sqlserver > #1691
| Newsgroups | comp.databases.ms-sqlserver |
|---|---|
| Date | 2014-02-19 13:43 -0800 |
| References | <le2d1u$ea1$1@dont-email.me> <XnsA2D9D7EC34F93Yazorman@127.0.0.1> |
| Message-ID | <cbe80d14-a145-41f9-bcee-1662a30d1915@googlegroups.com> (permalink) |
| Subject | Re: Is it really any point to have a relation in this example |
| From | rja.carnegie@gmail.com |
On Wednesday, 19 February 2014 20:13:33 UTC, Erland Sommarskog wrote: > Tony Johansson (johansson.andersson@telia.com) writes: > > In this example is it any point to create a separate table for warehouse. > > Is it just as good to store information such as current quantity for each > > flower that exist in the product table. > > > > I find it funny to have a table warehouse with just an Id without any more > > fields. > > Most likely the warehouse have other attributes like name, address, etc. > > But even we assume something that only has an ID, which in this case must > be a natural key, it should probably be a separate table, as a foreign-key > constraint to this table helps to restrict the possible values in the > column. If it's a book exercise, maybe they would have put in other columns, as you say, but they didn't bother to do it. If the business expands, it may have more than one warehouse (or greenhouse?) I suppose that until then, if there is only one, then you all know its address. But your database design is ready, except for not having those columns. We've also used a table with only one row and one column to hold an ID that we don't want to have merely as a table's automatic identity, although this may be unwise. I think it was about putting an exclusive lock on that until a transaction was complete.
Back to comp.databases.ms-sqlserver | Previous | Next — Previous in thread | Next in thread | Find similar
Is it really any point to have a relation in this example "Tony Johansson" <johansson.andersson@telia.com> - 2014-02-19 14:53 +0100
Re: Is it really any point to have a relation in this example Erland Sommarskog <esquel@sommarskog.se> - 2014-02-19 21:13 +0100
Re: Is it really any point to have a relation in this example rja.carnegie@gmail.com - 2014-02-19 13:43 -0800
Re: Is it really any point to have a relation in this example Gene Wirchenko <genew@telus.net> - 2014-02-20 09:49 -0800
csiph-web