Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Task 1: Create the database Write an CREATE.sql file to create the schema pictured in figure 1. You should have create statements for each of

Task 1: Create the database

  1. Write an CREATE.sql file to create the schema pictured in figure 1.
  • You should have create statements for each of the tables with all their attributes and keys. Data types are indicated in the figure.
  • Also create a user that your PHP can use to access the database. This will require both a create and grant statement.
  • Add at least 3 classes and at least 15 grades using at least 2 insert statements in your script.
image

Figure 1

  1. Test your create script on your VM and adjust as necessary until full functional.

Task 2: Create the front end

  1. Write a database.php to connect to your database on your VM using the credentials created in your script.
  • Hint! We modified a database.php last week in assignment 9. There are examples in chapters 4 and 19. You can use either PDO or mysqli for this assignment.
  • This connection script should include a try/catch for connection. If an error occurs, you will want to include an error or database_error.php script that displays that error to the user. Again, we worked with such a script in assignment 9 or you can find examples in your book. Make sure to include such a script in your application.
  1. Write index.php. This script should select values from the database and display those values to the user using html. You have 2 options to fulfill this requirement:
  • Option 1: Display all grades recorded in the database, grouped and summarized by class. This means that I expect a percentage figured and displayed for each grade, but an overall grade to be calculated and displayed as well. All courses would be displayed on a single html page in separate tables.
  1. This option will look similar to an example in chapter 4 where you have multiple foreach statements.
  • Option 2: Start the user experience by displaying a form where the user would choose a class. On submit of the form, display the grades for that class including the percentage for each assignment and the overall percentage.
  1. This option will require you to make index.php a form with a submit action pointing to an additional file that displays results: grades.php.
  2. This will also require you to bind parameters, using the value(s) entered in the form.

Task 3: Test your application and style as wanted

  1. Test your application by calculating the grades for the records you inserted.
  • If you encounter errors, adjust your code and continue to test until you have a functioning application.
  1. Add any style you wish to dress up your application. In the last assignment, we used a template to help make our application look professional. At a minimum, I will expect a main.css file.
  • Make sure to include any credit statements needed in your html and all needed style files in your final submission.

Task 4: Submission with Git

  • Your repo should include at a minimum:
  1. create.sql
  2. Database.php
  3. Database_error.php
  4. Index.php
  5. Grades.php (optional)
  6. Main.css (and any other style files)

assignment grade id description pt possible pt_earn class id int, ai, pk varchar(45) int decimal int, fk class id dept num section name semester year class int, ai, pk char(4) int char(2) varchar(45) char(2) int

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Modeling and Database Design

Authors: Narayan S. Umanath, Richard W. Scammel

2nd edition

1285085256, 978-1285085258

More Books

Students also viewed these Databases questions

Question

Explain the relationship between thoughts, feelings, and actions.

Answered: 1 week ago

Question

Describe the four actions involved in data management.

Answered: 1 week ago