Looooong DB table

I have this table that contains so many fields in Prisma, should I brake it up into multiple tables or it's fine like this?
No description
7 Replies
timidev
timidev•9mo ago
First of all, what do you what to build?
Maisara Babiker
Maisara BabikerOP•9mo ago
I am building a quiz app
FleetAdmiralJakob 🗕 🗗 🗙
you should defintely split this up first you should make a table with the quiz information then a table with user info (or use an auth service for that) and then a table that is linked to a quiz and user that shows the progress of each quiz that a user has done but why not try your invention out and split your table up if you need to
yanuu :)
yanuu :)•9mo ago
There are some fields you can reduce - you don't really need a successPercentage and mark field if you can calculate it based on (correct_answers * score_per_question)/(number_of_questions* score_per_question), also the solved field is essentially producing the same result as success or status.
Maisara Babiker
Maisara BabikerOP•9mo ago
So I should make three tables QuizInfo, UserAnswers, UserInfo, that makes sense I did like this before but it added a little more complexity so, I got lazy and did that way, but my way got complex too Is it normal to have DB table this long? and what is the optimal length?
FleetAdmiralJakob 🗕 🗗 🗙
it depens on the project size
timidev
timidev•9mo ago
Just like Fleet said, it definitely depends on the project size To me since it's a quiz app, the provided schema is okay But you could try breaking it down, create two tables One for the quiz, another to keep track of users answers Just add a hidden row in the quiz table called OG answer. Then use it to check if user's answers match the OG answer in the quiz table
Want results from more Discord servers?
Add your server