This chapter reviews basic query construction and recommends some refinements to take advantage of product design. You will complete tutorial tasks on looking at table contents, ordering query results, selecting columns, selecting rows, and using search conditions to refine queries.
For advanced query performance recommendations, see Chapter 3, “Improving Query Performance.”
If you use a graphical front-end tool instead of DBISQL to query your database, the tool may allow you to view the SQL syntax it generates. For example, in InfoMaker, you can view SQL statements by choosing the SQL Syntax button on the Table painter bar.
This tutorial introduces the SELECT statement used to retrieve information from databases. SELECT statements are commonly called queries, because they ask the database server about information in a database.
The SELECT statement is a versatile command. SELECT statements can become highly complex in applications retrieving very specific information from large databases. This tutorial uses only simple SELECT statements: later tutorials describe more advanced queries. For more information about the full syntax of the select statement, see the SELECT statement in Chapter 6, “SQL Statements,” in the Sybase IQ Reference Manual.
Ideally, you should be running Sybase IQ software on your computer while you read and work through the tutorial lessons.
This tutorial assumes that you have already started DBISQL and connected to the sample database. If you have not already done so, see Chapter 2, “Using Interactive SQL (dbisql)” in the Sybase IQ Utility Guide.