Too many columns, how to reduce it? User events, ratings, scores storing for each lesson I am working on a eLearning project. It has:

Courses


Courses (n courses)
-Modules (at least 3 modules in one course = n x 3)
--Lessons (at least 8 lessons in one module = n x 8 x 3 = n x 24 items)
---Quizzes (at least 5 quizzes in one lesson = n x 24 x 5 = n x 120 items)
---Training (1 training per course = n x 24 x 1 = n x 24 items)


I need to give rating for each lesson overall score (1, 2 or 3 stars rating)
I need to record users quizzes data (wrong answers, right answers etc.)

The table will grow too large if I were to store values in individual lessons as columns and quiz itmes as columns. Let's say we have 5000 users, 500 quiz items, 100 lessons.  It means, there are 500 columns across 5000 rows.

Help me reducing the columns and make the databased optimised by avoiding NULL entries.
You should turn each of those repeated columns into a separate row. Instead of a table design

QuizId
Item1
Item2
...
Item500


The table should be

QuizId
ItemNumber   -- values are 1 through 500
ItemValue


Then instead of having hundreds of columns there will be thousands, or even millions, of rows. That's fine. RDBMS is designed to handled that many without concern.