Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 10th, 2003, 02:06 PM
leeolive leeolive is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: London
Posts: 43 leeolive User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
advice on how to plan my tables

Hi!

I haven't been near Access or planned a database structure for about 2 years now and am battling to figure out the database design. The website will collect information on travellers visiting the UK and is to do with their pensions. The travellers will obviously have a birth country, permanent address and an address here in the UK.

Can someone help?

I have a total of 41 fields, but am not sure what to put into what table etc etc and which fields should link to each other. I would ideally like to keep things as simple as possible.

ApplicantID (auto generated)
Title
FirstName
Surname
MaidenName
MaritalStatus
Gender
DateofBirth
NINumber (National Insurance number)
Street
Town
City
County
PostalCode
Country
Email
HomePhoneContact
MobilePhoneContact
PermanentStreet
PermanentTown
PermanentCity
PermanentCounty
PermanentPostalCode
PermanentCountry
Country2 (country of origin/birth)
NOKName (next of kin name)
NOKDateofBirth (next of kin - date of birth)
Profession
EmploymentType
Employer
EmployersStreet
EmployersTown
EmployersCity
EmployersPostCode
WorkPhoneContact
DateJoinedCompany
DateJoinedScheme
AnnualSalary
RetirementAge
PolicyCommencementDate
PaymentArrangement

One more question: If a field is mandatory, should I set this to mandatory within the database or can I just ensure that it is completed within the form validation on the website? Ie. Is it 'risky' to set it to mandatory, will an error occur (that I would have to handle) on the website if for some reason that field is not completed?

Thanks, I appreciate this!
Lee

Reply With Quote
  #2  
Old October 12th, 2003, 12:18 AM
binky's Avatar
binky binky is offline
Gerbil
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Oct 2001
Location: In a Rotastak
Posts: 1,763 binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level)binky User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 22 h 12 m 52 sec
Reputation Power: 18
I'll answer your closing question first. With Access I've always found the setting of things in the database itself a bit risky. Usually with other parts of Access (forms, reports, queries).

My usual way of dealing with database/web systems is to leave the database without rules except for field types, so null values can be entered. Then I create the web site, which has to provide form validation as integral part of any web application.

During testing it becomes apparent where you need to set rules such as default values, usually where a record is inserted and you don't want to write a value for every field in the SQL statement.

As for your fields:

USER_TABLE
ApplicantID (auto generated)
Title
FirstName
Surname
MaidenName
MaritalStatus
Gender
DateofBirth
NINumber (National Insurance number)
Street
Town
City
County
PostalCode
Country
Email
HomePhoneContact
MobilePhoneContact
PermanentStreet
PermanentTown
PermanentCity
PermanentCounty
PermanentPostalCode
PermanentCountry
Country2 (country of origin/birth)
NOKName (next of kin name)
NOKDateofBirth (next of kin - date of birth)
----
Profession
EmploerID
EmploymentType
WorkPhoneContact
DateJoinedCompany
DateJoinedScheme
AnnualSalary
RetirementAge
PolicyCommencementDate
PaymentArrangement

EMPLOYER_TABLE
EmployerID
Employer
EmployersStreet
EmployersTown
EmployersCity
EmployersPostCode

As the bit in the users_table that I marked under --- is unique per user, this should be in the user table though it looks like it should be in the employer table.
__________________
- Sorted!

www.ppfuk.com - Free Photo Sharing

Reply With Quote
  #3  
Old October 12th, 2003, 01:36 AM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 12th Plane (10500 - 10999 posts)
 
Join Date: Jun 2003
Posts: 10,829 Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level)Doug G User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 20 h 19 m 24 sec
Reputation Power: 765

Reply With Quote
  #4  
Old October 12th, 2003, 09:06 AM
leeolive leeolive is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: London
Posts: 43 leeolive User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
thanks!

Thanks Binky and Doug for taking the time to reply! I thought I would need to use 2 + tables(damn!). Very helpful link, Doug.
I like the way the guy says he can still remember how it felt to actually submit to a database from a website - I have to agree thatb it's such a *great* feeling to see the data appear within the table! (cause for many a sing and dance

Cheers
Lee

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > advice on how to plan my tables


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway