Top > SAStrutsあれこれ > HSQLDBデータベースを作成

Everything is expanded.Everything is shortened.
  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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE DEPARTMENT(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,NAME VARCHAR(255) NOT NULL,VERSION INTEGER NOT NULL)
CREATE MEMORY TABLE ADDRESS(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,NAME VARCHAR(255) NOT NULL,VERSION INTEGER NOT NULL)
CREATE MEMORY TABLE EMPLOYEE(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL PRIMARY KEY,NAME VARCHAR(255) NOT NULL,JOB_TYPE VARCHAR(30),SALARY INTEGER,DEPARTMENT_ID INTEGER,ADDRESS_ID INTEGER,VERSION INTEGER NOT NULL,CONSTRAINT FK_DEPARTMENT FOREIGN KEY(DEPARTMENT_ID) REFERENCES DEPARTMENT(ID),CONSTRAINT FK_ADDRESS FOREIGN KEY(ADDRESS_ID) REFERENCES ADDRESS(ID))
ALTER TABLE DEPARTMENT ALTER COLUMN ID RESTART WITH 5
ALTER TABLE ADDRESS ALTER COLUMN ID RESTART WITH 15
ALTER TABLE EMPLOYEE ALTER COLUMN ID RESTART WITH 15
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 20
SET SCHEMA PUBLIC
INSERT INTO DEPARTMENT VALUES(1,'ACCOUNTING',1)
INSERT INTO DEPARTMENT VALUES(2,'RESEARCH',1)
INSERT INTO DEPARTMENT VALUES(3,'SALES',1)
INSERT INTO DEPARTMENT VALUES(4,'OPERATIONS',1)
INSERT INTO ADDRESS VALUES(1,'STREET 1',1)
INSERT INTO ADDRESS VALUES(2,'STREET 2',1)
INSERT INTO ADDRESS VALUES(3,'STREET 3',1)
INSERT INTO ADDRESS VALUES(4,'STREET 4',1)
INSERT INTO ADDRESS VALUES(5,'STREET 5',1)
INSERT INTO ADDRESS VALUES(6,'STREET 6',1)
INSERT INTO ADDRESS VALUES(7,'STREET 7',1)
INSERT INTO ADDRESS VALUES(8,'STREET 8',1)
INSERT INTO ADDRESS VALUES(9,'STREET 9',1)
INSERT INTO ADDRESS VALUES(10,'STREET 10',1)
INSERT INTO ADDRESS VALUES(11,'STREET 11',1)
INSERT INTO ADDRESS VALUES(12,'STREET 12',1)
INSERT INTO ADDRESS VALUES(13,'STREET 13',1)
INSERT INTO ADDRESS VALUES(14,'STREET 14',1)
INSERT INTO EMPLOYEE VALUES(1,'ALLEN','SALESMAN',1600,3,1);
INSERT INTO EMPLOYEE VALUES(2,'WARD','SALESMAN',1250,3,2);
INSERT INTO EMPLOYEE VALUES(3,'JONES','MANAGER',2975,2,3);
INSERT INTO EMPLOYEE VALUES(4,'MARTIN','SALESMAN',1250,3,4);
INSERT INTO EMPLOYEE VALUES(5,'BLAKE','MANAGER',2850,3,5);
INSERT INTO EMPLOYEE VALUES(6,'CLARK','MANAGER',2450,1,6);
INSERT INTO EMPLOYEE VALUES(7,'SCOTT','ANALYST',3000,2,7);
INSERT INTO EMPLOYEE VALUES(8,'KING','PRESIDENT',5000,1,8);
INSERT INTO EMPLOYEE VALUES(9,'TURNER','SALESMAN',1500,3,9);
INSERT INTO EMPLOYEE VALUES(10,'ADAMS','CLERK',1100,2,10);
INSERT INTO EMPLOYEE VALUES(11,'JAMES','CLERK',950,3,11);
INSERT INTO EMPLOYEE VALUES(12,'FORD','ANALYST',3000,2,12);
INSERT INTO EMPLOYEE VALUES(13,'MILLER','CLERK',1300,1,13);
INSERT INTO EMPLOYEE VALUES(14,'SMITH','CLERK',800,2,14);
  0
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
#HSQL Database Engine 1.8.0.10
#Wed Dec 03 18:51:38 JST 2008
hsqldb.script_format=0
runtime.gc_interval=0
sql.enforce_strict_size=false
hsqldb.cache_size_scale=8
readonly=false
hsqldb.nio_data_file=true
hsqldb.cache_scale=14
version=1.8.0
hsqldb.default_table_type=memory
hsqldb.cache_file_scale=1
hsqldb.log_size=200
modified=yes
hsqldb.cache_version=1.7.0
hsqldb.original_version=1.8.0
hsqldb.compatible_version=1.8.0

リロード   新規 編集 凍結解除 差分 添付 複製 名前変更   ホーム 一覧 単語検索 最終更新 バックアップ リンク元   ヘルプ   最終更新のRSS
Last-modified: 2012-08-08 (水) 23:26:03 (2925d)