On Sun, May 25, 2008 at 12:37 PM, Todd Benson <caduceass / gmail.com> wrote:

> No solid constraints for data integrity.  Like foreign key
> constraints, for example.  Somebody mentioned on this list in a
> different thread, though, that this will change in the future.  Here's
> a contrived example without caps...
>
> sqlite3 --version
> => 3.4.0
> sqlite3
>
> create table food (
>  ingredient varchar not null primary key
> );
>
> create table measurements (
>  measurement varchar not null primary key
> );
>
> create table preparation (
>  measurement not null references measurements (measurement),
>  ingredient not null references food (ingredient),
>  primary key (measurement, ingredient)
> );
>
> insert into food values ("garlic");
> insert into measurements ("clove");

Oops, there was supposed to be a values after measurements there.  The
point still stands, though.

> insert into preparation (measurement, ingredient) values ("garlic", "clove");
> insert into preparation (measurement, ingredient) values ("clove", "garlic");
> select * from preparation;
>
> => garlic |clove (yes, the result has that space after garlic)
> => clove|garlic
>
> Sort of a bandaid on logic, especially considering that the above code
> complies with the SQL92 standard.  Hey, but it's small, fast, and
> works for some things.
>
> Sorry for the bad vibe, but people need to be aware that they are not
> working with an RDBMS.
>
> Todd
>