I have a database that has different grades for the course (i.e. three homework for the 1st year, two homework for the course 2, ..., course N with homework M). How should I handle this as the database design goes?
CourseID HW1 HW2 HW3 1 100 99 100 2 100 75 NULL
EDIT I guess I need to rephrase my question. At the moment, I have two tables: "Course and homework." Homework points to the course through a foreign key. My question is: how do I know how many homework will be available for each class?
. , , .
:
CourseID CourseName 1 Foo
HomeworkID HomeworkName HomeworkDescription HW1 Bar ...
CourseID HomeworkID Result 1 HW1 100
, . antipattern, Metadata Tribbles. , - .
, .
Courses Homeworks. Homeworks .
Courses
Homeworks
: , ?
, :
SELECT CourseId, COUNT(*) AS Num_HW_Per_Course FROM Homeworks GROUP BY CourseId
, , . ( ) .
Source: https://habr.com/ru/post/1766863/More articles:Django LEFT OUTER JOIN on two columns where one is not a foreign key - sqlPrint Specification Name - ruby-on-railsVery simple memory leak Ruby GServer - ruby | fooobar.comPass success_url to activate - pythonIs there a way to do bulk / quick delete in mysql? - mysqlDoes the link not work when positioning with a background image? - javascriptiOS - как обрабатывать изменения ориентации в пользовательских ячейках таблицы - iphoneMalicious destination detection? - securityRails3 and heroku image_path - ruby-on-rails-3https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1766868/trying-to-integrate-some-apps-to-my-project&usg=ALkJrhg94O4-XhOrf2vneH0gp23E6e3ugwAll Articles