text
stringlengths
1
1.05M
insert into PERSON (ID, NAME) values (4, 'effine');
-- https://classroom.udacity.com/nanodegrees/nd027/parts/f7dbb125-87a2-4369-bb64-dc5c21bb668a/modules/a7801de4-ee3f-4531-b887-82dea67f47a6/lessons/01995bb4-db30-4e01-bf38-ff11b631be0f/concepts/1533c19b-0505-49fd-b1b7-06c987641f0d -- https://www.postgresql.org/docs/13/ddl-basics.html -- https://www.postgresql.org/docs/13/ddl-constraints.html (PK,FK) -- https://www.postgresql.org/docs/13/datatype.html -- drop to reset the database if exists drop database if exists sparkifydb; -- https://www.postgresql.org/docs/13/manage-ag-templatedbs.html -- CREATE DATABASE actually works by copying an existing database. By default, it copies the standard system database named template1. -- By instructing CREATE DATABASE to copy template0 instead of template1, you can create a “pristine” (original) user database (one where no user-defined objects exist and where the system objects have not been altered) that contains none of the site-local additions in template1. create database sparkifydb with encoding 'utf8' TEMPLATE template0; -- to use database sparkifydb \c sparkifydb -- dimension tables
CREATE TABLE `m_floating_rates` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `name` VARCHAR(200) NOT NULL, `is_base_lending_rate` BIT(1) NOT NULL DEFAULT 0, `is_active` BIT(1) NOT NULL DEFAULT 1, `createdby_id` BIGINT(20) NOT NULL, `created_date` DATETIME NOT NULL, `lastmodifiedby_id` BIGINT(20) NOT NULL, `lastmodified_date` DATETIME NOT NULL, PRIMARY KEY (`id`), UNIQUE INDEX `unq_name` (`name`) ); CREATE TABLE `m_floating_rates_periods` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `floating_rates_id` BIGINT(20) NOT NULL, `from_date` DATETIME NOT NULL, `interest_rate` DECIMAL(19,6) NOT NULL, `is_differential_to_base_lending_rate` BIT(1) NOT NULL DEFAULT 0, `is_active` BIT(1) NOT NULL DEFAULT 1, `createdby_id` BIGINT(20) NOT NULL, `created_date` DATETIME NOT NULL, `lastmodifiedby_id` BIGINT(20) NOT NULL, `lastmodified_date` DATETIME NOT NULL, PRIMARY KEY (`id`), CONSTRAINT `FK_mappings_m_floating_rates` FOREIGN KEY (`floating_rates_id`) REFERENCES `m_floating_rates` (`id`) ); ALTER TABLE `m_product_loan` ADD COLUMN `is_linked_to_floating_interest_rates` BIT(1) NOT NULL DEFAULT 0 AFTER `fund_id`, MODIFY COLUMN `nominal_interest_rate_per_period` DECIMAL(19,6) NULL DEFAULT NULL, MODIFY COLUMN `interest_period_frequency_enum` SMALLINT(5) NULL DEFAULT NULL, MODIFY COLUMN `annual_nominal_interest_rate` DECIMAL(19,6) NULL DEFAULT NULL; CREATE TABLE `m_product_loan_floating_rates` ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `loan_product_id` BIGINT(20) NOT NULL, `floating_rates_id` BIGINT(20) NOT NULL, `interest_rate_differential` DECIMAL(19,6) NOT NULL DEFAULT 0, `min_differential_lending_rate` DECIMAL(19,6) NOT NULL DEFAULT 0, `default_differential_lending_rate` DECIMAL(19,6) NOT NULL DEFAULT 0, `max_differential_lending_rate` DECIMAL(19,6) NOT NULL DEFAULT 0, `is_floating_interest_rate_calculation_allowed` BIT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`id`), CONSTRAINT `FK_mappings_m_product_loan_id` FOREIGN KEY (`loan_product_id`) REFERENCES `m_product_loan` (`id`), CONSTRAINT `FK_mappings_m_floating_rates_id` FOREIGN KEY (`floating_rates_id`) REFERENCES `m_floating_rates` (`id`) ); ALTER TABLE `m_loan` ADD COLUMN `is_floating_interest_rate` BIT(1) NULL DEFAULT 0 AFTER `arrearstolerance_amount`, ADD COLUMN `interest_rate_differential` DECIMAL(19,6) NULL DEFAULT 0 AFTER `is_floating_interest_rate`, MODIFY COLUMN `nominal_interest_rate_per_period` DECIMAL(19,6) NULL DEFAULT NULL, MODIFY COLUMN `interest_period_frequency_enum` SMALLINT(5) NULL DEFAULT NULL, MODIFY COLUMN `annual_nominal_interest_rate` DECIMAL(19,6) NULL DEFAULT NULL; INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('portfolio', 'READ_FLOATINGRATE', 'FLOATINGRATE', 'READ', 0), ('portfolio', 'CREATE_FLOATINGRATE', 'FLOATINGRATE', 'CREATE', 1), ('portfolio', 'CREATE_FLOATINGRATE_CHECKER', 'FLOATINGRATE', 'CREATE_CHECKER', 0), ('portfolio', 'UPDATE_FLOATINGRATE', 'FLOATINGRATE', 'UPDATE', 1), ('portfolio', 'UPDATE_FLOATINGRATE_CHECKER', 'FLOATINGRATE', 'UPDATE_CHECKER', 0);
INSERT INTO USER_DOMAIN (USER_NAME, USER_SURNAME) VALUES ('Eni','Berisha'), ('Andi','Berisha'), ('Sid','Tellalhari'), ('John','Behar'); INSERT INTO TASK_DOMAIN (HAS_TASK_BEEN_COMPLETED_CHECK, TASK_NAME,USER_ID) VALUES ('Y','taxes',1), ('Y','Laundry',2), ('N','Walk the dog',3);
{{ config( materialized='table' ) }} SELECT order_id, promo_id, user_id, address_id, created_at, order_cost, shipping_cost, order_total, tracking_id, shipping_service, estimated_delivery_at, delivered_at, status FROM {{ source('tutorial', 'orders') }}
DROP TABLE categories; DROP TABLE tags; DROP TABLE votes; DROP TABLE leave_words; DROP TABLE friend_links; DROP TABLE links; DROP TABLE cards;
 DROP DATABASE domainhunter; CREATE DATABASE domainhunter WITH OWNER = postgres ENCODING = 'UTF8' TABLESPACE = pg_default CONNECTION LIMIT = -1; DROP TABLE public.domain; CREATE TABLE public.domain ( id SERIAL NOT NULL PRIMARY KEY, name VARCHAR(100) NOT NULL, tld VARCHAR(10) NOT NULL, expiration timestamp, checked timestamp ) WITH ( OIDS=FALSE ) ; DROP TABLE public.domainstatus; CREATE TABLE public.domainstatus ( id SERIAL NOT NULL PRIMARY KEY, domainid INTEGER NOT NULL REFERENCES domain(id), error boolean NOT NULL, nowhois boolean NOT NULL, registrarlock boolean NOT NULL, ok boolean NOT NULL, serverhold boolean NOT NULL, redemptionperiod boolean NOT NULL, addperiod boolean NOT NULL, autorenewperiod boolean NOT NULL, inactive boolean NOT NULL, pendingcreate boolean NOT NULL, pendingdelete boolean NOT NULL, pendingrenew boolean NOT NULL, pendingrestore boolean NOT NULL, pendingtransfer boolean NOT NULL, pendingupdate boolean NOT NULL, renewperiod boolean NOT NULL, serverdeleteprohibited boolean NOT NULL, serverrenewprohibited boolean NOT NULL, servertransferprohibited boolean NOT NULL, serverupdateprohibited boolean NOT NULL, transferperiod boolean NOT NULL, clientdeleteprohibited boolean NOT NULL, clienthold boolean NOT NULL, clientrenewprohibited boolean NOT NULL, clienttransferprohibited boolean NOT NULL, clientupdateprohibited boolean NOT NULL ) WITH ( OIDS=FALSE );
DROP INDEX IF EXISTS "VonageSessionLayout_vonageSessionId";
-- phpMyAdmin SQL Dump -- version 4.9.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 17, 2020 at 05:21 PM -- Server version: 10.3.15-MariaDB -- PHP Version: 7.2.19 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 */; -- -- Database: `ermsdb` -- -- -------------------------------------------------------- -- -- Table structure for table `empeducation` -- CREATE TABLE `empeducation` ( `Id` int(11) NOT NULL, `EmpID` int(10) DEFAULT NULL, `CoursePG` varchar(45) DEFAULT NULL, `SchoolCollegePG` varchar(45) DEFAULT NULL, `YearPassingPG` varchar(45) DEFAULT NULL, `PercentagePG` varchar(4) DEFAULT NULL, `CourseGra` varchar(45) DEFAULT NULL, `SchoolCollegeGra` varchar(45) DEFAULT NULL, `YearPassingGra` varchar(45) DEFAULT NULL, `PercentageGra` varchar(4) DEFAULT NULL, `CourseSSC` varchar(45) DEFAULT NULL, `SchoolCollegeSSC` varchar(45) DEFAULT NULL, `YearPassingSSC` varchar(45) DEFAULT NULL, `PercentageSSC` varchar(4) DEFAULT NULL, `CourseHSC` varchar(45) DEFAULT NULL, `SchoolCollegeHSC` varchar(45) DEFAULT NULL, `YearPassingHSC` varchar(45) DEFAULT NULL, `PercentageHSC` varchar(4) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `empeducation` -- INSERT INTO `empeducation` (`Id`, `EmpID`, `CoursePG`, `SchoolCollegePG`, `YearPassingPG`, `PercentagePG`, `CourseGra`, `SchoolCollegeGra`, `YearPassingGra`, `PercentageGra`, `CourseSSC`, `SchoolCollegeSSC`, `YearPassingSSC`, `PercentageSSC`, `CourseHSC`, `SchoolCollegeHSC`, `YearPassingHSC`, `PercentageHSC`) VALUES (1, 4, 'NA', 'NA', 'NA', 'NA', 'B.Tech(IT)', 'LPU', '2014', '86%', 'Science', 'ABC Senoir secondary School', '2010', '64%', 'Science', 'abcd', '2008', '98%'), (2, 2, 'abc', 'ghf', '2016', '89%', 'B.Tech(IT)', 'LPU', '2013', '86%', 'Science', 'DPS Senoir secondary School', '2009', '64%', 'Science', 'DPS Senoir secondary School', '2008', '90%'), (3, 3, 'Master in charted accountant', 'Bhavi CA college', '2004', '89%', 'Bachelor in charted accountant', 'Bhavi CA college', '1996', '95%', 'Science', 'graimia convent school', '1993', '75%', 'Science', 'graimia convent school', '1991', '89%'), (4, 7, 'MCA', 'KITE Ghaziabad', '1990', '64 %', 'BCA', 'TVN', '1997', '68 %', 'Science', 'TVN', '1992', '76 %', 'Science', 'TVN', '2010', '89 %'), (5, 12, 'NA', 'NA', 'NA', 'NA', 'B.Tech', 'VIT', '1996', '75%', 'Science', 'GHI convent school', '1993', '66%', 'Science', 'GHI convent school', '1990', '65%'), (6, 13, 'MBA', 'SMU', '2018', '70', 'B.Tech', 'LPU', '2015', '80', 'PCM', 'Test', '2010', '74', 'PCM', 'ABC', '2008', '85'), (7, 1, 'NA', 'NA', 'NA', 'NA', 'B.Tech', 'ABC', '2012', '75', 'PCM', 'XYZ', '2008', '67', '10th', 'HGHH', '2006', '89'), (8, 14, 'M.Tech', 'ABC College', '2014', '65', 'B.Tech', 'XYZ', '2012', '70', 'PCM', 'ABC', '2008', '56', 'High School', 'XYZ', '2006', '85'); -- -------------------------------------------------------- -- -- Table structure for table `empexpireince` -- CREATE TABLE `empexpireince` ( `ID` int(11) NOT NULL, `EmpID` varchar(5) DEFAULT NULL, `Employer1Name` varchar(75) DEFAULT NULL, `Employer1Designation` varchar(50) DEFAULT NULL, `Employer1CTC` varchar(50) DEFAULT NULL, `Employer1WorkDuration` varchar(11) DEFAULT NULL, `Employer2Name` varchar(75) DEFAULT NULL, `Employer2Designation` varchar(50) DEFAULT NULL, `Employer2CTC` varchar(50) DEFAULT NULL, `Employer2WorkDuration` varchar(11) DEFAULT NULL, `Employer3Name` varchar(75) DEFAULT NULL, `Employer3Designation` varchar(50) DEFAULT NULL, `Employer3CTC` varchar(50) DEFAULT NULL, `Employer3WorkDuration` varchar(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `empexpireince` -- INSERT INTO `empexpireince` (`ID`, `EmpID`, `Employer1Name`, `Employer1Designation`, `Employer1CTC`, `Employer1WorkDuration`, `Employer2Name`, `Employer2Designation`, `Employer2CTC`, `Employer2WorkDuration`, `Employer3Name`, `Employer3Designation`, `Employer3CTC`, `Employer3WorkDuration`) VALUES (2, '4', 'abc.pvt.td', 'software tester', '20,000 p/m', '4 yrs', 'tch.pvt.td', 'software tester', '32000 p/m', '4 yrs', 'dfg.pvt.td', 'SR.software tester', '45000 p/m', '7 yrs'), (7, '2', 'SAR pvt.ltd', 'Software Developer', '25000 p/m', '3 yrs', 'abc enterprise', 'software developer', '30000 p/m', '3 yrs', 'dgfhgfg.pt.ltd', 'software developer', '35000 p/m', '2 yrs till '), (8, '3', 'GHA pvt.ltd', 'accountant', '25000', '5 yrs', 'HRCH pvt.ltd', 'accountant', '75000', '5 yrs', 'TCGHB pvt ltd', 'Sr.Accountant', '95000 ', '8 yrs till'), (9, '7', 'FAG pvt.ltd', 'HR Executive', '25000 p/m', '6 yrs', 'TYS', 'HR Executive', '35000 p/m', '7 yrs', 'hirp pvt.ltd', 'HR Executive', '45000 p/m', '4 yrs till'), (10, '12', 'dfg.pvt.ltd', 'accountant', '25000 p/m', '1 yrs', 'fghpvt.ltd', 'accountant', '30000 p/m', '3 yrs', 'fghpvt.ltd', 'accountant', '45000 p/m', '5 yrs till'), (11, '13', 'ABC', 'Developer', '12000 ', '2 years', 'NA', 'NA', 'NA', 'NA', 'NA', 'NA', 'NA', 'NA'), (12, '1', '', '', '', '', '', '', '', '', '', '', '', ''), (13, '14', 'ABC Tech', 'Jr Devloper', '1258000', '6 Month', 'XYZ Tech', 'Devloper', '2589300', '6 Month', 'It Tech', 'Sr Devloper', '853214447', '2 + Years'); -- -------------------------------------------------------- -- -- Table structure for table `employeedetail` -- CREATE TABLE `employeedetail` ( `ID` int(11) NOT NULL, `EmpFname` varchar(50) DEFAULT NULL, `EmpLName` varchar(50) NOT NULL, `EmpCode` varchar(50) DEFAULT NULL, `EmpDept` varchar(120) DEFAULT NULL, `EmpDesignation` varchar(120) DEFAULT NULL, `EmpContactNo` bigint(10) DEFAULT NULL, `EmpGender` enum('Male','Female') DEFAULT NULL, `EmpEmail` varchar(200) DEFAULT NULL, `EmpPassword` varchar(100) DEFAULT NULL, `EmpJoingdate` date DEFAULT NULL, `PostingDate` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `employeedetail` -- INSERT INTO `employeedetail` (`ID`, `EmpFname`, `EmpLName`, `EmpCode`, `EmpDept`, `EmpDesignation`, `EmpContactNo`, `EmpGender`, `EmpEmail`, `EmpPassword`, `EmpJoingdate`, `PostingDate`) VALUES (1, 'Subhash', 'Pandey', '123465', 'IT', 'Software Developer', 1234567890, 'Male', 'abc@gmail.com', 'Test@12345', '2019-01-02', '2019-02-06 06:31:49'), (2, 'Anuj', 'Kumar', '123465558', 'CS', 'Software Developer', 1234567890, 'Male', 'anuj@gmail.com', '123', '2017-03-23', '2019-02-06 06:41:42'), (3, 'Ankush', 'Pandey', '123467', 'IT', 'Software Developer', 1234567890, 'Male', 'ankush@gmail.com', '89756', '2010-09-13', '2019-02-06 06:42:15'), (4, 'Sarita', 'Pandey', '12346012', 'IT', 'Software Developer', 1234567890, '', 'abhi@gmail.com', '156975', NULL, '2019-02-06 06:42:47'), (6, 'Manu', 'Ramesh', '369874', NULL, NULL, NULL, NULL, 'manu@gmail.com', '987563', NULL, '2019-02-06 12:00:50'), (7, 'Ragunath', 'Shahye', '63', NULL, NULL, NULL, NULL, 'shahye@gmail.com', '99999', NULL, '2019-02-08 07:22:40'), (8, '1345556', '', '', NULL, NULL, NULL, NULL, '', '', NULL, '2019-02-11 05:08:40'), (9, 'Garuv', 'Bhatia', '89745', NULL, NULL, NULL, NULL, 'jk@gmail.com', '12', NULL, '2019-02-11 05:12:28'), (10, 'Khusi', 'Dev', '1234', NULL, NULL, NULL, NULL, 'hjk@gmail.com', '1990', NULL, '2019-02-11 05:18:08'), (11, 'SARITA', 'pANDEY', '789', NULL, NULL, NULL, NULL, 'PANDEY@GMAIL.COM', '1111', NULL, '2019-02-11 08:50:55'), (12, 'Dinesh', 'Karthik', '56989', NULL, NULL, NULL, NULL, 'dinesh@gmail.com', '8989', NULL, '2019-02-11 12:30:50'), (13, 'Test', 'User', '2131231', 'IT', 'Software Developer', 1234567890, 'Male', 'testuser@gmail.com', 'Test@123', '2018-10-09', '2019-02-11 16:21:58'), (14, 'Anuj', 'Kumar', '1023647885', 'IT', 'Software Developer', 1234567890, 'Male', 'aktest@gmail.com', 'Test@123', '2019-01-01', '2020-02-19 16:58:51'); -- -------------------------------------------------------- -- -- Table structure for table `tbladmin` -- CREATE TABLE `tbladmin` ( `ID` int(11) NOT NULL, `AdminName` varchar(50) DEFAULT NULL, `AdminuserName` varchar(50) DEFAULT NULL, `Password` varchar(45) DEFAULT NULL, `AdminRegdate` timestamp NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tbladmin` -- INSERT INTO `tbladmin` (`ID`, `AdminName`, `AdminuserName`, `Password`, `AdminRegdate`) VALUES (1, 'Admin', 'Admin', 'Test@123', '2019-02-07 16:52:45'); -- -- Indexes for dumped tables -- -- -- Indexes for table `empeducation` -- ALTER TABLE `empeducation` ADD PRIMARY KEY (`Id`); -- -- Indexes for table `empexpireince` -- ALTER TABLE `empexpireince` ADD PRIMARY KEY (`ID`); -- -- Indexes for table `employeedetail` -- ALTER TABLE `employeedetail` ADD PRIMARY KEY (`ID`), ADD UNIQUE KEY `EmpCode` (`EmpCode`); -- -- Indexes for table `tbladmin` -- ALTER TABLE `tbladmin` ADD PRIMARY KEY (`ID`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `empeducation` -- ALTER TABLE `empeducation` MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT for table `empexpireince` -- ALTER TABLE `empexpireince` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `employeedetail` -- ALTER TABLE `employeedetail` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15; -- -- AUTO_INCREMENT for table `tbladmin` -- ALTER TABLE `tbladmin` MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; 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 */;
SELECT t1.name, count(*) FROM site as s, so_user as u1, question as q1, answer as a1, tag as t1, tag_question as tq1 WHERE q1.owner_user_id = u1.id AND a1.question_id = q1.id AND a1.owner_user_id = u1.id AND s.site_id = q1.site_id AND s.site_id = a1.site_id AND s.site_id = u1.site_id AND s.site_id = tq1.site_id AND s.site_id = t1.site_id AND q1.id = tq1.question_id AND t1.id = tq1.tag_id AND (s.site_name in ('stackoverflow','superuser')) AND (t1.name in ('arrays','async-await','google-chrome','silverlight','vba')) AND (q1.favorite_count >= 0) AND (q1.favorite_count <= 1) AND (u1.reputation >= 0) AND (u1.reputation <= 10) GROUP BY t1.name
### Schema CREATE DATABASE burgers_db; USE burgers_db; CREATE TABLE burgers ( id int AUTO_INCREMENT, burger_name varchar(255) NOT NULL, devoured BOOLEAN DEFAULT false, PRIMARY KEY (id) );
-- Email CREATE TABLE email ( id uuid NOT NULL, email character varying(255) NOT NULL, verified boolean NOT NULL ); ALTER TABLE email ADD CONSTRAINT email_pkey PRIMARY KEY (id); ALTER TABLE email ADD CONSTRAINT email_uk_email UNIQUE (email); -- Email verification token CREATE TABLE email_verification_token ( id uuid NOT NULL, expires timestamp without time zone, email_id uuid ); ALTER TABLE email_verification_token ADD CONSTRAINT email_verification_token_pkey PRIMARY KEY (id); ALTER TABLE email_verification_token ADD CONSTRAINT email_verification_token_fk_email_id FOREIGN KEY (email_id) REFERENCES email(id);
ALTER TABLE admins ADD password VARCHAR(100); UPDATE admins set password=crypt(email, gen_salt('bf', 10)); ALTER TABLE admins ALTER COLUMN password SET NOT NUll;
insert into model(`model_name`) values('Alice');
#|frequency |flux | 113.499387796 -0.00678305141628 113.495660179 -0.0134488940239 113.491932808 -0.00309644965455 113.488205681 0.00969441514462 113.484478798 0.0137932784855 113.480752161 -0.00175093684811 113.477025768 0.00593731412664 113.47329962 0.0160758625716 113.469573717 0.00470563024282 113.465848059 -0.00227381451987 113.462122645 -0.0145112443715 113.458397475 0.00904896110296 113.454672551 0.0181626398116 113.45094787 0.000478692585602 113.447223435 -0.00162767828442 113.443499244 0.00407127477229 113.439775297 0.0171934068203 113.436051595 -0.00077015243005 113.432328138 -0.0133250020444 113.428604924 -0.00967513490468 113.424881956 -0.00464574899524 113.421159231 -0.0289955008775 113.417436751 0.00366687448695 113.413714515 0.00424346514046 113.409992524 0.00198071706109 113.406270777 -0.00701845949516 113.402549274 0.00766929518431 113.398828016 0.0101054422557 113.395107001 0.0172824896872 113.391386231 0.00712584704161 113.387665705 0.016496181488 113.383945423 0.00927925668657 113.380225385 -0.000581113854423 113.376505592 0.00588804949075 113.372786042 -0.00339046539739 113.369066736 0.00743571622297 113.365347675 -0.0156049756333 113.361628857 -0.0102213947102 113.357910284 -0.0123379686847 113.354191954 -0.00144494650885 113.350473869 -0.0108854295686 113.346756027 -0.0135339070112 113.343038429 -0.00483590364456 113.339321075 0.0143642611802 113.335603965 -0.00182233483065 113.331887098 0.00713913608342 113.328170476 0.00395041331649 113.324454097 -0.00927066337317 113.320737962 -0.00958565622568 113.31702207 0.00336040602997 113.313306423 0.0107808178291 113.309591018 0.000774948333856 113.305875858 -0.00869701057673 113.302160941 -0.00494432356209 113.298446268 0.0166430752724 113.294731838 0.0203309487551 # testing original data 113.291017652 0.0686153098941 113.28730371 0.0534001626074 # testing narrow 1 channel line #113.291017652 0.1686153098941 #113.28730371 -0.0011 113.283590011 0.010153981857 113.279876555 0.0112531688064 113.276163343 0.00819610897452 113.272450374 -0.00801649875939 113.268737649 -0.0115187168121 113.265025167 -0.0118589671329 113.261312928 0.00436507817358 113.257600933 0.0128000490367 113.253889181 -0.001705276547 113.250177672 0.000610841088928 113.246466407 0.0106641538441 113.242755384 -0.00157447531819 113.239044605 -0.00246322178282 113.235334069 -0.00155195919797 113.231623777 0.0180283319205 113.227913727 -0.00865403749049 113.224203921 -0.015010163188 113.220494358 -0.0130772087723 113.216785037 0.00932211056352 113.21307596 -0.00600345013663 113.209367126 -0.00115906447172 113.205658535 0.00614380976185 113.201950186 0.0012194380397 113.198242081 0.0114583363757 113.194534219 0.0162586141378 113.190826599 0.00192232581321 113.187119223 -0.0109210796654 113.183412089 -0.0192291233689 113.179705198 -0.00447851140052
TRUNCATE dataflow_batch_export; TRUNCATE dataflow_batch_import; TRUNCATE log_customer; TRUNCATE log_quote; TRUNCATE log_summary; TRUNCATE log_summary_type; TRUNCATE log_url; TRUNCATE log_url_info; TRUNCATE log_visitor; TRUNCATE log_visitor_info; TRUNCATE log_visitor_online; TRUNCATE report_event; TRUNCATE report_viewed_product_index; TRUNCATE report_compared_product_index; TRUNCATE catalog_compare_item; DELETE FROM sales_flat_quote WHERE updated_at < DATE_SUB(Now(),INTERVAL 5 DAY);
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute -- Copyright [2016-2020] EMBL-European Bioinformatics Institute -- -- 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. # patch_50_51_i.sql # # title: Meta value binary # # description: # Add BINARY flag to meta.meta_value to make it case sensitive when doing UNIQUE comparisions (especially for Gallus/gallus) # Drop UNIQUE index first ALTER TABLE meta DROP INDEX species_key_value_idx; ALTER TABLE meta CHANGE COLUMN meta_value meta_value VARCHAR(255) BINARY NOT NULL; # Redo index ALTER TABLE meta ADD UNIQUE INDEX species_key_value_idx (species_id, meta_key, meta_value); # patch identifier INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL, 'patch', 'patch_50_51_i.sql|meta_value_binary');
/* Enter your query here. * * * * * * * * * * * * * * * */ set @number=0; select repeat('* ', @number := @number + 1) from information_schema.tables where @number<20; /* Enter your query here. * * * * * * * * * * * * * * * */ set @number=21; select repeat('* ', @number := @number - 1) from information_schema.tables;
SET SEARCH_PATH TO STAGING_VOCABULARY; -- CREATE INDEXES ON OMOP VOCABULARY TABLES -- -- drug strength CREATE INDEX idx_stg_drug_strength_id_1 ON drug_strength USING btree (drug_concept_id); ALTER TABLE drug_strength CLUSTER ON idx_stg_drug_strength_id_1; CREATE INDEX idx_stg_drug_strength_id_2 ON drug_strength USING btree (ingredient_concept_id); -- concept CREATE INDEX idx_stg_concept_class_id ON concept USING btree (concept_class_id COLLATE pg_catalog."default"); CREATE INDEX idx_stg_concept_code ON concept USING btree (concept_code COLLATE pg_catalog."default"); CREATE UNIQUE INDEX idx_stg_concept_concept_id ON concept USING btree (concept_id); ALTER TABLE concept CLUSTER ON idx_stg_concept_concept_id; CREATE INDEX idx_stg_concept_domain_id ON concept USING btree (domain_id COLLATE pg_catalog."default"); CREATE INDEX idx_stg_concept_vocabluary_id ON concept USING btree (vocabulary_id COLLATE pg_catalog."default"); CREATE INDEX idx_stg_concept_varchar_concept_id ON concept USING btree ((concept_id::character varying) COLLATE pg_catalog."default"); -- concept relationship CREATE INDEX idx_stg_concept_relationship_id_1 ON concept_relationship USING btree (concept_id_1); CREATE INDEX idx_stg_concept_relationship_id_2 ON concept_relationship USING btree (concept_id_2); CREATE INDEX idx_stg_concept_relationship_id_3 ON concept_relationship USING btree (relationship_id COLLATE pg_catalog."default"); CREATE INDEX idx_stg_concept_relationship_id_4 ON concept_relationship USING btree (concept_id_1, concept_id_2, relationship_id COLLATE pg_catalog."default"); ALTER TABLE concept_relationship CLUSTER ON idx_stg_concept_relationship_id_4; -- concept ancestor CREATE INDEX idx_stg_concept_ancestor_id_1 ON concept_ancestor USING btree (ancestor_concept_id); ALTER TABLE concept_ancestor CLUSTER ON idx_stg_concept_ancestor_id_1; CREATE INDEX idx_stg_concept_ancestor_id_2 ON concept_ancestor USING btree (descendant_concept_id); -- concept synonym CREATE INDEX idx_stg_concept_synonym_id ON concept_synonym USING btree (concept_id); ALTER TABLE concept_synonym CLUSTER ON idx_stg_concept_synonym_id; -- relationship CREATE UNIQUE INDEX idx_stg_relationship_rel_id ON relationship USING btree (relationship_id COLLATE pg_catalog."default"); ALTER TABLE relationship CLUSTER ON idx_stg_relationship_rel_id; -- concept class CREATE UNIQUE INDEX idx_stg_concept_class_class_id ON concept_class USING btree (concept_class_id COLLATE pg_catalog."default"); ALTER TABLE concept_class CLUSTER ON idx_stg_concept_class_class_id; -- vocabulary CREATE UNIQUE INDEX idx_stg_vocabulary_vocabulary_id ON vocabulary USING btree (vocabulary_id COLLATE pg_catalog."default"); ALTER TABLE vocabulary CLUSTER ON idx_stg_vocabulary_vocabulary_id; -- domain CREATE UNIQUE INDEX idx_stg_domain_domain_id ON domain USING btree (domain_id COLLATE pg_catalog."default"); ALTER TABLE domain CLUSTER ON idx_stg_domain_domain_id;
CREATE TABLE #Codesets ( codeset_id int NOT NULL, concept_id bigint NOT NULL ) ; INSERT INTO #Codesets (codeset_id, concept_id) SELECT 0 as codeset_id, c.concept_id FROM (select distinct I.concept_id FROM ( select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4180793) UNION select c.concept_id from @vocabulary_database_schema.CONCEPT c join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id and ca.ancestor_concept_id in (4180793) and c.invalid_reason is null ) I LEFT JOIN ( select concept_id from @vocabulary_database_schema.CONCEPT where concept_id in (4178966) UNION select c.concept_id from @vocabulary_database_schema.CONCEPT c join @vocabulary_database_schema.CONCEPT_ANCESTOR ca on c.concept_id = ca.descendant_concept_id and ca.ancestor_concept_id in (4178966) and c.invalid_reason is null ) E ON I.concept_id = E.concept_id WHERE E.concept_id is null ) C; with primary_events (event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id) as ( -- Begin Primary Events select P.ordinal as event_id, P.person_id, P.start_date, P.end_date, op_start_date, op_end_date, cast(P.visit_occurrence_id as bigint) as visit_occurrence_id FROM ( select E.person_id, E.start_date, E.end_date, row_number() OVER (PARTITION BY E.person_id ORDER BY E.sort_date ASC) ordinal, OP.observation_period_start_date as op_start_date, OP.observation_period_end_date as op_end_date, cast(E.visit_occurrence_id as bigint) as visit_occurrence_id FROM ( -- Begin Condition Occurrence Criteria SELECT C.person_id, C.condition_occurrence_id as event_id, C.condition_start_date as start_date, COALESCE(C.condition_end_date, DATEADD(day,1,C.condition_start_date)) as end_date, C.CONDITION_CONCEPT_ID as TARGET_CONCEPT_ID, C.visit_occurrence_id, C.condition_start_date as sort_date FROM ( SELECT co.* , row_number() over (PARTITION BY co.person_id ORDER BY co.condition_start_date, co.condition_occurrence_id) as ordinal FROM @cdm_database_schema.CONDITION_OCCURRENCE co JOIN #Codesets codesets on ((co.condition_concept_id = codesets.concept_id and codesets.codeset_id = 0)) ) C WHERE C.ordinal = 1 -- End Condition Occurrence Criteria ) E JOIN @cdm_database_schema.observation_period OP on E.person_id = OP.person_id and E.start_date >= OP.observation_period_start_date and E.start_date <= op.observation_period_end_date WHERE DATEADD(day,365,OP.OBSERVATION_PERIOD_START_DATE) <= E.START_DATE AND DATEADD(day,0,E.START_DATE) <= OP.OBSERVATION_PERIOD_END_DATE ) P WHERE P.ordinal = 1 -- End Primary Events ) SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, visit_occurrence_id INTO #qualified_events FROM ( select pe.event_id, pe.person_id, pe.start_date, pe.end_date, pe.op_start_date, pe.op_end_date, row_number() over (partition by pe.person_id order by pe.start_date ASC) as ordinal, cast(pe.visit_occurrence_id as bigint) as visit_occurrence_id FROM primary_events pe ) QE ; --- Inclusion Rule Inserts create table #inclusion_events (inclusion_rule_id bigint, person_id bigint, event_id bigint ); with cteIncludedEvents(event_id, person_id, start_date, end_date, op_start_date, op_end_date, ordinal) as ( SELECT event_id, person_id, start_date, end_date, op_start_date, op_end_date, row_number() over (partition by person_id order by start_date ASC) as ordinal from ( select Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date, SUM(coalesce(POWER(cast(2 as bigint), I.inclusion_rule_id), 0)) as inclusion_rule_mask from #qualified_events Q LEFT JOIN #inclusion_events I on I.person_id = Q.person_id and I.event_id = Q.event_id GROUP BY Q.event_id, Q.person_id, Q.start_date, Q.end_date, Q.op_start_date, Q.op_end_date ) MG -- matching groups ) select event_id, person_id, start_date, end_date, op_start_date, op_end_date into #included_events FROM cteIncludedEvents Results ; -- generate cohort periods into #final_cohort with cohort_ends (event_id, person_id, end_date) as ( -- cohort exit dates -- By default, cohort exit at the event's op end date select event_id, person_id, op_end_date as end_date from #included_events ), first_ends (person_id, start_date, end_date) as ( select F.person_id, F.start_date, F.end_date FROM ( select I.event_id, I.person_id, I.start_date, E.end_date, row_number() over (partition by I.person_id, I.event_id order by E.end_date) as ordinal from #included_events I join cohort_ends E on I.event_id = E.event_id and I.person_id = E.person_id and E.end_date >= I.start_date ) F WHERE F.ordinal = 1 ) select person_id, start_date, end_date INTO #cohort_rows from first_ends; with cteEndDates (person_id, end_date) AS -- the magic ( SELECT person_id , DATEADD(day,-1 * 0, event_date) as end_date FROM ( SELECT person_id , event_date , event_type , MAX(start_ordinal) OVER (PARTITION BY person_id ORDER BY event_date, event_type ROWS UNBOUNDED PRECEDING) AS start_ordinal , ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY event_date, event_type) AS overall_ord FROM ( SELECT person_id , start_date AS event_date , -1 AS event_type , ROW_NUMBER() OVER (PARTITION BY person_id ORDER BY start_date) AS start_ordinal FROM #cohort_rows UNION ALL SELECT person_id , DATEADD(day,0,end_date) as end_date , 1 AS event_type , NULL FROM #cohort_rows ) RAWDATA ) e WHERE (2 * e.start_ordinal) - e.overall_ord = 0 ), cteEnds (person_id, start_date, end_date) AS ( SELECT c.person_id , c.start_date , MIN(e.end_date) AS end_date FROM #cohort_rows c JOIN cteEndDates e ON c.person_id = e.person_id AND e.end_date >= c.start_date GROUP BY c.person_id, c.start_date ) select person_id, min(start_date) as start_date, end_date into #final_cohort from cteEnds group by person_id, end_date ; DELETE FROM @target_database_schema.@target_cohort_table where cohort_definition_id = @target_cohort_id; INSERT INTO @target_database_schema.@target_cohort_table (cohort_definition_id, subject_id, cohort_start_date, cohort_end_date) select @target_cohort_id as cohort_definition_id, person_id, start_date, end_date FROM #final_cohort CO ; TRUNCATE TABLE #cohort_rows; DROP TABLE #cohort_rows; TRUNCATE TABLE #final_cohort; DROP TABLE #final_cohort; TRUNCATE TABLE #inclusion_events; DROP TABLE #inclusion_events; TRUNCATE TABLE #qualified_events; DROP TABLE #qualified_events; TRUNCATE TABLE #included_events; DROP TABLE #included_events; TRUNCATE TABLE #Codesets; DROP TABLE #Codesets;
/* Navicat Premium Data Transfer Source Server : localhost Source Server Type : MySQL Source Server Version : 50724 Source Host : localhost:3306 Source Schema : demo Target Server Type : MySQL Target Server Version : 50724 File Encoding : 65001 Date: 21/05/2019 01:01:12 */ SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------- -- Table structure for we_chat -- ---------------------------- DROP TABLE IF EXISTS `we_chat`; CREATE TABLE `we_chat` ( `we_caht_id` int(11) NOT NULL AUTO_INCREMENT, `openid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户的标识,对当前公众号唯一', `unionid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '只有在用户将公众号绑定到微信开放平台帐号后,才会出现该字段。', `nickname` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户的昵称', `sex` int(11) DEFAULT NULL COMMENT '用户的性别,值为1时是男性,值为2时是女性,值为0时是未知', `province` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户所在省份', `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户所在城市', `country` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户所在国家', `headimgurl` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '用户头像,最后一个数值代表正方形头像大小(有0、46、64、96、132数值可选,0代表640*640正方形头像),用户没有头像时该项为空', `privilege` json COMMENT '用户特权信息,json 数组,如微信沃卡用户为(chinaunicom)', `create_date` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间,自动生成,无需填写并禁止修改。', `update_date` datetime(0) DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '更新时间,自动生成,无需填写并禁止修改。', `deleted` int(1) NOT NULL DEFAULT 0 COMMENT '逻辑删除,0 未删除,1 删除,MySQL 默认值 0,不为 NULL,注解@TableLogic。', `remarks` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '数据备注。', PRIMARY KEY (`we_caht_id`) USING BTREE ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '微信' ROW_FORMAT = Dynamic; SET FOREIGN_KEY_CHECKS = 1;
-- -- PostgreSQL database dump -- -- Dumped from database version 9.5.8 -- Dumped by pg_dump version 9.5.8 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; SET row_security = off; -- -- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -- CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog; -- -- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -- COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language'; SET search_path = public, pg_catalog; SET default_tablespace = ''; SET default_with_oids = false; -- -- Name: clients; Type: TABLE; Schema: public; Owner: collins -- CREATE TABLE clients ( id integer NOT NULL, name character varying, stylistid integer ); ALTER TABLE clients OWNER TO collins; -- -- Name: clients_id_seq; Type: SEQUENCE; Schema: public; Owner: collins -- CREATE SEQUENCE clients_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE clients_id_seq OWNER TO collins; -- -- Name: clients_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: collins -- ALTER SEQUENCE clients_id_seq OWNED BY clients.id; -- -- Name: stylists; Type: TABLE; Schema: public; Owner: collins -- CREATE TABLE stylists ( id integer NOT NULL, name character varying ); ALTER TABLE stylists OWNER TO collins; -- -- Name: stylists_id_seq; Type: SEQUENCE; Schema: public; Owner: collins -- CREATE SEQUENCE stylists_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; ALTER TABLE stylists_id_seq OWNER TO collins; -- -- Name: stylists_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: collins -- ALTER SEQUENCE stylists_id_seq OWNED BY stylists.id; -- -- Name: id; Type: DEFAULT; Schema: public; Owner: collins -- ALTER TABLE ONLY clients ALTER COLUMN id SET DEFAULT nextval('clients_id_seq'::regclass); -- -- Name: id; Type: DEFAULT; Schema: public; Owner: collins -- ALTER TABLE ONLY stylists ALTER COLUMN id SET DEFAULT nextval('stylists_id_seq'::regclass); -- -- Data for Name: clients; Type: TABLE DATA; Schema: public; Owner: collins -- COPY clients (id, name, stylistid) FROM stdin; 4 king 2 5 vivo 1 8 muru njau 3 2 njau 2 9 leah lopez 1 \. -- -- Name: clients_id_seq; Type: SEQUENCE SET; Schema: public; Owner: collins -- SELECT pg_catalog.setval('clients_id_seq', 9, true); -- -- Data for Name: stylists; Type: TABLE DATA; Schema: public; Owner: collins -- COPY stylists (id, name) FROM stdin; 1 CODE GARAGE 2 night vision 3 TwitterMaster \. -- -- Name: stylists_id_seq; Type: SEQUENCE SET; Schema: public; Owner: collins -- SELECT pg_catalog.setval('stylists_id_seq', 3, true); -- -- Name: clients_pkey; Type: CONSTRAINT; Schema: public; Owner: collins -- ALTER TABLE ONLY clients ADD CONSTRAINT clients_pkey PRIMARY KEY (id); -- -- Name: stylists_pkey; Type: CONSTRAINT; Schema: public; Owner: collins -- ALTER TABLE ONLY stylists ADD CONSTRAINT stylists_pkey PRIMARY KEY (id); -- -- Name: public; Type: ACL; Schema: -; Owner: postgres -- REVOKE ALL ON SCHEMA public FROM PUBLIC; REVOKE ALL ON SCHEMA public FROM postgres; GRANT ALL ON SCHEMA public TO postgres; GRANT ALL ON SCHEMA public TO PUBLIC; -- -- PostgreSQL database dump complete --
-- link: https://leetcode.com/problems/employees-earning-more-than-their-managers/description/ -- The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. -- Given the Employee table, write a SQL query that finds out employees who earn more than their managers. For the above table, Joe is the only employee who earns more than his manager. SELECT E1.Name as Employee FROM Employee as E1, Employee as E2 where E1.ManagerId = E2.Id and E1.Salary > E2.Salary;
SELECT sum(s) FROM (SELECT y AS s FROM remote('127.0.0.{1,2}', test, big_array) ARRAY JOIN x AS y); DROP TABLE test.big_array;
-- CLTPHP SQL Backup -- Time:2017-04-05 14:51:47 -- http://www.cltphp.com -- -- 表的结构 `clt_ad` -- DROP TABLE IF EXISTS `clt_ad`; CREATE TABLE `clt_ad` ( `ad_id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL DEFAULT '' COMMENT '广告名称', `type_id` tinyint(5) NOT NULL COMMENT '所属位置', `pic` varchar(200) NOT NULL DEFAULT '' COMMENT '广告图片URL', `url` varchar(200) NOT NULL DEFAULT '' COMMENT '广告链接', `addtime` int(11) NOT NULL COMMENT '添加时间', `sort` int(11) NOT NULL COMMENT '排序', `open` tinyint(2) NOT NULL COMMENT '1=审核 0=未审核', PRIMARY KEY (`ad_id`), KEY `plug_ad_adtypeid` (`type_id`) ) ENGINE=MyISAM AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; -- -- 导出`clt_ad`表中的数据 `clt_ad` -- INSERT INTO `clt_ad` VALUES (15,'如何优雅的装饰客厅',1,'/uploads/20170223/6f728d80d0b9f26bfefafe49d5d99c2b.jpg','',1480909037,1,1); INSERT INTO `clt_ad` VALUES (16,'内页横幅',5,'/uploads/20161212/9000ba8250cccd2be494d4241c56afe2.jpg','',1480909132,50,1); INSERT INTO `clt_ad` VALUES (17,'如何优雅的装饰客厅01',1,'http://bpic.588ku.com/back_pic/03/71/89/8657b8591f90b53.jpg','',1481788850,2,1); INSERT INTO `clt_ad` VALUES (18,'如何优雅的装饰客厅02',1,'/uploads/20161215/08d9c6acbdc8035815acd3bb9acb3b49.jpg','',1481788869,3,1); INSERT INTO `clt_ad` VALUES (19,'如何优雅的装饰客厅03',1,'/uploads/20161215/08d9c6acbdc8035815acd3bb9acb3b49.jpg','',1481789413,50,1); -- -- 表的结构 `clt_ad_type` -- DROP TABLE IF EXISTS `clt_ad_type`; CREATE TABLE `clt_ad_type` ( `type_id` tinyint(5) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL DEFAULT '' COMMENT '广告位名称', `sort` int(11) NOT NULL COMMENT '广告位排序', PRIMARY KEY (`type_id`) ) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; -- -- 导出`clt_ad_type`表中的数据 `clt_ad_type` -- INSERT INTO `clt_ad_type` VALUES (1,'顶部轮播',1); INSERT INTO `clt_ad_type` VALUES (5,'内页横幅',2); -- -- 表的结构 `clt_admin` -- DROP TABLE IF EXISTS `clt_admin`; CREATE TABLE `clt_admin` ( `admin_id` tinyint(4) NOT NULL AUTO_INCREMENT COMMENT '管理员ID', `username` varchar(20) NOT NULL COMMENT '管理员用户名', `pwd` varchar(70) NOT NULL COMMENT '管理员密码', `group_id` mediumint(8) DEFAULT NULL COMMENT '分组ID', `email` varchar(30) DEFAULT NULL COMMENT '邮箱', `realname` varchar(10) DEFAULT NULL COMMENT '真实姓名', `tel` varchar(30) DEFAULT NULL COMMENT '电话号码', `hits` int(8) NOT NULL DEFAULT '1' COMMENT '登陆次数', `ip` varchar(20) DEFAULT NULL COMMENT 'IP地址', `add_time` int(11) DEFAULT NULL COMMENT '添加时间', `mdemail` varchar(50) DEFAULT '0' COMMENT '传递修改密码参数加密', `is_open` tinyint(2) DEFAULT '0' COMMENT '审核状态', PRIMARY KEY (`admin_id`), KEY `admin_username` (`username`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; -- -- 导出`clt_admin`表中的数据 `clt_admin` -- INSERT INTO `clt_admin` VALUES (1,'admin','0192023a7bbd73250516f069df18b500',1,'1109305987@qq.com','','18792402229',74,'127.0.0.1',1482132862,'0',1);
-- MySQL dump 10.16 Distrib 10.1.7-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: simpleblog -- ------------------------------------------------------ -- Server version 10.1.7-MariaDB-1~trusty-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 `v1m_blog_post` -- DROP TABLE IF EXISTS `v1m_blog_post`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `v1m_blog_post` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(128) COLLATE utf8_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `text` longtext COLLATE utf8_unicode_ci, `published` tinyint(1) DEFAULT NULL, `created` datetime DEFAULT NULL, `updated` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `v1m_blog_post` -- LOCK TABLES `v1m_blog_post` WRITE; /*!40000 ALTER TABLE `v1m_blog_post` DISABLE KEYS */; INSERT INTO `v1m_blog_post` VALUES (1,'new1','New post #1','This is a new post #1',1,'2015-09-10 19:38:00','2015-09-11 17:47:39'),(3,'Test2','Test#2','kughuihuiohi',0,'2015-09-10 22:51:58','2015-09-10 22:52:36'),(4,'test3','This is a big big big test#3','the good big big big test 3',1,'2015-09-10 23:01:38','2015-09-11 17:20:08'); /*!40000 ALTER TABLE `v1m_blog_post` 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 2015-09-12 17:43:30
INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Beauxbatons','Tom','Riddle','5149834356','Tom@gmail.com','Hogwarts st.','London','ON','K0L1C1','c89636'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Durmastrang','Cedric','Diggory','5147368464','Cedric@gmail.ca','ave. Hogsmeade','London','ON','K7L3F2','c89263'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Hogwarts','Viktor','Krum','5148379702','Viktor@outlook.ca','Durmstrang st.','London','ON','K0M2F4','c89264'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Gryffindor','Ludo','Bagman','5148379475','Ludo@gmail.ca','Beauxbatons st.','London','ON','L0M2S3','c82836'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Slytherin','Charlie','Weasley','5140820000','Charlie@gmail.ca','Gringotts st.','Kingston','ON','L3B2D3','c78394'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Ravenclaw','Vernon','Dursley','5142879374','Vernon@outlook.com','Knockturn Alley','Kingston','ON','M4C1B5','c83974'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Hufflepuff','Dudley','Dursley','5140009274','Dudley@gmail.ca','Shreking Shack st.','Kingston','ON','N4S4H2','c89364'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Muggle','Lavender','Brown','5140028743','Lavender@gmail.ca','Zonko st.','Toronto','ON','M1J3X4','c78649'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Mysteries','Igor','Karkaroff','5142348743','Igor@outlook.com','Flourish st.','Toronto','ON','M8V3H4','c89734'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Floo','Padma','Patil','5149992345','Floo@gmail.ca','Blotts st.','Toronto','ON','L0M1E1','c77263'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Wizengamot','Seamus','Finnigan','5141112222','Seamus@gmail.ca','Azkaban st.','Ottawa','ON','N4S2W2','c66763'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Aurors','Dean','Thomas','5149283333','Dean@outlook.ca','Privit st.','Ottawa','ON','N5P7D8','c78374'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Runes','Ernie','Mcmillan','5149992342','Ernie@outlook.com','Ollivanders st.','Ottawa','ON','M1W4H4','c77223'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Quidditch','Lily','Potter','5145558888','Lily@gmail.ca','Eeylops st.','Ottawa','ON','M4C5S3','c90823'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Kings Cross','Hannah','Abbott','5143333456','Hannah@outlook.com','Emporium st.','Ottawa','ON','K1V8U8','c836423'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Leaky Cauldron','Milicent','Bulstrode','5142933746','Milicent@gmail.com','Hamilton st.','Quebec','QC','H9C1A0','c83645'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Madam Malkins Robes','Justin','Finch-Fletchley','5142838877','Justin@gmail.com','Monk st.','Montreal','QC','A6E3H4','c72632'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Borgin and Burkes','Colin','Creevey','5148273746','Colin@outlook.com','Saint Catherine st.','Montreal','QC','W3F1G3','c73642'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Honeydukes','James','Potter','5142943223','James@gmail.ca','Wellington st.','Montreal','QC','K0E3F3','c73643'); INSERT INTO Company(CompanyName , ContactFirstName , ContactLastName,ContactNumber , ContactEmail ,Street , City , Province ,PostalCode , PWD) VALUES ('Three Broomsticks','Lee','Jordan','5148822846','Lee@gmail.ca','Saint Laurence st.','Montreal','QC','E3C8I9','c63544'); select * from Company;
ALTER TABLE "public"."resume" DROP COLUMN "version_date";
# --- !Ups alter table users drop column if exists default_language; alter table users add column default_language_id bigint; alter table users add constraint fk_default_language_languages foreign key (default_language_id) references languages (id) on delete restrict on update restrict; create index ix_users_default_language on users (default_language_id); # --- !Downs alter table users add column default_language varchar(8) default 'eng'; alter table users drop column if exists default_language_id; alter table users drop constraint if exists fk_default_language_languages; drop index if exists ix_users_default_language;
ALTER TABLE `t_device_online` ADD COLUMN `intranetIp` varchar(30) COMMENT '内网IP' AFTER `status`; ALTER TABLE `t_device_mapping` ADD COLUMN `hostname` varchar(255) NULL AFTER `remote_port`; ALTER TABLE `t_device_mapping` ADD COLUMN `bind_tls` int(1) NULL AFTER `hostname`; ALTER TABLE `t_device_online` CHANGE COLUMN `deviceId` `deviceNo` varchar(255) NOT NULL COMMENT '设备编号'; ALTER TABLE `t_device_online` ADD COLUMN `mac_addr` varchar(20) COMMENT 'Mac地址' AFTER `intranetIp`; ALTER TABLE `t_device_online` CHANGE COLUMN `intranetIp` `intranetIp` varchar(100) DEFAULT NULL COMMENT '内网IP'; ALTER TABLE `t_device` ADD COLUMN `mac_addr` varchar(20) COMMENT 'mac地址' AFTER `intranetIp`; ALTER TABLE `t_device` CHANGE COLUMN `intranetIp` `intranet_ip` varchar(30) DEFAULT NULL COMMENT '内网IP'; ALTER TABLE `t_user` ADD COLUMN `icon` varchar(255) COMMENT '头像' AFTER `agree`; ALTER TABLE `t_device_mapping` ADD COLUMN `status` int COMMENT '映射状态 (1、启用;0、停用)' AFTER `tls_key`, AUTO_INCREMENT=6; update t_device_mapping set status = 1; -- 2019年11月17日 marker 新增基础认证 ALTER TABLE `t_device_mapping` ADD COLUMN `auth` varchar(100) COMMENT '基础认证' AFTER `status`; -- 2019年12月24日 marker 新增登录时间字段 ALTER TABLE `t_user` ADD COLUMN `loginTime` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '登录时间' AFTER `icon`; ALTER TABLE `t_user` ADD COLUMN `balance` decimal(10,2) DEFAULT 0 COMMENT '余额' AFTER `loginTime`; -- 2019年12月25日 marker 新增服务通道表 ALTER TABLE `t_device_mapping` ADD COLUMN `server_tunnel_id` bigint COMMENT '服务通道ID' AFTER `auth`; update t_device_mapping set server_tunnel_id = 1; -- 2020年1月14日 marker 新增domain_id ALTER TABLE `t_device_mapping` ADD COLUMN `domain_id` bigint COMMENT '域名ID' AFTER `server_tunnel_id`; -- 2020年1月15日 marker 新增设备通道 ALTER TABLE `t_device` ADD COLUMN `server_tunnel_id` bigint NOT NULL COMMENT '设备通道' AFTER `mac_addr`; -- 2020年3月17日 marker server_tunnel_id 设置默认值1 ALTER TABLE `t_device` CHANGE COLUMN `server_tunnel_id` `server_tunnel_id` bigint(20) NOT NULL DEFAULT 1 COMMENT '设备通道'; -- 2020年3月18日 marker 新注册的用户,创建时间默认 ALTER TABLE `t_sys_users` CHANGE COLUMN `created_time` `created_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', CHANGE COLUMN `updated_time` `updated_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '更新时间'; -- 2020年3月18日 marker 新增注册激活码 ALTER TABLE `t_sys_users` ADD COLUMN `activate_code` varchar(50) COMMENT '激活码' AFTER `updated_by`; -- 2020年6月25日 marker 新增设备秘钥,提高安全性 ALTER TABLE `t_device` ADD COLUMN `device_secret` varchar(100) NULL COMMENT '设备秘钥' AFTER `server_tunnel_id`; -- 2019年6月4日 (线上已更新)
/****** Object: StoredProcedure [dbo].[LocalErrorHandler] ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE [dbo].[LocalErrorHandler] /**************************************************** ** ** Desc: This procedure should be called from within a Try...Catch block ** It will generate an error description and optionally log the error ** It also returns the Error Severity and Error Number via output parameters ** ** Return values: 0: success, otherwise, error code ** ** Auth: mem ** Date: 11/30/2006 ** 01/03/2008 mem - Added parameter @duplicateEntryHoldoffHours ** 02/23/2016 mem - Add set XACT_ABORT on ** 04/12/2017 mem - Log exceptions to T_Log_Entries ** 03/15/2021 mem - Treat @errorNum as an input/output parameter ** *****************************************************/ ( @callingProcName varchar(128)='', -- Optionally provide the calling procedure name; if not provided then uses ERROR_PROCEDURE() @callingProcLocation varchar(128)='', -- Custom description of the location within the calling procedure within which the error occurred @logError tinyint = 0, -- Set to 1 to log the error in T_Log_Entries @displayError tinyint = 0, -- Set to 1 to display the error via SELECT @message @logWarningErrorList varchar(512) = '1205', -- Comma separated list of errors that should be treated as warnings if logging to T_Log_Entries @errorSeverity int=0 output, @errorNum int=0 output, @message varchar(512)='' output, -- Populated with a description of the error @duplicateEntryHoldoffHours int = 0 -- Set this to a value greater than 0 to prevent duplicate entries being posted within the given number of hours ) As Set XACT_ABORT, nocount on Declare @myRowCount int = 0 Declare @myError int = 0 Declare @currentLocation varchar(128) = 'Start' Declare @errorNumber int Declare @errorState int Declare @errorProc varchar(256) Declare @errorLine int Declare @errorMessage varchar(256) Declare @logErrorType varchar(64) Begin Try Set @currentLocation = 'Validating the inputs' -- Validate the inputs Set @callingProcName = IsNull(@callingProcName, '') Set @callingProcLocation = IsNull(@callingProcLocation, '') Set @logError = IsNull(@logError, 0) Set @displayError = IsNull(@displayError, 0) Set @errorSeverity = 0 Set @errorNum = IsNull(@errorNum, 0) Set @message = '' -- Lookup current error information Set @currentLocation = 'Populating the error tracking variables' SELECT @errorSeverity = IsNull(ERROR_SEVERITY(), 0), @errorNumber = IsNull(ERROR_NUMBER(), 0), @errorState = IsNull(ERROR_STATE(), 0), @errorProc = IsNull(ERROR_PROCEDURE(), ''), @errorLine = IsNull(ERROR_LINE(), 0), @errorMessage = IsNull(ERROR_MESSAGE(), '') -- Generate the error description Set @currentLocation = 'Generating the error description' If Len(IsNull(@errorProc, '')) = 0 Begin -- Update @errorProc using @callingProcName If len(@callingProcName) = 0 Set @callingProcName = 'Unknown Procedure' Set @errorProc = @callingProcName End -- Update @callingProcName using @errorProc (required for calling PostLogEntry) Set @callingProcName = @errorProc If @errorNumber = 0 And Len(@errorMessage) = 0 Begin If @errorNum <> 0 Set @message = 'Error encountered in ' + @errorProc + '; Error ' + Cast(@errorNum as varchar(12)) Else Set @message = 'No Error for ' + @errorProc End Else Begin Set @message = 'Error caught in ' + @errorProc If Len(@callingProcLocation) > 0 Set @message = @message + ' at "' + @callingProcLocation + '"' Set @message = @message + ': ' + @errorMessage + '; Severity ' + Cast(@errorSeverity as varchar(12)) + '; SQL Server Error ' + Cast(@errorNumber as varchar(12)) + '; Line ' + Cast(@errorLine as varchar(12)) If @errorNum = 0 Set @errorNum = @errorNumber Else Set @message = @message + '; Local error ' + Cast(@errorNum as varchar(12)) End If @logError <> 0 Begin Set @currentLocation = 'Examining @logWarningErrorList' If Exists (SELECT Value FROM dbo.udfParseDelimitedIntegerList(@logWarningErrorList, ',') WHERE Value = @errorNum) Set @logErrorType = 'Warning' Else Set @logErrorType = 'Error' Set @currentLocation = 'Calling PostLogEntry' execute PostLogEntry @logErrorType, @message, @callingProcName, @duplicateEntryHoldoffHours End If @displayError <> 0 SELECT @message as Error_Description End Try Begin Catch Set @message = 'Error ' + @currentLocation + ' in LocalErrorHandler: ' + IsNull(ERROR_MESSAGE(), '?') + '; Error ' + Cast(IsNull(ERROR_NUMBER(), 0) as varchar(12)) Set @myError = ERROR_NUMBER() SELECT @message as Error_Description Print @message Declare @postedBy varchar(128) = 'LocalErrorHandler (' + @callingProcName + ')' Exec PostLogEntry 'Error', @message, @postedBy End Catch RETURN @myError GO GRANT EXECUTE ON [dbo].[LocalErrorHandler] TO [DMS_SP_User] AS [dbo] GO GRANT EXECUTE ON [dbo].[LocalErrorHandler] TO [Mgr_Config_Admin] AS [dbo] GO
SET SEARCH_PATH TO armydb; INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1053,'2000-01-1','Argentina','Bersa'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1054,'2001-02-2','Australia','Boeing Australia'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1055,'2005-03-3','Austria','Steyr Mannlicher'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1056,'2002-04-4','Azerbaijan','MDI Azerbaijan'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1057,'2003-05-5','Bangladesh','Defence Advancement Trading Company (DATCO)'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1058,'2001-06-6','Belgium','Fabrique Nationale de Herstal'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1059,'2002-07-7','Bosnia and Herzegovina','Pretis dd'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1060,'2006-08-8','Brazil','Avibras'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1061,'2005-09-9','Bulgaria','TEREM'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1062,'2001-10-10','India','Hindustan Aeronautics Limited'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1063,'2000-11-11','Argentina','Bersa'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1064,'2003-12-12','Australia','Boeing Australia'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1065,'2005-1-13','Austria','Steyr Mannlicher'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1066,'2002-2-14','Azerbaijan','MDI Azerbaijan'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1067,'2001-3-15','Bangladesh','Defence Advancement Trading Company (DATCO)'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1068,'2004-4-16','Belgium','Fabrique Nationale de Herstal'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1069,'2003-5-17','Bosnia and Herzegovina','Pretis dd'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1070,'2006-6-18','Brazil','Avibras'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1071,'2002-7-19','Bulgaria','TEREM'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1072,'2000-8-20','India','Hindustan Aeronautics Limited'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1073,'2001-9-21','Argentina','Bersa'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1074,'2005-10-22','Australia','Boeing Australia'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1075,'2004-11-23','Austria','Steyr Mannlicher'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1076,'2006-12-24','Azerbaijan','MDI Azerbaijan'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1077,'2003-1-25','Bangladesh','Defence Advancement Trading Company (DATCO)'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1078,'2004-2-26','Belgium','Fabrique Nationale de Herstal'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1079,'2001-3-27','Bosnia and Herzegovina','Pretis dd'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1080,'2003-4-28','Brazil','Avibras'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1081,'2002-5-1','Bulgaria','TEREM'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1082,'2001-6-2','India','Hindustan Aeronautics Limited'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1083,'2006-7-3','India','Hindustan Aeronautics Limited'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1084,'2003-8-4','India','Hindustan Aeronautics Limited'); INSERT INTO "manufacturing_details" (weapon_id, manufacturing_date, manufacting_location, company_name) VALUES (1085,'2004-9-5','India','Hindustan Aeronautics Limited');
SELECT bands.name AS 'Band Name' FROM bands;
set client_encoding = 'utf-8'; set client_min_messages = warning; create extension if not exists pgtap; reset client_min_messages; begin; select plan(27); select has_materialized_view( 'swrs_transform', 'permit', 'swrs_transform.permit should be a materialized view' ); select has_index( 'swrs_transform', 'permit', 'ggircs_permit_primary_key', 'swrs_transform.permit should have a primary key' ); select columns_are('swrs_transform'::name, 'permit'::name, array[ 'id'::name, 'eccc_xml_file_id'::name, 'path_context'::name, 'permit_idx'::name, 'issuing_agency'::name, 'issuing_dept_agency_program'::name, 'permit_number'::name ]); select col_type_is( 'swrs_transform', 'permit', 'eccc_xml_file_id', 'integer', 'permit.eccc_xml_file_id column should be type integer'); select col_hasnt_default('swrs_transform', 'permit', 'eccc_xml_file_id', 'permit.eccc_xml_file_id column should not have a default value'); -- select has_column( 'swrs_transform', 'permit', 'path_context', 'permit.path_context column should exist'); select col_type_is( 'swrs_transform', 'permit', 'path_context', 'character varying(1000)', 'permit.path_context column should be type varchar'); select col_is_null( 'swrs_transform', 'permit', 'path_context', 'permit.path_context column should not allow null'); select col_hasnt_default('swrs_transform', 'permit', 'path_context', 'permit.path_context column should not have a default'); -- select has_column( 'swrs_transform', 'permit', 'permit_idx', 'permit.permit_idx column should exist'); select col_type_is( 'swrs_transform', 'permit', 'permit_idx', 'integer', 'permit.permit_idx column should be type integer'); select col_is_null( 'swrs_transform', 'permit', 'permit_idx', 'permit.permit_idx column should not allow null'); select col_hasnt_default('swrs_transform', 'permit', 'permit_idx', 'permit.permit_idx column should not have a default'); -- select has_column( 'swrs_transform', 'permit', 'issuing_agency', 'permit.issuing_agency column should exist'); select col_type_is( 'swrs_transform', 'permit', 'issuing_agency', 'character varying(1000)', 'permit.issuing_agency column should be type varchar'); select col_is_null( 'swrs_transform', 'permit', 'issuing_agency', 'permit.issuing_agency column should not allow null'); select col_hasnt_default('swrs_transform', 'permit', 'issuing_agency', 'permit.issuing_agency column should not have a default'); -- select has_column( 'swrs_transform', 'permit', 'issuing_dept_agency_program', 'permit.issuing_dept_agency_program column should exist'); select col_type_is( 'swrs_transform', 'permit', 'issuing_dept_agency_program', 'character varying(1000)', 'permit.issuing_dept_agency_program column should be type varchar'); select col_is_null( 'swrs_transform', 'permit', 'issuing_dept_agency_program', 'permit.issuing_dept_agency_program column should not allow null'); select col_hasnt_default('swrs_transform', 'permit', 'issuing_dept_agency_program', 'permit.issuing_dept_agency_program column should not have a default'); -- select has_column( 'swrs_transform', 'permit', 'permit_number', 'permit.permit_number column should exist'); select col_type_is( 'swrs_transform', 'permit', 'permit_number', 'character varying(1000)', 'permit.permit_number column should be type varchar'); select col_is_null( 'swrs_transform', 'permit', 'permit_number', 'permit.permit_number column should not allow null'); select col_hasnt_default('swrs_transform', 'permit', 'permit_number', 'permit.permit_number column should not have a default'); insert into swrs_extract.eccc_xml_file (xml_file) values ($$<ReportData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <RegistrationData> <Facility> <Identifiers> <Permits> <Permit> <IssuingAgency>BC Ministry of Environment</IssuingAgency> <IssuingDeptAgencyProgram>abc</IssuingDeptAgencyProgram> <PermitNumber>AB-12345</PermitNumber> </Permit> </Permits> </Identifiers> </Facility> </RegistrationData> <ReportDetails> <FacilityId>666</FacilityId> </ReportDetails> </ReportData> $$); refresh materialized view swrs_transform.facility with data; refresh materialized view swrs_transform.permit with data; select results_eq( $$ select facility.swrs_facility_id from swrs_transform.permit join swrs_transform.facility on permit.eccc_xml_file_id = facility.eccc_xml_file_id $$, 'select swrs_facility_id from swrs_transform.facility', 'Foreign key eccc_xml_file_id in ggircs_swrs_parent_facility references swrs_transform.facility' ); -- XML import tests select results_eq( 'select eccc_xml_file_id from swrs_transform.permit', 'select id from swrs_extract.eccc_xml_file', 'column eccc_xml_file_id in permit correctly parsed xml' ); select results_eq( 'select path_context from swrs_transform.permit', ARRAY['RegistrationData'::varchar], 'column path_context in permit correctly parsed xml' ); select results_eq( 'select permit_idx from swrs_transform.permit', ARRAY[0::integer], 'column permit_idx in permit correctly parsed xml' ); select results_eq( 'select issuing_agency from swrs_transform.permit', ARRAY['BC Ministry of Environment'::varchar], 'column issuing_agency in permit correctly parsed xml' ); select results_eq( 'select issuing_dept_agency_program from swrs_transform.permit', ARRAY['abc'::varchar], 'column issuing_dept_agency_program in permit correctly parsed xml' ); select results_eq( 'select permit_number from swrs_transform.permit', ARRAY['AB-12345'::varchar], 'column permit_number in permit correctly parsed xml' ); select * from finish(); rollback;
-- extract articles with named entities -- columns articleId, entity name, entity type name and article text SELECT pa.project_article_id AS 'id', et.name AS 'type', e.name AS 'name', REPLACE(CONCAT(a.title, ' ', a.body), '"', '\"') AS 'text' FROM `project_article` AS pa INNER JOIN `article` AS a ON pa.article_id = a.article_id INNER JOIN `article_entity` AS ae ON ae.article_id = a.article_id INNER JOIN `entity` AS e ON e.entity_id = ae.entity_id INNER JOIN `entity_type` AS et ON et.entity_type_id = e.entity_type_id WHERE pa.project_id = 14354
DROP TABLE IF EXISTS user_in_gist_information CASCADE; DROP TABLE IF EXISTS gist_content_information CASCADE; DROP TABLE IF EXISTS gist_information CASCADE;
-- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: admin_dev -- ------------------------------------------------------ -- Server version 10.1.26-MariaDB-0+deb9u1 /*!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 */; /*!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 */; DROP TABLE IF EXISTS `dbcondition_variables`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `dbcondition_variables` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id', `dbconditionid` bigint(20) unsigned NOT NULL COMMENT '用例Id', `dbconditionname` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin COMMENT '用例名', `variablesid` bigint(20) unsigned NOT NULL COMMENT '变量Id', `variablesname` varchar(64) CHARACTER SET utf8 COLLATE utf8_bin COMMENT '变量名', `memo` varchar(200) CHARACTER SET utf8 COLLATE utf8_bin COMMENT '备注', `create_time` datetime DEFAULT NOW() COMMENT '创建时间', `lastmodify_time` datetime DEFAULT NOW() COMMENT '上一次修改时间', PRIMARY KEY (`id`) ) ENGINE = InnoDB AUTO_INCREMENT = 4 DEFAULT CHARSET = utf8mb4 COMMENT ='数据库条件变量表';
-- dialect: PostgreSQL -- from running `psql -E` and entering \d <some table name> SELECT c.relchecks, c.relkind, c.relhasindex, c.relhasrules, c.relhastriggers, c.relrowsecurity, c.relforcerowsecurity, c.relhasoids, '', c.reltablespace, CASE WHEN c.reloftype = 0 THEN '' ELSE c.reloftype::pg_catalog.regtype::pg_catalog.text END, c.relpersistence, c.relreplident FROM pg_catalog.pg_class c LEFT JOIN pg_catalog.pg_class tc ON (c.reltoastrelid = tc.oid) WHERE c.oid = '49628'; SELECT a.attname, pg_catalog.format_type(a.atttypid, a.atttypmod), (SELECT substring(pg_catalog.pg_get_expr(d.adbin, d.adrelid) for 128) FROM pg_catalog.pg_attrdef d WHERE d.adrelid = a.attrelid AND d.adnum = a.attnum AND a.atthasdef), a.attnotnull, a.attnum, (SELECT c.collname FROM pg_catalog.pg_collation c, pg_catalog.pg_type t WHERE c.oid = a.attcollation AND t.oid = a.atttypid AND a.attcollation <> t.typcollation) AS attcollation, a.attidentity, NULL AS indexdef, NULL AS attfdwoptions FROM pg_catalog.pg_attribute a WHERE a.attrelid = '49628' AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum; SELECT inhparent::pg_catalog.regclass, pg_catalog.pg_get_expr(c.relpartbound, inhrelid) FROM pg_catalog.pg_class c JOIN pg_catalog.pg_inherits i ON c.oid = inhrelid WHERE c.oid = '49628' AND c.relispartition;
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Feb 22, 2021 at 09:31 AM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.0 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: `bk_db` -- -- -------------------------------------------------------- -- -- Table structure for table `guru` -- CREATE TABLE `guru` ( `id_guru` varchar(50) NOT NULL, `nama_guru` varchar(255) NOT NULL, `alamat` varchar(255) NOT NULL, `golongan` varchar(255) NOT NULL, `spesialis` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `guru` -- INSERT INTO `guru` (`id_guru`, `nama_guru`, `alamat`, `golongan`, `spesialis`) VALUES ('0011', 'Maria Ulfa S.,Ag', 'Jln. Sidodadi Bululawang, Malang', 'Honorer', 'Bimbingan Konseling'); -- -------------------------------------------------------- -- -- Table structure for table `kj` -- CREATE TABLE `kj` ( `id_KJ` varchar(50) NOT NULL, `nama_jurusan` varchar(25) NOT NULL, `Kelas` varchar(25) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `kj` -- INSERT INTO `kj` (`id_KJ`, `nama_jurusan`, `Kelas`) VALUES ('K_10_IPA', 'Ilmu Pengetahuan Alam', '10'), ('K_10_IPS', 'Ilmu Pengetahuan Sosial', '10'), ('K_11_IPA', 'Ilmu Pengetahuan Alam', '11'), ('K_11_IPS', 'Ilmu Pengetahuan Sosial', '11'), ('K_12_IPA', 'Ilmu Pengetahuan Alam', '12'), ('K_12_IPS', 'Ilmu Pengetahuan Sosial', '12'); -- -------------------------------------------------------- -- -- Table structure for table `konsultasi` -- CREATE TABLE `konsultasi` ( `id_konsultasi` int(11) NOT NULL, `id_siswa` varchar(50) NOT NULL, `id_perekapan` varchar(50) NOT NULL, `id_KJ` varchar(50) NOT NULL, `id_guru` int(50) NOT NULL, `kelas` varchar(50) NOT NULL, `nama_jurusan` varchar(50) NOT NULL, `tanggal` date NOT NULL, `catatan` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `konsultasi` -- INSERT INTO `konsultasi` (`id_konsultasi`, `id_siswa`, `id_perekapan`, `id_KJ`, `id_guru`, `kelas`, `nama_jurusan`, `tanggal`, `catatan`) VALUES (51, '200702', 'KP01', 'K_11_IPS', 11, '11', 'Ilmu Pengetahuan Sosial', '2021-02-22', ''), (52, '200702', 'KP01', 'K_10_IPS', 11, '10', 'Ilmu Pengetahuan Sosial', '2021-02-22', ''), (53, '200701', 'KP01', 'K_10_IPS', 11, '10', 'Ilmu Pengetahuan Sosial', '2021-02-22', ''); -- -------------------------------------------------------- -- -- Table structure for table `kp` -- CREATE TABLE `kp` ( `id_kp` varchar(11) NOT NULL, `tatib` varchar(50) NOT NULL, `bentuk_pelanggaran` varchar(255) NOT NULL, `bobot` varchar(255) NOT NULL, `keterangan` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `kp` -- INSERT INTO `kp` (`id_kp`, `tatib`, `bentuk_pelanggaran`, `bobot`, `keterangan`) VALUES ('1.1', 'PAKAIAN SERAGAM', 'Tidak mengenakan seragam sekolah yang telah ditentukan (pakaian, sepatu, dasi, kaos kaki, sabuk, topi, tali sepatu hitam/putih) ', '3', ''), ('1.2', 'PAKAIAN SERAGAM', 'Tidak mengenakan pakaian olah raga yang telah di tentukan', '5', ''), ('2.1', 'RAMBUT, KUKU, TATO, MAKE-UP', 'Berambut gondrong/tidak rapi bagi laki-laki', '5', ''), ('2.2', 'RAMBUT, KUKU, TATO, MAKE-UP', 'Memakai aksesori yang tidak mencerminkan pribadi siswa', '3', ''), ('2.3', 'RAMBUT, KUKU, TATO, MAKE-UP', 'Mengecat rambut ', '15', ''), ('2.4', 'RAMBUT, KUKU, TATO, MAKE-UP', 'Bertato', '15', ''), ('2.5', 'RAMBUT, KUKU, TATO, MAKE-UP', 'Berkuku panjang, mengecat kuku', '2', ''), ('2.6', 'RAMBUT, KUKU, TATO, MAKE-UP', 'Membawa perlengkapan make up', '2', ''), ('3.1', 'MASUK DAN PULANG SEKOLAH', 'Tidak masuk sekolah tanpa keterangan / dinyatakan alpha', '8', ''), ('3.2', 'MASUK DAN PULANG SEKOLAH', 'Tidak masuk sekolah dengan membuat surat keterangan palsu', '8', ''), ('3.3', 'MASUK DAN PULANG SEKOLAH', 'Meninggalkan pelajaran tertentu tanpa izin (bolos sekolah)', '10', ''), ('3.4', 'MASUK DAN PULANG SEKOLAH', 'Tidak mengikuti kegiatan ekstrakurikuler tanpa izin (bagi kelas X/XI/XII)', '2', ''), ('3.5', 'MASUK DAN PULANG SEKOLAH', 'Tidak mengikuti kegiatan jam tambahan tanpa izin ( bagi kelas XII )', '2', ''), ('3.6', 'MASUK DAN PULANG SEKOLAH', 'Berada di luar lingkungan sekolah tanpa izin pada saat jam pelajaran ', '2', ''), ('3.7', 'MASUK DAN PULANG SEKOLAH', 'Datang terlambat tanpa alasan yang bisa dipertanggung jawabkan', '3', ''), ('4.1', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Tidak melaksanakan piket kebersihan, ketertiban dan keindahan kelas', '5', ''), ('4.2', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Makan / minum didalam kelas saat pelajaran berlangsung tanpa izin guru', '3', ''), ('4.3', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Membuang sampah tidak pada tempatnya', '3', ''), ('4.4', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Mencuri / memalak di lingkungan sekolah', '40', ''), ('4.5', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Menggelapkan, memanipulasi, menyalah gunakan uang sekolah', '25', ''), ('4.6', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Membocorkan soal ulangan harian, UTS, PAS, PAT', '15', ''), ('4.7', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Mengikuti organisasi terlarang (ajaran sesat)', '50', ''), ('4.8', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Berangkat sekolah dan menerima informasi siswa yang bolos', '10', ''), ('4.9', 'KEBERSIHAN, KEDISIPLINAN, KETERTIBAN, KEHADIRAN', 'Membuat kegaduhan / keributan selama proses belajar mengajar', '10', ''), ('5.1', 'SOPAN SANTUN/PERGAULAN', 'Terbukti memfitnah atau mencemarkan nama baik', '30', ''), ('5.2', 'SOPAN SANTUN/PERGAULAN', 'Bertingkahlaku tidak sopan, melecehkan kepala sekolah, guru, staff tata usaha, dan siswa ', '40', ''), ('5.3', 'SOPAN SANTUN/PERGAULAN', 'Berkata kasar / tidak sopan, terhadap kepala sekolah, guru, staff tata usaha', '30', ''), ('5.4', 'SOPAN SANTUN/PERGAULAN', 'Memalsukan tanda tangan kepala sekolah, guru, staff tata usaha', '75', ''), ('5.5', 'SOPAN SANTUN/PERGAULAN', 'Memalsukan tanda tangan orang tua', '20', ''), ('6.1', 'UPACARA BENDERA DAN PERINGATAN HARI BESAR', 'Tidak mengikuti upacara bendera (hari senin) sesuai ketentuan sekolah', '5', ''), ('6.2', 'UPACARA BENDERA DAN PERINGATAN HARI BESAR', 'Tidak mengikuti upacara hari besar nasional (hari kemerdekaan, hardiknas, hari pahlawan, hari sumpah pemuda, dll)', '15', ''), ('6.3', 'UPACARA BENDERA DAN PERINGATAN HARI BESAR', 'Tidak mengikuti upacara hari besar keagamaan', '15', ''), ('7.1', 'KEGIATAN KEAGAMAAN', 'Mempermainkan, melecehkan agama, baik agama sendiri/orang lain', '20', ''), ('7.2', 'KEGIATAN KEAGAMAAN', 'Tidak menjalankan sholat dhuhur (siswa muslim)', '10', ''), ('7.3', 'KEGIATAN KEAGAMAAN', 'Tidak mengikuti kegiatan dan pesantren ramadhan yang diadakan disekolah (siswa muslim)', '20', ''), ('7.4', 'KEGIATAN KEAGAMAAN', 'Bagi siswa muslim tidak mengikuti kegiatan keagamaan yang diatur oleh sekolah (tahfidz)', '15', ''), ('8.01', 'LARANGAN-LARANGAN', 'Membawa rokok, merokok di sekolah/lingkungan sekolah', '25', ''), ('8.02', 'LARANGAN-LARANGAN', 'Membawa / meminum minuman keras', '75', ''), ('8.03', 'LARANGAN-LARANGAN', 'Mengedarkan dan mengkonsumsi narkotika, psikotropika atau obat terlarang lainnya', '150', ''), ('8.04', 'LARANGAN-LARANGAN', 'Berlaku tidak senonoh di lingkungan sekolah', '50', ''), ('8.05', 'LARANGAN-LARANGAN', 'Berkelahi baik perorangan / kelompok di dalam sekolah / luar sekolah', '70', ''), ('8.06', 'LARANGAN-LARANGAN', 'Mengotori / mencoret-coret dinding sekolah, pagar sekolah, dll', '15', ''), ('8.07', 'LARANGAN-LARANGAN', 'Berbicara kotor, mengumpat, bergunjing, menghina, menyapa antar sesama / warga sekolah dengan kata-kata sapaan senonoh', '15', ''), ('8.08', 'LARANGAN-LARANGAN', 'Membawa barang yang tidak ada hubungan dengan kepentingan sekolah seperti senjata tajam atau alat-alat yang membahayakan orang lain', '50', ''), ('8.09', 'LARANGAN-LARANGAN', 'Membawa, membaca / mengedarkan bacaan, gambar, sketsa, video porno', '50', ''), ('8.10', 'LARANGAN-LARANGAN', 'Menikah / hamil', '150', ''), ('8.11', 'LARANGAN-LARANGAN', 'Membawa kartu dan bermain di lingkungan sekolah', '20', ''), ('8.12', 'LARANGAN-LARANGAN', 'Membawa alat komunikasi hp di perbolehkan, tetapi ketika jam belajar tidak dimatikan dan mengganggu proses belajar-mengajar', '20', ''); -- -------------------------------------------------------- -- -- Table structure for table `pelanggaran` -- CREATE TABLE `pelanggaran` ( `id_pelanggaran` int(20) NOT NULL, `id_siswa` varchar(50) NOT NULL, `id_KJ` varchar(50) NOT NULL, `id_guru` varchar(50) NOT NULL, `kelas` varchar(50) NOT NULL, `nama_jurusan` varchar(50) NOT NULL, `id_kp` varchar(20) NOT NULL, `id_perekapan` varchar(50) NOT NULL, `tanggal` date NOT NULL, `catatan` text DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `pelanggaran` -- INSERT INTO `pelanggaran` (`id_pelanggaran`, `id_siswa`, `id_KJ`, `id_guru`, `kelas`, `nama_jurusan`, `id_kp`, `id_perekapan`, `tanggal`, `catatan`) VALUES (6, '200702', 'K_10_IPA', '0011', '10', 'Ilmu Pengetahuan Alam', '4.2', 'KP01', '2021-02-22', ''); -- -------------------------------------------------------- -- -- Table structure for table `perekapan` -- CREATE TABLE `perekapan` ( `id_perekapan` varchar(50) NOT NULL, `thn_ajaran` varchar(50) NOT NULL, `semester` varchar(50) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `perekapan` -- INSERT INTO `perekapan` (`id_perekapan`, `thn_ajaran`, `semester`) VALUES ('KP01', '2020-2021', 'Ganjil'), ('KP02', '2020-2021', 'Genap'); -- -------------------------------------------------------- -- -- Table structure for table `siswa` -- CREATE TABLE `siswa` ( `id_siswa` varchar(50) NOT NULL, `id_KJ` varchar(255) NOT NULL, `nilai_raport` varchar(255) DEFAULT NULL, `nama_siswa` varchar(255) NOT NULL, `password` varchar(50) NOT NULL, `jenis_kelamin` varchar(50) NOT NULL, `alamat` varchar(255) NOT NULL, `nohp` varchar(25) NOT NULL, `ttl` date NOT NULL, `tempat_lahir` varchar(50) NOT NULL, `tinggal` varchar(50) DEFAULT NULL, `hoby` varchar(50) DEFAULT NULL, `prestasi` varchar(255) DEFAULT NULL, `cita_cita` varchar(255) DEFAULT NULL, `nama_ayah` varchar(50) DEFAULT NULL, `password_ortu` varchar(50) NOT NULL, `nama_ibu` varchar(50) DEFAULT NULL, `alamat_ortu` varchar(255) DEFAULT NULL, `pekerjaan_ayah` varchar(50) DEFAULT NULL, `pendidikan_ayah` varchar(50) DEFAULT NULL, `nohp_ayah` varchar(20) DEFAULT NULL, `pekerjaan_ibu` varchar(50) DEFAULT NULL, `pendidikan_ibu` varchar(50) DEFAULT NULL, `nohp_ibu` varchar(25) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `siswa` -- INSERT INTO `siswa` (`id_siswa`, `id_KJ`, `nilai_raport`, `nama_siswa`, `password`, `jenis_kelamin`, `alamat`, `nohp`, `ttl`, `tempat_lahir`, `tinggal`, `hoby`, `prestasi`, `cita_cita`, `nama_ayah`, `password_ortu`, `nama_ibu`, `alamat_ortu`, `pekerjaan_ayah`, `pendidikan_ayah`, `nohp_ayah`, `pekerjaan_ibu`, `pendidikan_ibu`, `nohp_ibu`) VALUES ('200701', 'K_10_IPA', '30', 'ahmad', '123', 'Laki-Laki', 'jl.kauman 2 margoyoso kec.Kalinyamatan kab.Jepara', '082230183334', '1999-12-03', 'malang', '', '', '', NULL, 'ibnu', '123', '', '', '', '', '', '', '', ''), ('200702', 'K_10_IPA', '', 'Amliana Adui', '200702', 'Perempuan', '', '', '2021-02-22', 'malang', '', '', '', NULL, '', '200702', '', '', '', '', '', '', '', ''); -- -------------------------------------------------------- -- -- Table structure for table `tabel_sanksi` -- CREATE TABLE `tabel_sanksi` ( `id_sanksi` int(11) NOT NULL, `jenis_sanksi` varchar(255) NOT NULL, `poin_sanksi` int(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tabel_sanksi` -- INSERT INTO `tabel_sanksi` (`id_sanksi`, `jenis_sanksi`, `poin_sanksi`) VALUES (5, 'Peringatan tertulis dan teguran oleh Wali Kelas / Guru BK', 30), (6, 'Pembinaan (I) Pernyataan tertulis (1) Panggilan Orangtua (1)', 50), (8, 'Pembinaan (II) Pernyataan tertulis (2) diketahui oleh waka Kesiswaan', 70), (9, 'Pembinaan (III) Pernyataan tertulis (3) Panggilan Orangtua (2)', 90), (10, 'Pembinaan (IV) Pernyataan tertulis (4) Panggilan Orangtua (3)', 110), (11, 'Pembinaan (V) Pernyataan tertulis (5) Panggilan Orangtua (4) diketahui oleh wali kelas, Guru BK, Waka Kesiswaan', 130), (12, 'Dikembalikan Kepada Orang tua/wali siswa (dikeluarkan dengan tidak hormat)', 150), (13, 'Skorsing 1 hari + diberikan sanksi tugas dari sekolah', 60), (14, 'Skorsing 2 hari + diberikan sanksi tugas dari sekolah', 80), (15, 'Skorsing 3 hari + diberikan sanksi tugas dari sekolah', 120); -- -------------------------------------------------------- -- -- Table structure for table `tabel_user` -- CREATE TABLE `tabel_user` ( `id_user` int(11) NOT NULL, `Username` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `level` enum('admin','user') NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `tabel_user` -- INSERT INTO `tabel_user` (`id_user`, `Username`, `password`, `level`) VALUES (1, 'admin', 'admin', 'admin'), (2, 'Kepala Sekolah', 'kepsek123', 'user'), (9, 'Kesiswaan', '123', 'user'); -- -------------------------------------------------------- -- -- Table structure for table `tabel_walikelas` -- CREATE TABLE `tabel_walikelas` ( `id_walikelas` int(50) NOT NULL, `nip` varchar(50) CHARACTER SET latin1 NOT NULL, `id_KJ` varchar(50) CHARACTER SET latin1 NOT NULL, `nama_walikelas` varchar(50) CHARACTER SET latin1 NOT NULL, `password` varchar(50) CHARACTER SET latin1 NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- -- Dumping data for table `tabel_walikelas` -- INSERT INTO `tabel_walikelas` (`id_walikelas`, `nip`, `id_KJ`, `nama_walikelas`, `password`) VALUES (1, '02151', 'K_10_IPA', 'daus', 'ganti'); -- -- Indexes for dumped tables -- -- -- Indexes for table `guru` -- ALTER TABLE `guru` ADD PRIMARY KEY (`id_guru`); -- -- Indexes for table `kj` -- ALTER TABLE `kj` ADD PRIMARY KEY (`id_KJ`); -- -- Indexes for table `konsultasi` -- ALTER TABLE `konsultasi` ADD PRIMARY KEY (`id_konsultasi`), ADD KEY `id_perekapan` (`id_perekapan`) USING BTREE, ADD KEY `id_KJ` (`id_KJ`), ADD KEY `id_guru` (`id_guru`), ADD KEY `id_siswa` (`id_siswa`); -- -- Indexes for table `kp` -- ALTER TABLE `kp` ADD PRIMARY KEY (`id_kp`); -- -- Indexes for table `pelanggaran` -- ALTER TABLE `pelanggaran` ADD PRIMARY KEY (`id_pelanggaran`), ADD KEY `id_kp` (`id_kp`) USING BTREE, ADD KEY `id_perekapan` (`id_perekapan`) USING BTREE, ADD KEY `id_KJ` (`id_KJ`), ADD KEY `id_siswa` (`id_siswa`), ADD KEY `id_guru` (`id_guru`); -- -- Indexes for table `perekapan` -- ALTER TABLE `perekapan` ADD PRIMARY KEY (`id_perekapan`); -- -- Indexes for table `siswa` -- ALTER TABLE `siswa` ADD PRIMARY KEY (`id_siswa`), ADD KEY `id_KJ` (`id_KJ`); -- -- Indexes for table `tabel_sanksi` -- ALTER TABLE `tabel_sanksi` ADD PRIMARY KEY (`id_sanksi`); -- -- Indexes for table `tabel_user` -- ALTER TABLE `tabel_user` ADD PRIMARY KEY (`id_user`); -- -- Indexes for table `tabel_walikelas` -- ALTER TABLE `tabel_walikelas` ADD PRIMARY KEY (`id_walikelas`), ADD KEY `id_KJ` (`id_KJ`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `konsultasi` -- ALTER TABLE `konsultasi` MODIFY `id_konsultasi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54; -- -- AUTO_INCREMENT for table `pelanggaran` -- ALTER TABLE `pelanggaran` MODIFY `id_pelanggaran` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `tabel_sanksi` -- ALTER TABLE `tabel_sanksi` MODIFY `id_sanksi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16; -- -- AUTO_INCREMENT for table `tabel_user` -- ALTER TABLE `tabel_user` MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10; -- -- AUTO_INCREMENT for table `tabel_walikelas` -- ALTER TABLE `tabel_walikelas` MODIFY `id_walikelas` int(50) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- Constraints for dumped tables -- -- -- Constraints for table `konsultasi` -- ALTER TABLE `konsultasi` ADD CONSTRAINT `konsultasi_ibfk_3` FOREIGN KEY (`id_perekapan`) REFERENCES `perekapan` (`id_perekapan`); -- -- Constraints for table `pelanggaran` -- ALTER TABLE `pelanggaran` ADD CONSTRAINT `pelanggaran_ibfk_3` FOREIGN KEY (`id_kp`) REFERENCES `kp` (`id_kp`), ADD CONSTRAINT `pelanggaran_ibfk_4` FOREIGN KEY (`id_perekapan`) REFERENCES `perekapan` (`id_perekapan`), ADD CONSTRAINT `pelanggaran_ibfk_7` FOREIGN KEY (`id_KJ`) REFERENCES `kj` (`id_KJ`), ADD CONSTRAINT `pelanggaran_ibfk_9` FOREIGN KEY (`id_guru`) REFERENCES `guru` (`id_guru`); -- -- Constraints for table `siswa` -- ALTER TABLE `siswa` ADD CONSTRAINT `siswa_ibfk_1` FOREIGN KEY (`id_KJ`) REFERENCES `kj` (`id_KJ`) ON DELETE CASCADE ON UPDATE CASCADE; -- -- Constraints for table `tabel_walikelas` -- ALTER TABLE `tabel_walikelas` ADD CONSTRAINT `tabel_walikelas_ibfk_1` FOREIGN KEY (`id_KJ`) REFERENCES `kj` (`id_KJ`); 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 */;
/* MySQL Data Transfer Source Host: localhost Source Database: pos Target Host: localhost Target Database: pos Date: 23/02/2021 13:03:18 */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for barang -- ---------------------------- CREATE TABLE `barang` ( `kode_barang` varchar(20) NOT NULL, `nama_barang` varchar(200) DEFAULT NULL, `harga` double NOT NULL, `satuan` varchar(20) DEFAULT NULL, `stok` double NOT NULL, PRIMARY KEY (`kode_barang`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -- ---------------------------- -- Records -- ---------------------------- INSERT INTO `barang` VALUES ('1', 'Aqua', '2000', '250 ml', '200'); INSERT INTO `barang` VALUES ('2', 'Coca-cola', '3500', '250 ml', '150'); INSERT INTO `barang` VALUES ('3', 'Pocari Sweat', '5000', '450 ml', '250');
-- USER is a reserved keyword with Postgres -- You must use double quotes in every query that user is in: -- ex. SELECT * FROM "user"; -- Otherwise you will have errors! CREATE TABLE "Users" ( "id" serial PRIMARY KEY, "email" VARCHAR(255) NOT NULL, "name" VARCHAR(255), -- should be NOT NULL in future "password" VARCHAR(255), "authLevel" VARCHAR(255) DEFAULT 'advertiser', -- should be NOT NULL in future "contactPreference" VARCHAR(255), "acceptAchPayment" BOOLEAN, "companyName" VARCHAR(255), "doNotDisturb" BOOLEAN, "isActive" BOOLEAN DEFAULT true, "advertiserUrl" VARCHAR(255), "address" VARCHAR(255), "primaryName" VARCHAR(255), "primaryTitle" VARCHAR(255), "primaryEmail" VARCHAR(255), "primaryDirectPhone" VARCHAR(50), "primaryMobilePhone" VARCHAR(50), "secondaryName" VARCHAR(255), "secondaryTitle" VARCHAR(255), "secondaryEmail" VARCHAR(255), "secondaryDirectPhone" VARCHAR(50), "secondaryMobilePhone" VARCHAR(50), "notes" VARCHAR(512), "inviteCode" VARCHAR(255) ); CREATE TABLE "AdSize" ( "id" SERIAL PRIMARY KEY, "adType" VARCHAR(255) NOT NULL, "columns" INT NOT NULL, "inches" INT NOT NULL, "image" VARCHAR(255) NOT NULL ); CREATE TABLE "Sponsorship" ( "id" SERIAL PRIMARY KEY, "isSponsored" BOOLEAN NOT NULL, "sponsorshipPrice" DECIMAL NOT NULL ); CREATE TABLE "Color" ( "id" SERIAL PRIMARY KEY, "colorType" VARCHAR(255) NOT NULL, "colorPrice" DECIMAL NOT NULL ); CREATE TABLE "Rates" ( "id" SERIAL PRIMARY KEY, "rateName" VARCHAR(255) NOT NULL, "isLessThanEight" BOOLEAN, "isEightToTwelve" BOOLEAN, "isTwelveToTwenty" BOOLEAN, "isTwentyPlus" BOOLEAN, "minDuration" INT NOT NULL, "maxDuration" INT NOT NULL ); CREATE TABLE "Contracts" ( "id" SERIAL PRIMARY KEY, "adSizeId" INT REFERENCES "AdSize", "adInstructions" VARCHAR(255), "sponsorshipId" INT REFERENCES "Sponsorship", "notes" VARCHAR(512), "startMonth" DATE, "commissionPercentage" INT, "colorId" INT REFERENCES "Color", "contractType" VARCHAR(255), "calculatedBill" DECIMAL, "actualBill" DECIMAL, "page" INT, "holidayGuide" DECIMAL, -- Stretch, probably just rate schema reference "isApproved" BOOLEAN, "pricingSchemaId" INT REFERENCES "Rates", "months" INT NOT NULL ); CREATE TABLE "Images" ( "id" SERIAL PRIMARY KEY, "imageUrl" VARCHAR(1024) NOT NULL, "contractId" INT REFERENCES "Contracts" ); -- CREATE TABLE "Invites" ( -- "id" SERIAL PRIMARY KEY, -- "email" VARCHAR(255) NOT NULL, -- "inviteCode" VARCHAR(255) NOT NULL, -- -- "authLevel" VARCHAR(255) NOT NULL, -- "userId" INT REFERENCES "Users" -- ); CREATE TABLE "Chat" ( "id" SERIAL PRIMARY KEY, "message" VARCHAR(5000) NOT NULL, "timeStamp" TIMESTAMP DEFAULT CURRENT_TIMESTAMP, "userId" INT REFERENCES "Users", "contractId" INT REFERENCES "Contracts" ); CREATE TABLE "Contracts_Users" ( "id" SERIAL PRIMARY KEY, "contractId" INT REFERENCES "Contracts", "userId" INT REFERENCES "Users" ); CREATE TABLE "MiscRates" ( "id" SERIAL PRIMARY KEY, "miscRateName" VARCHAR(255) NOT NULL, "ratePrice" DECIMAL NOT NULL );
/*L Copyright SAIC Distributed under the OSI-approved BSD 3-Clause License. See http://ncip.github.com/cabio/LICENSE.txt for details. L*/ DROP TABLE KEYWORD; DROP TABLE STG_KEYWORD; DROP TABLE STG_KEYWORD_AGG; -- Staging table for keywords, truncated before processing each class CREATE TABLE STG_KEYWORD ( SCORE NUMBER, VALUE VARCHAR2(512) ) TABLESPACE CABIO_FUT; -- Aggregated staging table for keywords across all types. Scores are -- inversed (i.e. 1 is the best possible score). CREATE TABLE STG_KEYWORD_AGG ( SCORE NUMBER NOT NULL, VALUE VARCHAR2(512) NOT NULL, TYPE VARCHAR2(255) NOT NULL ) TABLESPACE CABIO_FUT; -- User table with normal scoring (0 is the worst score). Scores are -- combined across classes, so TYPE no longer makes sense, since any -- given keyword may come from multipe types. CREATE TABLE KEYWORD ( ID NUMBER NOT NULL, SCORE NUMBER NOT NULL, VALUE VARCHAR2(512) NOT NULL ) TABLESPACE CABIO_FUT; ALTER TABLE KEYWORD ADD CONSTRAINT PK_KEYWORD PRIMARY KEY (ID) using index tablespace CABIO_FUT;
{% macro get_user_columns() %} {% set columns = [ {"name": "company", "datatype": dbt_utils.type_string()}, {"name": "id", "datatype": dbt_utils.type_int()}, {"name": "login", "datatype": dbt_utils.type_string()}, {"name": "name", "datatype": dbt_utils.type_string()} ] %} {{ return(columns) }} {% endmacro %}
/* Select returns detailed concurent program information from concurrent request id */ accept Enter_request_id prompt 'Please enter request_id : '; SELECT cr.request_id, re.responsibility_key AS RESPONSIBILITY, us.user_name, us.description, us.email_address , cp.concurrent_program_name AS Concurrent_program_short_name, cp.user_concurrent_program_name AS concurrent_program_name, fa.application_short_name, fa.application_name --,rg.request_group_name, -- cr.* FROM apps.fnd_concurrent_requests cr, apps.fnd_responsibility re, apps.fnd_user us , apps.fnd_concurrent_programs_vl cp, apps.fnd_application_vl fa --,apps.fnd_request_group_units rgu , --apps.fnd_request_groups rg WHERE 1 = 1 AND re.responsibility_id = cr.responsibility_id AND cr.requested_by = us.user_id AND cp.concurrent_program_id = cr.concurrent_program_id AND cr.program_application_id = fa.application_id --AND rg.request_group_id = rgu.request_group_id --AND rgu.request_unit_id = cr.concurrent_program_id AND cr.request_id = '&Enter_request_id'; /
GRANT EXECUTE ON FUNCTION pg_stat_statements_reset TO citus WITH GRANT OPTION; GRANT EXECUTE ON FUNCTION citus_stat_statements_reset TO citus WITH GRANT OPTION;
-- This SQL code was generated by sklearn2sql (development version). -- Copyright 2018 -- Model : CaretClassifier_svmPoly_pca -- Dataset : iris_date_tgt -- Database : db2 -- This SQL code can contain one or more statements, to be executed in the order they appear in this file. -- Model deployment code WITH "ADS_sca_1_OUT" AS (SELECT "ADS"."KEY" AS "KEY", (CAST("ADS"."Feature_0" AS DOUBLE) - 5.8475) / 0.8305068311812104 AS "Feature_0", (CAST("ADS"."Feature_1" AS DOUBLE) - 3.040833333333333) / 0.4410636176856331 AS "Feature_1", (CAST("ADS"."Feature_2" AS DOUBLE) - 3.8441666666666667) / 1.7181578875675667 AS "Feature_2", (CAST("ADS"."Feature_3" AS DOUBLE) - 1.245833333333333) / 0.7517929083403303 AS "Feature_3" FROM "IRIS_DATE_TGT" AS "ADS"), "ADS_pre_1_OUT" AS (SELECT "ADS_sca_1_OUT"."KEY" AS "KEY", "ADS_sca_1_OUT"."Feature_0" * -0.5263014514387969 + "ADS_sca_1_OUT"."Feature_1" * 0.2495430740050257 + "ADS_sca_1_OUT"."Feature_2" * -0.5822562654142306 + "ADS_sca_1_OUT"."Feature_3" * -0.5671972124538438 AS "PC1", "ADS_sca_1_OUT"."Feature_0" * 0.35797855187209515 + "ADS_sca_1_OUT"."Feature_1" * 0.9312088394674648 + "ADS_sca_1_OUT"."Feature_2" * 0.009350349831007576 + "ADS_sca_1_OUT"."Feature_3" * 0.06792661227568664 AS "PC2", "ADS_sca_1_OUT"."Feature_0" * 0.7268387018817979 + "ADS_sca_1_OUT"."Feature_1" * -0.2319858665682916 + "ADS_sca_1_OUT"."Feature_2" * -0.142090941958786 + "ADS_sca_1_OUT"."Feature_3" * -0.6306331924126783 AS "PC3", "ADS_sca_1_OUT"."Feature_0" * -0.2579993024404442 + "ADS_sca_1_OUT"."Feature_1" * 0.1294639302135427 + "ADS_sca_1_OUT"."Feature_2" * 0.8004376156560707 + "ADS_sca_1_OUT"."Feature_3" * -0.5253332981610163 AS "PC4" FROM "ADS_sca_1_OUT"), kernel_input_with_scaling AS (SELECT "ADS_pre_1_OUT"."KEY" AS "KEY", (CAST("ADS_pre_1_OUT"."PC1" AS DOUBLE) - 5.782411586589357e-20) / 1.7024643738506824 AS "PC1", (CAST("ADS_pre_1_OUT"."PC2" AS DOUBLE) - -4.1251724258728475e-16) / 0.9673313864403812 AS "PC2", (CAST("ADS_pre_1_OUT"."PC3" AS DOUBLE) - -9.830099697201907e-19) / 0.3786830074967196 AS "PC3", (CAST("ADS_pre_1_OUT"."PC4" AS DOUBLE) - -2.532696274926138e-17) / 0.1499474054786266 AS "PC4" FROM "ADS_pre_1_OUT"), "SV_data_1789-07-14T00:00:00.000000000" AS (SELECT "Values".sv_idx AS sv_idx, "Values".dual_coeff AS dual_coeff, "Values".sv_0 AS sv_0, "Values".sv_1 AS sv_1, "Values".sv_2 AS sv_2, "Values".sv_3 AS sv_3 FROM (SELECT 0 AS sv_idx, 0.03698239332241758 AS dual_coeff, -0.2290477843222614 AS sv_0, -0.4071901395685993 AS sv_1, 0.7640377136387312 AS sv_2, -0.762821332898633 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 1 AS sv_idx, -1.0 AS dual_coeff, 1.3197565542586798 AS sv_0, -0.4479333556302453 AS sv_1, 0.303715499171448 AS sv_2, 0.18731757446329592 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 2 AS sv_idx, -0.6225804683504559 AS dual_coeff, 1.3597383010881399 AS sv_0, 0.208529013752129 AS sv_1, -0.17848365845964853 AS sv_2, 1.70664291646024 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 3 AS sv_idx, -1.0 AS dual_coeff, 1.1216998823056528 AS sv_0, 0.1508448490733541 AS sv_1, 0.03287412337975043 AS sv_2, -1.130049254414846 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 4 AS sv_idx, 1.0 AS dual_coeff, 0.3311720803058076 AS sv_0, -1.5318646212571527 AS sv_1, -0.4689638276281063 AS sv_2, -1.4531968887381883 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS sv_idx, 0.0780436295325227 AS dual_coeff, -0.4766262633420692 AS sv_0, 0.5265311353535093 AS sv_1, 1.4251458952980132 AS sv_2, -0.6418671768968254 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS sv_idx, 0.8936004787998726 AS dual_coeff, -0.009184894451922408 AS sv_0, -0.1571262461630556 AS sv_1, -0.2603541692315079 AS sv_2, 1.5447730540364581 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS sv_idx, -0.24671964960617865 AS dual_coeff, 1.4419947262281017 AS sv_0, -1.0638122004046346 AS sv_1, -0.2992589914813187 AS sv_2, 0.00313214239519926 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS sv_idx, 0.24292564694509644 AS dual_coeff, -0.22490279064694457 AS sv_0, 0.8886339591253616 AS sv_1, -1.0741764680679287 AS sv_2, 0.7742770901490198 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS sv_idx, -0.4482531273784429 AS dual_coeff, 1.180964848290088 AS sv_0, -2.320024268056499 AS sv_1, 0.5655409729458527 AS sv_2, -2.155262249053796 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS sv_idx, 1.0 AS dual_coeff, 0.08585405084418343 AS sv_0, -1.0527780076245596 AS sv_1, 0.8911238859455795 AS sv_2, -0.4810347886657211 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 11 AS sv_idx, 0.0660010967351681 AS dual_coeff, -0.3959452341354214 AS sv_0, 0.6210143972545975 AS sv_1, 0.3495675779918653 AS sv_2, 0.020085504375629268 AS sv_3 FROM SYSIBM.SYSDUMMY1) AS "Values"), "kernel_dp_1789-07-14T00:00:00.000000000" AS (SELECT t."KEY" AS "KEY", t.dot_product AS dot_product FROM (SELECT full_join_data_sv."KEY" AS "KEY", sum(CAST(full_join_data_sv.dot_prod1 AS DOUBLE)) + 0.766486520398831 AS dot_product FROM (SELECT kernel_input_with_scaling."KEY" AS "KEY", "SV_data_1789-07-14T00:00:00.000000000".dual_coeff * power(0.1 * (kernel_input_with_scaling."PC1" * "SV_data_1789-07-14T00:00:00.000000000".sv_0 + kernel_input_with_scaling."PC2" * "SV_data_1789-07-14T00:00:00.000000000".sv_1 + kernel_input_with_scaling."PC3" * "SV_data_1789-07-14T00:00:00.000000000".sv_2 + kernel_input_with_scaling."PC4" * "SV_data_1789-07-14T00:00:00.000000000".sv_3) + 1.0, 3.0) AS dot_prod1 FROM kernel_input_with_scaling, "SV_data_1789-07-14T00:00:00.000000000") AS full_join_data_sv GROUP BY full_join_data_sv."KEY") AS t), "OVR_Score_1789-07-14T00:00:00.000000000" AS (SELECT "kernel_dp_1789-07-14T00:00:00.000000000"."KEY" AS "KEY_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Proba_1789-07-14T00:00:00.000000000", "kernel_dp_1789-07-14T00:00:00.000000000".dot_product AS "Score_1789-07-14T00:00:00.000000000" FROM "kernel_dp_1789-07-14T00:00:00.000000000"), "SV_data_1789-08-14T00:00:00.000000000" AS (SELECT "Values".sv_idx AS sv_idx, "Values".dual_coeff AS dual_coeff, "Values".sv_0 AS sv_0, "Values".sv_1 AS sv_1, "Values".sv_2 AS sv_2, "Values".sv_3 AS sv_3 FROM (SELECT 0 AS sv_idx, -0.41822897496453226 AS dual_coeff, 1.3197565542586795 AS sv_0, -0.4479333556302453 AS sv_1, 0.303715499171448 AS sv_2, 0.18731757446329592 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 1 AS sv_idx, -0.3868870267625282 AS dual_coeff, 1.35973830108814 AS sv_0, 0.208529013752129 AS sv_1, -0.17848365845964853 AS sv_2, 1.7066429164602397 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 2 AS sv_idx, -0.9212947737107436 AS dual_coeff, 1.121699882305653 AS sv_0, 0.15084484907335408 AS sv_1, 0.03287412337975043 AS sv_2, -1.130049254414846 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 3 AS sv_idx, 0.03678350139057858 AS dual_coeff, -1.0892525899862582 AS sv_0, 0.7036516642633818 AS sv_1, -0.2591383229856554 AS sv_2, -3.075509578911965 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 4 AS sv_idx, 0.5368577519433659 AS dual_coeff, -0.7374549682085079 AS sv_0, -0.484564324147251 AS sv_1, 0.06102961064041459 AS sv_2, -0.9067886174962738 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS sv_idx, 0.677038313930345 AS dual_coeff, -0.5061817232377643 AS sv_0, 0.035969749289692786 AS sv_1, -1.0271450483456157 AS sv_2, -0.008694495512959118 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS sv_idx, 0.4925658455874589 AS dual_coeff, -0.6110860518178179 AS sv_0, -0.29320221057887275 AS sv_1, 0.5430022756061417 AS sv_2, 1.3083799564314078 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS sv_idx, -0.0168346374139441 AS dual_coeff, 1.2923683459618376 AS sv_0, 1.2339206167555417 AS sv_1, -0.483760112293777 AS sv_2, 0.9361062325332176 AS sv_3 FROM SYSIBM.SYSDUMMY1) AS "Values"), "kernel_dp_1789-08-14T00:00:00.000000000" AS (SELECT t_1."KEY" AS "KEY", t_1.dot_product AS dot_product FROM (SELECT full_join_data_sv_1."KEY" AS "KEY", sum(CAST(full_join_data_sv_1.dot_prod1 AS DOUBLE)) + 0.352294275487715 AS dot_product FROM (SELECT kernel_input_with_scaling."KEY" AS "KEY", "SV_data_1789-08-14T00:00:00.000000000".dual_coeff * power(0.1 * (kernel_input_with_scaling."PC1" * "SV_data_1789-08-14T00:00:00.000000000".sv_0 + kernel_input_with_scaling."PC2" * "SV_data_1789-08-14T00:00:00.000000000".sv_1 + kernel_input_with_scaling."PC3" * "SV_data_1789-08-14T00:00:00.000000000".sv_2 + kernel_input_with_scaling."PC4" * "SV_data_1789-08-14T00:00:00.000000000".sv_3) + 1.0, 3.0) AS dot_prod1 FROM kernel_input_with_scaling, "SV_data_1789-08-14T00:00:00.000000000") AS full_join_data_sv_1 GROUP BY full_join_data_sv_1."KEY") AS t_1), "OVR_Score_1789-08-14T00:00:00.000000000" AS (SELECT "kernel_dp_1789-08-14T00:00:00.000000000"."KEY" AS "KEY_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Proba_1789-08-14T00:00:00.000000000", "kernel_dp_1789-08-14T00:00:00.000000000".dot_product AS "Score_1789-08-14T00:00:00.000000000" FROM "kernel_dp_1789-08-14T00:00:00.000000000"), "SV_data_1789-09-14T00:00:00.000000000" AS (SELECT "Values".sv_idx AS sv_idx, "Values".dual_coeff AS dual_coeff, "Values".sv_0 AS sv_0, "Values".sv_1 AS sv_1, "Values".sv_2 AS sv_2, "Values".sv_3 AS sv_3 FROM (SELECT 0 AS sv_idx, -1.0 AS dual_coeff, -0.3467508079212669 AS sv_0, -0.2119974770220477 AS sv_1, -0.15819006920484815 AS sv_2, 0.261524404362658 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 1 AS sv_idx, -1.0 AS dual_coeff, -0.10540702318024228 AS sv_0, -1.3293206464383127 AS sv_1, -0.20594023142806456 AS sv_2, -0.10703336828000429 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 2 AS sv_idx, 1.0 AS dual_coeff, -0.8605510005635174 AS sv_0, 0.27969751982132807 AS sv_1, -0.4019788850352463 AS sv_2, -0.733837732812117 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 3 AS sv_idx, 0.06291150636754685 AS dual_coeff, -0.6354658508918914 AS sv_0, -0.6968953111054446 AS sv_1, -1.359713424717213 AS sv_2, 0.2844487562226476 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 4 AS sv_idx, 1.0 AS dual_coeff, -0.5633103896390681 AS sv_0, 0.08109165235018401 AS sv_1, -0.8178736357731226 AS sv_2, 0.09481967641150019 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 5 AS sv_idx, -1.0 AS dual_coeff, -0.16462539018501227 AS sv_0, -0.17197653917801864 AS sv_1, -1.221524981126167 AS sv_2, 1.2859756100512512 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 6 AS sv_idx, -1.0 AS dual_coeff, -0.4096160387940097 AS sv_0, 0.8051788785127104 AS sv_1, -0.2856291778067481 AS sv_2, 0.5783778252567429 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 7 AS sv_idx, 0.7625756412115418 AS dual_coeff, -0.15885840159671633 AS sv_0, -1.556501926411469 AS sv_1, -2.587854078680349 AS sv_2, 0.825406561453712 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 8 AS sv_idx, -0.7362225494054027 AS dual_coeff, -0.1718725189412923 AS sv_0, -1.7658370524986495 AS sv_1, 0.0718484009342381 AS sv_2, -0.4985395211307865 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 9 AS sv_idx, 1.0 AS dual_coeff, -1.1319626242616307 AS sv_0, -0.7377801841458396 AS sv_1, 1.0667102114799558 AS sv_2, 0.669205438552054 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 10 AS sv_idx, -1.0 AS dual_coeff, 0.04831775178167375 AS sv_0, -1.0177043550349694 AS sv_1, -1.3767353921902683 AS sv_2, 0.1292949809373294 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 11 AS sv_idx, 1.0 AS dual_coeff, -0.7741800058650958 AS sv_0, 0.7156513391177087 AS sv_1, -0.6579287810350012 AS sv_2, -0.6530202842015935 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 12 AS sv_idx, 1.0 AS dual_coeff, -0.7374549682085078 AS sv_0, -0.4845643241472509 AS sv_1, 0.06102961064041459 AS sv_2, -0.9067886174962738 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 13 AS sv_idx, 0.3295253398129857 AS dual_coeff, -1.1252602242923606 AS sv_0, 1.0139489920759266 AS sv_1, 1.20632327016201 AS sv_2, 1.6249817204313048 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 14 AS sv_idx, 1.0 AS dual_coeff, -0.5286750525859466 AS sv_0, -0.006901806714972248 AS sv_1, -1.3237714063682993 AS sv_2, 1.130546149523611 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 15 AS sv_idx, -0.523079788483837 AS dual_coeff, -0.6538263780128066 AS sv_0, -1.6506862656401555 AS sv_1, 1.2762904419332939 AS sv_2, -1.52309619524668 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 16 AS sv_idx, 1.0 AS dual_coeff, -0.8103279650090582 AS sv_0, -0.044109810739219005 AS sv_1, -0.36963017625972133 AS sv_2, 1.6595384650363063 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 17 AS sv_idx, 1.0 AS dual_coeff, -0.5061817232377643 AS sv_0, 0.03596974928969279 AS sv_1, -1.0271450483456157 AS sv_2, -0.008694495512959118 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 18 AS sv_idx, 1.0 AS dual_coeff, -0.6110860518178179 AS sv_0, -0.29320221057887275 AS sv_1, 0.5430022756061417 AS sv_2, 1.3083799564314078 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 19 AS sv_idx, 1.0 AS dual_coeff, -0.8316360531190267 AS sv_0, 0.2627044381200628 AS sv_1, -0.024465458208240958 AS sv_2, 1.1302537725898394 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 20 AS sv_idx, 1.0 AS dual_coeff, -0.9791423086649674 AS sv_0, 1.0357441163212526 AS sv_1, -0.6871500354786788 AS sv_2, 0.5265032566931478 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 21 AS sv_idx, 0.43394558328621863 AS dual_coeff, -0.6354658508918914 AS sv_0, -0.6968953111054446 AS sv_1, -1.359713424717213 AS sv_2, 0.2844487562226476 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 22 AS sv_idx, 0.3390635615706725 AS dual_coeff, -1.0632832779220625 AS sv_0, 0.5576265704945415 AS sv_1, 1.9708190111640569 AS sv_2, 1.5441235517811938 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 23 AS sv_idx, -1.0 AS dual_coeff, -0.4024930600127821 AS sv_0, 0.42792683905349516 AS sv_1, -1.536043829642959 AS sv_2, 0.589986189653623 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 24 AS sv_idx, -0.9333457458230092 AS dual_coeff, -0.22490279064694454 AS sv_0, 0.8886339591253617 AS sv_1, -1.0741764680679287 AS sv_2, 0.7742770901490199 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 25 AS sv_idx, -1.0 AS dual_coeff, -0.5806584822824865 AS sv_0, 0.5375593166419463 AS sv_1, 1.138114868253046 AS sv_2, -0.17581376051664788 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 26 AS sv_idx, -1.0 AS dual_coeff, -0.67097329758465 AS sv_0, -0.9491019931972904 AS sv_1, 1.0033626968746907 AS sv_2, 0.09974331867472287 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 27 AS sv_idx, 1.0 AS dual_coeff, -0.6789075377717992 AS sv_0, -1.7369919644134428 AS sv_1, 0.704876462250472 AS sv_2, 0.4446963905862061 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 28 AS sv_idx, -1.0 AS dual_coeff, -0.37946925113163943 AS sv_0, -0.1756534081941675 AS sv_1, 0.25075742496242187 AS sv_2, 1.1417399768679672 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 29 AS sv_idx, -0.6534378190294636 AS dual_coeff, -0.09017905525714784 AS sv_0, -0.26109517177108804 AS sv_1, -1.6837452789962486 AS sv_2, 1.7003246746828506 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 30 AS sv_idx, -1.0 AS dual_coeff, -0.7622391712317312 AS sv_0, 0.33966971589678224 AS sv_1, 0.7684633394319059 AS sv_2, -0.371526116902454 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 31 AS sv_idx, -1.0 AS dual_coeff, -0.2165783957646952 AS sv_0, -0.03998635058028351 AS sv_1, -0.4626783252333973 AS sv_2, -0.26761409961692223 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 32 AS sv_idx, 0.8666694606780595 AS dual_coeff, -1.3968587718079994 AS sv_0, 0.2399378203088459 AS sv_1, 1.9807672784368275 AS sv_2, 0.27229635799780355 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 33 AS sv_idx, 1.0 AS dual_coeff, -0.8986158535502288 AS sv_0, -0.4284142397983223 AS sv_1, -0.01673000383205732 AS sv_2, -0.33722102919164065 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 34 AS sv_idx, -1.0 AS dual_coeff, -0.32407055475555924 AS sv_0, -0.41259245321747107 AS sv_1, 0.8326813770582218 AS sv_2, 1.8780122931237608 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 35 AS sv_idx, 1.0 AS dual_coeff, -0.8681416850352318 AS sv_0, -0.911177722447064 AS sv_1, 0.09546468868284567 AS sv_2, -1.4536187624473933 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 36 AS sv_idx, -0.9486051901853124 AS dual_coeff, -0.3959452341354214 AS sv_0, 0.6210143972545975 AS sv_1, 0.3495675779918653 AS sv_2, 0.02008550437562927 AS sv_3 FROM SYSIBM.SYSDUMMY1 UNION ALL SELECT 37 AS sv_idx, -1.0 AS dual_coeff, -0.6949158150850943 AS sv_0, 0.6278031227629293 AS sv_1, 1.556657693398034 AS sv_2, 0.031214583332265795 AS sv_3 FROM SYSIBM.SYSDUMMY1) AS "Values"), "kernel_dp_1789-09-14T00:00:00.000000000" AS (SELECT t_2."KEY" AS "KEY", t_2.dot_product AS dot_product FROM (SELECT full_join_data_sv_2."KEY" AS "KEY", sum(CAST(full_join_data_sv_2.dot_prod1 AS DOUBLE)) + -1.54088002264008 AS dot_product FROM (SELECT kernel_input_with_scaling."KEY" AS "KEY", "SV_data_1789-09-14T00:00:00.000000000".dual_coeff * power(0.1 * (kernel_input_with_scaling."PC1" * "SV_data_1789-09-14T00:00:00.000000000".sv_0 + kernel_input_with_scaling."PC2" * "SV_data_1789-09-14T00:00:00.000000000".sv_1 + kernel_input_with_scaling."PC3" * "SV_data_1789-09-14T00:00:00.000000000".sv_2 + kernel_input_with_scaling."PC4" * "SV_data_1789-09-14T00:00:00.000000000".sv_3) + 1.0, 3.0) AS dot_prod1 FROM kernel_input_with_scaling, "SV_data_1789-09-14T00:00:00.000000000") AS full_join_data_sv_2 GROUP BY full_join_data_sv_2."KEY") AS t_2), "OVR_Score_1789-09-14T00:00:00.000000000" AS (SELECT "kernel_dp_1789-09-14T00:00:00.000000000"."KEY" AS "KEY_1789-09-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "Proba_1789-09-14T00:00:00.000000000", "kernel_dp_1789-09-14T00:00:00.000000000".dot_product AS "Score_1789-09-14T00:00:00.000000000" FROM "kernel_dp_1789-09-14T00:00:00.000000000"), "OVR_Join_CTE" AS (SELECT "OVR_Score_1789-07-14T00:00:00.000000000"."KEY_1789-07-14T00:00:00.000000000" AS "KEY_1789-07-14T00:00:00.000000000", "OVR_Score_1789-07-14T00:00:00.000000000"."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", "OVR_Score_1789-07-14T00:00:00.000000000"."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", "OVR_Score_1789-08-14T00:00:00.000000000"."KEY_1789-08-14T00:00:00.000000000" AS "KEY_1789-08-14T00:00:00.000000000", "OVR_Score_1789-08-14T00:00:00.000000000"."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", "OVR_Score_1789-08-14T00:00:00.000000000"."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", "OVR_Score_1789-09-14T00:00:00.000000000"."KEY_1789-09-14T00:00:00.000000000" AS "KEY_1789-09-14T00:00:00.000000000", "OVR_Score_1789-09-14T00:00:00.000000000"."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", "OVR_Score_1789-09-14T00:00:00.000000000"."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000" FROM "OVR_Score_1789-07-14T00:00:00.000000000" LEFT OUTER JOIN "OVR_Score_1789-08-14T00:00:00.000000000" ON "OVR_Score_1789-07-14T00:00:00.000000000"."KEY_1789-07-14T00:00:00.000000000" = "OVR_Score_1789-08-14T00:00:00.000000000"."KEY_1789-08-14T00:00:00.000000000" LEFT OUTER JOIN "OVR_Score_1789-09-14T00:00:00.000000000" ON "OVR_Score_1789-09-14T00:00:00.000000000"."KEY_1789-09-14T00:00:00.000000000" = "OVR_Score_1789-08-14T00:00:00.000000000"."KEY_1789-08-14T00:00:00.000000000"), orig_cte AS (SELECT "OVR_Join_CTE"."KEY_1789-07-14T00:00:00.000000000" AS "KEY", "OVR_Join_CTE"."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", "OVR_Join_CTE"."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", "OVR_Join_CTE"."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", "OVR_Join_CTE"."Proba_1789-07-14T00:00:00.000000000" / ("OVR_Join_CTE"."Proba_1789-07-14T00:00:00.000000000" + "OVR_Join_CTE"."Proba_1789-08-14T00:00:00.000000000" + "OVR_Join_CTE"."Proba_1789-09-14T00:00:00.000000000") AS "Proba_1789-07-14T00:00:00.000000000", "OVR_Join_CTE"."Proba_1789-08-14T00:00:00.000000000" / ("OVR_Join_CTE"."Proba_1789-07-14T00:00:00.000000000" + "OVR_Join_CTE"."Proba_1789-08-14T00:00:00.000000000" + "OVR_Join_CTE"."Proba_1789-09-14T00:00:00.000000000") AS "Proba_1789-08-14T00:00:00.000000000", "OVR_Join_CTE"."Proba_1789-09-14T00:00:00.000000000" / ("OVR_Join_CTE"."Proba_1789-07-14T00:00:00.000000000" + "OVR_Join_CTE"."Proba_1789-08-14T00:00:00.000000000" + "OVR_Join_CTE"."Proba_1789-09-14T00:00:00.000000000") AS "Proba_1789-09-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "LogProba_1789-07-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "LogProba_1789-08-14T00:00:00.000000000", CAST(NULL AS DOUBLE) AS "LogProba_1789-09-14T00:00:00.000000000", NULL AS "Decision", CAST(NULL AS DOUBLE) AS "DecisionProba" FROM "OVR_Join_CTE"), score_class_union AS (SELECT scu."KEY_u" AS "KEY_u", scu.class AS class, scu."LogProba" AS "LogProba", scu."Proba" AS "Proba", scu."Score" AS "Score" FROM (SELECT orig_cte."KEY" AS "KEY_u", '1789-07-14T00:00:00.000000000' AS class, orig_cte."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba", orig_cte."Proba_1789-07-14T00:00:00.000000000" AS "Proba", orig_cte."Score_1789-07-14T00:00:00.000000000" AS "Score" FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", '1789-08-14T00:00:00.000000000' AS class, orig_cte."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba", orig_cte."Proba_1789-08-14T00:00:00.000000000" AS "Proba", orig_cte."Score_1789-08-14T00:00:00.000000000" AS "Score" FROM orig_cte UNION ALL SELECT orig_cte."KEY" AS "KEY_u", '1789-09-14T00:00:00.000000000' AS class, orig_cte."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba", orig_cte."Proba_1789-09-14T00:00:00.000000000" AS "Proba", orig_cte."Score_1789-09-14T00:00:00.000000000" AS "Score" FROM orig_cte) AS scu), score_max AS (SELECT orig_cte."KEY" AS "KEY", orig_cte."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", orig_cte."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", orig_cte."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", orig_cte."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", orig_cte."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", orig_cte."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", orig_cte."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", orig_cte."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", orig_cte."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000", orig_cte."Decision" AS "Decision", orig_cte."DecisionProba" AS "DecisionProba", max_select."KEY_m" AS "KEY_m", max_select."max_Score" AS "max_Score" FROM orig_cte LEFT OUTER JOIN (SELECT score_class_union."KEY_u" AS "KEY_m", max(score_class_union."Score") AS "max_Score" FROM score_class_union GROUP BY score_class_union."KEY_u") AS max_select ON orig_cte."KEY" = max_select."KEY_m"), union_with_max AS (SELECT score_class_union."KEY_u" AS "KEY_u", score_class_union.class AS class, score_class_union."LogProba" AS "LogProba", score_class_union."Proba" AS "Proba", score_class_union."Score" AS "Score", score_max."KEY" AS "KEY", score_max."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", score_max."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", score_max."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", score_max."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", score_max."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", score_max."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", score_max."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", score_max."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", score_max."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Score" AS "max_Score" FROM score_class_union LEFT OUTER JOIN score_max ON score_class_union."KEY_u" = score_max."KEY"), arg_max_cte AS (SELECT score_max."KEY" AS "KEY", score_max."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", score_max."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", score_max."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", score_max."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", score_max."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", score_max."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", score_max."LogProba_1789-07-14T00:00:00.000000000" AS "LogProba_1789-07-14T00:00:00.000000000", score_max."LogProba_1789-08-14T00:00:00.000000000" AS "LogProba_1789-08-14T00:00:00.000000000", score_max."LogProba_1789-09-14T00:00:00.000000000" AS "LogProba_1789-09-14T00:00:00.000000000", score_max."Decision" AS "Decision", score_max."DecisionProba" AS "DecisionProba", score_max."KEY_m" AS "KEY_m", score_max."max_Score" AS "max_Score", "arg_max_t_Score"."KEY_Score" AS "KEY_Score", "arg_max_t_Score"."arg_max_Score" AS "arg_max_Score" FROM score_max LEFT OUTER JOIN (SELECT union_with_max."KEY" AS "KEY_Score", max(union_with_max.class) AS "arg_max_Score" FROM union_with_max WHERE union_with_max."max_Score" <= union_with_max."Score" GROUP BY union_with_max."KEY") AS "arg_max_t_Score" ON score_max."KEY" = "arg_max_t_Score"."KEY_Score") SELECT arg_max_cte."KEY" AS "KEY", arg_max_cte."Score_1789-07-14T00:00:00.000000000" AS "Score_1789-07-14T00:00:00.000000000", arg_max_cte."Score_1789-08-14T00:00:00.000000000" AS "Score_1789-08-14T00:00:00.000000000", arg_max_cte."Score_1789-09-14T00:00:00.000000000" AS "Score_1789-09-14T00:00:00.000000000", arg_max_cte."Proba_1789-07-14T00:00:00.000000000" AS "Proba_1789-07-14T00:00:00.000000000", arg_max_cte."Proba_1789-08-14T00:00:00.000000000" AS "Proba_1789-08-14T00:00:00.000000000", arg_max_cte."Proba_1789-09-14T00:00:00.000000000" AS "Proba_1789-09-14T00:00:00.000000000", CASE WHEN (arg_max_cte."Proba_1789-07-14T00:00:00.000000000" IS NULL OR arg_max_cte."Proba_1789-07-14T00:00:00.000000000" > 0.0) THEN ln(arg_max_cte."Proba_1789-07-14T00:00:00.000000000") ELSE -1.79769313486231e+308 END AS "LogProba_1789-07-14T00:00:00.000000000", CASE WHEN (arg_max_cte."Proba_1789-08-14T00:00:00.000000000" IS NULL OR arg_max_cte."Proba_1789-08-14T00:00:00.000000000" > 0.0) THEN ln(arg_max_cte."Proba_1789-08-14T00:00:00.000000000") ELSE -1.79769313486231e+308 END AS "LogProba_1789-08-14T00:00:00.000000000", CASE WHEN (arg_max_cte."Proba_1789-09-14T00:00:00.000000000" IS NULL OR arg_max_cte."Proba_1789-09-14T00:00:00.000000000" > 0.0) THEN ln(arg_max_cte."Proba_1789-09-14T00:00:00.000000000") ELSE -1.79769313486231e+308 END AS "LogProba_1789-09-14T00:00:00.000000000", arg_max_cte."arg_max_Score" AS "Decision", CASE WHEN (arg_max_cte."arg_max_Score" = '1789-07-14T00:00:00.000000000') THEN arg_max_cte."Proba_1789-07-14T00:00:00.000000000" WHEN (arg_max_cte."arg_max_Score" = '1789-08-14T00:00:00.000000000') THEN arg_max_cte."Proba_1789-08-14T00:00:00.000000000" WHEN (arg_max_cte."arg_max_Score" = '1789-09-14T00:00:00.000000000') THEN arg_max_cte."Proba_1789-09-14T00:00:00.000000000" END AS "DecisionProba" FROM arg_max_cte
-- BP 6.1D content: domain syschar: 3 INSERT INTO S_DOM VALUES (15122, 'dogs', 'This test deals with simple relationships between two classes. It creates a number of instances of each class and relates them. The instances proceed to generate events to themselves and to one another. Executes unrelates between the instances. ** Note this test does not use the LOG External Entity', 1, 1); INSERT INTO S_CDT VALUES (524289, 0); INSERT INTO S_DT VALUES (524289, 15122, 'void', ''); INSERT INTO S_CDT VALUES (524290, 1); INSERT INTO S_DT VALUES (524290, 15122, 'boolean', ''); INSERT INTO S_CDT VALUES (524291, 2); INSERT INTO S_DT VALUES (524291, 15122, 'integer', ''); INSERT INTO S_CDT VALUES (524292, 3); INSERT INTO S_DT VALUES (524292, 15122, 'real', ''); INSERT INTO S_CDT VALUES (524293, 4); INSERT INTO S_DT VALUES (524293, 15122, 'string', ''); INSERT INTO S_CDT VALUES (524294, 5); INSERT INTO S_DT VALUES (524294, 15122, 'unique_id', ''); INSERT INTO S_CDT VALUES (524295, 6); INSERT INTO S_DT VALUES (524295, 15122, 'state<State_Model>', ''); INSERT INTO S_CDT VALUES (524296, 7); INSERT INTO S_DT VALUES (524296, 15122, 'same_as<Base_Attribute>', ''); INSERT INTO S_CDT VALUES (524297, 8); INSERT INTO S_DT VALUES (524297, 15122, 'inst_ref<Object>', ''); INSERT INTO S_CDT VALUES (524298, 9); INSERT INTO S_DT VALUES (524298, 15122, 'inst_ref_set<Object>', ''); INSERT INTO S_CDT VALUES (524299, 10); INSERT INTO S_DT VALUES (524299, 15122, 'inst<Event>', ''); INSERT INTO S_CDT VALUES (524300, 11); INSERT INTO S_DT VALUES (524300, 15122, 'inst<Mapping>', ''); INSERT INTO S_CDT VALUES (524301, 12); INSERT INTO S_DT VALUES (524301, 15122, 'inst_ref<Mapping>', ''); INSERT INTO S_UDT VALUES (524302, 524300, 1); INSERT INTO S_DT VALUES (524302, 15122, 'date', ''); INSERT INTO S_UDT VALUES (524303, 524300, 2); INSERT INTO S_DT VALUES (524303, 15122, 'timestamp', ''); INSERT INTO S_UDT VALUES (524304, 524301, 3); INSERT INTO S_DT VALUES (524304, 15122, 'inst_ref<Timer>', ''); INSERT INTO S_EE VALUES (524290, 'ARCH', '', 'ARCH', 15122); INSERT INTO S_BRG VALUES (524304, 524290, 'shutdown', '', 0, 524289, 'control stop;', 1); INSERT INTO GD_MD VALUES (524289, 1, 15122, 1, 1, 0, 1, 1, 0, 12, 1600, 4199, 1.000000, 0); INSERT INTO GD_GE VALUES (524319, 524289, 3145734, 11); INSERT INTO GD_SHP VALUES (524319, 1920, 1344, 2080, 1440); INSERT INTO GD_GE VALUES (524320, 524289, 524290, 12); INSERT INTO GD_SHP VALUES (524320, 1920, 1536, 2080, 1632); INSERT INTO GD_MD VALUES (524290, 2, 15122, 1, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (524321, 524290, 3145734, 11); INSERT INTO GD_SHP VALUES (524321, 1920, 1344, 2080, 1440); INSERT INTO GD_MD VALUES (524291, 3, 15122, 1, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (524322, 524291, 3145734, 11); INSERT INTO GD_SHP VALUES (524322, 1920, 1344, 2080, 1440); INSERT INTO GD_MD VALUES (524292, 4, 15122, 1, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (524323, 524292, 3145734, 11); INSERT INTO GD_SHP VALUES (524323, 1920, 1344, 2080, 1440); INSERT INTO S_SS VALUES (3145734, 'dogs', '', '', 1, 15122, 3145734); INSERT INTO O_OBJ VALUES (3145729, 'Dog', 1, 'D', '', 3145734); INSERT INTO O_NBATTR VALUES (3145729, 3145729); INSERT INTO O_BATTR VALUES (3145729, 3145729); INSERT INTO O_ATTR VALUES (3145729, 3145729, 0, 'name', '', '', 'name', 0, 524293); INSERT INTO O_NBATTR VALUES (3145730, 3145729); INSERT INTO O_BATTR VALUES (3145730, 3145729); INSERT INTO O_ATTR VALUES (3145730, 3145729, 3145729, 'number_slashes', '', '', 'number_slashes', 0, 524291); INSERT INTO O_REF VALUES (3145729, 3145730, 0, 3145733, 3145729, 3145729, 3145730, 3145731, 3145730, 0, 0, ''); INSERT INTO O_RATTR VALUES (3145731, 3145729, 3145733, 3145730, 0); INSERT INTO O_ATTR VALUES (3145731, 3145729, 3145730, 'cat_under_pursuit', '', '', 'cat_under_pursuit', 0, 524296); INSERT INTO O_NBATTR VALUES (3145732, 3145729); INSERT INTO O_BATTR VALUES (3145732, 3145729); INSERT INTO O_ATTR VALUES (3145732, 3145729, 3145731, 'current_state', '', '', 'current_state', 0, 524295); INSERT INTO O_ID VALUES (0, 3145729); INSERT INTO O_OIDA VALUES (3145729, 3145729, 0); INSERT INTO O_RTIDA VALUES (3145729, 3145729, 0, 3145730, 3145731); INSERT INTO SM_ISM VALUES (1048578, 3145729); INSERT INTO SM_SM VALUES (1048578, '', 2); INSERT INTO SM_MOORE VALUES (1048578); INSERT INTO SM_EVTDI VALUES (1048577, 1048578, 'cat_name', '', 524293); INSERT INTO SM_SUPDT VALUES (1048577, 1048578, 0); INSERT INTO SM_SUPDT VALUES (1048578, 1048578, 0); INSERT INTO SM_SDI VALUES (1048577, 1048578, 1048578); INSERT INTO SM_STATE VALUES (1048577, 1048578, 1048577, 'looking_for_cats', 1, 0); INSERT INTO SM_LEVT VALUES (1048577, 1048578, 1048577); INSERT INTO SM_SEVT VALUES (1048577, 1048578, 1048577); INSERT INTO SM_EVT VALUES (1048577, 1048578, 1048577, 1, 'finished_licking_wounds', 0, '', 'D1', ''); INSERT INTO SM_EIGN VALUES (1048577, 1048577, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048577, 1048577, 1048578, 1048577); INSERT INTO SM_LEVT VALUES (1048578, 1048578, 1048577); INSERT INTO SM_SEVT VALUES (1048578, 1048578, 1048577); INSERT INTO SM_EVT VALUES (1048578, 1048578, 1048577, 2, 'cats_located', 0, '', 'D2', ''); INSERT INTO SM_SEME VALUES (1048577, 1048578, 1048578, 1048577); INSERT INTO SM_LEVT VALUES (1048579, 1048578, 1048578); INSERT INTO SM_SEVT VALUES (1048579, 1048578, 1048578); INSERT INTO SM_EVT VALUES (1048579, 1048578, 1048578, 3, 'chase_cat', 0, '', 'D3', ''); INSERT INTO SM_EIGN VALUES (1048577, 1048579, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048577, 1048579, 1048578, 1048578); INSERT INTO SM_LEVT VALUES (1048580, 1048578, 1048577); INSERT INTO SM_SEVT VALUES (1048580, 1048578, 1048577); INSERT INTO SM_EVT VALUES (1048580, 1048578, 1048577, 4, 'nose_slashed', 0, '', 'D4', ''); INSERT INTO SM_EIGN VALUES (1048577, 1048580, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048577, 1048580, 1048578, 1048577); INSERT INTO SM_LEVT VALUES (1048581, 1048578, 1048578); INSERT INTO SM_SEVT VALUES (1048581, 1048578, 1048578); INSERT INTO SM_EVT VALUES (1048581, 1048578, 1048578, 5, 'three_legged_cat_sighted', 0, '', 'D5', ''); INSERT INTO SM_EIGN VALUES (1048577, 1048581, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048577, 1048581, 1048578, 1048578); INSERT INTO SM_LEVT VALUES (1048582, 1048578, 1048577); INSERT INTO SM_SEVT VALUES (1048582, 1048578, 1048577); INSERT INTO SM_EVT VALUES (1048582, 1048578, 1048577, 6, 'had_enough', 0, '', 'D6', ''); INSERT INTO SM_EIGN VALUES (1048577, 1048582, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048577, 1048582, 1048578, 1048577); INSERT INTO SM_STATE VALUES (1048578, 1048578, 1048577, 'selecting_cat', 2, 0); INSERT INTO SM_EIGN VALUES (1048578, 1048577, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048578, 1048577, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048578, 1048578, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048578, 1048578, 1048578, 1048577); INSERT INTO SM_SEME VALUES (1048578, 1048579, 1048578, 1048578); INSERT INTO SM_EIGN VALUES (1048578, 1048580, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048578, 1048580, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048578, 1048581, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048578, 1048581, 1048578, 1048578); INSERT INTO SM_EIGN VALUES (1048578, 1048582, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048578, 1048582, 1048578, 1048577); INSERT INTO SM_STATE VALUES (1048579, 1048578, 1048578, 'chasing_cat', 3, 0); INSERT INTO SM_EIGN VALUES (1048579, 1048577, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048579, 1048577, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048579, 1048578, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048579, 1048578, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048579, 1048579, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048579, 1048579, 1048578, 1048578); INSERT INTO SM_SEME VALUES (1048579, 1048580, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048579, 1048581, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048579, 1048581, 1048578, 1048578); INSERT INTO SM_EIGN VALUES (1048579, 1048582, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048579, 1048582, 1048578, 1048577); INSERT INTO SM_STATE VALUES (1048580, 1048578, 1048577, 'licking_wounds', 4, 0); INSERT INTO SM_SEME VALUES (1048580, 1048577, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048580, 1048578, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048580, 1048578, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048580, 1048579, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048580, 1048579, 1048578, 1048578); INSERT INTO SM_EIGN VALUES (1048580, 1048580, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048580, 1048580, 1048578, 1048577); INSERT INTO SM_SEME VALUES (1048580, 1048581, 1048578, 1048578); INSERT INTO SM_SEME VALUES (1048580, 1048582, 1048578, 1048577); INSERT INTO SM_STATE VALUES (1048581, 1048578, 1048577, 'no_interest_in_cats', 5, 1); INSERT INTO SM_EIGN VALUES (1048581, 1048577, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048581, 1048577, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048581, 1048578, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048581, 1048578, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048581, 1048579, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048581, 1048579, 1048578, 1048578); INSERT INTO SM_EIGN VALUES (1048581, 1048580, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048581, 1048580, 1048578, 1048577); INSERT INTO SM_EIGN VALUES (1048581, 1048581, 1048578, 1048578, ''); INSERT INTO SM_SEME VALUES (1048581, 1048581, 1048578, 1048578); INSERT INTO SM_EIGN VALUES (1048581, 1048582, 1048578, 1048577, ''); INSERT INTO SM_SEME VALUES (1048581, 1048582, 1048578, 1048577); INSERT INTO SM_NSTXN VALUES (1048577, 1048578, 1048577, 1048578, 1048577); INSERT INTO SM_TXN VALUES (1048577, 1048578, 1048578, 1048577); INSERT INTO SM_NSTXN VALUES (1048578, 1048578, 1048578, 1048579, 1048578); INSERT INTO SM_TXN VALUES (1048578, 1048578, 1048579, 1048578); INSERT INTO SM_NSTXN VALUES (1048579, 1048578, 1048580, 1048581, 1048578); INSERT INTO SM_TXN VALUES (1048579, 1048578, 1048579, 1048578); INSERT INTO SM_NSTXN VALUES (1048580, 1048578, 1048579, 1048580, 1048577); INSERT INTO SM_TXN VALUES (1048580, 1048578, 1048580, 1048577); INSERT INTO SM_NSTXN VALUES (1048581, 1048578, 1048580, 1048577, 1048577); INSERT INTO SM_TXN VALUES (1048581, 1048578, 1048577, 1048577); INSERT INTO SM_NSTXN VALUES (1048582, 1048578, 1048580, 1048582, 1048577); INSERT INTO SM_TXN VALUES (1048582, 1048578, 1048581, 1048577); INSERT INTO SM_MOAH VALUES (1048577, 1048578, 1048577); INSERT INTO SM_AH VALUES (1048577, 1048578); INSERT INTO SM_ACT VALUES (1048577, 1048578, 1, 'generate D2:''cats_located''() to self;', ''); INSERT INTO SM_MOAH VALUES (1048578, 1048578, 1048578); INSERT INTO SM_AH VALUES (1048578, 1048578); INSERT INTO SM_ACT VALUES (1048578, 1048578, 1, 'select any cat_to_chase related by self->C[R2]; select many visible_cats related by self->C[R2]; for each cat in visible_cats if (cat.number_legs <= 3) assign cat_to_chase = cat; end if; end for; relate self to cat_to_chase across R1; generate D3:''chase_cat''(cat_name:cat_to_chase.name) to self; ', ''); INSERT INTO SM_MOAH VALUES (1048579, 1048578, 1048579); INSERT INTO SM_AH VALUES (1048579, 1048578); INSERT INTO SM_ACT VALUES (1048579, 1048578, 1, 'select one cat related by self->C[R1]; generate C1:''chase_begins''() to cat;', ''); INSERT INTO SM_MOAH VALUES (1048580, 1048578, 1048580); INSERT INTO SM_AH VALUES (1048580, 1048578); INSERT INTO SM_ACT VALUES (1048580, 1048578, 1, 'assign self.number_slashes = self.number_slashes + 1; select one cat_chased related by self->C[R1]; unrelate self from cat_chased across R1; if (self.number_slashes >= 1) generate D6:''had_enough''() to self; else select any cat_to_chase related by self->C[R2]; select many visible_cats related by self->C[R2]; for each cat in visible_cats if (cat.number_legs <= 3) assign cat_to_chase = cat; end if; end for; if (not_empty cat_to_chase) relate self to cat_to_chase across R1; generate D5:''three_legged_cat_sighted''(cat_name:cat_to_chase.name) to self; else generate D1:''finished_licking_wounds''() to self; end if; end if;', ''); INSERT INTO SM_MOAH VALUES (1048581, 1048578, 1048581); INSERT INTO SM_AH VALUES (1048581, 1048578); INSERT INTO SM_ACT VALUES (1048581, 1048578, 1, 'select many cats related by self->C[R2]; for each cat in cats unrelate self from cat across R2; end for; assign finished = true; select many dogs from instances of D; for each dog in dogs if (dog.name != self.name) assign finished = false; end if; end for; if (finished == true) bridge ARCH::shutdown(); end if; ', ''); INSERT INTO GD_MD VALUES (1048577, 8, 1048578, 40, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (1048578, 1048577, 1048577, 41); INSERT INTO GD_SHP VALUES (1048578, 1664, 1120, 1888, 1232); INSERT INTO GD_GE VALUES (1048579, 1048577, 1048578, 41); INSERT INTO GD_SHP VALUES (1048579, 1664, 1312, 2032, 1536); INSERT INTO GD_GE VALUES (1048580, 1048577, 1048579, 41); INSERT INTO GD_SHP VALUES (1048580, 1712, 1664, 1936, 1776); INSERT INTO GD_GE VALUES (1048581, 1048577, 1048580, 41); INSERT INTO GD_SHP VALUES (1048581, 2080, 1104, 2544, 1472); INSERT INTO GD_GE VALUES (1048582, 1048577, 1048581, 41); INSERT INTO GD_SHP VALUES (1048582, 2304, 1552, 2544, 1824); INSERT INTO GD_GE VALUES (1048583, 1048577, 1048577, 42); INSERT INTO GD_CON VALUES (1048583, 1048578, 1048579, 0); INSERT INTO GD_CTXT VALUES (1048583, 0, 0, 0, 0, 0, 0, 1796, 1247, 1916, 1278, 4, -10, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1048584, 1048583, 1808, 1232, 1808, 1312, 0); INSERT INTO GD_GE VALUES (1048585, 1048577, 1048578, 42); INSERT INTO GD_CON VALUES (1048585, 1048579, 1048580, 0); INSERT INTO GD_CTXT VALUES (1048585, 0, 0, 0, 0, 0, 0, 1829, 1596, 2004, 1629, 5, 35, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1048586, 1048585, 1840, 1536, 1840, 1664, 0); INSERT INTO GD_GE VALUES (1048587, 1048577, 1048580, 42); INSERT INTO GD_CON VALUES (1048587, 1048580, 1048581, 0); INSERT INTO GD_CTXT VALUES (1048587, 0, 0, 0, 0, 0, 0, 2034, 1570, 2166, 1607, -110, -103, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1048588, 1048587, 1936, 1712, 2160, 1712, 0); INSERT INTO GD_LS VALUES (1048589, 1048587, 2160, 1712, 2160, 1472, 1048588); INSERT INTO GD_GE VALUES (1048590, 1048577, 1048581, 42); INSERT INTO GD_CON VALUES (1048590, 1048581, 1048578, 0); INSERT INTO GD_CTXT VALUES (1048590, 0, 0, 0, 0, 0, 0, 1899, 1165, 2077, 1198, -60, 6, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1048591, 1048590, 2080, 1184, 1888, 1184, 0); INSERT INTO GD_GE VALUES (1048592, 1048577, 1048579, 42); INSERT INTO GD_CON VALUES (1048592, 1048581, 1048580, 0); INSERT INTO GD_CTXT VALUES (1048592, 0, 0, 0, 0, 0, 0, 1967, 1762, 2206, 1795, -241, 33, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1048593, 1048592, 2224, 1472, 2224, 1760, 0); INSERT INTO GD_LS VALUES (1048594, 1048592, 2224, 1760, 1936, 1760, 1048593); INSERT INTO GD_GE VALUES (1048595, 1048577, 1048582, 42); INSERT INTO GD_CON VALUES (1048595, 1048581, 1048582, 0); INSERT INTO GD_CTXT VALUES (1048595, 0, 0, 0, 0, 0, 0, 2420, 1489, 2524, 1524, 20, 8, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1048596, 1048595, 2416, 1472, 2416, 1552, 0); INSERT INTO O_OBJ VALUES (3145730, 'Cat', 2, 'C', '', 3145734); INSERT INTO O_NBATTR VALUES (3145733, 3145730); INSERT INTO O_BATTR VALUES (3145733, 3145730); INSERT INTO O_ATTR VALUES (3145733, 3145730, 0, 'name', '', '', 'name', 0, 524293); INSERT INTO O_NBATTR VALUES (3145734, 3145730); INSERT INTO O_BATTR VALUES (3145734, 3145730); INSERT INTO O_ATTR VALUES (3145734, 3145730, 3145733, 'number_legs', '', '', 'number_legs', 0, 524291); INSERT INTO O_REF VALUES (3145730, 3145729, 0, 3145729, 3145730, 3145732, 3145731, 3145735, 3145729, 0, 0, ''); INSERT INTO O_RATTR VALUES (3145735, 3145730, 3145729, 3145729, 0); INSERT INTO O_ATTR VALUES (3145735, 3145730, 3145734, 'viewing_dog', '', '', 'viewing_dog', 0, 524296); INSERT INTO O_NBATTR VALUES (3145736, 3145730); INSERT INTO O_BATTR VALUES (3145736, 3145730); INSERT INTO O_ATTR VALUES (3145736, 3145730, 3145735, 'has_been_chased', '', '', 'has_been_chased', 0, 524290); INSERT INTO O_NBATTR VALUES (3145737, 3145730); INSERT INTO O_BATTR VALUES (3145737, 3145730); INSERT INTO O_ATTR VALUES (3145737, 3145730, 3145736, 'current_state', '', '', 'current_state', 0, 524295); INSERT INTO O_ID VALUES (0, 3145730); INSERT INTO O_OIDA VALUES (3145733, 3145730, 0); INSERT INTO O_RTIDA VALUES (3145733, 3145730, 0, 3145729, 3145730); INSERT INTO SM_ISM VALUES (1572867, 3145730); INSERT INTO SM_SM VALUES (1572867, '', 3); INSERT INTO SM_MOORE VALUES (1572867); INSERT INTO SM_EVTDI VALUES (1572865, 1572867, 'dog_name', '', 524293); INSERT INTO SM_SUPDT VALUES (1572865, 1572867, 0); INSERT INTO SM_STATE VALUES (1572865, 1572867, 1572865, 'acting_cool', 1, 0); INSERT INTO SM_LEVT VALUES (1572865, 1572867, 1572865); INSERT INTO SM_SEVT VALUES (1572865, 1572867, 1572865); INSERT INTO SM_EVT VALUES (1572865, 1572867, 1572865, 1, 'chase_begins', 0, '', 'C1', ''); INSERT INTO SM_SEME VALUES (1572865, 1572865, 1572867, 1572865); INSERT INTO SM_LEVT VALUES (1572866, 1572867, 1572865); INSERT INTO SM_SEVT VALUES (1572866, 1572867, 1572865); INSERT INTO SM_EVT VALUES (1572866, 1572867, 1572865, 2, 'see_chance', 0, '', 'C2', ''); INSERT INTO SM_EIGN VALUES (1572865, 1572866, 1572867, 1572865, ''); INSERT INTO SM_SEME VALUES (1572865, 1572866, 1572867, 1572865); INSERT INTO SM_LEVT VALUES (1572867, 1572867, 1572865); INSERT INTO SM_SEVT VALUES (1572867, 1572867, 1572865); INSERT INTO SM_EVT VALUES (1572867, 1572867, 1572865, 3, 'relax', 0, '', 'C3', ''); INSERT INTO SM_EIGN VALUES (1572865, 1572867, 1572867, 1572865, ''); INSERT INTO SM_SEME VALUES (1572865, 1572867, 1572867, 1572865); INSERT INTO SM_STATE VALUES (1572866, 1572867, 1572865, 'running_for_life', 2, 0); INSERT INTO SM_EIGN VALUES (1572866, 1572865, 1572867, 1572865, ''); INSERT INTO SM_SEME VALUES (1572866, 1572865, 1572867, 1572865); INSERT INTO SM_SEME VALUES (1572866, 1572866, 1572867, 1572865); INSERT INTO SM_EIGN VALUES (1572866, 1572867, 1572867, 1572865, ''); INSERT INTO SM_SEME VALUES (1572866, 1572867, 1572867, 1572865); INSERT INTO SM_STATE VALUES (1572867, 1572867, 1572865, 'slashing_nose', 3, 0); INSERT INTO SM_EIGN VALUES (1572867, 1572865, 1572867, 1572865, ''); INSERT INTO SM_SEME VALUES (1572867, 1572865, 1572867, 1572865); INSERT INTO SM_EIGN VALUES (1572867, 1572866, 1572867, 1572865, ''); INSERT INTO SM_SEME VALUES (1572867, 1572866, 1572867, 1572865); INSERT INTO SM_SEME VALUES (1572867, 1572867, 1572867, 1572865); INSERT INTO SM_NSTXN VALUES (1572865, 1572867, 1572865, 1572865, 1572865); INSERT INTO SM_TXN VALUES (1572865, 1572867, 1572866, 1572865); INSERT INTO SM_NSTXN VALUES (1572866, 1572867, 1572866, 1572866, 1572865); INSERT INTO SM_TXN VALUES (1572866, 1572867, 1572867, 1572865); INSERT INTO SM_NSTXN VALUES (1572867, 1572867, 1572867, 1572867, 1572865); INSERT INTO SM_TXN VALUES (1572867, 1572867, 1572865, 1572865); INSERT INTO SM_MOAH VALUES (1572865, 1572867, 1572865); INSERT INTO SM_AH VALUES (1572865, 1572867); INSERT INTO SM_ACT VALUES (1572865, 1572867, 1, '', ''); INSERT INTO SM_MOAH VALUES (1572866, 1572867, 1572866); INSERT INTO SM_AH VALUES (1572866, 1572867); INSERT INTO SM_ACT VALUES (1572866, 1572867, 1, 'generate C2:see_chance() to self; assign self.has_been_chased = true;', ''); INSERT INTO SM_MOAH VALUES (1572867, 1572867, 1572867); INSERT INTO SM_AH VALUES (1572867, 1572867); INSERT INTO SM_ACT VALUES (1572867, 1572867, 1, 'select many pursuing_dogs related by self->D[R1]; for each dog in pursuing_dogs generate D4:''nose_slashed''() to dog; end for; generate C3:''relax''() to self;', ''); INSERT INTO GD_MD VALUES (1572865, 8, 1572867, 40, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (1572866, 1572865, 1572865, 41); INSERT INTO GD_SHP VALUES (1572866, 1872, 1296, 2016, 1392); INSERT INTO GD_GE VALUES (1572867, 1572865, 1572866, 41); INSERT INTO GD_SHP VALUES (1572867, 1824, 1632, 2032, 1728); INSERT INTO GD_GE VALUES (1572868, 1572865, 1572867, 41); INSERT INTO GD_SHP VALUES (1572868, 2048, 1440, 2368, 1568); INSERT INTO GD_GE VALUES (1572869, 1572865, 1572865, 42); INSERT INTO GD_CON VALUES (1572869, 1572866, 1572867, 0); INSERT INTO GD_CTXT VALUES (1572869, 0, 0, 0, 0, 0, 0, 1828, 1481, 1933, 1518, -92, -8, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1572870, 1572869, 1936, 1392, 1936, 1632, 0); INSERT INTO GD_GE VALUES (1572871, 1572865, 1572866, 42); INSERT INTO GD_CON VALUES (1572871, 1572867, 1572868, 0); INSERT INTO GD_CTXT VALUES (1572871, 0, 0, 0, 0, 0, 0, 2098, 1680, 2197, 1717, -53, 25, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1572872, 1572871, 2032, 1680, 2208, 1680, 0); INSERT INTO GD_LS VALUES (1572873, 1572871, 2208, 1680, 2208, 1568, 1572872); INSERT INTO GD_GE VALUES (1572874, 1572865, 1572867, 42); INSERT INTO GD_CON VALUES (1572874, 1572868, 1572866, 0); INSERT INTO GD_CTXT VALUES (1572874, 0, 0, 0, 0, 0, 0, 2093, 1318, 2174, 1354, -50, -1, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (1572875, 1572874, 2208, 1440, 2208, 1344, 0); INSERT INTO GD_LS VALUES (1572876, 1572874, 2208, 1344, 2016, 1344, 1572875); INSERT INTO O_OBJ VALUES (3145731, 'dogs init', 3, 'INIT', '', 3145734); INSERT INTO O_NBATTR VALUES (3145739, 3145731); INSERT INTO O_BATTR VALUES (3145739, 3145731); INSERT INTO O_ATTR VALUES (3145739, 3145731, 0, 'id', '', '', 'id', 0, 524294); INSERT INTO O_NBATTR VALUES (3145738, 3145731); INSERT INTO O_BATTR VALUES (3145738, 3145731); INSERT INTO O_ATTR VALUES (3145738, 3145731, 3145739, 'current_state', '', '', 'current_state', 0, 524295); INSERT INTO O_ID VALUES (0, 3145731); INSERT INTO O_OIDA VALUES (3145739, 3145731, 0); INSERT INTO SM_ISM VALUES (2097156, 3145731); INSERT INTO SM_SM VALUES (2097156, '', 4); INSERT INTO SM_MOORE VALUES (2097156); INSERT INTO SM_SUPDT VALUES (2097153, 2097156, 0); INSERT INTO SM_STATE VALUES (2097153, 2097156, 2097153, 'Initialization', 1, 0); INSERT INTO SM_LEVT VALUES (2097153, 2097156, 2097153); INSERT INTO SM_SEVT VALUES (2097153, 2097156, 2097153); INSERT INTO SM_EVT VALUES (2097153, 2097156, 2097153, 1, 'init', 0, '', 'INIT1', ''); INSERT INTO SM_SEME VALUES (2097153, 2097153, 2097156, 2097153); INSERT INTO SM_NSTXN VALUES (2097153, 2097156, 2097153, 2097153, 2097153); INSERT INTO SM_TXN VALUES (2097153, 2097156, 2097153, 2097153); INSERT INTO SM_MOAH VALUES (2097153, 2097156, 2097153); INSERT INTO SM_AH VALUES (2097153, 2097156); INSERT INTO SM_ACT VALUES (2097153, 2097156, 1, '// Cats create object instance c1 of C; assign c1.name = "Fifi"; assign c1.number_legs = 4; create object instance c2 of C; assign c2.name = "Foofoo"; assign c2.number_legs = 4; create object instance c3 of C; assign c3.name = "Quif"; assign c3.number_legs = 3; create object instance c4 of C; assign c4.name = "Hairball"; assign c4.number_legs = 4; create object instance c5 of C; assign c5.name = "Slow"; assign c5.number_legs = 2; create object instance c6 of C; assign c6.name = "Dwerp"; assign c6.number_legs = 3; create object instance c7 of C; assign c7.name = "Mongroot"; assign c7.number_legs = 4; create object instance c8 of C; assign c8.name = "Ratflem"; assign c8.number_legs = 3; // Dogs create object instance d1 of D; assign d1.name = "Rohan"; assign d1.number_slashes = 0; create object instance d2 of D; assign d2.name = "Oso"; assign d2.number_slashes = 0; create object instance d3 of D; assign d3.name = "Clifford"; assign d3.number_slashes = 0; // Create the "visible cats" relationship for each dog. relate d1 to c1 across R2; relate d1 to c2 across R2; relate d1 to c3 across R2; relate d2 to c4 across R2; relate d2 to c5 across R2; relate d3 to c6 across R2; relate d3 to c7 across R2; relate d3 to c8 across R2; // Get some chases started generate D2:''cats_located''() to d1; generate D2:''cats_located''() to d2; generate D2:''cats_located''() to d3; ', ''); INSERT INTO GD_MD VALUES (2097153, 8, 2097156, 40, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (2097154, 2097153, 2097153, 41); INSERT INTO GD_SHP VALUES (2097154, 1776, 1264, 2128, 1760); INSERT INTO GD_GE VALUES (2097155, 2097153, 2097153, 42); INSERT INTO GD_CON VALUES (2097155, 2097154, 2097154, 0); INSERT INTO GD_CTXT VALUES (2097155, 0, 0, 0, 0, 0, 0, 2259, 1268, 2332, 1300, 19, 27, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (2097156, 2097155, 2128, 1520, 2256, 1520, 0); INSERT INTO GD_LS VALUES (2097157, 2097155, 2256, 1520, 2256, 1216, 2097156); INSERT INTO GD_LS VALUES (2097158, 2097155, 2256, 1216, 1952, 1216, 2097157); INSERT INTO GD_LS VALUES (2097159, 2097155, 1952, 1216, 1952, 1264, 2097158); INSERT INTO R_SIMP VALUES (3145729); INSERT INTO R_REL VALUES (3145729, 1, '', 3145734); INSERT INTO R_FORM VALUES (3145729, 3145729, 3145729, 1, 1, 'is_chased_by'); INSERT INTO R_RGO VALUES (3145729, 3145729, 3145729); INSERT INTO R_OIR VALUES (3145729, 3145729, 3145729, 0); INSERT INTO R_PART VALUES (3145730, 3145729, 3145730, 0, 1, 'chases'); INSERT INTO R_RTO VALUES (3145730, 3145729, 3145730, 0); INSERT INTO R_OIR VALUES (3145730, 3145729, 3145730, 0); INSERT INTO R_SIMP VALUES (3145730); INSERT INTO R_REL VALUES (3145730, 2, '', 3145734); INSERT INTO R_PART VALUES (3145729, 3145730, 3145731, 0, 1, 'is_seen_by'); INSERT INTO R_RTO VALUES (3145729, 3145730, 3145731, 0); INSERT INTO R_OIR VALUES (3145729, 3145730, 3145731, 0); INSERT INTO R_FORM VALUES (3145730, 3145730, 3145732, 1, 1, 'sees'); INSERT INTO R_RGO VALUES (3145730, 3145730, 3145732); INSERT INTO R_OIR VALUES (3145730, 3145730, 3145732, 0); INSERT INTO CA_COMM VALUES (1048578, 3145734); INSERT INTO CA_SMSMC VALUES (1048578, 1048578, 1572867, 0); INSERT INTO CA_SMSME VALUES (1048578, 1572867, 1572865); INSERT INTO CA_ACC VALUES (1048577, 3145734, 1048578, 0); INSERT INTO CA_SMOA VALUES (1048577, 3145730, 0); INSERT INTO CA_SMOAA VALUES (1048577, 3145734, 3145730); INSERT INTO CA_SMOAA VALUES (1048577, 3145733, 3145730); INSERT INTO CA_ACC VALUES (1048578, 3145734, 1048578, 0); INSERT INTO CA_SMOA VALUES (1048578, 3145729, 0); INSERT INTO CA_SMOAA VALUES (1048578, 3145730, 3145729); INSERT INTO CA_SMOAA VALUES (1048578, 3145729, 3145729); INSERT INTO CA_COMM VALUES (1572866, 3145734); INSERT INTO CA_SMSMC VALUES (1572866, 1572867, 1048578, 0); INSERT INTO CA_SMSME VALUES (1572866, 1048578, 1048580); INSERT INTO CA_ACC VALUES (1572866, 3145734, 1572867, 0); INSERT INTO CA_SMOA VALUES (1572866, 3145730, 0); INSERT INTO CA_SMOAA VALUES (1572866, 3145736, 3145730); INSERT INTO CA_COMM VALUES (2097154, 3145734); INSERT INTO CA_SMSMC VALUES (2097154, 2097156, 1048578, 0); INSERT INTO CA_SMSME VALUES (2097154, 1048578, 1048578); INSERT INTO CA_ACC VALUES (2097155, 3145734, 2097156, 0); INSERT INTO CA_SMOA VALUES (2097155, 3145730, 0); INSERT INTO CA_SMOAA VALUES (2097155, 3145734, 3145730); INSERT INTO CA_SMOAA VALUES (2097155, 3145733, 3145730); INSERT INTO CA_ACC VALUES (2097156, 3145734, 2097156, 0); INSERT INTO CA_SMOA VALUES (2097156, 3145729, 0); INSERT INTO CA_SMOAA VALUES (2097156, 3145730, 3145729); INSERT INTO CA_SMOAA VALUES (2097156, 3145729, 3145729); INSERT INTO GD_MD VALUES (3145741, 5, 3145734, 11, 1, 0, 1, 1, 0, 12, 1600, 4199, 1.000000, 0); INSERT INTO GD_GE VALUES (3145744, 3145741, 3145729, 21); INSERT INTO GD_SHP VALUES (3145744, 1712, 1248, 1888, 1376); INSERT INTO GD_GE VALUES (3145745, 3145741, 3145730, 21); INSERT INTO GD_SHP VALUES (3145745, 2192, 1248, 2368, 1376); INSERT INTO GD_GE VALUES (3145746, 3145741, 3145731, 21); INSERT INTO GD_SHP VALUES (3145746, 1904, 1568, 2080, 1680); INSERT INTO GD_GE VALUES (3145764, 3145741, 3145729, 24); INSERT INTO GD_CON VALUES (3145764, 3145744, 3145745, 0); INSERT INTO GD_CTXT VALUES (3145764, 1893, 1322, 1993, 1352, 35, 1, 2010, 1319, 2060, 1349, -5, 5, 2107, 1332, 2183, 1365, -15, 25); INSERT INTO GD_LS VALUES (3145765, 3145764, 1888, 1312, 2192, 1312, 0); INSERT INTO GD_GE VALUES (3145766, 3145741, 3145730, 24); INSERT INTO GD_CON VALUES (3145766, 3145744, 3145745, 0); INSERT INTO GD_CTXT VALUES (3145766, 1670, 1407, 1770, 1437, -65, 26, 1994, 1404, 2044, 1434, -5, 5, 2275, 1387, 2318, 1419, 44, 6); INSERT INTO GD_LS VALUES (3145767, 3145766, 1776, 1376, 1776, 1424, 0); INSERT INTO GD_LS VALUES (3145768, 3145766, 1776, 1424, 2272, 1424, 3145767); INSERT INTO GD_LS VALUES (3145769, 3145766, 2272, 1424, 2272, 1376, 3145768); INSERT INTO GD_MD VALUES (3145742, 6, 3145734, 11, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (3145747, 3145742, 3145729, 21); INSERT INTO GD_SHP VALUES (3145747, 1712, 1264, 1904, 1328); INSERT INTO GD_GE VALUES (3145748, 3145742, 3145730, 21); INSERT INTO GD_SHP VALUES (3145748, 2192, 1280, 2384, 1344); INSERT INTO GD_GE VALUES (3145749, 3145742, 3145731, 21); INSERT INTO GD_SHP VALUES (3145749, 1904, 1568, 2096, 1632); INSERT INTO GD_GE VALUES (3145750, 3145742, 3145761, 1005); INSERT INTO GD_CON VALUES (3145750, 3145749, 3145747, 0); INSERT INTO GD_CTXT VALUES (3145750, 0, 0, 0, 0, 0, 0, 1872, 1424, 1985, 1461, 8, -6, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3145751, 3145750, 1928, 1568, 1832, 1328, 0); INSERT INTO GD_GE VALUES (3145752, 3145742, 3145763, 1005); INSERT INTO GD_CON VALUES (3145752, 3145747, 3145748, 0); INSERT INTO GD_CTXT VALUES (3145752, 0, 0, 0, 0, 0, 0, 2070, 1271, 2177, 1307, 47, -1, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3145753, 3145752, 1904, 1288, 2192, 1304, 0); INSERT INTO GD_GE VALUES (3145754, 3145742, 3145765, 1005); INSERT INTO GD_CON VALUES (3145754, 3145748, 3145747, 0); INSERT INTO GD_CTXT VALUES (3145754, 0, 0, 0, 0, 0, 0, 1939, 1311, 2060, 1343, -84, 23, 0, 0, 0, 0, 0, 0); INSERT INTO GD_LS VALUES (3145755, 3145754, 2192, 1320, 1904, 1304, 0); INSERT INTO GD_MD VALUES (3145743, 7, 3145734, 11, 1, 0, 1, 1, 0, 12, 1600, 4200, 1.000000, 0); INSERT INTO GD_GE VALUES (3145756, 3145743, 3145729, 21); INSERT INTO GD_SHP VALUES (3145756, 1712, 1264, 1904, 1328); INSERT INTO GD_GE VALUES (3145757, 3145743, 3145730, 21); INSERT INTO GD_SHP VALUES (3145757, 2080, 1280, 2272, 1344); INSERT INTO GD_GE VALUES (3145758, 3145743, 3145731, 21); INSERT INTO GD_SHP VALUES (3145758, 1904, 1568, 2096, 1632);
CREATE TABLE [dbo].[SQLVersion] ( [SQLVersionId] INT IDENTITY (1, 1) NOT NULL, [Name] NVARCHAR (100) NOT NULL, [Description] NVARCHAR (500) NOT NULL, [IsActive] BIT NOT NULL, [CreatedOn] DATETIME CONSTRAINT [DF_SQLVersion_CreatedOn] DEFAULT (getdate()) NOT NULL, [CreatedBy] NVARCHAR (256) CONSTRAINT [DF_SQLVersion_CreatedBy] DEFAULT (suser_sname()) NOT NULL, [LastUpdatedOn] DATETIME CONSTRAINT [DF_SQLVersion_LastUpdatedOn] DEFAULT (getdate()) NOT NULL, [LastUpdatedBy] VARCHAR (50) CONSTRAINT [DF_SQLVersion_LastUpdatedBy] DEFAULT (suser_sname()) NOT NULL, CONSTRAINT [PK_SQLVersion] PRIMARY KEY CLUSTERED ([SQLVersionId] ASC) );
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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. */ -- LANGUAGE_IMPLEMENTATION_VERSION CREATE TABLE IF NOT EXISTS public.language_implementation_version ( language_implementation_version_id SERIAL , language_implementation_version citext NOT NULL DEFAULT '' , benchmark_language_id integer NOT NULL , PRIMARY KEY (language_implementation_version_id, benchmark_language_id) , FOREIGN KEY (benchmark_language_id) REFERENCES public.benchmark_language ); COMMENT ON TABLE public.language_implementation_version IS 'The benchmark language implementation or compiler version, e.g. ' '''CPython 2.7'' or ''PyPy x.y'' or ''gcc 7.3.0'' or ' '''gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0''.'; COMMENT ON COLUMN public.language_implementation_version.language_implementation_version IS 'The version number used in the benchmark environment (e.g. ''2.7'').'; -- CONSTRAINTS ALTER TABLE public.language_implementation_version ADD CONSTRAINT language_implementation_version_check_version_length CHECK (char_length(language_implementation_version) < 255); CREATE UNIQUE INDEX language_implementation_version_unique_index ON public.language_implementation_version (benchmark_language_id, language_implementation_version); COMMENT ON INDEX language_implementation_version_unique_index IS 'Enforce unique implementation versions for the languages.';
CREATE DATABASE IF NOT EXISTS `fortuna` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; USE `fortuna`; CREATE TABLE IF NOT EXISTS `users` ( `UserId` int(11) NOT NULL AUTO_INCREMENT, `Email` varchar(128) NOT NULL, `PassHash` varchar(128) NOT NULL, `Salt` varchar(64) NOT NULL, `Confirm` varchar(64) DEFAULT NULL, `Active` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`UserId`), UNIQUE KEY `UserId_UNIQUE` (`UserId`), UNIQUE KEY `Email_UNIQUE` (`Email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `sessions` ( `SessionId` int(11) NOT NULL AUTO_INCREMENT, `SessionKey` varchar(32) NOT NULL, `UserId` int(11) NOT NULL, `Expires` bigint(20) NOT NULL, `Active` tinyint(1) NOT NULL DEFAULT '1', `Created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `LastUsed` bigint(20) NOT NULL, `UserAgent` text, PRIMARY KEY (`SessionId`), UNIQUE KEY `SessionId_UNIQUE` (`SessionId`), UNIQUE KEY `SessionKey_UNIQUE` (`SessionKey`) ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `workspaces` ( `WorkspaceId` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(45) NOT NULL, `Logo` varchar(128) DEFAULT NULL, PRIMARY KEY (`WorkspaceId`), UNIQUE KEY `Name_UNIQUE` (`Name`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `workspace_users` ( `WorkspaceUserId` int(11) NOT NULL AUTO_INCREMENT, `WorkspaceId` int(11) NOT NULL, `UserId` int(11) DEFAULT NULL, `Role` enum('Member','Admin') NOT NULL DEFAULT 'Member', PRIMARY KEY (`WorkspaceUserId`), UNIQUE KEY `noDup` (`UserId`,`WorkspaceId`), KEY `Workspace_idx` (`WorkspaceId`), KEY `User_idx` (`UserId`), CONSTRAINT `User` FOREIGN KEY (`UserId`) REFERENCES `users` (`UserId`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `UserWorkspace` FOREIGN KEY (`WorkspaceId`) REFERENCES `workspaces` (`WorkspaceId`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `experiments` ( `ExperimentId` int(11) NOT NULL AUTO_INCREMENT, `WorkspaceId` int(11) NOT NULL, `Name` varchar(45) NOT NULL, `Description` text, `Active` tinyint(1) NOT NULL DEFAULT '1', `Endpoint` varchar(64) NOT NULL, `APIKeyHash` varchar(128) NOT NULL, `APIKeySalt` varchar(64) NOT NULL, PRIMARY KEY (`ExperimentId`), KEY `ExperimentWorkspace_idx` (`WorkspaceId`), CONSTRAINT `ExperimentWorkspace` FOREIGN KEY (`WorkspaceId`) REFERENCES `workspaces` (`WorkspaceId`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `outcomes` ( `OutcomeId` int(11) NOT NULL AUTO_INCREMENT, `ExperimentId` int(11) NOT NULL, `Value` text NOT NULL, `Description` text, `Weight` int(11) NOT NULL, PRIMARY KEY (`OutcomeId`), KEY `parentExperiment_idx` (`ExperimentId`), CONSTRAINT `parentExperiment` FOREIGN KEY (`ExperimentId`) REFERENCES `experiments` (`ExperimentId`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `subjects` ( `SubjectId` int(11) NOT NULL AUTO_INCREMENT, `ExperimentId` int(11) NOT NULL, `Identifier` varchar(128) DEFAULT NULL, `AnonymousIdentifier` varchar(128) NOT NULL, PRIMARY KEY (`SubjectId`), UNIQUE KEY `inExpOnce` (`ExperimentId`,`SubjectId`), KEY `ExperimentSubject_idx` (`ExperimentId`), KEY `anonymousId` (`AnonymousIdentifier`), CONSTRAINT `ExperimentSubject` FOREIGN KEY (`ExperimentId`) REFERENCES `experiments` (`ExperimentId`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `results` ( `ResultId` int(11) NOT NULL AUTO_INCREMENT, `ExperimentId` int(11) NOT NULL, `OutcomeId` int(11) DEFAULT NULL, `SubjectId` int(11) DEFAULT NULL, `Active` tinyint(1) NOT NULL DEFAULT '1', PRIMARY KEY (`ResultId`), KEY `ExperimentResult_idx` (`ExperimentId`), KEY `ExperimentSubject_idx` (`SubjectId`), KEY `OutcomeResult_idx` (`OutcomeId`), CONSTRAINT `ExperimentResult` FOREIGN KEY (`ExperimentId`) REFERENCES `experiments` (`ExperimentId`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `OutcomeResult` FOREIGN KEY (`OutcomeId`) REFERENCES `outcomes` (`OutcomeId`) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT `SubjectResult` FOREIGN KEY (`SubjectId`) REFERENCES `subjects` (`SubjectId`) ON DELETE NO ACTION ON UPDATE NO ACTION ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `tbl_platform` ( `id` bigint unsigned, `roleId` int(11) not null, PRIMARY KEY (`id`), UNIQUE KEY `idx_roleId` (`roleId`) ) ENGINE=innodb DEFAULT CHARSET=utf8 COMMENT='平台账号对应角色'; CREATE TABLE `tbl_role` ( `id` int(11) NOT NULL auto_increment, `name` varchar(64), `rank` int(11) not null DEFAULT 0 COMMENT '积分', `money` int(11) not null DEFAULT 0 COMMENT '金钱', `gem` int(11) not null DEFAULT 0 COMMENT '宝石', `p2pPort` int(11) not null DEFAULT 8081 COMMENT 'P2P端口', `regTime` int(11) not null COMMENT '注册时间', `lastLogin` int(11) not null COMMENT '最后登录时间', `missionData` text NOT NULL, `robotData` text NOT NULL, `itemData` text NOT NULL, PRIMARY KEY (`id`) ) ENGINE=innodb DEFAULT CHARSET=utf8 COMMENT='角色信息表';
-- Copyright (c) 2007, 2013, Oracle and/or its affiliates. -- Copyright (c) 2008, 2014, Monty Program Ab & SkySQL Ab -- -- This program is free software; you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation; version 2 of the License. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program; if not, write to the Free Software -- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -- -- The system tables of MySQL Server -- set sql_mode=''; set @orig_storage_engine=@@storage_engine; set storage_engine=myisam; set @have_innodb= (select count(engine) from information_schema.engines where engine='INNODB' and support != 'NO'); SET @innodb_or_myisam=IF(@have_innodb <> 0, 'InnoDB', 'MyISAM'); CREATE TABLE IF NOT EXISTS db ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db,User), KEY User (User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Database privileges'; -- Remember for later if db table already existed set @had_db_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS host ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY Host (Host,Db) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Host privileges; Merged with database privileges'; CREATE TABLE IF NOT EXISTS user ( Host char(60) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Password char(41) character set latin1 collate latin1_bin DEFAULT '' NOT NULL, Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Reload_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Shutdown_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Process_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, File_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_db_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Super_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tmp_table_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Lock_tables_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Execute_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_slave_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Repl_client_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Show_view_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Alter_routine_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_user_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Event_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Trigger_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, Create_tablespace_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, ssl_type enum('','ANY','X509', 'SPECIFIED') COLLATE utf8_general_ci DEFAULT '' NOT NULL, ssl_cipher BLOB NOT NULL, x509_issuer BLOB NOT NULL, x509_subject BLOB NOT NULL, max_questions int(11) unsigned DEFAULT 0 NOT NULL, max_updates int(11) unsigned DEFAULT 0 NOT NULL, max_connections int(11) unsigned DEFAULT 0 NOT NULL, max_user_connections int(11) DEFAULT 0 NOT NULL, plugin char(64) CHARACTER SET latin1 DEFAULT '' NOT NULL, authentication_string TEXT NOT NULL, password_expired ENUM('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, is_role enum('N', 'Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, default_role char(80) binary DEFAULT '' NOT NULL, max_statement_time decimal(12,6) DEFAULT 0 NOT NULL, PRIMARY KEY Host (Host,User) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Users and global privileges'; -- Remember for later if user table already existed set @had_user_table= @@warning_count != 0; CREATE TABLE IF NOT EXISTS roles_mapping ( Host char(60) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Role char(80) binary DEFAULT '' NOT NULL, Admin_option enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, UNIQUE (Host, User, Role)) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Granted roles'; CREATE TABLE IF NOT EXISTS func ( name char(64) binary DEFAULT '' NOT NULL, ret tinyint(1) DEFAULT '0' NOT NULL, dl char(128) DEFAULT '' NOT NULL, type enum ('function','aggregate') COLLATE utf8_general_ci NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User defined functions'; CREATE TABLE IF NOT EXISTS plugin ( name varchar(64) DEFAULT '' NOT NULL, dl varchar(128) DEFAULT '' NOT NULL, PRIMARY KEY (name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_general_ci comment='MySQL plugins'; CREATE TABLE IF NOT EXISTS servers ( Server_name char(64) NOT NULL DEFAULT '', Host char(64) NOT NULL DEFAULT '', Db char(64) NOT NULL DEFAULT '', Username char(80) NOT NULL DEFAULT '', Password char(64) NOT NULL DEFAULT '', Port INT(4) NOT NULL DEFAULT '0', Socket char(64) NOT NULL DEFAULT '', Wrapper char(64) NOT NULL DEFAULT '', Owner char(64) NOT NULL DEFAULT '', PRIMARY KEY (Server_name)) CHARACTER SET utf8 comment='MySQL Foreign Servers table'; CREATE TABLE IF NOT EXISTS tables_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Grantor char(141) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Table_priv set('Select','Insert','Update','Delete','Create','Drop','Grant','References','Index','Alter','Create View','Show view','Trigger') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Table privileges'; CREATE TABLE IF NOT EXISTS columns_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Table_name char(64) binary DEFAULT '' NOT NULL, Column_name char(64) binary DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Column_priv set('Select','Insert','Update','References') COLLATE utf8_general_ci DEFAULT '' NOT NULL, PRIMARY KEY (Host,Db,User,Table_name,Column_name) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Column privileges'; CREATE TABLE IF NOT EXISTS help_topic ( help_topic_id int unsigned not null, name char(64) not null, help_category_id smallint unsigned not null, description text not null, example text not null, url text not null, primary key (help_topic_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help topics'; CREATE TABLE IF NOT EXISTS help_category ( help_category_id smallint unsigned not null, name char(64) not null, parent_category_id smallint unsigned null, url text not null, primary key (help_category_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help categories'; CREATE TABLE IF NOT EXISTS help_relation ( help_topic_id int unsigned not null references help_topic, help_keyword_id int unsigned not null references help_keyword, primary key (help_keyword_id, help_topic_id) ) engine=MyISAM CHARACTER SET utf8 comment='keyword-topic relation'; CREATE TABLE IF NOT EXISTS help_keyword ( help_keyword_id int unsigned not null, name char(64) not null, primary key (help_keyword_id), unique index (name) ) engine=MyISAM CHARACTER SET utf8 comment='help keywords'; CREATE TABLE IF NOT EXISTS time_zone_name ( Name char(64) NOT NULL, Time_zone_id int unsigned NOT NULL, PRIMARY KEY Name (Name) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone names'; CREATE TABLE IF NOT EXISTS time_zone ( Time_zone_id int unsigned NOT NULL auto_increment, Use_leap_seconds enum('Y','N') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL, PRIMARY KEY TzId (Time_zone_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zones'; CREATE TABLE IF NOT EXISTS time_zone_transition ( Time_zone_id int unsigned NOT NULL, Transition_time bigint signed NOT NULL, Transition_type_id int unsigned NOT NULL, PRIMARY KEY TzIdTranTime (Time_zone_id, Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transitions'; CREATE TABLE IF NOT EXISTS time_zone_transition_type ( Time_zone_id int unsigned NOT NULL, Transition_type_id int unsigned NOT NULL, Offset int signed DEFAULT 0 NOT NULL, Is_DST tinyint unsigned DEFAULT 0 NOT NULL, Abbreviation char(8) DEFAULT '' NOT NULL, PRIMARY KEY TzIdTrTId (Time_zone_id, Transition_type_id) ) engine=MyISAM CHARACTER SET utf8 comment='Time zone transition types'; CREATE TABLE IF NOT EXISTS time_zone_leap_second ( Transition_time bigint signed NOT NULL, Correction int signed NOT NULL, PRIMARY KEY TranTime (Transition_time) ) engine=MyISAM CHARACTER SET utf8 comment='Leap seconds information for time zones'; CREATE TABLE IF NOT EXISTS proc (db char(64) collate utf8_bin DEFAULT '' NOT NULL, name char(64) DEFAULT '' NOT NULL, type enum('FUNCTION','PROCEDURE') NOT NULL, specific_name char(64) DEFAULT '' NOT NULL, language enum('SQL') DEFAULT 'SQL' NOT NULL, sql_data_access enum( 'CONTAINS_SQL', 'NO_SQL', 'READS_SQL_DATA', 'MODIFIES_SQL_DATA') DEFAULT 'CONTAINS_SQL' NOT NULL, is_deterministic enum('YES','NO') DEFAULT 'NO' NOT NULL, security_type enum('INVOKER','DEFINER') DEFAULT 'DEFINER' NOT NULL, param_list blob NOT NULL, returns longblob NOT NULL, body longblob NOT NULL, definer char(141) collate utf8_bin DEFAULT '' NOT NULL, created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified timestamp NOT NULL DEFAULT '0000-00-00 00:00:00', sql_mode set( 'REAL_AS_FLOAT', 'PIPES_AS_CONCAT', 'ANSI_QUOTES', 'IGNORE_SPACE', 'IGNORE_BAD_TABLE_OPTIONS', 'ONLY_FULL_GROUP_BY', 'NO_UNSIGNED_SUBTRACTION', 'NO_DIR_IN_CREATE', 'POSTGRESQL', 'ORACLE', 'MSSQL', 'DB2', 'MAXDB', 'NO_KEY_OPTIONS', 'NO_TABLE_OPTIONS', 'NO_FIELD_OPTIONS', 'MYSQL323', 'MYSQL40', 'ANSI', 'NO_AUTO_VALUE_ON_ZERO', 'NO_BACKSLASH_ESCAPES', 'STRICT_TRANS_TABLES', 'STRICT_ALL_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'INVALID_DATES', 'ERROR_FOR_DIVISION_BY_ZERO', 'TRADITIONAL', 'NO_AUTO_CREATE_USER', 'HIGH_NOT_PRECEDENCE', 'NO_ENGINE_SUBSTITUTION', 'PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment text collate utf8_bin NOT NULL, character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db,name,type)) engine=MyISAM character set utf8 comment='Stored Procedures'; CREATE TABLE IF NOT EXISTS procs_priv ( Host char(60) binary DEFAULT '' NOT NULL, Db char(64) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Routine_name char(64) COLLATE utf8_general_ci DEFAULT '' NOT NULL, Routine_type enum('FUNCTION','PROCEDURE') NOT NULL, Grantor char(141) DEFAULT '' NOT NULL, Proc_priv set('Execute','Alter Routine','Grant') COLLATE utf8_general_ci DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (Host,Db,User,Routine_name,Routine_type), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Procedure privileges'; -- Create general_log if CSV is enabled. SET @have_csv = (SELECT support FROM information_schema.engines WHERE engine = 'CSV'); SET @str = IF (@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS general_log (event_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, server_id INTEGER UNSIGNED NOT NULL, command_type VARCHAR(64) NOT NULL, argument MEDIUMTEXT NOT NULL) engine=CSV CHARACTER SET utf8 comment="General log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; -- Create slow_log if CSV is enabled. SET @str = IF (@have_csv = 'YES', 'CREATE TABLE IF NOT EXISTS slow_log (start_time TIMESTAMP(6) NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, user_host MEDIUMTEXT NOT NULL, query_time TIME(6) NOT NULL, lock_time TIME(6) NOT NULL, rows_sent INTEGER NOT NULL, rows_examined INTEGER NOT NULL, db VARCHAR(512) NOT NULL, last_insert_id INTEGER NOT NULL, insert_id INTEGER NOT NULL, server_id INTEGER UNSIGNED NOT NULL, sql_text MEDIUMTEXT NOT NULL, thread_id BIGINT(21) UNSIGNED NOT NULL, rows_affected INTEGER NOT NULL) engine=CSV CHARACTER SET utf8 comment="Slow log"', 'SET @dummy = 0'); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; CREATE TABLE IF NOT EXISTS event ( db char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', name char(64) CHARACTER SET utf8 NOT NULL default '', body longblob NOT NULL, definer char(141) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', execute_at DATETIME default NULL, interval_value int(11) default NULL, interval_field ENUM('YEAR','QUARTER','MONTH','DAY','HOUR','MINUTE','WEEK','SECOND','MICROSECOND','YEAR_MONTH','DAY_HOUR','DAY_MINUTE','DAY_SECOND','HOUR_MINUTE','HOUR_SECOND','MINUTE_SECOND','DAY_MICROSECOND','HOUR_MICROSECOND','MINUTE_MICROSECOND','SECOND_MICROSECOND') default NULL, created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, modified TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00', last_executed DATETIME default NULL, starts DATETIME default NULL, ends DATETIME default NULL, status ENUM('ENABLED','DISABLED','SLAVESIDE_DISABLED') NOT NULL default 'ENABLED', on_completion ENUM('DROP','PRESERVE') NOT NULL default 'DROP', sql_mode set('REAL_AS_FLOAT','PIPES_AS_CONCAT','ANSI_QUOTES','IGNORE_SPACE','IGNORE_BAD_TABLE_OPTIONS','ONLY_FULL_GROUP_BY','NO_UNSIGNED_SUBTRACTION','NO_DIR_IN_CREATE','POSTGRESQL','ORACLE','MSSQL','DB2','MAXDB','NO_KEY_OPTIONS','NO_TABLE_OPTIONS','NO_FIELD_OPTIONS','MYSQL323','MYSQL40','ANSI','NO_AUTO_VALUE_ON_ZERO','NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLES','STRICT_ALL_TABLES','NO_ZERO_IN_DATE','NO_ZERO_DATE','INVALID_DATES','ERROR_FOR_DIVISION_BY_ZERO','TRADITIONAL','NO_AUTO_CREATE_USER','HIGH_NOT_PRECEDENCE','NO_ENGINE_SUBSTITUTION','PAD_CHAR_TO_FULL_LENGTH') DEFAULT '' NOT NULL, comment char(64) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL default '', originator INTEGER UNSIGNED NOT NULL, time_zone char(64) CHARACTER SET latin1 NOT NULL DEFAULT 'SYSTEM', character_set_client char(32) collate utf8_bin, collation_connection char(32) collate utf8_bin, db_collation char(32) collate utf8_bin, body_utf8 longblob, PRIMARY KEY (db, name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT 'Events'; SET @create_innodb_table_stats="CREATE TABLE IF NOT EXISTS innodb_table_stats ( database_name VARCHAR(64) NOT NULL, table_name VARCHAR(64) NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, n_rows BIGINT UNSIGNED NOT NULL, clustered_index_size BIGINT UNSIGNED NOT NULL, sum_of_other_index_sizes BIGINT UNSIGNED NOT NULL, PRIMARY KEY (database_name, table_name) ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0"; SET @create_innodb_index_stats="CREATE TABLE IF NOT EXISTS innodb_index_stats ( database_name VARCHAR(64) NOT NULL, table_name VARCHAR(64) NOT NULL, index_name VARCHAR(64) NOT NULL, last_update TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, /* there are at least: stat_name='size' stat_name='n_leaf_pages' stat_name='n_diff_pfx%' */ stat_name VARCHAR(64) NOT NULL, stat_value BIGINT UNSIGNED NOT NULL, sample_size BIGINT UNSIGNED, stat_description VARCHAR(1024) NOT NULL, PRIMARY KEY (database_name, table_name, index_name, stat_name) ) ENGINE=INNODB DEFAULT CHARSET=utf8 COLLATE=utf8_bin STATS_PERSISTENT=0"; SET @str=IF(@have_innodb <> 0, @create_innodb_table_stats, "SET @dummy = 0"); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; SET @str=IF(@have_innodb <> 0, @create_innodb_index_stats, "SET @dummy = 0"); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; SET @cmd="CREATE TABLE IF NOT EXISTS slave_relay_log_info ( Number_of_lines INTEGER UNSIGNED NOT NULL COMMENT 'Number of lines in the file or rows in the table. Used to version table definitions.', Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the current relay log file.', Relay_log_pos BIGINT UNSIGNED NOT NULL COMMENT 'The relay log position of the last executed event.', Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log file from which the events in the relay log file were read.', Master_log_pos BIGINT UNSIGNED NOT NULL COMMENT 'The master log position of the last executed event.', Sql_delay INTEGER NOT NULL COMMENT 'The number of seconds that the slave must lag behind the master.', Number_of_workers INTEGER UNSIGNED NOT NULL, Id INTEGER UNSIGNED NOT NULL COMMENT 'Internal Id that uniquely identifies this record.', PRIMARY KEY(Id)) DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT 'Relay Log Information'"; SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_myisam); -- Don't create the table; MariaDB will have another implementation #PREPARE stmt FROM @str; #EXECUTE stmt; #DROP PREPARE stmt; SET @cmd= "CREATE TABLE IF NOT EXISTS slave_master_info ( Number_of_lines INTEGER UNSIGNED NOT NULL COMMENT 'Number of lines in the file.', Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL COMMENT 'The name of the master binary log currently being read from the master.', Master_log_pos BIGINT UNSIGNED NOT NULL COMMENT 'The master log position of the last read event.', Host CHAR(64) CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The host name of the master.', User_name TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The user name used to connect to the master.', User_password TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The password used to connect to the master.', Port INTEGER UNSIGNED NOT NULL COMMENT 'The network port used to connect to the master.', Connect_retry INTEGER UNSIGNED NOT NULL COMMENT 'The period (in seconds) that the slave will wait before trying to reconnect to the master.', Enabled_ssl BOOLEAN NOT NULL COMMENT 'Indicates whether the server supports SSL connections.', Ssl_ca TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Authority (CA) certificate.', Ssl_capath TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path to the Certificate Authority (CA) certificates.', Ssl_cert TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL certificate file.', Ssl_cipher TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the cipher in use for the SSL connection.', Ssl_key TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The name of the SSL key file.', Ssl_verify_server_cert BOOLEAN NOT NULL COMMENT 'Whether to verify the server certificate.', Heartbeat FLOAT NOT NULL COMMENT '', Bind TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'Displays which interface is employed when connecting to the MySQL server', Ignored_server_ids TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The number of server IDs to be ignored, followed by the actual server IDs', Uuid TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The master server uuid.', Retry_count BIGINT UNSIGNED NOT NULL COMMENT 'Number of reconnect attempts, to the master, before giving up.', Ssl_crl TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The file used for the Certificate Revocation List (CRL)', Ssl_crlpath TEXT CHARACTER SET utf8 COLLATE utf8_bin COMMENT 'The path used for Certificate Revocation List (CRL) files', Enabled_auto_position BOOLEAN NOT NULL COMMENT 'Indicates whether GTIDs will be used to retrieve events from the master.', PRIMARY KEY(Host, Port)) DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT 'Master Information'"; SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_myisam); -- Don't create the table; MariaDB will have another implementation #PREPARE stmt FROM @str; #EXECUTE stmt; #DROP PREPARE stmt; SET @cmd= "CREATE TABLE IF NOT EXISTS slave_worker_info ( Id INTEGER UNSIGNED NOT NULL, Relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Relay_log_pos BIGINT UNSIGNED NOT NULL, Master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_relay_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_relay_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_master_log_name TEXT CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, Checkpoint_master_log_pos BIGINT UNSIGNED NOT NULL, Checkpoint_seqno INT UNSIGNED NOT NULL, Checkpoint_group_size INTEGER UNSIGNED NOT NULL, Checkpoint_group_bitmap BLOB NOT NULL, PRIMARY KEY(Id)) DEFAULT CHARSET=utf8 STATS_PERSISTENT=0 COMMENT 'Worker Information'"; SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_myisam); -- Don't create the table; MariaDB will have another implementation #PREPARE stmt FROM @str; #EXECUTE stmt; #DROP PREPARE stmt; CREATE TABLE IF NOT EXISTS proxies_priv (Host char(60) binary DEFAULT '' NOT NULL, User char(80) binary DEFAULT '' NOT NULL, Proxied_host char(60) binary DEFAULT '' NOT NULL, Proxied_user char(80) binary DEFAULT '' NOT NULL, With_grant BOOL DEFAULT 0 NOT NULL, Grantor char(141) DEFAULT '' NOT NULL, Timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY Host (Host,User,Proxied_host,Proxied_user), KEY Grantor (Grantor) ) engine=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='User proxy privileges'; -- Remember for later if proxies_priv table already existed set @had_proxies_priv_table= @@warning_count != 0; -- -- Tables unique for MariaDB -- CREATE TABLE IF NOT EXISTS table_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables'; CREATE TABLE IF NOT EXISTS column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varbinary(255) DEFAULT NULL, max_value varbinary(255) DEFAULT NULL, nulls_ratio decimal(12,4) DEFAULT NULL, avg_length decimal(12,4) DEFAULT NULL, avg_frequency decimal(12,4) DEFAULT NULL, hist_size tinyint unsigned, hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB'), histogram varbinary(255), PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns'; CREATE TABLE IF NOT EXISTS index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes'; SET @cmd= "CREATE TABLE IF NOT EXISTS gtid_slave_pos ( domain_id INT UNSIGNED NOT NULL, sub_id BIGINT UNSIGNED NOT NULL, server_id INT UNSIGNED NOT NULL, seq_no BIGINT UNSIGNED NOT NULL, PRIMARY KEY (domain_id, sub_id)) CHARSET=latin1 COMMENT='Replication slave GTID position'"; SET @str=CONCAT(@cmd, ' ENGINE=', @innodb_or_myisam); PREPARE stmt FROM @str; EXECUTE stmt; DROP PREPARE stmt; set storage_engine=@orig_storage_engine;
-- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Feb 02, 2019 at 02:56 AM -- Server version: 10.1.36-MariaDB -- PHP Version: 7.2.11 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 */; -- -- Database: `perpustakaan` -- -- -------------------------------------------------------- -- -- Table structure for table `anggota` -- CREATE TABLE `anggota` ( `nis` int(20) NOT NULL, `nama_anggota` varchar(100) NOT NULL, `jk` text NOT NULL, `alamat` varchar(100) NOT NULL, `tempat_lahir` varchar(30) NOT NULL, `tanggal_lahir` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `anggota` -- INSERT INTO `anggota` (`nis`, `nama_anggota`, `jk`, `alamat`, `tempat_lahir`, `tanggal_lahir`) VALUES (12161522, 'Ikrom Syakur', 'Laki-laki', 'sedayu', 'sedayu', '1997-12-12'), (12161531, 'Rahma Sunita', 'Perempuan', 'Bengkulu', 'Bengkulu', '1995-01-30'), (12161532, 'Rahmat Arifin', 'Laki-laki', 'Gunung kunci tirtohargo', '', '0000-00-00'), (12161535, 'Rudi Setyawan', 'Laki-laki', 'Lampung', '', '0000-00-00'); -- -------------------------------------------------------- -- -- Table structure for table `buku` -- CREATE TABLE `buku` ( `kode_buku` int(10) NOT NULL, `judul` varchar(100) NOT NULL, `pengarang` varchar(50) NOT NULL, `kode_kategori` text NOT NULL, `tahun_terbit` varchar(10) NOT NULL, `penerbit` varchar(99) NOT NULL, `isbn` varchar(99) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `buku` -- INSERT INTO `buku` (`kode_buku`, `judul`, `pengarang`, `kode_kategori`, `tahun_terbit`, `penerbit`, `isbn`) VALUES (1201191, 'King of hell', 'coy too sik', '3', '2005', 'Yoonko', '12-ada-34-4565'), (1201193, 'cara memanjangkan rambut yang benar', 'j. marsudi', '2', '', '', ''), (1920119, 'Titisan Cinta', 'Fredy S.', '2', '', '', ''); -- -------------------------------------------------------- -- -- Table structure for table `kategori` -- CREATE TABLE `kategori` ( `kode_kategori` int(10) NOT NULL, `jenis_kategori` varchar(55) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `kategori` -- INSERT INTO `kategori` (`kode_kategori`, `jenis_kategori`) VALUES (1, 'Sejarah'), (2, 'Fiksi'), (3, 'Romance'), (4, 'Demon'); -- -------------------------------------------------------- -- -- Table structure for table `petugas` -- CREATE TABLE `petugas` ( `id_petugas` int(10) NOT NULL, `nama_petugas` varchar(50) NOT NULL, `username` varchar(100) NOT NULL, `password` varchar(100) NOT NULL, `level` varchar(10) NOT NULL, `alamat` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `petugas` -- INSERT INTO `petugas` (`id_petugas`, `nama_petugas`, `username`, `password`, `level`, `alamat`) VALUES (1, 'admin', 'tugas', '0192023a7bbd73250516f069df18b500', 'admin', ''), (121, 'sony', 'norh3m', 'c56cb0b654928b752a8694b9b51605f7', 'petugas', ''), (12151423, 'admin', 'admin', '21232f297a57a5a743894a0e4a801fc3', 'admin', ''), (12161532, 'Rahmat', 'ksl1', '5f2f6d13a6ae65943ecccceaa237057f', 'petugas', ''); -- -------------------------------------------------------- -- -- Table structure for table `transaksi` -- CREATE TABLE `transaksi` ( `kode_transaksi` int(99) NOT NULL, `nis` int(50) NOT NULL, `kode_buku` int(50) NOT NULL, `tanggal_pinjam` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `tanggal_kembali` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, `denda` int(20) NOT NULL, `status` varchar(10) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `transaksi` -- INSERT INTO `transaksi` (`kode_transaksi`, `nis`, `kode_buku`, `tanggal_pinjam`, `tanggal_kembali`, `denda`, `status`) VALUES (131344, 12161522, 1201191, '2019-01-26 00:00:00', '2019-01-30 07:43:48', 0, 'kembali'), (345543, 12161522, 1201191, '2019-01-26 06:43:13', '2019-01-26 07:35:24', 0, 'kembali'), (454345, 12161532, 1201191, '2019-01-30 13:41:19', NULL, 0, 'pinjam'), (656688, 12161532, 1201191, '2019-01-10 00:00:00', '2019-01-30 07:45:46', 13000, 'kembali'), (1221211, 12161535, 1201191, '2019-01-01 00:00:00', '2019-01-26 07:34:34', 18000, 'kembali'), (1233321, 12161532, 1201193, '2019-01-26 06:21:16', '2019-01-26 07:35:13', 0, 'kembali'), (45455544, 12161532, 1201191, '2019-01-11 07:31:44', '2019-01-30 04:43:02', 12000, 'kembali'), (121233322, 12161532, 1201193, '2019-01-29 03:52:06', '2019-01-30 07:34:32', 0, 'kembali'); -- -- Indexes for dumped tables -- -- -- Indexes for table `anggota` -- ALTER TABLE `anggota` ADD PRIMARY KEY (`nis`), ADD UNIQUE KEY `nis` (`nis`); -- -- Indexes for table `buku` -- ALTER TABLE `buku` ADD PRIMARY KEY (`kode_buku`); -- -- Indexes for table `kategori` -- ALTER TABLE `kategori` ADD PRIMARY KEY (`kode_kategori`); -- -- Indexes for table `petugas` -- ALTER TABLE `petugas` ADD PRIMARY KEY (`id_petugas`); -- -- Indexes for table `transaksi` -- ALTER TABLE `transaksi` ADD PRIMARY KEY (`kode_transaksi`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `kategori` -- ALTER TABLE `kategori` MODIFY `kode_kategori` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `petugas` -- ALTER TABLE `petugas` MODIFY `id_petugas` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12161533; 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 */;
-- use text for groups ALTER TABLE `sys_user` CHANGE `groups` `groups` TEXT;
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 30, 2020 at 06:31 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.5 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: `simple_blogs` -- -- -------------------------------------------------------- -- -- Table structure for table `categories` -- CREATE TABLE `categories` ( `id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `categories` -- INSERT INTO `categories` (`id`, `name`, `created_at`, `updated_at`) VALUES (1, 'Coba Update 2', '2020-09-29 00:06:50', '2020-09-29 06:29:25'), (6, 'instagram', '2020-09-29 03:10:22', '2020-09-29 03:10:22'), (7, 'instagram', '2020-09-29 03:10:31', '2020-09-29 03:10:31'), (9, 'asa', '2020-09-29 19:04:58', '2020-09-29 19:04:58'), (10, 'asa', '2020-09-30 06:03:35', '2020-09-30 06:03:35'), (11, 'asa', '2020-09-30 06:04:44', '2020-09-30 06:04:44'); -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED 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; -- -------------------------------------------------------- -- -- Table structure for table `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; -- -- Dumping data for table `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, '2020_09_29_065058_categories', 1), (5, '2020_09_29_065332_news', 1), (6, '2016_06_01_000001_create_oauth_auth_codes_table', 2), (7, '2016_06_01_000002_create_oauth_access_tokens_table', 2), (8, '2016_06_01_000003_create_oauth_refresh_tokens_table', 2), (9, '2016_06_01_000004_create_oauth_clients_table', 2), (10, '2016_06_01_000005_create_oauth_personal_access_clients_table', 2); -- -------------------------------------------------------- -- -- Table structure for table `news` -- CREATE TABLE `news` ( `id` int(10) UNSIGNED NOT NULL, `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `content` text COLLATE utf8mb4_unicode_ci NOT NULL, `category_id` int(10) UNSIGNED NOT NULL, `author` bigint(20) UNSIGNED DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `news` -- INSERT INTO `news` (`id`, `title`, `content`, `category_id`, `author`, `created_at`, `updated_at`) VALUES (2, 'Eius consequatur quo et eum necessitatibus quia commodi. Possimus labore blanditiis qui nostrum. Nam ullam laudantium voluptatem hic eveniet accusamus.', 'Odio deleniti iure quidem natus libero. Non et est exercitationem labore velit ut sint. Rerum eligendi quidem ab ex.', 1, NULL, '2020-09-29 00:06:50', '2020-09-29 00:06:50'), (17, 'Ratione dolorem maxime exercitationem voluptate quia. Consequatur ut assumenda sit ut quaerat ut eos. Autem dignissimos est est.', 'Dolorum qui aut libero ut ea cum illum. Est adipisci beatae voluptas omnis. Accusantium ut velit omnis similique.', 1, NULL, '2020-09-29 00:06:50', '2020-09-29 00:06:50'), (19, 'Occaecati vel expedita laudantium ad. Consequatur quis et odit facere. Hic aperiam illum iste corporis. Vero qui qui maiores omnis.', 'Itaque reprehenderit voluptatem atque quam. Laborum optio et repellat nemo. Voluptatem quis voluptatem rem eveniet illum et. Qui rerum eum ipsam odio ut sed dolore totam. Sed et autem voluptatem est similique quis adipisci.', 1, NULL, '2020-09-29 00:06:50', '2020-09-29 00:06:50'), (20, 'Fugiat non id qui doloremque. Occaecati commodi qui qui. Harum quidem beatae hic. Qui dolor sunt aliquam consequatur magnam qui quia ut.', 'Quod aut neque ex similique illum quibusdam ipsa. Delectus et possimus dolorem distinctio. Et et nemo dolores labore ut.', 1, NULL, '2020-09-29 00:06:50', '2020-09-29 00:06:50'), (21, 'test input', 'content input', 1, NULL, '2020-09-29 03:58:38', '2020-09-29 03:58:38'), (22, 'test input', 'content input', 1, NULL, '2020-09-29 04:00:14', '2020-09-29 04:00:14'), (23, 'test input', 'content input', 1, NULL, '2020-09-29 04:00:23', '2020-09-29 04:00:23'), (25, 'test input', 'content input', 1, NULL, '2020-09-29 19:05:22', '2020-09-29 19:05:22'), (26, 'test input', 'content input', 1, NULL, '2020-09-30 06:07:49', '2020-09-30 06:07:49'), (27, 'test input with author', 'content input', 1, 1, '2020-09-30 06:36:21', '2020-09-30 06:36:21'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_access_tokens` -- CREATE TABLE `oauth_access_tokens` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint(20) DEFAULT NULL, `client_id` int(10) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `revoked` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `oauth_access_tokens` -- INSERT INTO `oauth_access_tokens` (`id`, `user_id`, `client_id`, `name`, `scopes`, `revoked`, `created_at`, `updated_at`, `expires_at`) VALUES ('4278cdcb100238a0796b55e19bf0e0d892f5a89e86f002d33fd853c45f989f1baae59472d14c24f8', 1, 1, 'app', '[]', 0, '2020-09-30 03:46:26', '2020-09-30 03:46:26', '2021-09-30 10:46:26'), ('983be7d528dbea65c53b85fc8fff28807fe8e91ecf2403964b6ce3b5e52fce1af4d27340e8eb40ea', 1, 1, 'app', '[]', 0, '2020-09-30 06:02:00', '2020-09-30 06:02:00', '2021-09-30 13:02:00'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_auth_codes` -- CREATE TABLE `oauth_auth_codes` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `user_id` bigint(20) NOT NULL, `client_id` int(10) UNSIGNED NOT NULL, `scopes` text COLLATE utf8mb4_unicode_ci DEFAULT NULL, `revoked` tinyint(1) NOT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `oauth_clients` -- CREATE TABLE `oauth_clients` ( `id` int(10) UNSIGNED NOT NULL, `user_id` bigint(20) DEFAULT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `secret` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `redirect` text COLLATE utf8mb4_unicode_ci NOT NULL, `personal_access_client` tinyint(1) NOT NULL, `password_client` tinyint(1) NOT NULL, `revoked` tinyint(1) NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `oauth_clients` -- INSERT INTO `oauth_clients` (`id`, `user_id`, `name`, `secret`, `redirect`, `personal_access_client`, `password_client`, `revoked`, `created_at`, `updated_at`) VALUES (1, NULL, 'Laravel Personal Access Client', 'QFdGzQxvxqlGKpJLXS8nKt7H9hNfo2E7kkiKiFNo', 'http://localhost', 1, 0, 0, '2020-09-29 20:07:36', '2020-09-29 20:07:36'), (2, NULL, 'Laravel Password Grant Client', 'dRixpVtOrVWcCjxBwtwCgutv9ckRhKWcscEn90ZN', 'http://localhost', 0, 1, 0, '2020-09-29 20:07:36', '2020-09-29 20:07:36'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_personal_access_clients` -- CREATE TABLE `oauth_personal_access_clients` ( `id` int(10) UNSIGNED NOT NULL, `client_id` int(10) UNSIGNED NOT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `oauth_personal_access_clients` -- INSERT INTO `oauth_personal_access_clients` (`id`, `client_id`, `created_at`, `updated_at`) VALUES (1, 1, '2020-09-29 20:07:36', '2020-09-29 20:07:36'); -- -------------------------------------------------------- -- -- Table structure for table `oauth_refresh_tokens` -- CREATE TABLE `oauth_refresh_tokens` ( `id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `access_token_id` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL, `revoked` tinyint(1) NOT NULL, `expires_at` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `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; -- -------------------------------------------------------- -- -- Table structure for table `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; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Didik Mulyadi', 'didikmulyadi12@gmail.com', NULL, '$2y$10$PbrNcYdsCOQKGzdBFIDb3e0jNYXalYU5/HClZP/jOcHiyxEZYvOYK', NULL, '2020-09-29 21:59:41', '2020-09-29 21:59:41'), (3, 'Encep Nurdin', 'encepnurdin185@gmail.com', NULL, '$2y$10$3V/V2RIRA1O8goPUBInAze75YH5/GDv3.zvE7PZMLSY/WcAPfKzIK', NULL, '2020-09-29 22:02:38', '2020-09-29 22:02:38'); -- -- Indexes for dumped tables -- -- -- Indexes for table `categories` -- ALTER TABLE `categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `news` -- ALTER TABLE `news` ADD PRIMARY KEY (`id`), ADD KEY `news_category_id_foreign` (`category_id`), ADD KEY `news_author_foreign` (`author`); -- -- Indexes for table `oauth_access_tokens` -- ALTER TABLE `oauth_access_tokens` ADD PRIMARY KEY (`id`), ADD KEY `oauth_access_tokens_user_id_index` (`user_id`); -- -- Indexes for table `oauth_auth_codes` -- ALTER TABLE `oauth_auth_codes` ADD PRIMARY KEY (`id`); -- -- Indexes for table `oauth_clients` -- ALTER TABLE `oauth_clients` ADD PRIMARY KEY (`id`), ADD KEY `oauth_clients_user_id_index` (`user_id`); -- -- Indexes for table `oauth_personal_access_clients` -- ALTER TABLE `oauth_personal_access_clients` ADD PRIMARY KEY (`id`), ADD KEY `oauth_personal_access_clients_client_id_index` (`client_id`); -- -- Indexes for table `oauth_refresh_tokens` -- ALTER TABLE `oauth_refresh_tokens` ADD PRIMARY KEY (`id`), ADD KEY `oauth_refresh_tokens_access_token_id_index` (`access_token_id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `categories` -- ALTER TABLE `categories` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12; -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `news` -- ALTER TABLE `news` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=28; -- -- AUTO_INCREMENT for table `oauth_clients` -- ALTER TABLE `oauth_clients` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `oauth_personal_access_clients` -- ALTER TABLE `oauth_personal_access_clients` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- Constraints for dumped tables -- -- -- Constraints for table `news` -- ALTER TABLE `news` ADD CONSTRAINT `news_author_foreign` FOREIGN KEY (`author`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, ADD CONSTRAINT `news_category_id_foreign` FOREIGN KEY (`category_id`) REFERENCES `categories` (`id`) ON DELETE CASCADE ON UPDATE 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 */;
-- Drops the burgers_db if it already exists -- DROP DATABASE IF EXISTS burgers_db; -- Create the database burgers_db and specified it for use. CREATE DATABASE burgers_db; USE burgers_db; -- Create the table plans. CREATE TABLE burgers ( id int NOT NULL AUTO_INCREMENT, burger_name varchar(255) NOT NULL, devoured boolean, PRIMARY KEY (id) );
DELIMITER $$ CREATE FUNCTION emp_info(p_first_name varchar(255), p_last_name varchar(255)) RETURNS decimal(10,2) BEGIN DECLARE v_max_from_date date; DECLARE v_salary decimal(10,2); SELECT MAX(from_date) INTO v_max_from_date FROM employees e JOIN salaries s ON e.emp_no = s.emp_no WHERE e.first_name = p_first_name AND e.last_name = p_last_name; SELECT s.salary INTO v_salary FROM employees e JOIN salaries s ON e.emp_no = s.emp_no WHERE e.first_name = p_first_name AND e.last_name = p_last_name AND s.from_date = v_max_from_date; RETURN v_salary; END$$ DELIMITER ; SELECT EMP_INFO('Aruna', 'Journel');
CREATE FUNCTION tracked_deletes_datavalidation.RuleStatusDescriptor_TR_DelTrkg() RETURNS trigger AS $BODY$ BEGIN INSERT INTO tracked_deletes_datavalidation.RuleStatusDescriptor(RuleStatusDescriptorId, Id, ChangeVersion) SELECT OLD.RuleStatusDescriptorId, Id, nextval('changes.ChangeVersionSequence') FROM edfi.Descriptor WHERE DescriptorId = OLD.RuleStatusDescriptorId; RETURN NULL; END; $BODY$ LANGUAGE plpgsql; CREATE TRIGGER TrackDeletes AFTER DELETE ON datavalidation.RuleStatusDescriptor FOR EACH ROW EXECUTE PROCEDURE tracked_deletes_datavalidation.RuleStatusDescriptor_TR_DelTrkg(); CREATE FUNCTION tracked_deletes_datavalidation.RunStatusDescriptor_TR_DelTrkg() RETURNS trigger AS $BODY$ BEGIN INSERT INTO tracked_deletes_datavalidation.RunStatusDescriptor(RunStatusDescriptorId, Id, ChangeVersion) SELECT OLD.RunStatusDescriptorId, Id, nextval('changes.ChangeVersionSequence') FROM edfi.Descriptor WHERE DescriptorId = OLD.RunStatusDescriptorId; RETURN NULL; END; $BODY$ LANGUAGE plpgsql; CREATE TRIGGER TrackDeletes AFTER DELETE ON datavalidation.RunStatusDescriptor FOR EACH ROW EXECUTE PROCEDURE tracked_deletes_datavalidation.RunStatusDescriptor_TR_DelTrkg(); CREATE FUNCTION tracked_deletes_datavalidation.SeverityDescriptor_TR_DelTrkg() RETURNS trigger AS $BODY$ BEGIN INSERT INTO tracked_deletes_datavalidation.SeverityDescriptor(SeverityDescriptorId, Id, ChangeVersion) SELECT OLD.SeverityDescriptorId, Id, nextval('changes.ChangeVersionSequence') FROM edfi.Descriptor WHERE DescriptorId = OLD.SeverityDescriptorId; RETURN NULL; END; $BODY$ LANGUAGE plpgsql; CREATE TRIGGER TrackDeletes AFTER DELETE ON datavalidation.SeverityDescriptor FOR EACH ROW EXECUTE PROCEDURE tracked_deletes_datavalidation.SeverityDescriptor_TR_DelTrkg(); CREATE FUNCTION tracked_deletes_datavalidation.ValidationLogicTypeDescriptor_TR_DelTrkg() RETURNS trigger AS $BODY$ BEGIN INSERT INTO tracked_deletes_datavalidation.ValidationLogicTypeDescriptor(ValidationLogicTypeDescriptorId, Id, ChangeVersion) SELECT OLD.ValidationLogicTypeDescriptorId, Id, nextval('changes.ChangeVersionSequence') FROM edfi.Descriptor WHERE DescriptorId = OLD.ValidationLogicTypeDescriptorId; RETURN NULL; END; $BODY$ LANGUAGE plpgsql; CREATE TRIGGER TrackDeletes AFTER DELETE ON datavalidation.ValidationLogicTypeDescriptor FOR EACH ROW EXECUTE PROCEDURE tracked_deletes_datavalidation.ValidationLogicTypeDescriptor_TR_DelTrkg(); CREATE FUNCTION tracked_deletes_datavalidation.ValidationResult_TR_DelTrkg() RETURNS trigger AS $BODY$ BEGIN INSERT INTO tracked_deletes_datavalidation.ValidationResult(ResourceType, ResultIdentifier, Id, ChangeVersion) VALUES (OLD.ResourceType, OLD.ResultIdentifier, OLD.Id, nextval('changes.ChangeVersionSequence')); RETURN NULL; END; $BODY$ LANGUAGE plpgsql; CREATE TRIGGER TrackDeletes AFTER DELETE ON datavalidation.ValidationResult FOR EACH ROW EXECUTE PROCEDURE tracked_deletes_datavalidation.ValidationResult_TR_DelTrkg(); CREATE FUNCTION tracked_deletes_datavalidation.ValidationRule_TR_DelTrkg() RETURNS trigger AS $BODY$ BEGIN INSERT INTO tracked_deletes_datavalidation.ValidationRule(RuleIdentifier, RuleSource, Id, ChangeVersion) VALUES (OLD.RuleIdentifier, OLD.RuleSource, OLD.Id, nextval('changes.ChangeVersionSequence')); RETURN NULL; END; $BODY$ LANGUAGE plpgsql; CREATE TRIGGER TrackDeletes AFTER DELETE ON datavalidation.ValidationRule FOR EACH ROW EXECUTE PROCEDURE tracked_deletes_datavalidation.ValidationRule_TR_DelTrkg(); CREATE FUNCTION tracked_deletes_datavalidation.ValidationRun_TR_DelTrkg() RETURNS trigger AS $BODY$ BEGIN INSERT INTO tracked_deletes_datavalidation.ValidationRun(Host, RuleEngine, RunIdentifier, Id, ChangeVersion) VALUES (OLD.Host, OLD.RuleEngine, OLD.RunIdentifier, OLD.Id, nextval('changes.ChangeVersionSequence')); RETURN NULL; END; $BODY$ LANGUAGE plpgsql; CREATE TRIGGER TrackDeletes AFTER DELETE ON datavalidation.ValidationRun FOR EACH ROW EXECUTE PROCEDURE tracked_deletes_datavalidation.ValidationRun_TR_DelTrkg();
DROP DATABASE IF EXISTS employeeTracker_db; CREATE DATABASE employeeTracker_db; USE employeeTracker_db; CREATE TABLE employee ( id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, first_name VARCHAR(30) NOT NULL, last_name VARCHAR(30) NOT NULL, role_id INT NOT NULL, manager_id INT, FOREIGN KEY (role_id) REFERENCES role(id), FOREIGN KEY (manager_id) REFERENCES employee(id) ); CREATE TABLE role ( id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, title VARCHAR(30) NOT NULL, salary DECIMAL NOT NULL, department_id INT NOT NULL, FOREIGN KEY (department_id) REFERENCES department(id) ); CREATE TABLE department ( id INT PRIMARY KEY AUTO_INCREMENT NOT NULL, name VARCHAR(30) NOT NULL );
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; CREATE TABLE routes ( id UUID DEFAULT uuid_generate_v4() PRIMARY KEY, slug VARCHAR NOT NULL UNIQUE , creator_id UUID, target VARCHAR NOT NULL, active BOOLEAN NOT NULL DEFAULT 't', active_from TIMESTAMP, -- time based activation active_till TIMESTAMP, -- time based deactivation created_at TIMESTAMP NOT NULL DEFAULT current_timestamp, updated_at TIMESTAMP NOT NULL DEFAULT current_timestamp, CONSTRAINT fk_creator FOREIGN KEY(creator_id) REFERENCES users(id) ); -- To automatically refresh updated_at CREATE OR REPLACE FUNCTION refresh_r_updated_at() RETURNS TRIGGER AS $$ BEGIN IF row(NEW.*) IS DISTINCT FROM row(OLD.*) THEN NEW.updated_at = now(); RETURN NEW; ELSE RETURN OLD; END IF; END; $$ language 'plpgsql'; CREATE TRIGGER refresh_route_updated_at BEFORE UPDATE ON routes FOR EACH ROW EXECUTE PROCEDURE refresh_r_updated_at();
SET DEFINE OFF; ALTER TABLE AFW_01_EVENM_NOTFB ADD ( CONSTRAINT AFW_01_EVENM_NOTFB_UK1 UNIQUE (CODE, REF_STRUC_APLIC) ENABLE VALIDATE) /
create table customer (id InT PRIMARY KEY AUTO ONCREMENT, firstname VARCHAR(30), lastname VARCHAR(30));
CREATE TABLE IF NOT EXISTS %pre%post ( log_ID int(11) NOT NULL AUTO_INCREMENT, log_CateID int(11) NOT NULL DEFAULT '0', log_AuthorID int(11) NOT NULL DEFAULT '0', log_Tag varchar(250) NOT NULL DEFAULT '', log_Status tinyint(4) NOT NULL DEFAULT '0', log_Type int(11) NOT NULL DEFAULT '0', log_Alias varchar(250) NOT NULL DEFAULT '', log_IsTop tinyint(4) NOT NULL DEFAULT '0', log_IsLock tinyint(4) NOT NULL DEFAULT '0', log_Title varchar(250) NOT NULL DEFAULT '', log_Intro text NOT NULL, log_Content longtext NOT NULL, log_CreateTime int(11) NOT NULL DEFAULT '0', log_PostTime int(11) NOT NULL DEFAULT '0', log_UpdateTime int(11) NOT NULL DEFAULT '0', log_CommNums int(11) NOT NULL DEFAULT '0', log_ViewNums int(11) NOT NULL DEFAULT '0', log_Template varchar(250) NOT NULL DEFAULT '', log_FirstImg varchar(250) NOT NULL DEFAULT '', log_Thumb varchar(250) NOT NULL DEFAULT '', log_Meta longtext NOT NULL, PRIMARY KEY (log_ID), KEY %pre%log_TPISC (log_Type,log_PostTime,log_IsTop,log_Status,log_CateID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS %pre%category ( cate_ID int(11) NOT NULL AUTO_INCREMENT, cate_Name varchar(250) NOT NULL DEFAULT '', cate_Order int(11) NOT NULL DEFAULT '0', cate_Type int(11) NOT NULL DEFAULT '0', cate_Count int(11) NOT NULL DEFAULT '0', cate_Alias varchar(250) NOT NULL DEFAULT '', cate_Group varchar(250) NOT NULL DEFAULT '', cate_Intro text NOT NULL, cate_RootID int(11) NOT NULL DEFAULT '0', cate_ParentID int(11) NOT NULL DEFAULT '0', cate_Template varchar(250) NOT NULL DEFAULT '', cate_LogTemplate varchar(250) NOT NULL DEFAULT '', cate_Meta longtext NOT NULL, PRIMARY KEY (cate_ID), KEY %pre%cate_Order (cate_Order) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS %pre%comment ( comm_ID int(11) NOT NULL AUTO_INCREMENT, comm_LogID int(11) NOT NULL DEFAULT '0', comm_IsChecking tinyint(4) NOT NULL DEFAULT '0', comm_RootID int(11) NOT NULL DEFAULT '0', comm_ParentID int(11) NOT NULL DEFAULT '0', comm_AuthorID int(11) NOT NULL DEFAULT '0', comm_Name varchar(250) NOT NULL DEFAULT '', comm_Email varchar(250) NOT NULL DEFAULT '', comm_HomePage varchar(250) NOT NULL DEFAULT '', comm_Content text NOT NULL, comm_PostTime int(11) NOT NULL DEFAULT '0', comm_IP varchar(250) NOT NULL DEFAULT '', comm_Agent text NOT NULL, comm_Meta longtext NOT NULL, PRIMARY KEY (comm_ID), KEY %pre%comm_LRI (comm_LogID,comm_RootID,comm_IsChecking), KEY %pre%comm_IsChecking (comm_IsChecking) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS %pre%config ( conf_ID int(11) NOT NULL AUTO_INCREMENT, conf_Name varchar(250) NOT NULL DEFAULT '', conf_Key varchar(250) NOT NULL DEFAULT '', conf_Value longtext NOT NULL, PRIMARY KEY (conf_ID), KEY %pre%conf_Name (conf_Name) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; CREATE TABLE IF NOT EXISTS %pre%member ( mem_ID int(11) NOT NULL AUTO_INCREMENT, mem_Guid varchar(36) NOT NULL DEFAULT '', mem_Level tinyint(4) NOT NULL DEFAULT '0', mem_Status tinyint(4) NOT NULL DEFAULT '0', mem_Name varchar(250) NOT NULL DEFAULT '', mem_Password varchar(250) NOT NULL DEFAULT '', mem_Email varchar(250) NOT NULL DEFAULT '', mem_HomePage varchar(250) NOT NULL DEFAULT '', mem_IP varchar(250) NOT NULL DEFAULT '', mem_CreateTime int(11) NOT NULL DEFAULT '0', mem_PostTime int(11) NOT NULL DEFAULT '0', mem_UpdateTime int(11) NOT NULL DEFAULT '0', mem_Alias varchar(250) NOT NULL DEFAULT '', mem_Intro text NOT NULL, mem_Articles int(11) NOT NULL DEFAULT '0', mem_Pages int(11) NOT NULL DEFAULT '0', mem_Comments int(11) NOT NULL DEFAULT '0', mem_Uploads int(11) NOT NULL DEFAULT '0', mem_Template varchar(250) NOT NULL DEFAULT '', mem_Meta longtext NOT NULL, PRIMARY KEY (mem_ID), KEY %pre%mem_Name (mem_Name), KEY %pre%mem_Alias (mem_Alias), KEY %pre%mem_Level (mem_Level) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS %pre%module ( mod_ID int(11) NOT NULL AUTO_INCREMENT, mod_Name varchar(250) NOT NULL DEFAULT '', mod_FileName varchar(250) NOT NULL DEFAULT '', mod_Content text NOT NULL, mod_SidebarID int(11) NOT NULL DEFAULT '0', mod_HtmlID varchar(250) NOT NULL DEFAULT '', mod_Type varchar(5) NOT NULL DEFAULT '', mod_MaxLi int(11) NOT NULL DEFAULT '0', mod_Source varchar(250) NOT NULL DEFAULT '', mod_IsHideTitle tinyint(4) NOT NULL DEFAULT '0', mod_Meta longtext NOT NULL, PRIMARY KEY (mod_ID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS %pre%tag ( tag_ID int(11) NOT NULL AUTO_INCREMENT, tag_Name varchar(250) NOT NULL DEFAULT '', tag_Order int(11) NOT NULL DEFAULT '0', tag_Type int(11) NOT NULL DEFAULT '0', tag_Count int(11) NOT NULL DEFAULT '0', tag_Alias varchar(250) NOT NULL DEFAULT '', tag_Group varchar(250) NOT NULL DEFAULT '', tag_Intro text NOT NULL, tag_Template varchar(250) NOT NULL DEFAULT '', tag_Meta longtext NOT NULL, PRIMARY KEY (tag_ID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ; CREATE TABLE IF NOT EXISTS %pre%upload ( ul_ID int(11) NOT NULL AUTO_INCREMENT, ul_AuthorID int(11) NOT NULL DEFAULT '0', ul_Size integer NOT NULL DEFAULT 0, ul_Name varchar(250) NOT NULL DEFAULT '', ul_SourceName varchar(250) NOT NULL DEFAULT '', ul_MimeType varchar(250) NOT NULL DEFAULT '', ul_PostTime int(11) NOT NULL DEFAULT '0', ul_DownNums int(11) NOT NULL DEFAULT '0', ul_LogID int(11) NOT NULL DEFAULT '0', ul_Intro text NOT NULL, ul_Meta longtext NOT NULL, PRIMARY KEY (ul_ID) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci AUTO_INCREMENT=1 ;
IF NOT EXISTS (select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='sa' and TABLE_NAME='sa_alueluokitus') BEGIN CREATE TABLE sa.sa_alueluokitus( id bigint IDENTITY(1,1) NOT NULL, koodi nvarchar(3) NOT NULL, nimi nvarchar(200) NULL, nimi_sv nvarchar(200) NULL, nimi_en nvarchar(200) NULL, alkupvm date NULL, loppupvm date NULL, maakuntakoodi nvarchar(3) NULL, maakuntanimi nvarchar(200) NULL, maakuntanimi_sv nvarchar(200) NULL, maakuntanimi_en nvarchar(200) NULL, avikoodi nvarchar(2) NULL, avinimi nvarchar(200) NULL, avinimi_sv nvarchar(200) NULL, avinimi_en nvarchar(200) NULL, elykoodi nvarchar(2) NULL, elynimi nvarchar(200) NULL, elynimi_sv nvarchar(200) NULL, elynimi_en nvarchar(200) NULL, kielisuhdekoodi nvarchar(2) NULL, kielisuhdenimi nvarchar(200) NULL, kielisuhdenimi_sv nvarchar(200) NULL, kielisuhdenimi_en nvarchar(200) NULL, seutukuntakoodi nvarchar(3) NULL, seutukuntanimi nvarchar(200) NULL, seutukuntanimi_sv nvarchar(200) NULL, seutukuntanimi_en nvarchar(200) NULL, laanikoodi nvarchar(2) NULL, laaninimi nvarchar(200) NULL, laaninimi_sv nvarchar(200) NULL, laaninimi_en nvarchar(200) NULL, kuntaryhmakoodi nvarchar(2) NULL, kuntaryhmanimi nvarchar(200) NULL, kuntaryhmanimi_sv nvarchar(200) NULL, kuntaryhmanimi_en nvarchar(200) NULL, loadtime datetime2(4) NOT NULL, source nvarchar(255) NULL, username nvarchar(128) NOT NULL, CONSTRAINT PK__sa_alueluokitus PRIMARY KEY CLUSTERED ( id ASC ) ) ; ALTER TABLE sa.sa_alueluokitus ADD CONSTRAINT DF__sa_alueluokitus__loadtime DEFAULT (getdate()) FOR loadtime ; ALTER TABLE sa.sa_alueluokitus ADD CONSTRAINT DF__sa_alueluokitus__username DEFAULT (suser_name()) FOR username ; END
CREATE PROCEDURE [dbo].[sp-select-customers] @custid int = 0 AS SELECT count(*) from dbo.Customer where id = @custid RETURN 0
ALTER TABLE QUERY ADD COLUMN DASH_UUID varchar(255) DEFAULT NULL; UPDATE QUERY INNER JOIN DASH ON (QUERY.DASH_ID = DASH.ID) SET QUERY.DASH_UUID = DASH.UUID; ALTER TABLE QUERY DROP COLUMN DASH_ID
-- file:rowsecurity.sql ln:1420 expect:true ALTER POLICY p ON tbl1 TO regress_rls_frank USING (true)
SET send_logs_level = 'fatal'; DROP DATABASE IF EXISTS database_for_dict_01018; CREATE DATABASE database_for_dict_01018; DROP TABLE IF EXISTS database_for_dict_01018.table_for_dict; CREATE TABLE database_for_dict_01018.table_for_dict ( key_column UInt64, second_column UInt8, third_column String ) ENGINE = MergeTree() ORDER BY key_column; INSERT INTO database_for_dict_01018.table_for_dict VALUES (1, 100, 'Hello world'); DROP DATABASE IF EXISTS db_01018; CREATE DATABASE db_01018; SELECT '=DICTIONARY in Ordinary DB'; DROP DICTIONARY IF EXISTS db_01018.dict1; CREATE DICTIONARY db_01018.dict1 ( key_column UInt64 DEFAULT 0, second_column UInt8 DEFAULT 1, third_column String DEFAULT 'qqq' ) PRIMARY KEY key_column SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict_01018')) LIFETIME(MIN 1 MAX 10) LAYOUT(FLAT()); SHOW CREATE DICTIONARY db_01018.dict1; SHOW DICTIONARIES FROM db_01018 LIKE 'dict1'; EXISTS DICTIONARY db_01018.dict1; SELECT database, name FROM system.dictionaries WHERE name LIKE 'dict1'; SELECT '==DETACH DICTIONARY'; DETACH DICTIONARY db_01018.dict1; SHOW DICTIONARIES FROM db_01018 LIKE 'dict1'; EXISTS DICTIONARY db_01018.dict1; SELECT database, name FROM system.dictionaries WHERE name LIKE 'dict1'; SELECT '==ATTACH DICTIONARY'; ATTACH DICTIONARY db_01018.dict1; SHOW DICTIONARIES FROM db_01018 LIKE 'dict1'; EXISTS DICTIONARY db_01018.dict1; SELECT database, name FROM system.dictionaries WHERE name LIKE 'dict1'; SELECT '==DROP DICTIONARY'; DROP DICTIONARY IF EXISTS db_01018.dict1; SHOW DICTIONARIES FROM db_01018 LIKE 'dict1'; EXISTS DICTIONARY db_01018.dict1; SELECT database, name FROM system.dictionaries WHERE name LIKE 'dict1'; DROP DATABASE IF EXISTS db_01018; DROP DATABASE IF EXISTS memory_db; CREATE DATABASE memory_db ENGINE = Memory; SELECT '=DICTIONARY in Memory DB'; CREATE DICTIONARY memory_db.dict2 ( key_column UInt64 DEFAULT 0 INJECTIVE, second_column UInt8 DEFAULT 1 EXPRESSION rand() % 222, third_column String DEFAULT 'qqq' ) PRIMARY KEY key_column SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict_01018')) LIFETIME(MIN 1 MAX 10) LAYOUT(FLAT()); -- {serverError 48} SHOW CREATE DICTIONARY memory_db.dict2; -- {serverError 487} SHOW DICTIONARIES FROM memory_db LIKE 'dict2'; EXISTS DICTIONARY memory_db.dict2; SELECT database, name FROM system.dictionaries WHERE name LIKE 'dict2'; SELECT '=DICTIONARY in Lazy DB'; DROP DATABASE IF EXISTS lazy_db; CREATE DATABASE lazy_db ENGINE = Lazy(1); CREATE DICTIONARY lazy_db.dict3 ( key_column UInt64 DEFAULT 0 INJECTIVE, second_column UInt8 DEFAULT 1 EXPRESSION rand() % 222, third_column String DEFAULT 'qqq' ) PRIMARY KEY key_column, second_column SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict_01018')) LIFETIME(MIN 1 MAX 10) LAYOUT(COMPLEX_KEY_HASHED()); -- {serverError 48} DROP DATABASE IF EXISTS lazy_db; SELECT '=DROP DATABASE WITH DICTIONARY'; DROP DATABASE IF EXISTS db_01018; CREATE DATABASE db_01018; CREATE DICTIONARY db_01018.dict4 ( key_column UInt64 DEFAULT 0, second_column UInt8 DEFAULT 1, third_column String DEFAULT 'qqq' ) PRIMARY KEY key_column SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict_01018')) LIFETIME(MIN 1 MAX 10) LAYOUT(FLAT()); SHOW DICTIONARIES FROM db_01018; DROP DATABASE IF EXISTS db_01018; CREATE DATABASE db_01018; SHOW DICTIONARIES FROM db_01018; CREATE DICTIONARY db_01018.dict4 ( key_column UInt64 DEFAULT 0, second_column UInt8 DEFAULT 1, third_column String DEFAULT 'qqq' ) PRIMARY KEY key_column SOURCE(CLICKHOUSE(HOST 'localhost' PORT tcpPort() USER 'default' TABLE 'table_for_dict' PASSWORD '' DB 'database_for_dict_01018')) LIFETIME(MIN 1 MAX 10) LAYOUT(FLAT()); SHOW DICTIONARIES FROM db_01018; DROP DATABASE IF EXISTS db_01018; DROP TABLE IF EXISTS database_for_dict_01018.table_for_dict; DROP DATABASE IF EXISTS database_for_dict_01018; DROP DATABASE IF EXISTS memory_db;
SELECT * FROM CITY;
DROP INDEX CONCURRENTLY IF EXISTS "post_history_post_id_idx"; DROP INDEX CONCURRENTLY IF EXISTS "post_history_categories_idx"; DROP INDEX CONCURRENTLY IF EXISTS "post_history_state_idx"; DROP TABLE IF EXISTS "post_history";
-- This file and its contents are licensed under the Timescale License. -- Please see the included NOTICE for copyright information and -- LICENSE-TIMESCALE for a copy of the license. \ir include/rand_generator.sql \c :TEST_DBNAME :ROLE_SUPERUSER \ir include/compression_utils.sql SET client_min_messages = ERROR; DROP TABLESPACE IF EXISTS tablespace1; DROP TABLESPACE IF EXISTS tablespace2; SET client_min_messages = NOTICE; --test hypertable with tables space CREATE TABLESPACE tablespace1 OWNER :ROLE_DEFAULT_PERM_USER LOCATION :TEST_TABLESPACE1_PATH; CREATE TABLESPACE tablespace2 OWNER :ROLE_DEFAULT_PERM_USER LOCATION :TEST_TABLESPACE2_PATH; \c :TEST_DBNAME :ROLE_DEFAULT_PERM_USER CREATE TABLE test1 ("Time" timestamptz, i integer, b bigint, t text); SELECT table_name from create_hypertable('test1', 'Time', chunk_time_interval=> INTERVAL '1 day'); INSERT INTO test1 SELECT t, gen_rand_minstd(), gen_rand_minstd(), gen_rand_minstd()::text FROM generate_series('2018-03-02 1:00'::TIMESTAMPTZ, '2018-03-28 1:00', '1 hour') t; ALTER TABLE test1 set (timescaledb.compress, timescaledb.compress_segmentby = 'b', timescaledb.compress_orderby = '"Time" DESC'); SELECT COUNT(*) AS count_compressed FROM ( SELECT compress_chunk(chunk.schema_name|| '.' || chunk.table_name) FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' and chunk.compressed_chunk_id IS NULL ORDER BY chunk.id ) AS sub; --make sure allowed ddl still work ALTER TABLE test1 CLUSTER ON "test1_Time_idx"; ALTER TABLE test1 SET WITHOUT CLUSTER; CREATE INDEX new_index ON test1(b); DROP INDEX new_index; ALTER TABLE test1 SET (fillfactor=100); ALTER TABLE test1 RESET (fillfactor); ALTER TABLE test1 ALTER COLUMN b SET STATISTICS 10; -- TABLESPACES -- For tablepaces with compressed chunks the semantics are the following: -- - compressed chunks get put into the same tablespace as the -- uncompressed chunk on compression. -- - set tablespace on uncompressed hypertable cascades to compressed hypertable+chunks -- - set tablespace on all chunks is blocked (same as w/o compression) -- - move chunks on a uncompressed chunk errors -- - move chunks on compressed chunk works --In the future we will: -- - add tablespace option to compress_chunk function and policy (this will override the setting -- of the uncompressed chunk). This will allow changing tablespaces upon compression -- - Note: The current plan is to never listen to the setting on compressed hypertable. In fact, -- we will block setting tablespace on compressed hypertables SELECT count(*) as "COUNT_CHUNKS_UNCOMPRESSED" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' \gset SELECT count(*) as "COUNT_CHUNKS_COMPRESSED" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1' \gset ALTER TABLE test1 SET TABLESPACE tablespace1; --all chunks + both the compressed and uncompressed hypertable moved to new tablespace SELECT count(*) = (:COUNT_CHUNKS_UNCOMPRESSED +:COUNT_CHUNKS_COMPRESSED + 2) FROM pg_tables WHERE tablespace = 'tablespace1'; ALTER TABLE test1 SET TABLESPACE tablespace2; SELECT count(*) = (:COUNT_CHUNKS_UNCOMPRESSED +:COUNT_CHUNKS_COMPRESSED + 2) FROM pg_tables WHERE tablespace = 'tablespace2'; SELECT comp_chunk.schema_name|| '.' || comp_chunk.table_name as "COMPRESSED_CHUNK_NAME", uncomp_chunk.schema_name|| '.' || uncomp_chunk.table_name as "UNCOMPRESSED_CHUNK_NAME" FROM _timescaledb_catalog.chunk comp_chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (comp_chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) INNER JOIN _timescaledb_catalog.chunk uncomp_chunk ON (uncomp_chunk.compressed_chunk_id = comp_chunk.id) WHERE uncomp_hyper.table_name like 'test1' ORDER BY comp_chunk.id LIMIT 1\gset \set ON_ERROR_STOP 0 --set tablespace is blocked on chunks for now; if this ever changes we need --to test that path to make sure it passes down the tablespace. ALTER TABLE :UNCOMPRESSED_CHUNK_NAME SET TABLESPACE tablespace1; SELECT move_chunk(chunk=>:'UNCOMPRESSED_CHUNK_NAME', destination_tablespace=>'tablespace1', index_destination_tablespace=>'tablespace1', reorder_index=>'_timescaledb_internal."_hyper_1_1_chunk_test1_Time_idx"'); \set ON_ERROR_STOP 1 SELECT move_chunk(chunk=>:'COMPRESSED_CHUNK_NAME', destination_tablespace=>'tablespace1', index_destination_tablespace=>'tablespace1', reorder_index=>'_timescaledb_internal."compress_hyper_2_28_chunk__compressed_hypertable_2_b__ts_meta_s"'); -- the compressed chunk is in here now SELECT count(*) FROM pg_tables WHERE tablespace = 'tablespace1'; SELECT decompress_chunk(:'UNCOMPRESSED_CHUNK_NAME'); --the compresse chunk was dropped by decompression SELECT count(*) FROM pg_tables WHERE tablespace = 'tablespace1'; SELECT move_chunk(chunk=>:'UNCOMPRESSED_CHUNK_NAME', destination_tablespace=>'tablespace1', index_destination_tablespace=>'tablespace1', reorder_index=>'_timescaledb_internal."_hyper_1_1_chunk_test1_Time_idx"'); --the uncompressed chunks has now been moved SELECT count(*) FROM pg_tables WHERE tablespace = 'tablespace1'; SELECT compress_chunk(:'UNCOMPRESSED_CHUNK_NAME'); --the compressed chunk is now in the same tablespace as the uncompressed one SELECT count(*) FROM pg_tables WHERE tablespace = 'tablespace1'; -- -- DROP CHUNKS -- SELECT count(*) as count_chunks_uncompressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1'; SELECT count(*) as count_chunks_compressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1'; SELECT chunk.schema_name|| '.' || chunk.table_name as "UNCOMPRESSED_CHUNK_NAME" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' ORDER BY chunk.id LIMIT 1 \gset DROP TABLE :UNCOMPRESSED_CHUNK_NAME; --should decrease #chunks both compressed and decompressed SELECT count(*) as count_chunks_uncompressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1'; --make sure there are no orphaned _timescaledb_catalog.compression_chunk_size entries (should be 0) SELECT count(*) as orphaned_compression_chunk_size FROM _timescaledb_catalog.compression_chunk_size size LEFT JOIN _timescaledb_catalog.chunk chunk ON (chunk.id = size.chunk_id) WHERE chunk.id IS NULL; SELECT count(*) as count_chunks_compressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1'; SELECT drop_chunks(table_name=>'test1', older_than => '2018-03-10'::TIMESTAMPTZ); --should decrease #chunks both compressed and decompressed SELECT count(*) as count_chunks_uncompressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1'; SELECT count(*) as count_chunks_compressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1'; SELECT chunk.schema_name|| '.' || chunk.table_name as "UNCOMPRESSED_CHUNK_NAME" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' ORDER BY chunk.id LIMIT 1 \gset SELECT chunk.schema_name|| '.' || chunk.table_name as "COMPRESSED_CHUNK_NAME" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1' ORDER BY chunk.id LIMIT 1 \gset \set ON_ERROR_STOP 0 DROP TABLE :COMPRESSED_CHUNK_NAME; \set ON_ERROR_STOP 1 SELECT chunk.schema_name|| '.' || chunk.table_name as "UNCOMPRESSED_CHUNK_NAME", comp_chunk.schema_name|| '.' || comp_chunk.table_name as "COMPRESSED_CHUNK_NAME" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.chunk comp_chunk ON (chunk.compressed_chunk_id = comp_chunk.id) INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' ORDER BY chunk.id LIMIT 1 \gset --create a dependent object on the compressed chunk to test cascade behaviour CREATE VIEW dependent_1 AS SELECT * FROM :COMPRESSED_CHUNK_NAME; \set ON_ERROR_STOP 0 --errors due to dependent objects DROP TABLE :UNCOMPRESSED_CHUNK_NAME; \set ON_ERROR_STOP 1 DROP TABLE :UNCOMPRESSED_CHUNK_NAME CASCADE; --should decrease #chunks both compressed and decompressed SELECT count(*) as count_chunks_uncompressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1'; SELECT count(*) as count_chunks_compressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1'; SELECT chunk.schema_name|| '.' || chunk.table_name as "UNCOMPRESSED_CHUNK_NAME", comp_chunk.schema_name|| '.' || comp_chunk.table_name as "COMPRESSED_CHUNK_NAME" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.chunk comp_chunk ON (chunk.compressed_chunk_id = comp_chunk.id) INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' ORDER BY chunk.id LIMIT 1 \gset CREATE VIEW dependent_1 AS SELECT * FROM :COMPRESSED_CHUNK_NAME; \set ON_ERROR_STOP 0 --errors due to dependent objects SELECT drop_chunks(table_name=>'test1', older_than => '2018-03-28'::TIMESTAMPTZ); \set ON_ERROR_STOP 1 SELECT drop_chunks(table_name=>'test1', older_than => '2018-03-28'::TIMESTAMPTZ, cascade=>true); --should decrease #chunks both compressed and decompressed SELECT count(*) as count_chunks_uncompressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1'; SELECT count(*) as count_chunks_compressed FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1'; --make sure there are no orphaned _timescaledb_catalog.compression_chunk_size entries (should be 0) SELECT count(*) as orphaned_compression_chunk_size FROM _timescaledb_catalog.compression_chunk_size size LEFT JOIN _timescaledb_catalog.chunk chunk ON (chunk.id = size.chunk_id) WHERE chunk.id IS NULL; -- -- DROP HYPERTABLE -- SELECT comp_hyper.schema_name|| '.' || comp_hyper.table_name as "COMPRESSED_HYPER_NAME" FROM _timescaledb_catalog.hypertable comp_hyper INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1' ORDER BY comp_hyper.id LIMIT 1 \gset \set ON_ERROR_STOP 0 DROP TABLE :COMPRESSED_HYPER_NAME; \set ON_ERROR_STOP 1 BEGIN; SELECT hypertable.schema_name|| '.' || hypertable.table_name as "UNCOMPRESSED_HYPER_NAME" FROM _timescaledb_catalog.hypertable hypertable WHERE hypertable.table_name like 'test1' ORDER BY hypertable.id LIMIT 1 \gset --before the drop there are 2 hypertables: the compressed and uncompressed ones SELECT count(*) FROM _timescaledb_catalog.hypertable hypertable; --add policy to make sure it's dropped later select add_compress_chunks_policy(:'UNCOMPRESSED_HYPER_NAME', interval '1 day'); SELECT count(*) FROM _timescaledb_config.bgw_policy_compress_chunks; DROP TABLE :UNCOMPRESSED_HYPER_NAME; --verify that there are no more hypertable remaining SELECT count(*) FROM _timescaledb_catalog.hypertable hypertable; SELECT count(*) FROM _timescaledb_catalog.hypertable_compression; --verify that the policy is gone SELECT count(*) FROM _timescaledb_config.bgw_policy_compress_chunks; ROLLBACK; --create a dependent object on the compressed hypertable to test cascade behaviour CREATE VIEW dependent_1 AS SELECT * FROM :COMPRESSED_HYPER_NAME; \set ON_ERROR_STOP 0 DROP TABLE :UNCOMPRESSED_HYPER_NAME; \set ON_ERROR_STOP 1 BEGIN; DROP TABLE :UNCOMPRESSED_HYPER_NAME CASCADE; SELECT count(*) FROM _timescaledb_catalog.hypertable hypertable; ROLLBACK; DROP VIEW dependent_1; --create a cont agg view on the ht as well then the drop should nuke everything SET timescaledb.current_timestamp_mock = '2018-03-28 1:00'; CREATE VIEW test1_cont_view WITH ( timescaledb.continuous, timescaledb.refresh_interval='72 hours') AS SELECT time_bucket('1 hour', "Time"), SUM(i) FROM test1 GROUP BY 1; REFRESH MATERIALIZED VIEW test1_cont_view; SELECT count(*) FROM test1_cont_view; \c :TEST_DBNAME :ROLE_SUPERUSER SELECT chunk.schema_name|| '.' || chunk.table_name as "COMPRESSED_CHUNK_NAME" FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable comp_hyper ON (chunk.hypertable_id = comp_hyper.id) INNER JOIN _timescaledb_catalog.hypertable uncomp_hyper ON (comp_hyper.id = uncomp_hyper.compressed_hypertable_id) WHERE uncomp_hyper.table_name like 'test1' ORDER BY chunk.id LIMIT 1 \gset ALTER TABLE test1 OWNER TO :ROLE_DEFAULT_PERM_USER_2; --make sure new owner is propagated down SELECT a.rolname from pg_class c INNER JOIN pg_authid a ON(c.relowner = a.oid) WHERE c.oid = 'test1'::regclass; SELECT a.rolname from pg_class c INNER JOIN pg_authid a ON(c.relowner = a.oid) WHERE c.oid = :'COMPRESSED_HYPER_NAME'::regclass; SELECT a.rolname from pg_class c INNER JOIN pg_authid a ON(c.relowner = a.oid) WHERE c.oid = :'COMPRESSED_CHUNK_NAME'::regclass; -- -- turn off compression -- SELECT COUNT(*) AS count_compressed FROM ( SELECT decompress_chunk(chunk.schema_name|| '.' || chunk.table_name) FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' and chunk.compressed_chunk_id IS NOT NULL ORDER BY chunk.id ) AS sub; select add_compress_chunks_policy('test1', interval '1 day'); \set ON_ERROR_STOP 0 ALTER table test1 set (timescaledb.compress='f'); \set ON_ERROR_STOP 1 select remove_compress_chunks_policy('test1'); ALTER table test1 set (timescaledb.compress='f'); --only one hypertable left SELECT count(*) = 1 FROM _timescaledb_catalog.hypertable hypertable; SELECT compressed_hypertable_id IS NULL FROM _timescaledb_catalog.hypertable hypertable WHERE hypertable.table_name like 'test1' ; --no hypertable compression entries left SELECT count(*) = 0 FROM _timescaledb_catalog.hypertable_compression; --make sure there are no orphaned _timescaledb_catalog.compression_chunk_size entries (should be 0) SELECT count(*) as orphaned_compression_chunk_size FROM _timescaledb_catalog.compression_chunk_size size LEFT JOIN _timescaledb_catalog.chunk chunk ON (chunk.id = size.chunk_id) WHERE chunk.id IS NULL; --can turn compression back on ALTER TABLE test1 set (timescaledb.compress, timescaledb.compress_segmentby = 'b', timescaledb.compress_orderby = '"Time" DESC'); SELECT COUNT(*) AS count_compressed FROM ( SELECT compress_chunk(chunk.schema_name|| '.' || chunk.table_name) FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' and chunk.compressed_chunk_id IS NULL ORDER BY chunk.id ) AS sub; DROP TABLE test1 CASCADE; DROP TABLESPACE tablespace1; DROP TABLESPACE tablespace2; -- Triggers are NOT fired for compress/decompress CREATE TABLE test1 ("Time" timestamptz, i integer); SELECT table_name from create_hypertable('test1', 'Time', chunk_time_interval=> INTERVAL '1 day'); CREATE OR REPLACE FUNCTION test1_print_func() RETURNS TRIGGER LANGUAGE PLPGSQL AS $BODY$ BEGIN RAISE NOTICE ' raise notice test1_print_trigger called '; RETURN OLD; END; $BODY$; CREATE TRIGGER test1_trigger BEFORE INSERT OR UPDATE OR DELETE OR TRUNCATE ON test1 FOR EACH STATEMENT EXECUTE PROCEDURE test1_print_func(); INSERT INTO test1 SELECT generate_series('2018-03-02 1:00'::TIMESTAMPTZ, '2018-03-03 1:00', '1 hour') , 1 ; -- add a row trigger too -- CREATE TRIGGER test1_trigger2 BEFORE INSERT OR UPDATE OR DELETE ON test1 FOR EACH ROW EXECUTE PROCEDURE test1_print_func(); INSERT INTO test1 SELECT '2018-03-02 1:05'::TIMESTAMPTZ, 2; ALTER TABLE test1 set (timescaledb.compress, timescaledb.compress_orderby = '"Time" DESC'); SELECT COUNT(*) AS count_compressed FROM ( SELECT compress_chunk(chunk.schema_name|| '.' || chunk.table_name) FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' and chunk.compressed_chunk_id IS NULL ORDER BY chunk.id) AS subq; SELECT COUNT(*) AS count_compressed FROM ( SELECT decompress_chunk(chunk.schema_name|| '.' || chunk.table_name) FROM _timescaledb_catalog.chunk chunk INNER JOIN _timescaledb_catalog.hypertable hypertable ON (chunk.hypertable_id = hypertable.id) WHERE hypertable.table_name like 'test1' ORDER BY chunk.id ) as subq;
/********* CONCEPT LEVEL check: PLAUSIBLE_GENDER - number of records of a given concept which occur in person with implausible gender for that concept Parameters used in this template: cdmDatabaseSchema = @cdmDatabaseSchema cdmTableName = @cdmTableName cdmFieldName = @cdmFieldName conceptId = @conceptId plausibleGender = @plausibleGender **********/ SELECT num_violated_rows, CASE WHEN denominator.num_rows = 0 THEN 0 ELSE 1.0*num_violated_rows/denominator.num_rows END AS pct_violated_rows FROM ( SELECT COUNT_BIG(*) AS num_violated_rows FROM ( SELECT @cdmTableName.* FROM @cdmDatabaseSchema.@cdmTableName INNER JOIN @cdmDatabaseSchema.person ON @cdmTableName.person_id = person.person_id WHERE @cdmFieldName = @conceptId AND person.gender_concept_id <> {@plausibleGender == 'Male'} ? {8507} : {8532} ) violated_rows ) violated_row_count, ( SELECT COUNT_BIG(*) AS num_rows FROM @cdmDatabaseSchema.@cdmTableName WHERE @cdmFieldName = @conceptId ) denominator ;
CREATE SCHEMA IF NOT EXISTS training_cucumber;
create table items ( id integer ); alter table items enable row level security; create table projects ( id integer ); alter table projects force row level security;
-- phpMyAdmin SQL Dump -- version 4.5.2 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 25, 2017 at 07:24 AM -- Server version: 10.1.13-MariaDB -- PHP Version: 5.5.35 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 utf8mb4 */; -- -- Database: `target_local` -- -- -------------------------------------------------------- -- -- Table structure for table `admin_availability_time_slot` -- CREATE TABLE `admin_availability_time_slot` ( `id` bigint(20) NOT NULL, `product_type_id` bigint(20) NOT NULL, `timeslot_name` varchar(255) NOT NULL, `date_time` datetime NOT NULL, `date` date NOT NULL, `time` time NOT NULL, `time_duration` int(11) NOT NULL, `batch_name` varchar(255) NOT NULL, `is_users_booked` tinyint(1) NOT NULL, `is_complete` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin_availability_time_slot` -- INSERT INTO `admin_availability_time_slot` (`id`, `product_type_id`, `timeslot_name`, `date_time`, `date`, `time`, `time_duration`, `batch_name`, `is_users_booked`, `is_complete`, `created`, `modified`) VALUES (9, 2, 'ASSES_PREP-23Oct17-06AM', '2017-10-23 06:00:00', '0000-00-00', '00:00:00', 1, 'ASSES_PREP-23Oct17-06AM BATCH', 0, 0, '2017-10-24 17:22:08', '2017-10-23 17:37:55'), (11, 5, 'ON_MOCK-24Oct17-12PM', '2017-10-24 12:00:00', '0000-00-00', '00:00:00', 2, 'ON_MOCK-24Oct17-12PM BATCH', 0, 0, '2017-10-23 17:39:47', '2017-10-23 17:39:47'), (15, 5, 'ON_MOCK-25Oct17-10AM', '2017-10-25 10:00:00', '0000-00-00', '00:00:00', 2, 'ON_MOCK-25Oct17-10AM BATCH', 0, 0, '2017-10-23 18:30:12', '2017-10-23 18:30:12'), (16, 2, 'ASSES_PREP-25Oct17-12PM', '2017-10-25 12:00:00', '0000-00-00', '00:00:00', 1, 'ASSES_PREP-25Oct17-12AM Batch', 0, 0, '2017-10-23 18:31:12', '2017-10-23 18:31:12'), (18, 9, 'CCC-23Oct17-10PM', '2017-10-23 22:00:00', '0000-00-00', '00:00:00', 1, 'CCC - 8 AM Batch', 0, 0, '2017-10-24 17:50:24', '2017-10-23 20:17:36'), (19, 3, 'PNC-08Nov17-09AM', '2017-11-08 09:00:00', '0000-00-00', '00:00:00', 1, 'PNC-03Nov17-04AM Batch', 0, 0, '2017-10-23 20:22:11', '2017-10-23 20:22:11'), (20, 2, 'ASSES_PREP-06Nov17-12PM', '2017-11-06 12:00:00', '0000-00-00', '00:00:00', 1, 'ASSES_PREP-06Nov17-12PM Batch', 0, 0, '2017-10-23 20:23:15', '2017-10-23 20:23:15'), (21, 5, 'ON_MOCK-09Nov17-01PM', '2017-11-09 13:00:00', '0000-00-00', '00:00:00', 2, 'ON_MOCK-09Nov17-01PM Batch', 0, 0, '2017-10-23 20:28:56', '2017-10-23 20:28:56'), (22, 3, 'PNC-25Oct17-06PM', '2017-10-25 18:00:00', '0000-00-00', '00:00:00', 1, 'PNC-25Oct17-10AM Batch', 1, 0, '2017-10-23 20:31:49', '2017-10-23 20:31:49'), (23, 5, 'ON_MOCK-29Oct17-08PM', '2017-10-29 20:00:00', '0000-00-00', '00:00:00', 2, '', 0, 0, '2017-10-24 17:09:47', '2017-10-24 10:51:38'), (24, 10, 'RRC-27Oct17-10AM', '2017-10-27 10:00:00', '0000-00-00', '00:00:00', 1, '', 0, 0, '2017-10-24 17:09:23', '2017-10-24 15:44:23'); -- -------------------------------------------------------- -- -- Table structure for table `admin_batch_list` -- CREATE TABLE `admin_batch_list` ( `id` bigint(20) NOT NULL, `time_slot_id` bigint(20) NOT NULL, `class_id` int(11) NOT NULL, `duration_part` int(11) NOT NULL, `date_time` datetime NOT NULL, `date` date NOT NULL, `time` time NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin_batch_list` -- INSERT INTO `admin_batch_list` (`id`, `time_slot_id`, `class_id`, `duration_part`, `date_time`, `date`, `time`) VALUES (33, 11, 1, 1, '2017-10-24 12:00:00', '0000-00-00', '00:00:00'), (42, 15, 1, 1, '2017-10-25 10:00:00', '0000-00-00', '00:00:00'), (43, 15, 1, 2, '2017-10-25 11:00:00', '0000-00-00', '00:00:00'), (44, 16, 1, 1, '2017-10-25 12:00:00', '0000-00-00', '00:00:00'), (57, 19, 1, 1, '2017-11-08 09:00:00', '0000-00-00', '00:00:00'), (58, 20, 1, 1, '2017-11-06 12:00:00', '0000-00-00', '00:00:00'), (59, 21, 1, 1, '2017-11-09 13:00:00', '0000-00-00', '00:00:00'), (60, 21, 1, 2, '2017-11-09 14:00:00', '0000-00-00', '00:00:00'), (61, 22, 1, 1, '2017-10-25 18:00:00', '0000-00-00', '00:00:00'), (85, 24, 1, 1, '2017-10-27 10:00:00', '0000-00-00', '00:00:00'), (86, 24, 2, 1, '2017-10-30 10:00:00', '0000-00-00', '00:00:00'), (87, 24, 3, 1, '2017-11-02 10:00:00', '0000-00-00', '00:00:00'), (88, 23, 1, 1, '2017-10-29 20:00:00', '0000-00-00', '00:00:00'), (89, 23, 1, 2, '2017-10-29 21:00:00', '0000-00-00', '00:00:00'), (90, 9, 1, 1, '2017-10-23 06:00:00', '0000-00-00', '00:00:00'), (97, 18, 1, 1, '2017-10-23 22:00:00', '0000-00-00', '00:00:00'), (98, 18, 2, 1, '2017-10-26 08:00:00', '0000-00-00', '00:00:00'), (99, 18, 3, 1, '2017-10-30 08:00:00', '0000-00-00', '00:00:00'), (100, 18, 4, 1, '2017-11-01 08:00:00', '0000-00-00', '00:00:00'), (101, 18, 5, 1, '2017-11-03 09:00:00', '0000-00-00', '00:00:00'), (102, 18, 6, 1, '2017-12-04 08:00:00', '0000-00-00', '00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `admin_users` -- CREATE TABLE `admin_users` ( `id` bigint(20) NOT NULL, `username` varchar(255) NOT NULL, `first_name` varchar(255) NOT NULL, `last_name` varchar(255) NOT NULL, `display_name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `password` varchar(255) NOT NULL, `status` tinyint(1) NOT NULL, `reset_token` varchar(255) NOT NULL, `reset_token_date` datetime DEFAULT NULL, `last_login_time` datetime NOT NULL, `total_login_count` bigint(20) NOT NULL, `is_deleted` tinyint(1) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `admin_users` -- INSERT INTO `admin_users` (`id`, `username`, `first_name`, `last_name`, `display_name`, `email`, `password`, `status`, `reset_token`, `reset_token_date`, `last_login_time`, `total_login_count`, `is_deleted`, `created`, `modified`) VALUES (1, 'admin', 'admin', '', 'admin', 'admin@targetusmle.com', '0e7517141fb53f21ee439b355b5a1d0a', 1, '', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 7, 0, '2017-10-10 16:07:33', '2017-10-10 16:07:33'), (2, 'admin1', 'admin1', '', 'admin1', 'admin1@targetusmle.com', '0192023a7bbd73250516f069df18b500', 1, '1285940911', '2017-10-11 11:59:58', '0000-00-00 00:00:00', 21, 0, '2017-10-10 16:07:17', '2017-10-10 16:07:17'); -- -------------------------------------------------------- -- -- Table structure for table `advertisements` -- CREATE TABLE `advertisements` ( `id` bigint(20) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL, `name` varchar(255) NOT NULL, `image` varchar(255) NOT NULL, `url` varchar(255) DEFAULT NULL, `page_id` bigint(20) NOT NULL, `position_id` bigint(20) NOT NULL, `is_offer` tinyint(1) NOT NULL, `description` text, `expiry_date` datetime NOT NULL, `status` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `advertisements` -- INSERT INTO `advertisements` (`id`, `created`, `modified`, `name`, `image`, `url`, `page_id`, `position_id`, `is_offer`, `description`, `expiry_date`, `status`) VALUES (1, '2017-10-11 16:47:50', '0000-00-00 00:00:00', 'Ad 1', 'advertisement.png', 'http://www.targetusmle.com', 2, 2, 0, NULL, '2017-10-31 00:00:00', 1), (2, '2017-10-11 16:49:05', '0000-00-00 00:00:00', 'Ad 2', 'advertisement1.png', 'http://www.targetusmle.com', 2, 2, 0, NULL, '2017-10-31 00:00:00', 1); -- -------------------------------------------------------- -- -- Table structure for table `ad_page` -- CREATE TABLE `ad_page` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL, `status` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `ad_page` -- INSERT INTO `ad_page` (`id`, `name`, `created`, `modified`, `status`) VALUES (1, 'cs hand book', '2017-10-11 00:00:00', '2017-10-11 00:00:00', 1), (2, 'blog', '2017-10-11 00:00:00', '2017-10-11 00:00:00', 1); -- -------------------------------------------------------- -- -- Table structure for table `ad_page_position` -- CREATE TABLE `ad_page_position` ( `id` bigint(20) NOT NULL, `ad_page_id` bigint(20) NOT NULL, `position` varchar(255) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL, `status` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `ad_page_position` -- INSERT INTO `ad_page_position` (`id`, `ad_page_id`, `position`, `created`, `modified`, `status`) VALUES (1, 1, 'bottom', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1), (2, 2, 'rightside', '0000-00-00 00:00:00', '0000-00-00 00:00:00', 1); -- -------------------------------------------------------- -- -- Table structure for table `banner_management` -- CREATE TABLE `banner_management` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `content_one` text NOT NULL, `content_two` text NOT NULL, `url` varchar(255) NOT NULL, `directory_path` varchar(255) NOT NULL, `file_name` varchar(255) NOT NULL, `site_reference_id` bigint(20) NOT NULL, `sort_order` int(11) NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `banner_management` -- INSERT INTO `banner_management` (`id`, `name`, `content_one`, `content_two`, `url`, `directory_path`, `file_name`, `site_reference_id`, `sort_order`, `status`, `created`, `modified`) VALUES (1, 'Home Banner 1', 'Home', 'This is home page banner', 'http://www.targetusmle.com', '/opt/lampp/htdocs/projects/target_usmle/04development/01source/appdata/banners/', 'adminbanner.jpg', 1, 0, 1, '2017-10-11 15:25:00', '2017-10-11 15:25:00'), (2, 'Home Banner 2', 'Home', 'This is banner 2', 'http://www.targetusmle.com', '/opt/lampp/htdocs/projects/target_usmle/04development/01source/appdata/banners/', 'adminbanner1.jpg', 1, 0, 1, '2017-10-11 15:31:31', '2017-10-11 15:31:31'), (3, 'Home Banner 3', 'Home', 'This is banner 3', '', '/opt/lampp/htdocs/projects/target_usmle/04development/01source/appdata/banners/', 'adminbanner2.jpg', 1, 0, 1, '2017-10-11 15:51:55', '2017-10-11 15:51:55'), (4, 'Home Banner 4', 'Home', 'This is banner 4', '', '/opt/lampp/htdocs/projects/target_usmle/04development/01source/appdata/banners/', 'adminbanner3.jpg', 1, 0, 1, '2017-10-11 15:52:20', '2017-10-11 15:52:20'), (5, 'Home Banner 5', 'Home', 'Banner 5', '', '/opt/lampp/htdocs/projects/target_usmle/04development/01source/appdata/banners/', 'adminbanner4.jpg', 1, 0, 1, '2017-10-11 15:52:40', '2017-10-11 15:52:40'), (6, 'Online video Tutorials', 'Online Video Tutorial', 'this is video banner', '', '/opt/lampp/htdocs/projects/target_usmle/04development/01source/appdata/banners/', 'adminbanner5.jpg', 2, 0, 1, '2017-10-11 15:53:10', '2017-10-11 15:53:10'); -- -------------------------------------------------------- -- -- Table structure for table `blogs` -- CREATE TABLE `blogs` ( `id` int(11) NOT NULL, `title` text NOT NULL, `slug` text NOT NULL, `short_description` text NOT NULL, `description` text NOT NULL, `image` varchar(255) NOT NULL, `posted_by` int(11) NOT NULL, `category_id` bigint(20) NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `blogs` -- INSERT INTO `blogs` (`id`, `title`, `slug`, `short_description`, `description`, `image`, `posted_by`, `category_id`, `status`, `created`, `modified`) VALUES (6, 'test1', 'test1', 'test1', 'test1', 'dummy_logo.png', 2, 3, 1, '2017-10-13 16:39:11', '0000-00-00 00:00:00'), (7, 'test', 'test-1', '<p>test</p>', '<p>test</p>', 'cron1.png', 2, 2, 1, '2017-10-13 16:45:44', '0000-00-00 00:00:00'), (9, 'test1', 'test1-1', '<p>test</p>', '<p>test</p>', '', 2, 2, 1, '2017-10-13 17:34:37', '0000-00-00 00:00:00'), (10, 'test2', 'test2', 'test2', 'test2', 'child1.jpg', 2, 3, 1, '2017-10-23 14:58:21', '0000-00-00 00:00:00'), (12, 'system', 'system', 'Lorem ipsum Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum Lorem ipsum Lorem ipsum', 'Lorem ipsum Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsumLorem ipsum Lorem ipsum Lorem ipsum', '', 2, 2, 1, '2017-10-23 15:08:03', '0000-00-00 00:00:00'), (13, 'Blog Videos', 'blog-videos', '<p>blog vids</p>', '<p>blog vids</p>', '', 2, 3, 1, '2017-10-24 10:52:22', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `blog_categories` -- CREATE TABLE `blog_categories` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `no_of_blogs` int(11) NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `blog_categories` -- INSERT INTO `blog_categories` (`id`, `name`, `slug`, `no_of_blogs`, `status`, `created`, `modified`) VALUES (1, 'Standard CS Encounter', 'standard-cs-encounter', 0, 1, '2017-10-11 17:39:29', '2017-10-11 17:39:29'), (2, 'Systemwise History', 'systemwise-history', 3, 1, '2017-10-11 17:44:04', '2017-10-11 17:44:04'), (3, 'Physical Exam Videos', 'physical-exam-videos', 3, 1, '2017-10-13 12:50:56', '2017-10-13 12:50:56'); -- -------------------------------------------------------- -- -- Table structure for table `carrier_applied_users` -- CREATE TABLE `carrier_applied_users` ( `id` int(11) NOT NULL, `carrier_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `qualification` varchar(255) NOT NULL, `experience` varchar(255) NOT NULL, `email_id` varchar(255) NOT NULL, `phone_no` varchar(255) NOT NULL, `skills` text NOT NULL, `resume` varchar(255) NOT NULL, `is_read` tinyint(1) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `carrier_openings` -- CREATE TABLE `carrier_openings` ( `id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `description` text NOT NULL, `status` int(11) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `cities` -- CREATE TABLE `cities` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `city_code` varchar(255) NOT NULL, `country_id` bigint(20) NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `cities` -- INSERT INTO `cities` (`id`, `name`, `slug`, `city_code`, `country_id`, `status`, `created`, `modified`) VALUES (1, 'Chennai', 'chennai', '', 96, 1, '2017-10-13 14:33:48', '2017-10-13 14:33:48'), (2, 'Mumbai', 'mumbai', '', 96, 0, '2017-10-13 14:34:13', '2017-10-13 14:34:13'); -- -------------------------------------------------------- -- -- Table structure for table `cms_pages` -- CREATE TABLE `cms_pages` ( `id` bigint(20) NOT NULL, `name` varchar(235) NOT NULL, `slug` varchar(255) NOT NULL, `content` text NOT NULL, `sort_order` int(11) NOT NULL, `seo_title` varchar(255) NOT NULL, `meta_keywords` text NOT NULL, `meta_description` text NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 - inactive , 1 - active', `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `cms_pages` -- INSERT INTO `cms_pages` (`id`, `name`, `slug`, `content`, `sort_order`, `seo_title`, `meta_keywords`, `meta_description`, `status`, `created`, `modified`) VALUES (1, 'About Us', 'about-us', '<div class="aboutus-sec" id="aboutus">\r\n<div class="wrapper">\r\n<h2>TopSure</h2>\r\n\r\n<p class="first-para">TopSure is a professional consultancy group that provides marketing, business consulting and lead generation services to leading companies in Singapore and abroad.</p>\r\n\r\n<p>Creativity and commitment are the two major values of the company which propel us to bring success to the projects and our clients that we deal with. Our works include major areas such as healthcare, insurance, investments, business consulting and professional services.</p>\r\n\r\n<p>You have a business need, let&#39;s catch up over a coffee!</p>\r\n</div>\r\n</div>', 2, '', '', '', 1, '2017-07-27 13:08:13', '2017-08-14 11:12:27'), (2, 'Privacy Policy', 'privacy-policy', '<h4>Privacy &amp; Confidentiality</h4>\r\n\r\n<p>TopSure is a brand and a web platform (the &quot;Platform&quot;) owned and operated by J Ben Consulting Pte. Ltd. Singapore (&quot;JBen&quot; or &quot;The Company&quot;). JBen is extremely concerned about User&#39;s privacy when collecting User&#39;s personal information. Please read this Policy to learn more details.</p>\r\n\r\n<p>JBen does not collect any personal particulars from the User to download the Platform or access the information and content that are available on the Platform. But if the User wants to engage JBen to inquire and collect data on behalf of the User from suppliers and third party vendors for their interested products and/or services that are displayed on the Platform, then the User acknowledges and agrees to freely provide their following personal particulars for the same through the Platform such as name, mobile number, email ID, age etc. which are not otherwise publicly available. The protection of User&#39;s personal information is extremely important to JBen. This Privacy Policy (&quot;Policy&quot;) describes how JBen collects and uses the personal information that User provides on this Platform. JBen shall make changes to this Policy without prior notice and hence JBen encourages the User to review this Policy regularly for any such changes.</p>\r\n\r\n<p>JBen, as the owner and operator of the Platform, does not rent, sell or share personal information about the User with other people or non-affiliated companies, except to provide the information, data or services the User has requested or under the following circumstances,</p>\r\n\r\n<ul>\r\n <li>To collect information and data from the suppliers and/or third party vendors that provide specific products and services that the User is interested and/or wants JBen to coordinate for the same.</li>\r\n <li>To comply court orders or legal process or to exercise or establish its legal rights or defend against legal claims.</li>\r\n</ul>\r\n\r\n<p>JBen utilises highly secured infrastructure that deploys robust security controls in order to protect collection, transmission, storage and management of all personal information that are collected from the User, JBen cannot assure that all personal information that it may collect will never be disclosed in a manner that is inconsistent with this Policy. There may be instances of inadvertent disclosures, which are beyond the control of or not due to the fault or negligence of JBen. And as a consequence, JBen disclaims any warranties or representations relating to maintenance or non-disclosures of User&#39;s personal information that are collected and shared through the Platform or through other communication means.</p>\r\n\r\n<p>JBen encourages the User to communicate by sending an email to <a href="mailto:info@topsure.com.sg">info@topsure.com.sg</a> if the User has a query, complaint or a problem concerning the privacy policy or to report a privacy related problem.</p>', 1, '', '', 'test', 1, '2017-07-27 13:47:25', '2017-10-12 11:43:54'); -- -------------------------------------------------------- -- -- Table structure for table `countries` -- CREATE TABLE `countries` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `country_code` varchar(255) NOT NULL, `status` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `countries` -- INSERT INTO `countries` (`id`, `name`, `slug`, `country_code`, `status`) VALUES (1, 'Andorra', '', 'AND', 1), (2, 'United Arab Emirates', '', 'ARE', 1), (3, 'Afghanistan', '', 'AFG', 1), (4, 'Antigua and Barbuda', '', 'ATG', 1), (5, 'Anguilla', '', 'AIA', 1), (6, 'Albania', '', 'ALB', 1), (7, 'Armenia', '', 'ARM', 1), (8, 'Netherlands Antilles', '', 'ANT', 1), (9, 'Angola', '', 'AGO', 1), (10, 'Argentina', '', 'ARG', 1), (11, 'Austria', '', 'AUT', 1), (12, 'Australia', '', 'AUS', 1), (13, 'Aruba', '', 'ABW', 1), (14, 'Azerbaijan', '', 'AZE', 1), (15, 'Bosnia and Herzegovina', '', 'BIH', 1), (16, 'Barbados', '', 'BRB', 1), (17, 'Bangladesh', '', 'BGD', 1), (18, 'Belgium', '', 'BEL', 1), (19, 'Burkina Faso', '', 'BGR', 1), (20, 'Bulgaria', '', 'BGR', 1), (21, 'Bahrain', '', 'BHR', 1), (22, 'Burundi', '', 'BDI', 1), (23, 'Benin', '', 'BEN', 1), (24, 'Bermuda', '', 'BMU', 1), (25, 'Brunei Darussalam', '', 'BRN', 1), (26, 'Bolivia', '', 'BOL', 1), (27, 'Brazil', '', 'BRA', 1), (28, 'Bahamas', '', 'BHS', 1), (29, 'Bhutan', '', 'BTN', 1), (30, 'Botswana', '', 'BWA', 1), (31, 'Belarus', '', 'BLR', 1), (32, 'Belize', '', 'BLZ', 1), (33, 'Canada', '', 'CAN', 1), (34, 'Cocos (Keeling) Islands', '', 'CCK', 1), (35, 'Democratic Republic of the Congo', '', 'COD', 1), (36, 'Central African Republic', '', 'CAF', 1), (37, 'Congo', '', 'COG', 1), (38, 'Switzerland', '', 'CHE', 1), (39, 'Cote D''Ivoire (Ivory Coast)', '', 'CIV', 1), (40, 'Cook Islands', '', 'COK', 1), (41, 'Chile', '', 'CHL', 1), (42, 'Cameroon', '', 'CMR', 1), (43, 'China', '', 'CHN', 1), (44, 'Colombia', '', 'COL', 1), (45, 'Costa Rica', '', 'CRI', 1), (46, 'Cuba', '', 'CUB', 1), (47, 'Cape Verde', '', 'CPV', 1), (48, 'Christmas Island', '', 'CXR', 1), (49, 'Cyprus', '', 'CYP', 1), (50, 'Czech Republic', '', 'CZE', 1), (51, 'Germany', '', 'DEU', 1), (52, 'Djibouti', '', 'DJI', 1), (53, 'Denmark', '', 'DNK', 1), (54, 'Dominica', '', 'DMA', 1), (55, 'Dominican Republic', '', 'DOM', 1), (56, 'Algeria', '', 'DZA', 1), (57, 'Ecuador', '', 'ECU', 1), (58, 'Estonia', '', 'EST', 1), (59, 'Egypt', '', 'EGY', 1), (60, 'Western Sahara', '', 'ESH', 1), (61, 'Eritrea', '', 'ERI', 1), (62, 'Spain', '', 'ESP', 1), (63, 'Ethiopia', '', 'ETH', 1), (64, 'Finland', '', 'FIN', 1), (65, 'Fiji', '', 'FJI', 1), (66, 'Falkland Islands (Malvinas)', '', 'FLK', 1), (67, 'Federated States of Micronesia', '', 'FSM', 1), (68, 'Faroe Islands', '', 'FRO', 1), (69, 'France', '', 'FRA', 1), (70, 'Gabon', '', 'GAB', 1), (71, 'Great Britain (UK)', '', 'GBR', 1), (72, 'Grenada', '', 'GRD', 1), (73, 'Georgia', '', 'GEO', 1), (74, 'French Guiana', '', 'GUF', 1), (75, 'NULL', '', 'GGY', 1), (76, 'Ghana', '', 'GHA', 1), (77, 'Gibraltar', '', 'GIB', 1), (78, 'Greenland', '', 'GRL', 1), (79, 'Gambia', '', 'GMB', 1), (80, 'Guinea', '', 'GIN', 1), (81, 'Guadeloupe', '', 'GLP', 1), (82, 'Equatorial Guinea', '', 'GNQ', 1), (83, 'Greece', '', 'GRC', 1), (84, 'S. Georgia and S. Sandwich Islands', '', 'SGS', 1), (85, 'Guatemala', '', 'GTM', 1), (86, 'Guinea-Bissau', '', 'GNB', 1), (87, 'Guyana', '', 'GUY', 1), (88, 'Hong Kong', '', 'HKG', 1), (89, 'Honduras', '', 'HND', 1), (90, 'Croatia (Hrvatska)', '', 'HRV', 1), (91, 'Haiti', '', 'HTI', 1), (92, 'Hungary', '', 'HUN', 1), (93, 'Indonesia', '', 'IDN', 1), (94, 'Ireland', '', 'IRL', 1), (95, 'Israel', '', 'ISR', 1), (96, 'India', '', 'IND', 1), (97, 'Iraq', '', 'IRQ', 1), (98, 'Iran', '', 'IRN', 1), (99, 'Iceland', '', 'ISL', 1), (100, 'Italy', '', 'ITA', 1), (101, 'Jamaica', '', 'JAM', 1), (102, 'Jordan', '', 'JOR', 1), (103, 'Japan', '', 'JPN', 1), (104, 'Kenya', '', 'KEN', 1), (105, 'Kyrgyzstan', '', 'KGZ', 1), (106, 'Cambodia', '', 'KHM', 1), (107, 'Kiribati', '', 'KIR', 1), (108, 'Comoros', '', 'COM', 1), (109, 'Saint Kitts and Nevis', '', 'KNA', 1), (110, 'Korea (North)', '', 'PRK', 1), (111, 'Korea (South)', '', 'KOR', 1), (112, 'Kuwait', '', 'KWT', 1), (113, 'Cayman Islands', '', 'CYM', 1), (114, 'Kazakhstan', '', 'KAZ', 1), (115, 'Laos', '', 'LAO', 1), (116, 'Lebanon', '', 'LBN', 1), (117, 'Saint Lucia', '', 'LCA', 1), (118, 'Liechtenstein', '', 'LIE', 1), (119, 'Sri Lanka', '', 'LKA', 1), (120, 'Liberia', '', 'LBR', 1), (121, 'Lesotho', '', 'LSO', 1), (122, 'Lithuania', '', 'LTU', 1), (123, 'Luxembourg', '', 'LUX', 1), (124, 'Latvia', '', 'LVA', 1), (125, 'Libya', '', 'LBY', 1), (126, 'Morocco', '', 'MAR', 1), (127, 'Monaco', '', 'MCO', 1), (128, 'Moldova', '', 'MDA', 1), (129, 'Madagascar', '', 'MDG', 1), (130, 'Marshall Islands', '', 'MHL', 1), (131, 'Macedonia', '', 'MKD', 1), (132, 'Mali', '', 'MLI', 1), (133, 'Myanmar', '', 'MMR', 1), (134, 'Mongolia', '', 'MNG', 1), (135, 'Macao', '', 'MAC', 1), (136, 'Northern Mariana Islands', '', 'MNP', 1), (137, 'Martinique', '', 'MTQ', 1), (138, 'Mauritania', '', 'MRT', 1), (139, 'Montserrat', '', 'MSR', 1), (140, 'Malta', '', 'MLT', 1), (141, 'Mauritius', '', 'MUS', 1), (142, 'Maldives', '', 'MDV', 1), (143, 'Malawi', '', 'MWI', 1), (144, 'Mexico', '', 'MEX', 1), (145, 'Malaysia', '', 'MYS', 1), (146, 'Mozambique', '', 'MOZ', 1), (147, 'Namibia', '', 'NAM', 1), (148, 'New Caledonia', '', 'NCL', 1), (149, 'Niger', '', 'NER', 1), (150, 'Norfolk Island', '', 'NFK', 1), (151, 'Nigeria', '', 'NGA', 1), (152, 'Nicaragua', '', 'NIC', 1), (153, 'Netherlands', '', 'NLD', 1), (154, 'Norway', '', 'NOR', 1), (155, 'Nepal', '', 'NPL', 1), (156, 'Nauru', '', 'NRU', 1), (157, 'Niue', '', 'NIU', 1), (158, 'New Zealand (Aotearoa)', '', 'NZL', 1), (159, 'Oman', '', 'OMN', 1), (160, 'Panama', '', 'PAN', 1), (161, 'Peru', '', 'PER', 1), (162, 'French Polynesia', '', 'PYF', 1), (163, 'Papua New Guinea', '', 'PNG', 1), (164, 'Philippines', '', 'PHL', 1), (165, 'Pakistan', '', 'PAK', 1), (166, 'Poland', '', 'POL', 1), (167, 'Saint Pierre and Miquelon', '', 'SPM', 1), (168, 'Pitcairn', '', 'PCN', 1), (169, 'Palestinian Territory', '', 'PSE', 1), (170, 'Portugal', '', 'PRT', 1), (171, 'Palau', '', 'PLW', 1), (172, 'Paraguay', '', 'PRY', 1), (173, 'Qatar', '', 'QAT', 1), (174, 'Reunion', '', 'REU', 1), (175, 'Romania', '', 'ROU', 1), (176, 'Russian Federation', '', 'RUS', 1), (177, 'Rwanda', '', 'RWA', 1), (178, 'Saudi Arabia', '', 'SAU', 1), (179, 'Solomon Islands', '', 'SLB', 1), (180, 'Seychelles', '', 'SYC', 1), (181, 'Sudan', '', 'SDN', 1), (182, 'Sweden', '', 'SWE', 1), (183, 'Singapore', '', 'SGP', 1), (184, 'Saint Helena', '', 'SHN', 1), (185, 'Slovenia', '', 'SVN', 1), (186, 'Svalbard and Jan Mayen', '', 'SJM', 1), (187, 'Slovakia', '', 'SVK', 1), (188, 'Sierra Leone', '', 'SLE', 1), (189, 'San Marino', '', 'SMR', 1), (190, 'Senegal', '', 'SEN', 1), (191, 'Somalia', '', 'SOM', 1), (192, 'Suriname', '', 'SUR', 1), (193, 'Sao Tome and Principe', '', 'STP', 1), (194, 'El Salvador', '', 'SLV', 1), (195, 'Syria', '', 'SYR', 1), (196, 'Swaziland', '', 'SWZ', 1), (197, 'Turks and Caicos Islands', '', 'TCA', 1), (198, 'Chad', '', 'TCD', 1), (199, 'French Southern Territories', '', 'ATF', 1), (200, 'Togo', '', 'TGO', 1), (201, 'Thailand', '', 'THA', 1), (202, 'Tajikistan', '', 'TJK', 1), (203, 'Tokelau', '', 'TKL', 1), (204, 'Turkmenistan', '', 'TKM', 1), (205, 'Tunisia', '', 'TUN', 1), (206, 'Tonga', '', 'TON', 1), (207, 'Turkey', '', 'TUR', 1), (208, 'Trinidad and Tobago', '', 'TTO', 1), (209, 'Tuvalu', '', 'TUV', 1), (210, 'Taiwan', '', 'TWN', 1), (211, 'Tanzania', '', 'TZA', 1), (212, 'Ukraine', '', 'UKR', 1), (213, 'Uganda', '', 'UGA', 1), (214, 'Uruguay', '', 'URY', 1), (215, 'Uzbekistan', '', 'UZB', 1), (216, 'Saint Vincent and the Grenadines', '', 'VCT', 1), (217, 'Venezuela', '', 'VEN', 1), (218, 'Virgin Islands (British)', '', 'VGB', 1), (219, 'Virgin Islands (U.S.)', '', 'VIR', 1), (220, 'Viet Nam', '', 'VNM', 1), (221, 'Vanuatu', '', 'VUT', 1), (222, 'Wallis and Futuna', '', 'WLF', 1), (223, 'Samoa', '', 'WSM', 1), (224, 'Yemen', '', 'YEM', 1), (225, 'Mayotte', '', 'MYT', 1), (226, 'South Africa', '', 'ZAF', 1), (227, 'Zambia', '', 'ZMB', 1), (228, 'Zaire (former)', '', 'ZAR', 1), (229, 'Zimbabwe', '', 'ZWE', 1), (230, 'United States of America', '', 'USA', 1); -- -------------------------------------------------------- -- -- Table structure for table `email_templates` -- CREATE TABLE `email_templates` ( `id` bigint(20) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `from_email` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `reply_to` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `name` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `description` text CHARACTER SET utf8 COLLATE utf8_unicode_ci, `subject` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL, `email_content` text CHARACTER SET utf8 COLLATE utf8_unicode_ci, `email_variables` text CHARACTER SET utf8 COLLATE utf8_unicode_ci, `is_active` tinyint(1) NOT NULL DEFAULT '1', `is_html` tinyint(1) NOT NULL DEFAULT '0' ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `email_templates` -- INSERT INTO `email_templates` (`id`, `created`, `modified`, `from_email`, `reply_to`, `name`, `description`, `subject`, `email_content`, `email_variables`, `is_active`, `is_html`) VALUES (1, '2015-06-22 11:28:15', '0000-00-00 00:00:00', 'hariharan@blazedream.com', NULL, 'Forgot Password Alert for User', 'Target USMLE - Forgot Password', 'Target USMLE - Forgot Password', '<table border="0" cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td>\r\n <table border="1" cellpadding="0" cellspacing="0" style="width:550px;border-color:#ccc;">\r\n <tbody>\r\n <tr>\r\n <td style="text-align:center;background-color:#FFF;"><img alt="[SITE_NAME]" src="[LOGO]" style="margin:10px" /></td>\r\n </tr>\r\n <tr>\r\n </tr>\r\n <tr>\r\n <td style="padding:15px;font: sans serif;">\r\n <p>Hi <b>[USERNAME]</b> ,</p>\r\n\r\n <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;There was recently a request to reset the password for your account. If you requested this password change, please click on the following link to reset your password: Click here to reset your password. or If clicking the link does not work, please copy and paste the URL into your browser instead.</p>\r\n\r\n <p><strong><a href="[PASSCODELINK]">Click here to Reset Password</a></strong></p>\r\n\r\n <p><b>Note:</b>&nbsp;Your password reset link will be expired after one day.</p>\r\n\r\n <p>Thanks &amp; Regards,</p>\r\n\r\n <p><b>[SITE_NAME]</b></p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>', NULL, 1, 1), (2, '2015-06-22 11:28:15', '0000-00-00 00:00:00', 'hariharan@blazedream.com', NULL, 'User Registration Admin', 'Target USMLE - User Registration(Admin)', 'Target USMLE - User Registration(Admin)', '<p>&nbsp;</p>\r\n\r\n<table border="0" cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td>\r\n <table border="1" cellpadding="0" cellspacing="0" style="width:550px;border-color:#ccc;">\r\n <tbody>\r\n <tr>\r\n <td style="text-align:center;background-color:#FFF;"><img alt="[SITE_NAME]" src="[LOGO]" style="margin:10px" /></td>\r\n </tr>\r\n <tr>\r\n </tr>\r\n <tr>\r\n <td style="padding:15px;font: sans serif;">\r\n <p>Hi <b>[USERNAME]</b> ,&nbsp;</p>\r\n\r\n <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; Target USMLE Admin has created and activated your account. Login to Target USMLE portal, using the provided Username and password.</p>\r\n\r\n <p><b>Email ID: </b>[USER_EMAIL]</p>\r\n\r\n <p><b>Password&nbsp; :</b> [PASSWORD]</p>\r\n\r\n <p>Please visit our website at [SITE_LINK]</p>\r\n\r\n <p>Thanks &amp; Regards,</p>\r\n\r\n <p><b>[SITE_NAME]</b></p>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style="padding:15px;font: sans serif;">&nbsp;</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>', NULL, 1, 1), (4, '2015-06-22 11:28:15', '0000-00-00 00:00:00', 'hariharan@blazedream.com', NULL, 'User Registration', 'Target USMLE - User Registration', 'Target USMLE - Registration Success', '<p>&nbsp;</p>\r\n\r\n<table border="0" cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td>\r\n <table border="1" cellpadding="0" cellspacing="0" style="width:550px;border-color:#ccc;">\r\n <tbody>\r\n <tr>\r\n <td style="text-align:center;background-color:#FFF;"><img alt="[SITE_NAME]" src="[LOGO]" style="margin:10px" /></td>\r\n </tr>\r\n <tr>\r\n </tr>\r\n <tr>\r\n <td style="padding:15px;font: sans serif;">\r\n <p>Hi <b>[USERNAME]</b> ,&nbsp;</p>\r\n\r\n <p>&nbsp; &nbsp; &nbsp; &nbsp; Thank you for registering with Us!!.</p>\r\n\r\n <p>Thanks &amp; Regards,</p>\r\n\r\n <p><b>[SITE_NAME]</b></p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>', NULL, 1, 1), (5, '2015-06-22 11:28:15', '0000-00-00 00:00:00', 'hariharan@blazedream.com', NULL, 'Reset Password Alert for User', 'Target USMLE - Reset Password', 'Target USMLE - Reset Password', '<table border="0" cellpadding="0" cellspacing="0" style="width:100%">\r\n <tbody>\r\n <tr>\r\n <td>\r\n <table border="1" cellpadding="0" cellspacing="0" style="width:550px;border-color:#ccc;">\r\n <tbody>\r\n <tr>\r\n <td style="text-align:center;background-color:#FFF;"><img alt="[SITET_NAME]" src="[LOGO]" style="margin:10px" /></td>\r\n </tr>\r\n <tr>\r\n <td style="padding:15px;font: sans serif;">\r\n <p>Hi <b>[USERNAME]</b> ,</p>\r\n\r\n <p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; You have successfully reset your password.</p>\r\n\r\n <p><strong><a href="[SITE_LINK]">Click here for link</a></strong></p>\r\n\r\n <p>&nbsp;</p>\r\n\r\n <p>Thanks &amp; Regards,</p>\r\n\r\n <p><b>[SITE_NAME]</b></p>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>', NULL, 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `enquiry_form` -- CREATE TABLE `enquiry_form` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `email_id` varchar(255) NOT NULL, `phone_number` varchar(255) NOT NULL, `comments` text NOT NULL, `is_read` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `user_id` bigint(20) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `faqs` -- CREATE TABLE `faqs` ( `id` int(11) NOT NULL, `category_id` int(11) NOT NULL, `question` text NOT NULL, `answer` text NOT NULL, `sort_order` int(11) NOT NULL, `status` int(11) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `faqs` -- INSERT INTO `faqs` (`id`, `category_id`, `question`, `answer`, `sort_order`, `status`, `created`, `modified`) VALUES (1, 1, 'What is Step 2 CS?', 'Step 2 CS is basically designed to test your ability to perform in a practical environment. Students are tested on written and verbal skills as well as the ability to carry out physical examinations and taking a proper medical history. With adherence to a few strategies during Step 2 CS preparation, a student will be adequately equipped to tackle the test. - See more at: https://www.targetusmle.com/step-2-cs-preparation.php#sthash.TXxJVhop.dpuf', 0, 1, '2017-10-13 15:43:55', '0000-00-00 00:00:00'), (2, 1, 'What is in offered?', 'The step 2 cs schedule helps as a guideline for medical graduates and doctors to plan their step 2 cs exam date in such a way that they get their score reports on time to appear for the match. A lot of thought needs to go in while looking at the step 2 cs schedule because the score reporting takes longer than it takes for step 1 or step 2 ck. While everyone wants to pass step 2 cs in the first attempt, some students find themselves missing out on the match because they did not plan on failing the first time! - See more at: https://www.targetusmle.com/step-2-cs-schedule.php#sthash.UKvD1Wr2.dpuf', 0, 0, '2017-10-13 15:45:32', '2017-10-13 15:47:41'), (3, 2, 'What is ecfmg step 2 cs?', '<p>Ecfmg step 2 cs bulletin is published well ahead of time - the previous year for international medical graduates (IMG) to plan your trip to the USA to take this unique exam. You should plan your exam dates/year according to the current ecfmg step 2 cs bulletin of the year you plan to take the exam</p>', 0, 1, '2017-10-13 15:51:03', '2017-10-16 11:26:47'), (6, 2, 'What is in offered?', '<p>test</p>', 0, 1, '2017-10-13 16:00:18', '2017-10-13 16:02:25'); -- -------------------------------------------------------- -- -- Table structure for table `faq_categories` -- CREATE TABLE `faq_categories` ( `id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `status` int(11) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `faq_categories` -- INSERT INTO `faq_categories` (`id`, `name`, `slug`, `status`, `created`, `modified`) VALUES (1, 'USMLE Step 2 CS Exam', 'usmle-step-2-cs-exam', 1, '2017-10-13 15:18:31', '0000-00-00 00:00:00'), (2, 'USMLE Step 2 CS Study Partners', 'usmle-step-2-cs-study-partners', 1, '2017-10-13 15:19:02', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `faq_queries` -- CREATE TABLE `faq_queries` ( `id` int(11) NOT NULL, `queries` text NOT NULL, `user_id` int(11) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL, `status` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `id` bigint(20) NOT NULL, `order_id` varchar(255) NOT NULL, `user_id` bigint(20) NOT NULL, `user_first_name` varchar(255) NOT NULL, `user_last_name` varchar(255) NOT NULL, `user_address` text NOT NULL, `user_country` bigint(20) NOT NULL, `user_city` bigint(20) NOT NULL, `user_skype` varchar(255) NOT NULL, `user_phone` varchar(255) NOT NULL, `amount` float NOT NULL, `products` varchar(255) NOT NULL, `product_type` int(11) NOT NULL, `valid_days` int(11) NOT NULL, `expiry_date` datetime NOT NULL, `is_extended` tinyint(1) NOT NULL, `is_webinar` tinyint(1) NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `order_history` -- CREATE TABLE `order_history` ( `id` bigint(20) NOT NULL, `order_id` bigint(20) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `type` tinyint(1) NOT NULL COMMENT '1 -> pending , 2 -> complete d, 3 -> rejected', `extended_days` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `order_transaction` -- CREATE TABLE `order_transaction` ( `id` bigint(20) NOT NULL, `order_id` bigint(20) NOT NULL, `transaction_id` text NOT NULL, `transaction_info` text NOT NULL, `payment_amount` float NOT NULL, `payment_currency` varchar(255) NOT NULL, `payment_status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE `product` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `price` float NOT NULL, `slug` varchar(255) NOT NULL, `product_type_id` bigint(20) NOT NULL, `valid_days` int(11) NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_attributes` -- CREATE TABLE `product_attributes` ( `id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `content_one` text NOT NULL, `content_two` text NOT NULL, `content_three` text NOT NULL, `video_url` text NOT NULL, `image` text NOT NULL, `product_included` varchar(255) NOT NULL, `included_valid_days` int(11) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_mock_exam` -- CREATE TABLE `product_mock_exam` ( `id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `type` enum('Online','Live','','') NOT NULL, `country_id` bigint(20) NOT NULL, `city_id` bigint(20) NOT NULL, `timing` time NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_mock_exam_available` -- CREATE TABLE `product_mock_exam_available` ( `id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `product_mock_exam_id` bigint(20) NOT NULL, `date` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_pnc_content` -- CREATE TABLE `product_pnc_content` ( `id` bigint(20) NOT NULL, `user_id` bigint(20) NOT NULL, `order_id` varchar(255) NOT NULL, `text_one` text NOT NULL, `text_two` text NOT NULL, `diagnosis_one_title` text NOT NULL, `diagnosis_two_title` text NOT NULL, `diagnosis_three_title` text NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_pnc_submit_list` -- CREATE TABLE `product_pnc_submit_list` ( `id` bigint(20) NOT NULL, `user_id` bigint(20) NOT NULL, `order_id` varchar(255) NOT NULL, `product_pnc_content_id` bigint(20) NOT NULL, `attachment_dir` text NOT NULL, `attachment` varchar(255) NOT NULL, `status` tinyint(1) NOT NULL, `is_read` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_pnc__diagnosis` -- CREATE TABLE `product_pnc__diagnosis` ( `id` bigint(20) NOT NULL, `product_pnc_content_id` bigint(20) NOT NULL, `diagnosis_type` enum('one','two','three') NOT NULL, `text_one` text NOT NULL, `text_two` text NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_step_categories` -- CREATE TABLE `product_step_categories` ( `id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `parent` bigint(20) NOT NULL, `description` text NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_step_videos` -- CREATE TABLE `product_step_videos` ( `id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `product_step_categories_id` bigint(20) NOT NULL, `file_url` text NOT NULL, `video_type` int(11) NOT NULL COMMENT '1 - high , 2- medium , 3-low', `correction_type` enum('Wrong','Correct') NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_type` -- CREATE TABLE `product_type` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `shortform` varchar(255) NOT NULL, `class_count` int(11) NOT NULL, `time_duration` int(11) NOT NULL, `created` datetime NOT NULL, `updated` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product_type` -- INSERT INTO `product_type` (`id`, `name`, `slug`, `shortform`, `class_count`, `time_duration`, `created`, `updated`) VALUES (1, 'Online Video Tutorials', 'online-video-tutorials', 'VID_TUT', 0, 0, '2017-10-12 18:41:10', '0000-00-00 00:00:00'), (2, 'Assesment Preparation', 'assesment-preparation', 'ASSES_PREP', 1, 1, '2017-10-12 18:45:58', '0000-00-00 00:00:00'), (3, 'Patient Note Correction', 'patient-note-correction', 'PNC', 1, 1, '2017-10-12 18:46:34', '0000-00-00 00:00:00'), (4, 'Webinar', 'webinar', 'WEBIN', 0, 0, '2017-10-12 18:47:33', '0000-00-00 00:00:00'), (5, 'Online Mock Exam', 'online-mock-exam', 'ON_MOCK', 1, 2, '2017-10-12 18:47:52', '0000-00-00 00:00:00'), (6, 'Live Mock Exam', 'live-mock-exam', 'LIV_MOCK', 0, 0, '2017-10-12 18:47:58', '0000-00-00 00:00:00'), (7, 'Combo Plan', 'combo-plan', 'COMBO_PLAN', 0, 0, '2017-10-12 18:48:08', '0000-00-00 00:00:00'), (8, 'Combo Package', 'combo-package', 'COMBO_PACK', 0, 0, '2017-10-12 18:48:16', '0000-00-00 00:00:00'), (9, 'Complete Comprehensive Course', 'complete-comprehensive-course', 'CCC', 6, 1, '2017-10-20 00:00:00', '0000-00-00 00:00:00'), (10, 'Rapid Review Course', 'rapid-review-course', 'RRC', 3, 1, '2017-10-12 18:47:06', '0000-00-00 00:00:00'); -- -------------------------------------------------------- -- -- Table structure for table `product_user_access` -- CREATE TABLE `product_user_access` ( `id` bigint(20) NOT NULL, `user_id` bigint(20) NOT NULL, `product_id` bigint(20) NOT NULL, `product_expiry_date` datetime NOT NULL, `is_extended` tinyint(1) NOT NULL, `is_expired` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `product_webinar` -- CREATE TABLE `product_webinar` ( `id` bigint(20) NOT NULL, `description` text NOT NULL, `image` text NOT NULL, `date_time` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `site_references` -- CREATE TABLE `site_references` ( `id` bigint(20) NOT NULL, `page_url` varchar(255) NOT NULL, `page_name` varchar(255) NOT NULL, `status` tinyint(1) NOT NULL DEFAULT '1' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `site_references` -- INSERT INTO `site_references` (`id`, `page_url`, `page_name`, `status`) VALUES (1, 'home/index', 'home', 1), (2, 'onlinevideo/index', 'onlinevideo', 1); -- -------------------------------------------------------- -- -- Table structure for table `site_settings` -- CREATE TABLE `site_settings` ( `id` bigint(20) NOT NULL, `setting_category_id` int(11) NOT NULL, `name` varchar(255) NOT NULL, `value` text NOT NULL, `description` text NOT NULL, `type` varchar(255) NOT NULL, `options` varchar(255) NOT NULL, `include_class` varchar(255) NOT NULL, `include_validation` varchar(255) NOT NULL, `label` varchar(255) NOT NULL, `sort_order` bigint(20) NOT NULL, `is_show` tinyint(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `site_settings` -- INSERT INTO `site_settings` (`id`, `setting_category_id`, `name`, `value`, `description`, `type`, `options`, `include_class`, `include_validation`, `label`, `sort_order`, `is_show`) VALUES (1, 1, 'site.name', 'Target USMLE', 'You can make changes in site name by using this value. ', 'text', '', '', 'trim|required', 'Site Name', 1, 1), (2, 1, 'site.date_format', 'M d, Y', 'You can make changes in date format of the site.', 'text', '', 'datepicker', 'trim|required', 'Date Format', 2, 0), (3, 1, 'site.datetime_format', 'M d, Y g:i:s A', 'You can make changes in date time format of the site.', 'text', '', 'datepicker', 'trim|required', 'Date Time Format', 3, 0), (4, 2, 'meta.keywords', 'STEP 2 CS Exam', 'You can make changes homepage meta keywords in this.', 'textarea', '', '', 'trim|required', 'Meta Keywords', 1, 1), (5, 2, 'meta.description', 'TARGET USMLE is an learning site for STEP 2 CS Exam', 'You can make changes homepage meta description in this.', 'textarea', '', '', 'trim|required', 'Meta Description', 2, 1), (6, 4, 'emailtemplate.from_email', 'dr.maryjune@targetusmle.com', 'You can make changes in Template From email for admin.', 'text', '', 'email', 'trim|required|valid_email', 'From Email', 1, 1), (7, 4, 'emailtemplate.to_email', 'dr.maryjune@targetusmle.com', 'You can make changes in Template To email for admin.', 'text', '', 'email', 'trim|required|valid_email', 'To Email', 2, 1), (8, 4, 'emailtemplate.reply_email', 'dr.maryjune@targetusmle.com', 'You can make changes in Template Reply email for admin.', 'text', '', 'email', 'trim|required|valid_email', 'Reply Email', 3, 1), (9, 5, 'pagination.front', '10', 'You can make changes in front end pagination by using this value. ', 'text', '', 'numberOnly', 'trim|required|numeric', 'Front Pagination', 1, 1), (10, 5, 'pagination.back', '10', 'You can make changes in front end pagination by using this value. ', 'text', '', 'numberOnly', 'trim|required|numeric', 'Back Pagination', 2, 1), (11, 1, 'site.address', 'Target USMLE\r\nNo. 2 Reddipalayam Street, 1st Floor,\r\nMugappair West,\r\nChennai 600 037,\r\nINDIA. - See more at: https://www.targetusmle.com/contactus.php#sthash.tIVbm5te.dpuf', 'You can make changes in site address by using this value. ', 'textarea', '', '', 'trim|required', 'Address', 6, 1), (12, 1, 'site.phone', '+91-9789930077', 'You can make changes in phone number by using this value. ', 'text', '', '', 'trim|required|regex_match[/^(?=.*[0-9])[- +0-9]+$/]', 'Phone no', 4, 1), (13, 1, 'site.secondary_phone', '+91-9789930077', 'You can make changes in secondary phone number by using this value. ', 'text', '', '', 'trim|required|regex_match[/^(?=.*[0-9])[- +0-9]+$/]', 'Secondary Phone no', 5, 1); -- -------------------------------------------------------- -- -- Table structure for table `site_settings_categories` -- CREATE TABLE `site_settings_categories` ( `id` bigint(20) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL, `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `description` text COLLATE utf8_unicode_ci NOT NULL, `show_order` int(11) NOT NULL, `is_show` tinyint(1) NOT NULL, `is_active` tinyint(1) NOT NULL ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- Dumping data for table `site_settings_categories` -- INSERT INTO `site_settings_categories` (`id`, `created`, `modified`, `name`, `description`, `show_order`, `is_show`, `is_active`) VALUES (1, '0000-00-00 00:00:00', '0000-00-00 00:00:00', 'site', 'Site settings', 1, 1, 1), (2, '2017-10-10 00:00:00', '2017-10-10 00:00:00', 'meta', 'meta details', 2, 1, 1), (3, '2017-10-10 00:00:00', '2017-10-10 00:00:00', 'social', 'social settings', 3, 1, 1), (4, '2017-10-10 00:00:00', '2017-10-10 00:00:00', 'emailtemplate', 'email template settings', 4, 1, 1), (5, '2017-10-12 00:00:00', '2017-10-12 00:00:00', 'pagination', 'Pagination', 5, 1, 1); -- -------------------------------------------------------- -- -- Table structure for table `testimonial` -- CREATE TABLE `testimonial` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `description` text NOT NULL, `category_id` bigint(20) NOT NULL, `type` enum('TEXT','VIDEO') NOT NULL, `youtube_link` text NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `status` tinyint(1) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `testimonial` -- INSERT INTO `testimonial` (`id`, `name`, `description`, `category_id`, `type`, `youtube_link`, `created`, `modified`, `status`) VALUES (1, 'Testimonial 1', '<p>test</p>', 2, 'VIDEO', 'https://www.youtube.com/embed/mTUgRsEwZ7E', '2017-10-16 14:55:01', '2017-10-16 14:55:01', 1), (2, 'Testimonial 2', '<p>test</p>', 1, 'TEXT', '', '2017-10-16 15:01:03', '2017-10-16 15:01:03', 1); -- -------------------------------------------------------- -- -- Table structure for table `testimonial_categories` -- CREATE TABLE `testimonial_categories` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `status` tinyint(1) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `testimonial_categories` -- INSERT INTO `testimonial_categories` (`id`, `name`, `slug`, `status`, `created`, `modified`) VALUES (1, 'ONLINE SKYPE TRAINING / LIVE MOCK EXAM, INDIA', 'online-skype-training-live-mock-exam-india', 1, '2017-10-13 19:46:07', '2017-10-13 19:46:07'), (2, 'ONLINE VIDEO TUTORIAL: 7 Easy Steps 2 CS', 'online-video-tutorial-7-easy-steps-2-cs', 1, '2017-10-13 19:46:49', '2017-10-13 19:46:49'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` int(11) NOT NULL, `first_name` varchar(255) NOT NULL, `last_name` varchar(255) NOT NULL, `username` varchar(255) NOT NULL, `email_id` varchar(255) NOT NULL, `password` text NOT NULL, `know_about_us` varchar(255) NOT NULL, `skype_id` varchar(255) NOT NULL, `phone_no` varchar(255) NOT NULL, `address` text NOT NULL, `country` int(11) NOT NULL, `city` int(11) NOT NULL, `exam_date` datetime NOT NULL, `exam_center` varchar(255) NOT NULL, `status` tinyint(4) NOT NULL, `is_email_verified` tinyint(4) NOT NULL, `ip_address` varchar(255) NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `users_batch_time_slot` -- CREATE TABLE `users_batch_time_slot` ( `id` bigint(20) NOT NULL, `user_time_slot_id` bigint(20) NOT NULL, `class_id` bigint(20) NOT NULL, `date` date NOT NULL, `time` time NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `users_ebook_amazon_count` -- CREATE TABLE `users_ebook_amazon_count` ( `id` bigint(20) NOT NULL, `user_id` bigint(20) NOT NULL, `user_first_name` varchar(255) NOT NULL, `user_last_name` varchar(255) NOT NULL, `user_address` text NOT NULL, `user_country` bigint(20) NOT NULL, `user_city` bigint(20) NOT NULL, `user_skype` varchar(255) NOT NULL, `user_phone` varchar(255) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `users_free_sample` -- CREATE TABLE `users_free_sample` ( `id` bigint(20) NOT NULL, `email` varchar(255) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `users_time_slot` -- CREATE TABLE `users_time_slot` ( `id` bigint(20) NOT NULL, `user_id` bigint(20) NOT NULL, `order_id` varchar(255) NOT NULL, `time_slot_id` bigint(20) NOT NULL, `batch_id` bigint(20) NOT NULL, `date` date NOT NULL, `time` time NOT NULL, `payment_method_status` tinyint(1) DEFAULT '0' COMMENT '1 - online , 2- offline', `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, `modified` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `users_webinar` -- CREATE TABLE `users_webinar` ( `id` bigint(20) NOT NULL, `name` varchar(255) NOT NULL, `email` varchar(255) NOT NULL, `skype_id` varchar(255) NOT NULL, `created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `youtube_channels` -- CREATE TABLE `youtube_channels` ( `id` int(11) NOT NULL, `title` varchar(255) NOT NULL, `slug` varchar(255) NOT NULL, `product_type` bigint(20) NOT NULL, `youtube_link` text NOT NULL, `created` datetime NOT NULL, `modified` datetime NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `admin_availability_time_slot` -- ALTER TABLE `admin_availability_time_slot` ADD PRIMARY KEY (`id`); -- -- Indexes for table `admin_batch_list` -- ALTER TABLE `admin_batch_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `admin_users` -- ALTER TABLE `admin_users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `advertisements` -- ALTER TABLE `advertisements` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ad_page` -- ALTER TABLE `ad_page` ADD PRIMARY KEY (`id`); -- -- Indexes for table `ad_page_position` -- ALTER TABLE `ad_page_position` ADD PRIMARY KEY (`id`); -- -- Indexes for table `banner_management` -- ALTER TABLE `banner_management` ADD PRIMARY KEY (`id`); -- -- Indexes for table `blogs` -- ALTER TABLE `blogs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `blog_categories` -- ALTER TABLE `blog_categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `carrier_applied_users` -- ALTER TABLE `carrier_applied_users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `carrier_openings` -- ALTER TABLE `carrier_openings` ADD PRIMARY KEY (`id`); -- -- Indexes for table `cities` -- ALTER TABLE `cities` ADD PRIMARY KEY (`id`); -- -- Indexes for table `cms_pages` -- ALTER TABLE `cms_pages` ADD PRIMARY KEY (`id`); -- -- Indexes for table `countries` -- ALTER TABLE `countries` ADD PRIMARY KEY (`id`); -- -- Indexes for table `email_templates` -- ALTER TABLE `email_templates` ADD PRIMARY KEY (`id`); -- -- Indexes for table `enquiry_form` -- ALTER TABLE `enquiry_form` ADD PRIMARY KEY (`id`); -- -- Indexes for table `faqs` -- ALTER TABLE `faqs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `faq_categories` -- ALTER TABLE `faq_categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `faq_queries` -- ALTER TABLE `faq_queries` ADD PRIMARY KEY (`id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`id`); -- -- Indexes for table `order_history` -- ALTER TABLE `order_history` ADD PRIMARY KEY (`id`); -- -- Indexes for table `order_transaction` -- ALTER TABLE `order_transaction` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product` -- ALTER TABLE `product` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_attributes` -- ALTER TABLE `product_attributes` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_mock_exam` -- ALTER TABLE `product_mock_exam` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_mock_exam_available` -- ALTER TABLE `product_mock_exam_available` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_pnc_content` -- ALTER TABLE `product_pnc_content` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_pnc_submit_list` -- ALTER TABLE `product_pnc_submit_list` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_pnc__diagnosis` -- ALTER TABLE `product_pnc__diagnosis` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_step_categories` -- ALTER TABLE `product_step_categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_step_videos` -- ALTER TABLE `product_step_videos` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_type` -- ALTER TABLE `product_type` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_user_access` -- ALTER TABLE `product_user_access` ADD PRIMARY KEY (`id`); -- -- Indexes for table `product_webinar` -- ALTER TABLE `product_webinar` ADD PRIMARY KEY (`id`); -- -- Indexes for table `site_references` -- ALTER TABLE `site_references` ADD PRIMARY KEY (`id`); -- -- Indexes for table `site_settings` -- ALTER TABLE `site_settings` ADD PRIMARY KEY (`id`); -- -- Indexes for table `site_settings_categories` -- ALTER TABLE `site_settings_categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `testimonial` -- ALTER TABLE `testimonial` ADD PRIMARY KEY (`id`); -- -- Indexes for table `testimonial_categories` -- ALTER TABLE `testimonial_categories` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users_batch_time_slot` -- ALTER TABLE `users_batch_time_slot` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users_ebook_amazon_count` -- ALTER TABLE `users_ebook_amazon_count` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users_free_sample` -- ALTER TABLE `users_free_sample` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users_time_slot` -- ALTER TABLE `users_time_slot` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users_webinar` -- ALTER TABLE `users_webinar` ADD PRIMARY KEY (`id`); -- -- Indexes for table `youtube_channels` -- ALTER TABLE `youtube_channels` ADD PRIMARY KEY (`id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `admin_availability_time_slot` -- ALTER TABLE `admin_availability_time_slot` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25; -- -- AUTO_INCREMENT for table `admin_batch_list` -- ALTER TABLE `admin_batch_list` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=103; -- -- AUTO_INCREMENT for table `admin_users` -- ALTER TABLE `admin_users` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `advertisements` -- ALTER TABLE `advertisements` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `ad_page` -- ALTER TABLE `ad_page` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `ad_page_position` -- ALTER TABLE `ad_page_position` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `banner_management` -- ALTER TABLE `banner_management` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `blogs` -- ALTER TABLE `blogs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `blog_categories` -- ALTER TABLE `blog_categories` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT for table `carrier_applied_users` -- ALTER TABLE `carrier_applied_users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `carrier_openings` -- ALTER TABLE `carrier_openings` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `cities` -- ALTER TABLE `cities` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `cms_pages` -- ALTER TABLE `cms_pages` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `countries` -- ALTER TABLE `countries` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=231; -- -- AUTO_INCREMENT for table `email_templates` -- ALTER TABLE `email_templates` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `enquiry_form` -- ALTER TABLE `enquiry_form` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `faqs` -- ALTER TABLE `faqs` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT for table `faq_categories` -- ALTER TABLE `faq_categories` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `faq_queries` -- ALTER TABLE `faq_queries` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `order_history` -- ALTER TABLE `order_history` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `order_transaction` -- ALTER TABLE `order_transaction` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product` -- ALTER TABLE `product` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_attributes` -- ALTER TABLE `product_attributes` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_mock_exam` -- ALTER TABLE `product_mock_exam` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_mock_exam_available` -- ALTER TABLE `product_mock_exam_available` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_pnc_content` -- ALTER TABLE `product_pnc_content` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_pnc_submit_list` -- ALTER TABLE `product_pnc_submit_list` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_pnc__diagnosis` -- ALTER TABLE `product_pnc__diagnosis` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_step_categories` -- ALTER TABLE `product_step_categories` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_step_videos` -- ALTER TABLE `product_step_videos` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_type` -- ALTER TABLE `product_type` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `product_user_access` -- ALTER TABLE `product_user_access` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `product_webinar` -- ALTER TABLE `product_webinar` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `site_references` -- ALTER TABLE `site_references` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `site_settings` -- ALTER TABLE `site_settings` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `site_settings_categories` -- ALTER TABLE `site_settings_categories` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT for table `testimonial` -- ALTER TABLE `testimonial` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `testimonial_categories` -- ALTER TABLE `testimonial_categories` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users_batch_time_slot` -- ALTER TABLE `users_batch_time_slot` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users_ebook_amazon_count` -- ALTER TABLE `users_ebook_amazon_count` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users_free_sample` -- ALTER TABLE `users_free_sample` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users_time_slot` -- ALTER TABLE `users_time_slot` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `users_webinar` -- ALTER TABLE `users_webinar` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `youtube_channels` -- ALTER TABLE `youtube_channels` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; /*!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 */;
--Recompile sp_recompile 'Insert_Data_Session'
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Puja]( [Id] [int] IDENTITY(1,1) NOT NULL, [Precio] [int] NULL, [IdPiedra] [int] NULL ) ON [PRIMARY] GO ALTER TABLE [dbo].[Puja] ADD PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] GO ALTER TABLE [dbo].[Puja] WITH CHECK ADD FOREIGN KEY([IdPiedra]) REFERENCES [dbo].[Roca] ([Id]) GO
CREATE TABLE underscored_no_fields ( id INT NOT NULL, sample_table_id INT NOT NULL, PRIMARY KEY (id), CONSTRAINT underscored_no_fields_sample_table_id_fkey FOREIGN KEY (sample_table_id) REFERENCES sample_table(id) ON DELETE NO ACTION ON UPDATE CASCADE );
select * from dm_documents where name like 'Client - Enclosing ATE%' update dm_documents set createdbyref = 'JJH' where name = 'Client - Enclosing ATE policy (LVPI-PM)'
/* NOTE that all extents in this file assume *no* initial data load. If the table will have data, you must calculate accordingly or performance will be *bad*. Change table, PK and index creation statements only for those tables which will have an initial data load. Altered by Andrew Gilmore to reflect estimated initial load/first few months storage need. Initial storages taken from current UCHDB2 size as of May 5, 2005. */ create table m_day ( model_run_id number(11) NOT NULL , site_datatype_id number(11) NOT NULL , start_date_time date NOT NULL, end_date_time date NOT NULL, value float NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 400M) ; ALTER TABLE m_day ADD ( CONSTRAINT m_day_pk PRIMARY KEY (model_run_id, site_datatype_id, start_date_time) using index storage (initial 300M) tablespace hdb_idx); create index m_day_date_idx on m_day(start_date_time) tablespace HDB_idx storage(initial 200M) ; create table m_hour ( model_run_id number(11) NOT NULL , site_datatype_id number(11) NOT NULL , start_date_time date NOT NULL, end_date_time date NOT NULL, value float NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE m_hour ADD ( CONSTRAINT m_hour_pk PRIMARY KEY (model_run_id, site_datatype_id, start_date_time) using index storage (initial 64k) tablespace hdb_idx); create index m_hour_date_idx on m_hour(start_date_time) tablespace HDB_idx storage(initial 64k) ; create table m_month ( model_run_id number(11) NOT NULL , site_datatype_id number(11) NOT NULL , start_date_time date NOT NULL, end_date_time date NOT NULL, value float NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 70M) ; ALTER TABLE m_month ADD ( CONSTRAINT m_month_pk PRIMARY KEY (model_run_id, site_datatype_id, start_date_time) using index storage (initial 70M) tablespace hdb_idx); create index m_month_date_idx on m_month(start_date_time) tablespace HDB_idx storage(initial 30M) ; create table m_monthrange ( model_run_id number(11) NOT NULL , site_datatype_id number(11) NOT NULL , start_date_month date NOT NULL , end_date_month date NOT NULL , value float NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE m_monthrange ADD ( CONSTRAINT m_monthrange_pk PRIMARY KEY (model_run_id,site_datatype_id, start_date_month) using index storage (initial 64k) tablespace hdb_idx); create index m_monthrange_date_idx on m_monthrange(start_date_month, end_date_month) tablespace HDB_idx storage(initial 64k) ; create table m_monthstat ( model_run_id number(11) NOT NULL , site_datatype_id number(11) NOT NULL , month number(11) NOT NULL , value float NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE m_monthstat ADD ( CONSTRAINT m_monthstat_pk PRIMARY KEY (model_run_id,site_datatype_id,month ) using index storage (initial 64k) tablespace hdb_idx); create index m_monthstat_date_idx on m_monthstat(month) tablespace HDB_idx storage(initial 64k) ; create table m_wy ( model_run_id number(11) NOT NULL , site_datatype_id number(11) NOT NULL , start_date_time date NOT NULL, end_date_time date NOT NULL, value float NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE m_wy ADD ( CONSTRAINT m_wy_pk PRIMARY KEY (model_run_id, site_datatype_id, start_date_time) using index storage (initial 64k) tablespace hdb_idx); create index m_wy_date_idx on m_wy(start_date_time) tablespace HDB_idx storage(initial 64k) ; create table m_year ( model_run_id number(11) NOT NULL , site_datatype_id number(11) NOT NULL , start_date_time date NOT NULL, end_date_time date NOT NULL, value float NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE m_year ADD ( CONSTRAINT m_year_pk PRIMARY KEY (model_run_id, site_datatype_id, start_date_time) using index storage (initial 64k) tablespace hdb_idx); create index m_year_date_idx on m_year(start_date_time) tablespace HDB_idx storage(initial 64k) ; create table r_base (site_datatype_id number NOT NULL, interval varchar2(16) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, value float NOT NULL, agen_id number NOT NULL, overwrite_flag varchar2(1), date_time_loaded date, validation char(1), collection_system_id number NOT NULL, loading_application_id number NOT NULL, method_id number NOT NULL, computation_id number NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 600M) ; alter table r_base add constraint r_base_pk primary key (site_datatype_id, interval, start_date_time,end_date_time) using index storage (initial 600M) tablespace hdb_idx; create index r_base_date_idx on r_base(start_date_time) tablespace HDB_idx storage(initial 250M) ; create index r_base_enddate_idx on r_base(end_date_time) tablespace HDB_idx storage(initial 250M) ; create table r_base_archive (site_datatype_id number NOT NULL, interval varchar2(16) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, value number NOT NULL, agen_id number, overwrite_flag varchar2(1), date_time_loaded date, validation char(1), collection_system_id number, loading_application_id number, method_id number, computation_id number, archive_reason varchar2(10) not null, date_time_archived date not null ) pctfree 1 --never should get an update tablespace HDB_data storage (initial 600M) ; create index r_base_archive_idx on r_base_archive(site_datatype_id,interval,start_date_time,end_date_time) tablespace HDB_idx storage(initial 600M) ; create table r_base_update (site_datatype_id number NOT NULL, interval varchar2(16) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, overwrite_flag varchar2(1), ready_for_delete varchar2(1) ) tablespace HDB_data storage(initial 10M); alter table r_base_update add constraint r_base_update_pk primary key (site_datatype_id, interval, start_date_time,end_date_time) using index storage (initial 64k) tablespace hdb_idx; create table r_day ( site_datatype_id number(11) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, date_time_loaded date NOT NULL, value float NOT NULL, source_id number(11), validation char(1), overwrite_flag varchar2(1), method_id number, derivation_flags varchar2(20) ) pctfree 10 tablespace HDB_data storage (initial 500M) ; ALTER TABLE r_day ADD ( CONSTRAINT r_day_pk PRIMARY KEY (site_datatype_id,start_date_time) using index storage (initial 350M) tablespace hdb_idx); create index r_day_date_idx on r_day(start_date_time) tablespace HDB_idx storage(initial 250M) ; create table r_daystat ( site_datatype_id number(11) NOT NULL , day number(11) NOT NULL , value float NOT NULL , source_id number(11) NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 2M) ; ALTER TABLE r_daystat ADD ( CONSTRAINT r_daystat_pk PRIMARY KEY (site_datatype_id,day) using index storage (initial 3M) tablespace hdb_idx); create index r_daystat_date_idx on r_daystat(day) tablespace HDB_idx storage(initial 3M) ; create table r_hour ( site_datatype_id number(11) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, date_time_loaded date NOT NULL, value float NOT NULL, source_id number(11), validation char(1), overwrite_flag varchar2(1), method_id number, derivation_flags varchar2(20) ) pctfree 10 tablespace HDB_data storage (initial 300M) ; ALTER TABLE r_hour ADD ( CONSTRAINT r_hour_pk PRIMARY KEY (site_datatype_id,start_date_time) using index storage (initial 250M) tablespace hdb_idx); create index r_hour_date_idx on r_hour(start_date_time) tablespace HDB_idx storage(initial 200M) ; create table r_hourstat ( site_datatype_id number(11) NOT NULL , hour number(11) NOT NULL , value float NOT NULL , source_id number(11) NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE r_hourstat ADD ( CONSTRAINT r_hourstat_pk PRIMARY KEY (site_datatype_id,hour) using index storage (initial 64k) tablespace hdb_idx); create index r_hourstat_date_idx on r_hourstat(hour) tablespace HDB_idx storage(initial 64k) ; create table r_instant ( site_datatype_id number(11) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, date_time_loaded date NOT NULL, value float NOT NULL, source_id number(11), validation char(1), overwrite_flag varchar2(1), method_id number, derivation_flags varchar2(20) ) pctfree 10 tablespace HDB_data storage (initial 500M) ; ALTER TABLE r_instant ADD ( CONSTRAINT r_instant_pk PRIMARY KEY (site_datatype_id, start_date_time) using index storage (initial 400M) tablespace hdb_idx); create index r_instant_date_idx on r_instant(start_date_time) tablespace HDB_idx storage(initial 300M) ; create table r_month ( site_datatype_id number(11) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, date_time_loaded date NOT NULL, value float NOT NULL, source_id number(11), validation char(1), overwrite_flag varchar2(1), method_id number, derivation_flags varchar2(20) ) pctfree 10 tablespace HDB_data storage (initial 10M) ; ALTER TABLE r_month ADD ( CONSTRAINT r_month_pk PRIMARY KEY (site_datatype_id,start_date_time) using index storage (initial 10M) tablespace hdb_idx); create index r_month_date_idx on r_month(start_date_time) tablespace HDB_idx storage(initial 4M) ; create table r_monthstat ( site_datatype_id number(11) NOT NULL , month number(11) NOT NULL , value float NOT NULL , source_id number(11) NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE r_monthstat ADD ( CONSTRAINT r_monthstat_pk PRIMARY KEY (site_datatype_id,month ) using index storage (initial 64k) tablespace hdb_idx); create index r_monthstat_date_idx on r_monthstat(month) tablespace HDB_idx storage(initial 64k) ; create table r_monthstatrange ( site_datatype_id number(11) NOT NULL , start_month number(11) NOT NULL , end_month number(11) NOT NULL , value float NOT NULL , source_id number(11) NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE r_monthstatrange ADD ( CONSTRAINT r_monthstatrange_pk PRIMARY KEY (site_datatype_id,start_month,end_month) using index storage (initial 64k) tablespace hdb_idx); create index r_monthstatrange_date_idx on r_monthstatrange(start_month, end_month) tablespace HDB_idx storage(initial 64k) ; create table r_wy ( site_datatype_id number(11) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, date_time_loaded date NOT NULL, value float NOT NULL, source_id number(11), validation char(1), overwrite_flag varchar2(1), method_id number, derivation_flags varchar2(20) ) pctfree 10 tablespace HDB_data storage (initial 400k) ; ALTER TABLE r_wy ADD ( CONSTRAINT r_wy_pk PRIMARY KEY (site_datatype_id,start_date_time) using index storage (initial 250k) tablespace hdb_idx); create index r_wy_date_idx on r_wy(start_date_time) tablespace HDB_idx storage(initial 150k) ; create table r_wystat ( site_datatype_id number(11) NOT NULL , wy number(11) NOT NULL , value float NOT NULL , source_id number(11) NOT NULL ) pctfree 10 tablespace HDB_data storage (initial 64k) ; ALTER TABLE r_wystat ADD ( CONSTRAINT r_wystat_pk PRIMARY KEY (site_datatype_id,wy) using index storage (initial 64k) tablespace hdb_idx); create index r_wystat_date_idx on r_wystat(wy) tablespace HDB_idx storage(initial 64k) ; create table r_year ( site_datatype_id number(11) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, date_time_loaded date NOT NULL, value float NOT NULL, source_id number(11), validation char(1), overwrite_flag varchar2(1), method_id number, derivation_flags varchar2(20) ) pctfree 10 tablespace HDB_data storage (initial 400k) ; ALTER TABLE r_year ADD ( CONSTRAINT r_year_pk PRIMARY KEY (site_datatype_id,start_date_time) using index storage (initial 250k) tablespace hdb_idx); create index r_year_date_idx on r_year(start_date_time) tablespace HDB_idx storage(initial 150k) ; create table r_yearstat ( site_datatype_id number(11) NOT NULL , year number(11) NOT NULL , value float NOT NULL , source_id number(11) NOT NULL ) pctfree 10 pctused 80 tablespace HDB_data storage (initial 64k) ; ALTER TABLE r_yearstat ADD ( CONSTRAINT r_yearstat_pk PRIMARY KEY (site_datatype_id,year) using index storage (initial 64k) tablespace hdb_idx); create index r_yearstat_date_idx on r_yearstat(year) tablespace HDB_idx storage(initial 64k) ; create table r_other ( site_datatype_id number(11) NOT NULL, start_date_time date NOT NULL, end_date_time date NOT NULL, date_time_loaded date NOT NULL, value float NOT NULL, source_id number(11), validation char(1), overwrite_flag varchar2(1), method_id number, derivation_flags varchar2(20) ) pctfree 10 tablespace HDB_data storage (initial 1024k) ; ALTER TABLE r_other ADD ( CONSTRAINT r_other_pk PRIMARY KEY (site_datatype_id, start_date_time, end_date_time) using index storage (initial 64k) tablespace hdb_idx); create index r_other_date_idx on r_other(start_date_time) tablespace HDB_idx storage(initial 64k) ;
--Problem URL: https://www.hackerrank.com/challenges/average-population-of-each-continent/problem SELECT COUNTRY.CONTINENT, FLOOR(AVG(CITY.POPULATION)) FROM COUNTRY INNER JOIN CITY ON COUNTRY.CODE = CITY.COUNTRYCODE GROUP BY COUNTRY.CONTINENT;
DROP TABLE IF EXISTS sessiones_activas; create table sessiones_activas ( id_session varchar(40), usuario varchar(20), id_sucursal MEDIUMINT, jerarquia varchar(5), finaliza varchar(20) ); alter table sessiones_activas add index id_session(id_session); DROP TABLE IF EXISTS datos_caja; create table datos_caja ( id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, numero_suc varchar(5), fecha date, total_efectivo double(10,2), total_tarjeta double(10,2), sin_comision double(10,2), turno varchar(1), fecha_sistema date, hora_sistema time, id_sucursal MEDIUMINT, id_session varchar(30), PRIMARY KEY (id) ); alter table datos_caja add index fecha_sistema(fecha_sistema); alter table datos_caja add index fecha(fecha); DROP TABLE IF EXISTS comisiones_vendedores; create table comisiones_vendedores( id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, id_datos_caja MEDIUMINT UNSIGNED, fecha date, turno varchar(1), vendedor varchar(10), linea varchar(20), total double(10,2), fecha_sistema date, hora_sistema time, id_sucursal MEDIUMINT, id_session varchar(30), PRIMARY KEY (id) ); alter table comisiones_vendedores add index id_session(id_session); alter table comisiones_vendedores add index vendedor(vendedor); alter table comisiones_vendedores add index fecha(fecha); alter table comisiones_vendedores add index fecha_sistema(fecha_sistema); alter table comisiones_vendedores add index linea(linea); alter table comisiones_vendedores add index turno(turno); DROP TABLE IF EXISTS costos; create table costos ( id MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT, id_articulos MEDIUMINT, precio_costo double, moneda varchar(6), descuento1 double, descuento2 double, descuento3 double, descuento4 double, descuento5 double, descuento6 double, descuento7 double, descuento8 double, descuento9 double, descuento10 double, iva double, margen double, fecha date, hora time, PRIMARY KEY (id) ); alter table costos add index id_articulos(id_articulos); DROP TABLE IF EXISTS valores; create table valores( id MEDIUMINT UNSIGNED NOT NULL , descripcion varchar(60), valor varchar(60) ); alter table valores add index id(id); alter table valores add index descripcion(descripcion); insert into valores set id="1", descripcion="precio dolar", valor="3.65"; insert into valores set id="2", descripcion="I.V.A.", valor="10.5"; insert into valores set id="3", descripcion="I.V.A.", valor="21"; alter table precios modify precio_base double; drop table sincronizaciones; drop table inter1; drop table comisiones; insert into usuarios set usuario="megatron", contrasena="salchichon", jerarquia="5";
SELECT * FROM deaths;
-- -- YB_TABLEGROUP Testsuite: Testing Statments for TABLEGROUP. -- \h CREATE TABLEGROUP \h ALTER TABLEGROUP \h DROP TABLEGROUP -- -- pg_catalog alterations. Validate columns of pg_yb_tablegroup and oids. -- \d pg_yb_tablegroup SELECT oid, relname, reltype, relnatts FROM pg_class WHERE relname IN ('pg_yb_tablegroup', 'pg_yb_tablegroup_oid_index'); SELECT oid, typname, typrelid FROM pg_type WHERE typname LIKE 'pg_yb_tablegroup'; -- -- CREATE TABLEGROUP -- CREATE TABLEGROUP tgroup1; CREATE TABLEGROUP tgroup2; CREATE TABLEGROUP tgroup3; CREATE TABLE tgroup_test1 (col1 int, col2 int) TABLEGROUP tgroup1; CREATE INDEX ON tgroup_test1(col2); CREATE TABLE tgroup_test2 (col1 int, col2 int) TABLEGROUP tgroup1; CREATE TABLE nogroup (col1 int) NO TABLEGROUP; -- fail CREATE TABLE nogroup (col1 int); -- TODO(alex): Create a table with a primary key SELECT grpname FROM pg_yb_tablegroup; SELECT cl.relname, tg.grpname FROM pg_class cl, yb_table_properties(cl.oid) props LEFT JOIN pg_yb_tablegroup tg ON tg.oid = props.tablegroup_oid WHERE cl.oid >= 16384 ORDER BY cl.relname; CREATE TABLE tgroup_test3 (col1 int, col2 int) TABLEGROUP tgroup2; CREATE INDEX ON tgroup_test3(col1); SELECT cl.relname, tg.grpname FROM pg_class cl, yb_table_properties(cl.oid) props LEFT JOIN pg_yb_tablegroup tg ON tg.oid = props.tablegroup_oid WHERE cl.oid >= 16384 ORDER BY cl.relname; -- These should fail. CREATE TABLEGROUP tgroup1; CREATE TABLE tgroup_test (col1 int, col2 int) TABLEGROUP bad_tgroupname; CREATE TABLE tgroup_optout (col1 int, col2 int) WITH (colocated=false) TABLEGROUP tgroup1; CREATE TABLE tgroup_optout (col1 int, col2 int) WITH (colocated=true) TABLEGROUP tgroup1; CREATE TABLE tgroup_optout (col1 int, col2 int) WITH (colocated=false) TABLEGROUP bad_tgroupname; CREATE TEMP TABLE tgroup_temp (col1 int, col2 int) TABLEGROUP tgroup1; CREATE INDEX ON tgroup_test3(col1) TABLEGROUP tgroup1; -- fail CREATE INDEX ON tgroup_test3(col1) NO TABLEGROUP; -- fail -- -- Cannot drop dependent objects -- CREATE USER alice; CREATE USER bob; CREATE TABLEGROUP alice_grp OWNER alice; CREATE TABLEGROUP alice_grp_2 OWNER alice; CREATE TABLEGROUP alice_grp_3 OWNER alice; CREATE TABLE bob_table (a INT) TABLEGROUP alice_grp; CREATE TABLE bob_table_2 (a INT) TABLEGROUP alice_grp_2; CREATE TABLE bob_table_3 (a INT) TABLEGROUP alice_grp_3; CREATE TABLE alice_table (a INT); ALTER TABLE bob_table OWNER TO bob; ALTER TABLE bob_table_2 OWNER TO bob; ALTER TABLE bob_table_3 OWNER TO bob; ALTER TABLE alice_table OWNER TO alice; -- Fails \set VERBOSITY terse \\ -- suppress dependency details. DROP TABLEGROUP alice_grp; -- because bob_table depends on alice_grp DROP USER alice; -- because alice still owns tablegroups DROP OWNED BY alice; -- because bob's tables depend on alice's tablegroups \set VERBOSITY default -- Succeeds DROP TABLEGROUP alice_grp_3 CASCADE; DROP TABLE bob_table; SELECT relname FROM pg_class WHERE relname LIKE 'bob%'; DROP TABLEGROUP alice_grp; -- bob_table is gone, so alice_grp has no deps DROP OWNED BY alice CASCADE; -- CASCADE means we are allowed to drop bob's tables. We'll notify about any entities that she doesn't own. DROP USER alice; -- we dropped all of alice's entities, so we can remove her SELECT relname FROM pg_class WHERE relname LIKE 'bob%'; -- -- Usage of WITH tablegroup_oid for CREATE TABLE/INDEX. These all fail. -- CREATE TABLE tgroup_with1 (col1 int, col2 int) WITH (tablegroup_oid=16385); CREATE TABLE tgroup_with2 (col1 int, col2 int) WITH (tablegroup_oid=16385, colocated=true); CREATE TABLE tgroup_with2 (col1 int, col2 int) WITH (tablegroup_oid=16385, colocated=false); CREATE TABLE tgroup_with3 (col1 int, col2 int) WITH (tablegroup_oid=16385) TABLEGROUP tgroup1; CREATE TABLE tgroup_with4 (col1 int, col2 int) WITH (tablegroup_oid=123); CREATE INDEX ON tgroup_test1(col1) WITH (tablegroup_oid=123); CREATE INDEX ON tgroup_test1(col1) WITH (tablegroup_oid=123, colocated=true); -- -- Usage of SPLIT clause with TABLEGROUP should fail -- CREATE TABLE tgroup_split (col1 int PRIMARY KEY) SPLIT INTO 3 TABLETS TABLEGROUP tgroup1; CREATE TABLE tgroup_split (col1 int, col2 text) SPLIT INTO 3 TABLETS TABLEGROUP tgroup1; CREATE INDEX ON tgroup_test1(col1) SPLIT AT VALUES((10), (20), (30)); -- -- Test describes -- CREATE TABLE tgroup_test4 (col1 int, col2 int) TABLEGROUP tgroup2; CREATE INDEX ON tgroup_test4(col1); CREATE INDEX ON tgroup_test4(col2); -- Add comments COMMENT ON TABLEGROUP tgroup1 IS 'Comment for Tablegroup 1'; COMMENT ON TABLEGROUP tgroup2 IS 'Comment for Tablegroup 2'; \dgr \dgr+ \dgrt \dgrt+ COMMENT ON TABLEGROUP tgroup2 IS NULL; \dgr+ tgroup2 \dgrt tgroup2 -- Describe table \d tgroup_test2 \d tgroup_test4 \d tgroup_test4_col1_idx CREATE TABLEGROUP tgroup_describe1; CREATE TABLEGROUP tgroup_describe2; CREATE TABLE tgroup_describe (col1 int) TABLEGROUP tgroup_describe1; CREATE INDEX ON tgroup_describe(col1); \d tgroup_describe -- -- DROP TABLEGROUP -- DROP TABLEGROUP tgroup3; -- These should fail. CREATE TABLE is to check that the row entry was deleted from pg_yb_tablegroup. CREATE TABLE tgroup_test5 (col1 int, col2 int) TABLEGROUP tgroup3; \set VERBOSITY terse \\ -- suppress dependency details. DROP TABLEGROUP tgroup1; DROP TABLEGROUP IF EXISTS tgroup1; \set VERBOSITY default DROP TABLEGROUP bad_tgroupname; -- This drop should work now. DROP TABLE tgroup_test1; DROP TABLE tgroup_test2; DROP TABLEGROUP tgroup1; DROP TABLEGROUP IF EXISTS tgroup1; -- Create a tablegroup with the name of a dropped tablegroup. CREATE TABLEGROUP tgroup1; DROP TABLEGROUP IF EXISTS tgroup1; CREATE TABLEGROUP tgroup1; -- -- Assigning a tablespace to a tablegroup -- CREATE TABLESPACE tblspc WITH (replica_placement='{"num_replicas": 1, "placement_blocks": [{"cloud":"cloud1","region":"datacenter1","zone":"rack1","min_num_replicas":1}]}'); -- These should fail CREATE TABLEGROUP grp1 TABLESPACE nonexistentspc; CREATE TABLEGROUP grp2 TABLESPACE pg_global; -- These should succeeed CREATE TABLEGROUP grp3 TABLESPACE tblspc; SET default_tablespace = "tblspc"; CREATE TABLEGROUP grp4; SET default_tablespace = ''; CREATE TABLE tgroup_test6 (col1 int, col2 int) TABLEGROUP grp3; \dgr+ \dgrt+ -- -- Interactions with colocated database. -- CREATE DATABASE db_colocated colocated=true; \c db_colocated -- This should fail. CREATE TABLEGROUP tgroup1;
-- @testpoint:opengauss关键字leading(保留),作为角色名 --关键字不带引号-合理报错 drop role if exists leading; create role leading with password 'gauss@123' valid until '2020-12-31'; --关键字带双引号-成功 drop role if exists "leading"; create role "leading" with password 'gauss@123' valid until '2020-12-31'; --清理环境 drop role "leading"; --关键字带单引号-合理报错 drop role if exists 'leading'; create role 'leading' with password 'gauss@123' valid until '2020-12-31'; --关键字带反引号-合理报错 drop role if exists `leading`; create role `leading` with password 'gauss@123' valid until '2020-12-31';
-- phpMyAdmin SQL Dump -- version 4.6.6deb5ubuntu0.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Jan 18, 2021 at 06:21 PM -- Server version: 5.7.32-0ubuntu0.18.04.1 -- PHP Version: 7.3.20-1+ubuntu18.04.1+deb.sury.org+1 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 utf8mb4 */; -- -- Database: `db_gmkorder` -- -- -------------------------------------------------------- -- -- Table structure for table `failed_jobs` -- CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED 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; -- -------------------------------------------------------- -- -- Table structure for table `gambar_produk` -- CREATE TABLE `gambar_produk` ( `id` int(11) NOT NULL, `kode_produk` varchar(100) DEFAULT NULL, `nama` text ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `gambar_produk` -- INSERT INTO `gambar_produk` (`id`, `kode_produk`, `nama`) VALUES (10, 'Brg0002', '1610800814-4.jpg'), (11, 'Brg0002', '1610800816-3.jpg'), (12, 'Brg0002', '1610800816-2.jpg'), (13, 'Brg0003', '1610801767-4.jpg'); -- -------------------------------------------------------- -- -- Table structure for table `kategori_produk` -- CREATE TABLE `kategori_produk` ( `id` int(11) NOT NULL, `nama` varchar(200) DEFAULT NULL, `slug` text, `gambar` text, `status` enum('Aktif','Non Aktif') DEFAULT 'Aktif' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `kategori_produk` -- INSERT INTO `kategori_produk` (`id`, `nama`, `slug`, `gambar`, `status`) VALUES (1, 'Baju Wanita', 'baju-wanita', '1610767706-prodect_details_1.png', 'Aktif'), (2, 'Baju Pria Terbaru', 'baju-pria-terbaru', '1610767912-prodect_details_2.png', 'Aktif'); -- -------------------------------------------------------- -- -- Table structure for table `migrations` -- CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `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, '2020_06_30_022914_create_pengguna_table', 1); -- -------------------------------------------------------- -- -- Table structure for table `password_resets` -- CREATE TABLE `password_resets` ( `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Table structure for table `pengguna` -- CREATE TABLE `pengguna` ( `id` bigint(20) UNSIGNED NOT NULL, `username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `nama` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `telp` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gambar` text COLLATE utf8mb4_unicode_ci, `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Dumping data for table `pengguna` -- INSERT INTO `pengguna` (`id`, `username`, `nama`, `email`, `telp`, `gambar`, `password`, `remember_token`) VALUES (2, 'deva', 'deva', 'satriosuklun@gmail.com', '08230', '1610714858-user2-160x160.jpg', '$2y$10$.f2D5qmNHfh4lB3SkcXXueOr9KouCRdhcTOLOWOOdTBEN8wnkvBEG', NULL); -- -------------------------------------------------------- -- -- Table structure for table `produk` -- CREATE TABLE `produk` ( `id` bigint(20) NOT NULL, `kode` text, `kategori_produk` int(11) DEFAULT NULL, `nama` varchar(200) DEFAULT NULL, `hpp` int(11) DEFAULT '0', `harga_jual` int(11) DEFAULT '0', `stok` int(11) DEFAULT '0', `deskripsi` text, `gambar_utama` text, `slug` text, `status` enum('Aktif','Non Aktif','Habis') DEFAULT 'Aktif' ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `produk` -- INSERT INTO `produk` (`id`, `kode`, `kategori_produk`, `nama`, `hpp`, `harga_jual`, `stok`, `deskripsi`, `gambar_utama`, `slug`, `status`) VALUES (6, 'Brg0002', 1, 'admin', 20000, 30000, 41, 'klsdfjkl', '1610800814-1.jpg', 'admin', 'Non Aktif'), (7, 'Brg0003', 2, 'safd', 20000, 33000, 11, 'ini deskripsi', '1610802490-1.jpg', 'safd', 'Aktif'), (8, 'brg02', NULL, 'barang satu', 0, 0, 0, 'asdfj', NULL, NULL, 'Aktif'), (15, 'Brg0005', 1, 'barang satu', 2000, 3000, 18, 'asdfj', NULL, NULL, 'Aktif'), (16, 'Brg0004', 1, 'barang satu', 100, 3001, 15, 'asdfj', NULL, NULL, 'Aktif'), (17, 'Brg0006', 1, 'barang satu', 2002, 3002, 12, 'asdfj', NULL, NULL, 'Aktif'); -- -------------------------------------------------------- -- -- Table structure for table `stok_log` -- CREATE TABLE `stok_log` ( `id` bigint(20) NOT NULL, `kode_produk` text, `user_id` int(11) DEFAULT NULL, `status` varchar(100) DEFAULT NULL, `aksi` text, `deskripsi` text, `jumlah` varchar(100) DEFAULT NULL, `jumlah_akhir` varchar(100) DEFAULT NULL, `tanggal` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `stok_log` -- INSERT INTO `stok_log` (`id`, `kode_produk`, `user_id`, `status`, `aksi`, `deskripsi`, `jumlah`, `jumlah_akhir`, `tanggal`) VALUES (1, 'Brg0003', 1, 'Import Penyesuaian Stok', 'Mengurangi', 'Mengedit stok produk', '1', '11', '2021-01-18 11:18:13'), (2, 'Brg0002', 1, 'Import Penyesuaian Stok', 'Menambahkan', 'Mengedit stok produk', '15', '41', '2021-01-18 11:18:13'); -- -------------------------------------------------------- -- -- Table structure for table `users` -- CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `username` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `name` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, `telp` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `level` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `gambar` text COLLATE utf8mb4_unicode_ci, `email_verified_at` timestamp NULL DEFAULT NULL, `password` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT 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; -- -- Dumping data for table `users` -- INSERT INTO `users` (`id`, `username`, `name`, `email`, `telp`, `level`, `gambar`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'deva', 'deva', 'damarasatrio@gmail.com', '14045333', 'Super Admin', '1610715217-user4-128x128.jpg', NULL, '$2y$10$F0HeSONFPSbJxRpR6XAovuL5AUlodmYe59oiyTHnfqV6Q4Pe7Egs.', NULL, '2021-01-09 19:20:55', '2021-01-15 05:53:37'); -- -- Indexes for dumped tables -- -- -- Indexes for table `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indexes for table `gambar_produk` -- ALTER TABLE `gambar_produk` ADD PRIMARY KEY (`id`); -- -- Indexes for table `kategori_produk` -- ALTER TABLE `kategori_produk` ADD PRIMARY KEY (`id`); -- -- Indexes for table `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indexes for table `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indexes for table `pengguna` -- ALTER TABLE `pengguna` ADD PRIMARY KEY (`id`); -- -- Indexes for table `produk` -- ALTER TABLE `produk` ADD PRIMARY KEY (`id`); -- -- Indexes for table `stok_log` -- ALTER TABLE `stok_log` ADD PRIMARY KEY (`id`); -- -- Indexes for table `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT for table `gambar_produk` -- ALTER TABLE `gambar_produk` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14; -- -- AUTO_INCREMENT for table `kategori_produk` -- ALTER TABLE `kategori_produk` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT for table `pengguna` -- ALTER TABLE `pengguna` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `produk` -- ALTER TABLE `produk` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18; -- -- AUTO_INCREMENT for table `stok_log` -- ALTER TABLE `stok_log` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT for table `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; /*!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 */;
CREATE OR REPLACE FUNCTION test_set_roles_function() RETURNS SETOF TEXT LANGUAGE plpgsql AS $$ DECLARE test_enterprise CONSTANT enterprises.name%TYPE = 'BigCo'; test_user CONSTANT users.name%TYPE = 'BigCo User'; test_organization CONSTANT organizations.name%TYPE = 'BigCo Engineering'; test_project CONSTANT projects.name%TYPE = 'skunkworks'; test_pipeline CONSTANT pipelines.name%TYPE = 'master'; test_enterprise_id CONSTANT enterprises.id%TYPE = ent(test_enterprise); test_user_id CONSTANT users.id%TYPE = u(test_enterprise, test_user); test_organization_id CONSTANT organizations.id%TYPE = org(test_enterprise, test_organization); test_project_id CONSTANT projects.id%TYPE = proj(test_enterprise, test_organization, test_project); test_pipeline_id CONSTANT pipelines.id%TYPE = pipe(test_enterprise, test_organization, test_project, test_pipeline); BEGIN -- Enterprise roles grants! PREPARE enterprise_roles(bigint, bigint) AS SELECT role FROM enterprise_user_roles WHERE enterprise_id = $1 AND user_id = $2 ORDER BY role; RETURN QUERY SELECT results_eq( format('EXECUTE enterprise_roles(%L, %L)', test_enterprise_id, test_user_id), ARRAY[]::delivery_role[], 'No roles yet' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, NULL, NULL, NULL, %L)', test_enterprise, test_user, ARRAY['admin']), 'Set "admin" at the enterprise scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE enterprise_roles(%L, %L)', test_enterprise_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user has the "admin" role at the enterprise scope now!' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, NULL, NULL, NULL, %L)', test_enterprise, test_user, ARRAY['admin']), 'Set "admin" at the enterprise scope again with no ill effects' ); RETURN QUERY SELECT results_eq( format('EXECUTE enterprise_roles(%L, %L)', test_enterprise_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user still only has the "admin" role at the enterprise scope' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, NULL, NULL, NULL, %L)', test_enterprise, test_user, ARRAY['committer', 'reviewer']), 'Set different roles at the enterprise scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE enterprise_roles(%L, %L)', test_enterprise_id, test_user_id), ARRAY['committer', 'reviewer']::delivery_role[], 'The user has only the set roles at the enterprise scope' ); RETURN QUERY SELECT results_eq( format('SELECT * FROM set_roles(%L, %L, NULL, NULL, NULL, %L)', test_enterprise, test_user, ARRAY['committer', 'reviewer']), format('SELECT * FROM scoped_roles(%L, %L, NULL, NULL, NULL)', test_enterprise, test_user), 'Returns scoped role information' ); -- Organization roles grants! PREPARE organization_roles(bigint, bigint) AS SELECT role FROM organization_user_roles WHERE organization_id = $1 AND user_id = $2 ORDER BY role; RETURN QUERY SELECT results_eq( format('EXECUTE organization_roles(%L, %L)', test_organization_id, test_user_id), ARRAY[]::delivery_role[], 'No roles yet' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, NULL, NULL, %L)', test_enterprise, test_user, test_organization, ARRAY['admin']), 'Set "admin" at the organization scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE organization_roles(%L, %L)', test_organization_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user has the "admin" role at the organization scope now!' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, NULL, NULL, %L)', test_enterprise, test_user, test_organization, ARRAY['admin']), 'Set "admin" at the organization scope again with no ill effects' ); RETURN QUERY SELECT results_eq( format('EXECUTE organization_roles(%L, %L)', test_organization_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user still only has the "admin" role at the organization scope' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, NULL, NULL, %L)', test_enterprise, test_user, test_organization, ARRAY['committer', 'reviewer']), 'Set different roles at the organization scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE organization_roles(%L, %L)', test_organization_id, test_user_id), ARRAY['committer', 'reviewer']::delivery_role[], 'The user has only the set roles at the organization scope' ); RETURN QUERY SELECT results_eq( format('SELECT * FROM set_roles(%L, %L, %L, NULL, NULL, %L)', test_enterprise, test_user, test_organization, ARRAY['committer', 'reviewer']), format('SELECT * FROM scoped_roles(%L, %L, %L, NULL, NULL)', test_enterprise, test_user, test_organization), 'Returns scoped role information' ); -- Project roles grants! PREPARE project_roles(bigint, bigint) AS SELECT role FROM project_user_roles WHERE project_id = $1 AND user_id = $2 ORDER BY role; RETURN QUERY SELECT results_eq( format('EXECUTE project_roles(%L, %L)', test_project_id, test_user_id), ARRAY[]::delivery_role[], 'No roles yet' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, %L, NULL, %L)', test_enterprise, test_user, test_organization, test_project, ARRAY['admin']), 'Set "admin" at the project scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE project_roles(%L, %L)', test_project_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user has the "admin" role at the project scope now!' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, %L, NULL, %L)', test_enterprise, test_user, test_organization, test_project, ARRAY['admin']), 'Set "admin" at the project scope again with no ill effects' ); RETURN QUERY SELECT results_eq( format('EXECUTE project_roles(%L, %L)', test_project_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user still only has the "admin" role at the project scope' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, %L, NULL, %L)', test_enterprise, test_user, test_organization, test_project, ARRAY['committer', 'reviewer']), 'Set different roles at the project scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE project_roles(%L, %L)', test_project_id, test_user_id), ARRAY['committer', 'reviewer']::delivery_role[], 'The user has only the set roles at the project scope' ); RETURN QUERY SELECT results_eq( format('SELECT * FROM set_roles(%L, %L, %L, %L, NULL, %L)', test_enterprise, test_user, test_organization, test_project, ARRAY['committer', 'reviewer']), format('SELECT * FROM scoped_roles(%L, %L, %L, %L, NULL)', test_enterprise, test_user, test_organization, test_project), 'Returns scoped role information' ); -- Pipeline roles grants! PREPARE pipeline_roles(bigint, bigint) AS SELECT role FROM pipeline_user_roles WHERE pipeline_id = $1 AND user_id = $2 ORDER BY role; RETURN QUERY SELECT results_eq( format('EXECUTE pipeline_roles(%L, %L)', test_pipeline_id, test_user_id), ARRAY[]::delivery_role[], 'No roles yet' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, %L, %L, %L)', test_enterprise, test_user, test_organization, test_project, test_pipeline, ARRAY['admin']), 'Set "admin" at the pipeline scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE pipeline_roles(%L, %L)', test_pipeline_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user has the "admin" role at the pipeline scope now!' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, %L, %L, %L)', test_enterprise, test_user, test_organization, test_project, test_pipeline, ARRAY['admin']), 'Set "admin" at the pipeline scope again with no ill effects' ); RETURN QUERY SELECT results_eq( format('EXECUTE pipeline_roles(%L, %L)', test_pipeline_id, test_user_id), ARRAY['admin']::delivery_role[], 'The user still only has the "admin" role at the pipeline scope' ); RETURN QUERY SELECT lives_ok( format('SELECT set_roles(%L, %L, %L, %L, %L, %L)', test_enterprise, test_user, test_organization, test_project, test_pipeline, ARRAY['committer', 'reviewer']), 'Set different roles at the pipeline scope' ); RETURN QUERY SELECT results_eq( format('EXECUTE pipeline_roles(%L, %L)', test_pipeline_id, test_user_id), ARRAY['committer', 'reviewer']::delivery_role[], 'The user has only the set roles at the pipeline scope' ); RETURN QUERY SELECT results_eq( format('SELECT * FROM set_roles(%L, %L, %L, %L, %L, %L)', test_enterprise, test_user, test_organization, test_project, test_pipeline, ARRAY['committer', 'reviewer']), format('SELECT * FROM scoped_roles(%L, %L, %L, %L, %L)', test_enterprise, test_user, test_organization, test_project, test_pipeline), 'Returns scoped role information' ); -- Last sanity check, to make sure we had all the right variables -- set above. If all that worked as expected, then we should see -- that we have those two roles granted at every scope when we're -- down at the pipeline level PREPARE all_permissions AS VALUES ('committer'::delivery_role, ARRAY['enterprise', 'organization', 'project', 'pipeline']), ('reviewer'::delivery_role, ARRAY['enterprise', 'organization', 'project', 'pipeline']); RETURN QUERY SELECT results_eq( format('SELECT * FROM scoped_roles(%L, %L, %L, %L, %L)', test_enterprise, test_user, test_organization, test_project, test_pipeline), 'all_permissions', 'We have all the roles we expect' ); END; $$;
-- -- Timeperiods. -- CREATE TABLE mod_bam_reporting_timeperiods ( timeperiod_id int NOT NULL, name varchar(200) NOT NULL, sunday varchar(200) default NULL, monday varchar(200) default NULL, tuesday varchar(200) default NULL, wednesday varchar(200) default NULL, thursday varchar(200) default NULL, friday varchar(200) default NULL, saturday varchar(200) default NULL, PRIMARY KEY (timeperiod_id), UNIQUE (name) );
DELETE dbo.tblUsers WHERE Country = 'United states' AND Team = 'Maximum PC Magazine'
CREATE OR REPLACE FUNCTION solarnet.calc_avg_watt_hours(real, real, real, real, double precision, double precision, interval) RETURNS double precision AS $BODY$ SELECT CASE WHEN /* Wh readings available, so use difference in Wh */ $5 IS NOT NULL AND $6 IS NOT NULL AND $5 > $6 THEN $5 - $6 WHEN /* Assume day reset on inverter, so Wh for day reset */ $5 IS NOT NULL AND $6 IS NOT NULL AND $5 < $6 THEN $5 ELSE /* Wh not available, so calculate Wh using (volts * amps * dt) */ ABS(($1 + $2) / 2) * (($3 + $4) / 2) * ((extract('epoch' from $7)) / 3600) END $BODY$ LANGUAGE sql IMMUTABLE;
/* correct_BnF_BLIC.sql is a MySQL script intended to fix the logic used to link to BnF by ISBN Version: $Revision$ Date: $Date$ (C) COPYRIGHT 2017 Ahasuerus ALL RIGHTS RESERVED The copyright notice above does not evidence any actual or intended publication of such source code. */ UPDATE websites set site_url = 'http://catalogue.bnf.fr/rechercher.do?motRecherche=%s', site_isbn13 = 2 where site_name = 'Bibliotheque nationale de France'; UPDATE websites set site_isbn13 = 2 where site_name = 'Open Library'; UPDATE websites set site_isbn13 = 1 where site_name = 'British Library';
-- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64) -- -- Host: localhost Database: rumoxdb -- ------------------------------------------------------ -- Server version 5.7.29 /*!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 */; -- -- Current Database: `rumoxdb` -- CREATE DATABASE /*!32312 IF NOT EXISTS*/ `rumoxdb` /*!40100 DEFAULT CHARACTER SET latin1 */; USE `rumoxdb`; -- -- Table structure for table `Categorias` -- DROP TABLE IF EXISTS `Categorias`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Categorias` ( `Id` char(36) NOT NULL, `Nome` varchar(100) NOT NULL, `DataHoraCriacao` datetime NOT NULL, `DataHoraAlteracao` datetime DEFAULT NULL, PRIMARY KEY (`Id`), UNIQUE KEY `unq_nome` (`Nome`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `Categorias` -- LOCK TABLES `Categorias` WRITE; /*!40000 ALTER TABLE `Categorias` DISABLE KEYS */; /*!40000 ALTER TABLE `Categorias` ENABLE KEYS */; UNLOCK TABLES; -- -- Table structure for table `Produtos` -- DROP TABLE IF EXISTS `Produtos`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `Produtos` ( `Id` char(36) NOT NULL, `CategoriaId` char(36) NOT NULL, `Codigo` bigint(20) unsigned NOT NULL, `Descricao` varchar(200) NOT NULL, `InformacoesAdicionais` text NOT NULL, `Ativo` tinyint(1) NOT NULL, `DataHoraCriacao` datetime NOT NULL, `DataHoraAlteracao` datetime DEFAULT NULL, PRIMARY KEY (`Id`), UNIQUE KEY `unq_codigo` (`Codigo`) USING BTREE, KEY `FK_Produtos_Categorias` (`CategoriaId`), CONSTRAINT `FK_Produtos_Categorias` FOREIGN KEY (`CategoriaId`) REFERENCES `Categorias` (`Id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; -- -- Dumping data for table `Produtos` -- LOCK TABLES `Produtos` WRITE; /*!40000 ALTER TABLE `Produtos` DISABLE KEYS */; /*!40000 ALTER TABLE `Produtos` 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 2020-04-21 21:12:36
CREATE TABLE BOOK (ID BIGINT NOT NULL, DESCRIPTION VARCHAR(255), ILLUSTRATIONS SMALLINT DEFAULT 0, ISBN VARCHAR(255), NBOFPAGE INTEGER, PRICE FLOAT, TITLE VARCHAR(255), PRIMARY KEY (ID)) CREATE SEQUENCE SEQ_GEN_SEQUENCE INCREMENT BY 50 START WITH 50
INSERT INTO tb_user (NAME, EMAIL, PASSWORD, ACTIVE, DATE_REQUEST_PASSWORD, CODE_REQUEST_PASSWORD, NUMBER_REQUESTS_PASSWORD, CREATED_AT, UPDATED_AT) VALUES ('Bob', 'bob@gmail.com', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG', true, null, null, null, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_user (NAME, EMAIL, PASSWORD, ACTIVE, DATE_REQUEST_PASSWORD, CODE_REQUEST_PASSWORD, NUMBER_REQUESTS_PASSWORD, CREATED_AT, UPDATED_AT) VALUES ('Maria', 'ana@gmail.com', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG', true, null, null, null, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_user (NAME, EMAIL, PASSWORD, ACTIVE, DATE_REQUEST_PASSWORD, CODE_REQUEST_PASSWORD, NUMBER_REQUESTS_PASSWORD, CREATED_AT, UPDATED_AT) VALUES ('Admin', 'adm@gmail.com', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG', true, null, null, null, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_user (NAME, EMAIL, PASSWORD, ACTIVE, DATE_REQUEST_PASSWORD, CODE_REQUEST_PASSWORD, NUMBER_REQUESTS_PASSWORD, CREATED_AT, UPDATED_AT) VALUES ('Shalia', 'teste@gmail.com', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG', false, null, null, null, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_role (AUTHORITY, DESCRIPTION, CREATED_AT, UPDATED_AT) VALUES ('ROLE_VISITOR', 'VISITANTE', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_role (AUTHORITY, DESCRIPTION, CREATED_AT, UPDATED_AT) VALUES ('ROLE_MEMBER', 'MEMBRO', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_user_role (user_id, role_id) VALUES (1, 1); INSERT INTO tb_user_role (user_id, role_id) VALUES (2, 2); INSERT INTO tb_user_role (user_id, role_id) VALUES (3, 2); INSERT INTO tb_user_role (user_id, role_id) VALUES (4, 1); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Ação', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Animação', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Aventura', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Comédia', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Comédia Romântica', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Esporte', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Ficção Científica', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Infantil', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_genre (NAME, CREATED_AT, UPDATED_AT) VALUES ('Romance', CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Ação INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Agentes Vanguard.','Um contador está no alvo da organização.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/4TGqXMsy9qM2nAUq4rYrErjkMXL.jpg','Um contador está no alvo da organização mercenária mais perigosa do mundo. Sua única esperança de sobrevivência é uma empresa chinesa de segurança secreta chamada Vanguard. <br> Após ser contratado pelo homem em perigo, o habilidoso líder da empresa Tang Huating (Jackie Chan) decide entrar em ação. Para isso, ele precisa se unir com as autoridades de Dubai e ser mais rápido do que os mercenários.',1, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Nova Ordem Espacial.','Em 2092, a Terra já está completamente devastada.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/drulhSX7P5TQlEMQZ3JoXKSDEfz.jpg','Em 2092, a Terra já está completamente devastada e inabitável. Por isso, os seres humanos que conseguiram sobreviver em condições extremas agora vivem em órbita no espaço. Porém, a galáxia é um lugar de disputas e constantes perigos. <br> O jovem Tae-ho (Song Joong-Ki) faz parte da tripulação de uma nave coletora de lixo espacial. No entanto, eles descobrem que existe um robô humanóide conhecido por ser uma arma de destruição em massa. Então o grupo decide se envolver em uma arriscada missão para deter o mal.',1, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Até o Céu.','O jovem mecânico Ángel (Miguel Herrán) se apaixona por Estrella.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/gSUrBxYAdMreMjVbYQOBgh0mGsK.jpg','O jovem mecânico Ángel (Miguel Herrán) se apaixona por Estrella (Carolina Yuste), uma mulher complicada que está envolvida com pessoas perigosas. Logo ele sai do subúrbio da Espanha e entra para o mundo do crime. <br> No entanto, ao aceitar participar de inúmeros roubos e golpes em Madri, um detetive implacável começa a persegui-lo com a promessa de colocar seu grupo atrás das grades.',1, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('O Homem de Aço.','No panteão dos super-heróis, Superman é o mais reconhecido e reverenciado personagem de todos os tempos.',2013,'https://www.themoviedb.org/t/p/w500_and_h282_face/69EFgWWPFWbRNHmQgYdSnyJ94Ge.jpg','No panteão dos super-heróis, Superman é o mais reconhecido e reverenciado personagem de todos os tempos. Clark Kent/Kal-El (Henry Cavill) é um jovem jornalista que se sente diferente por ter poderes além da imaginação de qualquer ser humano. Há anos enviado de Krypton, um avançado planeta alienígena, à Terra, Clark sofre com a derradeira questão: "Por que estou aqui?" <br> Moldado pelos valores de seus pais adotivos, Martha (Diane Lane) e Jonathan Kent (Kevin Costner), Clark logo descobre que ter super-habilidades significa tomar decisões muito difíceis. Mas quando o mundo mais precisa de estabilidade, ele é atacado. E agora, suas habilidades serão usadas para manter a paz ou partir para um tudo ou nada? Clark precisa se tornar o herói conhecido como "Superman", não apenas para brilhar como a última esperança da humanidade mas para proteger aqueles que ama.',1, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Animação INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Bob Esponja.','O Incrível Resgate.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/maFEWU41jdUOzDfRVkojq7fluIm.jpg','O querido caracol de estimação de Bob Esponja (Tom Kenny) foi raptado por Poseidon e levado para a cidade perdida de Atlântida. Agora ele terá que se unir ao amigo Patrick (Bill Fagerbakke) para lutar contra o deus dos mares e trazer o amado Gary de volta.',2, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Pets Unidos!','Um terrível vilão e seu exército de robôs.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/ePkagE11fpUbTasJ2udxTJHuaWU.jpg','Quando um terrível vilão e seu exército de robôs ameaçam a cidade, um cachorro decide unir uma equipe de heróis usando a sua experiência das ruas. <br> Agora ele e uma gata mimada estão no controle da segurança de todos.',2, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Nível Hard.','Um gamer adolescente.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/s7NC2kntiPB3WltWj9bnNTkoqUp.jpg','Um gamer adolescente é forçado a bancar a babá quanto três bebês com superpoderes saem de seu jogo favorito e caem diretamente em seu quintal. <br> Será que ele está preparado para a missão?',2, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Scooby! - O Filme.','Scooby (Frank Welker).',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/1RAxtBxslR4OZCZC1vxIRUxjR7a.jpg','Scooby (Frank Welker) e seu grupo enfrentam um mistério ainda mais <br> desafiador: o plano de libertar um cão fantasma do mal. Para evitar o <br> apocalipse, Scooby descobre que possui um destino muito mais importante do <br> que imaginava nessa jornada. ',2, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Aventura INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Liga da Justiça.','Determinado a garantir que o sacrifício final do Superman.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/pcDc2WJAYGJTTvRSEIpRZwM3Ola.jpg','Determinado a garantir que o sacrifício final do Superman (Henry Cavill) não foi em vão, o corajoso Bruce Wayne (Ben Affleck) decide manter sua fé na humanidade, buscando a ajuda de Diana Prince (Gal Gadot) para proteger o mundo. <br> Ao recrutar uma equipe de super-heróis, Batman e Mulher-Maravilha se unem aos excêntricos Aquaman (Jason Momoa), Cyborg (Ray Fisher) e Flash (Ezra Miller). No entanto, seu plano não será nada fácil após o surgimento de um vilão catastrófico.',3, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Flora & Ulysses.','Flora (Matilda Lawler).',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/tHjoTxM4SMgazi3Y2X8mmAtONVL.jpg','Flora (Matilda Lawler) é uma garotinha que passa seu tempo lendo gibis e lutando para entender o recente divórcio dos pais. No entanto, quando seu vizinho atropela um esquilo com o aspirador de pó, a garota entra em ação para salvar o bichinho. <br> A experiência de quase-morte do esquilo fez com que ele desenvolvesse superpoderes surpreendentes. Flora ensina o novo amigo a usar seus poderes para o bem, lutando contra injustiças e ajudando quem precisa. <br> Porém, tudo desmorona quando Phyllis (Alyson Hannigan), a mãe de Flora, acha melhor que elas se livrem do animal. Magoada, a menina decide ir para a casa do pai. Mas antes que possa fazer alguma coisa, o esquilo é sequestrado.',3, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('O Grande Ivan.','O gorila Ivan.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/umRu7cN3wIf1kRbCdhQkx6cVGZN.jpg','O gorila Ivan vive num shopping como atração. Ele esqueceu onde viveu antes dali. Mas a chegada do filhote de elefante Ruby, Ivan quer resgatar o seu passado e juntos planejam uma fuga do shopping.',3, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Soul.','Joe (Jamie Foxx) é um professor de música.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/kf456ZqeC45XTvo6W9pW5clYKfQ.jpg','Joe (Jamie Foxx) é um professor de música que sonhava em ser um grande artista de jazz e tocar no lendário clube The Blue Note. Quando ele finalmente tem a chance de impressionar alguns profissionais da área durante um ensaio aberto, um terrível acidente acontece e sua alma é transportada para fora do corpo, indo parar em outra realidade. <br> No outro local, ele conhecerá outras almas que estão esperando para retornar à Terra. Com a ajuda de uma criança que ainda está aprendendo sobre si mesma, ele tentará descobrir o que precisa fazer para retomar sua vida. A sua jornada será de muitas autodescobertas, contibuindo para o seu sonho.',3, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Comédia INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Diga-me Quando.','É o primeiro trabalho de Gerardo Gatica como diretor.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/hVfb4CwpWt1mWXAOFLgYfCKhZJd.jpg','Após a morte de seu avô, o mexicano-americano Will (Jesús Zavala), que é um viciado em trabalho, decide fazer uma pausa de sua vida agitada de Los Angeles. Para se reconectar com suas raízes, ele decide realizar os últimos desejos do avô. <br> Por isso, viaja para a Cidade do México a fim de conhecer os lugares mais famosos. Mas existe outra meta mais difícil que ele também precisa atingir: se apaixonar por alguém durante a viagem.',4, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Você Já Viu Vagalumes?','Gülseren (Ecem Erkek) é uma jovem prodígio com espírito rebelde.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/l3eIZRHxMJgIvSlGUtQC7P2ShPQ.jpg','Gülseren (Ecem Erkek) é uma jovem prodígio com espírito rebelde e irreverente. No meio de inúmeros conflitos políticos da Turquia, ela navega entre amor, perda e solidão enquanto uma grande mudança social ocorre em seu país. Mas sua natureza sonhadora e positiva não deixará nada abalar a autoconfiança.',4, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Esquadrão Trovão.','Em um mundo onde supervilões são comuns.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/z7HLq35df6ZpRxdMAE0qE3Ge4SJ.jpg','Em um mundo onde supervilões são comuns, as duas melhores amigas de infância Emily (Octavia Spencer) e Lydia (Melissa McCarthy) se reúnem após anos separadas para colocar um plano em prática. <br> Emily é uma cientista brilhante que teve a ideia de fazer um tratamento que permite adquirir superpoderes. Agora a cômica dupla deseja usar suas novas forças para proteger Chicago contra o mal que está assombrando a população.',4, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Finalmente 18!','O Dia Que Você Tanto Esperou',2013,'https://www.themoviedb.org/t/p/w500_and_h282_face/hzGoWhKUB20IdRCj261adN0q9kb.jpg','A melhor coisa da vida é ter amigos! E Jeff não pode reclamar nem um pouco disso, afinal, seus dois melhores amigos <br> vão até o campus onde ele mora para agitar o seu aniversário de 18 anos. Este é "O" primeiro grande momento na vida <br> de uma pessoa, é poder entrar em qualquer clube de dança, poder beber a vontade e praticamente fazer tudo o que quiser... ou quase tudo.',4, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Comédia Romântica INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Solteiramente.','Dineo (Fulu Mugovhani) já está acostumada com decepções amorosas.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/zNVKhT0js1UF7ZT9Lb4ioaa8jk6.jpg','Dineo (Fulu Mugovhani) já está acostumada com decepções amorosas, mas não consegue esquecer seu último ex-namorado. Para isso, a sua melhor amiga está determinada em ajudá-la a curtir a vida de solteira.',5, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Amor Garantido.','Para salvar o próprio escritório de advocacia.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/i6X9J6AgGhR3FNTtEc5GRs9e3ya.jpg','Para salvar o próprio escritório de advocacia, Susan (Rachael Leigh Cook) decide aceitar o caso de Nick (Damon Wayans Jr.) que quer processar um site de namoro por propaganda enganosa. No entanto, o andamento do processo acaba criando um clima entre os dois.',5, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Noite de Verão.','Jovens amigos resolvem passar o verão no mesmo lugar.',2019,'https://www.themoviedb.org/t/p/w220_and_h330_face/eP10eqYHMCov0aaIxuDhP1MEUNa.jpg','Jovens amigos resolvem passar o verão no mesmo lugar. No entanto, todo esse tempo juntos causará muitos conflitos e frustrações em seus relacionamentos amorosos da adolescência.',5, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Santa Girl.','A filha do Papai Noel (Jennifer Stone) sempre levou uma vida isolada.',2019,'https://www.themoviedb.org/t/p/w500_and_h282_face/uvAXXNbUV1p8XzgTlWpWkpfM4HZ.jpg','A filha do Papai Noel (Jennifer Stone) sempre levou uma vida isolada no Pólo Norte, até que decide sair da região para cursar um semestre de faculdade no mundo normal. No entanto, perto do natal, ela precisará retornar para as tarefas da família.',5, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Esporte INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Na Mesma Onda.','Sob o sol da Sicília, na Itália, nasce uma história de amor.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/gzycjJWGw04DF6C7IYOA1F0cWhc.jpg','Sob o sol da Sicília, na Itália, nasce uma história de amor entre dois jovens que passam o verão envolvidos no projeto de aproveitar as férias. No entanto, um contra-tempo faz seu romance se transformar em uma dolorosa paixão cheia de dificuldades. Agora eles precisarão amadurecer para superar a situação e seguir em frente.',6, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Voando Alto','Dois heróis nada comuns. Um mesmo sonho.',2016,'https://www.themoviedb.org/t/p/w500_and_h282_face/hiIG9wpYgc3X1UT0DQilRKfswxP.jpg','Cortado da equipe britânica de esqui, Eddie Edwards tenta uma vaga na prova de saltos na Olimpíada de Inverno de <br> 1988. Para isso, contará com a ajuda de Bronson Peary, um ex-atleta que trabalha como motorista de máquina de limpar neve.',6, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Creed II.','Adonis (Michael B. Jordan) lutou para manter escondido seu famoso sobrenome.',2018,'https://www.themoviedb.org/t/p/w500_and_h282_face/9il7qNbeYnPMYlutsVYDsj4hRyb.jpg','Adonis (Michael B. Jordan) lutou para manter escondido seu famoso sobrenome, Creed, para provar que podia ser um boxeador. Ele se deu bem e agora, Creed tem a chance de vingar a morte do pai, Apollo. Ele vai enfrentar o filho do lutador que matou seu pai, o russo Ivan Drago (Dolph Lundgren).', 6, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Free Solo.','O documentário segue Alex Honnold.',2018,'https://www.themoviedb.org/t/p/w500_and_h282_face/bgeSOUfhzzKv10cAe0SAIZVDTa7.jpg','O documentário segue Alex Honnold e como ele se torna a primeira pessoa a escalar sozinha a parede El Capitan, de Yosemite na Califórnia. Sem cordas ou equipamentos de segurança, ele completou o maior feito na história da escalada.',6, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Ficção Científica INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Círculo de Fogo: A Revolta.','Só os maiores vão sobreviver.',2018,'https://www.themoviedb.org/t/p/w500_and_h282_face/oMaj75G2WFw66xI1TREg1hrToSg.jpg','Jake Pentecost, filho de Stacker Pentecost, se junta a Mako Mori para liderar uma nova geração de pilotos Jaeger, incluindo seu rival Lambert e uma hacker de 15 anos, Amara, contra uma nova ameaça Kaiju.',7, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Oblivion','A terra é uma lembrança pela qual vale a pena lutar.',2013,'https://www.themoviedb.org/t/p/w500_and_h282_face/bAV9sQT3C11Q0xGFVktRNuaqKLg.jpg','Um veterano designado para extrair os recursos restantes da Terra começa a questionar o que ele sabe sobre sua missão e sobre si mesmo.',7, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Power.','Adonis (Michael B. Jordan) lutou para manter escondido seu famoso sobrenome.',2018,'https://www.themoviedb.org/t/p/w500_and_h282_face/7wdsLEnDryyl1gP3QKPfcpZNuYf.jpg','Uma pílula misteriosa que dá superpoderes imprevisíveis aos usuários acaba de chegar em Nova Orleans, Estados Unidos. Agora uma traficante adolescente, um policial e um ex-soldado precisam se unir para deter a organização por trás disso.', 7, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Projeto Gemini.','Um assassino (Will Smith) está querendo se aposentar.',2019,'https://www.themoviedb.org/t/p/w500_and_h282_face/c3F4P2oauA7IQmy4hM0OmRt2W7d.jpg','Um assassino (Will Smith) está querendo se aposentar. Mas antes ele precisa enfrentar um inimigo que jamais tinha imaginado: um clone seu, 25 anos mais jovem e cheio de vitalidade e vontade de matá-lo.',7, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Infantil INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Frozen 2.','A destemida Anna já teve de enfrentar muitos desafios.',2019,'https://www.themoviedb.org/t/p/w500_and_h282_face/9ROW9y2Kf7qE2wlinLcAJ8YhIkX.jpg','A destemida Anna já teve de enfrentar muitos desafios para encontrar sua irmã, Elsa, cujos poder fez o reino de Arendelle a ter um inverno eterno. Agora, as duas, na companhia no boneco de neve Olaf, vão viver aventuras ainda mais desafiadoras.',8, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('O Vale Encantado.','Cinderela, Branca de Neve e Bela Adormecida.',2018,'https://www.themoviedb.org/t/p/w220_and_h330_face/lCOP9ps7EYy1AR79ClZ78bHN1ew.jpg','Cinderela, Branca de Neve e Bela Adormecida estão felizes e apaixonadas pelos seus noivos, apenas aguardando a grande cerimônia do casamento. O que as princesas não faziam ideia é que todas estão noivas do mesmo Príncipe Encantado.',8, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Os Incríveis 2.','Bob Parr já salvou o mundo na pele do Senhor Incrível.',2018,'https://www.themoviedb.org/t/p/w500_and_h282_face/qEqrnYQWxHFBss0ugQsLORAI6aL.jpg','Bob Parr já salvou o mundo na pele do Senhor Incrível, juntamente com sua família superpoderosa. Agora sua vida caiu na rotina e tem passado o tempo cuidando do bebê Zezé, enquanto a sua esposa, Helen, é quem ataca de salvadora do universo como a Mulher-Elástica.', 8, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Kung Fu Panda 3.','O desajeitado urso panda Po (dublado originalmente por Jack Black).',2016,'https://www.themoviedb.org/t/p/w500_and_h282_face/kHgWFKSa0NUItppt6uW2JT1ezuQ.jpg','O desajeitado urso panda Po (dublado originalmente por Jack Black), segue sua jornada ao lado do mestre Shifu (Dustin Hoffman), Tigresa (Angelina Jolie), Macaco (Jackie Chan), Víbora (Lucy Liu) e Louva-Deus (Seth Rogen). O grupo precisa enfrentar uma força sobrenatural e Po vai finalmente conhecer o seu pai verdadeiro, que havia sumido.',8, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); -- Romance INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Na Batida do Coração.','Katya (Alexandra Pfeifer) é um jovem sonhadora.',2020,'https://www.themoviedb.org/t/p/w500_and_h282_face/uTendWR0h1w5Hkd4vmd7EeLdLhb.jpg','Katya (Alexandra Pfeifer) é um jovem sonhadora que treina para ser uma grande bailarina clássica. No entanto, ela acaba descobrindo o hip-hop e se apaixona pelo novo ritmo, além de conhecer Marlon (Yalany Marschner) um garoto encantador. Agora Katya precisará decidir entre seguir os planos de seus pais ou se jogar na nova paixão artística.',9, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Tudo por Ela.','Rei Nagasawa (Kiko Mizuhara) é uma jovem mulher lésbica.',2021,'https://www.themoviedb.org/t/p/w500_and_h282_face/dUbtr5cXaCyFByz41ch806Omyj9.jpg','Rei Nagasawa (Kiko Mizuhara) é uma jovem mulher lésbica que possui sentimentos pela amiga chamada Nanae (Honami Sato). No entanto, o amor platônico muda quando Rei descobre que Nanae está sofrendo violência doméstica do marido e decide matar o homem para salvá-la. <br> Depois do assassinato, as duas precisam fugir juntas para sobreviver. Nanae resiste em aceitar o crime e tem nojo de tudo que aconteceu. Já Rei sabe que agiu certo para salvar Nanae da violência. Agora as duas desfrutarão de um novo romance arrebatador, mas suas emoções sempre serão incompatíveis.',9, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('A Semana da Minha Vida.','Aqui tem muita música.', 2021 ,'https://www.themoviedb.org/t/p/w500_and_h282_face/sA07ynKTNXW2UMMOgPfLmFmmjgm.jpg', 'Will Hawkins é um adolescente rebelde que desafia a lei e precisa fazer uma escolha: ir para a detenção juvenil ou para um acampamento cristão.Um peixe fora da agua no início, ele acaba se soltando e encontrando o amor em uma jovem. Pela primeira vez e onde jamais poderia imaginar, Will sente que encontrou seu lugar no mundo.', 9, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_movie (TITLE, SUB_TITLE, YEAR, IMG_URL, SYNOPSIS, GENRE_ID, CREATED_AT, UPDATED_AT) VALUES ('Chuva que Cai do Céu.','Kevin (Jefri Nichol) não soube como se declarar para a melhor amiga.', 2020 , 'https://www.themoviedb.org/t/p/w500_and_h282_face/iDicJYmB5fq9wbtRGzdPxnxpZCe.jpg', 'Kevin (Jefri Nichol) não soube como se declarar para a melhor amiga Nara (Aurora Ribero) e agora ela está apaixonada por outro cara. Sem esperança de conquistá-la, o jovem sente que é melhor desistir desse romance. No entanto, o destino ainda surpreenderá os dois com o inesperado.' , 9 , CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_review (TEXT, USER_ID, MOVIE_ID, CREATED_AT, UPDATED_AT) VALUES ('Filme muito bom', 2, 1, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_review (TEXT, USER_ID, MOVIE_ID, CREATED_AT, UPDATED_AT) VALUES ('Filme excelente', 2, 8, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_review (TEXT, USER_ID, MOVIE_ID, CREATED_AT, UPDATED_AT) VALUES ('Filme sensacional', 2, 12, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null); INSERT INTO tb_review (TEXT, USER_ID, MOVIE_ID, CREATED_AT, UPDATED_AT) VALUES ('Filme muito bom', 2, 16, CURRENT_TIMESTAMP(0)::TIMESTAMP WITHOUT TIME ZONE, null);
UPDATE CONFIG set version = '8.1'; ALTER TABLE CENTRE_COUTS DROP FOREIGN KEY fk_couts_responsable; ALTER TABLE CENTRE_COUTS DROP idResponsable;
Select * from xafnfc.sttm_cust_personal U WHERE U.Last_Name LIKE '%NWAME%' and U.First_Name LIKE '%VICTOR%' select * from xafnfc.smtb_user P WHERE P.USER_NAME LIKE '%SEVI%' --AND P.Home_Branch = '023' select U.User_Id, U.User_Name, U.Customer_No, U.Home_Branch from xafnfc.smtb_user U WHERE U.Record_Stat = 'O' order by U.Home_Branch asc, U.START_DATE asc SELECT b.branch_code||' - '||b.branch_name as branch, b.branch_addr1||' '||b.branch_addr2||' '||b.branch_addr3 as adress FROM sttm_branch b order by b.branch_code ************************************************************************************************************************************************************************************* select * from bicim_mapping_account_class where type_compte = '020'; select * from bicim_mapping_account_class where account_class is null; update bicim_mapping_account_class set account_class = '074CAV' where type_compte = '074' and categorie_client in ('232','233','300','303') and account_class is null; select * from bicim_mapping_account_class where type_compte = '074' and categorie_client in('300','232','303') and account_class = '076CAV'; select * from bicim_mapping_account_class where type_compte = '075' and categorie_client in ('303','232','320','221','266','203','233','201','300','212','400','120') and account_class = '075ATD'; SELECT COUNT(*) FROM bicim_mapping_account_class WHERE account_class = (null); UPDATE bicim_mapping_account_class SET account_class = '072LCF' WHERE racine = '200377'; select * from smtb_role_master; ************************************************************************************************************************ select * from sttb_upload_cust_account where account_class = '020CSE'; select * from sttb_upload_cust_account where cust_ac_no = '004318201951000XOF' SELECT * FROM sttb_upload_cust_account where joint_ac_indicator = 'J' select * from STTMS_ACCLS_CAT_RESTR --where account_class = '020CSE'; select * from sttm_upload_customer where customer_no in ('318201951' ,'318201952'); --update sttb_upload_cust_account SET account_class = '001SPC'--where cust_ac_no = '003700003088000XOF'; select * from sttm_upload_customer where short_name = ' joseph traore'; select * from STTMS_CUSTOMER --where customer_category = '004321010067000XOF' ; select distinct a.joint_ac_indicator from sttb_upload_cust_account a where a.joint_ac_indicator is not null and exists (select 1 from sttb_upload_linked_entities b where b.maintenance_seq_no=a.maintenance_seq_no) and joint_ac_indicator<>'J'; select * from cltb_account_components;
USE demo DECLARE @UnixTimeStamp BIGINT = 1599624698 SELECT dbo.udf_ConvertUnixTimeStamp(@UnixTimeStamp) AS TheDate
--- name: srv_alias description: Lists all email aliases templates: - backend.backend returns: TABLE returns_columns: - name: localpart type: email.t_localpart - name: domain type: dns.t_hostname - name: mailbox_localpart type: email.t_localpart - name: mailbox_domain type: dns.t_hostname - name: backend_status type: backend.t_status --- RETURN QUERY WITH -- DELETE d AS ( DELETE FROM email.alias AS t WHERE backend._deleted(t.backend_status) AND backend._machine_priviledged(t.service, t.domain) ), -- UPDATE s AS ( UPDATE email.alias AS t SET backend_status = NULL WHERE backend._machine_priviledged(t.service, t.domain) AND backend._active(t.backend_status) ) -- SELECT SELECT t.localpart, t.domain, t.mailbox_localpart, t.mailbox_domain, t.backend_status FROM email.alias AS t WHERE backend._machine_priviledged(t.service, t.domain) AND (backend._active(t.backend_status) OR p_include_inactive);
CREATE DATABASE price_watch; USE price_watch; CREATE TABLE Searches ( SearchID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, UpdatedDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, FlightFrom VARCHAR(3) NOT NULL, FlightTo VARCHAR(3) NOT NULL, FlightDate DATE NOT NULL, Currency VARCHAR(3) NULL ); CREATE TABLE Flights ( FlightID INT PRIMARY KEY NOT NULL AUTO_INCREMENT, SearchID INT NOT NULL, UpdatedDate TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, Price DOUBLE NOT NULL, FlightDate DATETIME NOT NULL, BookingLink TEXT NOT NULL, FlightDurationText TEXT NOT NULL, FOREIGN KEY (SearchID) REFERENCES Searches(SearchID) );
ALTER TABLE `groups` CHANGE `sType` `sType` ENUM( 'Root', 'Class', 'Club', 'Friends', 'Other' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL; ALTER TABLE `history_groups` CHANGE `sType` `sType` ENUM( 'Root', 'Class', 'Club', 'Friends', 'Other' ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;