How many tables will you need in Mysql?

Asked

Viewed 75 times

-1

I’m starting a project that aims to manage students' grades and subjects.

The information I’ll need to store is:

  • Total subjects (All subjects the student will need to study)
  • Current materials (These are materials released for the semester, e.g. 7)
  • Grades Test 1, Test 2, Exam-Test and Average
  • Students (Full name and CPF)
  • Dates of the Trials

Is it right to organize this information how? Create 5 tables and FK for everyone? Then pull each item when you need it?

I tried to do it with 2 tables, but it seems impossible...

Note. I just need to know how good practice would be, they don’t need to send the code, only the same relational model.

  • Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site

1 answer

2

The hardest part is collecting the requirements and deeply analyzing what you need. It may be that you’ve done it well, it may not. If it’s not well done, we can’t help precisely.

Any reason to create as few tables as possible? I see no reason and it seems very wrong. I’ve seen whole complex systems in a single table, it was at the same time one of the most tragic and comical things I’ve ever seen in IT.

Knows normalization? Need to know to model database tables.

On top, and I don’t know if this is useful, it would really be the ones that stood out, but only because it was described like this:

  • Students
  • Disciplines
  • Subjects X Semesters
  • Evidence
  • Notes

I am considering that has only one course and the semesters do not have relevant information and are considered implicitly without precise registration, the application will deal with it.

The data will be obtained according to the normalization, in many cases using JOIN considering the FK. In fact this does not seem to be a difficult problem to solve, requiring something exceptional, unless the collection of requirements and analysis is wrong.

You talked good practice to the wrong person, I hate that, and I think it does a lot of damage to people’s minds, because deep down they want a universal cake recipe that solves their problem without having to think. In software development if this exists, you don’t have to hire people just to apply it, you’d have everything ready. You have to learn the basics, understand everything how it works, the contexts, deeply analyze and apply every basic knowledge to find the best solution to the specific problem within that context.

Anyway this is what you can answer, the model depends and would do for you, the code would not even make sense because nothing indicates that there is code in it. That’s why I don’t like good practice, it seems that the phrase was formulesca, did not consider the context.

If you have any specific problem you can ask.

  • Maniero, your answer was super complete. I’m actually trying to "summarize" something that shouldn’t be summed up, trying to save on the tables, and that would hurt me even if this project got bigger. I read the explanation about Normalization, very cool, and explained it to me. I commented on code, because I have tried to remove this doubt before and confused with the coding of the tables. I must be expressing myself wrong. The information I need is just this, simple and objective. I would like in vdd, just to know how someone more experienced would do it. Thank you so much!

  • @Flávia Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote for

Browser other questions tagged

You are not signed in. Login or sign up in order to post.