android

android tips and tutorials

SQLite foreign key examples

SQLite foreign keys FAQ: Can you show me how to define foreign keys in a SQLite database table design?

The SQLite database does support foreign keys, and its foreign key syntax is similar to other databases. Here's a quick SQLite foreign key example.

SQLite FAQ - How to show the schema for a SQLite database table

SQLite schema FAQ: How do I list the schema for SQLite database table?

To view the schema for a SQLite database table, just use the SQLite schema dot command, like this:

SQLite autoincrement - How to get the autoincrement value from the last insert

SQLite autoincrement FAQ: How do I get the autoincrement value from my last SQLite INSERT command?

You can get the integer value of the primary key field from the last insert into an autoincrement field using a SQLite function named last_insert_rowid(), as shown here.

SQLite autoincrement - How to create an autoincrement field in SQLite

SQLite FAQ - How do I create an autoincrement field in SQLite?

You define a SQLite autoincrement field (also known as a serial, identity, or primary key field) with this syntax:

Syndicate content