Gyrus,
A well-designed normalized relational database will require you to use
less code to produce the results you want in your web application. The
process of normalizing a database design is intended to eliminate data
redundancy and deletion/addition anomalies. Your question about
constraints requires an "it depends" answer. Usually constraints are
best enforced by the DBMS because it is a central point through which
all data changes must pass, and it's faster. However, in the text I
refer to, it mentions that processing is more efficient when constraints
are removed from some architectures; Microsoft Transaction Server is
specifically mentioned. "Your goal should be to understand the types of
constraints and the means by which they are enforced. When possible,
enforce them at the DBMS; if not, enforce them in the application."
("Database Processing: Fundamentals, Design, and Implementation" 7th
edition, David M. Kroenke, Copyright 2000, Prentice Hall,
http://www.prenhall.com/kroenke)
HTH,
Dina
----- Original Message -----
From: Gyrus
To: CF-Talk
Sent: Wednesday, January 09, 2002 9:31 AM
Subject: Defining internal DB relationships necessary?
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.
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?
My basic start for learning bits of SQL is Ben Forta's
'SQL in 10 Minutes', and none of the CREATE TABLE
examples use anything other than datatype and default
definitions. Is this misleading?
Any comments/advice on this topic welcome!
- Gyrus
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- [EMAIL PROTECTED]
work: http://www.tengai.co.uk
play: http://www.norlonto.net
- PGP key available
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
______________________________________________________________________
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