1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
|
-- ----------------------------------------------------------------------------
-- --
-- GNADE : GNu Ada Database Environment --
-- --
-- Filename : $Source: /cvsroot/gnade/gnade/samples/sample_db/gnade.mysql.sql,v $
-- Description : Makefile for the PostgreSQL sample database
-- Author : Michael Erdmann <michael.erdmann@snafu.de>
-- Created On : 02-April-2001
-- Last Modified By: $Author: merdmann $
-- Last Modified On: $Date: 2002/01/23 20:07:01 $
-- Status : $State: Exp $
--
-- Copyright (C) 2000-2001
--
-- GNADE is copyrighted by the persons and institutions enumerated in the --
-- AUTHORS file. This file is located in the root directory of the --
-- GNADE distribution. --
-- --
-- GNADE is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
-- As a special exception, if other files instantiate generics from --
-- GNADE Ada units, or you link GNADE Ada units or libraries with other --
-- files to produce an executable, these units or libraries do not by --
-- itself cause the resulting executable to be covered by the GNU --
-- General Public License. This exception does not however invalidate --
-- any other reasons why the executable file might be covered by the --
-- GNU Public License. --
-- --
-- GNADE is implemented to work with GNAT, the GNU Ada compiler. --
-- --
-- ----------------------------------------------------------------------------
-- Functional Description
-- ======================
-- This SQL Script generates the test data base as it is used by
-- the code in the ./samples directory. The demo user has username="gnade"
-- and password="gnade".
--
--
-- Restrictions
-- ============
-- This script is intended for use with MySQL.
--
-- References
-- ==========
--
-- build the test data base and store some tupples in it
use gnade;
CREATE TABLE EMPLOYEES (
empno int4 NOT NULL,
name character(20) NOT NULL,
firstname character(20),
deptno int4,
since date,
manager int4,
job character(20),
promotion bool,
salary decimal(8,4)
);
CREATE TABLE DEPARTMENTS (
deptno int4 NOT NULL,
name character(20) NOT NULL,
location character(20)
);
-- Testdata
insert into EMPLOYEES values
( 1, 'Erdmann', 'Michael', 1001, '1999-12-31', 2, 'Coding Monkey', 1, 200.1234 );
insert into EMPLOYEES values
( 2, 'Massalski', 'Marina', 1000, '2000-01-09', null, 'Supervisor', 0, 200.00 );
insert into EMPLOYEES values
( 3, 'Tully', 'Noel', 1001, '1959-01-23', 2, 'Supervisor', 1, 200.00 );
insert into EMPLOYEES values
( 4, 'Pfeifer', 'Jrgen', 1001, '2001-01-01', 2, 'Designer', 1, 200.00 );
insert into EMPLOYEES values
( 5, 'Smith', 'John', 1000, '1980-06-11', 3, 'Coding Monkey', 1, 250.00 );
insert into EMPLOYEES values
( 6, 'Smith', 'John', 1001, '1972-06-11', 3, 'Designer', 1, 820.00 );
insert into EMPLOYEES values
( 50, 'Simpson', 'Bud', 1003, '1980-06-11', 3, 'Clerk', 0, 20.00 );
insert into EMPLOYEES values
( 51, 'Bundy', 'Al', 1003, '1980-06-11', 3, 'Clerk', 0, 10.00 );
insert into EMPLOYEES values
( 52, 'Bundy', 'Peggy', 1003, '1988-06-15', 3, null, 0, -10.00 );
insert into EMPLOYEES values
( 53, 'Simpson', 'Kelly', 1003, '1995-09-11', 3, 'Secretary', 0, 20.00 );
insert into EMPLOYEES values
(500, 'Rutherford', 'Ernest', 2000, '1930-05-30', 3, 'Genius', 1, 1200.00 );
insert into EMPLOYEES values
(501, 'Fermi', null, 2000, '1940-07-29', 3, 'Genius', 1, 1200.00 );
insert into EMPLOYEES values
(502, 'Einstein', 'Albert', 2000, '1941-04-30', 2, 'Genius', 1, 1200.00 );
insert into EMPLOYEES values
(503, 'Fermi', null, 2000, '1020-08-15', 2, 'Genius', 1, 1200.99 );
insert into DEPARTMENTS
values( 1001, 'Sales', 'Berlin' );
insert into DEPARTMENTS
values( 1000, 'Developement', 'Stuttgart' );
insert into DEPARTMENTS
values( 1002, 'CM and Production', 'Bonn' );
insert into DEPARTMENTS
values( 1003, 'Support', 'Chicago' );
insert into DEPARTMENTS
values( 2000, 'Masterminds', null );
CREATE TABLE LOCATIONS (
NAME CHARACTER(20) NOT NULL PRIMARY KEY,
CITY VARCHAR(40),
STREET VARCHAR(80),
NO CHARACTER(5),
ZIPCODE INT
) ;
insert into LOCATIONS
values( 'Berlin', 'Berlin','Siemensdamm', '50a', 10243 );
insert into LOCATIONS
values( 'Bonn', 'Bonn','Oberkasselerstrasse', '8', 47112 );
insert into LOCATIONS
values( 'Stuttgart', 'Stuttgart','Lorenzweg', '1', 60001 );
insert into LOCATIONS
values( 'Chicage', 'Chicago','Bundy Stree', '9996', 70001 );
|