[thelist] Q on a DB schema
Joshua Olson
joshua at waetech.com
Thu Feb 19 11:10:09 CST 2004
> -----Original Message-----
> From: jsWalter
> Sent: Thursday, February 19, 2004 12:06 PM
>
> I was wondering, do I need all the data (see below) in a single table or
> can/should it be split up?
>
> This is to:
> - sign up a user
> - keep user personal info
> - keep user pref
> - track user access
Walter,
Since you have a PK for the user_id you technically can split it, but
there's little reason to, with one exception. The "track user access"
portion of this database could be handled in a separate table so you can
keep a running log of accesses rather than just the last access.
Something like this:
CREATE TABLE 'user_access' (
'user_id' int(4) NOT NULL,
'ip_addr' varchar(15) NOT NULL,
'referer' varchar(255) NULL,
'date_created' datetime NOT NULL default GetDate())
user_id is an FK back to the user table and each record would equate to a
single login by the user. This table would not be purged or overwritten as
it's an historical account off access.
Good luck,
<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com/service_areas/
706.210.0168
More information about the thelist
mailing list