title: Choice of tables for handling attendance
body: <p>I'm working on my project in PHP [handling students attendance system]. I have a list of students along with their id[jntuno] and I need to create a database in mysql for storing the daily attendance of each student for each subject.So I created my tables in this way :</p>
  
  <p>TABLE : <code>students</code></p>
  
  <p>FIELDS:</p>
  
  <pre><code>slno int(5) auto increment,
  jntuno char(15),
  name char(50),
  primary key(slno,jntuno).
  </code></pre>
  
  <p>DATA:</p>
  
  <p><img src="https://i.stack.imgur.com/zae9k.jpg" alt="Data in students table"></p>
  
  <p>this <code>students</code> table holds the list of students and their id</p>
  
  <p>now I created another table :</p>
  
  <p>TABLE: <code>dailyatt</code></p>
  
  <p>FIELDS:</p>
  
  <pre><code>date date,
  subject char(10),
  classesconducted int(2),
  `11341A0501` int(2),
  `11341A0502` int(2),
  `11341A0503` int(2),
  .
  .
  .
  `11341A0537` int(2),
  primary key(date,subject).
  </code></pre>
  
  <p>this table will look like :</p>
  
  <pre><code>+------------+-----------+-----------------+------------+-----------+-----------+
  |date        |subject    |classesconducted |11341A0501  |11341A0502 |11341A0503 |....
  +------------+-----------+-----------------+------=-----+-----------+-----------+
  |            |           |                 |            |           |           |
  </code></pre>
  
  <p>now every day upon entering the attendance in the PHP website, a new row will be created for each subject taught on that day. </p>
  
  <p>But many said that the database model  is not a good one ...<br>
  What's wrong with this database structure?  </p>
  
  <p>So can someone suggest me a better model for this kind of problem?</p>