sql
stringlengths 6
1.05M
|
|---|
CREATE Procedure Integration.IngestSaleData
AS
BEGIN
DECLARE @SQL nvarchar(max) = N''
DECLARE @timestamp char(8) = convert(char(8), getdate(), 112)
--This should match Staging table layout EXCEPT do NOT include identity and change dates to nvarchar
--***Note: for fact tables, exclude NULL foreign keys from external table
SET @SQL = '
IF OBJECT_ID(''[Integration].[FactSale_external]'') IS NOT NULL
DROP EXTERNAL TABLE [Integration].[FactSale_external]
CREATE EXTERNAL TABLE [Integration].[FactSale_external] (
[Invoice Date Key] nvarchar(50),
[Delivery Date Key] nvarchar(50),
[WWI Invoice ID] int,
[Description] nvarchar(100),
[Package] nvarchar(50),
[Quantity] int,
[Unit Price] decimal(18,2),
[Tax Rate] decimal(18,3),
[Total Excluding Tax] decimal(18,2),
[Tax Amount] decimal(18,2),
[Profit] decimal(18,2),
[Total Including Tax] decimal(18,2),
[Total Dry Items] int,
[Total Chiller Items] int,
[WWI City ID] int,
[WWI Customer ID] int,
[WWI Bill To Customer ID] int,
[WWI Stock Item ID] int,
[WWI Salesperson ID] int,
[Last Modified When] nvarchar(50)
)
WITH
(
LOCATION=''/Sale''
, DATA_SOURCE = AzureDataLakeStorage
, FILE_FORMAT = TextFileFormat
, REJECT_TYPE = VALUE
, REJECT_VALUE = 0
);'
EXECUTE sp_executesql @SQL --Create External Table
--print @sql
SET @SQL = N'
IF OBJECT_ID(''[Integration].[Sale_Staging]'') IS NOT NULL
DROP TABLE [Integration].[Sale_Staging]
CREATE TABLE [Integration].[Sale_Staging]
WITH (DISTRIBUTION = ROUND_ROBIN )
AS
SELECT NULL as [City Key]
, NULL as [Customer Key]
, NULL as [Bill To Customer Key]
, NULL as [Stock Item Key]
,[Invoice Date Key]
,[Delivery Date Key]
,NULL [Salesperson Key]
,[WWI Invoice ID]
,[Description]
,[Package]
,[Quantity]
,[Unit Price]
,[Tax Rate]
,[Total Excluding Tax]
,[Tax Amount]
,[Profit]
,[Total Including Tax]
,[Total Dry Items]
,[Total Chiller Items]
,[WWI City ID]
,[WWI Customer ID]
,[WWI Bill To Customer ID]
,[WWI Stock Item ID]
,[WWI Salesperson ID]
,[Last Modified When]
FROM [Integration].[FactSale_external]
OPTION (LABEL = ''CTAS : Load [Integration].[Sale_Staging]'');
'
EXECUTE sp_executesql @SQL --Load data from external table into staging table
--print @sql
END
|
<gh_stars>10-100
CREATE TABLE AS_SFTP_KNOWN_HOSTS
(
HOST VARCHAR2(1000 CHAR),
FINGERPRINT VARCHAR2(100 CHAR)
);
|
COPY INTO dbo.customer_profile
FROM 'https://feastonazuredatasamples.blob.core.windows.net/feastdatasamples/customer_profile.csv'
WITH
(
FILE_TYPE = 'CSV'
,FIRSTROW = 2
,MAXERRORS = 0
)
|
insert into secondary_message (id, content) values (2, 'secondary message');
|
<reponame>vegetweb/warehouse-docker
INSERT INTO system (version, name, repository, last_scheduled_task_check)
VALUES ('test', 'test', 'test', getdate())
|
<filename>project/dbt/models/examples/marts/bus/fct_bus_prueba.sql
{{ config(
materialized ='materializedview'
) }}
with fct_bus as (
SELECT *
FROM {{ ref('stg_bus_information') }} fi
),
fct_bus_1 as (
select id, paradaId, etiqLinea, tiempo1 as tiempo, distancia1 as distancia, destino1 as destino, modified from fct_bus
),
fct_bus_2 as (
select id, paradaId, etiqLinea, tiempo2 as tiempo, distancia2 as distancia, destino2 as destino, modified from fct_bus where destino2 not like ''
),
last_measures as (
select id, max(modified) as lastModified from fct_bus group by id
),
total_measures as (
select * from fct_bus_1 union all select * from fct_bus_2
)
select tm.* from total_measures as tm inner join last_measures as lm on tm.id = lm.id and tm.modified = lm.lastModified
|
<reponame>daneshk/ballerina-scenario-tests
DROP TABLE DDL_TEST_ALTER_TABLE
/
DROP TABLE DDL_TEST_TABLE
/
DROP TABLE DDL_TEST_CREATE_TABLE
/
DROP PROCEDURE DDL_TEST_CREATE_PROC
|
<reponame>darknegma/docker-airflow
create table "RESTAPI_PTO_PLANS_PII"
(
"COMPANYID" varchar,
"EARNED" float,
"EARNEDTHROUGHDATE" datetime,
"EMPLOYEEID" varchar,
"PENDINGBALANCE" float,
"PENDINGMOVEDATE" datetime,
"PTOPLAN" varchar,
"RESET" datetime,
"TAKEN" float,
"_SF_INSERTEDDATETIME" datetime
);
|
<gh_stars>0
select * from tesis.business where stars between 4 and 5 limit 0,10;
select count(*) from business;
/*histogram*/
select stars, count(*) as records from tesis.business group by stars order by records desc;
SELECT @@global.secure_file_priv;
select * from tesis.business into OUTFILE '/var/lib/mysql-files/tesis_business_memory';
SET GLOBAL tmp_table_size = 1024 * 1024 * 1024 * 10;
SET GLOBAL max_heap_table_size = 1024 * 1024 * 1024 * 10;
insert into business_memory select * from business;
alter table business_memory ENGINE = MEMORY;
/*truncate business_memory;*/
select count(*) from business_memory;
select * from tesis.business
where stars between 4 and 5
/*and (review_count is NULL or review_count = '')*/
limit 0,10;
select distinct stars from business;
/*histogram*/
select stars, count(*) as total from business_memory group by stars order by total desc;
select state, stars, avg(review_count) as avg_review_count from business
group by state, stars order by state, stars;
/*HEATMAP*/
select t.state, t.stars, avg(t.review_count) as avg_review_count from
(select state, stars, review_count from business_memory) t
group by state, stars
order by state, stars;
/*
CREATE INDEX RATINGS ON tesis.business (stars);
CREATE INDEX REVIEWS ON tesis.business (review_count);
CREATE INDEX STATES ON tesis.business (state);
CREATE INDEX RATINGS ON tesis.business_memory (stars);
CREATE INDEX REVIEWS ON tesis.business_memory (review_count);
CREATE INDEX STATES ON tesis.business_memory (state);
CREATE INDEX RATINGS ON tesis.business_memory_2 (stars);
CREATE INDEX REVIEWS ON tesis.business_memory_2 (review_count);
CREATE INDEX STATES ON tesis.business_memory_2 (state);
CREATE INDEX RATINGS ON tesis.heatmap_business_view (stars);
CREATE INDEX REVIEWS ON tesis.business_memory_2 (review_count);
CREATE INDEX STATES ON tesis.business_memory_2 (state);
*/
create table business_memory_2 select * from business;
select count(*) from business_memory_2;
alter table business_memory_2 ENGINE = MEMORY;
/*HISTOGRAM*/
select stars, count(*) as records from tesis.business_memory_2
group by stars order by records desc;
select stars, count(*) as records from tesis.business
group by stars order by records desc;
/*HEATMAP*/
select state, stars, avg(review_count) as avg_review_count
from business_memory_2
group by state, stars order by state, stars;
create view heatmap_business_view as
select state, stars, avg(review_count) as avg_review_count
from business
group by state, stars order by state, stars;
create table heatmap_business_view_mat as
select state, stars, avg(review_count) as avg_review_count
from business
group by state, stars order by state, stars;
select t.state, t.stars, avg(t.review_count) as avg_review_count from
(select state, stars, review_count from business) t
group by state, stars
order by state, stars;
SELECT * FROM tesis.heatmap_business_view_mat;
CREATE INDEX RATINGS ON tesis.heatmap_business_view_mat (stars);
CREATE INDEX REVIEWS_avg ON tesis.heatmap_business_view_mat (avg_review_count);
CREATE INDEX STATES ON tesis.heatmap_business_view_mat (state);
|
<filename>demo.roundhouse/db/permissions/rules.sql
GRANT EXECUTE ON OBJECT::dbo.GetUser
TO public;
|
<filename>db/computer/jeesite_sys_user.sql<gh_stars>1-10
create table sys_user
(
id varchar(64) not null comment '编号'
primary key,
company_id varchar(64) not null comment '归属公司',
office_id varchar(64) not null comment '归属部门',
login_name varchar(100) not null comment '登录名',
password varchar(100) not null comment '密码',
no varchar(100) null comment '工号',
name varchar(100) not null comment '姓名',
email varchar(200) null comment '邮箱',
phone varchar(200) null comment '电话',
mobile varchar(200) null comment '手机',
user_type char null comment '用户类型',
photo varchar(1000) null comment '用户头像',
login_ip varchar(100) null comment '最后登陆IP',
login_date datetime null comment '最后登陆时间',
login_flag varchar(64) null comment '是否可登录',
create_by varchar(64) not null comment '创建者',
create_date datetime not null comment '创建时间',
update_by varchar(64) not null comment '更新者',
update_date datetime not null comment '更新时间',
remarks varchar(255) null comment '备注信息',
del_flag char default '0' not null comment '删除标记'
)
comment '用户表' charset = utf8;
create index sys_user_company_id
on sys_user (company_id);
create index sys_user_del_flag
on sys_user (del_flag);
create index sys_user_login_name
on sys_user (login_name);
create index sys_user_office_id
on sys_user (office_id);
create index sys_user_update_date
on sys_user (update_date);
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('1', '1', '3', 'thinkgem', 'a350ed0f0bc27af2b786dde92a73f3195ea5fca114b1e3ac91456e9c', '0001', '系统管理员', '<EMAIL>', '8675', '8675', '', '/jeesite/userfiles/1/images/photo/2020/04/4560ed28161d7114.jpg', '0:0:0:0:0:0:0:1', '2020-04-21 10:46:21', '1', '1', '2013-05-27 08:00:00', '1', '2020-04-21 10:46:42', '最高管理员', '0');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('10', '7', '11', 'jn_jsb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0010', '济南技术部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('11', '12', '13', 'lc_admin', '<PASSWORD>', '0011', '济南历城领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('12', '12', '18', 'lx_admin', '<PASSWORD>', '0012', '济南历下领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('13', '22', '23', 'gx_admin', '0<PASSWORD>fcc<PASSWORD>c<PASSWORD>2', '0013', '济南高新领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('2', '1', '2', 'sd_admin', '<PASSWORD>', '0002', '管理员', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('3', '1', '3', 'sd_zhb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0003', '综合部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('4', '1', '4', 'sd_scb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0004', '市场部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('5', '1', '5', 'sd_jsb', '02a3f0772fcca9f415adc990734b45c6f059c7d33ee28362c4852032', '0005', '技术部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('6', '1', '6', 'sd_yfb', '<PASSWORD>', '0006', '研发部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('7', '7', '8', 'jn_admin', '<PASSWORD>', '0007', '济南领导', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('8', '7', '9', 'jn_zhb', '<PASSWORD>', '0008', '济南综合部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
INSERT INTO jeesite.sys_user (id, company_id, office_id, login_name, password, no, name, email, phone, mobile, user_type, photo, login_ip, login_date, login_flag, create_by, create_date, update_by, update_date, remarks, del_flag) VALUES ('9', '7', '10', 'jn_scb', '<PASSWORD>', '0009', '济南市场部', null, null, null, null, null, null, null, '1', '1', '2013-05-27 08:00:00', '1', '2013-05-27 08:00:00', null, '1');
|
-- {
-- "origin": "gr",
-- "lastServed": "2015-07-07T21:33:37.718Z",
-- "authenticName": "<NAME>",
-- "timesServed": 5,
-- "rating": 9,
-- "createdAt": "2015-08-09-09T22:22:22.222Z",
-- "primaryUrl": "http://de.allrecipes.com/rezept/1268/authentischer-griechischer-salat.aspx",
-- "updatedBy": "<EMAIL>",
-- "name": "<NAME>",
-- "imageUrl": "http://www.casualcatering.com/shop/images/greek.jpg",
-- "updatedAt": "2018-09-19T21:58:30.910Z",
-- "notes": "1. Paprikaschoten halbieren, entkernen und in 2 cm große Würfel schneiden. Tomaten sechsteln. Salatgurke längs vierteln und quer in 2 cm große Stücke schneiden. Zwiebeln in 1 cm dicke Scheiben schneiden. Minze in feine Streifen schneiden. Oliven halbieren, Schafskäse in 2 cm große Würfel schneiden.\n\n2. Essig mit 10 El kaltem Wasser, Öl, Salz und Pfeffer in einer Schüssel verrühren. Paprikaschoten, Tomaten, Gurke, Zwiebeln, Minze, Schafskäse und Oliven mit dem Dressing mischen und kurz durchziehen lassen. Dazu passt Fladenbrot.",
-- "id": "5585e234e4b062eca3674e08",
-- "tags": [
-- "feta",
-- "oliven",
-- "salat",
-- "tomaten",
-- "veggy"
-- ]
-- }
-- DDL for table
CREATE TABLE IF NOT EXISTS dish
(
-- https://dba.stackexchange.com/questions/122623/default-value-for-uuid-column-in-postgres
id UUID DEFAULT uuid_generate_v4(),
-- https://dba.stackexchange.com/questions/20974/should-i-add-an-arbitrary-length-limit-to-varchar-columns
name TEXT NOT NULL,
summary TEXT,
notes TEXT,
area_code TEXT, -- FK on geocode COUNTRY, formerly known as origin
primary_url TEXT,
image_url TEXT,
tags TEXT[] DEFAULT '{}',
auth_scope auth_scope default 'PUBLIC',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
created_by TEXT DEFAULT 'system',
updated_by TEXT DEFAULT 'system',
-- // dish specific
times_served smallint,
rating smallint,
PRIMARY KEY (id),
FOREIGN KEY (area_code) REFERENCES area (code)
);
-- INDEXES
CREATE INDEX ON dish ((lower(name)));
CREATE INDEX ON dish USING btree (auth_scope);
CREATE INDEX ON dish USING gin (tags);
-- IMPORTS
INSERT INTO dish (name, summary, area_code, primary_url)
VALUES ('Greek Salad', 'ελληνική σαλάτα', 'gr',
'http://de.allrecipes.com/rezept/1268/authentischer-griechischer-salat.aspx');
INSERT INTO dish (name, summary, area_code, primary_url)
VALUES ('Tom Yum Suppe', 'ต้มยำกุ้ง', 'th', 'http://www.eatingthaifood.com/2014/08/tom-yum-soup-recipe/');
|
create unique index IDX_ORDERMAN_PRODUCT_UNQ on ORDERMAN_PRODUCT (NAME, MEASURE) ;
|
<reponame>atkins126/kitto3<filename>Examples/HelloKitto/DB/HelloKitto_Firebird_DDL.sql
CREATE TABLE DOLL
(
DOLL_ID varchar(32) NOT NULL,
DOLL_NAME varchar(40) NOT NULL,
DATE_BOUGHT date,
HAIR_ID varchar(32),
DRESS_SIZE varchar(4),
MOM_ID varchar(32) NOT NULL,
ASPECT varchar(1024),
PICTURE blob sub_type 0,
CONSTRAINT PK_DOLL PRIMARY KEY (DOLL_ID)
);
CREATE TABLE GIRL
(
GIRL_ID varchar(32) NOT NULL,
GIRL_NAME varchar(40) NOT NULL,
AGE integer,
HAIR_ID varchar(32) NOT NULL,
PHONE varchar(16),
CONSTRAINT PK_GIRL PRIMARY KEY (GIRL_ID)
);
CREATE TABLE HAIR
(
HAIR_ID varchar(32) NOT NULL,
HAIR_COLOR varchar(80) NOT NULL,
CONSTRAINT PK_HAIR PRIMARY KEY (HAIR_ID)
);
CREATE TABLE INVITATION
(
INVITATION_ID varchar(32) NOT NULL,
PARTY_ID varchar(32) NOT NULL,
INVITEE_ID varchar(32) NOT NULL,
ACCEPTED smallint,
CONSTRAINT PK_INVITATION PRIMARY KEY (INVITATION_ID)
);
CREATE TABLE KITTO_USERS
(
USER_NAME varchar(32) NOT NULL,
PASSWORD_HASH varchar(32),
IS_ACTIVE smallint,
MUST_CHANGE_PASSWORD smallint,
EMAIL_ADDRESS varchar(100),
CONSTRAINT PK_KITTO_USERS PRIMARY KEY (USER_NAME)
);
CREATE TABLE PARTY
(
PARTY_ID varchar(32) NOT NULL,
PARTY_NAME varchar(40) NOT NULL,
PARTY_DATE date NOT NULL,
PARTY_TIME time NOT NULL,
ADDRESS varchar(256) NOT NULL,
CONSTRAINT PK_PARTY PRIMARY KEY (PARTY_ID)
);
/********************* VIEWS **********************/
/******************* EXCEPTIONS *******************/
/******************** TRIGGERS ********************/
ALTER TABLE DOLL ADD CONSTRAINT DT_DOLL_MOM
FOREIGN KEY (MOM_ID) REFERENCES GIRL (GIRL_ID);
ALTER TABLE DOLL ADD CONSTRAINT FK_DOLL_HAIR
FOREIGN KEY (HAIR_ID) REFERENCES HAIR (HAIR_ID) ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE GIRL ADD CONSTRAINT FK_GIRL_HAIR
FOREIGN KEY (HAIR_ID) REFERENCES HAIR (HAIR_ID) ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE INVITATION ADD CONSTRAINT DT_INVITATION_PARTY
FOREIGN KEY (PARTY_ID) REFERENCES PARTY (PARTY_ID) ON UPDATE NO ACTION ON DELETE NO ACTION;
ALTER TABLE INVITATION ADD CONSTRAINT FK_INVITATION_GIRL
FOREIGN KEY (INVITEE_ID) REFERENCES GIRL (GIRL_ID);
GRANT DELETE, INSERT, REFERENCES, SELECT, UPDATE
ON DOLL TO SYSDBA WITH GRANT OPTION;
|
CREATE TABLE `json` (
`pk` MEDIUMINT(4) NOT NULL PRIMARY KEY,
`js` JSON NOT NULL
);
|
-- Adminer 4.2.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE DATABASE `yii2` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `yii2`;
DROP TABLE IF EXISTS `yii_admin_log`;
CREATE TABLE `yii_admin_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`action` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Действие',
`user` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Пользователь',
`time` int(11) NOT NULL COMMENT 'Дата и время',
PRIMARY KEY (`id`),
KEY `FK_yii_admin_log_yii_user` (`user`),
CONSTRAINT `FK_yii_admin_log_yii_user` FOREIGN KEY (`user`) REFERENCES `yii_user` (`username`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT COMMENT='Таблица для хранения всех изменений, производимых в админке';
INSERT INTO `yii_admin_log` (`id`, `action`, `user`, `time`) VALUES
(1, 'Создал новость', 'admin', 1111);
DROP TABLE IF EXISTS `yii_auth_assignment`;
CREATE TABLE `yii_auth_assignment` (
`item_name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`user_id` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`created_at` int(11) DEFAULT NULL,
PRIMARY KEY (`item_name`,`user_id`),
CONSTRAINT `yii_auth_assignment_ibfk_1` FOREIGN KEY (`item_name`) REFERENCES `yii_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `yii_auth_assignment` (`item_name`, `user_id`, `created_at`) VALUES
('admin', '2', 1472945735),
('developer', '1', 1472945735),
('manager', '48', 1473617617),
('smm', '5', 1517066905),
('user', '4', 1472945735);
DROP TABLE IF EXISTS `yii_auth_item`;
CREATE TABLE `yii_auth_item` (
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Название роли',
`type` int(11) NOT NULL COMMENT 'Тип',
`description` text COLLATE utf8_unicode_ci COMMENT 'Описание',
`rule_name` varchar(64) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Правило',
`data` text COLLATE utf8_unicode_ci COMMENT 'Данные',
`created_at` int(11) DEFAULT NULL COMMENT 'Дата создания',
`updated_at` int(11) DEFAULT NULL COMMENT 'Дата обновления',
PRIMARY KEY (`name`),
KEY `rule_name` (`rule_name`),
KEY `idx-auth_item-type` (`type`),
CONSTRAINT `yii_auth_item_ibfk_1` FOREIGN KEY (`rule_name`) REFERENCES `yii_auth_rule` (`name`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `yii_auth_item` (`name`, `type`, `description`, `rule_name`, `data`, `created_at`, `updated_at`) VALUES
('admin', 1, NULL, NULL, NULL, 1472932403, 1472932403),
('developer', 1, NULL, NULL, NULL, 1472932403, 1472932403),
('manager', 1, NULL, NULL, NULL, 1472932403, 1472932403),
('smm', 1, NULL, NULL, NULL, NULL, NULL),
('user', 1, NULL, NULL, NULL, 1472932403, 1472932403);
DROP TABLE IF EXISTS `yii_auth_item_child`;
CREATE TABLE `yii_auth_item_child` (
`parent` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`child` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`parent`,`child`),
KEY `child` (`child`),
CONSTRAINT `yii_auth_item_child_ibfk_1` FOREIGN KEY (`parent`) REFERENCES `yii_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `yii_auth_item_child_ibfk_2` FOREIGN KEY (`child`) REFERENCES `yii_auth_item` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `yii_auth_item_child` (`parent`, `child`) VALUES
('developer', 'admin'),
('admin', 'manager'),
('manager', 'user');
DROP TABLE IF EXISTS `yii_auth_rule`;
CREATE TABLE `yii_auth_rule` (
`name` varchar(64) COLLATE utf8_unicode_ci NOT NULL,
`data` text COLLATE utf8_unicode_ci,
`created_at` int(11) DEFAULT NULL,
`updated_at` int(11) DEFAULT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
DROP TABLE IF EXISTS `yii_concerts`;
CREATE TABLE `yii_concerts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alias` varchar(255) NOT NULL COMMENT 'Псевдоним',
`title` varchar(255) NOT NULL COMMENT 'Заголовок',
`short_text` varchar(512) NOT NULL COMMENT 'Краткий текст',
`text` text NOT NULL COMMENT 'Полный текст',
`date` varchar(50) NOT NULL COMMENT 'Дата',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
INSERT INTO `yii_concerts` (`id`, `alias`, `title`, `short_text`, `text`, `date`) VALUES
(2, 'novyj-koncert', 'Новый концерт', 'Краткий текст для анонса', '<p>Подробное описание</p>', '2016-11-22'),
(4, 'novyj-koncert', 'Новый концерт2', 'Краткий текст для анонса', '<p>Подробное описание</p>', '2016-11-22'),
(5, 'novyj-koncert', 'Новый концерт3', 'Краткий текст для анонса', '<p>Подробное описание</p>', '2016-11-22');
DROP TABLE IF EXISTS `yii_events`;
CREATE TABLE `yii_events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alias` varchar(255) NOT NULL COMMENT 'Псевдоним',
`title` varchar(255) NOT NULL COMMENT 'Заголовок',
`short_text` varchar(512) NOT NULL COMMENT 'Краткий текст',
`text` text NOT NULL COMMENT 'Полный текст',
`date` varchar(50) NOT NULL COMMENT 'Дата',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `yii_events` (`id`, `alias`, `title`, `short_text`, `text`, `date`) VALUES
(1, 'vystuplenie-v-harat-s-pub-22-11-2016', 'Выступление в Harat\'s pub 22-11-2016', 'Мы будем вытупать в харатсе! И ты приходи!', '<p><strong>Lorem Ipsum</strong> - это текст-\"рыба\", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной \"рыбой\" для текстов на латинице с начала XVI века. В то время некий безымянный печатник создал большую коллекцию размеров и форм шрифтов, используя Lorem Ipsum для распечатки образцов. Lorem Ipsum не только успешно пережил без заметных изменений пять веков, но и перешагнул в электронный дизайн. Его популяризации в новое время послужили публикация листов Letraset с образцами Lorem Ipsum в 60-х годах и, в более недавнее время, программы электронной вёрстки типа Aldus PageMaker, в шаблонах которых используется Lorem Ipsum.</p>', '2016-11-22');
DROP TABLE IF EXISTS `yii_gallery`;
CREATE TABLE `yii_gallery` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alias` varchar(255) NOT NULL COMMENT 'Псевдоним',
`title` varchar(255) NOT NULL COMMENT 'Название альбома',
`image` varchar(255) NOT NULL COMMENT 'Обложка альбома',
`date` varchar(50) NOT NULL COMMENT 'Дата альбома',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `yii_gallery` (`id`, `alias`, `title`, `image`, `date`) VALUES
(14, 'b-day-slam-2016-2-9-2016', 'B-Day Slam 2016 2/9/2016', '/uploads/gallery/093460ad887e60fc.jpg', '2016-09-02'),
(15, 'harat-s-pub-3-09-16', 'Harat\'s Pub 3/09/16', '/uploads/gallery/79d099d484725f6e.jpg', '2016-09-16');
DROP TABLE IF EXISTS `yii_gallery_items`;
CREATE TABLE `yii_gallery_items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`gallery_id` int(11) NOT NULL COMMENT 'ИД галереи',
`thumb_image` varchar(255) NOT NULL COMMENT 'Уменьшенное изображение',
`image` varchar(255) NOT NULL COMMENT 'Оригинальное изображение',
PRIMARY KEY (`id`),
KEY `FK_yii_gallery_items_yii_gallery` (`gallery_id`),
CONSTRAINT `FK_yii_gallery_items_yii_gallery` FOREIGN KEY (`gallery_id`) REFERENCES `yii_gallery` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
INSERT INTO `yii_gallery_items` (`id`, `gallery_id`, `thumb_image`, `image`) VALUES
(22, 14, '/uploads/gallery/626115bb9341b8fe.jpg', '/uploads/gallery/c80be0a46813f674.jpg'),
(23, 14, '/uploads/gallery/e03a63f82aeaaf79.jpg', '/uploads/gallery/5764e73255928613.jpg'),
(24, 14, '/uploads/gallery/029ab8cad5d65ea2.jpg', '/uploads/gallery/a8e17cbf0c21fca0.jpg'),
(25, 14, '/uploads/gallery/358161ffcaf8c872.jpg', '/uploads/gallery/032d28a9c84d163c.jpg'),
(26, 14, '/uploads/gallery/9663d7d1b843032f.jpg', '/uploads/gallery/fdbe93ed53f78168.jpg'),
(27, 14, '/uploads/gallery/934a05b332306b16.jpg', '/uploads/gallery/48f35c453206798a.jpg'),
(28, 14, '/uploads/gallery/e8fb946dbc499ed2.jpg', '/uploads/gallery/36a51d4cd4ced1e9.jpg'),
(29, 14, '/uploads/gallery/becf45f188baefcf.jpg', '/uploads/gallery/048b5fced0aff682.jpg'),
(30, 14, '/uploads/gallery/566bac3b93c90103.jpg', '/uploads/gallery/d552298614ba3c24.jpg'),
(31, 14, '/uploads/gallery/c1b46bff13ef3b06.jpg', '/uploads/gallery/e7c279c65fa20eed.jpg'),
(32, 14, '/uploads/gallery/c65f3b3b28e52644.jpg', '/uploads/gallery/162ca2de49eaf833.jpg'),
(33, 14, '/uploads/gallery/5ab5d8ad2bdd862c.jpg', '/uploads/gallery/3724b8da9df9444b.jpg'),
(34, 14, '/uploads/gallery/be958d41fb6f0ddd.jpg', '/uploads/gallery/0b134d7149d73ebe.jpg'),
(35, 14, '/uploads/gallery/600cc8373e514c18.jpg', '/uploads/gallery/b9577c333dce70ff.jpg'),
(36, 14, '/uploads/gallery/8c9ba66b41950aa2.jpg', '/uploads/gallery/e1cd0728b023f1cc.jpg'),
(37, 14, '/uploads/gallery/e6f81aeddf60b5ff.jpg', '/uploads/gallery/53ab50f5894ae7a4.jpg'),
(38, 14, '/uploads/gallery/99e350c6aea5361b.jpg', '/uploads/gallery/54d8148cdd383fd0.jpg'),
(82, 15, '/uploads/gallery/4e50f55164297f8a.jpg', '/uploads/gallery/ba5ae06915d85ce5.jpg'),
(83, 15, '/uploads/gallery/7989596868e7850f.jpg', '/uploads/gallery/7a61776952225d4c.jpg'),
(84, 15, '/uploads/gallery/d2b70f0c8e016401.jpg', '/uploads/gallery/a79a0824df00a1b2.jpg'),
(85, 15, '/uploads/gallery/26ea3d8e270a5c26.jpg', '/uploads/gallery/6badc36acacbf976.jpg'),
(86, 15, '/uploads/gallery/f433a110dfa84795.jpg', '/uploads/gallery/0bac345e12648039.jpg'),
(87, 15, '/uploads/gallery/32eb772583554db6.jpg', '/uploads/gallery/a88f5b7a62c478e9.jpg'),
(88, 15, '/uploads/gallery/4b170c165b64f55d.jpg', '/uploads/gallery/45f664ea71228658.jpg'),
(89, 15, '/uploads/gallery/6f4d2bda7fb969d1.jpg', '/uploads/gallery/4b747bc3da1dd454.jpg'),
(90, 15, '/uploads/gallery/b9e02e93f9cc91a6.jpg', '/uploads/gallery/526aa3b9b97e2bd2.jpg'),
(91, 15, '/uploads/gallery/9490feda9ce331ef.jpg', '/uploads/gallery/ea0dc8ff41538c43.jpg'),
(92, 15, '/uploads/gallery/e62071424c4f4abb.jpg', '/uploads/gallery/13f8a2a047c05dd9.jpg'),
(93, 15, '/uploads/gallery/c00fb69a01e5ff7c.jpg', '/uploads/gallery/b65209656f77d4e5.jpg'),
(94, 15, '/uploads/gallery/9ac6920c158b79f1.jpg', '/uploads/gallery/7886b4032eb03f16.jpg'),
(95, 15, '/uploads/gallery/d537b58d8dedb8ab.jpg', '/uploads/gallery/a4d9855e57e28b5e.jpg'),
(96, 15, '/uploads/gallery/4cfbf3e5185c7fc2.jpg', '/uploads/gallery/5a1303183f04810c.jpg');
DROP TABLE IF EXISTS `yii_mailforms`;
CREATE TABLE `yii_mailforms` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Ключ (псевдоним) формы',
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Название формы',
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'E-mail адреса получателей',
`phones` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Телефоны для смс-уведомлений',
`request_text_ok` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Текст ответа при успешной отправке',
`request_text_error` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Текст ответа при ошибке',
`template` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Шаблон письма',
`form_fields` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Поля формы',
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `yii_mailforms` (`id`, `key`, `title`, `email`, `phones`, `request_text_ok`, `request_text_error`, `template`, `form_fields`) VALUES
(1, 'callback22', 'Заказать звонок', '<EMAIL>', '+7 (111) 111-11-11', 'Спасибо! Мы вам перезвоним!', 'Произошла ошибка!', '#name,\r\n<br/>\r\n<br/>\r\n<br/>\r\n<br/>\r\n<br/>\r\n#phone\r\n', '49,50');
DROP TABLE IF EXISTS `yii_mailforms_fields`;
CREATE TABLE `yii_mailforms_fields` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Тип поля',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Имя поля',
`placeholder` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Плейсхолдер',
`value` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Значение',
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
INSERT INTO `yii_mailforms_fields` (`id`, `type`, `name`, `placeholder`, `value`) VALUES
(49, 'text', 'name', 'Ф.И.О.', 'Ф.И.О.'),
(50, 'text', 'phone', 'Телефон', '8 (800) 000 00 00');
DROP TABLE IF EXISTS `yii_mailforms_results`;
CREATE TABLE `yii_mailforms_results` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`form_id` int(11) NOT NULL COMMENT 'ИД формы',
`time` int(11) NOT NULL COMMENT 'Дата и время записи',
`user` int(11) DEFAULT NULL COMMENT 'Пользователь',
PRIMARY KEY (`id`),
KEY `FK_yii_mailforms_results_yii_mailforms` (`form_id`),
CONSTRAINT `FK_yii_mailforms_results_yii_mailforms` FOREIGN KEY (`form_id`) REFERENCES `yii_mailforms` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT COMMENT='Результаты заполнения форм\r\n';
INSERT INTO `yii_mailforms_results` (`id`, `form_id`, `time`, `user`) VALUES
(1, 1, 1478713105, NULL),
(2, 1, 1478723292, NULL);
DROP TABLE IF EXISTS `yii_mailforms_results_values`;
CREATE TABLE `yii_mailforms_results_values` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`result_id` int(11) NOT NULL COMMENT 'ИД результата',
`field_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Имя поля',
`field_value` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Значение',
PRIMARY KEY (`id`),
KEY `FK_yii_mailforms_results_values_yii_mailforms_results` (`result_id`),
KEY `FK_yii_mailforms_results_values_yii_mailforms_fields` (`field_name`),
CONSTRAINT `FK_yii_mailforms_results_values_yii_mailforms_fields` FOREIGN KEY (`field_name`) REFERENCES `yii_mailforms_fields` (`name`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_yii_mailforms_results_values_yii_mailforms_results` FOREIGN KEY (`result_id`) REFERENCES `yii_mailforms_results` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT COMMENT='Значения полей результатов форм';
INSERT INTO `yii_mailforms_results_values` (`id`, `result_id`, `field_name`, `field_value`) VALUES
(1, 1, 'name', 'test name'),
(2, 1, 'phone', 'test phone'),
(3, 2, 'name', 'test'),
(4, 2, 'phone', 'test');
DROP TABLE IF EXISTS `yii_migration`;
CREATE TABLE `yii_migration` (
`version` varchar(180) NOT NULL,
`apply_time` int(11) DEFAULT NULL,
PRIMARY KEY (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `yii_migration` (`version`, `apply_time`) VALUES
('m000000_000000_base', 1471551731),
('m130524_201442_init', 1471551736),
('m140506_102106_rbac_init', 1472857568);
DROP TABLE IF EXISTS `yii_pages`;
CREATE TABLE `yii_pages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alias` varchar(255) NOT NULL COMMENT 'Псевдоним',
`title` varchar(255) NOT NULL COMMENT 'Заголовок',
`text` text NOT NULL COMMENT 'Полный текст',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
INSERT INTO `yii_pages` (`id`, `alias`, `title`, `text`) VALUES
(2, 'rajder', 'Райдер', '<p>1. Бэклайн<br /><br />1.1. Ламповый гитарный усилитель с кабинетом 1х12, 2х12. Fender/Marshall или клоны. Крайне нежелательны Mesa/Boogie и его клоны. - 2 шт. Кабинеты должны быть подзвучены инструментальными микрофонами (Эленберг и прочие караоке микрофонами не считаются)<br /><br />1.2. Басовый усилитель с кабинетом... Подзвучка микрофоном и съем в линию (дибокс).<br /><br />1.3.Барабаная установка классом не ниже Sonor 507, Mapex Q series. Комплектация бочка 22\"(20\"), подвесной том 12\" (10\"), напольный том 16\" (14\"). 4 стойки под тарелки, стойка под хэт, под малый, все стойки классом не ниже sonor 100-й серии. Набор микрофонов для съема ударной установки - бочка, малый, хэт, подвесной том, напольный том, оверхед, все микрофоны должны быть предназначены для подзвучки барабанов (Эленберг и прочие караоке микрофонами не считаются). Компрессор, как минимум на бочке.<br />P.S.: пласты целые!!!! не заклеенные скотчем малярной лентой и т.д., а ЦЕЛЫЕ<br /><br />1.4. 2 и более микрофона вокальных со стойками, классом не ниже shure sm58, вокальная обработка (компрессор, дилэй).<br /><br />2. Мониторинг<br /><br />2.1. Минимум 3 мониторные линии. Отдельная мониторная линия для барабанщика (можно наушники, исправные с длинным шнуром классом не ниже AKG 44).</p>'),
(3, 'kontakty', 'Контакты', '<p>тут контакты</p>'),
(4, 'biografiya', 'Биография', '<p>Био</p>'),
(5, 'index', 'Главная', '<p><strong>Lorem Ipsum</strong> - это текст-\"рыба\", часто используемый в печати и вэб-дизайне. Lorem Ipsum является стандартной \"рыбой\" для текстов на латинице с начала XVI века. В то время некий безымянный печатник создал большую коллекцию размеров и форм шрифтов, используя Lorem Ipsum для распечатки образцов. Lorem Ipsum не только успешно пережил без заметных изменений пять веков, но и перешагнул в электронный дизайн. Его популяризации в новое время послужили публикация листов Letraset с образцами Lorem Ipsum в 60-х годах и, в более недавнее время, программы электронной вёрстки типа Aldus PageMaker, в шаблонах которых используется Lorem Ipsum.</p>');
DROP TABLE IF EXISTS `yii_settings_seo`;
CREATE TABLE `yii_settings_seo` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL COMMENT 'Название настройки',
`alias` varchar(255) NOT NULL COMMENT 'алиас',
`value` text NOT NULL COMMENT 'Значение',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Поля для настройки СЕО данных';
INSERT INTO `yii_settings_seo` (`id`, `title`, `alias`, `value`) VALUES
(1, 'Ключевые слова', 'keywords', 'the maugleez, mowglee, breaking bad, saltoz, saltozguitars, music, download music, listen, listen to music, rockband, rock, nvkz, siberia, novokuznetsk, новокузнецк, blues, stoner, indie, get up, getup, clip, video, album, new album, fanclub, fan, Russia, Россия, русская музыка, russian music, nobidy cares, warld, peace, society, social, way, prime minister, lyrics, song, songs, daisy, #1, number 1, number one, love, love story, ballad, single, ethnic, indie, independent, independent russian music, сибиряк, authentical, shazam, melody, fantasy, drums, amtelectronics, amedia cymbals, cymbals, pedalboard, vaper, guitar, bass, vocal, vox, text, скачать, скачать музыку, скачать текст, vape, скачать песню, jungle, city jungle, jet, jet fighter, jet fighters, песня, музыка, скачать бесплатно, мауглиз, мауглис, зэ мауглис, же мауглис, зэ мауглиз, зе мауглиз. Do it yourself, diy, production, label, record, studio, record studio, recording, sexy, stunning, gourgeous, funny, funk, alternative, new, new wave, punk, hard, follow, follow me, tasty, wonderful, beautiful, nice'),
(2, 'Описание сайта', 'site_description', 'Рок-группа The Maugleez из Новокузнецка. Быстро, жарко и довольно агрессивно. Громко, дико и прямо в цель. Это The Maugleez.');
DROP TABLE IF EXISTS `yii_sitemap`;
CREATE TABLE `yii_sitemap` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`parent` int(11) NOT NULL DEFAULT '0' COMMENT 'Родитель',
`alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Псевдоним',
`menu` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Меню',
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Заголовок страницы',
`template` text COLLATE utf8_unicode_ci NOT NULL COMMENT 'Шаблон',
`ord` int(11) NOT NULL COMMENT 'Порядок',
PRIMARY KEY (`id`),
UNIQUE KEY `alias` (`alias`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
INSERT INTO `yii_sitemap` (`id`, `parent`, `alias`, `menu`, `title`, `template`, `ord`) VALUES
(1, 0, 'site', '', 'Главная', 'default', 0),
(2, 1, 'news', '', 'Новости', 'default', 0),
(5, 2, 'news2', '', 'Новости2', 'default', 0),
(6, 0, 'events', '', 'События', 'default', 0);
DROP TABLE IF EXISTS `yii_sitemap_menu`;
CREATE TABLE `yii_sitemap_menu` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alias` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Псевдоним',
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Название меню',
PRIMARY KEY (`id`),
UNIQUE KEY `key` (`alias`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
INSERT INTO `yii_sitemap_menu` (`id`, `alias`, `title`) VALUES
(1, 'main_menu', 'Главное меню'),
(2, 'bottom_menu', 'Нижнее меню');
DROP TABLE IF EXISTS `yii_social`;
CREATE TABLE `yii_social` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL COMMENT 'Название',
`link` varchar(255) NOT NULL COMMENT 'Ссылка',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
INSERT INTO `yii_social` (`id`, `title`, `link`) VALUES
(3, 'vk', 'https://vk.com/the_maugleez'),
(4, 'instagram', 'https://www.instagram.com/themaugleez/'),
(5, 'jamendo', 'https://www.jamendo.com/artist/492314/the-maugleez'),
(6, 'youtube', 'https://www.youtube.com/channel/UCLBpgk3Lv1_ASL8ww1jWtCA');
DROP TABLE IF EXISTS `yii_test`;
CREATE TABLE `yii_test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `yii_user`;
CREATE TABLE `yii_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Логин пользователя',
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Имя пользователя',
`auth_key` varchar(32) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Ключ авторизации',
`password_hash` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'Пароль',
`password_reset_token` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT 'Токен сброса пароля',
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL COMMENT 'E-mail пользователя',
`status` smallint(6) NOT NULL DEFAULT '10' COMMENT 'Статус',
`active` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Акстивность',
`created_at` int(11) NOT NULL COMMENT 'Создан',
`updated_at` int(11) NOT NULL COMMENT 'Обновлен',
PRIMARY KEY (`id`),
UNIQUE KEY `username` (`username`),
UNIQUE KEY `email` (`email`),
UNIQUE KEY `password_reset_token` (`password_reset_token`),
KEY `FK_yii_user_yii_user_status` (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ROW_FORMAT=COMPACT;
INSERT INTO `yii_user` (`id`, `username`, `name`, `auth_key`, `password_hash`, `password_reset_token`, `email`, `status`, `active`, `created_at`, `updated_at`) VALUES
(1, 'developer', 'Разработчик', 'okoNGoEJ-Ea-YTmNMn1O2R6b7LH5iXIY', '$2y$13$xkeKYO0Ox7e7OTAWdTJvMOylsAGxP17EHlPxLBu3JcTqJh97nrn0S', NULL, '<a href=\"mailto:<EMAIL>\" class=\"mailto\"><EMAIL><span class=\"mailto\"><span class=\"element-invisible\"> (link sends e-mail)</span></span></a>', 10, 0, 1467146186, 1467146186),
(2, 'admin', 'Администратор', 'GBYgVK9fmg8ArK9uMu2biaXdotUZbe9g', '$2y$13$xkeKYO0Ox7e7OTAWdTJvMOylsAGxP17EHlPxLBu3JcTqJh97nrn0S', NULL, '<a href=\"mailto:<EMAIL>\" class=\"mailto\"><EMAIL><span class=\"mailto\"><span class=\"element-invisible\"> (link sends e-mail)</span></span></a>', 10, 0, 1467146418, 1467146418),
(3, 'manager', 'Менеджер', 'GBYgVK9fmg8ArK9uMu2biaXdotUZbe9g', '$2y$13$xkeKYO0Ox7e7OTAWdTJvMOylsAGxP17EHlPxLBu3JcTqJh97nrn0S', NULL, '<a href=\"mailto:<EMAIL>\" class=\"mailto\"><EMAIL><span class=\"mailto\"><span class=\"element-invisible\"> (link sends e-mail)</span></span></a>', 10, 0, 1467146418, 1467146418),
(4, 'user', 'Пользователь', 'GBYgVK9fmg8ArK9uMu2biaXdotUZbe9g', '$2y$13$xkeKYO0Ox7e7OTAWdTJvMOylsAGxP17EHlPxLBu3JcTqJh97nrn0S', NULL, '<a href=\"mailto:<EMAIL>\" class=\"mailto\"><EMAIL><span class=\"mailto\"><span class=\"element-invisible\"> (link sends e-mail)</span></span></a>', 10, 0, 1467146418, 1467146418),
(5, 'smm1', '<NAME>', 'c717d1f2c28010cdc2acc686daecf2da', '$2y$13$NEKGF4VjF80UOUf7v/bmiurFWe67qb1bOVUkeedz3wKdu3Y.8SRYW', NULL, '<EMAIL>', 10, 1, 1517066901, 1517066901);
DROP TABLE IF EXISTS `yii_video`;
CREATE TABLE `yii_video` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL COMMENT 'Название',
`link` varchar(255) NOT NULL COMMENT 'Ссылка на видео',
`date` varchar(50) NOT NULL COMMENT 'Дата видео',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `yii_video` (`id`, `title`, `link`, `date`) VALUES
(1, 'Get Up!', 'https://youtu.be/LMl74VLNyAs', '24-06-2016'),
(2, 'Get Up!', 'https://youtu.be/7LUPMsTtsYA', '24-06-2017');
-- 2019-01-27 06:55:10
|
<reponame>opengauss-mirror/Yat
-- @testpoint: opengauss关键字maxextents(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists explain_test cascade;
create table explain_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor maxextents for select * from explain_test order by 1;
close maxextents;
end;
--关键字带双引号-成功
start transaction;
cursor "maxextents" for select * from explain_test order by 1;
close "maxextents";
end;
--关键字带单引号-合理报错
start transaction;
cursor 'maxextents' for select * from explain_test order by 1;
close 'maxextents';
end;
--关键字带反引号-合理报错
start transaction;
cursor `maxextents` for select * from explain_test order by 1;
close `maxextents`;
end;
--清理环境
drop table if exists explain_test cascade;
|
-- @testpoint: opengauss关键字Integer(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists explain_test cascade;
create table explain_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor Integer for select * from explain_test order by 1;
close Integer;
end;
--关键字带双引号-成功
start transaction;
cursor "Integer" for select * from explain_test order by 1;
close "Integer";
end;
--关键字带单引号-合理报错
start transaction;
cursor 'Integer' for select * from explain_test order by 1;
close 'Integer';
end;
--关键字带反引号-合理报错
start transaction;
cursor `Integer` for select * from explain_test order by 1;
close `Integer`;
end;
--清理环境
drop table if exists explain_test cascade;
|
<reponame>OlegKhaykin/OK
exec db_admin.kill_session(2717,57757);
-- Current session state and stats:
with
sess as
(
select
s.audsid, s.inst_id, s.sid, s.serial#, p.pid, p.spid, s.session_edition_id,
--decode(s.ownerid, 2147483644, null, trunc(s.ownerid/65536)) parallel_coord_id,
--decode(s.ownerid, 2147483644, null, mod(s.ownerid,65536)) parent_sess_sid,
s.username, s.osuser,
s.program, s.module, s.action, s.status,
s.sql_id, s.sql_child_number,
(select listagg(sql_text) within group(order by piece) from gv$sqltext where inst_id = s.inst_id and sql_id = s.sql_id) sql_text,
s.blocking_instance, s.blocking_session
from gv$session s
join gv$process p on p.inst_id = s.inst_id and p.addr = s.paddr
left join gv$sql sq on sq.inst_id = s.inst_id and sq.sql_id = s.sql_id and sq.child_number = s.sql_child_number
where 1=1
and s.status IN ('ACTIVE','KILLED')
--and s.audsid = 1043681662
--and s.osuser = 'OKhaykin'
--and upper(sql_text) like '%MEMBERPDCSCOREHIST%'
and s.username = 'N384433'
--and s.module = 'MEMBERDERIVEDFACT_UR_220123'
--and s.sid = 2061
--and s.audsid = 618435790
--and upper(s.program) ='SQLPLUS.EXE'
--and s.sql_id = '3paf8n00dyqvr'
),
longops as
(
select
s.audsid, s.sid, s.sql_text, lo.start_time,
lo.elapsed_seconds, lo.time_remaining, lo.message,
lo.sql_id, lo.sql_exec_id
from sess s
join gv$session_longops lo
on lo.inst_id = s.inst_id and lo.sid = s.sid and lo.serial# = s.serial#
),
waits as
(
select
--s.*,
s.audsid, s.inst_id, s.sid,
w.seq#, w.event, w.wait_class, w.state, w.wait_time_micro/1000000 wait_seconds, w.time_since_last_wait_micro/1000000 seconds_since_last_wait,
w.p1text, p1, w.p2text, p2, w.p3text, p3
from sess s
join gv$session_wait w on w.inst_id = s.inst_id and w.sid = s.sid
),
events as
(
select
s.audsid, s.inst_id, s.sid,
se.event, se.time_waited_micro/1000000 waited_seconds
from sess s
join gv$session_event se on se.inst_id = s.inst_id and se.sid = s.sid
),
stats as
(
select
--s.*,
s.audsid, s.inst_id, s.sid,
sn.name, ss.value
from sess s
join gv$sesstat ss
on ss.inst_id = s.inst_id and ss.sid = s.sid and value > 0
join gv$statname sn
on sn.inst_id = s.inst_id and sn.statistic# = ss.statistic#
),
hist as
(
select
--s.*,
s.audsid, s.inst_id, s.sid,
ash.event,
rank() over(partition by s.audsid, s.inst_id, s.sid order by sample_time desc) rnk
from sess s
join gv$active_session_history ash
on ash.inst_id = s.inst_id and ash.session_id = s.sid and ash.session_serial# = s.serial#
)
select audsid, program, status, 'exec db_admin.kill_session('||sid||','||serial#||');' from sess;
select /*+ noparallel */ * from sess order by audsid, sid;
--select * from waits order by audsid, wait_seconds desc;
select * from longops where time_remaining > 0 order by audsid, start_time desc, time_remaining desc, elapsed_seconds desc;
--select * from stats order by audsid;
select * from events order by audsid;
select * from hist where rnk=1 order by audsid;
select * from table(dbms_xplan.display_cursor(sql_id => '9hr22b850678j', format => 'ALL'));
-- Active session history:
select
sample_id, sample_time, session_id, session_serial#, sql_id, sql_plan_operation,
event, p1text, p1, p2text, p2, p3text, p3, wait_class, wait_time, session_state, program,
current_obj#, --current_file#, current_block#,
delta_time, delta_read_io_bytes
from
(
select t.*, row_number() over(partition by session_id order by sample_id) rnum
from gv$active_session_history t
where sql_id='3paf8n00dyqvr' and sample_time>sysdate-1/2400
)
where rnum = 1
order by session_id;
-- =========================== SQL execution statistics ==============================
-- For each SQL statement currently in SGA:
select
-- a.address, c.parent_handle
a.*, c.*
from gv$sqlarea a
left join gv$sql_cursor c
on c.parent_handle = a.address and c.inst_id = a.inst_id
where 1=1
--and a.parsing_schema_name = 'POC' and a.module = 'SQL*Plus'
--and a.sql_id = 'bz3wgf0189a4h'
and upper(a.sql_text) like '%FROM patientmedicalprocedure%'
;
select * from gv$session where sql_id = 'frzbwrc0qwj78';
-- For each plan:
select * from gv$sqlarea_plan_hash;
-- For each step of the plan:
select * from gv$sql_plan_statistics;
-- For each child cursor:
select * from gv$sql_cursor;
-- For each execution (SQL_ID + SQL_EXEC_START or SQL_EXEC_ID):
select * from gv$sql_monitor;
--================================= Execution plans ====================================
-- For the last EXPLAIN PLAN:
explain plan for
select ps.memberid from ahmmrnbusinesssupplier bs
join careenginememberprocessstatus ps
on ps.memberid = bs.ahmmrnmemberid where bs.lastbusinessahmsupplierid =12906 ;
select plan_table_output from table(dbms_xplan.display);
-- For the cursor that is still in SGA:
select * from table
(
dbms_xplan.display_cursor
(
sql_id =>
'gghbyydza9mk9',
cursor_child_no => 0,
format => 'ALL'
)
);
--==============================================================================
-- AWR
-- See if AWR is available:
select * from
(
select inst_id, name, value
from gv$parameter where name in
(
'control_management_pack_access', -- should be DIAGNOSTIC+TUNING
'statistics_level' -- should be TYPICAL or ALL
)
) pivot(max(value) for inst_id in (1/*,2,3,4,5,6,7,8*/))
order by 1;
-- See available AWR snapshots:
select * from dba_hist_ash_snapshot order by 1 desc;
-- Get AWR report:
-- In theory, you can do this:
select dbms_workload_repository.awr_report_text(4251913509, 1, 993, 994, 8) from dual;
-- But better use the following scripts located in $ORACLE_HOME/rdbms/admin:
-- awrrpt.sql - for the local database
-- awrrpti.sql - for specific instance
-- . . .
--------------------------------------------------------------------------------
-- ADDM:
-- Need ADVISOR privilege to run ADDM:
select * from user_sys_privs where privilege = 'ADVISOR';
-- To run ADDM manually in the database mode:
declare
task varchar2(30) := 'ADDM for snapshots 993-994';
begin
dbms_addm.analyze_db(task, 993, 994);
end;
/
-- See ADDM report:
select dbms_addm.get_report('ADDM for snapshots 993-994') from dual;
-- Create a performace baseline - a difference between 2 AWR snapshots:
begin
dbms_workload_repository.create_baseline
(
start_snap_id => 979,
end_snap_id => 980,
baseline_name => 'peak baseline'
--,dbid => 3310949047, -- NULL by default - i.e. the current database
--,expiration => 30
);
end;
/
-- See SQL execution statistics
select * from dba_hist_sqlstat
where snap_id = 979
and sql_id = '8y6q8umcqybwr';
-- Find a particular SQL in AWR:
select * from dba_hist_sqltext
where sql_id = '8y6q8umcqybwr'
--where sql_text like '%FROM patientmedicalprocedure%'
;
-- Plan captured in AWR:
select * from table
(
dbms_xplan.display_awr
(
sql_id => '8y6q8umcqybwr',
plan_hash_value => 2844803677,
--db_id IN NUMBER DEFAULT NULL,
format => 'TYPICAL' -- BASIC, SERIAL, ALL; default - TYPICAL
)
);
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 02 Jan 2019 pada 08.16
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.0.33
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: `videostreaming`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `lazday_admin`
--
CREATE TABLE `lazday_admin` (
`admin_id` int(11) NOT NULL,
`username` varchar(100) DEFAULT NULL,
`password` text,
`updated` datetime DEFAULT NULL,
`last_login` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `lazday_admin`
--
INSERT INTO `lazday_admin` (`admin_id`, `username`, `password`, `updated`, `last_login`) VALUES
(1, 'admin', '<PASSWORD>', '2018-07-10 18:11:25', '2018-12-26 23:02:56');
-- --------------------------------------------------------
--
-- Struktur dari tabel `lazday_cat`
--
CREATE TABLE `lazday_cat` (
`cat_id` int(11) NOT NULL,
`category` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `lazday_cat`
--
INSERT INTO `lazday_cat` (`cat_id`, `category`) VALUES
(1, 'Rock'),
(2, 'Pop'),
(3, 'Rap'),
(4, 'Kosong');
-- --------------------------------------------------------
--
-- Struktur dari tabel `lazday_like`
--
CREATE TABLE `lazday_like` (
`like_id` bigint(20) NOT NULL,
`android_id` text NOT NULL,
`list_id` text NOT NULL,
`created` datetime DEFAULT NULL,
`status` enum('unread','read') NOT NULL DEFAULT 'unread'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `lazday_like`
--
INSERT INTO `lazday_like` (`like_id`, `android_id`, `list_id`, `created`, `status`) VALUES
(1, 'cdb4f733a0f1d6c4', '1', '2018-12-20 02:17:48', 'read'),
(2, 'cdb4f733a0f1d6c4', '3', '2018-12-20 02:17:51', 'read'),
(3, 'cdb4f733a0f1d6c4', '6', '2018-12-20 02:18:00', 'read'),
(4, '6bdf16fc1258e07d', '6', '2018-12-20 09:09:18', 'read');
-- --------------------------------------------------------
--
-- Struktur dari tabel `lazday_list`
--
CREATE TABLE `lazday_list` (
`list_id` bigint(20) NOT NULL,
`video_id` bigint(20) DEFAULT NULL,
`title` text NOT NULL,
`filename` text NOT NULL,
`view` int(11) NOT NULL,
`created` datetime DEFAULT NULL,
`updated` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `lazday_list`
--
INSERT INTO `lazday_list` (`list_id`, `video_id`, `title`, `filename`, `view`, `created`, `updated`) VALUES
(1, 23, 'Sheila On 7 - Betapa (Video Clip)', '201220185c1a94d163c72.mp4', 2, '2018-12-20 01:58:25', '2018-12-20 01:58:25'),
(2, 23, 'Sheila on 7 - Dan', '201220185c1a94edb6ab7.mp4', 1, '2018-12-20 01:58:53', '2018-12-20 01:58:53'),
(3, 23, 'Sheila On 7 - Lapang Dada (Official Music Video)', '201220185c1a94ff3edba.mp4', 0, '2018-12-20 01:59:11', '2018-12-20 01:59:11'),
(4, 25, '<NAME> Fade2Black - Ya Sudahlah (Video Clip)', '201220185c1a95326ea88.mp4', 0, '2018-12-20 02:00:02', '2018-12-20 02:00:02'),
(5, 26, 'ADA Band - Manusia bodoh', '201220185c1a970bd5fcf.mp4', 0, '2018-12-20 02:07:56', '2018-12-20 02:07:56'),
(6, 21, 'Letto - sandaran hati', '201220185c1a972c77d32.mp4', 6, '2018-12-20 02:08:28', '2018-12-20 02:08:28'),
(7, 24, 'Noah - Separuh aku', '201220185c1a976ca6f65.mp4', 2, '2018-12-20 02:09:32', '2018-12-20 02:09:32'),
(8, 27, 'Andra and the BackBone - Lagi dan lagi', '201220185c1a97fba0bcf.mp4', 1, '2018-12-20 02:11:55', '2018-12-20 02:11:55'),
(9, 23, '<NAME>u', '201220185c1afec4bfd7a.mp4', 0, '2018-12-20 09:30:28', '2018-12-20 09:30:28');
-- --------------------------------------------------------
--
-- Struktur dari tabel `lazday_user`
--
CREATE TABLE `lazday_user` (
`user_id` bigint(20) NOT NULL,
`android_id` text,
`created` datetime NOT NULL,
`last_login` datetime NOT NULL,
`status` enum('unread','read') NOT NULL DEFAULT 'unread'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `lazday_user`
--
INSERT INTO `lazday_user` (`user_id`, `android_id`, `created`, `last_login`, `status`) VALUES
(1, '6bdf16fc1258e07d', '2018-12-20 09:05:17', '2018-12-20 09:05:17', 'read');
-- --------------------------------------------------------
--
-- Struktur dari tabel `lazday_video`
--
CREATE TABLE `lazday_video` (
`video_id` bigint(20) NOT NULL,
`title` varchar(100) NOT NULL,
`summary` text NOT NULL,
`cover` text NOT NULL,
`category` text NOT NULL,
`created` datetime DEFAULT NULL,
`updated` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `lazday_video`
--
INSERT INTO `lazday_video` (`video_id`, `title`, `summary`, `cover`, `category`, `created`, `updated`) VALUES
(21, 'Letto', 'Letto merupakan sebuah grup musik Indonesia yang pertama kali dibentuk tahun 2004. Grup musik asal Yogyakarta ini beranggotakan Noe (Sabrang Mowo Damar Panuluh, Yogyakarta 10 Juni 1979) sebagai vokalis, Patub (Agus Riyono, Yogyakarta, 2 Agustus 1979) sebagai gitaris, Arian (Ari Prastowo, Bantul, 27 Maret 1979) sebagai bassis, dan Dhedot (Dedi Riyono, Yogyakarta, 23 Januari 1987) sebagai drummer.', '201220185c1a923254b3e.jpg', 'Pop', '2018-12-20 01:47:14', '2018-12-20 02:14:57'),
(23, 'Sheila On 7', 'Sheila On 7 adalah grup musik Indonesia yang berdiri pada 6 Mei 1996 di Yogyakarta.[1] Grup band ini pada awalnya adalah sekumpulan anak-anak sekolah dari beberapa SMA di Yogyakarta.', '201220185c1a932109ae0.jpg', 'Pop, Rock', '2018-12-20 01:51:13', '2018-12-20 02:14:47'),
(24, 'Noah', 'NOAH (sebelumnya bernama Peterpan), adalah sebuah grup musik Pop/Rock alternatif dari Bandung, Indonesia. Grup musik ini dikenal sebagai grup musik terbesar atau paling terkenal di Indonesia, bahkan sedikitnya di dunia. Grup musik ini dibentuk pada tahun 2000 dan terkenal berkat lagunya \"Mimpi Yang Sempurna\".', '201220185c1a9389a9df1.jpg', 'Pop,Rock', '2018-12-20 01:52:57', '2018-12-20 02:14:35'),
(25, '<NAME> Fade2Black', '<NAME> (lahir di Jakarta, 8 Mei 1984; umur 34 tahun)[1] adalah pemusik Indonesia yang mengawali karier bermusik sebagai penyanyi cilik pada tahun 80-an. Ia mulai dikenal sejak dirilisnya album Si Lumba-lumba (1989). ', '201220185c1a93cd00e25.jpg', 'Rap', '2018-12-20 01:54:05', '2018-12-20 02:14:24'),
(26, 'ADA Band', 'ADA Band adalah sebuah grup musik yang berasal dari Jakarta, Indonesia. Grup ini awalnya didirikan oleh <NAME>, <NAME>, <NAME>, <NAME> dan <NAME>. Namun di tengah perjalanan kariernya grup ini mengalami banyak pergantian personel, grup musik yang melejit melalui tembang-tembangnya seperti \"Masih\",', '201220185c1a94475162e.jpg', 'Pop', '2018-12-20 01:56:07', '2018-12-20 02:14:09'),
(27, 'Andra and the BackBone', 'Andra and the BackBone merupakan salah satu grup musik dari Indonesia. Anggotanya berjumlah tiga orang yaitu Dedy, Stevie, dan Andra Junaidi. Grup musik ini dibentuk pada tahun 2007.', '201220185c1a97ba2bbfc.jpg', 'Pop,Rap,Rock', '2018-12-20 02:10:50', '2018-12-20 02:14:02'),
(28, 'here we go', 'jkkgj', 'Backup_of_tugasGayuh.cdr', '', '2018-12-26 23:04:29', '2018-12-26 23:04:29');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `lazday_admin`
--
ALTER TABLE `lazday_admin`
ADD PRIMARY KEY (`admin_id`);
--
-- Indeks untuk tabel `lazday_cat`
--
ALTER TABLE `lazday_cat`
ADD PRIMARY KEY (`cat_id`);
--
-- Indeks untuk tabel `lazday_like`
--
ALTER TABLE `lazday_like`
ADD PRIMARY KEY (`like_id`);
--
-- Indeks untuk tabel `lazday_list`
--
ALTER TABLE `lazday_list`
ADD PRIMARY KEY (`list_id`);
--
-- Indeks untuk tabel `lazday_user`
--
ALTER TABLE `lazday_user`
ADD PRIMARY KEY (`user_id`);
--
-- Indeks untuk tabel `lazday_video`
--
ALTER TABLE `lazday_video`
ADD PRIMARY KEY (`video_id`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `lazday_admin`
--
ALTER TABLE `lazday_admin`
MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `lazday_cat`
--
ALTER TABLE `lazday_cat`
MODIFY `cat_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `lazday_like`
--
ALTER TABLE `lazday_like`
MODIFY `like_id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `lazday_list`
--
ALTER TABLE `lazday_list`
MODIFY `list_id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT untuk tabel `lazday_user`
--
ALTER TABLE `lazday_user`
MODIFY `user_id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT untuk tabel `lazday_video`
--
ALTER TABLE `lazday_video`
MODIFY `video_id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
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 */;
|
<filename>db/seeds.sql
INSERT INTO products(product_name, price, stock_quantity, in_cart, cart_quantity)
VALUES('Apples', 4, 10, true, 3);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Oranges', 5, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Bananas', 3, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Carrots', 2, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Crackers', 3, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Bread', 3, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Tuna', 1, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Laundry Detergent', 6, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Toothpaste', 4, 10);
INSERT INTO products(product_name, price, stock_quantity)
VALUES('Vitamins', 10, 10);
|
<filename>abhi.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 13, 2020 at 05:16 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.28
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: `abhi`
--
-- --------------------------------------------------------
--
-- Table structure for table `employee`
--
CREATE TABLE `employee` (
`employee_id` int(11) NOT NULL,
`user_id` varchar(225) NOT NULL,
`name` varchar(225) NOT NULL,
`email` varchar(225) NOT NULL,
`mobile` varchar(225) NOT NULL,
`address` longtext NOT NULL,
`added_on` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `employee`
--
INSERT INTO `employee` (`employee_id`, `user_id`, `name`, `email`, `mobile`, `address`, `added_on`) VALUES
(15, '1', 'Arjun', '<EMAIL>', '9806242879', 'Bhopal', '2020-08-04'),
(17, '1', 'Arjun', '<EMAIL>', '9806242879', 'Bhopal', '2020-08-04'),
(18, '8', 'Arjun', '<EMAIL>', '9806242879', 'Bhopal', '2020-08-04'),
(19, '1', 'Arjun', '<EMAIL>', '9806242879', 'Bhopal', '2020-08-04'),
(20, '1', 'Arjun', '<EMAIL>', '9806242879', 'Bhopal', '2020-08-04'),
(21, '1', 'Arjun', '<EMAIL>', '9806242879', 'Bhopal', '2020-08-04'),
(22, '1', 'Arjun', '<EMAIL>', '9806242879', 'Bhopal', '2020-08-04');
-- --------------------------------------------------------
--
-- Table structure for table `employee_mail`
--
CREATE TABLE `employee_mail` (
`id` int(11) NOT NULL,
`user_id` varchar(255) NOT NULL,
`campion` varchar(225) NOT NULL,
`employee_id` varchar(255) NOT NULL,
`employee_email` varchar(225) NOT NULL,
`header` varchar(225) NOT NULL,
`subject` varchar(225) NOT NULL,
`body` longtext NOT NULL,
`from_mail` varchar(225) NOT NULL,
`added_on` timestamp NOT NULL DEFAULT current_timestamp(),
`token_number` varchar(255) NOT NULL,
`see_status` enum('0','1') NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `employee_mail`
--
INSERT INTO `employee_mail` (`id`, `user_id`, `campion`, `employee_id`, `employee_email`, `header`, `subject`, `body`, `from_mail`, `added_on`, `token_number`, `see_status`) VALUES
(1, '1', 'deepak', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'to', 'hiiiiiiiiiiiiiiiiiii<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/8cfe6\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:03:20', '8cfe6', '1'),
(2, '1', 'DAD', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', '10', '10000000000000000000000<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/15c74\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:03:36', '15c74', '1'),
(3, '1', 'DEEPAK', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'hI', 'dOWNLOD<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/92@75\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:10:00', '92@75', '0'),
(4, '1', 'ASHOK', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'mE', 'tO doWNLOD<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/b71fa\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:10:22', 'b71fa', '1'),
(5, '1', 'lOTTRY', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'to dOWNLODE', 'hi dEEPAK yOU WIN <br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/a1749\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:13:51', 'a1749', '1'),
(6, '1', 'ANKIT', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'fROM dEEPAK sHAHA', 'hI ANKIT<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/4c2@5\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:14:14', '4c2@5', '0'),
(7, '1', 'DEEPAK', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'Hi <NAME>', 'HIIIIIIIIIIIIIIIII<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/3e72f\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:16:06', '3e72f', '1'),
(8, '1', 'hi', '11', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'Testing', 'You Win 500000 Lack Rupes<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/11/5cea4\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:20:02', '5cea4', '0'),
(9, '1', 'hi', '6', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'To Deepak Ashok Vivek Shah', 'Hiiiii YTou Win 50000 <br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/6/5e46@\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-12 14:20:30', '5e46@', '0'),
(10, '3', 'New', '9', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'Test', 'Test<br><br><a style=\"width:100%;display:block\" href=\"c9lab.com/c9/mail_confirmmation/9/5@324\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-08-31 20:36:09', '5@324', '0'),
(11, '1', 'fdsf', '15', '<EMAIL>', 'MIME-Version: 1.0\r\nContent-type:text/html;charset=UTF-8\r\n', 'fdffd', 'fdffdffdf<br><br><a style=\"width:100%;display:block\" href=\"localhost/c9/mail_confirmmation/15/c283b\"> <button style=\"color:white;background:skyblue;border:none;\">Click Here</button></a>', '', '2020-09-08 01:35:08', 'c283b', '0');
-- --------------------------------------------------------
--
-- Table structure for table `superadmin`
--
CREATE TABLE `superadmin` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` text NOT NULL,
`mobile` varchar(255) NOT NULL,
`address` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `superadmin`
--
INSERT INTO `superadmin` (`id`, `name`, `email`, `password`, `mobile`, `address`) VALUES
(1, 'Super Admin', '<EMAIL>', '<PASSWORD>', '9806242879', 'Indore');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`user_id` int(11) NOT NULL,
`name` varchar(225) NOT NULL,
`company` varchar(225) NOT NULL,
`email` varchar(225) NOT NULL,
`password` text NOT NULL,
`mobile` int(11) NOT NULL,
`address` longtext NOT NULL,
`profile_pic` varchar(255) NOT NULL,
`date` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`user_id`, `name`, `company`, `email`, `password`, `mobile`, `address`, `profile_pic`, `date`) VALUES
(1, 'Super Admindasddsad', 'Softwagon', '<EMAIL>', '<PASSWORD>', 2147483647, 'Indore', 'unnamed.png', '2020-08-04'),
(2, '<NAME>', 'Owlok', '<EMAIL>', '<PASSWORD>', 2147483647, 'Bhopal', 'Lighthouse1.jpg', '2020-08-04'),
(3, 'Abhijeet', 'IPhelp Systems', '<EMAIL>', '<PASSWORD>07f7a9a65', 2147483647, 'Indore', '2019.PNG', '2020-08-08'),
(4, 'ashok', 'om', '<EMAIL>', '<PASSWORD>', 1234567890, 'Indore', '20181020211931__MG_7290.JPG', '2020-08-12'),
(5, 'deepak', '<EMAIL>', '<EMAIL>', '<PASSWORD>', 1234567890, 'Om sai', 's2.jpg', '2020-08-12'),
(6, 'd', 'd', '<EMAIL>', '<PASSWORD>', 2147483647, 'fs', 's21.jpg', '2020-08-12'),
(7, '<EMAIL>', '<EMAIL>', '<EMAIL>', 'c81188c9e210333c65d0a0b8d0ba0ce5', 2147483647, '', 'card.jpg', '2020-08-12'),
(8, '<EMAIL>', '<EMAIL>', '<EMAIL>', '8fefce8d164537376193ccee8d2e4e8e', 2147483647, '', 'idcard.jpeg', '2020-08-12');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `employee`
--
ALTER TABLE `employee`
ADD PRIMARY KEY (`employee_id`);
--
-- Indexes for table `employee_mail`
--
ALTER TABLE `employee_mail`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `superadmin`
--
ALTER TABLE `superadmin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`user_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `employee`
--
ALTER TABLE `employee`
MODIFY `employee_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
--
-- AUTO_INCREMENT for table `employee_mail`
--
ALTER TABLE `employee_mail`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `superadmin`
--
ALTER TABLE `superadmin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
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 */;
|
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 14, 2021 at 07:55 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
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: `laravel`
--
-- --------------------------------------------------------
--
-- Table structure for table `admins`
--
CREATE TABLE `admins` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` 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 `admins`
--
INSERT INTO `admins` (`id`, `name`, `username`, `email`, `password`, `created_at`, `updated_at`) VALUES
(1, 'Md. <NAME>', 'hossain7736', '<EMAIL>', '$2y$10$4qZAtsHa/LneAkuH9yohKuAYGnU4JXMgqSWBGQYz5jr3VqH1hml.O', '2021-03-13 11:47:06', '2021-03-14 12:47:45');
-- --------------------------------------------------------
--
-- Table structure for table `contacts`
--
CREATE TABLE `contacts` (
`id` bigint(20) UNSIGNED NOT NULL,
`contact_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`contact_number` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`contact_email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`contact_message` 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 `contacts`
--
INSERT INTO `contacts` (`id`, `contact_name`, `contact_number`, `contact_email`, `contact_message`, `created_at`, `updated_at`) VALUES
(4, '<NAME>', '01795700838', '<EMAIL>', 'Hello', '2021-03-09 09:20:14', '2021-03-09 09:20:14'),
(6, '<NAME>', '01754414138', '<EMAIL>', 'Hello, How are you?', '2021-03-09 11:56:19', '2021-03-09 11:56:19'),
(15, '1', '24242', '1', '244', '2021-03-11 12:24:58', '2021-03-11 12:24:58'),
(16, '<NAME>', '01785212536', '<EMAIL>', 'Hello, Buddy How are you?', '2021-03-11 12:25:51', '2021-03-11 12:25:51'),
(18, 'Anwar', '01795700838', '<EMAIL>', 'Hi', '2021-03-12 02:26:54', '2021-03-12 02:26:54');
-- --------------------------------------------------------
--
-- Table structure for table `courses`
--
CREATE TABLE `courses` (
`id` bigint(20) UNSIGNED NOT NULL,
`course_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_des` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_fee` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_totalenroll` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_totalclass` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_link` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`course_img` 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 `courses`
--
INSERT INTO `courses` (`id`, `course_name`, `course_des`, `course_fee`, `course_totalenroll`, `course_totalclass`, `course_link`, `course_img`, `created_at`, `updated_at`) VALUES
(4, 'আইটি কোর্স', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '6000TK', '120', '80 Class', 'asdf', '/images/android.jpg', '2021-03-07 12:37:08', '2021-03-08 13:16:15'),
(20, 'আইটি কোর্স', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '6000TK', '120', '80 Class', 'asdf', '/images/android.jpg', '2021-03-07 12:37:08', '2021-03-08 13:16:15'),
(21, 'আইটি কোর্স', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '6000TK', '120', '80 Class', 'asdf', '/images/android.jpg', '2021-03-07 12:37:08', '2021-03-08 13:16:15'),
(22, 'আইটি কোর্স', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '6000TK', '120', '80 Class', 'asdf', '/images/android.jpg', '2021-03-07 12:37:08', '2021-03-08 13:16:15'),
(23, 'আইটি কোর্স', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '6000TK', '120', '80 Class', 'asdf', '/images/android.jpg', '2021-03-07 12:37:08', '2021-03-08 13:16:15'),
(24, 'আইটি কোর্স', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '6000TK', '120', '80 Class', 'asdf', '/images/android.jpg', '2021-03-07 12:37:08', '2021-03-08 13:16:15');
-- --------------------------------------------------------
--
-- Table structure for table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- 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, '2021_02_27_130546_create_visitors_table', 1),
(2, '2021_03_07_181640_create_courses_table', 2),
(3, '2021_03_08_170158_create_projects_table', 3),
(4, '2021_03_09_145831_create_contacts_table', 4),
(6, '2021_03_10_165000_create_reviews_table', 5),
(7, '2014_10_12_000000_create_admins_table', 6),
(8, '2014_10_12_100000_create_password_resets_table', 6),
(9, '2019_08_19_000000_create_failed_jobs_table', 6),
(10, '2014_10_12_000000_create_photos_table', 7);
-- --------------------------------------------------------
--
-- 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 `photos`
--
CREATE TABLE `photos` (
`id` bigint(20) UNSIGNED NOT NULL,
`location` 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;
-- --------------------------------------------------------
--
-- Table structure for table `projects`
--
CREATE TABLE `projects` (
`id` bigint(20) UNSIGNED NOT NULL,
`project_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`project_des` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`project_link` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`project_img` 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 `projects`
--
INSERT INTO `projects` (`id`, `project_name`, `project_des`, `project_link`, `project_img`, `created_at`, `updated_at`) VALUES
(1, 'আইটি কোর্স', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '', '/images/project.jpg', '2021-03-08 17:38:24', '2021-03-08 17:38:28'),
(10, 'React', 'React', 'React', '/images/react.jpg', '2021-03-08 13:12:38', '2021-03-08 13:15:13'),
(13, 'HTML', 'HTML Stands for Hyper Text Markup Language', 'afda', '/images/laravel.jpg', '2021-03-11 13:39:51', '2021-03-11 13:39:51');
-- --------------------------------------------------------
--
-- Table structure for table `reviews`
--
CREATE TABLE `reviews` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(500) COLLATE utf8mb4_unicode_ci NOT NULL,
`des` varchar(2000) COLLATE utf8mb4_unicode_ci NOT NULL,
`img` varchar(500) 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 `reviews`
--
INSERT INTO `reviews` (`id`, `name`, `des`, `img`, `created_at`, `updated_at`) VALUES
(1, 'বিল গেটস', 'মাইক্রোসফটের প্রতিষ্ঠাতা বিল গেটসের জীবন কেটেছে নানা ঘটনার মধ্য দিয়ে। হার্ভার্ড বিশ্ববিদ্যালয়ে লেখাপড়া শেষ না করেই মাইক্রোসফট প্রতিষ্ঠা করা', '/images/bill.jpg', '2021-03-10 12:19:54', '2021-03-10 12:19:54'),
(12, 'বিল গেটস', 'মাইক্রোসফটের প্রতিষ্ঠাতা বিল গেটসের জীবন কেটেছে নানা ঘটনার মধ্য দিয়ে। হার্ভার্ড বিশ্ববিদ্যালয়ে লেখাপড়া শেষ না করেই মাইক্রোসফট প্রতিষ্ঠা করা', '/images/bill.jpg', '2021-03-11 13:39:09', '2021-03-11 13:39:09');
-- --------------------------------------------------------
--
-- Table structure for table `services`
--
CREATE TABLE `services` (
`id` bigint(20) UNSIGNED NOT NULL,
`service_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`service_des` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`service_img` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `services`
--
INSERT INTO `services` (`id`, `service_name`, `service_des`, `service_img`) VALUES
(41, 'ইন্টারফেস 2', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '/images/graphic.svg'),
(42, 'ইন্টারফেস 3', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '/images/graphic.svg'),
(48, 'ইন্টারফেস', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '/images/graphic.svg'),
(49, 'ইন্টারফেস', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '/images/graphic.svg'),
(50, 'ইন্টারফেস', 'মোবাইল এবং ওয়েব এপ্লিকেশন ডেভেলপমেন্ট', '/images/graphic.svg');
-- --------------------------------------------------------
--
-- Table structure for table `visitors`
--
CREATE TABLE `visitors` (
`id` bigint(20) UNSIGNED NOT NULL,
`ip_address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`visit_time` 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 `visitors`
--
INSERT INTO `visitors` (`id`, `ip_address`, `visit_time`, `created_at`, `updated_at`) VALUES
(1, '127.0.0.1', '2021-02-27 07:10:16pm', '2021-02-27 13:10:16', '2021-02-27 13:10:16'),
(2, '127.0.0.1', '2021-02-27 07:10:24pm', '2021-02-27 13:10:24', '2021-02-27 13:10:24'),
(3, '127.0.0.1', '2021-02-27 07:11:24pm', '2021-02-27 13:11:24', '2021-02-27 13:11:24'),
(4, '127.0.0.1', '2021-02-27 07:11:25pm', '2021-02-27 13:11:25', '2021-02-27 13:11:25'),
(5, '127.0.0.1', '2021-02-27 07:11:27pm', '2021-02-27 13:11:27', '2021-02-27 13:11:27'),
(6, '127.0.0.1', '2021-02-27 07:11:27pm', '2021-02-27 13:11:27', '2021-02-27 13:11:27'),
(7, '127.0.0.1', '2021-02-27 07:11:28pm', '2021-02-27 13:11:28', '2021-02-27 13:11:28'),
(8, '127.0.0.1', '2021-02-27 07:11:28pm', '2021-02-27 13:11:28', '2021-02-27 13:11:28'),
(9, '127.0.0.1', '2021-02-27 07:11:28pm', '2021-02-27 13:11:28', '2021-02-27 13:11:28'),
(10, '127.0.0.1', '2021-02-27 07:11:29pm', '2021-02-27 13:11:29', '2021-02-27 13:11:29'),
(11, '127.0.0.1', '2021-02-27 07:11:29pm', '2021-02-27 13:11:29', '2021-02-27 13:11:29'),
(12, '127.0.0.1', '2021-02-27 07:11:29pm', '2021-02-27 13:11:29', '2021-02-27 13:11:29'),
(13, '127.0.0.1', '2021-02-27 07:11:30pm', '2021-02-27 13:11:30', '2021-02-27 13:11:30'),
(14, '127.0.0.1', '2021-02-27 07:11:30pm', '2021-02-27 13:11:30', '2021-02-27 13:11:30'),
(15, '127.0.0.1', '2021-02-27 07:11:30pm', '2021-02-27 13:11:30', '2021-02-27 13:11:30'),
(16, '127.0.0.1', '2021-02-27 07:11:30pm', '2021-02-27 13:11:30', '2021-02-27 13:11:30'),
(17, '::1', '2021-03-08 12:09:57am', '2021-03-07 18:09:57', '2021-03-07 18:09:57'),
(18, '::1', '2021-03-08 12:10:02am', '2021-03-07 18:10:02', '2021-03-07 18:10:02'),
(19, '::1', '2021-03-08 12:13:00am', '2021-03-07 18:13:00', '2021-03-07 18:13:00'),
(20, '::1', '2021-03-08 12:13:29am', '2021-03-07 18:13:29', '2021-03-07 18:13:29'),
(21, '::1', '2021-03-08 12:13:48am', '2021-03-07 18:13:48', '2021-03-07 18:13:48'),
(22, '::1', '2021-03-08 12:26:21am', '2021-03-07 18:26:21', '2021-03-07 18:26:21'),
(23, '::1', '2021-03-08 12:27:28am', '2021-03-07 18:27:28', '2021-03-07 18:27:28'),
(24, '::1', '2021-03-08 12:28:30am', '2021-03-07 18:28:30', '2021-03-07 18:28:30'),
(25, '::1', '2021-03-08 12:29:07am', '2021-03-07 18:29:07', '2021-03-07 18:29:07'),
(26, '::1', '2021-03-08 12:29:49am', '2021-03-07 18:29:49', '2021-03-07 18:29:49'),
(27, '::1', '2021-03-08 12:30:34am', '2021-03-07 18:30:34', '2021-03-07 18:30:34'),
(28, '::1', '2021-03-08 12:30:55am', '2021-03-07 18:30:55', '2021-03-07 18:30:55'),
(29, '::1', '2021-03-08 12:31:48am', '2021-03-07 18:31:48', '2021-03-07 18:31:48'),
(30, '::1', '2021-03-08 12:37:24am', '2021-03-07 18:37:24', '2021-03-07 18:37:24'),
(31, '::1', '2021-03-08 12:38:08am', '2021-03-07 18:38:08', '2021-03-07 18:38:08'),
(32, '::1', '2021-03-08 12:38:18am', '2021-03-07 18:38:18', '2021-03-07 18:38:18'),
(33, '::1', '2021-03-08 12:39:14am', '2021-03-07 18:39:14', '2021-03-07 18:39:14'),
(34, '::1', '2021-03-08 12:39:31am', '2021-03-07 18:39:31', '2021-03-07 18:39:31'),
(35, '::1', '2021-03-08 12:39:48am', '2021-03-07 18:39:48', '2021-03-07 18:39:48'),
(36, '::1', '2021-03-08 12:40:08am', '2021-03-07 18:40:08', '2021-03-07 18:40:08'),
(37, '::1', '2021-03-08 12:40:43am', '2021-03-07 18:40:43', '2021-03-07 18:40:43'),
(38, '::1', '2021-03-08 12:41:39am', '2021-03-07 18:41:39', '2021-03-07 18:41:39'),
(39, '::1', '2021-03-08 12:41:53am', '2021-03-07 18:41:53', '2021-03-07 18:41:53'),
(40, '::1', '2021-03-08 12:42:28am', '2021-03-07 18:42:28', '2021-03-07 18:42:28'),
(41, '::1', '2021-03-08 12:42:44am', '2021-03-07 18:42:44', '2021-03-07 18:42:44'),
(42, '::1', '2021-03-08 12:43:15am', '2021-03-07 18:43:15', '2021-03-07 18:43:15'),
(43, '::1', '2021-03-08 12:43:34am', '2021-03-07 18:43:34', '2021-03-07 18:43:34'),
(44, '::1', '2021-03-08 12:43:45am', '2021-03-07 18:43:45', '2021-03-07 18:43:45'),
(45, '::1', '2021-03-08 12:44:31am', '2021-03-07 18:44:31', '2021-03-07 18:44:31'),
(46, '::1', '2021-03-08 12:44:38am', '2021-03-07 18:44:38', '2021-03-07 18:44:38'),
(47, '::1', '2021-03-08 12:44:47am', '2021-03-07 18:44:47', '2021-03-07 18:44:47'),
(48, '::1', '2021-03-08 12:45:08am', '2021-03-07 18:45:08', '2021-03-07 18:45:08'),
(49, '::1', '2021-03-08 12:45:12am', '2021-03-07 18:45:12', '2021-03-07 18:45:12'),
(50, '::1', '2021-03-08 12:50:37am', '2021-03-07 18:50:37', '2021-03-07 18:50:37'),
(51, '::1', '2021-03-08 10:52:03pm', '2021-03-08 16:52:03', '2021-03-08 16:52:03'),
(52, '::1', '2021-03-08 10:52:21pm', '2021-03-08 16:52:21', '2021-03-08 16:52:21'),
(53, '::1', '2021-03-08 10:52:22pm', '2021-03-08 16:52:22', '2021-03-08 16:52:22'),
(54, '::1', '2021-03-08 10:52:24pm', '2021-03-08 16:52:24', '2021-03-08 16:52:24'),
(55, '::1', '2021-03-08 10:52:25pm', '2021-03-08 16:52:25', '2021-03-08 16:52:25'),
(56, '::1', '2021-03-08 10:56:46pm', '2021-03-08 16:56:46', '2021-03-08 16:56:46'),
(57, '::1', '2021-03-08 10:57:41pm', '2021-03-08 16:57:41', '2021-03-08 16:57:41'),
(58, '::1', '2021-03-08 10:57:50pm', '2021-03-08 16:57:50', '2021-03-08 16:57:50'),
(59, '::1', '2021-03-08 10:58:27pm', '2021-03-08 16:58:27', '2021-03-08 16:58:27'),
(60, '::1', '2021-03-08 10:59:40pm', '2021-03-08 16:59:40', '2021-03-08 16:59:40'),
(61, '::1', '2021-03-08 10:59:45pm', '2021-03-08 16:59:45', '2021-03-08 16:59:45'),
(62, '::1', '2021-03-08 11:00:28pm', '2021-03-08 17:00:28', '2021-03-08 17:00:28'),
(63, '::1', '2021-03-08 11:00:34pm', '2021-03-08 17:00:34', '2021-03-08 17:00:34'),
(64, '::1', '2021-03-08 11:28:38pm', '2021-03-08 17:28:38', '2021-03-08 17:28:38'),
(65, '::1', '2021-03-08 11:28:47pm', '2021-03-08 17:28:47', '2021-03-08 17:28:47'),
(66, '::1', '2021-03-08 11:35:33pm', '2021-03-08 17:35:33', '2021-03-08 17:35:33'),
(67, '::1', '2021-03-08 11:38:39pm', '2021-03-08 17:38:39', '2021-03-08 17:38:39'),
(68, '::1', '2021-03-08 11:39:05pm', '2021-03-08 17:39:05', '2021-03-08 17:39:05'),
(69, '::1', '2021-03-08 11:41:18pm', '2021-03-08 17:41:18', '2021-03-08 17:41:18'),
(70, '::1', '2021-03-08 11:41:29pm', '2021-03-08 17:41:29', '2021-03-08 17:41:29'),
(71, '::1', '2021-03-08 11:41:51pm', '2021-03-08 17:41:51', '2021-03-08 17:41:51'),
(72, '::1', '2021-03-08 11:42:11pm', '2021-03-08 17:42:11', '2021-03-08 17:42:11'),
(73, '::1', '2021-03-08 11:42:28pm', '2021-03-08 17:42:28', '2021-03-08 17:42:28'),
(74, '::1', '2021-03-08 11:42:41pm', '2021-03-08 17:42:41', '2021-03-08 17:42:41'),
(75, '::1', '2021-03-08 11:43:06pm', '2021-03-08 17:43:06', '2021-03-08 17:43:06'),
(76, '::1', '2021-03-08 11:43:12pm', '2021-03-08 17:43:12', '2021-03-08 17:43:12'),
(77, '127.0.0.1', '2021-03-09 08:13:55pm', '2021-03-09 14:13:55', '2021-03-09 14:13:55'),
(78, '127.0.0.1', '2021-03-09 08:14:11pm', '2021-03-09 14:14:11', '2021-03-09 14:14:11'),
(79, '127.0.0.1', '2021-03-09 08:14:33pm', '2021-03-09 14:14:33', '2021-03-09 14:14:33'),
(80, '127.0.0.1', '2021-03-09 08:14:43pm', '2021-03-09 14:14:43', '2021-03-09 14:14:43'),
(81, '127.0.0.1', '2021-03-09 08:15:00pm', '2021-03-09 14:15:00', '2021-03-09 14:15:00'),
(82, '127.0.0.1', '2021-03-09 08:15:01pm', '2021-03-09 14:15:01', '2021-03-09 14:15:01'),
(83, '127.0.0.1', '2021-03-09 08:15:30pm', '2021-03-09 14:15:30', '2021-03-09 14:15:30'),
(84, '127.0.0.1', '2021-03-09 08:15:42pm', '2021-03-09 14:15:42', '2021-03-09 14:15:42'),
(85, '127.0.0.1', '2021-03-09 08:15:46pm', '2021-03-09 14:15:46', '2021-03-09 14:15:46'),
(86, '127.0.0.1', '2021-03-09 08:16:26pm', '2021-03-09 14:16:26', '2021-03-09 14:16:26'),
(87, '127.0.0.1', '2021-03-09 08:16:53pm', '2021-03-09 14:16:53', '2021-03-09 14:16:53'),
(88, '127.0.0.1', '2021-03-09 08:17:07pm', '2021-03-09 14:17:07', '2021-03-09 14:17:07'),
(89, '127.0.0.1', '2021-03-09 08:18:19pm', '2021-03-09 14:18:19', '2021-03-09 14:18:19'),
(90, '127.0.0.1', '2021-03-09 08:18:48pm', '2021-03-09 14:18:48', '2021-03-09 14:18:48'),
(91, '127.0.0.1', '2021-03-09 08:19:03pm', '2021-03-09 14:19:03', '2021-03-09 14:19:03'),
(92, '127.0.0.1', '2021-03-09 08:19:21pm', '2021-03-09 14:19:21', '2021-03-09 14:19:21'),
(93, '127.0.0.1', '2021-03-09 08:19:32pm', '2021-03-09 14:19:32', '2021-03-09 14:19:32'),
(94, '127.0.0.1', '2021-03-09 08:24:05pm', '2021-03-09 14:24:05', '2021-03-09 14:24:05'),
(95, '127.0.0.1', '2021-03-09 08:26:17pm', '2021-03-09 14:26:17', '2021-03-09 14:26:17'),
(96, '127.0.0.1', '2021-03-09 08:26:26pm', '2021-03-09 14:26:26', '2021-03-09 14:26:26'),
(97, '127.0.0.1', '2021-03-09 08:26:38pm', '2021-03-09 14:26:38', '2021-03-09 14:26:38'),
(98, '127.0.0.1', '2021-03-09 08:27:26pm', '2021-03-09 14:27:26', '2021-03-09 14:27:26'),
(99, '127.0.0.1', '2021-03-09 08:27:37pm', '2021-03-09 14:27:37', '2021-03-09 14:27:37'),
(100, '127.0.0.1', '2021-03-09 08:27:55pm', '2021-03-09 14:27:55', '2021-03-09 14:27:55'),
(101, '127.0.0.1', '2021-03-09 08:28:02pm', '2021-03-09 14:28:02', '2021-03-09 14:28:02'),
(102, '127.0.0.1', '2021-03-09 08:29:04pm', '2021-03-09 14:29:04', '2021-03-09 14:29:04'),
(103, '127.0.0.1', '2021-03-09 08:32:51pm', '2021-03-09 14:32:51', '2021-03-09 14:32:51'),
(104, '127.0.0.1', '2021-03-09 08:33:06pm', '2021-03-09 14:33:06', '2021-03-09 14:33:06'),
(105, '127.0.0.1', '2021-03-09 08:33:18pm', '2021-03-09 14:33:18', '2021-03-09 14:33:18'),
(106, '127.0.0.1', '2021-03-09 08:35:17pm', '2021-03-09 14:35:17', '2021-03-09 14:35:17'),
(107, '127.0.0.1', '2021-03-09 08:35:23pm', '2021-03-09 14:35:23', '2021-03-09 14:35:23'),
(108, '127.0.0.1', '2021-03-09 08:35:48pm', '2021-03-09 14:35:48', '2021-03-09 14:35:48'),
(109, '127.0.0.1', '2021-03-09 08:35:54pm', '2021-03-09 14:35:54', '2021-03-09 14:35:54'),
(110, '127.0.0.1', '2021-03-09 08:35:59pm', '2021-03-09 14:35:59', '2021-03-09 14:35:59'),
(111, '127.0.0.1', '2021-03-09 08:37:42pm', '2021-03-09 14:37:42', '2021-03-09 14:37:42'),
(112, '127.0.0.1', '2021-03-09 08:38:27pm', '2021-03-09 14:38:27', '2021-03-09 14:38:27'),
(113, '127.0.0.1', '2021-03-09 08:40:47pm', '2021-03-09 14:40:47', '2021-03-09 14:40:47'),
(114, '127.0.0.1', '2021-03-09 08:40:58pm', '2021-03-09 14:40:58', '2021-03-09 14:40:58'),
(115, '127.0.0.1', '2021-03-09 08:42:38pm', '2021-03-09 14:42:38', '2021-03-09 14:42:38'),
(116, '127.0.0.1', '2021-03-09 08:42:54pm', '2021-03-09 14:42:54', '2021-03-09 14:42:54'),
(117, '127.0.0.1', '2021-03-09 08:43:26pm', '2021-03-09 14:43:26', '2021-03-09 14:43:26'),
(118, '127.0.0.1', '2021-03-09 08:43:31pm', '2021-03-09 14:43:31', '2021-03-09 14:43:31'),
(119, '127.0.0.1', '2021-03-09 08:43:55pm', '2021-03-09 14:43:55', '2021-03-09 14:43:55'),
(120, '127.0.0.1', '2021-03-09 08:44:13pm', '2021-03-09 14:44:13', '2021-03-09 14:44:13'),
(121, '127.0.0.1', '2021-03-09 08:44:21pm', '2021-03-09 14:44:21', '2021-03-09 14:44:21'),
(122, '127.0.0.1', '2021-03-09 08:44:40pm', '2021-03-09 14:44:40', '2021-03-09 14:44:40'),
(123, '127.0.0.1', '2021-03-09 08:45:01pm', '2021-03-09 14:45:01', '2021-03-09 14:45:01'),
(124, '127.0.0.1', '2021-03-09 08:45:07pm', '2021-03-09 14:45:08', '2021-03-09 14:45:08'),
(125, '127.0.0.1', '2021-03-09 08:45:55pm', '2021-03-09 14:45:55', '2021-03-09 14:45:55'),
(126, '127.0.0.1', '2021-03-09 08:46:02pm', '2021-03-09 14:46:02', '2021-03-09 14:46:02'),
(127, '127.0.0.1', '2021-03-09 08:46:07pm', '2021-03-09 14:46:07', '2021-03-09 14:46:07'),
(128, '127.0.0.1', '2021-03-09 08:46:14pm', '2021-03-09 14:46:14', '2021-03-09 14:46:14'),
(129, '127.0.0.1', '2021-03-09 08:46:23pm', '2021-03-09 14:46:23', '2021-03-09 14:46:23'),
(130, '127.0.0.1', '2021-03-09 08:50:07pm', '2021-03-09 14:50:07', '2021-03-09 14:50:07'),
(131, '127.0.0.1', '2021-03-09 08:50:55pm', '2021-03-09 14:50:55', '2021-03-09 14:50:55'),
(132, '127.0.0.1', '2021-03-09 08:51:03pm', '2021-03-09 14:51:03', '2021-03-09 14:51:03'),
(133, '127.0.0.1', '2021-03-09 08:51:18pm', '2021-03-09 14:51:18', '2021-03-09 14:51:18'),
(134, '127.0.0.1', '2021-03-09 08:51:23pm', '2021-03-09 14:51:24', '2021-03-09 14:51:24'),
(135, '127.0.0.1', '2021-03-09 08:51:59pm', '2021-03-09 14:51:59', '2021-03-09 14:51:59'),
(136, '127.0.0.1', '2021-03-09 08:52:16pm', '2021-03-09 14:52:16', '2021-03-09 14:52:16'),
(137, '127.0.0.1', '2021-03-09 08:52:21pm', '2021-03-09 14:52:21', '2021-03-09 14:52:21'),
(138, '127.0.0.1', '2021-03-09 08:52:44pm', '2021-03-09 14:52:44', '2021-03-09 14:52:44'),
(139, '127.0.0.1', '2021-03-09 08:52:50pm', '2021-03-09 14:52:50', '2021-03-09 14:52:50'),
(140, '127.0.0.1', '2021-03-09 08:57:26pm', '2021-03-09 14:57:26', '2021-03-09 14:57:26'),
(141, '127.0.0.1', '2021-03-09 09:00:04pm', '2021-03-09 15:00:04', '2021-03-09 15:00:04'),
(142, '127.0.0.1', '2021-03-09 09:00:53pm', '2021-03-09 15:00:53', '2021-03-09 15:00:53'),
(143, '127.0.0.1', '2021-03-09 09:01:22pm', '2021-03-09 15:01:22', '2021-03-09 15:01:22'),
(144, '127.0.0.1', '2021-03-09 09:02:54pm', '2021-03-09 15:02:54', '2021-03-09 15:02:54'),
(145, '127.0.0.1', '2021-03-09 09:03:19pm', '2021-03-09 15:03:20', '2021-03-09 15:03:20'),
(146, '127.0.0.1', '2021-03-09 09:08:20pm', '2021-03-09 15:08:20', '2021-03-09 15:08:20'),
(147, '127.0.0.1', '2021-03-09 09:10:02pm', '2021-03-09 15:10:02', '2021-03-09 15:10:02'),
(148, '127.0.0.1', '2021-03-09 09:12:21pm', '2021-03-09 15:12:21', '2021-03-09 15:12:21'),
(149, '127.0.0.1', '2021-03-09 09:15:17pm', '2021-03-09 15:15:17', '2021-03-09 15:15:17'),
(150, '127.0.0.1', '2021-03-09 09:15:58pm', '2021-03-09 15:15:58', '2021-03-09 15:15:58'),
(151, '127.0.0.1', '2021-03-09 09:16:12pm', '2021-03-09 15:16:12', '2021-03-09 15:16:12'),
(152, '127.0.0.1', '2021-03-09 09:19:36pm', '2021-03-09 15:19:36', '2021-03-09 15:19:36'),
(153, '127.0.0.1', '2021-03-09 09:20:31pm', '2021-03-09 15:20:31', '2021-03-09 15:20:31'),
(154, '::1', '2021-03-09 11:54:01pm', '2021-03-09 17:54:02', '2021-03-09 17:54:02'),
(155, '::1', '2021-03-09 11:54:13pm', '2021-03-09 17:54:13', '2021-03-09 17:54:13'),
(156, '::1', '2021-03-10 12:05:43am', '2021-03-09 18:05:43', '2021-03-09 18:05:43'),
(157, '::1', '2021-03-10 12:06:10am', '2021-03-09 18:06:10', '2021-03-09 18:06:10'),
(158, '::1', '2021-03-10 12:06:22am', '2021-03-09 18:06:22', '2021-03-09 18:06:22'),
(159, '::1', '2021-03-10 12:06:32am', '2021-03-09 18:06:32', '2021-03-09 18:06:32'),
(160, '::1', '2021-03-10 12:06:35am', '2021-03-09 18:06:35', '2021-03-09 18:06:35'),
(161, '::1', '2021-03-10 12:07:28am', '2021-03-09 18:07:28', '2021-03-09 18:07:28'),
(162, '::1', '2021-03-10 12:07:30am', '2021-03-09 18:07:30', '2021-03-09 18:07:30'),
(163, '::1', '2021-03-10 12:39:37am', '2021-03-09 18:39:37', '2021-03-09 18:39:37'),
(164, '::1', '2021-03-10 12:39:49am', '2021-03-09 18:39:49', '2021-03-09 18:39:49'),
(165, '::1', '2021-03-10 10:36:06pm', '2021-03-10 16:36:06', '2021-03-10 16:36:06'),
(166, '::1', '2021-03-10 10:36:24pm', '2021-03-10 16:36:24', '2021-03-10 16:36:24'),
(167, '::1', '2021-03-10 10:37:49pm', '2021-03-10 16:37:49', '2021-03-10 16:37:49'),
(168, '::1', '2021-03-10 10:41:53pm', '2021-03-10 16:41:53', '2021-03-10 16:41:53'),
(169, '::1', '2021-03-10 10:41:57pm', '2021-03-10 16:41:58', '2021-03-10 16:41:58'),
(170, '::1', '2021-03-10 10:42:47pm', '2021-03-10 16:42:47', '2021-03-10 16:42:47'),
(171, '::1', '2021-03-10 10:44:57pm', '2021-03-10 16:44:57', '2021-03-10 16:44:57'),
(172, '::1', '2021-03-10 10:46:19pm', '2021-03-10 16:46:19', '2021-03-10 16:46:19'),
(173, '::1', '2021-03-10 10:46:41pm', '2021-03-10 16:46:41', '2021-03-10 16:46:41'),
(174, '::1', '2021-03-10 10:46:49pm', '2021-03-10 16:46:49', '2021-03-10 16:46:49'),
(175, '::1', '2021-03-10 11:02:24pm', '2021-03-10 17:02:24', '2021-03-10 17:02:24'),
(176, '::1', '2021-03-10 11:02:47pm', '2021-03-10 17:02:47', '2021-03-10 17:02:47'),
(177, '::1', '2021-03-10 11:02:49pm', '2021-03-10 17:02:49', '2021-03-10 17:02:49'),
(178, '::1', '2021-03-10 11:03:08pm', '2021-03-10 17:03:08', '2021-03-10 17:03:08'),
(179, '::1', '2021-03-10 11:03:28pm', '2021-03-10 17:03:28', '2021-03-10 17:03:28'),
(180, '::1', '2021-03-10 11:03:49pm', '2021-03-10 17:03:49', '2021-03-10 17:03:49'),
(181, '::1', '2021-03-10 11:03:57pm', '2021-03-10 17:03:57', '2021-03-10 17:03:57'),
(182, '::1', '2021-03-10 11:04:15pm', '2021-03-10 17:04:15', '2021-03-10 17:04:15'),
(183, '::1', '2021-03-10 11:04:26pm', '2021-03-10 17:04:26', '2021-03-10 17:04:26'),
(184, '::1', '2021-03-11 12:26:16am', '2021-03-10 18:26:17', '2021-03-10 18:26:17'),
(185, '::1', '2021-03-11 12:26:24am', '2021-03-10 18:26:24', '2021-03-10 18:26:24'),
(186, '::1', '2021-03-11 11:40:47pm', '2021-03-11 17:40:47', '2021-03-11 17:40:47'),
(187, '::1', '2021-03-11 11:46:42pm', '2021-03-11 17:46:42', '2021-03-11 17:46:42'),
(188, '::1', '2021-03-11 11:46:48pm', '2021-03-11 17:46:48', '2021-03-11 17:46:48'),
(189, '::1', '2021-03-11 11:48:05pm', '2021-03-11 17:48:05', '2021-03-11 17:48:05'),
(190, '::1', '2021-03-11 11:48:50pm', '2021-03-11 17:48:50', '2021-03-11 17:48:50'),
(191, '::1', '2021-03-11 11:51:26pm', '2021-03-11 17:51:26', '2021-03-11 17:51:26'),
(192, '::1', '2021-03-11 11:51:30pm', '2021-03-11 17:51:30', '2021-03-11 17:51:30'),
(193, '::1', '2021-03-11 11:55:18pm', '2021-03-11 17:55:18', '2021-03-11 17:55:18'),
(194, '::1', '2021-03-12 12:04:35am', '2021-03-11 18:04:35', '2021-03-11 18:04:35'),
(195, '::1', '2021-03-12 12:09:29am', '2021-03-11 18:09:29', '2021-03-11 18:09:29'),
(196, '::1', '2021-03-12 12:11:19am', '2021-03-11 18:11:20', '2021-03-11 18:11:20'),
(197, '::1', '2021-03-12 12:11:25am', '2021-03-11 18:11:25', '2021-03-11 18:11:25'),
(198, '::1', '2021-03-12 12:11:32am', '2021-03-11 18:11:32', '2021-03-11 18:11:32'),
(199, '::1', '2021-03-12 12:13:45am', '2021-03-11 18:13:45', '2021-03-11 18:13:45'),
(200, '::1', '2021-03-12 12:15:41am', '2021-03-11 18:15:41', '2021-03-11 18:15:41'),
(201, '::1', '2021-03-12 12:17:34am', '2021-03-11 18:17:34', '2021-03-11 18:17:34'),
(202, '::1', '2021-03-12 12:17:55am', '2021-03-11 18:17:55', '2021-03-11 18:17:55'),
(203, '::1', '2021-03-12 12:18:55am', '2021-03-11 18:18:55', '2021-03-11 18:18:55'),
(204, '::1', '2021-03-12 12:19:29am', '2021-03-11 18:19:29', '2021-03-11 18:19:29'),
(205, '::1', '2021-03-12 12:19:47am', '2021-03-11 18:19:47', '2021-03-11 18:19:47'),
(206, '::1', '2021-03-12 12:20:08am', '2021-03-11 18:20:08', '2021-03-11 18:20:08'),
(207, '::1', '2021-03-12 12:20:56am', '2021-03-11 18:20:56', '2021-03-11 18:20:56'),
(208, '::1', '2021-03-12 12:21:24am', '2021-03-11 18:21:24', '2021-03-11 18:21:24'),
(209, '::1', '2021-03-12 12:21:33am', '2021-03-11 18:21:33', '2021-03-11 18:21:33'),
(210, '::1', '2021-03-12 12:21:49am', '2021-03-11 18:21:49', '2021-03-11 18:21:49'),
(211, '::1', '2021-03-12 12:22:02am', '2021-03-11 18:22:02', '2021-03-11 18:22:02'),
(212, '::1', '2021-03-12 12:22:49am', '2021-03-11 18:22:49', '2021-03-11 18:22:49'),
(213, '::1', '2021-03-12 12:23:38am', '2021-03-11 18:23:38', '2021-03-11 18:23:38'),
(214, '::1', '2021-03-12 12:23:58am', '2021-03-11 18:23:58', '2021-03-11 18:23:58'),
(215, '::1', '2021-03-12 12:24:41am', '2021-03-11 18:24:41', '2021-03-11 18:24:41'),
(216, '::1', '2021-03-12 12:24:51am', '2021-03-11 18:24:52', '2021-03-11 18:24:52'),
(217, '::1', '2021-03-12 12:25:06am', '2021-03-11 18:25:06', '2021-03-11 18:25:06'),
(218, '::1', '2021-03-12 12:26:46am', '2021-03-11 18:26:46', '2021-03-11 18:26:46'),
(219, '::1', '2021-03-12 12:26:49am', '2021-03-11 18:26:49', '2021-03-11 18:26:49'),
(220, '::1', '2021-03-12 12:27:11am', '2021-03-11 18:27:11', '2021-03-11 18:27:11'),
(221, '::1', '2021-03-12 12:27:20am', '2021-03-11 18:27:20', '2021-03-11 18:27:20'),
(222, '::1', '2021-03-12 12:28:35am', '2021-03-11 18:28:35', '2021-03-11 18:28:35'),
(223, '::1', '2021-03-12 12:28:49am', '2021-03-11 18:28:49', '2021-03-11 18:28:49'),
(224, '::1', '2021-03-12 12:29:40am', '2021-03-11 18:29:40', '2021-03-11 18:29:40'),
(225, '::1', '2021-03-12 12:30:00am', '2021-03-11 18:30:00', '2021-03-11 18:30:00'),
(226, '::1', '2021-03-12 12:30:07am', '2021-03-11 18:30:07', '2021-03-11 18:30:07'),
(227, '::1', '2021-03-12 12:31:39am', '2021-03-11 18:31:39', '2021-03-11 18:31:39'),
(228, '::1', '2021-03-12 12:31:40am', '2021-03-11 18:31:40', '2021-03-11 18:31:40'),
(229, '::1', '2021-03-12 12:32:14am', '2021-03-11 18:32:14', '2021-03-11 18:32:14'),
(230, '::1', '2021-03-12 12:32:15am', '2021-03-11 18:32:15', '2021-03-11 18:32:15'),
(231, '::1', '2021-03-12 12:32:16am', '2021-03-11 18:32:16', '2021-03-11 18:32:16'),
(232, '::1', '2021-03-12 12:40:53am', '2021-03-11 18:40:53', '2021-03-11 18:40:53'),
(233, '::1', '2021-03-12 12:41:25am', '2021-03-11 18:41:25', '2021-03-11 18:41:25'),
(234, '::1', '2021-03-12 12:41:58am', '2021-03-11 18:41:58', '2021-03-11 18:41:58'),
(235, '::1', '2021-03-12 12:42:49am', '2021-03-11 18:42:49', '2021-03-11 18:42:49'),
(236, '::1', '2021-03-12 12:43:29am', '2021-03-11 18:43:29', '2021-03-11 18:43:29'),
(237, '::1', '2021-03-12 12:43:33am', '2021-03-11 18:43:33', '2021-03-11 18:43:33'),
(238, '::1', '2021-03-12 12:43:36am', '2021-03-11 18:43:36', '2021-03-11 18:43:36'),
(239, '::1', '2021-03-12 12:43:38am', '2021-03-11 18:43:38', '2021-03-11 18:43:38'),
(240, '::1', '2021-03-12 12:43:42am', '2021-03-11 18:43:42', '2021-03-11 18:43:42'),
(241, '::1', '2021-03-12 12:45:20am', '2021-03-11 18:45:20', '2021-03-11 18:45:20'),
(242, '::1', '2021-03-12 12:53:32am', '2021-03-11 18:53:33', '2021-03-11 18:53:33'),
(243, '::1', '2021-03-12 12:56:38am', '2021-03-11 18:56:38', '2021-03-11 18:56:38'),
(244, '::1', '2021-03-12 01:19:39am', '2021-03-11 19:19:39', '2021-03-11 19:19:39'),
(245, '::1', '2021-03-12 01:19:40am', '2021-03-11 19:19:40', '2021-03-11 19:19:40'),
(246, '::1', '2021-03-12 01:19:51am', '2021-03-11 19:19:51', '2021-03-11 19:19:51'),
(247, '::1', '2021-03-12 01:19:52am', '2021-03-11 19:19:52', '2021-03-11 19:19:52'),
(248, '::1', '2021-03-12 01:22:11am', '2021-03-11 19:22:11', '2021-03-11 19:22:11'),
(249, '::1', '2021-03-12 01:22:22am', '2021-03-11 19:22:22', '2021-03-11 19:22:22'),
(250, '::1', '2021-03-12 01:22:43am', '2021-03-11 19:22:43', '2021-03-11 19:22:43'),
(251, '::1', '2021-03-12 01:23:00am', '2021-03-11 19:23:00', '2021-03-11 19:23:00'),
(252, '::1', '2021-03-12 02:25:47pm', '2021-03-12 08:25:47', '2021-03-12 08:25:47'),
(253, '::1', '2021-03-12 02:27:06pm', '2021-03-12 08:27:07', '2021-03-12 08:27:07'),
(254, '::1', '2021-03-12 02:27:08pm', '2021-03-12 08:27:08', '2021-03-12 08:27:08'),
(255, '::1', '2021-03-12 02:57:25pm', '2021-03-12 08:57:25', '2021-03-12 08:57:25'),
(256, '::1', '2021-03-12 03:00:41pm', '2021-03-12 09:00:41', '2021-03-12 09:00:41'),
(257, '::1', '2021-03-12 03:01:46pm', '2021-03-12 09:01:46', '2021-03-12 09:01:46'),
(258, '::1', '2021-03-12 03:02:11pm', '2021-03-12 09:02:11', '2021-03-12 09:02:11'),
(259, '::1', '2021-03-12 03:02:39pm', '2021-03-12 09:02:39', '2021-03-12 09:02:39'),
(260, '::1', '2021-03-12 03:02:58pm', '2021-03-12 09:02:58', '2021-03-12 09:02:58'),
(261, '::1', '2021-03-12 03:03:01pm', '2021-03-12 09:03:01', '2021-03-12 09:03:01'),
(262, '::1', '2021-03-12 03:06:18pm', '2021-03-12 09:06:18', '2021-03-12 09:06:18'),
(263, '::1', '2021-03-12 03:06:21pm', '2021-03-12 09:06:21', '2021-03-12 09:06:21'),
(264, '::1', '2021-03-12 03:06:51pm', '2021-03-12 09:06:51', '2021-03-12 09:06:51'),
(265, '::1', '2021-03-12 03:06:55pm', '2021-03-12 09:06:55', '2021-03-12 09:06:55'),
(266, '::1', '2021-03-12 03:07:02pm', '2021-03-12 09:07:02', '2021-03-12 09:07:02'),
(267, '::1', '2021-03-12 03:07:08pm', '2021-03-12 09:07:08', '2021-03-12 09:07:08'),
(268, '::1', '2021-03-12 03:07:20pm', '2021-03-12 09:07:20', '2021-03-12 09:07:20'),
(269, '::1', '2021-03-12 03:07:29pm', '2021-03-12 09:07:29', '2021-03-12 09:07:29'),
(270, '::1', '2021-03-12 03:07:36pm', '2021-03-12 09:07:36', '2021-03-12 09:07:36'),
(271, '::1', '2021-03-12 03:07:48pm', '2021-03-12 09:07:48', '2021-03-12 09:07:48'),
(272, '::1', '2021-03-12 03:07:53pm', '2021-03-12 09:07:53', '2021-03-12 09:07:53'),
(273, '::1', '2021-03-12 03:07:58pm', '2021-03-12 09:07:58', '2021-03-12 09:07:58'),
(274, '::1', '2021-03-12 03:08:05pm', '2021-03-12 09:08:05', '2021-03-12 09:08:05'),
(275, '::1', '2021-03-12 03:08:11pm', '2021-03-12 09:08:11', '2021-03-12 09:08:11'),
(276, '::1', '2021-03-12 03:08:17pm', '2021-03-12 09:08:17', '2021-03-12 09:08:17'),
(277, '::1', '2021-03-12 03:08:24pm', '2021-03-12 09:08:24', '2021-03-12 09:08:24'),
(278, '::1', '2021-03-12 03:08:56pm', '2021-03-12 09:08:56', '2021-03-12 09:08:56'),
(279, '::1', '2021-03-12 03:11:07pm', '2021-03-12 09:11:07', '2021-03-12 09:11:07'),
(280, '::1', '2021-03-12 03:11:08pm', '2021-03-12 09:11:08', '2021-03-12 09:11:08'),
(281, '::1', '2021-03-12 03:11:29pm', '2021-03-12 09:11:29', '2021-03-12 09:11:29'),
(282, '::1', '2021-03-12 03:12:36pm', '2021-03-12 09:12:36', '2021-03-12 09:12:36'),
(283, '::1', '2021-03-12 03:12:53pm', '2021-03-12 09:12:53', '2021-03-12 09:12:53'),
(284, '::1', '2021-03-12 03:13:00pm', '2021-03-12 09:13:00', '2021-03-12 09:13:00'),
(285, '::1', '2021-03-12 03:15:22pm', '2021-03-12 09:15:22', '2021-03-12 09:15:22');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admins`
--
ALTER TABLE `admins`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `admins_email_unique` (`email`);
--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `courses`
--
ALTER TABLE `courses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`);
--
-- 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 `photos`
--
ALTER TABLE `photos`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `projects`
--
ALTER TABLE `projects`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `reviews`
--
ALTER TABLE `reviews`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `services`
--
ALTER TABLE `services`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `visitors`
--
ALTER TABLE `visitors`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admins`
--
ALTER TABLE `admins`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `contacts`
--
ALTER TABLE `contacts`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `courses`
--
ALTER TABLE `courses`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- 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 `photos`
--
ALTER TABLE `photos`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=187;
--
-- AUTO_INCREMENT for table `projects`
--
ALTER TABLE `projects`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `reviews`
--
ALTER TABLE `reviews`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;
--
-- AUTO_INCREMENT for table `visitors`
--
ALTER TABLE `visitors`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=286;
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 */;
|
<filename>library/src/java/SQL/getPermissions.sql
SELECT APP.PERMISSIONS.ID, APP.PERMISSIONS."NAME" FROM APP.PERMISSIONS
|
-- Create a new view called 'VW_BookInfo_Join_Category' in schema 'dbo'
-- Drop the view if it already exists
IF EXISTS (
SELECT *
FROM sys.views
JOIN sys.schemas
ON sys.views.schema_id = sys.schemas.schema_id
WHERE sys.schemas.name = N'dbo'
AND sys.views.name = N'VW_BookInfo_Join_Category'
)
DROP VIEW dbo.VW_BookInfo_Join_Category
GO
-- Create the view in the specified schema
CREATE VIEW dbo.VW_BookInfo_Join_Category
AS
-- body of the view
SELECT [bookInfoId], COALESCE([Category].[name], N'Book') AS [categoryName]
FROM dbo.[BookInfo]
LEFT JOIN dbo.[Category]
ON [BookInfo].[categoryId] = [Category].[categoryId]
GO
|
<filename>polygon/QiDao/view_qi_pool_withdraw.sql
BEGIN;
DROP VIEW IF EXISTS qidao.view_qi_pool_withdraw CASCADE;
CREATE VIEW qidao.view_qi_pool_withdraw AS (
select evt_block_time as block_time,
'0x' || encode("user", 'hex') as user_address,
contract_address as pool_contract_address,
amount/1e18 as amount,
"endBlock" as end_block,
evt_tx_hash as tx_hash
from qidao."eQi_evt_Leave"
);
COMMIT;
|
<reponame>BrendanCostigan/SQLServerExamples
-- Evaluates the arguments in order and returns the current value of the first expression that initially does not evaluate to NULL.
SELECT COALESCE(NULL, 'Fred', 'Joe'); --< Returns Fred
SELECT COALESCE('Joe', 'Fred', 'Mary'); --< Returns Joe
-- ISNULL Non-standard t-SQL alterative which is limited to two parameters. Do not use.
SELECT ISNULL(NULL, 'Fred'); --< Returns Fred
|
<reponame>segor/zno-opendata
-- Weighted Moving Average of two values
CREATE FUNCTION [dbo].[wmAvg]
(
@val1 decimal(7,4),
@val2 decimal(7,4),
@val3 decimal(7,4) = NULL
)
RETURNS decimal(7,4) AS
BEGIN
RETURN CASE WHEN @val3 IS NULL
THEN (2 * @val1 + 1 * @val2) / 3
ELSE (3 * @val1 + 2 * @val2 + 1 * @val3) / 6
END;
END
|
EXEC ('DROP VIEW IF EXISTS [zno$(ZnoYear)].[TerTypeScores]')
GO
CREATE VIEW [zno$(ZnoYear)].[TerTypeScores] AS
SELECT TerType
,COUNT(DISTINCT OutID) AS N
,AVG([Score]) AvgScore
,COUNT([Score]) AS Exams
,SUM(CAST([IsFailed] AS tinyint)) FailedExams
, 1 - 1.0 * SUM(CAST([IsFailed] AS tinyint))/ COUNT([Score]) AS PassRate
FROM [zno$(ZnoYear)].[Scores]
INNER JOIN [zno$(ZnoYear)].[Schools] on ([Scores].EOHash = [Schools].EOHash)
GROUP BY TerType
|
<gh_stars>1-10
UPDATE performs SET STdate='0001-01-01 00:00:00' WHERE STDate IS NULL;||
UPDATE performs SET ENdate='9000-01-01 00:00:00' WHERE ENDate IS NULL;||
ALTER TABLE performs MODIFY COLUMN STdate datetime NOT NULL DEFAULT '0001-01-01 00:00:00';||
ALTER TABLE performs MODIFY COLUMN ENdate datetime NOT NULL DEFAULT '9000-01-01 00:00:00';
|
<filename>digestor/data/sdss_postload.sql
--
-- This file is intended to be processed by the Python format method, and
-- executed *after* the table data has been loaded
--
CREATE INDEX {table}_q3c_ang2ipix ON {schema}.{table} (q3c_ang2ipix({ra}, {dec})) WITH (fillfactor=100);
CLUSTER {table}_q3c_ang2ipix ON {schema}.{table};
-- CREATE INDEX {table}_glon_q3c_ang2ipix ON {schema}.{table} (q3c_ang2ipix(glon, glat)) WITH (fillfactor=100);
-- CREATE INDEX {table}_elon_q3c_ang2ipix ON {schema}.{table} (q3c_ang2ipix(elon, elat)) WITH (fillfactor=100);
ALTER TABLE {schema}.{table} ADD PRIMARY KEY ({pkey});
CREATE UNIQUE INDEX {table}_sdss_joinid ON {schema}.{table} (sdss_joinid) WITH (fillfactor=100);
CREATE INDEX {table}_ra ON {schema}.{table} ({ra}) WITH (fillfactor=100);
CREATE INDEX {table}_dec ON {schema}.{table} ({dec}) WITH (fillfactor=100);
CREATE INDEX {table}_elon ON {schema}.{table} (elon) WITH (fillfactor=100);
CREATE INDEX {table}_elat ON {schema}.{table} (elat) WITH (fillfactor=100);
CREATE INDEX {table}_glon ON {schema}.{table} (glon) WITH (fillfactor=100);
CREATE INDEX {table}_glat ON {schema}.{table} (glat) WITH (fillfactor=100);
CREATE INDEX {table}_htm9 ON {schema}.{table} (htm9) WITH (fillfactor=100);
CREATE INDEX {table}_ring256 ON {schema}.{table} (ring256) WITH (fillfactor=100);
CREATE INDEX {table}_nest4096 ON {schema}.{table} (nest4096) WITH (fillfactor=100);
CREATE INDEX {table}_random_id ON {schema}.{table} (random_id) WITH (fillfactor=100);
GRANT SELECT ON {schema}.{table} TO dlquery;
ANALYZE {schema}.{table};
|
<reponame>Andrelirao/aulas-graduacao
CREATE OR REPLACE FUNCTION VERIFICAR_CAMPUS (
V_SIGLA IN CHAR)
RETURN VARCHAR2
IS
BEGIN
IF V_SIGLA = 'VG' THEN
RETURN 'VERGUEIRO';
ELSIF V_SIGLA = 'MM' THEN
RETURN 'Memorial';
ELSIF V_SIGLA = 'VM' THEN
RETURN 'Vila Maria';
ELSIF V_SIGLA = 'VP' THEN
RETURN 'Vila Prudente';
ELSE
RETURN '<NAME>';
END IF;
END VERIFICAR_CAMPUS;
/
BEGIN
dbms_output.put_line(VERIFICAR_CAMPUS('MM'));
END;
SELECT verificar_campus('VM') FROM DUAL;
SELECT verificar_campus('MM') FROM DUAL;
SELECT verificar_campus('SS') FROM DUAL;
|
CREATE TABLE IF NOT EXISTS discordUser (
userId INTEGER NOT NULL,
userDId INTEGER NOT NULL UNIQUE,
userName TEXT NOT NULL,
dateFirstSeen TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
dateFirstUsed TEXT,
userBirthday TEXT,
-- https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
timeZoneLabel TEXT, -- Should appear as America/New_York
-- https://en.wikipedia.org/wiki/List_of_time_zone_abbreviations
utcOffset TEXT, -- Format UTC±N
CONSTRAINT pk_discUser PRIMARY KEY (userId)
);
CREATE TABLE IF NOT EXISTS discordServer (
serverId INTEGER NOT NULL,
serverDId INTEGER NOT NULL UNIQUE,
serverName TEXT,
dateFirstSeen TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT pk_discServer PRIMARY KEY (serverId)
);
CREATE TABLE IF NOT EXISTS discordServerUser (
userId INTEGER NOT NULL,
serverId INTEGER NOT NULL,
userNickname TEXT,
CONSTRAINT pk_discServUser PRIMARY KEY (userId, serverId),
CONSTRAINT fk_discUserid_discServUser FOREIGN KEY (userId) REFERENCES discordUser(id),
CONSTRAINT fk_discServid_discServUser FOREIGN KEY (serverId) REFERENCES discordServer(id)
);
CREATE TABLE IF NOT EXISTS discordServerChannel (
channelId INTEGER NOT NULL,
serverId INTEGER NOT NULL,
channelName TEXT,
channelTopic TEXT,
isNsfw INTEGER,
lastMessageTime TEXT,
CONSTRAINT pk_discServChan PRIMARY KEY (channelId, serverId),
CONSTRAINT fk_discServid_discServChan FOREIGN KEY (serverId) REFERENCES discordServer(id)
);
CREATE TABLE IF NOT EXISTS artist (
artistId INTEGER NOT NULL,
artistNickname TEXT,
artistBirthday TEXT,
CONSTRAINT pk_artistid PRIMARY KEY (artistId)
);
CREATE TABLE IF NOT EXISTS twitterAccount (
twitterId INTEGER NOT NULL,
twitterUserId TEXT NOT NULL UNIQUE, -- the Twitter id is a signed 52-bit int, but it's preferable to pick id_str field
userName TEXT,
screenName TEXT,
userDesc TEXT,
verifiedAcc INTEGER DEFAULT 0, -- bool
creationDate TEXT,
CONSTRAINT pk_twitterAcc PRIMARY KEY (twitterId)
);
CREATE TABLE IF NOT EXISTS artistTwitter (
artistId INTEGER NOT NULL,
twitterId INTEGER NOT NULL,
CONSTRAINT pk_artistTwit PRIMARY KEY (artistId, twitterId)
CONSTRAINT fk_artidArtTwit FOREIGN KEY (artistId) REFERENCES artist(artistId)
CONSTRAINT fk_twitidArtTwit FOREIGN KEY (twitterId) REFERENCES twitterAccount(twitterId)
);
-- CREATE TABLE IF NOT EXISTS userAvatar (
-- avatarId INTEGER NOT NULL,
-- userId INTEGER NOT NULL,
-- avatarUrl TEXT NOT NULL,
-- CONSTRAINT pk_avatarid PRIMARY KEY (avatarId),
-- CONSTRAINT fk_userUserAvat FOREIGN KEY (userId) REFERENCES discordUser(userId)
-- );
|
<filename>XEvent/deadlock_xevent.sql<gh_stars>1-10
ALTER EVENT SESSION [Deadlocks] ON SERVER STATE = STOP
GO
DROP EVENT SESSION [Deadlocks] ON SERVER
GO
CREATE EVENT SESSION [Deadlocks] ON SERVER
ADD EVENT sqlserver.xml_deadlock_report
ADD TARGET package0.event_file(SET filename=N'Deadlocks',max_file_size=(250),max_rollover_files=(3))
WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=ON)
GO
ALTER EVENT SESSION [Deadlocks] ON SERVER STATE = START
GO
|
USE [VipunenTK]
GO
/****** Object: View [dbo].[v_f_tab_ulkomaalaistaustaiset] Script Date: 6.6.2018 11:31:42 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[v_f_tab_ulkomaalaistaustaiset]'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW [dbo].[v_f_tab_ulkomaalaistaustaiset] AS
SELECT [aloittaneet] AS aloit2
,[opiskelijat] AS opisk2
,[tutkinnot] AS tutk2
,[aloittaneet_ulkomaalaistausta_kielen_mukaan]
,[opiskelijat_ulkomaalaistausta_kielen_mukaan]
,[tutkinnot_ulkomaalaistausta_kielen_mukaan]
,[aloittaneet_ulkomaalaistausta_vanhempien_synnyinmaan_mukaan]
,[opiskelijat_ulkomaalaistausta_vanhempien_synnyinmaan_mukaan]
,[tutkinnot_ulkomaalaistausta_vanhempien_synnyinmaan_mukaan]
,[aloittaneet_ulkomaalaiset]
,[opiskelijat_ulkomaalaiset]
,[tutkinnot_ulkomaalaiset]
,[aloittaneet_ulkomailla_syntyneet]
,[opiskelijat_ulkomailla_syntyneet]
,[tutkinnot_ulkomailla_syntyneet]
,[tilastovuosi] AS Tilastovuosi
,d1.aineisto AS Aineisto
,d2.opintoala2002 AS [Opintoala]
,d2.koulutusala2002 AS [Koulutusala]
,d2.opintoala1995 AS [Koulutusala (95 luokitus)]
,d2.koulutusala2002 AS [Koulutusala (02 luokitus)]
,d2.koulutusaste2002 AS [Koulutusaste]
,d3.koulutusryhma AS Koulutuslaji
,d4.maassaolo AS Maassaolo
,d5.opetushallinnon_koulutus AS Hallinnonala
,[syntymavuosi] AS Syntymävuosi
,[suomeen_muuttamisvuosi] AS [Suomeen muuttamisvuosi]
,[tutkinnon_aloittamisvuosi] AS [Aloitusvuosi]
,[suoritusaika] AS Suoritusaika
,d6.kieli AS Opetuskieli
,d7.tutkinnon_toteuma AS [Koko tutkinto/tutkinnon osa]
,d8.kunta AS [Koulutuksen kunta]
,d8.maakunta AS [Koulutuksen maakunta]
,d8.ely AS [Koulutuksen ELY-alue]
,d8.avi AS [Koulutuksen AVI-alue]
,d8b.kunta AS [Asuinkunta]
,d8b.maakunta AS [Asuinmaakunta]
,d8b.ely AS [Asuinalueen ELY]
,d8b.avi AS [Asuinalueen AVI]
,d8c.asuinkunta_sama_vai_eri_kuin_aiemmin AS [Asuinkunta sama/eri kuin aikaisemmin]
,d8d.edeltavan_vuoden_asuinpaikka AS [Edeltävän vuoden asuinpaikka]
,d9.sukupuoli AS Sukupuoli
,d10.hetu_ok AS [Henkilötunnuksen oikeellisuus]
,d11.ika AS [Ikä]
,d11.ika5v [Ikäryhmä]
,d13.opiskelijan_olo AS [Kirjoillaolo (syys)]
,d16.maa AS [Kansalaisuus (maa)]
,d16.maanosa AS [Kansalaisuus (maanosa)]
,d16.etamaa AS [ETA-maan kansalainen]
,d16.eumaa AS [EU-maan kansalainen]
,d18.maa AS [Syntymävaltio]
,d18.maanosa AS [Syntymävaltio (maanosa)]
,d18b.maa AS [Äidin syntymävaltio]
,d18b.maanosa AS [Äidin syntymävaltio (maanosa)]
,d18c.maa AS [Isän syntymävaltio]
,d18c.maanosa AS [Isän syntymävaltio (maanosa)]
,d19.maahantulo_ja_opiskelun_aloittaminen AS [Maahantulo ja toisen asteen koul. aloittaminen]
,d20.maahantulo_ja_opiskelun_aloittaminen AS [Maahantulo ja korkeakoul. aloittaminen]
,d21.aidinkieli_versio1 AS [Äidinkieli]
,d21b.aidinkieli_versio2 AS [Äidinkieli (tarkennus)]
,d21c.kieli AS [Äidinkieli (maa)]
,d22.koulutussektori AS [Koulutussektori]
,d1.aineisto_koodi
,d2.jarjestys_opintoala2002 AS jarj_opintoala
,d2.jarjestys_koulutusala2002
,d2.jarjestys_opintoala1995
,d2.jarjestys_koulutusaste2002
,d3.jarjestys AS jarj_koullaji
,d4.jarjestys AS jarj_maassaolo
,d5.jarjestys AS jarj_hallinnonala
,d6.jarjestys AS jarj_opetuskieli
,d7.tutkinnon_toteuma_koodi
,d7.jarjestys AS jarj_kokotutkinto
,d8.jarjestys_maakunta
,d8.jarjestys_ely
,d8.jarjestys_avi
,d8b.jarjestys as jarj_kunta
,d8b.jarjestys_maakunta as jarj_asmaak
,d8b.jarjestys_ely as jarj_ely
,d8b.jarjestys_avi as jarj_avi
,d8c.jarjestys as jarj_askuntasamaeri
,d8d.jarjestys as jarj_edvuodenasuinpaikka
,d9.jarjestys AS jarj_sukupuoli
,d10.jarjestys as jarj_hetuok
,d11.jarjestys_ika5v
,d13.jarjestys AS jarj_kirjsyys
,d16.jarjestys AS jarj_maa
,d16.jarjestys_maanosa
,d16.jarjestys_etamaa
,d16.jarjestys_eumaa
,d18.jarjestys AS jarj_syntvaltio
,d18.jarjestys_maanosa AS jarj_syntmaanosa
,d18b.jarjestys AS jarj_syntvaltioai
,d18b.jarjestys_maanosa AS jarj_syntmaanosaai
,d18c.jarjestys AS jarj_syntvaltiois
,d18c.jarjestys_maanosa AS jarj_syntmaanosais
,d19.jarjestys AS jarj_maahantulotoinenaste
,d20.jarjestys AS jarj_maahantulokorkeak
,d21.jarjestys AS jarj_aidinkieli
,d21b.jarjestys AS jarj_aidinkieli2
,d21c.jarjestys AS jarj_aidinkieli4
,d22.jarjestys AS jarj_koulsektori
,d2.koulutusaste2002_koodi
,jarjestys_suoritusaika =
CASE
WHEN suoritusaika = ''Tuntematon'' or suoritusaika IS NULL THEN 999
ELSE cast(suoritusaika AS int)
END
FROM vipunentk.dbo.f_K2_17_ulkomaalaistaustaiset_opisk_ja_tutk
JOIN d_aineisto d1 on d1.id = [aineisto_id]
JOIN d_koulutusluokitus d2 on d2.id = [koulutusluokitus_id]
JOIN d_koulutusryhma d3 on d3.id = [koulutusryhma_id]
JOIN d_maassaolo d4 on d4.id = [maassaolo_id]
JOIN d_opetushallinnon_koulutus d5 on d5.id = [opetushallinnon_koulutus_id]
JOIN d_kieli d6 on d6.id = [koulutuksen_opetuskieli_id]
JOIN d_tutkinnon_toteuma d7 on d7.id = [tutkinnon_toteuma_id]
JOIN d_alueluokitus d8 on d8.id = [koulutuksen_sijaintikunta_id]
JOIN d_alueluokitus d8b on d8b.id = [kotikunta_id]
JOIN d_asuinkunta_sama_vai_eri_kuin_aiemmin d8c on d8c.id = [asuinkunta_sama_vai_eri_kuin_aiemmin_id]
JOIN d_edeltavan_vuoden_asuinpaikka d8d on d8d.id = [edeltavan_vuoden_asuinpaikka_id]
JOIN d_sukupuoli d9 on d9.id = [sukupuoli_id]
JOIN d_hetu_ok d10 on d10.id = [henkilotunnuksen_oikeellisuus_id]
JOIN d_ika d11 on d11.id = [ika_id]
JOIN d_opiskelijan_olo d13 on d13.id = [opiskelijan_olo_id]
JOIN d_valtio d16 on d16.id = [kansalaisuus_id]
JOIN d_valtio d18 on d18.id = [syntymamaa_id]
JOIN d_valtio d18b on d18b.id = [aidin_syntymamaa_id]
JOIN d_valtio d18c on d18c.id = [isan_syntymamaa_id]
JOIN d_maahantulo_ja_opiskelun_aloittaminen d19 on d19.id = [maahantulo_ja_toisen_asteen_koul_aloittaminen_id]
JOIN d_maahantulo_ja_opiskelun_aloittaminen d20 on d20.id = [maahantulo_ja_korkeakoulutuksen_aloittaminen_id]
JOIN d_aidinkieli_versio1 d21 on d21.id = [aidinkieli_versio1_id]
JOIN d_aidinkieli_versio2 d21b on d21b.id = [aidinkieli_versio2_id]
JOIN d_kieli d21c on d21c.id = [aidinkieli_versio4_id]
JOIN d_koulutussektori d22 on d22.id = [koulutussektori_id]
WHERE d1.aineisto_koodi = ''L'' AND [tilastovuosi] <> ''2009''
'
GO
USE [ANTERO]
|
use CouriersDB
go
create or alter proc udp_AddOrder
@OrderDate Date,
@ReceiveDate Date,
@Total money,
@AddressID int,
@TypeID int,
@DispatcherID int,
@ClientID int,
@CourierID int,
@RecipientID int
as begin
if not exists(
select * from Addresses
where ID = @AddressID
) begin
print 'Invalid Address ID!'
return
end
if not exists(
select * from TypesOfService
where ID = @TypeID
) begin
print 'Invalid Type ID!'
return
end
if not exists(
select * from Dispatchers
where ID = @DispatcherID
) begin
print 'Invalid Dispatcher ID!'
return
end
if not exists(
select * from Clients
where ID = @ClientID
) begin
print 'Invalid Client ID!'
return
end
if not exists(
select * from Couriers
where ID = @CourierID
) begin
print 'Invalid Courier ID!'
return
end
if not exists(
select * from Recipients
where ID = @RecipientID
) begin
print 'Invalid Recipient ID!'
return
end
if exists(
select * from Orders
where OrderDate = @OrderDate
and ReceiveDate = @ReceiveDate
and Total = @Total
and AddressID = @AddressID
and TypeID = @TypeID
and DispatcherID = @DispatcherID
and ClientID = @ClientID
and CourierID = @CourierID
and RecipientID = @RecipientID
) begin
print 'This order is already in the database!'
return
end
insert into Orders values (
@OrderDate,
@ReceiveDate,
@Total,
@AddressID,
@TypeID,
@DispatcherID,
@ClientID,
@CourierID,
@RecipientID);
declare @id int = (
select top 1 ID from Orders
where OrderDate = @OrderDate
and ReceiveDate = @ReceiveDate
and Total = @Total
and AddressID = @AddressID
and TypeID = @TypeID
and DispatcherID = @DispatcherID
and ClientID = @ClientID
and CourierID = @CourierID
and RecipientID = @RecipientID)
print 'Order added with ID: ' + cast(@id as nvarchar(50))
end
go
use master
go
/* Example
-- Add an order to the database
exec udp_AddOrder '01-25-2022', '01-30-2022', 5000, 5, 2, 4, 1, 2, 3
*/
|
<reponame>mkipnis/DistributedATS
USE distributed_ats;
DROP TABLE IF EXISTS `instrument`;
CREATE TABLE `instrument` (
`instrument_id` int(11) NOT NULL AUTO_INCREMENT,
`instrument_type_id` int(11) NOT NULL,
`symbol` char(30) NOT NULL,
PRIMARY KEY (`instrument_id`),
UNIQUE KEY `symbol_UNIQUE` (`symbol`),
KEY `instrument_group_id_fk_idx` (`instrument_type_id`),
CONSTRAINT `instrument_type_fk` FOREIGN KEY (`instrument_type_id`) REFERENCES `instrument_type` (`instrument_type_id`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
delimiter /
TRUNCATE TABLE KRNS_CMP_TYP_T
/
INSERT INTO KRNS_CMP_TYP_T (ACTV_IND,CAMPUS_TYP_CD,CMP_TYP_NM,DOBJ_MAINT_CD_ACTV_IND,OBJ_ID,VER_NBR)
VALUES ('Y','B','BOTH','Y','1EFD72846DC90024E043814FD8810024',1)
/
INSERT INTO KRNS_CMP_TYP_T (ACTV_IND,CAMPUS_TYP_CD,CMP_TYP_NM,DOBJ_MAINT_CD_ACTV_IND,OBJ_ID,VER_NBR)
VALUES ('Y','F','FISCAL','Y','1EFD72846DCA0024E043814FD8810024',1)
/
INSERT INTO KRNS_CMP_TYP_T (ACTV_IND,CAMPUS_TYP_CD,CMP_TYP_NM,DOBJ_MAINT_CD_ACTV_IND,OBJ_ID,VER_NBR)
VALUES ('Y','P','PHYSICAL','Y','1EFD72846DCB0024E043814FD8810024',1)
/
delimiter ;
|
CREATE DATABASE helios;
CREATE USER helios ENCRYPTED PASSWORD '<PASSWORD>';
|
create table Book(
id identity,
title varchar(128) not null,
author varchar(128) not null
);
|
<reponame>PureStorage-OpenConnect/Jenkins-Fa-Snapshot-Ci-Pipeline-Adv<gh_stars>0
CREATE PROCEDURE [tSQLt].[RenameClass]
@SchemaName NVARCHAR(MAX),
@NewSchemaName NVARCHAR(MAX)
AS
BEGIN
DECLARE @MigrateObjectsCommand NVARCHAR(MAX);
SELECT @NewSchemaName = PARSENAME(@NewSchemaName, 1),
@SchemaName = PARSENAME(@SchemaName, 1);
EXEC tSQLt.NewTestClass @NewSchemaName;
SELECT @MigrateObjectsCommand = (
SELECT Cmd AS [text()] FROM (
SELECT 'ALTER SCHEMA ' + QUOTENAME(@NewSchemaName) + ' TRANSFER ' + QUOTENAME(@SchemaName) + '.' + QUOTENAME(name) + ';' AS Cmd
FROM sys.objects
WHERE schema_id = SCHEMA_ID(@SchemaName)
AND type NOT IN ('PK', 'F')
UNION ALL
SELECT 'ALTER SCHEMA ' + QUOTENAME(@NewSchemaName) + ' TRANSFER XML SCHEMA COLLECTION::' + QUOTENAME(@SchemaName) + '.' + QUOTENAME(name) + ';' AS Cmd
FROM sys.xml_schema_collections
WHERE schema_id = SCHEMA_ID(@SchemaName)
UNION ALL
SELECT 'ALTER SCHEMA ' + QUOTENAME(@NewSchemaName) + ' TRANSFER TYPE::' + QUOTENAME(@SchemaName) + '.' + QUOTENAME(name) + ';' AS Cmd
FROM sys.types
WHERE schema_id = SCHEMA_ID(@SchemaName)
) AS Cmds
FOR XML PATH(''), TYPE).value('.', 'NVARCHAR(MAX)');
EXEC (@MigrateObjectsCommand);
EXEC tSQLt.DropClass @SchemaName;
END;
|
<filename>macros/schema_tests/fewer_rows_than.sql
{% test fewer_rows_than(model, compare_model) %}
{{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model)) }}
{% endtest %}
{% macro default__test_fewer_rows_than(model, compare_model) %}
{{ config(fail_calc = 'coalesce(row_count_delta, 0)') }}
with a as (
select count(*) as count_our_model from {{ model }}
),
b as (
select count(*) as count_comparison_model from {{ compare_model }}
),
counts as (
select
count_our_model,
count_comparison_model
from a
cross join b
),
final as (
select *,
case
-- fail the test if we have more rows than the reference model and return the row count delta
when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)
-- fail the test if they are the same number
when count_our_model = count_comparison_model then 1
-- pass the test if the delta is positive (i.e. return the number 0)
else 0
end as row_count_delta
from counts
)
select * from final
{% endmacro %}
|
<gh_stars>1-10
create table produtos (
id integer not null AUTO_INCREMENT PRIMARY KEY,
nome varchar(100) not null,
valor decimal(10,2) not null,
marca varchar(100) not null,
quantidade integer not null
);
CREATE TABLE `pessoas` (
`id` int(11) PRIMARY KEY NOT NULL AUTO_INCREMENT,
`nome` varchar(100) NOT NULL,
`senha` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
<reponame>Neovision-xin/dev
ALTER TABLE QRTZ_TRIGGERS ADD COLUMN REQUIRED_CAP VARCHAR(200) NULL;
|
WITH q_locks AS (
select
*
from
pg_locks
where
pid != pg_backend_pid()
and database = (select oid from pg_database where datname = current_database())
)
select /* pgwatch2_generated */
(extract(epoch from now()) * 1e9)::int8 as epoch_ns,
lockmodes AS tag_lockmode,
coalesce((select count(*) FROM q_locks WHERE mode = lockmodes), 0) AS count
FROM
unnest('{AccessShareLock, ExclusiveLock, RowShareLock, RowExclusiveLock, ShareLock, ShareRowExclusiveLock, AccessExclusiveLock, ShareUpdateExclusiveLock}'::text[]) lockmodes;
|
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [User.Session].[Bot](
[UserAgent] [varchar](500) NOT NULL,
PRIMARY KEY CLUSTERED
(
[UserAgent] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
|
<reponame>Indexical-Metrics-Measure-Advisory/watchmen
CREATE OR REPLACE FUNCTION WATCHMEN_MIGRATION_REDRESS_CONSTANT_FUNCTIONS(a_json CLOB) RETURN STRING IS
func_body VARCHAR2(200) DEFAULT '\s*\(\s*(\w+)\s*,\s*(\w+)\s*\)';
first_not_date VARCHAR2(200) DEFAULT '\(([^\)0-9])([^\)]+),([^\)]+)\)';
second_not_date VARCHAR2(200) DEFAULT '\(([^\)]+),([^\)0-9])([^\)]+)\)';
data CLOB DEFAULT NULL;
BEGIN
IF a_json IS NULL THEN
RETURN a_json;
END IF;
data := REPLACE(a_json, '{snowflake}', '{&nextSeq}');
data := REGEXP_REPLACE(data, concat('yearDiff', func_body), 'yearDiff(\2,\1)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('yearDiff', first_not_date), 'yearDiff(&\1\2,\3)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('yearDiff', second_not_date), 'yearDiff(\1,&\2\3)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('monthDiff', func_body), 'monthDiff(\2,\1)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('monthDiff', first_not_date), 'monthDiff(&\1\2,\3)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('monthDiff', second_not_date), 'monthDiff(\1,&\2\3)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('dayDiff', func_body), 'dayDiff(\2,\1)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('dayDiff', first_not_date), 'dayDiff(&\1\2,\3)', 1, 0, 'm');
data := REGEXP_REPLACE(data, concat('dayDiff', second_not_date), 'dayDiff(\1,&\2\3)', 1, 0, 'm');
return data;
END;
UPDATE spaces SET filters = WATCHMEN_MIGRATION_REDRESS_CONSTANT_FUNCTIONS(filters) where filters IS NOT NULL;
UPDATE subjects SET dataset = WATCHMEN_MIGRATION_REDRESS_CONSTANT_FUNCTIONS(dataset) where dataset IS NOT NULL;
UPDATE reports SET filters = WATCHMEN_MIGRATION_REDRESS_CONSTANT_FUNCTIONS(filters) where filters IS NOT NULL;
UPDATE pipelines SET stages = WATCHMEN_MIGRATION_REDRESS_CONSTANT_FUNCTIONS(stages) where stages IS NOT NULL;
-- noinspection SqlResolve @ column/"prerequisite_on"
UPDATE pipelines SET prerequisite_on = WATCHMEN_MIGRATION_REDRESS_CONSTANT_FUNCTIONS(prerequisite_on) where prerequisite_on IS NOT NULL;
DROP FUNCTION WATCHMEN_MIGRATION_REDRESS_CONSTANT_FUNCTIONS;
|
<gh_stars>0
CREATE TABLE [setup].[service_server_database]
(
/*==========================================================================
= connection table between service / server / database
==========================================================================*/
[service_id] INT NOT NULL,
[server_id] INT NOT NULL,
[datebase_id] INT NOT NULL,
CONSTRAINT [PK_service_server_database] PRIMARY KEY ([service_id], [server_id], [datebase_id])
)
|
<reponame>Soteded/TPs-Admin-BDD
CREATE USER 'exporter'@'%' IDENTIFIED BY 'password' WITH MAX_USER_CONNECTIONS 3;
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO 'exporter'@'%';
CREATE USER 'grafana'@'%' IDENTIFIED BY 'grafana';
GRANT SELECT ON TP1_AT.* TO 'grafana'@'%';
GRANT SELECT ON sylius_address.* TO 'grafana'@'%';
GRANT SELECT ON mysql.* TO 'grafana'@'%';
|
<gh_stars>0
-- AlterTable
ALTER TABLE "products" ADD COLUMN "image_url" VARCHAR;
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 03, 2021 at 06:13 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.8
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: `errand_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `projects`
--
CREATE TABLE `projects` (
`Id` int(11) NOT NULL,
`ProjectUserId` int(11) NOT NULL,
`ProjectName` varchar(256) NOT NULL,
`ProjectBody` text NOT NULL,
`DateCreated` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `projects`
--
INSERT INTO `projects` (`Id`, `ProjectUserId`, `ProjectName`, `ProjectBody`, `DateCreated`) VALUES
(1, 1, 'PHP OOP Courses', 'I need to buy all these courses.', '2021-08-18 05:52:41'),
(3, 1, 'Python', 'The Python is mostly use in AI now a days.', '2021-08-19 03:52:31');
-- --------------------------------------------------------
--
-- Table structure for table `tasks`
--
CREATE TABLE `tasks` (
`Id` int(11) NOT NULL,
`ProjectId` int(11) NOT NULL,
`TaskName` varchar(256) NOT NULL,
`TaskBody` text NOT NULL,
`DueDate` date NOT NULL,
`DateCreated` timestamp NOT NULL DEFAULT current_timestamp(),
`Status` tinyint(1) NOT NULL DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tasks`
--
INSERT INTO `tasks` (`Id`, `ProjectId`, `TaskName`, `TaskBody`, `DueDate`, `DateCreated`, `Status`) VALUES
(1, 1, 'OOP PHP', 'I need to finish this course from <NAME>.', '2021-08-26', '2021-08-18 05:53:32', 0),
(6, 1, 'This is my new task PHP', 'PHP Description.', '2021-08-25', '2021-08-19 03:47:28', 0),
(7, 1, 'Another PHP Task', 'Yesses., there is another task in a pipeline.', '2021-08-29', '2021-08-19 03:48:04', 1),
(10, 3, 'This is my new task By Python', 'Learn python from zero to hero', '2021-08-29', '2021-08-19 12:03:11', 0),
(11, 1, 'This is my new task 321 PHP', 'This is my new task 321 PHP Description', '2021-09-30', '2021-08-19 16:11:23', 0);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`Id` int(11) NOT NULL,
`FirstName` varchar(256) NOT NULL,
`LastName` varchar(256) NOT NULL,
`Email` varchar(256) NOT NULL,
`UserName` varchar(256) NOT NULL,
`Password` varchar(256) NOT NULL,
`RagisterDate` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`Id`, `FirstName`, `LastName`, `Email`, `UserName`, `Password`, `RagisterDate`) VALUES
(1, 'Atishkumar', 'Jaiwal', '<EMAIL>', '<PASSWORD>', '$<PASSWORD>', '2021-08-10 05:57:49');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `projects`
--
ALTER TABLE `projects`
ADD PRIMARY KEY (`Id`);
--
-- Indexes for table `tasks`
--
ALTER TABLE `tasks`
ADD PRIMARY KEY (`Id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`Id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `projects`
--
ALTER TABLE `projects`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `tasks`
--
ALTER TABLE `tasks`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
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 */;
|
<filename>kpi_exec.sql
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.5.52-MariaDB - MariaDB Server
-- Server OS: Linux
-- HeidiSQL Version: 9.5.0.5278
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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' */;
-- Dumping database structure for cbis_kpi
CREATE DATABASE IF NOT EXISTS `cbis_kpi` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
USE `cbis_kpi`;
-- Dumping structure for view cbis_kpi.ceph_map
-- Creating temporary table to overcome VIEW dependency errors
CREATE TABLE `ceph_map` (
`cbis_pod_id` BIGINT(20) UNSIGNED NOT NULL,
`hostname` VARCHAR(128) NOT NULL COLLATE 'utf8_bin',
`disk` VARCHAR(128) NOT NULL COLLATE 'utf8_bin',
`journal` VARCHAR(128) NOT NULL COLLATE 'utf8_bin',
`numosd` VARCHAR(128) NOT NULL COLLATE 'utf8_bin'
) ENGINE=MyISAM;
-- Dumping structure for procedure cbis_kpi.do_virsh_aggregate
DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `do_virsh_aggregate`(
IN `iDate` VARCHAR(50)
)
BEGIN
SET @reqdate = str_to_date(iDate,'%Y%m%d');
SET @enddate = unix_timestamp(DATE_ADD(@reqdate, INTERVAL 1 DAY));
SET @startdate = unix_timestamp(@reqdate);
DROP TABLE IF EXISTS virshraw;
CREATE TEMPORARY TABLE virshraw AS (
select
cbis_pod_id,
sdate,
stime,
sminute,
domain_name,
case
when item_key = 'net.rx[bytes]' then 'net.rx[Bps]'
when item_key = 'net.tx[bytes]' then 'net.tx[Bps]'
when item_key = 'storage.read[bytes]' then 'storage.read[Bps]'
when item_key = 'storage.write[bytes]' then 'storage.write[Bps]'
else item_key
end as item_key,
case
when item_key = 'vcpu[used]' then IFNULL(((sum(item_value) / (sum(clock_delta) * 1000000000)) * 100),0)
when item_key = 'vcpu[wait]' then IFNULL(((sum(item_value) / (sum(clock_delta) * 1000000000)) * 100),0)
when item_key = 'net.tx[bytes]' then IFNULL((sum(item_value) / sum(clock_delta)),0)
when item_key = 'net.rx[bytes]' then IFNULL((sum(item_value) / sum(clock_delta)),0)
when item_key = 'storage.read[bytes]' then IFNULL(((sum(item_value) / sum(clock_delta))),0)
when item_key = 'storage.write[bytes]' then IFNULL(((sum(item_value) / sum(clock_delta))),0)
when item_key = 'storage.read[busy]' then IFNULL(((sum(item_value) / (sum(clock_delta) * 1000000000)) * 100),0)
when item_key = 'storage.write[busy]' then IFNULL(((sum(item_value) / (sum(clock_delta) * 1000000000)) * 100),0)
else item_value
end as val
from
(
select
b.cbis_pod_id,
date_format(from_unixtime(floor(b.clock)),'%Y%m%d') as sdate,
date_format(from_unixtime(floor(b.clock)),'%H') as stime,
date_format(from_unixtime(floor(b.clock)),'%i') as sminute,
from_unixtime(floor(b.clock)) as clock,
b.domain_name,
case
WHEN b.item_key like 'vcpu.%.time' THEN 'vcpu[used]'
WHEN b.item_key like 'vcpu.%.wait' THEN 'vcpu[wait]'
WHEN b.item_key like 'net.%.tx.bytes' THEN 'net.tx[bytes]'
WHEN b.item_key like 'net.%.tx.drop' THEN 'net.tx[drop]'
WHEN b.item_key like 'net.%.tx.errs' THEN 'net.tx[error]'
WHEN b.item_key like 'net.%.tx.pkts' THEN 'net.tx[packet]'
WHEN b.item_key like 'net.%.rx.bytes' THEN 'net.rx[bytes]'
WHEN b.item_key like 'net.%.rx.drop' THEN 'net.rx[drop]'
WHEN b.item_key like 'net.%.rx.errs' THEN 'net.rx[error]'
WHEN b.item_key like 'net.%.rx.pkts' THEN 'net.rx[packet]'
WHEN b.item_key like 'block.%.rd.bytes' THEN 'storage.read[bytes]'
WHEN b.item_key like 'block.%.rd.times' THEN 'storage.read[busy]'
WHEN b.item_key like 'block.%.wr.bytes' THEN 'storage.write[bytes]'
WHEN b.item_key like 'block.%.wr.times' THEN 'storage.write[busy]'
ELSE b.item_key
END AS item_key,
case
WHEN b.item_key like 'vcpu%' THEN cast( if(b.item_delta > (b.clock_delta * 1000000000),b.clock_delta * 1000000000,b.item_delta) as decimal(20,3))
WHEN b.item_key like 'net%' THEN cast(b.item_delta as decimal(20,3))
WHEN b.item_key like 'block.%.times' THEN cast(b.item_delta as decimal(20,3))
ELSE IFNULL(cast(b.item_value as decimal(20,3)),0)
END AS item_value,
b.clock_delta
from cbis_virsh_stat_raw b
where b.clock between @startdate and @enddate
and (
item_key like 'vcpu.%.time'
or item_key like 'vcpu.%.wait'
or item_key like 'net.%.bytes'
or item_key like 'net.%.drop'
or item_key like 'net.%.errs'
or item_key like 'net.%.pkts'
or item_key like 'block.%.bytes'
or item_key like 'block.%.times'
or item_key like 'vcpu.maximum'
or item_key like 'balloon.current'
or item_key like 'net.count'
or item_key like 'memory.%'
)
) a
group by a.cbis_pod_id, a.clock, a.domain_name, a.item_key );
delete from virsh_raw_hourly where sdate = @reqdate;
insert into virsh_raw_hourly
(select
a.cbis_pod_name,
b.sdate,
b.stime,
c.hostname,
c.vm_name,
b.domain_name,
c.vm_numa,
c.project_name,
'avg' as 'metrictype',
cast(avg(case when b.item_key = 'vcpu[used]' then val end) as decimal(6,2)) as 'vcpu[used]',
cast(avg(case when b.item_key = 'vcpu[wait]' then val end) as decimal(6,2)) as 'vcpu[wait]',
cast(max(case WHEN b.item_key = 'vcpu.maximum' then val end) as int) as 'vcpu.maximum',
cast(avg(case WHEN b.item_key = 'balloon.current' then val end) / (1024 * 1024) as int) as 'memory.allocated',
cast(avg(case WHEN b.item_key = 'memory.available' then val end) / (1024 * 1024) as int) as 'memory.available',
cast(avg(case WHEN b.item_key = 'memory.unused' then val end) / (1024 * 1024) as int) as 'memory.unused',
cast(avg(case WHEN b.item_key = 'memory.swap_out' then val end) / (1024 * 1024) as int) as 'memory.swap_out',
cast(max(case WHEN b.item_key = 'net.count' then val end) as int) as 'net.count',
avg(case WHEN b.item_key = 'net.tx[Bps]' then val end) as 'net.tx[Bps]',
cast(avg(case WHEN b.item_key = 'net.tx[drop]' then val end) as int) as 'net.tx[drop]',
cast(avg(case WHEN b.item_key = 'net.tx[error]' then val end) as int) as 'net.tx[error]',
cast(avg(case WHEN b.item_key = 'net.tx[packet]' then val end) as int) as 'net.tx[packet]',
avg(case WHEN b.item_key = 'net.rx[Bps]' then val end) as 'net.rx[Bps]',
cast(avg(case WHEN b.item_key = 'net.rx[drop]' then val end) as int) as 'net.rx[drop]',
cast(avg(case WHEN b.item_key = 'net.rx[error]' then val end) as int) as 'net.rx[error]',
cast(avg(case WHEN b.item_key = 'net.rx[packet]' then val end) as int) as 'net.rx[packet]',
cast((avg(case WHEN b.item_key = 'storage.read[Bps]' then val end) / (1024 * 1024 )) as decimal (10,2)) as 'storage.read[MBs]',
cast((avg(case WHEN b.item_key = 'storage.write[Bps]' then val end) / (1024 * 1024 )) as decimal (10,2)) as 'storage.write[MBs]',
cast(avg(case WHEN b.item_key = 'storage.read[busy]' then val end) as decimal(6,2)) as 'storage.read[busy]',
cast(avg(case WHEN b.item_key = 'storage.write[busy]' then val end) as decimal(6,2)) as 'storage.write[busy]'
from virshraw b
left join cbis_pod a on a.cbis_pod_id = b.cbis_pod_id
left join cbis_virsh_list c on b.domain_name = c.domain_name
group by b.cbis_pod_id, b.sdate, b.stime, b.domain_name
);
insert into virsh_raw_hourly
(select
a.cbis_pod_name,
b.sdate,
b.stime,
c.hostname,
c.vm_name,
b.domain_name,
c.vm_numa,
c.project_name,
'max' as 'metrictype',
cast(max(case when b.item_key = 'vcpu[used]' then val end) as decimal(6,2)) as 'vcpu[used]',
cast(max(case when b.item_key = 'vcpu[wait]' then val end) as decimal(6,2)) as 'vcpu[wait]',
cast(max(case WHEN b.item_key = 'vcpu.maximum' then val end) as int) as 'vcpu.maximum',
cast(max(case WHEN b.item_key = 'balloon.current' then val end) / (1024 * 1024) as int) as 'memory.allocated',
cast(max(case WHEN b.item_key = 'memory.available' then val end) / (1024 * 1024) as int) as 'memory.available',
cast(max(case WHEN b.item_key = 'memory.unused' then val end) / (1024 * 1024) as int) as 'memory.unused',
cast(max(case WHEN b.item_key = 'memory.swap_out' then val end) / (1024 * 1024) as int) as 'memory.swap_out',
cast(max(case WHEN b.item_key = 'net.count' then val end) as int) as 'net.count',
max(case WHEN b.item_key = 'net.tx[Bps]' then val end) as 'net.tx[Bps]',
cast(max(case WHEN b.item_key = 'net.tx[drop]' then val end) as int) as 'net.tx[drop]',
cast(max(case WHEN b.item_key = 'net.tx[error]' then val end) as int) as 'net.tx[error]',
cast(max(case WHEN b.item_key = 'net.tx[packet]' then val end) as int) as 'net.tx[packet]',
max(case WHEN b.item_key = 'net.rx[Bps]' then val end) as 'net.rx[Bps]',
cast(max(case WHEN b.item_key = 'net.rx[drop]' then val end) as int) as 'net.rx[drop]',
cast(max(case WHEN b.item_key = 'net.rx[error]' then val end) as int) as 'net.rx[error]',
cast(max(case WHEN b.item_key = 'net.rx[packet]' then val end) as int) as 'net.rx[packet]',
cast((max(case WHEN b.item_key = 'storage.read[Bps]' then val end) / (1024 * 1024 )) as decimal (10,2)) as 'storage.read[MBs]',
cast((max(case WHEN b.item_key = 'storage.write[Bps]' then val end) / (1024 * 1024 )) as decimal (10,2)) as 'storage.write[MBs]',
cast(avg(case WHEN b.item_key = 'storage.read[busy]' then val end) as decimal(6,2)) as 'storage.read[busy]',
cast(max(case WHEN b.item_key = 'storage.write[busy]' then val end) as decimal(6,2)) as 'storage.write[busy]'
from virshraw b
left join cbis_pod a on a.cbis_pod_id = b.cbis_pod_id
left join cbis_virsh_list c on b.domain_name = c.domain_name
group by b.cbis_pod_id, b.sdate, b.stime, b.domain_name
);
END//
DELIMITER ;
-- Dumping structure for procedure cbis_kpi.do_zabbix_aggregate
DELIMITER //
CREATE DEFINER=`root`@`localhost` PROCEDURE `do_zabbix_aggregate`(
IN `iDate` VARCHAR(50)
)
BEGIN
SET @reqdate = str_to_date(iDate,'%Y%m%d');
SET @enddate = unix_timestamp(DATE_ADD(@reqdate, INTERVAL 1 DAY));
SET @startdate = unix_timestamp(@reqdate);
DROP TABLE IF EXISTS zabbixhour;
CREATE TEMPORARY TABLE zabbixhour AS (
select
date_format(DATE_ADD(from_unixtime(floor(clock)), INTERVAL 1 HOUR),'%Y%m%d') as sDate,
date_format(DATE_ADD(from_unixtime(floor(clock)), INTERVAL 1 HOUR),'%H') as sTime,
a.hostname,
b.cbis_pod_name AS 'cbispod',
a.cbis_pod_id AS 'cbispodid',
SUBSTRING_INDEX(SUBSTRING_INDEX(a.hostname, '-', 2), '-', -1) AS 'nodetype',
REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(a.hostname, '-', 3), '-', -1),".localdomain","") AS 'nodenumber',
from_unixtime(floor(max(clock))) as 'time',
count(hostname) as data_available,
item_key,
cast(min(item_value) as decimal(20,2)) as min_value,
cast(max(item_value) as decimal(20,2)) as max_value,
cast(avg(item_value) as decimal(20,2)) as avg_value
from cbis_zabbix_raw a
left join cbis_pod b ON a.cbis_pod_id = b.cbis_pod_id
where (clock between @startdate and @enddate)
group by b.cbis_pod_name, a.hostname, sDate, sTime, a.item_key
);
delete from zabbixhour where time >= from_unixtime(floor(@enddate));
delete from rep_platform_hourly where time between from_unixtime(floor(@startdate)) and DATE_ADD(@reqdate, INTERVAL 1 DAY);
insert into rep_platform_hourly
(
select
sDate,
sTime,
'avg' as 'metrictype',
a.hostname,
cbispod,
SUBSTRING_INDEX(SUBSTRING_INDEX(a.hostname, '-', 2), '-', -1) AS 'nodetype',
REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(a.hostname, '-', 3), '-', -1),".localdomain","") AS 'nodenumber',
time,
avg(case when item_key = 'system.cpu.util[,user]' then avg_value end) as 'system.cpu.util[,user]',
avg(case when item_key = 'system.cpu.util[,system]' then avg_value end) as 'system.cpu.util[,system]',
avg(case when item_key = 'system.cpu.util[,nice]' then avg_value end) as 'system.cpu.util[,nice]',
avg(case when item_key = 'system.cpu.util[,iowait]' then avg_value end) as 'system.cpu.util[,iowait]',
avg(case when item_key = 'system.cpu.util[,softirq]' then avg_value end) as 'system.cpu.util[,softirq]',
avg(case when item_key = 'vm.memory.size[total]' then avg_value end) as 'vm.memory.size[total]',
avg(case when item_key = 'vm.memory.size[available]' then avg_value end) as 'vm.memory.size[available]',
avg(case when item_key = 'net.if.in[en0]' then avg_value end) as 'net.if.in[en0]',
avg(case when item_key = 'net.if.out[en0]' then avg_value end) as 'net.if.out[en0]',
avg(case when item_key = 'net.if.in[en0,errors]' then avg_value end) as 'net.if.in[en0,errors]',
avg(case when item_key = 'net.if.out[en0,errors]' then avg_value end) as 'net.if.out[en0,errors]',
avg(case when item_key = 'net.if.in[en0,dropped]' then avg_value end) as 'net.if.in[en0,dropped]',
avg(case when item_key = 'net.if.out[en0,dropped]' then avg_value end) as 'net.if.out[en0,dropped]',
avg(case when item_key = 'net.if.in[ens3f0]' then avg_value end) as 'net.if.in[ens3f0]',
avg(case when item_key = 'net.if.out[ens3f0]' then avg_value end) as 'net.if.out[ens3f0]',
avg(case when item_key = 'net.if.in[ens3f0,errors]' then avg_value end) as 'net.if.in[ens3f0,errors]',
avg(case when item_key = 'net.if.out[ens3f0,errors]' then avg_value end) as 'net.if.out[ens3f0,errors]',
avg(case when item_key = 'net.if.in[ens3f0,dropped]' then avg_value end) as 'net.if.in[ens3f0,dropped]',
avg(case when item_key = 'net.if.out[ens3f0,dropped]' then avg_value end) as 'net.if.out[ens3f0,dropped]',
avg(case when item_key = 'net.if.in[ens3f1]' then avg_value end) as 'net.if.in[ens3f1]',
avg(case when item_key = 'net.if.out[ens3f1]' then avg_value end) as 'net.if.out[ens3f1]',
avg(case when item_key = 'net.if.in[ens3f1,errors]' then avg_value end) as 'net.if.in[ens3f1,errors]',
avg(case when item_key = 'net.if.out[ens3f1,errors]' then avg_value end) as 'net.if.out[ens3f1,errors]',
avg(case when item_key = 'net.if.in[ens3f1,dropped]' then avg_value end) as 'net.if.in[ens3f1,dropped]',
avg(case when item_key = 'net.if.out[ens3f1,dropped]' then avg_value end) as 'net.if.out[ens3f1,dropped]',
avg(case when item_key = 'net.if.in[ens6f0]' then avg_value end) as 'net.if.in[ens6f0]',
avg(case when item_key = 'net.if.out[ens6f0]' then avg_value end) as 'net.if.out[ens6f0]',
avg(case when item_key = 'net.if.in[ens6f0,errors]' then avg_value end) as 'net.if.in[ens6f0,errors]',
avg(case when item_key = 'net.if.out[ens6f0,errors]' then avg_value end) as 'net.if.out[ens6f0,errors]',
avg(case when item_key = 'net.if.in[ens6f0,dropped]' then avg_value end) as 'net.if.in[ens6f0,dropped]',
avg(case when item_key = 'net.if.out[ens6f0,dropped]' then avg_value end) as 'net.if.out[ens6f0,dropped]',
avg(case when item_key = 'net.if.in[ens6f1]' then avg_value end) as 'net.if.in[ens6f1]',
avg(case when item_key = 'net.if.out[ens6f1]' then avg_value end) as 'net.if.out[ens6f1]',
avg(case when item_key = 'net.if.in[ens6f1,errors]' then avg_value end) as 'net.if.in[ens6f1,errors]',
avg(case when item_key = 'net.if.out[ens6f1,errors]' then avg_value end) as 'net.if.out[ens6f1,errors]',
avg(case when item_key = 'net.if.in[ens6f1,dropped]' then avg_value end) as 'net.if.in[ens6f1,dropped]',
avg(case when item_key = 'net.if.out[ens6f1,dropped]' then avg_value end) as 'net.if.out[ens6f1,dropped]',
avg(case when item_key = 'net.if.in[vlan110]' then avg_value end) as 'net.if.in[vlan110]',
avg(case when item_key = 'net.if.out[vlan110]' then avg_value end) as 'net.if.out[vlan110]',
avg(case when item_key = 'net.if.in[vlan110,errors]' then avg_value end) as 'net.if.in[vlan110,errors]',
avg(case when item_key = 'net.if.out[vlan110,errors]' then avg_value end) as 'net.if.out[vlan110,errors]',
avg(case when item_key = 'net.if.in[vlan110,dropped]' then avg_value end) as 'net.if.in[vlan110,dropped]',
avg(case when item_key = 'net.if.out[vlan110,dropped]' then avg_value end) as 'net.if.out[vlan110,dropped]',
avg(case when item_key = 'net.if.in[vlan140]' then avg_value end) as 'net.if.in[vlan140]',
avg(case when item_key = 'net.if.out[vlan140]' then avg_value end) as 'net.if.out[vlan140]',
avg(case when item_key = 'net.if.in[vlan140,errors]' then avg_value end) as 'net.if.in[vlan140,errors]',
avg(case when item_key = 'net.if.out[vlan140,errors]' then avg_value end) as 'net.if.out[vlan140,errors]',
avg(case when item_key = 'net.if.in[vlan140,dropped]' then avg_value end) as 'net.if.in[vlan140,dropped]',
avg(case when item_key = 'net.if.out[vlan140,dropped]' then avg_value end) as 'net.if.out[vlan140,dropped]',
avg(case when item_key = 'net.if.in[vlan150]' then avg_value end) as 'net.if.in[vlan150]',
avg(case when item_key = 'net.if.out[vlan150]' then avg_value end) as 'net.if.out[vlan150]',
avg(case when item_key = 'net.if.in[vlan150,errors]' then avg_value end) as 'net.if.in[vlan150,errors]',
avg(case when item_key = 'net.if.out[vlan150,errors]' then avg_value end) as 'net.if.out[vlan150,errors]',
avg(case when item_key = 'net.if.in[vlan150,dropped]' then avg_value end) as 'net.if.in[vlan150,dropped]',
avg(case when item_key = 'net.if.out[vlan150,dropped]' then avg_value end) as 'net.if.out[vlan150,dropped]',
avg(case when item_key = 'net.if.in[vlan160]' then avg_value end) as 'net.if.in[vlan160]',
avg(case when item_key = 'net.if.out[vlan160]' then avg_value end) as 'net.if.out[vlan160]',
avg(case when item_key = 'net.if.in[vlan160,errors]' then avg_value end) as 'net.if.in[vlan160,errors]',
avg(case when item_key = 'net.if.out[vlan160,errors]' then avg_value end) as 'net.if.out[vlan160,errors]',
avg(case when item_key = 'net.if.in[vlan160,dropped]' then avg_value end) as 'net.if.in[vlan160,dropped]',
avg(case when item_key = 'net.if.out[vlan160,dropped]' then avg_value end) as 'net.if.out[vlan160,dropped]',
avg(case when item_key = 'net.if.in[vlan170]' then avg_value end) as 'net.if.in[vlan170]',
avg(case when item_key = 'net.if.out[vlan170]' then avg_value end) as 'net.if.out[vlan170]',
avg(case when item_key = 'net.if.in[vlan170,errors]' then avg_value end) as 'net.if.in[vlan170,errors]',
avg(case when item_key = 'net.if.out[vlan170,errors]' then avg_value end) as 'net.if.out[vlan170,errors]',
avg(case when item_key = 'net.if.in[vlan170,dropped]' then avg_value end) as 'net.if.in[vlan170,dropped]',
avg(case when item_key = 'net.if.out[vlan170,dropped]' then avg_value end) as 'net.if.out[vlan170,dropped]'
from zabbixhour a
# where sdate = @iDate
group by cbispod, hostname, sDate, sTime
);
insert into rep_platform_hourly
(
select
sDate,
sTime,
'max' as 'metrictype',
a.hostname,
cbispod,
SUBSTRING_INDEX(SUBSTRING_INDEX(a.hostname, '-', 2), '-', -1) AS 'nodetype',
REPLACE(SUBSTRING_INDEX(SUBSTRING_INDEX(a.hostname, '-', 3), '-', -1),".localdomain","") AS 'nodenumber',
time,
max(case when item_key = 'system.cpu.util[,user]' then max_value end) as 'system.cpu.util[,user]',
max(case when item_key = 'system.cpu.util[,system]' then max_value end) as 'system.cpu.util[,system]',
max(case when item_key = 'system.cpu.util[,nice]' then max_value end) as 'system.cpu.util[,nice]',
max(case when item_key = 'system.cpu.util[,iowait]' then max_value end) as 'system.cpu.util[,iowait]',
max(case when item_key = 'system.cpu.util[,softirq]' then max_value end) as 'system.cpu.util[,softirq]',
max(case when item_key = 'vm.memory.size[total]' then max_value end) as 'vm.memory.size[total]',
max(case when item_key = 'vm.memory.size[available]' then max_value end) as 'vm.memory.size[available]',
max(case when item_key = 'net.if.in[en0]' then max_value end) as 'net.if.in[en0]',
max(case when item_key = 'net.if.out[en0]' then max_value end) as 'net.if.out[en0]',
max(case when item_key = 'net.if.in[en0,errors]' then max_value end) as 'net.if.in[en0,errors]',
max(case when item_key = 'net.if.out[en0,errors]' then max_value end) as 'net.if.out[en0,errors]',
max(case when item_key = 'net.if.in[en0,dropped]' then max_value end) as 'net.if.in[en0,dropped]',
max(case when item_key = 'net.if.out[en0,dropped]' then max_value end) as 'net.if.out[en0,dropped]',
max(case when item_key = 'net.if.in[ens3f0]' then max_value end) as 'net.if.in[ens3f0]',
max(case when item_key = 'net.if.out[ens3f0]' then max_value end) as 'net.if.out[ens3f0]',
max(case when item_key = 'net.if.in[ens3f0,errors]' then max_value end) as 'net.if.in[ens3f0,errors]',
max(case when item_key = 'net.if.out[ens3f0,errors]' then max_value end) as 'net.if.out[ens3f0,errors]',
max(case when item_key = 'net.if.in[ens3f0,dropped]' then max_value end) as 'net.if.in[ens3f0,dropped]',
max(case when item_key = 'net.if.out[ens3f0,dropped]' then max_value end) as 'net.if.out[ens3f0,dropped]',
max(case when item_key = 'net.if.in[ens3f1]' then max_value end) as 'net.if.in[ens3f1]',
max(case when item_key = 'net.if.out[ens3f1]' then max_value end) as 'net.if.out[ens3f1]',
max(case when item_key = 'net.if.in[ens3f1,errors]' then max_value end) as 'net.if.in[ens3f1,errors]',
max(case when item_key = 'net.if.out[ens3f1,errors]' then max_value end) as 'net.if.out[ens3f1,errors]',
max(case when item_key = 'net.if.in[ens3f1,dropped]' then max_value end) as 'net.if.in[ens3f1,dropped]',
max(case when item_key = 'net.if.out[ens3f1,dropped]' then max_value end) as 'net.if.out[ens3f1,dropped]',
max(case when item_key = 'net.if.in[ens6f0]' then max_value end) as 'net.if.in[ens6f0]',
max(case when item_key = 'net.if.out[ens6f0]' then max_value end) as 'net.if.out[ens6f0]',
max(case when item_key = 'net.if.in[ens6f0,errors]' then max_value end) as 'net.if.in[ens6f0,errors]',
max(case when item_key = 'net.if.out[ens6f0,errors]' then max_value end) as 'net.if.out[ens6f0,errors]',
max(case when item_key = 'net.if.in[ens6f0,dropped]' then max_value end) as 'net.if.in[ens6f0,dropped]',
max(case when item_key = 'net.if.out[ens6f0,dropped]' then max_value end) as 'net.if.out[ens6f0,dropped]',
max(case when item_key = 'net.if.in[ens6f1]' then max_value end) as 'net.if.in[ens6f1]',
max(case when item_key = 'net.if.out[ens6f1]' then max_value end) as 'net.if.out[ens6f1]',
max(case when item_key = 'net.if.in[ens6f1,errors]' then max_value end) as 'net.if.in[ens6f1,errors]',
max(case when item_key = 'net.if.out[ens6f1,errors]' then max_value end) as 'net.if.out[ens6f1,errors]',
max(case when item_key = 'net.if.in[ens6f1,dropped]' then max_value end) as 'net.if.in[ens6f1,dropped]',
max(case when item_key = 'net.if.out[ens6f1,dropped]' then max_value end) as 'net.if.out[ens6f1,dropped]',
max(case when item_key = 'net.if.in[vlan110]' then max_value end) as 'net.if.in[vlan110]',
max(case when item_key = 'net.if.out[vlan110]' then max_value end) as 'net.if.out[vlan110]',
max(case when item_key = 'net.if.in[vlan110,errors]' then max_value end) as 'net.if.in[vlan110,errors]',
max(case when item_key = 'net.if.out[vlan110,errors]' then max_value end) as 'net.if.out[vlan110,errors]',
max(case when item_key = 'net.if.in[vlan110,dropped]' then max_value end) as 'net.if.in[vlan110,dropped]',
max(case when item_key = 'net.if.out[vlan110,dropped]' then max_value end) as 'net.if.out[vlan110,dropped]',
max(case when item_key = 'net.if.in[vlan140]' then max_value end) as 'net.if.in[vlan140]',
max(case when item_key = 'net.if.out[vlan140]' then max_value end) as 'net.if.out[vlan140]',
max(case when item_key = 'net.if.in[vlan140,errors]' then max_value end) as 'net.if.in[vlan140,errors]',
max(case when item_key = 'net.if.out[vlan140,errors]' then max_value end) as 'net.if.out[vlan140,errors]',
max(case when item_key = 'net.if.in[vlan140,dropped]' then max_value end) as 'net.if.in[vlan140,dropped]',
max(case when item_key = 'net.if.out[vlan140,dropped]' then max_value end) as 'net.if.out[vlan140,dropped]',
max(case when item_key = 'net.if.in[vlan150]' then max_value end) as 'net.if.in[vlan150]',
max(case when item_key = 'net.if.out[vlan150]' then max_value end) as 'net.if.out[vlan150]',
max(case when item_key = 'net.if.in[vlan150,errors]' then max_value end) as 'net.if.in[vlan150,errors]',
max(case when item_key = 'net.if.out[vlan150,errors]' then max_value end) as 'net.if.out[vlan150,errors]',
max(case when item_key = 'net.if.in[vlan150,dropped]' then max_value end) as 'net.if.in[vlan150,dropped]',
max(case when item_key = 'net.if.out[vlan150,dropped]' then max_value end) as 'net.if.out[vlan150,dropped]',
max(case when item_key = 'net.if.in[vlan160]' then max_value end) as 'net.if.in[vlan160]',
max(case when item_key = 'net.if.out[vlan160]' then max_value end) as 'net.if.out[vlan160]',
max(case when item_key = 'net.if.in[vlan160,errors]' then max_value end) as 'net.if.in[vlan160,errors]',
max(case when item_key = 'net.if.out[vlan160,errors]' then max_value end) as 'net.if.out[vlan160,errors]',
max(case when item_key = 'net.if.in[vlan160,dropped]' then max_value end) as 'net.if.in[vlan160,dropped]',
max(case when item_key = 'net.if.out[vlan160,dropped]' then max_value end) as 'net.if.out[vlan160,dropped]',
max(case when item_key = 'net.if.in[vlan170]' then max_value end) as 'net.if.in[vlan170]',
max(case when item_key = 'net.if.out[vlan170]' then max_value end) as 'net.if.out[vlan170]',
max(case when item_key = 'net.if.in[vlan170,errors]' then max_value end) as 'net.if.in[vlan170,errors]',
max(case when item_key = 'net.if.out[vlan170,errors]' then max_value end) as 'net.if.out[vlan170,errors]',
max(case when item_key = 'net.if.in[vlan170,dropped]' then max_value end) as 'net.if.in[vlan170,dropped]',
max(case when item_key = 'net.if.out[vlan170,dropped]' then max_value end) as 'net.if.out[vlan170,dropped]'
from zabbixhour a
# where sdate = @iDate
group by cbispod, hostname, sDate, sTime
)
;
delete from rep_osd_hourly where time between DATE_ADD(from_unixtime(floor(@startdate)), INTERVAL -10 MINUTE) and DATE_ADD(@reqdate, INTERVAL 1 DAY);
insert into rep_osd_hourly
(
select
sDate,
sTime,
max(time) as time,
cbispod,
b.hostname,
CASE
WHEN b.item_key like 'ceph.dtac.osd.apply.latency%' THEN REPLACE(REPLACE(b.item_key,'ceph.dtac.osd.apply.latency[',''),']','')
WHEN b.item_key like 'ceph.dtac.osd.commit.latency%' THEN REPLACE(REPLACE(b.item_key,'ceph.dtac.osd.commit.latency[',''),']','')
WHEN b.item_key like 'vfs.fs.size%' THEN SUBSTRING_INDEX(SUBSTRING_INDEX(b.item_key, '-', -1), ',', 1)
when b.item_key like 'iostat%' then c.numosd
END AS node_number,
'avg' as metrictype,
avg(case WHEN b.item_key like 'ceph.dtac.osd.apply.latency%' THEN b.avg_value end) as 'ceph.dtac.osd.apply.latency',
avg(case WHEN b.item_key like 'ceph.dtac.osd.commit.latency%' THEN b.avg_value end) as 'ceph.dtac.osd.commit.latency',
sum(case WHEN b.item_key like 'vfs.fs.size%total%' THEN b.avg_value end)/(1024*1024*1024) as 'ceph.dtac.osd.total',
sum(case WHEN b.item_key like 'vfs.fs.size%used%' THEN b.avg_value end)/(1024*1024*1024) as 'ceph.dtac.osd.used',
avg(case WHEN b.item_key like 'vfs.fs.size%free%' THEN b.avg_value end) as 'ceph.dtac.osd.free',
avg(case WHEN b.item_key like 'iostat%await%' THEN b.avg_value end) as 'ceph.dtac.osd.await',
avg(case WHEN b.item_key like 'iostat%r/s%' THEN b.avg_value end) as 'ceph.dtac.osd.r/s',
avg(case WHEN b.item_key like 'iostat%rkB/s%' THEN b.avg_value end)/(1024*1024) as 'ceph.dtac.osd.rmB/s',
avg(case WHEN b.item_key like 'iostat%w/s%' THEN b.avg_value end) as 'ceph.dtac.osd.w/s',
avg(case WHEN b.item_key like 'iostat%wkB/s%' THEN b.avg_value end)/(1024*1024) as 'ceph.dtac.osd.wmB/s'
from
(
select
cbispodid,
cbispod,
a.hostname,
sDate,
sTime,
time,
case when a.item_key like 'iostat%' then REPLACE(SUBSTRING_INDEX(a.item_key, ',', 1),'iostat[','') else NULL end as disknum,
a.item_key,
a.avg_value
from zabbixhour a
where (a.item_key like 'ceph.dtac.osd%' or a.item_key like 'vfs.fs.size%' or a.item_key like 'iostat%')
) b
left join ceph_map c on b.hostname = c.hostname and b.disknum = c.disk and b.cbispodid = c.cbis_pod_id
group by node_number, sDate, sTime
);
insert into rep_osd_hourly
select
sDate,
sTime,
max(time) as time,
cbispod,
b.hostname,
CASE
WHEN b.item_key like 'ceph.dtac.osd.apply.latency%' THEN REPLACE(REPLACE(b.item_key,'ceph.dtac.osd.apply.latency[',''),']','')
WHEN b.item_key like 'ceph.dtac.osd.commit.latency%' THEN REPLACE(REPLACE(b.item_key,'ceph.dtac.osd.commit.latency[',''),']','')
WHEN b.item_key like 'vfs.fs.size%' THEN SUBSTRING_INDEX(SUBSTRING_INDEX(b.item_key, '-', -1), ',', 1)
when b.item_key like 'iostat%' then c.numosd
END AS node_number,
'max' as metrictype,
max(case WHEN b.item_key like 'ceph.dtac.osd.apply.latency%' THEN b.max_value end) as 'ceph.dtac.osd.apply.latency',
max(case WHEN b.item_key like 'ceph.dtac.osd.commit.latency%' THEN b.max_value end) as 'ceph.dtac.osd.commit.latency',
sum(case WHEN b.item_key like 'vfs.fs.size%total%' THEN b.max_value end)/(1024*1024*1024) as 'ceph.dtac.osd.total',
sum(case WHEN b.item_key like 'vfs.fs.size%used%' THEN b.max_value end)/(1024*1024*1024) as 'ceph.dtac.osd.used',
max(case WHEN b.item_key like 'vfs.fs.size%free%' THEN b.max_value end) as 'ceph.dtac.osd.free',
max(case WHEN b.item_key like 'iostat%await%' THEN b.max_value end) as 'ceph.dtac.osd.await',
max(case WHEN b.item_key like 'iostat%r/s%' THEN b.max_value end) as 'ceph.dtac.osd.r/s',
max(case WHEN b.item_key like 'iostat%rkB/s%' THEN b.max_value end)/(1024*1024) as 'ceph.dtac.osd.rmB/s',
max(case WHEN b.item_key like 'iostat%w/s%' THEN b.max_value end) as 'ceph.dtac.osd.w/s',
max(case WHEN b.item_key like 'iostat%wkB/s%' THEN b.max_value end)/(1024*1024) as 'ceph.dtac.osd.wmB/s'
from
(
select
cbispodid,
cbispod,
a.hostname,
sDate,
sTime,
time,
case when a.item_key like 'iostat%' then REPLACE(SUBSTRING_INDEX(a.item_key, ',', 1),'iostat[','') else NULL end as disknum,
a.item_key,
a.max_value
from zabbixhour a
where (a.item_key like 'ceph.dtac.osd%' or a.item_key like 'vfs.fs.size%' or a.item_key like 'iostat%')
) b
left join ceph_map c on b.hostname = c.hostname and b.disknum = c.disk and b.cbispodid = c.cbis_pod_id
group by node_number, sDate, sTime;
END//
DELIMITER ;
-- Dumping structure for table cbis_kpi.rep_osd_hourly
CREATE TABLE IF NOT EXISTS `rep_osd_hourly` (
`sDate` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
`sTime` varchar(5) CHARACTER SET utf8mb4 NOT NULL,
`time` datetime NOT NULL,
`cbispod` varchar(150) COLLATE utf8_bin NOT NULL,
`hostname` varchar(150) COLLATE utf8_bin NOT NULL,
`node_number` varchar(10) COLLATE utf8_bin DEFAULT NULL,
`metrictype` varchar(5) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
`ceph.dtac.osd.apply.latency` float DEFAULT NULL,
`ceph.dtac.osd.commit.latency` float DEFAULT NULL,
`ceph.dtac.osd.total` float DEFAULT NULL,
`ceph.dtac.osd.used` float DEFAULT NULL,
`ceph.dtac.osd.free` float DEFAULT NULL,
`ceph.dtac.osd.await` float DEFAULT NULL,
`ceph.dtac.osd.r/s` float DEFAULT NULL,
`ceph.dtac.osd.rmB/s` float DEFAULT NULL,
`ceph.dtac.osd.w/s` float DEFAULT NULL,
`ceph.dtac.osd.wmB/s` float DEFAULT NULL,
UNIQUE KEY `uniqTime` (`sDate`,`sTime`,`cbispod`,`node_number`,`metrictype`),
KEY `sDate` (`sDate`),
KEY `sTime` (`sTime`,`sDate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- Data exporting was unselected.
-- Dumping structure for table cbis_kpi.rep_platform_hourly
CREATE TABLE IF NOT EXISTS `rep_platform_hourly` (
`sDate` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
`sTime` varchar(10) CHARACTER SET utf8mb4 NOT NULL,
`metrictype` varchar(10) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
`hostname` varchar(150) COLLATE utf8_bin NOT NULL DEFAULT '',
`cbispod` varchar(150) COLLATE utf8_bin NOT NULL,
`nodetype` varchar(150) COLLATE utf8_bin NOT NULL DEFAULT '',
`nodenumber` varchar(10) COLLATE utf8_bin NOT NULL DEFAULT '',
`time` datetime DEFAULT NULL,
`system.cpu.util[,user]` float DEFAULT NULL,
`system.cpu.util[,system]` float DEFAULT NULL,
`system.cpu.util[,nice]` float DEFAULT NULL,
`system.cpu.util[,iowait]` float DEFAULT NULL,
`system.cpu.util[,softirq]` float DEFAULT NULL,
`vm.memory.size[total]` float DEFAULT NULL,
`vm.memory.size[available]` float DEFAULT NULL,
`net.if.in[en0]` float DEFAULT NULL,
`net.if.out[en0]` float DEFAULT NULL,
`net.if.in[en0,errors]` float DEFAULT NULL,
`net.if.out[en0,errors]` float DEFAULT NULL,
`net.if.in[en0,dropped]` float DEFAULT NULL,
`net.if.out[en0,dropped]` float DEFAULT NULL,
`net.if.in[ens3f0]` float DEFAULT NULL,
`net.if.out[ens3f0]` float DEFAULT NULL,
`net.if.in[ens3f0,errors]` float DEFAULT NULL,
`net.if.out[ens3f0,errors]` float DEFAULT NULL,
`net.if.in[ens3f0,dropped]` float DEFAULT NULL,
`net.if.out[ens3f0,dropped]` float DEFAULT NULL,
`net.if.in[ens3f1]` float DEFAULT NULL,
`net.if.out[ens3f1]` float DEFAULT NULL,
`net.if.in[ens3f1,errors]` float DEFAULT NULL,
`net.if.out[ens3f1,errors]` float DEFAULT NULL,
`net.if.in[ens3f1,dropped]` float DEFAULT NULL,
`net.if.out[ens3f1,dropped]` float DEFAULT NULL,
`net.if.in[ens6f0]` float DEFAULT NULL,
`net.if.out[ens6f0]` float DEFAULT NULL,
`net.if.in[ens6f0,errors]` float DEFAULT NULL,
`net.if.out[ens6f0,errors]` float DEFAULT NULL,
`net.if.in[ens6f0,dropped]` float DEFAULT NULL,
`net.if.out[ens6f0,dropped]` float DEFAULT NULL,
`net.if.in[ens6f1]` float DEFAULT NULL,
`net.if.out[ens6f1]` float DEFAULT NULL,
`net.if.in[ens6f1,errors]` float DEFAULT NULL,
`net.if.out[ens6f1,errors]` float DEFAULT NULL,
`net.if.in[ens6f1,dropped]` float DEFAULT NULL,
`net.if.out[ens6f1,dropped]` float DEFAULT NULL,
`net.if.in[vlan110]` float DEFAULT NULL,
`net.if.out[vlan110]` float DEFAULT NULL,
`net.if.in[vlan110,errors]` float DEFAULT NULL,
`net.if.out[vlan110,errors]` float DEFAULT NULL,
`net.if.in[vlan110,dropped]` float DEFAULT NULL,
`net.if.out[vlan110,dropped]` float DEFAULT NULL,
`net.if.in[vlan140]` float DEFAULT NULL,
`net.if.out[vlan140]` float DEFAULT NULL,
`net.if.in[vlan140,errors]` float DEFAULT NULL,
`net.if.out[vlan140,errors]` float DEFAULT NULL,
`net.if.in[vlan140,dropped]` float DEFAULT NULL,
`net.if.out[vlan140,dropped]` float DEFAULT NULL,
`net.if.in[vlan150]` float DEFAULT NULL,
`net.if.out[vlan150]` float DEFAULT NULL,
`net.if.in[vlan150,errors]` float DEFAULT NULL,
`net.if.out[vlan150,errors]` float DEFAULT NULL,
`net.if.in[vlan150,dropped]` float DEFAULT NULL,
`net.if.out[vlan150,dropped]` float DEFAULT NULL,
`net.if.in[vlan160]` float DEFAULT NULL,
`net.if.out[vlan160]` float DEFAULT NULL,
`net.if.in[vlan160,errors]` float DEFAULT NULL,
`net.if.out[vlan160,errors]` float DEFAULT NULL,
`net.if.in[vlan160,dropped]` float DEFAULT NULL,
`net.if.out[vlan160,dropped]` float DEFAULT NULL,
`net.if.in[vlan170]` float DEFAULT NULL,
`net.if.out[vlan170]` float DEFAULT NULL,
`net.if.in[vlan170,errors]` float DEFAULT NULL,
`net.if.out[vlan170,errors]` float DEFAULT NULL,
`net.if.in[vlan170,dropped]` float DEFAULT NULL,
`net.if.out[vlan170,dropped]` float DEFAULT NULL,
UNIQUE KEY `uniqTime` (`sDate`,`sTime`,`metrictype`,`hostname`,`cbispod`),
KEY `hostname` (`hostname`),
KEY `cbispod` (`cbispod`,`hostname`),
KEY `nodetype` (`nodetype`,`hostname`,`cbispod`),
KEY `sDate` (`sDate`),
KEY `sTime` (`sTime`,`sDate`),
KEY `metrictype` (`metrictype`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- Data exporting was unselected.
-- Dumping structure for table cbis_kpi.virsh_raw_hourly
CREATE TABLE IF NOT EXISTS `virsh_raw_hourly` (
`cbis_pod_name` varchar(128) COLLATE utf8_bin DEFAULT '',
`sdate` varchar(8) CHARACTER SET utf8mb4 DEFAULT NULL,
`stime` varchar(7) CHARACTER SET utf8mb4 DEFAULT NULL,
`hostname` varchar(128) COLLATE utf8_bin DEFAULT '',
`vm_name` varchar(128) COLLATE utf8_bin DEFAULT '',
`domain_name` varchar(128) COLLATE utf8_bin NOT NULL DEFAULT '',
`vm_numa` varchar(128) COLLATE utf8_bin DEFAULT '',
`project_name` varchar(128) COLLATE utf8_bin DEFAULT '',
`metrictype` varchar(128) COLLATE utf8_bin DEFAULT '',
`vcpu[used]` decimal(6,2) DEFAULT NULL,
`vcpu[wait]` decimal(6,2) DEFAULT NULL,
`vcpu.maximum` bigint(21) DEFAULT NULL,
`memory.allocated` bigint(21) DEFAULT NULL,
`memory.available` bigint(21) DEFAULT NULL,
`memory.unused` bigint(21) DEFAULT NULL,
`memory.swap_out` bigint(21) DEFAULT NULL,
`net.count` bigint(21) DEFAULT NULL,
`net.tx[Bps]` decimal(53,11) DEFAULT NULL,
`net.tx[drop]` bigint(21) DEFAULT NULL,
`net.tx[error]` bigint(21) DEFAULT NULL,
`net.tx[packet]` bigint(21) DEFAULT NULL,
`net.rx[Bps]` decimal(53,11) DEFAULT NULL,
`net.rx[drop]` bigint(21) DEFAULT NULL,
`net.rx[error]` bigint(21) DEFAULT NULL,
`net.rx[packet]` bigint(21) DEFAULT NULL,
`storage.read[MBs]` decimal(10,2) DEFAULT NULL,
`storage.write[MBs]` decimal(10,2) DEFAULT NULL,
`storage.read[busy]` decimal(6,2) DEFAULT NULL,
`storage.write[busy]` decimal(6,2) DEFAULT NULL,
KEY `sdate` (`sdate`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
-- Data exporting was unselected.
-- Dumping structure for view cbis_kpi.ceph_map
-- Removing temporary table and create final VIEW structure
DROP TABLE IF EXISTS `ceph_map`;
CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `ceph_map` AS select `cbis_ceph_disk`.`cbis_pod_id` AS `cbis_pod_id`,`cbis_ceph_disk`.`hostname` AS `hostname`,replace(substring_index(`cbis_ceph_disk`.`disk`,'/',-(1)),'1','') AS `disk`,substring_index(`cbis_ceph_disk`.`journal`,'/',-(1)) AS `journal`,substring_index(`cbis_ceph_disk`.`osd`,'.',-(1)) AS `numosd` from `cbis_ceph_disk`;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS IS NULL, 1, @OLD_FOREIGN_KEY_CHECKS) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
<filename>database/dump20181129.sql<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: helpdesk
-- ------------------------------------------------------
-- Server version 5.7.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `migrations`
--
DROP TABLE IF EXISTS `migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `migrations` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `migrations`
--
LOCK TABLES `migrations` WRITE;
/*!40000 ALTER TABLE `migrations` DISABLE KEYS */;
INSERT INTO `migrations` VALUES (1,'2014_10_12_000000_create_users_table',1),(2,'2014_10_12_100000_create_password_resets_table',1),(3,'2015_07_22_115516_create_ticketit_tables',2),(4,'2015_07_22_123254_alter_users_table',2),(5,'2015_09_29_123456_add_completed_at_column_to_ticketit_table',2),(6,'2015_10_08_123457_create_settings_table',2),(7,'2016_01_15_002617_add_htmlcontent_to_ticketit_and_comments',2),(8,'2016_01_15_040207_enlarge_settings_columns',2),(9,'2016_01_15_120557_add_indexes',2);
/*!40000 ALTER TABLE `migrations` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `password_resets`
--
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
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,
KEY `password_resets_email_index` (`email`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `password_resets`
--
LOCK TABLES `password_resets` WRITE;
/*!40000 ALTER TABLE `password_resets` DISABLE KEYS */;
/*!40000 ALTER TABLE `password_resets` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit`
--
DROP TABLE IF EXISTS `ticketit`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`subject` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`html` longtext COLLATE utf8mb4_unicode_ci,
`status_id` int(10) unsigned NOT NULL,
`priority_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`agent_id` int(10) unsigned NOT NULL,
`category_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`completed_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ticketit_subject_index` (`subject`),
KEY `ticketit_status_id_index` (`status_id`),
KEY `ticketit_priority_id_index` (`priority_id`),
KEY `ticketit_user_id_index` (`user_id`),
KEY `ticketit_agent_id_index` (`agent_id`),
KEY `ticketit_category_id_index` (`category_id`),
KEY `ticketit_completed_at_index` (`completed_at`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit`
--
LOCK TABLES `ticketit` WRITE;
/*!40000 ALTER TABLE `ticketit` DISABLE KEYS */;
INSERT INTO `ticketit` VALUES (1,'teste','teste','<p>teste<br /></p>',2,2,1,2,1,'2018-11-29 03:49:33','2018-11-29 03:56:06','2018-11-29 03:56:04'),(2,'teste','teste','<p>teste<br /></p>',2,2,1,2,1,'2018-11-29 03:50:32','2018-11-29 03:56:34','2018-11-29 03:56:32'),(3,'Teste helpdesk','Teste helpdesk','<p>Teste helpdesk<br /></p>',1,1,1,2,1,'2018-11-29 04:06:08','2018-11-29 04:06:08',NULL);
/*!40000 ALTER TABLE `ticketit` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit_audits`
--
DROP TABLE IF EXISTS `ticketit_audits`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit_audits` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`operation` text COLLATE utf8mb4_unicode_ci NOT NULL,
`user_id` int(10) unsigned NOT NULL,
`ticket_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit_audits`
--
LOCK TABLES `ticketit_audits` WRITE;
/*!40000 ALTER TABLE `ticketit_audits` DISABLE KEYS */;
/*!40000 ALTER TABLE `ticketit_audits` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit_categories`
--
DROP TABLE IF EXISTS `ticketit_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit_categories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit_categories`
--
LOCK TABLES `ticketit_categories` WRITE;
/*!40000 ALTER TABLE `ticketit_categories` DISABLE KEYS */;
INSERT INTO `ticketit_categories` VALUES (1,'Support','#000000');
/*!40000 ALTER TABLE `ticketit_categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit_categories_users`
--
DROP TABLE IF EXISTS `ticketit_categories_users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit_categories_users` (
`category_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit_categories_users`
--
LOCK TABLES `ticketit_categories_users` WRITE;
/*!40000 ALTER TABLE `ticketit_categories_users` DISABLE KEYS */;
INSERT INTO `ticketit_categories_users` VALUES (1,2);
/*!40000 ALTER TABLE `ticketit_categories_users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit_comments`
--
DROP TABLE IF EXISTS `ticketit_comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit_comments` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`content` text COLLATE utf8mb4_unicode_ci NOT NULL,
`html` longtext COLLATE utf8mb4_unicode_ci,
`user_id` int(10) unsigned NOT NULL,
`ticket_id` int(10) unsigned NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ticketit_comments_user_id_index` (`user_id`),
KEY `ticketit_comments_ticket_id_index` (`ticket_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit_comments`
--
LOCK TABLES `ticketit_comments` WRITE;
/*!40000 ALTER TABLE `ticketit_comments` DISABLE KEYS */;
INSERT INTO `ticketit_comments` VALUES (1,'tessfss','<p>tessfss<br /></p>',1,2,'2018-11-29 03:56:28','2018-11-29 03:56:28');
/*!40000 ALTER TABLE `ticketit_comments` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit_priorities`
--
DROP TABLE IF EXISTS `ticketit_priorities`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit_priorities` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit_priorities`
--
LOCK TABLES `ticketit_priorities` WRITE;
/*!40000 ALTER TABLE `ticketit_priorities` DISABLE KEYS */;
INSERT INTO `ticketit_priorities` VALUES (1,'High','#830909'),(2,'Normal','#090909'),(3,'Low','#125f71');
/*!40000 ALTER TABLE `ticketit_priorities` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit_settings`
--
DROP TABLE IF EXISTS `ticketit_settings`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit_settings` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`lang` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`slug` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`value` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`default` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `ticketit_settings_slug_unique` (`slug`),
UNIQUE KEY `ticketit_settings_lang_unique` (`lang`),
KEY `ticketit_settings_lang_index` (`lang`),
KEY `ticketit_settings_slug_index` (`slug`)
) ENGINE=InnoDB AUTO_INCREMENT=43 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit_settings`
--
LOCK TABLES `ticketit_settings` WRITE;
/*!40000 ALTER TABLE `ticketit_settings` DISABLE KEYS */;
INSERT INTO `ticketit_settings` VALUES (1,NULL,'main_route','tickets','tickets','2018-11-29 03:46:22','2018-11-29 03:46:22'),(2,NULL,'main_route_path','tickets','tickets','2018-11-29 03:46:22','2018-11-29 03:46:22'),(3,NULL,'admin_route','tickets-admin','tickets-admin','2018-11-29 03:46:22','2018-11-29 03:46:22'),(4,NULL,'admin_route_path','tickets-admin','tickets-admin','2018-11-29 03:46:22','2018-11-29 03:46:22'),(5,NULL,'master_template','layouts.app','layouts.app','2018-11-29 03:46:22','2018-11-29 03:46:22'),(6,NULL,'bootstrap_version','4','4','2018-11-29 03:46:22','2018-11-29 03:46:22'),(7,NULL,'email.template','ticketit::emails.templates.ticketit','ticketit::emails.templates.ticketit','2018-11-29 03:46:22','2018-11-29 03:46:22'),(8,NULL,'email.header','Ticket Update','Ticket Update','2018-11-29 03:46:22','2018-11-29 03:46:22'),(9,NULL,'email.signoff','Thank you for your patience!','Thank you for your patience!','2018-11-29 03:46:22','2018-11-29 03:46:22'),(10,NULL,'email.signature','Your friends','Your friends','2018-11-29 03:46:22','2018-11-29 03:46:22'),(11,NULL,'email.dashboard','My Dashboard','My Dashboard','2018-11-29 03:46:22','2018-11-29 03:46:22'),(12,NULL,'email.google_plus_link','#','#','2018-11-29 03:46:22','2018-11-29 03:46:22'),(13,NULL,'email.facebook_link','#','#','2018-11-29 03:46:22','2018-11-29 03:46:22'),(14,NULL,'email.twitter_link','#','#','2018-11-29 03:46:22','2018-11-29 03:46:22'),(15,NULL,'email.footer','Powered by Ticketit','Powered by Ticketit','2018-11-29 03:46:22','2018-11-29 03:46:22'),(16,NULL,'email.footer_link','https://github.com/thekordy/ticketit','https://github.com/thekordy/ticketit','2018-11-29 03:46:22','2018-11-29 03:46:22'),(17,NULL,'email.color_body_bg','#FFFFFF','#FFFFFF','2018-11-29 03:46:22','2018-11-29 03:46:22'),(18,NULL,'email.color_header_bg','#44B7B7','#44B7B7','2018-11-29 03:46:22','2018-11-29 03:46:22'),(19,NULL,'email.color_content_bg','#F46B45','#F46B45','2018-11-29 03:46:22','2018-11-29 03:46:22'),(20,NULL,'email.color_footer_bg','#414141','#414141','2018-11-29 03:46:23','2018-11-29 03:46:23'),(21,NULL,'email.color_button_bg','#AC4D2F','#AC4D2F','2018-11-29 03:46:23','2018-11-29 03:46:23'),(22,NULL,'default_status_id','1','1','2018-11-29 03:46:23','2018-11-29 03:46:23'),(23,NULL,'default_close_status_id','2','0','2018-11-29 03:46:23','2018-11-29 03:46:24'),(24,NULL,'default_reopen_status_id','3','0','2018-11-29 03:46:23','2018-11-29 03:46:24'),(25,NULL,'paginate_items','10','10','2018-11-29 03:46:23','2018-11-29 03:46:23'),(26,NULL,'length_menu','a:2:{i:0;a:3:{i:0;i:10;i:1;i:50;i:2;i:100;}i:1;a:3:{i:0;i:10;i:1;i:50;i:2;i:100;}}','a:2:{i:0;a:3:{i:0;i:10;i:1;i:50;i:2;i:100;}i:1;a:3:{i:0;i:10;i:1;i:50;i:2;i:100;}}','2018-11-29 03:46:23','2018-11-29 03:46:23'),(27,NULL,'status_notification','1','1','2018-11-29 03:46:23','2018-11-29 03:46:23'),(28,NULL,'comment_notification','1','1','2018-11-29 03:46:23','2018-11-29 03:46:23'),(29,NULL,'queue_emails','0','0','2018-11-29 03:46:23','2018-11-29 03:46:23'),(30,NULL,'assigned_notification','1','1','2018-11-29 03:46:23','2018-11-29 03:46:23'),(31,NULL,'agent_restrict','0','0','2018-11-29 03:46:23','2018-11-29 03:46:23'),(32,NULL,'close_ticket_perm','a:3:{s:5:\"owner\";b:1;s:5:\"agent\";b:1;s:5:\"admin\";b:1;}','a:3:{s:5:\"owner\";b:1;s:5:\"agent\";b:1;s:5:\"admin\";b:1;}','2018-11-29 03:46:23','2018-11-29 03:46:23'),(33,NULL,'reopen_ticket_perm','a:3:{s:5:\"owner\";b:1;s:5:\"agent\";b:1;s:5:\"admin\";b:1;}','a:3:{s:5:\"owner\";b:1;s:5:\"agent\";b:1;s:5:\"admin\";b:1;}','2018-11-29 03:46:23','2018-11-29 03:46:23'),(34,NULL,'delete_modal_type','builtin','builtin','2018-11-29 03:46:23','2018-11-29 03:46:23'),(35,NULL,'editor_enabled','1','1','2018-11-29 03:46:23','2018-11-29 03:46:23'),(36,NULL,'include_font_awesome','1','1','2018-11-29 03:46:23','2018-11-29 03:46:23'),(37,NULL,'summernote_locale','en','en','2018-11-29 03:46:24','2018-11-29 03:46:24'),(38,NULL,'editor_html_highlighter','1','1','2018-11-29 03:46:24','2018-11-29 03:46:24'),(39,NULL,'codemirror_theme','monokai','monokai','2018-11-29 03:46:24','2018-11-29 03:46:24'),(40,NULL,'summernote_options_json_file','vendor/kordy/ticketit/src/JSON/summernote_init.json','vendor/kordy/ticketit/src/JSON/summernote_init.json','2018-11-29 03:46:24','2018-11-29 03:46:24'),(41,NULL,'purifier_config','a:3:{s:15:\"HTML.SafeIframe\";s:4:\"true\";s:20:\"URI.SafeIframeRegexp\";s:72:\"%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%\";s:18:\"URI.AllowedSchemes\";a:5:{s:4:\"data\";b:1;s:4:\"http\";b:1;s:5:\"https\";b:1;s:6:\"mailto\";b:1;s:3:\"ftp\";b:1;}}','a:3:{s:15:\"HTML.SafeIframe\";s:4:\"true\";s:20:\"URI.SafeIframeRegexp\";s:72:\"%^(http://|https://|//)(www.youtube.com/embed/|player.vimeo.com/video/)%\";s:18:\"URI.AllowedSchemes\";a:5:{s:4:\"data\";b:1;s:4:\"http\";b:1;s:5:\"https\";b:1;s:6:\"mailto\";b:1;s:3:\"ftp\";b:1;}}','2018-11-29 03:46:24','2018-11-29 03:46:24'),(42,NULL,'routes','/home/renato/Downloads/temporario/helpdesks/ticketit-app-master/vendor/kordy/ticketit/src/routes.php','/home/renato/Downloads/temporario/helpdesks/ticketit-app-master/vendor/kordy/ticketit/src/routes.php','2018-11-29 03:46:24','2018-11-29 03:46:24');
/*!40000 ALTER TABLE `ticketit_settings` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticketit_statuses`
--
DROP TABLE IF EXISTS `ticketit_statuses`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticketit_statuses` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`color` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `ticketit_statuses`
--
LOCK TABLES `ticketit_statuses` WRITE;
/*!40000 ALTER TABLE `ticketit_statuses` DISABLE KEYS */;
INSERT INTO `ticketit_statuses` VALUES (1,'New','#e9551e'),(2,'Closed','#186107'),(3,'Re-opened','#71001f');
/*!40000 ALTER TABLE `ticketit_statuses` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`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,
`ticketit_admin` tinyint(1) NOT NULL DEFAULT '0',
`ticketit_agent` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `users_email_unique` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'teste','<EMAIL>',NULL,'$2y$10$4xtdAzONyOWozj9RjCllDuKjn2IpoJV4Ym.uTlbxXTNApgJDr6UJ.','MD5wD9Fc3TJp1O1WRmTrvgR6PsEe7YQMmho3HS32qy0YmNN6QdmpB8t45gEj','2018-11-29 03:39:15','2018-11-29 03:39:15',0,0),(2,'8353083bf8a355','<EMAIL>',NULL,'$2y$10$UwBKWYB.PExQB4sGEhrwEedCI92smyZLhV//V3RtZGhgdC2X2rYnK',NULL,'2018-11-29 03:46:11','2018-11-29 03:46:25',1,1);
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-11-29 2:07:58
|
<reponame>stowdgl/templarastore
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 08, 2019 at 12:54 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
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: `store`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`parent_id` int(11) 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 `categories`
--
INSERT INTO `categories` (`id`, `title`, `parent_id`, `created_at`, `updated_at`) VALUES
(1, 'Smartphones', 1, '2019-03-26 16:44:00', '2019-03-26 16:44:00'),
(3, 'Notebooks', NULL, NULL, NULL),
(5, 'Smart-watches', NULL, '2019-04-08 04:51:30', '2019-04-08 04:51:30');
-- --------------------------------------------------------
--
-- Table structure for table `categories_products`
--
CREATE TABLE `categories_products` (
`products_id` int(11) NOT NULL,
`categories_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `categories_products`
--
INSERT INTO `categories_products` (`products_id`, `categories_id`) VALUES
(1, 1),
(2, 3),
(4, 1),
(106, 3),
(107, 1),
(109, 1),
(110, 3),
(111, 1);
-- --------------------------------------------------------
--
-- 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_03_26_160414_products', 2),
(4, '2019_03_26_160450_categories', 2),
(5, '2019_03_26_162407_prices', 2),
(6, '2019_04_03_115241_orders', 3);
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE `orders` (
`id` bigint(20) UNSIGNED NOT NULL,
`fio` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`city` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`npo` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`paymentmeth` 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 `orders`
--
INSERT INTO `orders` (`id`, `fio`, `email`, `city`, `phone`, `npo`, `paymentmeth`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, '<NAME>', '<EMAIL>', 'Харьков', '+380992270031', '8', 'Наличными', NULL, '2019-04-03 10:11:36', '2019-04-03 10:11:36'),
(2, '<NAME>', '<EMAIL>', 'Полтава', '+380992270031', '8', 'Наличными', NULL, '2019-04-03 10:12:37', '2019-04-03 10:12:37'),
(3, 'gsdfgsdfg', '<EMAIL>ghdhg', 'sdfgsdfg', '7643333578', '3', 'Наличными', NULL, '2019-04-03 10:36:14', '2019-04-03 10:36:14'),
(4, '<NAME>', 'df<EMAIL>', 'asdfadsf', '2354234', '8', 'Наличными', NULL, '2019-04-03 12:59:30', '2019-04-03 12:59:30');
-- --------------------------------------------------------
--
-- Table structure for table `orders_products`
--
CREATE TABLE `orders_products` (
`products_id` int(11) NOT NULL,
`orders_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `orders_products`
--
INSERT INTO `orders_products` (`products_id`, `orders_id`) VALUES
(4, 1),
(1, 1),
(105, 1),
(1, 2),
(105, 3),
(1, 4),
(4, 4);
-- --------------------------------------------------------
--
-- Table structure for table `prices`
--
CREATE TABLE `prices` (
`id` bigint(20) UNSIGNED NOT NULL,
`price` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`product_id` int(11) 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 `prices`
--
INSERT INTO `prices` (`id`, `price`, `product_id`, `created_at`, `updated_at`) VALUES
(1, '1000', 1, '2019-03-26 16:44:00', '2019-03-26 16:44:00'),
(3, '800', 4, NULL, NULL),
(4, '250', 105, NULL, NULL),
(5, '1700', 2, NULL, NULL),
(6, '1300', 109, '2019-04-08 02:56:59', '2019-04-08 02:56:59'),
(7, '1445', 110, '2019-04-08 04:30:11', '2019-04-08 04:30:11'),
(8, '160', 111, '2019-04-08 04:40:41', '2019-04-08 04:40:41'),
(9, '1705', 2, '2019-04-08 07:00:13', '2019-04-08 07:00:13'),
(10, '1700', 2, '2019-04-08 07:00:46', '2019-04-08 07:00:46');
-- --------------------------------------------------------
--
-- Table structure for table `prices_products`
--
CREATE TABLE `prices_products` (
`products_id` int(11) NOT NULL,
`prices_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `prices_products`
--
INSERT INTO `prices_products` (`products_id`, `prices_id`) VALUES
(1, 1),
(4, 3),
(2, 5),
(109, 6),
(110, 7),
(111, 8),
(2, 5);
-- --------------------------------------------------------
--
-- Table structure for table `products`
--
CREATE TABLE `products` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`code` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`specifications` text COLLATE utf8mb4_unicode_ci NOT NULL,
`manufacturer` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`manufacturer_img` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'default.jpg',
`product_img` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT 'img/a.jpg',
`items_available` int(11) NOT NULL DEFAULT '0',
`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 `products`
--
INSERT INTO `products` (`id`, `title`, `code`, `specifications`, `manufacturer`, `manufacturer_img`, `product_img`, `items_available`, `created_at`, `updated_at`) VALUES
(1, 'Samsung S10+', 'SM-G975F', '{\"screen\":\"6.5\"}', 'Samsung', '/img/samsung.jpg', 'img/ss10+.jpg', 10, '2019-03-26 16:40:00', '2019-03-26 16:40:00'),
(2, 'ASUS ZenBook Pro 500', 'UX550GD-BO009R', '{\"screen\":\"15.6\"}', 'Asus', '/img/asus.jpg', '/img/asus.jpg', 10, NULL, '2019-04-08 07:00:46'),
(4, 'Samsung Note 9', 'N960F', '{\"screen\":\"7.0\"}', 'Samsung', '/img/samsung.jpg', 'img/note9.jpg', 100, NULL, NULL),
(109, 'Huawei P30 Pro', 'P30Pro', '{\"screen\":\"7.0\"}', 'Huawei', '/img/huawei.png', '/img/1.png', 11, '2019-04-08 02:56:59', '2019-04-08 02:56:59'),
(110, 'Apple New Macbook Air MREE2UA/A Gold', 'MREE2UA/A', '{\"screen\":\"13.3\",\"resolution\":\"2560x1600\"}', 'Apple', '/img/apple.jpg', '/img/apple.jpg', 11, '2019-04-08 04:30:11', '2019-04-08 04:30:11'),
(111, 'Samsung J415F Galaxy J4+ Black', 'J415F', '{\"screen\":\"6.0\",\"resolution\":\"1480х720\"}', 'Samsung', '/img/samsung.jpg', '/img/samsung_galaxy_j6_plus.jpg', 304, '2019-04-08 04:40:40', '2019-04-08 04:40:40');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`gender` enum('male','female') CHARACTER SET utf8mb4 NOT NULL,
`fname` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`lname` varchar(255) CHARACTER SET utf8mb4 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,
`user_type` enum('admin','user') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'user',
`birthday` date 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`, `gender`, `fname`, `lname`, `email`, `email_verified_at`, `password`, `user_type`, `birthday`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'male', 'Gleb', 'Khivrenko', '<EMAIL>', NULL, '$2y$10$W4oOeXZkMd/bYAmqDgjI6..EI8VlMNmwqeL9yWZIurTW50eaVk1Pu', 'admin', '2000-03-14', NULL, '2019-03-26 13:30:19', '2019-03-26 13:30:19'),
(2, 'male', 'Andrey', 'Artemenko', '<EMAIL>', NULL, '$2y$10$h4cWipp2IgagGeqfT3e5K.4dlRKvJ7U2FyatzHfc0JxRKwFeU50v6', 'user', '2000-04-21', NULL, '2019-03-27 08:18:47', '2019-03-27 08:18:47'),
(3, 'female', 'Anastasia', 'Lukyanenko', '<EMAIL>', NULL, '$2y$10$tggh1hGIPOhP.L4Ju0yPwOQuFS.yoRJ7DU3yQNguofxQtoQaJUxbG', 'user', '1948-05-02', NULL, '2019-03-27 08:19:38', '2019-03-27 08:19:38'),
(4, 'female', 'Anastasia', 'Lukyanenko', '<EMAIL>', NULL, '$2y$10$SKRDvZyaZJ.UHIAy8.ZGSOS7rQEsBGHB/UvGlfgviAU8fLKwYzGpK', 'user', '2000-03-14', NULL, '2019-03-27 08:20:42', '2019-03-27 08:20:42');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `prices`
--
ALTER TABLE `prices`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `prices`
--
ALTER TABLE `prices`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=112;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
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 */;
|
<filename>db/src/api/city/cities.sql<gh_stars>0
\echo # Creating cities view
set search_path = api, public;
create or replace view cities as
select
id as id,
name,
ascii_name,
alternate_names,
latitude,
longitude,
timezone,
country_iso
from data.city t;
alter view cities owner to api; -- it is important to set the correct owner to the RLS policy kicks in
|
/*
NAME: <NAME>
DATE: 09/08/2020
CLASS: CIS223
INSTRUCTOR: <NAME>
*/
/* SELECT displays all of the table. */
SELECT *
/* Gather database from the L_Employee SQL file */
FROM L_FOODS WHERE price_increase > 0.20
ORDER BY menu_item
FROM L_FOODS WHERE not (price_increase > 0.20)
ORDER BY menu_item
FROM L_FOODS WHERE price_increase is NULL;
ORDER BY menu_item;
/* NOTE: Not replacing the manager_ID value; just adding the NULL values to the manager_ID column */
/* WHERE not Manager_ID = 203
OR Manager_ID is NULL; */
/* WHERE dept_code not in ('ACT', 'MKT')
and last_name between 'J' and 'M'
and last_name not like '%s'
and Manager_ID is not null; */
|
<filename>SQLHOMEWORK/SQLQueryHomework04.sql
USE [SEDC.Homework]
--1/2
DECLARE @FirstNameValues NVARCHAR(100)
SET @FirstNameValues = 'Antonio'
SELECT * FROM Student
WHERE FirstName = @FirstNameValues
DECLARE @StudentInfo TABLE
(StudentID INT, StudentName NVARCHAR(100), DateOfBirth DATE)
INSERT INTO @StudentInfo
SELECT s.ID, s.FirstName, s.DateOfBirth
FROM Student AS s
WHERE Gender = 'F'
SELECT * FROM @StudentInfo
CREATE TABLE #StudentEnrollementDate
(LastName NVARCHAR(100), EnrolledDate DATE)
INSERT INTO #StudentEnrollementDate
SELECT s.LastName, s.EnrolledDate
FROM Student AS s
WHERE s.Gender = 'M' and FirstName LIKE 'A%'
SELECT * FROM #StudentEnrollementDate as st
WHERE LEN(st.LastName) = 7
SELECT t.FirstName, t.LastName, SUBSTRING(t.FirstName,1, 3) AS subFirst, SUBSTRING(t.LastName,1, 3) AS subLast
FROM Teacher AS t
WHERE LEN(t.FirstName) < 5 and SUBSTRING(t.FirstName,1, 3) = SUBSTRING(t.LastName,1, 3)
--2/2
ALTER FUNCTION dbo.fn_FormatStudentName(@StudentID INT)
RETURNS NVARCHAR(1000)
AS
BEGIN
DECLARE @Result NVARCHAR(1000)
SELECT @Result = SUBSTRING(s.StudentCardNumber, 4, 8) + '-' + LEFT(s.FirstName, 1) + '.' + s.LastName
FROM Student as s
WHERE s.ID = @StudentID
RETURN @Result
END
SELECT *, dbo.fn_FormatStudentName(s.ID) as FunctionResult
FROM Student as s
|
-- Insert a new violation related to a inspection
INSERT IGNORE INTO inspections_violations
(inspection_id,
violation_id,
violation_count)
VALUES (:inspection_id,
:violation_id,
:violation_count);
|
<gh_stars>1-10
CREATE TABLE dbo.UserSecurityCode (
[Code] varchar(50) NOT NULL,
[UserId] varchar(50) NOT NULL,
[CodeType] int NOT NULL,
[ExpiryTime] datetime NOT NULL,
[ReturnUrl] varchar(max) NULL,
[PendingValue] nvarchar(255) NULL,
CONSTRAINT [PK_UserSecurityCode] PRIMARY KEY (Code),
CONSTRAINT [FK_UserSecurityCode_User] FOREIGN KEY (UserId) REFERENCES [User](Id)
)
|
create function logoff(param json) returns integer
language plpgsql
as
$$
declare
email text;
r record;
i record;
begin
email := param->>'email';
update basic_auth.access
set saida = current_timestamp
where usuario = email and saida isnull;
return 1;
end
$$;
alter function logoff(json) owner to postgres;
|
<filename>prices/layer1_usd_btc.sql
-- The prices.layer1_usd_btc table is no longer present but some queries depend on it.
CREATE OR REPLACE VIEW prices.layer1_usd_btc AS
SELECT
*
FROM
prices.layer1_usd
WHERE
symbol = 'BTC';
|
DROP DATABASE IF EXISTS COLUMNTEST;
CREATE DATABASE COLUMNTEST;
CREATE TABLE COLUMNTEST.A(ID INT, ID2 INT DEFAULT 1, ID3 STRING, ID4 STRING DEFAULT 'ID4');
SELECT database, name, type, default_kind as default_type, default_expression, comment FROM system.columns WHERE database LIKE 'COLUMNTEST';
DROP DATABASE COLUMNTEST;
|
alter table if exists hacker drop if exists kind;
|
select * from t_store where id in (select store_id from t_store_office where office_id=21);
select * from t_stock where store_id in (select store_id from t_store_office where office_id=21);
select * from t_stock_product where stock_id in (select id from t_stock where store_id in (select store_id from t_store_office where office_id=21));
delete from t_stock_product where stock_id in (select id from t_stock where store_id in (select store_id from t_store_office where office_id=21));
delete from t_stock where store_id in (select store_id from t_store_office where office_id=21);
test line add to dev is so simple and quick!
|
--liquibase formatted sql
--changeset amit_agrahari:1
drop table Product;
--changeset amit_agrahari:2
drop table t_catalog;
--changeset amit_agrahari:3
create table t_catalog
(
catalogId Number GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),
catalogName varchar2(50) Not Null,
CONSTRAINT t_catalog_pk PRIMARY KEY (catalogId)
);
--changeset amit_agrahari:4
create table Product
(
productId Number GENERATED ALWAYS as IDENTITY(START with 1 INCREMENT by 1),
productName varchar2(50) Not Null,
productPrice Number Not Null,
catalogId Number ,
CONSTRAINT Product_pk PRIMARY KEY (productId),
CONSTRAINT Product_fk
FOREIGN KEY (catalogId)
REFERENCES t_catalog(catalogId)
);
|
-- Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
--
-- 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
--
-- View: x$ps_digest_95th_percentile_by_avg_us
--
-- Helper view for statements_with_runtimes_in_95th_percentile.
-- Lists the 95th percentile runtime, for all statements
--
-- mysql> select * from x$ps_digest_95th_percentile_by_avg_us;
-- +--------+------------+
-- | avg_us | percentile |
-- +--------+------------+
-- | 964 | 0.9525 |
-- +--------+------------+
--
CREATE OR REPLACE
ALGORITHM = TEMPTABLE
DEFINER = 'mariadb.sys'@'localhost'
SQL SECURITY INVOKER
VIEW x$ps_digest_95th_percentile_by_avg_us (
avg_us,
percentile
) AS
SELECT s2.avg_us avg_us,
IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest), 0), 0) percentile
FROM sys.x$ps_digest_avg_latency_distribution AS s1
JOIN sys.x$ps_digest_avg_latency_distribution AS s2
ON s1.avg_us <= s2.avg_us
GROUP BY s2.avg_us
HAVING IFNULL(SUM(s1.cnt)/NULLIF((SELECT COUNT(*) FROM performance_schema.events_statements_summary_by_digest), 0), 0) > 0.95
ORDER BY percentile
LIMIT 1;
|
create table ACT_RU_INCIDENT (
ID_ varchar(64) not null,
INCIDENT_TIMESTAMP_ timestamp not null,
INCIDENT_MSG_ varchar(4000),
INCIDENT_TYPE_ varchar(255) not null,
EXECUTION_ID_ varchar(64),
ACTIVITY_ID_ varchar(255),
PROC_INST_ID_ varchar(64),
PROC_DEF_ID_ varchar(64),
CAUSE_INCIDENT_ID_ varchar(64),
ROOT_CAUSE_INCIDENT_ID_ varchar(64),
CONFIGURATION_ varchar(255),
primary key (ID_)
);
create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_);
alter table ACT_RU_INCIDENT
add constraint ACT_FK_INC_EXE
foreign key (EXECUTION_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_INCIDENT
add constraint ACT_FK_INC_PROCINST
foreign key (PROC_INST_ID_)
references ACT_RU_EXECUTION (ID_);
alter table ACT_RU_INCIDENT
add constraint ACT_FK_INC_PROCDEF
foreign key (PROC_DEF_ID_)
references ACT_RE_PROCDEF (ID_);
alter table ACT_RU_INCIDENT
add constraint ACT_FK_INC_CAUSE
foreign key (CAUSE_INCIDENT_ID_)
references ACT_RU_INCIDENT (ID_);
alter table ACT_RU_INCIDENT
add constraint ACT_FK_INC_RCAUSE
foreign key (ROOT_CAUSE_INCIDENT_ID_)
references ACT_RU_INCIDENT (ID_);
-- add ACT_INST_ID_ column to execution table --
alter table ACT_RU_EXECUTION
add ACT_INST_ID_ varchar(64);
-- populate ACT_INST_ID_ from history --
-- get from history for active activity instances --
UPDATE
ACT_RU_EXECUTION E
SET
ACT_INST_ID_ = (
SELECT
MAX(ID_)
FROM
ACT_HI_ACTINST HAI
WHERE
HAI.EXECUTION_ID_ = E.ID_
AND
END_TIME_ is null
)
WHERE
E.ACT_INST_ID_ is null
AND
E.ACT_ID_ is not null;
-- remaining executions use execution id as activity instance id --
UPDATE
ACT_RU_EXECUTION E
SET
ACT_INST_ID_ = E.ID_
WHERE
E.ACT_INST_ID_ is null;
-- add SUSPENSION_STATE_ column to task table --
alter table ACT_RU_TASK
add SUSPENSION_STATE_ integer;
UPDATE ACT_RU_TASK T
SET T.SUSPENSION_STATE_ = (
SELECT SUSPENSION_STATE_
FROM ACT_RU_EXECUTION E
WHERE E.ID_ = T.EXECUTION_ID_
);
UPDATE ACT_RU_TASK
SET SUSPENSION_STATE_ = 1
WHERE SUSPENSION_STATE_ is null;
-- add authorizations --------------------------------------
create table ACT_RU_AUTHORIZATION (
ID_ varchar(64) not null,
REV_ integer not null,
TYPE_ integer not null,
GROUP_ID_ varchar(255),
USER_ID_ varchar(255),
RESOURCE_TYPE_ integer not null,
RESOURCE_ID_ varchar(64),
PERMS_ integer,
primary key (ID_),
UNI_USER_ID_ varchar (255) not null generated always as (case when "USER_ID_" is null then "ID_" else "USER_ID_" end),
UNI_GROUP_ID_ varchar (255) not null generated always as (case when "GROUP_ID_" is null then "ID_" else "GROUP_ID_" end),
UNI_RESOURCE_ID_ varchar (64) not null generated always as (case when "RESOURCE_ID_" is null then "ID_" else "RESOURCE_ID_" end)
);
create unique index ACT_UNIQ_AUTH_USER on ACT_RU_AUTHORIZATION(TYPE_,UNI_USER_ID_,RESOURCE_TYPE_,UNI_RESOURCE_ID_);
create unique index ACT_UNIQ_AUTH_GROUP on ACT_RU_AUTHORIZATION(TYPE_,UNI_GROUP_ID_,RESOURCE_TYPE_,UNI_RESOURCE_ID_);
-- add deployment id -------------------------------------------
/** add deployment id to job table */
alter table ACT_RU_JOB
add DEPLOYMENT_ID_ varchar(64);
/** add parent act inst ID */
alter table ACT_HI_ACTINST
add PARENT_ACT_INST_ID_ varchar(64);
|
BEGIN;
ALTER TABLE participants
ADD COLUMN CampaignName varchar(250) NOT NULL;
COMMIT;
|
with all_subnet as (
select
*
from
terraform_resource
where
type = 'azurerm_subnet'
), network_security_group_association as (
select
*
from
terraform_resource
where
type = 'azurerm_subnet_network_security_group_association'
)
select
a.type || ' ' || a.name as resource,
case
when (s.arguments ->> 'subnet_id') is not null then 'ok'
else 'alarm'
end as status,
a.name || case
when (s.arguments ->> 'subnet_id') is not null then ' associated with subnet'
else ' not associated with subnet'
end || '.' reason,
a.path || ':' || a.start_line
from
all_subnet as a
left join network_security_group_association as s on a.name = ( split_part((s.arguments ->> 'subnet_id'), '.', 2));
|
<reponame>muntaza/Open_Persediaan
SELECT
*
FROM
view_beban_barang5_rsud
UNION ALL
|
autocommit off;
select ssn, name, dept_no, salary, location
from employees_v e;
update employees_v
set dept_no = 4,
location = 'oxbridge'
where location = 'marseilles'
or location = 'surrey';
select ssn, name, dept_no, salary, location
from employees_v e order by 1,2,3,4;
rollback work;
rollback;
|
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:opengauss关键字nomaxvalue(非保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists explain_test cascade;
--关键字不带引号-合理报错
create table explain_test(id int,name nomaxvalue);
--关键字带双引号-合理报错
create table explain_test(id int,name "nomaxvalue");
--关键字带单引号-合理报错
create table explain_test(id int,name 'nomaxvalue');
--关键字带反引号-合理报错
create table explain_test(id int,name `nomaxvalue`);
|
-- @testpoint:opengauss关键字more(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists more;
create database more;
drop database more;
--关键字带双引号-成功
drop database if exists "more";
create database "more";
drop database "more";
--关键字带单引号-合理报错
drop database if exists 'more';
create database 'more';
--关键字带反引号-合理报错
drop database if exists `more`;
create database `more`;
|
<filename>openGaussBase/testcase/KEYWORDS/Greatest/Opengauss_Function_Keyword_Greatest_Case0022.sql
-- @testpoint:opengauss关键字Greatest(非保留),作为用户组名
--关键字不带引号-成功
drop group if exists Greatest;
create group Greatest with password '<PASSWORD>';
drop group Greatest;
--关键字带双引号-成功
drop group if exists "Greatest";
create group "Greatest" with password '<PASSWORD>';
drop group "Greatest";
--关键字带单引号-合理报错
drop group if exists 'Greatest';
create group 'Greatest' with password '<PASSWORD>';
--关键字带反引号-合理报错
drop group if exists `Greatest`;
create group `Greatest` with password '<PASSWORD>';
|
alter table `administrator`
drop
foreign key FK_2a5vcjo3stlfcwadosjfq49l1;
alter table `anonymous`
drop
foreign key FK_6lnbc6fo3om54vugoh8icg78m;
alter table `authenticated`
drop
foreign key FK_h52w0f3wjoi68b63wv9vwon57;
alter table `consumer`
drop
foreign key FK_6cyha9f1wpj0dpbxrrjddrqed;
alter table `provider`
drop
foreign key FK_b1gwnjqm6ggy9yuiqm0o4rlmd;
drop table if exists `administrator`;
drop table if exists `anonymous`;
drop table if exists `authenticated`;
drop table if exists `consumer`;
drop table if exists `galanbulletin`;
drop table if exists `gamezbulletin`;
drop table if exists `provider`;
drop table if exists `shout`;
drop table if exists `sotobulletin`;
drop table if exists `user_account`;
drop table if exists `villegasbulletin`;
drop table if exists `hibernate_sequence`;
|
<filename>backup.sql<gh_stars>0
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE users (
user_id INTEGER PRIMARY KEY AUTOINCREMENT,
fullname VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL
, timestamp VARCHAR(255) NULL);
INSERT INTO users VALUES(1,'sandy','<EMAIL>','12345','2021-07-25 22:31:30.154562');
INSERT INTO users VALUES(2,'Sandy','<EMAIL>','password','2021-07-26 22:00:30.154562');
INSERT INTO users VALUES(3,'test','@test','password','2021-07-26 21:00:30.154562');
INSERT INTO users VALUES(5,'amanda j','<EMAIL>','amanda','2021-07-29 23:06:56.183589');
CREATE TABLE administrator (
admin_id INTEGER PRIMARY KEY AUTOINCREMENT,
fullname VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
user_role INTEGER(10) NOT NULL UNIQUE
);
INSERT INTO administrator VALUES(1,'<NAME>','<EMAIL>','<PASSWORD>',1);
INSERT INTO administrator VALUES(2,'<NAME>','<EMAIL>','<PASSWORD>',2);
CREATE TABLE tasks (
task_id INTEGER PRIMARY KEY AUTOINCREMENT,
task_name VARCHAR(255) NOT NULL,
description VARCHAR(255) NOT NULL UNIQUE,
timestamp VARCHAR(255) NOT NULL,
user_id INTEGER(255) NOT NULL
);
INSERT INTO tasks VALUES(1,'Creates Admin Interface','Create Admin Interface - Project 2 on pirple.com','2021-07-26 16:38:30.154562',1);
INSERT INTO tasks VALUES(2,'Create Homework #5','Create Homework #5 on pirple.com','2021-07-24 16:38:30.154562',1);
INSERT INTO tasks VALUES(3,'Create Homework #4','Create Homework #4 on pirple.com','2021-07-24 16:31:30.154562',1);
INSERT INTO tasks VALUES(10,'sandy goreraza tasks','sandy goreraza tasks','2021-07-30 00:07:59.495955',2);
DELETE FROM sqlite_sequence;
INSERT INTO sqlite_sequence VALUES('users',6);
INSERT INTO sqlite_sequence VALUES('administrator',2);
INSERT INTO sqlite_sequence VALUES('tasks',13);
COMMIT;
|
SELECT MIN(chn.name) AS character_name, MIN(mi_idx.info) AS rating, MIN(t.title) AS complete_hero_movie FROM complete_cast AS cc, comp_cast_type AS cct1, comp_cast_type AS cct2, char_name AS chn, cast_info AS ci, info_type AS it2, keyword AS k, kind_type AS kt, movie_info_idx AS mi_idx, movie_keyword AS mk, name AS n, title AS t WHERE cct1.kind = 'cast' AND cct2.kind like '%complete%' AND chn.name is not NULL and (chn.name like '%man%' or chn.name like '%Man%') AND it2.info = 'rating' AND k.keyword in ('superhero', 'marvel-comics', 'based-on-comic', 'fight') AND kt.kind = 'movie' AND mi_idx.info > '8.0' AND t.production_year > 2005 AND kt.id = t.kind_id AND t.id = mk.movie_id AND t.id = ci.movie_id AND t.id = cc.movie_id AND t.id = mi_idx.movie_id AND mk.movie_id = ci.movie_id AND mk.movie_id = cc.movie_id AND mk.movie_id = mi_idx.movie_id AND ci.movie_id = cc.movie_id AND ci.movie_id = mi_idx.movie_id AND cc.movie_id = mi_idx.movie_id AND chn.id = ci.person_role_id AND n.id = ci.person_id AND k.id = mk.keyword_id AND cct1.id = cc.subject_id AND cct2.id = cc.status_id AND it2.id = mi_idx.info_type_id;
|
-- CreateTable
CREATE TABLE `Medico` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`nome` VARCHAR(191) NOT NULL,
`crm` INTEGER NOT NULL,
`fixo` INTEGER NOT NULL,
`celular` INTEGER NOT NULL,
`cep` INTEGER NOT NULL,
UNIQUE INDEX `Medico_crm_key`(`crm`),
UNIQUE INDEX `Medico_celular_key`(`celular`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `Especialidade` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
`nome` VARCHAR(191) NOT NULL,
UNIQUE INDEX `Especialidade_nome_key`(`nome`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `_EspecialidadeToMedico` (
`A` INTEGER NOT NULL,
`B` INTEGER NOT NULL,
UNIQUE INDEX `_EspecialidadeToMedico_AB_unique`(`A`, `B`),
INDEX `_EspecialidadeToMedico_B_index`(`B`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- AddForeignKey
ALTER TABLE `_EspecialidadeToMedico` ADD FOREIGN KEY (`A`) REFERENCES `Especialidade`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `_EspecialidadeToMedico` ADD FOREIGN KEY (`B`) REFERENCES `Medico`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|
DELETE FROM ${dbschema}.berechnungen_tsp_ungleich_lfp2;
INSERT INTO ${dbschema}.berechnungen_tsp_ungleich_lfp2
(aname, bfs_nr, nfgeometer, lfp3, upgrade, geometrie, bemerkung, hoehe)
VALUES
('24033833', 2403, '<NAME>', 't', 't', ST_PointFromText('POINT(2623027.057 1236241.113)', 2056), 'LV95-Gesamtausgleich: 1108.121.0 / 623027.0570 / 236241.1133 / 451.3900 | Kontrollmessung 2018: 11081210,2623027.050,1236241.113,451.352', 451.39);
INSERT INTO ${dbschema}.berechnungen_tsp_ungleich_lfp2
(aname, bfs_nr, nfgeometer, lfp3, upgrade, geometrie, bemerkung, hoehe)
VALUES
('8005215', 2575, '<NAME>', 't', 'f', ST_PointFromText('POINT(2630118.219 1237151.199)', 2056), '2018: Versicherung nicht mehr vorhanden. Neuer Belag/Strasse. LV95-Gesamtausgleich: 1108.422.0 / 630118.2194 / 237151.1995 / 427.8200', 427.82);
INSERT INTO ${dbschema}.berechnungen_tsp_ungleich_lfp2
(aname, bfs_nr, nfgeometer, lfp3, upgrade, geometrie, bemerkung, hoehe)
VALUES
('5005535', 2580, '<NAME>', 't', 't', ST_PointFromText('POINT(2632452.176 1240216.935)', 2056), 'LV95-Gesamtausgleich: 1108.603.0 / 632452.1761 / 240216.9345 / 420.5400 | Kontrollmessung 2018: 11086030,2632452.167,1240216.917,420.503', 420.54);
INSERT INTO ${dbschema}.berechnungen_tsp_ungleich_lfp2
(aname, bfs_nr, nfgeometer, lfp3, upgrade, geometrie, bemerkung, hoehe)
VALUES
('24224957', 2422, '<NAME>', 't', 't', ST_PointFromText('POINT(2619847.180 1241384.290)', 2056), 'LV95-Gesamtausgleich: 1107.801.0 / 619847.1798 241384.2898 / 733.9500 | Kontrollmessung 2018: 11078010,2619847.169,1241384.284,733.885', 733.95);
INSERT INTO ${dbschema}.berechnungen_tsp_ungleich_lfp2
(aname, bfs_nr, nfgeometer, lfp3, upgrade, geometrie, bemerkung, hoehe)
VALUES
('11080080', 2422, '<NAME>', 'f', 'f', ST_PointFromText('POINT(2620891.139 1240644.545)', 2056), 'Punkt gelöscht und Materialisierung entfernt (2003). In LV95-Ausgleichung jedoch berücksichtig.', 594.99);
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 27 Jul 2020 pada 15.46
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.1
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: `les_privat`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `detailles`
--
CREATE TABLE `detailles` (
`id` bigint(20) UNSIGNED NOT NULL,
`id_murid` int(11) NOT NULL,
`id_guru` int(11) NOT NULL,
`id_mapel` int(11) 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 untuk tabel `detailles`
--
INSERT INTO `detailles` (`id`, `id_murid`, `id_guru`, `id_mapel`, `created_at`, `updated_at`) VALUES
(1, 5, 1, 4, '2020-07-26 19:29:26', '2020-07-26 19:29:26'),
(2, 4, 1, 1, '2020-07-26 20:47:38', '2020-07-26 20:47:38'),
(3, 5, 1, 3, '2020-07-26 22:21:27', '2020-07-26 22:21:27');
-- --------------------------------------------------------
--
-- Struktur dari tabel `guru`
--
CREATE TABLE `guru` (
`id` bigint(20) UNSIGNED NOT NULL,
`nama_guru` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`telp` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`alamat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` 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 untuk tabel `guru`
--
INSERT INTO `guru` (`id`, `nama_guru`, `telp`, `alamat`, `email`, `password`, `created_at`, `updated_at`) VALUES
(1, 'Nisrina', '0876513452', 'Jakarta', '<EMAIL>', '<PASSWORD>', NULL, '2020-07-26 06:16:27');
-- --------------------------------------------------------
--
-- Struktur dari tabel `mapel`
--
CREATE TABLE `mapel` (
`id` bigint(20) UNSIGNED NOT NULL,
`nama_mapel` 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 untuk tabel `mapel`
--
INSERT INTO `mapel` (`id`, `nama_mapel`, `created_at`, `updated_at`) VALUES
(1, 'Bahasa Indonesia', '2020-07-25 18:50:26', '2020-07-25 18:50:26'),
(3, 'Ilmu Pengetahuan Alam', NULL, NULL),
(4, 'Ilmu Pengetahuan Sosial', '2020-07-26 05:35:12', '2020-07-26 05:35:12');
-- --------------------------------------------------------
--
-- Struktur dari tabel `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 untuk tabel `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2020_07_23_030647_create_user_table', 1),
(2, '2020_07_23_030714_create_mapel_table', 1),
(3, '2020_07_23_030733_create_guru_table', 1),
(4, '2020_07_23_030749_create_murid_table', 1),
(5, '2020_07_25_082247_create_detailles_table', 2);
-- --------------------------------------------------------
--
-- Struktur dari tabel `murid`
--
CREATE TABLE `murid` (
`id` bigint(20) UNSIGNED NOT NULL,
`nama_murid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`telp` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`alamat` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` 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 untuk tabel `murid`
--
INSERT INTO `murid` (`id`, `nama_murid`, `telp`, `alamat`, `email`, `password`, `created_at`, `updated_at`) VALUES
(1, 'Nisrina', '082136752816', 'malang', '<EMAIL>', '<PASSWORD>', NULL, NULL),
(2, '<NAME>', '0872651438', 'Busan', '<EMAIL>', '<PASSWORD>', '2020-07-25 00:03:49', '2020-07-25 00:03:49'),
(5, '<NAME>', '089654287613', 'Masan', '<EMAIL>', '<PASSWORD>', '2020-07-25 05:55:16', '2020-07-26 05:45:55');
-- --------------------------------------------------------
--
-- Struktur dari tabel `user`
--
CREATE TABLE `user` (
`id` bigint(20) UNSIGNED NOT NULL,
`nama` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` 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 untuk tabel `user`
--
INSERT INTO `user` (`id`, `nama`, `email`, `password`, `created_at`, `updated_at`) VALUES
(1, 'Nisrina', '<EMAIL>', '<PASSWORD>', NULL, NULL),
(3, '<NAME>', '<EMAIL>', '<PASSWORD>', '2020-07-27 00:45:56', '2020-07-27 00:45:56');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `detailles`
--
ALTER TABLE `detailles`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `guru`
--
ALTER TABLE `guru`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `mapel`
--
ALTER TABLE `mapel`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `murid`
--
ALTER TABLE `murid`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `detailles`
--
ALTER TABLE `detailles`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT untuk tabel `guru`
--
ALTER TABLE `guru`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT untuk tabel `mapel`
--
ALTER TABLE `mapel`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `murid`
--
ALTER TABLE `murid`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT untuk tabel `user`
--
ALTER TABLE `user`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
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 */;
|
-- AlterTable
ALTER TABLE "Transaction" ALTER COLUMN "currencyCode" DROP NOT NULL,
ALTER COLUMN "exchangeRate" DROP NOT NULL;
|
<reponame>winterdev001/online-store
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 04, 2020 at 10:43 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.1.12
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: `amizero_market`
--
-- --------------------------------------------------------
--
-- Table structure for table `blogs`
--
CREATE TABLE `blogs` (
`id` bigint(20) UNSIGNED NOT NULL,
`title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` text COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`category_id` int(11) 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 `blogs`
--
INSERT INTO `blogs` (`id`, `title`, `content`, `image`, `category_id`, `created_at`, `updated_at`) VALUES
(1, 'New Trending T-shirts', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent egestas iaculis tristique. Quisque aliquam, turpis in suscipit varius, augue tellus tempor urna, et eleifend lectus sapien sed tortor. Nunc vitae lacus tincidunt, auctor velit et, feugiat leo. Donec orci sem, rutrum nec sem condimentum, eleifend ultricies enim. Nunc pulvinar, quam ut ultricies iaculis, odio enim pretium tellus, auctor fringilla metus tortor in turpis. Nulla facilisi. Etiam sit amet faucibus nunc.\r\n\r\nMauris eu vehicula metus. Proin interdum interdum ullamcorper. Nunc vitae porttitor arcu. Donec eget convallis libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce ut eros vitae felis porta ullamcorper. Aenean consectetur erat sed odio imperdiet vehicula. Maecenas bibendum risus dui, vitae fringilla nunc tincidunt volutpat.', 'tshirt2_1584624697.jpg', 1, '2020-03-19 11:31:37', '2020-03-19 11:31:37'),
(2, 'Best car of the month', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent egestas iaculis tristique. Quisque aliquam, turpis in suscipit varius, augue tellus tempor urna, et eleifend lectus sapien sed tortor. Nunc vitae lacus tincidunt, auctor velit et, feugiat leo. Donec orci sem, rutrum nec sem condimentum, eleifend ultricies enim. Nunc pulvinar, quam ut ultricies iaculis, odio enim pretium tellus, auctor fringilla metus tortor in turpis. Nulla facilisi. Etiam sit amet faucibus nunc.\r\n\r\nMauris eu vehicula metus. Proin interdum interdum ullamcorper. Nunc vitae porttitor arcu. Donec eget convallis libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce ut eros vitae felis porta ullamcorper. Aenean consectetur erat sed odio imperdiet vehicula. Maecenas bibendum risus dui, vitae fringilla nunc tincidunt volutpat.', 'santafe1_1584624734.jpg', 2, '2020-03-19 11:32:14', '2020-03-19 11:32:14'),
(3, 'My go to house style of 2020', 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent egestas iaculis tristique. Quisque aliquam, turpis in suscipit varius, augue tellus tempor urna, et eleifend lectus sapien sed tortor. Nunc vitae lacus tincidunt, auctor velit et, feugiat leo. Donec orci sem, rutrum nec sem condimentum, eleifend ultricies enim. Nunc pulvinar, quam ut ultricies iaculis, odio enim pretium tellus, auctor fringilla metus tortor in turpis. Nulla facilisi. Etiam sit amet faucibus nunc.\r\n\r\nMauris eu vehicula metus. Proin interdum interdum ullamcorper. Nunc vitae porttitor arcu. Donec eget convallis libero. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce ut eros vitae felis porta ullamcorper. Aenean consectetur erat sed odio imperdiet vehicula. Maecenas bibendum risus dui, vitae fringilla nunc tincidunt volutpat.', 'FANCY-15_1584624772.gif', 3, '2020-03-19 11:32:52', '2020-03-19 11:32:52');
-- --------------------------------------------------------
--
-- Table structure for table `blog_categories`
--
CREATE TABLE `blog_categories` (
`id` bigint(20) UNSIGNED NOT NULL,
`category_name` varchar(191) 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 `blog_categories`
--
INSERT INTO `blog_categories` (`id`, `category_name`, `created_at`, `updated_at`) VALUES
(1, 'Fashion', '2020-03-19 11:30:01', '2020-03-19 11:30:01'),
(2, 'Cars', '2020-03-19 11:30:09', '2020-03-19 11:30:09'),
(3, 'House', '2020-03-19 11:30:20', '2020-03-19 11:30:20');
-- --------------------------------------------------------
--
-- Table structure for table `carousels`
--
CREATE TABLE `carousels` (
`id` bigint(20) UNSIGNED NOT NULL,
`first_title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`second_title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(191) 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 `carousels`
--
INSERT INTO `carousels` (`id`, `first_title`, `second_title`, `image`, `created_at`, `updated_at`) VALUES
(1, 'New-Season', 'New watch 2020', 'banner-07_1584625062.jpg', '2020-03-19 11:27:25', '2020-03-19 11:37:42'),
(2, 'New-Season', 'New arrival Bags', 'banner-06_1584625089.jpg', '2020-03-19 11:28:50', '2020-03-19 11:38:09'),
(3, 'New-Season', 'Best choice of 2020', 'banner-01_1584625125.jpg', '2020-03-19 11:29:45', '2020-03-19 11:38:45');
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
CREATE TABLE `categories` (
`id` bigint(20) UNSIGNED NOT NULL,
`category_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`image` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `categories`
--
INSERT INTO `categories` (`id`, `category_name`, `created_at`, `updated_at`, `image`) VALUES
(1, 'Fashion', '2020-03-19 11:17:34', '2020-03-19 11:17:34', '1_1584623853.jpg'),
(2, 'House', '2020-03-19 11:20:24', '2020-03-19 11:20:24', '1-480x270_1584624024.gif'),
(3, 'Cars', '2020-03-19 11:20:52', '2020-04-01 10:27:32', 'cars_1585744052.jpg'),
(4, 'Electronics', '2020-04-01 10:25:59', '2020-04-01 10:25:59', 'comp_1585743958.jpg'),
(5, 'Sport', '2020-04-01 10:26:17', '2020-04-01 10:26:17', 'sport_1585743977.jpg'),
(6, 'Plot', '2020-04-01 10:26:42', '2020-04-01 10:26:42', 'house_1585744002.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `comments`
--
CREATE TABLE `comments` (
`id` bigint(20) UNSIGNED NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`content` text COLLATE utf8mb4_unicode_ci NOT NULL,
`for` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`for_id` int(11) 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 `comments`
--
INSERT INTO `comments` (`id`, `email`, `content`, `for`, `for_id`, `created_at`, `updated_at`) VALUES
(1, '<EMAIL>', 'nice house!!', 'product', 2, '2020-03-19 14:30:08', '2020-03-19 14:30:08'),
(3, '<EMAIL>', 'nice car', 'product', 3, '2020-03-19 14:38:38', '2020-03-19 14:38:38'),
(5, '<EMAIL>', 'i wonder where you got them?', 'product', 1, '2020-03-19 14:48:57', '2020-03-19 14:48:57'),
(6, '<EMAIL>', 'Woow!', 'product', 2, '2020-03-19 14:57:36', '2020-03-19 14:57:36'),
(12, '<EMAIL>', 'test', 'blog', 1, '2020-03-20 09:19:48', '2020-03-20 09:19:48'),
(13, '<EMAIL>', 'wooow', 'blog', 3, '2020-03-20 13:55:39', '2020-03-20 13:55:39');
-- --------------------------------------------------------
--
-- Table structure for table `fields`
--
CREATE TABLE `fields` (
`id` bigint(20) UNSIGNED NOT NULL,
`field_name` varchar(191) 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 `fields`
--
INSERT INTO `fields` (`id`, `field_name`, `created_at`, `updated_at`) VALUES
(1, 'SUV', '2020-03-19 11:21:18', '2020-03-19 11:21:18'),
(2, 'Collection', '2020-03-19 11:21:30', '2020-03-19 11:21:30'),
(4, 'T-shirt', '2020-03-19 13:23:30', '2020-03-19 13:23:30'),
(5, 'Jackets', '2020-03-19 13:25:53', '2020-03-19 13:25:53'),
(6, 'Residential', '2020-04-01 17:11:09', '2020-04-01 17:11:09'),
(7, 'Shoes', '2020-04-01 17:12:05', '2020-04-01 17:12:05');
-- --------------------------------------------------------
--
-- Table structure for table `messages`
--
CREATE TABLE `messages` (
`id` bigint(20) UNSIGNED NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`message` varchar(191) 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 `messages`
--
INSERT INTO `messages` (`id`, `email`, `message`, `created_at`, `updated_at`) VALUES
(1, '<EMAIL>', 'where is your address ecactly?', '2020-03-19 15:26:12', '2020-03-19 15:26:12'),
(2, '<EMAIL>', 'do you sell online too?', '2020-03-19 15:27:19', '2020-03-19 15:27:19'),
(4, '<EMAIL>', 'where can i find you?', '2020-03-20 13:56:25', '2020-03-20 13:56:25');
-- --------------------------------------------------------
--
-- 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
(25, '2014_10_12_000000_create_users_table', 1),
(26, '2014_10_12_100000_create_password_resets_table', 1),
(27, '2020_03_06_062717_create_products_table', 1),
(28, '2020_03_06_062923_create_categories_table', 1),
(29, '2020_03_06_062937_create_fields_table', 1),
(30, '2020_03_06_121738_create_product_images_table', 1),
(31, '2020_03_10_074355_add_user_id_to_products', 1),
(32, '2020_03_10_095021_add_image_to_categories', 1),
(33, '2020_03_16_123518_create_carousels_table', 1),
(34, '2020_03_17_093921_create_blogs_table', 1),
(35, '2020_03_17_093937_create_blog_categories_table', 1),
(36, '2020_03_19_153353_create_comments_table', 2),
(37, '2020_03_19_153405_create_messages_table', 2),
(38, '2020_03_20_134324_add_image_to_users', 3);
-- --------------------------------------------------------
--
-- 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 `products`
--
CREATE TABLE `products` (
`id` bigint(20) UNSIGNED NOT NULL,
`product_name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`price` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`total` int(11) NOT NULL,
`description` text COLLATE utf8mb4_unicode_ci NOT NULL,
`product_images` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`seller_phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`seller_email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`category_id` int(11) NOT NULL,
`field_id` int(11) NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data for table `products`
--
INSERT INTO `products` (`id`, `product_name`, `price`, `quantity`, `total`, `description`, `product_images`, `status`, `seller_phone`, `seller_email`, `category_id`, `field_id`, `created_at`, `updated_at`, `user_id`) VALUES
(1, 'Collection 1', 35, 3, 105, 'New fashion collection!', '[\"2_1584624161.jpg\"]', '0', '0789023456', '<EMAIL>', 1, 2, '2020-03-19 11:22:42', '2020-03-19 11:22:42', 1),
(2, 'Villa', 400000, 2, 800000, 'New villa in kigali', '[\"RENDER-05_1584624319.gif\",\"h14aa-300x155_1584624319.gif\",\"RENDER-08_1584624319.gif\"]', '0', '0789023498', '<EMAIL>', 2, 6, '2020-03-19 11:25:19', '2020-04-01 17:11:40', 1),
(3, 'Santafe 2020', 30000, 1, 30000, 'new santafe', '[\"santafe1_1584624401.jpg\"]', '0', '0789023411', '<EMAIL>', 3, 1, '2020-03-19 11:26:41', '2020-03-19 11:26:41', 1),
(4, 'New Jacket', 10, 3, 30, 'new T-shirt', '[\"product-detail-03_1584631523.jpg\",\"product-detail-02_1584631523.jpg\",\"product-detail-01_1584631523.jpg\"]', '0', '0789023456', '<EMAIL>', 1, 5, '2020-03-19 13:25:23', '2020-03-19 13:26:28', 1),
(5, 'Off-white Vans', 19, 2, 38, 'Brand new all white vans.', '[\"vans_1585768404.jpg\"]', '0', '0789023450', '<EMAIL>', 1, 7, '2020-04-01 17:13:24', '2020-04-01 17:13:24', 1),
(6, 'Jordan one', 27, 1, 27, 'Brand new Jordan ones with rare colours , get yours before its all sell out.', '[\"j1_1585768590.jpg\",\"j3_1585768590.jpg\",\"j2_1585768590.jpg\"]', '0', '0789023452', '<EMAIL>', 1, 7, '2020-04-01 17:16:30', '2020-04-01 17:16:30', 1);
-- --------------------------------------------------------
--
-- Table structure for table `product_images`
--
CREATE TABLE `product_images` (
`id` bigint(20) UNSIGNED NOT NULL,
`product_id` int(11) NOT NULL,
`image` varchar(191) 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;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`super` tinyint(1) NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`image` varchar(191) COLLATE utf8mb4_unicode_ci NOT 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`, `phone`, `super`, `remember_token`, `created_at`, `updated_at`, `image`) VALUES
(1, 'admin', '<EMAIL>', NULL, '$2y$10$SSJTJjQ82fUvpH9xFkJEFOj.Shkl.IZT4bX4WfzreCvTPcrnnkgoK', '<PASSWORD>', 1, NULL, NULL, '2020-03-20 14:23:59', 'banner-01_1584721439.jpg'),
(2, 'Alan', '<EMAIL>', NULL, '$2y$10$nbDSQ34iV4ydJRGHAdircu9YrbXoD52mxcXsJ2H3mB1AEJDB5qG/2', '0700000000', 0, NULL, '2020-03-20 12:05:17', '2020-03-20 13:04:41', 'product-min-01_1584716681.jpg'),
(3, 'fab', '<EMAIL>', NULL, '$2y$10$lUbDWaKex/zT0iI3XbvsEOAt8kO5rp9hiFxSpUyyNcSz8qG49hzZy', '0711111111', 0, NULL, '2020-03-20 13:58:47', '2020-03-20 13:58:47', 'noimage.jpg');
--
-- Indexes for dumped tables
--
--
-- 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 `carousels`
--
ALTER TABLE `carousels`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `fields`
--
ALTER TABLE `fields`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `messages`
--
ALTER TABLE `messages`
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 `products`
--
ALTER TABLE `products`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `product_images`
--
ALTER TABLE `product_images`
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 `blogs`
--
ALTER TABLE `blogs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `blog_categories`
--
ALTER TABLE `blog_categories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `carousels`
--
ALTER TABLE `carousels`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `comments`
--
ALTER TABLE `comments`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `fields`
--
ALTER TABLE `fields`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `messages`
--
ALTER TABLE `messages`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `product_images`
--
ALTER TABLE `product_images`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
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 */;
|
<filename>dataibuy.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th10 20, 2020 lúc 05:37 PM
-- Phiên bản máy phục vụ: 10.4.11-MariaDB
-- Phiên bản PHP: 7.2.31
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 */;
--
-- Cơ sở dữ liệu: `dataibuy`
--
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `categories`
--
CREATE TABLE `categories` (
`id_category` bigint(20) UNSIGNED NOT NULL,
`name_category` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`image_category` 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;
--
-- Đang đổ dữ liệu cho bảng `categories`
--
INSERT INTO `categories` (`id_category`, `name_category`, `image_category`, `created_at`, `updated_at`) VALUES
(3, 'iPhone', '24.jpg', NULL, NULL),
(4, 'SamSung', '43.jpg', NULL, NULL),
(5, 'Oppo', '94.png', NULL, NULL),
(6, 'Xiaomi', '85.jpg', NULL, NULL),
(7, 'Vivo', '76.jpg', NULL, NULL),
(8, 'Realme', '25.png', NULL, NULL),
(9, 'Nokia', '3.jpg', NULL, NULL),
(10, 'Huawei', '39.jpg', NULL, NULL);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `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;
--
-- Đang đổ dữ liệu cho bảng `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(13, '2014_10_12_000000_create_users_table', 1),
(14, '2014_10_12_100000_create_password_resets_table', 1),
(15, '2019_08_19_000000_create_failed_jobs_table', 1),
(16, '2020_11_10_031649_create_roles_table', 1),
(17, '2020_11_02_000222_create_product_table', 2),
(18, '2020_11_08_013244_create_categories_table', 2),
(19, '2020_11_19_103606_create_users_table', 3),
(20, '2020_11_19_112805_create_users_table', 4),
(21, '2020_11_20_060133_create_users_table', 5),
(22, '2020_11_20_060714_create_users_table', 6);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `product`
--
CREATE TABLE `product` (
`id_product` bigint(20) UNSIGNED NOT NULL,
`id_category` int(11) NOT NULL,
`name_product` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`price_product` double NOT NULL,
`description_product` text COLLATE utf8mb4_unicode_ci NOT NULL,
`quantity_product` double NOT NULL,
`image_product` 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;
--
-- Đang đổ dữ liệu cho bảng `product`
--
INSERT INTO `product` (`id_product`, `id_category`, `name_product`, `price_product`, `description_product`, `quantity_product`, `image_product`, `created_at`, `updated_at`) VALUES
(3, 3, 'iPhone 11 Pro Max 64GB', 29990000, 'KHUYẾN MÃI TRỊ GIÁ 2.000.000₫\r\nGiá và khuyến mãi dự kiến áp dụng đến 23:00 30/11\r\nGiảm giá 2,000,000đ *\r\nPhụ kiện Apple mua kèm giảm đến 20% (không áp dụng đồng thời KM khác) Xem chi tiết\r\nPin sạc dự phòng giảm 30% khi mua kèm. (click xem chi tiết)\r\nTặng 02 suất mua Đồng hồ thời trang giảm 40% (Không áp dụng thêm khuyến mãi khác).\r\nTặng 100.000₫ mua hàng tại website thành viên BachhoaXANH.com, áp dụng khi mua Online tại Tp.HCM và 1 số khu vực (Xem thể lệ)\r\n- Một số điện thoại được nhận 1 lần duy nhất\r\n\r\n- PMH được tặng cho KH chưa từng mua hàng tại BachhoaXANH Online', 12, '41.png', NULL, NULL),
(4, 6, 'Điện thoại Xiaomi Redmi 9 (4GB/64GB)', 3790000, 'KHUYẾN MÃI\r\nGiá và khuyến mãi áp dụng đặt và nhận hàng từ 00:00 13/11 - 23:59 15/11\r\nPin sạc dự phòng giảm 30% khi mua kèm. (click xem chi tiết)\r\nTặng 02 suất mua Đồng hồ thời trang giảm 40% (Không áp dụng thêm khuyến mãi khác).\r\nTặng 100.000₫ mua hàng tại website thành viên BachhoaXANH.com, áp dụng khi mua Online tại Tp.HCM và 1 số khu vực (Xem thể lệ)\r\n- Một số điện thoại được nhận 1 lần duy nhất\r\n\r\n- PMH được tặng cho KH chưa từng mua hàng tại BachhoaXANH Online', 12, '66.png', NULL, NULL),
(5, 5, 'Điện thoại OPPO A93', 7190000, 'KHUYẾN MÃI\r\nGiá và khuyến mãi dự kiến áp dụng đến 23:00 15/11\r\nPin sạc dự phòng giảm 30% khi mua kèm. (click xem chi tiết)\r\nTặng 02 suất mua Đồng hồ thời trang giảm 40% (Không áp dụng thêm khuyến mãi khác).\r\nTặng 100.000₫ mua hàng tại website thành viên BachhoaXANH.com, áp dụng khi mua Online tại Tp.HCM và 1 số khu vực (Xem thể lệ)\r\n- Một số điện thoại được nhận 1 lần duy nhất\r\n\r\n- PMH được tặng cho KH chưa từng mua hàng tại BachhoaXANH Online', 112, '2.png', NULL, NULL),
(6, 4, 'Điện thoại Samsung Galaxy Note 20 Ultra', 26990000, 'KHUYẾN MÃI\r\nGiá và khuyến mãi dự kiến áp dụng đến 23:00 15/11\r\nGiảm giá 5,000,000đ khi tham gia thu cũ đổi mới Note 20 Series Xem chi tiết\r\nƯu đãi phòng chờ thương gia Xem chi tiết\r\nTrả góp 0% thẻ tín dụng Xem chi tiết\r\nPin sạc dự phòng giảm 30% khi mua kèm. (click xem chi tiết)\r\nTặng 02 suất mua Đồng hồ thời trang giảm 40% (Không áp dụng thêm khuyến mãi khác).\r\nTặng 100.000₫ mua hàng tại website thành viên BachhoaXANH.com, áp dụng khi mua Online tại Tp.HCM và 1 số khu vực (Xem thể lệ)\r\n- Một số điện thoại được nhận 1 lần duy nhất\r\n\r\n- PMH được tặng cho KH chưa từng mua hàng tại BachhoaXANH Online', 123, '23.png', NULL, NULL),
(7, 9, 'Điện thoại Nokia 8.3 5G', 11990000, 'KHUYẾN MÃI\r\nGiá và khuyến mãi dự kiến áp dụng đến 23:00 30/11\r\nPin sạc dự phòng giảm 30% khi mua kèm. (click xem chi tiết)\r\nTặng 02 suất mua Đồng hồ thời trang giảm 40% (Không áp dụng thêm khuyến mãi khác).\r\nTặng 100.000₫ mua hàng tại website thành viên BachhoaXANH.com, áp dụng khi mua Online tại Tp.HCM và 1 số khu vực (Xem thể lệ)\r\n- Một số điện thoại được nhận 1 lần duy nhất\r\n\r\n- PMH được tặng cho KH chưa từng mua hàng tại BachhoaXANH Online', 12, '89.png', NULL, NULL);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `roles`
--
CREATE TABLE `roles` (
`id` bigint(20) UNSIGNED NOT NULL,
`name_roles` 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;
--
-- Đang đổ dữ liệu cho bảng `roles`
--
INSERT INTO `roles` (`id`, `name_roles`, `created_at`, `updated_at`) VALUES
(1, 'admin', '2020-11-11 02:07:05', '2020-11-11 02:07:05'),
(2, 'user', '2020-11-11 02:07:05', '2020-11-11 02:07:05');
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`gender` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`image` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`address` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`roles_id` int(11) NOT NULL DEFAULT 2,
`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;
--
-- Đang đổ dữ liệu cho bảng `users`
--
INSERT INTO `users` (`id`, `name`, `gender`, `image`, `email`, `phone`, `address`, `roles_id`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(3, '<NAME>', 'Nam', '1605858382.jpg', '<EMAIL>', '0853344503', '36 Ng<NAME>, <NAME>, Liên chiểu , <NAME>', 2, NULL, '$2y$10$hywpqZ3JCzAtnnKUQMr8M.MForgLFWymAPrf/IPMUPjr54mUYx3BG', NULL, '2020-11-20 00:46:22', '2020-11-20 01:13:03'),
(5, '<NAME>', 'Nữ', '1605860561.jpg', '<EMAIL>', '6489977641', '9039 Danika PrairieLake Fredericton, NH 19776-6802', 2, NULL, '$2y$10$MiB/s4lhXMpFKowxRyJ0NupxALQ12lmINaVL.XZ9EXhxkLxNAjFxS', NULL, '2020-11-20 01:22:41', '2020-11-20 01:22:41'),
(7, 'admin', 'Nữ', '1605886434.jpg', '<EMAIL>', '0853344503', '36 Ngô Thị Nhậm, <NAME>, Liên chiểu , Đà Nẵng', 1, NULL, '$2y$10$iZRj.r4DhAqjaqOi/iiKXuH75EoNoyrz4Hbh8rcrPI3z5BS.yIUA6', NULL, '2020-11-20 08:33:54', '2020-11-20 08:33:54');
--
-- Chỉ mục cho các bảng đã đổ
--
--
-- Chỉ mục cho bảng `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id_category`);
--
-- Chỉ mục cho bảng `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Chỉ mục cho bảng `product`
--
ALTER TABLE `product`
ADD PRIMARY KEY (`id_product`);
--
-- Chỉ mục cho bảng `roles`
--
ALTER TABLE `roles`
ADD PRIMARY KEY (`id`);
--
-- Chỉ mục cho bảng `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT cho các bảng đã đổ
--
--
-- AUTO_INCREMENT cho bảng `categories`
--
ALTER TABLE `categories`
MODIFY `id_category` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT cho bảng `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=23;
--
-- AUTO_INCREMENT cho bảng `product`
--
ALTER TABLE `product`
MODIFY `id_product` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT cho bảng `roles`
--
ALTER TABLE `roles`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT cho bảng `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
<gh_stars>0
SELECT COUNT (DISTINCT city) FROM customers
|
ALTER TABLE `myfreshword`.`ts_products`
ADD COLUMN `prod_preacher_id` INT(11) NOT NULL AFTER `prod_urlname`;
|
#select * from users where emailaddress like '%mathais.co.ke'
select * from users where emailaddress like '<EMAIL>'
|
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = dis, pg_catalog;
--
-- Name: status_agg(text); Type: AGGREGATE; Schema: dis; Owner: postgres
--
CREATE AGGREGATE status_agg(text) (
SFUNC = status_test,
STYPE = text
);
ALTER AGGREGATE dis.status_agg(text) OWNER TO postgres;
--
-- Name: AGGREGATE status_agg(text); Type: COMMENT; Schema: dis; Owner: postgres
--
COMMENT ON AGGREGATE status_agg(text) IS 'Aggregate test status (2012-03-15)';
--
-- PostgreSQL database dump complete
--
|
<gh_stars>100-1000
alter table email_verifications alter column key set data type uuid using key::uuid;
|
CREATE DATABASE onlinejudge_test;
\c onlinejudge_test;
\q
|
-- ----------------------------
-- Table structure for `{{%life_collection}}`
-- ----------------------------
CREATE TABLE `{{%life_collection}}` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`col_name` varchar(50) NOT NULL DEFAULT '' COMMENT '集合名称',
`data` text DEFAULT NULL COMMENT '数据',
`expire_at` datetime NOT NULL COMMENT '有效时间',
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
KEY `idx_colName` (`col_name`),
KEY `idx_expireAt` (`expire_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='db驱动的生命周期数据存储';
|
/* Training: SQL - Exercises */
-- DESCRIPTION: The purpose of this script is to provide exercises for the trainee to practice what
-- was covered in the accompanying `training_sql_heavyuser.ipynb` notebook.
USE [AdventureWorks];
/* Question 1: Dynamic SQL querying #1 */
-- Q. Is there an even more efficient way to perform the same task as in the query below
-- without having to use dynamic SQL querying?
-- Hint: Consider using System Talbes belong to the [INFORMATION_SCHEMA] database.
-- Note: This exercise introduces you to some very useful tables that exist in the background which
-- will be extremely useful for data management tasks. It also shows that dynamic SQL is not always the best option.
-- A. Please write your answer below.
SELECT
[SchemaName] = SCHEMA_NAME(table_object.[schema_id])
,[TableName] = table_object.[Name]
,[RowCount] = AVG(table_partition.[rows])
FROM [sys].[objects] AS table_object
INNER JOIN [sys].[partitions] table_partition
ON table_object.[object_id] = table_partition.[object_id]
WHERE table_object.[type] = 'U'
GROUP BY
table_object.[schema_id]
,table_object.[Name];
/* Question 2: Inserting data into tables */
-- Q. The [Person].[ProductPreference] table has been created for you to work with.
-- Can you complte one row of this table with your preferences?
CREATE TABLE [Person].[ProductPreference]
(
[StaffId] INT IDENTITY(1,1) PRIMARY KEY
,[StaffUnit] NVARCHAR(25)
,[BookFavourite] NVARCHAR(100)
,[BookAuthor] NVARCHAR(100)
,[SongFavourite] NVARCHAR(100)
,[SongArtist] NVARCHAR(100)
,[FilmFavourite] NVARCHAR(100)
,[FilmDirector] NVARCHAR(100)
,[DateTimeCreation] DATETIME DEFAULT(GETDATE())
);
-- Note: From the definitions of the [StaffId] and [DateTimeCreation] fields,
-- there is no need for you to enter these yourselves. Do you know what they do?
-- A. Please write your answer below.
INSERT INTO [Person].[ProductPreference]
(
[StaffUnit]
,[BookFavourite]
,[BookAuthor]
,[SongFavourite]
,[SongArtist]
,[FilmFavourite]
,[FilmDirector]
)
VALUES
('Statistics', 'Half a Lifelong Romance', 'Eileen Chang', 'Night Dream', 'LEEBADA', 'The Handmaiden', 'Park Chan-wook');
-- [StaffId] counts the row entry that the record sits in.
-- [DataTimeCreation] records the data and time the record was created.
/* Question 3: Thinking about objects in SQL */
-- Q. Consider the following discussion questions below:
-- 1. Thinking about the [StaffId] column, do you know what it does?
-- 2. Why might the name of this column be inappropriate for what it actually does?
-- 3. Can you think of a way to improve this?
-- A. Please write your answer below.
-- 1. Is a row counter.
-- 2. The same member of staff should get the same [StaffId] entry but will get different ones
-- when they enter two rows of data.
-- 3. Rename the [StaffId] column to [RowId] or something similar. Have an
-- extra column that identifies unique SQL user.
-- Addedum: This is not a well-governed table as a consequence of this.
/* Question 4: Dynamic unpivoting*/
-- In actual fact, the table created above, [Person].[ProductPreference] is not in a tidy data form.
-- As a database manager, this is a personal affront to you as you want to provide analysts with a
-- formatted table of data that makes their jobs easier.
-- Q. Can you unpivot the [Person].[ProductPreference] table so that it is in tidy data format?
-- Try to unpivot it without explicitly referncing the columns you want to unpivot to rows.
-- Note: This exercise is designed to get you thinking about what makes a good, structured table in SQL
-- that's helpful to the end-user, the analyst. It brings in concepts covered in (1.) and (2.).
-- A. Please write your answer below.
-- Addedum: This is not a well-governed table because the database is meant to be
-- providing nicely formatted data for analysts and this table is not in tidy format.
-- declare variables to use in dynamic sql
DECLARE @cols AS NVARCHAR(MAX), @query AS NVARCHAR(MAX);
DECLARE @name_schema AS NVARCHAR(25) = 'Person';
DECLARE @name_table AS NVARCHAR(50) = 'ProductPreference';
DECLARE @columns_keep AS NVARCHAR(255) = 'StaffId,StaffUnit';
DECLARE @column_measure AS NVARCHAR(15) = 'MediaType';
DECLARE @column_value AS NVARCHAR(15) = 'MediaSelection';
-- store list of all columns
SET @cols =
(
SELECT STRING_AGG([COLUMN_NAME],',')
FROM (
SELECT DISTINCT [COLUMN_NAME]
FROM [INFORMATION_SCHEMA].[COLUMNS]
WHERE [TABLE_NAME] = @name_table
-- cheated a bit here as this is causing issue
AND [COLUMN_NAME] NOT IN ('DataTimeCreation')
) AS t
);
-- remove columns we don't want to unpivot from list of variables
SET @cols = REPLACE(@cols, ',' + @columns_keep, '');
-- dynamic SQL unpivot
set @query =
'
SELECT ' + @columns_keep + ',' + @column_measure + ', ' + @column_value + '
FROM
(
SELECT *
FROM [' + @name_schema + '].[' + @name_table + ']
) AS x
UNPIVOT
(' +
@column_value + '
FOR ' + @column_measure + ' IN (' + @cols + ')
) AS p
';
-- see dynamic SQL query generated
PRINT @query;
-- execute dynamic SQL query
EXEC sp_executesql @query;
/* Question 5: Adding contraint to prevent rogue entries */
-- Q. In the [Person].[ProductPreference] table, can you add a constraint on
-- the [FilmFavourite] column to ensure that is must always be completed?
-- A. Please write your answer below.
ALTER TABLE [Person].[ProductPreference]
ALTER COLUMN [FilmFavourite] NVARCHAR(100) NOT NULL;
/* Question 6: Stored procedures and functions */
-- Q. From running the stored procedure and function defined above,
-- what is the difference in how they are prompted to run?
-- A. Please write your answer below.
-- Stored procedure is run in its entirety, with an `EXEC <stored_proc_name>`
-- whereas function is run within a `SELECT ...` statement. This leads to differences
-- in how they are used.
/* Question 7: Querying from a big-brother table */
-- Q. In the [AuditDetails].[vw_DatabaseChangeLog] table, can you query it
-- to look for changes that you have done to the database?
-- A. Please write your answer below.
SELECT *
FROM [AuditDetails].[vw_DatabaseChangeLog]
WHERE [NameUser] LIKE '%Ho%';
|
-- Purpose: show db stat
-- pp_awr2.sql: for normal width screen. e.g. laptop.
set feed off
--@pipe_ostat/pp_0501
col output format a170
set feed on serveroutput on arraysize 1 verify off
select * from table( sys.pipe_ostat.pipe_xdiff('
with t as ( select stat_name name,value,cumulative from v$osstat),
s as (select name,value from v$sysstat )
select name ,'''' display_name ,value ,''NO'' show ,cumulative ,'''' formula from t where name like ''%TIME%''
union all select stat_name name ,'''' ,value ,''NO'' ,''YES'' ,'''' from v$sys_time_model where STAT_name in (''DB CPU'',''background cpu time'',''DB time'')
--union all select name ,'''' ,value ,''YES'' ,cumulative ,'''' from t where /*name like ''VM%'' or */name = ''LOAD''
union all select '''' ,''%Idle'' ,0 ,''YES'' ,''YES'' ,''"IDLE_TIME"/("BUSY_TIME"+"IDLE_TIME")*100'' from dual
--union all select '''' ,''%TotalCPU'' ,0 ,''YES'' ,''YES'' ,''("DB CPU"+"background cpu time")/10000/("BUSY_TIME"+"IDLE_TIME")*100'' from dual
--union all select '''' ,''DBtime(ms)'' ,0 ,''YES'' ,''YES'' ,''"DB time"/1000'' from dual
union all select '''' ,''DBCPU(ms)'' ,0 ,''YES'' ,''YES'' ,''"DB CPU"/1000'' from dual
--union all select '''' ,''BgCPU(ms)'' ,0 ,''YES'' ,''YES'' ,''"background cpu time"/1000'' from dual
union all select '''' ,''PhyIO'' ,sum(value) ,''YES'' ,''YES'' ,'''' from s where name in (''physical write IO requests'',''physical read IO requests'')
--union all select '''' ,''GCBlkRcv'' ,sum(value) ,''YES'' ,''YES'' ,'''' from s where name in (''gc cr blocks received'',''gc current blocks received'')
--union all select '''' ,''GCBlkSvd'' ,sum(value) ,''YES'' ,''YES'' ,'''' from s where name in (''gc current blocks served'',''gc cr blocks served'')
union all select '''' ,''Trans'' ,sum(value) ,''YES'' ,''YES'' ,'''' from s where name in (''user rollbacks'',''user commits'')
--union all select '''' ,''%BusyCPU'' ,0 ,''YES'' ,''YES'' ,''("DB CPU"+"background cpu time")/10000/"BUSY_TIME"*100'' from dual
--union all select '''' ,''%User'' ,0 ,''YES'' ,''YES'' ,''"USER_TIME"/("BUSY_TIME"+"IDLE_TIME")*100'' from dual
--union all select '''' ,''%Sys'' ,0 ,''YES'' ,''YES'' ,''"SYS_TIME"/("BUSY_TIME"+"IDLE_TIME")*100'' from dual
--union all select '''' ,''%WIO'' ,0 ,''YES'' ,''YES'' ,''"IOWAIT_TIME"/("BUSY_TIME"+"IDLE_TIME")*100'' from dual
union all select name ,decode(name
,''redo size'' ,''RedoMB''
,''undo change vector size'' ,''UndoVecMB''
,''redo entries'' ,''Redo''
,''db block changes'' ,''BlkChg''
,''physical reads'' ,''PhyRdBlk''
,''physical writes'' ,''PhyWtBlk''
,''session logical reads'' ,''LgcRdBlk''
,''physical read IO requests'' ,''PhyRdReq''
,''physical write IO requests'' ,''PhyWtReq''
,''physical read total bytes'' ,''PhyRdMB''
,''physical write total bytes'' ,''PhyWtMB''
,''session logical reads - IM'' ,''LgcRd-IM''
,''parse count (total)'' ,''ParseTotal''
,''parse count (hard)'' ,''ParseHard''
,''user calls'' ,''UserCalls''
,''execute count'' ,''ExecSQL''
,''recursive calls'' ,''RecuCalls''
,''user rollbacks'' ,''Rollback''
,''logons cumulative'' ,''Logons''
,''cell writes to flash cache'' ,''CeFCWt''
,''cell physical IO interconnect bytes'',''CePhyICMB''
,''cell logical write IO requests'',''CeLgcWtReq''
,''workarea executions - optimal'',''WAreaOptm''
,name) ,decode(name
,''redo size'' ,value/1048576
,''cell physical IO interconnect bytes'' ,value/1048576
,''physical read total bytes'' ,value/1048576
,''physical write total bytes'' ,value/1048576
,''undo change vector size'' ,value/1048576
,value) ,''YES'' ,''YES'' ,'''' from s where name in (
''undo change vector size'' ,
''redo size'' ,
--''redo entries'' ,
''db block changes'' ,
--''physical reads'' ,''physical writes'' ,
--''physical write IO requests'' ,''physical read IO requests'' ,
''physical read total bytes'' ,''physical write total bytes'' ,
--''IM scan rows'' ,''session logical reads - IM'' ,
''user calls'' ,''execute count'' ,
--''recursive calls'' ,
--''parse count (total)'' ,
''parse count (hard)'' ,
''user rollbacks'' ,''session logical reads''
,''workarea executions - optimal''
--,''cell writes to flash cache'' ,''cell physical IO interconnect bytes'',''cell logical write IO requests''
--,''logons cumulative''
)
',
sql_str_2=>'
-----------------awr - Instance Efficiency Percentages (Target 100%)
-- Buffer Nowait %:
--union all select ''buffer waits'' ,'''' ,sum(count) ,''NO'' ,''YES'' ,'''' from v$waitstat
--union all select '''' ,''%BufNowait'' ,0 ,''YES'' ,''YES'' ,''100*(1-"buffer waits"/"session logical reads")'' from dual
-- Buffer Hit %:
union all select name ,'''' ,value ,''NO'' ,''YES'' ,'''' from s where name in (''physical reads'',''physical reads direct'',''physical reads direct (lob)'',''session logical reads'')
union all select '''' ,''%BufHit'' ,0 ,''YES'' ,''YES'' ,''100*(1-("physical reads"-"physical reads direct"-"physical reads direct (lob)")/"session logical reads")'' from dual
-- Library Hit %:
--union all select ''library pins'' ,'''' ,sum(pins) ,''NO'' ,''YES'' ,'''' from v$librarycache
--union all select ''library pinhits'' ,'''' ,sum(pinhits) ,''NO'' ,''YES'' ,'''' from v$librarycache
--union all select '''' ,''%LibHit'' ,0 ,''YES'' ,''YES'' ,''100*"library pinhits"/"library pins"'' from dual
-- Execute to Parse %:
union all select name ,'''' ,value ,''NO'' ,''YES'' ,'''' from s where name in (''parse count (total)'',''execute count'')
union all select '''' ,''%Exec2Prse'' ,0 ,''YES'' ,''YES'' ,''100*(1-"parse count (total)"/"execute count")'' from dual
-- Parse CPU to Parse Elapsd %:
union all select name ,'''' ,value ,''NO'' ,''YES'' ,'''' from s where name in (''parse time cpu'',''parse time elapsed'')
union all select '''' ,''%PrseC2E'' ,0 ,''YES'' ,''YES'' ,''100*"parse time cpu"/"parse time elapsed"'' from dual
-- Flash Cache Hit %:
--union all select name ,'''' ,value ,''NO'' ,''YES'' ,'''' from s where name in (''physical read total IO requests'',''cell flash cache read hits'')
--union all select '''' ,''%FCHit'' ,0 ,''YES'' ,''YES'' ,''100*"cell flash cache read hits"/"physical read total IO requests"'' from dual
-- Redo NoWait %:
union all select name ,'''' ,value ,''NO'' ,''YES'' ,'''' from s where name in (''redo log space requests'',''redo entries'')
--union all select '''' ,''%RedoNWait'' ,0 ,''YES'' ,''YES'' ,''100*(1-"redo log space requests"/"redo entries")'' from dual
-- In-memory Sort %:
union all select name ,'''' ,value ,''NO'' ,''YES'' ,'''' from s where name in (''sorts (memory)'',''sorts (disk)'')
--union all select '''' ,''%InmemSort'' ,0 ,''YES'' ,''YES'' ,''100*"sorts (memory)"/("sorts (memory)"+"sorts (disk)")'' from dual
-- Soft Parse %:
union all select '''' ,''%SoftPrse'' ,0 ,''YES'' ,''YES'' ,''100*(1-"parse count (hard)"/"parse count (total)")'' from dual
-- Latch Hit %:
--union all select ''latch gets'' ,'''' ,sum(gets) ,''NO'' ,''YES'' ,'''' from v$latch
--union all select ''latch misses'' ,'''' ,sum(misses) ,''NO'' ,''YES'' ,'''' from v$latch
--union all select '''' ,''%LatchHit'' ,0 ,''YES'' ,''YES'' ,''100*(1-"latch misses"/"latch gets")'' from dual
-- % Non-Parse CPU:
--union all select '''' ,''%NPrseCPU'' ,0 ,''YES'' ,''YES'' ,''100*(1-"parse time cpu"/("DB CPU"/10000))'' from dual
--union all select name ,''FreBufInsp'' ,value ,''YES'' ,''YES'' ,'''' from s where name in (''free buffer inspected'')
--union all select name ,''FreBufReq'' ,value ,''YES'' ,''YES'' ,'''' from s where name in (''free buffer requested'')
union all select '''' ,''EnqReqs'' ,value ,''YES'' ,''YES'' ,'''' from s where name in (''enqueue requests'')
union all select '''' ,''Latch'' ,sum(gets) ,''YES'' ,''YES'' ,'''' from v$latch
----------------------end-----------------------------------------------
',sample_cnt=>99999 ,SAMPLE_INTERVAL=>&1 ,column_width=>5 ,debug=>0));
--',sample_cnt=>5 ,SAMPLE_INTERVAL=>1 ,column_width=>5 ,debug=>1));
|
-- file:horology.sql ln:385 expect:true
RESET DateStyle
|
<reponame>githotirado/databricks_archives<filename>sql/Ollivander_2.sql
/*
in MSSQL - HT
Look for the minimum among the different
combinations of power and age.
Look for the cheapest wand for a given combination
of age and power.
*/
select id, age, coins_needed, power
from
(
select id
, age
, coins_needed
, min(coins_needed) over (partition by age, power) as min_coins
, power
from wands as wa
inner join wands_property as wp
on wa.code = wp.code
where is_evil = 0
) as wawp
where coins_needed = min_coins
order by power desc, age desc;
/* Solution 2 with correlated subquery located in 'where' clause (NOT in 'select')
*/
select w.id, p.age, w.coins_needed, w.power
from Wands as w
inner join Wands_Property as p
on (w.code = p.code)
where p.is_evil = 0
and w.coins_needed = (
select min(coins_needed)
from Wands as w1
inner join Wands_Property as p1
on w1.code = p1.code
and w1.power = w.power
and p1.age = p.age
-- where w1.power = w.power and p1.age = p.age
)
order by w.power desc, p.age desc
|
<filename>forwardEngineering_schema_computerdb.sql
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -----------------------------------------------------
-- Schema computerdb
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS `computerdb` ;
-- -----------------------------------------------------
-- Schema computerdb
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `computerdb` DEFAULT CHARACTER SET utf8 ;
USE `computerdb` ;
-- -----------------------------------------------------
-- Table `computerdb`.`product`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `computerdb`.`product` ;
CREATE TABLE IF NOT EXISTS `computerdb`.`product` (
`maker` VARCHAR(10) NOT NULL,
`model` VARCHAR(50) NOT NULL,
`type` ENUM("PC", "Laptop", "Printer") NOT NULL,
PRIMARY KEY (`model`))
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `computerdb`.`pc`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `computerdb`.`pc` ;
CREATE TABLE IF NOT EXISTS `computerdb`.`pc` (
`code` INT NOT NULL,
`speed` SMALLINT(4) NOT NULL,
`ram` SMALLINT(2) NOT NULL,
`hdd` REAL NOT NULL,
`cd` VARCHAR(10) NOT NULL,
`price` DECIMAL(15,2) NULL,
`model` VARCHAR(50) NOT NULL,
PRIMARY KEY (`code`),
INDEX `fk_pc_product_idx` (`model` ASC),
CONSTRAINT `fk_pc_product`
FOREIGN KEY (`model`)
REFERENCES `computerdb`.`product` (`model`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `computerdb`.`laptop`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `computerdb`.`laptop` ;
CREATE TABLE IF NOT EXISTS `computerdb`.`laptop` (
`code` INT NOT NULL,
`speed` SMALLINT(4) NOT NULL,
`ram` SMALLINT(2) NOT NULL,
`hdd` REAL NOT NULL,
`cd` VARCHAR(10) NOT NULL,
`price` DECIMAL(15,2) NULL,
`screen` TINYINT(2) NOT NULL,
`model` VARCHAR(50) NOT NULL,
PRIMARY KEY (`code`),
INDEX `fk_laptop_product1_idx` (`model` ASC),
CONSTRAINT `fk_laptop_product1`
FOREIGN KEY (`model`)
REFERENCES `computerdb`.`product` (`model`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `computerdb`.`printer`
-- -----------------------------------------------------
DROP TABLE IF EXISTS `computerdb`.`printer` ;
CREATE TABLE IF NOT EXISTS `computerdb`.`printer` (
`code` INT NOT NULL,
`color` CHAR(1) NOT NULL,
`type` ENUM("Laser", "Matrix", "Jet") NOT NULL,
`price` DECIMAL(15,2) NULL,
`model` VARCHAR(50) NOT NULL,
PRIMARY KEY (`code`),
INDEX `fk_printer_product1_idx` (`model` ASC),
CONSTRAINT `fk_printer_product1`
FOREIGN KEY (`model`)
REFERENCES `computerdb`.`product` (`model`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
-- -----------------------------------------------------
-- INSERT DATA INTO `product`
-- -----------------------------------------------------
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('Asus', '1000H', 'Laptop');
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('Apple', 'MacBook Pro', 'Laptop');
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('Lenovo', 'X220', 'Laptop');
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('MSI', 'PC 001', 'PC');
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('Gigabyte', 'PC 002', 'PC');
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('HP', '2012C', 'Printer');
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('Kryocera', 'X2012', 'Printer');
INSERT INTO `computerdb`.`product` (`maker`, `model`, `type`) VALUES ('ASUS', 'PC 003', 'PC');
-- -----------------------------------------------------
-- INSERT DATA INTO `laptop`
-- -----------------------------------------------------
INSERT INTO `computerdb`.`laptop` (`code`, `speed`, `ram`, `hdd`, `cd`, `price`, `screen`, `model`) VALUES ('1', '1800', '4096', '40', '0x', '200', '10', '1000H');
INSERT INTO `computerdb`.`laptop` (`code`, `speed`, `ram`, `hdd`, `cd`, `price`, `screen`, `model`) VALUES ('2', '2800', '8192', '500', '0x', '1500', '14', 'MacBook Pro');
INSERT INTO `computerdb`.`laptop` (`code`, `speed`, `ram`, `hdd`, `cd`, `price`, `screen`, `model`) VALUES ('3', '2600', '6144', '320', '0x', '500', '12', 'X220');
-- -----------------------------------------------------
-- INSERT DATA INTO `PC`
-- -----------------------------------------------------
INSERT INTO `computerdb`.`pc` (`code`, `speed`, `ram`, `hdd`, `cd`, `price`, `model`) VALUES ('1', '3000', '8096', '2000', '40x', '1200', 'PC 001');
INSERT INTO `computerdb`.`pc` (`code`, `speed`, `ram`, `hdd`, `cd`, `price`, `model`) VALUES ('2', '3300', '8096', '1000', '32X', '1000', 'PC 002');
INSERT INTO `computerdb`.`pc` (`code`, `speed`, `ram`, `hdd`, `cd`, `price`, `model`) VALUES ('3', '3000', '8096', '2000', '0x', '900', 'PC 003');
-- -----------------------------------------------------
-- INSERT DATA INTO `PRINTER`
-- -----------------------------------------------------
INSERT INTO `computerdb`.`printer` (`code`, `color`, `type`, `price`, `model`) VALUES ('1', 'y', 'Jet', '300', '2012C');
INSERT INTO `computerdb`.`printer` (`code`, `color`, `type`, `price`, `model`) VALUES ('2', 'n', 'Laser', '800', 'X2012');
|
<filename>sql/core/src/test/resources/sql-tests/inputs/timestamp-ntz.sql
-- timestamp_ntz literals and constructors
--CONFIG_DIM1 spark.sql.timestampType=TIMESTAMP_LTZ
--CONFIG_DIM1 spark.sql.timestampType=TIMESTAMP_NTZ
select timestamp_ntz'2016-12-31 00:12:00', timestamp_ntz'2016-12-31';
select to_timestamp_ntz(null), to_timestamp_ntz('2016-12-31 00:12:00'), to_timestamp_ntz('2016-12-31', 'yyyy-MM-dd');
-- `to_timestamp_ntz` can also take date input
select to_timestamp_ntz(to_date(null)), to_timestamp_ntz(to_date('2016-12-31'));
-- `to_timestamp_ntz` can also take timestamp_ltz input
select to_timestamp_ntz(to_timestamp_ltz(null)), to_timestamp_ntz(to_timestamp_ltz('2016-12-31 00:12:00'));
-- TimestampNTZ numeric fields constructor
SELECT make_timestamp_ntz(2021, 07, 11, 6, 30, 45.678);
-- make_timestamp_ntz should not accept time zone input
SELECT make_timestamp_ntz(2021, 07, 11, 6, 30, 45.678, 'CET');
SELECT make_timestamp_ntz(2021, 07, 11, 6, 30, 60.007);
SELECT convert_timezone('Europe/Moscow', 'America/Los_Angeles', timestamp_ntz'2022-01-01 00:00:00');
-- Get the difference between timestamps w/o time zone in the specified units
select timestampdiff('QUARTER', timestamp_ntz'2022-01-01 01:02:03', timestamp_ntz'2022-05-02 05:06:07');
select timestampdiff(HOUR, timestamp_ntz'2022-02-14 01:02:03', timestamp_ltz'2022-02-14 02:03:04');
select timestampdiff(YEAR, date'2022-02-15', timestamp_ntz'2023-02-15 10:11:12');
select timestampdiff('MILLISECOND', timestamp_ntz'2022-02-14 23:59:59.123', date'2022-02-15');
|
<reponame>lopezmoises/BD2
SELECT * FROM psdb.employees LIMIT 100;
|
create table Ksiazki(
ID_KSIAZKI int constraint PK_KSIAZKI primary key identity(1,1),
TYTUL varchar (250),
AUTOR varchar (200),
OPIS varchar (5000),
ILOSC_STRON int,
MIEJSCE_WYDANIA varchar (30),
WYDAWNICTWO varchar (30),
ROK_WYDANIA int,
ZDJECIE image);
|
<reponame>sunadm/ClickHouse<gh_stars>1-10
SET allow_experimental_live_view = 1;
DROP TABLE IF EXISTS test.lv;
DROP TABLE IF EXISTS test.mt;
SELECT name, value from system.settings WHERE name = 'temporary_live_view_timeout';
SELECT name, value from system.settings WHERE name = 'live_view_heartbeat_interval';
SET temporary_live_view_timeout=1;
CREATE TABLE test.mt (a Int32) Engine=MergeTree order by tuple();
CREATE TEMPORARY LIVE VIEW test.lv AS SELECT sum(a) FROM test.mt;
SHOW TABLES FROM test LIKE 'lv';
SELECT sleep(2);
SHOW TABLES FROM test LIKE 'lv';
DROP TABLE test.mt;
|
CREATE VIEW view46 AS
SELECT 1 AS c1
FROM table111
UNION
SELECT 1 AS c1
FROM table21
UNION
SELECT 1 AS c1
FROM table168
UNION
SELECT 1 AS c1
FROM view47
UNION
SELECT 1 AS c1
FROM view1
UNION
SELECT 1 AS c1
FROM view70;
GO
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.