Using Interactive SQL to display data

One of the principal uses of Interactive SQL is to browse the information in databases. This section shows how to query the information in the sample database.

You can display database information using the SELECT statement in Interactive SQL. The following example shows the command to type in the SQL Statements pane. Once you have typed the command, you must click the Execute SQL Statement button on the toolbar to carry out the command.

After you execute the statement, the data (called a result set) appears in the Results pane. You can use the scroll bars to see areas of the table that are outside your current view of the pane.

StepsTo list all the columns and rows of the employee table:

  1. Start Interactive SQL and connect to the sample database.

  2. Type the following in the SQL Statements pane:

    SELECT *
    FROM employee
    
  3. On the toolbar, click the Execute SQL Statement button.

Emp_id

Manager_id

Emp_lname

emp_fname

...

102

501

Fran

Whitney

...

105

501

Matthew

Cobb

...

129

902

Philip

Chin

...

148

1293

Julie

Jordan

...

160

501

Robert

Breault

...

...

For more information on SELECT statements, see Chapter 1, “Selecting Data from Database Tables” in the Sybase IQ Performance and Tuning Guide.