One of the principal uses of dbisql is to look at information in databases.
The database used in this tutorial is for a fictional company. The sample database contains information about employees, departments, sales orders, and so on.
All this information is organized into a number of tables, consisting of rows and columns.
You display information from a database using the SELECT statement. The following example shows the command to type in the dbisqlc command window. Once you have typed the command, you must click Execute to carry out the command. The example displays the first several columns and rows of the results of the query, which are displayed in the dbisqlc data window. The format is used throughout this manual.
Type the following:
SELECT * FROM employee
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 |
... |
... |
|
|
|
SQL statements are case insensitive. SELECT is the same as select and the same as Select. In the examples, SQL keywords are shown in upper case, but you do not have to type them in upper case.
SQL statements can be typed on more than one line. You can type the statements all on one line, or break them over several lines as you wish. Some SQL statements, such as the SELECT statement, consist of several parts, called clauses. In many examples, each clause is placed on a separate line, but you do not have to type them this way.
The dbisqlc Data window displays a set of rows and columns containing information about the employees. Each row contains information about one employee, and each column contains a particular piece of information for all employees.
When you type the command
SELECT * FROM employee
in the dbisqlc command window, the visible portion of the dbisqlc data window cannot hold the entire employee table.
The visible portion of the data window does not display all the information about each employee, and does not display the entire list of employees.
To see more information about each employee (that is, other columns) you use the scroll bar at the bottom of the data window. This is a standard Windows scroll bar.
To see more information on other employees (that is, other rows), use the scroll bar to the right of the data window. The employee table in the sample database has information on about 75 employees.
Sometimes, the vertical scroll bar behaves slightly differently than standard scroll bars, as the number of rows in the result may be unknown. In this case, a guess as to the number of rows is used. If dbisqlc determines that its guess is wrong, the guess is adjusted and the slider “jumps.”