sql stringlengths 6 1.05M |
|---|
--? age: num = 18 // 最低年龄
select
name, age
from student
where age >= @age |
SELECT max(value$)
FROM `bigquery-public-data.crypto_ethereum.transactions`
group bye hash
LIMIT 10 |
<gh_stars>10-100
UPDATE configuration SET version = '0.20';
DROP FUNCTION get_project_display_name(TEXT);
DROP FUNCTION get_package_description(TEXT);
DROP FUNCTION get_project_files(TEXT);
DROP FUNCTION get_project_versions(TEXT);
DROP FUNCTION get_file_apt_dependencies(VARCHAR);
CREATE FUNCTION get_project_data(pkg TEXT)
RETURNS JSON
LANGUAGE SQL
RETURNS NULL ON NULL INPUT
SECURITY DEFINER
SET search_path = public, pg_temp
AS $sql$
WITH abi_scores AS (
SELECT
v.version,
b.build_id,
CASE
WHEN ba.abi_tag = b.abi_tag THEN
CASE
-- Best case: builder of requested ABI produced compiled
-- file of requested ABI
WHEN b.status AND f.abi_tag = ba.abi_tag THEN 5
-- Good case: builder of expected ABI produced 'none' ABI
-- build
WHEN b.status AND f.abi_tag = 'none' THEN 4
WHEN b.status AND f.abi_tag = 'abi3' THEN 4
-- Builder of requested ABI produced failure
WHEN NOT b.status THEN 2
-- Builder of requested ABI succeeded but produced no
-- files (or files were overwritten by duplicate attempt)
WHEN b.status AND f.abi_tag is NULL THEN 1
-- Pending build for the requested ABI
WHEN b.status IS NULL THEN 0
-- Unexpected case
ELSE -2
END
ELSE
CASE
-- Weird case: builder of different ABI produced compiled
-- file with requested ABI
WHEN b.status AND f.abi_tag = ba.abi_tag THEN 4
-- Good case: builder of unexpected ABI produced compatible
-- build
WHEN b.status AND f.abi_tag = 'none' THEN 3
WHEN b.status AND f.abi_tag = 'abi3' THEN 3
-- Skipped package/version with no build, or pending build
WHEN b.status IS NULL THEN 1
-- Irrelevant cases
WHEN b.status THEN -1
WHEN NOT b.status THEN -1
-- Unexpected case
ELSE -2
END
END AS score,
CASE f.abi_tag
WHEN 'none' THEN ba.abi_tag
WHEN 'abi3' THEN ba.abi_tag
ELSE COALESCE(f.abi_tag, b.abi_tag, ba.abi_tag)
END AS calc_abi_tag,
CASE
WHEN p.skip <> '' THEN 'skip'
WHEN v.skip <> '' THEN 'skip'
WHEN b.status AND f.build_id IS NOT NULL THEN 'success'
WHEN NOT b.status THEN 'fail'
WHEN b.build_id IS NULL THEN 'pending'
ELSE 'error'
END AS calc_status
FROM
packages p
JOIN versions v USING (package)
CROSS JOIN build_abis ba
LEFT JOIN builds b
ON b.package = v.package
AND b.version = v.version
-- TODO The <= comparison is *way* too simplisitic
AND b.abi_tag <= ba.abi_tag
LEFT JOIN files f USING (build_id)
WHERE ba.skip = ''
AND v.package = pkg
),
abi_parts AS (
SELECT
abi_scores.*,
ROW_NUMBER() OVER (
PARTITION BY version, calc_abi_tag
ORDER BY score DESC
) AS num
FROM abi_scores
),
abi_objects AS (
SELECT
version,
json_object_agg(
calc_abi_tag,
json_build_object(
'status', calc_status,
'build_id', build_id
)
) AS obj
FROM abi_parts
WHERE score >= 0
AND num = 1
GROUP BY version
),
file_objects AS (
SELECT
b.version,
json_object_agg(
f.filename,
json_build_object(
'hash', f.filehash,
'size', f.filesize,
'abi_builder', b.abi_tag,
'abi_file', f.abi_tag,
'platform', f.platform_tag,
'requires_python', f.requires_python,
'apt_dependencies', (
SELECT
COALESCE(json_agg(dependency), '{{}}')
FROM (
SELECT dependency
FROM dependencies
WHERE filename = f.filename AND tool = 'apt'
EXCEPT ALL
SELECT apt_package
FROM preinstalled_apt_packages
WHERE abi_tag = f.abi_tag
) AS d
)
)
) AS obj
FROM files f
JOIN builds b USING (build_id)
WHERE b.package = pkg
GROUP BY b.version
)
VALUES (
json_build_object(
'name', (
SELECT name
FROM package_names
WHERE package = pkg
ORDER BY seen DESC
LIMIT 1
),
'description', (
SELECT description
FROM packages
WHERE package = pkg
),
'releases', (
SELECT COALESCE(json_object_agg(
v.version,
json_build_object(
'yanked', v.yanked,
'released', v.released AT TIME ZONE 'UTC',
'skip', COALESCE(NULLIF(v.skip, ''), p.skip),
'files', COALESCE(f.obj, '{{}}'),
'abis', COALESCE(a.obj, '{{}}')
)
), '{{}}')
FROM
packages p
JOIN versions v USING (package)
LEFT JOIN file_objects f USING (version)
LEFT JOIN abi_objects a USING (version)
WHERE p.package = pkg
)
)
);
$sql$;
REVOKE ALL ON FUNCTION get_project_data(TEXT) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION get_project_data(TEXT) TO {username};
DROP FUNCTION log_build_success(
TEXT, TEXT, INTEGER, INTERVAL, TEXT, TEXT, files ARRAY,
dependencies ARRAY);
DROP FUNCTION log_build_failure(TEXT, TEXT, INTEGER, INTERVAL, TEXT, TEXT);
CREATE FUNCTION log_build_success(
package TEXT,
version TEXT,
built_by INTEGER,
duration INTERVAL,
abi_tag TEXT,
build_files files ARRAY,
build_deps dependencies ARRAY
)
RETURNS INTEGER
LANGUAGE plpgsql
CALLED ON NULL INPUT
SECURITY DEFINER
SET search_path = public, pg_temp
AS $sql$
DECLARE
new_build_id INTEGER;
BEGIN
IF ARRAY_LENGTH(build_files, 1) = 0 THEN
RAISE EXCEPTION integrity_constraint_violation
USING MESSAGE = 'Successful build must include at least one file';
END IF;
INSERT INTO builds (
package,
version,
built_by,
duration,
status,
abi_tag
)
VALUES (
package,
version,
built_by,
duration,
TRUE,
abi_tag
)
RETURNING build_id
INTO new_build_id;
-- We delete the existing entries from files rather than using INSERT..ON
-- CONFLICT UPDATE because we need to delete dependencies associated with
-- those files too. This is considerably simpler than a multi-layered
-- upsert across tables.
DELETE FROM files f
USING UNNEST(build_files) AS b
WHERE f.filename = b.filename;
INSERT INTO files (
filename,
build_id,
filesize,
filehash,
package_tag,
package_version_tag,
py_version_tag,
abi_tag,
platform_tag,
requires_python
)
SELECT
b.filename,
new_build_id,
b.filesize,
b.filehash,
b.package_tag,
b.package_version_tag,
b.py_version_tag,
b.abi_tag,
b.platform_tag,
b.requires_python
FROM
UNNEST(build_files) AS b;
INSERT INTO dependencies (
filename,
tool,
dependency
)
SELECT
d.filename,
d.tool,
d.dependency
FROM
UNNEST(build_deps) AS d;
RETURN new_build_id;
END;
$sql$;
CREATE FUNCTION log_build_failure(
package TEXT,
version TEXT,
built_by INTEGER,
duration INTERVAL,
abi_tag TEXT
)
RETURNS INTEGER
LANGUAGE plpgsql
CALLED ON NULL INPUT
SECURITY DEFINER
SET search_path = public, pg_temp
AS $sql$
DECLARE
new_build_id INTEGER;
BEGIN
INSERT INTO builds (
package,
version,
built_by,
duration,
status,
abi_tag
)
VALUES (
package,
version,
built_by,
duration,
FALSE,
abi_tag
)
RETURNING build_id
INTO new_build_id;
RETURN new_build_id;
END;
$sql$;
REVOKE ALL ON FUNCTION log_build_success(
TEXT, TEXT, INTEGER, INTERVAL, TEXT, files ARRAY, dependencies ARRAY
) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION log_build_success(
TEXT, TEXT, INTEGER, INTERVAL, TEXT, files ARRAY, dependencies ARRAY
) TO {username};
REVOKE ALL ON FUNCTION log_build_failure(
TEXT, TEXT, INTEGER, INTERVAL, TEXT
) FROM PUBLIC;
GRANT EXECUTE ON FUNCTION log_build_failure(
TEXT, TEXT, INTEGER, INTERVAL, TEXT
) TO {username};
DROP TABLE output;
|
<filename>db/sql-scripts/procedures/Create_SP_Employee.sql
DROP VIEW IF EXISTS LATEST_HR_RECORDS;
CREATE VIEW LATEST_HR_RECORDS AS SELECT HR_RECORD.* FROM HR_RECORD WHERE (EMPLOYEE_ID, HR_RECORD.VERSION) IN (SELECT EMPLOYEE_ID, MAX(HR_RECORD.VERSION) AS LATEST_VERSION FROM `HR_RECORD` GROUP BY EMPLOYEE_ID);
-- STORED PROCEDURES FOR EmployeeService
-- -----------------------------------------------------
-- procedure create_onboarding_task
-- - create a onboarding task for the given employee,
-- - only if the employee and type exist
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS create_onboarding_task;
DELIMITER //
CREATE PROCEDURE `create_onboarding_task` (IN employee_id INT
, IN type_id INT
, IN created_date DATE
, IN due_date DATE
, IN expiry_date DATE
, IN description VARCHAR(2512)
, IN require_doc TINYINT
)
BEGIN
DECLARE emplChecker INT;
DECLARE typeChecker INT;
SET emplChecker = 0;
SET typeChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker FROM `HR_RECORD` WHERE `HR_RECORD`.EMPLOYEE_ID = employee_id;
IF type_id IS NOT NULL THEN
SELECT COUNT(DOC_TYPE_ID) INTO typeChecker FROM `DOC_TYPE` WHERE `DOC_TYPE`.DOC_TYPE_ID = type_id;
IF typeChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Document type does not exist.';
END IF;
END IF;
IF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
INSERT INTO ONBOARDING_TASK (EMPLOYEE_ID, DOC_TYPE_ID, CREATED_DATE, DUE_DATE, EXPIRY_DATE, DESCRIPTION, REQUIRE_DOC)
VALUES (employee_id, type_id, created_date, due_date, expiry_date, description, require_doc);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure complete_onboarding_task
-- - create a onboarding task for the given employee,
-- - only if the employee and type exist
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS complete_onboarding_task;
DELIMITER //
CREATE PROCEDURE `complete_onboarding_task` (IN onboarding_task_id INT
, IN actual_file BLOB(25000000)
, IN mime_type VARCHAR(100)
)
BEGIN
DECLARE taskChecker INT;
DECLARE requireChecker INT;
SET taskChecker = 0;
SET requireChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO taskChecker FROM `ONBOARDING_TASK` WHERE `ONBOARDING_TASK`.ONBOARDING_TASK_ID = onboarding_task_id;
IF taskChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'The onboarding task does not exist.';
ELSE
SELECT REQUIRE_DOC INTO requireChecker FROM `ONBOARDING_TASK` WHERE `ONBOARDING_TASK`.ONBOARDING_TASK_ID = onboarding_task_id;
IF requireChecker = 0 THEN
UPDATE ONBOARDING_TASK SET
ONBOARDING_TASK.STATUS = 1 WHERE ONBOARDING_TASK.ONBOARDING_TASK_ID = onboarding_task_id;
ELSE
UPDATE ONBOARDING_TASK SET
ONBOARDING_TASK.STATUS = 1, ONBOARDING_TASK.ACTUAL_FILE = actual_file, ONBOARDING_TASK.MIME_TYPE = mime_type WHERE ONBOARDING_TASK.ONBOARDING_TASK_ID = onboarding_task_id;
END IF;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure create_employee
-- - create an employee, provided SIN and email are
-- - not already in use
-- - Version = 0 to indicate a new employee
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS create_employee;
DELIMITER //
CREATE PROCEDURE `create_employee`(IN created_by_id INT
, IN role INT
, IN SIN INT
, IN email VARCHAR(100)
, IN first_name VARCHAR(100)
, IN last_name VARCHAR(100)
, IN address VARCHAR(512)
, IN birthdate DATE
, IN vacation_days INT
, IN remaining_vacation_days INT
, IN FTE TINYINT
, IN status TINYINT
, IN password VARCHAR(200)
, IN salary DECIMAL(10, 2)
, IN date_joined DATE
, IN admin_level TINYINT
, IN phone_number VARCHAR(45)
)
BEGIN
DECLARE sinChecker INT;
DECLARE emailChecker INT;
DECLARE employeeID INT;
DECLARE created_date DATE;
SET sinChecker = 0;
SET emailChecker = 0;
SELECT NOW() INTO created_date;
SELECT COUNT(SIN) INTO sinChecker
FROM `LATEST_HR_RECORDS`
WHERE `LATEST_HR_RECORDS`.SIN = SIN;
SELECT COUNT(EMAIL) INTO emailChecker
FROM `LATEST_HR_RECORDS`
WHERE `LATEST_HR_RECORDS`.EMAIL = email;
IF sinChecker > 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'SIN already in use.';
ELSEIF emailChecker > 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Email already in use.';
ELSEIF salary < 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Salary cannot be negative.';
ELSEIF remaining_vacation_days < 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Remaining vacation days cannot be negative.';
ELSEIF vacation_days < 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Vacation days cannot be negative.';
ELSE
INSERT INTO EMPLOYEE VALUES();
SELECT LAST_INSERT_ID() INTO employeeID;
INSERT INTO HR_RECORD (
EMPLOYEE_ID, VERSION, CREATED_BY, ROLE, SIN, EMAIL, FIRST_NAME, LAST_NAME, ADDRESS, BIRTHDATE, VACATION_DAYS,
REMAINING_VACATION_DAYS, FTE, STATUS, PASSWORD, SALARY, DATE_JOINED, ADMIN_LEVEL, CREATED_DATE, PHONE_NUMBER)
VALUES (
employeeID, 1, created_by_id, role, SIN, email, first_name, last_name, address, birthdate, vacation_days,
remaining_vacation_days, FTE, status, password, salary, date_joined, admin_level, created_date, phone_number);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure create_employee_performance_plan
-- - create a performance record for an employee,
-- - provided that the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS create_employee_performance_plan;
DELIMITER //
CREATE PROCEDURE `create_employee_performance_plan` (IN employee_id INT
, IN start_year SMALLINT
, IN end_year SMALLINT
, IN create_date DATE
, IN status TINYINT
)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
INSERT INTO `PERFORMANCE_PLAN` (START_YEAR, END_YEAR, CREATE_DATE, STATUS, EMPLOYEE_ID)
VALUES (start_year, end_year, create_date, status, employee_id);
SELECT LAST_INSERT_ID() AS PERFORMANCE_PLAN_ID;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure create_employee_performance_plan_section
-- - create a performance record for an employee,
-- - provided that the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS create_employee_performance_plan_section;
DELIMITER //
CREATE PROCEDURE `create_employee_performance_plan_section` (IN performance_plan_id INT
, IN section_data JSON
, IN section_name VARCHAR(100)
)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(PERFORMANCE_PLAN_ID) INTO checker
FROM `PERFORMANCE_PLAN`
WHERE `PERFORMANCE_PLAN`.PERFORMANCE_PLAN_ID = performance_plan_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Performance plan does not exist.';
ELSE
INSERT INTO `PERFORMANCE_SECTION` (`DATA`, SECTION_NAME, PERFORMANCE_PLAN_ID)
VALUES (section_data, section_name, performance_plan_id);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure create_employee_performance_review
-- - create a performance record for an employee,
-- - provided that the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS create_employee_performance_review;
DELIMITER //
CREATE PROCEDURE `create_employee_performance_review` (IN employee_id INT
, IN create_date DATE
, IN work_plan INT
, IN status TINYINT
)
BEGIN
DECLARE checker INT;
DECLARE work_plan_checker INT;
SET checker = 0;
SET work_plan_checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
SELECT COUNT(PERFORMANCE_PLAN_ID) INTO work_plan_checker
FROM `PERFORMANCE_PLAN`
WHERE `PERFORMANCE_PLAN`.PERFORMANCE_PLAN_ID = work_plan;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSEIF work_plan_checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Work plan does not exist.';
ELSE
INSERT INTO `PERFORMANCE_REVIEW` (CREATE_DATE, STATUS, EMPLOYEE_ID, WORK_PLAN_ID)
VALUES (create_date, status, employee_id, work_plan);
SELECT LAST_INSERT_ID() AS PERFORMANCE_REVIEW_ID;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure create_employee_performance_review_section
-- - create a performance record for an employee,
-- - provided that the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS create_employee_performance_review_section;
DELIMITER //
CREATE PROCEDURE `create_employee_performance_review_section` (IN performance_review_id INT
, IN section_data JSON
, IN section_name VARCHAR(100)
)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(PERFORMANCE_REVIEW_ID) INTO checker
FROM `PERFORMANCE_REVIEW`
WHERE `PERFORMANCE_REVIEW`.PERFORMANCE_REVIEW_ID = performance_review_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Performance review does not exist.';
ELSE
INSERT INTO `PERFORMANCE_SECTION` (`DATA`, SECTION_NAME, PERFORMANCE_REVIEW_ID)
VALUES (section_data, section_name, performance_review_id);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure create_employee_vacation
-- - create a vacation request for an employee,
-- - assigned to another employee to aprove, provided
-- - they both exist
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS create_employee_vacation;
DELIMITER //
CREATE PROCEDURE `create_employee_vacation` (IN employee_id INT
, IN requested_days INT
, IN request_status TINYINT
, IN created_date DATE
)
BEGIN
DECLARE emplChecker INT;
SET emplChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
INSERT INTO `VACATION_REQUEST` (EMPLOYEE_ID, REQUESTED_DAYS, REQUEST_STATUS, `DATE`)
VALUES (employee_id, requested_days, request_status, created_date);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure update_employee
-- - update an employee, provided that employee exists
-- - also validate that the new SIN and EMAIL are not
-- - used by other employees
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS update_employee;
DELIMITER //
CREATE PROCEDURE `update_employee`(IN employee_id INT
, IN created_by_id INT
, IN role INT
, IN SIN INT
, IN email VARCHAR(100)
, IN first_name VARCHAR(100)
, IN last_name VARCHAR(100)
, IN address VARCHAR(512)
, IN birthdate DATE
, IN vacation_days INT
, IN remaining_vacation_days INT
, IN FTE TINYINT
, IN status TINYINT
, IN salary DECIMAL(10, 2)
, IN date_joined DATE
, IN admin_level TINYINT
, IN phone_number VARCHAR(45)
)
BEGIN
DECLARE sinChecker INT;
DECLARE emailChecker INT;
DECLARE emplChecker INT;
DECLARE adminChecker INT;
DECLARE version INT;
DECLARE created_date DATE;
DECLARE password VARCHAR(200);
SET sinChecker = 0;
SET emailChecker = 0;
SET emplChecker = 0;
SET adminChecker = 0;
SELECT NOW() INTO created_date;
SELECT COUNT(SIN) INTO sinChecker
FROM `LATEST_HR_RECORDS`
WHERE `LATEST_HR_RECORDS`.SIN = SIN AND `LATEST_HR_RECORDS`.employee_id <> employee_id;
SELECT COUNT(EMAIL) INTO emailChecker
FROM `LATEST_HR_RECORDS`
WHERE `LATEST_HR_RECORDS`.EMAIL = email AND `LATEST_HR_RECORDS`.employee_id <> employee_id;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF IFNULL(created_by_id, -1) = -1 THEN
SET adminChecker = 1;
ELSE
SELECT COUNT(EMPLOYEE_ID) INTO adminChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = created_by_id;
END IF;
IF adminChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'The creator of the employee does not exist.';
ELSEIF sinChecker > 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'SIN already in use.';
ELSEIF emailChecker > 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Email already in use.';
ELSEIF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist';
ELSE
SELECT (`LATEST_HR_RECORDS`.VERSION + 1) INTO version FROM `LATEST_HR_RECORDS` WHERE `LATEST_HR_RECORDS`.EMPLOYEE_ID = employee_id LIMIT 1;
SELECT `LATEST_HR_RECORDS`.PASSWORD INTO password FROM `LATEST_HR_RECORDS` WHERE `LATEST_HR_RECORDS`.EMPLOYEE_ID = employee_id LIMIT 1;
INSERT INTO HR_RECORD (
EMPLOYEE_ID, VERSION, CREATED_BY, ROLE, SIN, EMAIL, FIRST_NAME, LAST_NAME, ADDRESS, BIRTHDATE, VACATION_DAYS,
REMAINING_VACATION_DAYS, FTE, STATUS, PASSWORD, SALARY, DATE_JOINED, ADMIN_LEVEL, CREATED_DATE, PHONE_NUMBER)
VALUES (
employee_id, version, created_by_id, role, SIN, email, first_name, last_name, address, birthdate, vacation_days,
remaining_vacation_days, FTE, status, password, salary, date_joined, admin_level, created_date, phone_number);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure update_employee_password
-- - update an employee, provided that employee exists
-- - also validate that the new SIN and EMAIL are not
-- - used by other employees
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS update_employee_password;
DELIMITER //
CREATE PROCEDURE `update_employee_password`(IN employee_id INT
, IN password VARCHAR(200)
)
BEGIN
DECLARE emplChecker INT;
DECLARE version INT;
SET version = 0;
SET emplChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist';
ELSE
SELECT `LATEST_HR_RECORDS`.VERSION INTO version FROM `LATEST_HR_RECORDS` WHERE `LATEST_HR_RECORDS`.EMPLOYEE_ID = employee_id LIMIT 1;
UPDATE HR_RECORD
SET HR_RECORD.PASSWORD = password
WHERE HR_RECORD.EMPLOYEE_ID = employee_id AND HR_RECORD.VERSION = version;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employee_tasks
-- - get the documents of an employee, provided
-- - the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employee_tasks;
DELIMITER //
CREATE PROCEDURE `get_employee_tasks`(IN employee_id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
SELECT *
FROM ONBOARDING_TASK
WHERE ONBOARDING_TASK.EMPLOYEE_ID = employee_id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employee
-- - get the latest version of the employee,
-- - provided the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employee;
DELIMITER //
CREATE PROCEDURE `get_employee`(IN employee_id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
SELECT *
FROM LATEST_HR_RECORDS
WHERE LATEST_HR_RECORDS.EMPLOYEE_ID = employee_id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employee_history
-- - get the history of the employee,
-- - provided the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employee_history;
DELIMITER //
CREATE PROCEDURE `get_employee_history`(IN employee_id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
SELECT history.*, ROLE.ROLE_NAME AS ROLE_NAME FROM (SELECT HR_RECORD.*, creator.FIRST_NAME AS CREATOR_FIRST_NAME, creator.LAST_NAME AS CREATOR_LAST_NAME
FROM HR_RECORD LEFT JOIN LATEST_HR_RECORDS AS creator
ON HR_RECORD.CREATED_BY = creator.EMPLOYEE_ID
WHERE HR_RECORD.EMPLOYEE_ID = employee_id
ORDER BY VERSION DESC) history LEFT JOIN ROLE
ON history.ROLE = ROLE.ROLE_ID;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_all_employees
-- - get the latest version of all employees
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_all_employees;
DELIMITER //
CREATE PROCEDURE `get_all_employees` ()
BEGIN
SELECT *
FROM LATEST_HR_RECORDS;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_all_active_employees
-- - get the latest version of all employees
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_all_active_employees;
DELIMITER //
CREATE PROCEDURE `get_all_active_employees` ()
BEGIN
SELECT *
FROM LATEST_HR_RECORDS
WHERE LATEST_HR_RECORDS.STATUS != 0;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_all_employees_with_birthday
-- - get the latest version of all employees that matches the birthday with start - end
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_all_employees_with_birthday;
DELIMITER //
CREATE PROCEDURE `get_all_employees_with_birthday` (IN start_period DATE
, IN end_period DATE)
BEGIN
SELECT *
FROM `LATEST_HR_RECORDS`
WHERE DATE_FORMAT(BIRTHDATE, '%m-%d') >= DATE_FORMAT(start_period, '%m-%d') and DATE_FORMAT(BIRTHDATE, '%m-%d') <= DATE_FORMAT(end_period, '%m-%d');
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_all_active_employees_with_birthday
-- - get the latest version of all employees that matches the birthday with start - end
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_all_active_employees_with_birthday;
DELIMITER //
CREATE PROCEDURE `get_all_active_employees_with_birthday` (IN start_period DATE
, IN end_period DATE)
BEGIN
SELECT *
FROM `LATEST_HR_RECORDS`
WHERE DATE_FORMAT(BIRTHDATE, '%m-%d') >= DATE_FORMAT(start_period, '%m-%d') and DATE_FORMAT(BIRTHDATE, '%m-%d') <= DATE_FORMAT(end_period, '%m-%d') AND LATEST_HR_RECORDS.STATUS != 0;
END //
DELIMITER ;
-- -----------------------------------------------------
-- function createDate
-- -----------------------------------------------------
DROP FUNCTION IF EXISTS createDate;
DELIMITER $$
CREATE FUNCTION `createDate`(YEAR_ INT, MONTH_ INT, DAY_ INT) RETURNS DATE
BEGIN
RETURN DATE(CONCAT(YEAR_,'-',MONTH_,'-', DAY_));
END $$
DELIMITER ;
-- -----------------------------------------------------
-- function dateWithYear
-- -----------------------------------------------------
DROP FUNCTION IF EXISTS dateWithYear;
DELIMITER $$
CREATE FUNCTION `dateWithYear`(ORIGINAL_DATE DATE, YEAR_ INT) RETURNS DATE
BEGIN
RETURN createDate(YEAR_, MONTH(ORIGINAL_DATE), DAY(ORIGINAL_DATE));
END $$
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_manager_employees
-- - get the employees reporting under the given
-- - manager, provided the manager exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_manager_employees;
DELIMITER //
CREATE PROCEDURE `get_manager_employees` (IN manager_id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = manager_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Manager does not exist.';
ELSE
SELECT *
FROM LATEST_HR_RECORDS hr1
WHERE hr1.EMPLOYEE_ID in (
SELECT m.EMPLOYEE_ID
FROM MANAGER_EMPLOYEE m
WHERE m.MANAGER_ID = manager_id
);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employees_of_manager
-- - get the employees reporting under the given
-- - manager, provided the manager exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employees_of_manager;
DELIMITER //
CREATE PROCEDURE `get_employees_of_manager` (IN manager_id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = manager_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Manager does not exist.';
ELSE
SET checker = 0;
SELECT ADMIN_LEVEL INTO checker
FROM `LATEST_HR_RECORDS`
WHERE `LATEST_HR_RECORDS`.EMPLOYEE_ID = manager_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An employee with STAFF admin level does not manage other employees.';
ELSE
SELECT *
FROM LATEST_HR_RECORDS hr1
WHERE hr1.EMPLOYEE_ID in (
SELECT m.EMPLOYEE_ID
FROM MANAGER_EMPLOYEE m
WHERE m.MANAGER_ID = manager_id
);
END IF;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_managers_of_employee
-- - get the managers this employee reports to
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_managers_of_employee;
DELIMITER //
CREATE PROCEDURE `get_managers_of_employee` (IN employee_id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
SELECT *
FROM LATEST_HR_RECORDS hr1
WHERE hr1.EMPLOYEE_ID in (
SELECT m.MANAGER_ID
FROM MANAGER_EMPLOYEE m
WHERE m.EMPLOYEE_ID = employee_id
);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employee_managers
-- - get the employees reporting under the given
-- - manager, provided the manager exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employee_managers;
DELIMITER //
CREATE PROCEDURE `get_employee_managers` (IN employee_id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
SELECT *
FROM LATEST_HR_RECORDS hr1
WHERE hr1.EMPLOYEE_ID in (
SELECT m.EMPLOYEE_ID
FROM MANAGER_EMPLOYEE m
WHERE m.EMPLOYEE_ID = employee_id
);
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure check_employee_manager
-- - checks if the employe-manager link exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS check_employee_manager;
DELIMITER //
CREATE PROCEDURE `check_employee_manager` (IN e_id INT, IN m_id INT)
BEGIN
DECLARE emplChecker INT;
DECLARE managChecker INT;
DECLARE linkChecker INT;
SET emplChecker = 0;
SET managChecker = 0;
SET linkChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = e_id;
SELECT COUNT(EMPLOYEE_ID) INTO managChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = m_id;
SELECT COUNT(MANAGER_ID) INTO linkChecker
FROM `MANAGER_EMPLOYEE`
WHERE `MANAGER_EMPLOYEE`.MANAGER_ID = m_id AND `MANAGER_EMPLOYEE`.EMPLOYEE_ID = e_id;
IF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSEIF managChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Manager employee does not exist.';
ELSEIF linkChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'The employee is not under the managed employees of the manager.';
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employee_performance_plans
-- - get the work plans for a given employee,
-- - provided the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employee_performance_plans;
DELIMITER //
CREATE PROCEDURE `get_employee_performance_plans` (IN employee_id INT)
BEGIN
DECLARE checker INT;
DECLARE checker2 INT;
SET checker = 0;
SET checker2 = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
SELECT COUNT(EMPLOYEE_ID) INTO checker2
FROM `PERFORMANCE_PLAN`
WHERE `PERFORMANCE_PLAN`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSEIF checker2 = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'The employee does not have any work plan.';
ELSE
SELECT *
FROM `PERFORMANCE_PLAN`
WHERE `PERFORMANCE_PLAN`.EMPLOYEE_ID = employee_id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employee_performance_reviews
-- - get the performance reviews for a given employee,
-- - provided the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employee_performance_reviews;
DELIMITER //
CREATE PROCEDURE `get_employee_performance_reviews` (IN employee_id INT)
BEGIN
DECLARE checker INT;
DECLARE checker2 INT;
SET checker = 0;
SET checker2 = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
SELECT COUNT(EMPLOYEE_ID) INTO checker2
FROM `PERFORMANCE_REVIEW`
WHERE `PERFORMANCE_REVIEW`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSEIF checker2 = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'The employee does not have any performance review.';
ELSE
SELECT *
FROM `PERFORMANCE_REVIEW`
WHERE `PERFORMANCE_REVIEW`.EMPLOYEE_ID = employee_id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure get_employee_vacation
-- - get the vacation requests for a given employee,
-- - provided the employee exists
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS get_employee_vacation;
DELIMITER //
CREATE PROCEDURE `get_employee_vacation` (IN id INT)
BEGIN
DECLARE checker INT;
SET checker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = employee_id;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
SELECT *
FROM VACATION_REQUEST
WHERE EMPLOYEE_ID = id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure link_employee_manager
-- - link the employee to a manager,
-- - provided both employee and manager exist
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS link_employee_manager;
DELIMITER //
CREATE PROCEDURE `link_employee_manager` (IN e_id INT
, IN m_id INT)
BEGIN
DECLARE emplChecker INT;
DECLARE managChecker INT;
DECLARE linkChecker INT;
DECLARE managerLevel INT;
SET emplChecker = 0;
SET managChecker = 0;
SET linkChecker = 0;
SET managerLevel = 0;
SELECT COUNT(EMPLOYEE_ID) INTO managerLevel
FROM `LATEST_HR_RECORDS`
WHERE `LATEST_HR_RECORDS`.EMPLOYEE_ID = m_id AND `LATEST_HR_RECORDS`.ADMIN_LEVEL = 0;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = e_id;
SELECT COUNT(EMPLOYEE_ID) INTO managChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = m_id;
SELECT COUNT(MANAGER_ID) INTO linkChecker
FROM `MANAGER_EMPLOYEE`
WHERE `MANAGER_EMPLOYEE`.MANAGER_ID = m_id AND `MANAGER_EMPLOYEE`.EMPLOYEE_ID = e_id;
IF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSEIF managChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Manager employee does not exist.';
ELSEIF linkChecker > 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee is already managed by this Manager.';
ELSEIF managerLevel > 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An employee with STAFF admin level, can not manage any employee.';
ELSEIF e_id = m_id THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An employee can not be managed by himself.';
ELSE
SET managChecker = 0;
SELECT ADMIN_LEVEL INTO managChecker
FROM `LATEST_HR_RECORDS`
WHERE `LATEST_HR_RECORDS`.EMPLOYEE_ID = m_id;
IF managChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'An employee with STAFF admin level can not manage any other employee.';
ELSE
INSERT INTO MANAGER_EMPLOYEE (MANAGER_ID, EMPLOYEE_ID)
VALUES (m_id, e_id);
END IF;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure unlink_employee_manager
-- - unlink the employee to a manager,
-- - provided both employee and manager exist
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS unlink_employee_manager;
DELIMITER //
CREATE PROCEDURE `unlink_employee_manager` (IN e_id INT
, IN m_id INT)
BEGIN
DECLARE emplChecker INT;
DECLARE managChecker INT;
DECLARE linkChecker INT;
SET emplChecker = 0;
SET managChecker = 0;
SET linkChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = e_id;
SELECT COUNT(EMPLOYEE_ID) INTO managChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = m_id;
SELECT COUNT(*) INTO linkChecker
FROM `MANAGER_EMPLOYEE`
WHERE `MANAGER_EMPLOYEE`.EMPLOYEE_ID = e_id
AND `MANAGER_EMPLOYEE`.MANAGER_ID = m_id;
IF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSEIF managChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Manager employee does not exist.';
ELSEIF linkChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee-Manager link does not exist.';
ELSE
DELETE FROM MANAGER_EMPLOYEE
WHERE MANAGER_ID = m_id AND EMPLOYEE_ID = e_id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure delete_managers
-- - unlink the managers of an employee
-- - provided employee exist
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS delete_managers;
DELIMITER //
CREATE PROCEDURE `delete_managers` (IN e_id INT)
BEGIN
DECLARE emplChecker INT;
SET emplChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO emplChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = e_id;
IF emplChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Employee does not exist.';
ELSE
DELETE FROM MANAGER_EMPLOYEE
WHERE EMPLOYEE_ID = e_id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure delete_employees
-- - unlink the managers of a manager
-- - provided manager exist
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS delete_employees;
DELIMITER //
CREATE PROCEDURE `delete_employees` (IN m_id INT)
BEGIN
DECLARE managChecker INT;
SET managChecker = 0;
SELECT COUNT(EMPLOYEE_ID) INTO managChecker
FROM `EMPLOYEE`
WHERE `EMPLOYEE`.EMPLOYEE_ID = m_id;
IF managChecker = 0 THEN
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'Manager does not exist.';
ELSE
DELETE FROM MANAGER_EMPLOYEE
WHERE MANAGER_ID = m_id;
END IF;
END //
DELIMITER ;
-- -----------------------------------------------------
-- procedure login
-- - Login the the provided credentials,
-- -----------------------------------------------------
DROP PROCEDURE IF EXISTS login;
DELIMITER $$
CREATE PROCEDURE `login`(IN `EMAIL` VARCHAR(100), IN `PASSWORD` VARCHAR(200))
BEGIN
DECLARE checker INT;
DECLARE checker2 INT;
DECLARE versionID INT;
SET checker = 0;
SET checker2 = 0;
SET versionID = 0;
SELECT COUNT(EMPLOYEE_ID) INTO checker FROM LATEST_HR_RECORDS where LATEST_HR_RECORDS.EMAIL = EMAIL AND LATEST_HR_RECORDS.STATUS != 0;
IF checker = 0 THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'The email is not registered.';
END IF;
SELECT COUNT(EMPLOYEE_ID) INTO checker2 FROM LATEST_HR_RECORDS WHERE LATEST_HR_RECORDS.EMAIL = EMAIL AND LATEST_HR_RECORDS.PASSWORD = PASSWORD AND LATEST_HR_RECORDS.STATUS != 0;
IF checker2 = 0 THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'The password is incorrect';
END IF;
SELECT * FROM LATEST_HR_RECORDS WHERE LATEST_HR_RECORDS.EMAIL = EMAIL AND LATEST_HR_RECORDS.PASSWORD = PASSWORD;
END$$
DELIMITER ;
|
<reponame>JuanRuiz10/Blog_Nicolas
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 04-10-2017 a las 00:23:20
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `portafolioweb`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `articles`
--
CREATE TABLE `articles` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`category_id` bigint(20) UNSIGNED NOT NULL,
`blog_id` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `blogs`
--
CREATE TABLE `blogs` (
`id` bigint(20) UNSIGNED NOT NULL,
`user_id` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `blogs`
--
INSERT INTO `blogs` (`id`, `user_id`, `created_at`, `updated_at`) VALUES
(1, 3, '2017-10-02 23:39:20', '2017-10-02 23:39:20');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `categories`
--
CREATE TABLE `categories` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `images`
--
CREATE TABLE `images` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`portafolio_id` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `information`
--
CREATE TABLE `information` (
`id` bigint(20) UNSIGNED NOT NULL,
`personal_information` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`acedemic_information` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`more_informacion` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`blog_id` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `information`
--
INSERT INTO `information` (`id`, `personal_information`, `acedemic_information`, `more_informacion`, `blog_id`, `created_at`, `updated_at`) VALUES
(2, '<NAME>', 'Hola soy bachiller tecnico', 'Hago softwares', 1, '2017-10-02 23:45:27', '2017-10-02 23:45:27');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2013_09_23_080708_create_states_table', 1),
(2, '2013_09_23_080814_create_profiles_table', 1),
(3, '2014_10_12_000000_create_users_table', 1),
(4, '2014_10_12_100000_create_password_resets_table', 1),
(5, '2017_09_23_080904_create_blogs_table', 1),
(6, '2017_09_23_081106_create_information_table', 1),
(7, '2017_09_23_081125_create_portafolios_table', 1),
(8, '2017_09_23_081151_create_images_table', 1),
(9, '2017_09_23_081204_create_softwares_table', 1),
(10, '2017_09_23_081224_create_categories_table', 1),
(11, '2017_09_23_081234_create_tags_table', 1),
(12, '2017_09_23_081329_create_articles_table', 1);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `portafolios`
--
CREATE TABLE `portafolios` (
`id` bigint(20) UNSIGNED NOT NULL,
`name_project` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description_project` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`blog_id` bigint(20) UNSIGNED NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `profiles`
--
CREATE TABLE `profiles` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `profiles`
--
INSERT INTO `profiles` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Administrador', NULL, NULL),
(2, 'Invitado', NULL, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `states`
--
CREATE TABLE `states` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `states`
--
INSERT INTO `states` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, 'Activo', NULL, NULL),
(2, 'Inactivo', NULL, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`name_user` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`photo` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`state_id` bigint(20) UNSIGNED NOT NULL DEFAULT '2',
`profile_id` bigint(20) UNSIGNED NOT NULL DEFAULT '2',
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Volcado de datos para la tabla `users`
--
INSERT INTO `users` (`id`, `name`, `last_name`, `name_user`, `photo`, `email`, `password`, `state_id`, `profile_id`, `remember_token`, `created_at`, `updated_at`) VALUES
(3, 'Jeisson', 'Rodriguez', 'jeisson', NULL, '<EMAIL>', <PASSWORD>', 2, 2, 'ibzd3CvrmeSyiCep1ZMDFwNMtB0cKRSMl5qstrTE0yJ25ffYrlaBarpCk2P8', '2017-09-24 09:44:44', '2017-10-04 01:23:40');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `articles`
--
ALTER TABLE `articles`
ADD PRIMARY KEY (`id`),
ADD KEY `articles_category_id_foreign` (`category_id`),
ADD KEY `articles_blog_id_foreign` (`blog_id`);
--
-- Indices de la tabla `blogs`
--
ALTER TABLE `blogs`
ADD PRIMARY KEY (`id`),
ADD KEY `blogs_user_id_foreign` (`user_id`);
--
-- Indices de la tabla `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `images`
--
ALTER TABLE `images`
ADD PRIMARY KEY (`id`),
ADD KEY `images_portafolio_id_foreign` (`portafolio_id`);
--
-- Indices de la tabla `information`
--
ALTER TABLE `information`
ADD PRIMARY KEY (`id`),
ADD KEY `information_blog_id_foreign` (`blog_id`);
--
-- Indices de la tabla `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`),
ADD KEY `password_resets_token_index` (`token`);
--
-- Indices de la tabla `portafolios`
--
ALTER TABLE `portafolios`
ADD PRIMARY KEY (`id`),
ADD KEY `portafolios_blog_id_foreign` (`blog_id`);
--
-- Indices de la tabla `profiles`
--
ALTER TABLE `profiles`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `states`
--
ALTER TABLE `states`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_name_user_unique` (`name_user`),
ADD UNIQUE KEY `users_email_unique` (`email`),
ADD KEY `users_state_id_foreign` (`state_id`),
ADD KEY `users_profile_id_foreign` (`profile_id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `articles`
--
ALTER TABLE `articles`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `blogs`
--
ALTER TABLE `blogs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `images`
--
ALTER TABLE `images`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `information`
--
ALTER TABLE `information`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT de la tabla `portafolios`
--
ALTER TABLE `portafolios`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `profiles`
--
ALTER TABLE `profiles`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `states`
--
ALTER TABLE `states`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `articles`
--
ALTER TABLE `articles`
ADD CONSTRAINT `articles_blog_id_foreign` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `articles_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE;
--
-- Filtros para la tabla `blogs`
--
ALTER TABLE `blogs`
ADD CONSTRAINT `blogs_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE;
--
-- Filtros para la tabla `images`
--
ALTER TABLE `images`
ADD CONSTRAINT `images_portafolio_id_foreign` FOREIGN KEY (`portafolio_id`) REFERENCES `portafolios` (`id`) ON DELETE CASCADE;
--
-- Filtros para la tabla `information`
--
ALTER TABLE `information`
ADD CONSTRAINT `information_blog_id_foreign` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`) ON DELETE CASCADE;
--
-- Filtros para la tabla `portafolios`
--
ALTER TABLE `portafolios`
ADD CONSTRAINT `portafolios_blog_id_foreign` FOREIGN KEY (`blog_id`) REFERENCES `blogs` (`id`) ON DELETE CASCADE;
--
-- Filtros para la tabla `users`
--
ALTER TABLE `users`
ADD CONSTRAINT `users_profile_id_foreign` FOREIGN KEY (`profile_id`) REFERENCES `profiles` (`id`) ON DELETE CASCADE,
ADD CONSTRAINT `users_state_id_foreign` FOREIGN KEY (`state_id`) REFERENCES `states` (`id`) ON DELETE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<gh_stars>0
-- Degree
-- FLOAT8, TF
CREATE OR REPLACE FUNCTION degree(float8, trapezoidal_function) RETURNS float8
AS 'fuzzy', 'pg_degreerf' LANGUAGE 'c' IMMUTABLE STRICT;
CREATE OPERATOR ~= (leftarg=float8, rightarg=trapezoidal_function, procedure=degree);
-- TF, FLOAT8
CREATE OR REPLACE FUNCTION degree(trapezoidal_function, float8) RETURNS float8
AS 'fuzzy', 'pg_degreefr' LANGUAGE 'c' IMMUTABLE STRICT;
CREATE OPERATOR ~= (leftarg=trapezoidal_function, rightarg=float8, procedure=degree);
-- TF, TF
CREATE OR REPLACE FUNCTION degreeff(trapezoidal_function, trapezoidal_function) RETURNS float8
AS 'fuzzy', 'pg_degreeff' LANGUAGE 'c' IMMUTABLE STRICT;
CREATE OPERATOR ~= (leftarg=trapezoidal_function, rightarg=trapezoidal_function, procedure=degreeff);
|
<gh_stars>0
CREATE DATABASE IF NOT EXISTS `template` ;
USE `template`;
-- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: localhost Database: template
-- ------------------------------------------------------
-- Server version 5.6.25-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `bitacora`
--
DROP TABLE IF EXISTS `bitacora`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `bitacora` (
`id_bitacora` int(11) NOT NULL AUTO_INCREMENT,
`fecha_hora` datetime DEFAULT NULL,
`ip` varchar(80) DEFAULT NULL,
`accion` varchar(80) DEFAULT NULL,
`tabla` varchar(80) DEFAULT NULL,
`id_usuario` int(11) NOT NULL,
`nombre` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id_bitacora`),
KEY `id_usuario` (`id_usuario`),
CONSTRAINT `bitacora_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id_usuario`)
) ;
--
-- Dumping data for table `bitacora`
--
LOCK TABLES `bitacora` WRITE;
/*!40000 ALTER TABLE `bitacora` DISABLE KEYS */;
/*!40000 ALTER TABLE `bitacora` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `gu_menu`
--
DROP TABLE IF EXISTS `gu_menu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gu_menu` (
`id_menu` int(11) NOT NULL AUTO_INCREMENT,
`menu` varchar(45) DEFAULT NULL,
`icono` varchar(350) DEFAULT NULL,
`movil` int(11) DEFAULT '0',
`orden` int(11) DEFAULT NULL,
PRIMARY KEY (`id_menu`)
) ;
--
-- Dumping data for table `gu_menu`
--
LOCK TABLES `gu_menu` WRITE;
INSERT INTO `gu_menu` VALUES (1,'Sistema','fa fa-cogs',0,1),(3,'Bitacora','fa fa-database',0,6),(20,'Catalogo','fa fa-book',0,7),(21,'Items','fa fa-clipboard',0,8),(22,'Ofertas','fa fa-coffee',0,9),(23,'Cotizaciones','fa fa-clone',0,10),(25,'Bodega','fa fa-bold',0,3),(26,'Reportes','fa fa-bell',0,5),(27,'Informes','fa fa-archive',0,4),(28,'Proyectos','fa fa-clipboard',0,2);
UNLOCK TABLES;
--
-- Table structure for table `gu_opcion`
--
DROP TABLE IF EXISTS `gu_opcion`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gu_opcion` (
`id_opcion` int(11) NOT NULL AUTO_INCREMENT,
`opcion` varchar(65) DEFAULT NULL,
`url` varchar(300) DEFAULT NULL,
`id_menu` int(11) NOT NULL,
PRIMARY KEY (`id_opcion`),
KEY `id_menu` (`id_menu`),
CONSTRAINT `gu_opcion_ibfk_1` FOREIGN KEY (`id_menu`) REFERENCES `gu_menu` (`id_menu`)
) ;
--
-- Dumping data for table `gu_opcion`
--
LOCK TABLES `gu_opcion` WRITE;
INSERT INTO `gu_opcion` VALUES (2,'Permisos','permissions_roles',1),(318,'Usuarios','users',1),(321,'Sesiones','log_of_session',3),(322,'Acciones','log_of_actions',3),(334,'Menu','menu',1),(336,'Opciones','options_menu',1),(397,'Tema','tema',1),(409,'Ordenar Modulos','orden',1),(422,'Pantallas','pantallas',1);
UNLOCK TABLES;
--
-- Table structure for table `gu_rol`
--
DROP TABLE IF EXISTS `gu_rol`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gu_rol` (
`id_rol` int(11) NOT NULL AUTO_INCREMENT,
`rol` varchar(45) DEFAULT NULL,
`id_permiso` int(11) DEFAULT NULL,
PRIMARY KEY (`id_rol`),
KEY `id_permiso` (`id_permiso`),
CONSTRAINT `gu_rol_ibfk_1` FOREIGN KEY (`id_permiso`) REFERENCES `permiso_url` (`id_permiso`)
) ;
--
-- Dumping data for table `gu_rol`
--
LOCK TABLES `gu_rol` WRITE;
INSERT INTO `gu_rol` VALUES (1,'admin',1),(2,'Comun',NULL),(3,'admin2',NULL),(4,'lector',NULL),(5,'Roni',NULL),(6,'Liliana',2);
UNLOCK TABLES;
--
-- Table structure for table `gu_rol_menu`
--
DROP TABLE IF EXISTS `gu_rol_menu`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gu_rol_menu` (
`id_rol` int(11) NOT NULL,
`id_opcion` int(11) NOT NULL,
`acceso` tinyint(1) DEFAULT NULL,
`agregar` tinyint(1) DEFAULT NULL,
`modificar` tinyint(1) DEFAULT NULL,
`eliminar` tinyint(1) DEFAULT NULL,
KEY `id_rol` (`id_rol`),
KEY `id_opcion` (`id_opcion`),
CONSTRAINT `gu_rol_menu_ibfk_1` FOREIGN KEY (`id_rol`) REFERENCES `gu_rol` (`id_rol`),
CONSTRAINT `gu_rol_menu_ibfk_2` FOREIGN KEY (`id_opcion`) REFERENCES `gu_opcion` (`id_opcion`)
) ;
--
-- Dumping data for table `gu_rol_menu`
--
LOCK TABLES `gu_rol_menu` WRITE;
INSERT INTO `gu_rol_menu` VALUES (1,2,NULL,NULL,NULL,NULL),(1,318,NULL,NULL,NULL,NULL),(1,321,NULL,NULL,NULL,NULL),(1,322,NULL,NULL,NULL,NULL),(1,334,NULL,NULL,NULL,NULL),(1,336,NULL,NULL,NULL,NULL),(1,397,NULL,NULL,NULL,NULL),(1,409,NULL,NULL,NULL,NULL),(1,422,NULL,NULL,NULL,NULL);
UNLOCK TABLES;
--
-- Table structure for table `permiso_url`
--
DROP TABLE IF EXISTS `permiso_url`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `permiso_url` (
`id_permiso` int(11) NOT NULL AUTO_INCREMENT,
`url_permiso` varchar(200) DEFAULT NULL,
`nombre_permiso` varchar(200) DEFAULT NULL,
PRIMARY KEY (`id_permiso`)
) ;
--
-- Dumping data for table `permiso_url`
--
LOCK TABLES `permiso_url` WRITE;
INSERT INTO `permiso_url` VALUES (1,'View_administrador','Administradores'),(2,'View_oferta','Cobros'),(3,'View_bodega','Bodega'),(4,'View_stock','bodega stock');
UNLOCK TABLES;
--
-- Table structure for table `sesiones`
--
DROP TABLE IF EXISTS `sesiones`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sesiones` (
`id_sesion` int(11) NOT NULL AUTO_INCREMENT,
`ip` varchar(50) DEFAULT NULL,
`id_usuario` int(11) DEFAULT NULL,
`nombre` varchar(80) DEFAULT NULL,
`fecha` datetime DEFAULT NULL,
`salida` varchar(25) DEFAULT NULL,
`estado` int(11) NOT NULL,
PRIMARY KEY (`id_sesion`),
KEY `id_usuario` (`id_usuario`),
CONSTRAINT `sesiones_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id_usuario`)
) ;
--
-- Dumping data for table `sesiones`
--
LOCK TABLES `sesiones` WRITE;
INSERT INTO `sesiones` VALUES (1590,'SISTEMAS',371,'ADMINISTRADOR','2021-02-08 11:11:22','2021-02-08 11:13:53',1);
UNLOCK TABLES;
--
-- Table structure for table `tbl_tema`
--
DROP TABLE IF EXISTS `tbl_tema`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tbl_tema` (
`id_tema` int(11) NOT NULL AUTO_INCREMENT,
`barra_superior_1` varchar(100) COLLATE utf8_unicode_ci DEFAULT 'black',
`barra_superior_2` varchar(100) COLLATE utf8_unicode_ci DEFAULT '#0C1D3A',
`foto_banner` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`foto_usuario` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`barra_inferior_1` varchar(100) COLLATE utf8_unicode_ci DEFAULT '#0E4AA5',
`barra_inferior_2` varchar(100) COLLATE utf8_unicode_ci DEFAULT '#0C1D3A',
`encabezado_tabla` varchar(100) COLLATE utf8_unicode_ci DEFAULT '#00BCD4',
`encabezado_modal` varchar(100) COLLATE utf8_unicode_ci DEFAULT '#00BCD4',
`tema` varchar(100) COLLATE utf8_unicode_ci DEFAULT 'teal',
`id_usuario` int(11) DEFAULT NULL,
`texto_barra_superior` varchar(45) COLLATE utf8_unicode_ci DEFAULT '#fff',
`texto_barra_inferior` varchar(45) COLLATE utf8_unicode_ci DEFAULT '#fff',
`texto_modal` varchar(45) COLLATE utf8_unicode_ci DEFAULT '#fff',
`texto_tabla` varchar(45) COLLATE utf8_unicode_ci DEFAULT '#fff',
PRIMARY KEY (`id_tema`),
KEY `id_usuario` (`id_usuario`)
);
--
-- Dumping data for table `tbl_tema`
--
LOCK TABLES `tbl_tema` WRITE;
INSERT INTO `tbl_tema` VALUES (1,'#000000','#103c63','1156648641.png','','#153b69','#000000','#324b6c','#000000','indigo',371,'#fff','#fff','#fff','#ffffff'),(2,'black','#0C1D3A','1334876789.jpg','','#0E4AA5','#0C1D3A','#003c6c','#040a1a','indigo',381,'#fff','#fff','#bdcbff','#fff'),(3,'#574eba','#288f8f','966183780.jpg','1836537042.png','#7a4b82','#46517a','#00BCD4','#00BCD4','light-blue',382,'#fff','#fff','#fff','#fff'),(4,'black','#0C1D3A',NULL,NULL,'#0E4AA5','#0C1D3A','#00BCD4','#00BCD4','teal',383,'#fff','#fff','#fff','#fff'),(5,'black','#0C1D3A','1852596369.jpg','','#0E4AA5','#0C1D3A','#00BCD4','#00BCD4','teal',384,'#fff','#fff','#fff','#fff'),(6,'black','#0C1D3A',NULL,NULL,'#0E4AA5','#0C1D3A','#00BCD4','#00BCD4','teal',385,'#fff','#fff','#fff','#fff'),(7,'rgba(0,0,0,0.99)','#0f1414','1218226549.jpeg','1755447378.png','#191b1f','#0C1D3A','#00BCD4','#00BCD4','teal',386,'#0930ea','#fff','#fff','#fff'),(8,'#0097ff','#224f9b','2098585117.jpeg','','#0E4AA5','#0C1D3A','#00BCD4','#00BCD4','teal',387,'#ffffff','#fff','#fff','#fff'),(9,'black','#0c3a16','1432891507.jpg','','#113921','#000000','#032c0a','#11331f','teal',858,'#fff','#fff','#fff','#fff');
UNLOCK TABLES;
--
-- Table structure for table `usuarios`
--
DROP TABLE IF EXISTS `usuarios`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `usuarios` (
`id_usuario` int(4) NOT NULL AUTO_INCREMENT,
`nombre` varchar(80) CHARACTER SET latin1 NOT NULL,
`clave` varchar(60) CHARACTER SET latin1 NOT NULL,
`id_rol` int(11) NOT NULL,
`fecha_creacion` datetime DEFAULT CURRENT_TIMESTAMP,
`nombre_completo` varchar(100) CHARACTER SET latin1 NOT NULL DEFAULT '',
`estado` int(11) DEFAULT '0',
PRIMARY KEY (`id_usuario`),
KEY `fk_usuarios_gu_rol1` (`id_rol`),
CONSTRAINT `fk_usuarios_gu_rol1` FOREIGN KEY (`id_rol`) REFERENCES `gu_rol` (`id_rol`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ;
--
-- Dumping data for table `usuarios`
--
LOCK TABLES `usuarios` WRITE;
INSERT INTO `usuarios` VALUES (371,'<EMAIL>','827ccb0eea8a706c4c34a16891f84e7b',1,'2019-06-10 16:26:55','ADMINISTRADOR',1);
UNLOCK TABLES;
--
-- Dumping events for database 'template'
--
--
-- Dumping routines for database 'template'
-- Dump completed on 2021-02-08 11:15:58
|
<filename>api/db/patches/2021-02-01-init-schema.sql
/* Updated At Trigger Function */
CREATE OR REPLACE FUNCTION trigger_updated_at_timestamp()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
/* Users Table */
CREATE TABLE users (
id SERIAL NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
email TEXT NOT NULL UNIQUE,
email_verified BOOLEAN NOT NULL DEFAULT false,
username TEXT NOT NULL,
password TEXT NOT NULL,
archived_at TIMESTAMP WITH TIME ZONE NULL,
banned_at TIMESTAMP WITH TIME ZONE NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
updated_at TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
);
CREATE TRIGGER set_timestamp
BEFORE UPDATE ON users
FOR EACH ROW EXECUTE PROCEDURE trigger_updated_at_timestamp(); |
SELECT
procpid,
START,
now() - START AS lap,
current_query
FROM
(
SELECT
backendid,
pg_stat_get_backend_pid (S.backendid) AS procpid,
pg_stat_get_backend_activity_start (S.backendid) AS START,
pg_stat_get_backend_activity (S.backendid) AS current_query
FROM
(
SELECT
pg_stat_get_backend_idset () AS backendid
) AS S
) AS S
WHERE
current_query <> '<IDLE>'
ORDER BY
lap DESC; |
<reponame>Yukiisama/Kaban
CREATE TABLE `release` (
project int,
id int AUTO_INCREMENT,
title TEXT,
description TEXT,
version_major int,
version_minor int,
version_patch int,
link TEXT,
creation_date DATE,
CONSTRAINT PK_ID PRIMARY KEY (id),
FOREIGN KEY (project) REFERENCES project(id) ON DELETE CASCADE
); |
<reponame>sumaikun/Legal_sig
/*
Navicat MySQL Data Transfer
Source Server : LOCAL
Source Server Version : 50711
Source Host : localhost:33060
Source Database : Homestead
Target Server Type : MYSQL
Target Server Version : 50711
File Encoding : 65001
Date: 2016-06-02 17:04:10
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for Articulos
-- ----------------------------
DROP TABLE IF EXISTS `Articulos`;
CREATE TABLE `Articulos` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`numero_articulo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`literal_numeral` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ,
`norma_id` int(11) NOT NULL ,
`Estado_del_Articulo` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL DEFAULT 'Vigente' ,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=23
;
-- ----------------------------
-- Records of Articulos
-- ----------------------------
BEGIN;
INSERT INTO `Articulos` VALUES ('1', '4', 'No aplica', '1', 'Derogado', '2016-05-26 21:30:06', '2016-05-26 16:30:06'), ('2', '2281115', 'No aplica', '2', 'Derogado', '2016-05-22 22:35:53', '2016-05-22 17:35:53'), ('3', '2281116', 'No aplica', '2', 'Derogado', '2016-05-23 02:53:18', '2016-05-22 21:53:18'), ('4', '1', 'No aplica', '3', 'Derogado', '2016-05-27 12:40:03', '2016-05-27 07:40:03'), ('5', '9', 'No aplica', '2', 'Derogado', '2016-05-23 02:53:18', '2016-05-22 21:53:18'), ('6', '8', 'No aplica', '2', 'Derogado', '2016-05-23 02:53:18', '2016-05-22 21:53:18'), ('7', '677', 'No aplica', '2', 'Derogado', '2016-05-23 02:53:18', '2016-05-22 21:53:18'), ('8', '678', 'No aplica', '2', 'Derogado', '2016-05-20 21:25:44', '2016-05-20 21:25:44'), ('9', '679', 'No aplica', '1', 'Derogado', '2016-05-20 21:30:07', '2016-05-20 21:30:07'), ('10', '676', 'No aplica', '1', 'Derogado', '2016-05-26 21:30:06', '2016-05-26 16:30:06'), ('11', '600', 'No aplica', '1', 'Derogado', '2016-05-26 21:30:06', '2016-05-26 16:30:06'), ('12', '4', 'No aplica', '2', 'Derogado', '2016-05-23 02:53:18', '2016-05-22 21:53:18'), ('13', '300', 'No aplica', '2', 'Derogado', '2016-05-23 02:53:18', '2016-05-22 21:53:18'), ('14', '6', 'No aplica', '6', 'Derogado', '2016-05-26 21:25:48', '2016-05-26 16:25:48'), ('15', '8', 'No aplica', '6', 'Derogado', '2016-05-27 12:33:34', '2016-05-27 07:33:34'), ('18', '65', 'No aplica', '1', 'Derogado', '2016-05-31 19:58:23', '2016-05-31 14:58:23'), ('19', '5', 'No aplica', '4', 'Derogado', '2016-05-31 19:59:11', '2016-05-31 14:59:11'), ('20', '4', 'No aplica', '8', 'Vigente', '2016-05-31 14:59:12', '2016-05-31 14:59:12'), ('21', '1', 'No aplica', '5', 'Derogado', '2016-05-31 20:44:23', '2016-05-31 15:44:23'), ('22', '8', 'No aplica', '4', 'Vigente', '2016-05-31 15:44:23', '2016-05-31 15:44:23');
COMMIT;
-- ----------------------------
-- Table structure for AspectoAmbiental
-- ----------------------------
DROP TABLE IF EXISTS `AspectoAmbiental`;
CREATE TABLE `AspectoAmbiental` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`nombre` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`created_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=3
;
-- ----------------------------
-- Records of AspectoAmbiental
-- ----------------------------
BEGIN;
INSERT INTO `AspectoAmbiental` VALUES ('1', 'Manejo de residuos', '2016-05-30 17:29:53', '2016-05-30 17:29:53'), ('2', 'Manejo de desechos', '2016-05-30 17:32:54', '2016-05-30 17:32:54');
COMMIT;
-- ----------------------------
-- Table structure for autoridademisora
-- ----------------------------
DROP TABLE IF EXISTS `autoridademisora`;
CREATE TABLE `autoridademisora` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`nombre` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=15
;
-- ----------------------------
-- Records of autoridademisora
-- ----------------------------
BEGIN;
INSERT INTO `autoridademisora` VALUES ('1', 'Congreso \r\nde la República', '2016-05-16 15:39:56', '2016-05-20 12:41:05'), ('2', 'Ministerio de Ambiente y Desarrollo Sostenible', '2016-05-16 15:39:56', '2016-05-20 12:41:05'), ('3', 'Presidencia de la República ', '2016-05-19 21:56:36', '2016-05-18 15:02:12'), ('4', 'Ministerio de Trabajo y Seguridad Socia', '2016-05-20 12:41:05', '2016-05-20 12:41:05'), ('5', 'Ministerio de Ambiente, Vivienda y Desarrollo Territorial', '2016-05-19 21:55:37', '2016-05-19 21:55:37'), ('6', 'Ministerio de Salud', '2016-05-20 12:34:47', '2016-05-20 12:34:47'), ('7', 'Ministerio de Comercio Exterior ', '2016-05-20 12:42:49', '2016-05-20 12:42:49'), ('8', 'Congreso Nacional de Colombia ', '2016-05-20 12:43:31', '2016-05-20 12:43:31'), ('9', 'Ministerio de Minas y Energía', '2016-05-20 12:44:05', '2016-05-20 12:44:05'), ('10', 'Ministerio de Transporte', '2016-05-20 12:45:08', '2016-05-20 12:45:08'), ('11', 'Ministerio de Hacienda y Crédito Público', '2016-05-20 12:46:01', '2016-05-20 12:46:01'), ('12', 'Ministerio de Gobierno', '2016-05-20 12:46:33', '2016-05-20 12:46:33'), ('13', 'Ministerio de Defensa', '2016-05-20 12:46:57', '2016-05-20 12:46:57'), ('14', ' Ministerio de Trabajo y Seguridad Social y de Salud', '2016-05-20 12:47:37', '2016-05-20 12:47:37');
COMMIT;
-- ----------------------------
-- Table structure for CategoriaAmbiental
-- ----------------------------
DROP TABLE IF EXISTS `CategoriaAmbiental`;
CREATE TABLE `CategoriaAmbiental` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`nombre` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`aspecto_ambiental_id` int(11) NOT NULL ,
`created_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=2
;
-- ----------------------------
-- Records of CategoriaAmbiental
-- ----------------------------
BEGIN;
INSERT INTO `CategoriaAmbiental` VALUES ('1', 'Desechos plasticos', '2', '2016-05-30 17:53:48', '2016-05-30 17:53:48');
COMMIT;
-- ----------------------------
-- Table structure for clase_norma
-- ----------------------------
DROP TABLE IF EXISTS `clase_norma`;
CREATE TABLE `clase_norma` (
`idclase_norma` int(50) NOT NULL ,
`nombre` varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
;
-- ----------------------------
-- Records of clase_norma
-- ----------------------------
BEGIN;
INSERT INTO `clase_norma` VALUES ('1', 'Informativa'), ('2', 'Obligatoria '), ('3', 'Derogada'), ('4', 'modificada');
COMMIT;
-- ----------------------------
-- Table structure for Comentario
-- ----------------------------
DROP TABLE IF EXISTS `Comentario`;
CREATE TABLE `Comentario` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`comentario` text CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`evaluacion_id` int(11) NOT NULL ,
`archivo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`created_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP ,
`usuario_id` int(11) NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=17
;
-- ----------------------------
-- Records of Comentario
-- ----------------------------
BEGIN;
INSERT INTO `Comentario` VALUES ('1', 'comentario 1', '13', 'Git.docx', '2016-06-01 14:11:45', '2016-06-01 14:11:45', '24'), ('2', 'comentario 1 de esa evaluacion', '14', 'Historia_proyecto.docx', '2016-06-01 14:37:44', '2016-06-01 14:37:44', '24'), ('3', 'comentario del 3 si yo voy a ser un comentario mucho mas grande', '15', 'Capacitación shamir.docx', '2016-06-01 15:13:04', '2016-06-01 15:13:04', '24'), ('7', 'soy otro comentario cuya intención es ser lo mas grande posible para averiguar si es posible que se desborde la base de datos.', '16', 'Historia_proyecto.doc', '2016-06-02 13:37:33', '2016-06-02 13:37:33', '24'), ('8', 'Soy otro comentario estoy probando que todo funcione de manera adecuada', '15', 'Historia_proyecto.doc', '2016-06-02 13:37:31', '2016-06-02 13:37:31', '24'), ('11', 'soy el tercer comentario espero que con esto ya se arregle el problema', '15', 'Historia_proyecto.doc', '2016-06-02 13:37:39', '2016-06-02 13:37:39', '24'), ('12', 'comentario 2 soy otro comentario que bien', '13', 'GOL-BMS-FO-12 Tatiana Toro 2016 (Reparado).xlsx', '2016-06-02 08:38:21', '2016-06-02 08:38:21', '24'), ('13', 'soy otra subida ', '13', 'Git.pdf', '2016-06-02 08:39:00', '2016-06-02 08:39:00', '24');
COMMIT;
-- ----------------------------
-- Table structure for empresa
-- ----------------------------
DROP TABLE IF EXISTS `empresa`;
CREATE TABLE `empresa` (
`idempresa` int(11) NOT NULL AUTO_INCREMENT ,
`nombre` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`representante_legal` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`cargo` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`sector_id` int(100) NOT NULL ,
`industria_id` int(100) NOT NULL ,
`estado` tinyint(1) NOT NULL ,
`comentario` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`path` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`factores` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'Ninguno' ,
`aspectos` varchar(35) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'Ninguno' ,
`calificacion` int(11) NULL DEFAULT NULL ,
`created_at` datetime NOT NULL ,
`updated_at` datetime NOT NULL ,
PRIMARY KEY (`idempresa`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=4
;
-- ----------------------------
-- Records of empresa
-- ----------------------------
BEGIN;
INSERT INTO `empresa` VALUES ('1', 'SCHLUMBERGER', '<NAME>', '', '1', '1', '0', 'Empresa de petroleos', '46logo_schlumberger.png', '1,2', '1,2', '1', '2016-05-22 13:12:46', '2016-05-31 09:26:07'), ('2', 'TecniControl', '<NAME>', '', '2', '3', '0', 'dedicada al sector ambiental y salud', '40logo_tecnicontrol.png', '1', 'Ninguno', '2', '2016-05-22 13:52:40', '2016-05-31 09:18:08'), ('3', '<NAME>', '<NAME>', 'Administrador de proyectos', '1', '4', '0', 'Empresa dedicada al sector ambiental y cumplimento en los estandares de calidad', '22logo_panthers.png', '3,9', '2', '1', '2016-05-22 14:11:22', '2016-05-31 09:28:53');
COMMIT;
-- ----------------------------
-- Table structure for EstadoCumplimiento
-- ----------------------------
DROP TABLE IF EXISTS `EstadoCumplimiento`;
CREATE TABLE `EstadoCumplimiento` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`Requisito` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`EvidenciaEsperada` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`Responsable` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ,
`AreaAplicacion` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ,
`created_at` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=15
;
-- ----------------------------
-- Records of EstadoCumplimiento
-- ----------------------------
BEGIN;
INSERT INTO `EstadoCumplimiento` VALUES ('1', '¿Está en curso algún procedimiento sancionatorio ambiental desde la autoridad competente en la jurisdicción de la facilidad?', 'Evidenciar los registros del tramite y la pertinencia de los mismos', 'Líder HSE', 'HSE', '2016-05-18 13:14:57', '2016-05-18 13:14:57'), ('2', 'Están definidas e implementadas las responsabilidades en materia ambiental son, como mínimo: velar por el cumplimiento de la normatividad ambiental; prevenir, minimizar y controlar la generación de cargas contaminantes; promover prácticas de producción má', 'Documento en el que se describa las responsabilidades\nEvidencias de la comunicación de las responsabilidades del rol, ej.\n* Registros (memorando, circular, acta, e-mail, etc..).\n* Los empleados que asumen la responsabilidad en DGA son idóneos y competent', 'Líder HSE', 'HSE', '2016-05-18 13:14:57', '2016-05-18 13:14:57'), ('3', 'En comunicado firmado por el representante legal de la empresa o su apoderado, se ha informado al la autoridad ambiental sobre la creación y funcionamiento del \"Departamento de Gestión Ambiental\", precisando las funciones y responsabilidades asignadas a', 'Comunicado a cada una de las autoridades ambientales competentes para cada una de las bases, firmado por el representante legal o su apoderado, con sello de radicado ante la autoridad ambiental.', 'Líder HSE', 'HSE', '2016-05-18 13:14:57', '2016-05-18 13:14:57'), ('4', 'requisito respecto al 4', 'evidencia respecto al 4 , esto es una prueba de le evidencia', 'el responsable de prueba', 'area de aplicación 0', '2016-05-25 14:40:48', '2016-05-25 14:40:48'), ('5', 'Se debe tener el reglamento interno de trabajo', 'reglamento interno de trabajo', 'Recursos humanos', '', '2016-05-26 16:34:17', '2016-05-26 16:34:17'), ('7', 'Requisito ambiental1', 'Evidencia ambiental 1', 'Responsable ambiental', 'ambiental', '2016-05-31 13:15:42', '2016-05-31 13:15:42'), ('8', 'requisito respecto al 8', 'evidencia respecto al 8 , esto es una prueba de le evidencia', 'Responsable ambiental', 'ambiental', '2016-05-31 13:24:30', '2016-05-31 13:24:30'), ('9', 'Requisito ambiental1', 'asads', 'dsadasd', 'dadasdasd', '2016-05-31 13:26:07', '2016-05-31 13:26:07'), ('10', 'fdfsdf', 'fsdfsdf', 'fsdfsdf', 'fsdfsdf', '2016-05-31 13:30:20', '2016-05-31 13:30:20'), ('11', 'fdsfsdf', 'fsdfsdf', 'fsdfsdf', 'fsdfsdf', '2016-05-31 13:35:29', '2016-05-31 13:35:29'), ('12', 'requisito 1', 'evidencia1', 'responsable1', 'area 0', '2016-05-31 15:49:08', '2016-05-31 15:49:08'), ('13', 'requisito legal2', 'evidencia esperada 2', 'responsable numero 2', 'area aplicacion 2', '2016-06-01 14:15:12', '2016-06-01 14:15:12'), ('14', 'requisito numero 3', 'Evidencia ambiental 3', 'responsable numero 3', 'area 3', '2016-06-01 14:52:50', '2016-06-01 14:52:50');
COMMIT;
-- ----------------------------
-- Table structure for Evaluacion
-- ----------------------------
DROP TABLE IF EXISTS `Evaluacion`;
CREATE TABLE `Evaluacion` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`Fecha` date NOT NULL ,
`Calificacion` int(11) NOT NULL ,
`EvidenciaCumplimiento` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`id_Requisito` int(11) NOT NULL ,
`created_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP ,
`Fecha2` date NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=17
;
-- ----------------------------
-- Records of Evaluacion
-- ----------------------------
BEGIN;
INSERT INTO `Evaluacion` VALUES ('1', '2016-05-11', '100', 'evidencia de cumplimiento 1', '1', '2016-05-31 21:10:28', '2016-05-31 21:10:28', '2017-05-11'), ('2', '2016-05-23', '100', 'evidencia de cumplimiento 2', '1', '2016-05-31 21:10:29', '2016-05-31 21:10:29', '2017-05-11'), ('3', '2016-05-27', '100', 'evidencia de cumplimiento 3', '1', '2016-05-31 21:10:35', '2016-05-31 21:10:35', '2017-05-11'), ('4', '2016-06-15', '100', 'evidencia de cumplimiento 4', '1', '2016-05-31 21:10:37', '2016-05-31 21:10:37', '2017-05-11'), ('5', '2016-05-04', '100', 'evidencia de cumplimiento 1 requisito 2', '2', '2016-05-31 21:10:40', '2016-05-31 21:10:40', '2017-05-11'), ('6', '2016-06-07', '0', 'evidencia de cumplimiento 2 requisito 2', '2', '2016-05-31 21:10:42', '2016-05-31 21:10:42', '2017-05-11'), ('7', '2016-05-26', '100', 'lo que sea ', '5', '2016-05-31 21:10:44', '2016-05-31 21:10:44', '2017-05-11'), ('8', '2016-05-17', '100', 'evidencia de cumplimiento ambiental', '7', '2016-05-31 21:10:46', '2016-05-31 21:10:46', '2017-05-11'), ('9', '2016-05-31', '100', 'evidencia de cumplimiento 8', '8', '2016-05-31 21:10:50', '2016-05-31 21:10:50', '2017-05-11'), ('10', '2016-05-31', '100', 'sdasdsadasdasdasd', '9', '2016-05-31 21:10:52', '2016-05-31 21:10:52', '2017-05-11'), ('11', '2016-05-31', '100', 'fdsfsdfsdf', '10', '2016-05-31 21:10:55', '2016-05-31 21:10:55', '2017-05-11'), ('12', '2016-06-01', '100', 'fsdfsdfsdf', '11', '2016-05-31 21:11:00', '2016-05-31 21:11:00', '2017-05-11'), ('13', '2016-05-31', '100', 'evidencia de cumplimiento 1', '12', '2016-05-31 16:47:54', '2016-05-31 16:47:54', '2017-05-31'), ('14', '2016-06-01', '100', 'evidencia de cumplimiento 2', '13', '2016-06-01 14:37:04', '2016-06-01 14:37:04', '2017-06-01'), ('15', '2016-07-04', '100', 'evidencia numero 4', '14', '2016-06-01 14:53:22', '2016-06-01 14:53:22', '2016-07-06'), ('16', '2016-06-18', '100', 'czxczxczxc', '14', '2016-06-01 14:54:06', '2016-06-01 14:54:06', '2016-06-16');
COMMIT;
-- ----------------------------
-- Table structure for factor_riesgo
-- ----------------------------
DROP TABLE IF EXISTS `factor_riesgo`;
CREATE TABLE `factor_riesgo` (
`idfactor_riesgo` int(11) NOT NULL AUTO_INCREMENT ,
`nombre` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`created_at` date NOT NULL ,
`updated_at` date NOT NULL ,
PRIMARY KEY (`idfactor_riesgo`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=13
;
-- ----------------------------
-- Records of factor_riesgo
-- ----------------------------
BEGIN;
INSERT INTO `factor_riesgo` VALUES ('1', 'Ambiente y Desarrollo', '2016-04-20', '2016-04-20'), ('2', 'Salud Ocupacional y Ambiente', '2016-04-13', '2016-04-13'), ('3', 'Salud Ocupacional', '2016-04-13', '2016-04-13'), ('4', 'Seguridad Informatica', '2016-04-12', '2016-04-12'), ('5', 'Seguridad Indistrial', '2016-04-13', '2016-04-13'), ('6', 'Deportes y Cultura', '2016-04-13', '2016-04-13'), ('7', 'Recreación y Deporte ', '2016-04-13', '2016-04-26'), ('8', 'Infraestructura y Vivienda ', '2016-04-13', '2016-04-13'), ('9', 'Caídas de nivel', '2016-05-22', '2016-05-22'), ('10', 'Intoxicación por gases ', '2016-05-22', '2016-05-22'), ('11', ' Psicosocial', '2016-05-26', '2016-05-26'), ('12', 'Biomecanico', '2016-05-26', '2016-05-26');
COMMIT;
-- ----------------------------
-- Table structure for HistoricoMigracion
-- ----------------------------
DROP TABLE IF EXISTS `HistoricoMigracion`;
CREATE TABLE `HistoricoMigracion` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`nombre` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`usuario_id` int(11) NOT NULL ,
`empresa_id` int(11) NOT NULL ,
`created_at` timestamp NULL DEFAULT NULL ,
`updated_at` timestamp NULL DEFAULT NULL ,
PRIMARY KEY (`id`, `usuario_id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=6
;
-- ----------------------------
-- Records of HistoricoMigracion
-- ----------------------------
BEGIN;
INSERT INTO `HistoricoMigracion` VALUES ('5', 'Migracion 1 de schumberger', '24', '1', '2016-06-02 14:37:18', '2016-06-02 14:37:18');
COMMIT;
-- ----------------------------
-- Table structure for industria
-- ----------------------------
DROP TABLE IF EXISTS `industria`;
CREATE TABLE `industria` (
`idindustria` int(200) NOT NULL ,
`sector_id` int(11) NOT NULL ,
`industria` varchar(150) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
;
-- ----------------------------
-- Records of industria
-- ----------------------------
BEGIN;
INSERT INTO `industria` VALUES ('1', '1', 'agricultura '), ('2', '1', 'ganadería'), ('3', '1', 'pesca'), ('4', '1', 'silvicultura'), ('5', '2', 'textil'), ('6', '2', 'quimica'), ('7', '2', 'alimentaria'), ('8', '3', 'transporte de carga '), ('9', '3', ' transporte público'), ('10', '3', ' transporte terrestre'), ('11', '3', ' transporte aéreo'), ('12', '3', ' transporte marítimo'), ('13', '4', 'Bancarias y Financieras'), ('14', '4', 'Aseguradoras'), ('15', '4', 'Pensiones y cesantías '), ('16', '4', 'fiduciarias');
COMMIT;
-- ----------------------------
-- Table structure for MigracionMatriz
-- ----------------------------
DROP TABLE IF EXISTS `MigracionMatriz`;
CREATE TABLE `MigracionMatriz` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`id_requisito` int(10) NOT NULL ,
`id_cumplimiento` int(11) NOT NULL ,
`id_evaluacion` int(10) NOT NULL ,
`id_usuario` int(10) NULL DEFAULT NULL ,
`id_historico` int(11) NOT NULL DEFAULT 0 ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=5
;
-- ----------------------------
-- Records of MigracionMatriz
-- ----------------------------
BEGIN;
INSERT INTO `MigracionMatriz` VALUES ('1', '12', '12', '13', '24', '5'), ('2', '13', '13', '14', '24', '5'), ('3', '14', '14', '15', '24', '5'), ('4', '14', '14', '16', '24', '0');
COMMIT;
-- ----------------------------
-- Table structure for migrations
-- ----------------------------
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
`migration` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`batch` int(11) NOT NULL
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
;
-- ----------------------------
-- Records of migrations
-- ----------------------------
BEGIN;
INSERT INTO `migrations` VALUES ('2014_10_12_000000_create_users_table', '1'), ('2016_05_23_115121_CreateEvaluacion', '2'), ('2016_05_27_081843_CreateMigracionMatriz', '3'), ('2016_05_30_164836_CreateAspectoAmbiental', '4'), ('2016_05_30_164902_CreateCategoriaAmbiental', '4'), ('2016_05_31_163501_CreateComentario', '5'), ('2016_06_02_093841_CreateHistoricMigracion', '6');
COMMIT;
-- ----------------------------
-- Table structure for normas
-- ----------------------------
DROP TABLE IF EXISTS `normas`;
CREATE TABLE `normas` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`numero_norma` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`descripcion_norma` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ,
`tipo_norma_id` int(11) NOT NULL ,
`yearemision_id` int(11) NOT NULL ,
`fecha` date NOT NULL ,
`autoridad_emisora_id` int(11) NOT NULL ,
`clase_norma_id` int(11) NOT NULL ,
`norma_relacionadas` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=11
;
-- ----------------------------
-- Records of normas
-- ----------------------------
BEGIN;
INSERT INTO `normas` VALUES ('1', '1333', 'Por el cual se adoptan normas sobre funciones que afecte al medio ambiente', '7', '9', '2016-04-11', '1', '3', 'Ley 99 de 1993, Congreso de la República, Art. 66\r\nLey 768 de 2002, Congreso de la República, Art. 13', '2016-05-26 21:30:06', '2016-05-26 16:30:06'), ('2', '1076', 'Este decreto vela por la integridad en la gestión ambiental', '1', '10', '2016-05-02', '2', '3', 'Deroga los art. 5,6 y 7 del Decreto 1299 de 2008', '2016-05-23 02:53:18', '2016-05-22 21:53:18'), ('3', '486', 'Esta resolución se enfoca a temas relacionados con desarrollo territorial ', '9', '6', '2002-05-12', '5', '3', 'Estatuto Tributario, Artículos 424-5 numeral 4 y 428 literal f) ', '2016-05-27 12:40:03', '2016-05-27 07:40:03'), ('4', '5678', 'Ley que aplica para la nueva gestion de basuras en empresa', '7', '12', '2006-05-04', '6', '1', 'Esta norma sigue vigente actualmente', '2016-05-23 01:43:18', '2016-05-22 14:49:09'), ('5', '345', 'Norma que derogada a los relacionados al articulos 2', '4', '8', '2004-03-12', '7', '2', 'derogada la norma con id 2', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('6', '1010', 'Ley de acoso laboral', '7', '15', '2010-05-26', '1', '3', 'No aplica', '2016-05-27 12:33:34', '2016-05-27 07:33:34'), ('7', '652', '', '1', '1', '2016-05-06', '1', '3', 'No aplica', '2016-05-27 12:38:47', '2016-05-27 07:38:47'), ('8', '6352', 'deroga a la 1010', '1', '18', '2012-05-19', '11', '1', '', '2016-05-27 07:33:34', '2016-05-27 07:33:34'), ('9', '782', 'deroga a la 652', '3', '1', '2016-06-02', '1', '2', 'No aplica', '2016-05-27 07:38:47', '2016-05-27 07:38:47'), ('10', '700', 'deroga a la 486', '3', '1', '2016-05-03', '1', '2', 'No aplica', '2016-05-27 07:40:03', '2016-05-27 07:40:03');
COMMIT;
-- ----------------------------
-- Table structure for password_resets
-- ----------------------------
DROP TABLE IF EXISTS `password_resets`;
CREATE TABLE `password_resets` (
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`token` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`created_at` timestamp NOT NULL
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
;
-- ----------------------------
-- Records of password_resets
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for Relacionderogada
-- ----------------------------
DROP TABLE IF EXISTS `Relacionderogada`;
CREATE TABLE `Relacionderogada` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`campo_derogado` varchar(35) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`campo_asignado` varchar(35) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`tabla_asociada` varchar(35) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=29
;
-- ----------------------------
-- Records of Relacionderogada
-- ----------------------------
BEGIN;
INSERT INTO `Relacionderogada` VALUES ('1', '8', '10', 'articulos', '2016-05-23 02:03:51', '2016-05-20 21:25:44'), ('2', '9', '11', 'articulos', '2016-05-23 02:03:55', '2016-05-20 21:30:08'), ('3', '2', '13', 'articulos', '2016-05-23 02:11:10', '2016-05-22 17:35:53'), ('4', '2', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('5', '3', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('6', '5', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('7', '6', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('8', '7', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('9', '8', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('10', '12', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('11', '13', 'norma asociada derogada', 'articulos', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('12', '2', '4', 'normas', '2016-05-22 21:53:18', '2016-05-22 21:53:18'), ('13', '14', '15', 'articulos', '2016-05-26 16:25:49', '2016-05-26 16:25:49'), ('14', '1', 'norma asociada derogada', 'articulos', '2016-05-26 16:30:06', '2016-05-26 16:30:06'), ('15', '9', 'norma asociada derogada', 'articulos', '2016-05-26 16:30:06', '2016-05-26 16:30:06'), ('16', '10', 'norma asociada derogada', 'articulos', '2016-05-26 16:30:06', '2016-05-26 16:30:06'), ('17', '11', 'norma asociada derogada', 'articulos', '2016-05-26 16:30:06', '2016-05-26 16:30:06'), ('18', '1', '6', 'normas', '2016-05-26 16:30:06', '2016-05-26 16:30:06'), ('19', '14', 'norma asociada derogada', 'articulos', '2016-05-27 07:33:34', '2016-05-27 07:33:34'), ('20', '15', 'norma asociada derogada', 'articulos', '2016-05-27 07:33:34', '2016-05-27 07:33:34'), ('21', '6', '8', 'normas', '2016-05-27 12:36:13', '2016-05-27 07:33:34'), ('26', '18', '19', 'articulos', '2016-05-31 14:58:23', '2016-05-31 14:58:23'), ('27', '19', '20', 'articulos', '2016-05-31 14:59:12', '2016-05-31 14:59:12'), ('28', '21', '22', 'articulos', '2016-05-31 15:44:23', '2016-05-31 15:44:23');
COMMIT;
-- ----------------------------
-- Table structure for RequisitosMatriz
-- ----------------------------
DROP TABLE IF EXISTS `RequisitosMatriz`;
CREATE TABLE `RequisitosMatriz` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`FactorRiesgo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`Grupo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`CategoriaRiesgo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`TipoNorma` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`Numero` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`AñoEmision` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`AutoridadEmite` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`ArticuloAplica` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`LitNum` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`NormasRelacionadas` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`Norma` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT 'NO APLICA' ,
`created_at` timestamp NOT NULL ,
`updated_at` timestamp NOT NULL ,
`empresa` int(11) NOT NULL ,
`Ambiental` tinyint(1) NOT NULL DEFAULT 0 ,
`Estadoarticulo` varchar(35) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'Vigente' ,
PRIMARY KEY (`id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=latin1 COLLATE=latin1_swedish_ci
AUTO_INCREMENT=15
;
-- ----------------------------
-- Records of RequisitosMatriz
-- ----------------------------
BEGIN;
INSERT INTO `RequisitosMatriz` VALUES ('12', 'Ambiente y Desarrollo', 'Suelo', 'Seguro ecológico', 'Acuerdo', '782', '2016', 'Congreso \r\nde la República', '5678', 'No aplica', 'No aplica', 'NO APLICA', '2016-05-31 14:35:11', '2016-05-31 14:35:11', '1', '0', 'Vigente'), ('13', 'Ambiente y Desarrollo', 'Suelo', 'Seguro ecológico', 'Ley', '5678', '2006', 'Ministerio de Salud', '5', 'No aplica', 'Esta norma sigue vigente actualmente', 'NO APLICA', '2016-05-31 14:58:40', '2016-05-31 14:58:40', '1', '0', 'Vigente'), ('14', 'Ambiente y Desarrollo', 'Energía ', 'Desarrollo web', 'Circular Externa ', '345', '2004', 'Ministerio de Comercio Exterior ', '1', 'No aplica', 'derogada la norma con id 2', 'NO APLICA', '2016-05-31 15:31:10', '2016-05-31 15:44:23', '1', '0', 'Derogado');
COMMIT;
-- ----------------------------
-- Table structure for rol
-- ----------------------------
DROP TABLE IF EXISTS `rol`;
CREATE TABLE `rol` (
`idrol` int(11) NOT NULL AUTO_INCREMENT ,
`nombre` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
PRIMARY KEY (`idrol`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=4
;
-- ----------------------------
-- Records of rol
-- ----------------------------
BEGIN;
INSERT INTO `rol` VALUES ('1', 'Administrador'), ('2', 'Consultor'), ('3', 'Cliente');
COMMIT;
-- ----------------------------
-- Table structure for sector
-- ----------------------------
DROP TABLE IF EXISTS `sector`;
CREATE TABLE `sector` (
`idsector` int(200) NOT NULL ,
`sector` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
;
-- ----------------------------
-- Records of sector
-- ----------------------------
BEGIN;
INSERT INTO `sector` VALUES ('1', 'Agropecuario'), ('2', 'Industrial'), ('3', 'Transporte'), ('4', 'Financiera');
COMMIT;
-- ----------------------------
-- Table structure for sub_factor_riesgo
-- ----------------------------
DROP TABLE IF EXISTS `sub_factor_riesgo`;
CREATE TABLE `sub_factor_riesgo` (
`idsub_factor_riesgo` int(11) NOT NULL AUTO_INCREMENT ,
`factor_riesgo_id` int(11) NOT NULL ,
`nombre` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`created_at` date NOT NULL ,
`updated_at` date NOT NULL ,
PRIMARY KEY (`idsub_factor_riesgo`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=11
;
-- ----------------------------
-- Records of sub_factor_riesgo
-- ----------------------------
BEGIN;
INSERT INTO `sub_factor_riesgo` VALUES ('1', '1', 'Departamento de Gestión Ambiental', '2016-05-18', '2016-05-18'), ('2', '2', 'Accidentes de tránsito en el transporte de me', '2016-05-18', '2016-05-18'), ('3', '3', 'vial', '2016-05-18', '2016-05-18'), ('4', '1', 'Seguro ecológico', '2016-05-18', '2016-05-18'), ('5', '4', 'Calidad de software ', '2016-05-18', '2016-05-18'), ('6', '3', 'Salud en el trabajo', '2016-05-18', '2016-05-18'), ('7', '9', 'Caída de maquinaria ', '2016-05-22', '2016-05-22'), ('8', '9', 'Caída en Oficinas', '2016-05-22', '2016-05-22'), ('9', '1', 'Desarrollo web', '2016-05-22', '2016-05-22'), ('10', '12', 'Manejo de cargas', '2016-05-26', '2016-05-26');
COMMIT;
-- ----------------------------
-- Table structure for temas_grupo
-- ----------------------------
DROP TABLE IF EXISTS `temas_grupo`;
CREATE TABLE `temas_grupo` (
`idtema` int(11) NOT NULL AUTO_INCREMENT ,
`tema` varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`created_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL ON UPDATE CURRENT_TIMESTAMP ,
PRIMARY KEY (`idtema`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=17
;
-- ----------------------------
-- Records of temas_grupo
-- ----------------------------
BEGIN;
INSERT INTO `temas_grupo` VALUES ('1', 'Administrativo', '2016-05-09 14:05:38', '2016-05-31 19:05:42'), ('2', 'Energía ', '2016-05-09 14:05:38', '2016-05-31 19:05:49'), ('3', 'Agua', '2016-05-09 14:05:38', '2016-05-31 19:05:51'), ('4', 'Vertimientos', '2016-05-09 14:05:38', '2016-05-31 19:05:54'), ('5', 'Emergencias y Contingencias', '2016-05-09 14:05:38', '2016-05-31 19:05:56'), ('6', 'Aire', '2016-05-09 14:05:38', '2016-05-31 19:05:58'), ('7', 'Quimico', '2016-05-09 14:05:38', '2016-05-31 19:06:00'), ('8', 'Control sustancias', '2016-05-09 14:05:38', '2016-05-31 19:06:02'), ('9', 'Comunidad', '2016-05-09 14:05:38', '2016-05-31 19:06:04'), ('10', 'Flora', '2016-05-09 14:05:38', '2016-05-31 19:06:06'), ('11', 'Residuos ', '2016-05-09 14:05:38', '2016-05-31 19:06:08'), ('12', 'Paisajismo', '2016-05-09 14:05:38', '2016-05-31 19:06:10'), ('13', 'Radiactivos', '2016-05-09 14:05:38', '2016-05-31 19:06:12'), ('14', 'Suelo', '2016-05-09 14:05:38', '2016-05-31 19:06:14'), ('15', 'Transporte', '2016-05-09 14:05:38', '2016-05-31 19:06:19'), ('16', 'Gestion de calidad', '2016-05-31 14:06:39', '2016-05-31 14:06:39');
COMMIT;
-- ----------------------------
-- Table structure for test_chart
-- ----------------------------
DROP TABLE IF EXISTS `test_chart`;
CREATE TABLE `test_chart` (
`id` tinyint(11) NOT NULL ,
`calificacion` int(11) NOT NULL
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
;
-- ----------------------------
-- Records of test_chart
-- ----------------------------
BEGIN;
INSERT INTO `test_chart` VALUES ('1', '100'), ('2', '100'), ('3', '100'), ('4', '100'), ('5', '100'), ('6', '100'), ('7', '100'), ('8', '100'), ('9', '0'), ('10', '0');
COMMIT;
-- ----------------------------
-- Table structure for tipo_norma
-- ----------------------------
DROP TABLE IF EXISTS `tipo_norma`;
CREATE TABLE `tipo_norma` (
`idtipo_norma` int(11) NOT NULL AUTO_INCREMENT ,
`nombre` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`descripcion` varchar(300) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`created_at` timestamp NULL DEFAULT NULL ,
`updated_at` timestamp NULL DEFAULT NULL ,
PRIMARY KEY (`idtipo_norma`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=11
;
-- ----------------------------
-- Records of tipo_norma
-- ----------------------------
BEGIN;
INSERT INTO `tipo_norma` VALUES ('1', 'Decretos', 'Son actos administrativos que posee un contenido normativo reglamentario.', '2016-04-15 20:32:14', '2016-05-12 19:28:18'), ('2', 'Decreto- Ley', 'Es una norma con rango de Ley sin que medie autorización previa de un congreso', '2016-04-15 20:32:14', '2016-04-26 14:13:43'), ('3', 'Acuerdo', 'Este acuerdo tiene como fin de proteger el medio ambiente', '2016-04-20 21:02:02', '2016-04-26 13:54:07'), ('4', 'Circular Externa ', 'Relacionado al medio ambiente ', '2016-04-21 21:12:08', '2016-04-26 13:55:11'), ('5', 'Resolución', 'Esta resolución esta enfocada al medio Ambiente ', '2016-04-21 21:12:21', '2016-04-26 13:51:09'), ('6', 'ISO - NTC Normas Técnicas Colombianas ', 'Norma establecidas para estandarizar procesos', '2016-04-26 14:28:08', '2016-04-26 14:28:08'), ('7', 'Ley', 'Regla o norma establecida por una autoridad superior para regular un aspecto', '2016-04-26 14:32:09', '2016-04-26 14:32:09'), ('8', 'NTC', 'Normas Tecnicas Colombianas', '2016-04-26 14:34:27', '2016-04-26 14:34:27'), ('9', 'Resolución', 'Se conoce como resolución al fallo o decisión que se emite por autoridad juducial ', '2016-04-26 15:01:41', '2016-04-26 15:01:41'), ('10', 'Juridica', '', '2016-05-22 17:47:05', '2016-05-22 17:47:05');
COMMIT;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT ,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`password` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`remember_token` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ,
`created_at` timestamp NULL DEFAULT NULL ,
`updated_at` timestamp NULL DEFAULT NULL ,
PRIMARY KEY (`id`),
UNIQUE INDEX `users_email_unique` (`email`) USING BTREE
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=1
;
-- ----------------------------
-- Records of users
-- ----------------------------
BEGIN;
COMMIT;
-- ----------------------------
-- Table structure for usuarios
-- ----------------------------
DROP TABLE IF EXISTS `usuarios`;
CREATE TABLE `usuarios` (
`idusuario` int(11) NOT NULL AUTO_INCREMENT ,
`rol_id` int(11) NOT NULL ,
`nombre` varchar(50) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`usuario` varchar(45) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`password` varchar(60) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`remember_token` varchar(100) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL DEFAULT NULL ,
`correo` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`EmpresasPermiso` varchar(20) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'ninguna' ,
`estado` tinyint(1) NOT NULL ,
`created_at` date NOT NULL ,
`updated_at` date NOT NULL ,
PRIMARY KEY (`idusuario`),
FOREIGN KEY (`rol_id`) REFERENCES `rol` (`idrol`) ON DELETE NO ACTION ON UPDATE NO ACTION,
INDEX `fk_usuario_rol1_idx` (`rol_id`) USING BTREE
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
AUTO_INCREMENT=31
;
-- ----------------------------
-- Records of usuarios
-- ----------------------------
BEGIN;
INSERT INTO `usuarios` VALUES ('1', '1', 'Tatiana', 'ttoro', <PASSWORD>', null, '<EMAIL>', 'ninguna', '1', '2016-04-01', '2016-05-06'), ('2', '3', '<NAME>', 'fforero', 'forero2015', null, '<EMAIL>', 'ninguna', '3', '2016-04-01', '2016-04-01'), ('3', '2', '<NAME>', 'cmerchan', '$2y$10$a5OuQi7hhwS2/IKzKg9Ty<PASSWORD>FaJC<PASSWORD>Vgg<PASSWORD>', 'zsuw5JhayYLR6ZOHMN7fgim9xFm855XxiasGkoJMImXn1guQLJkbhmGm7k5q', '<EMAIL>', '2', '1', '2016-04-01', '2016-05-13'), ('5', '1', '<NAME>', 'MoseisAs', '$2y$10$iq/JCmg54aHWOjnJz8QgZOZR55kgEB6XLfSun/zxhAnuYWd7wIjPe', null, '<EMAIL>', 'ninguna', '3', '2016-03-16', '2016-05-04'), ('8', '3', 'pruebazord', 'prueba', 'dsdsdsd', null, '<EMAIL>', 'ninguna', '0', '2016-03-17', '2016-05-06'), ('9', '2', 'JoseHernandez', 'Jose', 'Joseelduro', null, '<EMAIL>', 'ninguna', '0', '2016-03-17', '2016-03-17'), ('10', '3', '<NAME>', 'AndresB', 'asasdsdsd', null, '<EMAIL>', 'ninguna', '0', '2016-03-17', '2016-03-17'), ('14', '2', '<NAME>', 'Jvega', '$2y$10$ujD2.HMq.Mapfzsh2UGSteYBVMci6FcgGBGDOLDiJ5XGZGXJohUFy', 'y30SpFqXy1utCuLUfcD9hyg9oG5SxhRIMciR1eFmwokc07qkkp8L4tkb2MRZ', '<EMAIL>', '1,3', '0', '2016-03-22', '2016-05-16'), ('16', '2', '<NAME>', 'jklion', 'dsdsdsdsd', null, '<EMAIL>', '1,3', '0', '2016-03-22', '2016-05-13'), ('17', '1', '<NAME>', 'marolope', 'dssasds', null, '<EMAIL>', 'ninguna', '0', '2016-03-22', '2016-03-22'), ('24', '1', '<NAME>', 'Alexveg', '$2y$10$DYlLRBkrO0RRwwhWizRsOOII8yYp9WZ4SgjG/KUodgWSc1bM7FGFS', 'wMHotZLg2nzncwiBbM8OKLUmnRFuTaHNPp6RtQZmiS5ubkIMYRIB8jRzDiGI', '<EMAIL>', 'ninguna', '0', '2016-03-30', '2016-06-01'), ('25', '2', '<NAME> ', 'Franciscor', '$2y$10$Gc95qNZ21QpGfO4kzzaQrOkeD79VDVApRJm4zVKvz1KP5sweyleyy', '9eUVqa3aK334NKWRads8dOXelmELCvMAzJ8rIz584p6DRLkqsytFFOQohIfU', '<EMAIL>', 'ninguna', '0', '2016-04-01', '2016-05-13'), ('26', '1', '<NAME>', 'natat', '$2y$10$KlwT3glm40ssBq8GpjOl..4gUXb9Iie7HrzCn8sBWeV5LWBgHPBpu', null, '<EMAIL>', 'ninguna', '0', '2016-04-06', '2016-04-06'), ('27', '2', '<NAME>', 'Jrodriguez', '$2y$10$82I1IDMbYbhhCJzjNDCcuevv37X0pch8TgC5.Cp675w6HfX12jh1a', null, '<EMAIL>', 'ninguna', '0', '2016-04-13', '2016-04-13'), ('28', '1', '<NAME>', 'mtoro', '$2y$10$8oQaetJdtZZbPmL/k8i0vuWNEySwH9yH6pdB67at1LtvLz5D3Z4Ra', null, '<EMAIL>', 'ninguna', '3', '2016-04-20', '2016-04-20'), ('29', '3', '<NAME>', 'MarioGi', '$2y$10$b0h6kTdQ4H04dYOOyvOP0ucgOaxnOLiZaVrapcTT5C2ro9436UUEW', 'jcHLxkjlnOpM9z8b0EuLw6doJDONHv8Wc9cDIzvNgyBgrHyjRKYiotwSiYom', '<EMAIL>', 'ninguna', '0', '2016-05-13', '2016-05-13'), ('30', '3', '<NAME>', '<NAME>', '$2y$10$grL0m8hYc5r1lPOUHaGS3u6.E8TUDkFRXwsp74FJ/Atm8yqHbwxu.', null, '<EMAIL>', 'ninguna', '0', '2016-05-22', '2016-05-22');
COMMIT;
-- ----------------------------
-- Table structure for yearemision
-- ----------------------------
DROP TABLE IF EXISTS `yearemision`;
CREATE TABLE `yearemision` (
`id` int(10) UNSIGNED NOT NULL ,
`year` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL ,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci
;
-- ----------------------------
-- Records of yearemision
-- ----------------------------
BEGIN;
INSERT INTO `yearemision` VALUES ('1', '2016', '2016-05-16 15:42:51', '2016-05-20 12:18:06'), ('2', '2011', '2016-05-16 15:42:51', '2016-05-20 12:18:06'), ('3', '1978', '2016-05-18 22:58:24', '2016-05-18 20:48:34'), ('4', '2000', '2016-05-18 20:49:26', '2016-05-18 20:49:26'), ('5', '2001', '2016-05-19 21:44:07', '2016-05-20 12:18:06'), ('6', '2002', '2016-05-19 21:44:07', '2016-05-20 12:18:06'), ('7', '2003', '2016-05-19 21:44:25', '2016-05-20 12:18:06'), ('8', '2004', '2016-05-19 21:44:25', '2016-05-20 12:18:06'), ('9', '2009', '2016-05-19 21:45:26', '2016-05-20 12:18:06'), ('10', '2015', '2016-05-19 21:45:26', '2016-05-20 12:18:06'), ('11', '2005', '2016-05-20 12:18:06', '2016-05-20 12:18:06'), ('12', '2006', '2016-05-20 12:18:14', '2016-05-20 12:18:14'), ('13', '2007', '2016-05-20 12:18:25', '2016-05-20 12:18:25'), ('14', '2008', '2016-05-20 12:18:48', '2016-05-20 12:18:48'), ('15', '2010', '2016-05-20 12:19:45', '2016-05-20 12:19:45'), ('16', '2012', '2016-05-20 12:20:02', '2016-05-20 12:20:02'), ('17', '2013', '2016-05-20 12:20:08', '2016-05-20 12:20:08'), ('18', '2014', '2016-05-20 12:20:36', '2016-05-20 12:20:36'), ('19', '1999', '2016-05-20 12:21:48', '2016-05-20 12:21:48'), ('20', '1998', '2016-05-20 12:21:55', '2016-05-20 12:21:55');
COMMIT;
-- ----------------------------
-- Auto increment value for Articulos
-- ----------------------------
ALTER TABLE `Articulos` AUTO_INCREMENT=23;
-- ----------------------------
-- Auto increment value for AspectoAmbiental
-- ----------------------------
ALTER TABLE `AspectoAmbiental` AUTO_INCREMENT=3;
-- ----------------------------
-- Auto increment value for autoridademisora
-- ----------------------------
ALTER TABLE `autoridademisora` AUTO_INCREMENT=15;
-- ----------------------------
-- Auto increment value for CategoriaAmbiental
-- ----------------------------
ALTER TABLE `CategoriaAmbiental` AUTO_INCREMENT=2;
-- ----------------------------
-- Auto increment value for Comentario
-- ----------------------------
ALTER TABLE `Comentario` AUTO_INCREMENT=17;
-- ----------------------------
-- Auto increment value for empresa
-- ----------------------------
ALTER TABLE `empresa` AUTO_INCREMENT=4;
-- ----------------------------
-- Auto increment value for EstadoCumplimiento
-- ----------------------------
ALTER TABLE `EstadoCumplimiento` AUTO_INCREMENT=15;
-- ----------------------------
-- Auto increment value for Evaluacion
-- ----------------------------
ALTER TABLE `Evaluacion` AUTO_INCREMENT=17;
-- ----------------------------
-- Auto increment value for factor_riesgo
-- ----------------------------
ALTER TABLE `factor_riesgo` AUTO_INCREMENT=13;
-- ----------------------------
-- Auto increment value for HistoricoMigracion
-- ----------------------------
ALTER TABLE `HistoricoMigracion` AUTO_INCREMENT=6;
-- ----------------------------
-- Auto increment value for MigracionMatriz
-- ----------------------------
ALTER TABLE `MigracionMatriz` AUTO_INCREMENT=5;
-- ----------------------------
-- Auto increment value for normas
-- ----------------------------
ALTER TABLE `normas` AUTO_INCREMENT=11;
-- ----------------------------
-- Auto increment value for Relacionderogada
-- ----------------------------
ALTER TABLE `Relacionderogada` AUTO_INCREMENT=29;
-- ----------------------------
-- Auto increment value for RequisitosMatriz
-- ----------------------------
ALTER TABLE `RequisitosMatriz` AUTO_INCREMENT=15;
-- ----------------------------
-- Auto increment value for rol
-- ----------------------------
ALTER TABLE `rol` AUTO_INCREMENT=4;
-- ----------------------------
-- Auto increment value for sub_factor_riesgo
-- ----------------------------
ALTER TABLE `sub_factor_riesgo` AUTO_INCREMENT=11;
-- ----------------------------
-- Auto increment value for temas_grupo
-- ----------------------------
ALTER TABLE `temas_grupo` AUTO_INCREMENT=17;
-- ----------------------------
-- Auto increment value for tipo_norma
-- ----------------------------
ALTER TABLE `tipo_norma` AUTO_INCREMENT=11;
-- ----------------------------
-- Auto increment value for users
-- ----------------------------
ALTER TABLE `users` AUTO_INCREMENT=1;
-- ----------------------------
-- Auto increment value for usuarios
-- ----------------------------
ALTER TABLE `usuarios` AUTO_INCREMENT=31;
|
create database A06;
use A06;
create table employee(
emp_id int not null primary key,
emp_name varchar(16) not null,
date_of_join date not null,
salary int
);
create table employee_temp(
emp_id int not null primary key,
emp_name varchar(16) not null,
date_of_join date not null default (SYSDATE())
);
|
<gh_stars>1-10
--------------------------------------------------------
-- File created - zaterdag-juli-13-2013
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Package MARKDOWN
--------------------------------------------------------
create or replace package markdown
as
function markdown_to_html(p_text in clob)
return clob;
function html_to_markdown(p_text in varchar2)
return varchar2;
end markdown;
/
|
CREATE SECURITY POLICY Security.SalesFilter
ADD FILTER PREDICATE Security.fn_securitypredicate(TenantId)
ON dbo.Sales,
ADD BLOCK PREDICATE Security.fn_securitypredicate(TenantId)
ON dbo.Sales AFTER INSERT
WITH (STATE = ON); |
CREATE FUNCTION [tSQLt].[Private_ResolveObjectName](@Name NVARCHAR(MAX))
RETURNS TABLE
AS
RETURN
WITH ids(schemaId, objectId) AS
(SELECT SCHEMA_ID(OBJECT_SCHEMA_NAME(OBJECT_ID(@Name))),
OBJECT_ID(@Name)
),
idsWithNames(schemaId, objectId, quotedSchemaName, quotedObjectName) AS
(SELECT schemaId, objectId,
QUOTENAME(SCHEMA_NAME(schemaId)) AS quotedSchemaName,
QUOTENAME(OBJECT_NAME(objectId)) AS quotedObjectName
FROM ids
)
SELECT schemaId,
objectId,
quotedSchemaName,
quotedObjectName,
quotedSchemaName + '.' + quotedObjectName AS quotedFullName,
CASE WHEN LOWER(quotedObjectName) LIKE '[[]test%]'
AND objectId = OBJECT_ID(quotedSchemaName + '.' + quotedObjectName,'P')
THEN 1 ELSE 0 END AS isTestCase
FROM idsWithNames; |
<reponame>RobbieElias/RottenPotatoes
/*put the initial data to be added when the db is created*/
/* ---------------
Directors
--------------- */
INSERT INTO director VALUES (1, '<NAME>', '1945-05-24');
INSERT INTO director VALUES (2, '<NAME>', '1960-02-09');
INSERT INTO director VALUES (3, '<NAME>', '1940-12-17');
INSERT INTO director VALUES (4, '<NAME>', '1973-04-15');
INSERT INTO director VALUES (5, '<NAME>', '1959-05-10');
INSERT INTO director VALUES (6, '<NAME>', '1969-05-28');
INSERT INTO director VALUES (7, '<NAME>', '1988-07-01');
INSERT INTO director VALUES (8, '<NAME>', '1930-01-19');
INSERT INTO director VALUES (9, '<NAME>', '1951-05-01');
INSERT INTO director VALUES (10, '<NAME>', '1975-01-06');
INSERT INTO director VALUES (11, '<NAME>', '1951-08-29');
INSERT INTO director VALUES (12, '<NAME>', '1966-01-22');
INSERT INTO director VALUES (13, '<NAME>', '1958-01-07');
INSERT INTO director VALUES (14, '<NAME>', '1983-10-31');
INSERT INTO director VALUES (15, '<NAME>', '1976-05-20');
INSERT INTO director VALUES (16, '<NAME>', '1973-03-16');
INSERT INTO director VALUES (17, '<NAME>', '1940-01-30');
INSERT INTO director VALUES (18, '<NAME>', '1947-09-12');
INSERT INTO director VALUES (19, '<NAME>', '1990-03-05');
INSERT INTO director VALUES (20, '<NAME>', '1977-01-13');
INSERT INTO director VALUES (21, '<NAME>', '1963-02-16');
INSERT INTO director VALUES (22, '<NAME>', '1947-12-12');
INSERT INTO director VALUES (23, '<NAME>', '1945-04-06');
INSERT INTO director VALUES (24, '<NAME>', '1950-06-09');
INSERT INTO director VALUES (25, '<NAME>', '1948-02-03');
INSERT INTO director VALUES (26, '<NAME>', '1955-08-21');
INSERT INTO director VALUES (27, '<NAME>', '1971-11-04');
INSERT INTO director VALUES (28, '<NAME>', '1935-11-24');
INSERT INTO director VALUES (29, '<NAME>', '1977-08-09');
INSERT INTO director VALUES (30, '<NAME>', '1955-02-09');
INSERT INTO director VALUES (31, '<NAME>', '1934-01-29');
INSERT INTO director VALUES (32, '<NAME>', '1932-01-01');
INSERT INTO director VALUES (33, '<NAME>', '1985-03-19');
INSERT INTO director VALUES (34, '<NAME>', '1945-01-14');
INSERT INTO director VALUES (35, '<NAME>', '1975-04-16');
INSERT INTO director VALUES (36, '<NAME>', '1953-07-28');
INSERT INTO director VALUES (37, '<NAME>', '1984-06-10');
INSERT INTO director VALUES (38, '<NAME>', '1972-10-16');
INSERT INTO director VALUES (39, '<NAME>', '1953-08-16');
INSERT INTO director VALUES (40, '<NAME>', '1944-10-10');
INSERT INTO director VALUES (41, '<NAME>', '1956-10-23');
INSERT INTO director VALUES (42, '<NAME>', '1975-04-13');
INSERT INTO director VALUES (43, '<NAME>', '1980-10-31');
INSERT INTO director VALUES (44, '<NAME>', '1984-10-29');
INSERT INTO director VALUES (45, '<NAME>', '1968-02-11');
INSERT INTO director VALUES (46, '<NAME>', '1966-03-22');
INSERT INTO director VALUES (47, '<NAME>', '1967-01-13');
INSERT INTO director VALUES (48, '<NAME>', '1978-03-11');
INSERT INTO director VALUES (49, '<NAME>', '1983-12-01');
INSERT INTO director VALUES (50, '<NAME>', '1966-03-18');
INSERT INTO director VALUES (51, '<NAME>', '1964-03-25');
INSERT INTO director VALUES (52, '<NAME>', '1956-01-18');
INSERT INTO director VALUES (53, '<NAME>', '1984-02-26');
INSERT INTO director VALUES (54, '<NAME>', '1979-06-30');
INSERT INTO director VALUES (55, '<NAME>', '1976-06-25');
INSERT INTO director VALUES (56, '<NAME>', '1941-04-01');
INSERT INTO director VALUES (57, '<NAME>', '1944-02-18');
INSERT INTO director VALUES (58, '<NAME>', '1957-04-30');
INSERT INTO director VALUES (59, '<NAME>', '1947-02-22');
INSERT INTO director VALUES (60, '<NAME>', '1930-09-28');
INSERT INTO director VALUES (61, '<NAME>', '1982-06-08');
INSERT INTO director VALUES (62, '<NAME>', '1951-03-23');
INSERT INTO director VALUES (63, '<NAME>', '1932-09-27');
INSERT INTO director VALUES (64, '<NAME>', '1976-08-26');
INSERT INTO director VALUES (65, '<NAME>', '1966-04-05');
INSERT INTO director VALUES (66, '<NAME>', '1978-01-11');
INSERT INTO director VALUES (67, '<NAME>', '1939-03-25');
INSERT INTO director VALUES (68, '<NAME>', '1959-09-15');
INSERT INTO director VALUES (69, '<NAME>', '1959-10-28');
INSERT INTO director VALUES (70, '<NAME>', '1962-11-07');
INSERT INTO director VALUES (71, '<NAME>', '1974-06-24');
INSERT INTO director VALUES (72, '<NAME>', '1986-08-19');
INSERT INTO director VALUES (73, '<NAME>', '1947-02-18');
INSERT INTO director VALUES (74, '<NAME>', '1964-04-25');
INSERT INTO director VALUES (75, '<NAME>', '1980-06-18');
INSERT INTO director VALUES (76, '<NAME>', '1985-03-30');
INSERT INTO director VALUES (77, '<NAME>', '1939-07-17');
INSERT INTO director VALUES (78, '<NAME>', '1956-07-01');
INSERT INTO director VALUES (79, '<NAME>', '1972-06-09');
INSERT INTO director VALUES (80, '<NAME>', '1932-06-16');
INSERT INTO director VALUES (81, '<NAME>', '1931-09-17');
INSERT INTO director VALUES (82, '<NAME>', '1945-09-03');
INSERT INTO director VALUES (83, '<NAME>', '1958-07-04');
INSERT INTO director VALUES (84, '<NAME>', '1985-11-12');
INSERT INTO director VALUES (85, '<NAME>', '1934-03-03');
INSERT INTO director VALUES (86, '<NAME>', '1943-12-28');
INSERT INTO director VALUES (87, '<NAME>', '1936-02-13');
INSERT INTO director VALUES (88, '<NAME>', '1948-04-20');
INSERT INTO director VALUES (89, '<NAME>', '1971-04-26');
INSERT INTO director VALUES (90, '<NAME>', '1953-04-05');
INSERT INTO director VALUES (91, '<NAME>', '1949-01-15');
INSERT INTO director VALUES (92, '<NAME>', '1962-10-03');
INSERT INTO director VALUES (93, '<NAME>', '1974-06-25');
INSERT INTO director VALUES (94, '<NAME>', '1951-10-13');
INSERT INTO director VALUES (95, '<NAME>', '1948-05-29');
INSERT INTO director VALUES (96, '<NAME>', '1949-09-29');
INSERT INTO director VALUES (97, '<NAME>', '1938-10-24');
INSERT INTO director VALUES (98, '<NAME>', '1957-08-20');
INSERT INTO director VALUES (99, '<NAME>', '1979-06-13');
INSERT INTO director VALUES (100, '<NAME>', '1968-08-20');
INSERT INTO director VALUES (101, '<NAME>', '1990-06-27');
INSERT INTO director VALUES (102, '<NAME>', '1962-12-06');
INSERT INTO director VALUES (103, '<NAME>', '1964-04-08');
INSERT INTO director VALUES (104, '<NAME>', '1946-08-15');
INSERT INTO director VALUES (105, '<NAME>', '1936-04-01');
INSERT INTO director VALUES (106, '<NAME>', '1953-09-26');
INSERT INTO director VALUES (107, '<NAME>', '1940-11-13');
INSERT INTO director VALUES (108, '<NAME>', '1945-10-15');
INSERT INTO director VALUES (109, '<NAME>', '1980-03-26');
INSERT INTO director VALUES (110, '<NAME>', '1983-04-22');
INSERT INTO director VALUES (111, '<NAME>', '1948-03-31');
INSERT INTO director VALUES (112, '<NAME>', '1981-12-11');
INSERT INTO director VALUES (113, 'N/A', '1937-12-25');
INSERT INTO director VALUES (114, '<NAME>', '1976-10-01');
INSERT INTO director VALUES (115, '<NAME>', '1976-10-23');
INSERT INTO director VALUES (116, '<NAME>', '1942-02-25');
INSERT INTO director VALUES (117, '<NAME>', '1990-09-27');
INSERT INTO director VALUES (118, '<NAME>', '1982-12-05');
INSERT INTO director VALUES (119, '<NAME>', '1960-06-14');
INSERT INTO director VALUES (120, '<NAME>', '1971-01-22');
INSERT INTO director VALUES (121, '<NAME>', '1945-03-11');
INSERT INTO director VALUES (122, '<NAME>', '1979-06-30');
INSERT INTO director VALUES (123, '<NAME>', '1942-10-25');
INSERT INTO director VALUES (124, '<NAME>', '1989-09-03');
INSERT INTO director VALUES (125, '<NAME>', '1940-04-11');
INSERT INTO director VALUES (126, '<NAME>', '1961-03-23');
INSERT INTO director VALUES (127, '<NAME>', '1948-06-02');
INSERT INTO director VALUES (128, '<NAME>', '1949-02-02');
INSERT INTO director VALUES (129, '<NAME>', '1988-11-09');
INSERT INTO director VALUES (130, '<NAME>', '1936-11-14');
INSERT INTO director VALUES (131, '<NAME>', '1987-09-23');
INSERT INTO director VALUES (136, '<NAME>', '1988-05-06');
/* ---------------
Topics
--------------- */
INSERT INTO topics VALUES (3, 'Crime');
INSERT INTO topics VALUES (4, 'Drama');
INSERT INTO topics VALUES (5, 'Action');
INSERT INTO topics VALUES (6, 'Mystery');
INSERT INTO topics VALUES (7, 'Sci-Fi');
INSERT INTO topics VALUES (8, 'Biography');
INSERT INTO topics VALUES (9, 'History');
INSERT INTO topics VALUES (10, 'Adventure');
INSERT INTO topics VALUES (11, 'Fantasy');
INSERT INTO topics VALUES (12, 'Romance');
INSERT INTO topics VALUES (13, 'War');
INSERT INTO topics VALUES (14, 'Thriller');
INSERT INTO topics VALUES (15, 'Animation');
INSERT INTO topics VALUES (16, 'Comedy');
INSERT INTO topics VALUES (17, 'Horror');
INSERT INTO topics VALUES (18, 'Family');
INSERT INTO topics VALUES (20, 'Sport');
INSERT INTO topics VALUES (21, 'Musical');
INSERT INTO topics VALUES (23, 'Western');
INSERT INTO topics VALUES (24, 'None');
INSERT INTO topics VALUES (25, 'Documentary');
/* ---------------
Movies
--------------- */
INSERT INTO movie VALUES (82, 'Amadeus', 1984, 'images/movies/amadeus.jpg');
INSERT INTO movie VALUES (83, 'Once Upon a Time in America', 1984, 'images/movies/once_upon_a_time_in_america.jpg');
INSERT INTO movie VALUES (84, 'The Green Mile', 1999, 'images/movies/the_green_mile.jpg');
INSERT INTO movie VALUES (85, 'Full Metal Jacket', 1987, 'images/movies/full_metal_jacket.jpg');
INSERT INTO movie VALUES (86, 'Inglourious Basterds', 2009, 'images/movies/inglourious_basterds.jpg');
INSERT INTO movie VALUES (87, '2001: A Space Odyssey', 1968, 'images/movies/2001_a_space_odyssey.jpg');
INSERT INTO movie VALUES (88, 'The Great Dictator', 1940, 'images/movies/the_great_dictator.jpg');
INSERT INTO movie VALUES (89, 'Braveheart', 1995, 'images/movies/braveheart.jpg');
INSERT INTO movie VALUES (90, '<NAME>', 1948, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (91, 'The Apartment', 1960, 'images/movies/the_apartment.jpg');
INSERT INTO movie VALUES (92, 'Up', 2009, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (93, 'Der Untergang', 2004, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (94, 'Gran Torino', 2008, 'images/movies/gran_torino.jpg');
INSERT INTO movie VALUES (95, 'Metropolis', 1927, 'images/movies/metropolis.jpg');
INSERT INTO movie VALUES (96, 'The Sting', 1973, 'images/movies/the_sting.jpg');
INSERT INTO movie VALUES (97, 'Gladiator', 2000, 'images/movies/gladiator.jpg');
INSERT INTO movie VALUES (98, 'The Maltese Falcon', 1941, 'images/movies/the_maltese_falcon.jpg');
INSERT INTO movie VALUES (99, 'Unforgiven', 1992, 'images/movies/unforgiven.jpg');
INSERT INTO movie VALUES (100, 'Sin City', 2005, 'images/movies/sin_city.jpg');
INSERT INTO movie VALUES (101, 'The Elephant Man', 1980, 'images/movies/the_elephant_man.jpg');
INSERT INTO movie VALUES (102, 'Mr. <NAME> to Washington', 1939, 'images/movies/mr_smith_goes_to_washington.jpg');
INSERT INTO movie VALUES (103, 'Oldeuboi', 2003, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (104, 'On the Waterfront', 1954, 'images/movies/on_the_waterfront.jpg');
INSERT INTO movie VALUES (105, 'Indiana Jones and the Last Crusade', 1989, 'images/movies/indiana_jones_and_the_last_crusade.jpg');
INSERT INTO movie VALUES (106, 'Star Wars: Episode VI - Return of the Jedi', 1983, 'images/movies/star_wars_episode_vi_-_return_of_the_jedi.jpg');
INSERT INTO movie VALUES (107, 'Rebecca', 1940, 'images/movies/rebecca.jpg');
INSERT INTO movie VALUES (108, 'The Great Escape', 1963, 'images/movies/the_great_escape.jpg');
INSERT INTO movie VALUES (109, 'Die Hard', 1988, 'images/movies/die_hard.jpg');
INSERT INTO movie VALUES (110, 'Batman Begins', 2005, 'images/movies/batman_begins.jpg');
INSERT INTO movie VALUES (111, 'Mononoke-hime', 1997, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (112, 'Jaws', 1975, 'images/movies/jaws.jpg');
INSERT INTO movie VALUES (113, 'Hotel Rwanda', 2004, 'images/movies/hotel_rwanda.jpg');
INSERT INTO movie VALUES (1, 'The Shawshank Redemption', 1994, 'images/movies/the_shawshank_redemption.jpg');
INSERT INTO movie VALUES (2, 'The Godfather', 1972, 'images/movies/the_godfather.jpg');
INSERT INTO movie VALUES (3, 'The Godfather: Part II', 1974, 'images/movies/the_godfather_part_ii.jpg');
INSERT INTO movie VALUES (4, 'Il buono, il brutto, il cattivo.', 1966, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (5, 'Pulp Fiction', 1994, 'images/movies/pulp_fiction.jpg');
INSERT INTO movie VALUES (7, 'Schindler''s List', 1993, 'images/movies/schindlers_list.jpg');
INSERT INTO movie VALUES (8, '12 Angry Men', 1957, 'images/movies/12_angry_men.jpg');
INSERT INTO movie VALUES (9, 'One Flew Over the Cuckoo''s Nest', 1975, 'images/movies/one_flew_over_the_cuckoos_nest.jpg');
INSERT INTO movie VALUES (10, 'The Dark Knight', 2008, 'images/movies/the_dark_knight.jpg');
INSERT INTO movie VALUES (11, 'Star Wars: Episode V - The Empire Strikes Back', 1980, 'images/movies/star_wars_episode_v_-_the_empire_strikes_back.jpg');
INSERT INTO movie VALUES (12, 'The Lord of the Rings: The Return of the King', 2003, 'images/movies/the_lord_of_the_rings_the_return_of_the_king.jpg');
INSERT INTO movie VALUES (13, 'Shichinin no samurai', 1954, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (14, 'Star Wars', 1977, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (15, 'Goodfellas', 1990, 'images/movies/goodfellas.jpg');
INSERT INTO movie VALUES (152, 'Sunrise: A Song of Two Humans', 1927, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (114, 'Slumdog Millionaire', 2008, 'images/movies/slumdog_millionaire.jpg');
INSERT INTO movie VALUES (115, 'Det sjunde inseglet', 1957, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (16, 'Casablanca', 1942, 'images/movies/casablanca.jpg');
INSERT INTO movie VALUES (17, 'Fight Club', 1999, 'images/movies/fight_club.jpg');
INSERT INTO movie VALUES (18, 'Cidade de Deus', 2002, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (19, 'The Lord of the Rings: The Fellowship of the Ring', 2001, 'images/movies/the_lord_of_the_rings_the_fellowship_of_the_ring.jpg');
INSERT INTO movie VALUES (20, 'Rear Window', 1954, 'images/movies/rear_window.jpg');
INSERT INTO movie VALUES (21, 'C''era una volta il West', 1968, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (22, 'Raiders of the Lost Ark', 1981, 'images/movies/raiders_of_the_lost_ark.jpg');
INSERT INTO movie VALUES (23, 'Toy Story 3', 2010, 'images/movies/toy_story_3.jpg');
INSERT INTO movie VALUES (24, 'Psycho', 1960, 'images/movies/psycho.jpg');
INSERT INTO movie VALUES (25, 'The Usual Suspects', 1995, 'images/movies/the_usual_suspects.jpg');
INSERT INTO movie VALUES (26, 'The Matrix', 1999, 'images/movies/the_matrix.jpg');
INSERT INTO movie VALUES (27, 'The Silence of the Lambs', 1991, 'images/movies/the_silence_of_the_lambs.jpg');
INSERT INTO movie VALUES (28, 'Se7en', 1995, 'images/movies/se7en.jpg');
INSERT INTO movie VALUES (29, 'Memento', 2000, 'images/movies/memento.jpg');
INSERT INTO movie VALUES (30, 'It''s a Wonderful Life', 1946, 'images/movies/its_a_wonderful_life.jpg');
INSERT INTO movie VALUES (31, 'The Lord of the Rings: The Two Towers', 2002, 'images/movies/the_lord_of_the_rings_the_two_towers.jpg');
INSERT INTO movie VALUES (32, 'Sunset Blvd.', 1950, 'images/movies/sunset_blvd.jpg');
INSERT INTO movie VALUES (33, 'Dr. Strangelove or: How I Learned to Stop Worrying and Love the Bomb', 1964, 'images/movies/dr_strangelove_or_how_i_learned_to_stop_worrying_and_love_the_bomb.jpg');
INSERT INTO movie VALUES (34, 'Forrest Gump', 1994, 'images/movies/forrest_gump.jpg');
INSERT INTO movie VALUES (36, 'Citizen Kane', 1941, 'images/movies/citizen_kane.jpg');
INSERT INTO movie VALUES (37, 'Apocalypse Now', 1979, 'images/movies/apocalypse_now.jpg');
INSERT INTO movie VALUES (38, 'North by Northwest', 1959, 'images/movies/north_by_northwest.jpg');
INSERT INTO movie VALUES (39, 'American Beauty', 1999, 'images/movies/american_beauty.jpg');
INSERT INTO movie VALUES (40, 'American History X', 1998, 'images/movies/american_history_x.jpg');
INSERT INTO movie VALUES (41, 'Taxi Driver', 1976, 'images/movies/taxi_driver.jpg');
INSERT INTO movie VALUES (42, 'Terminator 2: Judgment Day', 1991, 'images/movies/terminator_2_judgment_day.jpg');
INSERT INTO movie VALUES (43, 'Saving Private Ryan', 1998, 'images/movies/saving_private_ryan.jpg');
INSERT INTO movie VALUES (44, 'Vertigo', 1958, 'images/movies/vertigo.jpg');
INSERT INTO movie VALUES (45, 'Le fabuleux destin d''<NAME>', 2001, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (46, 'Alien', 1979, 'images/movies/alien.jpg');
INSERT INTO movie VALUES (47, 'WALL·E', 2008, 'images/movies/walle.jpg');
INSERT INTO movie VALUES (49, 'The Shining', 1980, 'images/movies/the_shining.jpg');
INSERT INTO movie VALUES (6, 'Inception', 2010, 'images/movies/inception.jpg');
INSERT INTO movie VALUES (116, 'Blade Runner', 1982, 'images/movies/blade_runner.jpg');
INSERT INTO movie VALUES (117, 'Fargo', 1996, 'images/movies/fargo.jpg');
INSERT INTO movie VALUES (118, 'No Country for Old Men', 2007, 'images/movies/no_country_for_old_men.jpg');
INSERT INTO movie VALUES (119, 'Heat', 1995, 'images/movies/heat.jpg');
INSERT INTO movie VALUES (120, 'The General', 1926, 'images/movies/the_general.jpg');
INSERT INTO movie VALUES (50, 'Sen to Chihiro no kamikakushi', 2001, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (51, 'Paths of Glory', 1957, 'images/movies/paths_of_glory.jpg');
INSERT INTO movie VALUES (52, 'A Clockwork Orange', 1971, 'images/movies/a_clockwork_orange.jpg');
INSERT INTO movie VALUES (53, 'Double Indemnity', 1944, 'images/movies/double_indemnity.jpg');
INSERT INTO movie VALUES (54, 'To Kill a Mockingbird', 1962, 'images/movies/to_kill_a_mockingbird.jpg');
INSERT INTO movie VALUES (55, 'The Pianist', 2002, 'images/movies/the_pianist.jpg');
INSERT INTO movie VALUES (56, 'Das Leben der Anderen', 2006, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (57, 'The Departed', 2006, 'images/movies/the_departed.jpg');
INSERT INTO movie VALUES (59, 'City Lights', 1931, 'images/movies/city_lights.jpg');
INSERT INTO movie VALUES (60, 'Aliens', 1986, 'images/movies/aliens.jpg');
INSERT INTO movie VALUES (61, 'Eternal Sunshine of the Spotless Mind', 2004, 'images/movies/eternal_sunshine_of_the_spotless_mind.jpg');
INSERT INTO movie VALUES (62, 'Requiem for a Dream', 2000, 'images/movies/requiem_for_a_dream.jpg');
INSERT INTO movie VALUES (63, 'Das Boot', 1981, 'images/movies/das_boot.jpg');
INSERT INTO movie VALUES (64, 'The Third Man', 1949, 'images/movies/the_third_man.jpg');
INSERT INTO movie VALUES (65, 'L.A. Confidential', 1997, 'images/movies/la_confidential.jpg');
INSERT INTO movie VALUES (66, 'Reservoir Dogs', 1992, 'images/movies/reservoir_dogs.jpg');
INSERT INTO movie VALUES (67, 'Chinatown', 1974, 'images/movies/chinatown.jpg');
INSERT INTO movie VALUES (68, 'The Treasure of the Sierra Madre', 1948, 'images/movies/the_treasure_of_the_sierra_madre.jpg');
INSERT INTO movie VALUES (69, 'Modern Times', 1936, 'images/movies/modern_times.jpg');
INSERT INTO movie VALUES (183, 'Le salaire de la peur', 1953, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (184, 'Les diaboliques', 1955, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (70, 'Monty Python and the Holy Grail', 1975, 'images/movies/monty_python_and_the_holy_grail.jpg');
INSERT INTO movie VALUES (71, 'La vita è bella', 1997, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (72, 'Back to the Future', 1985, 'images/movies/back_to_the_future.jpg');
INSERT INTO movie VALUES (73, 'The Prestige', 2006, 'images/movies/the_prestige.jpg');
INSERT INTO movie VALUES (74, 'El laberinto del fauno', 2006, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (75, 'Raging Bull', 1980, 'images/movies/raging_bull.jpg');
INSERT INTO movie VALUES (35, 'Léon', 1994, 'images/movies/leon.jpg');
INSERT INTO movie VALUES (76, 'Nuovo Cinema Paradiso', 1988, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (77, 'Singin'' in the Rain', 1952, 'images/movies/singin_in_the_rain.jpg');
INSERT INTO movie VALUES (78, 'Some Like It Hot', 1959, 'images/movies/some_like_it_hot.jpg');
INSERT INTO movie VALUES (79, 'The Bridge on the River Kwai', 1957, 'images/movies/the_bridge_on_the_river_kwai.jpg');
INSERT INTO movie VALUES (80, 'Rashômon', 1950, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (121, 'The Wizard of Oz', 1939, 'images/movies/the_wizard_of_oz.jpg');
INSERT INTO movie VALUES (122, 'Touch of Evil', 1958, 'images/movies/touch_of_evil.jpg');
INSERT INTO movie VALUES (123, 'Per qualche dollaro in più', 1965, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (125, 'Yôjinbô', 1961, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (126, 'District 9', 2009, 'images/movies/district_9.jpg');
INSERT INTO movie VALUES (127, 'The Sixth Sense', 1999, 'images/movies/the_sixth_sense.jpg');
INSERT INTO movie VALUES (128, 'Snatch.', 2000, 'images/movies/snatch.jpg');
INSERT INTO movie VALUES (129, '<NAME>', 2001, 'images/movies/donnie_darko.jpg');
INSERT INTO movie VALUES (130, '<NAME>', 1977, 'images/movies/annie_hall.jpg');
INSERT INTO movie VALUES (131, 'Witness for the Prosecution', 1957, 'images/movies/witness_for_the_prosecution.jpg');
INSERT INTO movie VALUES (132, 'Smultronstället', 1957, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (133, 'The Deer Hunter', 1978, 'images/movies/the_deer_hunter.jpg');
INSERT INTO movie VALUES (185, '8½', 1963, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (141, 'Kill Bill: Vol. 1', 2003, 'images/movies/kill_bill_vol_2.jpg');
INSERT INTO movie VALUES (142, 'It Happened One Night', 1934, 'images/movies/it_happened_one_night.jpg');
INSERT INTO movie VALUES (143, 'Platoon', 1986, 'images/movies/platoon.jpg');
INSERT INTO movie VALUES (144, 'The Lion King', 1994, 'images/movies/the_lion_king.jpg');
INSERT INTO movie VALUES (145, 'Into the Wild', 2007, 'images/movies/into_the_wild.jpg');
INSERT INTO movie VALUES (146, 'There Will Be Blood', 2007, 'images/movies/there_will_be_blood.jpg');
INSERT INTO movie VALUES (147, 'Notorious', 1946, 'images/movies/notorious.jpg');
INSERT INTO movie VALUES (148, 'Million Dollar Baby', 2004, 'images/movies/million_dollar_baby.jpg');
INSERT INTO movie VALUES (149, 'Toy Story', 1995, 'images/movies/toy_story.jpg');
INSERT INTO movie VALUES (150, 'Butch Cassidy and the Sundance Kid', 1969, 'images/movies/butch_cassidy_and_the_sundance_kid.jpg');
INSERT INTO movie VALUES (151, 'Gone with the Wind', 1939, 'images/movies/gone_with_the_wind.jpg');
INSERT INTO movie VALUES (153, 'The Wrestler', 2008, 'images/movies/the_wrestler.jpg');
INSERT INTO movie VALUES (81, 'All About Eve', 1950, 'images/movies/all_about_eve.jpg');
INSERT INTO movie VALUES (48, 'Lawrence of Arabia', 1962, 'images/movies/lawrence_of_arabia.jpg');
INSERT INTO movie VALUES (124, 'Ran', 1985, 'images/movies/ran.jpg');
INSERT INTO movie VALUES (209, 'Låt den rätte komma in', 2008, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (210, 'All Quiet on the Western Front', 1930, 'images/movies/all_quiet_on_the_western_front.jpg');
INSERT INTO movie VALUES (211, 'Big Fish', 2003, 'images/movies/big_fish.jpg');
INSERT INTO movie VALUES (212, 'Magnolia', 1999, 'images/movies/magnolia.jpg');
INSERT INTO movie VALUES (214, 'La passion de <NAME>''Arc', 1928, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (215, 'Kind Hearts and Coronets', 1949, 'images/movies/kind_hearts_and_coronets.jpg');
INSERT INTO movie VALUES (216, 'Fanny och Alexander', 1982, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (217, 'Mystic River', 2003, 'images/movies/mystic_river.jpg');
INSERT INTO movie VALUES (218, 'Manhattan', 1979, 'images/movies/manhattan.jpg');
INSERT INTO movie VALUES (219, '<NAME>', 1975, 'images/movies/barry_lyndon.jpg');
INSERT INTO movie VALUES (220, 'Kill Bill: Vol. 2', 2004, 'images/movies/kill_bill_vol_2.jpg');
INSERT INTO movie VALUES (221, '<NAME>', 2009, 'images/movies/mary_and_max.jpg');
INSERT INTO movie VALUES (222, 'Patton', 1970, 'images/movies/patton.jpg');
INSERT INTO movie VALUES (223, 'Rosemary''<NAME>', 1968, 'images/movies/rosemarys_baby.jpg');
INSERT INTO movie VALUES (224, 'Duck Soup', 1933, 'images/movies/duck_soup.jpg');
INSERT INTO movie VALUES (225, 'Festen', 1998, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (226, 'Kick-Ass', 2010, 'images/movies/kick-ass.jpg');
INSERT INTO movie VALUES (134, 'Avatar', 2009, 'images/movies/avatar.jpg');
INSERT INTO movie VALUES (135, 'The Social Network', 2010, 'images/movies/the_social_network.jpg');
INSERT INTO movie VALUES (136, 'Cool Hand Luke', 1967, 'images/movies/cool_hand_luke.jpg');
INSERT INTO movie VALUES (137, 'Strangers on a Train', 1951, 'images/movies/strangers_on_a_train.jpg');
INSERT INTO movie VALUES (138, 'High Noon', 1952, 'images/movies/high_noon.jpg');
INSERT INTO movie VALUES (139, 'The Big Lebowski', 1998, 'images/movies/the_big_lebowski.jpg');
INSERT INTO movie VALUES (140, 'Hot<NAME> haka', 1988, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (154, 'The Manchurian Candidate', 1962, 'images/movies/the_manchurian_candidate.jpg');
INSERT INTO movie VALUES (155, 'Trainspotting', 1996, 'images/movies/trainspotting.jpg');
INSERT INTO movie VALUES (156, 'Ben-Hur', 1959, 'images/movies/ben-hur.jpg');
INSERT INTO movie VALUES (157, 'Scarface', 1983, 'images/movies/scarface.jpg');
INSERT INTO movie VALUES (158, 'The Grapes of Wrath', 1940, 'images/movies/the_grapes_of_wrath.jpg');
INSERT INTO movie VALUES (159, 'The Graduate', 1967, 'images/movies/the_graduate.jpg');
INSERT INTO movie VALUES (160, 'The Big Sleep', 1946, 'images/movies/the_big_sleep.jpg');
INSERT INTO movie VALUES (161, 'Groundhog Day', 1993, 'images/movies/groundhog_day.jpg');
INSERT INTO movie VALUES (179, 'El secreto de sus ojos', 2009, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (180, 'Gandhi', 1982, 'images/movies/gandhi.jpg');
INSERT INTO movie VALUES (181, 'Star Trek', 2009, 'images/movies/star_trek.jpg');
INSERT INTO movie VALUES (182, 'Ikiru', 1952, 'images/movies/ikiru.jpg');
INSERT INTO movie VALUES (186, 'The Princess Bride', 1987, 'images/movies/the_princess_bride.jpg');
INSERT INTO movie VALUES (187, 'The Night of the Hunter', 1955, 'images/movies/the_night_of_the_hunter.jpg');
INSERT INTO movie VALUES (188, 'Judgment at Nuremberg', 1961, 'images/movies/judgment_at_nuremberg.jpg');
INSERT INTO movie VALUES (189, 'The Incredibles', 2004, 'images/movies/the_incredibles.jpg');
INSERT INTO movie VALUES (190, 'Tonari no Totoro', 1988, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (191, 'The Hustler', 1961, 'images/movies/the_hustler.jpg');
INSERT INTO movie VALUES (192, 'Good Will Hunting', 1997, 'images/movies/good_will_hunting.jpg');
INSERT INTO movie VALUES (193, 'The Killing', 1956, 'images/movies/the_killing.jpg');
INSERT INTO movie VALUES (194, 'In Bruges', 2008, 'images/movies/in_bruges.jpg');
INSERT INTO movie VALUES (195, 'The Wild Bunch', 1969, 'images/movies/the_wild_bunch.jpg');
INSERT INTO movie VALUES (196, 'Network', 1976, 'images/movies/network.jpg');
INSERT INTO movie VALUES (197, 'Le scaphandre et le papillon', 2007, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (198, 'A Streetcar Named Desire', 1951, 'images/movies/a_streetcar_named_desire.jpg');
INSERT INTO movie VALUES (199, 'Les quatre cents coups', 1959, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (200, 'La strada', 1954, 'images/movies/la_strada.jpg');
INSERT INTO movie VALUES (201, 'The Exorcist', 1973, 'images/movies/the_exorcist.jpg');
INSERT INTO movie VALUES (202, 'Children of Men', 2006, 'images/movies/children_of_men.jpg');
INSERT INTO movie VALUES (203, 'Stalag 17', 1953, 'images/movies/stalag_17.jpg');
INSERT INTO movie VALUES (204, 'Persona', 1966, 'images/movies/persona.jpg');
INSERT INTO movie VALUES (205, 'Who''s Afraid of Virginia Woolf?', 1966, 'images/movies/whos_afraid_of_virginia_woolf.jpg');
INSERT INTO movie VALUES (206, '<NAME>', 1994, 'images/movies/ed_wood.jpg');
INSERT INTO movie VALUES (207, 'Dial M for Murder', 1954, 'images/movies/dial_m_for_murder.jpg');
INSERT INTO movie VALUES (208, 'La battaglia di Algeri', 1966, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (213, 'Rocky', 1976, 'images/movies/rocky.jpg');
INSERT INTO movie VALUES (227, 'Letters from Iwo Jima', 2006, 'images/movies/letters_from_iwo_jima.jpg');
INSERT INTO movie VALUES (228, 'Roman Holiday', 1953, 'images/movies/roman_holiday.jpg');
INSERT INTO movie VALUES (229, 'Pirates of the Caribbean: The Curse of the Black Pearl', 2003, 'images/movies/pirates_of_the_caribbean_the_curse_of_the_black_pearl.jpg');
INSERT INTO movie VALUES (230, '<NAME>', 2002, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (231, 'The Truman Show', 1998, 'images/movies/the_truman_show.jpg');
INSERT INTO movie VALUES (232, 'Crash', 2004, 'images/movies/crash.jpg');
INSERT INTO movie VALUES (233, 'Hauru no ugoku shiro', 2004, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (234, 'His Girl Friday', 1940, 'images/movies/his_girl_friday.jpg');
INSERT INTO movie VALUES (235, 'Arsenic and Old Lace', 1944, 'images/movies/arsenic_and_old_lace.jpg');
INSERT INTO movie VALUES (236, 'Harvey', 1950, 'images/movies/harvey.jpg');
INSERT INTO movie VALUES (237, 'Le notti di Cabiria', 1957, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (238, 'Trois couleurs: Rouge', 1994, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (239, 'The Philadelphia Story', 1940, 'images/movies/the_philadelphia_story.jpg');
INSERT INTO movie VALUES (240, 'A Christmas Story', 1983, 'images/movies/a_christmas_story.jpg');
INSERT INTO movie VALUES (241, 'Sleuth', 1972, 'images/movies/sleuth.jpg');
INSERT INTO movie VALUES (242, 'King Kong', 1933, 'images/movies/king_kong.jpg');
INSERT INTO movie VALUES (243, 'Bom yeoreum gaeul gyeoul geurigo bom', 2003, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (244, 'Rope', 1948, 'images/movies/rope.jpg');
INSERT INTO movie VALUES (245, 'Monsters, Inc.', 2001, 'images/movies/monsters_inc.jpg');
INSERT INTO movie VALUES (246, 'Tenkû no sh<NAME>', 1986, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (247, 'Yeopgijeogin geunyeo', 2001, 'images/movies/no_img.jpg');
INSERT INTO movie VALUES (248, 'Mulholland Dr.', 2001, 'images/movies/mulholland_dr.jpg');
INSERT INTO movie VALUES (249, 'The Man Who Shot Liberty Valance', 1962, 'images/movies/the_man_who_shot_liberty_valance.jpg');
INSERT INTO movie VALUES (162, 'Life of Brian', 1979, 'images/movies/life_of_brian.jpg');
INSERT INTO movie VALUES (163, 'The Gold Rush', 1925, 'images/movies/the_gold_rush.jpg');
INSERT INTO movie VALUES (164, 'The Bourne Ultimatum', 2007, 'images/movies/the_bourne_ultimatum.jpg');
INSERT INTO movie VALUES (165, 'Amores perros', 2000, 'images/movies/amores_perros.jpg');
INSERT INTO movie VALUES (166, 'Finding Nemo', 2003, 'images/movies/finding_nemo.jpg');
INSERT INTO movie VALUES (167, 'The Terminator', 1984, 'images/movies/the_terminator.jpg');
INSERT INTO movie VALUES (168, 'Stand by Me', 1986, 'images/movies/stand_by_me.jpg');
INSERT INTO movie VALUES (169, 'How to Train Your Dragon', 2010, 'images/movies/how_to_train_your_dragon.jpg');
INSERT INTO movie VALUES (170, 'The Best Years of Our Lives', 1946, 'images/movies/the_best_years_of_our_lives.jpg');
INSERT INTO movie VALUES (171, 'Lock, Stock and Two Smoking Barrels', 1998, 'images/movies/lock_stock_and_two_smoking_barrels.jpg');
INSERT INTO movie VALUES (172, 'The Thing', 1982, 'images/movies/the_thing.jpg');
INSERT INTO movie VALUES (173, 'The Kid', 1921, 'images/movies/the_kid.jpg');
INSERT INTO movie VALUES (174, 'V for Vendetta', 2006, 'images/movies/v_for_vendetta.jpg');
INSERT INTO movie VALUES (175, 'Casino', 1995, 'images/movies/casino.jpg');
INSERT INTO movie VALUES (176, 'Twelve Monkeys', 1995, 'images/movies/twelve_monkeys.jpg');
INSERT INTO movie VALUES (177, 'Dog Day Afternoon', 1975, 'images/movies/dog_day_afternoon.jpg');
INSERT INTO movie VALUES (178, 'Ratatouille', 2007, 'images/movies/ratatouille.jpg');
/* ---------------
Users
--------------- */
INSERT INTO movieuser VALUES (70, '123456', 'Elias', 'Robbie', '<EMAIL>', 'Gatineau', 'Quebec', 'Canada');
INSERT INTO movieuser VALUES (64, '44444', 'Ying', 'Steffanie', '<EMAIL>', 'Kanata', NULL, 'Canada');
INSERT INTO movieuser VALUES (20, '1010101010', 'Massenburg', 'Mariam', '<EMAIL>', 'Cleveland', 'Ohio', 'United States of America');
INSERT INTO movieuser VALUES (21, '77777', 'Greiner', 'Laurine', '<EMAIL>', NULL, NULL, 'Belgium');
INSERT INTO movieuser VALUES (22, '55555', 'Foret', 'Sydney', '<EMAIL>', 'Beirut', NULL, 'Lebanon');
INSERT INTO movieuser VALUES (35, '55555', 'Corby', 'Josette', '<EMAIL>', 'Beijing', NULL, 'China');
INSERT INTO movieuser VALUES (33, '55555', 'Iskra', 'Lakisha', '<EMAIL>', NULL, 'Tuva', 'Russia');
INSERT INTO movieuser VALUES (36, '55555', 'Tyner', 'Audie', '<EMAIL>', NULL, 'Cayo', 'Belize');
INSERT INTO movieuser VALUES (37, '22222', 'Ek', 'Aida', '<EMAIL>', 'Winnipeg', 'Manitoba', 'Canada');
INSERT INTO movieuser VALUES (41, '55555', 'Oakes', 'Peter', '<EMAIL>', 'Chicago', NULL, 'United States of America');
INSERT INTO movieuser VALUES (47, '99999', 'Stribling', 'Amy', '<EMAIL>', 'Vancouver', NULL, 'Canada');
INSERT INTO movieuser VALUES (39, '55555', 'Tomas', 'Raelene', '<EMAIL>', NULL, NULL, 'British Indian Ocean Ter');
INSERT INTO movieuser VALUES (48, '55555', 'Crisp', 'Marco', '<EMAIL>', 'rio de janeiro', NULL, 'Brazil');
INSERT INTO movieuser VALUES (54, '77777', 'Crosson', 'Jimmy', '<EMAIL>', 'Toronto', 'Ontario', 'Canada');
INSERT INTO movieuser VALUES (34, '99999', 'Greenleaf', 'Penny', '<EMAIL>', 'Oshawa', 'Ontario', 'Canada');
INSERT INTO movieuser VALUES (23, '77777', 'Vanasse', 'Elissa', '<EMAIL>', NULL, NULL, 'St Pierre & Miquelon');
INSERT INTO movieuser VALUES (25, '55555', 'Fells', 'Johnny', '<EMAIL>', NULL, 'Fezzan', 'Libya');
INSERT INTO movieuser VALUES (24, '66666', 'Duclos', 'Angella', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (38, '66666', 'Pankey', 'Jackelyn', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (53, '55555', 'Bence', 'Davis', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (55, '55555', 'Howie', 'Sylvester', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (58, '66666', 'Fuerst', 'Keneth', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (69, '77777', 'Kirklin', 'Renita', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (72, '111111', 'Shannon', 'Isaac', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (73, '123456', 'Doe', 'John', '<EMAIL>', NULL, NULL, NULL);
INSERT INTO movieuser VALUES (74, '123456', 'Pan', 'Peter', '<EMAIL>', 'Los Angeles', 'California', 'Canada');
INSERT INTO movieuser VALUES (26, '44444', 'Wise', 'Tereasa', '<EMAIL>', NULL, NULL, 'Bermuda');
INSERT INTO movieuser VALUES (40, '77777', 'Stegman', 'Ellsworth', '<EMAIL>', NULL, NULL, 'Great Britain');
INSERT INTO movieuser VALUES (27, '55555', 'Neher', 'Irma', '<EMAIL>', 'Sanniquellie', 'Nimba', 'Liberia');
INSERT INTO movieuser VALUES (28, '66666', 'Janson', 'Cyrus', '<EMAIL>', NULL, 'Moyamba', 'Sierra Leone');
INSERT INTO movieuser VALUES (29, '77777', 'Gregson', 'Chasity', '<EMAIL>', NULL, '<NAME>', 'Brazil');
INSERT INTO movieuser VALUES (30, '77777', 'Jerabek', 'Angelica', '<EMAIL>', NULL, 'Sofia', 'Bulgaria');
INSERT INTO movieuser VALUES (68, '55555', 'Leedy', 'Dominic', '<EMAIL>', NULL, NULL, 'Virgin Islands (USA)');
INSERT INTO movieuser VALUES (31, '88888', 'Sandford', 'Caprice', '<EMAIL>', NULL, 'Alberta', 'Canada');
INSERT INTO movieuser VALUES (32, '99999', 'Whitmarsh', 'Blair', '<EMAIL>', NULL, 'Minsk', 'Belarus');
INSERT INTO movieuser VALUES (42, '55555', 'Filip', 'Josephine', '<EMAIL>', NULL, 'Phnom Penh', 'Cambodia');
INSERT INTO movieuser VALUES (43, '88888', 'Hatmaker', 'Audra', '<EMAIL>', 'Deadwood', 'Dakota', 'United States of America');
INSERT INTO movieuser VALUES (44, '55555', 'Yocom', 'Fairy', '<EMAIL>', 'Tokyo', NULL, 'Japan');
INSERT INTO movieuser VALUES (45, '77777', 'Carwile', 'Carey', '<EMAIL>', NULL, NULL, 'Benin');
INSERT INTO movieuser VALUES (46, '66666', 'Ryburn', 'Shonta', '<EMAIL>', 'Charlottetown', 'P.E.I', 'Canada');
INSERT INTO movieuser VALUES (49, '77777', 'Minchew', 'Buffy', '<EMAIL>', NULL, 'Kotor', 'Republic of Montenegro');
INSERT INTO movieuser VALUES (50, '66666', 'Steuck', 'Damon', '<EMAIL>', 'Kingston', 'Ontario', 'Canada');
INSERT INTO movieuser VALUES (51, '1010101010', 'Cacciatore', 'Junie', '<EMAIL>', NULL, 'Masunga', 'Botswana');
INSERT INTO movieuser VALUES (71, '12345', 'Desjardins', 'Jesse', '<EMAIL>', 'Ottawa', 'Ontario', 'Canada');
INSERT INTO movieuser VALUES (52, '66666', 'Downey', 'Fae', '<EMAIL>', NULL, 'Tashkent', 'Uzbekistan');
INSERT INTO movieuser VALUES (56, '66666', 'Mcbeth', 'Armandina', '<EMAIL>', NULL, NULL, 'Singapore');
INSERT INTO movieuser VALUES (57, '99999', 'Devillier', 'Ann', '<EMAIL>', 'Nampa', 'Idaho', 'United States of America');
INSERT INTO movieuser VALUES (59, '99999', 'Simoneaux', 'Lorrie', '<EMAIL>', NULL, NULL, 'Virgin Islands (Brit)');
INSERT INTO movieuser VALUES (60, '55555', 'Grana', 'Pedro', '<EMAIL>', 'Puebla de Zaragoza', 'Puebla', 'Mexico');
INSERT INTO movieuser VALUES (61, '1010101010', 'Beauchemin', 'Windy', '<EMAIL>', 'Ottawa', 'Ontario', 'Canada');
INSERT INTO movieuser VALUES (77, '111111', 'Smith', 'John', '<EMAIL>', NULL, NULL, 'Canada');
INSERT INTO movieuser VALUES (62, '99999', 'Mclaughin', 'Burma', '<EMAIL>', NULL, NULL, 'Brazil');
INSERT INTO movieuser VALUES (63, '77777', 'Straube', 'Mia', '<EMAIL>', NULL, 'Yen Bai', 'Vietnam');
INSERT INTO movieuser VALUES (65, '99999', 'Montalvan', 'Willia', '<EMAIL>', NULL, NULL, 'Rwanda');
INSERT INTO movieuser VALUES (66, '77777', 'Halpern', 'Kiley', '<EMAIL>', NULL, NULL, 'Bonaire');
INSERT INTO movieuser VALUES (67, '88888', 'Spillers', 'Marcos', '<EMAIL>', NULL, NULL, 'Belize');
/* -------------------
User Profiles
------------------- */
INSERT INTO profile VALUES (39, '[26,40)', 'female', 'Homemaker', 'pc');
INSERT INTO profile VALUES (20, '[18,26)', 'female', 'Hair Dresser', 'iPhone');
INSERT INTO profile VALUES (40, '[40,)', 'female', 'Baker', 'Mobile');
INSERT INTO profile VALUES (22, '[26,40)', 'male', 'Unemployed', 'Galaxy S6');
INSERT INTO profile VALUES (42, '[18,26)', 'female', 'Domestic cleaner', 'Mobile');
INSERT INTO profile VALUES (21, '[18,26)', 'female', 'Saleswoman', 'Mac');
INSERT INTO profile VALUES (43, '[26,40)', 'female', 'Career criminal', 'Mobile');
INSERT INTO profile VALUES (37, '[18,26)', 'female', 'plumber', 'pc');
INSERT INTO profile VALUES (44, '[18,26)', 'female', 'Mortician', 'pc');
INSERT INTO profile VALUES (45, '[26,40)', 'female', 'Footballer', 'pc');
INSERT INTO profile VALUES (46, '[26,40)', 'female', 'Disc jockey', 'pc');
INSERT INTO profile VALUES (35, '[26,40)', 'female', 'Engineer', 'PC');
INSERT INTO profile VALUES (41, '[40,)', 'male', 'Retired', 'PC');
INSERT INTO profile VALUES (34, '[0,18)', 'female', 'Student', 'Mac');
INSERT INTO profile VALUES (23, '[26,40)', 'female', 'Diver', 'Mac');
INSERT INTO profile VALUES (24, '[40,)', 'female', 'Management consultant', 'Mobile');
INSERT INTO profile VALUES (25, '[0,18)', 'male', 'Student', 'Mobile');
INSERT INTO profile VALUES (26, '[26,40)', 'female', 'Craftsperson', 'pc');
INSERT INTO profile VALUES (27, '[26,40)', 'male', 'Pharmacist', 'Mac');
INSERT INTO profile VALUES (28, '[26,40)', 'male', 'Prison officer', 'pc');
INSERT INTO profile VALUES (29, '[0,18)', 'female', 'Tarot Reader', 'Mobile');
INSERT INTO profile VALUES (30, '[26,40)', 'female', 'Police officer', 'pc');
INSERT INTO profile VALUES (31, '[18,26)', 'female', 'Typist', 'pc');
INSERT INTO profile VALUES (32, '[18,26)', 'male', 'Toilet attendant', 'Mobile');
INSERT INTO profile VALUES (33, '[18,26)', 'female', 'Landowner', 'Mac');
INSERT INTO profile VALUES (36, '[26,40)', 'female', 'Chiropodist', 'Mobile');
INSERT INTO profile VALUES (38, '[26,40)', 'female', 'Massage therapist', 'pc');
INSERT INTO profile VALUES (49, '[26,40)', 'male', 'Dentist', 'Mac');
INSERT INTO profile VALUES (50, '[18,26)', 'male', 'Barber', 'pc');
INSERT INTO profile VALUES (51, '[40,)', 'female', 'Politician', 'Mobile');
INSERT INTO profile VALUES (52, '[18,26)', 'female', 'Astronomer', 'pc');
INSERT INTO profile VALUES (57, '[0,18)', 'female', 'Student', 'Mac');
INSERT INTO profile VALUES (59, '[18,26)', 'female', 'Baggage handler', 'Mac');
INSERT INTO profile VALUES (60, '[40,)', 'male', 'Priest', 'Mobile');
INSERT INTO profile VALUES (61, '[18,26)', 'female', 'Window cleaner', 'Mac');
INSERT INTO profile VALUES (64, '[40,)', 'female', 'Teacher', 'iPad');
INSERT INTO profile VALUES (62, '[40,)', 'male', 'Locksmith', 'Mobile');
INSERT INTO profile VALUES (48, '[0,18)', 'male', 'Student', 'Android');
INSERT INTO profile VALUES (54, '[26,40)', 'male', 'Actor', 'Mac');
INSERT INTO profile VALUES (69, '[26,40)', 'male', 'electrician', 'Mobile');
INSERT INTO profile VALUES (47, '[18,26)', 'female', 'Actress', 'iPhone');
INSERT INTO profile VALUES (63, '[18,26)', 'female', 'Reporter', 'Mac');
INSERT INTO profile VALUES (65, '[18,26)', 'male', 'Psychiatrist', 'pc');
INSERT INTO profile VALUES (66, '[26,40)', 'female', 'Occupational therapist', 'Mobile');
INSERT INTO profile VALUES (67, '[18,26)', 'male', 'Circus worker', 'pc');
INSERT INTO profile VALUES (68, '[0,18)', 'male', 'Student', 'PC');
INSERT INTO profile VALUES (71, '[18,26)', 'male', 'Student', 'pc');
INSERT INTO profile VALUES (70, '[18,26)', 'male', 'Programmer', 'PC');
INSERT INTO profile VALUES (56, '[26,40)', 'male', 'plumber', 'pc');
INSERT INTO profile VALUES (58, '[26,40)', 'male', 'plumber', 'pc');
INSERT INTO profile VALUES (53, '[26,40)', 'male', 'plumber', 'pc');
INSERT INTO profile VALUES (55, '[26,40)', 'male', 'plumber', 'pc');
INSERT INTO profile VALUES (72, '[40,)', 'male', 'plumber', 'pc');
/* -------------------
Actors
------------------- */
INSERT INTO actor VALUES (1, '<NAME>', '1987-04-17');
INSERT INTO actor VALUES (2, '<NAME>', '1958-04-05');
INSERT INTO actor VALUES (3, '<NAME>', '1984-09-17');
INSERT INTO actor VALUES (4, '<NAME>', '1936-11-26');
INSERT INTO actor VALUES (5, '<NAME>', '1970-08-23');
INSERT INTO actor VALUES (6, '<NAME>', '1943-07-31');
INSERT INTO actor VALUES (7, '<NAME>', '1988-09-06');
INSERT INTO actor VALUES (8, '<NAME>', '1932-05-10');
INSERT INTO actor VALUES (9, '<NAME>', '1930-05-27');
INSERT INTO actor VALUES (10, '<NAME>', '1979-04-19');
INSERT INTO actor VALUES (11, '<NAME>', '1987-05-12');
INSERT INTO actor VALUES (12, '<NAME>', '1962-04-25');
INSERT INTO actor VALUES (13, '<NAME>', '1958-12-14');
INSERT INTO actor VALUES (14, '<NAME>', '1940-01-09');
INSERT INTO actor VALUES (15, '<NAME>', '1951-04-09');
INSERT INTO actor VALUES (16, '<NAME>', '1960-08-04');
INSERT INTO actor VALUES (18, '<NAME>', '1972-05-29');
INSERT INTO actor VALUES (19, '<NAME>', '1971-05-30');
INSERT INTO actor VALUES (20, '<NAME>', '1938-04-05');
INSERT INTO actor VALUES (21, '<NAME>', '1947-12-09');
INSERT INTO actor VALUES (22, '<NAME>', '1943-03-30');
INSERT INTO actor VALUES (23, '<NAME>', '1989-03-16');
INSERT INTO actor VALUES (24, '<NAME>', '1933-07-28');
INSERT INTO actor VALUES (25, '<NAME>', '1935-09-29');
INSERT INTO actor VALUES (27, '<NAME>', '1977-05-25');
INSERT INTO actor VALUES (28, '<NAME>', '1965-04-23');
INSERT INTO actor VALUES (29, '<NAME>', '1990-07-28');
INSERT INTO actor VALUES (30, '<NAME>', '1950-10-13');
INSERT INTO actor VALUES (31, '<NAME>', '1958-03-16');
INSERT INTO actor VALUES (32, '<NAME>', '1986-11-13');
INSERT INTO actor VALUES (34, '<NAME>', '1951-12-03');
INSERT INTO actor VALUES (35, '<NAME>', '1932-10-10');
INSERT INTO actor VALUES (36, '<NAME>', '1958-09-09');
INSERT INTO actor VALUES (37, '<NAME>', '1965-07-01');
INSERT INTO actor VALUES (38, '<NAME>', '1930-06-18');
INSERT INTO actor VALUES (39, '<NAME>', '1961-01-16');
INSERT INTO actor VALUES (40, '<NAME>', '1965-11-25');
INSERT INTO actor VALUES (41, '<NAME>', '1979-10-04');
INSERT INTO actor VALUES (42, '<NAME>', '1957-05-29');
INSERT INTO actor VALUES (43, '<NAME>', '1937-03-21');
INSERT INTO actor VALUES (45, '<NAME>', '1967-06-07');
INSERT INTO actor VALUES (46, '<NAME>', '1958-06-27');
INSERT INTO actor VALUES (47, '<NAME>', '1978-04-20');
INSERT INTO actor VALUES (48, '<NAME>', '1941-02-05');
INSERT INTO actor VALUES (49, '<NAME>', '1939-11-24');
INSERT INTO actor VALUES (50, '<NAME>', '1958-09-18');
INSERT INTO actor VALUES (52, '<NAME>', '1957-11-01');
INSERT INTO actor VALUES (53, '<NAME>', '1971-12-16');
INSERT INTO actor VALUES (54, '<NAME>', '1947-07-26');
INSERT INTO actor VALUES (55, '<NAME>', '1961-05-29');
INSERT INTO actor VALUES (56, '<NAME>', '1977-09-12');
INSERT INTO actor VALUES (57, '<NAME>', '1948-03-03');
INSERT INTO actor VALUES (59, '<NAME>', '1952-01-04');
INSERT INTO actor VALUES (60, '<NAME>', '1947-09-30');
INSERT INTO actor VALUES (61, '<NAME>', '1968-08-04');
INSERT INTO actor VALUES (62, '<NAME>', '1980-03-19');
INSERT INTO actor VALUES (63, '<NAME>', '1943-08-14');
INSERT INTO actor VALUES (64, '<NAME>', '1956-08-20');
INSERT INTO actor VALUES (66, '<NAME>', '1946-05-23');
INSERT INTO actor VALUES (67, '<NAME>', '1985-04-28');
INSERT INTO actor VALUES (68, '<NAME>', '1976-08-20');
INSERT INTO actor VALUES (69, '<NAME>', '1946-11-07');
INSERT INTO actor VALUES (70, '<NAME>', '1955-05-16');
INSERT INTO actor VALUES (71, '<NAME>', '1951-07-16');
INSERT INTO actor VALUES (72, '<NAME>', '1935-08-11');
INSERT INTO actor VALUES (74, '<NAME>', '1958-10-04');
INSERT INTO actor VALUES (75, '<NAME>', '1953-04-27');
INSERT INTO actor VALUES (76, '<NAME>', '1959-03-18');
INSERT INTO actor VALUES (77, '<NAME>', '1987-03-30');
INSERT INTO actor VALUES (78, '<NAME>', '1940-08-16');
INSERT INTO actor VALUES (79, '<NAME>', '1970-04-22');
INSERT INTO actor VALUES (80, '<NAME>', '1936-02-22');
INSERT INTO actor VALUES (81, '<NAME>', '1969-05-04');
INSERT INTO actor VALUES (82, '<NAME>', '1989-08-30');
INSERT INTO actor VALUES (84, '<NAME>', '1950-04-19');
INSERT INTO actor VALUES (85, '<NAME>', '1946-03-26');
INSERT INTO actor VALUES (86, '<NAME>', '1934-05-22');
INSERT INTO actor VALUES (87, '<NAME>', '1936-12-30');
INSERT INTO actor VALUES (88, '<NAME>', '1964-05-27');
INSERT INTO actor VALUES (89, '<NAME>', '1952-03-12');
INSERT INTO actor VALUES (91, '<NAME>', '1982-02-24');
INSERT INTO actor VALUES (92, '<NAME>', '1990-10-14');
INSERT INTO actor VALUES (93, '<NAME>', '1948-03-22');
INSERT INTO actor VALUES (94, '<NAME>', '1934-10-08');
INSERT INTO actor VALUES (95, '<NAME>', '1956-06-03');
INSERT INTO actor VALUES (96, '<NAME>', '1959-05-11');
INSERT INTO actor VALUES (97, '<NAME>', '1951-02-28');
INSERT INTO actor VALUES (98, '<NAME>', '1950-10-01');
INSERT INTO actor VALUES (100, '<NAME>', '1968-01-04');
INSERT INTO actor VALUES (101, '<NAME>', '1976-02-13');
INSERT INTO actor VALUES (102, '<NAME>', '1966-07-15');
INSERT INTO actor VALUES (103, '<NAME>', '1973-08-14');
INSERT INTO actor VALUES (104, '<NAME>', '1967-11-25');
INSERT INTO actor VALUES (105, '<NAME>', '1934-04-18');
INSERT INTO actor VALUES (107, '<NAME>', '1936-02-10');
INSERT INTO actor VALUES (108, '<NAME>', '1930-07-16');
INSERT INTO actor VALUES (109, '<NAME>', '1946-07-25');
INSERT INTO actor VALUES (110, '<NAME>', '1976-06-01');
INSERT INTO actor VALUES (111, '<NAME>', '1936-09-05');
INSERT INTO actor VALUES (113, '<NAME>', '1975-01-31');
INSERT INTO actor VALUES (114, '<NAME>', '1970-08-28');
INSERT INTO actor VALUES (115, '<NAME>', '1945-03-14');
INSERT INTO actor VALUES (116, '<NAME>', '1930-04-27');
INSERT INTO actor VALUES (117, '<NAME>', '1975-01-16');
INSERT INTO actor VALUES (118, '<NAME>', '1952-03-12');
INSERT INTO actor VALUES (119, '<NAME>', '1964-09-20');
INSERT INTO actor VALUES (121, '<NAME>', '1981-03-14');
INSERT INTO actor VALUES (122, '<NAME>', '1955-11-15');
INSERT INTO actor VALUES (123, '<NAME>', '1936-01-10');
INSERT INTO actor VALUES (124, '<NAME>', '1938-06-05');
INSERT INTO actor VALUES (125, '<NAME>', '1960-08-22');
INSERT INTO actor VALUES (126, '<NAME>', '1962-06-13');
INSERT INTO actor VALUES (127, '<NAME>', '1967-10-13');
INSERT INTO actor VALUES (128, '<NAME>', '1981-10-19');
INSERT INTO actor VALUES (130, '<NAME>', '1982-10-11');
INSERT INTO actor VALUES (131, '<NAME>', '1958-10-24');
INSERT INTO actor VALUES (132, '<NAME>', '1968-04-27');
INSERT INTO actor VALUES (133, '<NAME>', '1958-04-25');
INSERT INTO actor VALUES (134, '<NAME>', '1941-06-07');
INSERT INTO actor VALUES (135, '<NAME>', '1945-03-22');
INSERT INTO actor VALUES (136, '<NAME>', '1962-08-11');
INSERT INTO actor VALUES (137, '<NAME>', '1947-05-16');
INSERT INTO actor VALUES (139, '<NAME>', '1963-02-23');
INSERT INTO actor VALUES (140, '<NAME>', '1963-12-08');
INSERT INTO actor VALUES (141, '<NAME>', '1936-10-01');
INSERT INTO actor VALUES (142, '<NAME>', '1969-10-29');
INSERT INTO actor VALUES (143, '<NAME>', '1958-11-03');
INSERT INTO actor VALUES (144, '<NAME>', '1981-11-01');
INSERT INTO actor VALUES (146, '<NAME>', '1974-01-14');
INSERT INTO actor VALUES (147, '<NAME>', '1982-02-25');
INSERT INTO actor VALUES (148, '<NAME>', '1933-07-12');
INSERT INTO actor VALUES (17, '<NAME>', '1964-08-31');
INSERT INTO actor VALUES (26, '<NAME>', '1930-08-09');
INSERT INTO actor VALUES (33, '<NAME>', '1979-01-16');
INSERT INTO actor VALUES (44, '<NAME>', '1947-09-17');
INSERT INTO actor VALUES (51, '<NAME>', '1949-05-11');
INSERT INTO actor VALUES (58, '<NAME>', '1947-10-23');
INSERT INTO actor VALUES (65, '<NAME>', '1941-02-19');
INSERT INTO actor VALUES (73, '<NAME>', '1982-10-11');
INSERT INTO actor VALUES (83, '<NAME>', '1963-12-23');
INSERT INTO actor VALUES (90, '<NAME>', '1959-01-02');
INSERT INTO actor VALUES (99, '<NAME>', '1944-12-30');
INSERT INTO actor VALUES (106, '<NAME>', '1935-12-10');
INSERT INTO actor VALUES (112, '<NAME>', '1985-11-25');
INSERT INTO actor VALUES (120, '<NAME>', '1936-03-28');
INSERT INTO actor VALUES (129, '<NAME>', '1983-03-14');
INSERT INTO actor VALUES (138, '<NAME>', '1951-05-02');
INSERT INTO actor VALUES (145, '<NAME>', '1949-06-26');
INSERT INTO actor VALUES (149, '<NAME>', '1935-03-28');
INSERT INTO actor VALUES (150, '<NAME>', '1955-11-16');
INSERT INTO actor VALUES (151, 'The Marx Brothers', '1939-10-07');
INSERT INTO actor VALUES (152, '<NAME>', '1986-06-09');
INSERT INTO actor VALUES (153, '<NAME>', '1981-09-30');
INSERT INTO actor VALUES (154, '<NAME>', '1945-10-16');
INSERT INTO actor VALUES (155, '<NAME>', '1933-11-12');
INSERT INTO actor VALUES (156, '<NAME>', '1951-05-24');
INSERT INTO actor VALUES (157, '<NAME>', '1978-03-29');
INSERT INTO actor VALUES (158, '<NAME>', '1971-08-25');
INSERT INTO actor VALUES (159, '<NAME>', '1942-03-12');
INSERT INTO actor VALUES (160, '<NAME>', '1970-06-10');
/* ----------------------
ActorPlays
---------------------- */
INSERT INTO actorplays VALUES (20, 17, 'L.B. "<NAME>');
INSERT INTO actorplays VALUES (93, 65, '<NAME>');
INSERT INTO actorplays VALUES (92, 64, '<NAME>');
INSERT INTO actorplays VALUES (91, 63, '<NAME>');
INSERT INTO actorplays VALUES (78, 63, 'Jerry');
INSERT INTO actorplays VALUES (89, 62, '<NAME>');
INSERT INTO actorplays VALUES (87, 61, 'Dr. <NAME>');
INSERT INTO actorplays VALUES (128, 60, '<NAME>');
INSERT INTO actorplays VALUES (11, 12, '<NAME>');
INSERT INTO actorplays VALUES (86, 60, 'Lt. <NAME>');
INSERT INTO actorplays VALUES (28, 60, 'Mills');
INSERT INTO actorplays VALUES (17, 60, '<NAME>');
INSERT INTO actorplays VALUES (116, 12, '<NAME>');
INSERT INTO actorplays VALUES (85, 59, 'Pvt. J.T. ''Joker'' Davis');
INSERT INTO actorplays VALUES (106, 12, '<NAME>');
INSERT INTO actorplays VALUES (82, 58, '<NAME>');
INSERT INTO actorplays VALUES (105, 12, '<NAME>');
INSERT INTO actorplays VALUES (22, 12, '<NAME>');
INSERT INTO actorplays VALUES (14, 12, '<NAME>');
INSERT INTO actorplays VALUES (81, 57, '<NAME>');
INSERT INTO actorplays VALUES (34, 18, '<NAME>');
INSERT INTO actorplays VALUES (80, 56, 'No name');
INSERT INTO actorplays VALUES (78, 55, '<NAME>');
INSERT INTO actorplays VALUES (43, 18, '<NAME>');
INSERT INTO actorplays VALUES (23, 18, 'Woody');
INSERT INTO actorplays VALUES (149, 18, 'Woody');
INSERT INTO actorplays VALUES (77, 54, '<NAME>');
INSERT INTO actorplays VALUES (84, 18, '<NAME>');
INSERT INTO actorplays VALUES (72, 52, '<NAME>');
INSERT INTO actorplays VALUES (162, 50, 'Wise Man #2 / <NAME> / <NAME>');
INSERT INTO actorplays VALUES (70, 50, 'King Arthur / Voice of God / Middle Head / Hiccoughing Guard');
INSERT INTO actorplays VALUES (173, 49, 'A Tramp');
INSERT INTO actorplays VALUES (163, 49, 'The Lone Prospector');
INSERT INTO actorplays VALUES (88, 49, 'Hynkel - Dictator of Tomania / A Jewish Barber');
INSERT INTO actorplays VALUES (69, 49, 'A Factory Worker');
INSERT INTO actorplays VALUES (66, 48, 'Mr. White - <NAME>');
INSERT INTO actorplays VALUES (79, 26, 'Shears');
INSERT INTO actorplays VALUES (195, 26, '<NAME>');
INSERT INTO actorplays VALUES (196, 26, '<NAME>');
INSERT INTO actorplays VALUES (32, 26, '<NAME>');
INSERT INTO actorplays VALUES (203, 26, 'Sgt. J.<NAME>');
INSERT INTO actorplays VALUES (63, 47, 'Capt.-Lt. <NAME> - <NAME>');
INSERT INTO actorplays VALUES (201, 46, '<NAME>');
INSERT INTO actorplays VALUES (61, 45, '<NAME>');
INSERT INTO actorplays VALUES (134, 44, 'Dr. <NAME>');
INSERT INTO actorplays VALUES (46, 44, 'Ripley');
INSERT INTO actorplays VALUES (59, 43, 'A Blind Girl');
INSERT INTO actorplays VALUES (54, 41, '<NAME>');
INSERT INTO actorplays VALUES (91, 40, '<NAME>');
INSERT INTO actorplays VALUES (52, 39, 'Alex');
INSERT INTO actorplays VALUES (51, 38, '<NAME>');
INSERT INTO actorplays VALUES (57, 37, '<NAME>');
INSERT INTO actorplays VALUES (49, 37, '<NAME>');
INSERT INTO actorplays VALUES (46, 34, 'Dallas');
INSERT INTO actorplays VALUES (167, 33, 'Terminator');
INSERT INTO actorplays VALUES (42, 33, 'Terminator');
INSERT INTO actorplays VALUES (65, 31, '<NAME>');
INSERT INTO actorplays VALUES (39, 31, '<NAME>');
INSERT INTO actorplays VALUES (38, 30, '<NAME>');
INSERT INTO actorplays VALUES (36, 29, '<NAME>');
INSERT INTO actorplays VALUES (35, 28, 'Léon');
INSERT INTO actorplays VALUES (65, 24, '<NAME>');
INSERT INTO actorplays VALUES (148, 23, '<NAME>-I<NAME>');
INSERT INTO actorplays VALUES (28, 23, 'Somerset');
INSERT INTO actorplays VALUES (33, 149, 'Gen. ''Buck'' Turgidson');
INSERT INTO actorplays VALUES (31, 25, 'Aldor');
INSERT INTO actorplays VALUES (127, 148, '<NAME>');
INSERT INTO actorplays VALUES (6, 5, '<NAME>');
INSERT INTO actorplays VALUES (202, 137, '<NAME>');
INSERT INTO actorplays VALUES (200, 136, 'Zampanò');
INSERT INTO actorplays VALUES (198, 135, 'Blanche');
INSERT INTO actorplays VALUES (176, 121, '<NAME>');
INSERT INTO actorplays VALUES (67, 134, '<NAME>');
INSERT INTO actorplays VALUES (194, 133, 'Natalie');
INSERT INTO actorplays VALUES (26, 21, 'Neo');
INSERT INTO actorplays VALUES (193, 132, '<NAME>');
INSERT INTO actorplays VALUES (188, 130, 'Chief Judge <NAME>');
INSERT INTO actorplays VALUES (186, 128, 'Westley');
INSERT INTO actorplays VALUES (185, 127, '<NAME>');
INSERT INTO actorplays VALUES (182, 126, '<NAME>');
INSERT INTO actorplays VALUES (181, 125, 'Kirk');
INSERT INTO actorplays VALUES (143, 100, 'Sgt. Barnes');
INSERT INTO actorplays VALUES (7, 124, '<NAME>');
INSERT INTO actorplays VALUES (177, 122, 'Sylvia');
INSERT INTO actorplays VALUES (35, 120, 'Mathilda');
INSERT INTO actorplays VALUES (174, 120, 'Evey');
INSERT INTO actorplays VALUES (157, 3, '<NAME>');
INSERT INTO actorplays VALUES (173, 119, 'The Man');
INSERT INTO actorplays VALUES (172, 118, '<NAME>');
INSERT INTO actorplays VALUES (169, 115, 'Hiccup');
INSERT INTO actorplays VALUES (148, 115, '<NAME>');
INSERT INTO actorplays VALUES (168, 114, '<NAME>');
INSERT INTO actorplays VALUES (166, 113, 'Marlin');
INSERT INTO actorplays VALUES (165, 112, '<NAME>');
INSERT INTO actorplays VALUES (57, 111, '<NAME>');
INSERT INTO actorplays VALUES (164, 111, '<NAME>');
INSERT INTO actorplays VALUES (161, 110, 'Phil');
INSERT INTO actorplays VALUES (159, 109, '<NAME>');
INSERT INTO actorplays VALUES (158, 108, '<NAME>');
INSERT INTO actorplays VALUES (5, 4, 'Pumpkin');
INSERT INTO actorplays VALUES (155, 107, 'Renton');
INSERT INTO actorplays VALUES (154, 106, '<NAME>');
INSERT INTO actorplays VALUES (151, 104, '<NAME>');
INSERT INTO actorplays VALUES (1, 1, '<NAME>');
INSERT INTO actorplays VALUES (30, 104, '<NAME>');
INSERT INTO actorplays VALUES (73, 9, '<NAME>');
INSERT INTO actorplays VALUES (10, 9, '<NAME>');
INSERT INTO actorplays VALUES (144, 101, '<NAME>');
INSERT INTO actorplays VALUES (142, 99, 'Peter');
INSERT INTO actorplays VALUES (141, 98, 'The Bride');
INSERT INTO actorplays VALUES (110, 6, 'Ducard');
INSERT INTO actorplays VALUES (140, 97, '<NAME>');
INSERT INTO actorplays VALUES (138, 95, '<NAME>');
INSERT INTO actorplays VALUES (71, 51, '<NAME>');
INSERT INTO actorplays VALUES (135, 93, '<NAME>');
INSERT INTO actorplays VALUES (204, 91, 'Alma');
INSERT INTO actorplays VALUES (47, 35, 'WALL·E');
INSERT INTO actorplays VALUES (132, 91, 'Sara');
INSERT INTO actorplays VALUES (130, 89, '<NAME>');
INSERT INTO actorplays VALUES (129, 88, '<NAME>');
INSERT INTO actorplays VALUES (25, 87, 'Fenster');
INSERT INTO actorplays VALUES (83, 13, '<NAME>" Aaronson');
INSERT INTO actorplays VALUES (124, 84, '<NAME>');
INSERT INTO actorplays VALUES (122, 83, '<NAME>');
INSERT INTO actorplays VALUES (156, 83, '<NAME>');
INSERT INTO actorplays VALUES (121, 82, 'Dorothy');
INSERT INTO actorplays VALUES (120, 81, '<NAME>');
INSERT INTO actorplays VALUES (118, 80, '<NAME>');
INSERT INTO actorplays VALUES (119, 13, '<NAME>');
INSERT INTO actorplays VALUES (249, 160, '<NAME>');
INSERT INTO actorplays VALUES (248, 159, 'Adam');
INSERT INTO actorplays VALUES (245, 158, '<NAME>');
INSERT INTO actorplays VALUES (139, 158, '<NAME>. "Sulley" Sullivan');
INSERT INTO actorplays VALUES (244, 157, 'His friend - Brandon');
INSERT INTO actorplays VALUES (236, 17, '<NAME>');
INSERT INTO actorplays VALUES (242, 156, '<NAME>');
INSERT INTO actorplays VALUES (248, 156, '<NAME>');
INSERT INTO actorplays VALUES (240, 155, '<NAME>');
INSERT INTO actorplays VALUES (232, 154, 'Elizabeth');
INSERT INTO actorplays VALUES (227, 153, '<NAME>');
INSERT INTO actorplays VALUES (226, 152, '<NAME> / Kick-Ass');
INSERT INTO actorplays VALUES (224, 151, 'The Four Marx Brothers');
INSERT INTO actorplays VALUES (223, 150, '<NAME>');
INSERT INTO actorplays VALUES (191, 149, '<NAME>');
INSERT INTO actorplays VALUES (222, 149, '<NAME> Jr.');
INSERT INTO actorplays VALUES (221, 148, '<NAME>');
INSERT INTO actorplays VALUES (220, 147, '<NAME>');
INSERT INTO actorplays VALUES (141, 147, '<NAME>');
INSERT INTO actorplays VALUES (219, 146, '<NAME>');
INSERT INTO actorplays VALUES (217, 145, '<NAME>');
INSERT INTO actorplays VALUES (215, 144, 'Louis');
INSERT INTO actorplays VALUES (213, 143, 'Rocky');
INSERT INTO actorplays VALUES (212, 142, 'Sir Edmund <NAME> / Young Pharmacy Kid');
INSERT INTO actorplays VALUES (210, 141, 'Kat');
INSERT INTO actorplays VALUES (207, 140, '<NAME>');
INSERT INTO actorplays VALUES (57, 5, '<NAME>');
INSERT INTO actorplays VALUES (206, 139, '<NAME>');
INSERT INTO actorplays VALUES (229, 139, 'Captain <NAME>');
INSERT INTO actorplays VALUES (205, 138, 'Martha');
INSERT INTO actorplays VALUES (48, 136, '<NAME>');
INSERT INTO actorplays VALUES (151, 135, 'Scarlett - Their Daughter');
INSERT INTO actorplays VALUES (196, 134, '<NAME>');
INSERT INTO actorplays VALUES (189, 131, '<NAME> / Mr. Incredible');
INSERT INTO actorplays VALUES (187, 129, '<NAME>');
INSERT INTO actorplays VALUES (33, 27, 'Group Capt. <NAME> / President <NAME> / Dr. Strangelove');
INSERT INTO actorplays VALUES (180, 124, '<NAME>');
INSERT INTO actorplays VALUES (178, 123, 'Remy');
INSERT INTO actorplays VALUES (2, 3, '<NAME>');
INSERT INTO actorplays VALUES (62, 46, '<NAME>');
INSERT INTO actorplays VALUES (171, 117, 'Tom');
INSERT INTO actorplays VALUES (170, 116, '<NAME>');
INSERT INTO actorplays VALUES (3, 3, '<NAME>');
INSERT INTO actorplays VALUES (119, 3, 'Lt. <NAME>');
INSERT INTO actorplays VALUES (73, 53, '<NAME>');
INSERT INTO actorplays VALUES (192, 111, '<NAME>');
INSERT INTO actorplays VALUES (101, 109, 'Mrs. Kendal');
INSERT INTO actorplays VALUES (211, 107, '<NAME> - Young');
INSERT INTO actorplays VALUES (66, 4, 'Mr. Orange - <NAME>');
INSERT INTO actorplays VALUES (153, 105, 'Randy ''The Ram'' Robinson');
INSERT INTO actorplays VALUES (138, 104, '<NAME>');
INSERT INTO actorplays VALUES (217, 1, '<NAME>');
INSERT INTO actorplays VALUES (145, 102, '<NAME>');
INSERT INTO actorplays VALUES (110, 9, '<NAME>');
INSERT INTO actorplays VALUES (7, 6, '<NAME>');
INSERT INTO actorplays VALUES (139, 96, 'The Dude');
INSERT INTO actorplays VALUES (244, 94, 'His friend - Philip');
INSERT INTO actorplays VALUES (137, 94, '<NAME>');
INSERT INTO actorplays VALUES (231, 45, '<NAME>');
INSERT INTO actorplays VALUES (134, 92, '<NAME>');
INSERT INTO actorplays VALUES (131, 90, '<NAME>');
INSERT INTO actorplays VALUES (146, 103, '<NAME>');
INSERT INTO actorplays VALUES (218, 89, 'Isaac');
INSERT INTO actorplays VALUES (128, 87, '<NAME>');
INSERT INTO actorplays VALUES (126, 86, '<NAME>');
INSERT INTO actorplays VALUES (125, 85, '<NAME>');
INSERT INTO actorplays VALUES (175, 13, 'Sam "Ace" Rothstein');
INSERT INTO actorplays VALUES (15, 13, '<NAME>');
INSERT INTO actorplays VALUES (3, 13, '<NAME>');
INSERT INTO actorplays VALUES (117, 79, '<NAME>');
INSERT INTO actorplays VALUES (75, 13, '<NAME>');
INSERT INTO actorplays VALUES (114, 78, '<NAME>');
INSERT INTO actorplays VALUES (113, 77, 'Policeman');
INSERT INTO actorplays VALUES (112, 76, 'Brody');
INSERT INTO actorplays VALUES (127, 75, 'Dr. <NAME>');
INSERT INTO actorplays VALUES (176, 75, '<NAME>');
INSERT INTO actorplays VALUES (109, 75, 'Officer <NAME>');
INSERT INTO actorplays VALUES (108, 74, 'Hilts ''The Cooler King''');
INSERT INTO actorplays VALUES (133, 13, 'Michael "Mike" Vronsky');
INSERT INTO actorplays VALUES (241, 73, '<NAME>');
INSERT INTO actorplays VALUES (107, 73, '''Maxim'' de Winter');
INSERT INTO actorplays VALUES (102, 72, 'Saunders');
INSERT INTO actorplays VALUES (101, 71, '<NAME>');
INSERT INTO actorplays VALUES (249, 17, '<NAME>');
INSERT INTO actorplays VALUES (100, 70, '<NAME>');
INSERT INTO actorplays VALUES (44, 17, 'John "<NAME>');
INSERT INTO actorplays VALUES (97, 69, 'Maximus');
INSERT INTO actorplays VALUES (65, 69, '<NAME>');
INSERT INTO actorplays VALUES (30, 17, '<NAME>');
INSERT INTO actorplays VALUES (191, 68, '<NAME>');
INSERT INTO actorplays VALUES (150, 68, '<NAME>');
INSERT INTO actorplays VALUES (136, 68, 'Luke');
INSERT INTO actorplays VALUES (102, 17, '<NAME>');
INSERT INTO actorplays VALUES (96, 68, '<NAME>');
INSERT INTO actorplays VALUES (95, 67, '<NAME>');
INSERT INTO actorplays VALUES (148, 66, '<NAME>');
INSERT INTO actorplays VALUES (239, 17, '<NAME>');
INSERT INTO actorplays VALUES (99, 66, '<NAME>');
INSERT INTO actorplays VALUES (94, 66, '<NAME>');
INSERT INTO actorplays VALUES (60, 44, 'Ripley');
INSERT INTO actorplays VALUES (242, 42, '<NAME>');
INSERT INTO actorplays VALUES (55, 42, '<NAME>');
INSERT INTO actorplays VALUES (228, 41, '<NAME>');
INSERT INTO actorplays VALUES (53, 40, '<NAME>');
INSERT INTO actorplays VALUES (67, 37, '<NAME>');
INSERT INTO actorplays VALUES (48, 36, '<NAME>');
INSERT INTO actorplays VALUES (41, 32, 'Concession Girl');
INSERT INTO actorplays VALUES (19, 11, '<NAME>');
INSERT INTO actorplays VALUES (239, 30, '<NAME>');
INSERT INTO actorplays VALUES (235, 30, '<NAME>');
INSERT INTO actorplays VALUES (234, 30, '<NAME>');
INSERT INTO actorplays VALUES (147, 30, 'Devlin');
INSERT INTO actorplays VALUES (64, 29, '<NAME>');
INSERT INTO actorplays VALUES (29, 24, 'Leonard');
INSERT INTO actorplays VALUES (99, 23, '<NAME>');
INSERT INTO actorplays VALUES (1, 23, '<NAME> ''Red'' Redding');
INSERT INTO actorplays VALUES (27, 22, '<NAME>');
INSERT INTO actorplays VALUES (25, 20, 'McManus');
INSERT INTO actorplays VALUES (24, 19, '<NAME>');
INSERT INTO actorplays VALUES (19, 16, 'Voice of the Ring');
INSERT INTO actorplays VALUES (40, 15, '<NAME>');
INSERT INTO actorplays VALUES (17, 15, 'The Narrator');
INSERT INTO actorplays VALUES (160, 14, '<NAME>');
INSERT INTO actorplays VALUES (98, 14, '<NAME>');
INSERT INTO actorplays VALUES (68, 14, 'Dobbs');
INSERT INTO actorplays VALUES (16, 14, '<NAME>');
INSERT INTO actorplays VALUES (12, 11, '<NAME>');
INSERT INTO actorplays VALUES (106, 10, '<NAME>');
INSERT INTO actorplays VALUES (14, 10, '<NAME>walker');
INSERT INTO actorplays VALUES (11, 10, 'Luke Skywalker');
INSERT INTO actorplays VALUES (9, 8, 'Ellis');
INSERT INTO actorplays VALUES (8, 7, 'Juror 1');
INSERT INTO actorplays VALUES (198, 2, 'Stanley');
INSERT INTO actorplays VALUES (104, 2, '<NAME>');
INSERT INTO actorplays VALUES (37, 2, '<NAME>');
INSERT INTO actorplays VALUES (2, 2, '<NAME>');
/* ---------------------
Directs
--------------------- */
INSERT INTO directs VALUES (1, 1);
INSERT INTO directs VALUES (2, 2);
INSERT INTO directs VALUES (3, 2);
INSERT INTO directs VALUES (5, 3);
INSERT INTO directs VALUES (6, 4);
INSERT INTO directs VALUES (7, 5);
INSERT INTO directs VALUES (8, 6);
INSERT INTO directs VALUES (9, 7);
INSERT INTO directs VALUES (10, 4);
INSERT INTO directs VALUES (11, 8);
INSERT INTO directs VALUES (12, 9);
INSERT INTO directs VALUES (14, 113);
INSERT INTO directs VALUES (15, 11);
INSERT INTO directs VALUES (16, 12);
INSERT INTO directs VALUES (17, 13);
INSERT INTO directs VALUES (19, 9);
INSERT INTO directs VALUES (20, 14);
INSERT INTO directs VALUES (22, 5);
INSERT INTO directs VALUES (23, 15);
INSERT INTO directs VALUES (24, 14);
INSERT INTO directs VALUES (25, 16);
INSERT INTO directs VALUES (26, 17);
INSERT INTO directs VALUES (26, 18);
INSERT INTO directs VALUES (27, 19);
INSERT INTO directs VALUES (28, 13);
INSERT INTO directs VALUES (29, 4);
INSERT INTO directs VALUES (30, 20);
INSERT INTO directs VALUES (31, 9);
INSERT INTO directs VALUES (32, 21);
INSERT INTO directs VALUES (33, 22);
INSERT INTO directs VALUES (34, 23);
INSERT INTO directs VALUES (36, 24);
INSERT INTO directs VALUES (37, 2);
INSERT INTO directs VALUES (38, 14);
INSERT INTO directs VALUES (39, 25);
INSERT INTO directs VALUES (40, 26);
INSERT INTO directs VALUES (41, 11);
INSERT INTO directs VALUES (42, 27);
INSERT INTO directs VALUES (43, 5);
INSERT INTO directs VALUES (44, 14);
INSERT INTO directs VALUES (46, 28);
INSERT INTO directs VALUES (47, 96);
INSERT INTO directs VALUES (48, 29);
INSERT INTO directs VALUES (49, 22);
INSERT INTO directs VALUES (51, 22);
INSERT INTO directs VALUES (52, 22);
INSERT INTO directs VALUES (53, 21);
INSERT INTO directs VALUES (54, 30);
INSERT INTO directs VALUES (55, 31);
INSERT INTO directs VALUES (57, 11);
INSERT INTO directs VALUES (59, 32);
INSERT INTO directs VALUES (60, 27);
INSERT INTO directs VALUES (61, 33);
INSERT INTO directs VALUES (62, 34);
INSERT INTO directs VALUES (63, 35);
INSERT INTO directs VALUES (64, 36);
INSERT INTO directs VALUES (65, 37);
INSERT INTO directs VALUES (66, 3);
INSERT INTO directs VALUES (67, 31);
INSERT INTO directs VALUES (68, 38);
INSERT INTO directs VALUES (69, 32);
INSERT INTO directs VALUES (70, 39);
INSERT INTO directs VALUES (70, 40);
INSERT INTO directs VALUES (72, 23);
INSERT INTO directs VALUES (73, 4);
INSERT INTO directs VALUES (75, 11);
INSERT INTO directs VALUES (77, 41);
INSERT INTO directs VALUES (77, 42);
INSERT INTO directs VALUES (78, 21);
INSERT INTO directs VALUES (79, 29);
INSERT INTO directs VALUES (81, 44);
INSERT INTO directs VALUES (82, 7);
INSERT INTO directs VALUES (83, 45);
INSERT INTO directs VALUES (84, 1);
INSERT INTO directs VALUES (85, 22);
INSERT INTO directs VALUES (86, 3);
INSERT INTO directs VALUES (86, 46);
INSERT INTO directs VALUES (87, 22);
INSERT INTO directs VALUES (88, 32);
INSERT INTO directs VALUES (89, 47);
INSERT INTO directs VALUES (91, 21);
INSERT INTO directs VALUES (92, 48);
INSERT INTO directs VALUES (92, 49);
INSERT INTO directs VALUES (93, 50);
INSERT INTO directs VALUES (94, 51);
INSERT INTO directs VALUES (95, 52);
INSERT INTO directs VALUES (96, 53);
INSERT INTO directs VALUES (97, 28);
INSERT INTO directs VALUES (98, 38);
INSERT INTO directs VALUES (99, 51);
INSERT INTO directs VALUES (100, 54);
INSERT INTO directs VALUES (100, 55);
INSERT INTO directs VALUES (100, 3);
INSERT INTO directs VALUES (101, 56);
INSERT INTO directs VALUES (102, 20);
INSERT INTO directs VALUES (104, 57);
INSERT INTO directs VALUES (105, 5);
INSERT INTO directs VALUES (106, 58);
INSERT INTO directs VALUES (107, 14);
INSERT INTO directs VALUES (108, 59);
INSERT INTO directs VALUES (109, 60);
INSERT INTO directs VALUES (110, 4);
INSERT INTO directs VALUES (112, 5);
INSERT INTO directs VALUES (113, 61);
INSERT INTO directs VALUES (114, 62);
INSERT INTO directs VALUES (114, 63);
INSERT INTO directs VALUES (116, 28);
INSERT INTO directs VALUES (117, 64);
INSERT INTO directs VALUES (117, 65);
INSERT INTO directs VALUES (118, 65);
INSERT INTO directs VALUES (118, 64);
INSERT INTO directs VALUES (119, 66);
INSERT INTO directs VALUES (120, 67);
INSERT INTO directs VALUES (120, 68);
INSERT INTO directs VALUES (121, 69);
INSERT INTO directs VALUES (121, 70);
INSERT INTO directs VALUES (121, 71);
INSERT INTO directs VALUES (121, 72);
INSERT INTO directs VALUES (121, 73);
INSERT INTO directs VALUES (122, 24);
INSERT INTO directs VALUES (124, 43);
INSERT INTO directs VALUES (125, 113);
INSERT INTO directs VALUES (126, 74);
INSERT INTO directs VALUES (127, 75);
INSERT INTO directs VALUES (128, 76);
INSERT INTO directs VALUES (129, 77);
INSERT INTO directs VALUES (130, 78);
INSERT INTO directs VALUES (131, 21);
INSERT INTO directs VALUES (132, 118);
INSERT INTO directs VALUES (133, 79);
INSERT INTO directs VALUES (134, 27);
INSERT INTO directs VALUES (135, 13);
INSERT INTO directs VALUES (136, 80);
INSERT INTO directs VALUES (137, 14);
INSERT INTO directs VALUES (138, 81);
INSERT INTO directs VALUES (139, 64);
INSERT INTO directs VALUES (139, 65);
INSERT INTO directs VALUES (141, 3);
INSERT INTO directs VALUES (142, 20);
INSERT INTO directs VALUES (143, 82);
INSERT INTO directs VALUES (144, 83);
INSERT INTO directs VALUES (144, 84);
INSERT INTO directs VALUES (145, 85);
INSERT INTO directs VALUES (146, 86);
INSERT INTO directs VALUES (147, 14);
INSERT INTO directs VALUES (148, 51);
INSERT INTO directs VALUES (149, 87);
INSERT INTO directs VALUES (150, 53);
INSERT INTO directs VALUES (151, 69);
INSERT INTO directs VALUES (151, 70);
INSERT INTO directs VALUES (151, 88);
INSERT INTO directs VALUES (153, 34);
INSERT INTO directs VALUES (154, 19);
INSERT INTO directs VALUES (155, 62);
INSERT INTO directs VALUES (156, 89);
INSERT INTO directs VALUES (157, 90);
INSERT INTO directs VALUES (158, 91);
INSERT INTO directs VALUES (159, 92);
INSERT INTO directs VALUES (160, 93);
INSERT INTO directs VALUES (161, 94);
INSERT INTO directs VALUES (162, 40);
INSERT INTO directs VALUES (163, 32);
INSERT INTO directs VALUES (164, 95);
INSERT INTO directs VALUES (166, 96);
INSERT INTO directs VALUES (166, 15);
INSERT INTO directs VALUES (167, 27);
INSERT INTO directs VALUES (168, 97);
INSERT INTO directs VALUES (169, 98);
INSERT INTO directs VALUES (169, 99);
INSERT INTO directs VALUES (170, 89);
INSERT INTO directs VALUES (171, 76);
INSERT INTO directs VALUES (172, 100);
INSERT INTO directs VALUES (173, 32);
INSERT INTO directs VALUES (174, 101);
INSERT INTO directs VALUES (175, 11);
INSERT INTO directs VALUES (176, 39);
INSERT INTO directs VALUES (177, 6);
INSERT INTO directs VALUES (178, 103);
INSERT INTO directs VALUES (178, 104);
INSERT INTO directs VALUES (180, 105);
INSERT INTO directs VALUES (181, 106);
INSERT INTO directs VALUES (182, 43);
INSERT INTO directs VALUES (185, 116);
INSERT INTO directs VALUES (186, 97);
INSERT INTO directs VALUES (187, 107);
INSERT INTO directs VALUES (187, 108);
INSERT INTO directs VALUES (187, 109);
INSERT INTO directs VALUES (188, 110);
INSERT INTO directs VALUES (189, 103);
INSERT INTO directs VALUES (191, 111);
INSERT INTO directs VALUES (192, 112);
INSERT INTO directs VALUES (193, 113);
INSERT INTO directs VALUES (194, 114);
INSERT INTO directs VALUES (195, 115);
INSERT INTO directs VALUES (196, 6);
INSERT INTO directs VALUES (198, 57);
INSERT INTO directs VALUES (200, 116);
INSERT INTO directs VALUES (201, 117);
INSERT INTO directs VALUES (203, 21);
INSERT INTO directs VALUES (204, 118);
INSERT INTO directs VALUES (205, 92);
INSERT INTO directs VALUES (206, 119);
INSERT INTO directs VALUES (207, 14);
INSERT INTO directs VALUES (210, 120);
INSERT INTO directs VALUES (211, 119);
INSERT INTO directs VALUES (212, 86);
INSERT INTO directs VALUES (213, 121);
INSERT INTO directs VALUES (215, 122);
INSERT INTO directs VALUES (217, 51);
INSERT INTO directs VALUES (218, 78);
INSERT INTO directs VALUES (219, 22);
INSERT INTO directs VALUES (220, 3);
INSERT INTO directs VALUES (221, 123);
INSERT INTO directs VALUES (222, 124);
INSERT INTO directs VALUES (223, 31);
INSERT INTO directs VALUES (224, 125);
INSERT INTO directs VALUES (226, 126);
INSERT INTO directs VALUES (227, 51);
INSERT INTO directs VALUES (228, 89);
INSERT INTO directs VALUES (229, 127);
INSERT INTO directs VALUES (231, 128);
INSERT INTO directs VALUES (234, 93);
INSERT INTO directs VALUES (235, 20);
INSERT INTO directs VALUES (236, 129);
INSERT INTO directs VALUES (239, 70);
INSERT INTO directs VALUES (240, 130);
INSERT INTO directs VALUES (241, 44);
INSERT INTO directs VALUES (242, 9);
INSERT INTO directs VALUES (244, 14);
INSERT INTO directs VALUES (245, 48);
INSERT INTO directs VALUES (245, 131);
INSERT INTO directs VALUES (245, 15);
INSERT INTO directs VALUES (248, 56);
INSERT INTO directs VALUES (249, 91);
INSERT INTO directs VALUES (232, 136);
INSERT INTO directs VALUES (4, 45);
/* -------------------------------
MovieTopics
------------------------------- */
INSERT INTO movietopics VALUES (3, 1, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 2, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 3, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 5, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 6, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (8, 7, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 8, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 9, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 10, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (5, 11, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 12, 'English', 'Yes', 'USA, New Zealand');
INSERT INTO movietopics VALUES (24, 13, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (5, 14, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (8, 15, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 152, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 16, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 17, 'English', 'Yes', 'USA, Germany');
INSERT INTO movietopics VALUES (24, 18, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (10, 19, 'English', 'Yes', 'New Zealand, USA');
INSERT INTO movietopics VALUES (6, 20, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 21, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (5, 22, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 23, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (17, 24, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 25, 'English', 'Yes', 'USA, Germany');
INSERT INTO movietopics VALUES (5, 26, 'English', 'Yes', 'USA, Australia');
INSERT INTO movietopics VALUES (3, 27, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 28, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (6, 29, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 30, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 31, 'English', 'Yes', 'USA, New Zealand');
INSERT INTO movietopics VALUES (4, 32, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 33, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (4, 34, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 35, 'English', 'Yes', 'France');
INSERT INTO movietopics VALUES (4, 36, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 37, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 38, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 39, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 40, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 41, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 42, 'English', 'Yes', 'USA, France');
INSERT INTO movietopics VALUES (5, 43, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (6, 44, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 45, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (17, 46, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (15, 47, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 48, 'English', 'Yes', 'UK');
INSERT INTO movietopics VALUES (4, 49, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (24, 50, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 51, 'English', 'Yes', 'USA, West Germany');
INSERT INTO movietopics VALUES (3, 52, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (3, 53, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 54, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (8, 55, 'English', 'Yes', 'France, Poland, Germany, UK');
INSERT INTO movietopics VALUES (24, 56, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (3, 57, 'English', 'Yes', 'USA, Hong Kong');
INSERT INTO movietopics VALUES (16, 59, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 60, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (4, 61, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 62, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 63, 'English', 'Yes', 'West Germany');
INSERT INTO movietopics VALUES (3, 65, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 66, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 67, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 68, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 69, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 183, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (24, 184, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (10, 70, 'English', 'Yes', 'UK');
INSERT INTO movietopics VALUES (16, 71, 'English', 'Yes', 'Italy');
INSERT INTO movietopics VALUES (10, 72, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 73, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (24, 74, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (8, 75, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 76, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (16, 77, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 78, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 79, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (6, 80, 'English', 'Yes', 'Japan');
INSERT INTO movietopics VALUES (4, 81, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (8, 82, 'English', 'Yes', 'USA, France');
INSERT INTO movietopics VALUES (3, 83, 'English', 'Yes', 'Italy, USA');
INSERT INTO movietopics VALUES (3, 84, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 86, 'English', 'Yes', 'USA, Germany');
INSERT INTO movietopics VALUES (6, 87, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (16, 88, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (8, 89, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 90, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (16, 91, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 92, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 93, 'English', 'Yes', 'Germany');
INSERT INTO movietopics VALUES (4, 94, 'English', 'Yes', 'USA, Germany');
INSERT INTO movietopics VALUES (4, 95, 'English', 'Yes', 'Germany');
INSERT INTO movietopics VALUES (16, 96, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 97, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (3, 98, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (23, 99, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 100, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (8, 101, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (16, 102, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 103, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (3, 104, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 105, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 106, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 107, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 108, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 109, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 110, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (24, 111, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (10, 112, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 113, 'English', 'Yes', 'UK, USA, Italy, South Africa, Canada');
INSERT INTO movietopics VALUES (4, 114, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (24, 115, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (7, 116, 'English', 'Yes', 'USA, Hong Kong, UK');
INSERT INTO movietopics VALUES (3, 117, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (3, 118, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 119, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 120, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 121, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 122, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 123, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (5, 124, 'English', 'Yes', 'Japan, France');
INSERT INTO movietopics VALUES (5, 125, 'English', 'Yes', 'Japan');
INSERT INTO movietopics VALUES (5, 126, 'English', 'Yes', 'USA, New Zealand, Canada, South Africa');
INSERT INTO movietopics VALUES (4, 127, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 128, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (4, 129, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 130, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 131, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 132, 'English', 'Yes', 'Sweden');
INSERT INTO movietopics VALUES (4, 133, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (5, 134, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (8, 135, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 136, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 137, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (23, 138, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 139, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (4, 140, 'English', 'Yes', 'Japan');
INSERT INTO movietopics VALUES (5, 141, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 142, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 143, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (15, 144, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 145, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 146, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 147, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 148, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 149, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (8, 150, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 151, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 153, 'English', 'Yes', 'USA, France');
INSERT INTO movietopics VALUES (4, 154, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 155, 'English', 'Yes', 'UK');
INSERT INTO movietopics VALUES (10, 156, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 157, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 158, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 159, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 160, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 161, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 162, 'English', 'Yes', 'UK');
INSERT INTO movietopics VALUES (10, 163, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 164, 'English', 'Yes', 'USA, Germany');
INSERT INTO movietopics VALUES (4, 165, 'English', 'Yes', 'Mexico');
INSERT INTO movietopics VALUES (15, 166, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 167, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (10, 168, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 169, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 170, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 171, 'English', 'Yes', 'UK');
INSERT INTO movietopics VALUES (17, 172, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 173, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 174, 'English', 'Yes', 'USA, UK, Germany');
INSERT INTO movietopics VALUES (8, 175, 'English', 'Yes', 'USA, France');
INSERT INTO movietopics VALUES (6, 176, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 177, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 178, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 179, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (8, 180, 'English', 'Yes', 'UK, India');
INSERT INTO movietopics VALUES (5, 181, 'English', 'Yes', 'USA, Germany');
INSERT INTO movietopics VALUES (4, 182, 'English', 'Yes', 'Japan');
INSERT INTO movietopics VALUES (4, 185, 'English', 'Yes', 'Italy, France');
INSERT INTO movietopics VALUES (10, 186, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 187, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 188, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 189, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 190, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 191, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 192, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 193, 'English', 'Yes', 'USA, Canada');
INSERT INTO movietopics VALUES (16, 194, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (5, 195, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 196, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 197, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 198, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 199, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 200, 'English', 'Yes', 'Italy');
INSERT INTO movietopics VALUES (17, 201, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 202, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (4, 203, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 204, 'English', 'Yes', 'Sweden');
INSERT INTO movietopics VALUES (4, 205, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (8, 206, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (3, 207, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 208, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (24, 209, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 210, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 211, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 212, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 213, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 214, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (16, 215, 'English', 'Yes', 'UK');
INSERT INTO movietopics VALUES (24, 216, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (3, 217, 'English', 'Yes', 'USA, Australia');
INSERT INTO movietopics VALUES (16, 218, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (10, 219, 'English', 'Yes', 'UK, USA, Ireland');
INSERT INTO movietopics VALUES (5, 220, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 221, 'English', 'Yes', 'Australia');
INSERT INTO movietopics VALUES (8, 222, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 223, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 224, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 225, 'English', 'Yes', 'Norway');
INSERT INTO movietopics VALUES (5, 226, 'English', 'Yes', 'UK, USA');
INSERT INTO movietopics VALUES (4, 227, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 228, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (5, 229, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 230, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 231, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (4, 232, 'English', 'Yes', 'Germany, USA');
INSERT INTO movietopics VALUES (24, 233, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (16, 234, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 235, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 236, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 237, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (24, 238, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (16, 239, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 240, 'English', 'Yes', 'USA, Canada');
INSERT INTO movietopics VALUES (6, 241, 'English', 'Yes', 'USA, UK');
INSERT INTO movietopics VALUES (5, 242, 'English', 'Yes', 'New Zealand, USA, Germany');
INSERT INTO movietopics VALUES (24, 243, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (3, 244, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (15, 245, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (24, 246, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (24, 247, 'English', 'Yes', 'None');
INSERT INTO movietopics VALUES (4, 248, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (23, 249, 'English', 'Yes', 'USA');
INSERT INTO movietopics VALUES (16, 245, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (17, 49, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (20, 148, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (9, 97, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (10, 242, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (5, 194, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (14, 127, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (20, 153, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (10, 4, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (23, 4, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (13, 43, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (11, 11, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (7, 106, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (13, 85, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (12, 192, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (21, 121, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (18, 144, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (18, 166, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (16, 166, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (17, 27, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (14, 62, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (5, 17, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (14, 129, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (20, 213, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (12, 213, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (6, 84, NULL, NULL, NULL);
INSERT INTO movietopics VALUES (5, 4, NULL, 'No', NULL);
INSERT INTO movietopics VALUES (5, 5, NULL, NULL, NULL);
/* -----------------------
Studios
----------------------- */
INSERT INTO studio VALUES (1, 'Warner Bros. Pictures', 'USA, France');
INSERT INTO studio VALUES (2, 'Warner Home Video', 'Italy, USA');
INSERT INTO studio VALUES (3, 'Warner Bros.', 'UK, USA');
INSERT INTO studio VALUES (4, 'The Weinstein Company', 'USA, Germany');
INSERT INTO studio VALUES (5, 'Criterion Collection', 'USA');
INSERT INTO studio VALUES (6, 'Paramount Pictures', 'USA');
INSERT INTO studio VALUES (7, 'United Artists', 'USA');
INSERT INTO studio VALUES (8, 'Walt Disney Pictures', 'USA');
INSERT INTO studio VALUES (9, 'Warner Bros. Pictures//Village Roadshow', 'USA, Germany');
INSERT INTO studio VALUES (10, 'Universal Pictures', 'USA');
INSERT INTO studio VALUES (11, 'Dreamworks Distribution LLC', 'USA, UK');
INSERT INTO studio VALUES (12, 'Dimension Films', 'USA');
INSERT INTO studio VALUES (13, 'Paramount', 'USA, UK');
INSERT INTO studio VALUES (14, 'ITVS', 'USA');
INSERT INTO studio VALUES (15, 'Sony Pictures', 'USA');
INSERT INTO studio VALUES (16, 'Twentieth Century Fox', 'USA');
INSERT INTO studio VALUES (17, 'VCI', 'USA');
INSERT INTO studio VALUES (18, '20th Century Fox', 'USA');
INSERT INTO studio VALUES (19, 'MGM', 'UK, USA, Italy, South Africa, Canada');
INSERT INTO studio VALUES (20, 'Columbia Pictures', 'USA');
INSERT INTO studio VALUES (21, 'Miramax Films', 'USA');
INSERT INTO studio VALUES (22, 'Warner Bros. Pictures//Legendary', 'USA, UK');
INSERT INTO studio VALUES (23, 'New Line Cinema', 'USA, New Zealand');
INSERT INTO studio VALUES (24, 'Fox Searchlight Pictures', 'UK, USA');
INSERT INTO studio VALUES (25, 'Gramercy Pictures', 'USA, Germany');
INSERT INTO studio VALUES (26, 'Orion Pictures Corporation', 'USA');
INSERT INTO studio VALUES (27, 'Newmarket Films', 'USA');
INSERT INTO studio VALUES (28, 'Liberty Films', 'USA');
INSERT INTO studio VALUES (29, 'RKO Radio Pictures', 'USA');
INSERT INTO studio VALUES (30, 'Turner Entertainment', 'USA');
INSERT INTO studio VALUES (31, 'Dream Works', 'USA');
INSERT INTO studio VALUES (32, 'TriStar Pictures', 'USA, France');
INSERT INTO studio VALUES (33, 'United Artists Films', 'USA');
INSERT INTO studio VALUES (34, 'Universal International Pictur', 'USA');
INSERT INTO studio VALUES (35, 'Focus Features', 'France, Poland, Germany, UK');
INSERT INTO studio VALUES (36, 'Twentieth Century Fox Home Entertainment', 'USA');
INSERT INTO studio VALUES (37, '20th Century Fox Film Corporat', 'UK, USA');
INSERT INTO studio VALUES (38, 'Artisan Entertainment', 'USA');
INSERT INTO studio VALUES (39, 'Rialto Pictures', 'UK');
INSERT INTO studio VALUES (40, 'Almi Cinema 5', 'UK');
INSERT INTO studio VALUES (41, 'Buena Vista Pictures', 'USA, UK');
INSERT INTO studio VALUES (42, 'Sony Pictures//Screen Gems', 'USA, New Zealand, Canada, South Africa');
INSERT INTO studio VALUES (43, 'Hollywood//Buena Vista', 'USA');
INSERT INTO studio VALUES (44, 'Newmarket Film Group', 'USA');
INSERT INTO studio VALUES (45, 'Cinerez', 'Italy, France');
INSERT INTO studio VALUES (46, 'Sony Pictures Home Entertainment', 'USA');
INSERT INTO studio VALUES (47, 'Orion Pictures', 'UK, USA');
INSERT INTO studio VALUES (48, 'Buena Vista', 'USA');
INSERT INTO studio VALUES (49, 'Paramount Vantage', 'USA');
INSERT INTO studio VALUES (50, 'Loew''s Inc.', 'USA');
INSERT INTO studio VALUES (51, 'Ealing Studios', 'UK');
INSERT INTO studio VALUES (52, 'WB', 'USA, Australia');
INSERT INTO studio VALUES (53, 'IFC Films', 'Australia');
INSERT INTO studio VALUES (54, 'Lionsgate', 'UK, USA');
INSERT INTO studio VALUES (55, 'Universal Films', 'USA');
INSERT INTO studio VALUES (56, 'Embassy Pictures//Rialto Pictures', 'USA');
INSERT INTO studio VALUES (57, 'IMAX', 'USA, Germany');
INSERT INTO studio VALUES (58, 'Cowboy Pictures', 'Japan');
INSERT INTO studio VALUES (59, 'Fox', 'USA');
INSERT INTO studio VALUES (60, 'MGM//United Artists', 'USA');
INSERT INTO studio VALUES (61, 'Paramount Home Video', 'USA');
INSERT INTO studio VALUES (62, 'Lions Gate Films', 'Germany, USA');
INSERT INTO studio VALUES (63, 'MCA Universal Home Video', 'USA');
INSERT INTO studio VALUES (64, 'Buena Vista Distribution Compa', 'USA');
INSERT INTO studio VALUES (65, 'Janus Films', 'USA');
INSERT INTO studio VALUES (66, 'Paramount//DWA', 'USA');
INSERT INTO studio VALUES (67, 'First National Pictures Inc.', 'USA');
INSERT INTO studio VALUES (68, 'WARNER BROTHERS PICTURES', 'USA');
INSERT INTO studio VALUES (69, 'Disney//Pixar', 'USA');
/* ----------------------------
Sponsors
---------------------------- */
INSERT INTO sponsors VALUES (1, 82);
INSERT INTO sponsors VALUES (2, 83);
INSERT INTO sponsors VALUES (1, 84);
INSERT INTO sponsors VALUES (3, 85);
INSERT INTO sponsors VALUES (4, 86);
INSERT INTO sponsors VALUES (1, 87);
INSERT INTO sponsors VALUES (5, 88);
INSERT INTO sponsors VALUES (6, 89);
INSERT INTO sponsors VALUES (7, 91);
INSERT INTO sponsors VALUES (8, 92);
INSERT INTO sponsors VALUES (9, 94);
INSERT INTO sponsors VALUES (6, 95);
INSERT INTO sponsors VALUES (10, 96);
INSERT INTO sponsors VALUES (11, 97);
INSERT INTO sponsors VALUES (3, 98);
INSERT INTO sponsors VALUES (1, 99);
INSERT INTO sponsors VALUES (12, 100);
INSERT INTO sponsors VALUES (13, 101);
INSERT INTO sponsors VALUES (14, 102);
INSERT INTO sponsors VALUES (15, 104);
INSERT INTO sponsors VALUES (6, 105);
INSERT INTO sponsors VALUES (16, 106);
INSERT INTO sponsors VALUES (7, 107);
INSERT INTO sponsors VALUES (17, 108);
INSERT INTO sponsors VALUES (18, 109);
INSERT INTO sponsors VALUES (1, 110);
INSERT INTO sponsors VALUES (10, 112);
INSERT INTO sponsors VALUES (19, 113);
INSERT INTO sponsors VALUES (20, 1);
INSERT INTO sponsors VALUES (6, 2);
INSERT INTO sponsors VALUES (6, 3);
INSERT INTO sponsors VALUES (21, 5);
INSERT INTO sponsors VALUES (10, 7);
INSERT INTO sponsors VALUES (5, 8);
INSERT INTO sponsors VALUES (7, 9);
INSERT INTO sponsors VALUES (22, 10);
INSERT INTO sponsors VALUES (16, 11);
INSERT INTO sponsors VALUES (23, 12);
INSERT INTO sponsors VALUES (3, 15);
INSERT INTO sponsors VALUES (24, 114);
INSERT INTO sponsors VALUES (1, 16);
INSERT INTO sponsors VALUES (18, 17);
INSERT INTO sponsors VALUES (23, 19);
INSERT INTO sponsors VALUES (6, 20);
INSERT INTO sponsors VALUES (6, 22);
INSERT INTO sponsors VALUES (8, 23);
INSERT INTO sponsors VALUES (6, 24);
INSERT INTO sponsors VALUES (25, 25);
INSERT INTO sponsors VALUES (1, 26);
INSERT INTO sponsors VALUES (26, 27);
INSERT INTO sponsors VALUES (23, 28);
INSERT INTO sponsors VALUES (27, 29);
INSERT INTO sponsors VALUES (28, 30);
INSERT INTO sponsors VALUES (23, 31);
INSERT INTO sponsors VALUES (6, 32);
INSERT INTO sponsors VALUES (15, 33);
INSERT INTO sponsors VALUES (6, 34);
INSERT INTO sponsors VALUES (29, 36);
INSERT INTO sponsors VALUES (7, 37);
INSERT INTO sponsors VALUES (30, 38);
INSERT INTO sponsors VALUES (31, 39);
INSERT INTO sponsors VALUES (23, 40);
INSERT INTO sponsors VALUES (20, 41);
INSERT INTO sponsors VALUES (32, 42);
INSERT INTO sponsors VALUES (6, 43);
INSERT INTO sponsors VALUES (6, 44);
INSERT INTO sponsors VALUES (18, 46);
INSERT INTO sponsors VALUES (8, 47);
INSERT INTO sponsors VALUES (1, 49);
INSERT INTO sponsors VALUES (1, 6);
INSERT INTO sponsors VALUES (1, 116);
INSERT INTO sponsors VALUES (19, 117);
INSERT INTO sponsors VALUES (21, 118);
INSERT INTO sponsors VALUES (3, 119);
INSERT INTO sponsors VALUES (33, 120);
INSERT INTO sponsors VALUES (7, 51);
INSERT INTO sponsors VALUES (3, 52);
INSERT INTO sponsors VALUES (6, 53);
INSERT INTO sponsors VALUES (34, 54);
INSERT INTO sponsors VALUES (35, 55);
INSERT INTO sponsors VALUES (1, 57);
INSERT INTO sponsors VALUES (36, 59);
INSERT INTO sponsors VALUES (37, 60);
INSERT INTO sponsors VALUES (35, 61);
INSERT INTO sponsors VALUES (38, 62);
INSERT INTO sponsors VALUES (20, 63);
INSERT INTO sponsors VALUES (39, 64);
INSERT INTO sponsors VALUES (1, 65);
INSERT INTO sponsors VALUES (21, 66);
INSERT INTO sponsors VALUES (6, 67);
INSERT INTO sponsors VALUES (7, 69);
INSERT INTO sponsors VALUES (40, 70);
INSERT INTO sponsors VALUES (10, 72);
INSERT INTO sponsors VALUES (41, 73);
INSERT INTO sponsors VALUES (7, 75);
INSERT INTO sponsors VALUES (20, 35);
INSERT INTO sponsors VALUES (19, 77);
INSERT INTO sponsors VALUES (7, 78);
INSERT INTO sponsors VALUES (20, 79);
INSERT INTO sponsors VALUES (1, 121);
INSERT INTO sponsors VALUES (42, 126);
INSERT INTO sponsors VALUES (43, 127);
INSERT INTO sponsors VALUES (20, 128);
INSERT INTO sponsors VALUES (44, 129);
INSERT INTO sponsors VALUES (7, 130);
INSERT INTO sponsors VALUES (19, 131);
INSERT INTO sponsors VALUES (10, 133);
INSERT INTO sponsors VALUES (45, 185);
INSERT INTO sponsors VALUES (21, 141);
INSERT INTO sponsors VALUES (46, 142);
INSERT INTO sponsors VALUES (47, 143);
INSERT INTO sponsors VALUES (48, 144);
INSERT INTO sponsors VALUES (49, 145);
INSERT INTO sponsors VALUES (49, 146);
INSERT INTO sponsors VALUES (29, 147);
INSERT INTO sponsors VALUES (1, 148);
INSERT INTO sponsors VALUES (48, 149);
INSERT INTO sponsors VALUES (18, 150);
INSERT INTO sponsors VALUES (50, 151);
INSERT INTO sponsors VALUES (24, 153);
INSERT INTO sponsors VALUES (18, 81);
INSERT INTO sponsors VALUES (20, 48);
INSERT INTO sponsors VALUES (39, 124);
INSERT INTO sponsors VALUES (10, 210);
INSERT INTO sponsors VALUES (15, 211);
INSERT INTO sponsors VALUES (23, 212);
INSERT INTO sponsors VALUES (51, 215);
INSERT INTO sponsors VALUES (52, 217);
INSERT INTO sponsors VALUES (7, 218);
INSERT INTO sponsors VALUES (3, 219);
INSERT INTO sponsors VALUES (21, 220);
INSERT INTO sponsors VALUES (53, 221);
INSERT INTO sponsors VALUES (36, 222);
INSERT INTO sponsors VALUES (6, 223);
INSERT INTO sponsors VALUES (6, 224);
INSERT INTO sponsors VALUES (54, 226);
INSERT INTO sponsors VALUES (18, 134);
INSERT INTO sponsors VALUES (20, 135);
INSERT INTO sponsors VALUES (3, 136);
INSERT INTO sponsors VALUES (7, 138);
INSERT INTO sponsors VALUES (25, 139);
INSERT INTO sponsors VALUES (6, 154);
INSERT INTO sponsors VALUES (21, 155);
INSERT INTO sponsors VALUES (19, 156);
INSERT INTO sponsors VALUES (55, 157);
INSERT INTO sponsors VALUES (36, 158);
INSERT INTO sponsors VALUES (56, 159);
INSERT INTO sponsors VALUES (1, 160);
INSERT INTO sponsors VALUES (20, 161);
INSERT INTO sponsors VALUES (20, 180);
INSERT INTO sponsors VALUES (57, 181);
INSERT INTO sponsors VALUES (58, 182);
INSERT INTO sponsors VALUES (18, 186);
INSERT INTO sponsors VALUES (7, 187);
INSERT INTO sponsors VALUES (7, 188);
INSERT INTO sponsors VALUES (59, 191);
INSERT INTO sponsors VALUES (21, 192);
INSERT INTO sponsors VALUES (35, 194);
INSERT INTO sponsors VALUES (1, 195);
INSERT INTO sponsors VALUES (60, 196);
INSERT INTO sponsors VALUES (1, 198);
INSERT INTO sponsors VALUES (5, 200);
INSERT INTO sponsors VALUES (1, 201);
INSERT INTO sponsors VALUES (10, 202);
INSERT INTO sponsors VALUES (61, 203);
INSERT INTO sponsors VALUES (5, 204);
INSERT INTO sponsors VALUES (2, 205);
INSERT INTO sponsors VALUES (41, 206);
INSERT INTO sponsors VALUES (1, 207);
INSERT INTO sponsors VALUES (7, 213);
INSERT INTO sponsors VALUES (1, 227);
INSERT INTO sponsors VALUES (6, 228);
INSERT INTO sponsors VALUES (41, 229);
INSERT INTO sponsors VALUES (6, 231);
INSERT INTO sponsors VALUES (62, 232);
INSERT INTO sponsors VALUES (20, 234);
INSERT INTO sponsors VALUES (1, 235);
INSERT INTO sponsors VALUES (63, 236);
INSERT INTO sponsors VALUES (19, 239);
INSERT INTO sponsors VALUES (19, 240);
INSERT INTO sponsors VALUES (10, 242);
INSERT INTO sponsors VALUES (1, 244);
INSERT INTO sponsors VALUES (64, 245);
INSERT INTO sponsors VALUES (61, 249);
INSERT INTO sponsors VALUES (1, 162);
INSERT INTO sponsors VALUES (65, 163);
INSERT INTO sponsors VALUES (10, 164);
INSERT INTO sponsors VALUES (62, 165);
INSERT INTO sponsors VALUES (8, 166);
INSERT INTO sponsors VALUES (26, 167);
INSERT INTO sponsors VALUES (63, 168);
INSERT INTO sponsors VALUES (66, 169);
INSERT INTO sponsors VALUES (29, 170);
INSERT INTO sponsors VALUES (25, 171);
INSERT INTO sponsors VALUES (10, 172);
INSERT INTO sponsors VALUES (67, 173);
INSERT INTO sponsors VALUES (1, 174);
INSERT INTO sponsors VALUES (10, 175);
INSERT INTO sponsors VALUES (10, 176);
INSERT INTO sponsors VALUES (68, 177);
INSERT INTO sponsors VALUES (69, 178);
/* ----------------------------
Watches
---------------------------- */
INSERT INTO watches VALUES (69, 5, '2016-04-07 00:00:00-04', 5);
INSERT INTO watches VALUES (70, 2, '2016-04-07 00:00:00-04', 5);
INSERT INTO watches VALUES (70, 5, '2016-04-07 00:00:00-04', 5);
INSERT INTO watches VALUES (70, 7, '2016-04-07 00:00:00-04', 4);
INSERT INTO watches VALUES (70, 1, '2016-04-07 00:00:00-04', 5);
INSERT INTO watches VALUES (70, 3, '2016-04-07 00:00:00-04', NULL);
INSERT INTO watches VALUES (70, 84, '2016-04-07 00:00:00-04', 4);
INSERT INTO watches VALUES (70, 40, '2016-04-07 00:00:00-04', 4);
INSERT INTO watches VALUES (70, 89, '2016-04-07 00:00:00-04', 3);
INSERT INTO watches VALUES (70, 175, '2016-04-07 00:00:00-04', 5);
INSERT INTO watches VALUES (70, 75, '2016-04-07 00:00:00-04', 4);
INSERT INTO watches VALUES (70, 15, '2016-04-07 00:00:00-04', 5);
INSERT INTO watches VALUES (73, 175, '2016-04-07 21:27:19.339778-04', 5);
INSERT INTO watches VALUES (73, 15, '2016-04-07 21:27:23.196225-04', 5);
INSERT INTO watches VALUES (73, 206, '2016-04-07 21:27:26.785101-04', 4);
INSERT INTO watches VALUES (73, 7, '2016-04-07 21:27:31.574439-04', 5);
INSERT INTO watches VALUES (73, 150, '2016-04-07 21:27:39.480344-04', 2);
INSERT INTO watches VALUES (73, 166, '2016-04-07 21:27:56.246548-04', 5);
INSERT INTO watches VALUES (73, 149, '2016-04-07 21:28:01.884818-04', 5);
INSERT INTO watches VALUES (73, 189, '2016-04-07 21:28:05.581974-04', 3);
INSERT INTO watches VALUES (73, 47, '2016-04-07 21:28:10.340801-04', 4);
INSERT INTO watches VALUES (73, 245, '2016-04-07 21:28:15.975275-04', 5);
INSERT INTO watches VALUES (73, 169, '2016-04-07 21:28:19.314787-04', 2);
INSERT INTO watches VALUES (70, 83, '2016-04-07 22:11:32.448196-04', 5);
INSERT INTO watches VALUES (70, 25, '2016-04-07 22:12:40.870429-04', NULL);
INSERT INTO watches VALUES (70, 8, '2016-04-07 22:28:34.6528-04', 3);
INSERT INTO watches VALUES (70, 166, '2016-04-08 08:30:43.934443-04', 4);
INSERT INTO watches VALUES (70, 73, '2016-04-08 08:34:11.233609-04', 5);
INSERT INTO watches VALUES (70, 134, '2016-04-08 08:36:09.056872-04', 1);
INSERT INTO watches VALUES (70, 129, '2016-04-08 08:36:35.597745-04', 3);
INSERT INTO watches VALUES (74, 29, '2016-04-08 13:34:45.325533-04', 4);
INSERT INTO watches VALUES (74, 73, '2016-04-08 13:34:59.488855-04', 5);
INSERT INTO watches VALUES (74, 39, '2016-04-08 13:35:08.015195-04', 5);
INSERT INTO watches VALUES (74, 49, '2016-04-08 13:35:12.824732-04', 2);
INSERT INTO watches VALUES (74, 231, '2016-04-08 13:35:16.345018-04', 3);
INSERT INTO watches VALUES (74, 127, '2016-04-08 13:35:23.574313-04', 4);
INSERT INTO watches VALUES (74, 37, '2016-04-08 13:35:27.41944-04', 3);
INSERT INTO watches VALUES (74, 34, '2016-04-08 13:35:31.624922-04', 5);
INSERT INTO watches VALUES (74, 15, '2016-04-08 13:37:22.812535-04', 5);
INSERT INTO watches VALUES (74, 75, '2016-04-08 13:37:26.202475-04', 3);
INSERT INTO watches VALUES (74, 180, '2016-04-08 13:37:29.461083-04', 3);
INSERT INTO watches VALUES (74, 89, '2016-04-08 13:37:36.187426-04', 4);
INSERT INTO watches VALUES (74, 201, '2016-04-08 13:43:47.856991-04', 3);
INSERT INTO watches VALUES (74, 10, '2016-04-08 13:43:53.448616-04', 5);
INSERT INTO watches VALUES (74, 11, '2016-04-08 13:44:02.668858-04', 4);
INSERT INTO watches VALUES (74, 6, '2016-04-08 13:44:28.56939-04', 5);
INSERT INTO watches VALUES (70, 39, '2016-04-09 14:37:23.310117-04', 5);
INSERT INTO watches VALUES (70, 192, '2016-04-09 14:37:49.877383-04', 4);
INSERT INTO watches VALUES (70, 17, '2016-04-09 18:38:09.084113-04', 4);
INSERT INTO watches VALUES (64, 34, '2016-04-10 00:47:09.08381-04', 4);
INSERT INTO watches VALUES (64, 61, '2016-04-10 00:47:12.022254-04', 4);
INSERT INTO watches VALUES (64, 205, '2016-04-10 00:47:15.692723-04', 2);
INSERT INTO watches VALUES (64, 192, '2016-04-10 00:47:18.539572-04', 3);
INSERT INTO watches VALUES (64, 114, '2016-04-10 00:47:21.183866-04', 2);
INSERT INTO watches VALUES (64, 203, '2016-04-10 00:47:23.560803-04', 1);
INSERT INTO watches VALUES (64, 95, '2016-04-10 00:47:25.630744-04', 1);
INSERT INTO watches VALUES (64, 182, '2016-04-10 00:47:28.51583-04', 1);
INSERT INTO watches VALUES (64, 223, '2016-04-10 00:47:31.48673-04', 2);
INSERT INTO watches VALUES (64, 85, '2016-04-10 00:47:34.928135-04', 3);
INSERT INTO watches VALUES (64, 175, '2016-04-10 00:47:40.04595-04', 4);
INSERT INTO watches VALUES (64, 101, '2016-04-10 00:47:43.779767-04', 3);
INSERT INTO watches VALUES (64, 55, '2016-04-10 00:47:46.683871-04', 4);
INSERT INTO watches VALUES (64, 180, '2016-04-10 00:47:49.874257-04', 3);
INSERT INTO watches VALUES (64, 245, '2016-04-10 00:47:55.153806-04', 4);
INSERT INTO watches VALUES (20, 39, '2016-04-10 00:54:33.070292-04', 4);
INSERT INTO watches VALUES (20, 6, '2016-04-10 00:54:37.735038-04', 4);
INSERT INTO watches VALUES (20, 10, '2016-04-10 00:54:41.295723-04', 5);
INSERT INTO watches VALUES (20, 2, '2016-04-10 00:54:45.454817-04', 4);
INSERT INTO watches VALUES (20, 83, '2016-04-10 00:54:48.158135-04', 5);
INSERT INTO watches VALUES (20, 66, '2016-04-10 00:54:50.77282-04', 4);
INSERT INTO watches VALUES (20, 177, '2016-04-10 00:54:53.219701-04', 3);
INSERT INTO watches VALUES (20, 244, '2016-04-10 00:54:55.94275-04', 4);
INSERT INTO watches VALUES (20, 65, '2016-04-10 00:54:58.283044-04', 2);
INSERT INTO watches VALUES (20, 157, '2016-04-10 00:55:02.073794-04', 4);
INSERT INTO watches VALUES (20, 40, '2016-04-10 00:55:05.687504-04', 3);
INSERT INTO watches VALUES (20, 41, '2016-04-10 00:55:09.313038-04', 5);
INSERT INTO watches VALUES (20, 54, '2016-04-10 00:55:12.338072-04', 2);
INSERT INTO watches VALUES (20, 28, '2016-04-10 00:55:15.805755-04', 3);
INSERT INTO watches VALUES (20, 242, '2016-04-10 00:56:45.360201-04', NULL);
INSERT INTO watches VALUES (20, 26, '2016-04-10 00:56:52.218484-04', NULL);
INSERT INTO watches VALUES (21, 41, '2016-04-10 00:57:15.899799-04', 4);
INSERT INTO watches VALUES (21, 5, '2016-04-10 00:57:50.682715-04', 5);
INSERT INTO watches VALUES (21, 15, '2016-04-10 00:58:27.248597-04', 4);
INSERT INTO watches VALUES (21, 10, '2016-04-10 00:58:31.094741-04', 5);
INSERT INTO watches VALUES (21, 73, '2016-04-10 00:58:34.538429-04', 5);
INSERT INTO watches VALUES (21, 1, '2016-04-10 00:58:37.429765-04', 5);
INSERT INTO watches VALUES (21, 149, '2016-04-10 00:58:40.405622-04', 4);
INSERT INTO watches VALUES (21, 53, '2016-04-10 00:58:50.546838-04', 2);
INSERT INTO watches VALUES (21, 104, '2016-04-10 00:58:52.406404-04', 1);
INSERT INTO watches VALUES (21, 177, '2016-04-10 00:58:54.565518-04', 4);
INSERT INTO watches VALUES (21, 157, '2016-04-10 00:58:57.852823-04', 5);
INSERT INTO watches VALUES (21, 122, '2016-04-10 00:59:00.458531-04', 4);
INSERT INTO watches VALUES (21, 100, '2016-04-10 00:59:02.053192-04', NULL);
INSERT INTO watches VALUES (21, 187, '2016-04-10 00:59:03.507346-04', NULL);
INSERT INTO watches VALUES (21, 207, '2016-04-10 00:59:05.631714-04', NULL);
INSERT INTO watches VALUES (21, 35, '2016-04-10 00:59:21.7651-04', NULL);
INSERT INTO watches VALUES (22, 83, '2016-04-10 01:04:53.869534-04', 5);
INSERT INTO watches VALUES (22, 52, '2016-04-10 01:04:55.981191-04', 4);
INSERT INTO watches VALUES (22, 217, '2016-04-10 01:04:57.964496-04', 3);
INSERT INTO watches VALUES (22, 177, '2016-04-10 01:05:00.348746-04', 4);
INSERT INTO watches VALUES (22, 54, '2016-04-10 01:05:02.389693-04', 2);
INSERT INTO watches VALUES (22, 160, '2016-04-10 01:05:04.430611-04', 3);
INSERT INTO watches VALUES (22, 25, '2016-04-10 01:05:08.406009-04', 4);
INSERT INTO watches VALUES (22, 100, '2016-04-10 01:05:11.459038-04', 4);
INSERT INTO watches VALUES (22, 117, '2016-04-10 01:05:13.847917-04', NULL);
INSERT INTO watches VALUES (22, 10, '2016-04-10 01:05:17.798073-04', 4);
INSERT INTO watches VALUES (22, 39, '2016-04-10 01:05:30.446416-04', 5);
INSERT INTO watches VALUES (35, 83, '2016-04-10 13:14:25.725036-04', 5);
INSERT INTO watches VALUES (35, 193, '2016-04-10 13:14:28.789712-04', 3);
INSERT INTO watches VALUES (35, 104, '2016-04-10 13:14:34.700889-04', 1);
INSERT INTO watches VALUES (35, 41, '2016-04-10 13:14:38.041438-04', 4);
INSERT INTO watches VALUES (35, 5, '2016-04-10 13:14:41.647345-04', 5);
INSERT INTO watches VALUES (35, 57, '2016-04-10 13:14:44.817627-04', 5);
INSERT INTO watches VALUES (35, 100, '2016-04-10 13:14:48.720195-04', 4);
INSERT INTO watches VALUES (35, 187, '2016-04-10 13:14:51.887886-04', 3);
INSERT INTO watches VALUES (35, 118, '2016-04-10 13:14:54.208858-04', 2);
INSERT INTO watches VALUES (35, 157, '2016-04-10 13:14:57.551942-04', 5);
INSERT INTO watches VALUES (35, 122, '2016-04-10 13:15:01.379091-04', 2);
INSERT INTO watches VALUES (35, 52, '2016-04-10 13:15:04.416481-04', 4);
INSERT INTO watches VALUES (35, 177, '2016-04-10 13:15:07.990045-04', 3);
INSERT INTO watches VALUES (35, 39, '2016-04-10 13:15:13.669108-04', 5);
INSERT INTO watches VALUES (35, 81, '2016-04-10 13:15:16.403193-04', 3);
INSERT INTO watches VALUES (35, 227, '2016-04-10 13:15:21.663151-04', 4);
INSERT INTO watches VALUES (35, 148, '2016-04-10 13:15:24.029204-04', 4);
INSERT INTO watches VALUES (35, 133, '2016-04-10 13:15:27.241327-04', 3);
INSERT INTO watches VALUES (35, 34, '2016-04-10 13:15:32.270046-04', 5);
INSERT INTO watches VALUES (34, 83, '2016-04-10 13:16:48.253237-04', 5);
INSERT INTO watches VALUES (34, 35, '2016-04-10 13:16:50.064238-04', NULL);
INSERT INTO watches VALUES (34, 187, '2016-04-10 13:16:52.346164-04', 3);
INSERT INTO watches VALUES (34, 57, '2016-04-10 13:16:56.353639-04', 4);
INSERT INTO watches VALUES (34, 3, '2016-04-10 13:17:01.915017-04', 5);
INSERT INTO watches VALUES (34, 41, '2016-04-10 13:17:05.805275-04', 4);
INSERT INTO watches VALUES (34, 122, '2016-04-10 13:17:08.206101-04', 2);
INSERT INTO watches VALUES (34, 65, '2016-04-10 13:17:10.628623-04', 3);
INSERT INTO watches VALUES (34, 94, '2016-04-10 13:17:22.294775-04', 4);
INSERT INTO watches VALUES (34, 188, '2016-04-10 13:17:24.423051-04', 2);
INSERT INTO watches VALUES (34, 61, '2016-04-10 13:17:26.690974-04', 3);
INSERT INTO watches VALUES (34, 114, '2016-04-10 13:17:29.373759-04', 3);
INSERT INTO watches VALUES (34, 34, '2016-04-10 13:17:33.275478-04', 5);
INSERT INTO watches VALUES (34, 210, '2016-04-10 13:17:38.313198-04', 4);
INSERT INTO watches VALUES (34, 158, '2016-04-10 13:17:41.483157-04', 3);
INSERT INTO watches VALUES (34, 166, '2016-04-10 13:17:56.653391-04', 4);
INSERT INTO watches VALUES (34, 142, '2016-04-10 13:18:08.5063-04', 2);
INSERT INTO watches VALUES (34, 240, '2016-04-10 13:18:10.855805-04', 2);
INSERT INTO watches VALUES (34, 29, '2016-04-10 13:18:16.147279-04', 5);
INSERT INTO watches VALUES (34, 87, '2016-04-10 13:18:19.538279-04', 3);
INSERT INTO watches VALUES (35, 65, '2016-04-10 13:19:57.538023-04', 3);
INSERT INTO watches VALUES (35, 66, '2016-04-10 13:20:00.968665-04', 1);
INSERT INTO watches VALUES (41, 3, '2016-04-10 13:20:22.717371-04', 4);
INSERT INTO watches VALUES (41, 25, '2016-04-10 13:20:24.70879-04', 4);
INSERT INTO watches VALUES (41, 28, '2016-04-10 13:20:31.355702-04', 4);
INSERT INTO watches VALUES (41, 2, '2016-04-10 13:20:33.954958-04', 5);
INSERT INTO watches VALUES (41, 157, '2016-04-10 13:20:36.534576-04', 4);
INSERT INTO watches VALUES (41, 84, '2016-04-10 13:20:38.893837-04', 4);
INSERT INTO watches VALUES (41, 41, '2016-04-10 13:20:41.487644-04', 4);
INSERT INTO watches VALUES (70, 135, '2016-04-07 00:00:00-04', 3);
INSERT INTO watches VALUES (41, 1, '2016-04-10 13:20:44.042945-04', 5);
INSERT INTO watches VALUES (41, 54, '2016-04-10 13:20:46.68673-04', 3);
INSERT INTO watches VALUES (41, 52, '2016-04-10 13:20:49.869186-04', 3);
INSERT INTO watches VALUES (41, 10, '2016-04-10 13:20:54.948125-04', 5);
INSERT INTO watches VALUES (41, 105, '2016-04-10 13:20:56.987504-04', 3);
INSERT INTO watches VALUES (41, 22, '2016-04-10 13:20:59.086721-04', 4);
INSERT INTO watches VALUES (41, 60, '2016-04-10 13:21:01.552914-04', 4);
INSERT INTO watches VALUES (41, 242, '2016-04-10 13:21:04.029995-04', 2);
INSERT INTO watches VALUES (41, 211, '2016-04-10 13:21:08.664432-04', 3);
INSERT INTO watches VALUES (41, 72, '2016-04-10 13:21:19.582565-04', 5);
INSERT INTO watches VALUES (41, 219, '2016-04-10 13:21:20.802191-04', NULL);
INSERT INTO watches VALUES (41, 121, '2016-04-10 13:21:23.166462-04', NULL);
INSERT INTO watches VALUES (41, 70, '2016-04-10 13:21:24.245635-04', NULL);
INSERT INTO watches VALUES (41, 35, '2016-04-10 13:33:51.080245-04', NULL);
INSERT INTO watches VALUES (41, 40, '2016-04-10 13:33:54.241238-04', 4);
INSERT INTO watches VALUES (47, 72, '2016-04-10 13:35:40.007341-04', 4);
INSERT INTO watches VALUES (47, 186, '2016-04-10 13:35:43.446484-04', 3);
INSERT INTO watches VALUES (47, 242, '2016-04-10 13:35:45.608538-04', 1);
INSERT INTO watches VALUES (47, 6, '2016-04-10 13:35:48.20555-04', 5);
INSERT INTO watches VALUES (47, 134, '2016-04-10 13:35:50.30844-04', 2);
INSERT INTO watches VALUES (47, 106, '2016-04-10 13:35:57.246656-04', NULL);
INSERT INTO watches VALUES (47, 23, '2016-04-10 13:36:08.374753-04', 4);
INSERT INTO watches VALUES (47, 149, '2016-04-10 13:36:11.360385-04', 5);
INSERT INTO watches VALUES (47, 189, '2016-04-10 13:36:13.658336-04', 3);
INSERT INTO watches VALUES (47, 169, '2016-04-10 13:36:15.873268-04', 4);
INSERT INTO watches VALUES (47, 47, '2016-04-10 13:36:19.430259-04', 5);
INSERT INTO watches VALUES (47, 245, '2016-04-10 13:36:21.543351-04', 5);
INSERT INTO watches VALUES (47, 142, '2016-04-10 13:36:30.411949-04', 1);
INSERT INTO watches VALUES (47, 83, '2016-04-10 13:36:35.110458-04', 4);
INSERT INTO watches VALUES (47, 1, '2016-04-10 13:36:38.835575-04', 5);
INSERT INTO watches VALUES (47, 73, '2016-04-10 13:36:44.926221-04', 5);
INSERT INTO watches VALUES (47, 39, '2016-04-10 13:36:49.582833-04', 4);
INSERT INTO watches VALUES (47, 34, '2016-04-10 13:36:53.437502-04', 5);
INSERT INTO watches VALUES (47, 10, '2016-04-10 13:36:57.237122-04', 5);
INSERT INTO watches VALUES (47, 231, '2016-04-10 13:37:00.885734-04', NULL);
INSERT INTO watches VALUES (47, 114, '2016-04-10 13:37:02.988971-04', NULL);
INSERT INTO watches VALUES (47, 203, '2016-04-10 13:37:05.740909-04', 3);
INSERT INTO watches VALUES (47, 227, '2016-04-10 13:37:10.008344-04', 2);
INSERT INTO watches VALUES (47, 229, '2016-04-10 13:38:45.839129-04', 3);
INSERT INTO watches VALUES (47, 31, '2016-04-10 13:39:36.593216-04', 5);
INSERT INTO watches VALUES (47, 110, '2016-04-10 13:39:41.47783-04', 4);
INSERT INTO watches VALUES (48, 31, '2016-04-10 13:41:12.286639-04', 4);
INSERT INTO watches VALUES (48, 164, '2016-04-10 13:41:14.855395-04', 4);
INSERT INTO watches VALUES (48, 17, '2016-04-10 13:41:17.345257-04', 5);
INSERT INTO watches VALUES (48, 61, '2016-04-10 13:41:20.240894-04', 4);
INSERT INTO watches VALUES (48, 34, '2016-04-10 13:41:22.362566-04', 5);
INSERT INTO watches VALUES (48, 73, '2016-04-10 13:41:27.967916-04', 5);
INSERT INTO watches VALUES (48, 1, '2016-04-10 13:41:31.247922-04', 4);
INSERT INTO watches VALUES (48, 83, '2016-04-10 13:41:35.333205-04', 5);
INSERT INTO watches VALUES (48, 210, '2016-04-10 13:41:42.189366-04', 2);
INSERT INTO watches VALUES (48, 202, '2016-04-10 13:41:45.192509-04', 2);
INSERT INTO watches VALUES (48, 148, '2016-04-10 13:41:47.640054-04', 4);
INSERT INTO watches VALUES (48, 153, '2016-04-10 13:41:50.376479-04', 4);
INSERT INTO watches VALUES (48, 165, '2016-04-10 13:41:51.504989-04', NULL);
INSERT INTO watches VALUES (48, 81, '2016-04-10 13:41:52.832754-04', NULL);
INSERT INTO watches VALUES (48, 36, '2016-04-10 13:41:55.169133-04', 4);
INSERT INTO watches VALUES (48, 39, '2016-04-10 13:42:00.549925-04', 5);
INSERT INTO watches VALUES (48, 129, '2016-04-10 13:42:04.680644-04', 3);
INSERT INTO watches VALUES (54, 73, '2016-04-10 13:47:31.311762-04', 5);
INSERT INTO watches VALUES (54, 83, '2016-04-10 13:47:35.062398-04', 5);
INSERT INTO watches VALUES (54, 34, '2016-04-10 13:47:40.964731-04', 5);
INSERT INTO watches VALUES (54, 165, '2016-04-10 13:47:43.339663-04', 2);
INSERT INTO watches VALUES (54, 192, '2016-04-10 13:47:45.083249-04', NULL);
INSERT INTO watches VALUES (54, 213, '2016-04-10 13:47:50.150944-04', 4);
INSERT INTO watches VALUES (54, 232, '2016-04-10 13:48:11.435947-04', 3);
INSERT INTO watches VALUES (54, 39, '2016-04-10 13:48:13.951816-04', 5);
INSERT INTO watches VALUES (54, 61, '2016-04-10 13:48:15.877421-04', 4);
INSERT INTO watches VALUES (54, 32, '2016-04-10 13:48:17.656991-04', 2);
INSERT INTO watches VALUES (54, 1, '2016-04-10 13:48:21.805794-04', 5);
INSERT INTO watches VALUES (54, 15, '2016-04-10 13:48:25.261296-04', 5);
INSERT INTO watches VALUES (54, 5, '2016-04-10 13:48:30.782243-04', 5);
INSERT INTO watches VALUES (54, 22, '2016-04-10 13:48:38.181751-04', NULL);
INSERT INTO watches VALUES (54, 164, '2016-04-10 13:48:40.789257-04', 2);
INSERT INTO watches VALUES (71, 5, '2016-04-10 14:05:11.227463-04', 5);
INSERT INTO watches VALUES (71, 194, '2016-04-10 14:06:55.413568-04', 5);
INSERT INTO watches VALUES (71, 166, '2016-04-10 14:16:00.783309-04', 4);
INSERT INTO watches VALUES (71, 139, '2016-04-10 14:22:24.891166-04', 5);
INSERT INTO watches VALUES (71, 134, '2016-04-10 14:23:32.21383-04', 3);
INSERT INTO watches VALUES (71, 42, '2016-04-10 14:23:47.787536-04', 4);
INSERT INTO watches VALUES (71, 14, '2016-04-10 14:23:53.796125-04', 5);
INSERT INTO watches VALUES (71, 226, '2016-04-10 14:23:57.61254-04', 4);
INSERT INTO watches VALUES (69, 126, '2016-04-10 14:40:48.251548-04', 3);
INSERT INTO watches VALUES (69, 6, '2016-04-10 14:40:50.900911-04', 5);
INSERT INTO watches VALUES (69, 97, '2016-04-10 14:40:57.287988-04', 5);
INSERT INTO watches VALUES (69, 116, '2016-04-10 14:41:07.341269-04', 5);
INSERT INTO watches VALUES (69, 176, '2016-04-10 14:41:20.323204-04', 5);
INSERT INTO watches VALUES (69, 172, '2016-04-10 14:41:41.177396-04', 3);
INSERT INTO watches VALUES (69, 49, '2016-04-10 14:41:53.089076-04', 4);
INSERT INTO watches VALUES (21, 173, '2016-04-10 14:46:42.873974-04', 1);
INSERT INTO watches VALUES (21, 224, '2016-04-10 14:46:47.827882-04', 3);
INSERT INTO watches VALUES (41, 168, '2016-04-10 13:21:21.92236-04', 3);
INSERT INTO watches VALUES (23, 31, '2016-04-10 14:59:23.147456-04', 5);
INSERT INTO watches VALUES (23, 220, '2016-04-10 14:59:27.898144-04', 2);
INSERT INTO watches VALUES (23, 77, '2016-04-10 14:59:35.678452-04', 3);
INSERT INTO watches VALUES (23, 228, '2016-04-10 14:59:40.164946-04', 5);
INSERT INTO watches VALUES (23, 221, '2016-04-10 14:59:51.700856-04', 1);
INSERT INTO watches VALUES (23, 149, '2016-04-10 14:59:57.543729-04', 3);
INSERT INTO watches VALUES (23, 178, '2016-04-10 15:00:02.641035-04', 4);
INSERT INTO watches VALUES (23, 148, '2016-04-10 15:00:22.069129-04', 3);
INSERT INTO watches VALUES (23, 99, '2016-04-10 15:00:30.564581-04', NULL);
INSERT INTO watches VALUES (24, 245, '2016-04-10 15:02:13.962524-04', 1);
INSERT INTO watches VALUES (24, 189, '2016-04-10 15:02:16.622251-04', 3);
INSERT INTO watches VALUES (24, 169, '2016-04-10 15:02:19.653766-04', 5);
INSERT INTO watches VALUES (24, 166, '2016-04-10 15:02:23.950949-04', 1);
INSERT INTO watches VALUES (24, 171, '2016-04-10 15:02:30.160503-04', 5);
INSERT INTO watches VALUES (24, 25, '2016-04-10 15:02:35.974988-04', 5);
INSERT INTO watches VALUES (24, 83, '2016-04-10 15:02:38.082766-04', NULL);
INSERT INTO watches VALUES (24, 35, '2016-04-10 15:02:39.547383-04', NULL);
INSERT INTO watches VALUES (25, 128, '2016-04-10 15:04:13.956096-04', 3);
INSERT INTO watches VALUES (25, 96, '2016-04-10 15:04:19.437254-04', 4);
INSERT INTO watches VALUES (25, 62, '2016-04-10 15:04:27.939854-04', NULL);
INSERT INTO watches VALUES (25, 129, '2016-04-10 15:04:30.770462-04', 4);
INSERT INTO watches VALUES (25, 127, '2016-04-10 15:04:47.798194-04', 4);
INSERT INTO watches VALUES (25, 94, '2016-04-10 15:04:50.417497-04', NULL);
INSERT INTO watches VALUES (25, 165, '2016-04-10 15:04:52.090482-04', NULL);
INSERT INTO watches VALUES (25, 113, '2016-04-10 15:04:54.769596-04', 1);
INSERT INTO watches VALUES (25, 212, '2016-04-10 15:05:01.433611-04', 4);
INSERT INTO watches VALUES (26, 57, '2016-04-10 15:06:23.827468-04', 5);
INSERT INTO watches VALUES (26, 67, '2016-04-10 15:06:33.360992-04', 2);
INSERT INTO watches VALUES (26, 213, '2016-04-10 15:06:37.577451-04', 2);
INSERT INTO watches VALUES (26, 192, '2016-04-10 15:06:39.730089-04', 5);
INSERT INTO watches VALUES (26, 154, '2016-04-10 15:06:43.140246-04', 4);
INSERT INTO watches VALUES (26, 27, '2016-04-10 15:06:52.740216-04', 3);
INSERT INTO watches VALUES (26, 117, '2016-04-10 15:07:00.95642-04', 5);
INSERT INTO watches VALUES (26, 25, '2016-04-10 15:07:03.774727-04', 1);
INSERT INTO watches VALUES (26, 100, '2016-04-10 15:07:10.200368-04', 1);
INSERT INTO watches VALUES (26, 239, '2016-04-10 15:07:18.69838-04', 3);
INSERT INTO watches VALUES (27, 19, '2016-04-10 15:09:20.043904-04', 3);
INSERT INTO watches VALUES (27, 12, '2016-04-10 15:09:22.664798-04', 4);
INSERT INTO watches VALUES (27, 145, '2016-04-10 15:09:27.709497-04', 5);
INSERT INTO watches VALUES (27, 185, '2016-04-10 15:09:35.698055-04', 1);
INSERT INTO watches VALUES (27, 140, '2016-04-10 15:09:39.382848-04', 2);
INSERT INTO watches VALUES (27, 155, '2016-04-10 15:09:44.954067-04', 5);
INSERT INTO watches VALUES (27, 223, '2016-04-10 15:09:47.519997-04', 3);
INSERT INTO watches VALUES (27, 93, '2016-04-10 15:10:00.156902-04', 4);
INSERT INTO watches VALUES (27, 142, '2016-04-10 15:10:09.930541-04', 3);
INSERT INTO watches VALUES (70, 116, '2016-04-10 15:11:50.894808-04', 3);
INSERT INTO watches VALUES (28, 136, '2016-04-10 15:11:52.065195-04', 3);
INSERT INTO watches VALUES (28, 66, '2016-04-10 15:11:55.082288-04', 5);
INSERT INTO watches VALUES (28, 100, '2016-04-10 15:11:57.652793-04', 5);
INSERT INTO watches VALUES (70, 117, '2016-04-10 15:11:57.716457-04', 4);
INSERT INTO watches VALUES (28, 52, '2016-04-10 15:12:00.192023-04', 2);
INSERT INTO watches VALUES (70, 97, '2016-04-10 15:12:02.033692-04', 4);
INSERT INTO watches VALUES (28, 160, '2016-04-10 15:12:03.23754-04', 2);
INSERT INTO watches VALUES (28, 84, '2016-04-10 15:12:05.838209-04', 3);
INSERT INTO watches VALUES (70, 194, '2016-04-10 15:12:05.942915-04', 4);
INSERT INTO watches VALUES (28, 2, '2016-04-10 15:12:09.673871-04', 5);
INSERT INTO watches VALUES (70, 145, '2016-04-10 15:12:09.767265-04', 2);
INSERT INTO watches VALUES (28, 118, '2016-04-10 15:12:13.428704-04', 2);
INSERT INTO watches VALUES (70, 171, '2016-04-10 15:12:14.605673-04', 3);
INSERT INTO watches VALUES (28, 244, '2016-04-10 15:12:17.006175-04', NULL);
INSERT INTO watches VALUES (28, 117, '2016-04-10 15:12:19.526336-04', NULL);
INSERT INTO watches VALUES (28, 54, '2016-04-10 15:12:21.791993-04', NULL);
INSERT INTO watches VALUES (70, 14, '2016-04-10 15:12:22.72146-04', 3);
INSERT INTO watches VALUES (70, 139, '2016-04-10 15:12:28.648838-04', 3);
INSERT INTO watches VALUES (70, 155, '2016-04-10 15:12:42.263052-04', 2);
INSERT INTO watches VALUES (70, 228, '2016-04-10 15:12:54.698562-04', 1);
INSERT INTO watches VALUES (70, 176, '2016-04-10 15:13:02.687799-04', 4);
INSERT INTO watches VALUES (29, 167, '2016-04-10 15:13:58.209356-04', 1);
INSERT INTO watches VALUES (29, 22, '2016-04-10 15:14:00.816586-04', 2);
INSERT INTO watches VALUES (29, 174, '2016-04-10 15:14:06.935954-04', 4);
INSERT INTO watches VALUES (29, 181, '2016-04-10 15:14:09.357056-04', 1);
INSERT INTO watches VALUES (29, 229, '2016-04-10 15:14:11.590207-04', 2);
INSERT INTO watches VALUES (29, 17, '2016-04-10 15:14:14.715217-04', 5);
INSERT INTO watches VALUES (29, 120, '2016-04-10 15:14:16.651438-04', NULL);
INSERT INTO watches VALUES (29, 126, '2016-04-10 15:14:19.876815-04', 3);
INSERT INTO watches VALUES (30, 73, '2016-04-10 15:17:12.108298-04', 4);
INSERT INTO watches VALUES (30, 191, '2016-04-10 15:17:15.025002-04', 3);
INSERT INTO watches VALUES (30, 32, '2016-04-10 15:17:17.869314-04', 5);
INSERT INTO watches VALUES (30, 131, '2016-04-10 15:17:23.456008-04', 5);
INSERT INTO watches VALUES (30, 151, '2016-04-10 15:17:27.007488-04', 5);
INSERT INTO watches VALUES (30, 196, '2016-04-10 15:17:33.74933-04', 5);
INSERT INTO watches VALUES (30, 129, '2016-04-10 15:17:35.875202-04', NULL);
INSERT INTO watches VALUES (30, 223, '2016-04-10 15:17:37.558302-04', NULL);
INSERT INTO watches VALUES (31, 245, '2016-04-10 15:19:10.748691-04', 5);
INSERT INTO watches VALUES (31, 169, '2016-04-10 15:19:13.334562-04', 5);
INSERT INTO watches VALUES (31, 189, '2016-04-10 15:19:15.709675-04', 5);
INSERT INTO watches VALUES (31, 149, '2016-04-10 15:19:19.844934-04', 5);
INSERT INTO watches VALUES (31, 221, '2016-04-10 15:19:24.823691-04', 1);
INSERT INTO watches VALUES (31, 144, '2016-04-10 15:19:30.887956-04', 5);
INSERT INTO watches VALUES (31, 92, '2016-04-10 15:19:35.158481-04', 4);
INSERT INTO watches VALUES (31, 151, '2016-04-10 15:19:51.043923-04', 1);
INSERT INTO watches VALUES (32, 136, '2016-04-10 15:21:55.369959-04', 4);
INSERT INTO watches VALUES (32, 53, '2016-04-10 15:21:58.147234-04', 4);
INSERT INTO watches VALUES (32, 193, '2016-04-10 15:22:05.127409-04', 5);
INSERT INTO watches VALUES (32, 104, '2016-04-10 15:22:08.193801-04', 3);
INSERT INTO watches VALUES (32, 106, '2016-04-10 15:22:15.938223-04', 5);
INSERT INTO watches VALUES (32, 97, '2016-04-10 15:22:19.374364-04', 5);
INSERT INTO watches VALUES (32, 18, '2016-04-10 15:22:21.337678-04', NULL);
INSERT INTO watches VALUES (32, 216, '2016-04-10 15:22:22.774133-04', NULL);
INSERT INTO watches VALUES (32, 115, '2016-04-10 15:22:24.648413-04', 4);
INSERT INTO watches VALUES (32, 237, '2016-04-10 15:22:26.618032-04', 2);
INSERT INTO watches VALUES (32, 132, '2016-04-10 15:22:29.086087-04', 4);
INSERT INTO watches VALUES (32, 103, '2016-04-10 15:22:31.373949-04', 2);
INSERT INTO watches VALUES (32, 50, '2016-04-10 15:22:37.925425-04', 3);
INSERT INTO watches VALUES (32, 152, '2016-04-10 15:22:39.862163-04', 4);
INSERT INTO watches VALUES (33, 29, '2016-04-10 15:24:39.286534-04', 3);
INSERT INTO watches VALUES (33, 176, '2016-04-10 15:25:00.106884-04', 5);
INSERT INTO watches VALUES (33, 84, '2016-04-10 15:25:05.962868-04', 3);
INSERT INTO watches VALUES (33, 87, '2016-04-10 15:25:11.227928-04', 5);
INSERT INTO watches VALUES (33, 80, '2016-04-10 15:25:15.57905-04', 3);
INSERT INTO watches VALUES (33, 44, '2016-04-10 15:25:19.203589-04', 4);
INSERT INTO watches VALUES (33, 20, '2016-04-10 15:25:23.381033-04', 2);
INSERT INTO watches VALUES (33, 241, '2016-04-10 15:25:27.108472-04', 3);
INSERT INTO watches VALUES (33, 35, '2016-04-10 15:25:35.964781-04', 1);
INSERT INTO watches VALUES (36, 76, '2016-04-10 15:26:42.727822-04', 4);
INSERT INTO watches VALUES (36, 74, '2016-04-10 15:26:45.767275-04', NULL);
INSERT INTO watches VALUES (36, 111, '2016-04-10 15:26:47.371858-04', 4);
INSERT INTO watches VALUES (36, 152, '2016-04-10 15:26:49.88506-04', 1);
INSERT INTO watches VALUES (36, 183, '2016-04-10 15:26:52.031986-04', 3);
INSERT INTO watches VALUES (36, 199, '2016-04-10 15:26:53.865754-04', 3);
INSERT INTO watches VALUES (36, 247, '2016-04-10 15:26:55.810406-04', 3);
INSERT INTO watches VALUES (36, 21, '2016-04-10 15:26:59.998449-04', 3);
INSERT INTO watches VALUES (36, 208, '2016-04-10 15:26:44.419914-04', 1);
INSERT INTO watches VALUES (36, 209, '2016-04-10 15:27:06.709362-04', 5);
INSERT INTO watches VALUES (37, 215, '2016-04-10 15:29:11.326461-04', 4);
INSERT INTO watches VALUES (37, 130, '2016-04-10 15:29:13.963854-04', 2);
INSERT INTO watches VALUES (37, 162, '2016-04-10 15:29:16.14314-04', 5);
INSERT INTO watches VALUES (37, 33, '2016-04-10 15:29:21.837005-04', 5);
INSERT INTO watches VALUES (37, 51, '2016-04-10 15:29:29.950102-04', 4);
INSERT INTO watches VALUES (37, 100, '2016-04-10 15:29:46.052621-04', 5);
INSERT INTO watches VALUES (37, 54, '2016-04-10 15:29:49.395543-04', 5);
INSERT INTO watches VALUES (38, 33, '2016-04-10 15:30:56.245003-04', 4);
INSERT INTO watches VALUES (38, 166, '2016-04-10 15:31:00.471195-04', 4);
INSERT INTO watches VALUES (38, 131, '2016-04-10 15:31:09.189226-04', 2);
INSERT INTO watches VALUES (38, 16, '2016-04-10 15:31:15.279995-04', 4);
INSERT INTO watches VALUES (38, 95, '2016-04-10 15:31:17.904627-04', 3);
INSERT INTO watches VALUES (38, 154, '2016-04-10 15:31:20.557829-04', 5);
INSERT INTO watches VALUES (38, 153, '2016-04-10 15:31:22.849879-04', 1);
INSERT INTO watches VALUES (39, 235, '2016-04-10 15:32:45.798251-04', 4);
INSERT INTO watches VALUES (39, 173, '2016-04-10 15:32:47.970085-04', 5);
INSERT INTO watches VALUES (39, 194, '2016-04-10 15:32:52.822834-04', 5);
INSERT INTO watches VALUES (39, 218, '2016-04-10 15:32:55.076681-04', 2);
INSERT INTO watches VALUES (39, 96, '2016-04-10 15:32:58.311988-04', 4);
INSERT INTO watches VALUES (39, 150, '2016-04-10 15:33:02.391847-04', 3);
INSERT INTO watches VALUES (40, 197, '2016-04-10 15:34:34.534719-04', 4);
INSERT INTO watches VALUES (40, 152, '2016-04-10 15:34:36.818425-04', 4);
INSERT INTO watches VALUES (40, 209, '2016-04-10 15:34:38.734661-04', 5);
INSERT INTO watches VALUES (40, 111, '2016-04-10 15:34:40.461048-04', 2);
INSERT INTO watches VALUES (40, 233, '2016-04-10 15:34:42.03528-04', 4);
INSERT INTO watches VALUES (40, 13, '2016-04-10 15:34:43.514997-04', 4);
INSERT INTO watches VALUES (40, 21, '2016-04-10 15:34:45.407787-04', 3);
INSERT INTO watches VALUES (40, 90, '2016-04-10 15:34:48.013026-04', 1);
INSERT INTO watches VALUES (40, 125, '2016-04-10 15:35:04.597157-04', 5);
INSERT INTO watches VALUES (40, 68, '2016-04-10 15:35:06.082737-04', NULL);
INSERT INTO watches VALUES (40, 31, '2016-04-10 15:35:07.018796-04', NULL);
INSERT INTO watches VALUES (40, 60, '2016-04-10 15:35:09.719841-04', NULL);
INSERT INTO watches VALUES (40, 14, '2016-04-10 15:35:12.082176-04', 1);
INSERT INTO watches VALUES (42, 48, '2016-04-10 15:36:28.741098-04', 4);
INSERT INTO watches VALUES (42, 186, '2016-04-10 15:36:32.430693-04', 1);
INSERT INTO watches VALUES (42, 112, '2016-04-10 15:36:36.194564-04', 5);
INSERT INTO watches VALUES (42, 4, '2016-04-10 15:36:37.948951-04', 1);
INSERT INTO watches VALUES (42, 249, '2016-04-10 15:36:41.723988-04', 4);
INSERT INTO watches VALUES (42, 79, '2016-04-10 15:36:46.305322-04', 4);
INSERT INTO watches VALUES (42, 12, '2016-04-10 15:36:51.466168-04', 5);
INSERT INTO watches VALUES (42, 108, '2016-04-10 15:36:59.326396-04', 5);
INSERT INTO watches VALUES (70, 162, '2016-04-10 15:37:33.959018-04', 1);
INSERT INTO watches VALUES (70, 209, '2016-04-10 15:37:42.466469-04', 1);
INSERT INTO watches VALUES (70, 125, '2016-04-10 15:37:47.120353-04', 1);
INSERT INTO watches VALUES (70, 106, '2016-04-10 15:37:54.348157-04', 2);
INSERT INTO watches VALUES (70, 112, '2016-04-10 15:38:05.984778-04', 2);
INSERT INTO watches VALUES (70, 196, '2016-04-10 15:38:10.225539-04', 2);
INSERT INTO watches VALUES (70, 108, '2016-04-10 15:38:17.687077-04', 3);
INSERT INTO watches VALUES (70, 144, '2016-04-10 15:38:22.538242-04', 4);
INSERT INTO watches VALUES (43, 146, '2016-04-10 15:38:55.560803-04', 5);
INSERT INTO watches VALUES (43, 145, '2016-04-10 15:39:06.551939-04', 5);
INSERT INTO watches VALUES (43, 72, '2016-04-10 15:39:08.745272-04', 4);
INSERT INTO watches VALUES (43, 48, '2016-04-10 15:39:11.362343-04', 2);
INSERT INTO watches VALUES (43, 121, '2016-04-10 15:39:18.779851-04', 5);
INSERT INTO watches VALUES (43, 126, '2016-04-10 15:39:23.145751-04', 5);
INSERT INTO watches VALUES (44, 71, '2016-04-10 15:40:53.090031-04', 4);
INSERT INTO watches VALUES (44, 200, '2016-04-10 15:40:59.043957-04', 3);
INSERT INTO watches VALUES (44, 61, '2016-04-10 15:41:02.360103-04', 5);
INSERT INTO watches VALUES (44, 172, '2016-04-10 15:41:11.423689-04', 5);
INSERT INTO watches VALUES (44, 211, '2016-04-10 15:41:16.54845-04', 1);
INSERT INTO watches VALUES (44, 86, '2016-04-10 15:41:19.943381-04', 5);
INSERT INTO watches VALUES (44, 161, '2016-04-10 15:41:27.655937-04', 4);
INSERT INTO watches VALUES (45, 114, '2016-04-10 15:43:33.227738-04', 5);
INSERT INTO watches VALUES (45, 158, '2016-04-10 15:43:35.834603-04', 5);
INSERT INTO watches VALUES (45, 36, '2016-04-10 15:43:38.157574-04', 1);
INSERT INTO watches VALUES (45, 205, '2016-04-10 15:43:40.1533-04', 5);
INSERT INTO watches VALUES (45, 232, '2016-04-10 15:43:42.974334-04', 5);
INSERT INTO watches VALUES (45, 68, '2016-04-10 15:43:52.448562-04', 5);
INSERT INTO watches VALUES (45, 109, '2016-04-10 15:43:55.485357-04', 5);
INSERT INTO watches VALUES (46, 88, '2016-04-10 15:46:05.764946-04', 5);
INSERT INTO watches VALUES (46, 171, '2016-04-10 15:46:07.898171-04', 2);
INSERT INTO watches VALUES (46, 77, '2016-04-10 15:46:11.9178-04', 5);
INSERT INTO watches VALUES (46, 159, '2016-04-10 15:46:22.277253-04', 5);
INSERT INTO watches VALUES (46, 219, '2016-04-10 15:46:31.344831-04', 5);
INSERT INTO watches VALUES (46, 242, '2016-04-10 15:46:34.911745-04', 5);
INSERT INTO watches VALUES (46, 86, '2016-04-10 15:46:38.043696-04', 3);
INSERT INTO watches VALUES (46, 163, '2016-04-10 15:46:40.683571-04', 5);
INSERT INTO watches VALUES (46, 70, '2016-04-10 15:46:51.707529-04', 5);
INSERT INTO watches VALUES (46, 108, '2016-04-10 15:46:53.90258-04', NULL);
INSERT INTO watches VALUES (46, 19, '2016-04-10 15:46:57.219326-04', NULL);
INSERT INTO watches VALUES (46, 79, '2016-04-10 15:46:55.04319-04', 5);
INSERT INTO watches VALUES (49, 35, '2016-04-10 15:49:26.540116-04', 5);
INSERT INTO watches VALUES (49, 123, '2016-04-10 15:49:31.007111-04', 4);
INSERT INTO watches VALUES (49, 50, '2016-04-10 15:49:32.657781-04', 2);
INSERT INTO watches VALUES (49, 216, '2016-04-10 15:49:34.980071-04', 2);
INSERT INTO watches VALUES (49, 233, '2016-04-10 15:49:38.050999-04', 5);
INSERT INTO watches VALUES (49, 199, '2016-04-10 15:49:40.594324-04', 1);
INSERT INTO watches VALUES (49, 21, '2016-04-10 15:49:42.961901-04', 5);
INSERT INTO watches VALUES (49, 45, '2016-04-10 15:49:45.185035-04', 2);
INSERT INTO watches VALUES (49, 208, '2016-04-10 15:49:46.777302-04', 3);
INSERT INTO watches VALUES (49, 243, '2016-04-10 15:49:48.157163-04', 1);
INSERT INTO watches VALUES (49, 13, '2016-04-10 15:49:52.953328-04', 2);
INSERT INTO watches VALUES (49, 237, '2016-04-10 15:49:54.665882-04', 4);
INSERT INTO watches VALUES (50, 59, '2016-04-10 15:50:51.263076-04', 5);
INSERT INTO watches VALUES (50, 224, '2016-04-10 15:50:53.402108-04', 5);
INSERT INTO watches VALUES (50, 215, '2016-04-10 15:50:56.578971-04', 3);
INSERT INTO watches VALUES (50, 102, '2016-04-10 15:50:59.990976-04', 5);
INSERT INTO watches VALUES (50, 171, '2016-04-10 15:51:04.695223-04', 3);
INSERT INTO watches VALUES (50, 142, '2016-04-10 15:51:08.457579-04', 3);
INSERT INTO watches VALUES (50, 54, '2016-04-10 15:51:13.549235-04', 5);
INSERT INTO watches VALUES (50, 66, '2016-04-10 15:51:16.063946-04', 5);
INSERT INTO watches VALUES (50, 118, '2016-04-10 15:51:18.227911-04', 5);
INSERT INTO watches VALUES (51, 49, '2016-04-10 15:52:39.094541-04', 5);
INSERT INTO watches VALUES (51, 201, '2016-04-10 15:52:42.42485-04', 1);
INSERT INTO watches VALUES (51, 46, '2016-04-10 15:52:45.010331-04', 5);
INSERT INTO watches VALUES (51, 172, '2016-04-10 15:52:46.630981-04', 3);
INSERT INTO watches VALUES (51, 38, '2016-04-10 15:52:50.641176-04', 3);
INSERT INTO watches VALUES (51, 56, '2016-04-10 15:52:57.323922-04', 3);
INSERT INTO watches VALUES (51, 21, '2016-04-10 15:53:00.226257-04', 5);
INSERT INTO watches VALUES (51, 115, '2016-04-10 15:53:03.298713-04', 2);
INSERT INTO watches VALUES (51, 197, '2016-04-10 15:53:05.472163-04', 3);
INSERT INTO watches VALUES (51, 230, '2016-04-10 15:53:08.154629-04', 1);
INSERT INTO watches VALUES (51, 238, '2016-04-10 15:53:10.722154-04', 3);
INSERT INTO watches VALUES (51, 243, '2016-04-10 15:53:12.63581-04', 3);
INSERT INTO watches VALUES (52, 46, '2016-04-10 15:53:36.181203-04', 1);
INSERT INTO watches VALUES (52, 156, '2016-04-10 15:54:46.461593-04', 5);
INSERT INTO watches VALUES (52, 63, '2016-04-10 15:54:50.051237-04', 3);
INSERT INTO watches VALUES (52, 211, '2016-04-10 15:54:52.928794-04', 5);
INSERT INTO watches VALUES (52, 12, '2016-04-10 15:54:55.884009-04', 3);
INSERT INTO watches VALUES (52, 219, '2016-04-10 15:55:00.132644-04', 3);
INSERT INTO watches VALUES (52, 21, '2016-04-10 15:55:05.414937-04', 5);
INSERT INTO watches VALUES (52, 184, '2016-04-10 15:55:07.250658-04', 3);
INSERT INTO watches VALUES (52, 179, '2016-04-10 15:55:09.333148-04', 5);
INSERT INTO watches VALUES (52, 246, '2016-04-10 15:55:22.746762-04', 5);
INSERT INTO watches VALUES (52, 76, '2016-04-10 15:55:25.715129-04', 2);
INSERT INTO watches VALUES (52, 123, '2016-04-10 15:55:27.287728-04', 5);
INSERT INTO watches VALUES (52, 190, '2016-04-10 15:55:28.749946-04', 1);
INSERT INTO watches VALUES (52, 115, '2016-04-10 15:55:30.481474-04', 3);
INSERT INTO watches VALUES (52, 74, '2016-04-10 15:55:35.803186-04', 4);
INSERT INTO watches VALUES (52, 13, '2016-04-10 15:55:38.013635-04', 4);
INSERT INTO watches VALUES (52, 209, '2016-04-10 15:55:42.243655-04', 1);
INSERT INTO watches VALUES (53, 156, '2016-04-10 15:55:59.348129-04', 2);
INSERT INTO watches VALUES (53, 163, '2016-04-10 15:56:02.699074-04', 4);
INSERT INTO watches VALUES (53, 83, '2016-04-10 15:56:09.013421-04', 3);
INSERT INTO watches VALUES (53, 59, '2016-04-10 15:56:15.651192-04', 1);
INSERT INTO watches VALUES (53, 109, '2016-04-10 15:56:19.83184-04', 4);
INSERT INTO watches VALUES (53, 246, '2016-04-10 15:56:24.046157-04', 1);
INSERT INTO watches VALUES (53, 88, '2016-04-10 15:56:27.783142-04', 4);
INSERT INTO watches VALUES (53, 5, '2016-04-10 15:56:36.21713-04', 5);
INSERT INTO watches VALUES (53, 87, '2016-04-10 15:56:43.88094-04', 3);
INSERT INTO watches VALUES (55, 179, '2016-04-10 15:57:02.280436-04', 3);
INSERT INTO watches VALUES (55, 247, '2016-04-10 15:57:04.7871-04', 1);
INSERT INTO watches VALUES (55, 132, '2016-04-10 15:57:07.129494-04', 1);
INSERT INTO watches VALUES (55, 152, '2016-04-10 15:57:09.069391-04', 5);
INSERT INTO watches VALUES (55, 184, '2016-04-10 15:57:11.390518-04', 3);
INSERT INTO watches VALUES (55, 87, '2016-04-10 15:57:26.697368-04', 2);
INSERT INTO watches VALUES (55, 80, '2016-04-10 15:57:33.702398-04', 4);
INSERT INTO watches VALUES (55, 26, '2016-04-10 15:57:44.831828-04', 5);
INSERT INTO watches VALUES (55, 11, '2016-04-10 15:57:48.42221-04', 5);
INSERT INTO watches VALUES (56, 101, '2016-04-10 15:58:28.575277-04', 4);
INSERT INTO watches VALUES (56, 82, '2016-04-10 15:58:32.245332-04', 4);
INSERT INTO watches VALUES (56, 206, '2016-04-10 15:58:35.67466-04', 3);
INSERT INTO watches VALUES (56, 7, '2016-04-10 15:58:38.350623-04', 5);
INSERT INTO watches VALUES (56, 222, '2016-04-10 15:58:40.57224-04', 5);
INSERT INTO watches VALUES (56, 89, '2016-04-10 15:58:43.90644-04', 4);
INSERT INTO watches VALUES (56, 150, '2016-04-10 15:58:47.341601-04', 4);
INSERT INTO watches VALUES (56, 180, '2016-04-10 15:58:50.067048-04', 5);
INSERT INTO watches VALUES (56, 75, '2016-04-10 15:58:53.556894-04', 5);
INSERT INTO watches VALUES (56, 15, '2016-04-10 15:58:57.876367-04', 3);
INSERT INTO watches VALUES (56, 135, '2016-04-10 15:59:02.171155-04', 5);
INSERT INTO watches VALUES (56, 55, '2016-04-10 15:59:06.109965-04', 3);
INSERT INTO watches VALUES (57, 204, '2016-04-10 16:00:50.816058-04', 4);
INSERT INTO watches VALUES (57, 114, '2016-04-10 16:00:52.792403-04', 2);
INSERT INTO watches VALUES (57, 198, '2016-04-10 16:00:54.770611-04', 5);
INSERT INTO watches VALUES (57, 16, '2016-04-10 16:00:56.627145-04', 3);
INSERT INTO watches VALUES (57, 62, '2016-04-10 16:00:59.107445-04', 3);
INSERT INTO watches VALUES (57, 209, '2016-04-10 16:01:01.515564-04', 5);
INSERT INTO watches VALUES (57, 246, '2016-04-10 16:01:03.378438-04', 2);
INSERT INTO watches VALUES (57, 152, '2016-04-10 16:01:05.177594-04', 2);
INSERT INTO watches VALUES (57, 123, '2016-04-10 16:01:07.526909-04', 5);
INSERT INTO watches VALUES (57, 243, '2016-04-10 16:01:09.497087-04', 1);
INSERT INTO watches VALUES (57, 38, '2016-04-10 16:01:14.071329-04', 4);
INSERT INTO watches VALUES (57, 112, '2016-04-10 16:01:17.187378-04', 2);
INSERT INTO watches VALUES (57, 181, '2016-04-10 16:01:28.900723-04', 4);
INSERT INTO watches VALUES (57, 37, '2016-04-10 16:01:34.756922-04', 5);
INSERT INTO watches VALUES (57, 91, '2016-04-10 16:01:40.379212-04', 5);
INSERT INTO watches VALUES (57, 107, '2016-04-10 16:01:50.993841-04', 5);
INSERT INTO watches VALUES (57, 174, '2016-04-10 16:02:02.686985-04', 3);
INSERT INTO watches VALUES (58, 60, '2016-04-10 16:02:37.294437-04', 2);
INSERT INTO watches VALUES (58, 93, '2016-04-10 16:02:41.21953-04', 3);
INSERT INTO watches VALUES (58, 195, '2016-04-10 16:02:48.291427-04', 5);
INSERT INTO watches VALUES (58, 43, '2016-04-10 16:02:50.92738-04', 5);
INSERT INTO watches VALUES (58, 10, '2016-04-10 16:02:53.792886-04', 5);
INSERT INTO watches VALUES (58, 26, '2016-04-10 16:02:56.676942-04', 5);
INSERT INTO watches VALUES (58, 124, '2016-04-10 16:02:59.326739-04', 3);
INSERT INTO watches VALUES (58, 31, '2016-04-10 16:03:02.424488-04', 5);
INSERT INTO watches VALUES (58, 97, '2016-04-10 16:03:04.785603-04', 5);
INSERT INTO watches VALUES (59, 134, '2016-04-10 16:04:02.1403-04', 3);
INSERT INTO watches VALUES (59, 46, '2016-04-10 16:04:07.274081-04', 5);
INSERT INTO watches VALUES (59, 49, '2016-04-10 16:04:10.055758-04', 5);
INSERT INTO watches VALUES (59, 27, '2016-04-10 16:04:12.707016-04', 4);
INSERT INTO watches VALUES (59, 120, '2016-04-10 16:04:18.511399-04', 5);
INSERT INTO watches VALUES (59, 125, '2016-04-10 16:04:21.012755-04', 2);
INSERT INTO watches VALUES (59, 195, '2016-04-10 16:04:23.734761-04', 5);
INSERT INTO watches VALUES (59, 226, '2016-04-10 16:04:26.720531-04', 4);
INSERT INTO watches VALUES (59, 119, '2016-04-10 16:04:30.900472-04', 4);
INSERT INTO watches VALUES (59, 167, '2016-04-10 16:04:35.561335-04', 5);
INSERT INTO watches VALUES (59, 11, '2016-04-10 16:04:38.517883-04', 5);
INSERT INTO watches VALUES (59, 214, '2016-04-10 16:04:42.521308-04', 3);
INSERT INTO watches VALUES (59, 197, '2016-04-10 16:04:44.919133-04', 4);
INSERT INTO watches VALUES (59, 56, '2016-04-10 16:04:47.019168-04', 2);
INSERT INTO watches VALUES (59, 233, '2016-04-10 16:04:49.64731-04', 1);
INSERT INTO watches VALUES (60, 78, '2016-04-10 16:07:48.34979-04', 4);
INSERT INTO watches VALUES (60, 128, '2016-04-10 16:07:50.664056-04', 5);
INSERT INTO watches VALUES (60, 240, '2016-04-10 16:07:52.982325-04', 4);
INSERT INTO watches VALUES (60, 234, '2016-04-10 16:07:56.649296-04', 1);
INSERT INTO watches VALUES (60, 239, '2016-04-10 16:07:58.915792-04', 4);
INSERT INTO watches VALUES (60, 71, '2016-04-10 16:08:01.916685-04', 5);
INSERT INTO watches VALUES (60, 33, '2016-04-10 16:08:07.602265-04', 5);
INSERT INTO watches VALUES (60, 166, '2016-04-10 16:08:10.582793-04', 3);
INSERT INTO watches VALUES (60, 144, '2016-04-10 16:08:13.080771-04', 4);
INSERT INTO watches VALUES (70, 198, '2016-04-10 16:08:14.31671-04', 2);
INSERT INTO watches VALUES (60, 23, '2016-04-10 16:08:16.30601-04', 5);
INSERT INTO watches VALUES (70, 70, '2016-04-10 16:08:18.039071-04', 1);
INSERT INTO watches VALUES (70, 222, '2016-04-10 16:08:21.713456-04', 2);
INSERT INTO watches VALUES (60, 169, '2016-04-10 16:08:22.273332-04', 5);
INSERT INTO watches VALUES (70, 26, '2016-04-10 16:08:27.184396-04', 4);
INSERT INTO watches VALUES (70, 102, '2016-04-10 16:08:32.318273-04', 2);
INSERT INTO watches VALUES (60, 170, '2016-04-10 16:08:37.438286-04', 4);
INSERT INTO watches VALUES (70, 107, '2016-04-10 16:08:37.657153-04', 1);
INSERT INTO watches VALUES (60, 213, '2016-04-10 16:08:39.949927-04', 5);
INSERT INTO watches VALUES (60, 202, '2016-04-10 16:08:43.10673-04', 4);
INSERT INTO watches VALUES (60, 158, '2016-04-10 16:08:45.323988-04', 3);
INSERT INTO watches VALUES (60, 200, '2016-04-10 16:08:47.603341-04', 4);
INSERT INTO watches VALUES (70, 159, '2016-04-10 16:08:48.175805-04', 2);
INSERT INTO watches VALUES (60, 127, '2016-04-10 16:08:49.956506-04', 4);
INSERT INTO watches VALUES (70, 43, '2016-04-10 16:08:54.502102-04', 4);
INSERT INTO watches VALUES (70, 91, '2016-04-10 16:08:59.374386-04', 2);
INSERT INTO watches VALUES (70, 120, '2016-04-10 16:09:59.088182-04', 1);
INSERT INTO watches VALUES (70, 146, '2016-04-10 16:10:03.927199-04', 4);
INSERT INTO watches VALUES (70, 82, '2016-04-10 16:10:10.463648-04', NULL);
INSERT INTO watches VALUES (61, 24, '2016-04-10 16:10:15.170292-04', 4);
INSERT INTO watches VALUES (70, 68, '2016-04-10 16:10:15.674741-04', 3);
INSERT INTO watches VALUES (61, 201, '2016-04-10 16:10:18.406792-04', 4);
INSERT INTO watches VALUES (61, 46, '2016-04-10 16:10:20.874335-04', 4);
INSERT INTO watches VALUES (70, 195, '2016-04-10 16:10:22.124805-04', 3);
INSERT INTO watches VALUES (61, 27, '2016-04-10 16:10:24.09453-04', 5);
INSERT INTO watches VALUES (70, 121, '2016-04-10 16:10:26.193379-04', 3);
INSERT INTO watches VALUES (61, 49, '2016-04-10 16:10:26.362959-04', 5);
INSERT INTO watches VALUES (61, 172, '2016-04-10 16:10:30.265734-04', 5);
INSERT INTO watches VALUES (61, 143, '2016-04-10 16:10:36.904945-04', 5);
INSERT INTO watches VALUES (61, 94, '2016-04-10 16:10:41.357685-04', 5);
INSERT INTO watches VALUES (61, 37, '2016-04-10 16:10:43.8805-04', 4);
INSERT INTO watches VALUES (61, 95, '2016-04-10 16:10:47.340638-04', 3);
INSERT INTO watches VALUES (61, 210, '2016-04-10 16:10:50.523117-04', 5);
INSERT INTO watches VALUES (61, 140, '2016-04-10 16:10:53.715472-04', 3);
INSERT INTO watches VALUES (77, 143, '2016-04-10 16:10:52.175648-04', 5);
INSERT INTO watches VALUES (77, 10, '2016-04-10 16:11:08.389449-04', 2);
INSERT INTO watches VALUES (77, 39, '2016-04-10 16:11:58.61679-04', 1);
INSERT INTO watches VALUES (62, 248, '2016-04-10 16:12:20.541096-04', 5);
INSERT INTO watches VALUES (62, 200, '2016-04-10 16:12:22.874912-04', 2);
INSERT INTO watches VALUES (62, 129, '2016-04-10 16:12:24.894925-04', 5);
INSERT INTO watches VALUES (62, 127, '2016-04-10 16:12:26.690776-04', 4);
INSERT INTO watches VALUES (62, 62, '2016-04-10 16:12:28.842044-04', 2);
INSERT INTO watches VALUES (62, 61, '2016-04-10 16:12:30.678141-04', 5);
INSERT INTO watches VALUES (62, 64, '2016-04-10 16:12:36.888364-04', 4);
INSERT INTO watches VALUES (62, 170, '2016-04-10 16:12:38.907975-04', 5);
INSERT INTO watches VALUES (62, 17, '2016-04-10 16:12:40.8781-04', 5);
INSERT INTO watches VALUES (62, 203, '2016-04-10 16:12:54.034532-04', 4);
INSERT INTO watches VALUES (62, 34, '2016-04-10 16:12:56.23059-04', 5);
INSERT INTO watches VALUES (62, 114, '2016-04-10 16:12:58.594215-04', 5);
INSERT INTO watches VALUES (63, 69, '2016-04-10 16:14:26.715678-04', 3);
INSERT INTO watches VALUES (63, 162, '2016-04-10 16:14:29.336897-04', 4);
INSERT INTO watches VALUES (63, 88, '2016-04-10 16:14:31.177275-04', 3);
INSERT INTO watches VALUES (63, 141, '2016-04-10 16:14:37.571845-04', 5);
INSERT INTO watches VALUES (63, 31, '2016-04-10 16:14:42.69522-04', 5);
INSERT INTO watches VALUES (63, 9, '2016-04-10 16:14:48.982382-04', 5);
INSERT INTO watches VALUES (63, 137, '2016-04-10 16:14:55.248198-04', 3);
INSERT INTO watches VALUES (70, 141, '2016-04-10 16:14:55.88666-04', 3);
INSERT INTO watches VALUES (63, 65, '2016-04-10 16:14:58.996957-04', 4);
INSERT INTO watches VALUES (70, 9, '2016-04-10 16:15:00.14282-04', 4);
INSERT INTO watches VALUES (70, 143, '2016-04-10 16:15:03.594529-04', 4);
INSERT INTO watches VALUES (63, 30, '2016-04-10 16:15:05.172897-04', 5);
INSERT INTO watches VALUES (70, 248, '2016-04-10 16:15:07.245304-04', 4);
INSERT INTO watches VALUES (70, 30, '2016-04-10 16:15:10.5199-04', 2);
INSERT INTO watches VALUES (63, 207, '2016-04-10 16:15:11.845179-04', 4);
INSERT INTO watches VALUES (70, 31, '2016-04-10 16:15:18.252523-04', 5);
INSERT INTO watches VALUES (63, 5, '2016-04-10 16:15:18.299811-04', 5);
INSERT INTO watches VALUES (63, 34, '2016-04-10 16:15:22.569423-04', 5);
INSERT INTO watches VALUES (63, 73, '2016-04-10 16:15:26.387036-04', 3);
INSERT INTO watches VALUES (65, 5, '2016-04-10 16:15:46.222585-04', 5);
INSERT INTO watches VALUES (65, 113, '2016-04-10 16:15:55.49851-04', 5);
INSERT INTO watches VALUES (65, 190, '2016-04-10 16:16:35.979726-04', 5);
INSERT INTO watches VALUES (65, 225, '2016-04-10 16:16:41.952421-04', 3);
INSERT INTO watches VALUES (65, 138, '2016-04-10 16:16:48.817559-04', 4);
INSERT INTO watches VALUES (65, 236, '2016-04-10 16:16:58.477484-04', 3);
INSERT INTO watches VALUES (65, 99, '2016-04-10 16:17:04.179883-04', 4);
INSERT INTO watches VALUES (65, 18, '2016-04-10 16:17:09.47806-04', 3);
INSERT INTO watches VALUES (65, 72, '2016-04-10 16:17:15.263525-04', 5);
INSERT INTO watches VALUES (65, 48, '2016-04-10 16:17:18.816046-04', 5);
INSERT INTO watches VALUES (65, 108, '2016-04-10 16:17:20.494863-04', 3);
INSERT INTO watches VALUES (65, 242, '2016-04-10 16:17:22.057967-04', 5);
INSERT INTO watches VALUES (65, 4, '2016-04-10 16:17:24.038155-04', 3);
INSERT INTO watches VALUES (66, 52, '2016-04-10 16:17:52.112476-04', 5);
INSERT INTO watches VALUES (66, 193, '2016-04-10 16:17:54.827714-04', 3);
INSERT INTO watches VALUES (66, 40, '2016-04-10 16:17:57.128556-04', 4);
INSERT INTO watches VALUES (66, 202, '2016-04-10 16:18:01.728971-04', 2);
INSERT INTO watches VALUES (66, 75, '2016-04-10 16:18:48.193611-04', 4);
INSERT INTO watches VALUES (66, 82, '2016-04-10 16:18:50.293926-04', 5);
INSERT INTO watches VALUES (66, 150, '2016-04-10 16:18:52.175225-04', 5);
INSERT INTO watches VALUES (66, 89, '2016-04-10 16:18:54.746264-04', 4);
INSERT INTO watches VALUES (66, 230, '2016-04-10 16:19:00.727753-04', 3);
INSERT INTO watches VALUES (66, 152, '2016-04-10 16:19:03.68156-04', 2);
INSERT INTO watches VALUES (66, 97, '2016-04-10 16:19:08.215998-04', 5);
INSERT INTO watches VALUES (66, 92, '2016-04-10 16:19:14.365875-04', 5);
INSERT INTO watches VALUES (66, 221, '2016-04-10 16:19:19.35791-04', 3);
INSERT INTO watches VALUES (67, 76, '2016-04-10 16:20:02.827672-04', 4);
INSERT INTO watches VALUES (67, 199, '2016-04-10 16:20:04.853884-04', 5);
INSERT INTO watches VALUES (67, 233, '2016-04-10 16:20:06.999052-04', 2);
INSERT INTO watches VALUES (67, 222, '2016-04-10 16:20:13.6221-04', 5);
INSERT INTO watches VALUES (67, 100, '2016-04-10 16:20:18.026262-04', 4);
INSERT INTO watches VALUES (67, 2, '2016-04-10 16:20:23.8785-04', 5);
INSERT INTO watches VALUES (67, 175, '2016-04-10 16:20:35.80198-04', 4);
INSERT INTO watches VALUES (67, 135, '2016-04-10 16:20:38.989618-04', 5);
INSERT INTO watches VALUES (68, 17, '2016-04-10 16:21:27.409763-04', 5);
INSERT INTO watches VALUES (68, 42, '2016-04-10 16:21:35.73836-04', 5);
INSERT INTO watches VALUES (68, 20, '2016-04-10 16:21:42.373183-04', 3);
INSERT INTO watches VALUES (68, 157, '2016-04-10 16:21:47.843648-04', 5);
INSERT INTO watches VALUES (68, 130, '2016-04-10 16:21:54.051955-04', 3);
INSERT INTO watches VALUES (68, 2, '2016-04-10 16:21:59.841574-04', 5);
INSERT INTO watches VALUES (68, 161, '2016-04-10 16:22:05.322543-04', 2);
INSERT INTO watches VALUES (68, 194, '2016-04-10 16:22:11.053149-04', 4);
INSERT INTO watches VALUES (71, 97, '2016-04-10 16:23:27.337385-04', 5);
INSERT INTO watches VALUES (71, 109, '2016-04-10 16:23:34.335905-04', 5);
INSERT INTO watches VALUES (70, 110, '2016-04-10 18:14:59.07446-04', NULL);
INSERT INTO watches VALUES (70, 23, '2016-04-10 18:20:30.391504-04', NULL);
INSERT INTO watches VALUES (62, 147, '2015-11-10 00:00:00-05', 2);
SELECT pg_catalog.setval('actor_actorid_seq', 160, true);
SELECT pg_catalog.setval('director_directorid_seq', 140, true);
SELECT pg_catalog.setval('movie_movieid_seq', 249, true);
SELECT pg_catalog.setval('movieuser_userid_seq', 79, true);
SELECT pg_catalog.setval('studio_studioid_seq', 69, true);
SELECT pg_catalog.setval('topics_topicid_seq', 25, true);
|
<gh_stars>0
-- AlterTable
ALTER TABLE `lop` ADD COLUMN `fk_giang_vien` VARCHAR(40);
-- CreateIndex
CREATE INDEX `lop_giang_vien_id_fk` ON `lop`(`fk_giang_vien`);
-- AddForeignKey
ALTER TABLE `lop` ADD FOREIGN KEY (`fk_giang_vien`) REFERENCES `giang_vien`(`id`) ON DELETE SET NULL ON UPDATE CASCADE;
|
-- Lets use temp tables for safety...
-- exon
DROP TABLE IF EXISTS exon_bk;
CREATE TABLE exon_bk LIKE exon;
INSERT INTO exon_bk SELECT * FROM exon;
OPTIMIZE TABLE exon_bk;
-- exon_transcript
DROP TABLE IF EXISTS exon_transcript_bk;
CREATE TABLE exon_transcript_bk LIKE exon_transcript;
INSERT INTO exon_transcript_bk SELECT * FROM exon_transcript;
OPTIMIZE TABLE exon_transcript_bk;
-- translation
DROP TABLE IF EXISTS translation_bk;
CREATE TABLE translation_bk LIKE translation;
INSERT INTO translation_bk SELECT * FROM translation;
OPTIMIZE TABLE translation_bk;
-- Get a list of dupes
DROP TABLE IF EXISTS temp_duplicate_exons;
CREATE TEMPORARY TABLE temp_duplicate_exons (
PRIMARY KEY (exon_id),
UNIQUE INDEX (
seq_region_id,
seq_region_start,
seq_region_end,
seq_region_strand,
phase,
end_phase,
gene_id
)
) AS
--
SELECT
-- The exon we'll keep...
MIN(exon_id) AS exon_id,
-- The part we want to make unique
e.seq_region_id,
e.seq_region_start, e.seq_region_end, e.seq_region_strand,
e.phase, e.end_phase,
t.gene_id,
-- Just FYI...
COUNT(*) AS N
--
FROM
exon e
INNER JOIN
exon_transcript
USING
(exon_id)
INNER JOIN
transcript t
USING
(transcript_id)
GROUP BY
-- The part we want to make unique (these are the columns used by
-- the DuplicateExons HC).
e.seq_region_id,
e.seq_region_start, e.seq_region_end, e.seq_region_strand,
e.phase, e.end_phase,
t.gene_id
HAVING
COUNT(*) > 1
;
--
SELECT COUNT(*) FROM temp_duplicate_exons;
SELECT SUM(N) FROM temp_duplicate_exons;
-- Make a mapping
DROP TABLE IF EXISTS temp_exon_map;
CREATE TEMPORARY TABLE temp_exon_map (
PRIMARY KEY (old_exon_id, new_exon_id)
) AS
SELECT DISTINCT
#COUNT(*)
e.exon_id AS old_exon_id,
x.exon_id AS new_exon_id
FROM
exon_bk e
INNER JOIN
exon_transcript_bk
USING
(exon_id)
INNER JOIN
transcript t
USING
(transcript_id)
INNER JOIN
temp_duplicate_exons x
ON
x.seq_region_id =
e.seq_region_id AND
x.seq_region_start =
e.seq_region_start AND
x.seq_region_end =
e.seq_region_end AND
x.seq_region_strand =
e.seq_region_strand AND
x.phase =
e.phase AND
x.end_phase =
e.end_phase AND
t.gene_id =
x.gene_id
;
--
SELECT COUNT(*) FROM temp_exon_map;
-- Now re-link the dupes in the exon_transcript table...
UPDATE
temp_exon_map
INNER JOIN
exon_transcript_bk
ON
exon_id = old_exon_id
SET
exon_id = new_exon_id
;
-- You didn't forget this table now did you?
UPDATE
temp_exon_map
INNER JOIN
translation_bk
ON
start_exon_id = old_exon_id
SET
start_exon_id = new_exon_id
;
UPDATE
temp_exon_map
INNER JOIN
translation_bk
ON
end_exon_id = old_exon_id
SET
end_exon_id = new_exon_id
;
-- NOW KILL THEM!!!!
DELETE
exon_bk
FROM
exon_bk
INNER JOIN
temp_exon_map
ON
exon_id = old_exon_id
WHERE
old_exon_id !=
new_exon_id
;
-- Final checks
SELECT COUNT(*)
FROM exon_bk;
SELECT COUNT(*), COUNT(DISTINCT exon_id), COUNT(DISTINCT transcript_id)
FROM exon_transcript_bk
-- Hack...
IGNORE INDEX (PRIMARY);
SELECT COUNT(*), COUNT(DISTINCT exon_id), COUNT(DISTINCT transcript_id)
FROM exon_bk INNER JOIN exon_transcript_bk USING (exon_id);
SELECT COUNT(*) FROM translation;
SELECT
COUNT(*), COUNT(DISTINCT translation_id)
FROM
translation
INNER JOIN
exon ON end_exon_id = exon_id
INNER JOIN
exon_transcript
USING
(exon_id, transcript_id)
;
SELECT
COUNT(*), COUNT(DISTINCT translation_id)
FROM
translation_bk
INNER JOIN
exon_bk ON start_exon_id = exon_id
INNER JOIN
exon_transcript_bk
USING
(exon_id, transcript_id)
;
-- TIDY UP
RENAME TABLE exon TO exon_old_2;
RENAME TABLE exon_transcript TO exon_transcript_old_2;
RENAME TABLE translation TO translation_old_2;
RENAME TABLE exon_bk TO exon;
RENAME TABLE exon_transcript_bk TO exon_transcript;
RENAME TABLE translation_bk TO translation;
|
<reponame>nurikk/gpdb
create table unload_test (f1 int, f2 text , f3 text) distributed by (f1);
copy unload_test from stdin;
1 one uno
2 two dos
3 three treis
4 four cuatro
5 \N \N
6 null null
7 text with space "text" with 'quotes'
\.
|
DROP DATABASE IF EXISTS employee_trackerDB;
CREATE DATABASE employee_trackerDB;
USE employee_trackerDB;
CREATE TABLE department (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NULL,
PRIMARY KEY (id)
);
CREATE TABLE role (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(30) NULL,
salary DECIMAL(10,2) NULL,
department_id INT NULL,
PRIMARY KEY (id)
);
CREATE TABLE employee (
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
role_id INT,
manager_id INT NULL,
PRIMARY KEY (id)
);
-- creating test department
INSERT INTO department (name)
VALUES ("Sales");
-- creating test role
INSERT INTO role (title, salary, department_id)
VALUES ("Manager", 123.12, 1);
-- creating test employee
INSERT INTO employee (first_name,last_name,role_id)
VALUES ("Bob","Builder",1);
SELECT * FROM department;
-- INNER JOIN reffering to values
-- SELECT name"Department", title"Title", first_name"<NAME>", last_name"<NAME>", salary"Salary"
-- FROM employee
-- INNER JOIN role ON role_id = role.id
-- INNER JOIN department ON role.department_id = department.id |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: cmr
-- ------------------------------------------------------
-- Server version 5.7.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `symfony_demo_tag`
--
DROP TABLE IF EXISTS `symfony_demo_tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `symfony_demo_tag` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQ_4D5855405E237E06` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `symfony_demo_tag`
--
LOCK TABLES `symfony_demo_tag` WRITE;
/*!40000 ALTER TABLE `symfony_demo_tag` DISABLE KEYS */;
INSERT INTO `symfony_demo_tag` VALUES (4,'adipiscing'),(3,'consectetur'),(8,'dolore'),(5,'incididunt'),(2,'ipsum'),(6,'labore'),(1,'lorem'),(9,'pariatur'),(7,'voluptate');
/*!40000 ALTER TABLE `symfony_demo_tag` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-03-30 18:01:21
|
SELECT * FROM banco_estrelas.carro;
INSERT INTO banco_estrelas.carro VALUES ("HLJ-8513", 2010, "Prata", "VW", "Gol G5");
INSERT INTO banco_estrelas.carro VALUES ("HLJ-8512", 2020, "Vermelho", "Fiat", "Palio");
INSERT INTO banco_estrelas.carro VALUES ("HLJ-8514", 2013, "Preto", "Fiat", "Fiat Uno Way");
INSERT INTO banco_estrelas.carro VALUES ("HLJ-8516", 2012, "Amarelo", "Mitsuchishi", "Lancer");
INSERT INTO banco_estrelas.carro VALUES ("HLJ-8515", 2015, "Prata", "Toyota", "Hilux"); |
<gh_stars>0
-- migrate:up
CREATE TABLE tenants_hosts (
id SERIAL,
host INET NOT NULL,
CONSTRAINT pkey_tenants_hosts_id PRIMARY KEY (id)
);
/* Insert some hosts for testing, localhost for dev */
INSERT INTO tenants_hosts (host) values('127.0.0.1'), ('127.0.0.1'), ('127.0.0.1');
GRANT SELECT, UPDATE, INSERT, DELETE ON tenants_hosts TO saas_user;
-- migrate:down
DROP TABLE IF EXISTS tenants_hosts; |
DELETE FROM emails
WHERE
person = %(person_id)s
AND
email = %(email)s |
set
check_function_bodies = false;
-- enums
create table
public.gender_keys(id text primary key);
create table
public.color_keys(id text primary key);
create table
public.size_keys(id text primary key);
create table
public.delivery_keys (id text primary key);
create table
public.reward_keys (id text primary key);
-- t-shirts
create table
public.tshirts (
id text primary key,
"order" integer unique,
color text references public.color_keys(id) not null,
gender text references public.gender_keys(id) not null,
name text not null
);
-- rewards
create table
public.rewards (
id text primary key references public.reward_keys(id),
"order" integer unique,
max_tshirts integer not null,
min_pledge integer not null,
tshirt text references public.tshirts(id),
-- nullable (optional) reference
name text not null
);
-- users
create table
public.users (
email text primary key,
is_organizer boolean not null default false,
is_tester boolean not null default false,
name text not null,
pledge integer not null default 0,
token text not null
);
create index
name
on public.pledges using btree (name);
create index
token
on public.pledges using btree (token);
create index
pledge
on public.pledges using btree (pledge);
-- pledges
create sequence
public.pledges_id_seq cache 10;
create table
public.pledges (
id integer primary key default nextval('public.pledges_id_seq'),
is_test boolean not null default false,
date date not null,
email text references public.users(email) not null,
name text not null,
amount integer not null,
reward_id text references public.rewards(id) not null,
note text
);
create index
email
on public.pledges using btree (email);
create index
date
on public.pledges using btree (date);
create index
amount
on public.pledges using btree (amount);
-- surveys
create function
public.updated_at() returns trigger language plpgsql as $$ begin
new.updated_at = now();
return new;
end; $$;
-- selected t-shirts
create table
public.selected_tshirts (
is_test boolean not null default false,
token text references public.users(token) not null,
index integer not null,
tshirt text references public.tshirts(id),
gender text references public.gender_keys(id),
color text references public.color_keys(id),
size text references public.size_keys(id),
created_at timestamp default now(),
updated_at timestamp,
unique (token, index),
check (index >= 0) -- check (index <= max_tshirts)
);
create event trigger
public.selected_tshirts_updated_trigger before
update
on public.selected_thirts for each row
execute
function public.updated_at();
-- selected uniques
create table
public.selected_uniques (
is_test boolean not null default false,
reward text references public.rewards(id) not null,
id integer not null,
token text references public.users(token) not null,
index integer not null,
created_at timestamp default now(),
updated_at timestamp,
unique (reward, token, index),
unique (reward, id, is_test),
check (id >= 0),
check (index >= 0)
);
create event trigger
public.selected_uniques_updated_trigger before
update
on public.selected_uniques for each row
execute
function public.updated_at(); |
-- View: public.viewtestrecords
-- DROP VIEW public.viewtestrecords;
create or replace view public.viewtestrecords as
Select testtype_name,
testentry_id,
item_number,
part_serialnumber,
testentry_orig_serialnumber,
testdef_name,
testdef_description,
testentry_result,
testentry_created_timestamp,
usr_username,
testentry_completed_timestamp
from testentry
inner join item on testentry_orig_item_id = item_id
inner join part on testentry_part_id = part_id
inner join testdef on testentry_test_id = testdef_id
inner join testtype on testdef_type_id = testtype_id
inner join usr on testentry_created_user_id = usr_id
order by testentry_id;
alter table public.viewtestrecords
owner to admin; |
CREATE TABLE IF NOT EXISTS `guardian_invitations` (
`id` int(11) NOT NULL,
`student_id` int(11) NOT NULL,
`invitation_code` varchar(250) NOT NULL,
`email` varchar(250) NOT NULL,
`phone` varchar(250) NOT NULL,
`invitation_key` varchar(250) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
|
BEGIN;
ALTER TABLE listening_sessions
DROP COLUMN title;
COMMIT;
|
select sum(population)
from city
where district = 'california' |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Ven 24 Avril 2015 à 21:37
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Base de données : `nekkai`
--
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`username` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`avatar` text NOT NULL,
`signup_date` int(10) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
--
-- Contenu de la table `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `email`, `avatar`, `signup_date`) VALUES
(6, 'Lymdun', '<PASSWORD>', '<EMAIL>', '', 1408903902);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- file:strings.sql ln:258 expect:true
SELECT 'h%wkeye' LIKE 'h#%' ESCAPE '#' AS "false"
|
<filename>db/schema_005-insert_announcement_into_settings.sql<gh_stars>10-100
INSERT INTO `config_settings` VALUES('announcement_html', '', '<p>Insert any HTML that you want to appear at the top of every page (when logged in).<br/>Note: avoid use of double quotation marks.</p>');
|
<filename>backend/de.metas.swat/de.metas.swat.base/src/main/sql/postgresql/system/40-sw01_swat/5460140_sys_gh1064_docType_Rules_Changed.sql
-- 2017-04-13T10:24:42.221
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@DocBaseType@=''SOO'' | @DocBaseType@=''POO'' | @DocBaseType@=''ARI'' | @DocBaseType@=''ARC'' | @DocBaseType@=''MOP'' | @DocBaseType@=''MMR'' | @DocBaseType@=''MMS'' | @DocBaseType@=''API'' | @DocBaseType@=''MMI''',Updated=TO_TIMESTAMP('2017-04-13 10:24:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=2581
;
-- 2017-04-13T10:26:10.275
-- URL zum Konzept
UPDATE AD_Val_Rule SET Code=' (''@DocBaseType@''=''ARI'' AND AD_Ref_List.Value IN (''AQ'', ''AP''))
OR (''@DocBaseType@''=''ARC'' AND AD_Ref_List.Value IN (''CQ'', ''CR'',''CS''))
OR (''@DocBaseType@'' IN(''API'', ''MOP'') AND AD_Ref_List.Value IN (''QI'', ''VI''))
OR (''@DocBaseType@'' = ''MMI'' AND AD_Ref_List.Value = ''MD'')
OR (''@DocBaseType@'' NOT IN (''API'', ''ARI'', ''ARC'', ''MOP'') AND AD_Ref_List.Value NOT IN (''AQ'', ''AP'', ''CQ'', ''CR'', ''QI'')) /* fallback for the rest of the entries */
',Updated=TO_TIMESTAMP('2017-04-13 10:26:10','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Val_Rule_ID=540219
;
-- 2017-04-13T10:27:16.408
-- URL zum Konzept
INSERT INTO AD_Ref_List (AD_Client_ID,AD_Org_ID,AD_Ref_List_ID,AD_Reference_ID,Created,CreatedBy,EntityType,IsActive,Name,Updated,UpdatedBy,Value,ValueName) VALUES (0,0,541260,148,TO_TIMESTAMP('2017-04-13 10:27:16','YYYY-MM-DD HH24:MI:SS'),100,'de.metas.swat','Y','Material Disposal',TO_TIMESTAMP('2017-04-13 10:27:16','YYYY-MM-DD HH24:MI:SS'),100,'MD','Material Disposal')
;
-- 2017-04-13T10:27:16.420
-- URL zum Konzept
INSERT INTO AD_Ref_List_Trl (AD_Language,AD_Ref_List_ID, Description,Name, IsTranslated,AD_Client_ID,AD_Org_ID,Created,Createdby,Updated,UpdatedBy) SELECT l.AD_Language,t.AD_Ref_List_ID, t.Description,t.Name, 'N',t.AD_Client_ID,t.AD_Org_ID,t.Created,t.Createdby,t.Updated,t.UpdatedBy FROM AD_Language l, AD_Ref_List t WHERE l.IsActive='Y' AND l.IsSystemLanguage='Y' AND l.IsBaseLanguage='N' AND t.AD_Ref_List_ID=541260 AND NOT EXISTS (SELECT * FROM AD_Ref_List_Trl tt WHERE tt.AD_Language=l.AD_Language AND tt.AD_Ref_List_ID=t.AD_Ref_List_ID)
;
|
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-0","200 Oracle Parkway","","Redwood Shores","CA","94065","USA","37.530737","-122.265557");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-1","100 Main Street","","San Francisco","CA","94135","USA","37.791826","-122.394953");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-2","300 Second Street","","Fremont","CA","94536","USA","37.552713","-121.994713");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-3","200 First Street","","Livermore","CA","94566","USA","37.660406","-121.876038");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-4","100 Park Street","","Alameda","CA","94501","USA","37.763389","-122.243514");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-5","4500 Broadway","","Oakland","CA","94611","USA","37.832892","-122.253260");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-6","4226 Piedmont Ave","","Oakland","CA","94611","USA","37.827911","-122.249982");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-7","5655 College Ave","","Oakland","CA","94618","USA","37.843693","-122.251890");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-8","1200 University Ave","","Berkeley","CA","94702","USA","37.869368","-122.289508");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-9","2100 Ward Street","","Berkeley","CA","94702","USA","37.859333","-122.266792");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-10","2181 Shattuck Avenue","","Berkeley","CA","94702","USA","37.869801","-122.267527");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-11","1200 Shattuck Avenue","","Berkeley","CA","94702","USA","37.869801","-122.267527");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-12","5655 College Ave","","Oakland","CA","94618","USA","37.843693","-122.251890");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-13","4226 Piedmont Ave","","Oakland","CA","94611","USA","37.827911","-122.249982");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-14","100 Main Street","","San Francisco","CA","94135","USA","37.791826","-122.394953");
insert into location (id, street1, street2, city, state, zip, country, latitude, longitude) values("loc-15","300 Second Street","","Fremont","CA","94536","USA","37.552713","-121.994713");
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-101','bsmith','Bob','Smith','loc-1','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-102','djones','Dan','Jones','loc-2','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-103','rbarkhouse','Rick','Barkhouse','loc-3','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-104','lsmith','Lynn','Smith','loc-4','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-105','jtaylor','Julia','Taylor','loc-5','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-106','bwilliams','Bruce','Williams','loc-6','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-107','kbrown','Kent','Brown','loc-7','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-108','ldavies','Larry','Davies','loc-8','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-109','tthomas','Ted','Thomas','loc-9','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-110','bthompson','Bruce','Thompson','loc-10','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-111','jling','Jini','Ling','loc-11','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-112','jstevens','Jennifer','Stevens','loc-12','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-113','skapoor','Srini','Kapoor','loc-13','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-114','mdsouza','Mark','DSouza','loc-14','6505067000','5105552121','<EMAIL>');
insert into customers (id, username, firstname, lastname, locationid, mobile, home, email) values('cus-115','jjackson','Jamal','Jackson','loc-15','6505067000','5105552121','<EMAIL>');
|
<reponame>anthonykeenan/corda-postgres-example
CREATE USER "$" WITH LOGIN PASSWORD '<PASSWORD>';
CREATE SCHEMA "$_schema";
GRANT USAGE, CREATE ON SCHEMA "$_schema" TO "$";
GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON ALL tables IN SCHEMA "$_schema" TO "$";
ALTER DEFAULT privileges IN SCHEMA "$_schema" GRANT SELECT, INSERT, UPDATE, DELETE, REFERENCES ON tables TO "$";
GRANT USAGE, SELECT ON ALL sequences IN SCHEMA "$_schema" TO "$";
ALTER DEFAULT privileges IN SCHEMA "$_schema" GRANT USAGE, SELECT ON sequences TO "$";
ALTER ROLE "$" SET search_path = "$_schema"; |
/****** Object: Table [dbo].[Organization] Script Date: 15/09/2016 19:10:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Organization](
[OrganizationId] [int] NOT NULL,
[RaisonSociale] [nvarchar](200) NULL,
[Reference] [int] NULL,
[Effectif] [int] NULL,
[FormeJuridique] [nvarchar](50) NULL,
[CodeNAF] [nvarchar](50) NULL,
[IdentifiantConventionCollective] [nvarchar](50) NULL,
[SIRET] [nvarchar](50) NULL,
[AggregateId] [uniqueidentifier] NULL,
[CreationDate] [datetime] NOT NULL,
[ModificationDate] [datetime] NOT NULL,
CONSTRAINT [PK_PM] PRIMARY KEY CLUSTERED
(
[PMId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
|
<gh_stars>0
---------------------------------------------------------------------------------------------
--------------------------------USING CONDITIONAL PREDICATES --------------------------------
---------------------------------------------------------------------------------------------
create or replace trigger before_row_emp_cpy
before insert or update or delete on employees_copy
referencing old as O new as N
for each row
begin
dbms_output.put_line('Before Row Trigger is Fired!.');
dbms_output.put_line('The Salary of Employee '||:o.employee_id
||' -> Before:'|| :o.salary||' After:'||:n.salary);
if inserting then
dbms_output.put_line('An INSERT occurred on employees_copy table');
elsif deleting then
dbms_output.put_line('A DELETE occurred on employees_copy table');
elsif updating ('salary') then
dbms_output.put_line('A DELETE occurred on the salary column');
elsif updating then
dbms_output.put_line('An UPDATE occurred on employees_copy table');
end if;
end; |
<filename>framework/resources/Functional/tpcds/sanity/parquet/drill4704_3.sql
select ss_sold_date_sk from store_sales where cast(ss_ext_wholesale_cost as decimal)=448 and ss_ext_list_price between 448 and 448;
|
<reponame>cpollet/jixture
insert into users values ('username1', 0, 'password');
insert into users
values ('username2', 0, 'password');
-- some comment
insert into users
values ('username3', 0, 'password')
; |
#standardSQL
# 09_02: % of pages having minimum set of accessible elements
# Compliant pages have: header, footer, nav, and main (or [role=main]) elements
CREATE TEMPORARY FUNCTION getCompliantElements(payload STRING)
RETURNS ARRAY<STRING> LANGUAGE js AS '''
try {
var $ = JSON.parse(payload);
var elements = JSON.parse($._element_count);
if (Array.isArray(elements) || typeof elements != 'object') return [];
var compliantElements = new Set(['header', 'footer', 'nav', 'main']);
return Object.keys(elements).filter(e => compliantElements.has(e));
} catch (e) {
return [];
}
''';
SELECT
client,
COUNT(DISTINCT page) AS pages,
total,
ROUND(COUNT(DISTINCT page) * 100 / total, 2) AS pct
FROM
(SELECT _TABLE_SUFFIX AS client, url AS page, getCompliantElements(payload) AS compliant_elements FROM `httparchive.pages.2019_07_01_*`)
JOIN
(SELECT client, page, REGEXP_CONTAINS(body, '(?i)role=[\'"]?main') AS has_role_main FROM `httparchive.almanac.summary_response_bodies` WHERE firstHtml)
USING
(client, page)
JOIN
(SELECT _TABLE_SUFFIX AS client, COUNT(0) AS total FROM `httparchive.pages.2019_07_01_*` GROUP BY _TABLE_SUFFIX)
USING (client)
WHERE
'header' IN UNNEST(compliant_elements) AND
'footer' IN UNNEST(compliant_elements) AND
'nav' IN UNNEST(compliant_elements) AND
('main' IN UNNEST(compliant_elements) OR has_role_main)
GROUP BY
client,
total |
<filename>java/sui-migration/src/main/resources/db/migration_sui/V30__add_page_sizes_to_table_info.sql
ALTER TABLE sui_meta.table_info ADD page_sizes TEXT NOT NULL DEFAULT '10,25,50,100,250,500,1000';
|
<reponame>aws-samples/aws-blog-redshift-datalake-etl-elt-patterns<gh_stars>10-100
\timing
\c rselttest
-- Tickit dataset
-- ELT Queries
-- ELT Query 1
-- Total quantity sold on a given calendar date
drop table if exists elt_total_quantity_sold_by_date;
create table elt_total_quantity_sold_by_date
as
SELECT
caldate,
sum(qtysold) as total_quantity
FROM spectrum_eltblogpost.sales, date
WHERE sales.dateid = date.dateid
group by caldate;
-- ELT Query 2
-- Total quantity sold to each buyer
drop table if exists elt_total_quantity_sold_by_buyer_by_date;
create table elt_total_quantity_sold_by_buyer_by_date
as
SELECT buyerid,caldate, firstname, lastname, total_quantity
FROM (SELECT buyerid, caldate, sum(qtysold) total_quantity
FROM spectrum_eltblogpost.sales, date
where sales.dateid = date.dateid
GROUP BY buyerid, caldate) Q, users
WHERE Q.buyerid = userid;
-- ELT Query 3
-- Find events in the 99.9 percentile in terms of all time gross sales
drop table if exists elt_total_price_by_eventname;
create table elt_total_price_by_eventname
as
SELECT E.eventid,eventname, total_price
FROM (SELECT eventid, total_price, ntile(1000) over(order by total_price desc) as percentile
FROM (SELECT eventid, sum(pricepaid) total_price
FROM spectrum_eltblogpost.sales
GROUP BY eventid)) Q, event E
WHERE Q.eventid = E.eventid
AND percentile = 1;
|
--#
--# Gpu PreAggregate TestCases on Zero record Table.
--#
set pg_strom.debug_force_gpupreagg to on;
set pg_strom.enable_gpusort to off;
set client_min_messages to warning;
-- smallint
select avg(smlint_x) from strom_zero_test ;
select count(smlint_x) from strom_zero_test ;
select max(smlint_x) from strom_zero_test ;
select min(smlint_x) from strom_zero_test ;
select sum(smlint_x) from strom_zero_test ;
select stddev(smlint_x) from strom_zero_test ;
select stddev_pop(smlint_x) from strom_zero_test ;
select stddev_samp(smlint_x) from strom_zero_test ;
select variance(smlint_x) from strom_zero_test ;
select var_pop(smlint_x) from strom_zero_test ;
select var_samp(smlint_x) from strom_zero_test ;
select corr(smlint_x,smlint_x) from strom_zero_test ;
select covar_pop(smlint_x,smlint_x) from strom_zero_test ;
select covar_samp(smlint_x,smlint_x) from strom_zero_test ;
--integer
select avg(integer_x) from strom_zero_test ;
select count(integer_x) from strom_zero_test ;
select max(integer_x) from strom_zero_test ;
select min(integer_x) from strom_zero_test ;
select sum(integer_x) from strom_zero_test ;
select stddev(integer_x) from strom_zero_test ;
select stddev_pop(integer_x) from strom_zero_test ;
select stddev_samp(integer_x) from strom_zero_test ;
select variance(integer_x) from strom_zero_test ;
select var_pop(integer_x) from strom_zero_test ;
select var_samp(integer_x) from strom_zero_test ;
select corr(integer_x,integer_x) from strom_zero_test ;
select covar_pop(integer_x,integer_x) from strom_zero_test ;
select covar_samp(integer_x,integer_x) from strom_zero_test ;
--bigint
select avg(bigint_x) from strom_zero_test ;
select count(bigint_x) from strom_zero_test ;
select max(bigint_x) from strom_zero_test ;
select min(bigint_x) from strom_zero_test ;
select sum(bigint_x) from strom_zero_test ;
select stddev(bigint_x) from strom_zero_test ;
select stddev_pop(bigint_x) from strom_zero_test ;
select stddev_samp(bigint_x) from strom_zero_test ;
select variance(bigint_x) from strom_zero_test ;
select var_pop(bigint_x) from strom_zero_test ;
select var_samp(bigint_x) from strom_zero_test ;
select corr(bigint_x,bigint_x) from strom_zero_test ;
select covar_pop(bigint_x,bigint_x) from strom_zero_test ;
select covar_samp(bigint_x,bigint_x) from strom_zero_test ;
--real
select avg(real_x) from strom_zero_test ;
select count(real_x) from strom_zero_test ;
select max(real_x) from strom_zero_test ;
select min(real_x) from strom_zero_test ;
select sum(real_x) from strom_zero_test ;
select stddev(real_x) from strom_zero_test ;
select stddev_pop(real_x) from strom_zero_test ;
select stddev_samp(real_x) from strom_zero_test ;
select variance(real_x) from strom_zero_test ;
select var_pop(real_x) from strom_zero_test ;
select var_samp(real_x) from strom_zero_test ;
select corr(real_x,real_x) from strom_zero_test ;
select covar_pop(real_x,real_x) from strom_zero_test ;
select covar_samp(real_x,real_x) from strom_zero_test ;
--float
select avg(float_x) from strom_zero_test ;
select count(float_x) from strom_zero_test ;
select max(float_x) from strom_zero_test ;
select min(float_x) from strom_zero_test ;
select sum(float_x) from strom_zero_test ;
select stddev(float_x) from strom_zero_test ;
select stddev_pop(float_x) from strom_zero_test ;
select stddev_samp(float_x) from strom_zero_test ;
select variance(float_x) from strom_zero_test ;
select var_pop(float_x) from strom_zero_test ;
select var_samp(float_x) from strom_zero_test ;
select corr(float_x,float_x) from strom_zero_test ;
select covar_pop(float_x,float_x) from strom_zero_test ;
select covar_samp(float_x,float_x) from strom_zero_test ;
--numeric
select avg(nume_x) from strom_zero_test ;
select count(nume_x) from strom_zero_test ;
select max(nume_x) from strom_zero_test ;
select min(nume_x) from strom_zero_test ;
select sum(nume_x) from strom_zero_test ;
select stddev(nume_x) from strom_zero_test ;
select stddev_pop(nume_x) from strom_zero_test ;
select stddev_samp(nume_x) from strom_zero_test ;
select variance(nume_x) from strom_zero_test ;
select var_pop(nume_x) from strom_zero_test ;
select var_samp(nume_x) from strom_zero_test ;
select corr(nume_x,nume_x) from strom_zero_test ;
select covar_pop(nume_x,nume_x) from strom_zero_test ;
select covar_samp(nume_x,nume_x) from strom_zero_test ;
--smallserial
select avg(smlsrl_x) from strom_zero_test ;
select count(smlsrl_x) from strom_zero_test ;
select max(smlsrl_x) from strom_zero_test ;
select min(smlsrl_x) from strom_zero_test ;
select sum(smlsrl_x) from strom_zero_test ;
select stddev(smlsrl_x) from strom_zero_test ;
select stddev_pop(smlsrl_x) from strom_zero_test ;
select stddev_samp(smlsrl_x) from strom_zero_test ;
select variance(smlsrl_x) from strom_zero_test ;
select var_pop(smlsrl_x) from strom_zero_test ;
select var_samp(smlsrl_x) from strom_zero_test ;
select corr(smlsrl_x,smlsrl_x) from strom_zero_test ;
select covar_pop(smlsrl_x,smlsrl_x) from strom_zero_test ;
select covar_samp(smlsrl_x,smlsrl_x) from strom_zero_test ;
--serial
select avg(serial_x) from strom_zero_test ;
select count(serial_x) from strom_zero_test ;
select max(serial_x) from strom_zero_test ;
select min(serial_x) from strom_zero_test ;
select sum(serial_x) from strom_zero_test ;
select stddev(serial_x) from strom_zero_test ;
select stddev_pop(serial_x) from strom_zero_test ;
select stddev_samp(serial_x) from strom_zero_test ;
select variance(serial_x) from strom_zero_test ;
select var_pop(serial_x) from strom_zero_test ;
select var_samp(serial_x) from strom_zero_test ;
select corr(serial_x,serial_x) from strom_zero_test ;
select covar_pop(serial_x,serial_x) from strom_zero_test ;
select covar_samp(serial_x,serial_x) from strom_zero_test ;
--bigserial
select avg(bigsrl_x) from strom_zero_test ;
select count(bigsrl_x) from strom_zero_test ;
select max(bigsrl_x) from strom_zero_test ;
select min(bigsrl_x) from strom_zero_test ;
select sum(bigsrl_x) from strom_zero_test ;
select stddev(bigsrl_x) from strom_zero_test ;
select stddev_pop(bigsrl_x) from strom_zero_test ;
select stddev_samp(bigsrl_x) from strom_zero_test ;
select variance(bigsrl_x) from strom_zero_test ;
select var_pop(bigsrl_x) from strom_zero_test ;
select var_samp(bigsrl_x) from strom_zero_test ;
select corr(bigsrl_x,bigsrl_x) from strom_zero_test ;
select covar_pop(bigsrl_x,bigsrl_x) from strom_zero_test ;
select covar_samp(bigsrl_x,bigsrl_x) from strom_zero_test ;
|
<filename>sql4_persediaan/kartu_barang2_sql/kartu_barang2_setwan.sql
DROP VIEW IF EXISTS view_kartu_barang2_setwan;
CREATE VIEW view_kartu_barang2_setwan AS
SELECT
*,
sum(pra_saldo) OVER (PARTITION BY kode_barang ORDER BY tanggal, id_persediaan) as saldo
FROM
view_kartu_barang_setwan
WHERE
1 = 1 AND
id_skpd = 1;
GRANT ALL PRIVILEGES ON view_kartu_barang2_setwan TO lap_setwan;
REVOKE INSERT, UPDATE, DELETE ON view_kartu_barang2_setwan FROM lap_setwan;
|
<gh_stars>0
-- Update ALL status to OPEN if any have been created with ALL
update potentialduplicate set status = 'OPEN' where status = 'ALL'; |
ALTER TABLE {PREFIX}category ADD COLUMN category_icon varchar(255);
|
-- @testpoint:opengauss关键字prefix(非保留),作为用户组名
--关键字不带引号-成功
drop group if exists prefix;
create group prefix with password '<PASSWORD>';
drop group prefix;
--关键字带双引号-成功
drop group if exists "prefix";
create group "prefix" with password '<PASSWORD>';
drop group "prefix";
--关键字带单引号-合理报错
drop group if exists 'prefix';
create group 'prefix' with password '<PASSWORD>';
--关键字带反引号-合理报错
drop group if exists `prefix`;
create group `prefix` with password '<PASSWORD>';
|
set session role= 'userallowexclude3';
select * from a;
|
<reponame>guilleminio/tiendadeofertas<filename>bd/SITIO/tienda_de_ofertas.sql
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 30-12-2021 a las 18:10:57
-- Versión del servidor: 10.4.21-MariaDB
-- Versión de PHP: 8.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `tienda_de_ofertas`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `carro`
--
CREATE TABLE `carro` (
`id_carro` int(11) NOT NULL,
`id_usuario` int(11) DEFAULT NULL,
`fecha_carro` datetime NOT NULL,
`estado_carro` int(11) NOT NULL,
`monto_carro` float DEFAULT NULL,
`offercrips_carro` float NOT NULL,
`formapago_carro` int(11) DEFAULT NULL,
`formaenvio_carro` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `carro`
--
INSERT INTO `carro` (`id_carro`, `id_usuario`, `fecha_carro`, `estado_carro`, `monto_carro`, `offercrips_carro`, `formapago_carro`, `formaenvio_carro`) VALUES
(16, 1, '2021-12-30 18:10:24', 1, 32000, 6400, NULL, NULL);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `carro_estados`
--
CREATE TABLE `carro_estados` (
`id_estado_carro` int(11) NOT NULL,
`nombre_estado_carro` varchar(300) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `carro_estados`
--
INSERT INTO `carro_estados` (`id_estado_carro`, `nombre_estado_carro`) VALUES
(1, 'EN CURSO'),
(2, 'CONFIRMADO');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `estado_pedido`
--
CREATE TABLE `estado_pedido` (
`id_estado` int(11) NOT NULL,
`nombre_estado` varchar(300) NOT NULL,
`descripcion_estado` varchar(300) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `estado_pedido`
--
INSERT INTO `estado_pedido` (`id_estado`, `nombre_estado`, `descripcion_estado`) VALUES
(1, 'CONFIRMADO', 'El pedido ha sido confirmado por el cliente'),
(2, 'ENTREGADO', 'El pedido ha sido entregado al cliente'),
(3, 'CANCELADO', 'El pedido ha sido cancelado por el cliente'),
(4, 'PENDIENTE', 'El pedido está pendiente de pago');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `forma_envio`
--
CREATE TABLE `forma_envio` (
`id_formaenvio` int(11) NOT NULL,
`nombre_formaenvio` varchar(300) NOT NULL,
`descripcion_formaenvio` varchar(300) NOT NULL,
`activo_formaenvio` bit(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `forma_envio`
--
INSERT INTO `forma_envio` (`id_formaenvio`, `nombre_formaenvio`, `descripcion_formaenvio`, `activo_formaenvio`) VALUES
(1, 'Sucursal', 'Retiro en sucursal - Horario: Lunes a Viernes, 10:00 hs. a 20:00 hs.', b'1'),
(2, 'Domicilio', 'Entrega a domicilio', b'1');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `forma_pago`
--
CREATE TABLE `forma_pago` (
`id_formapago` int(11) NOT NULL,
`nombre_formapago` varchar(300) NOT NULL,
`descripcion_formapago` varchar(300) NOT NULL,
`activo_formapago` bit(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `forma_pago`
--
INSERT INTO `forma_pago` (`id_formapago`, `nombre_formapago`, `descripcion_formapago`, `activo_formapago`) VALUES
(1, 'Contado', 'Aboná tu compra en efectivo', b'1'),
(2, 'Offercrips', 'Aboná tu compra con Offercrips', b'1');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `item_carro`
--
CREATE TABLE `item_carro` (
`id_item` int(11) NOT NULL,
`id_carro` int(11) NOT NULL,
`id_producto` int(11) NOT NULL,
`precio_unitario` float NOT NULL,
`valor_offercrips` int(11) NOT NULL,
`cantidad` int(11) NOT NULL,
`total_item` float NOT NULL,
`total_offercrips_item` float NOT NULL,
`suma_offercrips` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `item_pedido`
--
CREATE TABLE `item_pedido` (
`id_pedido` int(11) NOT NULL,
`id_item` int(11) NOT NULL,
`id_producto` int(11) NOT NULL,
`precio_unitario_item` float NOT NULL,
`valor_offercrips` float NOT NULL,
`cantidad_item` int(11) NOT NULL,
`precio_total_item` float NOT NULL,
`total_offercrips_item` float NOT NULL,
`suma_offercrips` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `item_pedido`
--
INSERT INTO `item_pedido` (`id_pedido`, `id_item`, `id_producto`, `precio_unitario_item`, `valor_offercrips`, `cantidad_item`, `precio_total_item`, `total_offercrips_item`, `suma_offercrips`) VALUES
(1, 1, 4, 28000, 5600, 2, 56000, 11200, 2800),
(2, 1, 1, 25000, 5000, 1, 25000, 5000, 1500),
(3, 1, 4, 28000, 5600, 2, 56000, 11200, 2800),
(3, 2, 1, 25000, 5000, 1, 25000, 5000, 1500),
(4, 1, 1, 25000, 5000, 1, 25000, 5000, 1500),
(4, 2, 2, 32000, 6400, 1, 32000, 6400, 1600),
(5, 1, 1, 25000, 5000, 1, 25000, 5000, 1500);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `pedido`
--
CREATE TABLE `pedido` (
`id_pedido` int(11) NOT NULL,
`id_usuario` int(11) NOT NULL,
`fecha_pedido` datetime NOT NULL,
`estado_pedido` int(11) NOT NULL,
`monto_pedido` float NOT NULL,
`offercrips_pedido` float NOT NULL,
`formapago_pedido` int(11) NOT NULL,
`formaenvio_pedido` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `pedido`
--
INSERT INTO `pedido` (`id_pedido`, `id_usuario`, `fecha_pedido`, `estado_pedido`, `monto_pedido`, `offercrips_pedido`, `formapago_pedido`, `formaenvio_pedido`) VALUES
(1, 1, '2021-12-30 16:22:13', 4, 56000, 11200, 1, 1),
(2, 1, '2021-12-30 16:24:41', 1, 25000, 5000, 2, 2),
(3, 2, '2021-12-30 16:28:54', 4, 81000, 16200, 1, 2),
(4, 2, '2021-12-30 17:32:32', 1, 57000, 11400, 2, 2),
(5, 1, '2021-12-30 17:35:35', 1, 25000, 5000, 2, 2);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuario`
--
CREATE TABLE `usuario` (
`id_usuario` int(11) NOT NULL,
`nombre_usuario` varchar(300) NOT NULL,
`apellido_usuario` varchar(300) NOT NULL,
`email_usuario` varchar(500) NOT NULL,
`contrasenia_usuario` varchar(300) NOT NULL,
`domicilio_usuario` varchar(300) NOT NULL,
`telefono_usuario` varchar(300) NOT NULL,
`fechaalta_usuario` datetime NOT NULL,
`ultimologin_usuario` datetime NOT NULL,
`offercrips` float NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Volcado de datos para la tabla `usuario`
--
INSERT INTO `usuario` (`id_usuario`, `nombre_usuario`, `apellido_usuario`, `email_usuario`, `contrasenia_usuario`, `domicilio_usuario`, `telefono_usuario`, `fechaalta_usuario`, `ultimologin_usuario`, `offercrips`) VALUES
(1, 'Cosme', 'Fulanito', '<EMAIL>', '$2y$10$V..Zy8AS6Bp8MbOwDgnsX..fqwHIjg8GammJSBS1WYmUsRvuNo0j2', 'Laprida 5214', '0800-55-245', '2021-12-30 16:19:34', '2021-12-30 17:34:21', 5800),
(2, '<NAME>', 'Sabadú', '<EMAIL>', '$2y$10$1MlCtJNCJJLyB9rp9e2Qp.hhtm6B2Be/Y1IJXATNvCxs3YohFNxYe', 'Colón 100', '0800-999-522', '2021-12-30 16:28:07', '2021-12-30 17:31:05', 6000);
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `carro`
--
ALTER TABLE `carro`
ADD PRIMARY KEY (`id_carro`),
ADD UNIQUE KEY `id_usuario` (`id_usuario`),
ADD KEY `FK_CARRO_ENVIO` (`formaenvio_carro`),
ADD KEY `FK_CARRO_PAGO` (`formapago_carro`),
ADD KEY `FK_CARRO_ESTADO` (`estado_carro`);
--
-- Indices de la tabla `carro_estados`
--
ALTER TABLE `carro_estados`
ADD PRIMARY KEY (`id_estado_carro`);
--
-- Indices de la tabla `estado_pedido`
--
ALTER TABLE `estado_pedido`
ADD PRIMARY KEY (`id_estado`);
--
-- Indices de la tabla `forma_envio`
--
ALTER TABLE `forma_envio`
ADD PRIMARY KEY (`id_formaenvio`);
--
-- Indices de la tabla `forma_pago`
--
ALTER TABLE `forma_pago`
ADD PRIMARY KEY (`id_formapago`);
--
-- Indices de la tabla `item_carro`
--
ALTER TABLE `item_carro`
ADD PRIMARY KEY (`id_item`,`id_carro`),
ADD KEY `id_carro` (`id_carro`);
--
-- Indices de la tabla `item_pedido`
--
ALTER TABLE `item_pedido`
ADD PRIMARY KEY (`id_pedido`,`id_item`);
--
-- Indices de la tabla `pedido`
--
ALTER TABLE `pedido`
ADD PRIMARY KEY (`id_pedido`),
ADD KEY `FK_PEDIDO_USUARIO` (`id_usuario`),
ADD KEY `FK_PEDIDO_ESTADO` (`estado_pedido`);
--
-- Indices de la tabla `usuario`
--
ALTER TABLE `usuario`
ADD PRIMARY KEY (`id_usuario`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `carro`
--
ALTER TABLE `carro`
MODIFY `id_carro` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT de la tabla `carro_estados`
--
ALTER TABLE `carro_estados`
MODIFY `id_estado_carro` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT de la tabla `estado_pedido`
--
ALTER TABLE `estado_pedido`
MODIFY `id_estado` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT de la tabla `forma_envio`
--
ALTER TABLE `forma_envio`
MODIFY `id_formaenvio` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `forma_pago`
--
ALTER TABLE `forma_pago`
MODIFY `id_formapago` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT de la tabla `pedido`
--
ALTER TABLE `pedido`
MODIFY `id_pedido` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT de la tabla `usuario`
--
ALTER TABLE `usuario`
MODIFY `id_usuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- Restricciones para tablas volcadas
--
--
-- Filtros para la tabla `carro`
--
ALTER TABLE `carro`
ADD CONSTRAINT `FK_CARRO_ENVIO` FOREIGN KEY (`formaenvio_carro`) REFERENCES `forma_envio` (`id_formaenvio`),
ADD CONSTRAINT `FK_CARRO_ESTADO` FOREIGN KEY (`estado_carro`) REFERENCES `carro_estados` (`id_estado_carro`),
ADD CONSTRAINT `FK_CARRO_PAGO` FOREIGN KEY (`formapago_carro`) REFERENCES `forma_pago` (`id_formapago`),
ADD CONSTRAINT `FK_USUARIO_CARRO` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id_usuario`);
--
-- Filtros para la tabla `item_carro`
--
ALTER TABLE `item_carro`
ADD CONSTRAINT `FK_ITEM_CARRO` FOREIGN KEY (`id_carro`) REFERENCES `carro` (`id_carro`);
--
-- Filtros para la tabla `item_pedido`
--
ALTER TABLE `item_pedido`
ADD CONSTRAINT `FK_ITEM_PEDIDO` FOREIGN KEY (`id_pedido`) REFERENCES `pedido` (`id_pedido`);
--
-- Filtros para la tabla `pedido`
--
ALTER TABLE `pedido`
ADD CONSTRAINT `FK_PEDIDO_ESTADO` FOREIGN KEY (`estado_pedido`) REFERENCES `estado_pedido` (`id_estado`),
ADD CONSTRAINT `FK_PEDIDO_USUARIO` FOREIGN KEY (`id_usuario`) REFERENCES `usuario` (`id_usuario`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
alter table "user"
add column "isadmin" boolean not null default false |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.4.6
-- Dumped by pg_dump version 9.4.6
-- Started on 2016-02-22 13:34:42 CET
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- TOC entry 8 (class 2615 OID 32968)
-- Name: tresenraya; Type: SCHEMA; Schema: -; Owner: -
--
CREATE SCHEMA tresenraya;
SET search_path = tresenraya, pg_catalog;
SET default_with_oids = false;
--
-- TOC entry 177 (class 1259 OID 32985)
-- Name: activaciones; Type: TABLE; Schema: tresenraya; Owner: -
--
CREATE TABLE activaciones (
aid integer NOT NULL,
uid bigint NOT NULL,
clave character varying NOT NULL,
fecha_limite timestamp without time zone NOT NULL,
avisado boolean DEFAULT false NOT NULL
);
--
-- TOC entry 176 (class 1259 OID 32983)
-- Name: activaciones_aid_seq; Type: SEQUENCE; Schema: tresenraya; Owner: -
--
CREATE SEQUENCE activaciones_aid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2049 (class 0 OID 0)
-- Dependencies: 176
-- Name: activaciones_aid_seq; Type: SEQUENCE OWNED BY; Schema: tresenraya; Owner: -
--
ALTER SEQUENCE activaciones_aid_seq OWNED BY activaciones.aid;
--
-- TOC entry 181 (class 1259 OID 41571)
-- Name: partidas; Type: TABLE; Schema: tresenraya; Owner: -
--
CREATE TABLE partidas (
pid character varying NOT NULL,
desafiante integer NOT NULL,
desafiado integer NOT NULL,
aceptado smallint DEFAULT 0 NOT NULL
);
--
-- TOC entry 178 (class 1259 OID 41318)
-- Name: recordarme; Type: TABLE; Schema: tresenraya; Owner: -
--
CREATE TABLE recordarme (
id character varying NOT NULL,
token character varying NOT NULL,
salt character varying NOT NULL,
uid bigint NOT NULL
);
--
-- TOC entry 175 (class 1259 OID 32971)
-- Name: usuarios; Type: TABLE; Schema: tresenraya; Owner: -
--
CREATE TABLE usuarios (
uid integer NOT NULL,
nombre character varying(30) NOT NULL,
contrasena character varying(50) NOT NULL,
correo character varying NOT NULL,
activado boolean NOT NULL,
pais character(2) NOT NULL,
fecha_registro timestamp without time zone DEFAULT now() NOT NULL,
info_partidas integer[] DEFAULT '{0,0,0,0}'::integer[] NOT NULL,
fecha_conexion timestamp without time zone,
direccion_ip inet
);
--
-- TOC entry 180 (class 1259 OID 41561)
-- Name: usuarios_conectados; Type: TABLE; Schema: tresenraya; Owner: -
--
CREATE TABLE usuarios_conectados (
uid bigint NOT NULL,
nombre character(30) NOT NULL,
pais character(2)
);
--
-- TOC entry 179 (class 1259 OID 41441)
-- Name: usuarios_registrados; Type: VIEW; Schema: tresenraya; Owner: -
--
CREATE VIEW usuarios_registrados AS
SELECT usuarios.uid,
usuarios.nombre
FROM usuarios
WHERE (usuarios.activado = true);
--
-- TOC entry 174 (class 1259 OID 32969)
-- Name: usuarios_uid_seq; Type: SEQUENCE; Schema: tresenraya; Owner: -
--
CREATE SEQUENCE usuarios_uid_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
--
-- TOC entry 2050 (class 0 OID 0)
-- Dependencies: 174
-- Name: usuarios_uid_seq; Type: SEQUENCE OWNED BY; Schema: tresenraya; Owner: -
--
ALTER SEQUENCE usuarios_uid_seq OWNED BY usuarios.uid;
--
-- TOC entry 1915 (class 2604 OID 32988)
-- Name: aid; Type: DEFAULT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY activaciones ALTER COLUMN aid SET DEFAULT nextval('activaciones_aid_seq'::regclass);
--
-- TOC entry 1912 (class 2604 OID 32974)
-- Name: uid; Type: DEFAULT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY usuarios ALTER COLUMN uid SET DEFAULT nextval('usuarios_uid_seq'::regclass);
--
-- TOC entry 1925 (class 2606 OID 41335)
-- Name: activaciones_aid_pkey; Type: CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY activaciones
ADD CONSTRAINT activaciones_aid_pkey PRIMARY KEY (aid);
--
-- TOC entry 1929 (class 2606 OID 41325)
-- Name: recordarme_pkey; Type: CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY recordarme
ADD CONSTRAINT recordarme_pkey PRIMARY KEY (id);
--
-- TOC entry 1931 (class 2606 OID 41570)
-- Name: usuarios_conectados_nombre_ukey; Type: CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY usuarios_conectados
ADD CONSTRAINT usuarios_conectados_nombre_ukey UNIQUE (nombre);
--
-- TOC entry 1919 (class 2606 OID 32981)
-- Name: usuarios_correo_key; Type: CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY usuarios
ADD CONSTRAINT usuarios_correo_key UNIQUE (correo);
--
-- TOC entry 1921 (class 2606 OID 32979)
-- Name: usuarios_nombre_key; Type: CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY usuarios
ADD CONSTRAINT usuarios_nombre_key UNIQUE (nombre);
--
-- TOC entry 1923 (class 2606 OID 41327)
-- Name: usuarios_uid_pkey; Type: CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY usuarios
ADD CONSTRAINT usuarios_uid_pkey PRIMARY KEY (uid);
--
-- TOC entry 1926 (class 1259 OID 41341)
-- Name: fki_activaciones_uid_fkey; Type: INDEX; Schema: tresenraya; Owner: -
--
CREATE INDEX fki_activaciones_uid_fkey ON activaciones USING btree (uid);
--
-- TOC entry 1927 (class 1259 OID 41333)
-- Name: fki_recordarme_uid_fkey; Type: INDEX; Schema: tresenraya; Owner: -
--
CREATE INDEX fki_recordarme_uid_fkey ON recordarme USING btree (uid);
--
-- TOC entry 1932 (class 2606 OID 41336)
-- Name: activaciones_uid_fkey; Type: FK CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY activaciones
ADD CONSTRAINT activaciones_uid_fkey FOREIGN KEY (uid) REFERENCES usuarios(uid);
--
-- TOC entry 1933 (class 2606 OID 41328)
-- Name: recordarme_uid_fkey; Type: FK CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY recordarme
ADD CONSTRAINT recordarme_uid_fkey FOREIGN KEY (uid) REFERENCES usuarios(uid);
--
-- TOC entry 1934 (class 2606 OID 41564)
-- Name: usuarios_conectados_uid_fkey; Type: FK CONSTRAINT; Schema: tresenraya; Owner: -
--
ALTER TABLE ONLY usuarios_conectados
ADD CONSTRAINT usuarios_conectados_uid_fkey FOREIGN KEY (uid) REFERENCES usuarios(uid);
-- Completed on 2016-02-22 13:34:42 CET
--
-- PostgreSQL database dump complete
--
|
/*
Archivo para el usuario dueño de los objetos.
Grupo de trabajo:
-
-
Tabla de contenido del Archivo:
- Creacion de tablas: 2.1-
*/
-- 2.1 Creamos Tabla para los hoteles
CREATE TABLE HOTELES(
ID INT NOT NULL,
DIRECCION VARCHAR2(50) NOT NULL,
CIUDAD VARCHAR2(50) NOT NULL,
CONSTRAINT PK_HOTEL PRIMARY KEY(ID)
);
-- 2.2 Creamos la secuencia para la PK de Tabla hoteles
CREATE SEQUENCE SQ_HOTELES_AUTOINCREMENT INCREMENT BY 1 START WITH 1 MAXVALUE 10000 MINVALUE 1;
CREATE OR REPLACE TRIGGER TR_GHOTELES_AUTOINCREMENT
BEFORE INSERT ON HOTELES
FOR EACH ROW
BEGIN
SELECT SQ_HOTELES_AUTOINCREMENT.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
/
-- 2.3 ingresar datos a la Tabla hoteles
INSERT INTO HOTELES (DIRECCION, CIUDAD) VALUES('Carrera 1A', 'Popayán');
INSERT INTO HOTELES (DIRECCION, CIUDAD) VALUES('Calle 1B', 'Cali');
INSERT INTO HOTELES (DIRECCION, CIUDAD) VALUES('Carrera 2A', 'Medellin');
INSERT INTO HOTELES (DIRECCION, CIUDAD) VALUES('Caller 7A', 'Bogota');
COMMIT;
-- Creamos la Tabla de servicios
CREATE TABLE SERVICIOS(
ID NUMBER NOT NULL,
NOMBRE VARCHAR2(50) NOT NULL,
CONSTRAINT PK_SERVICIOS PRIMARY KEY(ID)
);
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(1, 'Piscina');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(2, 'Jacuzzi');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(3, 'Saunas');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(4, 'Masajes');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(5, 'Turco');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(6, 'Juegos Infantiles');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(7, 'Playa');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(8, 'Bar');
INSERT INTO SERVICIOS(ID, NOMBRE) VALUES(9, 'Discoteca');
COMMIT;
-- Creamos la Tabla de servicios de los hoteles
CREATE TABLE SERVICIOS_HOTEL(
ID NUMBER NOT NULL,
SERVICIO NUMBER NOT NULL,
HOTEL NUMBER NOT NULL,
CONSTRAINT PK_SERVICIOS_HOTEL PRIMARY KEY(ID),
CONSTRAINT FK_SERVICIO_SH FOREIGN KEY (SERVICIO) REFERENCES SERVICIOS,
CONSTRAINT FK_HOTEL_SH FOREIGN KEY (HOTEL) REFERENCES HOTELES
)
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(4, 1);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(3, 1);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(8, 1);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(1, 1);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(2, 1);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(4, 2);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(3, 2);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(8, 2);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(1, 2);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(2, 2);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(4, 3);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(3, 3);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(8, 3);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(1, 3);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(2, 3);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(4, 4);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(3, 4);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(8, 4);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(1, 4);
INSERT INTO SERVICIOS_HOTEL(SERVICIO, HOTEL) VALUES(2, 4);
COMMIT;
-- Creamos la Tabla de habitaciones
CREATE TABLE HABITACIONES(
ID NUMBER NOT NULL,
NOMBRE VARCHAR2(50) NOT NULL,
HOTEL NUMBER NOT NULL,
ESTADO VARCHAR2(50) NOT NULL,
CONSTRAINT PK_HABITACIONES PRIMARY KEY(ID),
CONSTRAINT FK_HOTEL_HABITACIONES FOREIGN KEY (HOTEL) REFERENCES HOTELES,
CONSTRAINT CH_ESTADO_HABITACION CHECK(ESTADO in ('LIBRE','RESERVADA'))
);
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('201', 1, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('202', 1, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('203', 1, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('204', 1, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('205', 1, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('201', 2, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('202', 2, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('203', 2, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('204', 2, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('205', 2, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('201', 3, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('202', 3, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('203', 3, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('204', 3, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('205', 3, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('201', 4, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('202', 4, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('203', 4, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('204', 4, 'LIBRE');
INSERT INTO HABITACIONES(NOMBRE, HOTEL, ESTADO) VALUES('205', 4, 'LIBRE');
COMMIT;
-- Creamos la Tabla de amenidades
CREATE TABLE AMENIDADES(
ID NUMBER NOT NULL,
NOMBRE VARCHAR2(50) NOT NULL,
CONSTRAINT PK_AMENIDADES PRIMARY KEY(ID)
);
INSERT INTO AMENIDADES(ID, NOMBRE) VALUES(1, 'Wi-Fi');
INSERT INTO AMENIDADES(ID, NOMBRE) VALUES(2, 'TV');
INSERT INTO AMENIDADES(ID, NOMBRE) VALUES(3, 'Aire Acondicionado');
INSERT INTO AMENIDADES(ID, NOMBRE) VALUES(4, 'Nevera');
INSERT INTO AMENIDADES(ID, NOMBRE) VALUES(5, 'Tina');
INSERT INTO AMENIDADES(ID, NOMBRE) VALUES(6, 'Jacuzzi');
COMMIT;
-- Creamos la Tabla de amenidades de las habitaciones
CREATE TABLE AMENIDADES_HABITACION(
ID NUMBER NOT NULL,
AMENIDAD NUMBER NOT NULL,
HABITACION NUMBER NOT NULL,
CONSTRAINT PK_AMENIDADES_HABITACIONL PRIMARY KEY(ID),
CONSTRAINT FK_AMENIDAD_AH FOREIGN KEY (AMENIDAD) REFERENCES AMENIDADES,
CONSTRAINT FK_HABITACION_AH FOREIGN KEY (HABITACION) REFERENCES HABITACIONES
)
-- Insertamos amenidades para la habitacion 1 del hotel 1
INSERT INTO AMENIDADES_HABITACION(AMENIDAD, HABITACION) VALUES(1, 1);
INSERT INTO AMENIDADES_HABITACION(AMENIDAD, HABITACION) VALUES(3, 1);
INSERT INTO AMENIDADES_HABITACION(AMENIDAD, HABITACION) VALUES(4, 1);
COMMIT;
-- 2.4 Creamos la Tabla de clientes
CREATE TABLE CLIENTES(
ID NUMBER NOT NULL,
NOMBRES VARCHAR2(50) NOT NULL,
CEDULA VARCHAR2(50) NOT NULL,
CONSTRAINT PK_CLIENTE PRIMARY KEY(ID),
CONSTRAINT UQ_CEDULA UNIQUE(CEDULA)
);
-- 2.5 Creamos la secuencia para la PK de Tabla Clientes
CREATE SEQUENCE SQ_CLIENTES_AUTOINCREMENT INCREMENT BY 1 START WITH 1 MAXVALUE 10000 MINVALUE 1;
CREATE OR REPLACE TRIGGER TR_GCLIENTES_AUTOINCREMENT
BEFORE INSERT ON CLIENTES
FOR EACH ROW
BEGIN
SELECT SQ_CLIENTES_AUTOINCREMENT.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
/
-- 2.6 ingresar datos a la Tabla CLIENTES
INSERT INTO CLIENTES (NOMBRES, CEDULA) VALUES('<NAME>', '1061765345');
INSERT INTO CLIENTES (NOMBRES, CEDULA) VALUES('<NAME>', '6543546587');
INSERT INTO CLIENTES (NOMBRES, CEDULA) VALUES('<NAME>', '4352657654');
INSERT INTO CLIENTES (NOMBRES, CEDULA) VALUES('<NAME>', '1067233654');
INSERT INTO CLIENTES (NOMBRES, CEDULA) VALUES('ESTEBAN VALENCIA', '8907234567');
COMMIT;
-- 2.7 Creamos la Tabla de temporadas para los hoteles
CREATE TABLE TEMPORADAS(
ID INT NOT NULL,
HOTEL INT NOT NULL,
TEMPORADA VARCHAR2(50) NOT NULL,
FECHA_INICIO DATE NOT NULL,
FECHA_FINAL DATE NOT NULL,
CONSTRAINT PK_TEMPORADA PRIMARY KEY(ID),
CONSTRAINT FK_TEMPORADA_HOTEL FOREIGN KEY (HOTEL) REFERENCES HOTELES,
CONSTRAINT CH_TEMPORADA_VALOR CHECK(TEMPORADA in ('ALTA','MEDIA','BAJA'))
);
-- 2.8 Creamos la secuencia para la PK de Tabla Clientes
CREATE SEQUENCE SQ_TEMPORADAS_AUTOINCREMENT INCREMENT BY 1 START WITH 1 MAXVALUE 10000 MINVALUE 1;
CREATE OR REPLACE TRIGGER TRG_TEMPORADAS_AUTOINCREMENT
BEFORE INSERT ON TEMPORADAS
FOR EACH ROW
BEGIN
SELECT SQ_TEMPORADAS_AUTOINCREMENT.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
/
-- 2.9 ingresar datos a la Tabla TEMPORADAS
INSERT INTO TEMPORADAS
(HOTEL, TEMPORADA, FECHA_INICIO, FECHA_FINAL)
VALUES
(1, 'ALTA', TO_DATE('10/10/2021', 'MM/DD/YYYY'), TO_DATE('11/27/2021', 'MM/DD/YYYY'));
INSERT INTO TEMPORADAS
(HOTEL, TEMPORADA, FECHA_INICIO, FECHA_FINAL)
VALUES
(2, 'BAJA', TO_DATE('10/10/2021', 'MM/DD/YYYY'), TO_DATE('12/12/2021', 'MM/DD/YYYY'));
INSERT INTO TEMPORADAS
(HOTEL, TEMPORADA, FECHA_INICIO, FECHA_FINAL)
VALUES
(3, 'MEDIA', TO_DATE('10/10/2021', 'MM/DD/YYYY'), TO_DATE('12/22/2021', 'MM/DD/YYYY'));
INSERT INTO TEMPORADAS
(HOTEL, TEMPORADA, FECHA_INICIO, FECHA_FINAL)
VALUES
(4, 'ALTA', TO_DATE('10/10/2021', 'MM/DD/YYYY'), TO_DATE('12/27/2021', 'MM/DD/YYYY'));
COMMIT;
-- 2.10 Creamos la Tabla de reservas
CREATE TABLE RESERVAS(
ID INT NOT NULL,
CLIENTE INT NOT NULL,
HOTEL INT NOT NULL,
FECHA DATE NOT NULL,
VALOR FLOAT(3) NOT NULL,
TEMPORADA INT NOT NULL,
CONSTRAINT PK_RESERVA PRIMARY KEY(ID),
CONSTRAINT FK_RESERVA_CLIENTE FOREIGN KEY (CLIENTE) REFERENCES CLIENTES,
CONSTRAINT FK_RESERVA_HOTEL FOREIGN KEY (HOTEL) REFERENCES HOTELES,
CONSTRAINT FK_RESERVA_TEMPORADA FOREIGN KEY (TEMPORADA) REFERENCES TEMPORADAS,
CONSTRAINT CH_VALOR CHECK(VALOR>0)
);
-- 2.11 Creamos la secuencia para la PK de Tabla Reservas
CREATE SEQUENCE SQ_RESERVAS_AUTOINCREMENT INCREMENT BY 1 START WITH 1 MAXVALUE 10000 MINVALUE 1;
CREATE OR REPLACE TRIGGER TRG_RESERVAS_AUTOINCREMENT
BEFORE INSERT ON RESERVAS
FOR EACH ROW
BEGIN
SELECT SQ_RESERVAS_AUTOINCREMENT.NEXTVAL INTO :NEW.ID FROM DUAL;
END;
/
-- 2.9 ingresar datos a la Tabla TEMPORADAS
INSERT INTO RESERVAS
(CLIENTE, HOTEL, FECHA, VALOR, TEMPORADA)
VALUES
(1, 1, TO_DATE('10/10/2021', 'MM/DD/YYYY'), 100000, 1);
INSERT INTO RESERVAS
(CLIENTE, HOTEL, FECHA, VALOR, TEMPORADA)
VALUES
(2, 2, TO_DATE('10/10/2021', 'MM/DD/YYYY'), 100000, 2);
INSERT INTO RESERVAS
(CLIENTE, HOTEL, FECHA, VALOR, TEMPORADA)
VALUES
(3, 3, TO_DATE('10/10/2021', 'MM/DD/YYYY'), 100000, 3);
INSERT INTO RESERVAS
(CLIENTE, HOTEL, FECHA, VALOR, TEMPORADA)
VALUES
(4, 4, TO_DATE('10/10/2021', 'MM/DD/YYYY'), 100000, 4);
INSERT INTO RESERVAS
(CLIENTE, HOTEL, FECHA, VALOR, TEMPORADA)
VALUES
(5, 4, TO_DATE('10/10/2021', 'MM/DD/YYYY'), 100000, 4);
COMMIT;
-- 3.1 Crear vista para consultar las reservas por hotel
CREATE OR REPLACE VIEW GET_RESERVAS_POR_HOTEL
AS
SELECT C.NOMBRES AS CLIENTE, C.CEDULA AS CEDULA_CLIENTE, R.FECHA, T.TEMPORADA,H.DIRECCION AS DIRECCION_HOTEL, H.CIUDAD
FROM RESERVAS R
JOIN CLIENTES C ON R.CLIENTE=C.ID
JOIN HOTELES H ON R.HOTEL=H.ID
JOIN TEMPORADAS T ON R.TEMPORADA=T.ID;
-- 3.2 Crear vista para consultar las TEMPORADAS por hotel
CREATE OR REPLACE VIEW GET_TEMPORADAS_POR_HOTEL
AS
SELECT H.ID AS ID_HOTEL, H.DIRECCION AS DIRECCION_HOTEL, H.CIUDAD, T.TEMPORADA, T.FECHA_INICIO, T.FECHA_FINAL FROM HOTELES H JOIN TEMPORADAS T ON T.HOTEL=H.ID;
-- 3.3 Asignamos permisos al usuario de Auditorias
GRANT SELECT ON HOTELES TO AUDITORIAS;
GRANT SELECT ON CLIENTES TO AUDITORIAS;
GRANT SELECT ON TEMPORADAS TO AUDITORIAS;
GRANT SELECT ON RESERVAS TO AUDITORIAS;
-- 4.2 Creamos vistas para cada tabla de Owner
CREATE OR REPLACE VIEW VHOTELES
(ID,DIRECCION,CIUDAD,PISCINA,JACUZZI,SAUNA,MASAJES,TURCO,JUEGOS,PLAYA,BAR,DISCOTECA)
AS
SELECT H.ID,H.DIRECCION,H.CIUDAD,H.PISCINA,H.JACUZZI,H.SAUNA,H.MASAJES,H.TURCO,H.JUEGOS,H.PLAYA,H.BAR,H.DISCOTECA FROM HOTELES H;
CREATE OR REPLACE VIEW VCLIENTES
(ID, NOMBRES, CEDULA)
AS
SELECT C.ID, C.NOMBRES, C.CEDULA FROM CLIENTES C;
CREATE OR REPLACE VIEW VTEMPORADAS
(ID, HOTEL, TEMPORADA, FECHA_INICIO, FECHA_FINAL)
AS
SELECT T.ID, T.HOTEL, T.TEMPORADA, T.FECHA_INICIO, T.FECHA_FINAL FROM TEMPORADAS T;
CREATE OR REPLACE VIEW VRESERVAS
(ID, CLIENTE, HOTEL, FECHA, VALOR, TEMPORADA)
AS
SELECT R.ID, R.CLIENTE, R.HOTEL, R.FECHA, R.VALOR, R.TEMPORADA FROM RESERVAS R;
-- 4.3 Asignamos permisos para acceder a las vistas del Schema Owner
GRANT SELECT ON GET_RESERVAS_POR_HOTEL TO GERENCIA;
GRANT SELECT ON GET_TEMPORADAS_POR_HOTEL TO GERENCIA;
GRANT SELECT, UPDATE, DELETE, INSERT ON VHOTELES TO GERENCIA;
GRANT SELECT, UPDATE, DELETE, INSERT ON VCLIENTES TO GERENCIA;
GRANT SELECT, UPDATE, DELETE, INSERT ON VTEMPORADAS TO GERENCIA;
GRANT SELECT, UPDATE, DELETE, INSERT ON VRESERVAS TO GERENCIA;
GRANT SELECT ON GET_RESERVAS_POR_HOTEL TO RECEPCION;
GRANT SELECT ON VHOTELES TO RECEPCION;
GRANT SELECT, INSERT ON VRESERVAS TO RECEPCION;
GRANT SELECT, INSERT, UPDATE ON VCLIENTES TO RECEPCION;
-- 5.1 Consulta para saber los hoteles ubicados en la ciudad de Popayán
SELECT H.ID AS ID_HOTEL, H.DIRECCION, H.CIUDAD FROM HOTELES H WHERE H.CIUDAD='Popayán';
-- 5.2 Consulta para listar las reservas del hotel con el ID=4
SELECT C.NOMBRES AS CLIENTE, C.CEDULA AS CEDULA_CLIENTE, R.FECHA, H.DIRECCION AS DIRECCION_HOTEL, H.CIUDAD
FROM RESERVAS R
JOIN CLIENTES C ON R.CLIENTE=C.ID
JOIN HOTELES H ON R.HOTEL=H.ID
WHERE H.ID=4;
-- 5.3 Consulta para listart las reservas que tenga una temporada ALTA
SELECT C.NOMBRES AS CLIENTE, C.CEDULA AS CEDULA_CLIENTE, R.FECHA, T.TEMPORADA,H.DIRECCION AS DIRECCION_HOTEL, H.CIUDAD
FROM RESERVAS R
JOIN CLIENTES C ON R.CLIENTE=C.ID
JOIN HOTELES H ON R.HOTEL=H.ID
JOIN TEMPORADAS T ON R.TEMPORADA=T.ID
WHERE T.TEMPORADA='ALTA';
-- 5.4 Consulta para listar las reservas con fecha de '10/10/2021' en los hoteles de la ciudad de Popayán
SELECT C.NOMBRES AS CLIENTE, C.CEDULA AS CEDULA_CLIENTE, R.FECHA, T.TEMPORADA,H.DIRECCION AS DIRECCION_HOTEL, H.CIUDAD
FROM RESERVAS R
JOIN CLIENTES C ON R.CLIENTE=C.ID
JOIN HOTELES H ON R.HOTEL=H.ID
JOIN TEMPORADAS T ON R.TEMPORADA=T.ID
WHERE R.FECHA='10/10/2021' AND H.CIUDAD='Popayán';
-- 5.5 Consulta para listar los hoteles que cuenta con servicios de: SAUNA y TURCO
SELECT C.NOMBRES AS CLIENTE, C.CEDULA AS CEDULA_CLIENTE, R.FECHA, T.TEMPORADA,H.DIRECCION AS DIRECCION_HOTEL, H.CIUDAD
FROM RESERVAS R
JOIN CLIENTES C ON R.CLIENTE=C.ID
JOIN HOTELES H ON R.HOTEL=H.ID
JOIN TEMPORADAS T ON R.TEMPORADA=T.ID
WHERE H.SAUNA=1 AND H.TURCO=1; |
INSERT INTO track_locations VALUES
(1,4,37.775485,-122.435077,'Velit ad et quis fugiat nostrud esse tempor sunt. Voluptate ut consectetur aute magna. Magna in non deserunt Lorem ullamco quis velit quis ea eu elit sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-03 02:54:03'),
(2,19,37.749928,-122.451506,'Occaecat excepteur aliquip qui cillum. Quis laborum incididunt ea tempor excepteur consectetur ex adipisicing nostrud dolor dolor ullamco Lorem. Laborum amet labore aliqua cupidatat occaecat commodo laboris dolor consectetur occaecat eiusmod qui aute occaecat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-28 02:04:38'),
(3,34,37.721391,-122.477951,'Laboris esse et mollit nisi sit consectetur ut dolore elit do eiusmod proident occaecat. Culpa amet ea fugiat consectetur cupidatat eiusmod est incididunt minim reprehenderit sit dolor. Tempor aliquip dolore officia magna labore reprehenderit Lorem reprehenderit cillum est.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-02 03:58:59'),
(4,3,37.748179,-122.486153,'Minim pariatur anim anim officia consectetur mollit aute mollit. Laboris sint sint excepteur eiusmod nisi ad aute ipsum deserunt. Veniam ea proident excepteur nisi.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-21 08:48:13'),
(5,9,37.725699,-122.38807,'Consectetur occaecat sint excepteur ut. Duis do veniam excepteur ex nostrud excepteur excepteur in. Consectetur ea adipisicing culpa excepteur nisi esse mollit occaecat elit ea.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-31 01:47:20'),
(6,10,37.791093,-122.441538,'Incididunt Lorem ut ut ex. Officia id tempor qui est exercitation officia sint sunt culpa sint labore qui. Amet cillum sit tempor cillum duis consectetur voluptate minim nulla magna.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-07 07:10:50'),
(7,42,37.70519,-122.400646,'Enim labore in in quis non. Eiusmod elit proident nulla dolor occaecat pariatur velit et. Ex culpa nulla occaecat laboris magna magna nisi commodo dolore non nisi elit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-16 09:24:06'),
(8,49,37.762411,-122.400098,'Incididunt nulla sint enim id quis ut nulla nisi veniam. Anim ut irure duis deserunt velit nisi pariatur amet ullamco fugiat dolor fugiat anim. Laboris ut excepteur aute sit est ea velit aliquip.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-07 07:59:34'),
(9,17,37.713894,-122.470613,'Ea aute irure minim anim cupidatat et sunt est sint est ex. Elit nisi commodo consequat ipsum non nulla sint non pariatur nulla cillum dolor Lorem. Voluptate et aute fugiat occaecat officia ad fugiat voluptate occaecat aliquip culpa.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-15 11:33:56'),
(10,31,37.749368,-122.501458,'Voluptate do et elit mollit velit veniam et est laborum sit exercitation. Reprehenderit fugiat voluptate cupidatat pariatur veniam cupidatat reprehenderit reprehenderit. Dolor id cillum anim veniam occaecat aute laborum dolore commodo amet deserunt commodo id incididunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-13 05:31:04'),
(11,15,37.787161,-122.470752,'Amet consectetur cillum consectetur incididunt amet. Fugiat Lorem ipsum non aliqua elit deserunt duis Lorem ex. Cillum cupidatat irure ipsum minim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-13 04:55:20'),
(12,45,37.725391,-122.39024,'Laboris fugiat minim sunt et minim fugiat qui incididunt labore et ex consectetur officia officia. Occaecat et in nostrud ut magna commodo velit exercitation nulla sunt consectetur nulla amet. Minim officia officia esse nostrud labore cillum dolore nostrud in sit eiusmod sint pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-05 05:09:48'),
(13,12,37.711218,-122.439349,'Adipisicing tempor qui enim eiusmod adipisicing quis ullamco laboris ad adipisicing consectetur irure. Eiusmod tempor et mollit consequat in magna voluptate consequat cupidatat magna culpa incididunt commodo. Anim eu ea et dolor.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-23 02:45:46'),
(14,40,37.722989,-122.505206,'Culpa sunt eu velit duis sit officia incididunt fugiat et et deserunt veniam ad do. Culpa est deserunt veniam ea est. Enim sunt proident cillum quis sit sit magna aute dolor in sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-03 08:18:42'),
(15,22,37.732242,-122.453514,'Dolore id velit aliquip cillum cillum velit laboris. Adipisicing dolor aute aute incididunt cupidatat non excepteur magna nostrud sint occaecat. Tempor dolore adipisicing dolor deserunt incididunt enim amet Lorem aliqua cillum sunt minim sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-20 10:16:24'),
(16,3,37.795105,-122.440754,'Esse laboris sint tempor non reprehenderit mollit non qui cillum. In do labore ut eu anim eu velit duis. Ut Lorem sit do officia in id nisi cillum veniam eiusmod.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-19 07:53:27'),
(17,32,37.780429,-122.41093,'Aliqua ullamco id ad proident culpa Lorem anim aute nulla elit ullamco. Qui ex culpa fugiat nulla quis. Consectetur amet culpa nulla laboris dolore consequat elit do adipisicing laboris deserunt nisi nisi.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-09 08:51:59'),
(18,12,37.768146,-122.470829,'Anim consectetur nulla Lorem ea et et culpa sunt magna pariatur. Ex veniam aliquip aute deserunt. Labore eiusmod cupidatat enim excepteur ut ullamco amet cupidatat mollit occaecat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-16 11:24:50'),
(19,47,37.761985,-122.40816,'Aute eu non consequat non id reprehenderit labore et quis velit est irure ea reprehenderit. Eiusmod consequat esse fugiat do minim. Ea magna ex incididunt duis aute ex sunt deserunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-25 08:01:20'),
(20,41,37.706392,-122.396893,'Exercitation esse consectetur enim dolor commodo incididunt commodo mollit nostrud labore amet. Deserunt ea ad exercitation irure reprehenderit. Cillum commodo aliqua culpa aute ipsum est culpa.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-21 06:04:39'),
(21,43,37.748313,-122.406026,'Sit nostrud occaecat exercitation magna quis consequat pariatur. Officia sint sunt adipisicing deserunt in id minim tempor esse officia ut elit quis. Anim sunt ea ullamco non ullamco id exercitation Lorem cillum anim aliquip nostrud.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-10 01:30:33'),
(22,48,37.751606,-122.411524,'Aliqua velit pariatur ut elit officia duis id aute irure laboris do minim Lorem sunt. Pariatur est commodo sint elit nulla qui tempor cillum. Et incididunt tempor eu ut proident voluptate aute id aliqua.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-23 01:57:52'),
(23,8,37.755672,-122.506666,'Magna pariatur nisi sunt sit dolore cupidatat dolore cupidatat commodo est incididunt mollit. Dolor laborum aute sint laboris esse cillum reprehenderit eu dolore. Occaecat excepteur aliqua ad ad occaecat commodo ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-14 06:18:15'),
(24,4,37.730212,-122.385566,'Eu amet culpa occaecat est nulla exercitation proident cillum laborum cupidatat. In do minim consectetur laboris eu esse exercitation adipisicing cupidatat. Quis aliqua do laborum do adipisicing.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-15 10:28:08'),
(25,19,37.791592,-122.477403,'Occaecat magna eu et aliqua nostrud in eiusmod cupidatat qui reprehenderit eiusmod minim magna nisi. Aliqua fugiat aliqua aliquip magna tempor aliquip nulla id ullamco do cillum velit voluptate. Elit reprehenderit sint aute proident enim tempor deserunt quis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-26 02:00:16'),
(26,15,37.764356,-122.395661,'Esse id dolore amet commodo occaecat veniam magna ea. Nisi minim velit pariatur anim ullamco nisi proident consequat. Laborum commodo est anim reprehenderit dolor id excepteur Lorem mollit reprehenderit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-09 03:27:42'),
(27,16,37.776122,-122.405066,'Ex esse officia aliquip reprehenderit. Commodo labore incididunt duis reprehenderit tempor consectetur Lorem sunt. Laboris ad duis reprehenderit pariatur irure incididunt Lorem enim ullamco laboris nostrud sunt nisi id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-09 01:46:53'),
(28,17,37.741051,-122.480649,'Lorem qui sint tempor sint. Mollit anim culpa enim veniam enim incididunt nisi non reprehenderit ad labore nulla. Et commodo anim Lorem aliqua proident nisi proident duis sunt incididunt ex esse aliqua nisi.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-11 12:26:08'),
(29,18,37.745239,-122.447239,'Est ex sunt minim pariatur et incididunt sit mollit reprehenderit exercitation occaecat aliquip veniam ut. Tempor non et dolore sit mollit deserunt incididunt esse dolor sint magna sit labore reprehenderit. Laborum ipsum ad sint sunt laboris est est velit sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-08 11:38:02'),
(30,10,37.747312,-122.479205,'Sint pariatur est esse amet amet reprehenderit id cillum culpa culpa aliqua aliquip ex. Cupidatat eu consectetur esse nostrud. Et non nostrud quis esse incididunt ullamco mollit occaecat ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-15 05:54:49'),
(31,23,37.733299,-122.423836,'Voluptate incididunt ad est do ullamco ut proident id. Elit consectetur occaecat reprehenderit sint aute proident anim excepteur sit ea quis duis. Commodo duis mollit enim sint exercitation dolore excepteur adipisicing sint mollit fugiat deserunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-15 11:21:46'),
(32,21,37.705725,-122.419068,'Ut culpa nulla ad eiusmod nisi sit tempor fugiat tempor ea dolor. Ex sunt aliqua amet id eu id irure reprehenderit. Irure deserunt dolore ut proident quis elit sit cupidatat commodo mollit veniam nulla irure.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-25 08:20:20'),
(33,32,37.776065,-122.447063,'Ipsum tempor incididunt dolor adipisicing adipisicing ad occaecat veniam. Reprehenderit ullamco in anim culpa sunt Lorem qui aliqua fugiat fugiat non. Eiusmod aliqua anim ut non proident duis do sit eiusmod qui.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-06 05:53:24'),
(34,16,37.745826,-122.403745,'Esse Lorem anim aliquip proident id adipisicing. Deserunt cillum id laborum reprehenderit eiusmod labore nostrud reprehenderit voluptate enim magna eiusmod velit. Aute irure veniam aliqua veniam nulla eu et irure et tempor commodo nisi laboris labore.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-19 03:26:47'),
(35,40,37.765466,-122.407948,'Dolore eiusmod elit anim ea voluptate tempor do sit cillum. Eu voluptate qui tempor nulla do esse consectetur minim nostrud. Duis cupidatat sunt deserunt id id est deserunt exercitation irure nostrud.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-14 02:39:50'),
(36,35,37.756269,-122.494098,'Labore elit qui irure nulla anim ad esse culpa laborum quis pariatur officia tempor. Lorem est laboris deserunt cupidatat sint duis eu adipisicing mollit sint commodo fugiat magna anim. Nulla ea amet cupidatat ex ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-25 04:13:38'),
(37,22,37.783429,-122.421678,'Eiusmod ad tempor officia ullamco dolor ullamco anim nisi deserunt reprehenderit non. Qui consequat nisi reprehenderit excepteur dolore. Deserunt officia consequat adipisicing ex quis quis non irure id esse id magna magna id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-23 10:56:21'),
(38,36,37.788403,-122.422246,'Ex veniam consequat et exercitation aute adipisicing laborum excepteur quis consectetur. Quis nulla fugiat enim ex tempor sunt magna voluptate excepteur non sit laborum. Enim duis reprehenderit voluptate ad sint quis amet cupidatat tempor magna duis esse voluptate.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-06 01:03:31'),
(39,10,37.726997,-122.461258,'Est anim elit dolor ipsum officia adipisicing laborum anim. Ullamco excepteur esse tempor sint duis reprehenderit ea ut minim quis aute. Pariatur ullamco ex eu sint cupidatat ut aute ea nisi consectetur id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-13 04:05:27'),
(40,39,37.762437,-122.424577,'Exercitation non adipisicing ut officia veniam commodo incididunt ullamco. Adipisicing velit non sint id. Lorem irure eu labore cupidatat fugiat laborum cillum incididunt incididunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-03 12:23:29'),
(41,44,37.745592,-122.406498,'Excepteur commodo pariatur amet amet ea sint aliqua et. Fugiat eu anim ipsum consectetur ipsum do dolor exercitation laboris eu officia dolore. Qui esse voluptate voluptate adipisicing.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-20 03:18:17'),
(42,35,37.785498,-122.493201,'Officia irure commodo adipisicing anim occaecat fugiat anim irure et magna ut laboris. Voluptate aliqua dolore mollit do labore est non eu ad culpa dolor pariatur nisi. Culpa aliquip aute et anim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-11 06:44:19'),
(43,44,37.748083,-122.460728,'Aliqua consectetur exercitation exercitation reprehenderit est eu sit. Dolore ad deserunt laborum ullamco fugiat irure dolor qui do id laboris ad aute. Commodo ullamco cupidatat enim sunt aute.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-08 06:05:27'),
(44,36,37.711611,-122.398561,'Ut ut minim eiusmod in exercitation proident aliquip dolor magna culpa est amet eu dolor. Exercitation ex culpa laboris amet non magna veniam amet. Pariatur minim et cillum eu consectetur sint irure laboris nostrud labore ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-23 05:47:40'),
(45,5,37.707651,-122.381934,'Enim voluptate aute nisi nisi dolore veniam amet. Qui et sint velit anim anim enim dolore amet quis ex officia anim. Esse reprehenderit excepteur fugiat laboris ea fugiat anim Lorem culpa labore duis sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-10 04:05:19'),
(46,40,37.779048,-122.398334,'Cillum est nulla culpa quis sint mollit ullamco labore. Magna id voluptate dolor id. Dolore ea incididunt aute adipisicing sit ullamco in.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-12 05:26:38'),
(47,19,37.711208,-122.481187,'In magna enim incididunt nulla amet. Quis est dolor deserunt id amet esse id excepteur sint ex. Duis dolor aliqua minim cillum aliqua velit irure veniam sint aute.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-13 07:38:30'),
(48,17,37.748141,-122.416135,'Nulla quis velit esse ex nulla labore nostrud. Occaecat dolor est officia veniam proident. Amet laboris proident laborum veniam tempor et ex consectetur officia aute aute veniam.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-17 04:55:35'),
(49,47,37.721077,-122.483741,'Id anim aute consectetur et duis proident consectetur officia adipisicing. Ex proident commodo eiusmod amet ex pariatur qui incididunt irure dolore adipisicing do. Sint elit dolore minim veniam eiusmod exercitation proident.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-21 07:01:08'),
(50,42,37.752778,-122.393939,'Nisi sunt ex sunt commodo est Lorem ipsum cupidatat elit cillum ad non enim. Magna cillum id deserunt minim cupidatat anim est aliquip qui non magna. Veniam sint dolor commodo mollit Lorem cillum laboris esse.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-31 03:56:25'),
(51,6,37.722784,-122.477083,'Officia consectetur enim Lorem dolor. Velit reprehenderit ullamco eu mollit. Quis aliqua dolor velit id nulla pariatur reprehenderit non anim deserunt id ad.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-30 12:49:28'),
(52,39,37.792975,-122.490434,'Aliquip commodo deserunt est consequat. Nisi et velit dolore nulla excepteur ad aute mollit. Ea ea Lorem eu do eiusmod excepteur non laborum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-01 12:02:14'),
(53,4,37.747612,-122.408908,'Exercitation reprehenderit consequat fugiat ipsum mollit eu nulla anim elit do sit aliquip sint. Adipisicing do et aliquip dolore laboris elit cillum enim fugiat fugiat ea occaecat nulla. Aliqua excepteur aute in commodo nulla proident in eu voluptate.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-10 04:00:47'),
(54,48,37.779532,-122.438549,'Nisi eiusmod cillum excepteur sint aliqua fugiat. Excepteur nostrud Lorem est adipisicing magna labore occaecat irure amet consequat mollit. Id cupidatat elit incididunt enim eu id non ad ullamco veniam ex.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-18 01:45:27'),
(55,19,37.78525,-122.489923,'Laboris pariatur amet ipsum amet esse enim non reprehenderit nostrud enim ea irure deserunt. Consequat eiusmod non occaecat est velit deserunt et tempor culpa laborum minim sunt adipisicing. Ipsum aliquip labore occaecat anim consectetur dolore eu ea sit laboris.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-21 03:57:58'),
(56,22,37.766852,-122.421889,'Fugiat do adipisicing minim dolor nostrud consectetur anim officia ea laborum do non id. Nostrud nostrud nisi mollit sit cillum occaecat veniam. Consequat voluptate tempor dolor fugiat minim mollit et.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-05 04:31:36'),
(57,4,37.758531,-122.495513,'Exercitation cupidatat sunt pariatur do. Eiusmod qui irure nostrud magna consequat aliquip pariatur amet laborum. Voluptate voluptate ullamco consectetur labore officia officia officia excepteur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-26 10:59:29'),
(58,15,37.757746,-122.500045,'Amet eu in nisi veniam qui dolore nostrud fugiat dolor eu ex. Magna tempor et exercitation minim est aliqua qui elit ea qui do deserunt. Non ipsum esse ex officia dolor deserunt eiusmod cillum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-23 11:55:35'),
(59,42,37.792751,-122.490985,'Elit exercitation aliqua irure commodo eu consectetur proident nisi consectetur. Quis Lorem esse est mollit in nostrud veniam cillum magna amet laborum. Proident do ullamco do enim laboris irure velit anim amet veniam excepteur sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-28 01:14:16'),
(60,10,37.741365,-122.456854,'Cupidatat do do ad id Lorem enim sit elit irure ea labore ex. Adipisicing in cillum occaecat adipisicing cupidatat aute officia dolore irure. Amet nulla amet officia eu.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-07 05:17:42'),
(61,26,37.721816,-122.416588,'Do ipsum exercitation ad nostrud in. Voluptate culpa nostrud aliquip eu nostrud reprehenderit pariatur eu et quis consectetur mollit fugiat officia. Reprehenderit cupidatat sint ex dolor laboris voluptate consequat ipsum laborum proident.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-19 10:27:19'),
(62,33,37.754244,-122.494353,'Consectetur voluptate reprehenderit amet adipisicing cillum enim nisi voluptate ea. Tempor fugiat eiusmod consequat nulla officia Lorem ullamco nostrud esse sit excepteur. Et laborum fugiat non id in elit consequat id velit veniam ullamco incididunt ad ad.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-25 05:09:23'),
(63,6,37.758691,-122.408886,'Magna aliqua veniam pariatur quis adipisicing ex cupidatat elit eiusmod pariatur. Magna irure mollit eiusmod magna adipisicing do quis. Culpa ad reprehenderit ad eiusmod.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-12 06:57:20'),
(64,38,37.743135,-122.44058,'Sint enim et dolor proident. Lorem laborum esse velit irure sint incididunt laborum qui ad culpa mollit officia ipsum fugiat. Pariatur culpa tempor tempor velit aute consequat do ut velit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-05 12:49:49'),
(65,42,37.721457,-122.488862,'Voluptate consectetur duis consectetur nostrud minim. Reprehenderit ullamco proident excepteur officia occaecat. Ad laborum excepteur in eiusmod adipisicing fugiat proident non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-11 04:07:07'),
(66,35,37.712909,-122.487666,'Culpa mollit incididunt qui aute proident ad id. Cillum aliquip ex proident mollit cillum magna nostrud non in amet ipsum. Ullamco ullamco dolore ut enim eu qui.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-25 12:07:07'),
(67,42,37.730843,-122.50232,'Ea quis deserunt elit culpa deserunt ea esse fugiat ad commodo enim Lorem aute esse. Excepteur anim proident sint duis. Officia enim id velit minim enim magna commodo sunt nisi eu ex magna fugiat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-04 02:23:01'),
(68,12,37.747666,-122.415672,'Ullamco eu quis in occaecat duis dolore proident mollit et non id. Deserunt ut fugiat proident culpa aliqua laborum aliqua aliqua sint proident voluptate non sit. Deserunt deserunt excepteur Lorem enim in labore id do anim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-28 09:20:49'),
(69,50,37.793392,-122.46435,'Consequat elit est laboris magna tempor sint id Lorem ad cillum. Ad enim sint eu occaecat aliquip commodo nulla voluptate qui laborum nostrud irure occaecat. Eiusmod sunt anim incididunt nisi magna tempor.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-01 01:43:13'),
(70,13,37.793151,-122.46486,'Officia proident ad voluptate sint enim cupidatat. Dolor deserunt sint velit adipisicing magna. Commodo non in aute ad anim adipisicing qui labore amet.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-24 10:20:18'),
(71,44,37.793505,-122.481837,'Quis culpa proident esse aute in commodo occaecat. Laborum ullamco deserunt in cupidatat duis ipsum magna cillum consectetur eiusmod aliquip consequat pariatur nostrud. Eiusmod in ipsum mollit ipsum dolore nulla nostrud sit labore irure fugiat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-10 04:59:31'),
(72,50,37.740168,-122.414869,'Et in esse adipisicing reprehenderit ullamco consectetur sunt mollit laborum cupidatat ut ad proident proident. Ad fugiat dolor cupidatat et tempor deserunt dolor consequat consectetur irure exercitation aliquip ex. Qui ipsum enim Lorem nostrud officia.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-13 05:09:07'),
(73,24,37.769592,-122.421013,'Eiusmod ullamco reprehenderit duis officia quis velit laborum in est eu ipsum reprehenderit ut voluptate. Aute veniam mollit ea et in reprehenderit ullamco enim ipsum fugiat minim irure Lorem. Sunt nostrud eu esse id eiusmod excepteur pariatur ex officia excepteur et enim esse.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-26 04:14:59'),
(74,11,37.704999,-122.39729,'Amet aliqua nisi nisi duis labore elit veniam aliquip excepteur ut id. Do fugiat eu qui deserunt in id non laborum veniam sunt aliqua. Cillum ea nisi officia proident velit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-17 08:18:07'),
(75,29,37.774492,-122.426143,'Dolore est Lorem nulla ex duis eiusmod officia. Consectetur enim Lorem ex sunt laboris fugiat proident. Aute reprehenderit nostrud elit cillum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-11 04:16:38'),
(76,13,37.735392,-122.492885,'Laboris reprehenderit amet in ullamco cillum reprehenderit ut mollit nulla est tempor. Lorem non exercitation ipsum deserunt dolore ullamco in voluptate laborum. Ut reprehenderit cillum quis dolor adipisicing.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-23 01:08:56'),
(77,34,37.794925,-122.384781,'Occaecat nisi nulla dolor id ut proident ullamco do nulla pariatur. In aliqua duis esse magna adipisicing irure duis est occaecat adipisicing minim anim nulla nisi. Aliquip Lorem deserunt ullamco cupidatat occaecat quis sunt ullamco nisi minim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-10 01:56:43'),
(78,8,37.718642,-122.443214,'Veniam tempor enim adipisicing ea cupidatat. Aute eiusmod quis cupidatat et occaecat eiusmod excepteur ut do minim cillum cillum magna adipisicing. Non ipsum aute amet labore dolore consequat sit cupidatat aliquip aliquip pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-18 12:09:33'),
(79,6,37.778254,-122.434712,'Non dolor tempor nulla fugiat. Dolor do deserunt occaecat duis aliqua magna culpa ad dolore dolore est officia cupidatat elit. Sint sit id ipsum esse officia fugiat commodo enim quis ex.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-09 05:18:48'),
(80,31,37.747171,-122.494823,'Commodo irure laboris do minim eiusmod. Et aliqua amet mollit irure. Irure duis do amet ex laboris non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-21 12:03:30'),
(81,1,37.76127,-122.443164,'Do cupidatat minim adipisicing laborum duis non. Eiusmod dolore dolore minim irure esse nulla labore anim eiusmod eiusmod consectetur ut do nostrud. Voluptate excepteur aliquip reprehenderit et ut cupidatat cillum in elit dolore labore tempor quis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-11 05:58:15'),
(82,38,37.728462,-122.480535,'Est in velit proident consequat voluptate est labore magna voluptate occaecat nisi eiusmod ipsum. Qui tempor aute pariatur eu exercitation incididunt excepteur esse dolore cupidatat. Sint sit do sint deserunt deserunt nostrud ullamco consequat qui.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-07 06:01:27'),
(83,7,37.748541,-122.395936,'Quis et excepteur nulla consectetur culpa dolore sint sint exercitation consectetur. Nulla in deserunt proident deserunt laboris nulla velit aute anim consectetur ut commodo aute. Laboris ad minim voluptate amet velit in aliqua.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-08 09:20:00'),
(84,16,37.748858,-122.424302,'Laboris adipisicing et mollit qui voluptate officia duis nostrud deserunt in id. Aliqua enim est do sint irure elit nostrud proident Lorem et. Aliquip ad exercitation nulla voluptate ex magna minim incididunt culpa.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-30 09:30:10'),
(85,17,37.714591,-122.428225,'Proident adipisicing est magna elit commodo consectetur exercitation eiusmod ea culpa dolore. Cupidatat id irure magna et qui enim do eu. Ad labore ipsum eu aliquip eiusmod qui velit cillum sit ullamco cupidatat tempor in Lorem.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-07 06:58:46'),
(86,40,37.780939,-122.383275,'Irure sunt mollit aliqua id voluptate. Laboris eiusmod ullamco non proident proident proident reprehenderit mollit occaecat sunt adipisicing elit magna. Reprehenderit magna ex incididunt officia pariatur dolor veniam sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-26 09:24:35'),
(87,3,37.723819,-122.490381,'Excepteur voluptate aliqua cillum commodo exercitation do aute. Exercitation aliquip veniam in mollit labore. Commodo labore qui aliquip do anim ullamco nisi est laborum ut mollit incididunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-05 04:42:51'),
(88,2,37.773859,-122.424333,'Do velit officia esse incididunt incididunt Lorem cupidatat mollit nisi est eu elit. Do nisi id anim fugiat. Ea fugiat esse ea ad pariatur qui anim enim officia excepteur fugiat incididunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-03 02:36:29'),
(89,3,37.746833,-122.393513,'Irure duis ea Lorem fugiat non aute aliqua fugiat irure elit elit exercitation. Sunt deserunt pariatur ullamco amet aliqua voluptate eiusmod sunt deserunt exercitation aliquip laborum. Minim ad amet sint mollit ex duis laboris adipisicing minim tempor eiusmod.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-27 06:29:04'),
(90,27,37.703488,-122.392101,'Adipisicing et magna ullamco velit nulla culpa eiusmod commodo. Laborum in laboris nulla labore elit Lorem. Culpa in duis sint amet sunt occaecat irure elit eiusmod pariatur exercitation nostrud excepteur cupidatat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-30 09:48:20'),
(91,23,37.729859,-122.42503,'Officia sunt amet labore ut aute nostrud non enim ex esse est. Adipisicing Lorem ipsum esse ex veniam ullamco. Veniam cillum consectetur cillum do qui qui mollit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-17 02:41:36'),
(92,33,37.726205,-122.502053,'Ad ad do quis adipisicing ut dolor. Lorem laboris consectetur consectetur ad veniam culpa ea do exercitation. Lorem aute et tempor officia minim exercitation exercitation in deserunt nulla pariatur ullamco non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-01 12:25:40'),
(93,6,37.715959,-122.489041,'Sunt reprehenderit consequat ea amet anim consequat. Ullamco nisi dolore Lorem reprehenderit mollit pariatur dolore est aliqua. Ea ullamco aliqua esse amet dolore elit occaecat adipisicing.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-05 08:37:23'),
(94,42,37.772932,-122.45533,'Minim eu veniam ullamco est irure tempor ut do fugiat eiusmod tempor. Sit id ipsum commodo occaecat consequat magna labore ut voluptate ea nostrud. Adipisicing do ipsum cupidatat laborum ad sit mollit commodo cupidatat nisi commodo in.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-26 12:29:37'),
(95,50,37.740401,-122.415189,'Incididunt aute nisi commodo incididunt eu nulla quis consectetur ipsum ullamco. Nisi quis fugiat sint officia veniam aliquip laborum cupidatat qui non enim. Anim quis cillum magna adipisicing labore ullamco incididunt magna.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-17 01:36:46'),
(96,43,37.712105,-122.478253,'Proident nostrud fugiat anim elit amet anim occaecat. Ullamco esse excepteur nulla reprehenderit sint. In anim ullamco mollit anim incididunt excepteur dolore mollit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-26 08:58:23'),
(97,21,37.710223,-122.395327,'Non qui ea aliqua et et sunt deserunt nostrud eu id minim reprehenderit pariatur. Fugiat qui laboris velit consequat magna. Sunt et et commodo exercitation aute aliqua.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-30 03:22:43'),
(98,18,37.721962,-122.464212,'Qui enim minim proident culpa sit ex fugiat esse ad nostrud. Sint voluptate officia qui sunt consectetur aliqua elit exercitation ullamco eu proident. Duis in ex eu cillum dolore do esse excepteur non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-11 12:09:11'),
(99,7,37.726968,-122.49722,'Duis non reprehenderit velit commodo occaecat cillum nulla aute sit do sunt sunt nulla Lorem. Eiusmod tempor nisi voluptate laborum et ex id. Magna pariatur sunt ex mollit amet irure aute cupidatat cupidatat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-08 08:18:49'),
(100,20,37.781023,-122.487291,'Sint esse esse labore Lorem sint sint. Anim mollit ipsum eu et nulla ea eiusmod reprehenderit aliqua incididunt ad. Eiusmod ipsum ex aliqua commodo tempor minim laborum incididunt anim anim reprehenderit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-24 08:20:39'),
(101,41,37.705274,-122.382752,'Do ad cillum laborum sint tempor. In proident qui ad pariatur ea sint ea. Adipisicing esse culpa laboris labore amet fugiat velit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-07 10:40:24'),
(102,19,37.742667,-122.419425,'Eiusmod mollit proident tempor ipsum eu exercitation dolor veniam occaecat elit. Proident et tempor dolor exercitation incididunt. Anim eu eu est minim dolor veniam duis qui elit ad duis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-23 03:50:23'),
(103,7,37.732115,-122.384388,'Qui sunt officia aute nostrud pariatur ullamco sit culpa aute adipisicing occaecat labore. Quis dolore nostrud eu culpa ea consectetur aute id amet sit eu culpa cillum ea. Culpa fugiat minim id culpa ad.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-22 06:13:55'),
(104,24,37.708278,-122.411315,'Lorem non anim laborum pariatur pariatur. Quis excepteur ut officia incididunt consectetur ullamco eu. Aliqua ex ex duis do proident laboris ex aliqua pariatur enim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-01 01:39:09'),
(105,32,37.77233,-122.412031,'Magna dolore mollit irure ad amet sint dolor aliquip aute ad proident dolore consectetur. Incididunt occaecat nisi laboris in qui. Tempor occaecat in incididunt eiusmod do.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-14 10:17:31'),
(106,28,37.708596,-122.470086,'Nostrud eiusmod labore ex exercitation. Deserunt ipsum ex mollit nostrud. Occaecat nulla ea minim commodo quis elit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-28 05:54:17'),
(107,49,37.779287,-122.502169,'Consectetur mollit magna tempor mollit ipsum. Irure in velit et consequat minim excepteur non excepteur aute sint aliquip aute. Proident quis sint sit veniam.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-04 11:27:17'),
(108,11,37.755222,-122.409523,'Mollit minim nostrud ut in veniam. Ut et adipisicing sunt non ipsum. Labore sunt dolore fugiat aute sint excepteur deserunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-05 03:32:30'),
(109,6,37.734759,-122.502975,'Laborum in labore ut consequat voluptate sint cillum dolor minim excepteur fugiat non amet tempor. Exercitation nisi dolor exercitation aliqua elit pariatur dolor aliqua et sit aliquip aliquip deserunt. Do sint aute elit tempor occaecat labore proident nostrud magna est ullamco.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-14 03:03:02'),
(110,3,37.791395,-122.492054,'Id proident deserunt cillum quis mollit anim non. Amet mollit et aute labore amet sit elit duis elit culpa sint elit ut culpa. Labore exercitation culpa duis esse irure.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-31 11:54:38'),
(111,13,37.704259,-122.460245,'Nostrud enim est in magna Lorem commodo mollit proident non. Incididunt incididunt tempor veniam minim veniam officia cupidatat velit non ut adipisicing culpa dolor. Deserunt cillum nisi adipisicing ad incididunt minim duis ad excepteur pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-24 04:33:33'),
(112,20,37.761539,-122.484543,'Qui dolor laborum consectetur enim irure non dolore nostrud ut. Elit adipisicing amet officia anim minim ad. Id duis do tempor sint exercitation sit anim consectetur non elit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-09 05:39:56'),
(113,42,37.733781,-122.479427,'Velit mollit aute est ipsum reprehenderit. Nulla sit in ad cupidatat esse pariatur. Consequat ullamco quis sunt dolor Lorem reprehenderit exercitation proident nostrud incididunt reprehenderit cupidatat aliquip.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-13 09:56:24'),
(114,18,37.78055,-122.444016,'Excepteur veniam sunt excepteur cupidatat commodo deserunt enim ipsum magna. Velit minim culpa fugiat exercitation ea. Labore reprehenderit nisi consequat nisi ullamco adipisicing cupidatat ex fugiat est do sint cupidatat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-25 05:18:59'),
(115,25,37.779498,-122.394532,'Nulla aliqua deserunt sit adipisicing consequat ex adipisicing veniam enim enim enim consequat. Voluptate magna laboris dolore nulla elit ea id. Aliqua nostrud ut adipisicing ipsum duis sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-04 07:28:51'),
(116,49,37.725124,-122.46051,'Ullamco eu excepteur sunt esse dolore ad nostrud proident dolor. Ea anim reprehenderit nisi aute id laborum excepteur non incididunt labore. Occaecat cupidatat officia enim reprehenderit pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-07 07:03:29'),
(117,50,37.76774,-122.489121,'Reprehenderit consequat minim aute dolore non velit et cupidatat sint officia incididunt laboris. In duis magna dolore officia fugiat non do officia et tempor elit. Amet eu elit enim adipisicing.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-30 11:12:05'),
(118,46,37.769982,-122.449201,'Commodo nisi occaecat reprehenderit officia ullamco velit eiusmod sunt labore mollit elit. Qui sint id laboris aute fugiat. Aute deserunt dolor tempor sint in Lorem.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-06 06:04:28'),
(119,31,37.7478,-122.436459,'Magna ipsum nisi cillum veniam est non commodo. Mollit laborum officia esse ipsum. Anim elit do Lorem aute commodo nulla irure consequat nisi adipisicing magna proident.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-05 12:44:59'),
(120,18,37.747364,-122.427651,'Id do irure enim ad officia esse fugiat. Aliquip elit non veniam id et. Exercitation labore laborum pariatur culpa ex nostrud ex culpa commodo id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-02 02:21:18'),
(121,44,37.714957,-122.463916,'Officia ea irure tempor do eu adipisicing laboris reprehenderit officia. Aliquip quis pariatur sunt amet. Nulla officia cillum incididunt mollit amet nostrud incididunt eu aute dolor duis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-02 09:47:38'),
(122,48,37.748554,-122.423991,'Ad sit commodo eu minim occaecat nisi exercitation laborum fugiat dolor reprehenderit do et reprehenderit. Adipisicing amet Lorem mollit qui reprehenderit. Amet quis aute deserunt ad enim ullamco.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-04 03:31:38'),
(123,29,37.742069,-122.456123,'Magna amet nisi sint quis cupidatat eiusmod irure aliquip cupidatat aliqua. Sit deserunt nulla laborum nostrud non sunt irure officia officia irure id non minim. Nulla aute anim ea nisi in mollit labore labore commodo aliqua.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-11 03:20:02'),
(124,34,37.713315,-122.441281,'Ea magna id eu voluptate velit commodo non amet do sint labore officia. Fugiat ipsum sit id pariatur deserunt nulla eu in nostrud ex. Occaecat incididunt amet proident nisi mollit velit duis occaecat dolor.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-24 02:07:25'),
(125,11,37.771884,-122.391578,'Cupidatat excepteur eiusmod ullamco ipsum fugiat commodo minim sunt Lorem laboris. Eu quis culpa cupidatat aliqua elit aliqua eiusmod aliqua dolor proident labore. Esse ullamco amet sit dolore duis aliquip incididunt anim pariatur labore exercitation consectetur dolore enim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-29 11:48:20'),
(126,18,37.751149,-122.385249,'Culpa adipisicing pariatur dolore enim occaecat irure proident tempor velit. Aliqua laboris ea reprehenderit non laborum consectetur veniam et culpa. Minim qui Lorem veniam do proident cillum aute laborum excepteur sunt sint.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-10 01:42:07'),
(127,22,37.735425,-122.491387,'Nulla non aliqua sunt sunt eu. Deserunt elit labore ullamco sunt adipisicing aliqua cupidatat non consectetur aliquip nostrud mollit do. Sunt occaecat voluptate enim dolor cillum non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-26 02:03:43'),
(128,24,37.735777,-122.446558,'Voluptate aliqua amet fugiat qui nulla culpa aliquip consectetur consequat voluptate quis nostrud ut. Incididunt in excepteur irure eu aute ipsum velit est eiusmod laboris magna eu magna. Minim incididunt qui sunt cupidatat Lorem occaecat aute in ipsum Lorem.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-07 08:56:04'),
(129,14,37.715697,-122.437706,'Lorem excepteur occaecat laborum dolor ad consectetur cupidatat. Deserunt cupidatat laborum et eu consequat eu enim. Deserunt non veniam Lorem aute ut labore ut cupidatat adipisicing culpa aliqua veniam occaecat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-20 02:24:50'),
(130,21,37.757116,-122.444966,'Incididunt reprehenderit exercitation dolor duis sint quis magna duis sit adipisicing laboris laborum excepteur. Culpa minim excepteur duis sunt consectetur aliqua officia dolor nulla. Laboris elit do consectetur occaecat sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-29 08:19:52'),
(131,15,37.763023,-122.419241,'Adipisicing tempor incididunt irure consectetur eiusmod. Laborum nostrud mollit eiusmod duis cillum proident minim. Laboris enim officia pariatur exercitation non minim excepteur esse est minim culpa magna quis ex.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-10 05:04:46'),
(132,12,37.776375,-122.492627,'Et aute mollit et aute sunt sunt. Id ex mollit esse qui ea cupidatat deserunt. Quis ad tempor fugiat culpa et anim excepteur exercitation sint in Lorem anim dolore.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-12 03:45:51'),
(133,38,37.708282,-122.464252,'Excepteur aute nostrud sunt id labore anim qui eu amet culpa qui. Anim commodo esse mollit ad reprehenderit laborum quis amet officia ullamco quis ad adipisicing. Ullamco cillum non aliqua ipsum sit ea laboris nulla ullamco voluptate ut sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-06 12:59:34'),
(134,24,37.793242,-122.400706,'Lorem anim dolore excepteur fugiat amet aliquip Lorem elit eu id occaecat. Enim laborum sunt veniam minim eu ullamco esse nulla officia. Reprehenderit reprehenderit sunt in eu sunt laboris mollit tempor.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-07 06:05:28'),
(135,8,37.726147,-122.426967,'Ad minim ipsum nostrud officia aliqua qui ipsum. Aliqua id ullamco in officia ipsum sit excepteur. Cillum consectetur magna adipisicing nisi commodo non duis sint laborum sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-25 03:25:40'),
(136,22,37.721399,-122.490697,'Est reprehenderit et pariatur ut sint ad occaecat ad consequat consequat. Proident ipsum reprehenderit consectetur ut eu fugiat laboris esse commodo eiusmod consectetur quis. Ipsum nostrud eu dolor cillum ipsum dolore eiusmod aliqua voluptate eiusmod non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-19 01:56:48'),
(137,41,37.728984,-122.432624,'Laboris do est ex do est in ea Lorem reprehenderit deserunt proident occaecat. Non mollit excepteur magna proident pariatur minim elit tempor. Lorem irure consequat eu excepteur ullamco.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-18 09:11:48'),
(138,40,37.761756,-122.493936,'Incididunt commodo proident eiusmod ea eiusmod. Enim elit ex esse ea pariatur sint cupidatat officia fugiat proident consequat. Voluptate non dolore Lorem incididunt incididunt tempor ad deserunt sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-24 02:21:20'),
(139,16,37.793923,-122.48339,'Ipsum duis irure ad eu deserunt incididunt magna commodo quis Lorem ad aliqua sint incididunt. Commodo id ea est duis nisi. Tempor deserunt occaecat do nisi ut quis ad veniam occaecat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-21 11:25:08'),
(140,18,37.78131,-122.486216,'Cupidatat aliqua amet ullamco mollit ut. Eu culpa do dolore incididunt amet velit enim id veniam tempor in ut duis cillum. Excepteur proident consequat ad proident ex minim qui cupidatat aute labore eu deserunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-12 11:13:24'),
(141,27,37.785809,-122.492666,'Amet enim ea eu ipsum ea aliquip. Non nulla eiusmod ea velit. Veniam non exercitation enim voluptate et commodo excepteur irure ex pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-08 06:19:01'),
(142,48,37.78384,-122.383396,'Incididunt nulla voluptate sint aliquip cillum laboris consequat do amet dolore tempor. Ea nostrud pariatur irure voluptate amet exercitation ipsum magna cillum Lorem aliqua anim. Mollit dolor labore quis irure eu id ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-24 03:47:07'),
(143,4,37.791205,-122.447576,'Voluptate elit sit eiusmod laboris laborum enim anim cupidatat. Reprehenderit ex enim labore cupidatat fugiat nulla labore laborum. Reprehenderit sunt deserunt laborum incididunt nulla est dolor velit anim officia.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-30 02:49:03'),
(144,28,37.770564,-122.385495,'Minim ullamco cupidatat esse cillum nostrud. Deserunt nulla esse fugiat sunt labore consectetur cillum Lorem in sunt elit nulla sit exercitation. Cillum magna cillum non consequat laborum minim cupidatat cupidatat esse dolor anim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-13 03:49:27'),
(145,15,37.762634,-122.499583,'Eu elit eiusmod et do sint incididunt. Dolor cupidatat labore est fugiat enim dolor reprehenderit qui. Minim enim minim excepteur enim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-11 08:00:37'),
(146,50,37.761616,-122.465635,'Eiusmod sunt esse nisi non consequat sunt reprehenderit sint minim velit eiusmod. Magna incididunt ea consectetur occaecat fugiat non ad cupidatat. Anim eiusmod laboris non sit aliqua nulla incididunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-13 11:19:05'),
(147,28,37.747552,-122.444209,'Nulla excepteur aliquip aliqua nostrud non occaecat excepteur voluptate consectetur labore et laborum. Deserunt aute magna nulla deserunt ullamco ut nulla eiusmod do adipisicing sunt non amet enim. Tempor consequat deserunt reprehenderit ea dolor occaecat amet nostrud eu.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-28 12:26:29'),
(148,35,37.723387,-122.467856,'Pariatur ea id culpa consequat. Eu eu culpa ex do deserunt. Incididunt non tempor minim consectetur minim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-27 05:00:08'),
(149,41,37.760962,-122.420299,'Id do ipsum culpa do proident ea minim anim elit nisi occaecat deserunt cillum. Consectetur aliqua eu veniam magna anim amet veniam. Nulla reprehenderit in laborum officia mollit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-06 05:23:25'),
(150,27,37.752486,-122.500969,'Adipisicing aute cupidatat voluptate aliquip dolor aute pariatur dolor est eu ad. Do quis est veniam enim. Mollit proident excepteur est quis cillum amet.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-10 01:15:30'),
(151,44,37.712883,-122.463383,'Proident minim elit Lorem enim consequat consequat irure in ad nisi dolore. Nisi magna nulla adipisicing adipisicing. Cupidatat dolore pariatur labore sit duis labore incididunt aliquip in consequat labore.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-02 04:13:26'),
(152,1,37.777198,-122.502531,'Enim qui do dolore occaecat irure cupidatat ut consectetur. Minim ut aliqua non est irure reprehenderit tempor sunt pariatur eiusmod velit ullamco. Anim voluptate dolore ad qui nisi dolor nulla consectetur irure.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-19 04:12:30'),
(153,5,37.726091,-122.404362,'Ullamco est aliqua veniam nulla anim. Irure est quis excepteur proident sit adipisicing quis ex dolor laborum amet voluptate. Commodo enim eu sunt id exercitation magna minim officia duis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-05 07:50:32'),
(154,16,37.78211,-122.464117,'Deserunt culpa sunt est in id. Do deserunt est adipisicing id sunt. Magna proident et eiusmod adipisicing.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-12 12:58:52'),
(155,8,37.736094,-122.408177,'Nisi consequat aliquip ut officia. Eiusmod veniam officia consectetur exercitation proident dolore proident culpa occaecat minim. Dolor sint officia ex fugiat Lorem dolore.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-30 12:32:02'),
(156,41,37.781289,-122.498291,'Excepteur irure nulla tempor voluptate fugiat. Cillum irure culpa anim irure aute labore sunt tempor excepteur. Exercitation voluptate cillum eiusmod incididunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-02 06:38:32'),
(157,38,37.703933,-122.484082,'Voluptate labore velit ex officia aute duis consequat in aute ipsum est. Esse quis enim deserunt aute enim amet qui laborum. Culpa excepteur aliquip velit est ipsum culpa quis nostrud ipsum dolore ipsum nostrud.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-12 03:51:49'),
(158,42,37.781361,-122.432078,'Mollit consectetur aliqua minim occaecat amet. Anim dolor mollit est sit ex eiusmod laboris. Sint Lorem fugiat magna tempor pariatur nulla proident nostrud.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-13 04:27:57'),
(159,40,37.729681,-122.480949,'Nulla fugiat incididunt id in minim elit ad laborum. Mollit et culpa velit sunt quis labore eiusmod. Velit exercitation fugiat eiusmod occaecat pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-26 07:59:36'),
(160,28,37.757484,-122.386231,'Dolore excepteur dolore nostrud duis ullamco fugiat in dolore magna. Quis ad minim reprehenderit deserunt reprehenderit. Quis ut labore deserunt esse ipsum aliqua magna.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-22 02:15:00'),
(161,32,37.783849,-122.467042,'Laborum et aliquip incididunt elit officia commodo adipisicing Lorem exercitation Lorem nostrud eiusmod adipisicing sunt. Lorem occaecat deserunt consequat adipisicing occaecat. Sit magna irure laboris labore occaecat deserunt consectetur ullamco et.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-05 02:49:44'),
(162,16,37.725038,-122.384283,'Eiusmod laborum proident proident nisi. Do elit deserunt labore consectetur exercitation reprehenderit nisi consequat cupidatat id. Proident consequat culpa quis do ea quis consectetur est non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-01 04:59:55'),
(163,23,37.786817,-122.477347,'Do ullamco cupidatat sint quis. Nisi cupidatat eiusmod consectetur nisi velit amet do sint esse. Do adipisicing velit officia Lorem fugiat sunt anim Lorem amet in ipsum ullamco.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-17 05:25:52'),
(164,3,37.757632,-122.455117,'Minim irure anim incididunt dolor est consequat labore excepteur id velit. Amet quis sit consectetur tempor minim incididunt proident laborum minim. Est laborum ipsum ex eu ut consectetur cupidatat do commodo Lorem nisi ex culpa nostrud.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-27 08:34:04'),
(165,16,37.777692,-122.397671,'In commodo incididunt consectetur amet et duis mollit cillum. Do exercitation pariatur id consequat in fugiat aliqua incididunt. Dolor ullamco laborum ea voluptate.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-16 07:40:22'),
(166,26,37.781842,-122.39031,'Et et fugiat labore magna sit ex ullamco nisi nostrud ex nostrud occaecat. Reprehenderit nulla dolore dolore cillum est deserunt sit anim mollit. Minim anim voluptate ea consectetur et sint commodo eu excepteur mollit cillum anim ipsum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-17 09:24:09'),
(167,22,37.769727,-122.411744,'Proident deserunt velit Lorem labore nisi mollit id est ex id duis occaecat nulla nulla. Anim elit qui exercitation ut minim ipsum sit commodo. Velit laboris consectetur voluptate anim incididunt occaecat aliquip cillum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-20 10:44:20'),
(168,18,37.709936,-122.479706,'Est nostrud nisi ipsum cillum. Enim eiusmod anim cupidatat adipisicing fugiat dolor commodo elit excepteur. Nostrud exercitation officia reprehenderit amet.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-11 10:53:11'),
(169,13,37.761361,-122.507303,'Consectetur officia incididunt labore excepteur. Adipisicing esse veniam ipsum magna adipisicing id do elit ut esse ipsum aliquip incididunt est. Sit proident excepteur duis culpa.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-13 11:57:32'),
(170,16,37.777648,-122.419108,'Velit duis ullamco sit cillum. Voluptate in nulla culpa in voluptate quis laboris culpa velit mollit voluptate deserunt. Voluptate cupidatat nostrud mollit voluptate deserunt in nulla duis fugiat eiusmod.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-04 05:45:13'),
(171,48,37.711854,-122.507241,'Quis Lorem eiusmod est culpa reprehenderit sint reprehenderit id deserunt. Enim fugiat reprehenderit minim velit exercitation sit minim culpa laboris. Esse anim deserunt laborum dolor sunt consectetur voluptate id adipisicing fugiat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-18 10:43:48'),
(172,26,37.789428,-122.481152,'Mollit voluptate velit velit occaecat quis minim veniam ea elit nulla proident exercitation eiusmod anim. Aute ipsum incididunt elit irure ea mollit dolor proident eu est. Ipsum id enim sunt cupidatat nostrud aute duis cupidatat consectetur irure.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-08 01:00:22'),
(173,38,37.735523,-122.409236,'Incididunt excepteur cupidatat ad excepteur consectetur culpa anim ex fugiat amet laboris sunt fugiat. Sit voluptate velit exercitation fugiat ipsum labore minim eu proident pariatur ullamco. Et aliquip laboris veniam sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-09 04:02:54'),
(174,5,37.708478,-122.381669,'Esse qui mollit amet reprehenderit. Laboris enim voluptate ea occaecat ex voluptate ex ullamco. Pariatur qui est reprehenderit quis veniam sint aliquip.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-06 10:29:20'),
(175,43,37.728666,-122.390328,'Nulla irure ex est aute Lorem ea amet quis et aliquip voluptate ullamco voluptate. Aliqua fugiat laboris sit ea. Mollit incididunt ipsum do exercitation ex id proident adipisicing enim id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-26 12:29:51'),
(176,36,37.767691,-122.450506,'Ex velit non culpa eiusmod non id tempor incididunt adipisicing ipsum amet mollit. Nulla duis cupidatat veniam ea excepteur minim quis eu in sint. Velit aliquip veniam officia officia cillum proident officia ut deserunt nulla.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-29 06:07:15'),
(177,23,37.751852,-122.429649,'Mollit pariatur labore laboris excepteur pariatur ut eu minim laborum nisi. Do exercitation Lorem adipisicing duis. Sint anim aliqua nostrud proident.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-13 10:08:11'),
(178,46,37.75362,-122.439349,'Exercitation adipisicing anim esse elit consectetur esse culpa sit. Voluptate nostrud est pariatur sunt est minim exercitation eu id cupidatat minim commodo aute. Laborum esse dolore eiusmod ex duis cillum eu labore cupidatat id cillum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-31 08:31:57'),
(179,42,37.79325,-122.473503,'Non cupidatat culpa non veniam eu fugiat nulla magna est cupidatat adipisicing tempor id cillum. Velit ipsum sit excepteur cillum consequat aliquip elit tempor magna eu nostrud. Sint sint consequat proident dolor ea.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-29 06:46:12'),
(180,21,37.751953,-122.40467,'Nostrud ad cupidatat duis do cupidatat do est cillum. Cillum aliquip occaecat aute commodo dolor irure sint reprehenderit incididunt. Do velit cupidatat aute elit duis eu.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-17 12:36:12'),
(181,16,37.757862,-122.390456,'Ullamco deserunt veniam in non voluptate reprehenderit proident eiusmod duis exercitation. Tempor irure velit ex ut labore qui in exercitation tempor pariatur aliquip dolore. Labore adipisicing eiusmod culpa in adipisicing aute enim irure cupidatat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-16 10:26:08'),
(182,22,37.725973,-122.395796,'Et fugiat magna aliqua ut incididunt id nulla. Dolor mollit eiusmod cupidatat consequat deserunt fugiat minim minim. Pariatur enim enim eu do in commodo velit duis ex.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-28 07:51:55'),
(183,43,37.72257,-122.386792,'Nulla veniam sit qui deserunt reprehenderit mollit laborum cupidatat elit sint ex consectetur ullamco nisi. Duis id nisi aliqua est sit adipisicing tempor irure ad ad. Est nulla aliquip commodo minim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-19 12:59:49'),
(184,29,37.70542,-122.417053,'Mollit qui voluptate excepteur et sit laborum proident. Quis reprehenderit magna aliqua officia ex ex laboris. Elit consectetur reprehenderit tempor id aliquip in aliquip eiusmod fugiat sit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-25 02:35:21'),
(185,18,37.734847,-122.467137,'Pariatur duis et nostrud est ad ex fugiat in voluptate. Ea ex ex reprehenderit voluptate adipisicing ut esse excepteur esse incididunt nostrud. Eiusmod labore excepteur id consequat in eiusmod pariatur Lorem aliqua voluptate sunt qui ex.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-01 01:51:18'),
(186,8,37.719137,-122.467378,'Ullamco nostrud cillum eiusmod labore laboris amet dolor voluptate eu officia aute. Et ipsum elit id aliquip laboris laborum aliquip anim Lorem mollit magna. Magna consectetur aliqua ad ex ea officia consequat consequat deserunt nisi deserunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-11 10:38:35'),
(187,43,37.771546,-122.476709,'Velit ullamco voluptate mollit est mollit reprehenderit tempor laboris. Labore do in culpa mollit in nostrud elit pariatur labore amet dolor excepteur sint. Do ex minim cillum mollit id fugiat commodo sint in in exercitation dolor dolore nostrud.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-01 05:42:06'),
(188,10,37.737292,-122.397654,'Incididunt elit enim tempor qui et commodo laborum cillum veniam occaecat. Pariatur laborum et exercitation mollit culpa dolor aliquip enim. Consectetur do eu ullamco mollit aute exercitation cupidatat aliqua enim sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-16 03:00:43'),
(189,11,37.704156,-122.45758,'Enim elit sunt irure eiusmod occaecat adipisicing id et dolore. Incididunt nisi cillum voluptate exercitation consequat. Consequat adipisicing pariatur ipsum ullamco consequat officia anim sint adipisicing dolor consectetur cillum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-05 09:44:58'),
(190,2,37.704879,-122.431764,'Excepteur velit id id ex exercitation in ad labore pariatur dolore nulla culpa dolore id. Magna commodo laboris commodo pariatur Lorem esse fugiat. Reprehenderit non in veniam consectetur Lorem occaecat consequat id commodo anim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-29 12:12:10'),
(191,41,37.728595,-122.428467,'Aliquip cillum excepteur qui id aliquip consectetur sint minim eu elit nisi nulla magna laboris. Cupidatat do ex fugiat qui nisi labore. Ipsum incididunt in adipisicing consectetur est irure eu est.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-26 04:11:24'),
(192,47,37.746996,-122.418383,'Do proident velit minim laboris. Consectetur proident sit est et. Amet amet ipsum enim deserunt ullamco anim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-29 03:30:56'),
(193,36,37.777749,-122.444408,'Est consequat qui non adipisicing aute ex. In id et anim do laborum adipisicing et aliqua nisi reprehenderit culpa do veniam. Voluptate velit dolor anim eiusmod nisi cillum consequat ullamco non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-18 05:52:09'),
(194,47,37.795234,-122.445215,'Eu laboris deserunt culpa incididunt cillum ad id ut sit aute magna Lorem magna Lorem. Ad aliquip deserunt voluptate et proident ipsum culpa reprehenderit. Eiusmod proident velit amet in tempor adipisicing esse dolore est ea adipisicing qui id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-13 11:30:40'),
(195,42,37.781528,-122.468407,'Anim sunt tempor consequat exercitation reprehenderit amet sunt eu duis est occaecat quis labore. Voluptate duis aliquip sunt occaecat sint culpa exercitation ea aute ex. Ullamco elit cillum sint ex consequat aliquip.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-30 05:20:33'),
(196,16,37.755594,-122.494024,'Duis quis labore culpa sit. Aliquip id aute minim consectetur. Cupidatat minim ex fugiat est ad tempor sint consectetur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-14 07:57:12'),
(197,12,37.711914,-122.394142,'Sunt velit culpa eu aute fugiat dolore non esse. Culpa elit veniam irure enim mollit anim labore aliquip qui enim minim esse tempor. Laborum excepteur non ut elit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-31 01:43:57'),
(198,3,37.70568,-122.398927,'In irure sit excepteur do ex proident aute deserunt quis proident est exercitation id. Anim nulla nostrud cupidatat nulla reprehenderit duis laboris laboris. Aliquip ex irure id voluptate incididunt nisi.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-13 01:16:21'),
(199,17,37.725892,-122.398204,'Occaecat minim irure et est minim consectetur ex officia adipisicing voluptate. Laboris dolor laboris velit officia ut. Deserunt laborum cupidatat quis commodo tempor cupidatat consequat qui officia reprehenderit in.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-30 07:34:14'),
(200,12,37.76847,-122.477182,'Et duis ad elit enim ullamco consectetur incididunt do fugiat. Ex id velit occaecat irure commodo sit deserunt consectetur consectetur et qui. Nisi et anim reprehenderit ipsum dolore nulla.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-08 11:32:02'),
(201,32,37.756056,-122.498552,'Mollit nostrud fugiat deserunt pariatur Lorem excepteur esse sint. Aute incididunt dolor cupidatat proident ullamco aliqua. Pariatur labore est velit aliqua id nisi ad sit voluptate consequat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-01 02:47:14'),
(202,49,37.787379,-122.389968,'Exercitation deserunt officia nisi fugiat eu. Voluptate amet mollit nostrud Lorem. Velit ad reprehenderit deserunt officia minim.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-06 10:57:58'),
(203,49,37.749143,-122.493348,'Lorem duis in anim ad dolore non. Nostrud aliqua ipsum fugiat occaecat deserunt laboris veniam. Ad elit commodo reprehenderit nostrud nisi eu esse ea duis fugiat cupidatat adipisicing.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-19 05:07:40'),
(204,47,37.795455,-122.484594,'Consequat enim ipsum do consequat laboris mollit consequat elit incididunt consectetur do nisi. Eu ea incididunt anim incididunt officia labore. Esse consectetur consectetur sit sit velit ad deserunt nulla sunt cupidatat officia.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-04 11:53:28'),
(205,21,37.724916,-122.46413,'Ea est labore veniam sint sint sint culpa anim dolore. Culpa incididunt eu non incididunt irure veniam aliquip non nostrud sit officia. Mollit aliquip ipsum occaecat labore deserunt et proident ullamco eiusmod laboris.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-05 02:32:46'),
(206,43,37.733843,-122.471725,'Esse dolor magna incididunt eiusmod non aute. Amet elit irure magna nostrud. Dolor consectetur ex consectetur tempor enim sint.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-09 09:29:20'),
(207,24,37.710265,-122.440711,'Consectetur elit incididunt adipisicing excepteur ad cupidatat incididunt aliquip est. Voluptate dolore laboris ullamco magna do commodo non. Sint ipsum proident minim consectetur ipsum anim sunt adipisicing minim qui nostrud amet.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-05 05:43:26'),
(208,32,37.761176,-122.449505,'Est laborum culpa laborum deserunt consequat officia enim excepteur duis non. Mollit ea dolore occaecat et incididunt ipsum amet magna proident labore ipsum officia consequat. Lorem in amet culpa cupidatat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-17 06:04:51'),
(209,9,37.727664,-122.500408,'Ex in laborum do veniam aliqua ex consectetur. Commodo qui ullamco proident tempor elit enim incididunt nulla veniam sit dolore amet. Ullamco excepteur consequat aute quis fugiat officia occaecat laboris.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-02 10:06:58'),
(210,39,37.771719,-122.468106,'Proident id veniam elit cupidatat eiusmod nisi nostrud ex ad enim sint. Sunt enim laborum elit irure. Amet ad velit tempor occaecat consectetur fugiat minim duis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-09 03:28:31'),
(211,33,37.78254,-122.494196,'Ipsum cupidatat tempor irure sit tempor. Ea eiusmod quis dolore duis dolore. Mollit ad eiusmod elit sint exercitation incididunt duis veniam officia irure do nulla tempor commodo.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-25 07:26:49'),
(212,25,37.756829,-122.41739,'In do amet id voluptate eiusmod. Irure eu ipsum aliqua qui do exercitation ut nisi occaecat aute laboris est. Et laboris minim veniam ea voluptate ea irure quis voluptate.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-17 07:31:32'),
(213,9,37.758295,-122.477816,'Quis est amet fugiat enim dolore incididunt ea fugiat eiusmod et deserunt. Eiusmod aliqua labore ullamco ad nostrud laboris et amet sint consequat nostrud Lorem. Minim ullamco voluptate amet laborum nisi exercitation adipisicing occaecat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-11 11:18:51'),
(214,44,37.705139,-122.447966,'Nostrud in esse duis pariatur. Commodo consequat adipisicing do ullamco cillum fugiat veniam magna est nulla velit dolore. Lorem incididunt aliquip enim sit qui quis id qui aliquip elit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-02 11:04:15'),
(215,7,37.719472,-122.437792,'Cillum cupidatat reprehenderit Lorem sint duis dolore esse enim. Reprehenderit ex nulla velit aute. Id ad aliqua in tempor irure sint enim ullamco consectetur sint pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-03 02:06:12'),
(216,13,37.777006,-122.464637,'Ipsum eiusmod nostrud velit sunt anim culpa ipsum est est magna culpa magna. Duis laborum sunt voluptate sunt dolore ea. Occaecat eiusmod excepteur elit amet id Lorem id mollit aute magna voluptate et.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-06 09:12:43'),
(217,28,37.777161,-122.402361,'Cillum sit ut Lorem consequat veniam aliqua. Voluptate ad fugiat Lorem dolore voluptate ullamco elit. Cillum ut aute consectetur culpa adipisicing laboris.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-30 11:37:54'),
(218,20,37.739719,-122.383523,'Deserunt quis velit adipisicing deserunt qui Lorem nulla enim eu sit duis ex est. Fugiat et ut dolore quis duis sunt nulla non irure. Id anim sit magna mollit deserunt laborum occaecat veniam culpa nisi.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-18 08:16:10'),
(219,43,37.715368,-122.413911,'Mollit anim consequat exercitation tempor sint incididunt magna incididunt deserunt pariatur ut. Aliquip irure est dolor eiusmod sunt nisi dolor adipisicing officia. Do officia velit laboris ullamco dolore esse aute mollit veniam aliqua amet.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-22 01:17:37'),
(220,16,37.731187,-122.403614,'Ipsum laborum ad irure exercitation labore voluptate pariatur et consectetur qui quis. Nisi ex tempor sit ad esse elit anim nostrud id laboris ipsum irure eu pariatur. Fugiat proident do aliquip adipisicing quis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-14 12:37:32'),
(221,17,37.746316,-122.386949,'Irure ullamco qui consectetur enim. Anim ad et sit ullamco officia minim sunt esse minim ea reprehenderit mollit do. Excepteur laborum consectetur id eu ullamco in laboris ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-17 01:40:22'),
(222,28,37.746571,-122.415825,'Lorem est minim deserunt occaecat do ea sunt dolore. Quis culpa mollit cupidatat officia sit do ea excepteur exercitation ea nostrud commodo. Quis non consequat velit sint exercitation tempor ut veniam voluptate sit dolore reprehenderit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-24 07:46:30'),
(223,30,37.749406,-122.489634,'Ea aute aliquip commodo in ipsum ut Lorem. Consequat officia reprehenderit esse nulla esse amet esse adipisicing. Laboris occaecat magna nisi cillum incididunt velit laborum magna.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-17 07:05:00'),
(224,38,37.716634,-122.405946,'Irure eu eu aliqua mollit eu ut minim exercitation esse minim consectetur exercitation voluptate. Excepteur tempor voluptate excepteur ullamco cillum et non est. Ullamco pariatur amet adipisicing laboris.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-27 12:18:36'),
(225,27,37.777666,-122.407505,'Esse dolore veniam anim sint est minim id quis voluptate cillum pariatur sit irure. Lorem in aliquip quis voluptate ad culpa. Lorem ad pariatur labore adipisicing nostrud laboris incididunt laborum.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-01-01 11:57:41'),
(226,31,37.781463,-122.453908,'Elit est deserunt aliqua sit ipsum reprehenderit est aliqua ut. Pariatur aliquip ut id officia occaecat ex qui magna incididunt. Veniam laboris sunt aliquip sit ipsum consequat non.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-25 10:48:12'),
(227,34,37.768071,-122.474666,'Magna ex in irure nostrud elit fugiat. Labore duis quis amet consectetur nostrud qui excepteur. Voluptate laborum nulla nostrud reprehenderit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-28 10:04:03'),
(228,45,37.781652,-122.388193,'Pariatur do ad do minim officia Lorem. Esse consequat aute sit anim sunt velit. Id consectetur anim sint veniam sit consectetur Lorem magna.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-05 09:54:23'),
(229,2,37.777251,-122.464852,'Lorem ipsum velit esse sunt anim voluptate. Reprehenderit ullamco sit ut ex quis ut nulla labore enim et pariatur occaecat. Quis proident elit ipsum ad do occaecat cillum nulla magna ipsum nisi voluptate.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-17 12:09:09'),
(230,38,37.710979,-122.42296,'Sunt sint eu dolor consequat in culpa esse labore et sint est officia anim est. Sit do minim ullamco aliquip irure exercitation eu duis enim tempor culpa magna dolor. Ipsum ullamco aliqua qui ad non velit labore exercitation nostrud id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-11 10:26:10'),
(231,47,37.717582,-122.472754,'Minim duis elit nisi adipisicing culpa velit. Laborum nostrud ea anim et elit aliquip. In deserunt cupidatat laboris non qui dolore pariatur do sit dolor amet labore nostrud labore.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-02-17 06:42:27'),
(232,33,37.729414,-122.458857,'Labore pariatur in sunt officia elit sint aliqua qui est esse. Est aute sit deserunt do pariatur et exercitation minim ipsum voluptate minim officia commodo. Nisi do adipisicing veniam irure mollit officia ipsum velit qui ad aliqua tempor amet.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-29 09:54:22'),
(233,32,37.793832,-122.461475,'Tempor eiusmod ipsum enim occaecat velit excepteur culpa aliquip fugiat eiusmod consectetur labore aliqua officia. Aliqua excepteur elit qui ullamco aute cupidatat veniam aliqua laboris. Reprehenderit aute consectetur dolor labore excepteur aute cillum ea laborum incididunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-16 09:07:28'),
(234,49,37.72493,-122.397568,'Ut tempor cillum consequat proident. Culpa sint incididunt et do ullamco reprehenderit ut. In excepteur cupidatat ut ut est nulla esse eiusmod eiusmod non ea.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-30 03:15:22'),
(235,28,37.791045,-122.396639,'Aliqua eu aute mollit do pariatur enim fugiat cillum labore est aliqua. Irure est magna laboris fugiat ea sit pariatur tempor amet adipisicing dolore do. Lorem ut do ex aliqua dolore consectetur qui non amet.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-30 03:51:44'),
(236,27,37.723619,-122.501209,'Cupidatat est ipsum incididunt exercitation commodo est nulla aliquip quis nisi nostrud aute Lorem minim. Excepteur consectetur incididunt aliquip Lorem id aute adipisicing mollit. Tempor Lorem consectetur voluptate tempor reprehenderit et anim ipsum eiusmod amet voluptate culpa irure occaecat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-07-16 10:23:18'),
(237,45,37.745559,-122.499915,'Ex nulla voluptate consequat velit ipsum adipisicing velit ad sint. Adipisicing minim et id occaecat reprehenderit aliqua Lorem consectetur pariatur est eu occaecat aliquip. Labore sint deserunt anim nisi deserunt quis irure et est commodo amet Lorem deserunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-16 10:01:39'),
(238,45,37.717997,-122.452697,'Reprehenderit labore in veniam ullamco laboris dolor sint officia laboris esse sint exercitation proident. Proident veniam laboris pariatur consequat consequat duis ea exercitation quis. Eiusmod do tempor ut sunt eu in elit incididunt ullamco cillum cupidatat.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-05-06 04:50:33'),
(239,15,37.724783,-122.437608,'Eu tempor pariatur commodo cillum eu excepteur ipsum nostrud reprehenderit pariatur. Pariatur est ipsum nisi est ex laborum velit adipisicing veniam. Enim dolore id labore dolor Lorem.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-18 05:51:26'),
(240,20,37.72473,-122.482171,'Tempor aute eu elit sit officia veniam ullamco. Pariatur enim Lorem excepteur excepteur adipisicing voluptate fugiat ullamco irure minim est. Id proident veniam anim qui veniam amet qui nisi ut id.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-28 12:40:09'),
(241,26,37.732885,-122.399349,'Dolore excepteur proident et sit anim adipisicing sit excepteur. Dolor officia eu nisi eiusmod magna est aute ad irure qui pariatur pariatur irure qui. Veniam incididunt voluptate tempor ipsum reprehenderit dolor sunt in.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-09 03:24:42'),
(242,48,37.77549,-122.402679,'Aliquip excepteur sunt et ut laboris velit adipisicing veniam. Nisi sunt ad veniam nostrud elit culpa et cupidatat sit ullamco cillum enim sint elit. Velit laborum proident laborum amet aliquip do irure Lorem Lorem irure sunt.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-03-07 11:16:54'),
(243,38,37.707165,-122.504473,'Aliquip qui ut ea deserunt enim nisi amet nisi commodo minim aute dolore id commodo. Laborum duis Lorem incididunt reprehenderit dolor elit tempor. Velit pariatur cupidatat aliqua sint ut culpa laboris.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-09 05:32:16'),
(244,42,37.792468,-122.504172,'Pariatur deserunt quis pariatur in nulla exercitation fugiat nisi ullamco. Sunt nostrud aliqua eu est consectetur proident dolore nostrud commodo velit enim. Ex amet in labore sit aute eiusmod deserunt qui ut non dolore pariatur.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-26 01:11:58'),
(245,26,37.793865,-122.488895,'Sit tempor aliqua eu cupidatat id mollit irure occaecat in aliquip proident Lorem. Sunt occaecat sint consequat eu veniam. Ullamco elit laboris cillum officia.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-09-22 01:56:19'),
(246,38,37.720654,-122.394295,'Ipsum consectetur anim elit est dolor culpa Lorem esse veniam incididunt deserunt. Laboris culpa labore ad nisi. Sint nisi esse fugiat culpa proident do ipsum eiusmod dolor esse labore culpa veniam ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-22 04:25:22'),
(247,27,37.77548,-122.475385,'Culpa sint dolore sit nulla voluptate deserunt dolore magna sint deserunt reprehenderit sit. Culpa commodo enim cupidatat enim fugiat ex incididunt ad minim culpa exercitation. Consectetur magna ut ipsum dolore aute sunt culpa et duis officia ut ad mollit.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-08-25 05:23:39'),
(248,40,37.775494,-122.419827,'Velit incididunt cupidatat nostrud adipisicing dolor ipsum non esse excepteur anim dolore deserunt dolor. Anim ut do nostrud dolor sit ad qui tempor reprehenderit cillum. Culpa aliquip deserunt Lorem fugiat sint tempor commodo incididunt consectetur ea laboris.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-04-22 12:32:32'),
(249,1,37.7189,-122.420993,'Velit est mollit mollit anim est occaecat commodo ea pariatur commodo. Dolore deserunt ullamco adipisicing quis veniam amet exercitation. Dolor labore occaecat amet aute reprehenderit quis.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-06-28 05:47:13'),
(250,27,37.765326,-122.473189,'Dolore quis in elit minim aute eiusmod irure anim. Aliquip minim ad nulla nostrud veniam fugiat ullamco proident aliquip. Mollit laborum mollit commodo laborum consequat aliquip sit esse adipisicing ut.','https://via.placeholder.com/400/','https://via.placeholder.com/100/?text=ICON','2020-10-17 10:46:01'); |
<filename>database/dump.sql
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema eventhos
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Table `system`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `system` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'The Id For The Producer',
`class` VARCHAR(45) NOT NULL COMMENT '\'The class of the system (producer or consumer)\'',
`identifier` VARCHAR(75) NOT NULL COMMENT 'Auto generated column, lower case name',
`name` VARCHAR(45) NOT NULL COMMENT 'The name of the system',
`type` VARCHAR(45) NOT NULL COMMENT 'What type of producer it is? (Microservice, ERP, CRM, CRS, etc)',
`description` TINYTEXT NOT NULL COMMENT 'A short description for the producer',
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`client_id` INT UNSIGNED NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `idProducer_UNIQUE` (`id` ASC),
UNIQUE INDEX `indifier_UNIQUE` (`identifier` ASC),
UNIQUE INDEX `client_id_UNIQUE` (`client_id` ASC),
UNIQUE INDEX `name_UNIQUE` (`name` ASC))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `event`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `event` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'The id for the event',
`system_id` INT UNSIGNED NOT NULL,
`identifier` VARCHAR(75) NOT NULL COMMENT 'Auto generated column, lower case name and the operation generated by the back end',
`name` VARCHAR(45) NOT NULL COMMENT 'A name for the event',
`operation` VARCHAR(25) NOT NULL COMMENT 'What operation does the event represents (select, new,update, delete, process) ',
`description` TINYTEXT NOT NULL COMMENT 'A short description for the event',
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE INDEX `idProducer_Event_UNIQUE` (`id` ASC),
UNIQUE INDEX `identifier_UNIQUE` (`identifier` ASC),
INDEX `fk_event_system1_idx` (`system_id` ASC),
UNIQUE INDEX `name_UNIQUE` (`name` ASC),
CONSTRAINT `fk_event_system1`
FOREIGN KEY (`system_id`)
REFERENCES `system` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `action`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `action` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`system_id` INT UNSIGNED NOT NULL,
`identifier` VARCHAR(75) NOT NULL COMMENT 'Auto generated column, lower case name and the operation generated by the back end',
`name` VARCHAR(45) NOT NULL COMMENT 'A name for the action',
`http_configuration` MEDIUMTEXT NOT NULL COMMENT 'An http configuration that should resamblace axios config',
`operation` VARCHAR(25) NOT NULL COMMENT 'What operation does the action represents (select, new,update, delete, process) ',
`description` TINYTEXT NOT NULL COMMENT 'A short description for the action',
`deleted` TINYINT(1) NOT NULL DEFAULT 0,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE INDEX `identifier_UNIQUE` (`identifier` ASC),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
INDEX `fk_action_system1_idx` (`system_id` ASC),
UNIQUE INDEX `name_UNIQUE` (`name` ASC),
CONSTRAINT `fk_action_system1`
FOREIGN KEY (`system_id`)
REFERENCES `system` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `action_security`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `action_security` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`action_id` INT UNSIGNED NOT NULL,
`type` VARCHAR(45) NOT NULL COMMENT 'What type of security does the action has',
`http_configuration` MEDIUMTEXT NULL COMMENT 'An http configuration that should resamblace axios config for oauth2 spec.',
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE INDEX `idAction_Security_UNIQUE` (`id` ASC),
INDEX `fk_action_security_action1_idx` (`action_id` ASC),
CONSTRAINT `fk_action_security_action1`
FOREIGN KEY (`action_id`)
REFERENCES `action` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `contract`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `contract` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`action_id` INT UNSIGNED NOT NULL,
`event_id` INT UNSIGNED NOT NULL COMMENT 'The id of the event that the contract is listening',
`identifier` VARCHAR(75) NOT NULL COMMENT 'Auto generated column, lower case name and the operation generated by the back end',
`name` VARCHAR(45) NOT NULL COMMENT 'A name for the contract',
`active` TINYINT(1) NOT NULL DEFAULT 1 COMMENT 'Is the contract currently active?',
`order` SMALLINT UNSIGNED NULL DEFAULT 0,
`deleted` TINYINT(1) NULL DEFAULT 0,
`created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
INDEX `fk_contract_event1_idx` (`event_id` ASC),
UNIQUE INDEX `identifier_UNIQUE` (`identifier` ASC),
INDEX `fk_contract_action1_idx` (`action_id` ASC),
CONSTRAINT `fk_contract_event1`
FOREIGN KEY (`event_id`)
REFERENCES `event` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_contract_action1`
FOREIGN KEY (`action_id`)
REFERENCES `action` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `variable`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `variable` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`key` VARCHAR(300) NOT NULL,
`name` VARCHAR(45) NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `received_event`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `received_event` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'The id for the event',
`event_id` INT UNSIGNED NOT NULL COMMENT 'The id of the event',
`received_request` MEDIUMTEXT NOT NULL COMMENT 'The header of the request event',
`received_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'When was the event recived',
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
INDEX `fk_recived_event_event1_idx` (`event_id` ASC),
CONSTRAINT `fk_recived_event_event1`
FOREIGN KEY (`event_id`)
REFERENCES `event` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `contract_exc_detail`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `contract_exc_detail` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'The id for the event',
`contract_id` INT UNSIGNED NOT NULL,
`received_event_id` INT UNSIGNED NOT NULL,
`state` VARCHAR(15) NOT NULL COMMENT 'What satate the contract is at? (ERROR, PROCESSING, COMPLETED)',
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
INDEX `fk_contract_exc_detail_recived_event1_idx` (`received_event_id` ASC),
INDEX `fk_contract_exc_detail_contract1_idx` (`contract_id` ASC),
CONSTRAINT `fk_contract_exc_detail_recived_event1`
FOREIGN KEY (`received_event_id`)
REFERENCES `received_event` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_contract_exc_detail_contract1`
FOREIGN KEY (`contract_id`)
REFERENCES `contract` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `contract_exc_try`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `contract_exc_try` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`contract_exc_detail_id` INT UNSIGNED NOT NULL,
`request` MEDIUMTEXT NOT NULL COMMENT 'The header of the request event',
`response` MEDIUMTEXT NOT NULL COMMENT 'The header of the request event',
`state` VARCHAR(15) NOT NULL COMMENT 'What satate the contract is at? (ERROR, PROCESSING, COMPLETED)',
`finished_at` TIMESTAMP NULL COMMENT 'When was the contract executed',
`executed_at` TIMESTAMP NULL COMMENT 'When was the contract executed',
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
INDEX `fk_contract_exc_try_contract_exc_detail1_idx` (`contract_exc_detail_id` ASC),
CONSTRAINT `fk_contract_exc_try_contract_exc_detail1`
FOREIGN KEY (`contract_exc_detail_id`)
REFERENCES `contract_exc_detail` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
/* For detailed explantion of schematic, consult DOCUMENTATION.md */
DROP TABLE IF EXISTS student_award;
DROP TABLE IF EXISTS cnst_archive;
DROP TABLE IF EXISTS compound_cnst;
DROP TABLE IF EXISTS basic_cnst;
DROP TABLE IF EXISTS cnst;
DROP TABLE IF EXISTS student_action;
DROP TABLE IF EXISTS action_archive;
DROP TABLE IF EXISTS action;
DROP TABLE IF EXISTS student;
DROP PROCEDURE IF EXISTS ACTN_SUM;
DROP PROCEDURE IF EXISTS YEAR_CNT;
DROP PROCEDURE IF EXISTS ACTN_FREQ;
DROP PROCEDURE IF EXISTS ACTN_CSTV;
/*
* Tables
*/
/* Students */
CREATE TABLE student (
stdt_id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
oen VARCHAR(9) NOT NULL, /* Ontario education number */
last_name VARCHAR(64) NOT NULL,
first_name VARCHAR(64) NOT NULL,
pref_name VARCHAR(64), /* Preferred name (if applicable) */
start_year YEAR NOT NULL, /* Start of highschool career. e.g. if they start in 2019-2020 school year, put 2019. */
grad_year YEAR NOT NULL, /* End of highschool career. e.g. if they graduate in 2022-2023 school year, put 2023. */
PRIMARY KEY (stdt_id)
);
/* Actions */
CREATE TABLE action (
actn_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
type TINYINT(1) NOT NULL, /* 0 for Athletic, 1 for Academic, 2 for Activity */
name VARCHAR(64) NOT NULL,
points TINYINT UNSIGNED NOT NULL DEFAULT 0, /* Point value of action */
PRIMARY KEY (actn_id),
UNIQUE (name)
);
/* Archived actions */
CREATE TABLE action_archive (
actn_id SMALLINT UNSIGNED NOT NULL,
PRIMARY KEY (actn_id),
FOREIGN KEY (actn_id) REFERENCES action(actn_id)
);
/* Student participating in an action for a specific year */
CREATE TABLE student_action (
stdt_id MEDIUMINT UNSIGNED NOT NULL,
actn_id SMALLINT UNSIGNED NOT NULL,
start_year YEAR NOT NULL, /* Start year of current school year. If the year is 2020-2021, put 2020 here */
FOREIGN KEY (stdt_id) REFERENCES student(stdt_id),
FOREIGN KEY (actn_id) REFERENCES action(actn_id),
UNIQUE (stdt_id, actn_id, start_year)
);
/* Constraint information */
CREATE TABLE cnst (
cnst_id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(64),
description VARCHAR(64) NOT NULL,
type TINYINT(1) NOT NULL, /* See DOCUMENTATION.md */
is_award BOOLEAN NOT NULL,
PRIMARY KEY (cnst_id),
CHECK (type IN (0, 1, 2, 3, 4, 5)),
CHECK (is_award=FALSE OR name IS NOT NULL)
);
/* Basic constraint parameter info */
CREATE TABLE basic_cnst (
cnst_id SMALLINT UNSIGNED NOT NULL,
actn_id SMALLINT UNSIGNED, /* May not be valid, since actions can be deleted */
actn_type TINYINT(1),
mx TINYINT UNSIGNED, /* Max points */
x TINYINT UNSIGNED NOT NULL, /* Interval start */
y TINYINT UNSIGNED NOT NULL, /* Interval end */
PRIMARY KEY (cnst_id),
FOREIGN KEY (cnst_id) REFERENCES cnst(cnst_id)
);
/* Compound constraint edge list */
CREATE TABLE compound_cnst (
sub_cnst SMALLINT UNSIGNED NOT NULL,
super_cnst SMALLINT UNSIGNED NOT NULL,
FOREIGN KEY (sub_cnst) REFERENCES cnst(cnst_id),
FOREIGN KEY (super_cnst) REFERENCES cnst(cnst_id),
UNIQUE (sub_cnst, super_cnst)
);
/* Archived constraints */
CREATE TABLE cnst_archive (
cnst_id SMALLINT UNSIGNED NOT NULL,
PRIMARY KEY (cnst_id),
FOREIGN KEY (cnst_id) REFERENCES cnst(cnst_id)
);
/* Awards assigned to students */
CREATE TABLE student_award (
stdt_id MEDIUMINT UNSIGNED NOT NULL,
cnst_id SMALLINT UNSIGNED NOT NULL,
confirmed BOOLEAN NOT NULL DEFAULT false,
FOREIGN KEY (stdt_id) REFERENCES student(stdt_id),
FOREIGN KEY (cnst_id) REFERENCES cnst(cnst_id),
UNIQUE (stdt_id, cnst_id)
);
/*
* Procedures
*/
DELIMITER //
/*
* Calculation for basic constraint type 1 (summing action points)
* p_stdt_id: student id, corresponds to stdt_id in student table
* p_actn_type: action type, corresponds to type in action table
* p_mx: max yearly points, corresponds to _m_ from DOCUMENTATION
*/
CREATE PROCEDURE ACTN_SUM (IN p_stdt_id MEDIUMINT UNSIGNED, IN p_actn_type TINYINT(1), IN p_mx TINYINT UNSIGNED, OUT result TINYINT UNSIGNED)
BEGIN
SELECT COALESCE(SUM(res.points), 0) INTO result
FROM (
SELECT LEAST(a.points, p_mx) points, s_a.actn_id
FROM student_action s_a
INNER JOIN action a ON a.actn_id=s_a.actn_id AND a.type=p_actn_type
WHERE s_a.stdt_id=p_stdt_id
) res;
END;
//
/*
* Calculation for basic constraint type 2 (years in high school)
* p_stdt_id: student id
*/
CREATE PROCEDURE YEAR_CNT (IN p_stdt_id MEDIUMINT UNSIGNED, OUT result TINYINT UNSIGNED)
BEGIN
SELECT grad_year-start_year INTO result
FROM student WHERE stdt_id=p_stdt_id LIMIT 1;
END;
//
/*
* Calculation for basic constraint type 3 (frequency)
* p_stdt_id: student id
* p_actn_type: action type
* p_actn_id: action id, corresponds to actn_id in action table
*/
CREATE PROCEDURE ACTN_FREQ (IN p_stdt_id MEDIUMINT UNSIGNED, IN p_actn_type TINYINT(1), IN p_actn_id SMALLINT UNSIGNED, OUT result TINYINT UNSIGNED)
BEGIN
/*
* a. If only action id is given, count frequency of that specific action
* b. If both are given, count maximum frequency of any specific action (note: the action id is ignored)
* c. If only action type is given, count frequency of all actions of that type
* If none of those are satisfied, raise an exception
*/
IF p_actn_type IS NULL AND p_actn_id IS NOT NULL THEN
SELECT COUNT(*) INTO result FROM student_action s_a WHERE s_a.stdt_id=p_stdt_id AND actn_id=p_actn_id;
ELSEIF p_actn_type IS NOT NULL AND p_actn_id IS NOT NULL THEN
SELECT MAX(freq) INTO result
FROM (
SELECT s_a.actn_id, COUNT(*) freq
FROM student_action s_a
INNER JOIN action a ON a.actn_id=s_a.actn_id AND a.type=p_actn_type
WHERE s_a.stdt_id=p_stdt_id
GROUP BY s_a.actn_id
) res;
ELSEIF p_actn_type IS NOT NULL THEN
SELECT COUNT(*) INTO result
FROM (
SELECT s_a.actn_id
FROM student_action s_a
INNER JOIN action a ON a.actn_id=s_a.actn_id AND a.type=p_actn_type
WHERE s_a.stdt_id=p_stdt_id
) res;
ELSE
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'At least one of action id or action type must be not null';
END IF;
SELECT COALESCE(result, 0) INTO result;
END;
//
/*
* Calculation for basic constraint type 4 (consecutive actions)
* p_stdt_id: student id
* p_actn_type: action type
* p_actn_id: action id
*/
CREATE PROCEDURE ACTN_CSTV (IN p_stdt_id MEDIUMINT UNSIGNED, IN p_actn_type TINYINT(1), IN p_actn_id SMALLINT UNSIGNED, OUT result TINYINT UNSIGNED)
BEGIN
SELECT @last_lst := 2, @last_actn_id := 0, @last_yr := 0;
/*
* a. If only action id is given, count maximum consecutive occurrence of that specific action
* b. If both are given, count maximum consecutive occurrence of any specific action (note: the action id is ignored)
* c. If only action type is given, count maximum consecutive occurrence of all actions of that type
* If none of those are satisfied, raise an exception
*/
IF p_actn_type IS NULL AND p_actn_id IS NOT NULL THEN
SELECT MAX(cstv) INTO result
FROM (
SELECT (lst-@last_lst>0) valid, yr-@last_yr cstv, @last_lst := lst, @last_yr := yr
FROM (
SELECT MIN(sequence_combined.lst) lst, yr
FROM (
SELECT 1 lst, start_year yr
FROM student_action s_a
WHERE s_a.stdt_id=p_stdt_id AND actn_id=p_actn_id
UNION ALL
SELECT 2 lst, start_year+1 yr
FROM (
SELECT s_a.start_year
FROM student_action s_a
WHERE s_a.stdt_id=p_stdt_id AND actn_id=p_actn_id
) sequence_copy
) sequence_combined
GROUP BY yr
HAVING COUNT(*)=1
ORDER BY yr
) bounds
) res
WHERE valid;
ELSEIF p_actn_type IS NOT NULL AND p_actn_id IS NOT NULL THEN
SELECT MAX(cstv) INTO result
FROM (
SELECT (lst-@last_lst>0 AND actn_id=@last_actn_id) valid, IF(yr>@last_yr, yr-@last_yr, 0) cstv, @last_lst := lst, @last_actn_id := actn_id, @last_yr := yr
FROM (
SELECT MIN(sequence_combined.lst) lst, actn_id, yr
FROM (
SELECT 1 lst, s_a.actn_id, s_a.start_year yr
FROM student_action s_a
INNER JOIN action a ON a.actn_id=s_a.actn_id AND a.type=p_actn_type
WHERE s_a.stdt_id=p_stdt_id
UNION ALL
SELECT 2 lst, actn_id, start_year+1 yr
FROM (
SELECT s_a.actn_id, s_a.start_year
FROM student_action s_a
INNER JOIN action a ON a.actn_id=s_a.actn_id AND a.type=p_actn_type
WHERE s_a.stdt_id=p_stdt_id
) sequence_copy
) sequence_combined
GROUP BY actn_id, yr
HAVING COUNT(*)=1
ORDER BY actn_id, yr
) bounds
) res
WHERE valid;
ELSEIF p_actn_type IS NOT NULL THEN
SELECT MAX(cstv) INTO result
FROM (
SELECT (lst-@last_lst>0) valid, yr-@last_yr cstv, @last_lst := lst, @last_yr := yr
FROM (
SELECT MIN(sequence_combined.lst) lst, yr
FROM (
SELECT 1 lst, s_a.start_year yr
FROM student_action s_a
INNER JOIN action a ON a.actn_id=s_a.actn_id AND a.type=p_actn_type
WHERE s_a.stdt_id=p_stdt_id
GROUP BY s_a.start_year
UNION ALL
SELECT 2 lst, start_year+1 yr
FROM (
SELECT s_a.start_year
FROM student_action s_a
INNER JOIN action a ON a.actn_id=s_a.actn_id AND a.type=p_actn_type
WHERE s_a.stdt_id=p_stdt_id
GROUP BY s_a.start_year
) sequence_copy
) sequence_combined
GROUP BY yr
HAVING COUNT(*)=1
ORDER BY yr
) bounds
) res
WHERE valid;
ELSE
SIGNAL SQLSTATE '45000' SET MESSAGE_TEXT = 'At least one of action id or action type must be not null';
END IF;
SELECT COALESCE(result, 0) INTO result;
END;
//
DELIMITER ;
|
CREATE TABLE project ( ID decimal(18,0) NOT NULL, pname varchar(255) DEFAULT NULL, URL varchar(255) DEFAULT NULL, LEAD varchar(255) DEFAULT NULL, DESCRIPTION LONGVARCHAR, pkey varchar(255) DEFAULT NULL, pcounter decimal(18,0) DEFAULT NULL, ASSIGNEETYPE decimal(18,0) DEFAULT NULL, AVATAR decimal(18,0) DEFAULT NULL, PRIMARY KEY (ID));
|
DROP TABLE IF EXISTS $table$;
CREATE TABLE $table$ (
id BIGINT AUTO_INCREMENT,
username VARCHAR(32),
UNIQUE INDEX (username),
yob INT,
fullname VARCHAR(255),
data_date DATE,
data_time TIME(3),
data_datetime DATETIME(3),
data_bin BLOB,
data_notnull INT UNSIGNED NOT NULL,
PRIMARY KEY (id)
) Engine=InnoDB;
INSERT INTO $table$ (id, username, yob, fullname, data_date, data_time, data_datetime, data_bin, data_notnull)
VALUES
(1, 'a', '1999', 'Nguyen A', NOW(), NOW(), NOW(), '', 1)
,(2, 'b', '2000', 'Nguyen B', NOW(), NOW(), NOW(), '', 2)
,(3, 'c', '2001', 'Nguyen C', NOW(), NOW(), NOW(), '', 3)
;
|
<gh_stars>1-10
CREATE TYPE [Data_Load].[TransferEntity] AS TABLE (
[TransferId] BIGINT NOT NULL,
[SenderAccountId] BIGINT NOT NULL,
[ReceiverAccountId] BIGINT NOT NULL,
[RequiredPaymentId] UNIQUEIDENTIFIER NOT NULL,
[CommitmentId] BIGINT NOT NULL,
[Amount] DECIMAL(18, 5) NULL,
[Type] NVARCHAR(50) NOT NULL,
[CollectionPeriodName] NVARCHAR(10) NOT NULL
);
|
<reponame>AbnerLago/Foodfy<gh_stars>1-10
DROP DATABASE IF EXISTS foodfy;
CREATE DATABASE foodfy;
-- to run seeds
DELETE FROM users;
DELETE FROM chefs;
DELETE FROM recipes;
DELETE FROM files;
DELETE FROM recipe_files;
-- restart sequence auto_increment from tales ids
ALTER SEQUENCE chefs_id_seq RESTART WITH 1;
ALTER SEQUENCE recipes_id_seq RESTART WITH 1;
ALTER SEQUENCE files_id_seq RESTART WITH 1;
ALTER SEQUENCE recipe_files_id_seq RESTART WITH 1;
ALTER SEQUENCE users_id_seq RESTART WITH 1;
-- users
CREATE TABLE "users" (
"id" SERIAL PRIMARY KEY,
"name" TEXT NOT NULL,
"email" TEXT UNIQUE NOT NULL,
"password" TEXT NOT NULL,
"reset_token" TEXT,
"reset_token_expires" TEXT,
"is_admin" INT NOT NULL DEFAULT 0,
"created_at" TIMESTAMP DEFAULT(now()),
"updated_at" TIMESTAMP DEFAULT(now())
);
-- files
CREATE TABLE "files" (
"id" SERIAL PRIMARY KEY,
"name" text NOT NULL,
"path" text NOT NULL
);
-- chefs
CREATE TABLE "chefs" (
"id" SERIAL PRIMARY KEY,
"name" text NOT NULL,
"file_id" integer NOT NULL REFERENCES "files"("id"),
"created_at" timestamp DEFAULT (now()),
"updated_at" timestamp DEFAULT (now())
);
-- recipes
CREATE TABLE "recipes" (
"id" SERIAL PRIMARY KEY,
"chef_id" integer NOT NULL REFERENCES "chefs"("id") ON DELETE CASCADE,
"user_id" integer NOT NULL REFERENCES "users"("id") ON DELETE CASCADE,
"title" text NOT NULL,
"ingredients" text NOT NULL,
"preparation" text NOT NULL,
"information" text NOT NULL,
"created_at" timestamp DEFAULT (now()),
"updated_at" timestamp DEFAULT (now())
);
-- recipe files
CREATE TABLE "recipe_files" (
"id" SERIAL PRIMARY KEY,
"recipe_id" integer REFERENCES "recipes"("id") ON DELETE CASCADE,
"file_id" integer REFERENCES "files"("id")
);
-- connect-pg-simple session
CREATE TABLE "session" (
"sid" varchar NOT NULL COLLATE "default",
"sess" json NOT NULL,
"expire" timestamp(6) NOT NULL
)
WITH (OIDS=FALSE);
ALTER TABLE "session"
ADD CONSTRAINT "session_pkey"
PRIMARY KEY ("sid") NOT DEFERRABLE INITIALLY IMMEDIATE;
--create procedure
CREATE FUNCTION trigger_set_timestamp()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
--auto updated_at users
CREATE TRIGGER set_timestamp
BEFORE UPDATE ON users
FOR EACH ROW
EXECUTE PROCEDURE trigger_set_timestamp();
--auto updated_at chefs
CREATE TRIGGER set_timestamp
BEFORE UPDATE ON chefs
FOR EACH ROW
EXECUTE PROCEDURE trigger_set_timestamp();
--auto updated_at recipes
CREATE TRIGGER set_timestamp
BEFORE UPDATE ON recipes
FOR EACH ROW
EXECUTE PROCEDURE trigger_set_timestamp();
-- cascade effect recipe files
ALTER TABLE ONLY recipe_files
ADD CONSTRAINT recipe_files_file_id_fkey
FOREIGN KEY ("file_id")
REFERENCES "files"("id")
ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE ONLY recipe_files
ADD CONSTRAINT recipe_files_recipe_id_fkey
FOREIGN KEY ("recipe_id")
REFERENCES "recipes"("id")
ON UPDATE CASCADE ON DELETE CASCADE; |
--create a table containing the number of employees who are about to retire (those born 1952-1955)
SELECT e.emp_no, e.first_name,
e.last_name, ti.title,
ti.from_date, ti.to_date, s.salary
INTO number_of_employees
FROM employees as e
INNER JOIN titles as ti
ON (e.emp_no = ti.emp_no)
INNER JOIN salaries as s
ON (ti.emp_no = s.emp_no)
WHERE (e.birth_date BETWEEN '1952-01-01' AND '1955-12-31')
ORDER BY e.emp_no;
-- checking number_of_employeess table
SELECT * FROM number_of_employees;
-- filter duplicates with PARTITION
SELECT emp_no,
first_name,
last_name,
title,
to_date
INTO most_recent_title_per_employee
FROM
( SELECT emp_no,
first_name,
last_name,
title,
to_date, ROW_NUMBER() OVER
(PARTITION BY (emp_no)
ORDER BY to_date DESC) rn
FROM number_of_employees
) tmp WHERE rn = 1
ORDER BY emp_no;
SELECT * FROM most_recent_title_per_employee;
-- number of retiring
SELECT COUNT(emp_no) as count_num_ri_emp
FROM most_recent_title_per_employee;
-- total number of going to retire by per title
SELECT COUNT(title) as title_count, title
INTO employees_per_title
FROM most_recent_title_per_employee
GROUP BY title
ORDER BY title_count
;
--checking table
SELECT * FROM employees_per_title;
-- Deliverable 2: Mentorship Eligibility
-- To be eligible to participate in the mentorship program,
-- employees will need to have a date of birth that falls between January 1, 1965 and December 31, 1965.
SELECT e.emp_no, e.first_name,
e.last_name, ti.title,
de.from_date, de.to_date
INTO mentorship_program
FROM employees as e
INNER JOIN dept_emp as de
ON (e.emp_no = de.emp_no)
INNER JOIN titles as ti
ON (de.emp_no = ti.emp_no)
WHERE (e.birth_date BETWEEN '1965-01-01' AND '1965-12-31')
AND(de.to_date = '9999-01-01')
ORDER by emp_no;
SELECT * FROM mentorship_program;
-- number of mentors
SELECT COUNT(DISTINCT emp_no)
FROM mentorship_program;
|
CREATE FULLTEXT INDEX
ON [dbo].[BackupFiles]
( [FileName], [Directory], [FullSourcePath], [FileHashString] )
KEY INDEX PK_BackupFiles_ID
ON [ArchivialFtsCatalog]
WITH CHANGE_TRACKING AUTO |
DELETE FROM rating WHERE rating_id = $1; |
<reponame>Shuttl-Tech/antlr_psql<gh_stars>10-100
-- file:collate.sql ln:214 expect:true
INSERT INTO collate_test22 VALUES ('foo'), ('bar'), ('baz')
|
-- file:plpgsql.sql ln:2373 expect:true
select continue_test1()
|
--Problem 5
CREATE PROCEDURE usp_TransferMoney(@senderId INT, @recieverId INT, @amount DECIMAL(15, 4))
AS
BEGIN TRANSACTION
EXEC usp_WithdrawMoney @senderId, @amount
EXEC usp_DepositMoney @recieverId, @amount
COMMIT
EXEC usp_TransferMoney 1, 2, 100
SELECT *
FROM Accounts
WHERE Id = 1 OR Id = 2 |
<gh_stars>0
-- -- -- -- -- -- -- -- -- -- -- -- [DATA ANALYSIS] -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- [1]
-- List the following details of each employee:
-- employee number, last name, first name, gender, and salary.
SELECT * FROM employees;
-- -- -- -- -- -- -- [2]
-- List employees who were hired in 1986
-- Use ASC to find the specific dates needed for == 1986 hire_date; clearer to see
SELECT * FROM employees
-- ORDER BY hire_date ASC;
WHERE hire_date BETWEEN '1986-01-01' AND '1986-12-31';
-- -- -- -- -- -- -- [PART 3]
-- List the manager of each department with the following information: department number,
-- department name, the manager's employee number, last name, first name, and
-- start and end employment dates.
-- Things needed -- departments, dept_manager, and employees -- columns needed from
-- them include -- emp_no and demp_no
-- departments - dept_no, dept_manager - dept_no & emp_no, employees - emp_no
SELECT * FROM departments;
SELECT * FROM dept_manager;
SELECT * FROM employees;
SELECT employees.emp_no, dept_manager.dept_no, employees.first_name, employees.last_name,
employees.hire_date, dept_manager.from_date, dept_manager.to_date
FROM employees
INNER JOIN dept_manager
ON employees.emp_no = dept_manager.emp_no;
SELECT employees.emp_no, dept_manager.dept_no, departments.dept_name, employees.last_name,
employees.first_name,employees.hire_date, dept_manager.from_date, dept_manager.to_date
FROM employees
INNER JOIN dept_manager
ON employees.emp_no = dept_manager.emp_no
INNER JOIN departments
ON dept_manager.dept_no = departments.dept_no;
-- -- -- -- -- -- -- [PART 4]
-- List the department of each employee with the following information: employee number,
-- last name, first name, and department name.
SELECT employees.emp_no, employees.last_name, employees.first_name, departments.dept_name
FROM employees INNER JOIN dept_manager
ON employees.emp_no = dept_manager.emp_no
INNER JOIN departments
ON dept_manager.dept_no = departments.dept_no;
-- -- -- -- -- -- -- [PART 5]
-- List all employees whose first name is "Hercules" and last names begin with "B."
SELECT * FROM employees
WHERE first_name LIKE 'Hercules'
AND last_name LIKE 'B%';
-- -- -- -- -- -- -- [PART 6]
-- List all employees in the Sales department, including their employee number,
-- last name, first name, and department name.
SELECT dept_employee.emp_no, employees.last_name, employees.first_name, departments.dept_name
FROM dept_employee
JOIN employees
ON dept_employee.emp_no = employees.emp_no
JOIN departments
ON dept_employee.dept_no = departments.dept_no
WHERE departments.dept_name = 'Sales';
-- -- -- -- -- -- -- [PART 7]
-- List all employees in the Sales and Development departments, including their
-- employee number, last name, first name, and department name.
SELECT dept_employee.emp_no, employees.last_name, employees.first_name, departments.dept_name
FROM dept_employee
JOIN employees
ON dept_employee.emp_no = employees.emp_no
JOIN departments
ON dept_employee.dept_no = departments.dept_no
WHERE departments.dept_name = 'Sales'
OR departments.dept_name = 'Development';
-- -- -- -- -- -- -- [PART 8]
-- In descending order, list the frequency count of employee last names, i.e.,
-- how many employees share each last name.
-- Learned how to change the name of the column from Anthony
SELECT last_name AS "<NAME>",
COUNT(last_name) AS "FREQUENCY COUNT OF EMPLOYEE LAST NAMES"
FROM employees
GROUP BY last_name
ORDER BY
COUNT(last_name) DESC; |
-- Join players with seasons_stats
SELECT players.id,
players.player,
players.height,
players.weight,
players.college,
players.born,
seasons_stats.position,
seasons_stats.tm
FROM players
INNER JOIN seasons_stats ON
players.id = seasons_stats.player_id;
-- Join seasons_stats with players
SELECT seasons_stats.player_id,
players.college,
seasons_stats.year,
seasons_stats.position,
seasons_stats.Two_Point_Percentage,
seasons_stats.FG_Percentage,
seasons_stats.FT_Percentage,
seasons_stats.TS_Percentage
FROM seasons_stats
INNER JOIN players ON
players.id = seasons_stats.player_id;
|
<reponame>RyanAFinney/sakai
-- HSQLDB DDL to create table
CREATE TABLE {TABLENAME} (
{ID} BIGINT NOT NULL IDENTITY,
entityRef VARCHAR(255) NOT NULL,
entityPrefix VARCHAR(255) NOT NULL,
tag VARCHAR(255) NOT NULL);
|
<reponame>TANGO-Project/energy-modeller
CREATE SCHEMA `iaas_energy_modeller` ;
CREATE TABLE IF NOT EXISTS host
(
host_id INT NOT NULL,
host_name VARCHAR(50)
);
ALTER TABLE host
ADD CONSTRAINT pk_hostID PRIMARY KEY (host_id);
CREATE TABLE IF NOT EXISTS host_calibration_data
(
calibration_id INT NOT NULL,
host_id INT,
cpu DOUBLE,
memory DOUBLE,
power DOUBLE
);
ALTER TABLE host_calibration_data
ADD CONSTRAINT pk_host_calibration_data PRIMARY KEY (calibration_id);
ALTER TABLE `host_calibration_data`
CHANGE COLUMN `calibration_id` `calibration_id` INT(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE host_calibration_data
ADD CONSTRAINT fk_host_id
FOREIGN KEY (host_id)
REFERENCES host(host_id);
CREATE TABLE IF NOT EXISTS host_profile_data
(
host_profile_id INT NOT NULL,
host_id INT,
type VARCHAR(50),
value DOUBLE
);
ALTER TABLE host_profile_data
ADD CONSTRAINT pk_host_profile_data PRIMARY KEY (host_profile_id);
ALTER TABLE `host_profile_data`
CHANGE COLUMN `host_profile_id` `host_profile_id` INT(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE host_profile_data
ADD CONSTRAINT fk_host_profile_data_host_id
FOREIGN KEY (host_id)
REFERENCES host(host_id);
CREATE TABLE IF NOT EXISTS host_measurement
(
measurement_id INT NOT NULL,
host_id INT NOT NULL,
clock BIGINT UNSIGNED,
energy DOUBLE,
power DOUBLE
);
ALTER TABLE host_measurement
ADD CONSTRAINT pk_measurementID PRIMARY KEY (measurement_id);
ALTER TABLE `host_measurement`
CHANGE COLUMN `measurement_id` `measurement_id` INT(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE host_measurement
ADD CONSTRAINT fk_measurement_host_id
FOREIGN KEY (host_id)
REFERENCES host(host_id);
CREATE TABLE IF NOT EXISTS vm
(
vm_id INT NOT NULL,
vm_name VARCHAR(50),
deployment_id VARCHAR(50)
);
ALTER TABLE vm
ADD CONSTRAINT pk_vmID PRIMARY KEY (vm_id);
CREATE TABLE IF NOT EXISTS vm_measurement
(
measurement_id INT NOT NULL,
host_id INT NOT NULL,
vm_id INT NOT NULL,
clock BIGINT UNSIGNED,
cpu_load DOUBLE,
power_overhead DOUBLE
);
ALTER TABLE vm_measurement
ADD CONSTRAINT pk_vm_measurementID PRIMARY KEY (measurement_id);
ALTER TABLE `vm_measurement`
CHANGE COLUMN `measurement_id` `measurement_id` INT(11) NOT NULL AUTO_INCREMENT ;
ALTER TABLE vm_measurement
ADD CONSTRAINT fk_vm_measurement_host_id
FOREIGN KEY (host_id)
REFERENCES host(host_id);
ALTER TABLE vm_measurement
ADD CONSTRAINT fk_vm_measurement_vm_id
FOREIGN KEY (vm_id)
REFERENCES vm(vm_id);
CREATE INDEX idx_vm_clock ON vm_measurement (clock);
CREATE INDEX idx_vm_measure_vm_clock ON vm_measurement (vm_id, clock);
CREATE INDEX idx_vm_measure_spd ON vm_measurement (host_id, vm_id, clock);
CREATE INDEX idx_host_clock ON host_measurement (clock);
CREATE INDEX idx_host_measure_spd ON host_measurement (host_id, clock);
CREATE TABLE IF NOT EXISTS vm_app_tag_arr
(
vm_id INT NOT NULL,
vm_app_tag_id INT NOT NULL
);
CREATE TABLE IF NOT EXISTS vm_disk_arr
(
vm_id INT NOT NULL,
vm_disk_id INT NOT NULL
);
CREATE TABLE IF NOT EXISTS vm_app_tag
(
vm_app_tag_id INT NOT NULL,
tag_name VARCHAR(255)
);
CREATE TABLE IF NOT EXISTS vm_disk
(
vm_disk_id INT NOT NULL,
disk_name VARCHAR(255)
);
ALTER TABLE vm_app_tag
ADD CONSTRAINT pk_vm_app_tag PRIMARY KEY (vm_app_tag_id);
ALTER TABLE vm_disk
ADD CONSTRAINT pk_vm_disk PRIMARY KEY (vm_disk_id);
ALTER TABLE `vm_app_tag`
CHANGE COLUMN `vm_app_tag_id` `vm_app_tag_id` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE `vm_disk`
CHANGE COLUMN `vm_disk_id` `vm_disk_id` INT(11) NOT NULL AUTO_INCREMENT;
ALTER TABLE vm_app_tag
ADD UNIQUE INDEX tag_name_UNIQUE (tag_name ASC);
ALTER TABLE vm_disk
ADD UNIQUE INDEX vm_disk_UNIQUE (disk_name ASC);
ALTER TABLE vm_app_tag_arr
ADD CONSTRAINT pk_vm_app_tag_arr PRIMARY KEY (vm_app_tag_id, vm_id);
ALTER TABLE vm_disk_arr
ADD CONSTRAINT pk_vm_disk_arr PRIMARY KEY (vm_disk_id, vm_id);
ALTER TABLE vm_app_tag_arr
ADD CONSTRAINT fk_vm_app_arr_vm_id
FOREIGN KEY (vm_id)
REFERENCES vm(vm_id);
ALTER TABLE vm_app_tag_arr
ADD CONSTRAINT fk_vm_app_arr_vm_app_tag_id
FOREIGN KEY (vm_app_tag_id)
REFERENCES vm_app_tag(vm_app_tag_id);
ALTER TABLE vm_disk_arr
ADD CONSTRAINT fk_vm_disk_arr_vm_id
FOREIGN KEY (vm_id)
REFERENCES vm(vm_id);
ALTER TABLE vm_disk_arr
ADD CONSTRAINT fk_vm_disk_arr_vm_disk_id
FOREIGN KEY (vm_disk_id)
REFERENCES vm_disk(vm_disk_id); |
<reponame>IASA-GR/appdb-core
/*
Copyright (C) 2015 IASA - Institute of Accelerating Systems and Applications (http://www.iasa.gr)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
/*
EGI AppDB incremental SQL script
Previous version: 8.12.25
New version: 8.12.26
Author: <EMAIL>
*/
START TRANSACTION;
DROP MATERIALIZED VIEW site_services_xml;
DROP MATERIALIZED VIEW site_service_images_xml;
DROP VIEW va_provider_images;
ALTER TABLE __va_provider_images RENAME TO va_provider_images;
CREATE OR REPLACE FUNCTION good_vmiinstanceid(va_provider_images)
RETURNS integer AS
$BODY$
SELECT CASE WHEN goodid IS NULL THEN $1.vmiinstanceid ELSE goodid END FROM (
SELECT max(t1.id) as goodid FROM vmiinstances AS t1
INNER JOIN vmiinstances AS t2 ON t1.checksum = t2.checksum AND t1.guid = t2.guid AND t2.id = $1.vmiinstanceid
INNER JOIN vapplists ON t1.id = vapplists.vmiinstanceid
INNER JOIN vapp_versions ON vapplists.vappversionid = vapp_versions.id
WHERE vapp_versions.published
) AS t
$BODY$
LANGUAGE sql STABLE
COST 100;
ALTER FUNCTION good_vmiinstanceid(va_provider_images)
OWNER TO appdb;
CREATE MATERIALIZED VIEW site_services_xml
AS
SELECT va_providers.sitename,
XMLELEMENT(NAME "site:service", XMLATTRIBUTES('occi' AS type, va_providers.id AS id, va_providers.hostname AS host, count(DISTINCT va_provider_images.good_vmiinstanceid) AS instances, va_providers.beta AS beta, va_providers.in_production AS in_production), xmlagg(XMLELEMENT(NAME "siteservice:image", XMLATTRIBUTES(va_provider_images.vmiinstanceid AS id, va_provider_images.good_vmiinstanceid AS goodid)))) AS x
FROM va_providers
LEFT JOIN va_provider_images ON va_provider_images.va_provider_id = va_providers.id AND (va_provider_images.vmiinstanceid IN ( SELECT vaviews.vmiinstanceid
FROM vaviews))
GROUP BY va_providers.id, va_providers.hostname, va_providers.beta, va_providers.in_production, va_providers.sitename
WITH DATA;
ALTER TABLE site_services_xml
OWNER TO appdb;
CREATE INDEX idx_site_services_xml_sitename
ON site_services_xml
USING btree
(sitename COLLATE pg_catalog."default");
CREATE MATERIALIZED VIEW site_service_images_xml AS
SELECT siteimages.va_provider_id,
xmlagg(siteimages.x) AS xmlagg
FROM ( SELECT va_providers.id AS va_provider_id,
XMLELEMENT(NAME "siteservice:image", XMLATTRIBUTES(__vaviews.vappversionid AS versionid, __vaviews.va_version_archived AS archived, __vaviews.va_version_enabled AS enabled, __vaviews.va_version_expireson AS expireson,
CASE
WHEN __vaviews.va_version_expireson <= now() THEN true
ELSE false
END AS isexpired, __vaviews.imglst_private AS private, __vaviews.vmiinstanceid AS id, __vaviews.vmiinstance_guid AS identifier, __vaviews.vmiinstance_version AS version, va_provider_images.good_vmiinstanceid AS goodid), vmiflavor_hypervisor_xml.hypervisor::text::xml, XMLELEMENT(NAME "virtualization:os", XMLATTRIBUTES(oses.id AS id, __vaviews.osversion AS version, oses.os_family_id AS family_id), oses.name), XMLELEMENT(NAME "virtualization:arch", XMLATTRIBUTES(archs.id AS id), archs.name), XMLELEMENT(NAME "virtualization:format", __vaviews.format), XMLELEMENT(NAME "virtualization:url", XMLATTRIBUTES(
CASE
WHEN __vaviews.imglst_private = true THEN 'true'::text
ELSE NULL::text
END AS protected),
CASE
WHEN __vaviews.imglst_private = false THEN __vaviews.uri
ELSE NULL::text
END), XMLELEMENT(NAME "virtualization:size", XMLATTRIBUTES(
CASE
WHEN __vaviews.imglst_private = true THEN 'true'::text
ELSE NULL::text
END AS protected),
CASE
WHEN __vaviews.imglst_private = false THEN __vaviews.size
ELSE NULL::bigint
END), XMLELEMENT(NAME "siteservice:mpuri", ((((('//'::text || (( SELECT config.data
FROM config
WHERE config.var = 'ui-host'::text))) || '/store/vm/image/'::text) || __vaviews.vmiinstance_guid::text) || ':'::text) || va_provider_images.good_vmiinstanceid::text) || '/'::text), array_to_string(array_agg(DISTINCT site_service_imageocciids_to_xml(va_provider_images.va_provider_id, va_provider_images.vmiinstanceid, va_provider_images.vowide_vmiinstanceid)::text), ''::text)::xml, XMLELEMENT(NAME "application:application", XMLATTRIBUTES(__vaviews.appid AS id, __vaviews.appcname AS cname, __vaviews.imglst_private AS imagelistsprivate, applications.deleted AS deleted, applications.moderated AS moderated), XMLELEMENT(NAME "application:name", __vaviews.appname)), vmiinst_cntxscripts_to_xml(__vaviews.vmiinstanceid)) AS x
FROM va_providers
JOIN va_provider_images va_provider_images ON va_provider_images.va_provider_id = va_providers.id
JOIN vaviews __vaviews ON __vaviews.vmiinstanceid = va_provider_images.vmiinstanceid
JOIN applications ON applications.id = __vaviews.appid
LEFT JOIN vmiflavor_hypervisor_xml ON vmiflavor_hypervisor_xml.vmiflavourid = __vaviews.vmiflavourid
LEFT JOIN archs ON archs.id = __vaviews.archid
LEFT JOIN oses ON oses.id = __vaviews.osid
LEFT JOIN vmiformats ON vmiformats.name::text = __vaviews.format
WHERE __vaviews.va_version_published
GROUP BY va_providers.id, __vaviews.vappversionid, __vaviews.va_version_archived, __vaviews.va_version_enabled, __vaviews.va_version_expireson, __vaviews.imglst_private, __vaviews.vmiinstanceid, __vaviews.vmiinstance_guid, __vaviews.vmiinstance_version, va_provider_images.good_vmiinstanceid, vmiflavor_hypervisor_xml.hypervisor::text, oses.id, archs.id, __vaviews.osversion, __vaviews.format, __vaviews.uri, __vaviews.size, __vaviews.appid, __vaviews.appcname, __vaviews.appname, applications.deleted, applications.moderated) siteimages
GROUP BY siteimages.va_provider_id
WITH DATA;
ALTER TABLE site_service_images_xml
OWNER TO appdb;
-- Function: app_to_xml_ext(integer, integer)
-- DROP FUNCTION app_to_xml_ext(integer, integer);
CREATE OR REPLACE FUNCTION app_to_xml_ext(
mid integer,
muserid integer DEFAULT NULL::integer)
RETURNS xml AS
$BODY$
WITH target_relations AS(
SELECT $1 as id, xmlagg(x) as "xml" FROM target_relations_to_xml((SELECT guid FROM applications WHERE id = $1)) as x
),
subject_relations AS (
SELECT $1 as id, xmlagg(x) as "xml" FROM subject_relations_to_xml((SELECT guid FROM applications WHERE id = $1)) as x
) SELECT xmlelement(name "application:application", xmlattributes(
applications.id as id,
applications.tool as tool,
applications.rating as rating,
applications.ratingcount as "ratingCount",
app_popularity($1) as "popularity",
(SELECT vappliance_site_count(applications.id) ) as "sitecount",
applications.cname as "cname",
applications.metatype,
applications.guid as guid,
CASE WHEN applications.metatype = 2 THEN
(SELECT COUNT(context_script_assocs.scriptid) FROM context_script_assocs INNER JOIN contexts ON contexts.id = context_script_assocs.contextid WHERE contexts.appid = applications.id)
ELSE (SELECT relcount FROM app_release_count WHERE appid = applications.id)
END AS relcount,
hitcounts.count as hitcount,
(SELECT COUNT(DISTINCT(va_provider_images.va_provider_id)) FROM applications
INNER JOIN vaviews ON vaviews.appid = applications.id
INNER JOIN va_provider_images ON va_provider_images.vmiinstanceid = vaviews.vmiinstanceid AND vaviews.vmiinstanceid = va_provider_images.good_vmiinstanceid
WHERE applications.id = $1) AS vaprovidercount,
CASE WHEN applications.metatype = 2 THEN (SELECT COUNT(DISTINCT(va_provider_images.va_provider_id)) FROM contexts
INNER JOIN context_script_assocs ON context_script_assocs.contextid = contexts.id
INNER JOIN contextscripts AS cs ON cs.id = context_script_assocs.scriptid
INNER JOIN vmiinstance_contextscripts AS vcs ON vcs.contextscriptid = cs.id
INNER JOIN vaviews ON vaviews.vmiinstanceid = vcs.vmiinstanceid
INNER JOIN va_provider_images ON va_provider_images.vmiinstanceid = vaviews.vmiinstanceid AND vaviews.vmiinstanceid = va_provider_images.good_vmiinstanceid
INNER JOIN applications AS apps ON apps.id = vaviews.appid
WHERE apps.metatype = 1 AND contexts.appid = $1) ELSE 0 END AS swprovidercount,
applications.tagpolicy as "tagPolicy",
lastupdated BETWEEN NOW() - (SELECT data FROM config WHERE var='app_validation_period' LIMIT 1)::INTERVAL AND NOW() as "validated",
CASE WHEN applications.moderated IS TRUE THEN 'true' END as "moderated",
CASE WHEN applications.deleted IS TRUE THEN 'true' END as "deleted",
CASE WHEN (NOT $2 IS NULL) AND (EXISTS (SELECT * FROM appbookmarks WHERE appid = applications.id AND researcherid = $2)) THEN 'true' END as "bookmarked"), E'\n\t',
xmlelement(name "application:name", applications.name), E'\n\t',
xmlelement(name "application:description", applications.description),E'\n\t',
xmlelement(name "application:abstract", applications.abstract),E'\n\t',
xmlelement(name "application:addedOn", applications.dateadded),E'\n\t',
xmlelement(name "application:lastUpdated", applications.lastupdated),E'\n\t',
owners."owner",E'\n\t',
actors."actor",E'\n\t',
category_to_xml(applications.categoryid,applications.id),E'\n\t',
disciplines.discipline,E'\n\t',
status_to_xml(statuses.id),E'\n\t',
-- CASE WHEN 34 = ANY(applications.categoryid) THEN
-- va_vos.vo
-- ELSE
vos.vo,
-- END, E'\n\t',
countries.country, E'\n\t',
people.person, E'\n\t',
urls.url, E'\n\t',
docs.doc, E'\n\t',
middlewares.mw, E'\n\t',
xmlelement(name "application:permalink",'http://'||(SELECT data FROM config WHERE var='ui-host')||'/?p='||encode(CAST('/apps/details?id='||applications.id::text AS bytea),'base64')), E'\n\t',
CASE WHEN NOT applogos.logo IS NULL THEN
xmlelement(name "application:logo",'http://'||(SELECT data FROM config WHERE var='ui-host')||'/apps/getlogo?id='||applications.id::text)
END,
CASE WHEN applications.moderated AND (NOT $2 IS NULL) /*AND ((SELECT positiontypeid FROM researchers AS moderators WHERE moderators.id = $2) IN (5,7))*/ THEN
(
xmlelement(name "application:moderatedOn",app_mod_infos.moddedon)::text || xmlelement(name "application:moderationReason",app_mod_infos.modreason)::text || researcher_to_xml(app_mod_infos.moddedby, 'moderator')::text
)::xml
END,
CASE WHEN applications.deleted AND (NOT $2 IS NULL) /*AND ((SELECT positiontypeid FROM researchers AS deleters WHERE deleters.id = $2) IN (5,7))*/ THEN
(
xmlelement(name "application:deletedOn",app_del_infos.deletedon)::text || researcher_to_xml(app_del_infos.deletedby, 'deleter')::text
)::xml
END,
CASE WHEN applications.categoryid[1] = 34 THEN
(
xmlelement(
name "application:vappliance",
xmlattributes(
(SELECT vapplications.id FROM vapplications WHERE vapplications.appid = applications.id) AS "id",
(SELECT vapplications.appid FROM vapplications WHERE vapplications.appid = applications.id) AS "appid",
(SELECT vapplications.guid FROM vapplications WHERE vapplications.appid = applications.id) AS "identifier",
(SELECT vapplications.name FROM vapplications WHERE vapplications.appid = applications.id) AS "name",
(SELECT vapplications.imglst_private FROM vapplications WHERE vapplications.appid = applications.id) AS "imageListsPrivate"
)
)::text
)::xml
END,
app_licenses_to_xml($1),
tags.tag, E'\n\t',
proglangs.proglang, E'\n\t',
archs.arch , E'\n\t',
oses.os, E'\n\t',
-- CASE WHEN NOT $2 IS NULL THEN
-- CASE WHEN EXISTS(
-- SELECT *
-- FROM permissions
-- WHERE (object = applications.guid OR object IS NULL) AND (actor = (SELECT guid FROM researchers WHERE id = $2)) AND (actionid IN (1,2))
-- ) THEN
-- targetprivs.privs
-- END
-- END, E'\n\t',
target_relations.xml,E'\n\t',
subject_relations.xml,E'\n\t',
CASE WHEN NOT $2 IS NULL THEN
privs_to_xml(applications.guid, (SELECT guid FROM researchers WHERE id = $2))
END, E'\n\t'
) AS application FROM applications
LEFT OUTER JOIN (SELECT appid, xmlagg(discipline_to_xml(disciplineid)) AS discipline FROM appdisciplines GROUP BY appid) AS disciplines ON disciplines.appid = applications.id
LEFT OUTER JOIN (SELECT id, xmlagg(researcher_to_xml("owner", 'owner')) AS "owner" FROM applications GROUP BY id) AS owners ON owners.id = applications.id
LEFT OUTER JOIN (SELECT id, xmlagg(researcher_to_xml(addedby, 'actor')) AS "actor" FROM applications GROUP BY id) AS actors ON actors.id = applications.id
LEFT OUTER JOIN
(SELECT appid, xmlagg(vo_to_xml(void)) AS vo FROM app_vos INNER JOIN vos ON vos.id = app_vos.void WHERE vos.deleted IS FALSE GROUP BY appid)
AS vos ON vos.appid = applications.id
/*
LEFT OUTER JOIN
(
SELECT
appid,
array_to_string(array_agg(DISTINCT vo_to_xml(void)::text), '')::xml AS vo
FROM vowide_image_lists
INNER JOIN vowide_image_list_images ON vowide_image_list_images.vowide_image_list_id = vowide_image_lists.id
INNER JOIN vapplists ON vapplists.id = vowide_image_list_images.vapplistid
INNER JOIN vapp_versions ON vapp_versions.id = vapplists.vappversionid
INNER JOIN vos ON vos.id = vowide_image_lists.void
INNER JOIN vmiinstances ON vmiinstances.id = vapplists.vmiinstanceid
INNER JOIN vmiflavours ON vmiflavours.id = vmiinstances.vmiflavourid
INNER JOIN vmis ON vmis.id = vmiflavours.vmiid
INNER JOIN vapplications ON vapplications.id = vmis.vappid
WHERE NOT vos.deleted -- AND vapp_versions.published AND vapp_versions.enabled AND NOT vapp_versions.archived
GROUP BY vapplications.appid
)
AS va_vos ON va_vos.appid = applications.id
*/
LEFT OUTER JOIN (SELECT appid, xmlagg(country_to_xml(id, appid)) AS country FROM appcountries GROUP BY appid) AS countries ON countries.appid = applications.id
INNER JOIN statuses ON statuses.id = applications.statusid
LEFT OUTER JOIN target_relations ON target_relations.id = applications.id
LEFT OUTER JOIN subject_relations ON subject_relations.id = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(appmiddleware_to_xml(id)) AS mw FROM app_middlewares GROUP BY appid) AS middlewares ON middlewares.appid = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(researcher_to_xml(researcherid, 'contact',appid)) AS person FROM researchers_apps INNER JOIN researchers ON researchers.id = researchers_apps.researcherid WHERE researchers.deleted IS FALSE GROUP BY appid) AS people ON people.appid = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(xmlelement(name "application:url", xmlattributes(id as id, description as type, title as title), url)) AS url FROM app_urls GROUP BY appid) AS urls ON urls.appid = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(appdocument_to_xml(id)) AS doc FROM appdocuments GROUP BY appid) AS docs ON docs.appid = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(xmlelement(name "application:tag", xmlattributes(CASE WHEN researcherid ISNULL THEN 0 ELSE researcherid END as "submitterID"),tag)) as tag FROM app_tags GROUP BY appid) as tags ON tags.appid = applications.id
LEFT OUTER JOIN app_mod_infos ON app_mod_infos.appid = applications.id
LEFT OUTER JOIN app_del_infos ON app_del_infos.appid = applications.id
LEFT OUTER JOIN hitcounts ON hitcounts.appid = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(xmlelement(name "application:language", xmlattributes(proglangid as id),(SELECT proglangs.name FROM proglangs WHERE id = proglangid))) as proglang FROM appproglangs GROUP BY appid) as proglangs ON proglangs.appid = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(xmlelement(name "application:arch", xmlattributes(archid as id),(SELECT archs.name FROM archs WHERE id = archid))) as arch FROM app_archs GROUP BY appid) as archs ON archs.appid = applications.id
LEFT OUTER JOIN (SELECT appid, xmlagg(xmlelement(name "application:os", xmlattributes(osid as id),(SELECT oses.name FROM oses WHERE id = osid))) as os FROM app_oses GROUP BY appid) as oses ON oses.appid = applications.id
LEFT OUTER JOIN applogos ON applogos.appid = applications.id
-- LEFT OUTER JOIN (
-- SELECT xmlagg(x) AS privs, id FROM (SELECT target_privs_to_xml(applications.guid, $2) AS x, applications.id FROM applications) AS t GROUP BY t.id
-- ) AS targetprivs ON applications.id = targetprivs.id
WHERE applications.id = $1;
$BODY$
LANGUAGE sql VOLATILE
COST 100;
ALTER FUNCTION app_to_xml_ext(integer, integer)
OWNER TO appdb;
CREATE OR REPLACE FUNCTION vapp_image_providers_to_xml(_appid integer)
RETURNS SETOF xml AS
$BODY$
WITH hypervisors AS (
WITH x AS (
SELECT vmiflavours_2.id,
unnest(vmiflavours_2.hypervisors) AS y
FROM vmiflavours vmiflavours_2
)
SELECT vmiflavours_1.id AS vmiflavourid,
xmlagg(XMLELEMENT(NAME "virtualization:hypervisor", XMLATTRIBUTES(( SELECT hypervisors_1.id
FROM public.hypervisors hypervisors_1
WHERE hypervisors_1.name::text = x.y::text) AS id), x.y)) AS hypervisor
FROM vmiflavours vmiflavours_1
JOIN x ON x.id = vmiflavours_1.id
GROUP BY vmiflavours_1.id
)
SELECT
xmlelement(
name "virtualization:image",
xmlattributes(
vaviews.vmiinstanceid,
vaviews.vmiinstance_guid AS identifier,
vaviews.vmiinstance_version,
vaviews.va_version_archived AS archived,
vaviews.va_version_enabled AS enabled,
CASE WHEN vaviews.va_version_expireson >= NOW() THEN FALSE ELSE TRUE END AS isexpired
),
hypervisors.hypervisor::text::xml,
-- XMLELEMENT(NAME "virtualization:hypervisors", array_to_string(vaviews.hypervisors, ',')::xml),
XMLELEMENT(NAME "virtualization:os", XMLATTRIBUTES(oses.id AS id, vaviews.osversion AS version, oses.os_family_id as family_id), oses.name),
XMLELEMENT(NAME "virtualization:arch", XMLATTRIBUTES(archs.id AS id), archs.name),
vmiinst_cntxscripts_to_xml(vaviews.vmiinstanceid),
-- XMLELEMENT(NAME "virtualization:location", vaviews.uri),
-- XMLELEMENT(NAME "virtualization:checksum", XMLATTRIBUTES(vaviews.checksumfunc AS checkfunc), vaviews.checksum),
-- XMLELEMENT(NAME "virtualization:osversion", vaviews.osversion),
array_to_string(array_agg(DISTINCT
xmlelement(name "virtualization:provider",
xmlattributes(
va_provider_images.va_provider_id as provider_id,
va_provider_images.va_provider_image_id as occi_id,
vowide_image_lists.void,
vos.name as voname,
va_provider_images.vmiinstanceid as vmiinstanceid
)
)::text
),'')::xml
)
FROM
applications
INNER JOIN vaviews ON vaviews.appid = applications.id
INNER JOIN va_provider_images AS va_provider_images ON va_provider_images.vmiinstanceid = vaviews.vmiinstanceid
LEFT OUTER JOIN hypervisors ON hypervisors.vmiflavourid = vaviews.vmiflavourid
LEFT OUTER JOIN archs ON archs.id = vaviews.archid
LEFT OUTER JOIN oses ON oses.id = vaviews.osid
LEFT OUTER JOIN vmiformats ON vmiformats.name::text = vaviews.format
LEFT OUTER JOIN app_vos ON app_vos.appid = applications.id
LEFT OUTER JOIN vowide_image_list_images ON vowide_image_list_images.id = va_provider_images.vowide_vmiinstanceid
LEFT OUTER JOIN vowide_image_lists ON vowide_image_lists.id = vowide_image_list_images.vowide_image_list_id AND (vowide_image_lists.state::text = 'published' OR vowide_image_lists.state::text = 'obsolete')
LEFT OUTER JOIN vos ON vos.id = vowide_image_lists.void
WHERE
vaviews.vmiinstanceid = va_provider_images.good_vmiinstanceid AND
vaviews.va_version_published AND
-- NOT vaviews.va_version_archived AND
applications.id = $1
GROUP BY
applications.id,
--vaviews.uri,
--vaviews.checksumfunc,
--vaviews.checksum,
vaviews.osversion,
--vaviews.hypervisors,
hypervisors.hypervisor::text,
--vaviews.va_id,
--vaviews.vappversionid,
vaviews.vmiinstanceid,
vaviews.vmiflavourid,
vaviews.vmiinstance_guid,
vaviews.vmiinstance_version,
vaviews.va_version_archived,
vaviews.va_version_enabled,
vaviews.va_version_expireson,
archs.id,
oses.id,
vmiformats.id;
$BODY$
LANGUAGE sql VOLATILE
COST 100
ROWS 1000;
ALTER FUNCTION vapp_image_providers_to_xml(integer)
OWNER TO appdb;
CREATE OR REPLACE FUNCTION vappliance_site_count(appid integer) RETURNS integer
LANGUAGE sql
AS $_$
SELECT COUNT(p.sitename)::INTEGER FROM (
SELECT vp.sitename FROM
va_providers AS vp
INNER JOIN va_provider_images AS vi ON vi.va_provider_id = vp.id
INNER JOIN vaviews AS vv ON vv.vmiinstanceid = vi.vmiinstanceid
WHERE vv.appid = $1 AND vv.va_version_published = true AND vv.va_version_enabled = true AND vv.vmiinstanceid = vi.good_vmiinstanceid
GROUP BY vp.sitename
) AS p
$_$;
-- Function: count_site_matches(text, text, boolean)
-- DROP FUNCTION count_site_matches(text, text, boolean);
CREATE OR REPLACE FUNCTION count_site_matches(
itemname text,
cachetable text,
private boolean DEFAULT false)
RETURNS SETOF record AS
$BODY$
DECLARE q TEXT;
DECLARE allitems INT;
BEGIN
IF itemname = 'country' THEN
q := 'SELECT countries.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, countries.id AS count_id FROM ' || cachetable || ' AS sites LEFT JOIN countries ON countries.id = sites.countryid';
ELSIF itemname = 'discipline' THEN
q := 'SELECT disciplines.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, disciplines.id AS count_id FROM ' || cachetable || ' AS sites LEFT JOIN va_providers ON va_providers.sitename = sites.name
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid
LEFT JOIN applications ON applications.id = vaviews.appid
LEFT JOIN appdisciplines ON appdisciplines.appid = applications.id
LEFT JOIN disciplines ON disciplines.id = appdisciplines.disciplineid';
-- q := 'SELECT disciplines.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, disciplines.id AS count_id FROM ' || cachetable || ' AS sites' || CASE WHEN NOT private THEN ' LEFT JOIN app_vos ON app_vos.appid = applications.id LEFT JOIN vos ON vos.id = app_vos.void AND vos.deleted IS FALSE' ELSE '' END || ' LEFT JOIN appdisciplines ON appdisciplines.appid = applications.id LEFT JOIN disciplines ON disciplines.id = appdisciplines.disciplineid' || CASE WHEN NOT private THEN ' OR disciplines.id = vos.domainid' ELSE '' END;
ELSIF itemname = 'category' THEN
q := 'SELECT categories.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, categories.id AS count_id
FROM ' || cachetable || ' AS sites LEFT JOIN va_providers ON va_providers.sitename = sites.name LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid LEFT JOIN applications ON applications.id = vaviews.appid LEFT JOIN categories ON categories.id = ANY(applications.categoryid)';
--q := 'SELECT categories.name::TEXT AS count_text, COUNT(DISTINCT applications.id) AS count, categories.id AS count_id FROM ' || cachetable || ' AS applications LEFT JOIN categories ON categories.id = ANY(applications.categoryid)';
ELSIF itemname = 'arch' THEN
q := 'SELECT archs.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, archs.id AS count_id FROM ' || cachetable || ' AS sites LEFT JOIN va_providers ON va_providers.sitename = sites.name
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid
LEFT JOIN applications ON applications.id = vaviews.appid
LEFT JOIN vapplications ON vapplications.appid = applications.id
LEFT JOIN vapp_versions ON vapp_versions.vappid = vapplications.id AND published AND enabled AND NOT archived AND status = ''verified''
LEFT JOIN vmis ON vmis.vappid = vapplications.id
LEFT JOIN vmiflavours ON vmiflavours.vmiid = vmis.id
LEFT JOIN archs ON archs.id = vmiflavours.archid';
ELSIF itemname = 'os' THEN
q := 'SELECT oses.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, oses.id AS count_id FROM ' || cachetable || ' AS sites
LEFT JOIN va_providers ON va_providers.sitename = sites.name
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid
LEFT JOIN applications ON applications.id = vaviews.appid
LEFT JOIN vapplications ON vapplications.appid = applications.id
LEFT JOIN vapp_versions ON vapp_versions.vappid = vapplications.id AND published AND enabled AND NOT archived AND status = ''verified''
LEFT JOIN vmis ON vmis.vappid = vapplications.id
LEFT JOIN vmiflavours ON vmiflavours.vmiid = vmis.id
LEFT JOIN oses ON oses.id = vmiflavours.osid';
ELSIF itemname = 'osfamily' THEN
q := 'SELECT os_families.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, os_families.id AS count_id FROM ' || cachetable || ' AS sites
LEFT JOIN va_providers ON va_providers.sitename = sites.name
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid
LEFT JOIN applications ON applications.id = vaviews.appid
LEFT JOIN vapplications ON vapplications.appid = applications.id
LEFT JOIN vapp_versions ON vapp_versions.vappid = vapplications.id AND published AND enabled AND NOT archived AND status = ''verified''
LEFT JOIN vmis ON vmis.vappid = vapplications.id
LEFT JOIN vmiflavours ON vmiflavours.vmiid = vmis.id
LEFT JOIN oses ON oses.id = vmiflavours.osid
LEFT JOIN os_families ON os_families.id = oses.os_family_id';
ELSIF itemname = 'hypervisor' THEN
q :='SELECT hypervisors.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, hypervisors.id::int AS count_id FROM ' || cachetable || ' AS sites
LEFT JOIN va_providers ON va_providers.sitename = sites.name
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid
LEFT JOIN applications ON applications.id = vaviews.appid
LEFT JOIN vapplications ON vapplications.appid = applications.id
LEFT JOIN vapp_versions ON vapp_versions.vappid = vapplications.id AND published AND enabled AND NOT archived AND status = ''verified''
LEFT JOIN vmis ON vmis.vappid = vapplications.id
LEFT JOIN vmiflavours ON vmiflavours.vmiid = vmis.id
LEFT JOIN hypervisors ON hypervisors.name::text = ANY(vmiflavours.hypervisors::TEXT[])';
ELSIF itemname = 'vo' THEN
q := 'SELECT vos.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, vos.id AS count_id FROM ' || cachetable || ' AS sites
LEFT JOIN va_providers ON va_providers.sitename = sites.name
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id AND va_provider_images.vowide_vmiinstanceid IS NOT NULL
LEFT JOIN vowide_image_list_images ON vowide_image_list_images.ID = va_provider_images.vowide_vmiinstanceid and vowide_image_list_images.state = ''up-to-date''::e_vowide_image_state
LEFT JOIN vowide_image_lists ON vowide_image_lists.id = vowide_image_list_images.vowide_image_list_id AND vowide_image_list_images.state <> ''draft''::e_vowide_image_state
LEFT JOIN vos ON vos.id = vowide_image_lists.void AND vos.deleted IS FALSE';
ELSIF itemname = 'middleware' THEN
q := 'SELECT middlewares.name::TEXT AS count_text, COUNT(DISTINCT sites.id) AS count, middlewares.id AS count_id FROM ' || cachetable || ' AS sites
LEFT JOIN va_providers ON va_providers.sitename = sites.name
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid
LEFT JOIN applications ON applications.id = vaviews.appid
LEFT JOIN app_middlewares ON app_middlewares.appid = applications.id
LEFT JOIN middlewares ON middlewares.id = app_middlewares.middlewareid';
ELSIF itemname = 'supports' THEN
q := 'SELECT CASE WHEN va_providers.sitename IS NULL THEN ''none''
ELSE ''occi'' END AS count_text, COUNT(DISTINCT sites.id) AS count,
CASE WHEN va_providers.sitename IS NULL THEN 0 ELSE 1 END AS count_id
FROM ' || cachetable || ' AS sites
LEFT JOIN va_providers ON va_providers.sitename = sites.name and va_providers.in_production = true';
ELSIF itemname = 'hasinstances' THEN
q := 'SELECT CASE WHEN va_provider_images.vmiinstanceid IS NULL THEN ''none''
ELSE ''virtual images'' END AS count_text, COUNT(DISTINCT sites.id) AS count,
CASE WHEN va_provider_images.vmiinstanceid IS NULL THEN 0 ELSE 1 END AS count_id
FROM ' || cachetable || ' AS sites
LEFT JOIN va_providers ON va_providers.sitename = sites.name and va_providers.in_production = true
LEFT JOIN va_provider_images AS va_provider_images ON va_provider_images.va_provider_id = va_providers.id
LEFT JOIN vaviews ON vaviews.vmiinstanceid = va_provider_images.vmiinstanceid';
ELSE
RAISE NOTICE 'Unknown site property requested for logistics counting: %', itemname;
RETURN;
END IF;
RETURN QUERY EXECUTE 'SELECT count_text, count, count_id::text FROM (' || q || ' GROUP BY count_text, count_id) AS t WHERE NOT count_text IS NULL';
END;
$BODY$
LANGUAGE plpgsql VOLATILE
COST 100
ROWS 1000;
ALTER FUNCTION count_site_matches(text, text, boolean)
OWNER TO appdb;
COMMENT ON FUNCTION count_site_matches(text, text, boolean) IS 'not to be called directly; used by site_logistics function';
CREATE OR REPLACE FUNCTION good_vmiinstanceid(va_provider_images)
RETURNS integer AS
$BODY$
SELECT CASE WHEN goodid IS NULL THEN $1.vmiinstanceid ELSE goodid END FROM (
SELECT max(t1.id) as goodid FROM vmiinstances AS t1
INNER JOIN vmiinstances AS t2 ON t1.checksum = t2.checksum AND t1.guid = t2.guid AND t2.id = $1.vmiinstanceid
INNER JOIN vapplists ON t1.id = vapplists.vmiinstanceid
INNER JOIN vapp_versions ON vapplists.vappversionid = vapp_versions.id
WHERE vapp_versions.published
) AS t
$BODY$
LANGUAGE sql STABLE
COST 100;
ALTER FUNCTION good_vmiinstanceid(va_provider_images)
OWNER TO appdb;
ALTER TABLE app_order_hack ADD CONSTRAINT pk_app_order_hack PRIMARY KEY (appid);
ALTER TABLE va_provider_images ADD CONSTRAINT fk_va_provider_images_vmiinstances_1 FOREIGN KEY (vmiinstanceid) REFERENCES vmiinstances(id);
CREATE INDEX idx_va_provider_images_vmiinstanceid ON va_provider_images(vmiinstanceid);
CREATE INDEX idx_va_provider_images_vowide_vmiinstanceid ON va_provider_images(vowide_vmiinstanceid);
CREATE INDEX idx_vapplications_appid ON vapplications(appid);
CREATE INDEX idx_vapplists_vappversionid ON vapplists(vappversionid);
CREATE INDEX idx_vapplists_vmiinstanceid ON vapplists(vmiinstanceid);
CREATE INDEX idx_context_script_assocs_contextid ON context_script_assocs(contextid);
CREATE INDEX idx_context_script_assocs_scriptid ON context_script_assocs(scriptid);
CREATE INDEX idx_vowide_image_list_images_listid ON vowide_image_list_images(vowide_image_list_id);
CREATE INDEX idx_vowide_image_list_images_vapplistid ON vowide_image_list_images(vapplistid);
CREATE INDEX idx_vowide_image_lists_void ON vowide_image_lists(void);
CREATE INDEX idx_vowide_image_lists_state ON vowide_image_lists(state);
CREATE INDEX idx_vowide_image_lists_state_pub_or_obs ON vowide_image_lists(state) WHERE state = 'published' OR state = 'obsolete';
CREATE INDEX idx_vmiinstance_contextscripts_vmiinstanceid ON vmiinstance_contextscripts(vmiinstanceid);
CREATE INDEX idx_vmiinstance_contextscripts_contextscriptid ON vmiinstance_contextscripts(contextscriptid);
CREATE INDEX idx_vmiinstances_checksum ON vmiinstances(checksum);
CREATE INDEX idx_vmiinstances_guid ON vmiinstances(guid);
CREATE INDEX idx_applications_metatype ON applications(metatype);
CREATE OR REPLACE FUNCTION swapp_image_providers_to_xml(_appid integer)
RETURNS SETOF xml AS
$BODY$
SELECT
xmlelement(
name "virtualization:image",
xmlattributes(
vaviews.vmiinstanceid,
vaviews.vmiinstance_guid AS identifier,
vaviews.vmiinstance_version,
vaviews.va_version_archived AS archived,
vaviews.va_version_enabled AS enabled,
CASE WHEN vaviews.va_version_expireson >= NOW() THEN FALSE ELSE TRUE END AS isexpired
),
XMLELEMENT(NAME "application:application",
XMLATTRIBUTES(applications.id AS id, applications.cname AS cname, applications.guid AS guid, applications.deleted, applications.moderated),
XMLELEMENT(NAME "application:name", applications.name)
),
hypervisors.hypervisor::text::xml,
XMLELEMENT(NAME "virtualization:os", XMLATTRIBUTES(oses.id AS id, vaviews.osversion AS version, oses.os_family_id as family_id), oses.name),
XMLELEMENT(NAME "virtualization:arch", XMLATTRIBUTES(archs.id AS id), archs.name),
vmiinst_cntxscripts_to_xml(vaviews.vmiinstanceid),
array_to_string(array_agg(DISTINCT
xmlelement(name "virtualization:provider",
xmlattributes(
va_provider_images.va_provider_id as provider_id,
va_provider_images.va_provider_image_id as occi_id,
vowide_image_lists.void,
va_provider_images.vmiinstanceid as vmiinstanceid
)
)::text
),'')::xml
)
FROM contexts
INNER JOIN context_script_assocs ON context_script_assocs.contextid = contexts.id
INNER JOIN contextscripts AS cs ON cs.id = context_script_assocs.scriptid
INNER JOIN vmiinstance_contextscripts AS vcs ON vcs.contextscriptid = cs.id
INNER JOIN va_provider_images ON va_provider_images.good_vmiinstanceid = vcs.vmiinstanceid
INNER JOIN vaviews ON vaviews.vmiinstanceid = vcs.vmiinstanceid
INNER JOIN applications ON applications.id = vaviews.appid
LEFT OUTER JOIN vmiflavor_hypervisor_xml AS hypervisors ON hypervisors.vmiflavourid = vaviews.vmiflavourid
LEFT OUTER JOIN archs ON archs.id = vaviews.archid
LEFT OUTER JOIN oses ON oses.id = vaviews.osid
-- LEFT OUTER JOIN vmiformats ON vmiformats.name = vaviews.format
LEFT OUTER JOIN app_vos ON app_vos.appid = applications.id
LEFT OUTER JOIN vowide_image_list_images ON vowide_image_list_images.id = va_provider_images.vowide_vmiinstanceid
LEFT OUTER JOIN vowide_image_lists ON vowide_image_lists.id = vowide_image_list_images.vowide_image_list_id AND (vowide_image_lists.state = 'published' OR vowide_image_lists.state = 'obsolete')
WHERE
vaviews.va_version_published
-- AND contexts.appid = $1
GROUP BY
applications.id,
vaviews.osversion,
hypervisors.hypervisor::text,
vaviews.vmiinstanceid,
vaviews.vmiflavourid,
vaviews.vmiinstance_guid,
vaviews.vmiinstance_version,
vaviews.va_version_archived,
vaviews.va_version_enabled,
vaviews.va_version_expireson,
archs.id,
oses.id,
-- vmiformats.id,
app_vos.appid
$BODY$
LANGUAGE sql VOLATILE
COST 100
ROWS 1000;
ALTER FUNCTION swapp_image_providers_to_xml(integer)
OWNER TO appdb;
INSERT INTO version (major,minor,revision,notes)
SELECT 8, 12, 26, E'Performance improvements'
WHERE NOT EXISTS (SELECT * FROM version WHERE major=8 AND minor=12 AND revision=26);
COMMIT;
|
<gh_stars>10-100
CREATE OR REPLACE PROCEDURE UPDATECOUNTRYLISTALL
(vCountryCode IN Country.CountryCode%TYPE,
vCountryName IN Country.CountryName%TYPE,
cur_OUT OUT PKGENTLIB_ARCHITECTURE.CURENTLIB_ARCHITECTURE
)
AS
BEGIN
UPDATE Country SET CountryName = vCountryName where CountryCode=vCountryCode;
OPEN cur_OUT for
SELECT * FROM Country;
END;
/
|
select name, id, type, region, resource_group
from azure.azure_application_security_group
where name = '{{resourceName}}' and resource_group = '{{resourceName}}'
|
<filename>src/main/resources/org/support/project/knowledge/dao/sql/MailPropertiesDao/MailPropertiesDao_delete.sql<gh_stars>100-1000
DELETE FROM MAIL_PROPERTIES
WHERE
HOOK_ID = ?
AND PROPERTY_KEY = ?
;
|
--DROP ROLE activiti;
CREATE ROLE activiti LOGIN
ENCRYPTED PASSWORD '<PASSWORD>'
NOSUPERUSER INHERIT CREATEDB NOCREATEROLE;
COMMENT ON ROLE activiti IS 'user for workflow engine';
CREATE DATABASE activitidb
WITH ENCODING='UTF8'
OWNER=activiti
CONNECTION LIMIT=-1;
|
<filename>tests/queries/0_stateless/01421_assert_in_in.sql
SELECT (1, 2) IN ((1, (2, 3)), (1 + 1, 1)); -- { serverError 53 }
|
-- @testpoint:opengauss关键字current_user(保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists current_user_test cascade;
--关键字不带引号-合理报错
create table current_user_test(id int,name current_user);
--关键字带双引号-合理报错
create table current_user_test(id int,name "current_user");
--关键字带单引号-合理报错
create table current_user_test(id int,name 'current_user');
--关键字带反引号-合理报错
create table current_user_test(id int,name `current_user`); |
alter table chat_message
rename column sender_identity_id to sender_user_id;
|
CREATE DATABASE RpsGameDb;
-- CREATE SCHEMA RpsGame;
DROP TABLE Players;
CREATE TABLE Players(
PlayerId int PRIMARY KEY NOT NULL IDENTITY(1,1) ,
PlayerFname NVARCHAR(20) NOT NULL,
PlayerLname NVARCHAR(20) NOT NULL,
PlayerAge INT NULL,
CONSTRAINT AgeUnder125 CHECK (PlayerAge < 125 AND PlayerAge > 0 )
);
INSERT INTO Players (PlayerFname, PlayerLname, PlayerAge)
VALUES ('Mark', 'Moore', 42);
INSERT INTO Players (PlayerFname, PlayerLname, PlayerAge)
VALUES ('Sekou', 'Dosso', 60);
SELECT * FROM Players;
|
-- -------------------------------- mm_wiki
-- mm-wiki 表结构
-- author: phachon
-- --------------------------------
-- 手动安装时首先需要创建数据库
-- create database if not exists mm_wiki default charset utf8;
-- --------------------------------
-- 用户表
-- --------------------------------
drop table if exists mm_wiki.mw_user purge;
create table mm_wiki."mw_user" (
"user_id" int not null primary key identity(1,1) , --comment '用户 id',
"username" varchar(100) not null default '', --comment '用户名',
"password" varchar(32) not null default '', --comment '密码',
"given_name" varchar(50) not null default '', --comment '姓名',
"mobile" varchar(13) not null default '', --comment '手机号',
"phone" varchar(13) not null default '', --comment '电话',
"email" varchar(50) not null default '', --comment '邮箱',
"department" varchar(50) not null default '', --comment '部门',
"position" varchar(50) not null default '', --comment '职位',
"location" varchar(50) not null default '', --comment '位置',
"im" varchar(50) not null default '', --comment '即时聊天工具',
"last_ip" varchar(15) not null default '', --comment '最后登录ip',
"last_time" bigint not null default 0, --comment '最后登录时间',
"role_id" tinyint not null default 0, --comment '角色 id',
"is_forbidden" tinyint not null default 0, --comment '是否屏蔽,0 否 1 是',
"is_delete" tinyint not null default 0, --comment '是否删除,0 否 1 是',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='用户表';
-- ---------------------------------------------------------------
-- 系统角色表
-- ---------------------------------------------------------------
drop table if exists mm_wiki.mw_role purge;
create table mm_wiki."mw_role" (
"role_id" int not null primary key identity(1,1) , --comment '角色 id',
"name" varchar(10) not null default '', --comment '角色名称',
"type" tinyint not null default 0, --comment '角色类型 0 自定义角色,1 系统角色',
"is_delete" tinyint not null default 0, --comment '是否删除,0 否 1 是',
"create_time" int not null default 0, --comment '创建时间',
"update_time" int not null default 0 --comment '更新时间',
) ;--, --comment='系统角色表';
-- -------------------------------------------------------
-- 系统权限表
-- -------------------------------------------------------
drop table if exists mm_wiki.mw_privilege purge;
create table mm_wiki."mw_privilege" (
"privilege_id" int not null primary key identity(1,1) , --comment '权限id',
"name" varchar(30) not null default '', --comment '权限名',
"parent_id" int not null default 0, --comment '上级',
"type" varchar(100) not null default 'controller', --comment '权限类型:控制器、菜单',
"controller" varchar(100) not null default '', --comment '控制器',
"action" varchar(100) not null default '', --comment '动作',
"icon" varchar(100) not null default '', --comment '图标(用于展示)',
"target" varchar(200) not null default '', --comment '目标地址',
"is_display" tinyint not null default 0, --comment '是否显示:0不显示 1显示',
"sequence" int not null default 0, --comment '排序(越小越靠前)',
"create_time" int not null default 0, --comment '创建时间',
"update_time" int not null default 0 --comment '更新时间',
) ;--, --comment='系统权限表';
-- ------------------------------------------------------------------
-- 系统角色权限对应关系表
-- ------------------------------------------------------------------
drop table if exists mm_wiki.mw_role_privilege purge;
create table mm_wiki."mw_role_privilege" (
"role_privilege_id" int not null primary key identity(1,1) , --comment '角色权限关系 id',
"role_id" int not null default 0, --comment '角色id',
"privilege_id" int not null default 0, --comment '权限id',
"create_time" int not null default 0 --comment '创建时间',
) ;--, --comment='系统角色权限对应关系表';
-- --------------------------------
-- 空间表
-- --------------------------------
drop table if exists mm_wiki.mw_space purge;
create table mm_wiki."mw_space" (
"space_id" int not null primary key identity(1,1) , --comment '空间 id',
"name" varchar(50) not null default '', --comment '名称',
"description" varchar(100) not null default '', --comment '描述',
"tags" varchar(255) not null default '', --comment '标签',
"visit_level" varchar(100) not null default 'public', --comment '访问级别:private,public',
"is_share" tinyint not null default 1, --comment '文档是否允许分享 0 否 1 是',
"is_export" tinyint not null default 1, --comment '文档是否允许导出 0 否 1 是',
"is_delete" tinyint not null default 0, --comment '是否删除 0 否 1 是',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='空间表';
-- --------------------------------
-- 空间成员表
-- --------------------------------
drop table if exists mm_wiki.mw_space_user purge;
create table mm_wiki."mw_space_user" (
"space_user_id" int not null primary key identity(1,1) , --comment '用户空间关系 id',
"user_id" int not null default 0, --comment '用户 id',
"space_id" int not null default 0, --comment '空间 id',
"privilege" tinyint not null default 0, --comment '空间成员操作权限 0 浏览者 1 编辑者 2 管理员',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '修改时间',
) ;--, --comment='空间成员表';
create unique index idx_mw_space_user_user_id_space_id on mm_wiki."mw_space_user"("user_id", "space_id");
-- --------------------------------
-- 文档表
-- --------------------------------
drop table if exists mm_wiki.mw_document purge;
create table mm_wiki."mw_document" (
"document_id" int not null primary key identity(1,1) , --comment '文档 id',
"parent_id" int not null default 0, --comment '文档父 id',
"space_id" int not null default 0, --comment '空间id',
"name" varchar(150) not null default '', --comment '文档名称',
"type" tinyint not null default 1, --comment '文档类型 1 page 2 dir',
"path" varchar(30) not null default 0, --comment '存储根文档到父文档的 document_id 值, 格式 0,1,2,...',
"sequence" int not null default 0, --comment '排序号(越小越靠前)',
"create_user_id" int not null default 0, --comment '创建用户 id',
"edit_user_id" int not null default 0, --comment '最后修改用户 id',
"is_delete" tinyint not null default 0, --comment '是否删除 0 否 1 是',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='文档表';
-- --------------------------------
-- 用户收藏表
-- --------------------------------
drop table if exists mm_wiki.mw_collection purge;
create table mm_wiki."mw_collection" (
"collection_id" int not null primary key identity(1,1) , --comment '用户收藏关系 id',
"user_id" int not null default 0, --comment '用户id',
"type" tinyint not null default 1, --comment '收藏类型 1 文档 2 空间',
"resource_id" int not null default 0, --comment '收藏资源 id ',
"create_time" bigint not null default 0 --comment '创建时间',
) ;--, --comment='用户收藏表';
create unique index idx_mw_collection on mm_wiki."mw_collection"("user_id", "resource_id", "type");
-- --------------------------------
-- 用户关注表
-- --------------------------------
drop table if exists mm_wiki.mw_follow purge;
create table mm_wiki.mw_follow (
"follow_id" int not null primary key identity(1,1) , --comment '关注 id',
"user_id" int not null default 0, --comment '用户id',
"type" tinyint not null default 1, --comment '关注类型 1 文档 2 用户',
"object_id" int not null default 0, --comment '关注对象 id',
"create_time" bigint not null default 0 --comment '创建时间',
) ;--, --comment='用户关注表';
create unique index idx_mw_follow on mm_wiki.mw_follow(user_id, object_id, type);
-- --------------------------------
-- 文档日志表
-- --------------------------------
drop table if exists mm_wiki.mw_log_document purge;
create table mm_wiki."mw_log_document" (
"log_document_id" int not null primary key identity(1,1) , --comment '文档日志 id',
"document_id" int not null default 0, --comment '文档id',
"space_id" int not null default 0, --comment '空间id',
"user_id" int not null default 0, --comment '用户id',
"action" tinyint not null default 1, --comment '动作 1 创建 2 修改 3 删除',
"comments" varchar(255) not null default '', --comment '备注信息',
"create_time" int not null default 0 --comment '创建时间',
) ;--, --comment='文档日志表';
-- --------------------------------
-- 系统操作日志表
-- --------------------------------
drop table if exists mm_wiki.mw_log purge;
create table mm_wiki."mw_log" (
"log_id" bigint not null primary key identity(1,1) , --comment '系统操作日志 id',
"level" tinyint not null default '6', --comment '日志级别',
"path" varchar(100) not null default '', --comment '请求路径',
"get" varchar(4000) not null, --comment 'get参数',
"post" varchar(4000) not null, --comment 'post参数',
"message" varchar(255) not null default '', --comment '信息',
"ip" varchar(100) not null default '', --comment 'ip地址',
"user_agent" varchar(200) not null default '', --comment '用户代理',
"referer" varchar(100) not null default '', --comment 'referer',
"user_id" int not null default 0, --comment '用户id',
"username" varchar(100) not null default '', --comment '用户名',
"create_time" int not null default 0 --comment '创建时间',
) ;--, --comment='系统操作日志表';
-- --------------------------------
-- 邮件服务器表
-- --------------------------------
drop table if exists mm_wiki.mw_email purge;
create table mm_wiki."mw_email" (
"email_id" int not null primary key identity(1,1) , --comment '邮箱 id',
"name" varchar(100) not null default '', --comment '邮箱服务器名称',
"sender_address" varchar(100) not null default '', --comment '发件人邮件地址',
"sender_name" varchar(100) not null default '', --comment '发件人显示名',
"sender_title_prefix" varchar(100) not null default '', --comment '发送邮件标题前缀',
"host" varchar(100) not null default '', --comment '服务器主机名',
"port" int not null default '25', --comment '服务器端口',
"username" varchar(50) not null default '', --comment '用户名',
"password" varchar(50) not null default '', --comment '密码',
"is_ssl" tinyint not null default 0, --comment '是否使用ssl, 0 默认不使用 1 使用',
"is_used" tinyint not null default 0, --comment '是否被使用, 0 默认不使用 1 使用',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='邮件服务器表';
-- --------------------------------
-- 快捷链接表
-- --------------------------------
drop table if exists mm_wiki.mw_link purge;
create table mm_wiki."mw_link" (
"link_id" int not null primary key identity(1,1) , --comment '链接 id',
"name" varchar(50) not null default '', --comment '链接名称',
"url" varchar(100) not null default '', --comment '链接地址',
"sequence" int not null default 0, --comment '排序号(越小越靠前)',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='快捷链接表';
-- --------------------------------
-- 统一登录认证表
-- --------------------------------
drop table if exists mm_wiki.mw_login_auth purge;
create table mm_wiki."mw_login_auth" (
"login_auth_id" bigint not null primary key identity(1,1) , --comment '认证表主键id',
"name" varchar(30) not null, --comment '登录认证名称',
"username_prefix" varchar(30) not null, --comment '用户名前缀',
"url" varchar(200) not null, --comment '认证接口 url',
"ext_data" varchar(500) not null default '', --comment '额外数据: token=aaa&key=bbb',
"is_used" tinyint not null default 0, --comment '是否被使用, 0 默认不使用 1 使用',
"is_delete" tinyint not null default 0, --comment '是否删除 0 否 1 是',
"create_time" bigint not null, --comment '创建时间',
"update_time" bigint not null --comment '更新时间',
) ;--, --comment='统一登录认证表';
-- --------------------------------
-- 全局配置表
-- --------------------------------
drop table if exists mm_wiki.mw_config purge;
create table mm_wiki."mw_config" (
"config_id" bigint not null primary key identity(1,1) , --comment '配置表主键id',
"name" varchar(100) not null default '', --comment '配置名称',
"key" varchar(50) not null default '', --comment '配置键',
"value" varchar(4000) not null, --comment '配置值',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='全局配置表';
-- --------------------------------
-- 系统联系人表
-- --------------------------------
drop table if exists mm_wiki.mw_contact purge;
create table mm_wiki."mw_contact" (
"contact_id" int not null primary key identity(1,1) , --comment '联系人 id',
"name" varchar(50) not null default '', --comment '联系人名称',
"mobile" varchar(13) not null default '', --comment '联系电话',
"email" varchar(50) not null default '', --comment '邮箱',
"position" varchar(100) not null default '', --comment '联系人职位',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='联系人表';
-- --------------------------------
-- 附件信息表
-- --------------------------------
drop table if exists mm_wiki.mw_attachment purge;
create table mm_wiki."mw_attachment" (
"attachment_id" int not null primary key identity(1,1) , --comment '附件 id',
"user_id" int not null default 0, --comment '创建用户id',
"document_id" int not null default 0, --comment '所属文档id',
"name" varchar(50) not null default '', --comment '附件名称',
"path" varchar(100) not null default '', --comment '附件路径',
"source" tinyint not null default 0, --comment '附件来源, 0 默认是附件 1 图片',
"create_time" bigint not null default 0, --comment '创建时间',
"update_time" bigint not null default 0 --comment '更新时间',
) ;--, --comment='附件信息表';
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1
-- Létrehozás ideje: 2022. Feb 16. 21:30
-- Kiszolgáló verziója: 10.4.21-MariaDB
-- PHP verzió: 8.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Adatbázis: `salamiapi`
--
-- --------------------------------------------------------
--
-- Tábla szerkezet ehhez a táblához `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Tábla szerkezet ehhez a táblához `materials`
--
CREATE TABLE `materials` (
`id` bigint(20) UNSIGNED NOT NULL,
`meat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- A tábla adatainak kiíratása `materials`
--
INSERT INTO `materials` (`id`, `meat`) VALUES
(1, 'csirke');
-- --------------------------------------------------------
--
-- Tábla szerkezet ehhez a táblához `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- A tábla adatainak kiíratása `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2019_12_14_000001_create_personal_access_tokens_table', 1),
(5, '2022_02_16_193745_create_materials_table', 1),
(6, '2022_02_16_200540_create_products_table', 1);
-- --------------------------------------------------------
--
-- Tábla szerkezet ehhez a táblához `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Tábla szerkezet ehhez a táblához `personal_access_tokens`
--
CREATE TABLE `personal_access_tokens` (
`id` bigint(20) UNSIGNED NOT NULL,
`tokenable_type` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`tokenable_id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
`abilities` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`last_used_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- A tábla adatainak kiíratása `personal_access_tokens`
--
INSERT INTO `personal_access_tokens` (`id`, `tokenable_type`, `tokenable_id`, `name`, `token`, `abilities`, `last_used_at`, `created_at`, `updated_at`) VALUES
(1, 'App\\Models\\User', 1, 'adoptme', '<PASSWORD>', '[\"*\"]', NULL, '2022-02-16 19:18:32', '2022-02-16 19:18:32');
-- --------------------------------------------------------
--
-- Tábla szerkezet ehhez a táblához `products`
--
CREATE TABLE `products` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`price` int(11) NOT NULL,
`material_id` bigint(20) UNSIGNED NOT NULL,
`manufacture_date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- A tábla adatainak kiíratása `products`
--
INSERT INTO `products` (`id`, `name`, `price`, `material_id`, `manufacture_date`) VALUES
(1, 'turista', 1000, 1, '2022-01-01');
-- --------------------------------------------------------
--
-- Tábla szerkezet ehhez a táblához `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- A tábla adatainak kiíratása `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'jani', '<EMAIL>', NULL, '$2y$10$xJyGqiE.rxXrp7wiyrMTlekiTIuMEs0EMLa7SqeMNiP4Vdghb0xFC', NULL, '2022-02-16 19:16:55', '2022-02-16 19:16:55');
--
-- Indexek a kiírt táblákhoz
--
--
-- A tábla indexei `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- A tábla indexei `materials`
--
ALTER TABLE `materials`
ADD PRIMARY KEY (`id`);
--
-- A tábla indexei `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- A tábla indexei `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- A tábla indexei `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `personal_access_tokens_token_unique` (`token`),
ADD KEY `personal_access_tokens_tokenable_type_tokenable_id_index` (`tokenable_type`,`tokenable_id`);
--
-- A tábla indexei `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`),
ADD KEY `products_material_id_foreign` (`material_id`);
--
-- A tábla indexei `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- A kiírt táblák AUTO_INCREMENT értéke
--
--
-- AUTO_INCREMENT a táblához `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT a táblához `materials`
--
ALTER TABLE `materials`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT a táblához `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT a táblához `personal_access_tokens`
--
ALTER TABLE `personal_access_tokens`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT a táblához `products`
--
ALTER TABLE `products`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT a táblához `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Megkötések a kiírt táblákhoz
--
--
-- Megkötések a táblához `products`
--
ALTER TABLE `products`
ADD CONSTRAINT `products_material_id_foreign` FOREIGN KEY (`material_id`) REFERENCES `materials` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<reponame>Chronophylos/dungeon-bot<gh_stars>0
-- Database generated with pgModeler (PostgreSQL Database Modeler).
-- pgModeler version: 0.9.3-beta1
-- PostgreSQL version: 13.0
-- Project Site: pgmodeler.io
-- Model Author: ---
-- Database creation must be performed outside a multi lined SQL file.
-- These commands were put in this file only as a convenience.
--
-- object: dungeon | type: DATABASE --
-- DROP DATABASE IF EXISTS dungeon;
-- CREATE DATABASE dungeon;
-- ddl-end --
-- object: public.race | type: TYPE --
-- DROP TYPE IF EXISTS public.race CASCADE;
CREATE TYPE public.race AS
ENUM ('human');
-- ddl-end --
-- object: public.class | type: TYPE --
-- DROP TYPE IF EXISTS public.class CASCADE;
CREATE TYPE public.class AS
ENUM ('fighter');
-- ddl-end --
-- object: public.player | type: TABLE --
-- DROP TABLE IF EXISTS public.player CASCADE;
CREATE TABLE public.player (
id integer NOT NULL,
dungeon_cooldown timestamptz,
race public.race,
class public.class,
strength smallint,
dexterity smallint,
constitution smallint,
intelligence smallint,
wisdom smallint,
charisma smallint,
luck smallint,
has_character bool NOT NULL DEFAULT false,
CONSTRAINT player_pk PRIMARY KEY (id)
);
-- ddl-end --
COMMENT ON COLUMN public.player.id IS E'equals twitch user id';
-- ddl-end --
COMMENT ON COLUMN public.player.dungeon_cooldown IS E'When the dungeon cooldown is reset';
-- ddl-end --
|
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 03-Mar-2021 às 22:01
-- Versão do servidor: 10.4.16-MariaDB
-- versão do PHP: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Banco de dados: `helpdesk`
--
-- --------------------------------------------------------
--
-- Estrutura da tabela `chamados`
--
CREATE TABLE `chamados` (
`id_chamado` int(11) NOT NULL,
`titulo` varchar(50) DEFAULT NULL,
`status` varchar(10) DEFAULT NULL,
`prioridade` varchar(10) DEFAULT NULL,
`descricao` varchar(255) DEFAULT NULL,
`deadline` date DEFAULT NULL,
`id_cliente` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `chamados`
--
INSERT INTO `chamados` (`id_chamado`, `titulo`, `status`, `prioridade`, `descricao`, `deadline`, `id_cliente`) VALUES
(7, 'teste', 'inativo', '0', 'teste', '2021-02-25', 4),
(8, 'teste', 'inativo', '0', 'teste', '2021-02-25', 4),
(9, 'Gabinete pegou fogo', 'inativo', '10', 'O gabinete do computador do prefeito pegou fogo enquanto ele fazia os registros dos gastos da prefeittura', '2021-02-14', 4),
(10, 'computador com tela azul', 'inativo', '0', 'O computador da usuária apresenta tela azul após a mesma ver videos do carlinhos maia durante o expediente', '2021-02-16', 4),
(12, 'Chamado', 'inativo', '0', 'oi', '2021-03-23', 4),
(13, 'Erro 404', 'ativo', '0', 'oiii', '2021-03-20', 4),
(14, 'Chamadoooo', 'ativo', '5', 'jsd', '2021-09-04', 4),
(15, 'urgente', 'inativo', '10', NULL, '2021-03-03', 5),
(16, 'O atrasado', 'ativo', '10', 'iiii', '2021-03-01', 5),
(17, 'Deu ruim', 'ativo', '0', 'socorrooooo', '2021-03-23', 5);
-- --------------------------------------------------------
--
-- Estrutura da tabela `clientes`
--
CREATE TABLE `clientes` (
`id_cliente` int(11) NOT NULL,
`nome_cliente` varchar(100) DEFAULT NULL,
`cpf` varchar(11) DEFAULT NULL,
`setor` varchar(30) DEFAULT NULL,
`telefone` varchar(11) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `clientes`
--
INSERT INTO `clientes` (`id_cliente`, `nome_cliente`, `cpf`, `setor`, `telefone`, `email`) VALUES
(4, 'Kassandra', '18177728288', 'Recursos Humanos', '1231321233', '<EMAIL>'),
(5, '<NAME>', '12333212333', 'Recursos Humanos', '1233333333', '<EMAIL>'),
(6, NULL, NULL, 'Recursos Humanos', NULL, NULL);
-- --------------------------------------------------------
--
-- Estrutura da tabela `enderecos`
--
CREATE TABLE `enderecos` (
`id_endereco` int(11) NOT NULL,
`Rua` varchar(50) DEFAULT NULL,
`num` varchar(5) DEFAULT NULL,
`bairro` varchar(50) DEFAULT NULL,
`cep` int(20) DEFAULT NULL,
`cidade` varchar(20) DEFAULT NULL,
`estado` varchar(2) DEFAULT NULL,
`id_usuario` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `enderecos`
--
INSERT INTO `enderecos` (`id_endereco`, `Rua`, `num`, `bairro`, `cep`, `cidade`, `estado`, `id_usuario`) VALUES
(1, 'ruateste', '123', 'testebairro', 99888721, 'testecity', 'SP', 5),
(2, 'rua aaa', '123', 'bairrddde', 11665420, 'seila', 'SP', 6),
(4, NULL, NULL, NULL, NULL, NULL, NULL, 7),
(5, 'ruateste', NULL, NULL, NULL, NULL, NULL, 5),
(6, 'rua aaa', '675', 'Centro', 11680000, 'Caragua', 'SP', 6),
(7, 'Samambaia', '675', 'Centro', 11680000, 'Caragua', 'SP', 7),
(8, 'Barça', '121', 'Celnona', 11665420, 'guara', 'SP', 9),
(9, '<NAME>', '90', 'Utero', 119928344, 'Pessoinha', 'SP', 13),
(10, 'rua linda', '123', 'tamandaré', 11665420, 'sao paulo', 'SP', 14),
(12, NULL, NULL, NULL, 11665420, NULL, NULL, 16),
(13, 'Avenida Rio Branco', '123', 'Indaiá', 11665600, 'Caraguatatuba', 'SP', 17),
(14, '<NAME>', '1234', '<NAME>', 11665420, 'Caraguatatuba', 'SP', 18),
(17, '<NAME>', NULL, '<NAME>', 11665420, 'Caraguatatuba', 'SP', 30),
(18, NULL, NULL, NULL, 11680000, 'Ubatuba', 'SP', 31);
-- --------------------------------------------------------
--
-- Estrutura da tabela `enderecos_clientes`
--
CREATE TABLE `enderecos_clientes` (
`id_endereco` int(11) NOT NULL,
`Rua` varchar(50) DEFAULT NULL,
`num` varchar(5) DEFAULT NULL,
`bairro` varchar(50) DEFAULT NULL,
`cep` int(8) DEFAULT NULL,
`cidade` varchar(20) DEFAULT NULL,
`estado` varchar(2) DEFAULT NULL,
`id_cliente` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Extraindo dados da tabela `enderecos_clientes`
--
INSERT INTO `enderecos_clientes` (`id_endereco`, `Rua`, `num`, `bairro`, `cep`, `cidade`, `estado`, `id_cliente`) VALUES
(2, 'Rua x', '123', 'Barro', 11665420, 'Cidade', 'SP', 4),
(3, 'Rua legal', '123', 'Bairro x', 11887263, 'Caraguá', 'SP', 5);
-- --------------------------------------------------------
--
-- Estrutura da tabela `horarios`
--
CREATE TABLE `horarios` (
`id` int(11) NOT NULL,
`id_usuario` int(11) NOT NULL,
`hora_entrada` time DEFAULT NULL,
`hora_saida` time DEFAULT NULL,
`dia` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Extraindo dados da tabela `horarios`
--
INSERT INTO `horarios` (`id`, `id_usuario`, `hora_entrada`, `hora_saida`, `dia`) VALUES
(1, 6, '07:30:00', '18:00:00', '2021-02-19'),
(2, 14, '07:00:00', '18:35:02', '2021-02-19'),
(3, 9, '07:04:55', '19:09:22', '2021-02-18'),
(4, 13, '09:05:38', '19:50:09', '2021-02-19');
-- --------------------------------------------------------
--
-- Estrutura da tabela `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Estrutura da tabela `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`role` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Extraindo dados da tabela `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `role`, `remember_token`, `created_at`, `updated_at`) VALUES
(5, 'Iphone se', '<EMAIL>', NULL, '$2y$10$oRBdpFsRqFzXzrZHH7c/feL/VX1lIItKM5RD5mI0JIk3611W5bxpW', 'admin', NULL, '2021-03-02 01:08:02', '2021-03-02 01:08:02'),
(6, 'Mayara', '<EMAIL>', NULL, '$2y$10$vycIcva/di7ycT51UigO3uqTrSZUfVpUBhmBl8EqGKnRTYbDuJMky', 'admin', NULL, '2021-03-02 02:21:42', '2021-03-02 02:21:42'),
(8, 'Mayara', '<EMAIL>', NULL, '$2y$10$.YlCrZMao3lYZYMDKezn5edaxKXGmaDH/cq17qV5zpAN5edvoGwV6', 'admin', NULL, '2021-03-02 02:58:43', '2021-03-02 02:58:43'),
(9, 'Thamy', '<EMAIL>', NULL, '$2y$10$i7efzhRpvD3WTDCItvwMUuPksETHbWa0kHV7RJeuQY6SFfqoqkG26', 'operador', NULL, '2021-03-02 08:13:27', '2021-03-02 08:13:27');
-- --------------------------------------------------------
--
-- Estrutura da tabela `usuarios`
--
CREATE TABLE `usuarios` (
`id_usuario` int(11) NOT NULL,
`nome_usuario` varchar(120) DEFAULT NULL,
`cpf` varchar(11) DEFAULT NULL,
`cargo` varchar(20) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`telefone` varchar(11) DEFAULT NULL,
`login` varchar(20) DEFAULT NULL,
`senha` varchar(8) DEFAULT NULL,
`nivel_acesso` varchar(20) DEFAULT NULL,
`tel_contato_usuario` varchar(11) NOT NULL,
`filhos_usuario` int(11) NOT NULL,
`nascimento_usuario` varchar(255) NOT NULL,
`escolaridade` varchar(255) NOT NULL,
`estado_civil_usuario` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Extraindo dados da tabela `usuarios`
--
INSERT INTO `usuarios` (`id_usuario`, `nome_usuario`, `cpf`, `cargo`, `email`, `telefone`, `login`, `senha`, `nivel_acesso`, `tel_contato_usuario`, `filhos_usuario`, `nascimento_usuario`, `escolaridade`, `estado_civil_usuario`) VALUES
(5, 'ana', '1221112221', 'Secretaria', '<EMAIL>', NULL, 'anajuliarh', 'user123', 'Atendente', '239999228', 0, '2021-01-20', 'Ensino Superior Completo', 'Casado(a)'),
(6, 'DanyBonde', '1231231234', 'Recursos Humanos', '<EMAIL>', NULL, 'teste', 'user123', 'Atendente', '1231321233', 5, '2021-02-02', 'Analfabeto(a)', 'Casado(a)'),
(7, 'Thamy', '87654', 'Atendimento', '<EMAIL>', '1299876508', 'tham', 'user123', 'Supervisor', '12998765', 1, '1998-09-23', 'Ensino Superior Completo', 'Casado(a)'),
(9, '<NAME>', '11188827277', 'Recursos Humanos', '<EMAIL>', '1232333388', 'Vezzarorh', 'user123', 'Atendente', '1298889900', 2, '2021-01-21', 'Ensino Superior Incompleto', 'Casado(a)'),
(13, '<NAME>', '12333322212', 'Recursos Humanos', '<EMAIL>', '1233221123', 'jojo', 'user123', 'Supervisor', '12221121212', 0, '2021-03-05', 'Ensino Superior Incompleto', 'Solteiro(a)'),
(14, '<NAME>', '12322289899', 'Secretaria', '<EMAIL>', '1233221233', 'testee', 'user123', 'Suporte', '1233223344', 1, '1989-05-18', 'Ensino Superior Completo', 'Solteiro(a)'),
(16, '<NAME>', '48140380890', 'Recursos Humanos', '<EMAIL>', '12992120107', NULL, 'user123', 'Atendente', '12992128899', 2, '1997-01-28', 'Ensino Superior Completo', 'Casado(a)'),
(17, '<NAME>', '12312389899', 'Desenvolvimento Web', '<EMAIL>', '1222118899', '<EMAIL>', 'user123', 'Suporte', '1288383388', 0, '1954-06-30', 'Ensino Superior Incompleto', 'Casado(a)'),
(18, '<NAME>', '12388898999', 'Desenvolvimento Web', '<EMAIL>', '1299888899', '<EMAIL>', 'user123', 'Suporte', '12999889989', 0, '1994-11-23', 'Ensino Superior Completo', 'Casado(a)'),
(30, 'Mayara', '12345678909', 'Atendimento', '<EMAIL>', '2343349233', 'socorro', 'user123', 'admin', '2343349233', 2, '1988-04-23', 'Ensino Superior Incompleto', 'Divorciado(a)'),
(31, 'Thamy', '12345678909', 'Atendimento', '<EMAIL>', '12345456565', 'a', 'user123', 'operador', '12345456565', 1, '1998-09-21', 'Ensino Superior Incompleto', 'Solteiro(a)');
--
-- Índices para tabelas despejadas
--
--
-- Índices para tabela `chamados`
--
ALTER TABLE `chamados`
ADD PRIMARY KEY (`id_chamado`),
ADD KEY `id_cliente` (`id_cliente`);
--
-- Índices para tabela `clientes`
--
ALTER TABLE `clientes`
ADD PRIMARY KEY (`id_cliente`);
--
-- Índices para tabela `enderecos`
--
ALTER TABLE `enderecos`
ADD PRIMARY KEY (`id_endereco`),
ADD KEY `id_usuario` (`id_usuario`);
--
-- Índices para tabela `enderecos_clientes`
--
ALTER TABLE `enderecos_clientes`
ADD PRIMARY KEY (`id_endereco`),
ADD KEY `id_cliente` (`id_cliente`);
--
-- Índices para tabela `horarios`
--
ALTER TABLE `horarios`
ADD PRIMARY KEY (`id`),
ADD KEY `id_usuario` (`id_usuario`);
--
-- Índices para tabela `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Índices para tabela `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Índices para tabela `usuarios`
--
ALTER TABLE `usuarios`
ADD PRIMARY KEY (`id_usuario`);
--
-- AUTO_INCREMENT de tabelas despejadas
--
--
-- AUTO_INCREMENT de tabela `chamados`
--
ALTER TABLE `chamados`
MODIFY `id_chamado` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT de tabela `clientes`
--
ALTER TABLE `clientes`
MODIFY `id_cliente` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT de tabela `enderecos`
--
ALTER TABLE `enderecos`
MODIFY `id_endereco` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT de tabela `enderecos_clientes`
--
ALTER TABLE `enderecos_clientes`
MODIFY `id_endereco` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT de tabela `horarios`
--
ALTER TABLE `horarios`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT de tabela `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de tabela `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT de tabela `usuarios`
--
ALTER TABLE `usuarios`
MODIFY `id_usuario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- Restrições para despejos de tabelas
--
--
-- Limitadores para a tabela `chamados`
--
ALTER TABLE `chamados`
ADD CONSTRAINT `chamados_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `clientes` (`id_cliente`),
ADD CONSTRAINT `chamados_ibfk_7` FOREIGN KEY (`id_cliente`) REFERENCES `clientes` (`id_cliente`) ON DELETE CASCADE;
--
-- Limitadores para a tabela `enderecos`
--
ALTER TABLE `enderecos`
ADD CONSTRAINT `enderecos_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id_usuario`);
--
-- Limitadores para a tabela `enderecos_clientes`
--
ALTER TABLE `enderecos_clientes`
ADD CONSTRAINT `enderecos_clientes_ibfk_1` FOREIGN KEY (`id_cliente`) REFERENCES `clientes` (`id_cliente`);
--
-- Limitadores para a tabela `horarios`
--
ALTER TABLE `horarios`
ADD CONSTRAINT `horarios_ibfk_1` FOREIGN KEY (`id_usuario`) REFERENCES `usuarios` (`id_usuario`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<reponame>DeepuBhasin/azad_project<filename>Database/azad_website.sql
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 07, 2022 at 05:48 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.4.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `azad_website`
--
-- --------------------------------------------------------
--
-- Table structure for table `about_table`
--
CREATE TABLE `about_table` (
`id` int(11) NOT NULL,
`about_description` longtext DEFAULT NULL,
`created_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `about_table`
--
INSERT INTO `about_table` (`id`, `about_description`, `created_at`) VALUES
(1, 'A.S. Construction is a young building construction company primarily focused on delivering multistory building projects with highest quality. Under the management of <NAME>, the director, and with experienced staff, the company has bagged and successfully delivered around 15 projects in the past 10 years. The company has required machinery and manpower of 200+ to deliver projects as per design and project needs. Achieving best quality and evolving stakeholder relationships are our our highest priorities. We believe in working as an integrated system by collaborating with out client to provide cost effective and practical solutions. Our goal is to provide engaging workplace environment for our employees, encourage innovation and support our team for individual learning. \r\nOne company, one family. ', '2021-11-03 13:30:53');
-- --------------------------------------------------------
--
-- Table structure for table `contact_table`
--
CREATE TABLE `contact_table` (
`id` int(11) NOT NULL,
`contact_info` varchar(255) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `contact_table`
--
INSERT INTO `contact_table` (`id`, `contact_info`, `address`, `created_at`) VALUES
(1, 'You can contact or visit us in our office from Monday to Saturday from 8 a.m. - 5 p.m.', '66A street no.3\r\nPartap avenue opposite mall of amritsar\r\nAmritsar\r\nPunjab, India\r\n143001 ', '2022-03-05 15:47:08');
-- --------------------------------------------------------
--
-- Table structure for table `footerdiv`
--
CREATE TABLE `footerdiv` (
`id` int(11) NOT NULL,
`about_us` longtext DEFAULT NULL,
`tags` varchar(255) DEFAULT NULL,
`phone1` varchar(15) DEFAULT NULL,
`phone2` varchar(15) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`working_hours` varchar(150) DEFAULT NULL,
`copyright` varchar(150) DEFAULT NULL,
`created_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `footerdiv`
--
INSERT INTO `footerdiv` (`id`, `about_us`, `tags`, `phone1`, `phone2`, `email`, `working_hours`, `copyright`, `created_at`) VALUES
(1, 'We are team players with apt knowledge, skills and experience focused on achieving highest quality of work for our clients. We believe in collaboration and innovation to provide cost effective achievable solutions and make our client\'s life easier. ', 'Building construction, Multistory building, Khalsa College, Traditional style construction', '+91 98148 97920', '+64 2247 38036', '<EMAIL>', '8:00 a.m - 18:00 p.m', 'All right are reservered', '2021-11-03 13:51:32');
-- --------------------------------------------------------
--
-- Table structure for table `home_table`
--
CREATE TABLE `home_table` (
`id` int(11) NOT NULL,
`about_heading` varchar(255) DEFAULT NULL,
`about_description` longtext DEFAULT NULL,
`slide_show_images` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `home_table`
--
INSERT INTO `home_table` (`id`, `about_heading`, `about_description`, `slide_show_images`) VALUES
(1, 'WE AIM TO MAKE OUR CLIENTS LIFE SIMPLE\'s', 'The Core Attributes that CLLAim to Deliver To Their Clients are \"Service And Solution\" Based around an ethos of professionalism and value, we aim to make our client\'s. \r\nOK\r\ntest \r\n\r\n\r\n\r\n\r\n\r\n\r\nokokokok\r\nppkpl ', '62236c4d606e4EOA_EmailCodingBasics_Blog.jpg,62236c4d6f08fphoto-1599507593362-50fa53ed1b40.jpg,62236c4d7712cthumb-1920-338157.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `login_table`
--
CREATE TABLE `login_table` (
`id` int(11) NOT NULL,
`user_name` varchar(150) NOT NULL,
`password` varchar(150) NOT NULL,
`status` int(11) NOT NULL,
`created_dt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `login_table`
--
INSERT INTO `login_table` (`id`, `user_name`, `password`, `status`, `created_dt`) VALUES
(1, 'admin', '<PASSWORD>', 1, '2021-10-27 10:29:18'),
(2, 'azad', '<PASSWORD>', 1, '2021-10-27 10:30:08');
-- --------------------------------------------------------
--
-- Table structure for table `message_table`
--
CREATE TABLE `message_table` (
`id` int(11) NOT NULL,
`user_name` varchar(50) DEFAULT NULL,
`email` varchar(150) DEFAULT NULL,
`phone` varchar(15) DEFAULT NULL,
`message` text DEFAULT NULL,
`created_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `project_category`
--
CREATE TABLE `project_category` (
`id` int(11) NOT NULL,
`name` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `project_category`
--
INSERT INTO `project_category` (`id`, `name`) VALUES
(1, 'interior'),
(2, 'building'),
(3, 'construction'),
(4, 'house'),
(5, 'architecture'),
(6, 'floor');
-- --------------------------------------------------------
--
-- Table structure for table `project_table`
--
CREATE TABLE `project_table` (
`id` int(11) NOT NULL,
`title` varchar(150) DEFAULT NULL,
`category` varchar(150) DEFAULT NULL,
`main_image_1` varchar(255) DEFAULT NULL,
`main_image_2` varchar(255) DEFAULT NULL,
`slide_show_images` varchar(255) DEFAULT NULL,
`description` longtext DEFAULT NULL,
`project_date` datetime DEFAULT NULL,
`location` varchar(150) DEFAULT NULL,
`project_value` varchar(150) DEFAULT NULL,
`dashboard_status` int(11) NOT NULL DEFAULT 0,
`visibile_status` int(11) NOT NULL DEFAULT 0,
`created_at` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `about_table`
--
ALTER TABLE `about_table`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contact_table`
--
ALTER TABLE `contact_table`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `footerdiv`
--
ALTER TABLE `footerdiv`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `home_table`
--
ALTER TABLE `home_table`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `login_table`
--
ALTER TABLE `login_table`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `message_table`
--
ALTER TABLE `message_table`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `project_category`
--
ALTER TABLE `project_category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `project_table`
--
ALTER TABLE `project_table`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `about_table`
--
ALTER TABLE `about_table`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `contact_table`
--
ALTER TABLE `contact_table`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `footerdiv`
--
ALTER TABLE `footerdiv`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `home_table`
--
ALTER TABLE `home_table`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `login_table`
--
ALTER TABLE `login_table`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `message_table`
--
ALTER TABLE `message_table`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `project_category`
--
ALTER TABLE `project_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `project_table`
--
ALTER TABLE `project_table`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
DROP TABLE IF EXISTS CUSTOMER;
CREATE TABLE CUSTOMER (
id VARCHAR(250) NOT NULL,
name VARCHAR(250) NOT NULL,
gener VARCHAR(250) NOT NULL,
nick_name VARCHAR(250) DEFAULT NULL,
avatar VARCHAR(250) DEFAULT NULL
);
INSERT INTO CUSTOMER (id,name, gener, nick_name, avatar) VALUES
('0635c81f-3e75-4e0f-a248-a919e9f0dde0','<NAME>','M','Fred','https://img.favpng.com/12/2/6/computer-icons-user-profile-avatar-png-favpng-atLhPkZ1MULZUSeGvauk2WtMp_t.jpg'),
('b557c6c8-8556-4be1-a386-de64d313cf60','<NAME>','M','Jorginho','https://img.favpng.com/17/22/20/computer-icons-avatar-child-user-profile-blog-png-favpng-mkwEYyWeERuihcWLNTu9erqqn_t.jpg'),
('5e9a2dd7-94b3-4565-9a56-b626415ad003','Pedro','M','Pedrinho','https://img.favpng.com/8/7/18/avatar-child-computer-icons-user-profile-png-favpng-MzLAeL5t4QkeLit56jc7DdPUC_t.jpg'),
('d1dc9997-1aec-4e7e-ad06-18d8d41d727a','Marcia','F','marcia','https://img.favpng.com/13/0/13/cat-computer-icons-user-profile-avatar-png-favpng-0aXfSAjB7FwDVpeuUDXvWRLzd_t.jpg');
|
<reponame>jaidernperez/web-hotel-php<filename>database/database_mysql.sql
drop database if exists db_hotel;
create database if not exists db_hotel character set utf8mb4 collate utf8mb4_bin;
use db_hotel;
/*==============================================================*/
/* table: habitacion */
/*==============================================================*/
create table habitacion
(
id_habitacion integer auto_increment not null,
id_tipo integer not null,
nombre varchar(30) not null,
precio float not null,
disponibilidad smallint not null,
constraint pk_habitacion primary key (id_habitacion)
);
/*==============================================================*/
/* table: persona */
/*==============================================================*/
create table persona
(
id_persona integer auto_increment not null,
cedula varchar(20) not null,
nombres varchar(50) not null,
apellidos varchar(50) not null,
correo varchar(50) not null,
telefono varchar(20) null,
constraint pk_persona primary key (id_persona)
);
/*==============================================================*/
/* table: reservacion */
/*==============================================================*/
create table reservacion
(
id_reservacion integer auto_increment not null,
id_habitacion integer not null,
id_persona integer not null,
fecha_inicio date not null,
fecha_final date null,
precio_total float null,
estado smallint null,
constraint pk_reservacion primary key (id_reservacion)
);
/*==============================================================*/
/* table: rol */
/*==============================================================*/
create table rol
(
id_rol integer auto_increment not null,
nombre varchar(30) not null,
constraint pk_rol primary key (id_rol)
);
/*==============================================================*/
/* table: tipo_habitacion */
/*==============================================================*/
create table tipo_habitacion
(
id_tipo integer auto_increment not null,
nombre varchar(30) not null,
constraint pk_tipo_habitacion primary key (id_tipo)
);
/*==============================================================*/
/* table: usuario */
/*==============================================================*/
create table usuario
(
id_usuario integer auto_increment not null,
id_rol integer not null,
id_persona integer not null,
nombre_usuario varchar(30) not null,
clave varchar(256) not null,
imagen varchar(200) null,
constraint pk_usuario primary key (id_usuario)
);
alter table habitacion
add constraint fk_habitaci_reference_tipo_hab foreign key (id_tipo)
references tipo_habitacion (id_tipo)
on update cascade
on delete restrict;
alter table reservacion
add constraint fk_reservac_reference_habitaci foreign key (id_habitacion)
references habitacion (id_habitacion)
on update cascade
on delete restrict;
alter table reservacion
add constraint fk_reservac_reference_persona foreign key (id_persona)
references persona (id_persona)
on update cascade
on delete restrict;
alter table usuario
add constraint fk_usuario_reference_rol foreign key (id_rol)
references rol (id_rol)
on update cascade
on delete restrict;
alter table usuario
add constraint fk_usuario_ref_persona foreign key (id_persona)
references persona (id_persona)
on update cascade
on delete restrict;
insert into tipo_habitacion(nombre)
values('Sencilla'),
('Doble'),
('Suite'),
('Familiar');
insert into rol(nombre)
values('Admin'),
('Empleado'),
('Invitado');
insert into persona(cedula, nombres, apellidos, correo, telefono)
values('0000000000', 'Super', 'Admin', '<EMAIL>', '0000000');
-- Username: admin, Password: <PASSWORD>
insert into usuario(id_rol, id_persona, nombre_usuario, imagen, clave)
values (1,1,'admin', 'img_-ca954182160928154131734540410876502.png',
'cf835de3d4ea01367c45e412e7a9393a85a4e40af149ed8c3ed6c37c05b67b27813d7ff8072c1035cedd19415adf17128d63186f05f0d656002b0ca1c34f44a0');
|
ALTER TABLE scheduled_calls_table ADD status varchar(20) NOT NULL DEFAULT 'scheduled';
UPDATE scheduled_calls_table SET status = 'scheduled';
|
/*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50726
Source Host : localhost:3306
Source Database : taller
Target Server Type : MYSQL
Target Server Version : 50726
File Encoding : 65001
Date: 2020-05-15 16:32:19
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for modelos
-- ----------------------------
-- ----------------------------
-- Records of modelos
-- ----------------------------
INSERT INTO `modelos` VALUES ('1', '1', 'QUATRO', '1', null, null);
INSERT INTO `modelos` VALUES ('2', '1', 'A4 QUATTRO', '1', null, null);
INSERT INTO `modelos` VALUES ('3', '2', '525 I', '1', null, null);
INSERT INTO `modelos` VALUES ('4', '2', '2002', '1', null, null);
INSERT INTO `modelos` VALUES ('5', '2', '320 I', '1', null, null);
INSERT INTO `modelos` VALUES ('6', '2', '535 I', '1', null, null);
INSERT INTO `modelos` VALUES ('7', '2', '325 I', '1', null, null);
INSERT INTO `modelos` VALUES ('8', '2', '528 I', '1', null, null);
INSERT INTO `modelos` VALUES ('9', '2', '328 I', '1', null, null);
INSERT INTO `modelos` VALUES ('10', '2', 'X5', '1', null, null);
INSERT INTO `modelos` VALUES ('11', '3', 'MONTECARLO', '1', null, null);
INSERT INTO `modelos` VALUES ('12', '3', 'S 10', '1', null, null);
INSERT INTO `modelos` VALUES ('13', '3', 'S-10', '1', null, null);
INSERT INTO `modelos` VALUES ('14', '3', 'PANEL C M V', '1', null, null);
INSERT INTO `modelos` VALUES ('15', '3', 'CELTA', '1', null, null);
INSERT INTO `modelos` VALUES ('16', '3', 'CMV', '1', null, null);
INSERT INTO `modelos` VALUES ('17', '3', 'METRO', '1', null, null);
INSERT INTO `modelos` VALUES ('18', '3', 'MONZA', '1', null, null);
INSERT INTO `modelos` VALUES ('19', '3', 'CORSA', '1', null, null);
INSERT INTO `modelos` VALUES ('20', '3', 'AVEO', '1', null, null);
INSERT INTO `modelos` VALUES ('21', '3', 'C M V', '1', null, null);
INSERT INTO `modelos` VALUES ('22', '3', 'BLAZER', '1', null, null);
INSERT INTO `modelos` VALUES ('23', '3', 'MALIBU', '1', null, null);
INSERT INTO `modelos` VALUES ('24', '3', 'CHEVY', '1', null, null);
INSERT INTO `modelos` VALUES ('25', '3', 'SPECTRUM', '1', null, null);
INSERT INTO `modelos` VALUES ('26', '3', 'C M P', '1', null, null);
INSERT INTO `modelos` VALUES ('27', '3', 'AVEO LS', '1', null, null);
INSERT INTO `modelos` VALUES ('28', '3', 'COLORADO', '1', null, null);
INSERT INTO `modelos` VALUES ('29', '4', 'P T CRUISER', '1', null, null);
INSERT INTO `modelos` VALUES ('30', '4', 'VOYAGER', '1', null, null);
INSERT INTO `modelos` VALUES ('31', '6', 'ATTIVO COACH', '1', null, null);
INSERT INTO `modelos` VALUES ('32', '6', 'ATIVO', '1', null, null);
INSERT INTO `modelos` VALUES ('33', '6', 'RACER GSI', '1', null, null);
INSERT INTO `modelos` VALUES ('34', '6', 'LABO', '1', null, null);
INSERT INTO `modelos` VALUES ('35', '6', 'FINO', '1', null, null);
INSERT INTO `modelos` VALUES ('36', '6', 'ATTIVO', '1', null, null);
INSERT INTO `modelos` VALUES ('37', '6', 'MATIZ', '1', null, null);
INSERT INTO `modelos` VALUES ('38', '6', 'MATIZ S', '1', null, null);
INSERT INTO `modelos` VALUES ('39', '7', 'CUORE', '1', null, null);
INSERT INTO `modelos` VALUES ('40', '7', 'CHARADE', '1', null, null);
INSERT INTO `modelos` VALUES ('41', '7', 'GRAN MOVE SE', '1', null, null);
INSERT INTO `modelos` VALUES ('42', '8', '120 Y', '1', null, null);
INSERT INTO `modelos` VALUES ('43', '9', 'RAM 1500', '1', null, null);
INSERT INTO `modelos` VALUES ('44', '9', 'NEON SXT', '1', null, null);
INSERT INTO `modelos` VALUES ('45', '9', 'CARAVAN', '1', null, null);
INSERT INTO `modelos` VALUES ('46', '9', 'CALIBER LXT', '1', null, null);
INSERT INTO `modelos` VALUES ('47', '9', 'RAM', '1', null, null);
INSERT INTO `modelos` VALUES ('48', '10', '40 HP', '1', null, null);
INSERT INTO `modelos` VALUES ('49', '10', 'INTRUDER', '1', null, null);
INSERT INTO `modelos` VALUES ('50', '11', '25', '1', null, null);
INSERT INTO `modelos` VALUES ('51', '12', 'ESCAPE', '1', null, null);
INSERT INTO `modelos` VALUES ('52', '12', 'FOCUS ZX5', '1', null, null);
INSERT INTO `modelos` VALUES ('53', '12', 'ESCAPE XLS', '1', null, null);
INSERT INTO `modelos` VALUES ('54', '12', 'FOCUS', '1', null, null);
INSERT INTO `modelos` VALUES ('55', '12', 'RANGER', '1', null, null);
INSERT INTO `modelos` VALUES ('56', '12', 'EVEREST', '1', null, null);
INSERT INTO `modelos` VALUES ('57', '12', 'RANGER X L', '1', null, null);
INSERT INTO `modelos` VALUES ('58', '12', 'FOCUS ZX 5', '1', null, null);
INSERT INTO `modelos` VALUES ('59', '12', 'RANGER LIMITED', '1', null, null);
INSERT INTO `modelos` VALUES ('60', '12', 'FOCUS ZX4', '1', null, null);
INSERT INTO `modelos` VALUES ('61', '12', 'RANGER X L T', '1', null, null);
INSERT INTO `modelos` VALUES ('62', '12', 'EXPLORER SPORT', '1', null, null);
INSERT INTO `modelos` VALUES ('63', '12', 'RANGER XLT', '1', null, null);
INSERT INTO `modelos` VALUES ('64', '12', 'FOCUS L X', '1', null, null);
INSERT INTO `modelos` VALUES ('65', '12', 'EXPLORER XLT', '1', null, null);
INSERT INTO `modelos` VALUES ('66', '12', 'RANGER XL', '1', null, null);
INSERT INTO `modelos` VALUES ('67', '12', 'RANGER 4X4', '1', null, null);
INSERT INTO `modelos` VALUES ('68', '12', 'RANGER XL', '1', null, null);
INSERT INTO `modelos` VALUES ('69', '12', 'EVEREST XLT', '1', null, null);
INSERT INTO `modelos` VALUES ('70', '12', 'ESCORT SE', '1', null, null);
INSERT INTO `modelos` VALUES ('71', '12', 'MUSTANG', '1', null, null);
INSERT INTO `modelos` VALUES ('72', '12', 'EXPLORER', '1', null, null);
INSERT INTO `modelos` VALUES ('73', '12', 'ECOSPORT AMBI', '1', null, null);
INSERT INTO `modelos` VALUES ('74', '12', 'ECOSPORT XLS', '1', null, null);
INSERT INTO `modelos` VALUES ('75', '12', 'ESCAPE XLT', '1', null, null);
INSERT INTO `modelos` VALUES ('76', '12', 'EXPLORER SPOR', '1', null, null);
INSERT INTO `modelos` VALUES ('77', '13', 'CABEZAL', '1', null, null);
INSERT INTO `modelos` VALUES ('78', '14', 'METRO', '1', null, null);
INSERT INTO `modelos` VALUES ('79', '14', 'PRIZM', '1', null, null);
INSERT INTO `modelos` VALUES ('80', '14', 'TRACKER', '1', null, null);
INSERT INTO `modelos` VALUES ('81', '14', 'TRACKER SPORT', '1', null, null);
INSERT INTO `modelos` VALUES ('82', '15', 'C156', '1', null, null);
INSERT INTO `modelos` VALUES ('83', '17', 'CIVIC', '1', null, null);
INSERT INTO `modelos` VALUES ('84', '17', 'CR V 4X2', '1', null, null);
INSERT INTO `modelos` VALUES ('85', '17', 'CIVIC E X', '1', null, null);
INSERT INTO `modelos` VALUES ('86', '17', 'CRV LX', '1', null, null);
INSERT INTO `modelos` VALUES ('87', '17', 'ELEMENT', '1', null, null);
INSERT INTO `modelos` VALUES ('88', '17', 'CIVIC L X', '1', null, null);
INSERT INTO `modelos` VALUES ('89', '17', 'C R V', '1', null, null);
INSERT INTO `modelos` VALUES ('90', '17', 'CRV', '1', null, null);
INSERT INTO `modelos` VALUES ('91', '17', 'CIVIC LX', '1', null, null);
INSERT INTO `modelos` VALUES ('92', '17', 'ACCORD', '1', null, null);
INSERT INTO `modelos` VALUES ('93', '17', 'CRV 4WD', '1', null, null);
INSERT INTO `modelos` VALUES ('94', '17', 'CIVIC EX', '1', null, null);
INSERT INTO `modelos` VALUES ('95', '17', 'FIT', '1', null, null);
INSERT INTO `modelos` VALUES ('96', '17', 'CIVIC SI', '1', null, null);
INSERT INTO `modelos` VALUES ('97', '17', 'PILOT', '1', null, null);
INSERT INTO `modelos` VALUES ('98', '18', 'ELANTRA', '1', null, null);
INSERT INTO `modelos` VALUES ('99', '18', 'PANEL', '1', null, null);
INSERT INTO `modelos` VALUES ('100', '18', 'H-1', '1', null, null);
INSERT INTO `modelos` VALUES ('101', '18', 'GETZ GL', '1', null, null);
INSERT INTO `modelos` VALUES ('102', '18', 'ELANTRA GLS', '1', null, null);
INSERT INTO `modelos` VALUES ('103', '18', 'TIBURÓN', '1', null, null);
INSERT INTO `modelos` VALUES ('104', '18', 'ACCENT G L', '1', null, null);
INSERT INTO `modelos` VALUES ('105', '18', 'TIBURON', '1', null, null);
INSERT INTO `modelos` VALUES ('106', '18', 'ACCENT', '1', null, null);
INSERT INTO `modelos` VALUES ('107', '18', 'TUCSON', '1', null, null);
INSERT INTO `modelos` VALUES ('108', '18', 'H100', '1', null, null);
INSERT INTO `modelos` VALUES ('109', '18', 'H 1', '1', null, null);
INSERT INTO `modelos` VALUES ('110', '18', 'MATRIX GL', '1', null, null);
INSERT INTO `modelos` VALUES ('111', '18', 'H-100', '1', null, null);
INSERT INTO `modelos` VALUES ('112', '19', 'SCHOOL BUS', '1', null, null);
INSERT INTO `modelos` VALUES ('113', '20', 'RODEO', '1', null, null);
INSERT INTO `modelos` VALUES ('114', '20', 'PUP', '1', null, null);
INSERT INTO `modelos` VALUES ('115', '20', 'D MAX', '1', null, null);
INSERT INTO `modelos` VALUES ('116', '20', 'TFR', '1', null, null);
INSERT INTO `modelos` VALUES ('117', '20', 'PICK UP', '1', null, null);
INSERT INTO `modelos` VALUES ('118', '20', 'FSR33L-02', '1', null, null);
INSERT INTO `modelos` VALUES ('119', '20', 'NMR', '1', null, null);
INSERT INTO `modelos` VALUES ('120', '20', '4X4', '1', null, null);
INSERT INTO `modelos` VALUES ('121', '20', 'NPR', '1', null, null);
INSERT INTO `modelos` VALUES ('122', '20', 'NQR', '1', null, null);
INSERT INTO `modelos` VALUES ('123', '21', 'CHEROKEE', '1', null, null);
INSERT INTO `modelos` VALUES ('124', '21', 'CHEROKEE SPORT', '1', null, null);
INSERT INTO `modelos` VALUES ('125', '21', 'LIBERTY LTD', '1', null, null);
INSERT INTO `modelos` VALUES ('126', '21', 'GRAND CHEROKEE', '1', null, null);
INSERT INTO `modelos` VALUES ('127', '21', 'PATRIOT', '1', null, null);
INSERT INTO `modelos` VALUES ('128', '21', 'GRAND CHEROOKE', '1', null, null);
INSERT INTO `modelos` VALUES ('129', '21', 'LIBERTY', '1', null, null);
INSERT INTO `modelos` VALUES ('130', '21', 'WRANGLER', '1', null, null);
INSERT INTO `modelos` VALUES ('131', '21', 'COMPASS', '1', null, null);
INSERT INTO `modelos` VALUES ('132', '22', '6 H P', '1', null, null);
INSERT INTO `modelos` VALUES ('133', '23', '3.3 HP', '1', null, null);
INSERT INTO `modelos` VALUES ('134', '24', 'K 2700', '1', null, null);
INSERT INTO `modelos` VALUES ('135', '24', 'RIO R S', '1', null, null);
INSERT INTO `modelos` VALUES ('136', '24', 'SPORTAGE EX', '1', null, null);
INSERT INTO `modelos` VALUES ('137', '24', 'CARENS', '1', null, null);
INSERT INTO `modelos` VALUES ('138', '24', 'OPTIMA L X', '1', null, null);
INSERT INTO `modelos` VALUES ('139', '24', 'TOWNER', '1', null, null);
INSERT INTO `modelos` VALUES ('140', '24', 'SEDONA E X', '1', null, null);
INSERT INTO `modelos` VALUES ('141', '24', 'CARNIVAL GS', '1', null, null);
INSERT INTO `modelos` VALUES ('142', '24', 'OPTIMA', '1', null, null);
INSERT INTO `modelos` VALUES ('143', '24', 'RIO', '1', null, null);
INSERT INTO `modelos` VALUES ('144', '24', 'SPORTAGE', '1', null, null);
INSERT INTO `modelos` VALUES ('145', '24', 'RIO E X', '1', null, null);
INSERT INTO `modelos` VALUES ('146', '24', 'SEPHIA', '1', null, null);
INSERT INTO `modelos` VALUES ('147', '24', 'SPECTRA EX', '1', null, null);
INSERT INTO `modelos` VALUES ('148', '24', 'K2700', '1', null, null);
INSERT INTO `modelos` VALUES ('149', '24', 'SPECTRA', '1', null, null);
INSERT INTO `modelos` VALUES ('150', '24', 'SPORTAGE LX', '1', null, null);
INSERT INTO `modelos` VALUES ('151', '24', 'SORENTO LX', '1', null, null);
INSERT INTO `modelos` VALUES ('152', '24', 'RIO LX', '1', null, null);
INSERT INTO `modelos` VALUES ('153', '24', 'ESPECTRA', '1', null, null);
INSERT INTO `modelos` VALUES ('154', '24', 'FORTE', '1', null, null);
INSERT INTO `modelos` VALUES ('155', '24', 'PICANTO', '1', null, null);
INSERT INTO `modelos` VALUES ('156', '24', 'RIO EX', '1', null, null);
INSERT INTO `modelos` VALUES ('157', '24', 'SPORTAGE EX', '1', null, null);
INSERT INTO `modelos` VALUES ('158', '24', 'SPORTGE LX', '1', null, null);
INSERT INTO `modelos` VALUES ('159', '24', 'K3600', '1', null, null);
INSERT INTO `modelos` VALUES ('160', '24', 'SOUL', '1', null, null);
INSERT INTO `modelos` VALUES ('161', '25', 'VESPA', '1', null, null);
INSERT INTO `modelos` VALUES ('162', '26', 'DEPORTIVO', '1', null, null);
INSERT INTO `modelos` VALUES ('163', '27', 'LR2 SE', '1', null, null);
INSERT INTO `modelos` VALUES ('164', '27', 'RANGE ROVER', '1', null, null);
INSERT INTO `modelos` VALUES ('165', '27', 'RANGE ROVER SPORT', '1', null, null);
INSERT INTO `modelos` VALUES ('166', '28', 'RX 300', '1', null, null);
INSERT INTO `modelos` VALUES ('167', '28', 'IS 250', '1', null, null);
INSERT INTO `modelos` VALUES ('168', '28', 'GX 470', '1', null, null);
INSERT INTO `modelos` VALUES ('169', '30', 'BT-50 HI', '1', null, null);
INSERT INTO `modelos` VALUES ('170', '30', 'E2200', '1', null, null);
INSERT INTO `modelos` VALUES ('171', '30', 'PROTEGE 5', '1', null, null);
INSERT INTO `modelos` VALUES ('172', '30', 'PROTEGE', '1', null, null);
INSERT INTO `modelos` VALUES ('173', '30', 'TRIBUTE', '1', null, null);
INSERT INTO `modelos` VALUES ('174', '30', '6 R', '1', null, null);
INSERT INTO `modelos` VALUES ('175', '30', '626', '1', null, null);
INSERT INTO `modelos` VALUES ('176', '30', '323', '1', null, null);
INSERT INTO `modelos` VALUES ('177', '30', '3', '1', null, null);
INSERT INTO `modelos` VALUES ('178', '30', '323 LX', '1', null, null);
INSERT INTO `modelos` VALUES ('179', '30', 'PROTEGE L X', '1', null, null);
INSERT INTO `modelos` VALUES ('180', '30', 'B 2900', '1', null, null);
INSERT INTO `modelos` VALUES ('181', '30', '6', '1', null, null);
INSERT INTO `modelos` VALUES ('182', '30', '323 L X', '1', null, null);
INSERT INTO `modelos` VALUES ('183', '30', 'BT 50', '1', null, null);
INSERT INTO `modelos` VALUES ('184', '30', 'B2500', '1', null, null);
INSERT INTO `modelos` VALUES ('185', '30', '3 V', '1', null, null);
INSERT INTO `modelos` VALUES ('186', '30', 'B 2300', '1', null, null);
INSERT INTO `modelos` VALUES ('187', '30', '3000', '1', null, null);
INSERT INTO `modelos` VALUES ('188', '30', '626 GLX', '1', null, null);
INSERT INTO `modelos` VALUES ('189', '30', '6', '1', null, null);
INSERT INTO `modelos` VALUES ('190', '30', 'CX 7', '1', null, null);
INSERT INTO `modelos` VALUES ('191', '30', '6 V', '1', null, null);
INSERT INTO `modelos` VALUES ('192', '30', 'B2300', '1', null, null);
INSERT INTO `modelos` VALUES ('193', '30', '3V', '1', null, null);
INSERT INTO `modelos` VALUES ('194', '30', 'PROTEGE ES', '1', null, null);
INSERT INTO `modelos` VALUES ('195', '30', '323 GLX', '1', null, null);
INSERT INTO `modelos` VALUES ('196', '30', '3 SHREWSBURY', '1', null, null);
INSERT INTO `modelos` VALUES ('197', '31', '300', '1', null, null);
INSERT INTO `modelos` VALUES ('198', '31', 'E 240', '1', null, null);
INSERT INTO `modelos` VALUES ('199', '31', 'ML 320', '1', null, null);
INSERT INTO `modelos` VALUES ('200', '31', '250', '1', null, null);
INSERT INTO `modelos` VALUES ('201', '32', 'MARINO', '1', null, null);
INSERT INTO `modelos` VALUES ('202', '33', 'COOPER S', '1', null, null);
INSERT INTO `modelos` VALUES ('203', '34', 'L-200', '1', null, null);
INSERT INTO `modelos` VALUES ('204', '34', 'OUTLANDER', '1', null, null);
INSERT INTO `modelos` VALUES ('205', '34', 'MIRAGE', '1', null, null);
INSERT INTO `modelos` VALUES ('206', '34', 'LANCER G L', '1', null, null);
INSERT INTO `modelos` VALUES ('207', '34', 'MONTERO I O', '1', null, null);
INSERT INTO `modelos` VALUES ('208', '34', 'L 300', '1', null, null);
INSERT INTO `modelos` VALUES ('209', '34', 'L 200', '1', null, null);
INSERT INTO `modelos` VALUES ('210', '34', 'NATIVA', '1', null, null);
INSERT INTO `modelos` VALUES ('211', '34', 'ECLIPSE', '1', null, null);
INSERT INTO `modelos` VALUES ('212', '34', 'LANCER', '1', null, null);
INSERT INTO `modelos` VALUES ('213', '34', 'LANCER GL', '1', null, null);
INSERT INTO `modelos` VALUES ('214', '34', 'LANCER ES', '1', null, null);
INSERT INTO `modelos` VALUES ('215', '34', 'LANCER GLX', '1', null, null);
INSERT INTO `modelos` VALUES ('216', '34', 'CANTER', '1', null, null);
INSERT INTO `modelos` VALUES ('217', '34', 'L300', '1', null, null);
INSERT INTO `modelos` VALUES ('218', '34', 'GALANT', '1', null, null);
INSERT INTO `modelos` VALUES ('219', '34', 'L200', '1', null, null);
INSERT INTO `modelos` VALUES ('220', '34', 'MONTERO', '1', null, null);
INSERT INTO `modelos` VALUES ('221', '34', 'PICK UP L 200', '1', null, null);
INSERT INTO `modelos` VALUES ('222', '34', 'LANCER EX', '1', null, null);
INSERT INTO `modelos` VALUES ('223', '34', 'OUTLANDER ASX', '1', null, null);
INSERT INTO `modelos` VALUES ('224', '34', 'MONTERO GLS', '1', null, null);
INSERT INTO `modelos` VALUES ('225', '34', 'MONTERO IO', '1', null, null);
INSERT INTO `modelos` VALUES ('226', '34', 'MONTERO GL X', '1', null, null);
INSERT INTO `modelos` VALUES ('227', '34', 'ASX', '1', null, null);
INSERT INTO `modelos` VALUES ('228', '35', 'NAVARA SE', '1', null, null);
INSERT INTO `modelos` VALUES ('229', '35', 'FRONTIER', '1', null, null);
INSERT INTO `modelos` VALUES ('230', '35', 'SENTRA', '1', null, null);
INSERT INTO `modelos` VALUES ('231', '35', 'PATHFINDER', '1', null, null);
INSERT INTO `modelos` VALUES ('232', '35', 'Z24', '1', null, null);
INSERT INTO `modelos` VALUES ('233', '35', 'PICK UP', '1', null, null);
INSERT INTO `modelos` VALUES ('234', '35', 'SUNNY', '1', null, null);
INSERT INTO `modelos` VALUES ('235', '35', 'PLATINA', '1', null, null);
INSERT INTO `modelos` VALUES ('236', '35', 'ALMERA', '1', null, null);
INSERT INTO `modelos` VALUES ('237', '35', 'SENTRA 1.8', '1', null, null);
INSERT INTO `modelos` VALUES ('238', '35', 'SENTRA GXE', '1', null, null);
INSERT INTO `modelos` VALUES ('239', '35', 'NAVARA', '1', null, null);
INSERT INTO `modelos` VALUES ('240', '35', 'PATROL', '1', null, null);
INSERT INTO `modelos` VALUES ('241', '35', 'ALTIMA', '1', null, null);
INSERT INTO `modelos` VALUES ('242', '35', 'PATROL S G L', '1', null, null);
INSERT INTO `modelos` VALUES ('243', '35', 'PICK UP D 21', '1', null, null);
INSERT INTO `modelos` VALUES ('244', '35', 'TIIDA SE', '1', null, null);
INSERT INTO `modelos` VALUES ('245', '35', 'FRONTIER LCV', '1', null, null);
INSERT INTO `modelos` VALUES ('246', '35', 'D 21', '1', null, null);
INSERT INTO `modelos` VALUES ('247', '35', 'MURANO', '1', null, null);
INSERT INTO `modelos` VALUES ('248', '35', 'D21', '1', null, null);
INSERT INTO `modelos` VALUES ('249', '35', 'SENTRA S', '1', null, null);
INSERT INTO `modelos` VALUES ('250', '35', '200 SX', '1', null, null);
INSERT INTO `modelos` VALUES ('251', '35', 'SENTRA SR', '1', null, null);
INSERT INTO `modelos` VALUES ('252', '35', 'SENTRA GXE', '1', null, null);
INSERT INTO `modelos` VALUES ('253', '35', '4X4', '1', null, null);
INSERT INTO `modelos` VALUES ('254', '35', 'MARCH', '1', null, null);
INSERT INTO `modelos` VALUES ('255', '35', 'VERSA SL', '1', null, null);
INSERT INTO `modelos` VALUES ('256', '35', 'X TRAIL SE', '1', null, null);
INSERT INTO `modelos` VALUES ('257', '35', 'NAVARA LE', '1', null, null);
INSERT INTO `modelos` VALUES ('258', '35', 'TIIDA', '1', null, null);
INSERT INTO `modelos` VALUES ('259', '35', 'ROGUE', '1', null, null);
INSERT INTO `modelos` VALUES ('260', '35', 'VANETTE', '1', null, null);
INSERT INTO `modelos` VALUES ('261', '35', 'FRONTIER AX', '1', null, null);
INSERT INTO `modelos` VALUES ('262', '35', 'AD', '1', null, null);
INSERT INTO `modelos` VALUES ('263', '35', 'N/D', '1', null, null);
INSERT INTO `modelos` VALUES ('264', '35', 'VERSA', '1', null, null);
INSERT INTO `modelos` VALUES ('265', '35', 'JUKE', '1', null, null);
INSERT INTO `modelos` VALUES ('266', '36', 'PARTNER', '1', null, null);
INSERT INTO `modelos` VALUES ('267', '36', '206 X R', '1', null, null);
INSERT INTO `modelos` VALUES ('268', '36', '206 XR', '1', null, null);
INSERT INTO `modelos` VALUES ('269', '36', '206', '1', null, null);
INSERT INTO `modelos` VALUES ('270', '36', '206 XRPR HDI', '1', null, null);
INSERT INTO `modelos` VALUES ('271', '36', '307 XR', '1', null, null);
INSERT INTO `modelos` VALUES ('272', '36', '207 SPORT 1.6', '1', null, null);
INSERT INTO `modelos` VALUES ('273', '36', '405', '1', null, null);
INSERT INTO `modelos` VALUES ('274', '36', '406 ST', '1', null, null);
INSERT INTO `modelos` VALUES ('275', '37', 'VIBE', '1', null, null);
INSERT INTO `modelos` VALUES ('276', '38', 'SCENIC', '1', null, null);
INSERT INTO `modelos` VALUES ('277', '38', 'CLIO', '1', null, null);
INSERT INTO `modelos` VALUES ('278', '41', 'TC', '1', null, null);
INSERT INTO `modelos` VALUES ('279', '41', 'XB', '1', null, null);
INSERT INTO `modelos` VALUES ('280', '42', 'CORDOBA', '1', null, null);
INSERT INTO `modelos` VALUES ('281', '44', 'FORTWO', '1', null, null);
INSERT INTO `modelos` VALUES ('282', '45', 'KYRON M200', '1', null, null);
INSERT INTO `modelos` VALUES ('283', '45', 'REXTON RX290', '1', null, null);
INSERT INTO `modelos` VALUES ('284', '46', 'LEGACY', '1', null, null);
INSERT INTO `modelos` VALUES ('285', '47', 'JIMMY', '1', null, null);
INSERT INTO `modelos` VALUES ('286', '47', 'STEEM', '1', null, null);
INSERT INTO `modelos` VALUES ('287', '47', 'GRAND VITARA', '1', null, null);
INSERT INTO `modelos` VALUES ('288', '47', 'FORENZA', '1', null, null);
INSERT INTO `modelos` VALUES ('289', '47', 'A X 100', '1', null, null);
INSERT INTO `modelos` VALUES ('291', '47', ' AX 100', '1', null, null);
INSERT INTO `modelos` VALUES ('292', '47', 'ESTEEM', '1', null, null);
INSERT INTO `modelos` VALUES ('293', '47', 'AEREO SX', '1', null, null);
INSERT INTO `modelos` VALUES ('294', '47', 'SAMURAI', '1', null, null);
INSERT INTO `modelos` VALUES ('295', '47', 'APV', '1', null, null);
INSERT INTO `modelos` VALUES ('296', '47', 'XL 7', '1', null, null);
INSERT INTO `modelos` VALUES ('297', '47', 'GN 125 F', '1', null, null);
INSERT INTO `modelos` VALUES ('298', '47', 'SX 4', '1', null, null);
INSERT INTO `modelos` VALUES ('299', '47', 'GN 125 H', '1', null, null);
INSERT INTO `modelos` VALUES ('300', '47', 'GN 125H', '1', null, null);
INSERT INTO `modelos` VALUES ('301', '48', 'SPORT', '1', null, null);
INSERT INTO `modelos` VALUES ('302', '49', 'COROLLA', '1', null, null);
INSERT INTO `modelos` VALUES ('303', '49', 'TERCEL', '1', null, null);
INSERT INTO `modelos` VALUES ('304', '49', 'ECHO', '1', null, null);
INSERT INTO `modelos` VALUES ('305', '49', 'YARIS', '1', null, null);
INSERT INTO `modelos` VALUES ('306', '49', 'STARLET', '1', null, null);
INSERT INTO `modelos` VALUES ('307', '49', 'COROLLA TERCEL', '1', null, null);
INSERT INTO `modelos` VALUES ('308', '49', 'HI ACE', '1', null, null);
INSERT INTO `modelos` VALUES ('309', '49', 'CORONA', '1', null, null);
INSERT INTO `modelos` VALUES ('310', '49', 'COROLLA CE', '1', null, null);
INSERT INTO `modelos` VALUES ('311', '49', 'COROLLA SE', '1', null, null);
INSERT INTO `modelos` VALUES ('312', '49', 'RAV 4X4', '1', null, null);
INSERT INTO `modelos` VALUES ('313', '49', 'HILUX', '1', null, null);
INSERT INTO `modelos` VALUES ('314', '49', 'CORONA GL', '1', null, null);
INSERT INTO `modelos` VALUES ('315', '49', 'COROLLA XLI', '1', null, null);
INSERT INTO `modelos` VALUES ('316', '49', 'LAND CRUISER', '1', null, null);
INSERT INTO `modelos` VALUES ('317', '49', 'MATRIX', '1', null, null);
INSERT INTO `modelos` VALUES ('318', '49', 'COROLLA GLI', '1', null, null);
INSERT INTO `modelos` VALUES ('319', '49', 'LITEACE', '1', null, null);
INSERT INTO `modelos` VALUES ('320', '49', 'HI LUX', '1', null, null);
INSERT INTO `modelos` VALUES ('321', '49', 'FOUR RUNNER SR5', '1', null, null);
INSERT INTO `modelos` VALUES ('322', '49', 'TACOMA', '1', null, null);
INSERT INTO `modelos` VALUES ('323', '49', 'FOUR RUNNER', '1', null, null);
INSERT INTO `modelos` VALUES ('324', '49', 'RAV 4', '1', null, null);
INSERT INTO `modelos` VALUES ('325', '49', 'RAV 4 XLE', '1', null, null);
INSERT INTO `modelos` VALUES ('326', '49', 'FORTUNER', '1', null, null);
INSERT INTO `modelos` VALUES ('327', '49', 'LAND CRUSIER PRADO', '1', null, null);
INSERT INTO `modelos` VALUES ('328', '49', 'DYNA', '1', null, null);
INSERT INTO `modelos` VALUES ('329', '49', 'SCION', '1', null, null);
INSERT INTO `modelos` VALUES ('330', '49', 'SCION XB', '1', null, null);
INSERT INTO `modelos` VALUES ('331', '52', 'FOX 1.6', '1', null, null);
INSERT INTO `modelos` VALUES ('332', '52', 'SAVEIRO', '1', null, null);
INSERT INTO `modelos` VALUES ('333', '52', 'POLO COMFORT L', '1', null, null);
INSERT INTO `modelos` VALUES ('334', '52', 'GOLF', '1', null, null);
INSERT INTO `modelos` VALUES ('335', '52', 'JETTA EUROPA', '1', null, null);
INSERT INTO `modelos` VALUES ('336', '52', '113-1500', '1', null, null);
INSERT INTO `modelos` VALUES ('337', '52', 'TIGUAN', '1', null, null);
INSERT INTO `modelos` VALUES ('338', '52', 'KEFER', '1', null, null);
INSERT INTO `modelos` VALUES ('339', '52', 'PARATI', '1', null, null);
INSERT INTO `modelos` VALUES ('340', '52', 'GOL', '1', null, null);
INSERT INTO `modelos` VALUES ('341', '52', 'BEETLE', '1', null, null);
INSERT INTO `modelos` VALUES ('342', '52', 'COMBI', '1', null, null);
INSERT INTO `modelos` VALUES ('343', '52', 'JETTA', '1', null, null);
INSERT INTO `modelos` VALUES ('344', '52', 'ESCARABAJO', '1', null, null);
INSERT INTO `modelos` VALUES ('345', '52', 'JETTA GL 2.0', '1', null, null);
INSERT INTO `modelos` VALUES ('346', '52', 'GOLF VARIANT', '1', null, null);
INSERT INTO `modelos` VALUES ('347', '54', '245', '1', null, null);
INSERT INTO `modelos` VALUES ('348', '54', 'S 60', '1', null, null);
INSERT INTO `modelos` VALUES ('349', '54', 'S 70', '1', null, null);
INSERT INTO `modelos` VALUES ('350', '54', 'C 30 T5', '1', null, null);
INSERT INTO `modelos` VALUES ('351', '56', 'GTP30TK', '1', null, null);
INSERT INTO `modelos` VALUES ('352', '57', 'YD 110 S', '1', null, null);
INSERT INTO `modelos` VALUES ('353', '57', '750 SS', '1', null, null);
INSERT INTO `modelos` VALUES ('354', '57', 'YFM 350 FWA', '1', null, null);
INSERT INTO `modelos` VALUES ('355', '57', '250 HP', '1', null, null);
INSERT INTO `modelos` VALUES ('356', '57', 'YBR 125', '1', null, null);
INSERT INTO `modelos` VALUES ('357', '57', 'OUTBOARD', '1', null, null);
INSERT INTO `modelos` VALUES ('358', '3', 'AVEEO 5 LT', '1', null, null);
INSERT INTO `modelos` VALUES ('359', '55', 'Jetta', '1', '2020-04-07 09:50:08', '2020-04-07 09:50:08');
SET FOREIGN_KEY_CHECKS=1;
|
BEGIN;
WITH osm_streets AS (SELECT
name,
osm_id,
highway as category,
way as geometry,
to_tsvector('cuba_streets',name) as vector
FROM planet_osm_line
WHERE name is not null
AND highway is not null
AND highway != 'yes'
)
INSERT INTO streets(
name,
osm_id,
category,
geometry,
vector
) SELECT
name,
osm_id,
category,
geometry,
vector
FROM osm_streets;
COMMIT;
|
<filename>environment/mysql/data/dml.sql
insert into devtalks.cliente (nome, email) values ('Teste 01', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 02', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 03', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 04', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 05', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 06', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 07', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 08', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 09', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 10', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 11', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 12', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 13', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 14', '<EMAIL>');
insert into devtalks.cliente (nome, email) values ('Teste 15', '<EMAIL>'); |
USE Hotel
UPDATE Payments
SET TaxRate = TaxRate - (TaxRate * 0.03)
SELECT TaxRate FROM Payments |
/** Dummy data */
USE wretro;
DECLARE @SESSION_ID UNIQUEIDENTIFIER = N'8986E7EF-6FF4-49EC-BAEA-EFC21576D649';
DECLARE @CARD_ID_1 UNIQUEIDENTIFIER = N'2591EE0D-4178-47CA-BFC2-FA5304F925B8';
DECLARE @CARD_ID_2 UNIQUEIDENTIFIER = N'10435192-6C10-4CD0-9C36-EC539B364606';
DECLARE @CARD_ID_3 UNIQUEIDENTIFIER = N'7C28AD1F-601E-4E31-AEEF-5FCAE1B204B5';
-- Session
INSERT INTO [wretro].[Session]
(Id, Title)
VALUES
(@SESSION_ID, 'Sprint for Warriors Team');
-- Cards
INSERT INTO [wretro].[Card]
(Id, Title, Position, SessionId)
VALUES
(@CARD_ID_1, 'Good', 0, @SESSION_ID);
INSERT INTO [wretro].[Card]
(Id, Title, Position, SessionId)
VALUES
(@CARD_ID_2, 'Meh', 1, @SESSION_ID);
INSERT INTO [wretro].[Card]
(Id, Title, Position, SessionId)
VALUES
(@CARD_ID_3, 'Bad', 2, @SESSION_ID);
-- Comments
INSERT INTO [wretro].[Comment]
(Id, Text, Likes, CardId, Position)
VALUES
('797CDEF9-8FBD-4F1C-B8AA-D679B235B85D', 'So much work!', 0, @CARD_ID_1, 0);
INSERT INTO [wretro].[Comment]
(Id, Text, Likes, CardId, Position)
VALUES
('F408F188-5C35-473A-8275-B2D2218BF0DA', 'Good things are good', 0, @CARD_ID_1, 1);
INSERT INTO [wretro].[Comment]
(Id, Text, Likes, CardId, Position)
VALUES
('65CE9F39-6C85-4238-A0E2-0D7C67602765', 'Innovation week canceled', 0, @CARD_ID_2, 0);
INSERT INTO [wretro].[Comment]
(Id, Text, Likes, CardId, Position)
VALUES
('DB37F5F9-50BF-407C-975F-DAE47F55C246', 'Innovation week canceled', 0, @CARD_ID_2, 1);
INSERT INTO [wretro].[Comment]
(Id, Text, Likes, CardId, Position)
VALUES
('D5BB2620-3257-435D-A130-25E34AE6803D', 'Something about infra', 0, @CARD_ID_3, 0);
INSERT INTO [wretro].[Comment]
(Id, Text, Likes, CardId, Position)
VALUES
('1730E882-B979-47F6-96C6-B8272D4B7716', 'The planning', 0, @CARD_ID_3, 1);
|
create table type_test
(
col_id int primary key,
col_bigint bigint default 0 not null,
col_bigint_n bigint,
col_binary binary(255) default 0 not null,
col_binary_n binary(255),
col_bit bit default 0 not null,
col_bit_n bit,
col_bool bit default 0 not null,
col_bool_n bit,
col_char char(255) default '' not null,
col_char_n char(255),
col_date date default '1989-11-09' not null,
col_date_n date,
col_datetime datetime default '1989-11-09T00:00:00' not null,
col_datetime_n datetime,
col_datetime2 datetime2 default '1989-11-09T00:00:00' not null,
col_datetime2_n datetime2,
col_decimal decimal default 0 not null,
col_decimal_n decimal,
col_float float default 0 not null,
col_float_n float,
col_int int default 0 not null,
col_int_n int,
col_money money default 0 not null,
col_money_n money,
col_nchar nchar(255) default '' not null,
col_nchar_n nchar(255),
col_nvarchar nvarchar(255) default '' not null,
col_nvarchar_n nvarchar(255),
col_numeric numeric default 0 not null,
col_numeric_n numeric,
col_real real default 0 not null,
col_real_n real,
col_smalldatetime smalldatetime default '1989-11-09 00:00' not null,
col_smalldatetime_n smalldatetime,
col_smallint smallint default 0 not null,
col_smallint_n smallint,
col_smallmoney smallmoney default 0 not null,
col_smallmoney_n smallmoney,
col_time time default '00:00:00' not null,
col_time_n time,
col_tinyint tinyint default '0' not null,
col_tinyint_n tinyint,
col_uuid uniqueidentifier default NEWID() not null,
col_uuid_n uniqueidentifier,
col_varbinary varbinary(255) default 0 not null,
col_varbinary_n varbinary(255),
col_varchar varchar(255) default '' not null,
col_varchar_n varchar(255)
) |
--liquibase formatted sql
--changeset vrafael:framework_20200317_BeforeAfter_07_dboValueSetAfter logicalFilePath:path-independent splitStatements:true stripComments:false endDelimiter:\nGO runOnChange:true
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
GO
--------- framework "RecordSQL" v2 (https://github.com/vrafael/recordsql-database) ---------
--сортировка ссылок объекта в рамках типа и условия
CREATE OR ALTER PROCEDURE [dbo].[LinkSetAfter]
@TypeID bigint
,@OwnerID bigint
,@CaseID bigint
AS
EXEC dbo.ContextProcedurePush
@ProcID = @@PROCID
BEGIN
SET NOCOUNT ON;
--устанавливаем порядок внешних ссылок в рамках объекта
UPDATE l
SET l.[Order] = lo.[Order]
FROM
(
SELECT
lo.LinkID
,(ROW_NUMBER() OVER(ORDER BY ISNULL(NULLIF(lo.[Order], 0), 2147483646))) * 10 as [Order]
FROM dbo.TLink lo
WHERE lo.TypeID = @TypeID
AND lo.OwnerID = @OwnerID
AND (lo.CaseID = @CaseID
OR (@CaseID IS NULL AND lo.CaseID IS NULL))
) lo
JOIN dbo.TLink l ON l.LinkID = lo.LinkID
END |
-- Nothing to do here.. Exasol doesn't support UNIQUE constraints, except in
-- the form of PRIMARY KEY.
COMMENT ON SCHEMA ®istry IS 'Sqitch database deployment metadata v1.1.';
|
<gh_stars>1000+
USE [test_normalization];
execute('create view _airbyte_test_normalization."unnest_alias_children_ab2__dbt_tmp" as
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
select
_airbyte_unnest_alias_hashid,
cast(ab_id as
bigint
) as ab_id,
cast(owner as VARCHAR(max)) as owner,
_airbyte_emitted_at
from "test_normalization"._airbyte_test_normalization."unnest_alias_children_ab1"
-- children at unnest_alias/children
');
|
-- =============================================
-- Create XML Index Type PATH Template
-- =============================================
-- Creates a secondary XML index of type PATH on
-- an XML column using a primary XML index on the
-- XML column
USE <database_name, sysname, myDatabase>
GO
IF EXISTS (
SELECT *
FROM sys.xml_indexes
WHERE name = '<xml_index_name, sysname, myPathXmlIndex>' AND
object_id = OBJECT_ID ('<schema_name, sysname, myDatabaseSchema>.<table_name, sysname, myTable>')
)
DROP INDEX <xml_index_name, sysname, myPathXmlIndex>
ON <schema_name, sysname, myDatabaseSchema>.<table_name, sysname, myTable>
GO
CREATE XML INDEX <xml_index_name, sysname, myPathXmlIndex>
ON <schema_name, sysname, myDatabaseSchema>.<table_name, sysname, myTable>
(
<xml_column_name, sysname, myXmlColumn>
)
USING XML INDEX <xml_index_name, sysname, myPrimaryXmlIndex>
FOR PATH
GO
|
<filename>egov/egov-ptis/src/main/resources/db/migration/main/V20200427175458__ptis_search_courtcase_writeoff_application_role_mappings.sql
-----------role action mapping-------
INSERT INTO EG_ACTION (ID,NAME,URL,QUERYPARAMS,PARENTMODULE,ORDERNUMBER,DISPLAYNAME,ENABLED,CONTEXTROOT,VERSION,CREATEDBY,CREATEDDATE,LASTMODIFIEDBY,LASTMODIFIEDDATE,APPLICATION) values (NEXTVAL('SEQ_EG_ACTION'),'Search CourtCase/WriteOff Application','/search/courtcasewriteoffapplication', null,
(select id from EG_MODULE where name = 'Existing property'),null,'Search CourtCase/WriteOff Application','t','ptis',0,1,now(),1,now(),(select id from eg_module where name = 'Property Tax'));
Insert into EG_ACTION (id,name,url,queryparams,parentmodule,ordernumber,displayname,enabled,contextroot,version,createdby,createddate,lastmodifiedby,lastmodifieddate,application) values (nextval('SEQ_EG_ACTION'),'Search CourtCase/WriteOff Application Result','/search/courtcasewriteoffapplication/result',null,(select id from eg_module where name='Existing property'),1,'Search CourtCase/WriteOff Application Result',false,'ptis',0,1,now(),1,now(),(select id from eg_module where name='Property Tax'));
insert into eg_roleaction (actionid, roleid) select (select id from eg_action where name = 'Search CourtCase/WriteOff Application' and contextroot='ptis'), id from eg_role where name in ('Court Case Approver','Court Case Initiator','Write Off Initiator','Write Off Approver');
insert into eg_roleaction (actionid, roleid) select (select id from eg_action where name = 'Search CourtCase/WriteOff Application Result' and contextroot='ptis'), id from eg_role where name in ('Court Case Approver','Court Case Initiator','Write Off Initiator','Write Off Approver');
|
<reponame>windwiny/Oracle-DBA-tips-scripts
-- +----------------------------------------------------------------------------+
-- | <NAME> |
-- | <EMAIL> |
-- | www.idevelopment.info |
-- |----------------------------------------------------------------------------|
-- | Copyright (c) 1998-2015 <NAME>. All rights reserved. |
-- |----------------------------------------------------------------------------|
-- | DATABASE : Oracle |
-- | FILE : example_create_not_null_constraints.sql |
-- | CLASS : Examples |
-- | PURPOSE : It is important when designing tables to name your NOT NULL |
-- | constraints. The following example provides the syntax necessary|
-- | to name your NOT NULL constraints. |
-- | NOTE : As with any code, ensure to test this script in a development |
-- | environment before attempting to run it in production. |
-- +----------------------------------------------------------------------------+
ALTER TABLE user_names
MODIFY ( name CONSTRAINT user_names_nn1 NOT NULL
, age CONSTRAINT user_names_nn2 NOT NULL
, update_log_date CONSTRAINT user_names_nn3 NOT NULL
)
/
|
<reponame>happypypy/workspace
INSERT INTO `cms_account`(`chraccount`,`chrname`,`chrpassword`,`intflag`,`intsn`,`repurview`,`chrremark`,`siteid`,`sitename`) VALUES ('admin', '系统管理员', '<PASSWORD>', '1', '0', '1', '站点管理员', '{siteid}','{sitename}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站名称', '', '', 'webname', '1', '1', '1', '1', '网站名称建议使用汉字', '', '', '网站名称', '', '', '{sitename}', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站地址', '', '', 'webaddress', '1', '2', '0', '1', '', '', '', '', '', '', 'www.chinasky.cn', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站Banner', '', '', 'webbanner', '1', '4', '0', '1', '', '', '', '', '', '', 'images/banner.jpg', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站站长', '', '', 'webmaster', '1', '5', '0', '1', '', '', '', '', '', '', 'admin', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站站长邮箱', '', '', 'masteremail', '1', '6', '0', '1', '', '', '', '', '', '', '<EMAIL>', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '页面底部落款信息', '', '', 'copyright', '2', '7', '1', '1', '', '', '', '', '', '', 'copyright 2018', '', '', '400', '80', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站META关键字', '', '', 'metakeyword', '1', '8', '0', '1', '', '', '', '', '', '', '深圳天洛科技有限公司', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站META描述', '', '', 'metaremark', '1', '9', '0', '1', '', '', '', '', '', '', '深圳天洛科技有限公司', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站备案号', '', '', 'webnumber', '1', '10', '0', '1', '', '', '', '', '', '', '7896789374653', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站统计链接', '', '', 'weblink', '1', '11', '0', '1', '', '', '', '', '', '', '天络科技,网页制作,程序开发', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '邮箱地址', '', '', 'emailaddress', '1', '12', '0', '1', '', '', '', '', '', '', '', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '邮箱密码', '', '', 'emailpassword', '1', '13', '0', '1', '', '', '', '', '', '', '', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', 'SMTP地址', '', '', 'smtpaddress', '1', '14', '0', '1', '', '', '', '', '', '', '', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '注册信息接收邮箱', '', '', 'regemail', '1', '15', '0', '1', '', '', '', '', '', '', '', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '问题提交接收邮箱', '', '', 'prolememail', '1', '16', '0', '1', '', '', '', '', '', '', '', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '网站链接地址', '', '', 'weburl', '1', '17', '0', '1', '', '', '', '', '', '', 'http://www.chinasky.net/', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('41', 'weboption', '模版目录', '', '', 'rootdir', '1', '1', '0', '1', '', '', '', '', '', '', 'M1', 'M1', 'M1', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '网站上传目录', '', '', 'uploaddir', '1', '2', '0', '1', '', '', '', '', '', '', '/UploadFiles/', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '网站生成目录(留空为根目录)', '', '', 'producedir', '1', '3', '0', '1', '', '', '', '', '', '', 'html', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '上传文件保存规则', '', '', 'filename', '1', '4', '0', '1', '', '', '', '', '', '', '{$year}/{$month}/', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '上传文件大小限制(K)', '', '', 'filesize', '1', '5', '0', '1', '', '', '', '', '', '', '102400', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '允许上传文件类型', '', '', 'filetype', '1', '6', '0', '1', '', '', '', '', '', '', 'jpg;jpeg;gif;png;bmp;zip;rar;doc;pdf;arj;bin;blob;img', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '生成静态文件后缀', '', '', 'filefix', '1', '8', '0', '1', '', '', '', '', '', '', '.html', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '首页默认模板文件路径', '', '', 'indexdir', '1', '9', '0', '1', '', '', '', '', '', '', 'index.html', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '首页生成文件名', '', '', 'indexfilename', '1', '10', '0', '1', '', '', '', '', '', '', 'index.html', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '默认栏目首页模板', '', '', 'columnstencil', '1', '11', '0', '1', '', '', '', '', '', '', 'node/index.html', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '默认栏目列表页模板', '', '', 'columnlist', '1', '12', '0', '1', '', '', '', '', '', '', 'node/index.html', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '默认内容页模板', '', '', 'contentstencil', '1', '13', '0', '1', '', '', '', '', '', '', 'node/detail.html', '', '', '0', '0', '0', '1', '1', '9∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('2', 'weboption', '内容页生成规则', '', '', 'contentrule', '1', '14', '0', '1', '', '', '', '', '', '', '{$nodedir}/{$year}/{$month}-{$day}/{$id}', '', '', '400', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '生成方式', '', '', 'buildway', '6', '1', '0', '2', '', '', '', '', '', '', '2', '1', '1', '0', '0', '0', '1', '1', '1∮自动裁剪|1,强行缩放|2,仅考虑宽|3,仅考虑高|4☆☆☆☆☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '缩略图默认高', '', '', 'thumheight', '1', '3', '0', '2', '', '', '', '', '', '', '1001', '', '1001', null, null, null, '1', '1', '0∮☆☆☆☆☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '是否生成缩略图', '', '', 'thumbnail', '6', '2', '0', '2', '', '', '', '', '', '', '2', '1', '1', '0', '0', '0', '1', '1', '1∮是#yes|1,否#no|2☆☆☆☆☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '缩略图默认宽', '', '', 'thumwidth', '1', '3', '0', '2', '', '', '', '', '', '', '500', '', '500', '0', '0', '0', '1', '1', '0∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '是否生成水印', '', '', 'watermark', '6', '0', '0', '2', '', '', '', '', '', '', '1', '1', '1', '0', '0', '0', '1', '1', '1∮是#yes#shi|1,否#no#fou|2☆☆☆☆☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印类型', '', '', 'watertype', '6', '0', '0', '2', '', '', '', '', '', '', '1', '1', '1', '0', '0', '0', '1', '1', '1∮文字水印#water#文字水印|1,图片水印#pic#圖片水印|2☆☆☆☆☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印文字', '', '', 'waterword', '1', '0', '0', '2', '', '', '', '', '', '', '你好a', '', '你好a', '0', '0', '0', '1', '1', '9∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印文字字体', '', '', 'waterfont', '1', '0', '0', '2', '', '', '', '', '', '', '宋体', '', '宋體', '0', '0', '0', '1', '1', '9∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印字体大小', '', '', 'watersize', '1', '0', '0', '2', '', '', '', '', '', '', '12', '', '12', '0', '0', '0', '1', '1', '9∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印文字颜色', '', '', 'watercolour', '1', '0', '0', '2', '', '', '', '', '', '', '22222', '', '22222', '0', '0', '0', '1', '1', '9∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印图片地址', '', '', 'wateraddr', '10', '0', '0', '2', '', '', '', '', '', '', '', '', '', '0', '0', '0', '1', '1', '0∮☆☆☆☆☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印图片透明度', '', '', 'watertransparent', '1', '0', '0', '2', '', '', '', '', '', '', '701', '', '701', '0', '0', '0', '1', '1', '9∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '水印位置', '', '', 'waterplace', '7', '0', '0', '2', '', '', '', '', '', '', '2', '1', '1', '0', '0', '0', '1', '1', '1∮左上|1,左中|2,左下|3,中上|4,正中|1,中下|2,右下|1,右上|2,右中|1,右下|2☆☆☆☆☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '横向离边距离', '', '', 'latermargin', '1', '0', '0', '2', '', '', '', '', '', '', '22', '', '22', '0', '0', '0', '1', '1', '9∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('6', 'waterset', '纵向离边距离', '', '', 'longmargin', '1', '0', '0', '2', '', '', '', '', '', '', '33', '', '33', '0', '0', '0', '1', '1', '9∮☆', '', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('1', 'webset', '联系电话', '', '', 'telphont', '1', '1', '0', '1', '', '', '', '', '', '', '', '', '', '0', '0', '0', '1', '1', '0∮☆', '2∮∮∮', '{siteid}');
INSERT INTO `cms_config_rule`(`idmenu`,`menucode`,`chrname`,`en_chrname`,`tc_chrname`,`fieldname`,`fieldtype`,`intsn`,`isshow`,`intflag`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`defaultval`,`en_defaultval`,`tc_defaultval`,`txtwidth`,`txtheight`,`maxlength`,`type`,`txttype`,`settings`,`childsetting`,`idsite`) VALUES ('40','webset', '主页顶部机构LOGO', '', '', 'weblogo', '10', '3', '1', '1', '建议分辨率:300px*80', '', '', '', '', '', '/static/images/logo.png', '', '', '0', '0', '0', '1', '1', '', '2∮∮∮', '{siteid}');
INSERT INTO `cms_node`(`nodename`,`en_nodename`,`tc_nodename`,`idmodel`,`modelname`,`en_modelname`,`tc_modelname`,`parentid`,`parentpath`,`idroot`,`level`,`child`,`arrchildid`,`idorder`,`nodedir`,`parentdir`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`nodepicurl`,`metakeywords`,`en_metakeywords`,`tc_metakeywords`,`metaremark`,`en_metaremark`,`tc_metaremark`,`showonmenu`,`showonpath`,`isonepage`,`itempagesize`,`linkurl`,`option`,`templateofnodeindex`,`templateofnodelist`,`templateofnodecontent`,`idsite`,`nodetype`,`commentmodel`,`entrymodel`) VALUES ('关于我们', 'testdir', null, '35', '文章模型', null, null, '0', '0,', '0', '0', '0', '', '1', 'ceshi', '/', '', null, null, '', null, null, '1', '', null, null, '', null, null, '1', '1', '1', '0', '', '2', '', '', '', '{siteid}', '1', '0', '0');
INSERT INTO `cms_node`(`nodename`,`en_nodename`,`tc_nodename`,`idmodel`,`modelname`,`en_modelname`,`tc_modelname`,`parentid`,`parentpath`,`idroot`,`level`,`child`,`arrchildid`,`idorder`,`nodedir`,`parentdir`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`nodepicurl`,`metakeywords`,`en_metakeywords`,`tc_metakeywords`,`metaremark`,`en_metaremark`,`tc_metaremark`,`showonmenu`,`showonpath`,`isonepage`,`itempagesize`,`linkurl`,`option`,`templateofnodeindex`,`templateofnodelist`,`templateofnodecontent`,`idsite`,`nodetype`,`commentmodel`,`entrymodel`) VALUES ('课程介绍', 'testdir3', null, '35', '文章模型', null, null, '0', '0,', '0', '0', '0', '', '2', 'ceshi3', '/', '', null, null, '', null, null, '', '', null, null, '', null, null, '1', '1', '2', '0', '', null, '', '', '', '{siteid}', '1', '0', '0');
INSERT INTO `cms_node`(`nodename`,`en_nodename`,`tc_nodename`,`idmodel`,`modelname`,`en_modelname`,`tc_modelname`,`parentid`,`parentpath`,`idroot`,`level`,`child`,`arrchildid`,`idorder`,`nodedir`,`parentdir`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`nodepicurl`,`metakeywords`,`en_metakeywords`,`tc_metakeywords`,`metaremark`,`en_metaremark`,`tc_metaremark`,`showonmenu`,`showonpath`,`isonepage`,`itempagesize`,`linkurl`,`option`,`templateofnodeindex`,`templateofnodelist`,`templateofnodecontent`,`idsite`,`nodetype`,`commentmodel`,`entrymodel`) VALUES ('业务合作', 'testdir2', null, '35', '文章模型', null, null, '0', '0,', '0', '0', '0', '', '3', 'ceshi2', '/', '', null, null, '', null, null, '', '', null, null, '', null, null, '1', '1', '2', '0', '', '3', '', '', '', '{siteid}', '1', '0', '0');
INSERT INTO `cms_node`(`nodename`,`en_nodename`,`tc_nodename`,`idmodel`,`modelname`,`en_modelname`,`tc_modelname`,`parentid`,`parentpath`,`idroot`,`level`,`child`,`arrchildid`,`idorder`,`nodedir`,`parentdir`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`nodepicurl`,`metakeywords`,`en_metakeywords`,`tc_metakeywords`,`metaremark`,`en_metaremark`,`tc_metaremark`,`showonmenu`,`showonpath`,`isonepage`,`itempagesize`,`linkurl`,`option`,`templateofnodeindex`,`templateofnodelist`,`templateofnodecontent`,`idsite`,`nodetype`,`commentmodel`,`entrymodel`) VALUES ('课程回顾', 'testdir1', null, '35', '文章模型', null, null, '0', '0,', '0', '0', '0', '', '4', '', '/', '', null, null, '', null, null, '', '', null, null, '', null, null, '1', '1', '2', '0', '', '2', '', '', '', '{siteid}', '1', '0', '0');
INSERT INTO `cms_node`(`nodename`,`en_nodename`,`tc_nodename`,`idmodel`,`modelname`,`en_modelname`,`tc_modelname`,`parentid`,`parentpath`,`idroot`,`level`,`child`,`arrchildid`,`idorder`,`nodedir`,`parentdir`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`nodepicurl`,`metakeywords`,`en_metakeywords`,`tc_metakeywords`,`metaremark`,`en_metaremark`,`tc_metaremark`,`showonmenu`,`showonpath`,`isonepage`,`itempagesize`,`linkurl`,`option`,`templateofnodeindex`,`templateofnodelist`,`templateofnodecontent`,`idsite`,`nodetype`,`commentmodel`,`entrymodel`) VALUES ('通知公告', null, null, '35', '文章模型', null, null, '0', '0,', '0', '0', '0', '', '5', '', '/', '', null, null, '', null, null, '', '', null, null, '', null, null, '1', '1', '2', '0', '', null, '', '', '', '{siteid}', '1', '0', '0');
INSERT INTO `cms_node`(`nodename`,`en_nodename`,`tc_nodename`,`idmodel`,`modelname`,`en_modelname`,`tc_modelname`,`parentid`,`parentpath`,`idroot`,`level`,`child`,`arrchildid`,`idorder`,`nodedir`,`parentdir`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`nodepicurl`,`metakeywords`,`en_metakeywords`,`tc_metakeywords`,`metaremark`,`en_metaremark`,`tc_metaremark`,`showonmenu`,`showonpath`,`isonepage`,`itempagesize`,`linkurl`,`option`,`templateofnodeindex`,`templateofnodelist`,`templateofnodecontent`,`idsite`,`nodetype`,`commentmodel`,`entrymodel`) VALUES ('机构动态', null, null, '35', '文章模型', null, null, '0', '0,', '0', '0', '0', '', '6', '', '/', '', null, null, '', null, null, '', '', null, null, '', null, null, '1', '1', '2', '0', '', null, '', '', '', '{siteid}', '1', '0', null);
INSERT INTO `cms_node`(`nodename`,`en_nodename`,`tc_nodename`,`idmodel`,`modelname`,`en_modelname`,`tc_modelname`,`parentid`,`parentpath`,`idroot`,`level`,`child`,`arrchildid`,`idorder`,`nodedir`,`parentdir`,`tips`,`en_tips`,`tc_tips`,`remark`,`en_remark`,`tc_remark`,`nodepicurl`,`metakeywords`,`en_metakeywords`,`tc_metakeywords`,`metaremark`,`en_metaremark`,`tc_metaremark`,`showonmenu`,`showonpath`,`isonepage`,`itempagesize`,`linkurl`,`option`,`templateofnodeindex`,`templateofnodelist`,`templateofnodecontent`,`idsite`,`nodetype`,`commentmodel`,`entrymodel`) VALUES ('公司活动', null, null, '46', '活动模型', null, null, '0', '0,', '0', '0', '0', '', '7', '', '/', '', null, null, '', null, null, '', '', null, null, '', null, null, '1', '1', '2', '0', '', null, '', '', '', '{siteid}', '2', '0', '0');
|
CREATE DATABASE IF NOT EXISTS `lambda` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `lambda`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: lambda
-- ------------------------------------------------------
-- Server version 5.7.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `django_migrations`
--
DROP TABLE IF EXISTS `django_migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `django_migrations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`app` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`applied` datetime(6) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `django_migrations`
--
LOCK TABLES `django_migrations` WRITE;
/*!40000 ALTER TABLE `django_migrations` DISABLE KEYS */;
INSERT INTO `django_migrations` VALUES (1,'contenttypes','0001_initial','2018-11-16 17:49:20.381546'),(2,'auth','0001_initial','2018-11-16 17:49:21.044181'),(3,'accounts','0001_initial','2018-11-16 17:49:21.141960'),(4,'admin','0001_initial','2018-11-16 17:49:21.274884'),(5,'admin','0002_logentry_remove_auto_add','2018-11-16 17:49:21.284875'),(6,'admin','0003_logentry_add_action_flag_choices','2018-11-16 17:49:21.294874'),(7,'contenttypes','0002_remove_content_type_name','2018-11-16 17:49:21.395001'),(8,'auth','0002_alter_permission_name_max_length','2018-11-16 17:49:21.458829'),(9,'auth','0003_alter_user_email_max_length','2018-11-16 17:49:21.532630'),(10,'auth','0004_alter_user_username_opts','2018-11-16 17:49:21.544598'),(11,'auth','0005_alter_user_last_login_null','2018-11-16 17:49:21.594473'),(12,'auth','0006_require_contenttypes_0002','2018-11-16 17:49:21.599451'),(13,'auth','0007_alter_validators_add_error_messages','2018-11-16 17:49:21.611419'),(14,'auth','0008_alter_user_username_max_length','2018-11-16 17:49:21.671259'),(15,'auth','0009_alter_user_last_name_max_length','2018-11-16 17:49:21.729105'),(16,'home','0001_initial','2018-11-16 17:49:21.808891'),(17,'lambda_rad','0001_initial','2018-11-16 17:49:22.280025'),(18,'sessions','0001_initial','2018-11-16 17:49:22.324905');
/*!40000 ALTER TABLE `django_migrations` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-02-07 10:04:42
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.