CS 290W

Final Project: Assignment 7

Your Own Database and Search Engine

Due, December 9, 1999 by 11:59 p.m.

Must use the turnin command. Submit your HTML page and your CGI script.



Total project: 100 points.

 

(30 points) Your database:

 

In the cs290 tablespace, create your table with your unique ID, based on the following criteria: (if you'd like to get going on this over the break, create your table and name it your last name first initial, like this: millerj . Make sure to come to class Nov. 29 to register your unique id, however.)

 

The table must have at least 5 columns and 10 rows.

Suggestions for databases are:

 

Ø      a movie database with columns depicting: movie title, producer, actors, year made, brief description, your rating, etc.

 

Ø      your home site database with columns depicting: categories available at your site: assignments, favorite urls, slide show, etc.

 

Ø      a customer database with columns depicting: customer name, address, phone, fax,  items ordered, etc.

 

Ø      a product database with columns depicting: product name, description, weight, quantity, price, etc.

 

Ø      a favorite links database with columns depicting: urls, description, last modified, author, etc

 

Ø      a sports database with columns depicting: team names, win/loss, year, coach, players, etc.

 

Ø      a music database with columns depicting: song title, artist, date, url to artist's site, your rating, link to the tune, etc.

 

All character strings in your database should be declared via varchar2(). Set a maximum of your choice. All numbers must be declared via number(). Set a maximum of your choice. All fields must be declared "not null".

 

(70 points) Your HTML page: Create a search engine that has either one input element, or more, so that the user can input a string(s) that will be used to search your database. Allow the user to enter as many items as they'd like to.

 

For each search, return the full row(s) from the database that meets one or more of the search keywords the user entered. For example, if the user enters a year in the movie search field, you must return the full row of each movie that was made during the year the user selected. When gathering form data from the user, use CGI.pm and its methods. When returning results to the user, write the entire HTML page utilizing CGI.pm (NOT cgi-lib.pl) In addition, the rows of data must be organized in a table with border = 5. The table must also utilize CGI.pm. To be clear, you are not allowed to use cgi-lib.pl for this assignment. Be sure to do something sensible (and sensitive :-) if no matches for any of the search terms are found.

 

Additional criteria:

 

Ignore any characters other than letters and numbers. In fact, treat the non-alphanumerics as blanks. So the text "cgi-lib, $scalar, @array" would be the same as "cgi lib scalar array".

 

Suggestion: Store all lower case strings in your database. Then convert all characters from the user form to lowercase. Search these lowercase characters (words) in your database. This will make searching easier. So you must think about what would happen if your user was searching for, say a movie, "I Love to Program" and they entered: "I Love To Program". Since searching the database is case sensitive, you should be able to handle searches dealing with upper and lower case. If you do not store strings as lower case in your database, there are other ways to deal with this. For example, click here and search for UPPER

 

When you present results to the user, make the user's search input stand out with a different color from the other text. For example, if they searched for the year 1998 in the movie database, all resulting rows will have 1998 highlighted in some way.

 

Lastly, so that it is easy for your TA to grade, at the end of the results page, print out the full, entire database to the html page. Do this AT THE BOTTOM of the results page. This must also be printed using CGI.pm in a table format. This is code you can strip out once the assignment has been graded.