Exercises: Basic database applications

Exercise: Create a dog movie database

On your local machine, create a database called dogmovies. It will have data about movies that have dogs in them.

Make a user who can access the database.

Add a table to the database. Call it movies. Add fields for:

  • Movie id (the primary key)
  • Movie name
  • Year made
  • Rating (e.g., PG-13)

Add some movie data from this page.

Write a PHP test page to connect to the database.

Now duplicate the database and the test page on your hosting account.

Put the URL of the test page below.

(Log in to enter your solution to this exercise.)

Exercise: Create a dog book database

On your local machine, create a database called dogbooks. It will have data about books about dogs.

Make a user who can access the database.

Add a table to the database. Call it books. Add fields for:

  • Book id (the primary key)
  • Book name
  • Author name
  • Year published
  • Description

The last field is a paragraph or two about the book.

Add some book data from Dogwise, or another site. There’s lots of good stuff there.

Write a PHP test page to connect to the database.

Now duplicate the database and the test page on your hosting account.

Put the URL of the test page below.

(Log in to enter your solution to this exercise.)

Exercise: Create a dog Web site database

On your local machine, create a database called dogsites. It will have data on Web sites about dogs.

Make a user who can access the database.

Add a table to the database. Call it sites. Add fields for:

  • Site id (the primary key)
  • Site name
  • Home page URL
  • Comments

Add some data about dog sites.

Write a PHP test page to connect to the database.

Now duplicate the database and the test page on your hosting account.

Put the URL of the test page below.

(Log in to enter your solution to this exercise.)

Exercise: Dog movies home page and movie list

Create a version of the DogMovies site with a home page and a movies list. The home page should look something like this, but with your own graphics and colors:

Home page

Figure 1. Home page

Here’s the movie list page.

Movies

Figure 2. Movies

Clicking on the column headings sorts the data.

Add at least five movies to your database.

You can try my solution.

Upload your application to your hosting account. Put the URL below.

(Log in to enter your solution to this exercise.)

Exercise: Dog books home page and book list

Create a version of the DogBooks site with a home page, a book list, and a page describing each book. The home page should look something like this, but with your own graphics and colors:

Home page

Figure 1. Home page

Here’s the book list page:

Book list

Figure 2. Book list

Clicking on a column header sorts the pages.

Here’s part of a book description page:

Book description

Figure 3. Book description

You can try my solution.

Upload your application to your hosting account. Put the URL below.

(Log in to enter your solution to this exercise.)

Exercise: Dog sites home page and site list

Create a version of the DogSites site with a home page, and a site list. The home page should look something like this, but with your own graphics and colors:

Home page

Figure 1. Home page

Here’s the site list page:

Site list

Figure 2. Site list

You can try my solution.

Upload your application to your hosting account. Put the URL below.

(Log in to enter your solution to this exercise.)

Exercise: Administering the dog movie database

Add an administration section to the DogMovies Web site.

You can see my solution.

Enter the URL of your solution below.

(Log in to enter your solution to this exercise.)

Exercise: Administering the dog book database

Add an administration section to the DogBooks Web site.

You can see my solution.

Enter the URL of your solution below.

(Log in to enter your solution to this exercise.)

Exercise: Administering the dog site database

Add an administration section to the DogSites Web site.

You can see my solution.

Enter the URL of your solution below.

(Log in to enter your solution to this exercise.)


How to...

Lessons

User login

Log in problems? Try here


Dogs