Home arrow PHP arrow Page 2 - Statistical View of Data in a Clustered Bar Chart
PHP

Statistical View of Data in a Clustered Bar Chart


In this article, Naeem shows us how to go about creating a statistical view of data, in the form of a clustered bar chart, using PHP and MySQL.  He provides a real-life scenario, along with accompanying code, to demonstrate how the job can be accomplished.

Author Info:
By: Muhammad Naeem
Rating: 4 stars4 stars4 stars4 stars4 stars / 57
December 01, 2003
TABLE OF CONTENTS:
  1. · Statistical View of Data in a Clustered Bar Chart
  2. · Database
  3. · Getting Down and Dirty
  4. · Drawing Charts
  5. · Conclusion

print this article
SEARCH DEVARTICLES

Statistical View of Data in a Clustered Bar Chart - Database
(Page 2 of 5 )

The database consists of four tables.

  1. Students
  2. Programs
  3. Subjects
  4. Marks

Each of the first three tables has a one-to-many relationship with the Marks table.

Database Schema

SQL statements to create these tables are as follows:

Marks Table

CREATE TABLE marks (
   id int(11) NOT NULL auto_increment,
   student_id int(11) DEFAULT '0' NOT NULL,
   program int(11) DEFAULT '0' NOT NULL,
   subject int(11) DEFAULT '0' NOT NULL,
   marks int(11) DEFAULT '0' NOT NULL,
   entry_date date,
   PRIMARY KEY (id)
);

Programs Table

CREATE TABLE programs (
   id int(11) NOT NULL auto_increment,
   program varchar(255),
   PRIMARY KEY (id),
   UNIQUE program (program)
);

Students Table

CREATE TABLE students (
   id int(11) NOT NULL auto_increment,
   name varchar(100),
   PRIMARY KEY (id)
);

Subjects Table

CREATE TABLE subjects (
   id int(11) NOT NULL auto_increment,
   subject varchar(255),
   PRIMARY KEY (id),
   UNIQUE subject (subject)
);


blog comments powered by Disqus
PHP ARTICLES

- Removing Singletons in PHP
- Singletons in PHP
- Implement Facebook Javascript SDK with PHP
- Making Usage Statistics in PHP
- Installing PHP under Windows: Further Config...
- File Version Management in PHP
- Statistical View of Data in a Clustered Bar ...
- Creating a Multi-File Upload Script in PHP
- Executing Microsoft SQL Server Stored Proced...
- Code 10x More Efficiently Using Data Access ...
- A Few Tips for Speeding Up PHP Code
- The Modular Web Page
- Quick E-Commerce with PHP and PayPal
- Regression Testing With JMeter
- Building an Iterator with PHP

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2017 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials