Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database structure [closed]

I have a database structure in the below format,

subjects table

subject_id subject_name
    1         HTML
    2         Java

chapters table

chapter_id chapter_name subject_id
    1      Doctype          1
    2      Intro to Java    2

tutorials table

tutorial_id tutorial_name       chapter_id subject_id
     1      Intro to doctype         1         1
     2      Details of doctype       1         1
     3      Intro to JVM             2         2   

should subject_id be in tutorials table?

like image 916
Code Avatar asked Jul 24 '26 14:07

Code


2 Answers

No, you can get it indirectly from the chapters table. It's redundant in the tutorial table.

like image 155
Will Hartung Avatar answered Jul 26 '26 05:07

Will Hartung


No need of Using it as its chapter id is available in chapter table

like image 33
Ashish Babu Avatar answered Jul 26 '26 04:07

Ashish Babu