Article Preview
Buy Now
| Print: | |
| PDF: |
Databases for Real
Building a User Interface
Issue: 1.5 (April/May 2003)
Author: Paul Lefebvre
Author Bio: Paul Lefebvre is President and Chief Architect of LogicalVue Software, producers of SQLVue Professional and many other products.
Article Description: No description available.
Article Length (in bytes): 5,189
Starting Page Number: 27
RBD Number: 1513
Resource File(s):
1513.sit Updated: Friday, October 17, 2003 at 12:20 PM
Related Link(s): None
Known Limitations: None
Excerpt of article text...
Welcome back! So far, using our Softball example, we have learned how to design a database, convert it to tables, and work with SQL. Now it is time to build a user interface for the Softball database. We'll start with the game table. But first, I want to cover a couple SQL statements that we'll be using.
More SQL Commands
In addition to retrieving rows of data, the SELECT command also allows you to apply functions to those rows in various ways. The built-in REALbasic database engine supports COUNT, MIN, MAX, AVG, and SUM. For example, here is the SQL to find out how many teams there are (you can use SQLVue to test out SQL statements -- see our last column):
SELECT COUNT(key) FROM team
Last time, we used the INSERT command to add rows to our tables. The companion to the INSERT command is the DELETE command, which removes rows from a table. This is the SQL to delete the "Ducks" team from the team table:
DELETE FROM team WHERE name = "Ducks"
Use this command with caution! A command as simple as "DELETE FROM team" would remove all the rows from the team table.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|











