Assignment
The assignment will be chosen by the individual student with my approval. An ideal assignment will be one which involves at least four entity sets, but not too many since there will be critical time pressure to complete the assignment. Also, we hope for interesting relationships (many-many, many-one, one-one, ISA, weak entity sets, etc.) between the entity sets in order to lead naturally to the use of the major topics covered in the course. For students with considerable experience with practical database systems, I will encourage you to come up with ideas for alternative kinds of assignments that will provide you with a substantial learning experience.
The assignment will give you an opportunity to exercise the techniques and tools you learn in this class. The goal is not to develop a complete system, but rather to develop a prototype that illustrates the major features of the system, were it to be completed. We want the parts that are done to be complete and impressive. The major requirements of the assignment will be a careful and complete ER model, the relational database tables with sample data, a set of interesting SQL queries, and finally a user-friendly interface.
Important:
Please write down the keys for each relation, the functional dependencies for each relation, and you must guarantee all the relations are 3NF or above.
Here are some topics that can be used:
Taxi Company Database
Police Force Database
Hospital
Airport Records
Apartment Complex
Book Publisher
University
Attention:
Sample files
Table: contacts(first, last, phone, mobile, fax, email, website)
query.php (perform a query)
$username="username";
$password="password";
$database="username";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query="SELECT * FROM contacts";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "Database Output
";
$i=0;
while ($i
$first=mysql_result($result,$i,"first");
$last=mysql_result($result,$i,"last");
$phone=mysql_result($result,$i,"phone");
$mobile=mysql_result($result,$i,"mobile");
$fax=mysql_result($result,$i,"fax");
$email=mysql_result($result,$i,"email");
$web=mysql_result($result,$i,"web");
echo "$first $last
Phone: $phone
Mobile: $mobile
Fax: $fax
E-mail: $email
Web: $web
";
$i++;
}
?>
test.html and insert.php
First Name:
Last Name:
Phone:
Mobile:
Fax:
E-mail:
Web:
$username="username";
$password="password";
$database="username";
$first=$_POST['first'];
$last=$_POST['last'];
$phone=$_POST['phone'];
$mobile=$_POST['mobile'];
$fax=$_POST['fax'];
$email=$_POST['email'];
$web=$_POST['web'];
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO contacts VALUES ('$first','$last','$phone','$mobile','$fax','$email','$web')";
mysql_query($query);
mysql_close();
?>