473,402 Members | 2,055 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,402 software developers and data experts.

SQL suggestion???

Hi everybody,
Iam doing my project which is just like an online examination where many users write their exam and if they qualify they have to write another exam.so,my doubt is how should i maintain the tables for every round??every thing the answers by different users should be stored.I need to store the answers made for different questions of each user for each round...any suggestions..
Feb 27 '10 #1
6 2564
rski
700 Expert 512MB
Each round means each exam? or one exam is splitted into rounds?

For the start you would define tables
USER (informations about users)
EXAM (informations about exams, also exams path i mean which exam user must past to take another)
QUESTIONS (questions that was asked, connected with exams and users)
ANSWERS (answers for questions connected with exams, users and questions)

How many data you think there would be in the tables?

What do you think about that solution? Did I miss something.
Treat it as a sketch.

Sorry for not so good english, i think everything i wrote is clear.
Feb 28 '10 #2
Thanks rski...
wat ever the answers given by users should be stored.So my problem is i took a table USER_ANSW which stores all the answers of each questions of each round.of each user....but the users record gets repeated in USER_ANSW table...for every round.so shall i use the same table to store with repeated users or any other suggestion...
Feb 28 '10 #3
rski
700 Expert 512MB
I think that USER_ANSW should be a relation, that keeps only ids (which are primary keys)
USER_ANSW(user_id,answer_id,question_id,exam_id)

You don't write if exam is a test (open questions exam or choice/multichoice exam)? If it is an open question test(i mean users writes answers not choice them from a list) then you probably do not need ANSWERS table and USER_ANSW will look like that (no answer_id but real answer)
USER_ANSW(user_id,answer,question_id,exam_id)
Feb 28 '10 #4
oh thank you sir,
the idea was gud if i make USER_ANSW as a relation then i guess i should use PRIMARY KEYS in that table but not UNIQUE constraint rite???
and how to take a table for answers which relates to USER_ANSW table which stores only an option value for different questions for each user(previously i tried with arrays)..is it better to use arrays to store answers options for each user...???
Feb 28 '10 #5
rski
700 Expert 512MB
Primary key should be
user_id in table users
exam_id in table exams
question_id in table questions
answer_id in table answers

Table user_answ do not need primary key, but you can add one let say
uans_id.

table which stores only an option value for different questions for each user(previously i tried with arrays)
What do you mean for each user, i thought the answer table be like that

ANSWER(answer_id,question_id,answer_text)

so for one question there would be few rows with posible answers (related with questions via question_id foreign key)
Do you want to store here which user was asked that question? What for?
You can read that information from user_answ table.
Or I simply do not understand what do you want do achieve?
Feb 28 '10 #6
Thank You rski....i got it...

[quote]table which stores only an option value for different questions for each user(previously i tried with arrays/QUOTE]

what does i mean from above is that previosly my table for storing answers was:
answers(user_id,exam_id,answ array[])

where i used for every exam i stored answers(only options,one option per question) in array for each user and the userid's would repeat if he attempts more than one exam. which made me problem in retrieving.the data...

but now the problem is solved sir,

i think you got it wat does i mean....

Thank you much for valuable suggestion...
Feb 28 '10 #7

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

Similar topics

11
by: John Wellesz | last post by:
Hello, It would be great if there was an option to tell PHP to let the user manage all the HTTP headers instead of sending what it thinks is good for the programmer... For example when you...
5
by: John | last post by:
Hi: I'd like to implement a simple map, which is a 2-D plane with many points, e.g., 100. The points are not evenly distributed, i.e., some points may have two neighbor points; some may have 5...
10
by: Paulo Jan | last post by:
Hi all: Let's say I'm designing a database (Postgres 7.3) with a list of all email accounts in a certain server: CREATE TABLE emails ( clienteid INT4, direccion VARCHAR(512) PRIMARY KEY,...
7
by: J.Marsch | last post by:
I don't know whether this is the appropriate place to give product feedback, but here goes: I would love to see some kind of diagnostic to let me know when implicit boxing has occurred. We...
2
by: vinay | last post by:
I have a scenario, need your suggestion.. Our clients are already using the forms authentication where we check the User/Pwd from SQL svr Database. We also have some SETTINGS for the user saved...
13
by: sandeep chandra | last post by:
Hey guys, I am new to this group.. i never know wot s going on in this group.. but wot made be brought here is cpp.. guys am currently a part of onw reaserch ... am new to everything.. i...
17
by: Jedrzej Miadowicz | last post by:
I recently (re)discovered data binding in Windows Forms thanks to its advances in Visual Studio 2005. As I looked a little deeper, however, I realize that it still suffers from an irksome tendency...
4
by: John Salerno | last post by:
I apologize for the slightly off-topic nature, but I thought I'd just throw this out there for anyone working on text editors or IDEs with auto-completion. I think it should be a feature, when...
20
by: Allan Ebdrup | last post by:
I have a suggestion for C# I would like reader/writer locks to be built in to the language. When you want to aquire a loct on an object o you write lock(o) { ...//critical region } I would...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.