Basic Queries  «Prev  Next»

Write a SELECT statement - Exercise

Objective: Retrieve all columns from all rows in a single table.

Exercise scoring

This exercise is worth 3 points and is scored automatically. When you are finished, just click the Submit button to receive full credit.

Background/overview

Write a SELECT statement that will return all the columns of data in the CustTable of the VirtualBookShelf database.

Download files


You will need the file sqlfun.asp to do this exercise. This file can be used to easily enter and execute a SQL statement and view the results in an HTML table.

Instructions

  1. Open the sqlfun.asp file in the source code editor.
  2. Locate the line: querystring = " "
  3. Insert a complete SELECT between the quotation marks statement to return all the columns in the CustTable.
  4. To execute the statement, first save the file, then right-click the source editor window and select View in Browser. The statement will be executed and the output displayed in the browser window.

Hints

If you have not inserted the sqlfun.asp file into the VirtualBookShelf.com project, refer to Lesson titled "Data binding" in the previous Module.
The * character makes it very easy to request all the columns in a row. Of course, you can specify all the columns by name, but this is a lot easier.