table 1 id student 1 ali 2 akram 3 aamir 4 adeel 5 aun table 2 id course 1 english 2 urdu 3 maths 4 physics 5 chemistry table 3 id stu_id course_id 1 1 1 2 1 2 3 2 1 4 2 5 5 5 1
q1: these tables normalized ?
q2: me remove duplicates table 3, suppose if table 2 have 1000 courses, , student id 1 , 2 enrolled in courses, table 3 large because of 2000 entries , there way reduce these ?
- it normalized many-to-many relation;
- yes max cardinality of many-to-many relation max students x max courses, nothing terrible;
- in many-to-many relationships use multiple columns key of ids couple, not need id;
- if duplicates mean fact have many equal fields in columns, not duplicates @ all. mean student has many courses , viceversa. has unique couple stu_id-course_id.
regards
Comments
Post a Comment