Homework 10:  Web interface

Database Systems
Spring, 2020
Due:  May 8 (11:59 pm)

The objective of this assignment is to build a user-friendly, web interface to your database.  You may use PHP or another language of your choice.  I've put links to two PHP references on the course home page.

As you did with homework 7, you should write an interface that demonstrates how you envision your database being used.  You should include queries, insertions, and modifications among your options. For example, if you were writing an application for the student-course database, you might offer options such as

  1. Enter a course, or select one from a drop-down list.  Then list all the sections of the course and their current enrollments.
  2. Enter a student, or select one from a drop-down list.  Then list all the courses the student is enrolled in.
  3. Add a new student to the Student relation.  (The user can enter the student information in a set of text fields.)
  4. Enroll a student in a course.
  5. Add a new section of a course.
  6. Delete a section of a course.
  7. Modify the enrollment limit of a section of a course.
You don't need to provide access to everything in your database, but there should be at least four types of query, two types of insertion, and two types of modification.  The insertions and modifications should be related to the queries, so that the user can query the data which has been inserted or modified.  Some specific requirements:
For insertions and modifications, provide some sort of acknowledgement so the user can see that the operation has been completed.  For example, if a tuple is modified, you could display the new version of the tuple.

Handle errors that occur as a result of data entry.  Include some options that could lead to a violation of your primary or foreign key constraints.  The web page should display an appropriate message if an error occurs.

Don't ask your user to enter SQL code.

Setting up your personal web page

You need to do a few things in order to make your web page available on the world wide web:

1.  Make your home directory executable (i.e., searchable) by the public.  (This gives access to the web server.)

chmod a+x .

2.  Create a directory called "www" in your home directory.

mkdir www

3.  Make the www directory readable and executable by the public.

chmod a+rx www

4.  All the files that you want to have available on the web should be in the www directory.  Each of those files must be readable by the public.

chmod a+r <file-name>

5.  You can create a home page for yourself by putting a file called "index.html" in the www directory.  On your home page, you can create links to the files that access your database.


When that's all done, you should be able to access your web page from a browser using the url

http://newoccs.cs.oberlin.edu/~username

No other submission is necessary.  You can put your assertion of the honor code somewhere on your home page.