Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

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.


 


|

 


Weblog Commenting and Trackback by HaloScan.com