Monday, July 30, 2007

pop quiz

Here's a short exercise to practice what we've learned so far.

Create SQL statements to accomplish the following tasks. Post your answers in your blog. Hint: you might find this easiest to do using phpmyadmin.

  1. Create a customers table with an auto-incremented custno field, an indexed custname field and a single address field.
  2. Write the SQL code that would insert 'J. Smith' into the custname field and 'Leeds' into the address field.
  3. Write the SQL code that would extract all the customer details from the customers table in alphabetical order
For bonus marks:

Create an html page with a form for entering new customers. Link the form to a php page that inserts these values into your table. To include this code into your blog, you're going to have to do some formatting (blogs don't like < and > characters) - cut and paste your code into and out of the postable site to fix this.


Image: 'We Won the Quiz'
www.flickr.com/photos/24204505@N00/148260617

No comments: