Source

EYuiDemo / protected / data / eyuirelation-demo.sql

CREATE TABLE tbl_company (
    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
    name VARCHAR(128) NOT NULL
);

CREATE TABLE tbl_job (
    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
	company_id INTEGER NOT NULL,
    name VARCHAR(128) NOT NULL
);

CREATE TABLE tbl_department (
    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
	company_id INTEGER NOT NULL,
    name VARCHAR(128) NOT NULL
);

INSERT INTO tbl_company (id,name) VALUES (1, 'software & designers co');
INSERT INTO tbl_company (id,name) VALUES (2, 'website masters co');

INSERT INTO tbl_job (company_id,name) VALUES (1, 'analist');
INSERT INTO tbl_job (company_id,name) VALUES (1, 'programmer');

INSERT INTO tbl_job (company_id,name) VALUES (2, 'template creator');
INSERT INTO tbl_job (company_id,name) VALUES (2, 'html designer');

INSERT INTO tbl_department (company_id,name) VALUES (1, 'administration');
INSERT INTO tbl_department (company_id,name) VALUES (1, 'programming');

INSERT INTO tbl_department (company_id,name) VALUES (2, 'reception');
INSERT INTO tbl_department (company_id,name) VALUES (2, 'graphics');

CREATE TABLE tbl_userjob (
    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
	user_id INTEGER NOT NULL,
	company_id INTEGER NOT NULL
);

CREATE TABLE tbl_userdepartment (
    id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
	user_id INTEGER NOT NULL,
	company_id INTEGER NOT NULL
);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.