CREATE SCHEMA PUBLIC AUTHORIZATION DBA
CREATE MEMORY TABLE DEPARTMENT(DEPTID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,NAME VARCHAR(255),BUDGET INTEGER,Q1 INTEGER,Q2 INTEGER,Q3 INTEGER,Q4 INTEGER,DEPTCODE VARCHAR(20),LOCATION VARCHAR(255),TENANTID INTEGER DEFAULT 1)
CREATE MEMORY TABLE EMPLOYEE(EID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,FIRSTNAME VARCHAR(255),LASTNAME VARCHAR(255),STREET VARCHAR(255),CITY VARCHAR(255),STATE VARCHAR(2),ZIP VARCHAR(255),BIRTHDATE DATE,PICURL VARCHAR(255),TWITTERID VARCHAR(40),DEPTID INTEGER,MANAGERID INTEGER,TENANTID INTEGER DEFAULT 1,CONSTRAINT DEPTFKEY FOREIGN KEY(DEPTID) REFERENCES DEPARTMENT(DEPTID),CONSTRAINT MGRFKEY FOREIGN KEY(MANAGERID) REFERENCES EMPLOYEE(EID))
CREATE MEMORY TABLE VACATION(ID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,STARTDATE DATE,ENDDATE DATE,EMPID INTEGER NOT NULL,TENANTID INTEGER DEFAULT 1,CONSTRAINT EMPFKEY FOREIGN KEY(EMPID) REFERENCES EMPLOYEE(EID))
CREATE MEMORY TABLE USER(USERID INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1) NOT NULL PRIMARY KEY,USERNAME VARCHAR(20),PASSWORD VARCHAR(20),ROLE VARCHAR(20),TENANTID INTEGER DEFAULT 1)
ALTER TABLE DEPARTMENT ALTER COLUMN DEPTID RESTART WITH 11
ALTER TABLE EMPLOYEE ALTER COLUMN EID RESTART WITH 11
ALTER TABLE VACATION ALTER COLUMN ID RESTART WITH 22
ALTER TABLE USER ALTER COLUMN USERID RESTART WITH 7
CREATE USER SA PASSWORD ""
GRANT DBA TO SA
SET WRITE_DELAY 10
SET SCHEMA PUBLIC
INSERT INTO DEPARTMENT VALUES(1,'Engineering',1936760,445455,522925,426087,542293,'Eng','San Francisco',1)
INSERT INTO DEPARTMENT VALUES(2,'Marketing',1129777,225955,271146,327635,305040,'Mktg','New York',1)
INSERT INTO DEPARTMENT VALUES(3,'General and Admin',1452570,435771,290514,348617,377668,'G&A','San Francisco',1)
INSERT INTO DEPARTMENT VALUES(4,'Sales',2743744,493874,658499,713373,877998,'Sales','Austin',1)
INSERT INTO DEPARTMENT VALUES(5,'Professional Services',806984,201746,201746,177536,225955,'PS','San Francisco',2)
INSERT INTO EMPLOYEE VALUES(1,'Harpo','Marx','1 Broadway Street','New York','NY','10036','1888-11-23','http://dev.wavemaker.com/example/comedians/harpomarx.jpg','jokes',1,NULL,1)
INSERT INTO EMPLOYEE VALUES(2,'Stanley','Laurel','25 Liberty Way','Boston','MA','11343','1887-03-19','http://dev.wavemaker.com/example/comedians/stanleylaurel.jpg','TheOnion',1,1,1)
INSERT INTO EMPLOYEE VALUES(3,'Oliver','Hardy','2525 Cypress Lane','Atlanta','GA','14231','1890-09-30','http://dev.wavemaker.com/example/comedians/oliverhardy.jpg','WaveMakerDev',1,1,1)
INSERT INTO EMPLOYEE VALUES(4,'Shirley','Temple','45 Houston Street','New York','NY','10106','1893-10-21','http://dev.wavemaker.com/example/comedians/shirleytemple.jpg','billmaher',1,2,1)
INSERT INTO EMPLOYEE VALUES(5,'Dan','Ackroyd','346 Mulholland Drive','Los Angeles','CA','94036','1901-02-25','http://dev.wavemaker.com/example/comedians/danackroyd.jpg','JimCarrey',2,NULL,1)
INSERT INTO EMPLOYEE VALUES(6,'John','Belushi','6000 Sunset Boulevard','Los Angeles','CA','90028','1896-09-30','http://dev.wavemaker.com/example/comedians/johnbelushi.jpg','thinkstrategies',2,5,1)
INSERT INTO EMPLOYEE VALUES(7,'George','Carlin','6400 Hollywood Boulevard','Hollywood','CA','97028','1895-03-04','http://dev.wavemaker.com/example/comedians/georgecarlin.jpg','Scobleizer',2,5,1)
INSERT INTO EMPLOYEE VALUES(8,'Will','Rogers','1000 Brownsville Road','Brooklyn','NY','11212','1897-06-18','http://dev.wavemaker.com/example/comedians/willrogers.jpg','jhurwitz',5,NULL,2)
INSERT INTO EMPLOYEE VALUES(9,'Carol','Burnett','300 South Street','Philadephia','PA','19147','1902-10-04','http://dev.wavemaker.com/example/comedians/carolburnett.jpg','gigastacey',5,8,2)
INSERT INTO EMPLOYEE VALUES(10,'George','Burns','3 YukYuk Way','San Gabriel','CA','91775','1903-10-21','http://dev.wavemaker.com/example/comedians/georgeburns.jpg','TechCrunch',5,8,2)
INSERT INTO VACATION VALUES(1,'1920-11-23','1920-11-27',1,1)
INSERT INTO VACATION VALUES(2,'1921-12-05','1921-12-07',1,1)
INSERT INTO VACATION VALUES(3,'1920-10-06','1920-11-12',2,1)
INSERT INTO VACATION VALUES(4,'1921-01-01','1921-02-16',2,1)
INSERT INTO VACATION VALUES(5,'1922-08-14','1922-11-16',3,1)
INSERT INTO VACATION VALUES(6,'1923-09-07','1923-10-09',2,1)
INSERT INTO VACATION VALUES(7,'1918-11-03','1918-11-04',4,1)
INSERT INTO VACATION VALUES(8,'1919-06-10','1919-12-25',4,1)
INSERT INTO VACATION VALUES(9,'1934-11-07','1934-11-08',5,1)
INSERT INTO VACATION VALUES(10,'1924-03-13','1924-04-01',5,1)
INSERT INTO VACATION VALUES(11,'1918-11-18','1918-11-19',6,1)
INSERT INTO VACATION VALUES(12,'1921-08-08','1921-08-10',6,1)
INSERT INTO VACATION VALUES(13,'1920-11-23','1920-11-27',7,2)
INSERT INTO VACATION VALUES(14,'1921-12-23','1921-12-25',7,2)
INSERT INTO VACATION VALUES(15,'1960-08-11','1960-08-15',8,2)
INSERT INTO VACATION VALUES(16,'1951-01-12','1951-02-14',8,2)
INSERT INTO VACATION VALUES(17,'1920-11-05','1920-11-07',9,2)
INSERT INTO VACATION VALUES(18,'1921-04-04','1921-05-12',9,2)
INSERT INTO VACATION VALUES(19,'1944-11-11','1944-11-14',10,2)
INSERT INTO VACATION VALUES(20,'1951-12-03','1951-12-05',10,2)
INSERT INTO USER VALUES(1,'admin','admin','adminrole',1)
INSERT INTO USER VALUES(2,'user','user','userrole',1)
INSERT INTO USER VALUES(3,'admin2','admin2','adminrole',2)
INSERT INTO USER VALUES(4,'user2','user2','userrole',2)
INSERT INTO USER VALUES(6,'anon','anon','anonymous',1)
