473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Table Architecture to Host super-multi query

First off would like to say thanks for helping out with my last question! You guys are the bestest!!

OK now for the fun stuff. I am making a template "KISS" (keep it simple stupid) database. What my goal is to have a User create a login and profile of which animals they like. The database would then take thier selection of animals and ask specific questions for that type of animal. Then store the results into the Results table.

Here is the basic setup:

3-Tables:

tbluser
UID - pk - auto#
Username
Name
Password
*Animal*

tblquestion
QID -pk - auto#
animal
Question

tblresult
UID - indexed/linked
QID - indexed/linked
result - Yes/No

The animal section is giving me the issue. I know this seems minor, but this will be applied to database that is housing over 4,000 questions with over 2000 different selection fields (dropdowns, input, and textbox's) utilizing over 300 users per survey. Then inporting into a different database with over 800,000 results!

Sorry of the side track, back to our animals. I have a couple different ideas, use of checkbox's for each animal or text entry from drop down box (1 for each of the types of animals). Both of these seem redundant as well as an entry nightmear. I have never really messed with anything of this caliber, but am a quick learner. So even if you have an idea, I can normally find something to figure out how it works.

Thanks in advance!!!

Happy St. Patricks DAY!!!

~Kendall
Mar 17 '09 #1
6 1362
NeoPa
32,556 Expert Mod 16PB
Can you clarify how you envisage storing the Animal data (as there seems to be no dedicated Animal table, which I would have expected to see)?

All I see currently is an *Animal* field in the tblUser table, and I cannot see a sensible way of using this to do what you require.
Mar 17 '09 #2
The *animal* field is where I have speed bumps.

I have been working with each animal having its own field in the tbluser

example:
tbluser
cat - yes/no
dog - yes/no
gerbil - yes/no
hedgehog - yes/no
etc..... (you can see now the redunancy issues)

or

new table:
tblAnimal
animal - text - linked to the tbluser!animal for list capabilities

The problem I am running into is, if I creat a drop down box, the user can select only 1 item, even with mutli-select, the field will not hold the values of the animals they have.

That clear up things a little?? I do have a tendancy to talk in circles =D

Thanks!

~Kendall
Mar 17 '09 #3
FishVal
2,653 Expert 2GB
Hello, Kendall.

That looks quite straightforward. You need:
  • Table to store animals - tblAnimals.
  • Bridge table tblUserAnimals connecting tblUser and tblAnimals in M-to-M relationship to store user "animals selection".
  • tblquestion.animal obviously should be FK of tblAnimals.

The rest seems more or less ok.

Regards,
Fish.
Mar 17 '09 #4
NeoPa
32,556 Expert Mod 16PB
Fish probably knew where I was going with this even before your response.

Let us know if you have any problems understanding this setup or its ramifications.
Mar 17 '09 #5
Thanks Fish, and Thank you Neo!!

I'm pretty good at figuring things out; just need a small push in the right direction at times :)

I have setup the Many-to-Many relationship; I understand the concept, still doing some research on the limitations. Thats one thing I have noticed about all these expensive books... They are always more then happy to tell how to do something, but never the why and ramification. I was one of those kids that took his toys apart to see how they worked, then put them back together into something cool.

One thing I did question: Input forms for the bridge/link table. I would love to make my tblanimals into yes no check box for each entry then when a user creates thier profile it would add correct information to the linking table. I am thinking unbound checkbox's???

Ok guys, really appreciate the help... Your quickly making the top of my Christmas Card List!!!

~Kendall
Mar 18 '09 #6
FishVal
2,653 Expert 2GB
Hi, Kendall.

I think this stuff could help you to create a suitable interface.
Mar 18 '09 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Richard Gabriel | last post by:
Hi everyone, Since we upgraded to MySQL 4.0.13 from 3.23, we have been getting table corruption often. It happens about twice per week (with about 500 queries per second average). I have even...
0
by: Richard Gabriel | last post by:
Hi everyone, Since we upgraded to MySQL 4.0.13 from 3.23, we have been getting table corruption often. It happens about twice per week (with about 500 queries per second average). I have even...
1
by: Ambarish Ganguly | last post by:
Hi, We are planning for a 3 tier architecture with Web server App server containing all business dlls Database server. The web server will communicate using COM interop ( CreateObject sort...
1
by: Ambarish Ganguly | last post by:
Hi, We are planning for a 3 tier architecture with Web server App server containing all business dlls Database server. The web server will communicate using COM interop ( CreateObject sort...
4
gagandeepgupta16
by: gagandeepgupta16 | last post by:
Hi I have recently started working on VS2008, and very much new to WF. I have looked for some samples and articles on how WF, WCF and sequential WF are implemented. I have them in bits and...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.