"Can" you design your database with no primary keys? Yes, you can. Do I
recommend this, even on the smallest of databases? Absolutely not! It's
my opinion that if you're going to do something, do it right all the
time. Get in the habit of doing things the best way possible, even if it
takes you a little longer.

The "Learn something in milliseconds" books are fine to get a "basic"
understanding. But you'll find they don't get you very far. Take what
you've learned from those books and immediately start building upon
that. You can't learn everything over night.

The problems will start appearing in performance when you have a lot of
data in your db and no primary keys to index. Having good form
validation in your app will help keep your data "clean". As a last line
of defense, having constraints and the like on your db is a good
practice to get into.

Mark




-----Original Message-----
From: Gyrus [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 09, 2002 10:31 AM
To: CF-Talk
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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

______________________________________________________________________
Get Your Own Dedicated Windows 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=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to