Article Preview
Buy Now
| Print: | |
| PDF: |
Databases for Real
REALSQLDatabase (SQLite)
Issue: 4.5 (May/June 2006)
Article Description: No description available.
Article Length (in bytes): 2,940
Starting Page Number: 36
RBD Number: 4512
Resource File(s): None
Related Link(s): None
Known Limitations: None
Excerpt of article text...
Today we will discuss the various REAL SQL Database commands for manipulating data in a database. These commands are listed in Table 1. We'll stick with the simple URL database example from last time as we look at these commands.
Adding Data to Your Tables
None of the other commands mean much if you don't have any data in your tables. Data is added using the INSERT command. The SQLite INSERT commands works pretty much the same as INSERT for any other database. A quick example:
INSERT INTO bookmark (URL, Description) VALUES ('http://www.sqlite.org', 'SQLite Website')
As with most other databases, you can also use data from another table as the value for an INSERT command. An example would be:
INSERT INTO bookmark (URL, Description) SELECT value1, value2 FROM table1
Fetching Data from Your Tables
The SQLite SELECT command has many options for fetching your data. It has full support for the basic commands, such as WHERE, HAVING, and ORDER BY. Even better, it has excellent join support, can limit result counts and can handle unions and intersections. Here are some examples:
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|








