If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > Table Setup

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-30-10, 17:54
jairoortega jairoortega is offline
Registered User
 
Join Date: Apr 2010
Posts: 2
Question Table Setup

Hello Everyone,

I'm new to the forum and am happy to have found a forum dedicated to databases.

I'm working on a little project for my construction business.

I have an online inquiry form which potential clients fill out with their contact information aswell as the services they are interested about. Depending on the type of client(homeowner or contractor), JavaScript returns a group of checkboxes. I'm using checkboxes so clients can choose as many services as they want.

The problem is how do I store this information into a database efficiently. without reduntant information?

I plan to use this information to retrieve the following out of the table... How many inquiries did we get for "x" service last month? What services did the "xclient" inquiry about?

So far i have the basic table layout for the contact information and some other stuff but again i'm not sure to input that type of data.

Your help is appreciated.

Jairo
Reply With Quote
  #2 (permalink)  
Old 04-30-10, 22:57
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
you'll want one table for your clients, one table for your services, and then a third table, corresponding to each client's submitted checkboxes, which relate a client to a service -- one row for each checkbox that the client selected

this third table really needs only two columns, the clientid and the serviceid
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 05-02-10, 10:45
jairoortega jairoortega is offline
Registered User
 
Join Date: Apr 2010
Posts: 2
Wow,

Thank you for the quick response.

Looking back, I almost feel stupid for asking that. The solution couldn't have been anymore obvious.

Thank you Rudy
Reply With Quote
  #4 (permalink)  
Old 05-03-10, 15:31
blindman blindman is offline
World Class Flame Warrior
 
Join Date: Jun 2003
Location: Ohio
Posts: 11,726
Isaac Newton and Archimedes felt the same way. You are in good company.
__________________
If it's not practically useful, then it's practically useless.

blindman
www.chess.com: "sqlblindman"
Reply With Quote
Reply

Tags
data entry, database design, tables

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On