At 03:31 PM 01/09/2002 +0000, you wrote:
>My only work with databases is through ColdFusion, largely
>Access.
>
>In designing the tables, Access forces you to define a Primary
>Key, but I've only ever used the Relationships view where
>you define the actual relationships for visualisation purposes.
>Most of the sites I've done have been relatively straight-
>forward, and even though to start with I made myself draw
>up table schemas to get the relationships right, I can usually
>just run DB designs off without too much planning now.
>
>I always saw the relationships defined *in Access* as being
>only relevant to people using the DB with a front-end
>designed in Access itself. I deal with all constraints and so
>on via the CF code, validating forms, etc.

  I have come across quite a few systems that do this.  In almost all 
cases, data integrity was not preserved and invalid data relationships 
existed.  For example, often a table will contain a foreign key relating to 
data that does not exist.  It complicates things greatly when the 
application (and database structure) must be re-worked to meet new needs.


>However, I've just got round to creating tables via SQL,
>and studying the syntax for this I've wondered if specifying
>constraints, keys, etc., for explicit definition in the structure
>of the DB is necessary...
>
>Is it best to do it, but not essential for small apps with
>good form validation? What are the problems involved if
>you just create a table with the datatypes and defaults,
>no constraints?

  I would never recommend creating a database without specifying the 
constraints.  Two potential issues that you will want to consider:

1) The creation of invalid data in the form of foreign keys referring to 
non-existent information.  Yes, theoretically you can write your interface 
to avoid this, but is your coding always perfect?  I think you should set 
up the database to force integrity, yet code your interface as if you didn't.
2) What happens when your small app becomes a bigger app.  Are you going to 
start from scratch, or try to upgrade the existing database?  Most 
customers will want to upgrade as opposed to start from scratch

  I'm sure there are others, but.. Data Integrity is the big thing.


--
Jeffry Houser | mailto:[EMAIL PROTECTED]
AIM: Reboog711  | ICQ: 5246969 | Fax / Phone: 860-223-7946
--
DotComIt: Database Driven Web Data
My Book: Instant ColdFusion 5  | http://www.instantcoldfusion.com
My New Book: ColdFusion: A Beginner's Guide February 2002
--
Far Cry Fly, Alternative Folk Rock
http://www.farcryfly.com | http://www.mp3.com/FarCryFly
______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation � $99/Month � Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to