I would just like some guidance on database optimization. I have what is essentially a daily survey with a couple sliders (so float 0-1). Each day, X amount of people from the same company will fill this out, submitting their values for this "survey".
What I understand is that you should not create tables for each user as is it inefficient and unmanageable. So, I should not create a table for each company.
What I am looking for is guidance on putting all this data into one table. Here are some specific questions:
Thanks.
It's not advisable to use a single table for all your data.
I think you could model it with few tables (schem, a in Relational notation):
Users(ID,name, bla, bla, bla) --user's data
Company(ID, Name, bla, bla) --company's data
question(ID,question) --a single question
survey(ID, date, some general stuff about that survey) --track each survey
answer(ID, question_id, survey_id, user_id, company_id, answer_value) --an answer to a question (in a survey)
NOTE: foreign keys are indicated as referenced_table_ID
With this schema you can: