text stringlengths 6 9.38M |
|---|
-- init sql------------------------------------------------
set hive.execution.engine=spark;
drop table if exists dws.tmp_report_activity_base;
CREATE TABLE dws.tmp_report_activity_base (
`report_date` timestamp,
`isworkday` bigint,
`id` string,
`staff_no` string,
`name` string,
`mobile_no` string,
`position` string,
`city` string,
`market_department` string,
`user_type` string,
`higher_level_no` string,
`higher_level_name` string,
`create_user_id` string,
`create_date` timestamp,
`update_user_id` string,
`update_date` timestamp ,
`interview_sign_num` double ,
`loan_num` double ,
`visit_num` double ,
`csh_num` double,
`etl_update_time` timestamp COMMENT '更新时间'
);
with j as(
-- 面签
select
to_date(x.interview_time) report_date
,su.mobile_ sales_user_phone
,sum(x.interview_num_xg) interview_sign_num
from dwd.dwd_orders_ex x
join ods.ods_bpms_biz_apply_order bao on x.apply_no = bao.apply_no
join ods.ods_bpms_sys_user su on bao.sales_user_id = su.id_
group by to_date(x.interview_time), su.mobile_
),
h as(
-- 活动入口
select
to_date(d.create_time) report_date
,d.phone
,count(case when d.template_name='产说会/同业交流会' then d.dingtalk_id end) csh_num
,count(case when d.template_name in ('渠道拜访记录', "拜访记录") then d.dingtalk_id end) visit_num
from ods.ods_ding_ding_log d
where d.template_name in ('产说会/同业交流会','渠道拜访记录', "拜访记录")
group by to_date(d.create_time), d.phone
),
k as(
-- 放款
select
to_date(y.loan_time_xg) report_date
,su.mobile_ sales_user_phone
,sum(y.loan_num_xg) loan_num
from dwd.dwd_orders_ex y
join ods.ods_bpms_biz_apply_order bao on y.apply_no = bao.apply_no
join ods.ods_bpms_sys_user su on bao.sales_user_id = su.id_
group by to_date(y.loan_time_xg), su.mobile_
)
insert overwrite table dws.tmp_report_activity_base
select
p.`report_date`
,p.`is_work_day`
,cast(p.`id` as string)
,p.`staff_no`
,p.`name`
,p.`mobile_no`
,p.`position`
,p.`branch_company`
,p.`market_department`
,p.`user_type`
,p.`higher_level_no`
,p.`higher_level_name`
,p.`create_user_id`
,p.`create_date`
,p.`update_user_id`
,p.`update_date`
,nvl(j.interview_sign_num, 0) interview_timesign_num
,nvl(k.loan_num, 0) loan_num
,nvl(h.visit_num, 0) visit_num
,nvl(h.csh_num, 0) csh_num
,from_unixtime(unix_timestamp(),'yyyy-MM-dd')
from(
-- 日期+人员辅助计算
select to_date(r.day) report_date, r.is_work_day,u.*
from ods.ods_spp_biz_user_info u, dim.dim_c_work_calendar r
where to_date(r.day) >= '2018-12-31'
and to_date(r.day) < from_unixtime(unix_timestamp(),'yyyy-MM-dd')
) p
left join h on p.mobile_no=h.phone and p.report_date=h.report_date
left join j on p.mobile_no=j.sales_user_phone and p.report_date=j.report_date
left join k on p.mobile_no=k.sales_user_phone and p.report_date=k.report_date; |
CREATE DATABASE IF NOT EXISTS `tokoin`;
CREATE DATABASE IF NOT EXISTS `tokoin_bo`;
|
-- 1. Get all customers and their addresses.
SELECT * FROM customers
JOIN addresses ON customers.id = addresses.customer_id;
-- 2. Get all orders and their line items.
SELECT * FROM orders
JOIN line_items ON orders.id = line_items.order_id;
-- 3. Which warehouses have cheetos?
SELECT * FROM warehouse
JOIN warehouse_product
ON warehouse.id=warehouse_product.warehouse_id
JOIN products
ON products.id=warehouse_product.product_id
where description='cheetos';
Answer= delta
-- 4. Which warehouses have diet pepsi?
SELECT * FROM warehouse
JOIN warehouse_product
ON warehouse.id=warehouse_product.warehouse_id
JOIN products
ON products.id=warehouse_product.product_id
where description='diet pepsi';
Answer = alpha, delta, gamma
-- 5. Get the number of orders for each customer. NOTE: It is OK if those without orders are not included in results.
SELECT customers.id, first_name, last_name, COUNT(*)
FROM orders
JOIN addresses
ON orders.address_id=addresses.id
JOIN customers
ON addresses.customer_id=customers.id
GROUP BY customers.id;
Answer = Lisa had 3, Lucy had 3, Charles had 1, Geroge had 0
-- 6. How many customers do we have?
SELECT COUNT(*)
FROM customers;
Answer = 4
-- 7. How many products do we carry?
SELECT COUNT(*)
FROM products;
Answer = 7
-- 8. What is the total available on-hand quantity of diet pepsi?
SELECT SUM(on_hand)
FROM products
JOIN warehouse_product
ON products.id=warehouse_product.product_id
WHERE id =6;
Answer=92 |
CREATE DATABASE [AwfulInputs]; |
-- Adminer 4.7.3 MySQL dump
-- Digital Factory
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`ruc` varchar(11) DEFAULT NULL,
`address` varchar(100) DEFAULT NULL,
`phone` varchar(20) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `customers` (`id`, `name`, `ruc`, `address`, `phone`, `email`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 'Mauro', '10704842088', 'Jr. Tacna 251 - Barrio Huayco', '966948379', 'mauroflores8193@gmail.com', '2019-09-20 04:14:33', '2019-09-20 04:22:25', NULL),
(2, 'otro', '12345678431', '', '', '', '2019-09-21 23:55:18', '2019-09-21 23:55:18', NULL),
(3, 'Nuevo Cliente', '76543242113', '', '', '', '2019-09-21 23:55:32', '2019-09-21 23:55:32', NULL),
(4, NULL, NULL, NULL, NULL, NULL, '2019-09-22 22:08:24', '2019-09-22 23:41:48', '2019-09-22 23:41:48');
DROP TABLE IF EXISTS `data_models`;
CREATE TABLE `data_models` (
`id` int(11) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`uid` int(11) DEFAULT NULL,
`create_time` bigint(20) DEFAULT NULL,
`update_time` bigint(20) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `data_models` (`id`, `name`, `uid`, `create_time`, `update_time`, `created_at`, `updated_at`, `deleted_at`) VALUES
(5243, 'PM5100', 13717, 1550438611, 1550438611, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL);
DROP TABLE IF EXISTS `data_variables`;
CREATE TABLE `data_variables` (
`id` int(11) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`unit` varchar(20) DEFAULT NULL,
`data_model_id` int(11) DEFAULT NULL,
`formula` varchar(20) DEFAULT NULL,
`account` varchar(20) DEFAULT NULL,
`type` int(1) DEFAULT NULL,
`decimal_accuracy` int(2) DEFAULT NULL,
`create_time` bigint(20) DEFAULT NULL,
`update_time` bigint(20) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `data_model_id` (`data_model_id`),
CONSTRAINT `data_variables_ibfk_1` FOREIGN KEY (`data_model_id`) REFERENCES `data_models` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `data_variables` (`id`, `name`, `unit`, `data_model_id`, `formula`, `account`, `type`, `decimal_accuracy`, `create_time`, `update_time`, `created_at`, `updated_at`, `deleted_at`) VALUES
(22080, 'YEAR', 'Y', 5243, '%s', 'miki31', 0, NULL, 1550438611, 1550443811, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22081, 'Current Avg', 'A', 5243, '%s', 'miki31', 0, 2, 1550444364, 1550444364, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22082, 'Voltage L-N Avg', 'V', 5243, '%s', 'miki31', 0, 2, 1550444445, 1550444445, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22083, 'Active Power Total', 'kW', 5243, '%s', 'miki31', 0, 2, 1550444532, 1550444532, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22084, 'Reactive Power Total', 'kVAR', 5243, '%s', 'miki31', 0, 2, 1550444608, 1550444608, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22085, 'Apparent Power Total', 'kVA', 5243, '%s', 'miki31', 0, 2, 1550444645, 1550444645, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22086, 'Frequency', 'Hz', 5243, '%s', 'miki31', 0, 2, 1550444716, 1550444716, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22087, 'Active Energy Delivered (Into Load)_B', '', 5243, '%s', 'miki31', 0, NULL, 1550444936, 1551581613, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22119, 'Active Energy Delivered (Into Load)_A', '', 5243, '%s', 'miki31', 0, NULL, 1551581770, 1551581770, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22120, 'Reactive Energy Received_A', '', 5243, '%s', 'miki31', 0, NULL, 1551581833, 1551581833, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22121, 'Reactive Energy Received_B', '', 5243, '%s', 'miki31', 0, NULL, 1551581846, 1551581846, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22122, 'Apparent Energy Received_A', '', 5243, '%s', 'miki31', 0, NULL, 1551581875, 1551581875, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL),
(22123, 'Apparent Energy Received_B', '', 5243, '%s', 'miki31', 0, NULL, 1551581885, 1551581885, '2019-05-03 13:06:10', '2019-05-03 13:06:10', NULL);
DROP TABLE IF EXISTS `gateways`;
CREATE TABLE `gateways` (
`id` int(11) NOT NULL,
`code` varchar(20) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`address` text,
`pass` varchar(100) DEFAULT NULL,
`position` text,
`type` int(1) DEFAULT NULL,
`update_time` bigint(20) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `gateways` (`id`, `code`, `name`, `address`, `pass`, `position`, `type`, `update_time`, `created_at`, `updated_at`, `deleted_at`) VALUES
(10341, '00013717000000000001', 'PM5100', 'Avenida Caminos del Inca, Lima, Peru', 'Btln4Fkw', '-76.992722,-12.113634', 0, 1551632489, '2019-05-03 16:32:32', '2019-05-03 16:32:32', NULL),
(248670, '00007112000000000002', 'Gateway_Tiendas', '北京市西城区南纬路南巷34号', 'admin', '-0.007869,0.020865', 0, 1561581205, '2019-06-26 23:17:42', '2019-06-26 23:17:42', NULL);
DROP TABLE IF EXISTS `meters`;
CREATE TABLE `meters` (
`id` int(11) NOT NULL,
`index` int(11) DEFAULT NULL,
`name` varchar(100) DEFAULT NULL,
`address` int(11) DEFAULT NULL,
`data_model_id` int(11) DEFAULT NULL,
`gateway_id` int(11) DEFAULT NULL,
`create_date` bigint(20) DEFAULT NULL,
`update_date` bigint(20) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `gateway_id` (`gateway_id`),
KEY `data_model_id` (`data_model_id`),
CONSTRAINT `meters_ibfk_1` FOREIGN KEY (`gateway_id`) REFERENCES `gateways` (`id`),
CONSTRAINT `meters_ibfk_2` FOREIGN KEY (`data_model_id`) REFERENCES `data_models` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `meters` (`id`, `index`, `name`, `address`, `data_model_id`, `gateway_id`, `create_date`, `update_date`, `created_at`, `updated_at`, `deleted_at`) VALUES
(6562, 1, 'PM5100_HOME', 10, 5243, 10341, 1550467652000, 1551661289000, '2019-05-03 16:32:32', '2019-05-03 16:32:32', NULL),
(6588, 2, 'PM5100_OFFICE', 11, 5243, 10341, 1551661289000, 1551661289000, '2019-05-03 16:32:32', '2019-05-03 16:32:32', NULL);
DROP TABLE IF EXISTS `meter_data`;
CREATE TABLE `meter_data` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`gateway_cod` varchar(20) DEFAULT NULL,
`point_id` varchar(10) DEFAULT NULL,
`value` int(11) DEFAULT NULL,
`meter_index` varchar(10) DEFAULT NULL,
`meter_addr` varchar(10) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS `offices`;
CREATE TABLE `offices` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`floor` int(2) DEFAULT NULL,
`number` int(6) DEFAULT NULL,
`description` varchar(100) DEFAULT NULL,
`meter_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `meter_id` (`meter_id`),
CONSTRAINT `offices_ibfk_1` FOREIGN KEY (`meter_id`) REFERENCES `meters` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `offices` (`id`, `floor`, `number`, `description`, `meter_id`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 101, 'a ver', 6562, '2019-09-17 02:23:03', '2019-09-19 00:12:25', NULL),
(2, 1, 102, 'Otros', 6588, '2019-09-17 02:55:30', '2019-09-18 23:45:23', NULL),
(3, 2, 201, 'Local 201', 6588, '2019-09-17 04:14:48', '2019-09-18 23:45:21', NULL);
DROP TABLE IF EXISTS `rents`;
CREATE TABLE `rents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) DEFAULT NULL,
`contract_num` varchar(20) DEFAULT NULL,
`start_date` date DEFAULT NULL,
`end_date` date DEFAULT NULL,
`note` text,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `customer_id` (`customer_id`),
CONSTRAINT `rents_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customers` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `rents` (`id`, `customer_id`, `contract_num`, `start_date`, `end_date`, `note`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, '4525', '2019-09-22', NULL, '', '2019-09-22 22:16:36', '2019-09-22 23:39:47', NULL),
(2, 1, '424243', '2019-09-22', NULL, '', '2019-09-22 22:22:16', '2019-09-22 22:22:16', NULL),
(3, 1, '21321', '2019-09-01', NULL, '', '2019-09-22 23:33:34', '2019-09-22 23:33:34', NULL);
DROP TABLE IF EXISTS `rent_details`;
CREATE TABLE `rent_details` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rent_id` int(11) DEFAULT NULL,
`office_id` int(11) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `rent_id` (`rent_id`),
KEY `office_id` (`office_id`),
CONSTRAINT `rent_details_ibfk_1` FOREIGN KEY (`rent_id`) REFERENCES `rents` (`id`),
CONSTRAINT `rent_details_ibfk_2` FOREIGN KEY (`office_id`) REFERENCES `offices` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO `rent_details` (`id`, `rent_id`, `office_id`, `created_at`, `updated_at`, `deleted_at`) VALUES
(1, 1, 1, '2019-09-22 22:16:36', '2019-09-22 22:16:36', NULL),
(2, 2, 2, '2019-09-22 22:22:16', '2019-09-22 23:38:29', '2019-09-22 23:38:29'),
(3, 1, 2, '2019-09-22 23:30:09', '2019-09-22 23:39:31', '2019-09-22 23:39:31'),
(4, 3, 3, '2019-09-22 23:33:34', '2019-09-22 23:33:46', NULL),
(5, 1, 3, '2019-09-22 23:34:18', '2019-09-22 23:39:31', '2019-09-22 23:39:31'),
(6, 3, 1, '2019-09-22 23:35:01', '2019-09-22 23:35:01', NULL),
(7, 2, 3, '2019-09-22 23:39:14', '2019-09-22 23:39:14', NULL),
(8, 1, 2, '2019-09-22 23:39:31', '2019-09-22 23:39:31', NULL);
-- 2019-11-22 02:20:50
|
/*
** Question: https://leetcode.com/problems/page-recommendations/
*/
-- method 1, Oracle
-- Can also not use CTE, but put the whole CTE into a subquery directly
WITH user_1_friends AS (
SELECT user2_id AS friend_id
FROM Friendship
WHERE user1_id = 1
UNION
SELECT user1_id AS friend_id
FROM Friendship
WHERE user2_id = 1
)
SELECT DISTINCT l.page_id AS recommended_page
FROM Likes l
WHERE l.page_id NOT IN (SELECT page_id FROM Likes WHERE user_id = 1)
AND l.user_id IN (SELECT friend_id FROM user_1_friends)
;
-- method 2, Oracle/MySQL
-- Refer to here: https://leetcode.com/problems/page-recommendations/discuss/435145/mysql-solution
-- CASE WHEN is also a good option; this is faster than method 1
select distinct page_id as recommended_page
from
(select
case
when user1_id=1 then user2_id
when user2_id=1 then user1_id
end as user_id
from Friendship) a
join Likes
on a.user_id=Likes.user_id
where page_id not in (select page_id from Likes where user_id=1)
|
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES ('Mr. Chocolate', 10, 'M', 'brown', "friendly", 1);
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES ('Rowdy', 3, 'M', 'light brown', 'deadly', 1);
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES ('Tabitha', 5, 'F', 'butterscotch', 'meh', 1);
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES ('Sergeant Brown', 1, 'M', 'dark brown', 'nice', 1);
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES ('Melissa', 20, 'F', 'black', 'mean', 1);
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES ('Grinch', 51, 'M', 'dark brown', 'awful', 0);
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES ('Wendy', 5, 'F', 'brown', 'very nice', 1);
INSERT INTO bears (name, age, gender, color, temperament, alive) VALUES (NULL, 7, 'F', 'brown', 'ok', 0);
|
use i_maven_plugin_sql;
create table if not exists t_user(
id int(10) auto_increment primary key,
username varchar(20),
password varchar(20)
);
create table if not exists t_user_test(
id int(10) auto_increment primary key,
username varchar(20),
password varchar(20)
); |
/*
执行用时:293 ms, 在所有 MySQL 提交中击败了80.05% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
*/
# Write your MySQL query statement below
## max odd
select id, student
from seat where id & 1 and id in (select max(id) from seat)
union
## common odd
select (id + 1) as id, student
from seat where id & 1 and id not in (select max(id) from seat)
union
## even
select (id - 1) as id, student
from seat where id & 1 = 0
order by id;
/*
执行用时:314 ms, 在所有 MySQL 提交中击败了42.32% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
*/
# Write your MySQL query statement below
select
(case
when mod(id, 2) and id = (select max(id) from seat) then id
when mod(id, 2) then id + 1
else id - 1
end) as id,
student
from seat
order by id;
/*
执行用时:317 ms, 在所有 MySQL 提交中击败了38.43% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
*/
# Write your MySQL query statement below
# 利用异或只把偶数减2,奇数不变,从而调位。
# 异或 (两个数异或,二级制 最后一位不一样才为 1) ,如果id是奇数 id - 1 最后一位变 0, 异或后 大小不变,偶数 id id - 1 ,异或后 值 减小2
select rank() over(order by (id-1)^1) as id, student from seat
/*
执行用时:299 ms, 在所有 MySQL 提交中击败了68.47% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
*/
# Write your MySQL query statement below
select row_number() over () as id, student
from seat
order by if (id % 2, id, id - 2)
/*
执行用时:294 ms, 在所有 MySQL 提交中击败了78.43% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
*/
# Write your MySQL query statement below
select
row_number() over (order by if(mod(id, 2), id + 1, id - 1)) as id,
student
from seat
/*
执行用时:302 ms, 在所有 MySQL 提交中击败了62.61% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:12 / 12
*/
# Write your MySQL query statement below
select
rank() over (order by if(mod(id, 2), id + 1, id - 1)) as id,
student
from seat
|
\echo 'fcode,common_name'
SELECT facility_fcode, facility_common_name FROM facilities; |
--Created by: AA
--Updated by: BG
--Purpose: Report for WM customer service that checks for Pulse errors. (AltAddr, PromiseDt, ShippingDt, Missing Cust Item #)
--Last Update: Fixed promise_dt issue
SELECT 'Store' AS Error, OH.ord_dt, OH.ord_no, OH.oe_po_no, OH.cus_alt_adr_cd, ED.mac_location AS AltAddr, 'n/a' AS MarcoItem,
'n/a' AS CustItem, '' AS Promise_Dt, OH.shipping_dt, 'n/a' AS LOR_Cmt, '0' AS Ord_Qty, '0' AS Ship_Qty
FROM oeordhdr_sql OH LEFT OUTER JOIN
edcshtfl_sql ED ON OH.cus_alt_adr_cd = ED.location
WHERE LTRIM(OH.cus_no) = '1575' AND OH.slspsn_no <> '20' AND OH.oe_po_no LIKE '3%' AND ((OH.cus_alt_adr_cd IS NULL OR
OH.cus_alt_adr_cd LIKE '007%') OR
OH.shipping_dt IS NULL OR
OH.ship_to_addr_2 LIKE 'PO BOX%')
UNION ALL
SELECT CASE WHEN ED.tp_item_num IS NULL THEN 'Item' WHEN OL.promise_dt < GETDATE() THEN 'PromiseDate' END AS Error,
OH.ord_dt, OH.ord_no, OH.oe_po_no,
OH.cus_alt_adr_cd, 'n/a' AS AltAddr, OL.item_no, ED.tp_item_num, OL.promise_dt, OH.shipping_dt,
OL.user_def_fld_1 AS LOR_Cmt, OL.qty_ordered AS Ord_Qty, OL.qty_to_ship AS Ship_Qty
FROM oeordhdr_sql OH JOIN
oeordlin_sql OL ON OH.ord_no = OL.ord_no LEFT OUTER JOIN
edcitmfl_sql ED ON ED.mac_item_num = OL.item_no
WHERE LTRIM(OH.cus_no) = '1575' AND OH.slspsn_no <> '20'
AND OH.oe_po_no NOT IN ('31952646', '31960093', '31960095', '31960096', '31960097', '31960098', '31960099',
'31961662', '31961663', '31961664', '31961665', '31961668', '31961669', '31961860', '31961861', '31961867',
'31961912', '31961915', '31961917', '31961919', '31962091', '31962096', '31962098', '31962122', '31962124',
'31962126', '31962128', '31962210', '31962213', '31962217', '31962218', '31962241', '31962242', '31962244', '31962245',
'31962249', '31986745', '31986746', '32055310', '32055312', '32072274')
AND OL.shipped_dt IS NULL AND (OL.promise_dt < GETDATE() OR ED.edi_item_num IS NULL OR OL.item_no = '*EDI-ITEM') |
--회원관리
create table boardMember(
Member_id varchar2(15) primary key not null,
Member_pw varchar2(15),
Member_name varchar2(15),
Member_age number,
Member_gender varchar2(5),
Member_email varchar2(30)
);
select * from boardMember; |
Create Procedure mERP_sp_Update_LaunchErrorStatus(@RecdDocID Int, @ErrorMsg nVarchar(510))
As
Begin
Insert Into tbl_mERP_RecdErrMessages( TransactionType, ErrMessage, KeyValue, ProcessDate)
Values('LAUNCHINFO', @ErrorMsg, 'Received LaunchDocID - ' + Cast(@RecdDocID as nVarchar(10)) ,GetDate())
End
|
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 04, 2019 at 06:33 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `football`
--
-- --------------------------------------------------------
--
-- Table structure for table `game`
--
CREATE TABLE IF NOT EXISTS `game` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`home_team_key` int(10) unsigned NULL,
`away_team_key` int(10) unsigned NULL,
`home_score` int(10) unsigned NOT NULL,
`away_score` int(10) unsigned NOT NULL,
`home_timeouts` int(10) unsigned NOT NULL,
`away_timeouts` int(10) unsigned NOT NULL,
`quarter` int(10) unsigned NOT NULL,
`time` varchar(10) NOT NULL,
`down` int(10) unsigned NOT NULL,
`ball_on_yard_line` int(11) NOT NULL,
`yards_to_first_down` int(10) unsigned NOT NULL,
`is_home_team_ball` tinyint(1) NOT NULL,
`is_goal_to_go` tinyint(1) NOT NULL,
`is_kickoff` tinyint(1) NOT NULL,
`is_extra_point_attempt` tinyint(1) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `game_history`
--
CREATE TABLE IF NOT EXISTS `game_history` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`play_id` int(10) unsigned NOT NULL,
`offense_play_key` int(10) unsigned NOT NULL,
`defense_play_key` int(10) unsigned NOT NULL,
`home_play_key` int(10) unsigned NOT NULL,
`away_play_key` int(10) unsigned NOT NULL,
`home_score` int(10) unsigned NOT NULL,
`away_score` int(10) unsigned NOT NULL,
`home_timeouts` int(10) unsigned NOT NULL,
`away_timeouts` int(10) unsigned NOT NULL,
`quarter` int(10) unsigned NOT NULL,
`time` varchar(10) NOT NULL,
`ball_on_yard_line` int(11) NOT NULL,
`down` int(10) unsigned NOT NULL,
`yards_to_first_down` int(10) unsigned NOT NULL,
`is_goal_to_go` tinyint(1) NOT NULL,
`is_home_team_ball` tinyint(1) NOT NULL,
`is_kickoff` tinyint(1) NOT NULL,
`is_extra_point_attempt` tinyint(1) NOT NULL,
`is_touchdown` tinyint(1) NULL,
`is_defense_touchdown` tinyint(1) NULL,
`is_extra_point_good` tinyint(1) NULL,
`is_two_point_conversion_good` tinyint(1) NULL,
`is_safety` tinyint(1) NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `message`
--
CREATE TABLE IF NOT EXISTS `message` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_key` int(10) unsigned NOT NULL,
`game_key` int(10) unsigned NOT NULL,
`team_name` varchar(64) NOT NULL,
`username` varchar(64) NOT NULL,
`color` varchar(8) NOT NULL,
`ip` varchar(100) NOT NULL,
`message` text NOT NULL,
`report_count` int(10) unsigned NOT NULL,
`timestamp` timestamp NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=181 ;
-- --------------------------------------------------------
--
-- Table structure for table `offense_play`
--
CREATE TABLE IF NOT EXISTS `offense_play` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`is_run` tinyint(1) NOT NULL,
`is_pass` tinyint(1) NOT NULL,
`is_kick` tinyint(1) NOT NULL,
`is_punt` tinyint(1) NOT NULL,
`is_kickoff` tinyint(1) NOT NULL,
`is_kneel` tinyint(1) NOT NULL,
`preview_image` varchar(100) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=16 ;
--
-- Dumping data for table `offense_play`
--
INSERT INTO `offense_play` (`id`, `name`, `is_run`, `is_pass`, `is_kick`, `is_punt`, `is_kickoff`, `is_kneel`, `preview_image`, `created`, `updated`, `deleted`) VALUES
(1, 'run up the middle', 1, 0, 0, 0, 0, 0, '', '2019-06-04 02:55:11', '2019-06-04 02:55:11', NULL),
(2, 'run toss', 1, 0, 0, 0, 0, 0, '', '2019-06-04 02:55:43', '2019-06-04 02:55:43', NULL),
(3, 'QB Dive', 1, 0, 0, 0, 0, 0, '', '2019-06-04 02:55:43', '2019-06-04 02:55:43', NULL),
(4, 'short pass', 0, 1, 0, 0, 0, 0, '', '2019-06-04 02:56:59', '2019-06-04 02:56:59', NULL),
(5, 'medium pass', 0, 1, 0, 0, 0, 0, '', '2019-06-04 02:56:59', '2019-06-04 02:57:16', NULL),
(6, 'long pass', 0, 1, 0, 0, 0, 0, '', '2019-06-04 02:56:59', '2019-06-04 02:57:21', NULL),
(7, 'screen', 0, 1, 0, 0, 0, 0, '', '2019-06-04 02:58:30', '2019-06-04 02:58:30', NULL),
(8, 'bootleg', 0, 1, 0, 0, 0, 0, '', '2019-06-04 02:58:30', '2019-06-04 02:58:30', NULL),
(9, 'billy billy', 0, 1, 0, 0, 0, 0, '', '2019-06-04 02:58:30', '2019-06-04 02:58:30', NULL),
(10, 'punt', 0, 0, 0, 1, 0, 0, '', '2019-06-04 02:59:55', '2019-06-04 02:59:55', NULL),
(11, 'kick', 0, 0, 1, 0, 0, 0, '', '2019-06-04 02:59:55', '2019-06-04 02:59:55', NULL),
(12, 'kneel', 0, 0, 0, 0, 0, 1, '', '2019-06-04 02:59:55', '2019-06-04 02:59:55', NULL),
(13, 'kickoff touchback', 0, 0, 0, 0, 1, 0, '', '2019-06-04 03:00:59', '2019-06-04 03:00:59', NULL),
(14, 'kickoff short', 0, 0, 0, 0, 1, 0, '', '2019-06-04 03:01:19', '2019-06-04 03:01:19', NULL),
(15, 'onside', 0, 0, 0, 0, 1, 0, '', '2019-06-04 03:01:19', '2019-06-04 03:01:19', NULL);
-- --------------------------------------------------------
--
-- Table structure for table `outcome`
--
CREATE TABLE IF NOT EXISTS `outcome` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`play_key` int(10) unsigned NOT NULL,
`is_run_stuff` tinyint(1) NOT NULL,
`is_man` tinyint(1) NOT NULL,
`is_blitz` tinyint(1) NOT NULL,
`name` varchar(100) NOT NULL,
`announcer_text` varchar(1000) NOT NULL,
`yards` int(11) NOT NULL,
`likelyhood_based_on_stuff_the_run` int(11) NOT NULL,
`likelyhood_based_on_play_the_pass` int(11) NOT NULL,
`likelyhood_based_on_man` int(11) NOT NULL,
`likelyhood_based_on_zone` int(11) NOT NULL,
`likelyhood_based_on_blitz` int(11) NOT NULL,
`likelyhood_based_on_send_4` int(11) NOT NULL,
`likelyhood_based_on_oline_rating` int(11) NOT NULL,
`likelyhood_based_on_qb_rating` int(11) NOT NULL,
`likelyhood_based_on_rb_rating` int(11) NOT NULL,
`likelyhood_based_on_wr_rating` int(11) NOT NULL,
`likelyhood_based_on_te_rating` int(11) NOT NULL,
`likelyhood_based_on_dline_rating` int(11) NOT NULL,
`likelyhood_based_on_lb_rating` int(11) NOT NULL,
`likelyhood_based_on_db_rating` int(11) NOT NULL,
`likelyhood_based_on_kicker_rating` int(11) NOT NULL,
`likelyhood_based_on_special_offence_rating` int(11) NOT NULL,
`likelyhood_based_on_special_defense_rating` int(11) NOT NULL,
`seconds_off_clock_during_play` int(10) NOT NULL,
`seconds_off_clock_after_play` int(10) NOT NULL,
`announcer_audio_start` varchar(100) NOT NULL,
`announcer_audio_end` varchar(100) NOT NULL,
`animation_a` varchar(100) NOT NULL,
`animation_b` varchar(100) NOT NULL,
`game_audio` varchar(100) NOT NULL,
`is_complete` tinyint(1) NOT NULL,
`is_incomplete` tinyint(1) NOT NULL,
`is_interception` tinyint(1) NOT NULL,
`is_fumble` tinyint(1) NOT NULL,
`is_turnover` tinyint(1) NOT NULL,
`is_kick_good` tinyint(1) NOT NULL,
`is_kick_no_good` tinyint(1) NOT NULL,
`is_always_td` tinyint(1) NOT NULL,
`is_always_defense_td` tinyint(1) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `request`
--
CREATE TABLE IF NOT EXISTS `request` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_flag` bit(1) NOT NULL,
`user_key` int(10) unsigned NOT NULL,
`ip` varchar(100) NOT NULL,
`api_flag` bit(1) NOT NULL,
`route_url` varchar(1000) NOT NULL,
`full_url` varchar(1000) NOT NULL,
`get_data` text NOT NULL,
`post_data` text NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=36 ;
-- --------------------------------------------------------
--
-- Table structure for table `team`
--
CREATE TABLE IF NOT EXISTS `team` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` int(10) unsigned NOT NULL,
`user_key` int(10) unsigned NOT NULL,
`image` varchar(100) DEFAULT NULL,
`oline_rating` int(10) unsigned DEFAULT NULL,
`qb_rating` int(10) unsigned DEFAULT NULL,
`rb_rating` int(10) unsigned DEFAULT NULL,
`wr_rating` int(10) unsigned DEFAULT NULL,
`te_rating` int(10) unsigned DEFAULT NULL,
`dline_rating` int(10) unsigned DEFAULT NULL,
`lb_rating` int(10) unsigned DEFAULT NULL,
`db_rating` int(10) unsigned DEFAULT NULL,
`kicker_rating` int(10) unsigned DEFAULT NULL,
`special_rating` int(10) unsigned DEFAULT NULL,
`cookie_id` varchar(100) DEFAULT NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE IF NOT EXISTS `user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(100) NOT NULL,
`last_load` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ab_test` varchar(100) NOT NULL,
`email` varchar(250) NOT NULL,
`ip` varchar(100) NOT NULL,
`api_key` varchar(250) NOT NULL,
`password` varchar(250) NOT NULL,
`created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SELECT cust_name, cust_contact
FROM Customers
WHERE cust_id IN (SELECT cust_id
FROM Orders
WHERE order_num IN (SELECT order_num
FROM OrderItems
WHERE prod_id = 'RGAN01'));
SELECT cust_name, cust_contact
FROM Customers, Orders, OrderItems
WHERE Customers.cust_id = Orders.cust_id
AND Orders.order_num = OrderItems.order_num
AND OrderItems.prod_id = 'RGAN01';
-- both queries give the same results |
CREATE TABLE "answers"
(
"id" SERIAL PRIMARY KEY,
"answer" TEXT NOT NULL,
"question_id" INTEGER REFERENCES "questions"(id)
ON DELETE CASCADE NOT NULL
) |
CREATE TABLE IF NOT EXISTS `store_locator` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`user_id` bigint(20) NOT NULL,
`post_id` bigint(20) NOT NULL,
`category_id` int(11) NOT NULL,
`name` varchar(160) NOT NULL,
`logo` varchar(160) NOT NULL,
`address` varchar(160) NOT NULL,
`lat` varchar(20) NOT NULL,
`lng` varchar(20) NOT NULL,
`url` varchar(160) NOT NULL,
`description` text NOT NULL,
`tel` varchar(30) NOT NULL,
`email` varchar(60) NOT NULL,
`city` varchar(60) NOT NULL,
`country` varchar(60) NOT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `store_locator_category` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(120) NOT NULL,
`marker_icon` varchar(200) NOT NULL,
`image` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ; |
create table USER (
USER_ID identity primary key,
NAME varchar not null,
VERSION BIGINT,
CREATED_DATE TIMESTAMP,
LAST_MODIFIED_DATE TIMESTAMP,
CREATED_BY_USER_ID BIGINT,
LAST_MODIFIED_BY_USER_ID BIGINT,
constraint USER_CREATED_BY_USER foreign key (CREATED_BY_USER_ID) references USER (USER_ID),
constraint USER_LAST_MODIFIED_BY_USER foreign key (LAST_MODIFIED_BY_USER_ID) references USER (USER_ID)
);
create table FOO (
FOO_ID identity primary key,
DATA varchar not null,
VERSION BIGINT,
CREATED_DATE TIMESTAMP,
LAST_MODIFIED_DATE TIMESTAMP,
CREATED_BY_USER_ID BIGINT,
LAST_MODIFIED_BY_USER_ID BIGINT,
constraint FOO_CREATED_BY_USER foreign key (CREATED_BY_USER_ID) references USER (USER_ID),
constraint FOO_LAST_MODIFIED_BY_USER foreign key (LAST_MODIFIED_BY_USER_ID) references USER (USER_ID)
);
|
DROP TABLE IF EXISTS passports;
-- From SQLite extensions. Download regexp.c and compile
-- https://www.sqlite.org/src/file?name=ext/misc/regexp.c
.load regexp.dylib
CREATE TABLE passports(
birth_year TEXT, issue_year INT, expiry_year INT, height INT,
hair_colour TEXT, eye_colour TEXT, passport_id TEXT, country_id INT,
-- Generated columns to pull out unit and value from height
height_unit TEXT GENERATED ALWAYS AS (substr(height, -2)) STORED,
height_value INT GENERATED ALWAYS AS (substr(height, 0, length(height)-1)) STORED
);
INSERT INTO passports SELECT
json_extract(value, '$.byr'),
json_extract(value, '$.iyr'),
json_extract(value, '$.eyr'),
json_extract(value, '$.hgt'),
json_extract(value, '$.hcl'),
json_extract(value, '$.ecl'),
json_extract(value, '$.pid'),
json_extract(value, '$.cid')
FROM json_each(readfile('04_input.json'));
-- Part 1
select count(*) from passports where "" not in (
birth_year, issue_year, expiry_year, height, hair_colour, eye_colour, passport_id
);
-- Part 2
select count(*) from passports where
birth_year between 1920 and 2002 AND
issue_year between 2010 and 2020 AND
expiry_year between 2020 and 2030 AND
(
height_unit = 'cm' AND height_value between 150 and 193
OR
height_unit = 'in' AND height_value between 59 and 76
) AND
hair_colour regexp "#[0-9a-f]{6}" AND
eye_colour in ("amb","blu","brn","gry","grn","hzl","oth") AND
length(passport_id) = 9 order by 1 desc;
|
SELECT * FROM Timestamp_test_from; |
DROP DATABASE IF EXISTS elyon_db;
CREATE DATABASE IF NOT EXISTS elyon_db;
USE elyon_db;
CREATE TABLE IF NOT EXISTS user (
uuid VARCHAR(255) NOT NULL UNIQUE PRIMARY KEY,
name VARCHAR(255) NOT NULL UNIQUE,
u_gear INT NOT NULL DEFAULT 0,
u_level INT NOT NULL DEFAULT 0,
u_skill INT NOT NULL DEFAULT 0,
u_class VARCHAR(255) DEFAULT NULL,
r_red INT NOT NULL DEFAULT 0,
r_orange INT NOT NULL DEFAULT 0,
r_yellow INT NOT NULL DEFAULT 0,
r_blue INT NOT NULL DEFAULT 0,
r_green INT NOT NULL DEFAULT 0,
r_purple INT NOT NULL DEFAULT 0
);
|
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 08, 2016 at 08:06 AM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `myfiles_db`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
CREATE TABLE IF NOT EXISTS `admin` (
`no_id` int(10) NOT NULL,
`username` varchar(40) NOT NULL,
`password` varchar(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `data_umum`
--
CREATE TABLE IF NOT EXISTS `data_umum` (
`no_data` int(20) NOT NULL,
`tanggal` date NOT NULL,
`nama_data` varchar(50) NOT NULL,
`mata_kuliah` varchar(50) NOT NULL,
`semester` varchar(50) NOT NULL,
`type_file` varchar(10) NOT NULL,
`ukuran` varchar(20) NOT NULL,
`file` varchar(225) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `data_umum`
--
INSERT INTO `data_umum` (`no_data`, `tanggal`, `nama_data`, `mata_kuliah`, `semester`, `type_file`, `ukuran`, `file`) VALUES
(1, '2016-01-08', 'internet', 'internet', '5', 'docx', '14606', 'files/internet.docx');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`no_id`);
--
-- Indexes for table `data_umum`
--
ALTER TABLE `data_umum`
ADD PRIMARY KEY (`no_data`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE departments (
department_id VARCHAR(5) PRIMARY KEY,
department_name VARCHAR(25),
over_head_costs INT
);
CREATE TABLE products (
item_id VARCHAR(10) PRIMARY KEY,
product_name VARCHAR(50),
department_id VARCHAR(5),
price FLOAT,
stock_quantity INT,
product_sales FLOAT DEFAULT 0,
FOREIGN KEY (department_id) REFERENCES departments(department_id)
); |
-- ORDER BYはOVERの中で使われるが、あくまでウィンドウ関数が計算する順序を決めるだけ
-- 結果を並び替える場合、別にORDER BYを指定する
SELECT
name,
grouping,
unit_price,
RANK ()
OVER (
ORDER BY unit_price
) AS ranking
FROM
items
ORDER BY ranking
; |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Type : MariaDB
Source Server Version : 100207
Source Host : localhost:3306
Source Schema is_rule_stoped: lian2
Target Server Type : MariaDB
Target Server Version : 100207
File Encoding : 65001
Date: 27/09/2019 00:00:26
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for admin_menu
-- ----------------------------
DROP TABLE IF EXISTS `admin_menu`;
CREATE TABLE `admin_menu` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` int(11) NOT NULL DEFAULT 0,
`order` int(11) NOT NULL DEFAULT 0,
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`uri` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_menu
-- ----------------------------
INSERT INTO `admin_menu` VALUES (1, 0, 1, 'Dashboard', 'fa-bar-chart', '/', NULL, NULL, NULL);
INSERT INTO `admin_menu` VALUES (2, 0, 2, 'Admin', 'fa-tasks', '', NULL, NULL, NULL);
INSERT INTO `admin_menu` VALUES (3, 2, 3, 'Users', 'fa-users', 'auth/users', NULL, NULL, NULL);
INSERT INTO `admin_menu` VALUES (8, 0, 8, '客户管理', 'fa-user', 'clients', NULL, '2019-07-24 03:44:46', '2019-07-24 03:44:46');
INSERT INTO `admin_menu` VALUES (10, 0, 10, '销售管理', 'fa-blind', 'users', NULL, '2019-07-24 03:44:46', '2019-07-24 03:44:46');
INSERT INTO `admin_menu` VALUES (11, 0, 11, '设置', 'fa-server', 'setting', NULL, '2019-07-24 03:44:46', '2019-07-24 03:44:46');
-- ----------------------------
-- Table structure for admin_menu_copy1
-- ----------------------------
DROP TABLE IF EXISTS `admin_menu_copy1`;
CREATE TABLE `admin_menu_copy1` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`parent_id` int(11) NOT NULL DEFAULT 0,
`order` int(11) NOT NULL DEFAULT 0,
`title` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`icon` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`uri` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`permission` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_menu_copy1
-- ----------------------------
INSERT INTO `admin_menu_copy1` VALUES (1, 0, 1, 'Dashboard', 'fa-bar-chart', '/', NULL, NULL, NULL);
INSERT INTO `admin_menu_copy1` VALUES (2, 0, 2, 'Admin', 'fa-tasks', '', NULL, NULL, NULL);
INSERT INTO `admin_menu_copy1` VALUES (3, 2, 3, 'Users', 'fa-users', 'auth/users', NULL, NULL, NULL);
INSERT INTO `admin_menu_copy1` VALUES (4, 2, 4, 'Roles', 'fa-user', 'auth/roles', NULL, NULL, NULL);
INSERT INTO `admin_menu_copy1` VALUES (5, 2, 5, 'Permission', 'fa-ban', 'auth/permissions', NULL, NULL, NULL);
INSERT INTO `admin_menu_copy1` VALUES (6, 2, 6, 'Menu', 'fa-bars', 'auth/menu', NULL, NULL, NULL);
INSERT INTO `admin_menu_copy1` VALUES (7, 2, 7, 'Operation log', 'fa-history', 'auth/logs', NULL, NULL, NULL);
INSERT INTO `admin_menu_copy1` VALUES (8, 0, 8, '客户管理', 'fa-user', 'clients', NULL, '2019-07-24 03:44:46', '2019-07-24 03:44:46');
INSERT INTO `admin_menu_copy1` VALUES (10, 0, 10, '销售管理', 'fa-blind', 'users', NULL, '2019-07-24 03:44:46', '2019-07-24 03:44:46');
INSERT INTO `admin_menu_copy1` VALUES (11, 0, 11, '设置', 'fa-server', 'setting', NULL, '2019-07-24 03:44:46', '2019-07-24 03:44:46');
-- ----------------------------
-- Table structure for admin_operation_log
-- ----------------------------
DROP TABLE IF EXISTS `admin_operation_log`;
CREATE TABLE `admin_operation_log` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`method` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`input` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
INDEX `admin_operation_log_user_id_index`(`user_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 111 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_operation_log
-- ----------------------------
INSERT INTO `admin_operation_log` VALUES (1, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-20 14:13:11', '2019-09-20 14:13:11');
INSERT INTO `admin_operation_log` VALUES (2, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-20 15:10:13', '2019-09-20 15:10:13');
INSERT INTO `admin_operation_log` VALUES (3, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-20 15:10:20', '2019-09-20 15:10:20');
INSERT INTO `admin_operation_log` VALUES (4, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-22 15:16:13', '2019-09-22 15:16:13');
INSERT INTO `admin_operation_log` VALUES (5, 1, 'admin', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-22 15:16:31', '2019-09-22 15:16:31');
INSERT INTO `admin_operation_log` VALUES (6, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:18:10', '2019-09-22 15:18:10');
INSERT INTO `admin_operation_log` VALUES (7, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:18:14', '2019-09-22 15:18:14');
INSERT INTO `admin_operation_log` VALUES (8, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:19:30', '2019-09-22 15:19:30');
INSERT INTO `admin_operation_log` VALUES (9, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:24:50', '2019-09-22 15:24:50');
INSERT INTO `admin_operation_log` VALUES (10, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:25:01', '2019-09-22 15:25:01');
INSERT INTO `admin_operation_log` VALUES (11, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:25:17', '2019-09-22 15:25:17');
INSERT INTO `admin_operation_log` VALUES (12, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:25:27', '2019-09-22 15:25:27');
INSERT INTO `admin_operation_log` VALUES (13, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:36:18', '2019-09-22 15:36:18');
INSERT INTO `admin_operation_log` VALUES (14, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-22 15:36:56', '2019-09-22 15:36:56');
INSERT INTO `admin_operation_log` VALUES (15, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-22 15:54:37', '2019-09-22 15:54:37');
INSERT INTO `admin_operation_log` VALUES (16, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-22 15:55:22', '2019-09-22 15:55:22');
INSERT INTO `admin_operation_log` VALUES (17, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-23 01:04:57', '2019-09-23 01:04:57');
INSERT INTO `admin_operation_log` VALUES (18, 1, 'admin/rules/create', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 01:05:00', '2019-09-23 01:05:00');
INSERT INTO `admin_operation_log` VALUES (19, 1, 'admin/rules/create', 'GET', '127.0.0.1', '[]', '2019-09-23 01:05:59', '2019-09-23 01:05:59');
INSERT INTO `admin_operation_log` VALUES (20, 1, 'admin/rules/create', 'GET', '127.0.0.1', '[]', '2019-09-23 01:06:21', '2019-09-23 01:06:21');
INSERT INTO `admin_operation_log` VALUES (21, 1, 'admin/rules/create', 'GET', '127.0.0.1', '[]', '2019-09-23 01:06:57', '2019-09-23 01:06:57');
INSERT INTO `admin_operation_log` VALUES (22, 1, 'admin/rules/create', 'GET', '127.0.0.1', '[]', '2019-09-23 01:07:32', '2019-09-23 01:07:32');
INSERT INTO `admin_operation_log` VALUES (23, 1, 'admin/rules', 'POST', '127.0.0.1', '{\"name\":\"test\",\"_token\":\"TDEukD74qIwfsymggDDj61hLfLzdOtFkf1MQp30s\"}', '2019-09-23 01:07:37', '2019-09-23 01:07:37');
INSERT INTO `admin_operation_log` VALUES (24, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-23 01:07:38', '2019-09-23 01:07:38');
INSERT INTO `admin_operation_log` VALUES (25, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 01:07:46', '2019-09-23 01:07:46');
INSERT INTO `admin_operation_log` VALUES (26, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '[]', '2019-09-23 06:22:17', '2019-09-23 06:22:17');
INSERT INTO `admin_operation_log` VALUES (27, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '[]', '2019-09-23 06:22:53', '2019-09-23 06:22:53');
INSERT INTO `admin_operation_log` VALUES (28, 1, 'admin/rules/1', 'PUT', '127.0.0.1', '{\"name\":\"test\",\"detail\":{\"new_1\":{\"title\":\"1\",\"time_last\":\"1\",\"id\":null,\"_remove_\":\"0\"}},\"_token\":\"x4gclSd9nRvIe1RcMRAYR0nNlJYPJlHZlSEzAr9G\",\"_method\":\"PUT\"}', '2019-09-23 06:23:04', '2019-09-23 06:23:04');
INSERT INTO `admin_operation_log` VALUES (29, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '[]', '2019-09-23 06:23:06', '2019-09-23 06:23:06');
INSERT INTO `admin_operation_log` VALUES (30, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 06:23:18', '2019-09-23 06:23:18');
INSERT INTO `admin_operation_log` VALUES (31, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '[]', '2019-09-23 06:23:21', '2019-09-23 06:23:21');
INSERT INTO `admin_operation_log` VALUES (32, 1, 'admin/rules/1', 'PUT', '127.0.0.1', '{\"name\":\"test\",\"detail\":{\"new_1\":{\"time_last\":\"1\",\"id\":null,\"_remove_\":\"0\"}},\"_token\":\"x4gclSd9nRvIe1RcMRAYR0nNlJYPJlHZlSEzAr9G\",\"_method\":\"PUT\"}', '2019-09-23 06:23:27', '2019-09-23 06:23:27');
INSERT INTO `admin_operation_log` VALUES (33, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '[]', '2019-09-23 06:23:30', '2019-09-23 06:23:30');
INSERT INTO `admin_operation_log` VALUES (34, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '[]', '2019-09-23 06:26:59', '2019-09-23 06:26:59');
INSERT INTO `admin_operation_log` VALUES (35, 1, 'admin/rules/1', 'PUT', '127.0.0.1', '{\"name\":\"test\",\"detail\":{\"new_1\":{\"time_last\":\"1\",\"index\":\"1\",\"id\":null,\"_remove_\":\"0\"}},\"_token\":\"x4gclSd9nRvIe1RcMRAYR0nNlJYPJlHZlSEzAr9G\",\"_method\":\"PUT\"}', '2019-09-23 06:27:04', '2019-09-23 06:27:04');
INSERT INTO `admin_operation_log` VALUES (36, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-23 06:27:05', '2019-09-23 06:27:05');
INSERT INTO `admin_operation_log` VALUES (37, 1, 'admin/rules/1', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 06:27:09', '2019-09-23 06:27:09');
INSERT INTO `admin_operation_log` VALUES (38, 1, 'admin/rules', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 06:27:16', '2019-09-23 06:27:16');
INSERT INTO `admin_operation_log` VALUES (39, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 06:27:20', '2019-09-23 06:27:20');
INSERT INTO `admin_operation_log` VALUES (40, 1, 'admin/rules/1/edit', 'GET', '127.0.0.1', '[]', '2019-09-23 06:32:19', '2019-09-23 06:32:19');
INSERT INTO `admin_operation_log` VALUES (41, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-23 06:32:57', '2019-09-23 06:32:57');
INSERT INTO `admin_operation_log` VALUES (42, 1, 'admin/rules/create', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 06:33:00', '2019-09-23 06:33:00');
INSERT INTO `admin_operation_log` VALUES (43, 1, 'admin/rules', 'POST', '127.0.0.1', '{\"name\":\"test2\",\"detail\":{\"new_1\":{\"time_last\":\"2\",\"index\":\"1\",\"user_id\":\"86\",\"id\":null,\"_remove_\":\"0\"}},\"_token\":\"x4gclSd9nRvIe1RcMRAYR0nNlJYPJlHZlSEzAr9G\",\"_previous_\":\"http:\\/\\/test.lian2.com\\/admin\\/rules\\/\"}', '2019-09-23 06:33:10', '2019-09-23 06:33:10');
INSERT INTO `admin_operation_log` VALUES (44, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-23 06:33:12', '2019-09-23 06:33:12');
INSERT INTO `admin_operation_log` VALUES (45, 1, 'admin/rules/2/edit', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 06:33:57', '2019-09-23 06:33:57');
INSERT INTO `admin_operation_log` VALUES (46, 1, 'admin/rules/2', 'PUT', '127.0.0.1', '{\"name\":\"test2\",\"detail\":{\"new_1\":{\"time_last\":\"1\",\"index\":\"1\",\"user_id\":\"86\",\"id\":null,\"_remove_\":\"0\"}},\"_token\":\"x4gclSd9nRvIe1RcMRAYR0nNlJYPJlHZlSEzAr9G\",\"_method\":\"PUT\",\"_previous_\":\"http:\\/\\/test.lian2.com\\/admin\\/rules\\/\"}', '2019-09-23 06:34:04', '2019-09-23 06:34:04');
INSERT INTO `admin_operation_log` VALUES (47, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-23 06:34:05', '2019-09-23 06:34:05');
INSERT INTO `admin_operation_log` VALUES (48, 1, 'admin/rules', 'GET', '127.0.0.1', '[]', '2019-09-23 06:36:25', '2019-09-23 06:36:25');
INSERT INTO `admin_operation_log` VALUES (49, 1, 'admin/auth/users', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-23 14:42:12', '2019-09-23 14:42:12');
INSERT INTO `admin_operation_log` VALUES (50, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 14:42:23', '2019-09-23 14:42:23');
INSERT INTO `admin_operation_log` VALUES (51, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 14:44:15', '2019-09-23 14:44:15');
INSERT INTO `admin_operation_log` VALUES (52, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:22:17', '2019-09-23 15:22:17');
INSERT INTO `admin_operation_log` VALUES (53, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:24:17', '2019-09-23 15:24:17');
INSERT INTO `admin_operation_log` VALUES (54, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:24:35', '2019-09-23 15:24:35');
INSERT INTO `admin_operation_log` VALUES (55, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:25:16', '2019-09-23 15:25:16');
INSERT INTO `admin_operation_log` VALUES (56, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:26:48', '2019-09-23 15:26:48');
INSERT INTO `admin_operation_log` VALUES (57, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:30:41', '2019-09-23 15:30:41');
INSERT INTO `admin_operation_log` VALUES (58, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:31:51', '2019-09-23 15:31:51');
INSERT INTO `admin_operation_log` VALUES (59, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:33:08', '2019-09-23 15:33:08');
INSERT INTO `admin_operation_log` VALUES (60, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-23 15:33:33', '2019-09-23 15:33:33');
INSERT INTO `admin_operation_log` VALUES (61, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-24 14:17:07', '2019-09-24 14:17:07');
INSERT INTO `admin_operation_log` VALUES (62, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-24 14:17:35', '2019-09-24 14:17:35');
INSERT INTO `admin_operation_log` VALUES (63, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-24 14:17:38', '2019-09-24 14:17:38');
INSERT INTO `admin_operation_log` VALUES (64, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-24 14:20:41', '2019-09-24 14:20:41');
INSERT INTO `admin_operation_log` VALUES (65, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-24 14:21:01', '2019-09-24 14:21:01');
INSERT INTO `admin_operation_log` VALUES (66, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-24 14:21:23', '2019-09-24 14:21:23');
INSERT INTO `admin_operation_log` VALUES (67, 1, 'admin/auth/users', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:21:36', '2019-09-24 14:21:36');
INSERT INTO `admin_operation_log` VALUES (68, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"1\",\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:21:41', '2019-09-24 14:21:41');
INSERT INTO `admin_operation_log` VALUES (69, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"1\"}', '2019-09-24 14:21:42', '2019-09-24 14:21:42');
INSERT INTO `admin_operation_log` VALUES (70, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:22:03', '2019-09-24 14:22:03');
INSERT INTO `admin_operation_log` VALUES (71, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:26:05', '2019-09-24 14:26:05');
INSERT INTO `admin_operation_log` VALUES (72, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"1\"}', '2019-09-24 14:26:10', '2019-09-24 14:26:10');
INSERT INTO `admin_operation_log` VALUES (73, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"1\"}', '2019-09-24 14:26:23', '2019-09-24 14:26:23');
INSERT INTO `admin_operation_log` VALUES (74, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:26:27', '2019-09-24 14:26:27');
INSERT INTO `admin_operation_log` VALUES (75, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:26:48', '2019-09-24 14:26:48');
INSERT INTO `admin_operation_log` VALUES (76, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:26:57', '2019-09-24 14:26:57');
INSERT INTO `admin_operation_log` VALUES (77, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:27:05', '2019-09-24 14:27:05');
INSERT INTO `admin_operation_log` VALUES (78, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:29:19', '2019-09-24 14:29:19');
INSERT INTO `admin_operation_log` VALUES (79, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:29:26', '2019-09-24 14:29:26');
INSERT INTO `admin_operation_log` VALUES (80, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"1\",\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:32:57', '2019-09-24 14:32:57');
INSERT INTO `admin_operation_log` VALUES (81, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"1\"}', '2019-09-24 14:32:58', '2019-09-24 14:32:58');
INSERT INTO `admin_operation_log` VALUES (82, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\",\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:33:04', '2019-09-24 14:33:04');
INSERT INTO `admin_operation_log` VALUES (83, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-24 14:33:05', '2019-09-24 14:33:05');
INSERT INTO `admin_operation_log` VALUES (84, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:33:13', '2019-09-24 14:33:13');
INSERT INTO `admin_operation_log` VALUES (85, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-24 14:33:15', '2019-09-24 14:33:15');
INSERT INTO `admin_operation_log` VALUES (86, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-24 14:35:38', '2019-09-24 14:35:38');
INSERT INTO `admin_operation_log` VALUES (87, 1, 'admin/clients-import/index', 'GET', '127.0.0.1', '[]', '2019-09-24 14:36:30', '2019-09-24 14:36:30');
INSERT INTO `admin_operation_log` VALUES (88, 1, 'admin/clients-import/index', 'GET', '127.0.0.1', '[]', '2019-09-24 14:37:09', '2019-09-24 14:37:09');
INSERT INTO `admin_operation_log` VALUES (89, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:37:57', '2019-09-24 14:37:57');
INSERT INTO `admin_operation_log` VALUES (90, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:38:02', '2019-09-24 14:38:02');
INSERT INTO `admin_operation_log` VALUES (91, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-24 14:38:03', '2019-09-24 14:38:03');
INSERT INTO `admin_operation_log` VALUES (92, 1, 'admin/clients-import/index', 'GET', '127.0.0.1', '{\"_pjax\":\"#pjax-container\"}', '2019-09-24 14:38:06', '2019-09-24 14:38:06');
INSERT INTO `admin_operation_log` VALUES (93, 1, 'admin', 'GET', '127.0.0.1', '[]', '2019-09-26 14:49:55', '2019-09-26 14:49:55');
INSERT INTO `admin_operation_log` VALUES (94, 1, 'admin/clients', 'GET', '127.0.0.1', '[]', '2019-09-26 15:09:59', '2019-09-26 15:09:59');
INSERT INTO `admin_operation_log` VALUES (95, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:10:36', '2019-09-26 15:10:36');
INSERT INTO `admin_operation_log` VALUES (96, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:10:49', '2019-09-26 15:10:49');
INSERT INTO `admin_operation_log` VALUES (97, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:12:06', '2019-09-26 15:12:06');
INSERT INTO `admin_operation_log` VALUES (98, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:28:33', '2019-09-26 15:28:33');
INSERT INTO `admin_operation_log` VALUES (99, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:29:16', '2019-09-26 15:29:16');
INSERT INTO `admin_operation_log` VALUES (100, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:29:31', '2019-09-26 15:29:31');
INSERT INTO `admin_operation_log` VALUES (101, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:31:39', '2019-09-26 15:31:39');
INSERT INTO `admin_operation_log` VALUES (102, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:32:08', '2019-09-26 15:32:08');
INSERT INTO `admin_operation_log` VALUES (103, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:32:22', '2019-09-26 15:32:22');
INSERT INTO `admin_operation_log` VALUES (104, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:33:40', '2019-09-26 15:33:40');
INSERT INTO `admin_operation_log` VALUES (105, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:34:42', '2019-09-26 15:34:42');
INSERT INTO `admin_operation_log` VALUES (106, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:35:35', '2019-09-26 15:35:35');
INSERT INTO `admin_operation_log` VALUES (107, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:36:24', '2019-09-26 15:36:24');
INSERT INTO `admin_operation_log` VALUES (108, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:36:34', '2019-09-26 15:36:34');
INSERT INTO `admin_operation_log` VALUES (109, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:36:47', '2019-09-26 15:36:47');
INSERT INTO `admin_operation_log` VALUES (110, 1, 'admin/clients', 'GET', '127.0.0.1', '{\"admin_user_id\":\"2\"}', '2019-09-26 15:36:59', '2019-09-26 15:36:59');
-- ----------------------------
-- Table structure for admin_permissions
-- ----------------------------
DROP TABLE IF EXISTS `admin_permissions`;
CREATE TABLE `admin_permissions` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`http_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`http_path` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `admin_permissions_name_unique`(`name`) USING BTREE,
UNIQUE INDEX `admin_permissions_slug_unique`(`slug`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_permissions
-- ----------------------------
INSERT INTO `admin_permissions` VALUES (1, 'All permission', '*', '', '*', NULL, NULL);
INSERT INTO `admin_permissions` VALUES (2, 'Dashboard', 'dashboard', 'GET', '/', NULL, NULL);
INSERT INTO `admin_permissions` VALUES (3, 'Login', 'auth.login', '', '/auth/login\r\n/auth/logout', NULL, NULL);
INSERT INTO `admin_permissions` VALUES (4, 'User setting', 'auth.setting', 'GET,PUT', '/auth/setting', NULL, NULL);
INSERT INTO `admin_permissions` VALUES (5, 'Auth management', 'auth.management', '', '/auth/roles\r\n/auth/permissions\r\n/auth/menu\r\n/auth/logs', NULL, NULL);
-- ----------------------------
-- Table structure for admin_role_menu
-- ----------------------------
DROP TABLE IF EXISTS `admin_role_menu`;
CREATE TABLE `admin_role_menu` (
`role_id` int(11) NOT NULL,
`menu_id` int(11) NOT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
INDEX `admin_role_menu_role_id_menu_id_index`(`role_id`, `menu_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_role_menu
-- ----------------------------
INSERT INTO `admin_role_menu` VALUES (1, 2, NULL, NULL);
-- ----------------------------
-- Table structure for admin_role_permissions
-- ----------------------------
DROP TABLE IF EXISTS `admin_role_permissions`;
CREATE TABLE `admin_role_permissions` (
`role_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
INDEX `admin_role_permissions_role_id_permission_id_index`(`role_id`, `permission_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_role_permissions
-- ----------------------------
INSERT INTO `admin_role_permissions` VALUES (1, 1, NULL, NULL);
-- ----------------------------
-- Table structure for admin_role_users
-- ----------------------------
DROP TABLE IF EXISTS `admin_role_users`;
CREATE TABLE `admin_role_users` (
`role_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
INDEX `admin_role_users_role_id_user_id_index`(`role_id`, `user_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_role_users
-- ----------------------------
INSERT INTO `admin_role_users` VALUES (1, 1, NULL, NULL);
-- ----------------------------
-- Table structure for admin_roles
-- ----------------------------
DROP TABLE IF EXISTS `admin_roles`;
CREATE TABLE `admin_roles` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`slug` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `admin_roles_name_unique`(`name`) USING BTREE,
UNIQUE INDEX `admin_roles_slug_unique`(`slug`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_roles
-- ----------------------------
INSERT INTO `admin_roles` VALUES (1, 'Administrator', 'administrator', '2019-09-20 08:15:51', '2019-09-20 08:15:51');
-- ----------------------------
-- Table structure for admin_user_permissions
-- ----------------------------
DROP TABLE IF EXISTS `admin_user_permissions`;
CREATE TABLE `admin_user_permissions` (
`user_id` int(11) NOT NULL,
`permission_id` int(11) NOT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
INDEX `admin_user_permissions_user_id_permission_id_index`(`user_id`, `permission_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for admin_users
-- ----------------------------
DROP TABLE IF EXISTS `admin_users`;
CREATE TABLE `admin_users` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(190) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`avatar` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `admin_users_username_unique`(`username`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of admin_users
-- ----------------------------
INSERT INTO `admin_users` VALUES (1, 'admin', '$2y$10$4IHSUxbNgpdWCqvGHQVJmOOi/680vduoSBA.n9sU0F6W8SW6rVU2S', 'Administrator', NULL, 'xAHUPiY8VF831sYk3Yu7h3KvbworkxORgqkD9vyFBWSyCGp7JVyevIzUbh6S', '2019-09-20 08:15:51', '2019-09-20 08:15:51');
INSERT INTO `admin_users` VALUES (2, 'simon', '$2y$10$4IHSUxbNgpdWCqvGHQVJmOOi/680vduoSBA.n9sU0F6W8SW6rVU2S', 'Administrator', NULL, 'xAHUPiY8VF831sYk3Yu7h3KvbworkxORgqkD9vyFBWSyCGp7JVyevIzUbh6S', '2019-09-20 08:15:51', '2019-09-20 08:15:51');
-- ----------------------------
-- Table structure for clients
-- ----------------------------
DROP TABLE IF EXISTS `clients`;
CREATE TABLE `clients` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1 COMMENT '状态,最终确定的状态',
`sales_status` tinyint(1) NOT NULL DEFAULT 0 COMMENT '0 未打电话 1 ',
`admin_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '管理员备注',
`sales_remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '销售备注',
`transfer_remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '财务备注',
`remark` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注信息',
`rule_id` int(11) NULL DEFAULT NULL,
`user_id` int(11) NULL DEFAULT NULL,
`is_rule_stoped` tinyint(1) NOT NULL DEFAULT 0,
`admin_user_id` int(11) NOT NULL DEFAULT 0 COMMENT '指定的销售人员id',
`upload_admin_id` int(11) NOT NULL DEFAULT 0 COMMENT '提交的admin_user_id 无法更改',
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `phone`(`phone`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '客户,即需要买手机的' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of clients
-- ----------------------------
INSERT INTO `clients` VALUES (1, 'simon', '13365802535', 1, 0, NULL, NULL, NULL, NULL, 1, NULL, 0, 2, 0, NULL, NULL);
-- ----------------------------
-- Table structure for clients_users
-- ----------------------------
DROP TABLE IF EXISTS `clients_users`;
CREATE TABLE `clients_users` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`client_id` int(11) NULL DEFAULT NULL,
`user_id` int(11) NULL DEFAULT NULL,
`remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`accept_at` timestamp(0) NULL DEFAULT NULL COMMENT '点击接收时间',
`status` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间,也即派发时间',
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of clients_users
-- ----------------------------
INSERT INTO `clients_users` VALUES (1, 1, 86, '2112', '2019-09-23 15:21:35', '1', '2019-09-23 15:21:35', '2019-09-26 14:56:17');
INSERT INTO `clients_users` VALUES (2, 1, 87, '2112', '2019-09-23 15:21:35', '1', '2019-09-23 15:21:35', '2019-09-26 14:56:17');
-- ----------------------------
-- Table structure for clients_users_logs
-- ----------------------------
DROP TABLE IF EXISTS `clients_users_logs`;
CREATE TABLE `clients_users_logs` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`client_id` int(11) NOT NULL DEFAULT 0,
`user_id` int(11) NOT NULL DEFAULT 0,
`old_status` tinyint(1) NOT NULL DEFAULT 0,
`new_status` tinyint(1) NOT NULL DEFAULT 0,
`created_at` timestamp(0) NULL DEFAULT NULL COMMENT '创建时间,也即派发时间',
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of clients_users_logs
-- ----------------------------
INSERT INTO `clients_users_logs` VALUES (1, 1, 86, 1, 1, '2019-09-23 15:21:35', '2019-09-26 14:56:17');
-- ----------------------------
-- Table structure for migrations
-- ----------------------------
DROP TABLE IF EXISTS `migrations`;
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`migration` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of migrations
-- ----------------------------
INSERT INTO `migrations` VALUES (1, '2014_10_12_000000_create_users_table', 1);
INSERT INTO `migrations` VALUES (2, '2014_10_12_100000_create_password_resets_table', 1);
INSERT INTO `migrations` VALUES (3, '2016_01_04_173148_create_admin_tables', 1);
-- ----------------------------
-- Table structure for password_resets
-- ----------------------------
DROP TABLE IF EXISTS `password_resets`;
CREATE TABLE `password_resets` (
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
INDEX `password_resets_email_index`(`email`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for rules
-- ----------------------------
DROP TABLE IF EXISTS `rules`;
CREATE TABLE `rules` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of rules
-- ----------------------------
INSERT INTO `rules` VALUES (1, 'test', '2019-09-23 01:07:37', '2019-09-23 01:07:37');
INSERT INTO `rules` VALUES (2, 'test2', '2019-09-23 06:33:10', '2019-09-23 06:33:10');
-- ----------------------------
-- Table structure for rules_detail
-- ----------------------------
DROP TABLE IF EXISTS `rules_detail`;
CREATE TABLE `rules_detail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`rule_id` int(11) NULL DEFAULT NULL,
`user_id` int(11) NULL DEFAULT NULL,
`time_last` int(11) NULL DEFAULT NULL COMMENT '时间间隔,小时计算',
`index` tinyint(1) NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 4 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_bin ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of rules_detail
-- ----------------------------
INSERT INTO `rules_detail` VALUES (1, 1, 86, 1, 1, '2019-09-23 06:27:04', '2019-09-23 06:27:04');
INSERT INTO `rules_detail` VALUES (3, 2, 86, 1, 1, '2019-09-23 06:34:04', '2019-09-23 06:34:04');
-- ----------------------------
-- Table structure for settings
-- ----------------------------
DROP TABLE IF EXISTS `settings`;
CREATE TABLE `settings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`key` varchar(128) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`value` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 16 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of settings
-- ----------------------------
INSERT INTO `settings` VALUES (1, 'home_text', '首页信息 你好!欢迎您的到来!', '首页配置', '2019-07-25 06:28:00');
INSERT INTO `settings` VALUES (2, 'send_email', '198700333@qq.com', '发件箱', '2019-07-26 09:19:52');
INSERT INTO `settings` VALUES (3, 'receiver_email', '198700333@qq.com', '收件箱', '2019-07-26 09:20:03');
INSERT INTO `settings` VALUES (5, 'email_host', 'smtp.qq.com', '1', NULL);
INSERT INTO `settings` VALUES (6, 'email_password', 'cahbwvgaewxbbhii', 'xqcibgvtxkvcbigb', NULL);
INSERT INTO `settings` VALUES (7, 'notice', '【】【跑滴滴,请来湖南租行天下网约车】【】湖南租行天下网约车,针对渠道商特给与介绍成功返还X元一台的佣金。\r\n湖南租行天下是整个行业龙头企业,规模,品牌成交率稳居行业首位,选择与我们合作,您佣金更快捷、公平公正、透明!\r\n感谢您的选择与信任!\r\n\r\n\r\n【】您好,您提交信息后,可再去注册登录后台,及可看到您所提交的客户信息状态!【】', '当渠道商没有注册的时候,使用这个', '2019-07-31 03:04:08');
INSERT INTO `settings` VALUES (8, 'notice_1', '尊敬的普通渠道商:您好!\r\n【直推:通过后台提交客户信息或分享客户二维码供客户自行提交信息。】\r\n直推成交=返佣金XXX元到您银行卡;', '普通经销商公告', '2019-07-25 07:19:07');
INSERT INTO `settings` VALUES (9, 'notice_2', '待客户如家人,感恩您的信任,如您有朋友需要加入公司,请在本后台提交数据,或将二维码发送给对方自行提交数据。\r\n成交后赠送X次保养给您!', '老客户', '2019-07-25 07:26:16');
INSERT INTO `settings` VALUES (10, 'notice_3', '尊敬的高级渠道商:您好!\r\n(仅高级渠道商具有分享二维码,邀请注册为普通渠道商的权限!)\r\n【直推:通过后台提交客户信息或分享客户二维码供客户自行提交信息。】\r\n【间推:您邀请的普通渠道商通过后台提交客户信息或分享客户二维码供客户自行提交信息。】\r\n直推成交=返佣金XXX元到您银行卡;\r\n间推成交=返佣金xx元到您银行卡', '高级经销商公告信息,可以发展下级', '2019-07-25 07:14:07');
INSERT INTO `settings` VALUES (11, 'notice_4', '各位外拓经理,持之以恒,坚持不懈,源源不断!\r\n【本月新增任务:10单,天道酬勤,加油!】', '外拓经理公告信息', '2019-08-17 12:11:14');
INSERT INTO `settings` VALUES (12, 'login_notice', '湖南租行天下网约车,是长沙网约车业务最大的网约车公司!本公司业务人员从业经验资深,成交率远高于行业平均水准,公司规模、品牌口碑、服务专业性稳居行业前茅!诚邀合作伙伴注册,推荐意向客户,合作共赢!【单月佣金政策仅针对公司已认证合作商有效,登录后台可见】', '登录公告信息', '2019-08-15 15:15:57');
INSERT INTO `settings` VALUES (13, 'register_notice', '欢迎注册为湖南租行天下合作商,推荐意向客户来本公司跑网约车,丰厚佣金等你来拿!【公司采取特邀认证形式,获得认证资格,方可认证通过】', '注册公告信息', '2019-08-15 15:14:34');
INSERT INTO `settings` VALUES (14, 'top_is_open', '1', '是否开启显示外拓经理,1开启,0不显示', '2019-08-14 15:07:32');
INSERT INTO `settings` VALUES (15, 'self_notice', '湖南租行天下,滴滴网约车龙头企业,加入我们公司,快速合法合规赚钱!【赶快提交您的信息吧,工作人员将会在最短时间内,给您详细解答】', '用于用户自助填写信息的时候,显示', '2019-08-15 15:54:16');
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`phone` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`email` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp(0) NULL DEFAULT NULL,
`password` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`status` tinyint(1) NULL DEFAULT 0,
`ip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL,
`created_at` timestamp(0) NULL DEFAULT NULL,
`updated_at` timestamp(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `users_email_unique`(`phone`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 88 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of users
-- ----------------------------
INSERT INTO `users` VALUES (86, '13365802535', '13365802535', '', '2019-09-21 22:19:18', '$2y$10$X6GX3CAVYtTlfFw5mi2Za..uJPGChJ6/gR/o10Ofqp1o9Hle4TNSG', 'fG7WiWn7diNGmQT3X19IiZsZ9PAWiqNRdbKCnQWZapDmXAQTZcmBqHHaiu6u', 1, NULL, '2019-09-21 22:19:24', '2019-09-21 22:19:28');
INSERT INTO `users` VALUES (87, '11', '11', '23', '2019-09-26 23:34:09', '1', '1', 1, NULL, '2019-09-26 23:34:21', '2019-09-26 23:34:23');
SET FOREIGN_KEY_CHECKS = 1;
|
CREATE TABLE MY_RECORD (
id INT(11) NOT NULL,
data VARCHAR(32) NOT NULL,
PRIMARY KEY (id)
); |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 30, 2021 at 04:15 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.33
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: `spp`
--
-- --------------------------------------------------------
--
-- Table structure for table `kelas`
--
CREATE TABLE `kelas` (
`id_kelas` int(11) NOT NULL,
`nama_kelas` varchar(255) DEFAULT NULL,
`kompetensi_keahlian` varchar(255) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `kelas`
--
INSERT INTO `kelas` (`id_kelas`, `nama_kelas`, `kompetensi_keahlian`, `createdAt`, `updatedAt`) VALUES
(1, 'X IPS 1', 'IPS', '2021-03-15 04:04:48', '2021-03-15 04:04:48'),
(2, 'XI RPL 7', 'RPL', '2021-03-15 04:05:06', '2021-03-15 04:05:06'),
(9, 'XI RPL 2', 'RPL', '2021-03-15 10:58:09', '2021-03-15 10:58:09'),
(11, 'XII TKJ 3', 'TKJ', '2021-03-15 11:30:50', '2021-03-15 11:32:57');
-- --------------------------------------------------------
--
-- Table structure for table `pembayaran`
--
CREATE TABLE `pembayaran` (
`id_pembayaran` int(11) NOT NULL,
`id_petugas` int(11) NOT NULL,
`nisn` varchar(255) DEFAULT NULL,
`tgl_bayar` datetime DEFAULT NULL,
`bulan_dibayar` varchar(255) DEFAULT NULL,
`tahun_dibayar` varchar(255) DEFAULT NULL,
`id_spp` int(11) NOT NULL,
`jumlah_bayar` int(11) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `pembayaran`
--
INSERT INTO `pembayaran` (`id_pembayaran`, `id_petugas`, `nisn`, `tgl_bayar`, `bulan_dibayar`, `tahun_dibayar`, `id_spp`, `jumlah_bayar`, `createdAt`, `updatedAt`) VALUES
(1, 1, 'AB12', '2021-03-15 00:00:00', 'januari', '2020', 1, 200000, '2021-03-15 04:15:15', '2021-03-15 04:15:15'),
(8, 1, '11', '2021-03-16 00:00:00', 'Januari', '2021', 4, 250000, '2021-03-16 11:09:13', '2021-03-16 11:09:13'),
(11, 8, 'MM11', '2021-04-01 00:00:00', 'Januari', '2021', 2, 50000, '2021-04-01 06:50:17', '2021-04-01 06:50:17');
-- --------------------------------------------------------
--
-- Table structure for table `petugas`
--
CREATE TABLE `petugas` (
`id_petugas` int(11) NOT NULL,
`username` varchar(255) DEFAULT NULL,
`password` varchar(255) DEFAULT NULL,
`nama_petugas` varchar(255) DEFAULT NULL,
`level` varchar(255) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `petugas`
--
INSERT INTO `petugas` (`id_petugas`, `username`, `password`, `nama_petugas`, `level`, `createdAt`, `updatedAt`) VALUES
(1, 'mika', '202cb962ac59075b964b07152d234b70', 'mika', 'petugas', '2021-03-15 04:09:16', '2021-03-15 04:09:16'),
(2, 'ozora', '202cb962ac59075b964b07152d234b70', 'ozora', 'admin', '2021-03-15 04:09:36', '2021-03-15 04:09:36'),
(8, 'ilham', '827ccb0eea8a706c4c34a16891f84e7b', 'ilhamgaming', 'petugas', '2021-03-16 11:59:05', '2021-03-16 12:42:19');
-- --------------------------------------------------------
--
-- Table structure for table `sequelizemeta`
--
CREATE TABLE `sequelizemeta` (
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `sequelizemeta`
--
INSERT INTO `sequelizemeta` (`name`) VALUES
('1kelas.js'),
('2spp.js'),
('3petugas.js'),
('4siswa.js'),
('5pembayaran.js');
-- --------------------------------------------------------
--
-- Table structure for table `siswa`
--
CREATE TABLE `siswa` (
`nisn` char(255) NOT NULL,
`nis` char(255) DEFAULT NULL,
`nama` varchar(255) DEFAULT NULL,
`id_kelas` int(11) NOT NULL,
`alamat` text DEFAULT NULL,
`no_telp` varchar(255) DEFAULT NULL,
`id_spp` int(11) NOT NULL,
`password` varchar(255) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `siswa`
--
INSERT INTO `siswa` (`nisn`, `nis`, `nama`, `id_kelas`, `alamat`, `no_telp`, `id_spp`, `password`, `createdAt`, `updatedAt`) VALUES
('11', '1002', 'haji', 2, 'suhat city', '082097544', 2, '202cb962ac59075b964b07152d234b70', '2021-03-15 14:12:19', '2021-03-15 14:12:19'),
('AB12', '1001', 'dana', 1, 'sulfat', '082232986', 1, '202cb962ac59075b964b07152d234b70', '2021-03-15 04:12:08', '2021-03-15 04:12:08'),
('CD34', '1002', 'haji', 2, 'suhat city', '082097544', 2, '202cb962ac59075b964b07152d234b70', '2021-03-15 04:12:48', '2021-03-15 04:12:48'),
('MM11', '1003', 'Satmika Antargata Ozora', 9, 'Pakis Jalio', '1018237372', 4, 'e471a891c22fb1b5b722f57bed71de32', '2021-03-16 09:52:20', '2021-03-16 09:52:20');
-- --------------------------------------------------------
--
-- Table structure for table `spp`
--
CREATE TABLE `spp` (
`id_spp` int(11) NOT NULL,
`tahun` int(11) DEFAULT NULL,
`nominal` int(11) DEFAULT NULL,
`createdAt` datetime NOT NULL,
`updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `spp`
--
INSERT INTO `spp` (`id_spp`, `tahun`, `nominal`, `createdAt`, `updatedAt`) VALUES
(1, 2021, 200000, '2021-03-15 04:05:31', '2021-03-15 04:05:31'),
(2, 2021, 400000, '2021-03-15 04:05:44', '2021-03-15 04:05:44'),
(4, 2019, 250000, '2021-03-16 09:51:18', '2021-03-16 09:51:18');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `kelas`
--
ALTER TABLE `kelas`
ADD PRIMARY KEY (`id_kelas`);
--
-- Indexes for table `pembayaran`
--
ALTER TABLE `pembayaran`
ADD PRIMARY KEY (`id_pembayaran`),
ADD KEY `id_spp` (`id_spp`),
ADD KEY `id_petugas` (`id_petugas`);
--
-- Indexes for table `petugas`
--
ALTER TABLE `petugas`
ADD PRIMARY KEY (`id_petugas`);
--
-- Indexes for table `sequelizemeta`
--
ALTER TABLE `sequelizemeta`
ADD PRIMARY KEY (`name`),
ADD UNIQUE KEY `name` (`name`);
--
-- Indexes for table `siswa`
--
ALTER TABLE `siswa`
ADD PRIMARY KEY (`nisn`),
ADD KEY `id_kelas` (`id_kelas`),
ADD KEY `id_spp` (`id_spp`);
--
-- Indexes for table `spp`
--
ALTER TABLE `spp`
ADD PRIMARY KEY (`id_spp`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `kelas`
--
ALTER TABLE `kelas`
MODIFY `id_kelas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `pembayaran`
--
ALTER TABLE `pembayaran`
MODIFY `id_pembayaran` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `petugas`
--
ALTER TABLE `petugas`
MODIFY `id_petugas` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `spp`
--
ALTER TABLE `spp`
MODIFY `id_spp` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `pembayaran`
--
ALTER TABLE `pembayaran`
ADD CONSTRAINT `pembayaran_ibfk_2` FOREIGN KEY (`id_spp`) REFERENCES `siswa` (`id_spp`) ON DELETE CASCADE,
ADD CONSTRAINT `pembayaran_ibfk_3` FOREIGN KEY (`id_petugas`) REFERENCES `petugas` (`id_petugas`) ON DELETE CASCADE;
--
-- Constraints for table `siswa`
--
ALTER TABLE `siswa`
ADD CONSTRAINT `siswa_ibfk_1` FOREIGN KEY (`id_kelas`) REFERENCES `kelas` (`id_kelas`),
ADD CONSTRAINT `siswa_ibfk_2` FOREIGN KEY (`id_spp`) REFERENCES `spp` (`id_spp`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SELECT c.Id, c.FirstName, c.LastName, c.CreationDate,
c.LastActiveDate, p.Id AS ProductId, p.ProductTypeId, p.Price, p.Title, p.Description, p.Quantity
FROM Customer c INNER JOIN Product p ON p.CustomerId = c.Id
WHERE
c.FirstName LIKE '%a%' OR
c.LastName LIKE '%a%'
/* p.Id LIKE '%a%' OR
p.ProductTypeId LIKE '%a%' OR
p.Price LIKE '%a%' OR
p.Title LIKE '%andy%' OR
p.Description LIKE '%a%' OR
p.Quantity LIKE '%a%' */
--select * from Customer |
-- -----------------------------------------------------
-- Schema peliculas-app-back
-- -----------------------------------------------------
USE `peliculas-app-back` ;
-- -----------------------------------------------------
-- Table `peliculas-app-back`.`user`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `peliculas-app-back`.`user` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(255) NOT NULL,
`uid` VARCHAR(255) NOT NULL UNIQUE,
`name` VARCHAR(255) NULL DEFAULT NULL,
`surname` VARCHAR(255) NULL DEFAULT NULL,
`email` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`))
ENGINE=InnoDB
AUTO_INCREMENT = 1;
-- -----------------------------------------------------
-- Table `peliculas-app-back`.`subscriber`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `peliculas-app-back`.`subscriber` (
`user_id` BIGINT(20) NOT NULL,
`points` INT UNSIGNED DEFAULT 0,
PRIMARY KEY (`user_id`),
KEY `fk_subscriber_user` (`user_id`),
CONSTRAINT `fk_subscriber_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
)
ENGINE=InnoDB
AUTO_INCREMENT = 1;
-- -----------------------------------------------------
-- Table `peliculas-app-back`.`admin`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `peliculas-app-back`.`admin` (
`user_id` BIGINT(20) NOT NULL,
PRIMARY KEY (`user_id`),
KEY `fk_admin_user` (`user_id`),
CONSTRAINT `fk_admin_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
)
ENGINE=InnoDB
AUTO_INCREMENT = 1;
-- -----------------------------------------------------
-- Table `peliculas-app-back`.`cinema`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `peliculas-app-back`.`cinema` (
`user_id` BIGINT(20) NOT NULL,
`web` VARCHAR(255) NULL DEFAULT NULL,
`address` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`user_id`),
KEY `fk_cinema_user` (`user_id`),
CONSTRAINT `fk_cinema_user` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`)
)
ENGINE=InnoDB
AUTO_INCREMENT = 1;
-- -----------------------------------------------------
-- Table `peliculas-app-back`.`offer`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `peliculas-app-back`.`offer` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`description` VARCHAR(255) NULL DEFAULT NULL,
`deadline` DATETIME(6) DEFAULT NULL,
`add_points` INT UNSIGNED DEFAULT 0,
`sub_points` INT UNSIGNED DEFAULT 0,
`cinema_id` BIGINT(20) NOT NULL,
PRIMARY KEY (`id`),
KEY `fk_cinema` (`cinema_id`),
CONSTRAINT `fk_cinema` FOREIGN KEY (`cinema_id`) REFERENCES `cinema` (`user_id`)
)
ENGINE=InnoDB
AUTO_INCREMENT = 1;
-- -----------------------------------------------------
-- Add sample data
-- -----------------------------------------------------
INSERT INTO user (username, uid, name, surname, email)
VALUES ('juan', '2hpMMorqj5VzQJnB7LZwGYXBItL2', 'juan','bencardino', 'j@ibm.com');
INSERT INTO user (username, uid, name, surname, email)
VALUES ('diego', '4Qxd7AEXbbbkjaEpiOQywBHTY7g2', 'diego','bencardino', 'd@ibm.com');
INSERT INTO user (username, uid, name, surname, email)
VALUES ('santiago', 'MfY8qJG3qZZqumfUQYpY10zve152', 'santiago','londono', 's@ibm.com');
INSERT INTO user (username, uid, name, surname, email)
VALUES ('cristian', 'ZAlAAQMUYIdI4zV0dZwuq0XMlG12', 'cristian','arenas', 'c@ibm.com');
INSERT INTO subscriber (points, user_id) VALUES (10, 2);
INSERT INTO admin (user_id) VALUES (3);
INSERT INTO cinema (web, address, user_id) VALUES ('ibm.com','cra 1 #2 - 3', 4);
INSERT INTO offer(description, deadline, add_points, sub_points, cinema_id)
VALUES ('Oferton', '2021-05-29', 10 , 0, 4); |
SELECT *
FROM piskunova_special
INNER JOIN piskunova_course ON piskunova_course.special_id = piskunova_special.special_id
INNER JOIN piskunova_graduate ON piskunova_graduate.course_id = piskunova_course.course_id
INNER JOIN piskunova_graduate_time ON piskunova_graduate_time.graduate_id = piskunova_graduate.graduate_id
LEFT JOIN piskunova_day ON (piskunova_graduate_time.day_id = piskunova_day.day_id)
LEFT JOIN piskunova_lesson_num ON (piskunova_graduate_time.lesson_num_id = piskunova_lesson_num.lesson_num_id)
WHERE piskunova_lesson_num.time_lesson BETWEEN '14:00:00' and '18:00:00' AND (piskunova_day.name = 'Четверг' OR piskunova_day.name = 'Суббота') AND piskunova_day.day_id IS NULL AND piskunova_lesson_num.lesson_num_id IS NULL
|
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
INSERT 0 1
UPDATE 1
|
SELECT ename, sal, comm, NVL2(sal+comm, sal+comm, sal)
FROM employees
/
|
select TERID
,TERGRPID
,UPDDTM
from TER |
-- --------------------------------------------------------
-- Host: localhost
-- Versión del servidor: 5.7.24 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 10.3.0.5771
-- --------------------------------------------------------
/*!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' */;
-- Volcando estructura de base de datos para pokebd
DROP DATABASE IF EXISTS `pokebd`;
CREATE DATABASE IF NOT EXISTS `pokebd` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `pokebd`;
-- Volcando estructura para tabla pokebd.habilidad
DROP TABLE IF EXISTS `habilidad`;
CREATE TABLE IF NOT EXISTS `habilidad` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(50) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
-- Volcando datos para la tabla pokebd.habilidad: ~7 rows (aproximadamente)
/*!40000 ALTER TABLE `habilidad` DISABLE KEYS */;
INSERT INTO `habilidad` (`id`, `nombre`) VALUES
(6, 'ascua'),
(5, 'electricidad estatica'),
(2, 'foco interno'),
(7, 'hedor'),
(1, 'impasible'),
(3, 'justiciero'),
(4, 'pararayos');
/*!40000 ALTER TABLE `habilidad` ENABLE KEYS */;
-- Volcando estructura para tabla pokebd.pokemon
DROP TABLE IF EXISTS `pokemon`;
CREATE TABLE IF NOT EXISTS `pokemon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(50) CHARACTER SET latin1 NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8;
-- Volcando datos para la tabla pokebd.pokemon: ~12 rows (aproximadamente)
/*!40000 ALTER TABLE `pokemon` DISABLE KEYS */;
INSERT INTO `pokemon` (`id`, `nombre`) VALUES
(33, 'admin'),
(23, 'Ander 2'),
(2, 'BUA SAPI'),
(4, 'bulbasaur'),
(22, 'bulbasaur\''),
(31, 'DA MIKEL BUA'),
(3, 'DA MIKEL BUA SAPI'),
(14, 'MIKEL BUA'),
(32, 'NUEVO'),
(11, 'Pichachu'),
(30, 'Pichu'),
(29, 'pikachuuuajjjjja'),
(5, 'raichuuu');
/*!40000 ALTER TABLE `pokemon` ENABLE KEYS */;
-- Volcando estructura para tabla pokebd.pokemon_has_habilidad
DROP TABLE IF EXISTS `pokemon_has_habilidad`;
CREATE TABLE IF NOT EXISTS `pokemon_has_habilidad` (
`pokemonId` int(11) NOT NULL,
`habilidadId` int(11) NOT NULL,
PRIMARY KEY (`pokemonId`,`habilidadId`),
KEY `FK_habilidad` (`habilidadId`),
CONSTRAINT `FK_habilidad` FOREIGN KEY (`habilidadId`) REFERENCES `habilidad` (`id`),
CONSTRAINT `FK_pokemon` FOREIGN KEY (`pokemonId`) REFERENCES `pokemon` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- Volcando datos para la tabla pokebd.pokemon_has_habilidad: ~13 rows (aproximadamente)
/*!40000 ALTER TABLE `pokemon_has_habilidad` DISABLE KEYS */;
INSERT INTO `pokemon_has_habilidad` (`pokemonId`, `habilidadId`) VALUES
(2, 1),
(3, 1),
(4, 1),
(4, 2),
(2, 3),
(3, 3),
(29, 4),
(30, 4),
(32, 4),
(29, 5),
(30, 5),
(32, 5),
(3, 6),
(4, 7);
/*!40000 ALTER TABLE `pokemon_has_habilidad` ENABLE KEYS */;
-- Volcando estructura para tabla pokebd.usuarios
DROP TABLE IF EXISTS `usuarios`;
CREATE TABLE IF NOT EXISTS `usuarios` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(50) DEFAULT NULL,
`password` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;
-- Volcando datos para la tabla pokebd.usuarios: ~0 rows (aproximadamente)
/*!40000 ALTER TABLE `usuarios` DISABLE KEYS */;
INSERT INTO `usuarios` (`id`, `nombre`, `password`) VALUES
(1, 'admin', 'admin'),
(2, 'mikel', 'sapi');
/*!40000 ALTER TABLE `usuarios` ENABLE KEYS */;
/*!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 */;
|
DROP TABLE DT_Credit_line CASCADE CONSTRAINTS;
CREATE TABLE DT_Credit_line(credit_line_id NUMBER PRIMARY KEY,
customer_id NUMBER(8),
CONSTRAINT DT_credit_line_customer_id_FK FOREIGN KEY(customer_id) REFERENCES Customers(customer_id),
credit_limit NUMBER(10,2) NOT NULL CHECK (credit_limit >= 0),
creation_date DATE NOT NULL,
valid_form DATE NOT NULL ,
valid_to DATE NOT NULL ,
last_change_date DATE NOT NULL);
COMMENT ON COLUMN DT_Credit_line.credit_line_id IS 'primary key for table';
COMMENT ON COLUMN DT_Credit_line.customer_id IS 'Customer if for Credit line';
COMMENT ON COLUMN DT_Credit_line.credit_limit IS 'The amount of credit available to the customer';
COMMENT ON COLUMN DT_Credit_line.creation_date IS 'Creation date of the credit line';
COMMENT ON COLUMN DT_Credit_line.valid_form IS 'Credit line valid from date';
COMMENT ON COLUMN DT_Credit_line.valid_to IS 'Credit line valid to date';
COMMENT ON COLUMN DT_Credit_line.last_change_date IS 'Date of the last change of credit line amount';
|
library readmission version '1'
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.1' called FHIRHelpers
codesystem "SNOMEDCT": 'urn:oid:2.16.840.1.113883.6.96' version 'urn:hl7:version:2017-09'
codesystem "ICD10PCS": 'urn:oid:2.16.840.1.113883.6.4' version 'urn:hl7:version:2021'
valueset "Acute Conditions": '2.16.840.1.113883.3.464.1003.101.11.1269'
valueset "Bone Marrow Transplant": '2.16.840.1.113883.3.666.5.335'
valueset "Chemotherapy": '2.16.840.1.113762.1.4.1047.451'
valueset "Inpatient Stay": '2.16.840.1.113762.1.4.1182.285'
valueset "Inpatient Obstetrics NDNQI": '2.16.840.1.113883.3.2066.2062'
valueset "Kidney Transplant": '2.16.840.1.113883.3.464.1003.109.11.1024'
valueset "Nonacute Inpatient Stay": '2.16.840.1.113762.1.4.1182.289'
valueset "Observation Stay": '2.16.840.1.113762.1.4.1181.72'
valueset "Organ Transplant": '2.16.840.1.113883.3.666.5.358'
valueset "Perinatal Conditions": '2.16.840.1.113762.1.4.1195.334'
valueset "Potentially Planned Procedures": '2.16.840.1.113762.1.4.1195.332'
valueset "Rehabilitation Services": '2.16.840.1.113883.3.117.1.7.1.229'
valueset "Rehabilitation Therapy": '2.16.840.1.113762.1.4.1045.19'
parameter "Denominator Measurement Period" default Interval[@2020-01-01T00:00:00.0, @2020-12-01T00:00:00)
parameter "Numerator Measurement Period" default Interval[@2020-01-03T00:00:00.0, @2020-12-31T23:59:59.999)
context Patient
//****************************************************************************//
//Denominator
//Step 1 all acute inpatient and obervation stays with no non-acute inpatiant
define "Denominator Gen Pop":
[ExplanationOfBenefit] EOB
where (hasInpatientEncounter(EOB) or hasObservationEncounter(EOB))
and not hasNonAcuteInpatientEncounter(EOB)
and startsDuringDenomPeriod(getEncounter(EOB))
define function hasInpatientEncounter(eob ExplanationOfBenefit):
Exists(([Encounter: "Inpatient Stay"] enc where Substring(eob.item[0].encounter[0].reference.value, 9) = enc.id))
define function hasNonAcuteInpatientEncounter(eob ExplanationOfBenefit):
Exists(([Encounter: "Nonacute Inpatient Stay"] enc where Substring(eob.item[0].encounter[0].reference.value, 9) = enc.id))
define function hasObservationEncounter(eob ExplanationOfBenefit):
Exists(([Encounter: "Observation Stay"] enc where Substring(eob.item[0].encounter[0].reference.value, 9) = enc.id))
define function startsDuringDenomPeriod(denEnc Encounter):
denEnc.status ~ 'finished' and denEnc.period starts during "Denominator Measurement Period"
//Step 2 Remove direct transfers but keep the last one
define "Den Direct Transfers":
"Denominator Gen Pop" GAP where not nonLastDirectTransfer(getEncounter(GAP))
define function nonLastDirectTransfer(enc Encounter):
Exists("Denominator Gen Pop" ADL
where enc.id != getEncounter(ADL).id
and (days between enc.period.end and getEncounter(ADL).period.start <= 1)
and enc.period.start before getEncounter(ADL).period.start)
//Step 3 - Remove everyone who leaves the same day they arrive
define "Multi-Day Visits":
"Den Direct Transfers" DT where duration in days of getEncounter(DT).period >= 1
//Step 4 - Nobody who died during their stay or is pregnant
define "No Death or Pregnancy":
"Multi-Day Visits" MDV
where not hasDiedDuringStay(getEncounter(MDV))
and not hasPregnancyEncounter(MDV)
define function hasDiedDuringStay(enc Encounter):
case getCountWithNull(enc)
when 0 then false
else '371828006' in enc.hospitalization.dischargeDisposition.coding.code.value
end
define function getCountWithNull(enc Encounter):
case
when enc.hospitalization is null then 0
when enc.hospitalization.dischargeDisposition is null then 0
else Count(enc.hospitalization.dischargeDisposition.coding.code)
end
define function hasPregnancyEncounter(eob ExplanationOfBenefit):
Exists(([Encounter: "Inpatient Obstetrics NDNQI"] enc where Substring(eob.item[0].encounter[0].reference.value, 9) = enc.id))
or Exists(([Encounter: "Perinatal Conditions"] enc where Substring(eob.item[0].encounter[0].reference.value, 9) = enc.id))
// Step 5 continuous enrollment a year before and 30 days after
define "Continuous Enrollment":
"No Death or Pregnancy" NDOP where hasContinuousEnrollment(getEncounter(NDOP))
define function hasContinuousEnrollment(enc Encounter):
Exists([Encounter] enc2
where enc.id != enc2.id
and ((enc2.period.end occurs 365 days or less before enc.period.end)
or (enc2.period.end occurs 30 days or less after enc.period.end)))
// Step 6 Remove hospital stays if you go to the hospital too much
define "Final Denominator List":
case getInsurance(First("Continuous Enrollment"))
when 'Medicare' then if Count("Continuous Enrollment") < 4 then "Continuous Enrollment" else List<ExplanationOfBenefit>{}
when 'Medicaid' then if Count("Continuous Enrollment") < 4 then "Continuous Enrollment" else List<ExplanationOfBenefit>{}
else if Count("Continuous Enrollment") < 3 then "Continuous Enrollment" else List<ExplanationOfBenefit>{}
end
// Step 7 Count of all stays remaining
define "Denominator":
Count("Final Denominator List")
//****************************************************************************//
//Numerator
//Step 1 all acute inpatient and obervation stays with no non-acute inpatiant
define "Numerator Gen Pop":
(([Encounter: "Inpatient Stay"] union [Encounter: "Observation Stay"])
except [Encounter: "Nonacute Inpatient Stay"]
) TotalStays
where TotalStays.status ~ 'finished'
and TotalStays.period starts during "Numerator Measurement Period"
//Step 2 Remove direct transfers but keep the last one
define "Num Direct Transfers":
"Numerator Gen Pop" NumGenPop
where not numNonLastDirectTransfer(NumGenPop)
define function numNonLastDirectTransfer(enc Encounter):
Exists("Numerator Gen Pop" enc2
where enc.id != enc2.id
and (days between enc.period.end and enc2.period.start <= 1)
and enc.period.start before enc2.period.start)
// Step 3 - Exlcude various encounters
define "Numerator Exclusions":
[Encounter: "Chemotherapy"]
union [Encounter: "Rehabilitation Services"]
union [Encounter: "Rehabilitation Therapy"]
union [Encounter: "Kidney Transplant"]
union [Encounter: "Bone Marrow Transplant"]
union [Encounter: "Organ Transplant"]
union [Encounter: "Inpatient Obstetrics NDNQI"]
union [Encounter: "Perinatal Conditions"]
union "Planned Procedures"
define "Planned Procedures":
[Encounter: "Potentially Planned Procedures"] except [Encounter: "Acute Conditions"]
define "Valid Num Encounters":
"Num Direct Transfers" except "Numerator Exclusions"
// Step 4 - Check the denominator for numerator encounters withing 30 days
define "Final Numerator List":
"Final Denominator List" FDL where hasReadmission(getEncounter(FDL))
define function hasReadmission(denEnc Encounter):
Exists("Valid Num Encounters" numEnc
where numEnc.id != denEnc.id
and days between denEnc.period.end and numEnc.period.start <= 30
and denEnc.period.end before numEnc.period.end)
define "Numerator":
Count("Final Numerator List")
//****************************************************************************//
define function getInsurance(eob ExplanationOfBenefit):
eob.insurance[0].coverage.display.value
define function getEncounter(eob ExplanationOfBenefit):
([Encounter] enc where Substring(eob.item[0].encounter[0].reference.value, 9) = enc.id)[0]
//****************************************************************************//
context Unfiltered
define "Denominator Total":
Sum("Denominator")
define "Numerator Total":
Sum("Numerator")
define "Readmission HEDIS Score":
case
when "Denominator Total" = 0 then 0
else Sum("Numerator") / "Denominator Total"
end
|
SELECT *
FROM artists
WHERE name is "Black Sabbath";
-- WHERE name like "%Black%";
-- WHERE artistId = 50; |
SELECT DISTINCT CA.CO_ID, CA.TMCODE, SP.SPCODE, TM.EPC_PROD_OFFER, PO.PRODUCT_OFFERING_NAME
FROM
SYSADM.CONTRACT_ALL CA, SYSADM.MPULKTMB TM, SYSADM.PR_SERV_SPCODE_HIST SP, EPCCSOM.PRODUCT_OFFERING PO
WHERE CA.TMCODE = TM.TMCODE
AND TM.SNCODE = SP.SNCODE
AND TM.VSCODE IN ( SELECT MAX(Y.VSCODE) FROM SYSADM.MPULKTMB Y WHERE Y.TMCODE = TM.TMCODE AND Y.SPCODE = TM.SPCODE AND Y.SNCODE = TM.SNCODE AND VSDATE <=SYSDATE )
AND SP.HISTNO IN ( SELECT MAX(X.HISTNO) FROM SYSADM.PR_SERV_SPCODE_HIST X WHERE X.CO_ID = SP.CO_ID AND X.SNCODE = SP.SNCODE)
AND SP.SPCODE = TM.SPCODE
AND CA.CO_ID = SP.CO_ID
AND TM.EPC_PROD_OFFER = PO.PRODUCT_OFFERING_ID
AND CA.CO_ID = 1000023131
AND PO.PRODUCT_TYPE = 'Plan' |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Anamakine: 127.0.0.1
-- Üretim Zamanı: 05 Şub 2021, 13:56:58
-- Sunucu sürümü: 10.4.14-MariaDB
-- PHP Sürümü: 7.4.10
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 */;
--
-- Veritabanı: `kutuphane`
--
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `kitap`
--
CREATE TABLE `kitap` (
`kId` int(11) NOT NULL,
`KAdi` varchar(100) NOT NULL,
`seriNo` varchar(20) NOT NULL,
`Yazar` varchar(100) NOT NULL,
`durum` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Tablo döküm verisi `kitap`
--
INSERT INTO `kitap` (`kId`, `KAdi`, `seriNo`, `Yazar`, `durum`) VALUES
(1, 'Savaş Sanatı', '0202', 'Sun Tzu', 'Ödünç Verilmiş'),
(6, 'Simyacı', '8855', 'Paulo Coelho', 'Ödünç Verilmiş'),
(7, 'Rakamların Evrensel Tarihi', '9696', 'Georges Ifrah', 'Ödünç Verilmiş'),
(8, 'Fahrenheit 451', '5555', 'Ray Bradbury', 'Hasarlı'),
(9, 'Savaş Sanatı', '1234', 'Sun Tzu', 'Hasarlı'),
(10, '1984', '0001', 'George Orwell', 'Uygun'),
(11, 'Köpeğinize Kuantum Fiziğini Nasıl Öğretirsiniz', '3333', 'Chad Orzel', 'Uygun'),
(12, 'Saatleri ayarlama Enstütüsü', '1111', 'Ahmet Hamdi Tanpınar', 'Hasarlı'),
(13, 'Bir Bilim Adamının Romanı', '5525', 'Oğuz Atay', 'Uygun');
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `kullanici`
--
CREATE TABLE `kullanici` (
`id` int(11) NOT NULL,
`adSoyad` varchar(100) NOT NULL,
`tc` varchar(11) NOT NULL,
`tel` varchar(15) NOT NULL,
`mail` varchar(30) NOT NULL,
`adres` varchar(100) NOT NULL,
`aTarih` varchar(20) NOT NULL,
`vTarih` varchar(30) NOT NULL,
`KAdi` varchar(100) NOT NULL,
`kId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Tablo döküm verisi `kullanici`
--
INSERT INTO `kullanici` (`id`, `adSoyad`, `tc`, `tel`, `mail`, `adres`, `aTarih`, `vTarih`, `KAdi`, `kId`) VALUES
(1, 'şahsiyet', '123456789', '00000', 'mail', 'istanbul', '01-02--2023', '01-02--2023', 'Savaş sanatı ', 1),
(4, 'şahıs', '0000', '1234', 'mail', 'ankara', '23-02--2026', '23-02--2026', 'Simyacı', 6),
(5, 'kişi', '11111', '88888', 'mail', 'antalya', '04-02--2027', '04-02--2027', 'Rakamların Evrensel Tarihi', 7),
(7, 'birisi', '9999', '77777', 'mail', 'Gaziantep', '14-02--2027', '14-02--2027', 'Fahrenheit 451', 8);
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `personel`
--
CREATE TABLE `personel` (
`id` int(11) NOT NULL,
`adSoyad` varchar(100) NOT NULL,
`tc` varchar(11) NOT NULL,
`tel` varchar(15) NOT NULL,
`mail` varchar(30) NOT NULL,
`adres` varchar(1000) NOT NULL,
`isBaslama` varchar(30) NOT NULL,
`kadi` varchar(20) NOT NULL,
`ksifre` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Tablo döküm verisi `personel`
--
INSERT INTO `personel` (`id`, `adSoyad`, `tc`, `tel`, `mail`, `adres`, `isBaslama`, `kadi`, `ksifre`) VALUES
(1, 'Admin Admin', '0000', '99999', 'mail', 'Ankara', '10-06--2022', 'admin', '1234'),
(4, 'personel1', '00000', '11111', 'mail', 'istanbul', '03-02--2021', 'per1', '1234'),
(5, 'personel2', '8888', '9999', 'mail', 'Bursa', '01-02--2018', 'per2', '1234');
--
-- Dökümü yapılmış tablolar için indeksler
--
--
-- Tablo için indeksler `kitap`
--
ALTER TABLE `kitap`
ADD PRIMARY KEY (`kId`);
--
-- Tablo için indeksler `kullanici`
--
ALTER TABLE `kullanici`
ADD PRIMARY KEY (`id`);
--
-- Tablo için indeksler `personel`
--
ALTER TABLE `personel`
ADD PRIMARY KEY (`id`);
--
-- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri
--
--
-- Tablo için AUTO_INCREMENT değeri `kitap`
--
ALTER TABLE `kitap`
MODIFY `kId` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- Tablo için AUTO_INCREMENT değeri `kullanici`
--
ALTER TABLE `kullanici`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- Tablo için AUTO_INCREMENT değeri `personel`
--
ALTER TABLE `personel`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
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 */;
|
CREATE TABLE IF NOT EXISTS instance (
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
job_id UUID NOT NULL REFERENCES job (id),
scheduled_at TIMESTAMP NOT NULL,
state VARCHAR(30),
data JSONB,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL,
deleted_at TIMESTAMP WITH TIME ZONE
);
|
CREATE DATABASE `soft_uni`;
USE `soft_uni`;
CREATE TABLE `towns` (
`id` INT UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT,
`name` VARCHAR(30) NOT NULL,
CONSTRAINT `pk_towns` PRIMARY KEY (`id`)
);
CREATE TABLE `addresses` (
`id` INT UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT,
`address_text` VARCHAR(30) NOT NULL,
`town_id` INT UNSIGNED,
CONSTRAINT `pk_addresses` PRIMARY KEY (`id`),
CONSTRAINT `fk_addresses_towns` FOREIGN KEY (`town_id`)
REFERENCES `towns` (`id`)
);
CREATE TABLE `departments` (
`id` INT UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT,
`name` VARCHAR(30) NOT NULL,
CONSTRAINT `pk_departments` PRIMARY KEY (`id`)
);
CREATE TABLE `employees` (
`id` INT UNSIGNED NOT NULL UNIQUE AUTO_INCREMENT,
`first_name` VARCHAR(30) NOT NULL,
`middle_name` VARCHAR(30),
`last_name` VARCHAR(30) NOT NULL,
`job_title` VARCHAR(30) NOT NULL,
`department_id` INT UNSIGNED,
`hire_date` DATE,
`salary` DECIMAL(10 , 2 ),
`address_id` INT UNSIGNED,
CONSTRAINT `pk_employees` PRIMARY KEY (`id`),
CONSTRAINT `fk_employees_departments` FOREIGN KEY (`department_id`)
REFERENCES `departments` (`id`),
CONSTRAINT `fk_employees_addresses` FOREIGN KEY (`address_id`)
REFERENCES `addresses` (`id`)
); |
-- level 4 is bind values
-- level 8 is waits
-- level 12 is both
--
-- see 10046_off.sql to end tracing
-- be sure to use level 8 if the bind values may contain sensitive data
-- hard coded SQL may also contain sensitive data
alter session set events '10046 trace name context forever, level 12';
--sys.dbms_system.set_ev(sid(n), serial(n), 10046, 8, '');
|
-- insert the student
insert into student(student_id, first_name, last_name, email, phone) values
(1,'elon', 'musk', 'elonmusk@domain.com', '123456789'),
(2,'jeff', 'bezos', 'jeffbezos@domain.com', '123456789');
-- insert the faculty
insert into faculty(faculty_id, first_name, last_name, email, phone) values
(1,'elon', 'musk', 'elonmusk@domain.com', '123456789'),
(2,'jeff', 'bezos', 'jeffbezos@domain.com', '123456789');
-- insert the course
insert into course(course_id, name, description, duration, fee) values
(1,'java', 'description', 12, 20),
(2,'.net', 'description', 12, 20),
(3,'python', 'description', 10, 50),
(4,'ruby', 'description', 10, 40),
(5,'javascript', 'description', 10, 50);
-- insert the curriculum_details
insert into curriculum_details(course_id, curriculum) values
(1, 'oops'),
(1, 'Generics'),
(2, 'oops'),
(2, 'Exceptions');
-- insert student_course
insert into student_course(student_id, course_id) values
(1, 1),
(2, 2);
-- insert faculty_course
insert into faculty_course(faculty_id, course_id) values
(1, 1),
(2, 2);
-- insert address
insert into address(id, address_line1, address_line2, city, state, country, pin) values
(1, 'addressLine1', 'addressLine2', 'city', 'state', 'country', 'pin'),
(2, 'addressLine1', 'addressLine2', 'city', 'state', 'country', 'pin');
-- update student with address
update student set address_id=1 where student_id=1;
update student set address_id=1 where student_id=2;
-- update faculty with address
update faculty set address_id=2 where faculty_id=1;
update faculty set address_id=2 where faculty_id=2;
-- security data
insert into user(id, username, password, roles, enabled) values
(1, 'user', 'user', 'ROLE_USER', true),
(2, 'admin', 'admin', 'ROLE_ADMIN', true); |
CREATE TABLE [display].[sys_user]
(
[employee_number_display_value] NVARCHAR(80) NULL,
[preferred_language_display_value] NVARCHAR(80) NULL,
[sys_created_on_display_value] DATETIME NULL,
[date_format_display_value] NVARCHAR(80) NULL,
[notification_display_value] NVARCHAR(80) NULL,
[sys_class_name_display_value] NVARCHAR(80) NULL,
[mobile_phone_display_value] NVARCHAR(80) NULL,
[web_service_access_only_display_value] NVARCHAR(80) NULL,
[last_name_display_value] NVARCHAR(255) NULL,
[company_display_value] NVARCHAR(255) NULL,
[active_display_value] NVARCHAR(80) NULL,
[last_login_time_display_value] NVARCHAR(80) NULL,
[failed_attempts_display_value] NVARCHAR(80) NULL,
[sys_domain_path_display_value] NVARCHAR(MAX) NULL,
[schedule_display_value] NVARCHAR(80) NULL,
[default_perspective_display_value] NVARCHAR(MAX) NULL,
[password_needs_reset_display_value] NVARCHAR(MAX) NULL,
[sys_mod_count_display_value] NVARCHAR(80) NULL,
[sys_created_by_display_value] NVARCHAR(255) NULL,
[user_password_display_value] NVARCHAR(MAX) NULL,
[locked_out_display_value] NVARCHAR(MAX) NULL,
[cost_center_display_value] NVARCHAR(MAX) NULL,
[last_login_display_value] NVARCHAR(80) NULL,
[ldap_server_display_value] NVARCHAR(MAX) NULL,
[sso_source_display_value] NVARCHAR(80) NULL,
[gender_display_value] NVARCHAR(MAX) NULL,
[user_name_display_value] NVARCHAR(MAX) NULL,
[time_zone_display_value] NVARCHAR(80) NULL,
[middle_name_display_value] NVARCHAR(255) NULL,
[internal_integration_user_display_value] NVARCHAR(80) NULL,
[sys_updated_on_display_value] DATETIME NULL,
[sys_updated_by_display_value] NVARCHAR(80) NULL,
[time_format_display_value] NVARCHAR(MAX) NULL,
[sys_id_display_value] NVARCHAR(255) NULL,
[street_display_value] NVARCHAR(80) NULL,
[phone_display_value] NVARCHAR(80) NULL,
[vip_display_value] NVARCHAR(80) NULL,
[state_display_value] NVARCHAR(80) NULL,
[name_display_value] NVARCHAR(255) NULL,
[photo_display_value] NVARCHAR(255) NULL,
[sys_tags_display_value] NVARCHAR(80) NULL,
[department_display_value] NVARCHAR(255) NULL,
[introduction_display_value] NVARCHAR(MAX) NULL,
[title_display_value] NVARCHAR(500) NULL,
[building_display_value] NVARCHAR(80) NULL,
[first_name_display_value] NVARCHAR(255) NULL,
[sys_domain_display_value] NVARCHAR(80) NULL,
[zip_display_value] NVARCHAR(80) NULL,
[email_display_value] NVARCHAR(MAX) NULL,
[manager_display_value] NVARCHAR(80) NULL,
[location_display_value] NVARCHAR(500) NULL,
[source_display_value] NVARCHAR(80) NULL,
[country_display_value] NVARCHAR(80) NULL,
[city_display_value] NVARCHAR(80) NULL,
[roles_display_value] NVARCHAR(MAX) NULL,
[home_phone_display_value] NVARCHAR(80) NULL,
[calendar_integration_display_value] NVARCHAR(80) NULL
)
|
ALTER TABLE links
RENAME COLUMN owner_id TO initiator_id; |
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products (
id INTEGER (10) NOT NULL AUTO_INCREMENT,
product_name VARCHAR (30) NOT NULL,
department_name VARCHAR (30),
price DECIMAL (12, 2),
stock INTEGER (4),
PRIMARY KEY (id)
);
SELECT * FROM products;
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Toilet Paper", "necessities", 19.95, 100);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Blu-ray Player", "electronics", 39.99, 20);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Plain White Socks", "clothing", 1.49, 100);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Picture Frame", "household", 11.99, 40);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Wooden Chair", "household", 56.99, 20);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Speakers", "electronics", 79.95, 30);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Oreo O's", "food", 3.98, 50);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Badminton Set", "sporting goods", 49.99, 20);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Fidget Spinner", "toys", 4.95, 30);
INSERT INTO products (product_name, department_name, price, stock) VALUES ("Apple Air Pods", "electronics", 199.00, 20);
|
--修改日期:2012-11-20
--修改人:周兵
--修改内容:中海船录入余额完成标识,增加账户明细截止时间维护菜单。
--修改原因:ZY-ZH-02,在账户余额表中增加字段isComplete判断所在日期是否已经完成余额的生成,添加此字段后把以前的数据的isComplete值设置为1,1为完成。
DECLARE
VN_COUNT NUMBER;
VC_STR VARCHAR2(1000);
BEGIN
--查看该表中该字段是否存在
SELECT COUNT(*)
INTO VN_COUNT
FROM USER_TAB_COLUMNS
WHERE TABLE_NAME = 'BIS_ACC_HIS_BAL' AND COLUMN_NAME = 'ISCOMPLETE';
--如果小于1则说明不存在,则新增此字段
IF VN_COUNT < 1 THEN
VC_STR := ' ALTER TABLE BIS_ACC_HIS_BAL ADD ISCOMPLETE CHAR(1)';
EXECUTE IMMEDIATE VC_STR;
END IF;
END;
/
--update bis_acc_his_bal set isComplete='1';
commit;
DECLARE
VN_COUNT NUMBER;
BEGIN
SELECT COUNT(*)
INTO VN_COUNT
FROM bt_sys_res
WHERE res_name = '账户明细截止时间维护' and sys_code = 'bankacc' and res_level = 2;
IF VN_COUNT = 0 THEN
insert into bt_sys_res (RES_CODE, RES_NAME, SYS_CODE, FATHER_CODE, RES_URL, FUNC_FLAG, RES_TYPE, LINK_TARGET, STATUS, RES_ORDER, RMK, REVERSE1, REVERSE2, REVERSE3, REVERSE4, REVERSE5, REVERSE6, REVERSE7, REVERSE8, REVERSE9, REVERSE10, RES_LEVEL, RES_ROLE)
values (( select max(res_code)+1 from bt_sys_res ) , '账户明细截止时间维护', 'bankacc', ( select min(res_code) from bt_sys_res r where r.res_name = '录入明细' and r.sys_code = 'bankacc' ), '/bankacc/bankAccEndList.do?method=getBankAccEndList', '0', '1', '0', '0', 4, ' ', '', '', '', '', '', null, null, null, null, null, 2, '');
END IF;
END;
/
commit;
DECLARE
VN_COUNT NUMBER;
BEGIN
SELECT COUNT(*)
INTO VN_COUNT
FROM bt_param
WHERE code = 'isAccManImpAbs' and sys_code = 'fcs' and (name = '是否账户管理导入明细摘要' or name='账户管理导入明细摘要是否必填');
IF VN_COUNT = 0 THEN
insert into bt_param (code,sys_code,name,param_value1,param_value2,param_value3,param_type,rmk,reverse1,reverse2,reverse3,reverse4,reverse5,reverse6,reverse7,reverse8,reverse9,reverse10)
values('isAccManImpAbs','fcs','是否账户管理导入明细摘要','0',null,null,0,'账户管理导入明细摘要是否必填.1是;0否','1,是;0,否;',null,null,null,null,1.00,48.00,null,null,null);
END IF;
END;
/
commit;
update bt_param set name='账户管理导入明细摘要是否必填' where code = 'isAccManImpAbs' and sys_code = 'fcs' and name = '是否账户管理导入明细摘要';
update bt_sys_res set RES_URL='/bankacc/bankAccEndList.do?method=getBankAccEndList' WHERE res_name = '账户明细截止时间维护' and sys_code = 'bankacc' and res_level = 2;
commit;
|
SET SQL_SAFE_UPDATES=0;
use CarFactory;
delete from Car;
delete from Engine;
delete from Car_Engine;
insert into car (id, brand, type)
values
(1, "VW", "Golf"),
(2, "VW", "Passat"),
(3, "Tesla", "X"),
(4, "Ferarri", "F40"),
(5, "Trabant", "601"),
(6, "Fiat", "500"),
(7, "Opel", "Concept HR");
insert into Engine (id, name, type, power)
values
(1, "Brushless V1", "Elektro", 180),
(2, "TDI 5.0", "Diesel", 115),
(3, "V2", "Benzin 2-Takt", 45),
(4, "Sport V12", "Benzin", 420),
(5, "TFSI", "Benzin", 140),
(6, "CDI 1.8", "Diesel", 100),
(7, "Hamsterrad", "Hamster", null);
insert into Car_Engine (CarId, EngineId)
values
(1,2),
(1,5),
(2,2),
(2,5),
(3,1),
(4,4),
(5,3),
(6,5),
(6,6);
|
DELETE FROM 'tag' WHERE tag_id = ?; |
Create Procedure sp_Delete_DefaultFormat (@PrintID Int)
As
Delete CustomPrinting Where PrintID = @PrintID
|
CREATE TABLE person
(
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id',
first_name VARCHAR(20) NOT NULL DEFAULT '' COMMENT '名字',
last_name VARCHAR(20) NOT NULL DEFAULT '' COMMENT '姓氏',
gender ENUM('M', 'F') NOT NULL DEFAULT 'M' COMMENT '性别', -- 枚举类型
birth_day DATE NOT NULL DEFAULT '1000-01-01' COMMENT '出生年月',
street VARCHAR(30) NOT NULL DEFAULT '' COMMENT '街道',
city VARCHAR(20) NOT NULL DEFAULT '' COMMENT '城市',
state VARCHAR(20) NOT NULL DEFAULT '' COMMENT '州',
country VARCHAR(20) NOT NULL DEFAULT '' COMMENT '国家',
postal_code VARCHAR(20) NOT NULL DEFAULT '' COMMENT '邮编',
update_time TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', -- timestamp可以指定当时时间
CONSTRAINT PK_PERSON PRIMARY KEY (id),
INDEX IX_POSTAL_CODE(postal_code)
) Engine = InnoDB COMMENT '个人';
CREATE TABLE favourite_food
(
person_id SMALLINT UNSIGNED COMMENT '个人ID',
food VARCHAR(20) NOT NULL DEFAULT '' COMMENT '食物',
update_time TIMESTAMP NOT NULL DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
CONSTRAINT PK_FAVOURITE_FOOD PRIMARY KEY (person_id, food),
CONSTRAINT FK_FAV_FOOD_PERSON_ID FOREIGN KEY (person_id) REFERENCES person(id) -- 外键约束只在InnoDB起作用
) Engine = InnoDB COMMENT '喜爱的食物' |
CREATE procedure spr_ser_total_sales(@FROMDATE DATETIME, @TODATE DATETIME)
As
SELECT 1, "Gross Revenue (%c)" = isnull((select sum(isnull(Amount,0))
from invoicedetail,InvoiceAbstract
where invoiceAbstract.InvoiceID=InvoiceDetail.InvoiceID
and invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0 and InvoiceAbstract.InvoiceType in (1,2,3)),0)
+ ISNULL((SELECT SUM(Isnull(serviceinvoicedetail.NetValue,0))
FROM ServiceInvoiceDetail, serviceInvoiceAbstract
WHERE serviceInvoiceAbstract.serviceInvoiceID = serviceInvoiceDetail.serviceInvoiceID
AND (serviceInvoiceAbstract.serviceInvoiceType = 1)
AND Isnull(serviceInvoiceAbstract.Status,0) & 192 = 0
AND serviceInvoiceAbstract.serviceInvoiceDate BETWEEN @FROMDATE and @TODATE),0),
"Sales Return Damages(%c)" = (Select ISNULL(sum(Amount),0) from invoicedetail,InvoiceAbstract
where invoiceAbstract.InvoiceID=InvoiceDetail.InvoiceID
and invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0
and ((InvoiceAbstract.Status&32 <>0
and InvoiceAbstract.InvoiceType=4) or (InvoiceAbstract.InvoiceType=6))),
"Sales Return Saleable(%c)" = (Select ISNULL(sum(Amount),0) from invoicedetail,InvoiceAbstract
where invoiceAbstract.InvoiceID=InvoiceDetail.InvoiceID
and invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0
and ((InvoiceAbstract.Status&32=0
and InvoiceAbstract.InvoiceType =4) or (InvoiceAbstract.InvoiceType =5))),
"Net Sales Revenue (%c)" = isnull((select sum(isnull(Amount,0))
from invoicedetail,InvoiceAbstract
where invoiceAbstract.InvoiceID=InvoiceDetail.InvoiceID
and invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0 and InvoiceAbstract.InvoiceType in (1,2,3)),0) - isnull((select sum(isnull(Amount,0))
from invoicedetail,InvoiceAbstract
where invoiceAbstract.InvoiceID=InvoiceDetail.InvoiceID
and invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0 and InvoiceAbstract.InvoiceType in (4,5,6)),0)
+ ISNULL((SELECT SUM(Isnull(serviceinvoicedetail.NetValue,0))
FROM ServiceInvoiceDetail, serviceInvoiceAbstract
WHERE serviceInvoiceAbstract.serviceInvoiceID = serviceInvoiceDetail.serviceInvoiceID
AND (serviceInvoiceAbstract.serviceInvoiceType = 1)
AND Isnull(serviceInvoiceAbstract.Status,0) & 192 = 0
AND IsNull(ServiceinvoiceDetail.SpareCode, '') <> ''
AND serviceInvoiceAbstract.serviceInvoiceDate BETWEEN @FROMDATE AND @TODATE), 0),
"Net Service Revenue (%c)" = ISNULL((SELECT SUM(Isnull(serviceinvoiceDetail.Netvalue,0))
FROM ServiceInvoiceDetail, serviceInvoiceAbstract
WHERE serviceInvoiceAbstract.serviceInvoiceID = serviceInvoiceDetail.serviceInvoiceID
AND (serviceInvoiceAbstract.serviceInvoiceType = 1)
AND Isnull(serviceInvoiceAbstract.Status,0) & 192 = 0
and isnull(Serviceinvoicedetail.Taskid,'') <> ''
and IsNull(ServiceinvoiceDetail.SpareCode, '') = ''
AND serviceInvoiceAbstract.serviceInvoiceDate BETWEEN @FROMDATE AND @TODATE), 0),
"Total Net Revenue (%c)" = isnull((select sum(isnull(Amount,0))
from invoicedetail,InvoiceAbstract
where invoiceAbstract.InvoiceID=InvoiceDetail.InvoiceID
and invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0 and InvoiceAbstract.InvoiceType in (1,2,3)),0) - isnull((select sum(isnull(Amount,0))
from invoicedetail,InvoiceAbstract
where invoiceAbstract.InvoiceID=InvoiceDetail.InvoiceID
and invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0 and InvoiceAbstract.InvoiceType in (4,5,6)),0)
+ ISNULL((SELECT SUM(Isnull(serviceinvoicedetail.NetValue,0))
FROM ServiceInvoiceDetail, serviceInvoiceAbstract
WHERE serviceInvoiceAbstract.serviceInvoiceID = serviceInvoiceDetail.serviceInvoiceID
AND (serviceInvoiceAbstract.serviceInvoiceType = 1)
AND Isnull(serviceInvoiceAbstract.Status,0) & 192 = 0
AND serviceInvoiceAbstract.serviceInvoiceDate BETWEEN @FROMDATE AND @TODATE), 0),
"Roundoff Net Value (%c)" = ISNULL((Select sum(NetValue + RoundOffAmount) from InvoiceAbstract
Where invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0 and InvoiceAbstract.InvoiceType in (1,2,3)),0) - ISNULL((Select ISNULL(sum(NetValue + RoundOffAmount), 0)
from InvoiceAbstract
where invoicedate between @FROMDATE and @TODATE
And InvoiceAbstract.Status&128=0 and InvoiceAbstract.InvoiceType in (4,5,6)),0)
+ ISNULL((SELECT SUM(Isnull(NetValue,0) + isnull(RoundOffAmount,0))
FROM serviceInvoiceAbstract
WHERE (serviceInvoiceAbstract.serviceInvoiceType = 1)
AND Isnull(serviceInvoiceAbstract.Status,0) & 192 = 0
AND serviceInvoiceAbstract.serviceInvoiceDate BETWEEN @FROMDATE AND @TODATE), 0)
|
insert into db_sysarquivo values (3961, 'transferencialote', 'Guarda os dados da transferência realizada em lote de matrículas concluídas.', 'ed137', '2016-09-01', 'Transferência em Lote', 0, 'f', 'f', 'f', 'f' );
insert into db_sysarqmod values (1008004,3961);
insert into db_syscampo values(22013,'ed137_sequencial','int4','Código do lote de transferência.','0', 'Código',10,'f','f','f',1,'text','Código');
insert into db_syscampo values(22014,'ed137_escolaorigem','int4','Escola de origem na qual está realizando a transferência.','0', 'Escola de Origem',10,'f','f','f',1,'text','Escola de Origem');
insert into db_syscampo values(22015,'ed137_usuario','int4','Usuário que realizou a transferência.','0', 'Usuário',10,'f','f','f',1,'text','Usuário');
insert into db_syscampo values(22016,'ed137_escolarede','bool','Define se é uma escola da Rede ou de Fora.','true', 'Tipo de Escola',1,'f','f','f',5,'text','Tipo de Escola');
insert into db_syscampo values(22017,'ed137_escola','int4','Escola de destino da transferência do aluno. Pode tanto ser uma escola da Rede quanto uma escola de Fora.','0', 'Escola',10,'f','f','f',1,'text','Escola');
insert into db_syscampo values(22018,'ed137_data','varchar(20)','Data da realização da transferência.','', 'Data',20,'f','t','f',0,'text','Data');
insert into db_sysarqcamp values(3961,22013,1,0);
insert into db_sysarqcamp values(3961,22014,2,0);
insert into db_sysarqcamp values(3961,22015,3,0);
insert into db_sysarqcamp values(3961,22016,4,0);
insert into db_sysarqcamp values(3961,22017,5,0);
insert into db_sysarqcamp values(3961,22018,6,0);
insert into db_sysprikey (codarq,codcam,sequen,camiden) values(3961,22013,1,22013);
insert into db_sysforkey values(3961,22014,1,1010031,0);
insert into db_sysforkey values(3961,22015,1,109,0);
insert into db_sysindices values(4379,'transferencialote_ed137_sequencial_seq',3961,'0');
insert into db_syscadind values(4379,22013,1);
insert into db_syssequencia values(1000596, 'transferencialote_ed137_sequencial_seq', 1, 1, 9223372036854775807, 1, 1);
update db_sysarqcamp set codsequencia = 1000596 where codarq = 3961 and codcam = 22013;
insert into db_sysarquivo values (3962, 'transferencialotematricula', 'Guarda as matrículas que foram transferidas no lote.', 'ed138', '2016-09-01', 'Matrículas do Lote de Transferência', 0, 'f', 'f', 'f', 'f' );
insert into db_sysarqmod values (1008004,3962);
insert into db_syscampo values(22019,'ed138_sequencial','int4','Código','0', 'Código',10,'f','f','f',1,'text','Código');
insert into db_syscampo values(22020,'ed138_transferencialote','int4','Vínculo com o lote de transferência.','0', 'Transferência em Lote',10,'f','f','f',1,'text','Transferência em Lote');
insert into db_syscampo values(22021,'ed138_matricula','int4','Vínculo com a matrícula do aluno.','0', 'Matrícula',10,'f','f','f',1,'text','Matrícula');
insert into db_sysarqcamp values(3962,22019,1,0);
insert into db_sysarqcamp values(3962,22020,2,0);
insert into db_sysarqcamp values(3962,22021,3,0);
insert into db_sysprikey (codarq,codcam,sequen,camiden) values(3962,22019,1,22019);
insert into db_sysforkey values(3962,22020,1,3961,0);
insert into db_sysforkey values(3962,22021,1,1010112,0);
insert into db_sysindices values(4380,'transferencialotematricula_ed138_sequencial_seq',3962,'0');
insert into db_syscadind values(4380,22019,1);
insert into db_syssequencia values(1000597, 'transferencialotematricula_ed138_sequencial_seq', 1, 1, 9223372036854775807, 1, 1);
update db_sysarqcamp set codsequencia = 1000597 where codarq = 3962 and codcam = 22019;
select fc_executa_ddl('
CREATE SEQUENCE transferencialote_ed137_sequencial_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1');
CREATE TABLE IF NOT EXISTS transferencialote (
ed137_sequencial int4 NOT NULL,
ed137_escolaorigem int4 NOT NULL,
ed137_usuario int4 NOT NULL,
ed137_escolarede bool NOT NULL default 'true',
ed137_escola int4 NOT NULL,
ed137_data timestamp default now(),
CONSTRAINT transferencialote_sequ_pk PRIMARY KEY (ed137_sequencial),
CONSTRAINT transferencialote_escolaorigem_fk FOREIGN KEY (ed137_escolaorigem) REFERENCES escola.escola(ed18_i_codigo),
CONSTRAINT transferencialote_usuario_fk FOREIGN KEY (ed137_usuario) REFERENCES configuracoes.db_usuarios(id_usuario)
);
select fc_executa_ddl('CREATE SEQUENCE transferencialotematricula_ed138_sequencial_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1');
CREATE TABLE IF NOT EXISTS transferencialotematricula(
ed138_sequencial int4 NOT NULL,
ed138_transferencialote int4 NOT NULL,
ed138_matricula int4 NOT NULL,
CONSTRAINT transferencialotematricula_sequ_pk PRIMARY KEY (ed138_sequencial),
CONSTRAINT transferencialotematricula_matricula_fk FOREIGN KEY (ed138_matricula) REFERENCES escola.matricula(ed60_i_codigo),
CONSTRAINT transferencialotematricula_transferencialote_fk FOREIGN KEY (ed138_transferencialote) REFERENCES transferencialote(ed137_sequencial)
);
insert into db_itensmenu ( id_item ,descricao ,help ,funcao ,itemativo ,manutencao ,desctec ,libcliente ) values ( 10287 ,'Transferência de Alunos Encerrados ' ,'Transferência de Alunos Encerrados ' ,'' ,'1' ,'1' ,'Transferência de Alunos Encerrados ' ,'true' );
insert into db_itensmenu ( id_item ,descricao ,help ,funcao ,itemativo ,manutencao ,desctec ,libcliente ) values ( 10288 ,'Transferir' ,'Transferir aluno' ,'edu4_transferiralunoencerrado001.php' ,'1' ,'1' ,'Transferir alunos encerrados' ,'true' );
insert into db_itensmenu ( id_item ,descricao ,help ,funcao ,itemativo ,manutencao ,desctec ,libcliente ) values ( 10289 ,'Cancelar' ,'Cancelar transferência' ,'edu4_anulartransferenciaalunoencerrado001.php' ,'1' ,'1' ,'Cancelar transferência de alunos encerrados' ,'true' );
insert into db_itensmenu ( id_item ,descricao ,help ,funcao ,itemativo ,manutencao ,desctec ,libcliente ) values ( 10290 ,'Guia de Transferência - Alunos Encerrados' ,'Guia de Transferência - Alunos Encerrados' ,'edu2_guiatransferenciaencerrados001.php' ,'1' ,'1' ,'Guia de Transferência - Alunos Encerrados' ,'true' );
insert into db_menu ( id_item ,id_item_filho ,menusequencia ,modulo ) values (1101100, 10287, 5, 1100747);
insert into db_menu ( id_item ,id_item_filho ,menusequencia ,modulo ) values (10287, 10288, 1, 1100747);
insert into db_menu ( id_item ,id_item_filho ,menusequencia ,modulo ) values (10287, 10289, 2, 1100747);
insert into db_menu ( id_item ,id_item_filho ,menusequencia ,modulo ) values (1101189, 10290, 5, 1100747);
|
USE psdb; # la selecciono
SELECT * FROM psdb.employees;
|
DROP DATABASE burgers_db;
CREATE DATABASE burgers_db
USE burgers_db;
DROP TABLE IF EXISTS burgers_db;
CREATE TABLE burgers (
id INT (10) AUTO_INCREMENT PRIMARY KEY,
burger_name VARCHAR (255),
devoured BOOLEAN DEFAULT true
);
|
CREATE VIEW `individuals_wo_name` AS
SELECT
`civicrm_contact`.`nick_name` AS `nick_name`,
`civicrm_contact`.`legal_name` AS `legal_name`,
`civicrm_contact`.`contact_type` AS `contact_type`,
`civicrm_contact`.`do_not_email` AS `do_not_email`,
`civicrm_contact`.`do_not_phone` AS `do_not_phone`,
`civicrm_contact`.`do_not_mail` AS `do_not_mail`,
`civicrm_contact`.`do_not_sms` AS `do_not_sms`,
`civicrm_contact`.`contact_sub_type` AS `contact_sub_type`,
`civicrm_contact`.`legal_identifier` AS `legal_identifier`,
`civicrm_contact`.`external_identifier` AS `external_identifier`,
`civicrm_contact`.`sort_name` AS `sort_name`,
`civicrm_contact`.`display_name` AS `display_name`,
`civicrm_contact`.`image_URL` AS `image_URL`,
`civicrm_contact`.`preferred_communication_method` AS `preferred_communication_method`,
`civicrm_contact`.`preferred_mail_format` AS `preferred_mail_format`,
`civicrm_contact`.`do_not_trade` AS `do_not_trade`,
`civicrm_contact`.`hash` AS `hash`,
`civicrm_contact`.`is_opt_out` AS `is_opt_out`,
`civicrm_contact`.`id` AS `id`,
`civicrm_contact`.`source` AS `source`,
`civicrm_contact`.`first_name` AS `first_name`,
`civicrm_contact`.`middle_name` AS `middle_name`,
`civicrm_contact`.`last_name` AS `last_name`,
`civicrm_contact`.`prefix_id` AS `prefix_id`,
`civicrm_contact`.`suffix_id` AS `suffix_id`,
`civicrm_contact`.`email_greeting_id` AS `email_greeting_id`,
`civicrm_contact`.`email_greeting_custom` AS `email_greeting_custom`,
`civicrm_contact`.`email_greeting_display` AS `email_greeting_display`,
`civicrm_contact`.`postal_greeting_id` AS `postal_greeting_id`,
`civicrm_contact`.`postal_greeting_custom` AS `postal_greeting_custom`,
`civicrm_contact`.`postal_greeting_display` AS `postal_greeting_display`,
`civicrm_contact`.`addressee_id` AS `addressee_id`,
`civicrm_contact`.`addressee_custom` AS `addressee_custom`,
`civicrm_contact`.`addressee_display` AS `addressee_display`,
`civicrm_contact`.`job_title` AS `job_title`,
`civicrm_contact`.`gender_id` AS `gender_id`,
`civicrm_contact`.`birth_date` AS `birth_date`,
`civicrm_contact`.`is_deceased` AS `is_deceased`,
`civicrm_contact`.`deceased_date` AS `deceased_date`,
`civicrm_contact`.`household_name` AS `household_name`,
`civicrm_contact`.`primary_contact_id` AS `primary_contact_id`,
`civicrm_contact`.`organization_name` AS `organization_name`,
`civicrm_contact`.`sic_code` AS `sic_code`,
`civicrm_contact`.`user_unique_id` AS `user_unique_id`,
`civicrm_contact`.`employer_id` AS `employer_id`,
`civicrm_contact`.`api_key` AS `api_key`,
`civicrm_contact`.`is_deleted` AS `is_deleted`,
`civicrm_contact`.`preferred_language` AS `preferred_language`,
`civicrm_contact`.`created_date` AS `created_date`,
`civicrm_contact`.`modified_date` AS `modified_date`
FROM
`civicrm_contact`
WHERE
((ISNULL(`civicrm_contact`.`first_name`)
OR (CHAR_LENGTH(`civicrm_contact`.`first_name`) = 0))
AND (ISNULL(`civicrm_contact`.`last_name`)
OR (CHAR_LENGTH(`civicrm_contact`.`last_name`) = 0))
AND (`civicrm_contact`.`contact_type` = 'Individual')) |
CREATE OR REPLACE VIEW V_CMS_LOAN_BOOK AS
SELECT CLB.CLB_ID,
CLB.CLB_NO,
CLB.CLB_LOAN_CORP_ID AS BL_CORP_ID,
BL.CORP_CODE AS BL_CORP_CODE,
BL.CORP_NAME AS BL_CORP_NAME,
CLB.CLB_BORROW_CORP_ID AS BB_CORP_ID,
BB.CORP_CODE AS BB_CORP_CODE,
BB.CORP_NAME AS BB_CORP_NAME,
ROUND(CLB.CLB_LOAN_MONEY, 2) AS CLB_LOAN_MONEY,
ROUND(NVL(SUM(CLA.CLA_MONEY), 0), 2) AS CLA_MONEY,
ROUND(CLB.CLB_BALANCE, 2) AS CLB_BALANCE,
ROUND(CLB.CLB_FIXED_RATE, 6) AS CLB_FIXED_RATE,
ROUND(CLB.CLB_AGREEMENT_RATE, 6) AS CLB_AGREEMENT_RATE,
ROUND(NVL(SUM(CBI.FIX_FEE_REAL), 0), 2) AS FIX_FEE_REAL,
ROUND(NVL(SUM(CBI.AGREEMENT_FEE_REAL), 0), 2) AS AGREEMENT_FEE_REAL,
CLB.CLB_START_DATE,
CLB.CLB_END_DATE,
CLB.CLB_STATUS
FROM CMS_LOAN_BILL CLB
LEFT JOIN CMS_LOAN_ABATE CLA ON CLB.CLB_ID = CLA.CLB_ID
LEFT JOIN CMS_BILLING CBI ON CLB.CLB_ID = CBI.CLB_ID
INNER JOIN BT_CORP BL ON CLB.CLB_LOAN_CORP_ID = BL.ID
INNER JOIN BT_CORP BB ON CLB.CLB_BORROW_CORP_ID = BB.ID
GROUP BY CLB.CLB_ID,
CLB.CLB_NO,
CLA.CLA_ID,
CLB.CLB_LOAN_CORP_ID,
BL.CORP_CODE,
BL.CORP_NAME,
CLB.CLB_BORROW_CORP_ID,
BB.CORP_CODE,
BB.CORP_NAME,
CLB.CLB_LOAN_MONEY,
CLB.CLB_BALANCE,
CLB.CLB_FIXED_RATE,
CLB.CLB_AGREEMENT_RATE,
CLB.CLB_START_DATE,
CLB.CLB_END_DATE,
CLA.CLA_DATE,
CLB.CLB_STATUS;
CREATE OR REPLACE VIEW V_CMS_PAYMENT_RECORD AS
SELECT CPR.CPR_ID,
CPR.CPR_NO,
CLB.CLB_ID,
CLB.CLB_NO,
CLB.CLB_LOAN_CORP_ID AS BL_CORP_ID,
BL.CORP_CODE AS BL_CORP_CODE,
BL.CORP_NAME AS BL_CORP_NAME,
CLB.CLB_BORROW_CORP_ID AS BB_CORP_ID,
BB.CORP_CODE AS BB_CORP_CODE,
BB.CORP_NAME AS BB_CORP_NAME,
ROUND(CPR.CPR_MONEY * 10000, 2) AS CPR_MONEY,
ROUND(CPR.CPR_FIXED_MONEY, 2) AS CPR_FIXED_MONEY,
ROUND(CPR.CPR_AGREEMENT_MONEY, 2) AS CPR_AGREEMENT_MONEY,
ROUND(CPR.CPR_MONEY * 10000 + CPR.CPR_FIXED_MONEY + CPR.CPR_AGREEMENT_MONEY, 2) AS CPR_TOTAL_MONEY,
CPR.CPR_PAYMENT_DATE,
CPR.CPR_DESC,
CPR.CPR_STATUS
FROM CMS_PAYMENT_RECORDS CPR
JOIN CMS_LOAN_BILL CLB ON CLB.CLB_ID = CPR.CLB_ID
JOIN BT_CORP BL ON CLB.CLB_LOAN_CORP_ID = BL.ID
JOIN BT_CORP BB ON CLB.CLB_BORROW_CORP_ID = BB.ID
GROUP BY CPR.CPR_ID,
CPR.CPR_NO,
CLB.CLB_ID,
CLB.CLB_NO,
CLB.CLB_LOAN_CORP_ID,
BL.CORP_CODE,
BL.CORP_NAME,
CLB.CLB_BORROW_CORP_ID,
BB.CORP_CODE,
BB.CORP_NAME,
CPR.CPR_MONEY,
CPR.CPR_FIXED_MONEY,
CPR.CPR_AGREEMENT_MONEY,
CLB.CLB_AGREEMENT_RATE,
CPR.CPR_PAYMENT_DATE,
CPR.CPR_DESC,
CPR.CPR_STATUS; |
CREATE DATABASE TecWeb;
USE TecWeb;
CREATE TABLE IF NOT EXISTS `artisti` (
`Username` varchar(30) CHARACTER SET utf8 NOT NULL,
`Password` varchar(256) NOT NULL,
`Nome` varchar(100) CHARACTER SET utf8 NOT NULL,
`Cognome` varchar(100) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`Username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `opere` (
`Nome` varchar(30) CHARACTER SET utf8 NOT NULL,
`Descrizione` varchar(1000) CHARACTER SET utf8 DEFAULT NULL,
`Data_upload` datetime NOT NULL,
`Artista` varchar(30) CHARACTER SET utf8 NOT NULL,
`Categoria` enum('Landscape','Fantasy','Abstract','Cartoon','Portrait','Nature','Others') CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`Nome`,`Artista`),
FOREIGN KEY(`Artista`) REFERENCES `artisti` (`Username`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE IF NOT EXISTS `commenti` (
`ID` int(8) NOT NULL AUTO_INCREMENT,
`Opera` varchar(30) CHARACTER SET utf8 NOT NULL,
`Utente` varchar(30) CHARACTER SET utf8 NOT NULL,
`Creatore` varchar(30) CHARACTER SET utf8 NOT NULL,
`Commento` varchar(1000) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`ID`),
FOREIGN KEY(`Opera`, `Creatore`) REFERENCES `opere` (`Nome`, `Artista`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY(`Utente`) REFERENCES `artisti` (`Username`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
CREATE TABLE IF NOT EXISTS `likes` (
`Opera` varchar(30) CHARACTER SET utf8 NOT NULL,
`Utente` varchar(30) CHARACTER SET utf8 NOT NULL,
`Creatore` varchar(30) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`Opera`,`Creatore`,`Utente`),
FOREIGN KEY(`Opera`, `Creatore`) REFERENCES `opere` (`Nome`, `Artista`) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY(`Utente`) REFERENCES `artisti` (`Username`) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `artisti` (`Username`, `Password`, `Nome`, `Cognome`) VALUES
('daniele.bianchin', '$2y$10$nWohuRAUx2nk.9IUZc2DuOy1/UMgcWobHFXM526K7TokN0UKQxcHe', 'Daniele', 'Bianchin'),
('admin', '$2y$10$u9Wfos7iftnczbMBIUmcr.qUSA4xyRPsX9NFtOu2h08II3pLJs8ta', 'Daniele', 'Bianchin'),
('Singh', '$2y$10$KK6ctR/OLPqN22uNqS8u5ulbx571gmpVeofxrMxiVEvrajZ9mJr0C', 'Harwinder', 'Singh'),
('Noctis', '$2y$10$mJ5.UH.mUn.BzDax1wT3nuemN/HHkf7Xp2gSrfJ5FzFmd5rlDTCce', 'Davide', 'Liu'),
('pard', '$2y$10$yn0loTn1dxP0gGbzQ.ZJu.nZsQ2txPccPH.f1qHbz4axOT70sNyQ6', 'Pardeep', 'Singh');
INSERT INTO `opere` (`Nome`, `Descrizione`, `Data_upload`, `Artista`, `Categoria`) VALUES
('Noctis', 'Noctis Lucis Caelum', '2018-10-29 04:10:04', 'Noctis', 'Portrait'),
('Stickers', 'Lot of stickers', '2018-10-29 04:08:25', 'Noctis', 'Landscape'),
('Kefla', '', '2018-10-29 04:05:30', 'Noctis', 'Portrait'),
('Rose Wolf', '', '2018-10-29 04:07:24', 'Noctis', 'Nature'),
('High Altitude Vegetation', 'Unkown', '2018-07-22 17:34:11', 'daniele.bianchin', 'Fantasy'),
('Carpe Noctem', 'Unkown', '2018-07-22 17:34:11', 'daniele.bianchin', 'Fantasy'),
('Super Orbit', 'Unkown', '2018-01-21 17:21:11', 'daniele.bianchin', 'Fantasy'),
('Water on Planet X', 'Unkown', '2018-07-22 17:34:11', 'daniele.bianchin', 'Fantasy'),
('Wild-fi', 'Unkown', '2018-07-22 17:34:11', 'daniele.bianchin', 'Fantasy'),
('西王母', '', '2018-10-30 11:33:29', 'Noctis', 'Landscape');
INSERT INTO `commenti` (`ID`, `Opera`, `Utente`, `Creatore`, `Commento`) VALUES
(0, 'Carpe Noctem', 'daniele.bianchin', 'daniele.bianchin', 'Auto-commento');
INSERT INTO `likes` (`Opera`, `Utente`, `Creatore`) VALUES
('Carpe Noctem', 'daniele.bianchin', 'daniele.bianchin'),
('High Altitude Vegetation', 'daniele.bianchin', 'daniele.bianchin'),
('Kefla', 'admin', 'Noctis'),
('Kefla', 'Noctis', 'Noctis'),
('Noctis', 'admin', 'Noctis'),
('Noctis', 'Noctis', 'Noctis'),
('Rose Wolf', 'admin', 'Noctis'),
('Stickers', 'Noctis', 'Noctis'),
('Super Orbit', 'daniele.bianchin', 'daniele.bianchin'),
('Water on Planet X', 'daniele.bianchin', 'daniele.bianchin'),
('Wild-fi', 'daniele.bianchin', 'daniele.bianchin'),
('西王母', 'Noctis', 'Noctis');
|
SET SERVEROUTPUT ON;
DECLARE
oid_m NUMBER;
BEGIN
PRUEBAS_MODALIDADES.INICIALIZAR;
PRUEBAS_MODALIDADES.INSERTAR ('Prueba 1 - Inserción modalid','Entrenamiento',true);
oid_m := sec_modalidades.currval;
PRUEBAS_MODALIDADES.INSERTAR ('Prueba 2 - Inserción modalid null', null,false);
PRUEBAS_MODALIDADES.ELIMINAR('Prueba 5 - Eliminar modalid', OID_m, true);
END; |
USE `arenafifadb`;
DELIMITER $$
DROP FUNCTION IF EXISTS `fcGetPositionByTime` $$
CREATE FUNCTION `fcGetPositionByTime`(pIdCamp INTEGER, pIdTime INTEGER) RETURNS INTEGER
DETERMINISTIC
begin
DECLARE _position INTEGER DEFAULT NULL;
DECLARE _finished INTEGER DEFAULT 0;
DECLARE _teamID INTEGER DEFAULT 0;
DECLARE tabela_cursor CURSOR FOR
select C.ID_TIME
from TB_CLASSIFICACAO C
where C.ID_CAMPEONATO = pIdCamp
order by C.ID_GRUPO, C.QT_PONTOS_GANHOS desc, C.QT_VITORIAS desc, (C.QT_GOLS_PRO-C.QT_GOLS_CONTRA) desc, C.QT_GOLS_PRO desc, C.QT_GOLS_CONTRA;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _finished = 1;
SET _position = 1;
OPEN tabela_cursor;
get_tabela: LOOP
FETCH tabela_cursor INTO _teamID;
IF _finished = 1 THEN
LEAVE get_tabela;
END IF;
IF _teamID = pIdTime THEN
LEAVE get_tabela;
END IF;
SET _position = _position + 1;
END LOOP get_tabela;
CLOSE tabela_cursor;
RETURN _position;
End$$
DELIMITER ;
DELIMITER $$
DROP FUNCTION IF EXISTS `fcGetTimeIDByPosicao` $$
CREATE FUNCTION `fcGetTimeIDByPosicao`(pIdCamp INTEGER, pIdPosicao INTEGER) RETURNS INTEGER
DETERMINISTIC
begin
DECLARE _position INTEGER DEFAULT NULL;
DECLARE _finished INTEGER DEFAULT 0;
DECLARE _teamID INTEGER DEFAULT 0;
DECLARE tabela_cursor CURSOR FOR
select C.ID_TIME
from TB_CLASSIFICACAO C
where C.ID_CAMPEONATO = pIdCamp
order by C.ID_GRUPO, C.QT_PONTOS_GANHOS desc, C.QT_VITORIAS desc, (C.QT_GOLS_PRO-C.QT_GOLS_CONTRA) desc, C.QT_GOLS_PRO desc, C.QT_GOLS_CONTRA;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _finished = 1;
SET _position = 1;
OPEN tabela_cursor;
get_tabela: LOOP
FETCH tabela_cursor INTO _teamID;
IF _finished = 1 THEN
LEAVE get_tabela;
END IF;
IF _position = pIdPosicao THEN
LEAVE get_tabela;
END IF;
SET _position = _position + 1;
END LOOP get_tabela;
CLOSE tabela_cursor;
RETURN _teamID;
End$$
DELIMITER ;
DELIMITER $$
DROP FUNCTION IF EXISTS `fcGetTimeIDByPosicaoEGrupo` $$
CREATE FUNCTION `fcGetTimeIDByPosicaoEGrupo`(pIdCamp INTEGER, pIdPosicao INTEGER, pIdGrupo INTEGER) RETURNS INTEGER
DETERMINISTIC
begin
DECLARE _position INTEGER DEFAULT NULL;
DECLARE _finished INTEGER DEFAULT 0;
DECLARE _teamID INTEGER DEFAULT 0;
DECLARE tabela_cursor CURSOR FOR
select C.ID_TIME
from TB_CLASSIFICACAO C
where C.ID_CAMPEONATO = pIdCamp
and C.ID_GRUPO = pIdGrupo
order by C.ID_GRUPO, C.QT_PONTOS_GANHOS desc, C.QT_VITORIAS desc, (C.QT_GOLS_PRO-C.QT_GOLS_CONTRA) desc, C.QT_GOLS_PRO desc, C.QT_GOLS_CONTRA;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _finished = 1;
SET _position = 1;
OPEN tabela_cursor;
get_tabela: LOOP
FETCH tabela_cursor INTO _teamID;
IF _finished = 1 THEN
LEAVE get_tabela;
END IF;
IF _position = pIdPosicao THEN
LEAVE get_tabela;
END IF;
SET _position = _position + 1;
END LOOP get_tabela;
CLOSE tabela_cursor;
RETURN _teamID;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spAddUpdateClassificacao` $$
CREATE PROCEDURE `spAddUpdateClassificacao`(
pIdCamp INTEGER,
pIdTime INTEGER,
pTotalPT INTEGER,
pTotalMatches INTEGER,
pTotalWin INTEGER,
pTotalDraw INTEGER,
pTotalLost INTEGER,
pGoalsFor INTEGER,
pGoalsAgaint INTEGER
)
Begin
DECLARE _idGrupo INTEGER DEFAULT NULL;
SELECT ID_GRUPO into _idGrupo FROM TB_CLASSIFICACAO
WHERE ID_CAMPEONATO = pIdCamp and ID_TIME = pIdTime;
IF _idGrupo IS NULL THEN
SET _idGrupo = 0;
insert into `TB_CLASSIFICACAO` (`ID_CAMPEONATO`, `ID_TIME`, `ID_GRUPO`, `QT_PONTOS_GANHOS`, `QT_VITORIAS`, `QT_JOGOS`, `QT_EMPATES`, `QT_DERROTAS`, `QT_GOLS_PRO`, `QT_GOLS_CONTRA`)
values (pIdCamp, pIdTime, _idGrupo, pTotalPT, pTotalWin, pTotalMatches, pTotalDraw, pTotalLost, pGoalsFor, pGoalsAgaint);
ELSE
UPDATE TB_CLASSIFICACAO
SET QT_PONTOS_GANHOS = pTotalPT,
QT_VITORIAS = pTotalWin,
QT_JOGOS = pTotalMatches,
QT_EMPATES = pTotalDraw,
QT_DERROTAS = pTotalLost,
QT_GOLS_PRO = pGoalsFor,
QT_GOLS_CONTRA = pGoalsAgaint
WHERE ID_CAMPEONATO = pIdCamp and ID_TIME = pIdTime;
END IF;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spUpdateClassificacaoNewTime` $$
CREATE PROCEDURE `spUpdateClassificacaoNewTime`(
pIdCamp INTEGER,
pIdTimeOld INTEGER,
pIdTimeNew INTEGER
)
Begin
update `TB_CLASSIFICACAO`
set ID_TIME = pIdTimeNew
where ID_CAMPEONATO = pIdCamp and ID_TIME = pIdTimeOld;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spDeleteAllClassificacaoOfCampeonato` $$
CREATE PROCEDURE `spDeleteAllClassificacaoOfCampeonato`(pIdCamp INTEGER)
begin
delete from TB_CLASSIFICACAO where ID_CAMPEONATO = pIdCamp;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spAddLoadClassificacaoInitialOfCampeonato` $$
CREATE PROCEDURE `spAddLoadClassificacaoInitialOfCampeonato`(
pIdCamp INTEGER,
pIdsTime VARCHAR(250)
)
Begin
DECLARE _next VARCHAR(250) DEFAULT NULL;
DECLARE _nextlen INTEGER DEFAULT NULL;
DECLARE _idTime VARCHAR(10) DEFAULT NULL;
DECLARE strDelimiter CHAR(1) DEFAULT ',';
call `arenafifadb`.`spDeleteAllClassificacaoOfCampeonato`(pIdCamp);
iterator:
LOOP
IF LENGTH(TRIM(pIdsTime)) = 0 OR pIdsTime IS NULL THEN
LEAVE iterator;
END IF;
SET _next = SUBSTRING_INDEX(pIdsTime,strDelimiter,1);
SET _nextlen = LENGTH(_next);
SET _idTime = TRIM(_next);
call `arenafifadb`.`spAddUpdateClassificacao`(pIdCamp, CAST(_idTime AS SIGNED), 0, 0, 0, 0, 0, 0, 0);
SET pIdsTime = INSERT(pIdsTime,1,_nextlen + 1,'');
END LOOP;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spAddLoadClassificacaoInitialOfCampeonatov2` $$
CREATE PROCEDURE `spAddLoadClassificacaoInitialOfCampeonatov2`(
pIdCamp INTEGER)
Begin
DECLARE _finished INTEGER DEFAULT 0;
DECLARE _idTime INTEGER DEFAULT 0;
DECLARE tabela_cursor CURSOR FOR
SELECT ID_TIME FROM TB_CAMPEONATO_TIME WHERE ID_CAMPEONATO = pIdCamp;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _finished = 1;
call `arenafifadb`.`spDeleteAllClassificacaoOfCampeonato`(pIdCamp);
OPEN tabela_cursor;
get_tabela: LOOP
FETCH tabela_cursor INTO _idTime;
IF _finished = 1 THEN
LEAVE get_tabela;
END IF;
call `arenafifadb`.`spAddUpdateClassificacao`(pIdCamp, _idTime, 0, 0, 0, 0, 0, 0, 0);
END LOOP get_tabela;
CLOSE tabela_cursor;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spDeleteClassificacaoOfCampeonato` $$
CREATE PROCEDURE `spDeleteClassificacaoOfCampeonato`(pIdCamp INTEGER)
Begin
delete from `TB_CLASSIFICACAO` where ID_CAMPEONATO = pIdCamp;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spRemoveClassificacaoGrupoOfTime` $$
CREATE PROCEDURE `spRemoveClassificacaoGrupoOfTime`(
pIdCamp INTEGER,
pIdTime INTEGER
)
Begin
update `TB_CLASSIFICACAO`
set ID_GRUPO = 0, IN_ORDENACAO_GRUPO = 0
where ID_CAMPEONATO = pIdCamp and ID_TIME = pIdTime;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spRemoveClassificacaoGrupoOfAllTimes` $$
CREATE PROCEDURE `spRemoveClassificacaoGrupoOfAllTimes`(pIdCamp INTEGER)
Begin
update `TB_CLASSIFICACAO`
set ID_GRUPO = 0, IN_ORDENACAO_GRUPO = 0
where ID_CAMPEONATO = pIdCamp;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spAddClassificacaoGrupoOfTime` $$
CREATE PROCEDURE `spAddClassificacaoGrupoOfTime`(
pIdCamp INTEGER,
pIdTime INTEGER,
pIdGrupo INTEGER,
pOrdem INTEGER
)
Begin
update `TB_CLASSIFICACAO`
set ID_GRUPO = pIdGrupo, IN_ORDENACAO_GRUPO = pOrdem
where ID_CAMPEONATO = pIdCamp and ID_TIME = pIdTime;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spGetAllClassificacaoTimeOfCampeonato` $$
CREATE PROCEDURE `spGetAllClassificacaoTimeOfCampeonato`(
pIdCamp INTEGER
)
begin
DECLARE _numRodada INTEGER DEFAULT 0;
SET _numRodada = fcGetCurrentRoundByCampeonato(pIdCamp);
select C.*, T.NM_TIME, T.DS_TIPO, T.DS_URL_TIME, U.PSN_ID, U.NM_USUARIO, U.ID_USUARIO, T.IN_TIME_EXCLUIDO_TEMP_ATUAL, C.ID_GRUPO,
(select HC.IN_POSICAO from TB_HISTORICO_CLASSIFICACAO HC where HC.ID_CAMPEONATO = C.ID_CAMPEONATO and HC.ID_TIME = C.ID_TIME and HC.IN_NUMERO_RODADA = _numRodada limit 1) as PosicaoAnterior
from TB_CLASSIFICACAO C, TB_TIME T, TB_USUARIO_TIME UT, TB_USUARIO U
where C.ID_CAMPEONATO = pIdCamp
and UT.DT_VIGENCIA_FIM is null
and C.ID_TIME = T.ID_TIME
and C.ID_CAMPEONATO = UT.ID_CAMPEONATO
and T.ID_TIME = UT.ID_TIME
and UT.ID_USUARIO = U.ID_USUARIO
order by C.ID_GRUPO, C.QT_PONTOS_GANHOS desc, C.QT_VITORIAS desc, (C.QT_GOLS_PRO-C.QT_GOLS_CONTRA) desc, C.QT_GOLS_PRO desc, C.QT_GOLS_CONTRA, T.NM_TIME;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spGetAllClassificacaoTimeOfCampeonatoByGrupo` $$
CREATE PROCEDURE `spGetAllClassificacaoTimeOfCampeonatoByGrupo`(
pIdCamp INTEGER,
pIdGrupo INTEGER,
pTotalQualified INTEGER
)
begin
IF pTotalQualified = 0 THEN
select C.*, T.NM_TIME, T.DS_TIPO, T.DS_URL_TIME, U.PSN_ID, U.NM_USUARIO, U.ID_USUARIO, T.IN_TIME_EXCLUIDO_TEMP_ATUAL, C.ID_GRUPO
from TB_CLASSIFICACAO C, TB_TIME T, TB_USUARIO_TIME UT, TB_USUARIO U
where C.ID_CAMPEONATO = pIdCamp
and C.ID_GRUPO = pIdGrupo
and UT.DT_VIGENCIA_FIM is null
and C.ID_TIME = T.ID_TIME
and C.ID_CAMPEONATO = UT.ID_CAMPEONATO
and T.ID_TIME = UT.ID_TIME
and UT.ID_USUARIO = U.ID_USUARIO
order by C.ID_GRUPO, C.QT_PONTOS_GANHOS desc, C.QT_VITORIAS desc, (C.QT_GOLS_PRO-C.QT_GOLS_CONTRA) desc, C.QT_GOLS_PRO desc, C.QT_GOLS_CONTRA, T.NM_TIME;
ELSE
select C.*, T.NM_TIME, T.DS_TIPO, T.DS_URL_TIME, U.PSN_ID, U.NM_USUARIO, U.ID_USUARIO, T.IN_TIME_EXCLUIDO_TEMP_ATUAL, C.ID_GRUPO
from TB_CLASSIFICACAO C, TB_TIME T, TB_USUARIO_TIME UT, TB_USUARIO U
where C.ID_CAMPEONATO = pIdCamp
and C.ID_GRUPO = pIdGrupo
and UT.DT_VIGENCIA_FIM is null
and C.ID_TIME = T.ID_TIME
and C.ID_CAMPEONATO = UT.ID_CAMPEONATO
and T.ID_TIME = UT.ID_TIME
and UT.ID_USUARIO = U.ID_USUARIO
order by C.ID_GRUPO, C.QT_PONTOS_GANHOS desc, C.QT_VITORIAS desc, (C.QT_GOLS_PRO-C.QT_GOLS_CONTRA) desc, C.QT_GOLS_PRO desc, C.QT_GOLS_CONTRA, T.NM_TIME LIMIT pTotalQualified;
END IF;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spGetLoadClassificacaoTimeOfCampeonato` $$
CREATE PROCEDURE `spGetLoadClassificacaoTimeOfCampeonato`(
pIdCamp INTEGER,
pIdsTime VARCHAR(250)
)
begin
select C.*, T.NM_TIME, T.DS_TIPO, T.DS_URL_TIME, U.PSN_ID, U.NM_USUARIO, U.ID_USUARIO, T.IN_TIME_EXCLUIDO_TEMP_ATUAL, C.ID_GRUPO
from TB_CLASSIFICACAO C, TB_TIME T, TB_USUARIO_TIME UT, TB_USUARIO U
where C.ID_CAMPEONATO = pIdCamp
and FIND_IN_SET(C.ID_TIME,pIdsTime)
and UT.DT_VIGENCIA_FIM is null
and C.ID_TIME = T.ID_TIME
and C.ID_CAMPEONATO = UT.ID_CAMPEONATO
and T.ID_TIME = UT.ID_TIME
and UT.ID_USUARIO = U.ID_USUARIO
order by C.QT_PONTOS_GANHOS desc, C.QT_VITORIAS desc, (C.QT_GOLS_PRO-C.QT_GOLS_CONTRA) desc, C.QT_GOLS_PRO desc, C.QT_GOLS_CONTRA, T.NM_TIME;
End$$
DELIMITER ;
DELIMITER $$
DROP PROCEDURE IF EXISTS `spCalculateClassificacaoByTime` $$
CREATE PROCEDURE `spCalculateClassificacaoByTime`(
pIdCamp INTEGER, pIdTime INTEGER)
Begin
DECLARE _finished INTEGER DEFAULT 0;
DECLARE _totalPT INTEGER DEFAULT 0;
DECLARE _match INTEGER DEFAULT 0;
DECLARE _win INTEGER DEFAULT 0;
DECLARE _draw INTEGER DEFAULT 0;
DECLARE _lost INTEGER DEFAULT 0;
DECLARE _goalsFor INTEGER DEFAULT 0;
DECLARE _goalsAgainst INTEGER DEFAULT 0;
DECLARE _goalsTimeHome INTEGER DEFAULT 0;
DECLARE _goalsTimeAway INTEGER DEFAULT 0;
DECLARE _idTimeHome INTEGER DEFAULT 0;
DECLARE _idTimeAway INTEGER DEFAULT 0;
DECLARE tabela_cursor CURSOR FOR
SELECT ID_TIME_CASA, QT_GOLS_TIME_CASA, ID_TIME_VISITANTE, QT_GOLS_TIME_VISITANTE
FROM TB_TABELA_JOGO
WHERE ID_CAMPEONATO = pIdCamp
AND ID_FASE = 0
AND (ID_TIME_CASA = pIdTime OR ID_TIME_VISITANTE = pIdTime)
AND QT_GOLS_TIME_CASA IS NOT NULL
ORDER BY ID_TABELA_JOGO;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET _finished = 1;
OPEN tabela_cursor;
get_tabela: LOOP
FETCH tabela_cursor INTO _idTimeHome, _goalsTimeHome, _idTimeAway, _goalsTimeAway;
IF _finished = 1 THEN
LEAVE get_tabela;
END IF;
SET _match = _match + 1;
IF _goalsTimeHome = _goalsTimeAway THEN
SET _draw = _draw + 1;
END IF;
IF pIdTime = _idTimeHome THEN
IF _goalsTimeHome > _goalsTimeAway THEN
SET _win = _win + 1;
ELSEIF _goalsTimeHome < _goalsTimeAway THEN
SET _lost = _lost + 1;
END IF;
SET _goalsFor = _goalsFor + _goalsTimeHome;
SET _goalsAgainst = _goalsAgainst + _goalsTimeAway;
ELSE
IF _goalsTimeHome < _goalsTimeAway THEN
SET _win = _win + 1;
ELSEIF _goalsTimeHome > _goalsTimeAway THEN
SET _lost = _lost + 1;
END IF;
SET _goalsFor = _goalsFor + _goalsTimeAway;
SET _goalsAgainst = _goalsAgainst + _goalsTimeHome;
END IF;
END LOOP get_tabela;
SET _totalPT = (_win * 3) + _draw;
call `arenafifadb`.`spAddUpdateClassificacao`(pIdCamp, pIdTime, _totalPT, _match, _win, _draw, _lost, _goalsFor, _goalsAgainst);
CLOSE tabela_cursor;
End$$
DELIMITER ;
|
-- Creating DB for outer space --
CREATE TABLE star (
star TEXT PRIMARY KEY,
star_temp_in_Kelvin TEXT
);
CREATE TABLE planets (
planet TEXT PRIMARY KEY,
orbital_period_in_years FLOAT,
-- reference to star table
star_name TEXT NOT NULL REFERENCES star
);
CREATE TABLE moons (
moon TEXT PRIMARY KEY,
planet_name TEXT NOT NULL REFERENCES planets
);
-- Filling the tables
INSERT INTO star (star, star_temp_in_Kelvin)
values
('The Sun', '5800°K'),
('Proxima Centauri', '3042°K'),
('Gliese 876', '3192°K');
INSERT INTO planets (planet, orbital_period_in_years, star_name)
values
('Earth', 1.00, 'The Sun'),
('Mars', 1.882, 'The Sun'),
('Venus', 0.62, 'The Sun'),
('Proxima Centauri b', 0.03, 'Proxima Centauri'),
('Gliese 876 b', 0.236, 'Gliese 876');
INSERT INTO moons (moon, planet_name)
values
('The Moon', 'Earth'),
('Phobos', 'Mars'),
('Deimos', 'Mars');
-- Query for Data --
SELECT planet, star, COUNT(moons) as moon_count
FROM planets
JOIN star
ON star_name = star
LEFT OUTER JOIN moons
ON planet_name = planet
GROUP BY planet, star
; |
CREATE procedure sp_ser_closejobestimation(@EstimationID Int)
as
Update EstimationAbstract
Set status = (isnull(status,0) | 128)
Where EstimationID = @EstimationID
|
USE INETACT;
USE inetact-test;
USE mysql;
DELETE FROM T_MOBILE_BIND_INFO WHERE USER_NAME LIKE 'lichen'
SELECT * FROM T_MOBILE_BIND_INFO
WHERE USER_NAME IN ('hsxww0072')
SELECT * FROM T_MOBILE_BIND_INFO
WHERE USER_NAME IN ('zhongtai002','huaan002','wanlian002')
AND create_time LIKE '2016-08-08%';
SELECT * FROM T_SRV_EXEC_REQUEST
WHERE REQUEST_TIME > '2016-7-21' AND
DONEE_NAME = 'test测试_20175623'
SELECT * FROM T_SRV_EXEC_REQUEST;
WHERE
DONEE_NAME = 'test测试_20175623'
SELECT * FROM T_MOBILE_BIND_INFO ORDER BY id_mobile_bind_info DESC
WHERE USER_NAME LIKE 'lichen%';
SELECT * FROM T_MOBILE_BIND_INFO
WHERE mobile = '35c98c6e717a0d4fd2438f9516a30c33'
AND user_name = 'dzh-crp-sms'
SELECT * FROM T_MOBILE_BIND_INFO
WHERE user_name = 'dzh-crp-sms' ORDER BY id_mobile_bind_info DESC
SELECT * FROM T_MOBILE_BIND_INFO
WHERE USER_NAME LIKE 'lichen1002%'
AND MARK LIKE '135%'
SELECT * FROM T_MOBILE_BIND_INFO_BAK2
SELECT * INTO T_MOBILE_BIND_INFO_BAK2 FROM T_MOBILE_BIND_INFO
INSERT INTO T_MOBILE_BIND_INFO_BAK2 (SELECT * FROM T_MOBILE_BIND_INFO)
DROP TABLE IF EXISTS `T_MOBILE_BIND_INFO_BAK2`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `T_MOBILE_BIND_INFO_BAK2` (
`ID_MOBILE_BIND_INFO` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '..',
`USER_NAME` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT '' COMMENT '...',
`USER_ID` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '..ID',
`MOBILE` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '........',
`MOBILE_SYM` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '........',
`OSN` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '.....',
`ISN` VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '........',
`MARK` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '3-3-4.....',
`CHANNEL` VARCHAR(100) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '..',
`SOURCE_NO` VARCHAR(200) CHARACTER SET utf8 COLLATE utf8_bin DEFAULT NULL COMMENT '....',
`CREATE_TIME` DATETIME NOT NULL COMMENT '创建时间',
`MKT_ACTIVITY_CODE` VARCHAR(200) DEFAULT NULL,
`REMARK` VARCHAR(2000) DEFAULT NULL COMMENT '备注',
`URL_CODE` VARCHAR(255) DEFAULT NULL COMMENT '���ýӿ�URL�̱���',
`SYNC_STATUS` SMALLINT(1) DEFAULT NULL COMMENT '同步状态,0 未同步 1 已同步',
`EXT_DATA1` VARCHAR(100) DEFAULT NULL,
`EXT_DATA2` VARCHAR(100) DEFAULT NULL,
`EXT_DATA3` VARCHAR(100) DEFAULT NULL,
`EXT_DATA4` VARCHAR(100) DEFAULT NULL,
`UPT_TIME` DATETIME DEFAULT NULL,
PRIMARY KEY (`ID_MOBILE_BIND_INFO`),
KEY `idx_crt_time` (`CREATE_TIME`),
KEY `idx_mark_mac` (`MARK`,`MKT_ACTIVITY_CODE`),
KEY `idx_username_mac` (`USER_NAME`,`MKT_ACTIVITY_CODE`),
KEY `idx_mobile_mac` (`MOBILE`,`MKT_ACTIVITY_CODE`),
KEY `id_ext_data1` (`EXT_DATA1`),
KEY `idx_crt_ext_data2` (`EXT_DATA2`) USING BTREE,
KEY `idx_upt_time` (`UPT_TIME`) USING BTREE
) ENGINE=INNODB AUTO_INCREMENT=11775 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */; |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Gazdă: 127.0.0.1
-- Timp de generare: iun. 03, 2020 la 10:35 PM
-- Versiune server: 10.4.11-MariaDB
-- Versiune PHP: 7.4.6
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 */;
--
-- Bază de date: `bookreviewer`
--
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `authors`
--
CREATE TABLE `authors` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `authors`:
--
--
-- Eliminarea datelor din tabel `authors`
--
INSERT INTO `authors` (`id`, `name`) VALUES
(4, 'Miaunel si balanel'),
(2, 'Miaunel si balanel 2'),
(3, 'Mihai Eminescu');
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `books`
--
CREATE TABLE `books` (
`id` int(11) NOT NULL,
`author_id` int(11) NOT NULL,
`publHouse_id` int(11) NOT NULL,
`year` year(4) NOT NULL,
`body` tinytext NOT NULL,
`title` varchar(50) NOT NULL,
`posting_date` date NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `books`:
-- `author_id`
-- `authors` -> `id`
-- `publHouse_id`
-- `publishinghouses` -> `id`
--
--
-- Eliminarea datelor din tabel `books`
--
INSERT INTO `books` (`id`, `author_id`, `publHouse_id`, `year`, `body`, `title`, `posting_date`) VALUES
(2, 2, 1, 2006, 'Carte de colorat pentru copii cu flori si fluturi', 'Desene pentru copii', '2020-05-21'),
(3, 3, 3, 2014, 'o descriere la carte,da', 'carte2', '2020-06-01');
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `booksgenres`
--
CREATE TABLE `booksgenres` (
`book_id` int(11) NOT NULL,
`genre_name` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `booksgenres`:
-- `book_id`
-- `books` -> `id`
-- `genre_name`
-- `genres` -> `name`
--
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `comments`
--
CREATE TABLE `comments` (
`id` int(11) NOT NULL,
`body` varchar(200) NOT NULL,
`id_article` int(11) NOT NULL,
`type` enum('book','review') NOT NULL,
`user_id` int(11) NOT NULL,
`posted_at` date NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `comments`:
-- `user_id`
-- `users` -> `id`
--
--
-- Eliminarea datelor din tabel `comments`
--
INSERT INTO `comments` (`id`, `body`, `id_article`, `type`, `user_id`, `posted_at`) VALUES
(1, 'comment updated', 2, 'book', 2, '0000-00-00'),
(3, 'imi place cartea, super faina, recomand', 2, 'book', 2, '2020-05-29'),
(4, 'comentariu review', 0, 'review', 2, '2020-05-29'),
(5, 'comentariu review', 3, 'review', 2, '2020-05-29'),
(7, 'comentez si eu pe aici', 2, 'book', 3, '2020-06-01'),
(8, 'comentez si eu pe aici pramandhsndn', 2, 'book', 3, '2020-06-01');
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `genres`
--
CREATE TABLE `genres` (
`id` int(11) NOT NULL,
`name` varchar(30) NOT NULL,
`parent` varchar(30) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `genres`:
--
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `publishinghouses`
--
CREATE TABLE `publishinghouses` (
`id` int(11) NOT NULL,
`name` varchar(50) NOT NULL,
`country` varchar(30) DEFAULT NULL,
`founded` year(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `publishinghouses`:
--
--
-- Eliminarea datelor din tabel `publishinghouses`
--
INSERT INTO `publishinghouses` (`id`, `name`, `country`, `founded`) VALUES
(1, 'Paralela 45', 'Romania', 1986),
(3, 'Timpul', 'Romania', 1967);
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `reviews`
--
CREATE TABLE `reviews` (
`id` int(11) NOT NULL,
`title` varchar(50) NOT NULL,
`body` tinytext NOT NULL,
`book_id` int(11) DEFAULT NULL,
`user_id` int(11) NOT NULL,
`posting_date` date NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `reviews`:
-- `user_id`
-- `users` -> `id`
--
--
-- Eliminarea datelor din tabel `reviews`
--
INSERT INTO `reviews` (`id`, `title`, `body`, `book_id`, `user_id`, `posting_date`) VALUES
(2, 'Miau', 'dfgdhdhdhdfh', 0, 3, '2020-05-24'),
(4, 'Review pt Carticica', 'Mi-a placut aceasta Carte de colorat pentru copii cu flori si fluturi', 0, 3, '2020-05-24'),
(9, 'minunat review', 'am scris sho un review,da, iacasa', 2, 7, '2020-06-01'),
(10, 'minunat review', 'am scris sho un review,da, iacasa', 2, 7, '2020-06-01'),
(11, 'minunat review', 'am scris sho un review,da, iacasa', 2, 7, '2020-06-03');
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(30) NOT NULL,
`password` varchar(50) NOT NULL,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(30) NOT NULL,
`email` varchar(30) NOT NULL,
`birthday` date NOT NULL,
`gender` enum('M','F','-') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `users`:
--
--
-- Eliminarea datelor din tabel `users`
--
INSERT INTO `users` (`id`, `username`, `password`, `first_name`, `last_name`, `email`, `birthday`, `gender`) VALUES
(1, 'mariuca20', '*ACC4557F5BE7A85020E3701B63B184E90B24DC7C', 'maria', 'popa', 'jojo20202@gmail.com', '2020-05-12', 'F'),
(2, 'jojo', '', 'Geo', 'Bobitx', 'jojo20202@gmail.com', '0000-00-00', ''),
(3, 'jojo20202', '*3C5913F2D988CE3333403A2221721C2B13E5E0C5', 'Georgi', 'Bobitz', 'miau@yahoo.com', '1998-05-20', 'M'),
(7, 'miau', '*FCBAB14F2742234BDFB4A7B98921125FC0C76FA7', 'balanel', 'balanel', 'maieu@gogu.com', '0000-00-00', 'M'),
(8, 'miau2', '*FCBAB14F2742234BDFB4A7B98921125FC0C76FA7', 'balanel2', 'balanel2', 'maie2u@gogu.com', '2019-02-03', 'M');
-- --------------------------------------------------------
--
-- Structură tabel pentru tabel `votes`
--
CREATE TABLE `votes` (
`article_id` int(11) NOT NULL,
`value` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`article_type` enum('book','review') NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- RELAȚII PENTRU TABELE `votes`:
-- `article_id`
-- `reviews` -> `id`
--
--
-- Eliminarea datelor din tabel `votes`
--
INSERT INTO `votes` (`article_id`, `value`, `user_id`, `article_type`) VALUES
(2, 5, 3, 'review'),
(2, 5, 3, 'review');
--
-- Indexuri pentru tabele eliminate
--
--
-- Indexuri pentru tabele `authors`
--
ALTER TABLE `authors`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `author_name_unique` (`name`);
--
-- Indexuri pentru tabele `books`
--
ALTER TABLE `books`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_author` (`author_id`),
ADD KEY `fk_publHouse` (`publHouse_id`);
--
-- Indexuri pentru tabele `booksgenres`
--
ALTER TABLE `booksgenres`
ADD KEY `fk_book` (`book_id`),
ADD KEY `fk_genre` (`genre_name`);
--
-- Indexuri pentru tabele `comments`
--
ALTER TABLE `comments`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_user_id` (`user_id`);
--
-- Indexuri pentru tabele `genres`
--
ALTER TABLE `genres`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_genre` (`name`);
--
-- Indexuri pentru tabele `publishinghouses`
--
ALTER TABLE `publishinghouses`
ADD PRIMARY KEY (`id`);
--
-- Indexuri pentru tabele `reviews`
--
ALTER TABLE `reviews`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_user` (`user_id`);
--
-- Indexuri pentru tabele `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `unique_username` (`username`);
--
-- Indexuri pentru tabele `votes`
--
ALTER TABLE `votes`
ADD KEY `fk_review` (`article_id`);
--
-- AUTO_INCREMENT pentru tabele eliminate
--
--
-- AUTO_INCREMENT pentru tabele `authors`
--
ALTER TABLE `authors`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT pentru tabele `books`
--
ALTER TABLE `books`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pentru tabele `comments`
--
ALTER TABLE `comments`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT pentru tabele `genres`
--
ALTER TABLE `genres`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pentru tabele `publishinghouses`
--
ALTER TABLE `publishinghouses`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pentru tabele `reviews`
--
ALTER TABLE `reviews`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT pentru tabele `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- Constrângeri pentru tabele eliminate
--
--
-- Constrângeri pentru tabele `books`
--
ALTER TABLE `books`
ADD CONSTRAINT `fk_author` FOREIGN KEY (`author_id`) REFERENCES `authors` (`id`),
ADD CONSTRAINT `fk_publHouse` FOREIGN KEY (`publHouse_id`) REFERENCES `publishinghouses` (`id`);
--
-- Constrângeri pentru tabele `booksgenres`
--
ALTER TABLE `booksgenres`
ADD CONSTRAINT `fk_book` FOREIGN KEY (`book_id`) REFERENCES `books` (`id`),
ADD CONSTRAINT `fk_genre` FOREIGN KEY (`genre_name`) REFERENCES `genres` (`name`);
--
-- Constrângeri pentru tabele `comments`
--
ALTER TABLE `comments`
ADD CONSTRAINT `fk_user_id` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Constrângeri pentru tabele `reviews`
--
ALTER TABLE `reviews`
ADD CONSTRAINT `fk_user` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`);
--
-- Constrângeri pentru tabele `votes`
--
ALTER TABLE `votes`
ADD CONSTRAINT `fk_review` FOREIGN KEY (`article_id`) REFERENCES `reviews` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
select
count(distinct(c2.salesid))
from
ANALYTICS.Salesline_based_shipping sl
join (select
salesid,
'Y' as InCSA,
it.itemname
from raw_sources.salesline sl
join raw_sources.inventtable it on it.itemid = sl.itemid and it.itemtype = 2 and it.itemid not in ('CS_Ref_NoProcess','CS_Ref_NoShipRep','CS_Ref_RepDmg','CS_Ref_tax','Sales Tax','Return')
where sl.createdby not in ('okla4', 'okl.a', 'ohl.1')
and date(sl.createddatetime) >= '2013-01-01'
)c2 on c2.salesid = sl.salesid
where datetime_order between '2014-01-01' and '2015-01-01'
|
-- --------------------------------------------------------
--
-- Table structure for table `nepse_stock_type`
--
DROP TABLE IF EXISTS `nepse_stock_type`;
CREATE TABLE `nepse_stock_type` (
`stock_type_id` int(1) NOT NULL,
`stock_type` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `nepse_stock_type`
--
INSERT INTO `nepse_stock_type` (`stock_type_id`, `stock_type`) VALUES
(1, 'Shares'),
(4, 'Bonds'),
(5, 'Debentures'),
(6, 'Mutual Fund');
|
INSERT INTO core_table_relation(remarks, table1, table2, field1, field2, fkreltype) VALUES
('core_table->core_field', 'core_table', 'core_field', 'id', 'fktable',2),
('core_field_type->core_field', 'core_field_type', 'core_field', 'id', 'fkfieldtype',2);
|
DELIMITER //
CREATE PROCEDURE transfer_money(IN id_sender INT, IN id_recipient INT, IN amount DOUBLE)
transfer_money:BEGIN
-- Varmistetaan, että vastaanottajan tili on olemassa ja ei jatketa, jos ei.
IF NOT EXISTS (select 1 FROM account where id_account = id_recipient) THEN
SELECT "Recipient account does not exist";
LEAVE transfer_money;
END IF;
-- Selvitetään lähettäjän tilinumero kortista
-- SELECT account.id_account into @sender from account join card on account.id_account = card.id_account where id_card = id_sender;
-- Poistutaan, jos yritetään siirtä negatiivisia summia rahaa.
-- Tätä ei käytännössä pitäisi tapahtua ja jo ohjelman pitäisi estää se,
-- mutta estetään se tässäkin varmuuden vuoksi.
IF(amount < 0) THEN
SELECT "You cannot transfer negative amounts of money";
LEAVE transfer_money;
END IF;
START transaction;
UPDATE account SET balance=balance-amount WHERE id_account=id_sender AND balance-amount>0;
SET @test=row_count();
IF(@test>0) THEN
UPDATE account SET balance=balance+amount WHERE id_account=id_recipient;
SET @test=row_count();
IF(@test > 0) THEN
COMMIT;
-- Merkitään tapahtumat account_action -tauluun
INSERT INTO account_action(id_account,amount,date,action_type) VALUES(id_sender,-amount,NOW(),'siirto');
INSERT INTO account_action(id_account,amount,date,action_type) VALUES(id_recipient,+amount,NOW(),'siirto');
ELSE
ROLLBACK;
END IF;
ELSE
ROLLBACK;
END IF;
END
//
DELIMITER ;
|
-- POR2019
SELECT * FROM [MJDB2019].dbo.POR2019
-- POR2018
SELECT * FROM [MJDB2018].dbo.POR2018
-- SHIPMENT
SELECT * FROM [MJSHIPMENT].dbo.SHIPMENT
-- GET PLATFORM FROM SHIP
SELECT DISTINCT SHIP.Platform FROM [MJSHIPMENT].dbo.SHIPMENT AS SHIP
-- GET POR DATA (MAKING THE PIVOT)
SELECT POR2019.YYYYWW, POR2019.Planning_Wk, POR2019.Qty
FROM [MJDB2019].dbo.POR2019 AS POR2019
WHERE POR2019.Platform = 'RUBY MOBILE '
-- GET SHIP DATA (FOR D)
SELECT SHIP.YYYYWW,SUM(SHIP.Total) AS SUM FROM [MJSHIPMENT].dbo.SHIPMENT AS SHIP
WHERE SHIP.Platform = 'RUBY MOBILE '
GROUP BY SHIP.YYYYWW
-- GET REQUIRED POR TABLE
SELECT POR2019.Planning_Wk, POR2019.YYYYWW, POR2019.Region, POR2019.MPA, SUM(POR2019.Qty) AS Qty, POR2019.QtyType
FROM [MJDB2019].dbo.POR2019 AS POR2019
WHERE POR2019.Program = 'RUBY MOBILE '
GROUP BY POR2019.Planning_Wk,POR2019.YYYYWW, POR2019.Region, POR2019.MPA, POR2019.QtyType
ORDER BY POR2019.Planning_Wk , POR2019.YYYYWW
-- GET REQUIRED SHIP TABLE
SELECT SHIP.YYYYWW, SHIP.Region,SHIP.MPA,SHIP.Total AS Qty, SHIP.QtyType FROM [MJSHIPMENT].dbo.SHIPMENT AS SHIP
WHERE SHIP.Platform = 'RUBY MOBILE '
-- GET DISTINCT POR2019.YYYYWW
SELECT DISTINCT POR2019.Planning_Wk FROM MJDB2019.dbo.POR2019
WHERE POR2019.Platform = 'RUBY MOBILE '
ORDER BY POR2019.Planning_Wk
--GET DISTINCT POR2019.Planning_wk STRIP
SELECT DISTINCT REPLACE(POR2019.Planning_Wk, 'W', '') AS Plan_Wk
FROM MJDB2019.dbo.POR2019 AS POR2019
WHERE POR2019.Platform = 'RUBY MOBILE '
GROUP BY POR2019.Planning_Wk
--GETTING SHIP INFO
SELECT SHIP.YYYYWW,SHIP.Region, SHIP.MPA, SHIP.Total, Ship.QtyType FROM [MJSHIPMENT].dbo.SHIPMENT AS SHIP
WHERE SHIP.Platform = 'RUBY MOBILE ' AND SHIP.YYYYWW <= 201902
ORDER BY SHIP.YYYYWW
|
CREATE PROCEDURE SP_SER_INSERT_PERSONNELMASTER(
@PersonnelID nvarchar(50),
@PersonnelName nvarchar(255),
@PersonnelType int,
@PhoneNo nvarchar(50),
@Address nvarchar(255),
@Email nvarchar(50),
@Performance int,
@NoofJobs int
)
AS
INSERT INTO PERSONNELMASTER
(PersonnelID,PersonnelName,PersonnelType,PhoneNo,Address,
E_mail,Performance,NoofJObs,Active)
VALUES(
@PersonnelID,
@PersonnelName,
@PersonnelType,
@PhoneNo,
@Address,
@Email,
@Performance,
ISnull(@NoofJobs,0),
1
)
|
.header ON
.mode column
CREATE TABLE users (id INTEGER PRIMARY KEY, campaign TEXT, signed_up_on TEXT);
CREATE TABLE payments (id INTEGER PRIMARY KEY, amount INTEGER, paid_on TEXT, user_id INTEGER, FOREIGN KEY(user_id) REFERENCES users(id));
INSERT INTO users(id, campaign, signed_up_on) VALUES (1, 'facebook', '2014-10-01');
INSERT INTO users(id, campaign, signed_up_on) VALUES (2, 'twitter', '2014-10-02');
INSERT INTO users(id, campaign, signed_up_on) VALUES (3, 'direct', '2014-10-02');
INSERT INTO users(id, campaign, signed_up_on) VALUES (4, 'facebook', '2014-10-03');
INSERT INTO users(id, campaign, signed_up_on) VALUES (5, 'organic', '2014-10-03');
INSERT INTO users(id, campaign, signed_up_on) VALUES (6, 'organic', '2014-10-03');
INSERT INTO users(id, campaign, signed_up_on) VALUES (7, 'organic', '2014-10-04');
INSERT INTO users(id, campaign, signed_up_on) VALUES (8, 'direct', '2014-10-05');
INSERT INTO users(id, campaign, signed_up_on) VALUES (9, 'twitter', '2014-10-05');
INSERT INTO users(id, campaign, signed_up_on) VALUES (10, 'organic', '2014-10-05');
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (1, 1, '2014-10-02', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (2, 1, '2014-10-03', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (3, 1, '2014-10-04', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (4, 1, '2014-10-05', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (5, 1, '2014-10-06', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (6, 1, '2014-10-07', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (7, 1, '2014-10-08', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (8, 1, '2014-10-09', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (9, 1, '2014-10-10', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (10, 1, '2014-10-11', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (11, 1, '2014-10-12', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (12, 1, '2014-10-13', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (13, 1, '2014-10-14', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (14, 1, '2014-10-15', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (15, 1, '2014-10-16', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (16, 1, '2014-10-17', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (17, 1, '2014-10-18', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (18, 1, '2014-10-19', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (19, 1, '2014-10-20', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (20, 1, '2014-10-21', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (21, 1, '2014-10-22', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (22, 1, '2014-10-23', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (23, 1, '2014-10-24', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (24, 1, '2014-10-25', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (25, 1, '2014-10-26', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (26, 1, '2014-10-27', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (27, 1, '2014-10-28', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (28, 1, '2014-10-29', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (29, 1, '2014-10-30', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (30, 1, '2014-10-31', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (31, 2, '2014-10-03', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (32, 2, '2014-10-04', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (33, 2, '2014-10-05', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (34, 2, '2014-10-06', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (35, 2, '2014-10-07', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (36, 2, '2014-10-08', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (37, 2, '2014-10-09', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (38, 2, '2014-10-10', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (39, 2, '2014-10-11', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (40, 2, '2014-10-12', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (41, 2, '2014-10-13', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (42, 2, '2014-10-14', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (43, 2, '2014-10-15', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (44, 2, '2014-10-16', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (45, 2, '2014-10-17', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (46, 2, '2014-10-18', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (47, 2, '2014-10-19', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (48, 2, '2014-10-20', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (49, 2, '2014-10-21', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (50, 2, '2014-10-22', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (51, 2, '2014-10-23', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (52, 2, '2014-10-24', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (53, 2, '2014-10-25', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (54, 2, '2014-10-26', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (55, 2, '2014-10-27', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (56, 2, '2014-10-28', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (57, 2, '2014-10-29', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (58, 2, '2014-10-30', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (59, 2, '2014-10-31', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (60, 2, '2014-11-01', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (61, 3, '2014-10-05', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (62, 3, '2014-10-06', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (63, 3, '2014-10-12', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (64, 3, '2014-10-22', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (65, 3, '2014-10-26', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (66, 4, '2014-10-05', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (67, 4, '2014-10-06', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (68, 4, '2014-10-07', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (69, 4, '2014-10-08', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (70, 4, '2014-10-09', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (71, 4, '2014-10-18', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (72, 4, '2014-10-19', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (73, 4, '2014-10-24', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (74, 4, '2014-10-28', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (75, 4, '2014-11-01', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (76, 4, '2014-11-02', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (77, 5, '2014-10-06', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (78, 5, '2014-10-07', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (79, 5, '2014-10-09', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (80, 5, '2014-10-10', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (81, 5, '2014-10-11', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (82, 5, '2014-10-12', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (83, 5, '2014-10-14', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (84, 5, '2014-10-16', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (85, 5, '2014-10-18', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (86, 5, '2014-10-22', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (87, 5, '2014-10-28', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (88, 5, '2014-11-01', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (89, 5, '2014-11-02', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (90, 6, '2014-10-04', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (91, 6, '2014-10-05', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (92, 6, '2014-10-06', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (93, 6, '2014-10-07', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (94, 6, '2014-10-08', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (95, 6, '2014-10-09', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (96, 6, '2014-10-10', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (97, 6, '2014-10-11', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (98, 6, '2014-10-12', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (99, 6, '2014-10-13', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (100, 6, '2014-10-14', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (101, 6, '2014-10-15', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (102, 6, '2014-10-16', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (103, 6, '2014-10-17', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (104, 6, '2014-10-18', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (105, 6, '2014-10-19', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (106, 6, '2014-10-20', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (107, 6, '2014-10-21', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (108, 6, '2014-10-22', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (109, 6, '2014-10-23', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (110, 6, '2014-10-24', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (111, 6, '2014-10-25', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (112, 6, '2014-10-26', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (113, 6, '2014-10-27', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (114, 6, '2014-10-28', 50);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (115, 6, '2014-10-29', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (116, 6, '2014-10-30', 100);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (117, 6, '2014-10-31', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (118, 6, '2014-11-01', 30);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (119, 6, '2014-11-02', 40);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (120, 7, '2014-10-07', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (121, 7, '2014-10-12', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (122, 7, '2014-10-16', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (123, 7, '2014-10-17', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (124, 7, '2014-10-19', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (125, 7, '2014-10-22', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (126, 7, '2014-10-23', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (127, 7, '2014-10-25', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (128, 7, '2014-11-03', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (129, 8, '2014-10-06', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (130, 8, '2014-10-08', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (131, 8, '2014-10-10', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (132, 8, '2014-10-12', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (133, 8, '2014-10-24', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (134, 8, '2014-10-25', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (135, 8, '2014-10-28', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (136, 8, '2014-10-30', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (137, 8, '2014-10-31', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (138, 8, '2014-11-02', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (139, 9, '2014-10-09', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (140, 9, '2014-10-10', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (141, 9, '2014-10-13', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (142, 9, '2014-10-15', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (143, 9, '2014-10-18', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (144, 9, '2014-10-20', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (145, 9, '2014-10-22', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (146, 9, '2014-10-27', 5);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (147, 9, '2014-11-01', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (148, 9, '2014-11-02', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (149, 10, '2014-10-06', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (150, 10, '2014-10-07', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (151, 10, '2014-10-10', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (152, 10, '2014-10-14', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (153, 10, '2014-10-18', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (154, 10, '2014-10-26', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (155, 10, '2014-10-30', 10);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (156, 10, '2014-11-03', 20);
INSERT INTO payments(id, user_id, paid_on, amount) VALUES (157, 10, '2014-11-04', 5);
|
create table usuario_xxx(id_usuario integer,nombre varchar2(40), edad integer, constraint pk_is_usuario primary key (id_usuario));
create or replace trigger disp_usuario_xxx before insert on usuario_xxx
for each row
begin
if :new .edad<18 then
--Esta es la excepcion
raise_application_error(-20001, 'Eres menor de edad');
end if;
end;
/
|
create or replace view v1_MQ_302 as
select * from (
select decode(nvl(jsde008,0),1,8,nvl(jsde008,0)) CZDE902 ,jsde202,a.de011,to_number(DE007) de007,jsde201,to_char(sysdate,'YYYY-MM-DD') JSDE206,hdde147 ,b.jsde955 DE042,b.de041,c.de084 ,c.de083,nvl(jsde802,'99') JSDE702,nvl(jsde821,'基本支出') JSDE701,zbde151 DE151,zbjsde901 JSDE901,de181 ,de195 ,de193 JSDE340,de200,decode(a.de011,czde183,1,9) JSDE931,substr(a.de011,1,4)||'-12-31' JSDE311 from v1_jh001_all a,
czcs041 b,cs083 c,jscs009 d where a.DE011 = b.de011 and b.de022 = a.de022 and a.de022 = 110108 and b.de042 = a.de042 and b.jsde070 = 2 and c.de011 = a.de011 and c.de022 = a.de022 and c.de084 = a.de084
and d.de011 = a.de011 and d.de042 = a.de042 and d.jsde004 = 4)
/*
JSDE202 财政批次号
DE011 预算年份
DE007 预算月份
JSDE201 编号(支付明细ID)
JSDE206 发出日期
HDDE147 授权支付额度号
DE042 预算单位代码
DE041 预算单位名称
DE084 科目编码
DE083 科目名称
JSDE702 项目代码
JSDE701 项目名称
DE151 预算指标文号
JSDE901 用途
DE181 授权额度(金额)
DE195 单位零余额帐号
JSDE340 单位零余额开户行
DE200 支付类别
JSDE931 资金性质
JSDE311 截止日期
CZDE902 标志类型 0-正常下达 8—注销,9—年终注销
create by xiazhong 2012.12.11
*/
|
USE myemployees;
#1.查询各job_id的员工工资的最大值,最小值,平均值,总和,并按job_id升序
SELECT MAX(salary),MIN(salary),AVG(salary),SUM(salary),job_id
FROM employees
GROUP BY job_id
ORDER BY job_id;
#3.查询各个管理者手下员工的最低工资,其中最低工资不能低于6000,没有管理者的员工不计算在内
#“Where” 是一个约束声明,使用Where来约束来之数据库的数据,Where是在结果返回之前起作用的,且Where中不能使用聚合函数。
#“Having”是一个过滤声明,是在查询返回结果集以后对查询结果进行的过滤操作,在Having中可以使用聚合函数。
SELECT MIN(salary),manager_id
FROM employees
WHERE manager_id IS NOT NULL
GROUP BY manager_id
HAVING MIN(salary) >= 6000;
#4.查询所有部门的编号,员工数量和工资平均值,并按平均工资降序
SELECT department_id,COUNT(*) 员工数量,AVG(salary) 平均工资
FROM employees
GROUP BY department_id
ORDER BY 平均工资 DESC;
#5.选择具有各个job_id的员工人数
SELECT COUNT(*) 个数, job_id
FROM employees
GROUP BY job_id;
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 12 mai 2021 à 10:00
-- Version du serveur : 5.7.24
-- Version de PHP : 7.3.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 */;
--
-- Base de données : `supdeco`
--
-- --------------------------------------------------------
--
-- Structure de la table `anneeetude`
--
DROP TABLE IF EXISTS `anneeetude`;
CREATE TABLE IF NOT EXISTS `anneeetude` (
`id_anneeEtude` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantcyclepro` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`valeur_annee` smallint(6) NOT NULL,
PRIMARY KEY (`id_anneeEtude`,`id_etudiantbts`),
KEY `id_etudiantbts` (`id_etudiantbts`),
KEY `id_etudiantcyclepro` (`id_etudiantcyclepro`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `id_etudiantdba` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `article`
--
DROP TABLE IF EXISTS `article`;
CREATE TABLE IF NOT EXISTS `article` (
`id_article` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_users` mediumint(8) UNSIGNED NOT NULL,
`titre` varchar(60) NOT NULL,
`contenu` text NOT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_article`),
KEY `id_users` (`id_users`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `article_categorie`
--
DROP TABLE IF EXISTS `article_categorie`;
CREATE TABLE IF NOT EXISTS `article_categorie` (
`id_article` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_categorie` mediumint(8) UNSIGNED NOT NULL,
PRIMARY KEY (`id_article`,`id_categorie`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `article_motcle`
--
DROP TABLE IF EXISTS `article_motcle`;
CREATE TABLE IF NOT EXISTS `article_motcle` (
`id_article` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_motcle` mediumint(8) UNSIGNED NOT NULL,
PRIMARY KEY (`id_article`,`id_motcle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `categorie`
--
DROP TABLE IF EXISTS `categorie`;
CREATE TABLE IF NOT EXISTS `categorie` (
`id_categorie` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`nom_categorie` varchar(60) NOT NULL,
PRIMARY KEY (`id_categorie`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `commentaires`
--
DROP TABLE IF EXISTS `commentaires`;
CREATE TABLE IF NOT EXISTS `commentaires` (
`id_commentaire` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_article` mediumint(8) UNSIGNED NOT NULL,
`contenu` text NOT NULL,
`email` varchar(60) NOT NULL,
`pseudo` varchar(60) NOT NULL,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`id_commentaire`),
KEY `id_article` (`id_article`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `competence`
--
DROP TABLE IF EXISTS `competence`;
CREATE TABLE IF NOT EXISTS `competence` (
`id_competence` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`competence1` varchar(200) NOT NULL,
`competence2` varchar(200) NOT NULL,
`competence3` varchar(200) NOT NULL,
`competence4` varchar(200) NOT NULL,
`competence5` varchar(200) NOT NULL,
PRIMARY KEY (`id_competence`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `id_etudiantdba` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `compositiondossier`
--
DROP TABLE IF EXISTS `compositiondossier`;
CREATE TABLE IF NOT EXISTS `compositiondossier` (
`id_compositiondossier` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantcyclepro` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`description_dossier1` text NOT NULL,
`description_dossier2` text NOT NULL,
`description_dossier3` text NOT NULL,
`description_dossier4` text NOT NULL,
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL,
PRIMARY KEY (`id_compositiondossier`,`id_etudiantbts`),
KEY `id_etudiantbts` (`id_etudiantbts`),
KEY `id_etudiantcyclepro` (`id_etudiantcyclepro`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `id_etudiantdba` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `conditionadmission`
--
DROP TABLE IF EXISTS `conditionadmission`;
CREATE TABLE IF NOT EXISTS `conditionadmission` (
`id_condition` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantcyclepro` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`condition1` text NOT NULL,
`condition2` text NOT NULL,
`condition3` text NOT NULL,
`condition4` text NOT NULL,
PRIMARY KEY (`id_condition`,`id_etudiantbts`),
KEY `id_etudiantbts` (`id_etudiantbts`),
KEY `id_etudiantcyclepro` (`id_etudiantcyclepro`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `id_etudiantdba` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `cycle`
--
DROP TABLE IF EXISTS `cycle`;
CREATE TABLE IF NOT EXISTS `cycle` (
`id_cycle` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`nom_cycle` varchar(60) NOT NULL,
PRIMARY KEY (`id_cycle`)
) ENGINE=InnoDB AUTO_INCREMENT=46 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `cycle`
--
INSERT INTO `cycle` (`id_cycle`, `nom_cycle`) VALUES
(30, 'cycle professionnel'),
(31, 'Brevet de technicien supérieur(BTS)'),
(32, 'Brevet de technicien supérieur(BTS)'),
(33, 'Brevet de technicien supérieur(BTS)'),
(34, 'Brevet de technicien supérieur(BTS)'),
(35, 'Brevet de technicien supérieur(BTS)'),
(36, 'Brevet de technicien supérieur(BTS)'),
(38, 'Brevet de technicien supérieur(BTS)'),
(39, 'Brevet de technicien supérieur(BTS)'),
(40, 'Brevet de technicien supérieur(BTS)'),
(41, 'Brevet de technicien supérieur(BTS)'),
(42, 'Brevet de technicien supérieur(BTS)'),
(43, 'Brevet de technicien supérieur(BTS)'),
(44, 'Brevet de technicien supérieur(BTS)'),
(45, 'Brevet de technicien supérieur(BTS)');
-- --------------------------------------------------------
--
-- Structure de la table `diplomeobtenu`
--
DROP TABLE IF EXISTS `diplomeobtenu`;
CREATE TABLE IF NOT EXISTS `diplomeobtenu` (
`id_diplomeObtenu` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantcyclepro` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`nom_diplome` varchar(60) NOT NULL,
PRIMARY KEY (`id_diplomeObtenu`,`id_etudiantbts`),
KEY `id_etudiantbts` (`id_etudiantbts`),
KEY `id_etudiantcyclepro` (`id_etudiantcyclepro`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `diplomeobtenu_fk3` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `etudiantbts`
--
DROP TABLE IF EXISTS `etudiantbts`;
CREATE TABLE IF NOT EXISTS `etudiantbts` (
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`nom` varchar(60) NOT NULL,
`prenom` varchar(60) NOT NULL,
`date_naissance` date NOT NULL,
`lieu_naissance` varchar(60) NOT NULL,
`situation_familial` varchar(60) NOT NULL,
`sexe` varchar(20) NOT NULL,
`adresse` varchar(60) NOT NULL,
`tel_etudiant` int(10) UNSIGNED NOT NULL,
`quartier` varchar(60) NOT NULL,
`tel_parent` int(10) UNSIGNED NOT NULL,
`region_origine` varchar(60) NOT NULL,
`email` varchar(60) DEFAULT NULL,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
PRIMARY KEY (`id_etudiantbts`,`id_cycle`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `etudiantbts`
--
INSERT INTO `etudiantbts` (`id_etudiantbts`, `nom`, `prenom`, `date_naissance`, `lieu_naissance`, `situation_familial`, `sexe`, `adresse`, `tel_etudiant`, `quartier`, `tel_parent`, `region_origine`, `email`, `id_cycle`) VALUES
(6, 'kamto', 'valentin', '1997-06-02', 'ebolowa', 'marier', 'feminin', 'ngousso237', 689562314, 'eleveur', 656234879, 'ouest', 'kamtovalentin@gmail.com', 30),
(8, 'souffo', 'jonathan', '1997-06-09', 'yaounde', 'celibataire', 'masculin', '56980', 693124557, 'nkoa-bang', 698532415, 'garoua', 'jonathan@gmail.com', 38),
(9, 'souffo', 'jonathan', '1997-06-09', 'yaounde', 'celibataire', 'masculin', '56980', 693124557, 'nkoa-bang', 698532415, 'garoua', 'jonathan@gmail.com', 39),
(10, 'souffo', 'jonathan', '1997-06-09', 'yaounde', 'celibataire', 'masculin', '56980', 693124557, 'nkoa-bang', 698532415, 'garoua', 'jonathan@gmail.com', 40),
(11, 'souffo', 'jonathan', '1997-06-09', 'yaounde', 'celibataire', 'masculin', '56980', 693124557, 'nkoa-bang', 698532415, 'garoua', 'jonathan@gmail.com', 41),
(12, 'julien ', 'kaptue', '1999-07-09', 'yaounde', 'celibataire', 'masculin', 'Avenue kennedy', 698453612, 'omnisport', 697456723, 'Yaounde', 'kengnefranklin98@gmail.com', 42),
(13, 'julien ', 'kaptue', '1999-07-09', 'yaounde', 'celibataire', 'masculin', 'Avenue kennedy', 698453612, 'omnisport', 697456723, 'Yaounde', 'kengnefranklin98@gmail.com', 43),
(14, 'kamdem', 'honorer', '1996-08-09', 'yaounde', 'celibataire', 'masculin', 'Manguier237', 698754324, 'essos', 678905463, 'ouest', 'kengnefranklin98@gmail.com', 44),
(15, 'emvoutou', 'desirer', '2004-05-09', 'yaounde', 'celibataire', 'masculin', 'Avenuekennedy237', 678904532, 'anguissa', 698074345, 'centre', 'kengnefranklin98@gmail.com', 45);
-- --------------------------------------------------------
--
-- Structure de la table `etudiantcyclepro`
--
DROP TABLE IF EXISTS `etudiantcyclepro`;
CREATE TABLE IF NOT EXISTS `etudiantcyclepro` (
`id_etudiantcyclepro` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nometudiant` varchar(60) NOT NULL,
`prenometudiant` varchar(60) NOT NULL,
`date_naissance` date NOT NULL,
`lieu_naissance` varchar(60) NOT NULL,
`situation_familial` varchar(60) NOT NULL,
`sexe` char(15) NOT NULL,
`addresse` varchar(60) NOT NULL,
`tel_etudiant` int(10) UNSIGNED NOT NULL,
`quartier` varchar(60) NOT NULL,
`tel_parent` int(10) UNSIGNED NOT NULL,
`email` varchar(60) DEFAULT 'pas de mail',
PRIMARY KEY (`id_etudiantcyclepro`,`id_cycle`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `etudiantdba`
--
DROP TABLE IF EXISTS `etudiantdba`;
CREATE TABLE IF NOT EXISTS `etudiantdba` (
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nom` varchar(60) NOT NULL,
`prenom` varchar(60) NOT NULL,
`date_naissance` date NOT NULL,
`situation_familial` varchar(100) NOT NULL DEFAULT 'Celibataire',
`sexe` varchar(20) NOT NULL,
`adresse` varchar(60) DEFAULT NULL,
`tel_etudiant` smallint(6) NOT NULL,
`quartier` varchar(60) NOT NULL,
`tel_parent` smallint(6) NOT NULL,
`region_origine` varchar(60) NOT NULL,
`email` varchar(60) NOT NULL,
`ville_naissance` varchar(60) NOT NULL,
`pays_naissance` varchar(60) NOT NULL,
`nationalite` varchar(60) NOT NULL DEFAULT 'Camerounaise',
PRIMARY KEY (`id_etudiantdba`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `etudiantgrandeecole`
--
DROP TABLE IF EXISTS `etudiantgrandeecole`;
CREATE TABLE IF NOT EXISTS `etudiantgrandeecole` (
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nom` varchar(60) NOT NULL,
`prenom` varchar(60) NOT NULL,
`date_naissance` date NOT NULL,
`situation_familial` varchar(60) NOT NULL,
`sexe` char(15) NOT NULL,
`addresse_postal` varchar(30) DEFAULT NULL,
`tel_etudiant` mediumint(8) UNSIGNED NOT NULL,
`quartier` varchar(60) NOT NULL,
`tel_parent` mediumint(8) UNSIGNED NOT NULL,
`region_origine` varchar(60) NOT NULL,
`email` varchar(60) NOT NULL,
`ville_naissance` varchar(60) DEFAULT NULL,
`pays_naissance` varchar(60) DEFAULT NULL,
`nationalité` varchar(60) NOT NULL,
PRIMARY KEY (`id_etudiantgrandeecole`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `experienceprofessionnel`
--
DROP TABLE IF EXISTS `experienceprofessionnel`;
CREATE TABLE IF NOT EXISTS `experienceprofessionnel` (
`id_experiencepro` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`nom_entreprise` varchar(60) NOT NULL,
`fonction_occuper` varchar(60) NOT NULL,
`type_contrat` varchar(60) NOT NULL,
`duree_contrat` varchar(10) DEFAULT NULL,
`description_poste` text NOT NULL,
PRIMARY KEY (`id_experiencepro`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `id_etudiantdba` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `filierebachelor`
--
DROP TABLE IF EXISTS `filierebachelor`;
CREATE TABLE IF NOT EXISTS `filierebachelor` (
`id_filierebachelor` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nom_filiere` varchar(60) NOT NULL,
PRIMARY KEY (`id_filierebachelor`),
KEY `filierebachelor_fk` (`id_cycle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `filierebts`
--
DROP TABLE IF EXISTS `filierebts`;
CREATE TABLE IF NOT EXISTS `filierebts` (
`id_filierebts` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nom_filierebts` varchar(60) NOT NULL,
PRIMARY KEY (`id_filierebts`,`id_cycle`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB AUTO_INCREMENT=42 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `filierebts`
--
INSERT INTO `filierebts` (`id_filierebts`, `id_cycle`, `nom_filierebts`) VALUES
(26, 30, 'CARRIERES JURIDIQUES'),
(27, 31, 'COMMERCE-VENTE'),
(28, 32, 'COMMERCE-VENTE'),
(29, 33, 'COMMERCE-VENTE'),
(30, 34, 'COMMERCE-VENTE'),
(31, 35, 'COMMERCE-VENTE'),
(32, 36, 'COMMERCE-VENTE'),
(34, 38, 'CARRIERES JURIDIQUES'),
(35, 39, 'CARRIERES JURIDIQUES'),
(36, 40, 'CARRIERES JURIDIQUES'),
(37, 41, 'CARRIERES JURIDIQUES'),
(38, 42, 'GESTION'),
(39, 43, 'GESTION'),
(40, 44, 'GESTION'),
(41, 45, 'GESTION');
-- --------------------------------------------------------
--
-- Structure de la table `filierecyclepro`
--
DROP TABLE IF EXISTS `filierecyclepro`;
CREATE TABLE IF NOT EXISTS `filierecyclepro` (
`id_filierecyclepro` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nom_filiere` varchar(60) NOT NULL,
PRIMARY KEY (`id_filierecyclepro`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `filieredba`
--
DROP TABLE IF EXISTS `filieredba`;
CREATE TABLE IF NOT EXISTS `filieredba` (
`id_filieredba` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nom_filieredba` varchar(60) NOT NULL,
PRIMARY KEY (`id_filieredba`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `filieregrandeecole`
--
DROP TABLE IF EXISTS `filieregrandeecole`;
CREATE TABLE IF NOT EXISTS `filieregrandeecole` (
`id_filieregrandeecole` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_cycle` mediumint(8) UNSIGNED NOT NULL,
`nom_filiere` varchar(60) NOT NULL,
PRIMARY KEY (`id_filieregrandeecole`),
KEY `id_cycle` (`id_cycle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `formationetudiantbts`
--
DROP TABLE IF EXISTS `formationetudiantbts`;
CREATE TABLE IF NOT EXISTS `formationetudiantbts` (
`id_formation` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL,
`annee_obtention` date NOT NULL,
`diplome_preparer` varchar(250) NOT NULL,
`pays_origine_diplome` varchar(250) NOT NULL,
`nom_etablissement` varchar(250) NOT NULL,
PRIMARY KEY (`id_formation`),
KEY `fk_etudiantbts_formationbts` (`id_etudiantbts`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `formationetudiantbts`
--
INSERT INTO `formationetudiantbts` (`id_formation`, `id_etudiantbts`, `annee_obtention`, `diplome_preparer`, `pays_origine_diplome`, `nom_etablissement`) VALUES
(3, 6, '2005-05-03', 'licence', 'nigeria', 'lycee bilingue'),
(11, 8, '2015-06-05', 'Bac C', 'cameroun', ''),
(12, 8, '2015-06-05', 'Bac C', 'cameroun', ''),
(13, 9, '2015-06-05', 'Bac C', 'cameroun', ''),
(14, 9, '2015-06-05', 'Bac C', 'cameroun', ''),
(15, 10, '2015-06-05', 'Bac C', 'cameroun', ''),
(17, 11, '2015-06-05', 'Bac C', 'cameroun', ''),
(18, 12, '2015-03-09', 'bac c', 'Cameroun', 'lycee bilingue de yaoundé'),
(20, 13, '2015-03-09', 'bac c', 'Cameroun', 'lycee bilingue de yaoundé'),
(21, 14, '2012-03-08', 'Bac C', 'cameroun', 'lycee de domayo'),
(23, 15, '2010-04-07', 'Bac A', 'cameroun', 'lycee d\'elig essono'),
(24, 6, '2010-04-07', 'Bac A', 'cameroun', 'lycee d\'elig essono');
-- --------------------------------------------------------
--
-- Structure de la table `formationetudiantcyclepro`
--
DROP TABLE IF EXISTS `formationetudiantcyclepro`;
CREATE TABLE IF NOT EXISTS `formationetudiantcyclepro` (
`id_formationcyclepro` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL,
`annee_obtention` date NOT NULL,
`diplome_preparer` varchar(250) NOT NULL,
`pays_origine_diplome` varchar(205) NOT NULL,
`nom_etablissement` varchar(205) NOT NULL,
PRIMARY KEY (`id_formationcyclepro`),
KEY `fk_etudiantbts_formationcyclepro` (`id_etudiantbts`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `formationetudiantgdeecoleetdba`
--
DROP TABLE IF EXISTS `formationetudiantgdeecoleetdba`;
CREATE TABLE IF NOT EXISTS `formationetudiantgdeecoleetdba` (
`id_formation` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`date_obtention` date NOT NULL,
`diplome_preparer` varchar(100) NOT NULL,
`specialisation` varchar(100) NOT NULL,
`nom_etablissement` varchar(100) NOT NULL,
PRIMARY KEY (`id_formation`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `id_etudiantgrandeecole_2` (`id_etudiantgrandeecole`),
KEY `id_etudiantdba` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `image1`
--
DROP TABLE IF EXISTS `image1`;
CREATE TABLE IF NOT EXISTS `image1` (
`id_image1` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_article` mediumint(8) UNSIGNED NOT NULL,
`nom_image` varchar(60) NOT NULL,
PRIMARY KEY (`id_image1`),
KEY `id_article` (`id_article`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `image_bts`
--
DROP TABLE IF EXISTS `image_bts`;
CREATE TABLE IF NOT EXISTS `image_bts` (
`id_image` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantbts` mediumint(8) UNSIGNED NOT NULL,
`path_image` varchar(250) NOT NULL,
PRIMARY KEY (`id_image`),
KEY `id_etudiantbts` (`id_etudiantbts`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `image_bts`
--
INSERT INTO `image_bts` (`id_image`, `id_etudiantbts`, `path_image`) VALUES
(1, 10, '08b5d344920e43b5b3b93b47cc90ed0ajpg'),
(2, 11, '970437a1f5f53a05a889df1a2883ca3ejpg'),
(3, 12, '39e9bc109f20458c22c1cff7ecafe9d8jpg'),
(4, 13, '36d1f5d027f6d98ea68151185d88a3e9jpg'),
(5, 14, 'ed21ae8e55af3ebe56eaffe666080a26jpg'),
(6, 15, '78ffa9e22634b8947f73129e265c4487jpg');
-- --------------------------------------------------------
--
-- Structure de la table `mot_cles`
--
DROP TABLE IF EXISTS `mot_cles`;
CREATE TABLE IF NOT EXISTS `mot_cles` (
`id_motcle` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`motcle` varchar(20) NOT NULL,
PRIMARY KEY (`id_motcle`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `projetprofessionnel`
--
DROP TABLE IF EXISTS `projetprofessionnel`;
CREATE TABLE IF NOT EXISTS `projetprofessionnel` (
`id_projetpro` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_etudiantgrandeecole` mediumint(8) UNSIGNED NOT NULL,
`id_etudiantdba` mediumint(8) UNSIGNED NOT NULL,
`description_projetpro` text NOT NULL,
PRIMARY KEY (`id_projetpro`),
KEY `id_etudiantgrandeecole` (`id_etudiantgrandeecole`),
KEY `id_etudiantdba` (`id_etudiantdba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `specialitebachelor`
--
DROP TABLE IF EXISTS `specialitebachelor`;
CREATE TABLE IF NOT EXISTS `specialitebachelor` (
`id_specialitebachelor` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_filierebachelor` mediumint(8) UNSIGNED NOT NULL,
`nom_specialite` varchar(60) NOT NULL,
PRIMARY KEY (`id_specialitebachelor`),
KEY `specialitebachelor_fk` (`id_filierebachelor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `specialitebts`
--
DROP TABLE IF EXISTS `specialitebts`;
CREATE TABLE IF NOT EXISTS `specialitebts` (
`id_specialitebts` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_filierebts` mediumint(8) UNSIGNED NOT NULL,
`nom_specialitebts` varchar(60) NOT NULL,
PRIMARY KEY (`id_specialitebts`,`id_filierebts`),
KEY `id_filierebts` (`id_filierebts`)
) ENGINE=InnoDB AUTO_INCREMENT=49 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `specialitebts`
--
INSERT INTO `specialitebts` (`id_specialitebts`, `id_filierebts`, `nom_specialitebts`) VALUES
(33, 26, 'DOUANE ET TRANSIT'),
(34, 27, 'BANQUE ET FINANCE'),
(35, 28, 'BANQUE ET FINANCE'),
(36, 29, 'BANQUE ET FINANCE'),
(37, 30, 'BANQUE ET FINANCE'),
(38, 31, 'BANQUE ET FINANCE'),
(39, 32, 'BANQUE ET FINANCE'),
(41, 34, 'GESTION FISCALE'),
(42, 35, 'GESTION FISCALE'),
(43, 36, 'GESTION FISCALE'),
(44, 37, 'GESTION FISCALE'),
(45, 38, 'BANQUE ET FINANCE'),
(46, 39, 'BANQUE ET FINANCE'),
(47, 40, 'GESTION DES RESSOURCES HUMAINES'),
(48, 41, 'GESTION LOGISTIQUE ET TRANSPORT');
-- --------------------------------------------------------
--
-- Structure de la table `specialitecyclepro`
--
DROP TABLE IF EXISTS `specialitecyclepro`;
CREATE TABLE IF NOT EXISTS `specialitecyclepro` (
`id_specialitecyclepro` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_filierecyclepro` mediumint(8) UNSIGNED NOT NULL,
`nom_specialitecyclepro` varchar(60) NOT NULL,
PRIMARY KEY (`id_specialitecyclepro`),
KEY `id_filierecyclepro` (`id_filierecyclepro`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `specialitedba`
--
DROP TABLE IF EXISTS `specialitedba`;
CREATE TABLE IF NOT EXISTS `specialitedba` (
`id_specialitedba` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_filieredba` mediumint(8) UNSIGNED NOT NULL,
`nom_specialitedba` varchar(60) NOT NULL,
PRIMARY KEY (`id_specialitedba`),
KEY `id_filieredba` (`id_filieredba`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `specialitegrandeecole`
--
DROP TABLE IF EXISTS `specialitegrandeecole`;
CREATE TABLE IF NOT EXISTS `specialitegrandeecole` (
`id_specialitegrandeecole` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_filieregrandeecole` mediumint(8) UNSIGNED NOT NULL,
`nom_specialitegrandeecole` varchar(100) NOT NULL,
PRIMARY KEY (`id_specialitegrandeecole`),
KEY `id_filieregrandeecole` (`id_filieregrandeecole`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id_users` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(250) NOT NULL,
`email` varchar(60) NOT NULL,
`roles` json NOT NULL,
`pass` varchar(250) NOT NULL,
PRIMARY KEY (`id_users`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `users`
--
INSERT INTO `users` (`id_users`, `username`, `email`, `roles`, `pass`) VALUES
(4, 'rodondo237', 'wabo@gmail.com', '[\"ROLE_USER\"]', '$2y$10$RbEefdL1V5OTo7zHCMV58OoPs1Dy26wnn4EqmDqdHpa.pFKWywRBO'),
(5, 'rika237', 'rika@gmail.com', '[\"ROLE_USER\"]', '$2y$10$4LOu5/3rTuKSZU1b0dQOZOU6yqgHnTQgvEbl5g0A.TuJwYIZQSmQm'),
(6, 'rika237', 'rika@gmail.com', '[\"ROLE_USER\"]', '$2y$10$vDnfZmvUrWX9NwILCmY6Q.typq8fq8GL3XU5oBFUE69D5ATRB.tDK'),
(7, 'STEVE0000', 'kengnefranklin98@gmail.com', '[\"ROLE_ADMIN\"]', '$2y$10$9/AE658JKBqCgsDDcLKsjuhNsvhw8xBn7tjqI54/bKKLa7L/zE6B2'),
(8, 'franki450', 'kengne@gmail.com', '[\"ROLE_USER\"]', '$2y$10$MIX7zUCMEumRj7IRGnNsmuH.n8WqHexSkPcOhP6Bsv0cFWY4oed76'),
(9, 'calvin237', 'calvin@yahoo.fr', '[\"ROLE_USER\"]', '$2y$10$kqgup5KFIbuEebQ42sNKMuMjVf0QFEEf.b4xrGcOaqiYV/6XWmKcK');
-- --------------------------------------------------------
--
-- Structure de la table `videos`
--
DROP TABLE IF EXISTS `videos`;
CREATE TABLE IF NOT EXISTS `videos` (
`id_videos` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_article` mediumint(8) UNSIGNED NOT NULL,
`nom_video` varchar(60) NOT NULL,
PRIMARY KEY (`id_videos`),
KEY `id_article` (`id_article`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `anneeetude`
--
ALTER TABLE `anneeetude`
ADD CONSTRAINT `anneeetude_fk` FOREIGN KEY (`id_etudiantcyclepro`) REFERENCES `etudiantcyclepro` (`id_etudiantcyclepro`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `anneeetude_fk2` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `anneeetude_fk3` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `anneeetude_fk_1` FOREIGN KEY (`id_etudiantbts`) REFERENCES `etudiantbts` (`id_etudiantbts`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `article`
--
ALTER TABLE `article`
ADD CONSTRAINT `article_fk` FOREIGN KEY (`id_users`) REFERENCES `users` (`id_users`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `commentaires`
--
ALTER TABLE `commentaires`
ADD CONSTRAINT `commentaires_fk` FOREIGN KEY (`id_article`) REFERENCES `article` (`id_article`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `competence`
--
ALTER TABLE `competence`
ADD CONSTRAINT `competence_fk` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `competence_fk2` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `compositiondossier`
--
ALTER TABLE `compositiondossier`
ADD CONSTRAINT `compositiondossier_fk` FOREIGN KEY (`id_etudiantcyclepro`) REFERENCES `etudiantcyclepro` (`id_etudiantcyclepro`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `compositiondossier_fk1` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `compositiondossier_fk2` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `compositiondossier_fk_1` FOREIGN KEY (`id_etudiantbts`) REFERENCES `etudiantbts` (`id_etudiantbts`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `conditionadmission`
--
ALTER TABLE `conditionadmission`
ADD CONSTRAINT `condadmission_fk_1` FOREIGN KEY (`id_etudiantbts`) REFERENCES `etudiantbts` (`id_etudiantbts`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `conditionadmission_fk` FOREIGN KEY (`id_etudiantcyclepro`) REFERENCES `etudiantcyclepro` (`id_etudiantcyclepro`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `conditionadmission_fk1` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `conditionadmission_fk3` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `diplomeobtenu`
--
ALTER TABLE `diplomeobtenu`
ADD CONSTRAINT `diplomeobtenu_fk` FOREIGN KEY (`id_etudiantcyclepro`) REFERENCES `etudiantcyclepro` (`id_etudiantcyclepro`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `diplomeobtenu_fk2` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `diplomeobtenu_fk3` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `diplomeobtenu_fk_1` FOREIGN KEY (`id_etudiantbts`) REFERENCES `etudiantbts` (`id_etudiantbts`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `etudiantbts`
--
ALTER TABLE `etudiantbts`
ADD CONSTRAINT `etudiantbts_fk_1` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `etudiantcyclepro`
--
ALTER TABLE `etudiantcyclepro`
ADD CONSTRAINT `etudiantcyclepro_fk_1` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `etudiantdba`
--
ALTER TABLE `etudiantdba`
ADD CONSTRAINT `etudiantdba_fk` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `etudiantgrandeecole`
--
ALTER TABLE `etudiantgrandeecole`
ADD CONSTRAINT `etudiantgrandeecole_fk` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `experienceprofessionnel`
--
ALTER TABLE `experienceprofessionnel`
ADD CONSTRAINT `experienceprofessionnel_fk` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `experienceprofessionnel_fk2` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `filierebachelor`
--
ALTER TABLE `filierebachelor`
ADD CONSTRAINT `filierebachelor_fk` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`);
--
-- Contraintes pour la table `filierebts`
--
ALTER TABLE `filierebts`
ADD CONSTRAINT `filierebts_fk_1` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `filierecyclepro`
--
ALTER TABLE `filierecyclepro`
ADD CONSTRAINT `filierecyclepro_fk` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `filieredba`
--
ALTER TABLE `filieredba`
ADD CONSTRAINT `filieredba_fk` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `filieregrandeecole`
--
ALTER TABLE `filieregrandeecole`
ADD CONSTRAINT `filieregrandeecole_fk` FOREIGN KEY (`id_cycle`) REFERENCES `cycle` (`id_cycle`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `formationetudiantbts`
--
ALTER TABLE `formationetudiantbts`
ADD CONSTRAINT `fk_etudiantbts_formationbts` FOREIGN KEY (`id_etudiantbts`) REFERENCES `etudiantbts` (`id_etudiantbts`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `formationetudiantcyclepro`
--
ALTER TABLE `formationetudiantcyclepro`
ADD CONSTRAINT `fk_etudiantbts_formationcyclepro` FOREIGN KEY (`id_etudiantbts`) REFERENCES `etudiantbts` (`id_etudiantbts`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `formationetudiantgdeecoleetdba`
--
ALTER TABLE `formationetudiantgdeecoleetdba`
ADD CONSTRAINT `formationetudiantgdeecoleetdba_fk` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `formationetudiantgdeecoleetdba_fk2` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `image1`
--
ALTER TABLE `image1`
ADD CONSTRAINT `image1_fk` FOREIGN KEY (`id_article`) REFERENCES `article` (`id_article`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `image_bts`
--
ALTER TABLE `image_bts`
ADD CONSTRAINT `image_bts_ibfk_1` FOREIGN KEY (`id_etudiantbts`) REFERENCES `etudiantbts` (`id_etudiantbts`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `projetprofessionnel`
--
ALTER TABLE `projetprofessionnel`
ADD CONSTRAINT `projetprofessionnel_fk` FOREIGN KEY (`id_etudiantgrandeecole`) REFERENCES `etudiantgrandeecole` (`id_etudiantgrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `projetprofessionnel_fk2` FOREIGN KEY (`id_etudiantdba`) REFERENCES `etudiantdba` (`id_etudiantdba`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `specialitebachelor`
--
ALTER TABLE `specialitebachelor`
ADD CONSTRAINT `specialitebachelor_fk` FOREIGN KEY (`id_filierebachelor`) REFERENCES `filierebachelor` (`id_filierebachelor`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `specialitebts`
--
ALTER TABLE `specialitebts`
ADD CONSTRAINT `specialitebts_fk_1` FOREIGN KEY (`id_filierebts`) REFERENCES `filierebts` (`id_filierebts`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `specialitecyclepro`
--
ALTER TABLE `specialitecyclepro`
ADD CONSTRAINT `specialitecyclepro_fk` FOREIGN KEY (`id_filierecyclepro`) REFERENCES `filierecyclepro` (`id_filierecyclepro`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `specialitedba`
--
ALTER TABLE `specialitedba`
ADD CONSTRAINT `specialitedba_fk` FOREIGN KEY (`id_filieredba`) REFERENCES `filieredba` (`id_filieredba`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `specialitegrandeecole`
--
ALTER TABLE `specialitegrandeecole`
ADD CONSTRAINT `specialitegrandeecole_fk` FOREIGN KEY (`id_filieregrandeecole`) REFERENCES `filieregrandeecole` (`id_filieregrandeecole`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Contraintes pour la table `videos`
--
ALTER TABLE `videos`
ADD CONSTRAINT `videos_fk` FOREIGN KEY (`id_article`) REFERENCES `article` (`id_article`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
--Ql: Retrieve the name and address of all employees who work for the 'Research' department.*/
SELECT fname,lname,address
FROM pcomp.Employee, pcomp.dept
WHERE dept.dname='Research' AND dept.dnum=Employee.dno;
--Q2: For every project located in 'Stafford', list the project number, the controlling department number, and the department manager's last name, address, and birthdate.*/
SELECT pno, dnum, Lname, address, bdate
FROM pcomp.proj, pcomp.Employee, pcomp.dept
WHERE dnum=dno AND MANAGERSSN=ssn AND ploc='Stafford';
--Q3: For each employee, retrieve the employee's first and last name and the first and last name of his or her immediate supervisor.*/
SELECT E.Fname, E.Lname, S.Fname, S.Lname
FROM princee.Employee AS E, princee.Employee AS S
WHERE E.SuperSSN=S.ssn;
--Q4: Select all EMPLOYEE SSN*/
SELECT ssn
FROM pcomp.Employee
--Q5: Select all combinations of EMPLOYEE SSN and DEPARTMENT DNAME*/
SELECT ssn,dname
FROM pcomp.Employee, pcomp.dept;
--Q6: retrieves all the attribute values of any EMPLOYEE who works in DEPARTMENT number 5.*/
SELECT *
FROM princee.Employee
WHERE dno=5;
--Q7: retrieves all the attributes of an EMPLOYEE and the attributes of the DEPARTMENTin which he or she works for every employee of the 'Research' department.*/
SELECT *
FROM pcomp.Employee, pcomp.dept
WHERE dname='Research' AND dno=dnum;
--Q8: Retrieve the salary of every employee.*/
SELECT ALL salary
FROM princee.Employee;
--Q9: Retrieve the all distinct salary values.*/
SELECT DISTINCT SALARY
FROM pcomp.Employee;
--Q10: Make a list of all project numbers for projects that involve an employee whose lastname is 'Smith', either as a worker or as a manager of the department that controlsthe project.*/
SELECT DISTINCT pno
FROM pcomp.proj
WHERE pno in(SELECT pno
FROM pcomp.proj,pcomp.dept,pcomp.Employee
WHERE dept.dnum=Employee.dno OR dept.managerssn=employee.ssn OR Employee.lname='Smith')
/*Q11: Retrieve all employees whose address is in Houston, Texas.*/
SELECT Fname, Lname
FROM princee.Employee
WHERE address LIKE '%Houston,TX%';
/*Retrieve a list of employees and the projects they are working on, ordered by department and, within
each department, ordered alphabetically by last name, first name.*/
SELECT dname,lname,fname,pname
FROM princee.dept, princee.employee,princee.works_on, princee.proj
WHERE dept.dnum=employee.dno AND employee.ssn=works_on.essn AND works_on.pno=proj.pno
--Retrieve the names of all employees who do not have supervisors.
--SELECT fname,lname
--FROM pcomp.employee
--WHERE employee.superssn is NULL
--Retrieve the name of each employee who has a dependent with the same first name and same gender in employee.
SELECT e.fname ,e.lname
FROM princee.employee as e
WHERE e.SSN IN (SELECT essn
FROM princee.dependent
WHERE e.fname=depname
AND e.gender=gender);
--Retrieve the names of employees who have no dependents.
SELECT fname,lname
FROM pcomp.employee
WHERE NOT EXISTS(SELECT *
FROM pcomp.dependent
WHERE employee.ssn=dependent.essn);
--List the names of managers who have at least one dependent.
SELECT fname,lname
FROM pcomp.employee
WHERE EXISTS(SELECT *
FROM pcomp.dependent
WHERE employee.ssn=dependent.essn)
AND
EXISTS(SELECT *
FROM pcomp.dept
WHERE employee.ssn=dept.managerssn);
--Retrieve the social security numbers of all employees who work on project numbers 1,2,3
--SELECT DISTINCT essn
--FROM pcomp.works_on
--WHERE works_on.pno IN (1, 2, 3)
--Find the sum of the salaries of all employees, the maximum salary, the minimum salary, and the average salary.
SELECT SUM (SALARY), MAX (SALARY), MIN (SALARY),AVG (SALARY)
FROM princee.employee
--Findthe sum of the salaries of all employees of the 'Research' department, as well asthe maximum salary, the minimum salary, and the average salary in this department
SELECT SUM (SALARY), MAX (SALARY), MIN (SALARY),AVG (SALARY)
FROM (pcomp.employee JOIN pcomp.dept ON employee.dno=dept.dnum)
WHERE dept.dname='Research';
--Retrieve the total number of employees in the company
--SELECT COUNT(*)
--FROM pcomp.employee
--Retrieve the total number of employees in the 'Research' department
--SELECT COUNT(*)
--FROM pcomp.employee,pcomp.dept
--WHERE employee.dno=dept.dnum AND dept.dname='Research'
--Count the number of distinct salary values in the database.
--SELECT COUNT (DISTINCT employee.salary)
--FROM pcomp.employee
--For each department, retrieve the department number, the number of employees in the department, and their average salary.
--SELECT dno,COUNT(*),AVG(salary)
--FROM pcomp.employee
--GROUP BY employee.dno
--Foreach project on whichmore chan two employees work, retrieve the project number,the project name, and the number of employees who work on the project.
SELECT pno,pname,COUNT(*)
FROM pcomp.proj,pcomp.works_on
WHERE proj.pno=works_on.pno
GROUP BY proj.pno,proj.pname
HAVING COUNT (*) > 2;
--Foreach department that has more than five employees, retrieve the department number and the number of its employees who are making more than $40,000.
SELECT dnum,COUNT(*)
FROM pcomp.dept,pcomp.employee
WHERE dept.dnum=employee.dno AND employee.salary>4000 AND
employee.dno in(SELECT dno
FROM employee
GROUP BY dno
HAVING COUNT(*)>5)
GROUP BY dept.dnum;
SELECT Fname, Lname
FROM pcomp.Employee
WHERE bdate LIKE '__ 5 ';
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 28, 2019 at 09:58 AM
-- Server version: 5.7.27-0ubuntu0.16.04.1
-- PHP Version: 7.1.31-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `cars`
--
-- --------------------------------------------------------
--
-- Table structure for table `aboutus`
--
CREATE TABLE `aboutus` (
`id` int(11) NOT NULL,
`description` longtext NOT NULL,
`image` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `aboutus`
--
INSERT INTO `aboutus` (`id`, `description`, `image`) VALUES
(1, '<p><strong>Lorem simply dummy is a texted of the printing costed and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, </strong>when an unknown printer took a galley of type. Lorem simply dummy is a texted of the printing costed and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type.when an unknown printer took a galley of type. Lorem simply dummy is a texted of the printing costed and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type.</p>', '1568436217.home-2-about.png');
-- --------------------------------------------------------
--
-- Table structure for table `administrators`
--
CREATE TABLE `administrators` (
`myid` int(10) UNSIGNED NOT NULL,
`first_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`last_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '0',
`address` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` longtext CHARACTER SET utf8 NOT NULL,
`city` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`zip` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`country` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`phone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`image` text COLLATE utf8_unicode_ci NOT NULL,
`adminType` tinyint(1) NOT NULL,
`category` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`issubadmin` int(11) NOT NULL COMMENT '1=superAdmin,2=showroomAdmin,3=store,4=company'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `administrators`
--
INSERT INTO `administrators` (`myid`, `first_name`, `last_name`, `email`, `password`, `isActive`, `address`, `description`, `city`, `zip`, `country`, `phone`, `image`, `adminType`, `category`, `remember_token`, `created_at`, `updated_at`, `issubadmin`) VALUES
(1, 'Admin', '', 'car@gmail.com', '$2y$10$K2DV.mc/GEIlRcmMuoCqs.ND214ea2STV/lH5dVn/a/wxhgzJEp3e', 1, 'address', '', 'Nivada', '38000', '218', '123456789', 'resources/views/admin/images/admin_profile/1513671470.fast.jpg', 1, '', 'N87GqnynJVVkdVemEqC9ueNpwK4PKOkGBLfA6s5tUIj2c7m4x8ovHOBQKOiD', '0000-00-00 00:00:00', '2019-09-27 01:15:57', 0),
(8, 'Admin', '', 'demo@android.com', '$2y$10$vbQE1Lbu1kXCAILSvaH0uOZ3oA6oZdCf/0kjQB16iGnjc3eTaFBeu', 1, 'address', '', 'Nivada', '38000', '223', '', 'resources/views/admin/images/admin_profile/1513671470.fast.jpg', 1, '', 'resources/views/admin/images/admin_profile/1505132393.1486628854.fast.jpg', NULL, NULL, 0),
(9, 'Admin', '', 'demo@ionic.com', '$2y$10$vbQE1Lbu1kXCAILSvaH0uOZ3oA6oZdCf/0kjQB16iGnjc3eTaFBeu', 1, 'address', '', 'Nivada', '38000', '223', '', 'resources/views/admin/images/admin_profile/1513671470.fast.jpg', 1, '', 'c68im2rP1dzUw7guozSqEbxZHY5ebSGGOprcPezzYDo2ZIvxCaGplhjn5rFP', NULL, NULL, 0),
(23, 'prakash', 'sonule', 'prakash@gmail.com', '$2y$10$DDugbqADUP14v3wh8xwmfejd8eJWErzZaWYp5Lnag7wsztPltj2lK', 0, 'jasodanagar', '', '15', '382445', '99', '7894561230', 'resources/views/admin/images/admin_profile/1563960498.blog-image-real-estate-listing-descriptions.jpg', 1, '', '0s79xe1x4O3OrI3Ee4eNbRyYoPly4KciJ24osQJxh905UAgGINEGHXsygIhK', '2019-07-24 03:58:18', '2019-07-24 07:23:04', 2),
(24, 'akash', 'tsdddd', 'akash@gmail.com', '$2y$10$YGuwUH/t0FXfk1o7TAL9bONfLg1vJa.kyIsfY4tlK2Bvnaci2LlDm', 0, 'dhjfvshjdafvhjadfahjdfvahdfvfhfhhhdfhh', '', '14', '54775', '223', '5764567467667', 'resources/views/admin/images/admin_profile/1563960699.businesspeople-brainstorming-with-creative-ideas-picture-id950560696-1024x512.jpg', 1, '', 'aiqtgFXnuFaUpcYSlp7NwVfE0xCKDCKtQmFaKzoUKEmroIn1Xsw0Nlkxb0Hn', '2019-07-24 04:01:39', '2019-07-24 07:22:59', 2),
(25, 'abbas bhai', 'daruvala', 'daruvala@gmail.com', '$2y$10$xDdmgzSXnS5ADWOnGVwW3u1jWeaZ2FI2fD5AyZoIuPt56efGxPSBm', 0, 'new dubai', '', '12', '693200', '1', '963258741', 'resources/views/admin/images/admin_profile/1564654286.user4.jpeg', 1, '', NULL, '2019-08-01 04:41:26', '0000-00-00 00:00:00', 2),
(28, 'sanvi', 'patel', 'sanvi@gmail.com', '$2y$10$kTuxk9myBry.FWcBwVwzduLikWAg4eOR2n0gdvfRI/O/KzkHYFU..', 0, 'gds', '', '14', '6546', '2', '8795463210', 'resources/views/admin/images/admin_profile/1564660580.laptop4.jpg', 1, '3,5,7,8', 'OR8j0dlpg77vMmE5DwYZRcdstRYsSj3BFEGgCARBIdjO9owjzhykv16vcdAi', '2019-08-01 06:26:20', '2019-08-02 06:01:56', 4),
(29, 'riya', 't', 'riya@gmail.com', '$2y$10$Dz1o9Uk2v7D0LQXGR0Fl/ObB5J9lmO4cRzYIHvVsu3cYe5E1RORey', 0, 'gdsg', 'Global Travels represents the CABGURGAON.COM, which is the first Gurgaon based online booking system of cab rentals in India as the master licensee of GlGlobal Travels represents the CABGURGAON.COM, which is the first Gurgaon based online booking system of cab rentals in India as the master licensee of Global Travels.', '12', '', '12', '', 'resources/views/admin/images/admin_profile/1564663719.wallet1.jpeg', 1, '7,8', 'JCWBC2WZvjdeRP0e4S3oRPwOVgA7q1KQ9w5nmnXm6pHwUf6Itp4gq2rCqZ6s', '2019-08-01 07:18:39', '2019-09-22 23:51:12', 4),
(30, 'hakim bhai', 'potliwala', 'potliwala@gmail.com', '$2y$10$xe8.Q.hnKEglgsep1chrWOXNkdhHaii4uYWDGogmMY.yWTq9yw3DS', 0, 'ghh', '', '11', '45000', '1', '9876541323', '', 1, '', NULL, '2019-08-18 23:16:32', '2019-09-25 19:50:27', 2),
(31, 'heery', '1son', 'car1234@gmail.com', '$2y$10$u1CkMeuqKQ57kz0256jzwe1EL1iG/8nID4GfBhKyEL/S..6928qD2', 0, 'new', 'new', '12', '380015', '16', '9632587410', 'resources/views/admin/images/admin_profile/1568274546.laptop1.jpeg', 1, '', 'iYOaMHchdzgzcwDf1FiZvpickttj5SlKn8CGP8oePTLEy6GmRr9Z1Awv1wUe', '2019-09-12 02:19:06', '2019-09-25 03:17:19', 4),
(32, 'simon', 'smith', 'simonsmith@gmail.com', '$2y$10$kQymI5q3SjaI3HGP04au8O3fAorywdUUyPlEN.tIsXhCyOvWQCfw6', 0, 'america', '', '16', '123123', '4', '9874561230', 'resources/views/admin/images/admin_profile/1568356448.d1.jpg', 1, '3,4', 'sbtqUCSaohIIKVXcID53eNCLfo76mLk7gP3PQhjUh6KINbdWKCgOBf9yRcVq', '2019-09-13 01:04:08', '2019-09-16 00:52:32', 3),
(33, 'Patrik', 'Nash', 'patriknash@gmail.com', '$2y$10$fnDJmUBlDXuLGJJ/3t.2jOrE9VsPxhSc45h07lrj67blZH1y/efNS', 0, 'dubai', '', '12', '456123', '13', '9876543332', 'resources/views/admin/images/admin_profile/1568356849.d2.jpg', 1, '5,6,7', NULL, '2019-09-13 01:10:49', '0000-00-00 00:00:00', 3),
(34, 'Henry', 'Shaw', 'henryshaw@gmail.com', '$2y$10$aB1WQeP/g4IpBX.rMUrZ2eL/Wm77oI8JrBC9eUKN29VMVNnJLCa3O', 0, 'africa', '', '15', '5555555555', '1', '9876543211', 'resources/views/admin/images/admin_profile/1568356983.d4.jpg', 1, '3,8,9,11', NULL, '2019-09-13 01:13:03', '2019-09-16 00:53:39', 3),
(35, 'Metthew', 'Pattern', 'metthewpattern@gmail.com', '$2y$10$/hDmw/2MCW9twkc78zOiO.tJpz73rJ/C8UefKY6sOPwxvIlQgw72O', 0, '04,kerala,dubai', '', '14', '4444444444', '57', '9873216541', 'resources/views/admin/images/admin_profile/1568357127.d3.jpeg', 1, '3,4,5,6', NULL, '2019-09-13 01:15:27', '2019-09-16 23:33:13', 3),
(36, 'priyabrta', 'posta', 'posta@gmail.com', '$2y$10$9BZJHBS2G.WTnmox6hrpnOT.WZ6g7FlkcoRl0zY8wo/3l465TSOLq', 0, 'ahmedabad', 'new', '11', '34444', '20', '7894561320', 'resources/views/admin/images/admin_profile/1568712513.rose-blue-flower-rose-blooms-67636.jpeg', 1, '9', NULL, '2019-09-17 03:58:34', '2019-09-18 00:22:11', 3),
(37, 'jatin', 'bhai', 'jatin@gmail.com', '$2y$10$ttdozBvnZ0Xe6RD2e3tPou8HMeGb.lzuUlBhA2i5PqBJXS3y.NMNW', 0, 'abad', 'abd', '11', '4444', '8', '444444', 'resources/views/admin/images/admin_profile/1569321769.male1.jpeg', 1, '7', NULL, '2019-09-24 05:12:49', '0000-00-00 00:00:00', 3),
(38, 'mahesh', 'bhai', 'mahesh@gmail.com', '$2y$10$Drdz6e1TV3XH.LjbhH5sZ.pPbtwmJ3nRUkeFm8rti9xshHlC0qxkC', 0, 'abad', 'abd', '17', '4444', '17', '4545454', 'resources/views/admin/images/admin_profile/1569321821.male2.jpg', 1, '5', NULL, '2019-09-24 05:13:41', '0000-00-00 00:00:00', 3),
(39, 'Damu', 'bhai', 'don@gmail.com', '$2y$10$9JqLz.wXQjscggF5STAL8.IHgUGM4TULCL27uLVexJwHPEYK1R/0i', 0, 'vadodara', 'vcadodara', '21', '5656', '13', '879789879', 'resources/views/admin/images/admin_profile/1569321892.male3.jpg', 1, '7', NULL, '2019-09-24 05:14:52', '0000-00-00 00:00:00', 3),
(40, 'raju', 'bhai', 'raju@gmail.com', '$2y$10$5a.owHbImFRvswhapqyKieDvYyHR4iZVVr6/zzu5zRA3I2cwa4WMe', 0, 'sdsds', 'sdsd', '10', '45654', '19', '546546546', 'resources/views/admin/images/admin_profile/1569321968.male4.jpg', 1, '7', NULL, '2019-09-24 05:16:08', '0000-00-00 00:00:00', 3),
(41, 'fasino', 'sed', 'fasino@gmail.com', '$2y$10$0Xs9GzSZjxXb6Z8vENnQrerMiHx8R82pAxANNZgIIk5orE4Je5a1K', 0, 'fgfg', 'dfgdfg', '10', '546', '17', '546546', 'resources/views/admin/images/admin_profile/1569322023.male6.jpg', 1, '5,8', NULL, '2019-09-24 05:17:04', '0000-00-00 00:00:00', 3),
(42, 'mukesh', 'bhai', 'mukesh@gmail.com', '$2y$10$p4MAlbtj8RKwcmWvlG07uemlPrLPBKfHhGMmc7KIrakIIlKoOPMg2', 0, 'dsf', 'dsfdsf', '20', '546', '16', '546546', 'resources/views/admin/images/admin_profile/1569325588.male5.jpg', 1, '3', NULL, '2019-09-24 06:16:28', '0000-00-00 00:00:00', 3),
(43, 'jack', 'sparrow', 'jalpa@gmail.com', '$2y$10$D0CCqB.76CBxiYFim4QjSeiulSIcurE9ut/faA0CFGl/neGlsrxVq', 0, 'vfdgd', 'fdgfdg', '19', '567', '14', '657657', 'resources/views/admin/images/admin_profile/1569325938.male1.jpeg', 1, '4', NULL, '2019-09-24 06:22:18', '0000-00-00 00:00:00', 3),
(44, 'hitesh', 'bhai', 'hitesh@gmail.com', '$2y$10$B34RdJVQBxmgjlK.qoP9t.XCW.PVGUFYwwAPjOcYi1gJQFV1YV5z6', 0, 'dfgdg', 'fdgfdgdfg', '21', '567', '', '657657', 'resources/views/admin/images/admin_profile/1569325984.male5.jpg', 1, '3,7', '8Vk489g2cxkDM0DHpbPrTRz9FqPzsWp1S6zP1d2bvMuHyYT81dnaRPAM7OlN', '2019-09-24 06:23:04', '2019-09-26 23:17:57', 3),
(45, 'fgdfg', 'dfghdgh', 'kinnari@gmail.com', '$2y$10$CAm6UUJrs6HFkMjKsQzjS.D80HOmh1NRL1jj4i9.Z4Z468Ol9/egO', 0, 'dfghdgh', 'dfghdgh', '', '789456', '13', '5894564532132', '', 1, '', 'HwH3ccFvwSWWjFSHBqumRYW8FT3nF7BdCkv1GCsGHSmfjP6S4RQxFngzJ3nw', '2019-09-26 07:52:53', '2019-09-27 01:11:57', 2);
-- --------------------------------------------------------
--
-- Table structure for table `ads`
--
CREATE TABLE `ads` (
`id` int(11) NOT NULL,
`type` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`fromdate` date NOT NULL,
`todate` date NOT NULL,
`published` int(11) NOT NULL,
`image` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `ads`
--
INSERT INTO `ads` (`id`, `type`, `name`, `description`, `fromdate`, `todate`, `published`, `image`) VALUES
(1, 1, 'test1', 'test1', '2019-09-05', '2019-09-04', 1, '1568615409.shutterstock1.jpg'),
(2, 1, 'test 2', 'test 2', '2019-09-04', '2019-09-04', 1, '1568616371.shutterstock2.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `car_accessories`
--
CREATE TABLE `car_accessories` (
`id` int(11) NOT NULL,
`store_id` int(11) NOT NULL,
`category_id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`description` text NOT NULL,
`price` varchar(255) NOT NULL,
`size` varchar(255) NOT NULL,
`model` varchar(255) NOT NULL,
`color` varchar(255) NOT NULL,
`specification` longtext NOT NULL,
`status` tinyint(4) NOT NULL,
`quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `car_accessories`
--
INSERT INTO `car_accessories` (`id`, `store_id`, `category_id`, `name`, `description`, `price`, `size`, `model`, `color`, `specification`, `status`, `quantity`) VALUES
(7, 33, 0, 'Tire Set', 'packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).', '435435', '400', 'fgdfsg', 'fsdgsfg', 'jbdfgkjsb', 1, 10),
(8, 33, 5, 'Back Light', 'packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).', '2500', '4000', 'fdhfdh', 'dhjvfj', 'sbdfkghb', 1, 10),
(9, 33, 6, 'Parking Light', 'packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).', '566', '400', 'thth', 'rthtrh', 'Parking Light', 1, 10),
(10, 33, 7, 'Mirrors', 'gcgh', '50.00', '5', '23', 'black', 'bj', 2, 10),
(11, 32, 3, 'Sound System', 'packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).', '50000', '90\' cm', 'a1', 'Blue', 'Nothing but good', 1, 20),
(12, 32, 4, 'AC colder', 'packages and web page editors now use Lorem Ipsum as their default model text, and a search for \'lorem ipsum\' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).', '100000', '300 cm', 'ac-1', 'black', 'noooo', 1, 110),
(13, 44, 3, 'demo pro', 'dfhdghfgh', '45000', '4500', '2019', 'red', 'kfjbgfskj', 1, 4);
-- --------------------------------------------------------
--
-- Table structure for table `car_accessories_img`
--
CREATE TABLE `car_accessories_img` (
`id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`img_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `car_accessories_img`
--
INSERT INTO `car_accessories_img` (`id`, `product_id`, `img_name`) VALUES
(28, 7, '1565701755.download-(5).jpeg'),
(29, 8, '1565702033.maruti-suzuki-eeco-back-light-500x500.jpg'),
(30, 9, '1565702111.download-(9).jpeg'),
(31, 10, '1565702301.wing-mirror.jpeg'),
(32, 10, '1565702301.rear-mirror.jpeg'),
(33, 10, '1565702301.blind-spot-mirrors.jpeg'),
(34, 8, '1565702449.download-(7).jpeg'),
(36, 11, '1568357435.download.jpeg'),
(37, 12, '1568357621.download-(1).jpeg'),
(38, 13, '1569559765.photo-1511919884226-fd3cad34687c.jpeg');
-- --------------------------------------------------------
--
-- Table structure for table `car_brand`
--
CREATE TABLE `car_brand` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`ar` varchar(255) NOT NULL,
`ku` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `car_brand`
--
INSERT INTO `car_brand` (`id`, `name`, `ar`, `ku`, `description`, `status`) VALUES
(2, 'Maruti-Suzuki', 'يع / شراء سيارة', 'يع / شراء سيارة', 'Made In India', 1),
(3, 'Mahindra', 'Mahindra', 'Mahindra', 'made in india', 1),
(4, 'Tata', 'Tata', 'Tata', 'made in india', 1),
(5, 'Ford', 'Ford', 'Ford', 'made in ford', 1),
(10, 'Volvo', 'Volvo', 'Volvo', 'Luxurious', 1),
(11, 'Jeep', 'Jeep', 'Jeep', 'sdfgfsg', 1),
(12, 'Ashok Leyland', 'Ashok Leyland', 'Ashok Leyland', 'dsfgsdg', 1),
(13, 'Chinkara Motors', 'Chinkara Motors', 'Chinkara Motors', 'dfdf', 1),
(14, 'Opel', 'Opel', 'Opel', 'dafdaf', 1),
(15, 'Eicher Motors', 'Eicher Motors', 'Eicher Motors', 'dfdfdf', 1),
(16, 'Honda', 'Honda', 'Honda', 'fdfdf', 1),
(17, 'Hyundai', 'Hyundai', 'Hyundai', 'dfdf', 1),
(18, 'Skoda', 'Skoda', 'Skoda', 'dfdf', 1),
(19, 'Ariel', 'Ariel', 'Ariel', 'dafa', 1),
(20, 'Aston Martin', 'Aston Martin', 'Aston Martin', 'adfdaf', 1),
(21, 'Audi', 'Audi', 'Audi', 'adsfadf', 1),
(22, 'Bajaj', 'Bajaj', 'Bajaj', 'dsfgds', 1),
(23, 'Bentley', 'Bentley', 'Bentley', 'dsfdsf', 1),
(24, 'BMW', 'BMW', 'BMW', 'df', 1),
(25, 'Bugatti', 'Bugatti', 'Bugatti', 'dsfgd', 1),
(26, 'Chevrolet', 'Chevrolet', 'Chevrolet', 'dsfgdsg', 1),
(27, 'Datsun', 'Datsun', 'Datsun', 'sfdg', 1),
(28, 'Ferrari', 'Ferrari', 'Ferrari', 'sdfgsg', 1),
(29, 'Fiat', 'Fiat', 'Fiat', 'fsgfg', 1),
(30, 'Force', 'Force', 'Force', 'sdfg', 1),
(31, 'HM', 'HM', 'HM', 'dsf', 1),
(32, 'ICML', 'ICML', 'ICML', 'dsfg', 1),
(33, 'Isuzu', 'Isuzu', 'Isuzu', 'dsf', 1),
(34, 'Jaguar', 'Jaguar', 'Jaguar', 'dsfg', 1),
(35, 'Koenigsegg', 'Koenigsegg', 'Koenigsegg', 'dsfgdg', 1),
(36, 'Lamborghini', 'Lamborghini', 'Lamborghini', 'dsf', 1),
(37, 'Land Rover', 'Land Rover', 'Land Rover', 'dgd', 1),
(38, 'Mahindra - Reva', 'Mahindra - Reva', 'Mahindra - Reva', 'dfsg', 1),
(39, 'Maserati', 'Maserati', 'Maserati', 'dsgg', 1),
(40, 'Maybach', 'Maybach', 'Maybach', 'dsg', 1),
(41, 'Mercedes-Benz', 'Mercedes-Benz', 'Mercedes-Benz', 'dsfg', 1),
(42, 'Mini', 'Mini', 'Mini', 'dsfg', 1),
(43, 'Mitsubishi', 'Mitsubishi', 'Mitsubishi', 'dfg', 1),
(44, 'Nissan', 'Nissan', 'Nissan', 'dsfg', 1),
(45, 'Porsche', 'Porsche', 'Porsche', 'dsg', 1),
(46, 'Premier', 'Premier', 'Premier', 'dfg', 1),
(47, 'Renault', 'Renault', 'Renault', 'dsg', 1),
(48, 'Rolls-Royce', 'Rolls-Royce', 'Rolls-Royce', 'dgfdg', 1),
(49, 'San', 'San', 'San', 'daf', 1),
(50, 'Ssangyong', 'Ssangyong', 'Ssangyong', 'dgds', 1),
(51, 'Toyota', 'Toyota', 'Toyota', 'gfsrg', 1),
(52, 'Volkswagen', 'Volkswagen', 'Volkswagen', 'sdfg', 1);
-- --------------------------------------------------------
--
-- Table structure for table `city`
--
CREATE TABLE `city` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`ar` varchar(255) CHARACTER SET utf8 NOT NULL,
`ku` varchar(255) CHARACTER SET utf8 NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `city`
--
INSERT INTO `city` (`id`, `name`, `ar`, `ku`) VALUES
(10, 'Ad-Dawr', 'الدور', 'Ad-Dawr'),
(11, 'Afak', 'عفك', 'Afak'),
(12, 'Al-Awja', 'العوجا', 'Al-Awja'),
(13, 'Al Diwaniyah', 'الديوانية', 'Al Diwaniyah'),
(14, 'Al Hillah', 'الحلة', 'Al Hillah'),
(15, 'Al-Qa\'im', 'القائم', 'Al-Qa\'im'),
(16, 'Amarah', 'العمارة', 'Amarah'),
(17, 'Arbil', 'اربيل', 'Arbil'),
(18, 'Baghdad', 'بغداد', 'Baghdad'),
(19, 'Baghdadi', 'البغدادي', 'Baghdadi'),
(20, 'Taji', 'التاجي', 'Taji'),
(21, 'Ad-Dawr', 'الدور', 'Ad-Dawr');
-- --------------------------------------------------------
--
-- Table structure for table `contact_admin`
--
CREATE TABLE `contact_admin` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`userId` int(11) NOT NULL,
`userType` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`subject` varchar(255) NOT NULL,
`message` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contact_admin`
--
INSERT INTO `contact_admin` (`id`, `name`, `userId`, `userType`, `email`, `subject`, `message`) VALUES
(4, 'prakash', 5, '', 'prakash@harmistechnology.com', 'testing', 'testing message');
-- --------------------------------------------------------
--
-- Table structure for table `contact_agent`
--
CREATE TABLE `contact_agent` (
`id` int(11) NOT NULL,
`carId` int(11) NOT NULL,
`userId` int(11) NOT NULL,
`user_type` int(11) NOT NULL COMMENT '1 = show room admin , 2 = store admin , 3 = Company Admin',
`firstName` varchar(255) NOT NULL,
`lastName` varchar(255) NOT NULL,
`nationality` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`dateFrom` date NOT NULL,
`dateTo` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contact_agent`
--
INSERT INTO `contact_agent` (`id`, `carId`, `userId`, `user_type`, `firstName`, `lastName`, `nationality`, `email`, `phone`, `dateFrom`, `dateTo`) VALUES
(9, 0, 23, 1, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(10, 0, 23, 1, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(11, 0, 24, 2, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(12, 2, 8, 1, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(13, 2, 8, 1, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(14, 41, 12, 1, 'carlocal', 'carlocal', 'India', 'carlocal@gmail.com', '9865323652', '0000-00-00', '0000-00-00'),
(15, 41, 12, 1, 'carlocal', 'carlocal', 'India', 'carlocal@gmail.com', '9865323652', '0000-00-00', '0000-00-00'),
(16, 41, 12, 1, 'carlocal', 'carlocal', 'India', 'carlocal@gmail.com', '9865323652', '2019-09-17', '2019-09-28'),
(17, 41, 12, 1, 'carlocal', 'carlocal', 'India', 'carlocal@gmail.com', '9865323652', '2019-09-17', '2019-09-28'),
(18, 2, 8, 1, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(19, 2, 8, 1, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(20, 41, 12, 1, 'carlocal', 'carlocal', 'India', 'carlocal@gmail.com', '9865323652', '2019-09-17', '2019-09-28'),
(21, 2, 8, 1, 'chotu bhai', 'Don', 'indian', 'chotudon@gmail.com', '789456123', '2019-07-30', '2019-08-01'),
(22, 41, 12, 1, 'carlocal', 'carlocal', 'India', 'carlocal@gmail.com', '9865323652', '2019-09-17', '2019-09-28'),
(23, 41, 16, 1, 'carloc', 'patel', 'Afghan', 'carloc@gmail.com', '9898989898', '2030-09-16', '2022-09-16'),
(36, 44, 4, 3, 'heery', 'son', '1', 'herry@gmail.com', '9632587410', '2017-06-01', '2019-06-01'),
(37, 39, 15, 3, 'sandip', 'hawlett', '2', 'sandip1@gmail.com', '78755555', '2017-06-01', '2019-06-01'),
(38, 39, 15, 3, 'Nancy', 'hawlett', '1', 'nancyhawlett@gmail.com', '7845127845', '2017-06-01', '2019-06-01'),
(39, 54, 12, 1, 'carlocal', 'olpoo', 'Dubai', 'carlocal@gmail.com', '9865323652', '2019-12-21', '2023-09-21'),
(40, 39, 12, 1, 'carlocal', 'olpoo', 'India', 'carlocal@gmail.com', '9865323652', '2023-09-26', '2024-12-31');
-- --------------------------------------------------------
--
-- Table structure for table `contact_us`
--
CREATE TABLE `contact_us` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`message` longtext,
`created_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `contact_us`
--
INSERT INTO `contact_us` (`id`, `name`, `email`, `message`, `created_date`) VALUES
(1, 'HITESH', 'hp@gmail.com', 'car sell', '2019-09-18 07:59:17');
-- --------------------------------------------------------
--
-- Table structure for table `countries`
--
CREATE TABLE `countries` (
`countries_id` int(11) NOT NULL,
`countries_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`countries_iso_code_2` char(2) COLLATE utf8_unicode_ci NOT NULL,
`countries_iso_code_3` char(3) COLLATE utf8_unicode_ci NOT NULL,
`address_format_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `countries`
--
INSERT INTO `countries` (`countries_id`, `countries_name`, `countries_iso_code_2`, `countries_iso_code_3`, `address_format_id`) VALUES
(1, 'Afghanistan', 'AF', 'AFG', 1),
(2, 'Albania', 'AL', 'ALB', 1),
(3, 'Algeria', 'DZ', 'DZA', 1),
(4, 'American Samoa', 'AS', 'ASM', 1),
(5, 'Andorra', 'AD', 'AND', 1),
(6, 'Angola', 'AO', 'AGO', 1),
(7, 'Anguilla', 'AI', 'AIA', 1),
(8, 'Antarctica', 'AQ', 'ATA', 1),
(9, 'Antigua and Barbuda', 'AG', 'ATG', 1),
(10, 'Argentina', 'AR', 'ARG', 1),
(11, 'Armenia', 'AM', 'ARM', 1),
(12, 'Aruba', 'AW', 'ABW', 1),
(13, 'Australia', 'AU', 'AUS', 1),
(14, 'Austria', 'AT', 'AUT', 5),
(15, 'Azerbaijan', 'AZ', 'AZE', 1),
(16, 'Bahamas', 'BS', 'BHS', 1),
(17, 'Bahrain', 'BH', 'BHR', 1),
(18, 'Bangladesh', 'BD', 'BGD', 1),
(19, 'Barbados', 'BB', 'BRB', 1),
(20, 'Belarus', 'BY', 'BLR', 1),
(21, 'Belgium', 'BE', 'BEL', 1),
(22, 'Belize', 'BZ', 'BLZ', 1),
(23, 'Benin', 'BJ', 'BEN', 1),
(24, 'Bermuda', 'BM', 'BMU', 1),
(25, 'Bhutan', 'BT', 'BTN', 1),
(26, 'Bolivia', 'BO', 'BOL', 1),
(27, 'Bosnia and Herzegowina', 'BA', 'BIH', 1),
(28, 'Botswana', 'BW', 'BWA', 1),
(29, 'Bouvet Island', 'BV', 'BVT', 1),
(30, 'Brazil', 'BR', 'BRA', 1),
(31, 'British Indian Ocean Territory', 'IO', 'IOT', 1),
(32, 'Brunei Darussalam', 'BN', 'BRN', 1),
(33, 'Bulgaria', 'BG', 'BGR', 1),
(34, 'Burkina Faso', 'BF', 'BFA', 1),
(35, 'Burundi', 'BI', 'BDI', 1),
(36, 'Cambodia', 'KH', 'KHM', 1),
(37, 'Cameroon', 'CM', 'CMR', 1),
(38, 'Canada', 'CA', 'CAN', 1),
(39, 'Cape Verde', 'CV', 'CPV', 1),
(40, 'Cayman Islands', 'KY', 'CYM', 1),
(41, 'Central African Republic', 'CF', 'CAF', 1),
(42, 'Chad', 'TD', 'TCD', 1),
(43, 'Chile', 'CL', 'CHL', 1),
(44, 'China', 'CN', 'CHN', 1),
(45, 'Christmas Island', 'CX', 'CXR', 1),
(46, 'Cocos (Keeling) Islands', 'CC', 'CCK', 1),
(47, 'Colombia', 'CO', 'COL', 1),
(48, 'Comoros', 'KM', 'COM', 1),
(49, 'Congo', 'CG', 'COG', 1),
(50, 'Cook Islands', 'CK', 'COK', 1),
(51, 'Costa Rica', 'CR', 'CRI', 1),
(52, 'Cote D\'Ivoire', 'CI', 'CIV', 1),
(53, 'Croatia', 'HR', 'HRV', 1),
(54, 'Cuba', 'CU', 'CUB', 1),
(55, 'Cyprus', 'CY', 'CYP', 1),
(56, 'Czech Republic', 'CZ', 'CZE', 1),
(57, 'Denmark', 'DK', 'DNK', 1),
(58, 'Djibouti', 'DJ', 'DJI', 1),
(59, 'Dominica', 'DM', 'DMA', 1),
(60, 'Dominican Republic', 'DO', 'DOM', 1),
(61, 'East Timor', 'TP', 'TMP', 1),
(62, 'Ecuador', 'EC', 'ECU', 1),
(63, 'Egypt', 'EG', 'EGY', 1),
(64, 'El Salvador', 'SV', 'SLV', 1),
(65, 'Equatorial Guinea', 'GQ', 'GNQ', 1),
(66, 'Eritrea', 'ER', 'ERI', 1),
(67, 'Estonia', 'EE', 'EST', 1),
(68, 'Ethiopia', 'ET', 'ETH', 1),
(69, 'Falkland Islands (Malvinas)', 'FK', 'FLK', 1),
(70, 'Faroe Islands', 'FO', 'FRO', 1),
(71, 'Fiji', 'FJ', 'FJI', 1),
(72, 'Finland', 'FI', 'FIN', 1),
(73, 'France', 'FR', 'FRA', 1),
(74, 'France, Metropolitan', 'FX', 'FXX', 1),
(75, 'French Guiana', 'GF', 'GUF', 1),
(76, 'French Polynesia', 'PF', 'PYF', 1),
(77, 'French Southern Territories', 'TF', 'ATF', 1),
(78, 'Gabon', 'GA', 'GAB', 1),
(79, 'Gambia', 'GM', 'GMB', 1),
(80, 'Georgia', 'GE', 'GEO', 1),
(81, 'Germany', 'DE', 'DEU', 5),
(82, 'Ghana', 'GH', 'GHA', 1),
(83, 'Gibraltar', 'GI', 'GIB', 1),
(84, 'Greece', 'GR', 'GRC', 1),
(85, 'Greenland', 'GL', 'GRL', 1),
(86, 'Grenada', 'GD', 'GRD', 1),
(87, 'Guadeloupe', 'GP', 'GLP', 1),
(88, 'Guam', 'GU', 'GUM', 1),
(89, 'Guatemala', 'GT', 'GTM', 1),
(90, 'Guinea', 'GN', 'GIN', 1),
(91, 'Guinea-bissau', 'GW', 'GNB', 1),
(92, 'Guyana', 'GY', 'GUY', 1),
(93, 'Haiti', 'HT', 'HTI', 1),
(94, 'Heard and Mc Donald Islands', 'HM', 'HMD', 1),
(95, 'Honduras', 'HN', 'HND', 1),
(96, 'Hong Kong', 'HK', 'HKG', 1),
(97, 'Hungary', 'HU', 'HUN', 1),
(98, 'Iceland', 'IS', 'ISL', 1),
(99, 'India', 'IN', 'IND', 1),
(100, 'Indonesia', 'ID', 'IDN', 1),
(101, 'Iran (Islamic Republic of)', 'IR', 'IRN', 1),
(102, 'Iraq', 'IQ', 'IRQ', 1),
(103, 'Ireland', 'IE', 'IRL', 1),
(104, 'Israel', 'IL', 'ISR', 1),
(105, 'Italy', 'IT', 'ITA', 1),
(106, 'Jamaica', 'JM', 'JAM', 1),
(107, 'Japan', 'JP', 'JPN', 1),
(108, 'Jordan', 'JO', 'JOR', 1),
(109, 'Kazakhstan', 'KZ', 'KAZ', 1),
(110, 'Kenya', 'KE', 'KEN', 1),
(111, 'Kiribati', 'KI', 'KIR', 1),
(112, 'Korea, Democratic People\'s Republic of', 'KP', 'PRK', 1),
(113, 'Korea, Republic of', 'KR', 'KOR', 1),
(114, 'Kuwait', 'KW', 'KWT', 1),
(115, 'Kyrgyzstan', 'KG', 'KGZ', 1),
(116, 'Lao People\'s Democratic Republic', 'LA', 'LAO', 1),
(117, 'Latvia', 'LV', 'LVA', 1),
(118, 'Lebanon', 'LB', 'LBN', 1),
(119, 'Lesotho', 'LS', 'LSO', 1),
(120, 'Liberia', 'LR', 'LBR', 1),
(121, 'Libyan Arab Jamahiriya', 'LY', 'LBY', 1),
(122, 'Liechtenstein', 'LI', 'LIE', 1),
(123, 'Lithuania', 'LT', 'LTU', 1),
(124, 'Luxembourg', 'LU', 'LUX', 1),
(125, 'Macau', 'MO', 'MAC', 1),
(126, 'Macedonia, The Former Yugoslav Republic of', 'MK', 'MKD', 1),
(127, 'Madagascar', 'MG', 'MDG', 1),
(128, 'Malawi', 'MW', 'MWI', 1),
(129, 'Malaysia', 'MY', 'MYS', 1),
(130, 'Maldives', 'MV', 'MDV', 1),
(131, 'Mali', 'ML', 'MLI', 1),
(132, 'Malta', 'MT', 'MLT', 1),
(133, 'Marshall Islands', 'MH', 'MHL', 1),
(134, 'Martinique', 'MQ', 'MTQ', 1),
(135, 'Mauritania', 'MR', 'MRT', 1),
(136, 'Mauritius', 'MU', 'MUS', 1),
(137, 'Mayotte', 'YT', 'MYT', 1),
(138, 'Mexico', 'MX', 'MEX', 1),
(139, 'Micronesia, Federated States of', 'FM', 'FSM', 1),
(140, 'Moldova, Republic of', 'MD', 'MDA', 1),
(141, 'Monaco', 'MC', 'MCO', 1),
(142, 'Mongolia', 'MN', 'MNG', 1),
(143, 'Montserrat', 'MS', 'MSR', 1),
(144, 'Morocco', 'MA', 'MAR', 1),
(145, 'Mozambique', 'MZ', 'MOZ', 1),
(146, 'Myanmar', 'MM', 'MMR', 1),
(147, 'Namibia', 'NA', 'NAM', 1),
(148, 'Nauru', 'NR', 'NRU', 1),
(149, 'Nepal', 'NP', 'NPL', 1),
(150, 'Netherlands', 'NL', 'NLD', 1),
(151, 'Netherlands Antilles', 'AN', 'ANT', 1),
(152, 'New Caledonia', 'NC', 'NCL', 1),
(153, 'New Zealand', 'NZ', 'NZL', 1),
(154, 'Nicaragua', 'NI', 'NIC', 1),
(155, 'Niger', 'NE', 'NER', 1),
(156, 'Nigeria', 'NG', 'NGA', 1),
(157, 'Niue', 'NU', 'NIU', 1),
(158, 'Norfolk Island', 'NF', 'NFK', 1),
(159, 'Northern Mariana Islands', 'MP', 'MNP', 1),
(160, 'Norway', 'NO', 'NOR', 1),
(161, 'Oman', 'OM', 'OMN', 1),
(162, 'Pakistan', 'PK', 'PAK', 1),
(163, 'Palau', 'PW', 'PLW', 1),
(164, 'Panama', 'PA', 'PAN', 1),
(165, 'Papua New Guinea', 'PG', 'PNG', 1),
(166, 'Paraguay', 'PY', 'PRY', 1),
(167, 'Peru', 'PE', 'PER', 1),
(168, 'Philippines', 'PH', 'PHL', 1),
(169, 'Pitcairn', 'PN', 'PCN', 1),
(170, 'Poland', 'PL', 'POL', 1),
(171, 'Portugal', 'PT', 'PRT', 1),
(172, 'Puerto Rico', 'PR', 'PRI', 1),
(173, 'Qatar', 'QA', 'QAT', 1),
(174, 'Reunion', 'RE', 'REU', 1),
(175, 'Romania', 'RO', 'ROM', 1),
(176, 'Russian Federation', 'RU', 'RUS', 1),
(177, 'Rwanda', 'RW', 'RWA', 1),
(178, 'Saint Kitts and Nevis', 'KN', 'KNA', 1),
(179, 'Saint Lucia', 'LC', 'LCA', 1),
(180, 'Saint Vincent and the Grenadines', 'VC', 'VCT', 1),
(181, 'Samoa', 'WS', 'WSM', 1),
(182, 'San Marino', 'SM', 'SMR', 1),
(183, 'Sao Tome and Principe', 'ST', 'STP', 1),
(184, 'Saudi Arabia', 'SA', 'SAU', 1),
(185, 'Senegal', 'SN', 'SEN', 1),
(186, 'Seychelles', 'SC', 'SYC', 1),
(187, 'Sierra Leone', 'SL', 'SLE', 1),
(188, 'Singapore', 'SG', 'SGP', 4),
(189, 'Slovakia (Slovak Republic)', 'SK', 'SVK', 1),
(190, 'Slovenia', 'SI', 'SVN', 1),
(191, 'Solomon Islands', 'SB', 'SLB', 1),
(192, 'Somalia', 'SO', 'SOM', 1),
(193, 'South Africa', 'ZA', 'ZAF', 1),
(194, 'South Georgia and the South Sandwich Islands', 'GS', 'SGS', 1),
(195, 'Spain', 'ES', 'ESP', 3),
(196, 'Sri Lanka', 'LK', 'LKA', 1),
(197, 'St. Helena', 'SH', 'SHN', 1),
(198, 'St. Pierre and Miquelon', 'PM', 'SPM', 1),
(199, 'Sudan', 'SD', 'SDN', 1),
(200, 'Suriname', 'SR', 'SUR', 1),
(201, 'Svalbard and Jan Mayen Islands', 'SJ', 'SJM', 1),
(202, 'Swaziland', 'SZ', 'SWZ', 1),
(203, 'Sweden', 'SE', 'SWE', 1),
(204, 'Switzerland', 'CH', 'CHE', 1),
(205, 'Syrian Arab Republic', 'SY', 'SYR', 1),
(206, 'Taiwan', 'TW', 'TWN', 1),
(207, 'Tajikistan', 'TJ', 'TJK', 1),
(208, 'Tanzania, United Republic of', 'TZ', 'TZA', 1),
(209, 'Thailand', 'TH', 'THA', 1),
(210, 'Togo', 'TG', 'TGO', 1),
(211, 'Tokelau', 'TK', 'TKL', 1),
(212, 'Tonga', 'TO', 'TON', 1),
(213, 'Trinidad and Tobago', 'TT', 'TTO', 1),
(214, 'Tunisia', 'TN', 'TUN', 1),
(215, 'Turkey', 'TR', 'TUR', 1),
(216, 'Turkmenistan', 'TM', 'TKM', 1),
(217, 'Turks and Caicos Islands', 'TC', 'TCA', 1),
(218, 'Tuvalu', 'TV', 'TUV', 1),
(219, 'Uganda', 'UG', 'UGA', 1),
(220, 'Ukraine', 'UA', 'UKR', 1),
(221, 'United Arab Emirates', 'AE', 'ARE', 1),
(222, 'United Kingdom', 'GB', 'GBR', 1),
(223, 'United States', 'US', 'USA', 2),
(224, 'United States Minor Outlying Islands', 'UM', 'UMI', 1),
(225, 'Uruguay', 'UY', 'URY', 1),
(226, 'Uzbekistan', 'UZ', 'UZB', 1),
(227, 'Vanuatu', 'VU', 'VUT', 1),
(228, 'Vatican City State (Holy See)', 'VA', 'VAT', 1),
(229, 'Venezuela', 'VE', 'VEN', 1),
(230, 'Viet Nam', 'VN', 'VNM', 1),
(231, 'Virgin Islands (British)', 'VG', 'VGB', 1),
(232, 'Virgin Islands (U.S.)', 'VI', 'VIR', 1),
(233, 'Wallis and Futuna Islands', 'WF', 'WLF', 1),
(234, 'Western Sahara', 'EH', 'ESH', 1),
(235, 'Yemen', 'YE', 'YEM', 1),
(236, 'Yugoslavia', 'YU', 'YUG', 1),
(237, 'Zaire', 'ZR', 'ZAR', 1),
(238, 'Zambia', 'ZM', 'ZMB', 1),
(239, 'Zimbabwe', 'ZW', 'ZWE', 1);
-- --------------------------------------------------------
--
-- Table structure for table `currencies`
--
CREATE TABLE `currencies` (
`currencies_id` int(11) NOT NULL,
`title` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`code` char(3) COLLATE utf8_unicode_ci NOT NULL,
`symbol_left` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL,
`symbol_right` varchar(12) COLLATE utf8_unicode_ci DEFAULT NULL,
`decimal_point` char(1) COLLATE utf8_unicode_ci DEFAULT NULL,
`thousands_point` char(1) COLLATE utf8_unicode_ci DEFAULT NULL,
`decimal_places` char(1) COLLATE utf8_unicode_ci DEFAULT NULL,
`value` float(13,8) DEFAULT NULL,
`last_updated` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `currencies`
--
INSERT INTO `currencies` (`currencies_id`, `title`, `code`, `symbol_left`, `symbol_right`, `decimal_point`, `thousands_point`, `decimal_places`, `value`, `last_updated`) VALUES
(1, 'U.S. Dollar', 'USD', '$', NULL, '.', '.', '2', NULL, '2017-02-09 00:00:00'),
(2, 'Euro', 'EUR', NULL, '€', '.', '.', '2', NULL, NULL);
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE `customers` (
`customers_id` int(11) NOT NULL,
`customers_gender` char(1) COLLATE utf8_unicode_ci DEFAULT '0',
`customers_firstname` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`customers_lastname` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`company_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`countries_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`customers_dob` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`user_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`customers_default_address_id` int(11) DEFAULT NULL,
`customers_telephone` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`customers_fax` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`password` varchar(60) COLLATE utf8_unicode_ci NOT NULL,
`customers_newsletter` char(1) COLLATE utf8_unicode_ci DEFAULT NULL,
`isActive` tinyint(1) NOT NULL DEFAULT '1',
`fb_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`google_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
`customers_picture` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`created_at` int(100) NOT NULL,
`updated_at` int(100) NOT NULL,
`is_seen` tinyint(1) NOT NULL DEFAULT '0',
`remember_token` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `customers`
--
INSERT INTO `customers` (`customers_id`, `customers_gender`, `customers_firstname`, `customers_lastname`, `company_name`, `title_name`, `countries_name`, `customers_dob`, `email`, `user_name`, `customers_default_address_id`, `customers_telephone`, `customers_fax`, `password`, `customers_newsletter`, `isActive`, `fb_id`, `google_id`, `customers_picture`, `created_at`, `updated_at`, `is_seen`, `remember_token`) VALUES
(1, NULL, 'harmis', 'harmis', 'harmistest new', 'harmistest title', 'India', '', 'harmistest@gmail.com', '', NULL, '5452132123211', NULL, '$2y$10$GpsgFS4HG04M8e8xdFidLOie8gZ2IpIuBkww98jkfB/0qHYgLY4nu', NULL, 1, NULL, NULL, 'resources/assets/images/user_profile/default_user.png', 19, 19, 0, 'KHhBzGINzlpTOmNP1DRka1gKyjTJEhhRbRs5TgacFchUBDzTJ8gnnGuIZyU2'),
(2, NULL, 'test', 'test', 'test', 'test', 'Afghanistan', '', 'test@gmail.com', '', NULL, '', NULL, '$2y$10$B0vsSXQai8KCq.Tdp4SbD.9W4Nh6XRx/7ltQhgB4is/f.MIJvNacm', NULL, 1, NULL, NULL, 'resources/assets/images/user_profile/default_user.png', 19, 19, 0, '8kRXrVrSbi16RLYsOIbw32kTMTE2A7PZ76th5BgQrhJz7YWAI9cSmL65X72X'),
(3, NULL, 'demo', 'demo', 'demo123456', 'demo123', 'Canada', '', 'demo@gmail.com', '', NULL, '', NULL, '$2y$10$8N0FlkUdNOZRr0eb79mJBukWnBExjuksmb0/qA4RIlcLgHhQJzkAy', NULL, 1, NULL, NULL, 'resources/assets/images/user_profile/default_user.png', 19, 19, 0, 'UFfULVxIpeSg5qcCp1GONw4fL0rtijDrVSH6HZCbSTnRHvI1AoNIo6bGOqzo'),
(4, NULL, 'dddd', 'dddd', 'ccccc', 'aaaa', 'Cocos (Keeling) Islands', '', 'ddd@gmail.com', '', NULL, '787987889', NULL, '$2y$10$25wMKPnlDG1LaLjYFklVQ.vRfG1rzZcxUPQMgcYp8mU18A.f8qCbq', NULL, 1, NULL, NULL, 'resources/assets/images/user_profile/default_user.png', 19, 19, 0, ''),
(5, NULL, 'harmis', 'harmis123', 'harmis technology', 'new test', 'India', '', 'urvisha@harmistechnology.com', '', NULL, '', NULL, '$2y$10$RQZRpw2BvXMkx2a0YfSCyeGLzirwXQch5/1jexW/FXoWRGcK0hPiu', NULL, 1, NULL, NULL, 'resources/assets/images/user_profile/1550835854.googleplus.png', 19, 19, 0, 't0a3qDIP5KzVZNxrqQ9GSwp0OHBHcqp2e06khwXrgCGByhrGuPUaXbnpDl8s');
-- --------------------------------------------------------
--
-- Table structure for table `driverLicense`
--
CREATE TABLE `driverLicense` (
`id` int(11) NOT NULL,
`c_agentId` int(11) NOT NULL,
`license` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `driverLicense`
--
INSERT INTO `driverLicense` (`id`, `c_agentId`, `license`) VALUES
(20, 9, '1566207496.index.jpeg'),
(21, 10, '1566207937.index.jpeg'),
(22, 11, '1566207998.index.jpeg'),
(23, 13, '1568617782.bugati.jpg'),
(24, 13, '1568617782.download.jpg'),
(25, 13, '1568617783.images.jpg'),
(26, 14, '1568625395.IMG-20190916-WA0000.jpg'),
(27, 15, '1568625578.test.png'),
(28, 16, '1568625797.IMG-20190916-WA0000.jpg'),
(29, 17, '1568625812.test.png'),
(30, 20, '1568626194.test.png'),
(31, 22, '1568626312.IMG-20190916-WA0000.jpg'),
(32, 23, '1568627251.IMG-20190807-WA0000.jpg'),
(42, 36, '1568973017_0_coocker1.jpeg'),
(43, 36, '1568973018_1_speaker5.jpg'),
(44, 36, '1568973018_2_speaker4.jpeg'),
(45, 37, '1568974696_0_wallet7.jpeg'),
(46, 37, '1568974696_1_wallet3.jpg'),
(47, 37, '1568974696_2_user7.jpeg'),
(48, 38, '1568975101_0_wallet3.jpg'),
(49, 38, '1568975101_1_wallet1.jpeg'),
(50, 38, '1568975101_2_user6.jpeg'),
(51, 38, '1568975101_3_user5.jpeg'),
(52, 39, '1569059714.images-(1).jpeg'),
(53, 40, '1569483395.images-(2).jpeg');
-- --------------------------------------------------------
--
-- Table structure for table `fueltype`
--
CREATE TABLE `fueltype` (
`id` int(11) NOT NULL,
`name` varchar(255) CHARACTER SET utf8 NOT NULL,
`ar` varchar(255) CHARACTER SET utf8 NOT NULL,
`ku` varchar(255) CHARACTER SET utf8 NOT NULL,
`published` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `fueltype`
--
INSERT INTO `fueltype` (`id`, `name`, `ar`, `ku`, `published`) VALUES
(1, 'Petrol', 'Petrol', 'Petrol', 1),
(2, 'Diesel', 'Diesel', 'Diesel', 1),
(3, 'Gas', 'Gas', 'Gas', 1);
-- --------------------------------------------------------
--
-- Table structure for table `get_touch`
--
CREATE TABLE `get_touch` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`address` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `get_touch`
--
INSERT INTO `get_touch` (`id`, `title`, `description`, `address`, `phone`, `email`) VALUES
(1, 'Iraq Cars', '<p>Sed do eiusmod temporut labore et dolore magna aliqua. Your perfect place to buy & sell</p>', '804/2 Baghdad, iraq', '+91 0123456789', 'info@contact.com');
-- --------------------------------------------------------
--
-- Table structure for table `homeslide`
--
CREATE TABLE `homeslide` (
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`image` varchar(255) NOT NULL,
`description` longtext NOT NULL,
`titlearabic` varchar(255) CHARACTER SET utf8 NOT NULL,
`descriptionarabic` longtext CHARACTER SET utf8 NOT NULL,
`titlekurdish` varchar(255) NOT NULL,
`descriptionkurdish` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `homeslide`
--
INSERT INTO `homeslide` (`id`, `title`, `image`, `description`, `titlearabic`, `descriptionarabic`, `titlekurdish`, `descriptionkurdish`) VALUES
(1, 'BOOK A CAR TODAY!', '1568612006.slider-img-1.jpg', '<p>FOR AS LOW AS $10 A DAY PLUS 15% DISCOUNT</p><p>FOR OUR RETURNING CUSTOMERS</p>', 'احجز سيارة اليوم!', '<p>مقابل أقل من 10 دولارات في اليوم بالإضافة إلى خصم 15 ٪</p><p>لعملائنا العائدين</p>', 'TENOD LI KIRIN!', '<p>JI BO JI BO 10 $ A DAY PLN PLUS 15% KIRIN</p><p>JI BO XWARN XWEYN XWEYN</p>'),
(2, 'BOOK A CAR TODAY!', '1568612104.slider-img-2.jpg', '<p>FOR AS LOW AS $10 A DAY PLUS 15% DISCOUNT</p><p>FOR OUR RETURNING CUSTOMERS</p>', 'احجز سيارة اليوم!', '<p>مقابل أقل من 10 دولارات في اليوم بالإضافة إلى خصم 15 ٪</p><p>لعملائنا العائدين</p>', 'TENOD LI KIRIN!', '<p>JI BO JI BO 10 $ A DAY PLN PLUS 15% KIRIN</p><p>JI BO XWARN XWEYN XWEYN</p>'),
(3, 'BOOK A CAR TODAY!', '1568612148.slider-img-3.jpg', '<p>FOR AS LOW AS $10 A DAY PLUS 15% DISCOUNT</p><p>FOR OUR RETURNING CUSTOMERS</p>', 'احجز سيارة اليوم!', '<p>مقابل أقل من 10 دولارات في اليوم بالإضافة إلى خصم 15 ٪</p><p>لعملائنا العائدين</p>', 'TENOD LI KIRIN!', '<p>JI BO JI BO 10 $ A DAY PLN PLUS 15% KIRIN</p><p>JI BO XWARN XWEYN XWEYN</p>'),
(4, 'BOOK A CAR TODAY!', '1568873696.slider-img-4.jpg', '<p>FOR AS LOW AS $10 A DAY PLUS 15% DISCOUNT</p><p>FOR OUR RETURNING CUSTOMERS</p>', 'احجز سيارة اليوم!', '<p>مقابل أقل من 10 دولارات في اليوم بالإضافة إلى خصم 15 ٪</p><p>لعملائنا العائدين</p>', 'TENOD LI KIRIN!', '<p>JI BO JI BO 10 $ A DAY PLN PLUS 15% KIRIN</p><p>JI BO XWARN XWEYN XWEYN</p>');
-- --------------------------------------------------------
--
-- Table structure for table `languages`
--
CREATE TABLE `languages` (
`languages_id` int(11) NOT NULL,
`name` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`code` char(2) COLLATE utf8_unicode_ci NOT NULL,
`image` mediumtext COLLATE utf8_unicode_ci,
`directory` varchar(32) COLLATE utf8_unicode_ci DEFAULT NULL,
`sort_order` int(3) DEFAULT NULL,
`direction` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`is_default` tinyint(1) DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `languages`
--
INSERT INTO `languages` (`languages_id`, `name`, `code`, `image`, `directory`, `sort_order`, `direction`, `is_default`) VALUES
(1, 'English', 'en', 'resources/assets/images/language_flags/1486556365.503984030_english.jpg', 'english', 1, 'ltr', 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, '2019_05_01_064329_user_group', 1);
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
CREATE TABLE `orders` (
`Order_ID` int(11) NOT NULL,
`User_ID` int(11) NOT NULL,
`Status` varchar(255) NOT NULL,
`TotalCount` varchar(255) NOT NULL,
`Name` varchar(255) NOT NULL,
`Mobile` varchar(255) NOT NULL,
`pincode` varchar(255) NOT NULL,
`address` longtext NOT NULL,
`city` int(255) NOT NULL,
`datetime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `orders`
--
INSERT INTO `orders` (`Order_ID`, `User_ID`, `Status`, `TotalCount`, `Name`, `Mobile`, `pincode`, `address`, `city`, `datetime`) VALUES
(1, 4, 'Delivered', '4404350', 'edward', '9632587410', '380015', 'new', 12, '2019-09-17 07:50:16'),
(2, 5, 'Delivered', '20', 'hello', '3698521470', 'nehrunagar', 'nehrunagar', 0, '2019-09-17 09:00:45'),
(3, 5, 'Shipping', '20', 'hello', '3698521470', 'nehrunagar', 'nehrunagar', 0, '2019-09-17 09:05:15'),
(4, 5, 'Pending', '20', 'hello', '3698521470', 'nehrunagar', 'nehrunagar', 0, '2019-09-17 09:35:59'),
(5, 16, 'Pending', '400000.0', 'carloc patel', '9898989898', 'Iraq', 'Iraq', 0, '2019-09-17 09:43:38'),
(6, 16, 'Pending', '400000.0', 'carloc patel', '9898989898', 'Iraq', 'Iraq', 0, '2019-09-17 09:50:22'),
(7, 15, 'Pending', '50000', 'Nancy hawlett', '7845127845', '78964563', 'america', 12, '2019-09-17 10:41:11'),
(8, 4, 'Pending', '450000', 'bcxb', '9632587410', '380015', 'new', 17, '2019-09-17 12:31:24'),
(9, 4, 'Pending', '450000', 'jfg', '9632587410', '380015', 'newjgfjf', 19, '2019-09-17 12:32:42'),
(10, 17, 'Pending', '3048045', 'test1', '9789', '879', '87987', 18, '2019-09-17 12:33:24'),
(11, 4, 'Pending', '450000', 'jfg', '9632587410', '380015', 'newjgfjf', 19, '2019-09-17 12:33:44'),
(12, 4, 'Pending', '450000', 'jfg', '9632587410', '380015', 'newjgfjf', 19, '2019-09-17 12:35:34'),
(13, 4, 'Pending', '450000', 'jfg', '9632587410', '380015', 'newjgfjf', 19, '2019-09-17 12:35:54'),
(14, 4, 'Pending', '450000', 'jfg', '9632587410', '380015', 'newjgfjf', 19, '2019-09-17 12:36:00'),
(15, 4, 'Pending', '100000', 'helloma', '9632587410', '380015', '123456', 20, '2019-09-18 04:41:46'),
(16, 15, 'Pending', '970870', 'sandip', '78755555', '7874125', 'ahmedabad', 11, '2019-09-19 04:43:16'),
(17, 15, 'Pending', '435435', 'Nancy hawlett', '7845127845', '78964563', 'america', 12, '2019-09-19 07:21:24'),
(20, 12, 'Pending', '100000.0', 'carlocal olpoo', '9865323652', 'Mosul, Iraq', 'Mosul, Iraq', 0, '2019-09-20 11:55:15'),
(21, 15, 'Pending', '50000', 'Nancy hawlett', '7845127845', '78964563', 'america', 12, '2019-09-20 12:00:19'),
(22, 4, 'Pending', '50000', 'urvi', '9856232653', '380015', 'new', 19, '2019-09-20 12:01:12'),
(23, 15, 'Pending', '150000', 'Nancy hawlett', '7845127845', '78964563', 'america', 12, '2019-09-20 12:54:32'),
(24, 15, 'Pending', '100000', 'Nancy hawlett', '7845127845', '78964563', 'america', 12, '2019-09-20 12:55:06'),
(26, 12, 'Pending', '1035435.0', 'carlocal olpoo', '9865323652', 'Mosul, Iraq', 'Mosul, Iraq', 0, '2019-09-21 05:14:35'),
(27, 12, 'Pending', '635435.0', 'carlocal olpoo', '9865323652', 'Mosul, Iraq', 'Mosul, Iraq', 0, '2019-09-21 05:15:34'),
(28, 12, 'Pending', '635435.0', 'carlocal olpoo', '9865323652', 'Mosul, Iraq', 'Mosul, Iraq', 0, '2019-09-21 05:28:44'),
(29, 12, 'Pending', '150000.0', 'carlocal olpoo', '9865323652', 'Mosul, Iraq', 'Mosul, Iraq', 0, '2019-09-21 09:26:04'),
(30, 15, 'Pending', '300000', 'sandip', '78755555', '7874125', 'ahmedabad', 11, '2019-09-23 04:10:19'),
(31, 15, 'Pending', '100000', 'sandip', '78755555', '7874125', 'B 304/2,harmis technology,\nGopal palace jhansi ki rani BRTS bus stop,\nnear siromani complex', 12, '2019-09-23 05:18:11'),
(33, 19, 'Pending', '250000.0', 'testuser ', '9898989898', 'hello', 'hello', 0, '2019-09-23 09:21:31'),
(34, 19, 'Pending', '250000.0', 'testuser ', '7889788978', 'hello', 'hello', 0, '2019-09-23 09:22:58'),
(35, 19, 'Pending', '250000.0', 'testuser ', '896325410', 'hello', 'hello', 0, '2019-09-23 09:24:15'),
(36, 19, 'Pending', '250000.0', 'testuser ', '9898653265', 'nadiad', 'nadiad', 0, '2019-09-23 10:16:12'),
(37, 21, 'Pending', '150000.0', 'carlive ssss', '9898653265', 'Mosul, Iraq', 'Mosul, Iraq', 0, '2019-09-26 06:57:19'),
(38, 23, 'Pending', '100000', 'ravi', '7845127845', '78964563', 'america', 12, '2019-09-26 12:59:08'),
(39, 17, 'Pending', '1000000', 'prakash', '789456123', '78954', 'bsdjgbjsfbg', 11, '2019-09-27 05:25:36'),
(40, 17, 'Pending', '435435', 'prakash', '7845623123', '78946', 'dvshfjvhdsjvf', 10, '2019-09-27 05:30:32'),
(41, 19, 'Pending', '45000', 'test', '785464132', '7845', 'ljbdfhkgv', 20, '2019-09-27 05:39:21'),
(42, 14, 'Shipping', '90000', 'kinjal', '789456123', '789584', 'jsfbgjkbsk', 12, '2019-09-27 07:47:56'),
(43, 14, 'Pending', '435435', 'kinajal', '785456456', '789456', 'fsbgj', 11, '2019-09-27 07:50:39'),
(44, 14, 'Delivered', '145000', 'kinjal', '789456123', '798456', 'fjkdbshgvb', 17, '2019-09-27 07:51:48');
-- --------------------------------------------------------
--
-- Table structure for table `paymentGatway`
--
CREATE TABLE `paymentGatway` (
`id` int(11) NOT NULL,
`ownerid` int(11) NOT NULL,
`propertyid` int(11) NOT NULL,
`paymentId` longtext NOT NULL,
`amount` varchar(255) NOT NULL,
`customerId` longtext NOT NULL,
`status` longtext NOT NULL,
`recipetUrl` longtext NOT NULL,
`balId` longtext NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`video` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `paymentGatway`
--
INSERT INTO `paymentGatway` (`id`, `ownerid`, `propertyid`, `paymentId`, `amount`, `customerId`, `status`, `recipetUrl`, `balId`, `date`, `video`) VALUES
(1, 0, 0, 'ch_1EfM6jGebdXgb90nZvPswGoO', '50', 'cus_F9fRICC4rTN2TQ', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1EfM6jGebdXgb90nZvPswGoO/rcpt_F9fRMju0FzdBPs8UmKeq83sFH8EXONc', 'txn_1EfM6jGebdXgb90nR2vzvwbQ', '2019-07-13 12:46:09', ''),
(2, 0, 0, 'ch_1EfMESGebdXgb90n5vjL2XgW', '50', 'cus_F9fZNo3NAm9Fby', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1EfMESGebdXgb90n5vjL2XgW/rcpt_F9fZFMx5mkwpL28d6Ga0awqtC5dXxOh', 'txn_1EfMETGebdXgb90n98vnfIXq', '2019-07-13 12:46:09', ''),
(3, 0, 0, 'ch_1EnKgGGebdXgb90n90KTu9gx', '50', 'cus_FHuVWV49w76uPh', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1EnKgGGebdXgb90n90KTu9gx/rcpt_FHuVhKXGTQe0HzzzGpMAI5wkVTuapkO', 'txn_1EnKgGGebdXgb90n5dHR6bsG', '2019-07-13 12:46:09', ''),
(4, 1, 0, 'ch_1EvkaqGebdXgb90nFB7kpnHb', '50', 'cus_FQbolfs43kai5t', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1EvkaqGebdXgb90nFB7kpnHb/rcpt_FQboJjSsPjWZDBPIwaDjCqdgU9vNAj0', 'txn_1EvkaqGebdXgb90nHZjyznrO', '2019-07-13 12:46:09', ''),
(5, 1, 2, 'ch_1Evkh9GebdXgb90nDxejY6nN', '50', 'cus_FQbuGPCEpwOoZW', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1Evkh9GebdXgb90nDxejY6nN/rcpt_FQbuyRzTgungVgqSjw0DfXN2uY1XGua', 'txn_1Evkh9GebdXgb90nlWycMOsT', '2019-07-13 12:51:20', ''),
(6, 12, 102, 'ch_1EywDXGebdXgb90nPY3lo3Ql', '500', 'cus_FTu1QKzyzpwzIc', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1EywDXGebdXgb90nPY3lo3Ql/rcpt_FTu1my9K0uWBHWkVDqdjJhUSyEl2tzc', 'txn_1EywDXGebdXgb90nnRZPlXCx', '2019-07-22 07:45:56', 'http://192.168.1.20/realestate/public/templateVideo/20190516.180301_10_A_GardenHill_10.mp4'),
(7, 12, 102, 'ch_1EywEzGebdXgb90ndL7U5NeI', '500', 'cus_FTu3lQgvPwLZoR', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1EywEzGebdXgb90ndL7U5NeI/rcpt_FTu3ztlz1JR2DjCYq4on60dkelcRBtg', 'txn_1EywEzGebdXgb90n8tLOgHSO', '2019-07-22 07:47:26', 'public/templateVideo/20190516.180301_10_A_GardenHill_10.mp4'),
(8, 12, 102, 'ch_1EywGvGebdXgb90nX33QZtiA', '500', 'cus_FTu5E46rKdCNO9', 'Payment complete.', 'https://pay.stripe.com/receipts/acct_1Eb63KGebdXgb90n/ch_1EywGvGebdXgb90nX33QZtiA/rcpt_FTu5t0uwXRUcV7jBv5osJTQs7v0Ad63', 'txn_1EywGvGebdXgb90neKruwiBs', '2019-07-22 07:49:25', '20190516.180301_10_A_GardenHill_10.mp4');
-- --------------------------------------------------------
--
-- Table structure for table `pdf_report`
--
CREATE TABLE `pdf_report` (
`id` int(11) NOT NULL,
`pro_name` varchar(255) NOT NULL,
`pdf_upload` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `pdf_report`
--
INSERT INTO `pdf_report` (`id`, `pro_name`, `pdf_upload`) VALUES
(1, '6', '1559127909.Two-page-Hello-World.pdf'),
(2, '7', '1559129065.Expense-Report.pdf'),
(3, '6', '1559547762.new_enquiry.pdf');
-- --------------------------------------------------------
--
-- Table structure for table `Place_Order`
--
CREATE TABLE `Place_Order` (
`Place_Order_ID` int(11) NOT NULL,
`Order_ID` int(11) NOT NULL,
`Product_ID` int(11) NOT NULL,
`Name` varchar(255) NOT NULL,
`Price` varchar(255) NOT NULL,
`Quantity` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `Place_Order`
--
INSERT INTO `Place_Order` (`Place_Order_ID`, `Order_ID`, `Product_ID`, `Name`, `Price`, `Quantity`) VALUES
(1, 1, 7, 'Tire Set', '435435', 1),
(2, 1, 11, 'Sound System', '50000', 2),
(3, 2, 1, 'newone', '10', 1),
(4, 2, 1, 'newone', '10', 1),
(5, 3, 7, 'Tire Set', '10', 1),
(6, 3, 11, 'Sound System', '10', 1),
(7, 4, 7, 'Tire Set', '10', 1),
(8, 4, 11, 'Sound System', '10', 1),
(9, 5, 12, 'AC colder', '400000.0', 4),
(10, 6, 12, 'AC colder', '400000.0', 4),
(11, 7, 11, 'Sound System', '50000', 2),
(12, 14, 11, 'Sound System', '50000', 9),
(13, 15, 12, 'AC colder', '100000', 1),
(14, 16, 7, 'Tire Set', '435435', 1),
(15, 16, 12, 'AC colder', '100000', 25),
(16, 17, 7, 'Tire Set', '435435', 1),
(22, 23, 11, 'Sound System', '50000', 1),
(28, 26, 7, 'Tire Set', '435435.0', 1),
(30, 27, 7, 'Tire Set', '435435.0', 1),
(32, 28, 7, 'Tire Set', '435435.0', 1),
(33, 29, 12, 'AC colder', '100000.0', 1),
(35, 30, 12, 'AC colder', '100000', 3),
(36, 31, 12, 'AC colder', '100000', 1),
(38, 33, 12, 'AC colder', '100000.0', 1),
(39, 33, 11, 'Sound System', '150000.0', 3),
(40, 34, 12, 'AC colder', '100000.0', 1),
(41, 34, 11, 'Sound System', '150000.0', 3),
(42, 35, 12, 'AC colder', '100000.0', 1),
(43, 35, 11, 'Sound System', '150000.0', 3),
(44, 36, 12, 'AC colder', '100000.0', 1),
(45, 36, 11, 'Sound System', '150000.0', 3),
(46, 37, 12, 'AC colder', '100000.0', 1),
(47, 37, 11, 'Sound System', '50000.0', 1),
(48, 38, 12, 'AC colder', '100000', 1),
(49, 39, 12, 'AC colder', '100000', 10),
(50, 40, 7, 'Tire Set', '435435', 1),
(51, 41, 13, 'demo pro', '45000', 1),
(52, 42, 13, 'demo pro', '45000', 2),
(53, 43, 7, 'Tire Set', '435435', 1),
(54, 44, 13, 'demo pro', '45000', 1),
(55, 44, 12, 'AC colder', '100000', 1);
-- --------------------------------------------------------
--
-- Table structure for table `procategory`
--
CREATE TABLE `procategory` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`ar` varchar(255) CHARACTER SET utf8 NOT NULL,
`ku` varchar(255) CHARACTER SET utf8 NOT NULL,
`published` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `procategory`
--
INSERT INTO `procategory` (`id`, `name`, `ar`, `ku`, `published`) VALUES
(3, 'Interior Parts', 'Interior Parts', 'Interior Parts', 1),
(4, 'Exterior Parts', 'الأجزاء الخارجية', 'Parçeyên derveyî', 1),
(5, 'Ignition System', 'Ignition System', 'Ignition System', 1),
(6, 'Engines & Components', 'Engines & Components', 'Engines & Components', 1),
(7, 'Air Intake System', 'Air Intake System', 'Air Intake System', 1),
(8, 'Brake System', 'Brake System', 'Brake System', 1),
(9, 'Cooling System', 'Cooling System', 'Cooling System', 1),
(10, 'Glasses & Windows', 'Glasses & Windows', 'Glasses & Windows', 1),
(11, 'Other Tools', 'Other Tools', 'Other Tools', 1);
-- --------------------------------------------------------
--
-- Table structure for table `properties`
--
CREATE TABLE `properties` (
`id` int(11) NOT NULL,
`property_name` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`city` int(11) NOT NULL,
`sale_price` varchar(20) DEFAULT NULL,
`month_rentprice` varchar(255) DEFAULT NULL,
`daily_rentprice` float DEFAULT NULL,
`weekly_rentprice` float DEFAULT NULL,
`description` longtext NOT NULL,
`pro_type` int(11) NOT NULL,
`car_brand` int(11) NOT NULL,
`kilometer` varchar(255) NOT NULL,
`year_of_car` varchar(255) NOT NULL,
`specification` varchar(255) NOT NULL,
`prop_category` varchar(255) DEFAULT NULL,
`fueltype` varchar(255) NOT NULL,
`googleLocation` text NOT NULL,
`lat` varchar(255) NOT NULL,
`lng` varchar(255) NOT NULL,
`userType` varchar(255) NOT NULL COMMENT '1=users,2=showroom,3=company',
`userId` int(11) NOT NULL,
`showRoomId` int(11) NOT NULL,
`companyId` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL,
`isrequested` int(11) NOT NULL,
`published` tinyint(4) NOT NULL,
`video` varchar(255) NOT NULL,
`gear_type` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `properties`
--
INSERT INTO `properties` (`id`, `property_name`, `address`, `city`, `sale_price`, `month_rentprice`, `daily_rentprice`, `weekly_rentprice`, `description`, `pro_type`, `car_brand`, `kilometer`, `year_of_car`, `specification`, `prop_category`, `fueltype`, `googleLocation`, `lat`, `lng`, `userType`, `userId`, `showRoomId`, `companyId`, `email`, `phone`, `isrequested`, `published`, `video`, `gear_type`) VALUES
(1, 'swift', 'dshjkfhjv', 18, '150000', '12000', 0, 0, 'hdsvfhj', 1, 4, '50000', '1995', '3', '11', '1', 'Jashodanagar Fire Station, Jashoda Nagar, Ahmedabad, Gujarat, India', '22.9833426', '72.62410990000001', '1', 2, 0, 29, 'murat@gmail.com', '789456123', 0, 1, '', 'Automatic'),
(2, 'scorpio', 'fsgsfg', 11, '780000', '45000', NULL, NULL, 'dghdgh', 1, 3, '456', '2016', 'mahindra', '6', '', 'Naroda, Ahmedabad, Gujarat, India', '23.0685865', '72.65359609999996', '1', 3, 0, 0, 'bella@gmail.com', '789456123', 0, 1, '', ''),
(3, 'Wagon R', 'jdkbkf', 11, '7895000', '78000', 0, 0, 'sdfbhgb', 1, 2, '456000', '2016', '1', '2', '2', 'Jashodanagar Fire Station, Jashoda Nagar, Ahmedabad, Gujarat, India', '22.9833426', '72.62410990000001', '1', 3, 0, 0, 'prakash@gmail.com', '789456123', 1, 1, '', 'Automatic'),
(4, 'volo sport', 'dbafkjbdsfk', 17, '78000000', '4513', NULL, NULL, 'jskdbgkjbsd', 2, 10, '3550000', '2025', 'abcd', '18', '', 'Dubai - United Arab Emirates', '25.2048493', '55.270782800000006', '2', 0, 30, 0, 'prakash@gmail.com', '789456123', 0, 1, '', 'Manual'),
(6, 'volvo', 'fdsghfh', 13, '4500000', '369451', NULL, NULL, 'fsgdfg', 1, 10, '78000', '25', '2', '18', '2', 'Kuwait', '29.31166', '47.48176599999999', '2', 0, 24, 0, 'prakash@gmail.com', '789456132', 0, 1, '', 'Automatic'),
(7, 'maruti swift', 'bkfhjdsbgk', 15, '4500000', '985', NULL, NULL, 'sbfgkjb', 1, 2, '435', '40', 'bhjfs gh', '1', '', 'JSS Circle, 7th Block, Jayanagar, Bengaluru, Karnataka', '12.923413', '77.57621549999999', '2', 0, 24, 0, 'akash@gmail.com', '789456456132', 0, 1, '', ''),
(13, 'Mahindra', 'ahmedabad', 14, '56000', '', NULL, NULL, 'made in india', 1, 3, '7000', '2015', 'Petrol Manual 20/22 KMPL', '7', '', 'ahmedabad', '', '', '1', 1, 0, 0, 'prakash@gmail.com', '789456123', 0, 1, '', ''),
(14, 'Mahindra', 'ahmedabad', 18, '56000', '', NULL, NULL, 'made in india', 1, 3, '7000', '2015', 'Petrol Manual 20/22 KMPL', '7', '', 'ahmedabad', '', '', '1', 1, 0, 0, 'prakash@gmail.com', '789456123', 0, 1, '', ''),
(15, 'Mahindra', 'ahmedabad', 17, '56000', '', NULL, NULL, 'made in india', 1, 3, '7000', '2015', 'Petrol Manual 20/22 KMPL', '7', '', 'ahmedabad', '', '', '1', 1, 0, 0, 'prakash@gmail.com', '789456123', 0, 1, '', ''),
(16, 'Mahindra', 'ahmedabad', 16, '450000', '', NULL, NULL, 'made in india', 1, 3, '50000', '2011', 'Petrol Manual 20/22 KMPL', '6', '', 'iraq', '', '', '1', 1, 0, 0, 'prakash@gmail.com', '789456123', 0, 1, '', ''),
(17, 'dfhgd', 'fghgf', 0, '456476', '', NULL, NULL, 'gchfgh', 1, 3, '65365', '4567', 'gfhfghfgh', '2', '', 'Daftö, Sweden', '58.9037652', '11.183584600000017', '1', 2, 0, 0, 'cvhfg@gmail.com', '78945643123', 0, 1, '', ''),
(18, 'rt', 'df', 2, '67', '566', NULL, NULL, 'dfdf', 1, 3, '56', '2013', 'df', '2', '', 'Ahmednagar, Maharashtra, India', '19.0948287', '74.74797890000002', '1', 1, 0, 0, 'tes@gmail.com', '45', 0, 1, '', ''),
(19, 'Ford', 'Mosul, Iraq', 0, '', '3000000', NULL, NULL, 'bfhfj', 2, 5, '30000', '', '3 tear ac', '6', '', 'Mosul, Iraq', '', '', '1', 9, 0, 0, 'amit@gmail.com', '9724604987', 0, 0, '', ''),
(20, 'Ford', 'Mosul, Iraq', 0, '', '3000000', NULL, NULL, 'bfhfj', 2, 5, '30000', '', '3 tear ac', '6', '', 'Mosul, Iraq', '', '', '1', 9, 0, 0, 'amit@gmail.com', '9724604987', 0, 1, '', ''),
(21, 'Ford', 'Mosul, Iraq', 13, '2000000', '2000000', NULL, NULL, 'car desc updated', 2, 5, '200000', '2012', 'Heavy Body', '18', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(22, 'Ford', 'Mosul, Iraq', 0, '600000', '50000', NULL, NULL, 'car is actually 5years old and better comdomt', 1, 5, '60000', '', 'Auto', '8', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9898989898', 0, 1, '', ''),
(23, 'Tata', 'Mosul, Iraq', 0, '500000', '', NULL, NULL, 'xbxxb', 1, 4, '10000', '', '320 speed', '8', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(24, 'Ford', 'Mosul, Iraq', 0, '20000', '', NULL, NULL, 'vxvd', 1, 5, '50000', '', '3 tear ac', '7', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(25, 'Mahindra', 'Mosul, Iraq', 0, '', '20000', NULL, NULL, 'ggsgs', 2, 3, '500000', '', '320 speed', '5', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 0, '', ''),
(26, 'Tata', 'Mosul, Iraq', 0, '', '200000', NULL, NULL, 'gzgz', 2, 4, '98998888', '', '3 tear ac', '9', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 0, '', ''),
(27, 'Tata', 'Mosul, Iraq', 0, '', '20000', NULL, NULL, 'xxnnc', 2, 4, '5000', '', 'Tubeless', '8', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(28, 'Tata', 'Mosul, Iraq', 0, '', '20000', NULL, NULL, 'gzgxg', 2, 4, '230', '', '320 speed', '6', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(29, 'Tata', 'Kurdistan, Erbil, Iraq', 0, '20000', '', NULL, NULL, 'dggdgd', 1, 4, '552525', '', 'Auto', '7', '', 'Kurdistan, Erbil, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(30, 'Tata', 'Kurdistan, Erbil, Iraq', 0, '', '20000', NULL, NULL, 'gdgdg', 2, 4, '200', '', '3 tear ac', '7', '', 'Kurdistan, Erbil, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(31, 'Ford', 'Mosul, Iraq', 0, '', '200000', NULL, NULL, 'good condition', 2, 5, '30000', '', '3 tear ac', '9', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(32, 'Mahindra', 'Mosul, Iraq', 0, '2000000', '2000000', NULL, NULL, 'good dafsd', 1, 3, '22322222', '', 'Tubeless', '8', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 0, '', ''),
(33, 'new add car', 'test', 18, '4567', '345', NULL, NULL, 'test', 2, 4, '456', '19-09-1999', '3', '2', '3', 'Iraq', '33.223191', '43.679291000000035', '3', 0, 0, 28, 'kinnari@gmail.com', '7894561320', 0, 1, '', 'Manual'),
(34, 'Tata', 'Mosul, Iraq', 0, '', '2000', NULL, NULL, 'dhhdh', 2, 4, '20000', '', '320 speed', '9', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(35, 'Ford', 'Mosul, Iraq', 0, '', '20000', NULL, NULL, 'good', 2, 5, '2000', '', '3 tear ac', '7', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(36, 'Ford', 'Mosul, Iraq', 0, '', '20000', NULL, NULL, 'dhhdg', 2, 5, '2000', '', '320 speed', '7', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(37, 'Tata', 'Kurdistan, Erbil, Iraq', 0, '200000', '', NULL, NULL, 'fdfsfs', 1, 4, '23535', '', '320 speed', '8', '', 'Kurdistan, Erbil, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(38, 'Tata', 'Kurdistan, Erbil, Iraq', 0, '', '2000000', NULL, NULL, 'dhhdgd', 2, 4, '20000', '', '320 speed', '8', '', 'Kurdistan, Erbil, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 1, '', ''),
(39, 'test harmiskj', 'nahrunagar', 10, '4567', '345', NULL, NULL, 'test', 2, 4, '456', '19-09-1999', 'trtrt', '6', '', 'iraq', '33.223191', '43.679291000000035', '3', 2, 0, 29, 'kinnari@gmail.com', '784561231230', 0, 1, '', ''),
(40, 'Ford', 'Mosul, Iraq', 0, '20000', '20000', NULL, NULL, 'hgdg', 2, 5, '5000000', '', 'Heavy Body', '18', '', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 0, '', ''),
(41, 'new', '4224', 19, '242424242', '2424242', NULL, NULL, '24', 2, 3, '1500', '1205', '2', '2', '1', 'Iraq', '33.223191', '43.679291000000035', '3', 0, 0, 28, 'caifgigfr@gmail.com', '9632587410', 0, 1, '', 'Automatic'),
(42, 'Ford', 'Kurdistan, Erbil, Iraq', 0, '', '200000', NULL, NULL, 'vxvxg', 2, 5, '5000', '', '320 speed', '1', '', 'Kurdistan, Erbil, Iraq', '', '', '1', 16, 0, 0, 'carloc@gmail.com', '9898989898', 1, 1, '', ''),
(43, 'testst', 'testtt', 19, '4567', '345', NULL, NULL, 'teeeee', 2, 11, '4545', '2019', '2', '2', '2', 'Iraq', '33.223191', '43.679291000000035', '3', 0, 0, 28, 'card@gmail.com', '784561231230', 0, 1, '', ''),
(44, 'new property', 'tsanbvuii', 13, '4567', '30000', 500, 5000, 'sanvi car', 2, 3, '456', '2019', '2', '', '2', 'Iraq - Dubai - United Arab Emirates', '25.2275086', '55.171734300000026', '3', 0, 0, 28, 'test@gmail.com', '7894561320', 0, 1, '', 'Automatic'),
(45, 'new add car', '87987', 17, '4567', '4513', NULL, NULL, 'testt', 0, 5, '456', '2015', '4', '4', '3', 'Iraqi Museum, Baghdad, Iraq', '33.3284501', '44.385909800000036', '2', 0, 25, 0, 'kinnari@gmail.com', '9789', 0, 1, '', 'Automatic'),
(46, 'BMW', 'Iraq', 17, '200000', '', NULL, NULL, 'cncnnc', 1, 24, '50000', '', '4', '13', '2', 'Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 0, 0, '', 'Manual'),
(47, 'Maruti-Suzuki', 'Mosul, Iraq', 10, '20000', '', NULL, NULL, 'gghh', 1, 2, '2323', '', '3', '1', '3', 'Mosul, Iraq', '', '', '1', 12, 0, 0, 'carlocal@gmail.com', '9865323652', 1, 1, 'https://www.youtube.com/embed/IyETom5jxDc', 'Automatic'),
(48, 'mahindra XUV300', 'chfghghfghfsghfsgh', 11, '4500000', '', NULL, NULL, 'ghghsgdfhdfgh', 1, 3, '50000', '2019', '2', '5', '2', 'iraq', '', '', '1', 2, 0, 0, 'prakash@gmail.com', '789456123', 0, 1, 'https://www.youtube.com/watch?v=22zDVWH9cgM', 'Automatic'),
(49, 'tigor', 'fsgsgs', 14, '45000000', '', NULL, NULL, 'grgfsgsg', 1, 4, '45000', '2016', '2', '13', '2', 'Iraq - Dubai - United Arab Emirates', '25.2275086', '55.171734300000026', '1', 2, 0, 0, 'prakash@gmail.com', '789456123', 0, 1, 'https://www.youtube.com/watch?v=epJqtMGk4Jk', 'Manual'),
(50, 'audi mix', '', 12, '230000', '230000', NULL, NULL, 'test', 2, 4, '2013', '2013', '2', '10', '3', 'India', '20.593684', '78.96288000000004', '1', 17, 0, 0, 'hp1@hmail.com', '6599999991', 0, 2, 'https://www.youtube.com/watch?v=tQ0mzXRk-oM', 'Manual'),
(51, 'Endevour', '', 12, '360000', '', NULL, NULL, 'psum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of', 1, 5, '25000', '2016', '5', '16', '1', 'India', '20.593684', '78.96288000000004', '1', 17, 0, 0, 'hitesh@gmail.com', '9866788891', 0, 1, 'https://www.youtube.com/watch?v=Tp6Xu6i7sLg', 'Manual'),
(54, 'verna 1.6', '', 13, '780000', '', NULL, NULL, 'Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry\'s standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containin', 1, 4, '26000', '2016', '3', '10', '2', 'India', '20.593684', '78.96288000000004', '1', 17, 0, 0, 'hp@hmail.com', '9834523331', 0, 1, 'https://www.youtube.com/watch?v=uJ8a8-i1cqE', 'Manual'),
(55, 'Premier', 'Mosul, Iraq', 10, '2009', '', NULL, NULL, 'very good condition of this car', 1, 46, '20000', '', '1', '1', '1', 'Mosul, Iraq', '', '', '1', 19, 0, 0, 'testuser@gmail.com', '9865326598', 0, 1, '', ''),
(56, 'Khataro', 'america', 13, '10', '0', 0, 0, 'first Number Car', 1, 3, '30', '1.5', '3', '2', '3', 'america', '', '', '1', 2, 0, 0, 'sandeep@harmistechnology.com', '78787878787', 0, 1, 'http://192.168.1.25/cars/admin/property/56/edit', 'Manual'),
(57, 'Khataro', 'B 304/2,harmis technology,\r\nGopal palace jhansi ki rani BRTS bus stop,\r\nnear siromani complex', 11, '0', '1000000', 1000, 10000, 'hiiii', 2, 4, '50', '1.5', '3', '4', '3', 'fffff', '', '', '1', 1, 0, 0, 'car@gmail.com', '78755555', 0, 1, 'https://www.youtube.com/watch?v=NtzftGb0EcM', 'Automatic'),
(58, 'sandip', '', 11, NULL, '50000', NULL, NULL, 'all place', 2, 4, '2220', '1.5', '2', '11', '2', 'All Places Map, Pocket 4, Sector 25, Rohini, New Delhi, Delhi, India', '28.7358489', '77.09602999999993', '1', 15, 0, 0, 'car@gmail.com', '78755555', 0, 1, 'https://www.youtube.com/watch?v=NtzftGb0EcM', 'Manual'),
(59, 'new car', '', 15, '4500000', NULL, NULL, NULL, 'fhgdhfghjj', 1, 4, '5000000', '2016', '2', '10', '3', 'Al Qa\'im, Iraq', '34.316858', '41.16025969999998', '1', 4, 0, 0, 'prakash@gmail.com', '7894561232', 0, 1, '', 'Manual'),
(60, 'Audi', 'Mosul, Iraq', 10, '2019', NULL, NULL, NULL, 'good description', 1, 21, '20000', '', '5', '18', '2', 'Mosul, Iraq', '', '', '1', 21, 0, 0, 'carlive@gmail.com', '9898986532', 0, 1, '', ''),
(61, 'Ashok Leyland', 'Mosul, iraq', 10, '2015', NULL, NULL, NULL, 'shhdgd', 1, 12, '2000', '', '2', '8', '2', 'Mosul, iraq', '', '', '1', 14, 0, 0, 'carlive@gmail.com', '9865323652', 0, 1, 'fdgfdgdf', ''),
(62, 'Ashok Leyland', 'Mosul, iraq', 10, '2015', NULL, NULL, NULL, 'shhdgd', 1, 12, '2000', '', '2', '8', '2', 'Mosul, iraq', '', '', '1', 14, 0, 0, 'carlive@gmail.com', '9865323652', 0, 1, '', ''),
(63, 'audi mix', 'zsczxc', 13, '', '345', 13000, 200, 'xzcxzc', 1, 3, '2013', '2016', '1', '6', '3', 'India', '20.593684', '78.96288000000004', '2', 0, 28, 0, 'car@gmail.com', '9789', 0, 1, '435', 'Manual'),
(64, 'audi mix', 'jkjk', 10, 'dsf', '0', 0, 0, 'lkl', 2, 3, '2013', '2013', '2', '6', '2', 'India', '20.593684', '78.96288000000004', '3', 0, 28, 28, 'car@gmail.com', '9789', 0, 1, '', 'Manual'),
(66, 'cfxg', '5465454564556t5', 15, '', '', 0, 0, 'dfgfdg', 1, 4, '546', '2016', '3', '12', '1', 'India', '20.593684', '78.96288000000004', '2', 0, 45, 0, 'hitesh@gmail.com', '9789', 0, 1, '', 'Automatic');
-- --------------------------------------------------------
--
-- Table structure for table `property_category`
--
CREATE TABLE `property_category` (
`id` int(11) NOT NULL,
`name` varchar(255) CHARACTER SET utf8 NOT NULL,
`ar` varchar(255) CHARACTER SET utf8 NOT NULL,
`ku` varchar(255) CHARACTER SET utf8 NOT NULL,
`car_brand_id` int(11) NOT NULL,
`published` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `property_category`
--
INSERT INTO `property_category` (`id`, `name`, `ar`, `ku`, `car_brand_id`, `published`) VALUES
(1, 'Maruti Swift', 'ماروتي سويفت', 'ماروتی سوئفٹ۔', 2, 1),
(2, 'Maruti Wagon R', '', '', 2, 1),
(3, 'Maruti Vitara Brezza', '', '', 2, 1),
(4, 'Maruti Dzire', '', '', 2, 1),
(5, 'Mahindra XUV300', '', '', 3, 1),
(6, 'Mahindra Scorpio', '', '', 3, 1),
(7, 'Mahindra XUV500', '', '', 3, 1),
(8, 'Mahindra Thar', '', '', 3, 1),
(9, 'Mahindra Bolero', '', '', 3, 1),
(10, 'Tata Tiago NRG', 'ghg', 'fjhj', 4, 1),
(11, 'Tata Tiago', 'ماروتي سوزوكي', 'Beşa Navxwe', 4, 1),
(12, 'Tata Tiago JTP', '', '', 4, 1),
(13, 'Tata Tigor JTP', '', '', 4, 1),
(14, 'Ford EcoSport', '', '', 5, 1),
(15, 'Ford Freestyle', '', '', 5, 1),
(16, 'Ford Endeavour', '', '', 5, 1),
(17, 'Ford Figo', '', '', 5, 1),
(18, 'Volvo', '', '', 10, 1);
-- --------------------------------------------------------
--
-- Table structure for table `property_img`
--
CREATE TABLE `property_img` (
`id` int(11) NOT NULL,
`property_id` int(11) NOT NULL,
`img_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `property_img`
--
INSERT INTO `property_img` (`id`, `property_id`, `img_name`) VALUES
(1, 1, '1564481212.8602019-maruti_swift.jpg'),
(2, 2, '1564481277.scorpio.jpeg'),
(3, 3, '1564555733.scorpio.jpeg'),
(25, 7, '1564564838.8602019-maruti_swift.jpg'),
(26, 4, '1564642089.scorpio.jpeg'),
(27, 5, '1564996050.8602019-maruti_swift.jpg'),
(28, 6, '1564996158.8602019-maruti_swift.jpg'),
(41, 13, '1565682293.download.jpeg'),
(42, 14, '1565700651.download-(1).jpeg'),
(43, 16, '1566540734.ic_bus.png'),
(44, 1, '1566541533.bicycle5.jpeg'),
(46, 17, '1566544011.bicycle5.jpeg'),
(47, 18, '1566557357.download.jpeg'),
(48, 19, '1566907805.McLaren.jpg'),
(49, 19, '1566907805.bugati.jpg'),
(50, 20, '1566907959.bugati.jpg'),
(51, 20, '1566907959.download.jpg'),
(52, 20, '1566907959.images.jpg'),
(58, 22, '1568268731.images-(3).jpeg'),
(59, 22, '1568268731.mclaren-mso-600lt-coupe.jpg'),
(60, 22, '1568268731.images-(2).jpeg'),
(63, 23, '1568272815.images-(3).jpeg'),
(64, 23, '1568272815.images-(2).jpeg'),
(65, 23, '1568272816.images.jpeg'),
(66, 24, '1568273052.images-(1).jpeg'),
(67, 25, '1568273443.images.jpeg'),
(68, 26, '1568273739.images-(3).jpeg'),
(69, 27, '1568274494.images-(3).jpeg'),
(70, 28, '1568275013.images-(3).jpeg'),
(71, 29, '1568275131.1568271759366.jpg'),
(72, 30, '1568275204.1568195406431.jpg'),
(73, 31, '1568365245.mclaren-mso-600lt-coupe.jpg'),
(74, 32, '1568368431.images-(2).jpeg'),
(75, 32, '1568368644.images.jpeg'),
(76, 31, '1568368666.images.jpeg'),
(77, 33, '1568368796.maruti-suzuki-baleno.jpg'),
(78, 34, '1568368827.1568196952203.jpg'),
(79, 35, '1568368972.images-(3).jpeg'),
(80, 36, '1568369081.images-(2).jpeg'),
(81, 37, '1568369217.images-(1).jpeg'),
(82, 36, '1568369439.images-(2).jpeg'),
(83, 38, '1568369621.images-(2).jpeg'),
(84, 39, '1568445582.home-2-about.png'),
(85, 40, '1568459475.images-(2).jpeg'),
(86, 40, '1568459592.images.jpeg'),
(87, 21, '1568460274.home-2-about.png'),
(88, 41, '1568614958.camera5.jpeg'),
(89, 41, '1568614959.speaker2.jpg'),
(90, 42, '1568627368.IMG-20190806-WA0001.jpg'),
(91, 42, '1568627661.IMG-20190809-WA0000.jpg'),
(92, 43, '1568721582.maruti-suzuki-baleno.jpg'),
(93, 44, '1568722288.home-2-about.png'),
(94, 45, '1568792375.photo-1514316703755-dca7d7d9d882.jpeg'),
(95, 45, '1568792375.photo-1511919884226-fd3cad34687c.jpeg'),
(96, 46, '1568798848.mclaren-mso-600lt-coupe.jpg'),
(97, 47, '1568801558.mclaren-mso-600lt-coupe.jpg'),
(98, 48, '1568874331.download.jpg'),
(111, 51, '1568981835.en1.jpg'),
(112, 51, '1568981835.en2.jpg'),
(113, 51, '1568981835.en3.jpg'),
(149, 54, '1569056190.vn1.png'),
(153, 50, '1569056657.bz3.jpg'),
(154, 50, '1569056657.bz4.jpg'),
(155, 55, '1569234160.mclaren-mso-600lt-coupe.jpg'),
(156, 56, '1569317924.user6.jpeg'),
(157, 57, '1569318925.wallet7.jpeg'),
(158, 47, '1569320681.images-(2).jpeg'),
(159, 58, '1569329290.wallet7.jpeg'),
(161, 59, '1569386935.maruti-suzuki-baleno.jpg'),
(162, 59, '1569386935.photo-1511919884226-fd3cad34687c.jpeg'),
(163, 59, '1569386935.photo-1514316703755-dca7d7d9d882.jpeg'),
(206, 54, '1569402411.vn2.jpg'),
(207, 54, '1569402411.vn3.jpg'),
(226, 58, '1569407150.android.png'),
(238, 58, '1569408003.bottle3.jpg'),
(239, 60, '1569480925.mclaren-mso-600lt-coupe.jpg'),
(240, 60, '1569480925.images-(2).jpeg'),
(241, 61, '1569490225.home-2-about.png'),
(242, 62, '1569491857.home-2-about.png'),
(243, 63, '1569577875.bm2.jpg'),
(244, 64, '1569579424.bm3.jpg'),
(246, 66, '1569583654.bm3.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `property_types`
--
CREATE TABLE `property_types` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`ar` varchar(255) CHARACTER SET utf8 NOT NULL,
`ku` varchar(255) CHARACTER SET utf8 NOT NULL,
`published` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `property_types`
--
INSERT INTO `property_types` (`id`, `name`, `ar`, `ku`, `published`) VALUES
(1, 'For Buy & Sale', 'للبيع والبيع', 'خرید و فروخت کے لئے۔', 1),
(2, 'For Rent', 'للإيجار', '', 1);
-- --------------------------------------------------------
--
-- Table structure for table `pro_feature`
--
CREATE TABLE `pro_feature` (
`id` int(11) NOT NULL,
`pro_id` int(11) NOT NULL,
`feature_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `pro_feature`
--
INSERT INTO `pro_feature` (`id`, `pro_id`, `feature_id`) VALUES
(128, 0, 2),
(129, 0, 3),
(490, 187, 1),
(491, 187, 2),
(492, 187, 3),
(493, 187, 4),
(494, 187, 5),
(495, 187, 6),
(496, 187, 7),
(497, 187, 8),
(498, 187, 9),
(499, 187, 10),
(880, 57, 1),
(881, 57, 2),
(882, 57, 3),
(883, 57, 4),
(884, 57, 5),
(885, 57, 6),
(886, 57, 7),
(887, 57, 8),
(888, 57, 9),
(889, 57, 10);
-- --------------------------------------------------------
--
-- Table structure for table `settings`
--
CREATE TABLE `settings` (
`id` int(10) UNSIGNED NOT NULL,
`secure_secret` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`online_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`access_code` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`merchantTxnref` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`merchantId` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `setting_payment`
--
CREATE TABLE `setting_payment` (
`id` int(11) NOT NULL,
`stripe_key` longtext NOT NULL,
`published_key` longtext NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `setting_payment`
--
INSERT INTO `setting_payment` (`id`, `stripe_key`, `published_key`) VALUES
(1, 'sk_test_qKFL1d1wFqDp4DaVlL6gZzzr00eHSfRz5K', 'pk_test_zQm8B5ZcNuC0zdNyOdRxT5bt00mUd7EHk8');
-- --------------------------------------------------------
--
-- Table structure for table `shipping_address`
--
CREATE TABLE `shipping_address` (
`id` int(11) NOT NULL,
`fname` varchar(255) NOT NULL,
`lname` varchar(255) NOT NULL,
`company` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`phone` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `shipping_address`
--
INSERT INTO `shipping_address` (`id`, `fname`, `lname`, `company`, `address`, `email`, `phone`) VALUES
(1, 'test', 'test', 'test', 'test', 'test@gmail.comn', '9632587410'),
(2, 'ggdsg', 'dsgdsg', 'gsdg', 'gdsgsgsd', 'gdsgd', 'gsdgsd'),
(3, 'bfbhfd', 'hfdhd', 'hdh', 'hdfhd', 'hdfhd', 'dfh'),
(4, 'bfbhfd', 'hfdhd', 'hdh', 'hdfhd', 'hdfhd', 'dfh'),
(5, 'gsgds', 'ggsdg', 'sdgd', 'gsdg', 'dsgsd', 'gdsgd'),
(6, 'dfsaf', 'fsfasf', 'fsaf', 'faf', 'faf', 'fasfa'),
(7, 'dfda', 'fasfsaf', 'fsa', 'fsafaf', 'fsafs', 'fas'),
(8, 'fasdfsaf', 'safaf', 'afa', 'fsaff', 'afsafa', 'ffafa'),
(9, 'wew', 'v', 'vdfa', 'fasfaf', 'asfaf', 'afas'),
(10, 'dsgsg', 'gsd', 'gdsgsg', 'sgsg', 'sgsg', 'sgs'),
(11, 'dfh', 'hshs', 'hsh', 'sh', 'hsdfh', 'shs'),
(12, 'hdfh', 'hsh', 'shshs', 'hsh', 'hdshs', 'ghsgsg'),
(13, 'fd', 'fdf', 'd', 'fd', 'fd', 'fd'),
(14, 'tw', 'twe', 'tewtwt', 'twt', 'wetew', 't'),
(15, 'gdsg', 'gg', 'gsg', 'gsg', 'gsg', 'gsgs'),
(16, 'dfh', 'hshs', 'hsh', 'sh', 'hsdfh', 'shs'),
(17, 'GFDSG', 'DAGADGA', 'GDSGD', 'GADGA', 'GAGA', 'GA'),
(18, 'vdzg', 'fgsa', 'afaf', 'fasf', 'test@gmail.com', 'afas'),
(19, 'rewr', 'fasfa', 'fasf', 'fasfsa', 'fasfa@hotmail.com', 'fasfasf');
-- --------------------------------------------------------
--
-- Table structure for table `showroom_city`
--
CREATE TABLE `showroom_city` (
`id` int(11) NOT NULL,
`admin_id` int(11) NOT NULL,
`city_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `showroom_city`
--
INSERT INTO `showroom_city` (`id`, `admin_id`, `city_id`) VALUES
(1, 30, 11),
(2, 30, 12),
(3, 30, 14),
(4, 30, 11),
(5, 30, 12),
(6, 30, 13),
(7, 45, 12),
(8, 45, 14),
(9, 44, 12),
(10, 44, 14),
(11, 44, 15),
(12, 1, 11),
(13, 1, 13),
(14, 1, 11),
(15, 1, 13),
(16, 44, 12),
(17, 44, 14),
(18, 44, 15),
(19, 44, 12),
(20, 44, 14),
(21, 44, 15),
(22, 1, 11),
(23, 1, 13),
(24, 1, 15),
(25, 45, 11),
(26, 45, 12),
(27, 45, 14),
(28, 1, 11),
(29, 1, 12),
(30, 1, 13),
(31, 1, 15);
-- --------------------------------------------------------
--
-- Table structure for table `specification`
--
CREATE TABLE `specification` (
`id` int(11) NOT NULL,
`name` varchar(255) CHARACTER SET utf8 NOT NULL,
`ar` varchar(255) CHARACTER SET utf8 NOT NULL,
`ku` varchar(255) CHARACTER SET utf8 NOT NULL,
`published` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `specification`
--
INSERT INTO `specification` (`id`, `name`, `ar`, `ku`, `published`) VALUES
(1, 'Auto', 'Auto', 'Auto', 1),
(2, '3 tear ac', '3 tear ac', '3 tear ac', 1),
(3, '320 speed', '320 السرعة', '320 رفتار۔', 1),
(4, 'Tubeless', 'Tubeless', 'Tubeless', 1),
(5, 'Heavy Body', 'Heavy Body', 'Heavy Body', 1);
-- --------------------------------------------------------
--
-- Table structure for table `store_city`
--
CREATE TABLE `store_city` (
`id` int(11) NOT NULL,
`admin_id` int(11) NOT NULL,
`city_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `store_city`
--
INSERT INTO `store_city` (`id`, `admin_id`, `city_id`) VALUES
(1, 44, 11),
(2, 44, 12),
(3, 44, 14);
-- --------------------------------------------------------
--
-- Table structure for table `top_property`
--
CREATE TABLE `top_property` (
`id` int(11) NOT NULL,
`propertyId` int(11) NOT NULL,
`fromdate` date NOT NULL,
`todate` date NOT NULL,
`date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `top_property`
--
INSERT INTO `top_property` (`id`, `propertyId`, `fromdate`, `todate`, `date`) VALUES
(1, 2, '2019-08-09', '2019-08-22', '2019-09-25 12:18:49');
-- --------------------------------------------------------
--
-- Table structure for table `upload_id`
--
CREATE TABLE `upload_id` (
`id` int(11) NOT NULL,
`c_agentId` int(11) NOT NULL,
`image` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `upload_id`
--
INSERT INTO `upload_id` (`id`, `c_agentId`, `image`) VALUES
(15, 9, '1566207496.Maruti-Suzuki-Baleno-Right-Front-Three-Quarter-147420.jpg'),
(16, 10, '1566207937.Maruti-Suzuki-Baleno-Right-Front-Three-Quarter-147420.jpg'),
(17, 11, '1566207998.Maruti-Suzuki-Baleno-Right-Front-Three-Quarter-147420.jpg'),
(18, 13, '1568617782.bugati.jpg'),
(19, 13, '1568617782.download.jpg'),
(20, 13, '1568617782.images.jpg'),
(21, 14, '1568625395.IMG-20190916-WA0011.jpg'),
(22, 15, '1568625578.test.png'),
(23, 16, '1568625797.IMG-20190916-WA0011.jpg'),
(24, 17, '1568625812.test.png'),
(25, 20, '1568626193.test.png'),
(26, 22, '1568626312.IMG-20190916-WA0011.jpg'),
(27, 23, '1568627251.IMG-20190807-WA0001.jpg'),
(28, 26, '1568964650_0_wallet5.jpeg'),
(29, 26, '1568964650_1_wallet1.jpeg'),
(30, 26, '1568964650_2_user6.jpeg'),
(42, 30, '1568964932_2_user4.jpeg'),
(47, 36, '1568973017_0_speaker3.jpeg'),
(48, 36, '1568973017_1_speaker1.jpeg'),
(49, 37, '1568974695_0_wallet7.jpeg'),
(50, 37, '1568974696_1_user6.jpeg'),
(51, 37, '1568974696_2_user4.jpeg'),
(52, 37, '1568974696_3_user2.jpeg'),
(53, 38, '1568975101_0_wallet7.jpeg'),
(54, 38, '1568975101_1_wallet2.jpg'),
(55, 38, '1568975101_2_user7.jpeg'),
(56, 38, '1568975101_3_user6.jpeg'),
(57, 39, '1569059714.mclaren-mso-600lt-coupe.jpg'),
(58, 40, '1569483395.mclaren-mso-600lt-coupe.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `userdevicetoken`
--
CREATE TABLE `userdevicetoken` (
`id` int(11) NOT NULL,
`deviceType` tinyint(4) NOT NULL,
`deviceToken` varchar(225) NOT NULL,
`userId` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `usergroups`
--
CREATE TABLE `usergroups` (
`id` int(11) NOT NULL,
`typeName` varchar(255) NOT NULL,
`parentGroup` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `usergroups`
--
INSERT INTO `usergroups` (`id`, `typeName`, `parentGroup`) VALUES
(1, 'admin', 0),
(2, 'owner', 0),
(3, 'agent', 0);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`lname` varchar(255) NOT NULL,
`username` varchar(50) NOT NULL,
`dob` date NOT NULL,
`gender` int(11) NOT NULL,
`aged` int(11) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) DEFAULT NULL,
`phone` varchar(255) NOT NULL,
`image` varchar(255) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT NULL,
`address` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `lname`, `username`, `dob`, `gender`, `aged`, `email`, `password`, `phone`, `image`, `created_at`, `updated_at`, `address`) VALUES
(1, 'murat', 'patel', 'murat', '1994-07-07', 1, 0, 'murat@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '9632587410', '1564557880.silhouette-car-with-key-auto-car-logo-png_33231.jpg', '2019-08-02 11:13:23', '2019-07-25 01:36:50', 'nehrunagar,ahmedabad,gujarat'),
(2, 'prakash', 's', 'prakash', '1995-08-01', 1, 0, 'testing@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '1564046714.user6.jpeg', '2019-07-31 06:25:59', '2019-07-25 02:06:04', 'jasodanagar'),
(3, 'Bella', 'g', 'Bella', '0000-00-00', 1, 0, 'bella@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '', '2019-09-11 13:23:07', '2019-07-25 02:06:04', ''),
(4, 'kavya', 't', 'kavya', '2019-07-15', 2, 0, 'kavya@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '1568633638.bottle1.jpeg', '2019-09-16 11:34:02', '2019-09-16 06:04:02', 'navshari'),
(5, 'test1', '', 'test1', '0000-00-00', 0, 0, 'test1@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '', '2019-07-29 07:03:04', NULL, ''),
(6, 'demo', 'demo l', 'demo', '2019-07-30', 1, 0, 'demo@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '1564465854.23703JD_01_1553616680.jpg', '2019-07-30 05:50:54', '2019-07-30 00:20:54', 'sdfgsfg'),
(7, 'dfh', 'dfh', 'dgfh', '2019-08-23', 1, 1, 'sdf@gmail.com', '202cb962ac59075b964b07152d234b70', '', '', '2019-08-07 05:25:05', '2019-08-06 23:54:29', 'sfgdfgh'),
(8, 'p', 's', 'ps', '2019-08-27', 1, 0, 'prakash@gmail.com', '3db20af828d7bbfb0b0b6043dea3b24c', '', '', '2019-08-13 05:03:18', '2019-08-12 23:33:18', 'dsgs'),
(9, 'Amit', 'zala', 'Amit', '1996-08-28', 0, 0, 'amit@gmail.com', 'e35cf7b66449df565f93c607d5a81d09', '9724604987', '1566983061.Screenshot_2019-08-27-08-54-21-69_dac7cc7571c39b392df64923967cf7da.png', '2019-08-28 09:08:37', NULL, 'Mosul, Iraq'),
(10, 'dolly', 'patel', 'dolly', '1994-08-26', 0, 0, 'dolly@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '9898989898', '1567052677.Screenshot_2019-08-27-08-54-21-69_dac7cc7571c39b392df64923967cf7da.png', '2019-08-29 04:24:37', NULL, 'Iraq'),
(11, 'piyu', 'zala', 'piyu', '0000-00-00', 0, 0, 'piyu@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '1534567893', '1566470544.pfour.jpg', '2019-08-22 10:42:24', NULL, 'Kurdistan, Erbil, Iraq'),
(12, 'carlocal', 'olpoo', 'carlocal', '2002-09-12', 0, 0, 'carlocal@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '9865323652', '1568267137.IMG-20190904-WA0007.jpg', '2019-09-20 06:12:17', NULL, 'Mosul, Iraq'),
(13, '', '', 'komal', '0000-00-00', 0, 0, 'komal@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '', '2019-09-12 05:58:42', '2019-09-12 05:58:42', ''),
(14, '', '', 'Kinjal', '0000-00-00', 0, 0, 'kinjal@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '', '2019-09-12 06:19:28', '2019-09-12 06:19:28', ''),
(15, 'sandip', 'dalvadi', 'sandip', '1999-07-03', 1, 0, 'sandeep@harmistechnology.com', 'e10adc3949ba59abbe56e057f20f883e', '78755555', '', '2019-09-25 09:24:41', '2019-09-25 03:54:41', 'B 304/2,harmis technology,, Gopal palace jhansi ki rani BRTS bus stop,, near siromani complex'),
(16, 'carloc', 'patel', 'carloc', '2008-09-16', 0, 0, 'carloc@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '9898989898', '', '2019-09-16 09:46:09', NULL, 'Iraq'),
(17, 'Hitesh', 'devaiya', 'hitesh', '1997-08-02', 1, 0, 'hitesh@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '9523695263', '1569214716.male.jpeg', '2019-09-23 04:59:57', '2019-09-22 23:29:57', ''),
(18, '', '', 'urvi', '0000-00-00', 0, 0, 'urvi@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '1568889511.user2.jpeg', '2019-09-19 10:38:31', '2019-09-19 04:10:10', ''),
(19, 'testuser', 'zzzz', 'testuser', '1994-09-23', 0, 0, 'testuser@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '9865326598', '', '2019-09-23 10:20:13', NULL, 'Baghdad, Iraq'),
(20, '', '', 'hardik', '0000-00-00', 0, 0, 'harmistechnology@gmail.com', '4ef3c0949f24bc5f2d2f1bac8f2d3454', '', '', '2019-09-24 00:08:29', '2019-09-24 00:08:29', ''),
(21, 'carlive', 'ssss', 'carlive', '1994-09-26', 0, 0, 'carlive@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '9898653265', '1569480975.images.jpeg', '2019-09-26 06:56:15', NULL, 'Mosul, Iraq'),
(22, '', '', 'jay', '0000-00-00', 0, 0, 'jay@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '', '2019-09-26 07:26:57', '2019-09-26 07:26:57', ''),
(23, '', '', 'ravi', '0000-00-00', 0, 0, 'ravi@gmail.com', 'e10adc3949ba59abbe56e057f20f883e', '', '', '2019-09-26 07:27:42', '2019-09-26 07:27:42', '');
-- --------------------------------------------------------
--
-- Table structure for table `zones`
--
CREATE TABLE `zones` (
`zone_id` int(11) NOT NULL,
`zone_country_id` int(11) NOT NULL,
`zone_code` varchar(32) COLLATE utf8_unicode_ci NOT NULL,
`zone_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `zones`
--
INSERT INTO `zones` (`zone_id`, `zone_country_id`, `zone_code`, `zone_name`) VALUES
(1, 223, 'AL', 'Alabama'),
(2, 223, 'AK', 'Alaska'),
(3, 223, 'AS', 'American Samoa'),
(4, 223, 'AZ', 'Arizona'),
(5, 223, 'AR', 'Arkansas'),
(6, 223, 'AF', 'Armed Forces Africa'),
(7, 223, 'AA', 'Armed Forces Americas'),
(8, 223, 'AC', 'Armed Forces Canada'),
(9, 223, 'AE', 'Armed Forces Europe'),
(10, 223, 'AM', 'Armed Forces Middle East'),
(11, 223, 'AP', 'Armed Forces Pacific'),
(12, 223, 'CA', 'California'),
(13, 223, 'CO', 'Colorado'),
(14, 223, 'CT', 'Connecticut'),
(15, 223, 'DE', 'Delaware'),
(16, 223, 'DC', 'District of Columbia'),
(17, 223, 'FM', 'Federated States Of Micronesia'),
(18, 223, 'FL', 'Florida'),
(19, 223, 'GA', 'Georgia'),
(20, 223, 'GU', 'Guam'),
(21, 223, 'HI', 'Hawaii'),
(22, 223, 'ID', 'Idaho'),
(23, 223, 'IL', 'Illinois'),
(24, 223, 'IN', 'Indiana'),
(25, 223, 'IA', 'Iowa'),
(26, 223, 'KS', 'Kansas'),
(27, 223, 'KY', 'Kentucky'),
(28, 223, 'LA', 'Louisiana'),
(29, 223, 'ME', 'Maine'),
(30, 223, 'MH', 'Marshall Islands'),
(31, 223, 'MD', 'Maryland'),
(32, 223, 'MA', 'Massachusetts'),
(33, 223, 'MI', 'Michigan'),
(34, 223, 'MN', 'Minnesota'),
(35, 223, 'MS', 'Mississippi'),
(36, 223, 'MO', 'Missouri'),
(37, 223, 'MT', 'Montana'),
(38, 223, 'NE', 'Nebraska'),
(39, 223, 'NV', 'Nevada'),
(40, 223, 'NH', 'New Hampshire'),
(41, 223, 'NJ', 'New Jersey'),
(42, 223, 'NM', 'New Mexico'),
(43, 223, 'NY', 'New York'),
(44, 223, 'NC', 'North Carolina'),
(45, 223, 'ND', 'North Dakota'),
(46, 223, 'MP', 'Northern Mariana Islands'),
(47, 223, 'OH', 'Ohio'),
(48, 223, 'OK', 'Oklahoma'),
(49, 223, 'OR', 'Oregon'),
(50, 223, 'PW', 'Palau'),
(51, 223, 'PA', 'Pennsylvania'),
(52, 223, 'PR', 'Puerto Rico'),
(53, 223, 'RI', 'Rhode Island'),
(54, 223, 'SC', 'South Carolina'),
(55, 223, 'SD', 'South Dakota'),
(56, 223, 'TN', 'Tennessee'),
(57, 223, 'TX', 'Texas'),
(58, 223, 'UT', 'Utah'),
(59, 223, 'VT', 'Vermont'),
(60, 223, 'VI', 'Virgin Islands'),
(61, 223, 'VA', 'Virginia'),
(62, 223, 'WA', 'Washington'),
(63, 223, 'WV', 'West Virginia'),
(64, 223, 'WI', 'Wisconsin'),
(65, 223, 'WY', 'Wyoming'),
(66, 38, 'AB', 'Alberta'),
(67, 38, 'BC', 'British Columbia'),
(68, 38, 'MB', 'Manitoba'),
(69, 38, 'NF', 'Newfoundland'),
(70, 38, 'NB', 'New Brunswick'),
(71, 38, 'NS', 'Nova Scotia'),
(72, 38, 'NT', 'Northwest Territories'),
(73, 38, 'NU', 'Nunavut'),
(74, 38, 'ON', 'Ontario'),
(75, 38, 'PE', 'Prince Edward Island'),
(76, 38, 'QC', 'Quebec'),
(77, 38, 'SK', 'Saskatchewan'),
(78, 38, 'YT', 'Yukon Territory'),
(79, 81, 'NDS', 'Niedersachsen'),
(80, 81, 'BAW', 'Baden-Württemberg'),
(81, 81, 'BAY', 'Bayern'),
(82, 81, 'BER', 'Berlin'),
(83, 81, 'BRG', 'Brandenburg'),
(84, 81, 'BRE', 'Bremen'),
(85, 81, 'HAM', 'Hamburg'),
(86, 81, 'HES', 'Hessen'),
(87, 81, 'MEC', 'Mecklenburg-Vorpommern'),
(88, 81, 'NRW', 'Nordrhein-Westfalen'),
(89, 81, 'RHE', 'Rheinland-Pfalz'),
(90, 81, 'SAR', 'Saarland'),
(91, 81, 'SAS', 'Sachsen'),
(92, 81, 'SAC', 'Sachsen-Anhalt'),
(93, 81, 'SCN', 'Schleswig-Holstein'),
(94, 81, 'THE', 'Thüringen'),
(95, 14, 'WI', 'Wien'),
(96, 14, 'NO', 'Niederösterreich'),
(97, 14, 'OO', 'Oberösterreich'),
(98, 14, 'SB', 'Salzburg'),
(99, 14, 'KN', 'Kärnten'),
(100, 14, 'ST', 'Steiermark'),
(101, 14, 'TI', 'Tirol'),
(102, 14, 'BL', 'Burgenland'),
(103, 14, 'VB', 'Voralberg'),
(104, 204, 'AG', 'Aargau'),
(105, 204, 'AI', 'Appenzell Innerrhoden'),
(106, 204, 'AR', 'Appenzell Ausserrhoden'),
(107, 204, 'BE', 'Bern'),
(108, 204, 'BL', 'Basel-Landschaft'),
(109, 204, 'BS', 'Basel-Stadt'),
(110, 204, 'FR', 'Freiburg'),
(111, 204, 'GE', 'Genf'),
(112, 204, 'GL', 'Glarus'),
(113, 204, 'JU', 'Graubünden'),
(114, 204, 'JU', 'Jura'),
(115, 204, 'LU', 'Luzern'),
(116, 204, 'NE', 'Neuenburg'),
(117, 204, 'NW', 'Nidwalden'),
(118, 204, 'OW', 'Obwalden'),
(119, 204, 'SG', 'St. Gallen'),
(120, 204, 'SH', 'Schaffhausen'),
(121, 204, 'SO', 'Solothurn'),
(122, 204, 'SZ', 'Schwyz'),
(123, 204, 'TG', 'Thurgau'),
(124, 204, 'TI', 'Tessin'),
(125, 204, 'UR', 'Uri'),
(126, 204, 'VD', 'Waadt'),
(127, 204, 'VS', 'Wallis'),
(128, 204, 'ZG', 'Zug'),
(129, 204, 'ZH', 'Zürich'),
(130, 195, 'A Coruña', 'A Coruña'),
(131, 195, 'Alava', 'Alava'),
(132, 195, 'Albacete', 'Albacete'),
(133, 195, 'Alicante', 'Alicante'),
(134, 195, 'Almeria', 'Almeria'),
(135, 195, 'Asturias', 'Asturias'),
(136, 195, 'Avila', 'Avila'),
(137, 195, 'Badajoz', 'Badajoz'),
(138, 195, 'Baleares', 'Baleares'),
(139, 195, 'Barcelona', 'Barcelona'),
(140, 195, 'Burgos', 'Burgos'),
(141, 195, 'Caceres', 'Caceres'),
(142, 195, 'Cadiz', 'Cadiz'),
(143, 195, 'Cantabria', 'Cantabria'),
(144, 195, 'Castellon', 'Castellon'),
(145, 195, 'Ceuta', 'Ceuta'),
(146, 195, 'Ciudad Real', 'Ciudad Real'),
(147, 195, 'Cordoba', 'Cordoba'),
(148, 195, 'Cuenca', 'Cuenca'),
(149, 195, 'Girona', 'Girona'),
(150, 195, 'Granada', 'Granada'),
(151, 195, 'Guadalajara', 'Guadalajara'),
(152, 195, 'Guipuzcoa', 'Guipuzcoa'),
(153, 195, 'Huelva', 'Huelva'),
(154, 195, 'Huesca', 'Huesca'),
(155, 195, 'Jaen', 'Jaen'),
(156, 195, 'La Rioja', 'La Rioja'),
(157, 195, 'Las Palmas', 'Las Palmas'),
(158, 195, 'Leon', 'Leon'),
(159, 195, 'Lleida', 'Lleida'),
(160, 195, 'Lugo', 'Lugo'),
(161, 195, 'Madrid', 'Madrid'),
(162, 195, 'Malaga', 'Malaga'),
(163, 195, 'Melilla', 'Melilla'),
(164, 195, 'Murcia', 'Murcia'),
(165, 195, 'Navarra', 'Navarra'),
(166, 195, 'Ourense', 'Ourense'),
(167, 195, 'Palencia', 'Palencia'),
(168, 195, 'Pontevedra', 'Pontevedra'),
(169, 195, 'Salamanca', 'Salamanca'),
(170, 195, 'Santa Cruz de Tenerife', 'Santa Cruz de Tenerife'),
(171, 195, 'Segovia', 'Segovia'),
(172, 195, 'Sevilla', 'Sevilla'),
(173, 195, 'Soria', 'Soria'),
(174, 195, 'Tarragona', 'Tarragona'),
(175, 195, 'Teruel', 'Teruel'),
(176, 195, 'Toledo', 'Toledo'),
(177, 195, 'Valencia', 'Valencia'),
(178, 195, 'Valladolid', 'Valladolid'),
(179, 195, 'Vizcaya', 'Vizcaya'),
(180, 195, 'Zamora', 'Zamora'),
(181, 195, 'Zaragoza', 'Zaragoza'),
(182, 99, 'GJ', 'Gujarat'),
(183, 99, 'MH', 'Mharashtra');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `aboutus`
--
ALTER TABLE `aboutus`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `administrators`
--
ALTER TABLE `administrators`
ADD PRIMARY KEY (`myid`),
ADD UNIQUE KEY `administrators_email_unique` (`email`),
ADD KEY `email` (`email`);
--
-- Indexes for table `ads`
--
ALTER TABLE `ads`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `car_accessories`
--
ALTER TABLE `car_accessories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `car_accessories_img`
--
ALTER TABLE `car_accessories_img`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `car_brand`
--
ALTER TABLE `car_brand`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `city`
--
ALTER TABLE `city`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contact_admin`
--
ALTER TABLE `contact_admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contact_agent`
--
ALTER TABLE `contact_agent`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `contact_us`
--
ALTER TABLE `contact_us`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `countries`
--
ALTER TABLE `countries`
ADD PRIMARY KEY (`countries_id`);
--
-- Indexes for table `driverLicense`
--
ALTER TABLE `driverLicense`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `fueltype`
--
ALTER TABLE `fueltype`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `get_touch`
--
ALTER TABLE `get_touch`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `homeslide`
--
ALTER TABLE `homeslide`
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 (`Order_ID`);
--
-- Indexes for table `paymentGatway`
--
ALTER TABLE `paymentGatway`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pdf_report`
--
ALTER TABLE `pdf_report`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `Place_Order`
--
ALTER TABLE `Place_Order`
ADD PRIMARY KEY (`Place_Order_ID`);
--
-- Indexes for table `procategory`
--
ALTER TABLE `procategory`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `properties`
--
ALTER TABLE `properties`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `property_category`
--
ALTER TABLE `property_category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `property_img`
--
ALTER TABLE `property_img`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `property_types`
--
ALTER TABLE `property_types`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pro_feature`
--
ALTER TABLE `pro_feature`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `setting_payment`
--
ALTER TABLE `setting_payment`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `shipping_address`
--
ALTER TABLE `shipping_address`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `showroom_city`
--
ALTER TABLE `showroom_city`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `specification`
--
ALTER TABLE `specification`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `store_city`
--
ALTER TABLE `store_city`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `top_property`
--
ALTER TABLE `top_property`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `upload_id`
--
ALTER TABLE `upload_id`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `userdevicetoken`
--
ALTER TABLE `userdevicetoken`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `usergroups`
--
ALTER TABLE `usergroups`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `zones`
--
ALTER TABLE `zones`
ADD PRIMARY KEY (`zone_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `aboutus`
--
ALTER TABLE `aboutus`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `administrators`
--
ALTER TABLE `administrators`
MODIFY `myid` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;
--
-- AUTO_INCREMENT for table `ads`
--
ALTER TABLE `ads`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `car_accessories`
--
ALTER TABLE `car_accessories`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `car_accessories_img`
--
ALTER TABLE `car_accessories_img`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=39;
--
-- AUTO_INCREMENT for table `car_brand`
--
ALTER TABLE `car_brand`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=53;
--
-- AUTO_INCREMENT for table `city`
--
ALTER TABLE `city`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT for table `contact_admin`
--
ALTER TABLE `contact_admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `contact_agent`
--
ALTER TABLE `contact_agent`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=41;
--
-- AUTO_INCREMENT for table `contact_us`
--
ALTER TABLE `contact_us`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `countries`
--
ALTER TABLE `countries`
MODIFY `countries_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=240;
--
-- AUTO_INCREMENT for table `driverLicense`
--
ALTER TABLE `driverLicense`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;
--
-- AUTO_INCREMENT for table `fueltype`
--
ALTER TABLE `fueltype`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `get_touch`
--
ALTER TABLE `get_touch`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `homeslide`
--
ALTER TABLE `homeslide`
MODIFY `id` int(11) 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=2;
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `Order_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=45;
--
-- AUTO_INCREMENT for table `paymentGatway`
--
ALTER TABLE `paymentGatway`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `pdf_report`
--
ALTER TABLE `pdf_report`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `Place_Order`
--
ALTER TABLE `Place_Order`
MODIFY `Place_Order_ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;
--
-- AUTO_INCREMENT for table `procategory`
--
ALTER TABLE `procategory`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `properties`
--
ALTER TABLE `properties`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;
--
-- AUTO_INCREMENT for table `property_category`
--
ALTER TABLE `property_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT for table `property_img`
--
ALTER TABLE `property_img`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=247;
--
-- AUTO_INCREMENT for table `property_types`
--
ALTER TABLE `property_types`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `pro_feature`
--
ALTER TABLE `pro_feature`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=890;
--
-- AUTO_INCREMENT for table `setting_payment`
--
ALTER TABLE `setting_payment`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `shipping_address`
--
ALTER TABLE `shipping_address`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `showroom_city`
--
ALTER TABLE `showroom_city`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT for table `specification`
--
ALTER TABLE `specification`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `store_city`
--
ALTER TABLE `store_city`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `top_property`
--
ALTER TABLE `top_property`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `upload_id`
--
ALTER TABLE `upload_id`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=59;
--
-- AUTO_INCREMENT for table `userdevicetoken`
--
ALTER TABLE `userdevicetoken`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `usergroups`
--
ALTER TABLE `usergroups`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `zones`
--
ALTER TABLE `zones`
MODIFY `zone_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=184;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
CREATE TABLE IF NOT EXISTS client (
client_id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name TEXT,
description TEXT,
updated_on TIMESTAMP DEFAULT NOW(),
updated_by TEXT DEFAULT 'SYSTEM',
created_on TIMESTAMP DEFAULT NOW(),
created_by TEXT DEFAULT 'SYSTEM',
deleted BOOLEAN DEFAULT FALSE
);
|
--- URI Online Judge SQL
--- Copyright URI Online Judge
--- www.urionlinejudge.com.br
--- Problem 2612
SELECT DISTINCT movies.id, movies.name FROM movies
JOIN
genres ON (movies.id_genres = genres.id)
AND genres.description = 'Action'
JOIN movies_actors ON (movies.id = movies_actors.id_movies)
JOIN actors ON (movies_actors.id_actors = actors.id)
AND (actors.name = 'Marcelo Silva' OR actors.name = 'Miguel Silva');
|
select * from employee;
select fname as "FIRST NAME",
lname as "Last Name" from employee;
select * from employee where salary >= 30000;
select * from dependent where essn=333445555;
select * from project where Plocation="Houston" or Plocation="Stafford";
select * from project where Plocation="Houston" or dnum=4;
select Dname,Year(mgr_start_date) from department;
select Ssn from employee where Address like '%HOUSTON%';
select * from employee where fname like 'j%';
select * from employee where (sex='M' and salary > 30000) or (sex='F' and salary < 30000);
select Essn from works_on where hours < 50 and hours > 25;
select Essn from works_on where hours between 25 and 50;
select pname as 'Project Name' from project where Plocation="Houston" or Plocation="Stafford";
select pname as 'Project Name' from project where Plocation in ("Houston","Stafford");
select pname as 'Project Name' from project where Plocation != "Houston" and Plocation!="Stafford";
select pname as 'Project Name' from project where Plocation not in ("Houston","Stafford");
|
-- MySQL Script generated by MySQL Workbench
-- Thu Aug 6 00:07:46 2020
-- Model: New Model Version: 1.0
-- 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 mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema wwlink_ordems
-- -----------------------------------------------------
DROP SCHEMA IF EXISTS wwlink_ordems ;
-- -----------------------------------------------------
-- Schema wwlink_ordems
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS wwlink_ordems DEFAULT CHARACTER SET latin1 ;
USE wwlink_ordems ;
-- -----------------------------------------------------
-- Table wwlink_ordems.usuario
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.usuario ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.usuario (
id_usuario INT(11) NOT NULL AUTO_INCREMENT,
data_cad TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
nm_usuario VARCHAR(60) NULL DEFAULT NULL,
cargo VARCHAR(20) NULL DEFAULT NULL,
departamento VARCHAR(20) NULL DEFAULT NULL,
matricula VARCHAR(11) NULL DEFAULT NULL,
login VARCHAR(20) NULL DEFAULT NULL,
senha VARCHAR(60) NULL DEFAULT NULL,
status INT(1) NULL DEFAULT '1',
PRIMARY KEY (id_usuario))
ENGINE = InnoDB
AUTO_INCREMENT = 1017
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table wwlink_ordems.cliente
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.cliente ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.cliente (
id_cliente INT(11) NOT NULL AUTO_INCREMENT,
usuario_id INT(11) NULL DEFAULT NULL,
data_cad TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
data_nasc VARCHAR(14) NULL DEFAULT NULL,
data_uedit VARCHAR(14) NULL DEFAULT NULL,
nm_cliente VARCHAR(60) NULL DEFAULT NULL,
tipo_cliente INT(1) NULL DEFAULT '1',
doc_num VARCHAR(14) NULL DEFAULT NULL,
rg_ie VARCHAR(15) NULL DEFAULT NULL,
celular VARCHAR(15) NULL DEFAULT NULL,
fone_re VARCHAR(15) NULL DEFAULT NULL,
email VARCHAR(40) NULL DEFAULT NULL,
pes_contato VARCHAR(20) NULL DEFAULT NULL,
cep VARCHAR(10) NULL DEFAULT NULL,
endereco VARCHAR(60) NULL DEFAULT NULL,
numero VARCHAR(6) NULL DEFAULT NULL,
complemento VARCHAR(40) NULL DEFAULT NULL,
bairro VARCHAR(40) NULL DEFAULT NULL,
cidade VARCHAR(40) NULL DEFAULT NULL,
estado VARCHAR(2) NULL DEFAULT NULL,
usuario_id_usuario INT(11) NOT NULL,
PRIMARY KEY (id_cliente, usuario_id_usuario),
CONSTRAINT fk_cliente_usuario1
FOREIGN KEY (usuario_id_usuario)
REFERENCES wwlink_ordems.usuario (id_usuario)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 10
DEFAULT CHARACTER SET = utf8;
CREATE INDEX fk_usuario ON wwlink_ordems.cliente (usuario_id ASC);
CREATE INDEX fk_cliente_usuario1_idx ON wwlink_ordems.cliente (usuario_id_usuario ASC);
-- -----------------------------------------------------
-- Table wwlink_ordems.tipo_faq
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.tipo_faq ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.tipo_faq (
id_tipo_faq INT(11) NOT NULL AUTO_INCREMENT,
data_cad TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
descricao TEXT NOT NULL,
PRIMARY KEY (id_tipo_faq))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table wwlink_ordems.faq
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.faq ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.faq (
id INT(11) NOT NULL AUTO_INCREMENT,
titulo VARCHAR(80) NULL DEFAULT NULL,
descricao VARCHAR(300) NULL DEFAULT '',
image VARCHAR(80) NULL DEFAULT NULL,
tipo INT(80) NULL DEFAULT NULL,
tipo_faq_id_tipo_faq INT(11) NOT NULL,
usuario_id_usuario INT(11) NOT NULL,
PRIMARY KEY (id, tipo_faq_id_tipo_faq, usuario_id_usuario),
CONSTRAINT fk_faq_tipo_faq1
FOREIGN KEY (tipo_faq_id_tipo_faq)
REFERENCES wwlink_ordems.tipo_faq (id_tipo_faq)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_faq_usuario1
FOREIGN KEY (usuario_id_usuario)
REFERENCES wwlink_ordems.usuario (id_usuario)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 17
DEFAULT CHARACTER SET = latin1
COLLATE = latin1_bin;
CREATE INDEX fk_tipo ON wwlink_ordems.faq (tipo ASC);
CREATE INDEX fk_faq_tipo_faq1_idx ON wwlink_ordems.faq (tipo_faq_id_tipo_faq ASC);
CREATE INDEX fk_faq_usuario1_idx ON wwlink_ordems.faq (usuario_id_usuario ASC);
-- -----------------------------------------------------
-- Table wwlink_ordems.fornecedor
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.fornecedor ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.fornecedor (
id_fornecedor INT(11) NOT NULL AUTO_INCREMENT,
usuario_id INT(11) NULL DEFAULT NULL,
data_cad TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
nm_fornecedor VARCHAR(60) NULL DEFAULT NULL,
email VARCHAR(60) NULL DEFAULT NULL,
doc_num VARCHAR(14) NULL DEFAULT NULL,
rg_ie VARCHAR(15) NULL DEFAULT NULL,
celular VARCHAR(15) NULL DEFAULT NULL,
fone_re VARCHAR(15) NULL DEFAULT NULL,
pes_contato VARCHAR(20) NULL DEFAULT NULL,
cep VARCHAR(10) NULL DEFAULT NULL,
endereco VARCHAR(60) NULL DEFAULT NULL,
numero VARCHAR(6) NULL DEFAULT NULL,
complemento VARCHAR(40) NULL DEFAULT NULL,
bairro VARCHAR(40) NULL DEFAULT NULL,
cidade VARCHAR(40) NULL DEFAULT NULL,
estado VARCHAR(2) NULL DEFAULT NULL,
tipo_fornecedor INT(1) NULL DEFAULT NULL,
usuario_id_usuario INT(11) NOT NULL,
PRIMARY KEY (id_fornecedor, usuario_id_usuario),
CONSTRAINT fk_fornecedor_usuario1
FOREIGN KEY (usuario_id_usuario)
REFERENCES wwlink_ordems.usuario (id_usuario)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 9
DEFAULT CHARACTER SET = utf8;
CREATE INDEX fk_fornecedor_usuario1_idx ON wwlink_ordems.fornecedor (usuario_id_usuario ASC);
-- -----------------------------------------------------
-- Table wwlink_ordems.servico
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.servico ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.servico (
id_servico INT(11) NOT NULL,
nm_servico VARCHAR(80) CHARACTER SET 'utf8' NOT NULL,
vl_servico FLOAT(6,2) NOT NULL,
descricao VARCHAR(50) CHARACTER SET 'utf8' NULL DEFAULT NULL,
estoque INT(11) NULL DEFAULT NULL,
PRIMARY KEY (id_servico))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_bin;
-- -----------------------------------------------------
-- Table wwlink_ordems.os_status
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.os_status ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.os_status (
id_status INT(11) NOT NULL AUTO_INCREMENT,
status VARCHAR(20) CHARACTER SET 'utf8' NOT NULL,
PRIMARY KEY (id_status))
ENGINE = InnoDB
AUTO_INCREMENT = 7
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table wwlink_ordems.os
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.os ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.os (
id_os INT(11) NOT NULL AUTO_INCREMENT,
cliente_id INT(11) NULL DEFAULT NULL,
usuario_id INT(11) NULL DEFAULT NULL,
data_os TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
data_previsao VARCHAR(20) NULL DEFAULT NULL,
data_pronto VARCHAR(20) NULL DEFAULT NULL,
data_entrega VARCHAR(20) NULL DEFAULT NULL,
tipo VARCHAR(20) NULL DEFAULT NULL,
modelo VARCHAR(20) NULL DEFAULT NULL,
marca VARCHAR(20) NULL DEFAULT NULL,
cor VARCHAR(20) NULL DEFAULT NULL,
serie VARCHAR(20) NULL DEFAULT NULL,
garantia INT(1) NULL DEFAULT '1',
info_cliente VARCHAR(250) NULL DEFAULT NULL,
info_tecnico VARCHAR(250) NULL DEFAULT NULL,
info_entrega VARCHAR(250) NULL DEFAULT NULL,
info_interna VARCHAR(250) NULL DEFAULT NULL,
status_id INT(11) NULL DEFAULT '1',
peca_id INT(11) NULL DEFAULT NULL,
servico_id INT(11) NULL DEFAULT NULL,
valorTotal FLOAT(6,2) NULL DEFAULT NULL,
usuario_id_usuario INT(11) NOT NULL,
cliente_id_cliente INT(11) NOT NULL,
servico_id_servico INT(11) NOT NULL,
os_status_id_status INT(11) NOT NULL,
PRIMARY KEY (id_os, usuario_id_usuario, cliente_id_cliente, servico_id_servico, os_status_id_status),
CONSTRAINT fk_os_usuario1
FOREIGN KEY (usuario_id_usuario)
REFERENCES wwlink_ordems.usuario (id_usuario)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_os_cliente1
FOREIGN KEY (cliente_id_cliente)
REFERENCES wwlink_ordems.cliente (id_cliente)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_os_servico1
FOREIGN KEY (servico_id_servico)
REFERENCES wwlink_ordems.servico (id_servico)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_os_os_status1
FOREIGN KEY (os_status_id_status)
REFERENCES wwlink_ordems.os_status (id_status)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
AUTO_INCREMENT = 26
DEFAULT CHARACTER SET = utf8;
CREATE INDEX fk_peca ON wwlink_ordems.os (peca_id ASC) ;
CREATE INDEX fk_servico ON wwlink_ordems.os (servico_id ASC) ;
CREATE INDEX fk_status ON wwlink_ordems.os (status_id ASC) ;
CREATE INDEX fk_cliente ON wwlink_ordems.os (cliente_id ASC) ;
CREATE INDEX fk_usuario ON wwlink_ordems.os (usuario_id ASC) ;
CREATE INDEX fk_os_usuario1_idx ON wwlink_ordems.os (usuario_id_usuario ASC) ;
CREATE INDEX fk_os_cliente1_idx ON wwlink_ordems.os (cliente_id_cliente ASC) ;
CREATE INDEX fk_os_servico1_idx ON wwlink_ordems.os (servico_id_servico ASC) ;
CREATE INDEX fk_os_os_status1_idx ON wwlink_ordems.os (os_status_id_status ASC) ;
-- -----------------------------------------------------
-- Table wwlink_ordems.peca
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.peca ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.peca (
id_peca INT(11) NOT NULL AUTO_INCREMENT,
data_cad TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
nm_peca VARCHAR(40) NOT NULL,
vl_custo FLOAT(6,2) NOT NULL,
vl_venda FLOAT(6,2) NOT NULL,
estoque INT(11) NULL DEFAULT NULL,
entrada INT(11) NULL DEFAULT NULL,
saida INT(11) NULL DEFAULT NULL,
PRIMARY KEY (id_peca))
ENGINE = InnoDB
AUTO_INCREMENT = 15
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table wwlink_ordems.perfil
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.perfil ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.perfil (
id_perfil INT(11) NOT NULL AUTO_INCREMENT,
nivel_perfil INT(1) NOT NULL,
nm_perfil VARCHAR(40) NOT NULL,
PRIMARY KEY (id_perfil))
ENGINE = InnoDB
AUTO_INCREMENT = 7
DEFAULT CHARACTER SET = utf8;
-- -----------------------------------------------------
-- Table wwlink_ordems.recebimento
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.recebimento ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.recebimento (
id_recebimento INT(11) NOT NULL,
usuario_id INT(11) NULL DEFAULT NULL,
cliente_id INT(11) NULL DEFAULT NULL,
os_id INT(11) NULL DEFAULT NULL,
formaPagamento FLOAT(6,2) NULL DEFAULT NULL,
valorRecebimento FLOAT(6,2) NULL DEFAULT NULL,
statusRecebimento TINYINT(1) NULL DEFAULT NULL,
cliente_id_cliente INT(11) NOT NULL,
cliente_usuario_id_usuario INT(11) NOT NULL,
usuario_id_usuario INT(11) NOT NULL,
PRIMARY KEY (id_recebimento, cliente_id_cliente, cliente_usuario_id_usuario, usuario_id_usuario),
CONSTRAINT fk_recebimento_cliente1
FOREIGN KEY (cliente_id_cliente , cliente_usuario_id_usuario)
REFERENCES wwlink_ordems.cliente (id_cliente , usuario_id_usuario)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_recebimento_usuario1
FOREIGN KEY (usuario_id_usuario)
REFERENCES wwlink_ordems.usuario (id_usuario)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_bin;
CREATE INDEX fk_cliente ON wwlink_ordems.recebimento (cliente_id ASC) ;
CREATE INDEX fk_usurio ON wwlink_ordems.recebimento (usuario_id ASC) ;
CREATE INDEX fk_os ON wwlink_ordems.recebimento (os_id ASC) ;
CREATE INDEX fk_recebimento_cliente1_idx ON wwlink_ordems.recebimento (cliente_id_cliente ASC, cliente_usuario_id_usuario ASC) ;
CREATE INDEX fk_recebimento_usuario1_idx ON wwlink_ordems.recebimento (usuario_id_usuario ASC) ;
-- -----------------------------------------------------
-- Table wwlink_ordems.peca_has_os
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.peca_has_os ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.peca_has_os (
peca_id_peca INT(11) NOT NULL,
os_id_os INT(11) NOT NULL,
PRIMARY KEY (peca_id_peca, os_id_os),
CONSTRAINT fk_peca_has_os_peca
FOREIGN KEY (peca_id_peca)
REFERENCES wwlink_ordems.peca (id_peca)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_peca_has_os_os1
FOREIGN KEY (os_id_os)
REFERENCES wwlink_ordems.os (id_os)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE INDEX fk_peca_has_os_os1_idx ON wwlink_ordems.peca_has_os (os_id_os ASC) ;
CREATE INDEX fk_peca_has_os_peca_idx ON wwlink_ordems.peca_has_os (peca_id_peca ASC) ;
-- -----------------------------------------------------
-- Table wwlink_ordems.perfil_has_usuario
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.perfil_has_usuario ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.perfil_has_usuario (
perfil_id_perfil INT(11) NOT NULL,
usuario_id_usuario INT(11) NOT NULL,
PRIMARY KEY (perfil_id_perfil, usuario_id_usuario),
CONSTRAINT fk_perfil_has_usuario_perfil1
FOREIGN KEY (perfil_id_perfil)
REFERENCES wwlink_ordems.perfil (id_perfil)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_perfil_has_usuario_usuario1
FOREIGN KEY (usuario_id_usuario)
REFERENCES wwlink_ordems.usuario (id_usuario)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE INDEX fk_perfil_has_usuario_usuario1_idx ON wwlink_ordems.perfil_has_usuario (usuario_id_usuario ASC) ;
CREATE INDEX fk_perfil_has_usuario_perfil1_idx ON wwlink_ordems.perfil_has_usuario (perfil_id_perfil ASC) ;
-- -----------------------------------------------------
-- Table wwlink_ordems.peca_has_fornecedor
-- -----------------------------------------------------
DROP TABLE IF EXISTS wwlink_ordems.peca_has_fornecedor ;
CREATE TABLE IF NOT EXISTS wwlink_ordems.peca_has_fornecedor (
peca_id_peca INT(11) NOT NULL,
fornecedor_id_fornecedor INT(11) NOT NULL,
PRIMARY KEY (peca_id_peca, fornecedor_id_fornecedor),
CONSTRAINT fk_peca_has_fornecedor_peca1
FOREIGN KEY (peca_id_peca)
REFERENCES wwlink_ordems.peca (id_peca)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT fk_peca_has_fornecedor_fornecedor1
FOREIGN KEY (fornecedor_id_fornecedor)
REFERENCES wwlink_ordems.fornecedor (id_fornecedor)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE INDEX fk_peca_has_fornecedor_fornecedor1_idx ON wwlink_ordems.peca_has_fornecedor (fornecedor_id_fornecedor ASC) ;
CREATE INDEX fk_peca_has_fornecedor_peca1_idx ON wwlink_ordems.peca_has_fornecedor (peca_id_peca ASC) ;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
|
create table pz_platformservice_integration(
appname varchar(50),
configkey varchar(50),
configvalue varchar(50),
primary key(appname,configkey)
); |
--Provide a query that shows the # of invoices per country.
select
i.BillingCountry, count(i.InvoiceId) as InvoiceCount
from
Invoice i
group by i.BillingCountry |
USE TERMO8;
Drop table REF_POL_DISTR;
CREATE TABLE REF_POL_DISTR (
ID varchar(16) PRIMARY KEY,
PT_CM_GAB decimal(3,2),
PT_CM_TRA decimal(3,2),
PT_CM_TEL decimal(3,2),
PT_CM_PAJ decimal(3,2),
PT_CM_MIS decimal(3,2),
PT_CM_POL decimal(3,2),
PT_CM_PEL decimal(3,2),
PT_EF_MIS decimal(3,2),
PT_EF_PYT decimal(3,2),
PT_EF_TEX decimal(3,2),
PT_PP_GRA decimal(3,2),
PT_PP_ART decimal(3,2)
)
INSERT INTO REF_POL_DISTR VALUES ('CM01', 1, null, null, null, null, null, null, null, null, null, null, null), ('CM02', null, 1, null, null, null, null, null, null, null, null, null, null),
('CM03', null, null, 1, null, null, null, null, null, null, null, null, null), ('CM04', null, null, null, 1, null, null, null, null, null, null, null, null),
('CM05', null, null, null, null, 1, null, null, null, null, null, null, null), ('CM06', null, null, null, null, null, 1, null, null, null, null, null, null),
('CM20', 0.33, 0.33, null, null, 0.34, null, null, null, null, null, null, null), ('CM30', 0.5, 0.5, null, null, null, null, null, null, null, null, null, null),
('CM40', null, null, 0.5, null, null, 0.5, null, null, null, null, null, null), ('RE01', null, null, null, null, null, null, 1, null, null, null, null, null),
('EF01', null, null, null, null, null, null, null, 1, null, null, null, null), ('EF02', null, null, null, null, null, null, null, null, 1, null, null, null),
('EF03', null, null, null, null, null, null, null, null, null, 1, null, null), ('EF04', null, null, null, null, null, null, null, null, null, null, 0.5, 0.5),
('EF05', null, null, null, null, null, null, null, 0.33, 0.33, 0.34, null, null), ('EF20', null, null, null, null, null, null, null, 0.5, 0.5, null, null, null),
('EF30', null, null, null, null, null, null, null, 0.5, null, 0.5, null, null), ('EF40', null, null, null, null, null, null, null, null, null, null, 0.5, 0.5),
('GE20', 0.2, 0.2, 0.2, null, null, null, null, 0.2, 0.2, null, null, null), ('GE30', 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, null, null),
('GE40', 0.2, 0.2, 0.2, null, null, null, null, 0.15, 0.15, 0.1, null, null)
SELECT * FROM REF_POL_DISTR
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : Dim 02 déc. 2018 à 12:56
-- Version du serveur : 10.1.30-MariaDB
-- Version de PHP : 7.2.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 */;
--
-- Base de données : `covoiturage`
--
-- --------------------------------------------------------
--
-- Structure de la table `conducteurs`
--
CREATE TABLE `conducteurs` (
`id` int(11) NOT NULL,
`id_utilisateur` int(11) NOT NULL,
`nb_etoils` int(11) NOT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `conducteurs`
--
INSERT INTO `conducteurs` (`id`, `id_utilisateur`, `nb_etoils`, `updated_at`, `created_at`) VALUES
(1, 1, 4, NULL, NULL),
(2, 5, 1, NULL, NULL),
(3, 12, 4, NULL, NULL),
(4, 13, 4, NULL, NULL),
(5, 14, 5, NULL, NULL),
(6, 15, 2, NULL, NULL),
(7, 16, 3, NULL, NULL),
(8, 18, 3, NULL, NULL),
(9, 21, 3, NULL, NULL);
-- --------------------------------------------------------
--
-- Structure de la table `notes`
--
CREATE TABLE `notes` (
`id_conducteur` int(11) NOT NULL,
`id_passager` int(11) NOT NULL,
`note` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `notes`
--
INSERT INTO `notes` (`id_conducteur`, `id_passager`, `note`) VALUES
(1, 3, 3),
(1, 10, 10);
-- --------------------------------------------------------
--
-- Structure de la table `passagers`
--
CREATE TABLE `passagers` (
`id` int(11) NOT NULL,
`id_utilisateur` int(11) NOT NULL,
`nb_reservation` int(3) NOT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `passagers`
--
INSERT INTO `passagers` (`id`, `id_utilisateur`, `nb_reservation`, `updated_at`, `created_at`) VALUES
(1, 4, 0, NULL, NULL),
(2, 6, 0, NULL, NULL),
(3, 7, 1, NULL, NULL),
(4, 8, 0, NULL, NULL),
(5, 9, 0, NULL, NULL),
(6, 10, 0, NULL, NULL),
(7, 11, 0, NULL, NULL),
(8, 17, 0, NULL, NULL),
(9, 19, 0, NULL, NULL),
(10, 20, 1, NULL, NULL);
-- --------------------------------------------------------
--
-- Structure de la table `reservations`
--
CREATE TABLE `reservations` (
`idreservation` int(11) NOT NULL,
`date_reservation` varchar(30) NOT NULL,
`id_trajet` int(11) DEFAULT NULL,
`id_passager` int(11) DEFAULT NULL,
`description_reservation` varchar(300) DEFAULT NULL,
`acceptation` int(11) DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `reservations`
--
INSERT INTO `reservations` (`idreservation`, `date_reservation`, `id_trajet`, `id_passager`, `description_reservation`, `acceptation`, `updated_at`, `created_at`) VALUES
(2, '2018-01-28 02:13:33', 3, 1, NULL, NULL, NULL, NULL),
(3, '2018-01-28 03:01:25', 1, 1, NULL, NULL, NULL, NULL),
(4, '2018-01-28 12:49:01', 1, 2, 'a', 0, NULL, NULL),
(7, '2018-01-28 17:09:19', 8, 1, 'a', NULL, NULL, NULL),
(8, '2018-01-28 17:09:32', 8, 2, 'b', 2, NULL, NULL),
(9, '2018-01-28 17:09:42', 8, 3, NULL, NULL, NULL, NULL),
(10, '2018-01-29', 1, 3, NULL, NULL, NULL, NULL),
(11, '2018-01-30', 3, 3, NULL, NULL, NULL, NULL),
(12, '2018-02-08', 8, 3, NULL, NULL, NULL, NULL),
(13, '2018-02-08', 10, 3, NULL, NULL, NULL, NULL),
(14, '2018-11-13', 4, 10, NULL, NULL, NULL, NULL),
(15, '2018-11-13', 1, 10, NULL, NULL, NULL, NULL),
(16, '2018-11-13', 11, 10, NULL, NULL, NULL, NULL),
(17, '12/12/2012', 20, 2, 'ewqeqweqweqweqweqweq', 2, NULL, NULL);
-- --------------------------------------------------------
--
-- Structure de la table `trajets`
--
CREATE TABLE `trajets` (
`id` int(11) NOT NULL,
`date_depart` datetime DEFAULT NULL,
`date_arrive` datetime DEFAULT NULL,
`lieu_depart` varchar(75) DEFAULT NULL,
`lieu_arrive` varchar(75) DEFAULT NULL,
`prix` decimal(6,2) DEFAULT NULL,
`id_conducteur` int(11) DEFAULT NULL,
`nbplace` int(2) DEFAULT '4',
`etats` int(11) DEFAULT NULL,
`description` text,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `trajets`
--
INSERT INTO `trajets` (`id`, `date_depart`, `date_arrive`, `lieu_depart`, `lieu_arrive`, `prix`, `id_conducteur`, `nbplace`, `etats`, `description`, `updated_at`, `created_at`) VALUES
(1, '2018-12-02 00:00:00', '2018-12-02 00:00:00', 'Rabat', 'Marrakech', '200.00', 1, 2, 1, NULL, NULL, NULL),
(3, '2018-12-01 00:00:00', '2018-12-01 00:00:00', 'Casablanca', 'Fes', '110.00', 1, 3, 1, NULL, NULL, NULL),
(4, '2018-05-12 00:00:00', '2018-07-12 00:00:00', 'Casablanca', 'Tetouan', '75.80', 1, 2, 1, NULL, NULL, NULL),
(6, '2018-05-05 00:00:00', '2018-06-05 00:00:00', 'Casablanca', 'Agadir', '190.00', 2, 5, 1, NULL, NULL, NULL),
(8, '2018-05-02 00:00:00', '2018-06-02 00:00:00', 'Casablanca', 'sidi kasem', '79.00', 5, 3, 1, NULL, NULL, NULL),
(9, '2018-05-22 00:00:00', '2018-05-23 00:00:00', 'Tanger', 'Marrakech', '140.50', 6, 4, 0, NULL, NULL, NULL),
(10, '2018-03-12 00:00:00', '2018-03-12 00:00:00', 'Casablanca', 'Fes', '111.50', 7, 3, 0, NULL, NULL, NULL),
(11, '2019-01-01 00:00:00', '2019-05-05 00:00:00', 'Casablanca', 'Rabat', '35.00', 9, 4, 1, NULL, NULL, NULL),
(13, '2222-02-22 00:00:00', '2222-02-22 00:00:00', 'Rabat', 'Casabalanca', '222.00', 2, 2, 1, '2222 22 2 2 2 2', '2018-11-26 21:40:45', '2018-11-26 21:40:45'),
(18, '2018-11-29 00:00:00', '2018-11-22 00:00:00', 'CasaBlanca', 'Rabat', '12.00', 2, 12, 1, 'VlaVlaVlaVlaVlaVla VlaVla', '2018-11-26 23:47:37', '2018-11-26 23:47:37'),
(19, '2018-11-15 00:00:00', '2018-11-07 00:00:00', 'Casablanca', 'Rabat', '100.00', 1, 2, 0, 'ewqe', '2018-11-28 23:09:51', '2018-11-28 23:09:51'),
(20, '2018-12-01 00:00:00', '2018-12-05 00:00:00', 'Tanger', 'Casablanca', '200.00', 1, 2, 0, 'A 2:00', '2018-12-01 13:44:41', '2018-12-01 13:44:41');
-- --------------------------------------------------------
--
-- Structure de la table `utilisateurs`
--
CREATE TABLE `utilisateurs` (
`id` int(11) NOT NULL,
`nom` varchar(25) DEFAULT NULL,
`prenom` varchar(25) DEFAULT NULL,
`sex` varchar(1) DEFAULT NULL,
`date_naissance` date DEFAULT NULL,
`adresse` varchar(75) DEFAULT NULL,
`email` varchar(45) DEFAULT NULL,
`password` varchar(32) DEFAULT NULL,
`telephone` varchar(10) DEFAULT NULL,
`description` varchar(250) DEFAULT NULL,
`img_prf` varchar(45) DEFAULT '"C:/fileup/file.jpg"',
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `utilisateurs`
--
INSERT INTO `utilisateurs` (`id`, `nom`, `prenom`, `sex`, `date_naissance`, `adresse`, `email`, `password`, `telephone`, `description`, `img_prf`, `updated_at`, `created_at`) VALUES
(1, 'kamali', 'mounir', 'M', '1993-02-23', 'Rue nassim hay soumaya N 55 casablanca', 'm.kamali@gmail.com', 'bb14579504160ce4fcaf35cf78c60bc1', '0656538805', 'je suis le conducteur numero 1 yay!', 'fileup/avatar.jpg', NULL, NULL),
(2, 'hatimy', 'abdellah', 'M', '1995-01-01', 'Rue 7ay riad rabat', 'abdo.hat@gmail.com', '267c88a9c130619b5e8fe370c0ae7730', '0655555555', 'hellooo', 'fileup/avatar.jpg', NULL, NULL),
(3, 'hat', 'abdo', 'M', '1995-02-02', 'samsamasmsam asnsdknkdn sakdnskds sdaknsa', 'm.abdo@gmail.com', '267c88a9c130619b5e8fe370c0ae7730', '0656538805', 'helooo', 'fileup/avatar.jpg', NULL, NULL),
(4, 'mossaid', 'hamza', 'M', '1993-02-02', 'Rue zrketouni Casablanca', 'm.hamza@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0625369588', 'bonjour tout le monde cv??', 'fileup/avatar.jpg', NULL, NULL),
(5, 'selami', 'rachid', 'M', '1998-05-06', 'Rue 7ay riad rabat', 'm.rachid@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0688947523', 'hello there!!!', 'fileup/avatar.jpg', NULL, NULL),
(6, 'sereghini', 'ali', 'M', '1992-05-15', 'Db ghelef casablanca', 'm.alis@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0655234520', 'hello I\'m a new passenger', 'fileup/avatar.jpg', NULL, NULL),
(7, 'pass1', 'surnm', 'F', '1992-11-26', 'samsamasmsam asnsdknkdn sakdnskds sdaknsa', 'm.pass@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0656538805', 'heyyyyyyyyyy', 'fileup/avatar.jpg', NULL, NULL),
(8, 'kou', 'pas', 'M', '2000-02-02', 'Rue nassim hay soumaya N 55 casablanca', 'm.kou@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0656538805', 'heeeeeeeeeee', 'fileup/avatar.jpg', NULL, NULL),
(9, 'aminos', 'am', 'F', '2001-08-06', 'samsamasmsam asnsdknkdn sakdnskds sdaknsa', 'aminnos@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0656538805', 'heyyyyyyyy', 'fileup/avatar.jpg', NULL, NULL),
(10, 'parami', 'stali', 'F', '1980-06-04', 'Rue 7ay riad rabat', 'parami@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0625369588', 'turu ture utrue', 'fileup/avatar.jpg', NULL, NULL),
(11, 'alaoui', 'faouzi', 'M', '1996-12-06', 'Db ghelef casablanca', 'f.alaoui@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0688947523', 'hey hey hey', 'fileup/avatar.jpg', NULL, NULL),
(12, 'moudni', 'ismail', 'M', '1998-12-30', 'Rue 7ay riad rabat', 'msk@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0655555555', 'asdasjn', 'fileup/avatar.jpg', NULL, NULL),
(13, 'mahmoudi', 'abdellah', 'M', '1991-05-05', 'Db chorfa casablanca', 'mahmoudi.hassan@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0684751296', 'hello everyone', 'C:/fileup/avatar.jpg', NULL, NULL),
(14, 'saidi', 'karim', 'M', '1993-11-30', 'Rue nassim hay soumaya N 55 casablanca', 'karimis@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0655555555', 'oui cv??', 'fileup/avatar.jpg', NULL, NULL),
(15, 'alami', 'ayoub', 'M', '1995-05-05', 'Rue mossaada Tanger', 'ayoub.ala@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0655334178', 'Bonjour tout le monde!!', 'fileup/img.jpg', NULL, NULL),
(16, 'ismaili', 'hanane', 'F', '2018-05-06', 'Rue nassim Tetouan', 'hanaa@gmail.com', '1a1dc91c907325c69271ddf0c944bc72', '0648759612', 'Bonjour tout le monde', 'fileup/img.jpg', NULL, NULL),
(17, 'mouniri', 'ahmed', 'M', '1993-02-05', 'Rue Nassim agdal Rabat', 'ahmedmouniri@gmail.com', 'd41d8cd98f00b204e9800998ecf8427e', '0659781423', 'Hi Everyone!', 'fileup/ahmed.jpg', NULL, NULL),
(18, 'chraybi', 'ayoub', 'M', '1992-02-02', 'Rue Nassim agdal Rabat', 'ayoubchraybi@gmail.com', 'c62672c961ec63233d96e0fc9332f026', '0659781412', 'hi everyone ...', 'fileup/ali.jpg', NULL, NULL),
(19, 'hatab', 'abhat', 'M', '1996-01-01', 'Rue RAYHANE Rabat', 'hatab@gmail.com', 'd41d8cd98f00b204e9800998ecf8427e', '0689457811', 'Bonjour Tout le monde....', 'fileup/ahmed.jpg', NULL, NULL),
(20, 'extest', 'extest', 'M', '1995-01-01', 'extest', 'extest@gmail.com', 'f27f6f1c7c5cbf4e3e192e0a47b85300', '0689457811', 'ppp', 'fileup/abdel.jpg', NULL, NULL),
(21, 'condnom', 'condprenom', 'F', '1993-01-01', 'Rue RAYHANE Rabat', 'condnom@gmail.com', 'f27f6f1c7c5cbf4e3e192e0a47b85300', '0689457820', 'ppp ppp ppp', 'fileup/abdel.jpg', NULL, NULL);
-- --------------------------------------------------------
--
-- Structure de la table `vehicules`
--
CREATE TABLE `vehicules` (
`id` int(11) NOT NULL,
`coleur` varchar(25) NOT NULL,
`nb_places` int(11) NOT NULL,
`puissance` decimal(6,2) NOT NULL,
`idconducteur` int(11) DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `vehicules`
--
INSERT INTO `vehicules` (`id`, `coleur`, `nb_places`, `puissance`, `idconducteur`, `updated_at`, `created_at`) VALUES
(1, 'Mercedec Red', 4, '100.00', 1, NULL, NULL),
(2, 'Honda Bleu 2019', 4, '200.00', 1, NULL, NULL),
(3, 'Mercedec Red', 4, '100.00', 2, NULL, NULL),
(4, 'Honda Bleu 2019', 4, '200.00', 3, NULL, NULL);
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `conducteurs`
--
ALTER TABLE `conducteurs`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `idconducteur_UNIQUE` (`id`),
ADD KEY `fk_cond_ut_idx` (`id_utilisateur`);
--
-- Index pour la table `notes`
--
ALTER TABLE `notes`
ADD PRIMARY KEY (`id_conducteur`,`id_passager`),
ADD KEY `fk_note_pass_idx` (`id_passager`);
--
-- Index pour la table `passagers`
--
ALTER TABLE `passagers`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `idpassager_UNIQUE` (`id`),
ADD KEY `fk_pass_utl_idx` (`id_utilisateur`);
--
-- Index pour la table `reservations`
--
ALTER TABLE `reservations`
ADD PRIMARY KEY (`idreservation`),
ADD KEY `fk_reserv_trajet_idx` (`id_trajet`),
ADD KEY `fk_reserv_pass_idx` (`id_passager`);
--
-- Index pour la table `trajets`
--
ALTER TABLE `trajets`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_trajet_cond_idx` (`id_conducteur`);
--
-- Index pour la table `utilisateurs`
--
ALTER TABLE `utilisateurs`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `vehicules`
--
ALTER TABLE `vehicules`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `idVehicule_UNIQUE` (`id`),
ADD KEY `fk_vh_cond_idx` (`idconducteur`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `conducteurs`
--
ALTER TABLE `conducteurs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT pour la table `passagers`
--
ALTER TABLE `passagers`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT pour la table `reservations`
--
ALTER TABLE `reservations`
MODIFY `idreservation` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT pour la table `trajets`
--
ALTER TABLE `trajets`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT pour la table `utilisateurs`
--
ALTER TABLE `utilisateurs`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT pour la table `vehicules`
--
ALTER TABLE `vehicules`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `conducteurs`
--
ALTER TABLE `conducteurs`
ADD CONSTRAINT `fk_cond_ut` FOREIGN KEY (`id_utilisateur`) REFERENCES `utilisateurs` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `notes`
--
ALTER TABLE `notes`
ADD CONSTRAINT `fk_note_cond` FOREIGN KEY (`id_conducteur`) REFERENCES `conducteurs` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_note_pass` FOREIGN KEY (`id_passager`) REFERENCES `passagers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `reservations`
--
ALTER TABLE `reservations`
ADD CONSTRAINT `fk_reserv_pass` FOREIGN KEY (`id_passager`) REFERENCES `passagers` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_reserv_trajet` FOREIGN KEY (`id_trajet`) REFERENCES `trajets` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `trajets`
--
ALTER TABLE `trajets`
ADD CONSTRAINT `fk_trajet_cond` FOREIGN KEY (`id_conducteur`) REFERENCES `conducteurs` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Contraintes pour la table `vehicules`
--
ALTER TABLE `vehicules`
ADD CONSTRAINT `fk_vh_cond` FOREIGN KEY (`idconducteur`) REFERENCES `conducteurs` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
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 */;
|
CREATE TABLE entities (
id IDENTITY PRIMARY KEY,
province_id INTEGER,
type VARCHAR(255),
licence INTEGER,
location_identifier VARCHAR(255)
) |
CREATE procedure sp_View_GiftVouchers (
@CustomerID nvarchar(15),
@FromDate datetime,
@ToDate datetime,
@Mode int
)
As
If IsNull(@Mode,0) = 1
select Loyalty.LoyaltyID, Loyalty.Loyaltyname, Customer.CustomerID, Company_Name, DocumentDate, GiftVoucherNo
, NoteValue,
dbo.LookupDictionaryItem(case
When Status & 64 <> 0 Then N'Closed'
When IsNull(NoteValue,0) <> IsNull(balance,0) then 'Closed'
When isNull(claimRFA,0) = 1 then 'Closed'
When isnull(status,0) = 0 and isnull(RefDocid,0) = 0 Then N'Open'
when isnull(status & 128,0 ) = 128 and isnull(RefDocid,0) <> 0 then N'Closed'
when isnull(status & 128,0 ) = 128 and Balance = 0 then N'Closed'
when isnull(status & 128,0 ) = 0 and isnull(RefDocid,0) <> 0 then N'Open'
--When IsNull(Status & 0, 0) = 0 then 'Open'
Else N'' end, Default),
DocumentID, CreditID
from CreditNote, Customer , Loyalty
where Customer.CustomerID like @CustomerID and
DocumentDate between @FromDate and @ToDate and
CreditNote.Flag = 2 and
Customer.CustomerID = CreditNote.CustomerID and
Loyalty.LoyaltyID = CreditNote.LoyaltyID And
Loyalty.LoyaltyID in ('L1','L2','L3')
order by Customer.Company_Name, Loyalty.Loyaltyname, DocumentDate
Else if isNull(@Mode, 0) = 2
select Loyalty.LoyaltyID, Loyalty.Loyaltyname, Customer.CustomerID, Company_Name, DocumentDate, GiftVoucherNo
, NoteValue,
dbo.LookupDictionaryItem(case
When Status & 64 <> 0 Then N'Closed'
When IsNull(NoteValue,0) <> IsNull(balance,0) then 'Closed'
When isNull(claimRFA,0) = 1 then 'Closed'
When isnull(status,0) = 0 and isnull(RefDocid,0) = 0 Then N'Open'
when isnull(status & 128,0 ) = 128 and isnull(RefDocid,0) <> 0 then N'Closed'
when isnull(status & 128,0 ) = 128 and Balance = 0 then N'Closed'
when isnull(status & 128,0 ) = 0 and isnull(RefDocid,0) <> 0 then N'Open'
--When IsNull(Status & 0, 0) = 0 then 'Open'
Else N'' end, Default),
DocumentID, CreditID
from CreditNote, Customer , Loyalty
where Customer.CustomerID like @CustomerID and
DocumentDate between @FromDate and @ToDate and
CreditNote.Flag in(1,2) and
Customer.CustomerID = CreditNote.CustomerID and
Loyalty.LoyaltyID = CreditNote.LoyaltyID -- And
-- Loyalty.LoyaltyID in ('L1','L2','L3')
order by Customer.Company_Name, Loyalty.Loyaltyname, DocumentDate
|
drop procedure if exists test_loop;
delimiter //
create procedure test_loop(in i int)
begin
declare cnt int default 0;
while cnt < i do
set cnt = cnt + 1;
insert into Shohin values(cnt,concat('test', cnt));
end while;
end
//
delimiter ;
call test_loop(100); |
CREATE TABLE [Administracion].[MenuTipo]
(
[IdMenuTipo] INT NOT NULL PRIMARY KEY IDENTITY,
[Nombre] VARCHAR(45) NOT NULL
) |
Temporal EDA, Variables & Date Manipulation |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
CREATE KEYSPACE test_keyspace
WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '1'};
CREATE TABLE test_keyspace.employee (
employee_id bigint,
full_name text,
first_name text,
last_name text,
position_id int,
position_title text,
store_id int,
department_id int,
birth_date text,
hire_date text,
salary float,
supervisor_id int,
education_level text,
marital_status text,
gender text,
management_role text,
ascii_field ascii,
blob_field blob,
boolean_field boolean,
date_field date,
decimal_field decimal,
double_field double,
duration_field duration,
inet_field inet,
time_field time,
timestamp_field timestamp,
timeuuid_field timeuuid,
uuid_field uuid,
varchar_field varchar,
varint_field varint,
PRIMARY KEY (full_name, employee_id)
) WITH CLUSTERING ORDER BY (employee_id ASC);
USE test_keyspace;
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role, ascii_field, blob_field, boolean_field, date_field, decimal_field, double_field, duration_field, inet_field, time_field, timestamp_field, timeuuid_field, uuid_field, varchar_field, varint_field)
VALUES (1, 'Sheri Nowmer', 'Sheri', 'Nowmer', 1, 'President',0,1, '1961-08-26', '1994-12-01 00:00:00.0',80000.0 ,0, 'Graduate Degree', 'S', 'F', 'Senior Management', 'abc', bigintAsBlob(3), true, '2011-02-03', 123.456, 321.123, 3d89h4m48s, '8.8.8.8', '04:05:00', '2011-02-03 04:05:00', 50554d6e-29bb-11e5-b345-feff819cdc9f, 50554d6e-29bb-11e5-b345-feff819cdc9f, 'abc', 123);
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (2, 'Derrick Whelply', 'Derrick', 'Whelply', 2, 'VP Country Manager',0,1, '1915-07-03', '1994-12-01 00:00:00.0',40000.0 ,1, 'Graduate Degree', 'M', 'M', 'Senior Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (4, 'Michael Spence', 'Michael', 'Spence', 2, 'VP Country Manager',0,1, '1969-06-20', '1998-01-01 00:00:00.0',40000.0 ,1, 'Graduate Degree', 'S', 'M', 'Senior Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (5, 'Maya Gutierrez', 'Maya', 'Gutierrez', 2, 'VP Country Manager',0,1, '1951-05-10', '1998-01-01 00:00:00.0',35000.0 ,1, 'Bachelors Degree', 'M', 'F', 'Senior Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (6, 'Roberta Damstra', 'Roberta', 'Damstra', 3, 'VP Information Systems',0,2, '1942-10-08', '1994-12-01 00:00:00.0',25000.0 ,1, 'Bachelors Degree', 'M', 'F', 'Senior Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (7, 'Rebecca Kanagaki', 'Rebecca', 'Kanagaki', 4, 'VP Human Resources',0,3, '1949-03-27', '1994-12-01 00:00:00.0',15000.0 ,1, 'Bachelors Degree', 'M', 'F', 'Senior Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (8, 'Kim Brunner', 'Kim', 'Brunner', 11, 'Store Manager',9,11, '1922-08-10', '1998-01-01 00:00:00.0',10000.0 ,5, 'Bachelors Degree', 'S', 'F', 'Store Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (9, 'Brenda Blumberg', 'Brenda', 'Blumberg', 11, 'Store Manager',21,11, '1979-06-23', '1998-01-01 00:00:00.0',17000.0 ,5, 'Graduate Degree', 'M', 'F', 'Store Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (10, 'Darren Stanz', 'Darren', 'Stanz', 5, 'VP Finance',0,5, '1949-08-26', '1994-12-01 00:00:00.0',50000.0 ,1, 'Partial College', 'M', 'M', 'Senior Management');
INSERT INTO employee(employee_id, full_name, first_name, last_name, position_id, position_title, store_id, department_id, birth_date, hire_date, salary, supervisor_id, education_level, marital_status, gender, management_role)
VALUES (11, 'Jonathan Murraiin', 'Jonathan', 'Murraiin', 11, 'Store Manager',1,11, '1967-06-20', '1998-01-01 00:00:00.0',15000.0 ,5, 'Graduate Degree', 'S', 'M', 'Store Management');
CREATE TABLE test_keyspace.nation (
n_nationkey bigint,
n_name text,
n_regionkey int,
PRIMARY KEY (n_nationkey, n_regionkey)
) WITH CLUSTERING ORDER BY (n_regionkey ASC);
INSERT INTO nation(n_nationkey, n_name, n_regionkey)
VALUES (0, 'ALGERIA', 1);
CREATE TABLE arr (
f_int int PRIMARY KEY,
string_arr list<text>,
int_arr list<int>,
int_set set<int>
);
INSERT INTO arr (f_int, string_arr, int_arr, int_set)
VALUES (0, ['a', 'b', 'c', 'd'], [1, 2, 3, 4, 0], {9, 8, 7, 6, 5});
CREATE TABLE map (
prim_field int PRIMARY KEY,
nest_field map<text, text>,
more_nest_field map<text, frozen<map<text, text>>>,
map_arr list<frozen<map<text, int>>>
);
INSERT INTO map (prim_field, nest_field, more_nest_field, map_arr)
VALUES (0, {'a':'123', 'b':'abc'}, {'a':{'b':'abc'}}, [{'a':123, 'b':321}, {'c':456, 'd':789}]);
CREATE TABLE tuple (
prim_field int PRIMARY KEY,
tuple_field tuple<int, text, double>
);
|
col attributes format a30
col autotask_status head 'AUTOTASK|STATUS'
col client_name format a40
col current_job_name format a30
col deferred_window_name format a20
col duration format a26
col health_monitor head 'HEALTH|MONITOR'
col job_name format a25
col job_duration format a15 head 'JOB DURATION'
col job_error format 99999 head 'JOB|ERROR'
col job_info format a40 head 'JOB INFO'
col job_scheduler_status format a15
col job_start_time format a26 head 'JOB STATS TIME'
col job_status format a10 head 'JOB STATUS'
col last_good_date format a26
col last_try_date format a26
col last_try_result format a26
col next_try_date format a26
col next_start_date format a26
col operation_name format a30
col optimizer_stats head 'OPTIMIZER|STATS'
col repeat_interval format a80 head 'REPEAT INTERVAL'
col retry_count format 99999
col segment_advisor head 'SEGMENT|ADVISOR'
col sql_tune_advisor head 'SQL TUNE|ADVISOR'
col start_time format a26
col status format a8
col task_name format a30
col task_operation format a32 head 'TASK OPERATION'
col task_priority format a8 head 'TASK|PRIORITY'
col task_target_name format a30
col task_target_type format a30
col window_active head 'WINDOW|ACTIVE'
col window_duration format a26
col window_end_time format a26
col window_name format a20
col window_name head 'WINDOW NAME'
col window_next_time format a26 head 'WINDOW NEXT TIME'
col window_start_time format a26
col window_start_time format a26
|
/*
Name: Listing Views by MG..Agent (Lead Details)
Data source: 4
Created By: Admin
Last Update At: 2015-10-01T14:18:29.268801+00:00
*/
select
nvl(MarketingGroup_name,Lead_marketingGroup_name) as MarketingGroup,
nvl(Brokerage_name,Lead_brokerage_name) as Brokerage,
nvl(Branch_name,Lead_branch_name) as Branch,
nvl(Agent_name,Lead_agent_name) as Agent,
nvl(Listing,Leads_Listing) as Listing,
nvl(ListingAddress,Leads_ListingAddress) as ListingAddress,
Views,Visits,Visitors,Leads,ExternalClicks,
Leads_date,Leads_Contact_Name,Leads_Email,Leads_Phone,Leads_Inquiry
from (
SELECT * FROM (
SELECT
marketingGroup_name,
brokerage_name,
branch_name,
agent_name,
Listing,
ListingAddress,
Views,Visits,Visitors,
nvl(integer(Leads),integer(0)) AS Leads,
nvl(integer(CLICKS.ExternalClicks),integer(0)) as ExternalClicks,
FROM
(Select
marketingGroup_name,marketingGroup_id,brokerage_name,brokerage_id,branch_name,branch_id,agent_name,agent_id,Views,Listing,
Lis_Det.address as ListingAddress,Visits,Visitors
from
(SELECT marketingGroup_name,
marketingGroup_id,
brokerage_name,
brokerage_id,
branch_name,
branch_id,
agent_name,
agent_id,
COUNT(visit_num) AS Views,
Listing,
COUNT(DISTINCT post_visid_high + "-" + post_visid_low + "-" + visit_num) Visits,
COUNT(DISTINCT post_visid_high + "-" + post_visid_low) Visitors,
FROM
(SELECT MG_HL1.marketingGroup_name as marketingGroup_name,
MG_HL1.marketingGroup_id as marketingGroup_id,
MG_HL1.brokerage_name as brokerage_name,
MG_HL1.brokerage_id as brokerage_id,
MG_HL1.branch_name as branch_name,
MG_HL1.branch_id as branch_id,
MG_HL1.agent_name as agent_name,
MG_HL1.agent_id as agent_id,
post_visid_high,
post_visid_low,
visit_num,
t2.Listing as Listing
FROM
(SELECT nvl(L.Listing,t1.Listing) as Listing, post_visid_high, post_visid_low, visit_num
FROM ( SELECT FIRST(SPLIT(LAST(SPLIT(post_prop5, '/')), '-')) AS Listing,
post_visid_high,
post_visid_low,
visit_num
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,"table_id CONTAINS '2015_' AND length(table_id) >= 4"))
WHERE post_page_event = "0" /*PageViewCalls*/
AND DATE(date_time) >= DATE('{{startdate}}')
AND DATE(date_time) <= DATE('{{enddate}}')
AND post_prop19 = 'listing' /* Counting Listings */) t1
FULL OUTER JOIN each (Select string(id) as Listing from [djomniture:devspark.MG_Listings] ) AS L ON t1.Listing = L.Listing) t2
JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS MG_HL1 ON t2.Listing = MG_HL1.listing_id)
WHERE (marketingGroup_id = '{{mgid}}')
AND (brokerage_id = '{{brokerageid}}')
AND (branch_id = '{{branchid}}')
GROUP BY marketingGroup_name,
marketingGroup_id,
brokerage_name,
brokerage_id,
branch_name,
branch_id,
agent_name,
agent_id,
Listing) t3
JOIN [djomniture:devspark.MG_Listing_Address] AS Lis_Det ON Listing = Lis_Det.id
) t4
/*OUTER JOIN TO SELECT LEADS OR EMAILS SENT BY MGID*/
LEFT OUTER JOIN
(
SELECT string(count(Lead)) as Leads,Listing_id
FROM (
SELECT 1 as Lead,MG_HL2.Listing_id AS Listing_id
FROM [djomniture:devspark.MG_Leads] l
JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS MG_HL2 ON l.Listing_id = MG_HL2.Listing_id
WHERE (DATE(date) >= DATE('{{startdate}}')
AND DATE(date) <= DATE('{{enddate}}'))
) l
GROUP BY Listing_id
) AS LEADS ON t4.Listing = LEADS.Listing_id
/*OUTER JOIN TO SELECT CLICKS TO REDIRECT TO AN EXTERNAL WEBSITE GROUPED BY MGID*/
LEFT OUTER JOIN
(
SELECT string(COUNT(CLICK)) AS ExternalClicks ,Listing_id FROM (
Select Click,MG_HL3.Listing_id AS Listing_id
from (
SELECT 1 as Click,FIRST(SPLIT(post_prop20, '-')) AS Listing_id
FROM (TABLE_QUERY(djomniture:cipomniture_djmansionglobal,"table_id CONTAINS '2015_' AND length(table_id) >= 4"))
WHERE prop72 IS NOT NULL /*IT IS AN EXTERNAL REDIRECTION*/
AND prop72 != ''
AND prop72 != '__'
AND DATE(date_time) >= DATE('{{startdate}}')
AND DATE(date_time) <= DATE('{{enddate}}')
) c
JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS MG_HL3 ON c.Listing_id = MG_HL3.Listing_id
) GROUP BY Listing_id
) AS CLICKS ON t4.Listing = CLICKS.Listing_id
),
(SELECT
Hier_List.marketingGroup_name as Lead_marketingGroup_name,
Hier_List.brokerage_name Lead_brokerage_name,
Hier_List.branch_name Lead_branch_name,
Hier_List.agent_name Lead_agent_name,
b.listing_id as Leads_Listing,
Lis_Det.address as Leads_ListingAddress,
date(date) AS leads_date,
b.contact_Name as leads_Contact_Name,
b.contact_email AS leads_Email,
b.contact_phone leads_Phone,
NTH(2, SPLIT(regexp_replace(string(text),'\n',' '), '>')) AS leads_Inquiry,
FROM [djomniture:devspark.MG_Leads] b
JOIN [djomniture:devspark.MG_Hierarchy_Listing] AS Hier_List ON b.Listing_id = Hier_List.listing_id
JOIN [djomniture:devspark.MG_Listing_Address] AS Lis_Det ON b.Listing_id = Lis_Det.id
WHERE date(date) >= DATE('{{startdate}}')
AND date(date) <= DATE('{{enddate}}')
AND (Hier_List.marketingGroup_id = '{{mgid}}')
AND (Hier_List.brokerage_id = '{{brokerageid}}')
AND (Hier_List.branch_id = '{{branchid}}')
AND b.listing_id is not null )
) f
ORDER BY 1,2,3,4,5,6
|
CREATE TABLE `job_info` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`job_id` int(10) DEFAULT NULL COMMENT '任务主键',
`job_name` varchar(20) DEFAULT NULL COMMENT '任务名称',
`job_desc` varchar(255) DEFAULT NULL COMMENT '任务描述,包括功能和服务器信息',
`create_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
`update_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
`appkey` varchar(6) DEFAULT NULL COMMENT '作为api接口的身份标识',
`min_count` int(10) DEFAULT NULL COMMENT '最小数量',
`latest_time` timestamp NULL DEFAULT NULL COMMENT '最晚时间',
PRIMARY KEY (`id`),
UNIQUE KEY `appkey` (`appkey`) USING BTREE,
UNIQUE KEY `jobid` (`job_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='爬虫任务基本信息表';
|
DROP PROCEDURE IF EXISTS SP_INLOGUSUARIOS;
DELIMITER $$
CREATE PROCEDURE SP_INLOGUSUARIOS(
IN pnTipoAccion INT,
IN pnIdUSR INT
)
SP:BEGIN
DECLARE vConcatenacion varchar(400);
SET vConcatenacion=(SELECT concat('IdPersonal: ',id_personal,' Nombre: ',nombres,' ',apellidos,' FechaNacimiento: ',fecha_nacimiento,' Sexo: ' ,sexo,' No. Empleado: ',no_empleado,' Activo: ',activo)
from personal1
where (select personal_id_personal from user1 order by id desc limit 1)=id_personal
ORDER BY id_personal DESC LIMIT 1) ;
INSERT INTO `ccocesna`.`log_usuarios`
(`tipo_accion_id_accion`,`user_id`,`fecha_accion`,`detalle_anterior`,`detalle_Nuevo`)
VALUES
(1,pnIdUSR,(select current_timestamp()),null,vConcatenacion);
END $$
DELIMITER ;
/*
call SP_INLOGUSUARIOS(1,1);
*/ |
/***
**
**管理员表OK
**
***/
create table view_admin(
id int unsigned not null primary key auto_increment ,
adminuser varchar(32) not null default '',
adminpass char(32) not null default '',
adminemail varchar(50) not null default '',
logintime int unsigned not null default 0,
loginip bigint not null default 0,
createtime int unsigned not null default 0,
UNIQUE view_admin_adminuser_adminpass(adminuser,adminpass),
UNIQUE view_admin_adminuser_adminemail(adminuser,adminemail)
)engine=innodb charset=utf8;
/***
**
**艺术资讯表OK
**
***/
create table view_news(
newid int unsigned not null primary key auto_increment COMMENT '主键ID',
title varchar(200) not null default '' COMMENT '新闻标题',
content text COMMENT '新闻内容',
cover varchar(200) not null default 'http://ooc0eu4ky.bkt.clouddn.com/58f4b60e1156a' COMMENT '封面照片',
pics text COMMENT '新闻配图',
num int unsigned not null default 0 COMMENT '新闻访问量',
author varchar(50) not null default '' COMMENT '作者姓名',
createtime int unsigned not null default 0 COMMENT '创建时间'
)engine=innodb charset=utf8;
/***
**
**用户基本信息表OK
**
***/
create table view_user(
userid bigint unsigned not null primary key auto_increment,
username varchar(32) not null default '' COMMENT '用户名',
userpass char(32) not null default '' COMMENT '用户密码',
useremail varchar(100) not null default '' COMMENT '用户邮箱',
photo varchar(100) not null default 'http://ooc0eu4ky.bkt.clouddn.com/58f4b60e6c289' COMMENT '用户头像',
phone varchar(30) not null default '' COMMENT '手机号码',
createtime int unsigned not null default 0 COMMENT '用户注册时间',
UNIQUE view_user_username_userpass(username,userpass),
UNIQUE view_user_useremail_userpass(useremail,userpass)
)engine = innodb default charset = utf8;
/***
**
**用户详细信息表OK
**
***/
create table view_profile(
id bigint unsigned not null auto_increment primary key COMMENT '主键ID',
truename varchar(32) not null default '' COMMENT '真实姓名',
introduction text COMMENT '个人简介',
age tinyint unsigned not null default 0 COMMENT '年龄',
sex ENUM('0','1','2') not null default '0' COMMENT '性别',
nickname varchar(32) not null default '' COMMENT '昵称',
userid bigint unsigned not null default 0 COMMENT '用户ID',
createtime int unsigned not null default 0 COMMENT '创建时间',
UNIQUE view_profile_userid(userid))engine=innodb default charset=utf8;
/***
**
**艺术家信息表
**
***/
create table view_artist(
artistid bigint unsigned primary key auto_increment COMMENT '主键ID',
name varchar(100) not null default '' COMMENT '姓名',
identity varchar(200) not null default '' COMMENT '身份/职业',
career text COMMENT '个人履历',
introduction text COMMENT '个人简介',
cover varchar(300) not null default 'http://ooc0eu4ky.bkt.clouddn.com/110bab535259d9525201133b51765a8e.jpg' COMMENT '封面照片',
pics text COMMENT '艺术家配图',
num int unsigned not null default 0 COMMENT '被关注人数',
createtime int unsigned not null default 0 COMMENT '创建时间'
)engine=innodb default charset=utf8;
/***
**
**作品信息表
**
***/
create table view_production(
productionid bigint unsigned not null primary key auto_increment,
title varchar(100) not null default '' COMMENT '标题',
content text COMMENT '文字简介',
cover varchar(255) not null default 'http://ooc0eu4ky.bkt.clouddn.com/590c31da2f381' COMMENT '封面图片',
pics text COMMENT '有关图片',
artistid bigint unsigned not null default 1 COMMENT '属于艺术家',
createtime int unsigned not null default 0 COMMENT '创建时间',
index view_production_artistid(artistid))engine=innodb default charset=utf8;
/***
**
**展览消息表OK
**
***/
create table view_show(
showid bigint unsigned not null primary key auto_increment COMMENT '主键ID',
title varchar(200) not null default '' COMMENT '消息标题',
smalltitle varchar(50) not null default '' COMMENT '小标题',
introduction text COMMENT '展览简介',
cover varchar(300) not null default 'http://ooc0eu4ky.bkt.clouddn.com/HjHVL55VWVswbr0sOaVIouQ.jpg%211200.jpg' COMMENT '封面图片',
pics text COMMENT '展览图片',
pay int not null default 0 COMMENT '入场费用',
num int unsigned not null default 0 COMMENT '报名人数',
start_time int not null default 0 COMMENT '展览开始时间',
end_time int not null default 0 COMMENT '展览结束时间',
day_time varchar(100) not null default '' COMMENT '每天开放时间',
city varchar(50) not null default '北京' COMMENT '展览城市',
place varchar(200) not null default '' COMMENT '展览地点',
isCover tinyint not null default 0 COMMENT '是否为封面图片',
artistid bigint unsigned not null default 1 COMMENT '此展览有关人物',
createtime int unsigned not null default 0 COMMENT '消息发布时间',
index view_show_artistid(artistid)
)engine=innodb default charset=utf8;
/***
**
**系统通知表OK
**
***/
create table view_notify(
notifyid bigint unsigned primary key auto_increment not null COMMENT '主键ID',
title varchar(50) not null default '' COMMENT '通知标题',
content varchar(500) not null default '' COMMENT '通知内容',
userid bigint not null default 0 COMMENT '发送给谁',
createtime int not null default 0 COMMENT '发送时间',
index view_notify_userid(userid))engine=innodb default charset=utf8;
INSERT into view_notify(title,content,userid)values('系统通知','您所关心的 “梵高世纪画展已经开始”,望周知',3);
/***
**
**报名记录表OK
**
***/
create table view_ticket(
ticketid bigint unsigned primary key auto_increment not null COMMENT '主键ID',
phone varchar(20) not null default '' COMMENT '手机',
showid bigint not null default 0 COMMENT '展览消息ID',
userid bigint not null default 0 COMMENT '用户ID',
createtime int not null default 0 COMMENT '创建时间',
index view_ticket_showid(showid),
index view_ticket_userid(userid))engine = innodb default charset = utf8;
/***
**
**关注展览表
**
***/
create table view_careshow(
id int unsigned primary key auto_increment,
userid bigint unsigned not null default 0 COMMENT '用户ID',
showid bigint unsigned not null default 0 COMMENT '展览ID',
createtime int unsigned not null default 0 COMMENT '创建时间',
index view_care_userid(userid),
index view_care_showid(showid))engine=innodb default charset=utf8;
INSERT INTO view_careshow(userid,showid) values(3,2);
/***
**
**关注艺术家表
**
***/
create table view_careart(
id int unsigned primary key auto_increment,
userid bigint unsigned not null default 0 COMMENT '用户ID',
artistid bigint unsigned not null default 0 COMMENT '艺术家ID',
createtime int unsigned not null default 0 COMMENT '创建时间',
index view_care_userid(userid),
index view_care_artistid(artistid))engine=innodb default charset=utf8;
INSERT INTO view_careart(userid,artistid) values(3,2);
/***
**
**意见反馈表
**
***/
create table view_suggestion(
sugid int unsigned primary key auto_increment COMMENT '主键ID',
name varchar(100) not null default '' COMMENT '名字',
phone varchar(100) not null default '' COMMENT '联系方式',
suggest text COMMENT '意见',
createtime int unsigned not null default 0 COMMENT '创建时间',
)engine=innodb default charset=utf8; |
-- TITLE1:
-- TITLE2:Displaying Database Supplemental Logging Specifications
-- DESC:
COLUMN log_min HEADING 'Minimum|Supplemental|Logging?' FORMAT A12
COLUMN log_pk HEADING 'Primary Key|Supplemental|Logging?' FORMAT A12
COLUMN log_fk HEADING 'Foreign Key|Supplemental|Logging?' FORMAT A12
COLUMN log_ui HEADING 'Unique|Supplemental|Logging?' FORMAT A12
COLUMN log_all HEADING 'All Columns|Supplemental|Logging?' FORMAT A12
SELECT SUPPLEMENTAL_LOG_DATA_MIN log_min,
SUPPLEMENTAL_LOG_DATA_PK log_pk,
SUPPLEMENTAL_LOG_DATA_FK log_fk,
SUPPLEMENTAL_LOG_DATA_UI log_ui,
SUPPLEMENTAL_LOG_DATA_ALL log_all
FROM V$DATABASE;
|
CREATE TABLE `t_cor_correction` (
`cor_id` bigint(20) NOT NULL AUTO_INCREMENT,
`cor_pre_id` bigint(20) NOT NULL,
`cor_correction` enum('male','female','correct','other') DEFAULT NULL,
`cor_ts` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`cor_id`),
KEY `prediction_id` (`cor_pre_id`),
KEY `correction` (`cor_correction`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4;
CREATE TABLE `t_pre_prediction` (
`pre_id` bigint(20) NOT NULL AUTO_INCREMENT,
`pre_term` varchar(500) NOT NULL,
`pre_type` enum('url','twitter_username','first_name') DEFAULT NULL,
`pre_prediction` varchar(45) DEFAULT NULL,
`pre_count` int(11) DEFAULT '1',
`pre_created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`pre_last_accessed` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`pre_id`),
KEY `term` (`pre_term`(191)),
KEY `type` (`pre_type`),
KEY `prediction` (`pre_prediction`)
) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4;
|
SELECT TOP (1)
(
SELECT AVG(e.Salary)
FROM Employees e
WHERE DepartmentID = d.DepartmentID
) AS MinAverageSalary
FROM Departments d
ORDER BY MinAverageSalary ASC |
-- Updates the supplier_id of any files posted today and the previous day.
-- ~30 mins
SELECT 'Updating trans_clean supplier_ids.', CURRENT_TIMESTAMP;
UPDATE trans_clean
SET supplier_id = usm3.sid
FROM usm3
WHERE usm3.sss = trans_clean.supplier_source_string
AND usm3.mm = 'true'
AND trans_clean.supplier_id is null
--AND trans_clean.created_at > now()::date - 1
; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.