source: trunk/examples/demo/sql/book.sql@ 203

Last change on this file since 203 was 160, checked in by dmik, 19 years ago

Imported table and iconview modules and a bunch of dependent examples from the official release 3.3.1 from Trolltech.

File size: 1.4 KB
Line 
1-- The following SQL generates the database
2-- used by the 'book' example programs
3-- Copyright (C) 1992-2001 Trolltech AS. All rights reserved.
4--
5-- This file is part of an example program for Qt. This example
6-- program may be used, distributed and modified without limitation.
7
8DROP TABLE author;
9DROP TABLE book;
10DROP TABLE sequence;
11
12CREATE TABLE author
13( id integer primary key,
14forename varchar(40),
15surname varchar(40) );
16
17CREATE TABLE book
18( id integer primary key,
19title varchar(40),
20price numeric(10,2),
21authorid integer,
22notes varchar(255) );
23
24create index book_authorid_idx on book( authorid );
25
26CREATE TABLE sequence
27( tablename varchar(10),
28sequence numeric);
29
30INSERT INTO author VALUES ( 0, 'Philip K', 'Dick' );
31INSERT INTO author VALUES ( 1, 'Robert', 'Heinlein' );
32INSERT INTO author VALUES ( 2, 'Sarah', 'Paretsky' );
33
34INSERT INTO book VALUES ( 0, 'The Man Who Japed', 6.99, 0, 'A good book' );
35INSERT INTO book VALUES ( 1, 'The Man in the High Castle', 9.99, 0, 'Worth reading' );
36INSERT INTO book VALUES ( 2, 'The Number of the Beast', 8.99, 1, 'Get this!' );
37INSERT INTO book VALUES ( 3, 'Indemnity Only', 9.99, 2, 'Cool' );
38INSERT INTO book VALUES ( 4, 'Burn Marks', 9.99, 2, 'Need to make notes' );
39INSERT INTO book VALUES ( 5, 'Deadlock', 9.99, 2, 'Hmmm..' );
40
41INSERT INTO sequence VALUES ( 'author', 2 );
42INSERT INTO sequence VALUES ( 'book', 5 );
Note: See TracBrowser for help on using the repository browser.