text stringlengths 6 9.38M |
|---|
#存储过程和函数
/*
存储过程和函数:类似于Java中的方法
好处:
1.提高代码的重用性
2.简化操作
*/
#存储过程
/*
定义:一组预先编译好的SQL语句的集合,理解成批处理SQL语句
1,提高代码的重用性
2,简化操作
3,减少了编译次数并且减少了和数据库服务器的连接次数,提高了效率
*/
#一、创建语法
CREATE PROCEDURE 存储过程名(参数列表)
BEGIN
存储过程体(一组合法的SQL语句)
END
#注意:
/*
1、参数列表包含三部分
参数模式 参数名 参数类型
举例:
in 参数名 varchar(20)
参数模式:
in: 该参数可以作为输入,也就是该参数需要调用方传入值
out: 该参数可以作为输出,也就是该参数可以作为返回值
inout: 该参数既可以作为输入又可以作为输出,也就是该参数即需要传入值,又可以返回值
2、如果存储过程体仅仅只有一句话,begin end可以省略
存储过程体中的每条sql语句的结尾要求必须加分号
存储过程的结尾可以使用delimiter重新设置
语法:
delimiter 结束标记
案例:
delimiter $
*/
#二、调用语法
CALL 存储过程名(实参列表);
#1.空参列表
#案例:插入到admin表中的五条记录(在girls库中的表admin)
USE girls;
SELECT * FROM admin;
#delimiter, procedure
DELIMITER $
CREATE PROCEDURE myp1()
BEGIN
INSERT INTO admin(username, PASSWORD) VALUES
("alice","0000"),("tom","0000"),("jack","0000"),("rose","0000"),("tommes","0000");
END $
#调用
CALL myp1()$
#2.创建带in模式参数的存储过程
#案例1:创建存储过程中实现 根据女神名,查询对应的男神信息
CREATE PROCEDURE myp2(IN beautyname VARCHAR(20))
BEGIN
SELECT bo.*
FROM boys bo
RIGHT JOIN beauty b ON bo.id=b.boyfriend_id
WHERE b.name=beautyname;
END $
#调用
CALL myp2("赵敏")$
#案例2:创建存储过程实现,用户是否登录成功
DELIMITER $
CREATE PROCEDURE myp3(IN username VARCHAR(20),IN PASSWORD VARCHAR(20))
BEGIN
DECLARE result INT DEFAULT 0;#声明并初始化
SELECT COUNT(*) INTO result #赋值
FROM admin
WHERE admin.`username`=username
AND admin.`password`=PASSWORD;
SELECT IF(result>0,"成功","失败");#使用
END$
#3.创建out模式参数的存储过程
#案例1:根据输入的女神名,返回对应的男神名
CREATE PROCEDURE myp4(IN beautyname VARCHAR(20), OUT boyname VARCHAR(20))
BEGIN
SELECT bo.boyname INTO boyname
FROM boys bo
RIGHT JOIN beauty b
ON b.boyfriend_id = bo.id
WHERE b.name = beautyname;
END$
DELIMITER $
BEGIN
SELECT * FROM admin;
END$
|
DROP DATABASE IF EXISTS passport_demo;
CREATE DATABASE passport_demo;
|
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50173
Source Host : localhost:3306
Source Schema : mt-store
Target Server Type : MySQL
Target Server Version : 50173
File Encoding : 65001
Date: 07/06/2020 16:36:51
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for store
-- ----------------------------
DROP TABLE IF EXISTS `store`;
CREATE TABLE `store` (
`id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '主键',
`title` varchar(1000) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商店名称',
`phone` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '号码:座机或者手机号',
`city` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'city',
`address` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '详细地址\r\n',
`areaname` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商家区域',
`latitude` double(11, 0) NULL DEFAULT NULL COMMENT '纬度',
`longitude` double(11, 0) NULL DEFAULT NULL COMMENT '经度',
`avg_score` double(11, 0) NULL DEFAULT NULL COMMENT '打分',
`comments` int(11) NULL DEFAULT NULL COMMENT '评论数量',
`backCateName` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商家主题',
`store_id` int(11) NULL DEFAULT NULL COMMENT '商家id',
`avg_price` int(10) NULL DEFAULT NULL COMMENT '人均价格',
`source_key` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据来源关键词',
`source_data` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '数据源',
`creat_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
`update_time` datetime NULL DEFAULT NULL COMMENT '更新时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Compact;
SET FOREIGN_KEY_CHECKS = 1;
|
create table blog_entries(
id int not null auto_increment primary key,
text text not null,
name varchar(25) not null,
time timestamp not null default current_timestamp,
key(time)
) engine=InnoDB charset=utf8;
create table blog_comments(
id int not null auto_increment primary key,
blog_entry_id int not null references blog_entries(id),
name varchar(25) not null,
text text not null,
time timestamp not null default current_timestamp,
key(blog_entry_id),
key(time)
) engine=InnoDB charset=utf8; |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jul 26, 2021 at 04:42 PM
-- Server version: 8.0.21
-- PHP Version: 7.4.9
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: `mailerlite`
--
-- --------------------------------------------------------
--
-- Table structure for table `api_users`
--
DROP TABLE IF EXISTS `api_users`;
CREATE TABLE IF NOT EXISTS `api_users` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`api_key` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Table structure for table `groups`
--
DROP TABLE IF EXISTS `groups`;
CREATE TABLE IF NOT EXISTS `groups` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`group_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`group_id` bigint NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
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 */;
|
--------------------------------------------------------------------------
-- .rem command test
--------------------------------------------------------------------------
.help rem
.rem
SELECT 1234;
.end rem
.help rem
.rem asdfasdfasdf
asdfasdf;
asd;
a//z/
.end rem
.help rem
|
/*SELECT
product_name,
brand_name,
list_price
FROM
production.products p
INNER JOIN production.brands b
ON b.brand_id = p.brand_id;
*/
/*CREATE VIEW sales.product_info
AS
SELECT
product_name,
brand_name,
list_price
FROM
production.products p
INNER JOIN production.brands b
ON b.brand_id = p.brand_id;
*/
SELECT * FROM sales.product_info;
|
insert into bonuses (name, valid_from, valid_to, type, created_by, created_date, promotion_id,
amount, maximum_amount, quantity, percentage, currency, required_level,
allowed_countries, max_grant_numbers)
values
('Welcome Bonus: 200% Match bonus up to €200', timestamp('2014-04-22 23:59:59'), timestamp('2015-12-31 23:59:59'), 'DEPOSIT_BONUS', 1, current_timestamp, 1001,
null, 20000, null, 200, 'EUR', 1,
null, 1),
('€13 FREE Chip - Bonus money', timestamp('2014-04-22 23:59:59'), timestamp('2014-05-04 23:59:59'), 'BONUS_MONEY', 1, current_timestamp, 1001,
1300, null, null, null, 'EUR', 1,
'SWEDEN', 1),
('100% Match bonus up to 200€', timestamp('2014-04-22 23:59:59'), timestamp('2015-12-31 23:59:59'), 'DEPOSIT_BONUS', 1, current_timestamp, 1002,
null, 20000, null, 100, 'EUR', 1,
null, 1),
('5€ Free Chip', timestamp('2014-04-22 23:59:59'), timestamp('2015-12-31 23:59:59'), 'BONUS_MONEY', 1, current_timestamp, 1,
500, null, null, null, 'EUR', 1,
null, null),
('10€ Free Chip', timestamp('2014-04-22 23:59:59'), timestamp('2015-12-31 23:59:59'), 'BONUS_MONEY', 1, current_timestamp, 1,
1000, null, null, null, 'EUR', 1,
null, null),
('20€ Free Chip', timestamp('2014-04-22 23:59:59'), timestamp('2015-12-31 23:59:59'), 'BONUS_MONEY', 1, current_timestamp, 1,
2000, null, null, null, 'EUR', 1,
null, null),
('20 Free Spins', timestamp('2014-04-22 23:59:59'), timestamp('2015-12-31 23:59:59'), 'FREE_ROUND', 1, current_timestamp, 1,
null, null, null, null, 'EUR', 1,
null, null);
|
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-07-2017 a las 08:08:37
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 7.1.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 */;
--
-- Base de datos: `laravelcrud`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `alumnos`
--
CREATE TABLE `alumnos` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
`surname` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
`year` enum('2015','2016','2017') COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `alumnos`
--
INSERT INTO `alumnos` (`id`, `name`, `surname`, `year`, `created_at`, `updated_at`) VALUES
(3, 'Pepa', 'Flores', '2016', NULL, NULL),
(5, 'rosa', 'martinez', '2017', '2017-07-05 02:48:11', '2017-07-05 02:54:23'),
(7, 'Maria', 'delMonte', '2015', '2017-07-05 02:54:37', '2017-07-05 02:54:37');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(9, '2014_10_12_000000_create_users_table', 1),
(10, '2014_10_12_100000_create_password_resets_table', 1),
(11, '2017_07_04_031432_create_table_pasteles_table', 2),
(12, '2017_07_05_032031_create_table_alumnos', 3);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `pasteles`
--
CREATE TABLE `pasteles` (
`id` int(10) UNSIGNED NOT NULL,
`nombre` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
`sabor` enum('chocolate','vainilla','cheesecake') COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `pasteles`
--
INSERT INTO `pasteles` (`id`, `nombre`, `sabor`, `created_at`, `updated_at`) VALUES
(5, 'pastelito creadito', 'cheesecake', '2017-07-04 03:24:42', '2017-07-04 03:24:42'),
(6, 'mirwerewrwerwerwe', 'chocolate', '2017-07-04 03:24:51', '2017-07-04 03:25:20'),
(7, 'easeaseaseas', 'cheesecake', '2017-07-04 03:25:31', '2017-07-04 03:25:31');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `users`
--
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`username` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Volcado de datos para la tabla `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `remember_token`, `created_at`, `updated_at`, `username`) VALUES
(1, 'Administrator', 'admin@admin.com', '$2y$10$auMZt13sLNm18IuTSVsjEeTZKCycd5O0V9Onoycl.Cn679i47wZyu', NULL, '2017-07-05 03:03:18', '2017-07-05 03:03:18', 'admin'),
(2, 'ruth', 'rqvaquero@gmail.com', '$2y$10$8fT8exsjjAKzkO6aTtYtDuGerNiQBOKi13OLmoJbLIljFnA7Gd.oe', '9YnbNJDj2GshodxX2GpqJoGhliF2lb914w1DRvUaW37JInUViA6qKgoW8j95', '2017-07-05 03:12:04', '2017-07-05 03:12:04', 'ruth');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `alumnos`
--
ALTER TABLE `alumnos`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indices de la tabla `pasteles`
--
ALTER TABLE `pasteles`
ADD PRIMARY KEY (`id`);
--
-- Indices de la tabla `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `alumnos`
--
ALTER TABLE `alumnos`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT de la tabla `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT de la tabla `pasteles`
--
ALTER TABLE `pasteles`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT de la tabla `users`
--
ALTER TABLE `users`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
/*!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 */;
|
/* number of dives by diver */
SELECT COUNT(diver_id) AS number_of_dives
FROM dives
WHERE diver_id = 1
GROUP BY diver_id;
/* average dive duration by location */
SELECT AVG(duration)
::INT AS average_duration
FROM dives WHERE location_id = 1 GROUP BY location_id;
/* most active month */
SELECT DATE_TRUNC('month', dive_date) AS month, COUNT(*) AS dive_count
FROM dives
WHERE dive_date > NOW() - INTERVAL
'1 year'
GROUP BY month
ORDER BY dive_count DESC LIMIT 1;
/* query the single deepest dive from a location, using a subquery */
/* concat the diver name and then call that field diver_name */
SELECT CONCAT(divers.first_name, ' ', divers.last_name) AS diver_name, dives.depth
FROM dives
LEFT JOIN divers ON dives.diver_id = divers.id
WHERE dives.depth = (
SELECT MAX(depth)
FROM dives
WHERE location_id = 1
);
/* query all the diver certification levels */
/* make sure each diver record we get is unique using DISTINCT */
/* we could also use GROUP BY here to get distinct entries */
SELECT DISTINCT dives.diver_id, certifications.name
from dives
LEFT JOIN divers ON dives.diver_id = divers.id
LEFT JOIN certifications ON divers.certification_id = certifications.id;
/* same query as above but using a CTE (common table expression) */
/* this query finds the most prevalent certification at a given dive loation */
WITH
certs
AS
(
SELECT DISTINCT dives.diver_id, certifications.name
from dives
LEFT JOIN divers ON dives.diver_id = divers.id
LEFT JOIN certifications ON divers.certification_id = certifications.id
WHERE dives.location_id = 1
GROUP BY dives.diver_id, certifications.name
)
SELECT name
FROM certs
GROUP BY name
ORDER BY COUNT(name) DESC
LIMIT 1;
|
INSERT INTO coach (name_first, name_last, email, sport, team_name)
VALUES ($1, $2, $3, $4, $5)
RETURNING *;
|
ALTER TABLE user
ADD COLUMN password VARCHAR(50) NOT NULL COMMENT '密码';
|
DELIMITER $$
USE `cci_gh_go_dev`$$
DROP PROCEDURE IF EXISTS `SPAdminQSFieldStaffApplicationStats`$$
CREATE DEFINER=`phanipothula`@`%` PROCEDURE `SPAdminQSFieldStaffApplicationStats`()
BEGIN
DELETE FROM `AdminQuickStatsCategoryAggregate`
WHERE `adminQSTypeId` = 1 AND `adminQSCategoryId` = 4;
ALTER TABLE AdminQuickStatsCategoryAggregate AUTO_INCREMENT = 1;
INSERT INTO `AdminQuickStatsCategoryAggregate`
(`adminQSTypeId`,`adminQSCategoryId`,`adminQSCategoryName`,`adminQSCategoryAggregate`,`status`,`modifiedDate`)
VALUES
(1,4,'FieldStaff',(SELECT COUNT(`fieldStaffGoId`) FROM `FieldStaff` WHERE `fieldStaffStatusId` = 2),
'Pending',CURRENT_TIMESTAMP),
(1,4,'FieldStaff',(SELECT COUNT(`fieldStaffGoId`) FROM `FieldStaff` WHERE `fieldStaffStatusId` = 5),
'Future Prospect',CURRENT_TIMESTAMP),
(1,4,'FieldStaff',(SELECT COUNT(`fieldStaffGoId`) FROM `FieldStaff` WHERE `fieldStaffStatusId` = 3),
'Approved',CURRENT_TIMESTAMP),
(1,4,'FieldStaff',(SELECT COUNT(`fieldStaffGoId`) FROM `FieldStaff` WHERE `fieldStaffStatusId` = 1),
'Not Approved',CURRENT_TIMESTAMP),
(1,4,'FieldStaff',(SELECT COUNT(`fieldStaffGoId`) FROM `FieldStaff` WHERE `fieldStaffStatusId` = 4),
'Rejected',CURRENT_TIMESTAMP);
END$$
DELIMITER ; |
/*
Navicat SQLite Data Transfer
Source Server : Douban
Source Server Version : 30808
Source Host : :0
Target Server Type : SQLite
Target Server Version : 30808
File Encoding : 65001
Date: 2017-01-17 22:49:35
*/
PRAGMA foreign_keys = OFF;
-- ----------------------------
-- Table structure for movie
-- ----------------------------
DROP TABLE IF EXISTS "main"."movie";
CREATE TABLE "movie" (
"id" TEXT NOT NULL,
"title" TEXT,
"original_title" TEXT,
"year" TEXT,
"rating" TEXT,
"genres" TEXT,
"collect_count" INTEGER,
"subtype" TEXT,
"alt" TEXT,
"images" TEXT,
PRIMARY KEY ("id" ASC)
);
|
CREATE TABLE [ERP].[ValeTransferenciaReferencia] (
[ID] INT IDENTITY (1, 1) NOT NULL,
[IdValeTransferencia] INT NULL,
[IdReferenciaOrigen] INT NULL,
[IdReferencia] INT NULL,
[IdTipoComprobante] INT NULL,
[Serie] VARCHAR (20) NULL,
[Documento] VARCHAR (20) NULL,
[FlagInterno] BIT NULL,
PRIMARY KEY CLUSTERED ([ID] ASC),
FOREIGN KEY ([IdValeTransferencia]) REFERENCES [ERP].[ValeTransferencia] ([ID])
);
|
SELECT -- WHAT TO BUILD and where to sell
/*
One way to yield on this is to build 5-10 different kinds of products out of those that show higher profits,
and keep filling the shelves as they sell. Another valuable info is which products do not seem profitable at the moment.
*/
INITCAP(fin.produce) AS produce, INITCAP(fin.name_region) AS region
, fin.sel_samples AS sells
,TO_CHAR( fin.lowest_offer, '990G990G990G990') AS lowest_offer
,TO_CHAR( fin.offers_low_range, '990G990G990G990') AS offers_low_range
, fin.buy_samples AS buys
,TO_CHAR( fin.highest_bid, '990G990G990G990') AS highest_bid
,TO_CHAR( fin.bids_high_range, '990G990G990G990') AS bids_high_range
,TO_CHAR( fin.mid_spread, '990G990G990G990') AS mid_spread
,TO_NUMBER( :adjust ) AS adj
,TO_CHAR( fin.mid_spread + ((fin.lowest_offer - fin.mid_spread) * :adjust/100), '990G990G990G990') AS my_adjusted_offer
,TO_CHAR( fin.mid_spread_jita, '990G990G990G990') AS mid_spread_jita
,TO_CHAR( fin.breakeven, '990G990G990G990') AS break
,TO_CHAR( fin.buy_samples * fin.bids_high_range, '990G990G990G990') AS demand
/*
Adjust as percentage between highest_bid (-100), mid_spread (0), and lowest_offer (100), eg.:
bid mid offer
| | | -100: immediate cash-in by selling to highest bidder
|XXXXXXXXXX| | 0: assume mid_spread
|XXXXXXXXXX|XXXXX | 50: between mid_spread and lowest_offer
|XXXXXXXXXX|XXXXXXXXX | 90: barely undercut the lowest_offer... ofc takes progressively longer to sell
The greatest of { mid spread at Jita, your adjusted offer } becomes Margin against Breakeven.
And that margin is also made the Sort Order.
*/
,utils.per_cent(p_share => GREATEST(fin.mid_spread + ((fin.lowest_offer - fin.mid_spread) * :adjust/100)
,fin.mid_spread_jita)
-fin.breakeven
,p_total => fin.breakeven
,p_decimals => 1) AS margin
FROM (SELECT brk.produce
,brk.outcome_units
,sel.name_region
,sel.samples AS sel_samples
,sel.lowest_offer
,sel.offers_low_range
,buy.samples AS buy_samples
,buy.highest_bid
,buy.bids_high_range
,(sel.lowest_offer
+buy.highest_bid) /2 AS mid_spread
,brk.breakeven
,(SELECT ROUND((MIN(s_sel.lowest_offer) + MAX(s_buy.highest_bid)) /2, 2)
FROM vw_avg_sells_regions s_sel
INNER JOIN vw_avg_buys_regions s_buy ON s_sel.part_id = s_buy.part_id
AND s_sel.region = s_buy.region
WHERE s_sel.part_id = brk.produce_id
AND s_sel.region = 10000002) AS mid_spread_jita -- at The Forge, most likely Jita then
FROM (SELECT pdc.produce_id, pdc.produce, goo.outcome_units
,load_market_data.get_breakeven(SUM(agr.offers_low_range
*utils.calculate(REPLACE(pdc.formula_bp_orig
,':UNITS'
,goo.outcome_units)) -- for simplicity lets assume we build only one Unit
/goo.outcome_units)) AS breakeven -- and for comparison also when one Run builds many units
FROM vw_produce_leaves pdc
INNER JOIN part goo ON goo.ident = pdc.produce_id
INNER JOIN part prt ON prt.ident = pdc.part_id
INNER JOIN vw_avg_sells_regions agr ON agr.part_id = prt.ident
WHERE pdc.produce LIKE '%'|| UPPER(:produce) ||'%'
-- produce belongs to this group
AND (utils.keywd(pdc.produce_id, UPPER(:keyword)) = utils.f_get('k_numeric_true') OR :keyword IS NULL)
-- produce not in these groups
AND utils.keywd(pdc.produce_id, 'ORE') <> utils.f_get('k_numeric_true')
AND utils.keywd(pdc.produce_id, 'BLUEPRINTS') <> utils.f_get('k_numeric_true')
-- produce doesnt have a part in these groups
AND NOT EXISTS (SELECT 1 --*
FROM keyword kwd
INNER JOIN keyword_map kmp ON kmp.keyword_id = kwd.ident
INNER JOIN composite cmp ON cmp.part_id = kmp.part_id
WHERE cmp.good_id = pdc.produce_id
AND kwd.label IN ('CONTRACTS')) -- { Faction Ships, Named Modules }
AND agr.region = load_market_data.get_econ_region(p_part_id => prt.ident
,p_direction => agr.direction
,p_local_regions => :local_buy)
GROUP BY pdc.produce_id, pdc.produce, goo.outcome_units) brk
-- sells and buys may OUTER JOIN to Product data, but they must INNER JOIN together because we need mid_spread
LEFT OUTER JOIN vw_avg_sells_regions sel ON sel.part_id = brk.produce_id
INNER JOIN vw_avg_buys_regions buy ON buy.part_id = brk.produce_id
AND buy.region = sel.region
LEFT OUTER JOIN local_regions loc ON loc.region = sel.region
-- This must go together with that LEFT OUTER JOIN
WHERE ( loc.region IS NOT NULL
OR :local_sell IS NULL)
AND (( 1=1 -- comment out any of the below and still works
-- AND ( buy.bids_high_range * buy.samples > load_market_data.f_get('k_notable_demand_good') ) -- capital bound in buy orders means interest
-- AND ( brk.breakeven / buy.highest_bid < load_market_data.f_get('k_buys_max_below_break') ) -- conflicts with high :adjust
-- AND ( sel.lowest_offer / brk.breakeven > load_market_data.f_get('k_sells_min_above_break') ) -- basically rules out negative margins
)
OR :produce IS NOT NULL) -- obviously you want full results with specific Searches regardless whether theyre promising or not
) fin
ORDER BY utils.per_cent(p_share => GREATEST(fin.mid_spread + ((fin.lowest_offer - fin.mid_spread) * :adjust/100)
,fin.mid_spread_jita)
-fin.breakeven
,p_total => fin.breakeven) DESC
;
SELECT -- BREAKEVEN FOR PRODUCE if all input materials bought at low, and FROM WHERE TO BUY them
/*
You will want to be MORE Price Sensitive with materials that constitute to higher pct (%) of the goods_total.
Also you may make generous profits even if you are LESS price sensitive with the low pct materials.
Better yet, as these prices actually are high-/low-end ranges, some materials you will likely get even cheaper.
The CEIL()s/FLOOR()s makes it hard to implement quantities for one unit of { Ore, Fuel Blocks, Ammo, R.A.M., ... } (without sacrificing readability much)
They all outcome in many units which renders the "True Quantity for One Unit" an imaginary concept.
- Ore, set :units = 100, :bpc_runs = NULL
- Fuel Blocks, set :units = 40, :bcp_runs = NULL
- Ammo, set :units, :bpd_runs from your Faction Blueprint Copy
*/
:units ||'x '|| INITCAP(SUBSTR(fin.produce, 1, 22)) AS produce
, INITCAP(SUBSTR(fin.part, 1, 22)) AS part
,TO_CHAR( fin.quantity, '990G990G990D99') AS quantity
,TO_CHAR( fin.pile, '990G990G990D99') AS pile
,CASE WHEN fin.quantity - fin.pile > 0 THEN
TO_CHAR(fin.quantity - fin.pile, '990G990G990D99')
END AS short
-- ,TO_CHAR( fin.short_volume, '990G990G990D99') AS vol_short
-- most matetials you will likely want to haul with your Deep Space Transporter (DST), uncomment others as necessary
,of_cargo_deeptransport AS dst -- of_cargo_freighter AS frg, of_cargo_jump_freighter AS jf
,TO_CHAR( fin.offers_low_range, '990G990G990D99') AS quote
,INITCAP(SUBSTR(fin.name_region, 1, 15) ) AS region
,TO_CHAR( fin.items_total, '990G990G990G990' ) AS items_tot
, pct
,TO_CHAR( fin.goods_total, '990G990G990G990' ) AS goods_tot
,TO_CHAR( fin.breakeven, '990G990G990G990' ) AS break
,TO_CHAR( fin.just_buy_it, '990G990G990G990' ) AS just_buy_it
-- unitwise fields necesary to compare Fuel Blocks, Ore.. against market; decimals necessary for most Ore
,TO_CHAR( fin.goods_total / :units, '990G990G990D99') AS goods_unit
-- ,TO_CHAR( fin.goods_total * 0.96, '990G990G990' ) AS dsconut_four
,TO_CHAR( fin.goods_total * 0.93 / :units, '990G990G990D99') AS dsconut_seven
,TO_CHAR( fin.breakeven / :units, '990G990G990D99') AS break_unit
,TO_CHAR( fin.just_buy_it / :units, '990G990G990D99') AS just_buy_one
FROM (SELECT src.produce, src.part, src.pile, src.offers_low_range, src.name_region
, SUM(src.quantity) AS quantity
, src.volume * SUM(src.quantity) AS volume
,CASE WHEN src.pile < SUM(src.quantity) THEN src.volume * (SUM(src.quantity) - src.pile)
END AS short_volume
,CASE WHEN src.pile < SUM(src.quantity) THEN ROUND(src.volume * (SUM(src.quantity) - src.pile) / load_market_data.f_get('k_dstful') *100, 1)
END AS of_cargo_deeptransport
,CASE WHEN src.pile < SUM(src.quantity) THEN ROUND(src.volume * (SUM(src.quantity) - src.pile) / load_market_data.f_get('k_jumpfreightful') *100, 1)
END AS of_cargo_jump_freighter
, ROUND( src.offers_low_range * SUM(src.quantity)) AS items_total
, ROUND( src.offers_low_range * SUM(src.quantity)
/(SUM(src.offers_low_range * SUM(src.quantity)) OVER (PARTITION BY src.produce)) *100) AS pct
, ROUND( SUM(src.offers_low_range * SUM(src.quantity)) OVER (PARTITION BY src.produce)) AS goods_total
,CEIL(load_market_data.get_breakeven(SUM(src.offers_low_range * SUM(src.quantity)) OVER (PARTITION BY src.produce))) AS breakeven
,(SELECT sub.offers_low_range * :units
FROM vw_avg_sells_regions sub
WHERE sub.part_id = src.produce_id
AND sub.region = load_market_data.get_econ_region(p_part_id => src.produce_id
,p_direction => 'SELL'
,p_local_regions => :local_sell) OR sub.region IS NULL) AS just_buy_it
FROM (SELECT pdc.produce_id
,pdc.produce
--,pdc.good_id
--,pdc.good
--,pdc.part_id
,pdc.part
,prt.volume
,prt.pile
,sel.region
,sel.offers_low_range
,sel.name_region
, par.need_full_bpcs ||' * '|| REPLACE(pdc.formula_bp_orig, ':UNITS', par.bpc_runs)
||' + '|| REPLACE(pdc.formula_bp_orig, ':UNITS', par.need_short_runs) AS formula -- DEBUG
,utils.calculate(par.need_full_bpcs ||' * '|| REPLACE(pdc.formula_bp_orig, ':UNITS', par.bpc_runs)
||' + '|| REPLACE(pdc.formula_bp_orig, ':UNITS', par.need_short_runs)) AS quantity
FROM vw_produce_leaves pdc
INNER JOIN part prt ON prt.ident = pdc.part_id
INNER JOIN (SELECT :units AS units
, NVL(:bpc_runs, :units) AS bpc_runs
,FLOOR(:units / NVL(:bpc_runs, :units)) AS need_full_bpcs
,MOD (:units, NVL(:bpc_runs, :units)) AS need_short_runs
FROM dual) par ON 1=1
LEFT OUTER JOIN vw_avg_sells_regions sel ON sel.part_id = prt.ident
WHERE pdc.produce LIKE '%'|| UPPER(:produce) ||'%'
AND (sel.region = load_market_data.get_econ_region(p_part_id => prt.ident
,p_direction => sel.direction
,p_local_regions => :local_buy) OR sel.region IS NULL)) src
GROUP BY src.produce_id, src.produce, src.part, src.volume, src.pile, src.offers_low_range, src.name_region) fin
ORDER BY fin.produce
,fin.items_total DESC
,fin.part;
|
-- Скрипт создает последнее состояние бд, после создания не нужно применять миграции
CREATE TABLE db_info(
id SERIAL PRIMARY KEY,
major INTEGER NOT NULL,
minor INTEGER NOT NULL,
patch INTEGER NOT NULL,
UNIQUE (major, minor, patch)
);
INSERT INTO db_info(major, minor, patch) VALUES(1, 0, 1);
CREATE TABLE products (
id SMALLSERIAL PRIMARY KEY,
name TEXT NOT NULL,
kcal SMALLINT NOT NULL CHECK(kcal > 0)
);
CREATE TABLE food_diary(
id SMALLSERIAL PRIMARY KEY,
recording_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
product_id SMALLINT REFERENCES products (id) NOT NULL,
amount SMALLINT NOT NULL CHECK(amount > 0)
);
CREATE TABLE cases(
id SMALLSERIAL PRIMARY KEY,
name TEXT NOT NULL
);
CREATE TABLE specific_cases(
id SMALLSERIAL PRIMARY KEY,
case_id SMALLINT REFERENCES cases(id) NOT NULL,
concretization JSONB NOT NULL DEFAULT '{}'
);
CREATE TABLE case_diary(
id SMALLSERIAL PRIMARY KEY,
recording_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
elapsed_time_in_hours REAL NOT NULL CONSTRAINT positive_number_check (elapsed_time_in_hours > 0),
specific_case_id SMALLINT REFERENCES specific_cases(id) NOT NULL,
description JSONB NOT NULL DEFAULT '{}'
); |
/* [1] Apresentar os detalhes dos departamentos ordenados pelo nome de forma ascendente */
SELECT * FROM departments d ORDER BY d.department_name ASC ;
/* [2] Apresentar os nomes dos departamentos e os responsaveis por estes */
SELECT d.department_name, e.first_name, e.last_name FROM departments d, employees e WHERE d.manager_id=e.employee_id;
/* [3] Apresentar os nomes dos departamentos e o numero de funcionarios de cada um */
SELECT department_name, COUNT(*) AS tot_employees FROM employees e, departments d WHERE e.department_id=d.department_id GROUP BY department_name;
/* [4] Apresentar os identificadores dos gestores e o numero de funcionarios geridos por cada um */
SELECT manager_id, COUNT(*) AS tot_employees FROM employees GROUP BY manager_id ;
/* [5] Apresentar os detalhes dos funcionarios cuja percentagem de comissao seja nula, o salario esteja entre 10000 e 15000 e o gestor possua o identificador 101 */
SELECT * FROM employees WHERE commission_pct IS NULL AND salary>=10000 AND salary<=15000 AND manager_id=101;
/* [6] Apresentar os funcionarios cujo primeiro nome e ultimo nome comecam pela letra G */
SELECT first_name, last_name FROM employees WHERE SUBSTR(first_name,0,1)='G' AND SUBSTR(last_name,0,1)='G';
/* [7] Apresentar todos os funcionarios que entraram para a empresa apos 19 de Dezembro de 2007 */
SELECT * FROM employees e WHERE e.hire_date > to_date('19-12-2007','DD-MM-YYYY');
/* [8] Apresentar o nome dos funcionarios que foram contratados em 2008 */
SELECT first_name, last_name, hire_date FROM employees WHERE EXTRACT(YEAR FROM hire_date)=2008 ORDER BY hire_date;
/* [9] Apresentar quantos funcionarios foram admitidos em cada mes do ano 2008 */
SELECT COUNT(*) AS tot, EXTRACT(MONTH FROM hire_date) AS MONTH FROM employees WHERE EXTRACT(YEAR FROM hire_date) = 2008 GROUP BY (EXTRACT(MONTH FROM hire_date)) ORDER BY EXTRACT(MONTH FROM hire_date) ASC;
/* [10] Apresentar o nome dos funcionarios que iniciaram funcoes antes do seu gestor */
SELECT e1.first_name, e1.last_name FROM employees e1 JOIN employees e2 ON (e1.manager_id=e2.employee_id) WHERE e1.hire_date < e2.hire_date;
/* [11] Apresentar o cargo, o numero de funcionarios, o somatorio dos salarios e a diferenca entre o maior salario e o menor dos funcionarios desse cargo */
SELECT job_id, COUNT(*) as total_employees, SUM(salary) AS tot_salaries, MAX(salary)-MIN(salary) AS diff_salary FROM employees GROUP BY job_id ORDER BY diff_salary desc;
/* [12] Apresentar o nome dos funcionarios que ocupam o cargo de Programmer ou President */
SELECT e.first_name, e.last_name, j.job_title FROM employees e,jobs j WHERE e.job_id=j.job_id AND (j.job_title='Programmer' OR j.job_title='President');
/* [13] Apresentar o nome do cargo e a media dos salarios */
SELECT j.job_title, AVG(e.salary) AS avg_salary FROM employees e, jobs j WHERE e.job_id = j.job_id GROUP BY j.job_title;
/* [14] Apresentar simultaneamente o primeiro nome do funcionario, o seu cargo e a sua experiencia, ordenando do mais experiente para o menos experiente */
SELECT e.first_name, e.hire_date, FLOOR((SYSDATE-e.hire_date)/365) AS experience, j.job_title FROM employees e, jobs j WHERE e.job_id = j.job_id ORDER BY experience DESC;
/* [15] Apresentar os cargos cujo salario maximo seja menor ou igual que 6000 */
SELECT * FROM jobs WHERE max_salary <= 6000;
/* [16] Apresentar o cargo e a diferenca entre o salario maximo e o salario minimo desse cargo, em que o salario maximo esteja entre 6000 e 10000 */
SELECT j.job_title, (j.max_salary-j.min_salary) AS diff FROM jobs j WHERE (j.max_salary>=6000 AND j.max_salary<=10000);
/* [17] Apresentar o identificador dos funcionarios que tiveram mais que um cargo no passado */
SELECT employee_id FROM job_history GROUP BY employee_id HAVING COUNT(*) > 1;
/* [18] Apresentar os detalhes dos cargos que tenham sido executados por funcionarios que actualmente recebem mais que 10000 de salario */
SELECT jh.* FROM job_history jh, employees e WHERE (jh.employee_id = e.employee_id) AND salary > 10000;
/* [19] Apresentar os detalhes dos cargos atuais dos funcionarios que trabalharam como IT_PROG no passado */
SELECT * FROM jobs WHERE job_id IN(SELECT job_id FROM employees WHERE employee_id IN (SELECT employee_id FROM job_history WHERE job_id='IT_PROG'));
/* [20] Apresentar os paises e o numero de cidades existentes associadas a cada pais */
SELECT country_id, COUNT(*) as total_cities FROM locations GROUP BY country_id;
/* [21] Apresentar o nome da regiao, o nome do pais, o nome da cidade, o nome do departamento e do gestor deste, bem como do seu cargo */
SELECT r.region_name, c.country_name, l.city, d.department_name, e.first_name, e.last_name, j.job_title
FROM countries c, departments d, employees e, jobs j, locations l, regions r
WHERE r.region_id = c.region_id AND c.country_id=l.country_id AND l.location_id=d.location_id AND d.manager_id=e.employee_id AND e.job_id=j.job_id;
/* [22] Apresentar o nome do funcionario e o respetivo pais onde se encontra a trabalhar */
SELECT e.first_name, c.country_name FROM employees e, departments d, locations l, countries c
WHERE d.department_id = e.department_id AND l.location_id=d.location_id AND l.country_id=c.country_id;
/* [23] Apresentar o nome do pais, a cidade e o numero de departamentos que possuem mais de 5 funcionarios */
SELECT country_name, city, COUNT(department_id) AS num_dep FROM countries c, locations l, departments d
WHERE c.country_id=l.country_id AND d.location_id=l.location_id AND department_id IN (SELECT department_id FROM employees GROUP BY department_id HAVING COUNT(department_id)>5)
GROUP BY country_name, city; |
/*
Subquries practices
*/
SELECT
o.name,
COUNT(m.id)
FROM
orchestras AS o
JOIN members AS m ON o.id = m.orchestra_id
GROUP BY
1
HAVING
COUNT(m.id) > (SELECT AVG (d.count1)
FROM (SELECT COUNT (*) AS count1 FROM members GROUP BY orchestra_id)
AS d)
/*
correlated subquries
*/
SELECT
m.name AS member,
o.name AS orchestra
FROM
members AS m
JOIN orchestras AS o ON m.orchestra_id = o.id
WHERE
m.experience =
(SELECT MAX(experience)
FROM members AS m1
WHERE m1.orchestra_id = m.orchestra_id)
SELECT
m.name
FROM
members AS m
WHERE
m.wage >
(SELECT AVG(mm.wage)
FROM members AS mm
WHERE mm.position = 'violin'
AND
m.orchestra_id = mm.orchestra_id);
SELECT
o.name,
o.rating,
o.city_origin,
(SELECT COUNT(*)
FROM concerts AS c
WHERE c.country = 'Ukraine'
AND
o.id = c.orchestra_id) AS count
FROM
orchestras AS o
WHERE
o.country_origin = 'Germany';
SELECT
m.name AS name,
(SELECT COUNT(*)
FROM piece_of_art AS p
WHERE p.museum_id = m.id) AS piece_count
FROM
museum AS m
/*
subqury in WHERE clause
*/
SELECT
o.name,
c.city,
c.rating
FROM
orchestras AS o
JOIN concerts AS c ON o.id = c.orchestra_id
WHERE
c.rating IN (
SELECT MAX(rating)
FROM concerts
WHERE concerts.orchestra_id = o.id)
/*
LEFT JOIN vs Using subqury to get the same result
*/
SELECT
k.last_name,
k.first_name,
k.experience
FROM
dog_sitter k
LEFT JOIN care c ON k.id = c.dog_sitter_id
WHERE
c.dog_id IS NULL;
SELECT
s.last_name,
s.first_name,
s.experience
FROM
dog_sitter AS s
WHERE
s.id NOT IN (SELECT dog_sitter_id FROM care)
|
DROP TABLE IF EXISTS `XXX_deepltrans_data`; ##b_dump##
DROP TABLE IF EXISTS `XXX_plugin_deepltrans_data`; ##b_dump##
DROP TABLE IF EXISTS `XXX_plugin_deepltrans_deepltrans_form`; ##b_dump##
DROP TABLE IF EXISTS `XXX_plugin_deepltrans_einstellun_form`; ##b_dump##
DROP TABLE IF EXISTS `XXX_plugin_deepltrans_bersetzung_form`; ##b_dump##
|
rollback ;
savepoint 1;
commit;
set AUTOCOMMIT ON; -- 设置自动提交事务
select sysdate from dual; -- 返回当前数据库本地时间
select TO_CHAR(CURRENT_DATE,'YYYY-MM-DD HH:MM:SS') from dual; -- 返回当前会话时间 并格式化
select add_months(sysdate,5) from dual; -- 返回当前时间加 5个月
select localtimestamp from dual; -- 返回当前会话时间,包括时分秒
begin
dbms_output.put_line(user || ' tables in the database');
for t in (select table_name from user_tables)
loop
dbms_output.put_line(t.table_name);
end loop;
end;
/
/**
DBMS_OUTPUT.DISABLE;
禁用消息输出。
DBMS_OUTPUT.NEW_LINE;
放置一个行尾标记
DBMS_OUTPUT.ENABLE(buffer_size IN INTEGER DEFAULT 20000);
启用消息输出。buffer_size设置为NULL值表示无限制的缓冲区大小。
*/
declare
lines dbms_output.chararr;
num_lines number;
begin
dbms_output.enable;
dbms_output.put_line('hello world');
dbms_output.put_line('hello world2');
dbms_output.put_line('hello world3');
num_lines := 3;
dbms_output.get_lines(lines,num_lines);
for i in 1 .. num_lines loop
dbms_output.put_line(lines(i));
end loop;
end;
/
|
CREATE OR REPLACE VIEW SCH_TRIGGER AS
SELECT
TRI.TRIGGER_CATALOG AS CATALOG_NAME
, TRI.TRIGGER_SCHEMA AS SCHEMA_NAME
, TRI.EVENT_OBJECT_TABLE
, TRI.TRIGGER_NAME
, TRI.ACTION_TIMING
, TRI.EVENT_MANIPULATION
, TRI.ACTION_ORIENTATION
, TRI.ACTION_STATEMENT
, ROU.ROUTINE_NAME
, ROU.ROUTINE_TYPE
, ROU.SECURITY_TYPE
, ROU.DATA_TYPE
, ROU.ROUTINE_BODY
, ROU.EXTERNAL_LANGUAGE
FROM INFORMATION_SCHEMA.TRIGGERS TRI
INNER JOIN INFORMATION_SCHEMA.ROUTINES ROU ON ROU.ROUTINE_NAME = TRI.TRIGGER_NAME
ORDER BY TRI.EVENT_OBJECT_TABLE, TRI.TRIGGER_NAME; |
PRAGMA foreign_keys = ON;
create table time (
timestamp BIGINT not null,
packets INT not null,
PRIMARY KEY (timestamp)
);
create table macaddr (
mac BIGINT NOT NULL,
ssid VARCHAR(32),
PRIMARY KEY (mac)
);
create table timemac (
timestamp BIGINT not null,
mac BIGINT not null,
count INT not null,
signalstrength REAL,
PRIMARY KEY(timestamp, mac),
FOREIGN KEY(mac) REFERENCES macaddr(mac),
FOREIGN KEY(timestamp) REFERENCES time(timestamp)
);
|
-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Jul 03, 2021 at 07:03 PM
-- Server version: 5.7.32
-- PHP Version: 7.4.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 utf8mb4 */;
--
-- Database: `bd_tienda`
--
-- --------------------------------------------------------
--
-- Table structure for table `cliente`
--
CREATE TABLE `cliente` (
`IdCliente` int(11) UNSIGNED NOT NULL,
`Dni` varchar(8) DEFAULT NULL,
`Nombres` varchar(244) DEFAULT NULL,
`Direccion` varchar(244) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `cliente`
--
INSERT INTO `cliente` (`IdCliente`, `Dni`, `Nombres`, `Direccion`) VALUES
(1, '123', 'Cliente Frecuente', 'Los Alamos 345 Lima'),
(2, '12345678', 'Juan Alberto Ribero', 'Los Cardenales de Oyllo'),
(3, '1234567', 'Papa Francisco', 'El Vaticano'),
(4, '123456', 'Obama Belaunde', 'Carretera Central'),
(5, '1234', 'San Matero de Las Rosas', 'Puente Piedra Rosada'),
(6, '12345', 'Los Visitantes de Lurin', 'Puente Chicharoneria'),
(7, '123', 'Alvin', 'Calle 34'),
(8, '678', 'Pepe', 'Calle 34 # 345'),
(9, '555', 'Gerard Way', 'Calle 45 # 4343'),
(10, '345', 'Joaquin', 'Calle 345 # 45'),
(11, '123', 'Mike', 'Calle 13 x 45 y 67');
-- --------------------------------------------------------
--
-- Table structure for table `compras`
--
CREATE TABLE `compras` (
`idCompra` int(11) NOT NULL,
`idProveedor` int(11) NOT NULL,
`FechaCompra` varchar(100) NOT NULL,
`Monto` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `compras`
--
INSERT INTO `compras` (`idCompra`, `idProveedor`, `FechaCompra`, `Monto`) VALUES
(1, 1, '2021-06-15', 350);
-- --------------------------------------------------------
--
-- Table structure for table `detalle_compras`
--
CREATE TABLE `detalle_compras` (
`idDetalleCompras` int(11) NOT NULL,
`idCompras` int(11) NOT NULL,
`idProducto` int(11) NOT NULL,
`Cantidad` int(11) NOT NULL,
`PrecioCompra` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `detalle_compras`
--
INSERT INTO `detalle_compras` (`idDetalleCompras`, `idCompras`, `idProducto`, `Cantidad`, `PrecioCompra`) VALUES
(1, 1, 3, 10, 350);
-- --------------------------------------------------------
--
-- Table structure for table `detalle_oferta`
--
CREATE TABLE `detalle_oferta` (
`idDetalleOferta` int(11) NOT NULL,
`idOferta` int(11) NOT NULL,
`idProducto` int(11) NOT NULL,
`TipoOferta` int(11) NOT NULL,
`Cantidad` int(11) NOT NULL,
`Precio` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `detalle_ventas`
--
CREATE TABLE `detalle_ventas` (
`IdDetalleVentas` int(11) UNSIGNED NOT NULL,
`IdVentas` int(11) UNSIGNED NOT NULL,
`IdProducto` int(11) UNSIGNED NOT NULL,
`Cantidad` int(11) UNSIGNED DEFAULT NULL,
`PrecioVenta` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `detalle_ventas`
--
INSERT INTO `detalle_ventas` (`IdDetalleVentas`, `IdVentas`, `IdProducto`, `Cantidad`, `PrecioVenta`) VALUES
(138, 83, 1, 2, 150),
(139, 84, 2, 2, 20),
(140, 85, 3, 5, 37),
(141, 86, 3, 2, 37),
(142, 87, 1, 1, 150),
(143, 88, 3, 1, 37),
(144, 89, 3, 1, 37),
(145, 89, 2, 1, 20),
(146, 90, 3, 1, 37),
(147, 91, 2, 1, 20),
(153, 96, 2, 1, 20),
(154, 97, 2, 1, 20),
(155, 98, 2, 1, 20),
(156, 99, 2, 1, 20),
(157, 100, 2, 1, 20),
(158, 101, 1, 1, 150),
(159, 102, 2, 1, 20),
(160, 103, 1, 1, 150),
(161, 104, 1, 1, 150),
(162, 104, 2, 1, 20),
(163, 105, 7, 1, 37),
(164, 106, 6, 1, 14),
(165, 107, 4, 5, 13),
(166, 108, 5, 3, 12),
(167, 108, 1, 2, 150),
(168, 109, 1, 1, 150);
-- --------------------------------------------------------
--
-- Table structure for table `ofertas`
--
CREATE TABLE `ofertas` (
`idOferta` int(11) NOT NULL,
`idTipoOferta` int(11) NOT NULL,
`Descripcion` varchar(100) NOT NULL,
`FechaInicio` varchar(100) NOT NULL,
`FechaVigencia` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `ofertas`
--
INSERT INTO `ofertas` (`idOferta`, `idTipoOferta`, `Descripcion`, `FechaInicio`, `FechaVigencia`) VALUES
(1, 1, '3 gansitos por 10 pesos', '2021-06-20', '2021-06-22');
-- --------------------------------------------------------
--
-- Table structure for table `producto`
--
CREATE TABLE `producto` (
`IdProducto` int(11) UNSIGNED NOT NULL,
`Nombres` varchar(244) DEFAULT NULL,
`Precio` double DEFAULT NULL,
`Stock` int(11) UNSIGNED DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `producto`
--
INSERT INTO `producto` (`IdProducto`, `Nombres`, `Precio`, `Stock`) VALUES
(1, 'Gansito', 150, 48),
(2, 'Charritos', 20, 57),
(3, 'Pepsi', 37, 0),
(4, 'Takis fuego', 13, 45),
(5, 'Doritos nacho', 12, 42),
(6, 'Hot nuts', 14, 97),
(7, 'Paketaxo', 37, 82),
(9, 'Lucas', 12, 0),
(10, 'Coca cola', 37, 200),
(11, 'Cheetos bolita', 8, 13),
(12, 'Mamut', 10, 12),
(13, 'Cheeto flaming hot', 8, 13),
(14, 'Tostitos', 10, 11),
(15, 'Picafresa', 11, 13),
(16, 'Leche', 27.5, 45),
(17, 'Jugo Jumex', 22, 12);
-- --------------------------------------------------------
--
-- Table structure for table `proveedor`
--
CREATE TABLE `proveedor` (
`IdProveedor` int(11) NOT NULL,
`Nombre` varchar(100) NOT NULL,
`Direccion` varchar(100) NOT NULL,
`Telefono` varchar(100) NOT NULL,
`Marca` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `proveedor`
--
INSERT INTO `proveedor` (`IdProveedor`, `Nombre`, `Direccion`, `Telefono`, `Marca`) VALUES
(1, 'Juan', 'Calle 34 #111', '9991233455', 'Pepsi'),
(2, 'Pedro', 'Calle 23 # 111', '12323123123123', 'Coca'),
(3, 'Antonio', 'Calle 12 # 234234', '999603133', 'Gamesa'),
(4, 'Gustavo', 'Calle 34 Los Alamos', '9778978987', 'Santa fe');
-- --------------------------------------------------------
--
-- Table structure for table `vendedor`
--
CREATE TABLE `vendedor` (
`IdVendedor` int(10) UNSIGNED NOT NULL,
`Dni` varchar(8) NOT NULL,
`Nombres` varchar(255) DEFAULT NULL,
`Telefono` varchar(9) DEFAULT NULL,
`Estado` varchar(1) DEFAULT NULL,
`User` varchar(8) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `vendedor`
--
INSERT INTO `vendedor` (`IdVendedor`, `Dni`, `Nombres`, `Telefono`, `Estado`, `User`) VALUES
(1, '12345678', 'Empleado 0001', '988252459', '1', 'emp01'),
(2, '', 'Empleado 0002', '988252459', '1', 'Jo46'),
(3, '', 'Empleado 0003', '222222', '1', 'Em22');
-- --------------------------------------------------------
--
-- Table structure for table `ventas`
--
CREATE TABLE `ventas` (
`IdVentas` int(11) UNSIGNED NOT NULL,
`IdCliente` int(11) UNSIGNED NOT NULL,
`IdVendedor` int(10) UNSIGNED NOT NULL,
`NumeroSerie` varchar(244) DEFAULT NULL,
`FechaVentas` date DEFAULT NULL,
`Monto` double DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `ventas`
--
INSERT INTO `ventas` (`IdVentas`, `IdCliente`, `IdVendedor`, `NumeroSerie`, `FechaVentas`, `Monto`) VALUES
(83, 8, 1, '01', '2021-06-18', 300),
(84, 8, 1, '02', '2021-06-19', 40),
(85, 8, 1, '03', '2021-06-19', 185),
(86, 8, 1, '04', '2021-06-19', 74),
(87, 7, 1, '05', '2021-06-20', 150),
(88, 7, 1, '06', '2021-06-20', 37),
(89, 7, 1, '07', '2021-06-20', 57),
(90, 7, 1, '08', '2021-06-20', 37),
(91, 7, 1, '09', '2021-06-20', 20),
(96, 7, 1, '10', '2021-06-20', 20),
(97, 7, 1, '11', '2021-06-20', 20),
(98, 7, 1, '12', '2021-06-20', 20),
(99, 7, 1, '13', '2021-06-20', 20),
(100, 7, 1, '14', '2021-06-20', 20),
(101, 7, 1, '15', '2021-06-20', 150),
(102, 7, 1, '16', '2021-06-22', 20),
(103, 7, 1, '17', '2021-06-22', 150),
(104, 7, 1, '18', '2021-06-23', 170),
(105, 7, 1, '19', '2021-06-23', 37),
(106, 7, 1, '20', '2021-06-23', 14),
(107, 7, 1, '21', '2021-06-23', 65),
(108, 7, 1, '22', '2021-06-24', 336),
(109, 11, 1, '23', '2021-07-03', 150);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cliente`
--
ALTER TABLE `cliente`
ADD PRIMARY KEY (`IdCliente`);
--
-- Indexes for table `compras`
--
ALTER TABLE `compras`
ADD PRIMARY KEY (`idCompra`),
ADD KEY `idProveedor` (`idProveedor`);
--
-- Indexes for table `detalle_compras`
--
ALTER TABLE `detalle_compras`
ADD PRIMARY KEY (`idDetalleCompras`),
ADD KEY `idProducto` (`idProducto`),
ADD KEY `detalle_compras_ibfk_1` (`idCompras`);
--
-- Indexes for table `detalle_oferta`
--
ALTER TABLE `detalle_oferta`
ADD PRIMARY KEY (`idDetalleOferta`);
--
-- Indexes for table `detalle_ventas`
--
ALTER TABLE `detalle_ventas`
ADD PRIMARY KEY (`IdDetalleVentas`,`IdVentas`,`IdProducto`),
ADD KEY `Ventas_has_Producto_FKIndex1` (`IdVentas`),
ADD KEY `Ventas_has_Producto_FKIndex2` (`IdProducto`);
--
-- Indexes for table `ofertas`
--
ALTER TABLE `ofertas`
ADD PRIMARY KEY (`idOferta`);
--
-- Indexes for table `producto`
--
ALTER TABLE `producto`
ADD PRIMARY KEY (`IdProducto`);
--
-- Indexes for table `proveedor`
--
ALTER TABLE `proveedor`
ADD PRIMARY KEY (`IdProveedor`);
--
-- Indexes for table `vendedor`
--
ALTER TABLE `vendedor`
ADD PRIMARY KEY (`IdVendedor`);
--
-- Indexes for table `ventas`
--
ALTER TABLE `ventas`
ADD PRIMARY KEY (`IdVentas`),
ADD KEY `Ventas_FKIndex1` (`IdVendedor`),
ADD KEY `Ventas_FKIndex2` (`IdCliente`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `cliente`
--
ALTER TABLE `cliente`
MODIFY `IdCliente` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `compras`
--
ALTER TABLE `compras`
MODIFY `idCompra` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `detalle_compras`
--
ALTER TABLE `detalle_compras`
MODIFY `idDetalleCompras` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `detalle_oferta`
--
ALTER TABLE `detalle_oferta`
MODIFY `idDetalleOferta` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `detalle_ventas`
--
ALTER TABLE `detalle_ventas`
MODIFY `IdDetalleVentas` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=169;
--
-- AUTO_INCREMENT for table `ofertas`
--
ALTER TABLE `ofertas`
MODIFY `idOferta` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `producto`
--
ALTER TABLE `producto`
MODIFY `IdProducto` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `proveedor`
--
ALTER TABLE `proveedor`
MODIFY `IdProveedor` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `vendedor`
--
ALTER TABLE `vendedor`
MODIFY `IdVendedor` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `ventas`
--
ALTER TABLE `ventas`
MODIFY `IdVentas` int(11) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=110;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `compras`
--
ALTER TABLE `compras`
ADD CONSTRAINT `compras_ibfk_1` FOREIGN KEY (`idProveedor`) REFERENCES `proveedor` (`IdProveedor`);
--
-- Constraints for table `detalle_compras`
--
ALTER TABLE `detalle_compras`
ADD CONSTRAINT `detalle_compras_ibfk_1` FOREIGN KEY (`idCompras`) REFERENCES `compras` (`idCompra`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `detalle_ventas`
--
ALTER TABLE `detalle_ventas`
ADD CONSTRAINT `detalle_ventas_ibfk_1` FOREIGN KEY (`IdVentas`) REFERENCES `ventas` (`IdVentas`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `detalle_ventas_ibfk_2` FOREIGN KEY (`IdProducto`) REFERENCES `producto` (`IdProducto`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `ventas`
--
ALTER TABLE `ventas`
ADD CONSTRAINT `ventas_ibfk_1` FOREIGN KEY (`IdVendedor`) REFERENCES `vendedor` (`IdVendedor`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `ventas_ibfk_2` FOREIGN KEY (`IdCliente`) REFERENCES `cliente` (`IdCliente`) ON DELETE NO ACTION ON UPDATE NO ACTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 24, 2018 at 10:25 AM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `shareposts`
--
-- --------------------------------------------------------
--
-- Table structure for table `posts`
--
CREATE TABLE `posts` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`title` varchar(255) NOT NULL,
`body` text NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `posts`
--
INSERT INTO `posts` (`id`, `user_id`, `title`, `body`, `created_at`) VALUES
(3, 3, 'Post One', 'This is post one.', '2018-01-24 16:01:16'),
(4, 3, 'Post Two', 'This is post two.', '2018-01-24 16:03:22'),
(6, 4, 'Foo Bar Breaker', 'Breaking the ice and fire.', '2018-01-24 17:09:43');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `created_at`) VALUES
(3, 'John Doe', 'jdoe@gmail.com', '$2y$10$Zt7bx8ekclv3j6KgFG6fbOMBiVgG3D6Ovj4U/OEShUnXzsBF5NPNa', '2018-01-24 11:44:38'),
(4, 'Foo Bar', 'fbar@gmail.com', '$2y$10$RTVZenoHgLdyr0iMClqbPe.CZeSqQ4xuJKHihiL4s44lXvrCULJlS', '2018-01-24 16:05:30');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `posts`
--
ALTER TABLE `posts`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
SELECT
TOP 1 ADDRESS
FROM
CORRESPONDENCE_MST
WHERE
--取引先コード = パラメータ.取引先コード
CUSTOMER_CODE = /*customerCode*/
ORDER BY
CORRESPONDENCE_No |
-- AlterTable
ALTER TABLE `Users` ADD COLUMN `fb_name` VARCHAR(191) NOT NULL DEFAULT '';
|
/* *************************************************************************************** */
/* TASK 1. В базе данных shop и sample присутствуют одни и те же таблицы, учебной базы */
/* данных. Переместите запись id = 1 из таблицы shop.users в таблицу sample.users. */
/* Используйте транзакции. */
/* *************************************************************************************** */
USE shop;
DROP PROCEDURE IF EXISTS tran_example;
CREATE PROCEDURE tran_example()
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;
END;
START TRANSACTION;
INSERT INTO sample.users (name, birthday_at, created_at, updated_at)
SELECT name, birthday_at, created_at, updated_at FROM users WHERE id = 1;
COMMIT;
END;
CALL tran_example();
/* *************************************************************************************** */
/* TASK 2. Создайте хранимую функцию hello(), которая будет возвращать приветствие, */
/* в зависимости от текущего времени суток. С 6:00 до 12:00 функция должна */
/* возвращать фразу "Доброе утро", с 12:00 до 18:00 функция должна возвращать */
/* фразу "Добрый день", с 18:00 до 00:00 — "Добрый вечер", с 00:00 до 6:00 — */
/* "Доброй ночи". */
/* *************************************************************************************** */
USE shop;
DROP PROCEDURE IF EXISTS hello;
CREATE PROCEDURE hello()
BEGIN
DECLARE hour INT;
SET hour = HOUR(NOW());
SELECT CASE
WHEN hour < 6 THEN 'Доброй ночи'
WHEN hour >= 6 AND hour < 12 THEN 'Доброе утро'
WHEN hour >= 12 AND hour < 18 THEN 'Добрый день'
WHEN hour >= 18 THEN 'Добрый вечер'
END;
END;
CALL hello();
|
# Loans schema
# --- !Ups
CREATE TABLE loans (
id VARCHAR(255) NOT NULL,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
amount DECIMAL(16,4) NOT NULL,
term_days INTEGER NOT NULL,
timestamp TIMESTAMP NOT NULL,
client_ip VARCHAR(16) NOT NULL,
approved BOOLEAN NOT NULL,
PRIMARY KEY (id)
);
# --- !Downs
DROP TABLE loans; |
insert into avatars (avatar_base_type_id, level, skin, hair, picture_url, night_background_url, day_background_url, status, text_id, created_by, created_date)
values
(1, 1, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 2, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 3, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 4, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 5, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 6, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 7, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 8, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 9, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 10, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 11, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 12, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 13, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 14, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 15, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 16, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 17, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 18, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 19, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 20, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 21, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 22, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 23, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 24, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 25, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 26, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 27, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 28, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 29, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 30, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 31, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 32, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 33, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 34, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 35, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 36, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 37, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 38, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 39, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 40, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 41, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 42, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 43, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 44, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 45, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 46, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 47, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 48, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp),
(1, 49, 1, 3, 's1h3.png', '', '', 'ACTIVE', 1, 1, current_timestamp);
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 20, 2017 at 07:45 PM
-- Server version: 5.7.17-0ubuntu0.16.04.1
-- PHP Version: 7.0.15-0ubuntu0.16.04.4
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: `Practica3`
--
-- --------------------------------------------------------
--
-- Table structure for table `Departaments`
--
CREATE TABLE `Departaments` (
`codi` decimal(4,0) NOT NULL,
`nom` varchar(59) NOT NULL,
`pressupost` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `Departaments`
--
INSERT INTO `Departaments` (`codi`, `nom`, `pressupost`) VALUES
('701', 'Arquitectura de Computadors', 16140),
('702', 'Ciència dels Materials i Enginyeria Metal·lúrgica', 6715),
('703', 'Composició Arquitectònica', 15735),
('704', 'Construccions Arquitectòniques I', 7357),
('705', 'Construccions Arquitectòniques II', 19987),
('706', 'Enginyeria de la Construcció', 5182),
('707', 'Enginyeria de Sistemes, Automàtica i Informàtica Industrial', 14979),
('708', 'Enginyeria del Terreny, Cartogràfica i Geofísica', 15069),
('709', 'Enginyeria Elèctrica', 15615),
('710', 'Enginyeria Electrònica', 8240),
('711', 'Enginyeria Hidràulica, Marítima i Ambiental', 9313),
('712', 'Enginyeria Mecànica', 8995),
('713', 'Enginyeria Química', 9991),
('714', 'Enginyeria Tèxtil i Paperera', 18887),
('715', 'Estadística i Investigació Operativa', 7685),
('716', 'Estructures a l\'Arquitectura', 8069),
('717', 'Expressió Gràfica a l\'Enginyeria', 3499),
('718', 'Expressió Gràfica Arquitectònica I', 4610),
('719', 'Expressió Gràfica Arquitectònica II', 16305),
('720', 'Física Aplicada', 12669),
('721', 'Física i Enginyeria Nuclear', 6060),
('722', 'Infraestructura del Transport i del Territori', 14349),
('723', 'Llenguatges i Sistemes Informàtics', 15566),
('724', 'Màquines i Motors Tèrmics', 17325),
('725', 'Matemàtica Aplicada I', 9011),
('726', 'Matemàtica Aplicada II', 10561),
('727', 'Matemàtica Aplicada III', 5036),
('729', 'Mecànica de Fluids', 4914),
('731', 'Òptica i Optometria', 11142),
('732', 'Organització d\'Empreses', 11758),
('735', 'Projectes Arquitectònics', 8578),
('736', 'Projectes d\'Enginyeria', 7282),
('737', 'Resistència de Materials i Estructures a l\'Enginyeria', 15473),
('739', 'Teoria del Senyal i Comunicacions', 4312),
('740', 'Urbanisme i Ordenació del Territori', 11639),
('741', 'Enginyeria Minera i Recursos Naturals', 12065),
('742', 'Ciència i Enginyeria Nàutiques', 19469),
('743', 'Matemàtica Aplicada IV', 19791),
('744', 'Enginyeria Telemàtica', 5904),
('745', 'Enginyeria Agroalimentària i Biotecnologia', 19216),
('746', 'Enginyeria de Disseny i Programació de Sistemes Electrònics', 14653),
('747', 'Enginyeria de Serveis i Sistemes d\'Informació', 11517);
-- --------------------------------------------------------
--
-- Table structure for table `Empleats`
--
CREATE TABLE `Empleats` (
`dni` varchar(9) NOT NULL,
`nom` varchar(13) NOT NULL,
`cognom1` varchar(10) NOT NULL,
`cognom2` varchar(10) NOT NULL,
`departament` int(11) NOT NULL,
`Salari` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `Empleats`
--
INSERT INTO `Empleats` (`dni`, `nom`, `cognom1`, `cognom2`, `departament`, `Salari`) VALUES
('07977747J', 'PEDRO VTE', 'SÁNCHEZ', 'MARTÍNEZ', 700, 1031),
('13171339K', 'LAURA', 'MATEU', 'CARBONERES', 721, 2514),
('16283098H', 'VIRMA', 'CHENOLL', 'RUBIO', 703, 11260),
('1931252B', 'ENCARNACIÓN', 'BOU', 'GRAU', 727, 4030),
('20473005S', 'JESSICA', 'PINA', 'ALEGRE', 720, 7556),
('24383183D', 'JOAN FRANCESC', 'BAEZA', 'SORIA', 726, 1689),
('25416158P', 'LOURDES', 'SANZ', 'SANCHEZ', 740, 6019),
('2650711F', 'ESTHER', 'CERVERA', 'BUENO', 739, 10366),
('2657947K', 'PAU', 'BUENO', 'VILA', 721, 3542),
('29133618R', 'PAU', 'BOU', 'GRAU', 714, 5583),
('29205865M', 'JOAN FRANCESC', 'BAEZA', 'SORIA', 733, 8034),
('29486167Y', 'JORDI', 'SALES', 'BAEZA', 726, 11362),
('30974888Y', 'ENCARNACIÓN', 'RUBIO', 'RUBIO', 722, 5838),
('36173128', 'PEDRO VTE', 'CISCAR', 'CUÑA', 730, 11407),
('38506578R', 'ANTONIO', 'MORENO', 'DOÑATE', 711, 1650),
('43682334K', 'JESSICA', 'MICÓ', 'LANCERO', 735, 7830),
('44508273F', 'MARIA ISABEL', 'PARDO', 'BALDOVI', 702, 3700),
('44587749H', 'JORDI', 'SOLER', 'CAMPINS', 737, 8657),
('44591376B', 'JOAN FRANCESC', 'BAEZA', 'SORIA', 735, 3063),
('44717954C', 'CARLOS', 'BOIX', 'MARTINEZ', 719, 7662),
('44837411S', 'GEMMA', 'PINA', 'ALEGRE', 728, 11406),
('44914440V', 'JORGE', 'RUBIO', 'PERIS', 721, 9474),
('45643630S', 'LAURA', 'GIMENO', 'VERDU', 700, 9757),
('45687655H', 'NURIA', 'MANZANO', 'HOYO', 733, 3979),
('46961565G', 'JAVIER', 'CISCAR', 'CUÑA', 733, 6182),
('47085576E', 'SERGIO', 'MARTINEZ', 'SANZ', 713, 5590),
('47807773L', 'ISIDRO', 'CHISVERT', 'MATEU', 738, 8135),
('48922126E', 'MARIA ISABEL', 'CLEMENTE', 'RUBIO', 711, 5168),
('52365765D', 'MARIA ISABEL', 'TORREGROSA', 'CLEMENTE', 717, 7115),
('52414479D', 'ISIDRO', 'MATEU', 'CARBONERES', 721, 11197),
('52654158M', 'JOAN FRANCESC', 'GRAU', 'BADAL', 735, 6483),
('52765416N', 'ROBERTO', 'HOYO', 'GIMENO', 728, 9678),
('53182941H', 'AMPARO', 'TÁRREGA', 'MOLLÁ', 722, 7315),
('53187168J', 'PATRICIA', 'SORIA', 'SÁNCHEZ', 713, 7773),
('53276024C', 'PILAR', 'SANCHEZ', 'GARCIA', 717, 2082),
('5346814F', 'CONSUELO', 'MIRAVET', 'BOIX', 701, 3815),
('70254375R', 'JORGE', 'TALENS', 'SALES', 709, 2947),
('71151866D', 'VIRMA', 'TALENS', 'SALES', 732, 2011),
('71292960K', 'LOURDES', 'MARTINEZ', 'SANZ', 700, 10923),
('71437195', 'ANTONIO', 'MORENO', 'DOÑATE', 733, 8943),
('71447730R', 'CONSUELO', 'OLIVER', 'MIRAVET', 726, 9769),
('71644057', 'ESTHER', 'HERVAS', 'TRESCOLI', 706, 8904),
('71651900', 'PAU', 'CUÑA', 'BOIX', 735, 6556),
('71889629R', 'PATRICIA', 'VALLES', 'CHENOLL', 719, 3646),
('71950651G', 'MAURO', 'TORREGROSA', 'CLEMENTE', 715, 9058),
('72484302D', 'JESSICA', 'ALEGRE', 'TÁRREGA', 708, 8583),
('72985365V', 'LAURA', 'MORENO', 'DOÑATE', 707, 3844),
('72986056H', 'LOURDES', 'SARRION', 'SARRIO', 727, 6995),
('74005177D', 'ROBERTO', 'FERRANDO', 'BOIX', 702, 11758),
('74657572D', 'TERESA', 'FERRANDIS', 'COMBRES', 713, 8414),
('74882847E', 'SALVIA', 'FERRANDO', 'BOIX', 716, 7901),
('75149161L', 'NURIA', 'MANZANO', 'HOYO', 735, 3462),
('75766795', 'JAVIER', 'OLIVER', 'MIRAVET', 703, 8407),
('75959001Y', 'CONSUELO', 'GUNA', 'RODRIGUEZ', 721, 8992),
('76023312D', 'SALVIA', 'BADAL', 'FENOLLAR', 719, 5775),
('78712657D', 'SANDRA', 'BOIX', 'TORMOS', 726, 10952),
('78930167D', 'LAURA', 'DOÑATE', 'MORENO', 721, 4118),
('7983256W', 'ESTHER', 'OLMOS', 'CERVERA', 720, 3095),
('80153775V', 'MIREIA', 'OLMOS', 'CERVERA', 734, 9929),
('8873162S', 'JAVIER', 'BOIX', 'CHISVERT', 712, 5161),
('9809005B', 'SANDRA', 'MANZANO', 'HOYO', 711, 5182),
('9814648L', 'PILAR', 'VALLES', 'CHENOLL', 737, 4372);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `Departaments`
--
ALTER TABLE `Departaments`
ADD PRIMARY KEY (`codi`);
--
-- Indexes for table `Empleats`
--
ALTER TABLE `Empleats`
ADD PRIMARY KEY (`dni`);
/*!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 */;
|
db.coffee.remove(
{
size: "grande"
}
);
db.coffee.remove({});
db.coffee.drop();
show collections;
db.dropDatabase(); |
USE agreeddb
INSERT INTO recommended VALUES (11431, "Jaws", 1, 1)
INSERT INTO recommended VALUES (11432, "Jaws 2", 1, 0)
INSERT INTO recommended VALUES (11433, "Jaws 3", 1, 1)
INSERT INTO recommended VALUES (11434, "Jaws Returns", 1, 0)
INSERT INTO recommended VALUES (11435, "Jaws The Revenge", 1, 0)
INSERT INTO recommended VALUES (11436, "Jaws Enter the Shark", 1, 0)
INSERT INTO recommended VALUES (11437, "Jaws Electic Boogaloo", 0, 1)
INSERT INTO recommended VALUES (11438, "Jaws Goes to the Dentist", 0, 0)
INSERT INTO recommended VALUES (11439, "Jaws Scared Stupid", 0, 0)
INSERT INTO recommended VALUES (11430, "Jaws 10 the reboot", 0, 0) |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 16, 2018 at 11:23 PM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 7.0.28-0ubuntu0.16.04.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: `cours_iot_python_pour_le_web`
--
-- --------------------------------------------------------
--
-- Table structure for table `entries`
--
CREATE TABLE `entries` (
`id` int(11) NOT NULL,
`name` varchar(200) DEFAULT NULL,
`value` varchar(2000) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `entries`
--
INSERT INTO `entries` (`id`, `name`, `value`) VALUES
(1, 'slogan', 'Mangez des pommes !');
-- --------------------------------------------------------
--
-- Table structure for table `history`
--
CREATE TABLE `history` (
`id` int(20) NOT NULL,
`code` varchar(4) NOT NULL,
`site_id` int(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `sites`
--
CREATE TABLE `sites` (
`id` int(11) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`url` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`email` varchar(500) DEFAULT NULL,
`password` varchar(200) DEFAULT NULL,
`is_admin` tinyint(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `email`, `password`, `is_admin`) VALUES
(1, 'someone@yopmail.com', '$argon2i$v=19$m=512,t=2,p=2$07qXMsb4P4fQ+p9T6l3rvQ$hWU817VMNDP/E9l21rYOKQ', 1),
(2, 'azerty@azerty.com', 'azerty', 1),
(3, 'moi@moi.com', '$argon2i$v=19$m=512,t=2,p=2$qfwxttAAlHrTC8eTG2L+uA$+ZhsMELhnpNozqNwyqTm4w', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `entries`
--
ALTER TABLE `entries`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `history`
--
ALTER TABLE `history`
ADD PRIMARY KEY (`id`),
ADD KEY `site_id` (`site_id`);
--
-- Indexes for table `sites`
--
ALTER TABLE `sites`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `entries`
--
ALTER TABLE `entries`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `history`
--
ALTER TABLE `history`
MODIFY `id` int(20) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `sites`
--
ALTER TABLE `sites`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `history`
--
ALTER TABLE `history`
ADD CONSTRAINT `Reference` FOREIGN KEY (`site_id`) REFERENCES `sites` (`id`);
/*!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 */;
|
INSERT INTO todo VALUES (null ,'todoInDbmigration-1', false, true, true, false, NOW(), 1);
INSERT INTO todo VALUES (null ,'todoInDbmigration-2', false, true, true, false, NOW(), 2);
INSERT INTO todo VALUES (null ,'todoInDbmigration-3', false, true, true, false, NOW(), 3); |
/********************
* Ver 1.2
* 2019/3/12
*******************/
CREATE DATABASE `fms` COLLATE 'utf8_general_ci' ;
USE fms;
CREATE TABLE `fms_app_auth` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`app_id` VARCHAR(50) NULL DEFAULT NULL,
`app_key` VARCHAR(50) NULL DEFAULT NULL,
`app_info` VARCHAR(50) NULL DEFAULT NULL,
`app_host` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
CREATE TABLE `fms_file_list` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` TINYTEXT NULL,
`type` VARCHAR(50) NULL DEFAULT NULL,
`sha1` VARCHAR(128) NULL DEFAULT NULL,
`size` VARCHAR(50) NULL DEFAULT NULL,
`owner` VARCHAR(50) NULL DEFAULT NULL,
`share` VARCHAR(50) NULL DEFAULT NULL,
`count` TINYINT(4) NULL DEFAULT '0',
`desc` TEXT NULL,
`create_date` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `share` (`share`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;
CREATE TABLE `fms_file_store` (
`sha1` VARCHAR(128) NOT NULL,
`crc` VARCHAR(64) NULL DEFAULT NULL,
`path` TEXT NOT NULL,
`exist` VARCHAR(5) NULL DEFAULT 0,
`update_date` VARCHAR(50) NULL DEFAULT NULL,
`create_date` VARCHAR(50) NULL DEFAULT NULL,
PRIMARY KEY (`sha1`),
UNIQUE INDEX `crc` (`crc`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
|
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 26 Des 2020 pada 07.57
-- Versi server: 10.4.14-MariaDB
-- Versi PHP: 7.4.11
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: `db_restolatihan`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `kosong`
--
CREATE TABLE `kosong` (
`username` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1);
-- --------------------------------------------------------
--
-- Struktur dari tabel `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_admin`
--
CREATE TABLE `tbl_admin` (
`id_admin` int(11) NOT NULL,
`nama_admin` varchar(100) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(191) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
`remember_token` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_admin`
--
INSERT INTO `tbl_admin` (`id_admin`, `nama_admin`, `username`, `password`, `created_at`, `updated_at`, `remember_token`) VALUES
(13, 'admin', 'admin', '$2y$10$QdP8uA6ZfIvcZay9TszkcO1ROXoC1YFVXdJhUSzrGuEzQZjG346gS', '2020-11-25 02:21:06', '2020-11-25 02:21:06', NULL),
(14, 'adm', 'adm', '$2y$10$PvgHM4oJDfRJf0NzdP5vFurriAcKchZA635BmlEfWvN656XzvuSlO', '2020-11-25 02:23:21', '2020-11-25 02:23:21', NULL);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_kasir`
--
CREATE TABLE `tbl_kasir` (
`id_kasir` int(11) NOT NULL,
`nama_kasir` varchar(100) NOT NULL,
`jenis_kelamin` varchar(15) NOT NULL,
`alamat` text NOT NULL,
`no_hp` varchar(12) NOT NULL,
`email` varchar(50) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(191) NOT NULL,
`updated_at` date NOT NULL,
`created_at` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_kasir`
--
INSERT INTO `tbl_kasir` (`id_kasir`, `nama_kasir`, `jenis_kelamin`, `alamat`, `no_hp`, `email`, `username`, `password`, `updated_at`, `created_at`) VALUES
(1, 'saputraaaaaa', 'laki-laki', 'kdw', '088989', 'cs@g.com', 'kasir1', '$2y$10$X41nT/ek7vYyeLkWW7wRbOr/VnOK9X/wxhC2f6sAJN/CtNTMmP6/y', '2020-11-25', '2020-11-23'),
(2, 'a', 'a', 'a', '1', 'a', 'a', '$2y$10$uWVVb0GS4f5W6VjaiOfbR.GcHV1ZDNOZ4iwlUYDAknrNQt//dvpjW', '2020-11-25', '2020-11-25');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_kategori`
--
CREATE TABLE `tbl_kategori` (
`id_kategori` int(11) NOT NULL,
`nama_kategori` varchar(100) NOT NULL,
`deskripsi` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_laporan`
--
CREATE TABLE `tbl_laporan` (
`id_laporan` int(11) NOT NULL,
`tanggal` date NOT NULL,
`jumlah_pelanggan` int(11) NOT NULL,
`jumlah_penghasilan` int(11) NOT NULL,
`jumlah_suplier_masuk` int(11) NOT NULL,
`jumlah_produk_terjual` int(11) NOT NULL,
`jumlah_uang_masuk` int(11) NOT NULL,
`jumlah_uang_keluar` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_masakan`
--
CREATE TABLE `tbl_masakan` (
`id_masakan` int(11) NOT NULL,
`nama_masakan` varchar(100) NOT NULL,
`gambar_masakan` varchar(100) NOT NULL,
`nama_kategori` varchar(30) NOT NULL,
`harga` int(11) NOT NULL,
`status` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_masakan`
--
INSERT INTO `tbl_masakan` (`id_masakan`, `nama_masakan`, `gambar_masakan`, `nama_kategori`, `harga`, `status`) VALUES
(1, 'Ichiban donut', 'donut.png', 'dessert', 10000, 'tersedia'),
(2, 'Ichiban lemon tea', 'esteh.png', 'minuman', 10000, 'tersedia'),
(3, 'Ichiban sashimi', 'sashimi.png', 'makanan', 10000, 'tersedia'),
(7, 'Ichiban ramen', 'produk_1607239257.png', 'makanan', 10000, 'tersedia'),
(22, 'Ichiban yakiniku', 'produk_1607408126.png', 'makanan', 10000, 'tersedia'),
(23, 'Ichiban spesial sushi', 'produk_1607408173.png', 'makanan', 10000, 'tersedia'),
(24, 'Ichiban orange juice', 'produk_1607408238.png', 'minuman', 10000, 'tersedia'),
(25, 'Ichiban matcha', 'produk_1607408277.png', 'minuman', 10000, 'tersedia'),
(26, 'Ichiban chocolate milkshake', 'produk_1607408305.png', 'minuman', 10000, 'tersedia'),
(27, 'Ichiban dorayaki', 'produk_1607408334.png', 'dessert', 10000, 'tersedia'),
(28, 'Ichiban mochi', 'produk_1607408354.png', 'dessert', 10000, 'tersedia'),
(29, 'ichiban takiyaki', 'produk_1607408376.png', 'dessert', 10000, 'tersedia');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_order`
--
CREATE TABLE `tbl_order` (
`id_order` int(11) NOT NULL,
`masakan_id` int(11) NOT NULL,
`order_detail_id` int(11) NOT NULL,
`user_order_id` int(11) NOT NULL,
`tanggal_order` date NOT NULL,
`status_order` varchar(30) NOT NULL,
`jumlah` int(11) NOT NULL,
`sub_total` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_order`
--
INSERT INTO `tbl_order` (`id_order`, `masakan_id`, `order_detail_id`, `user_order_id`, `tanggal_order`, `status_order`, `jumlah`, `sub_total`) VALUES
(1, 3, 0, 22, '2020-12-25', 'sudah_dipesan', 3, 30000),
(2, 7, 0, 23, '2020-12-25', 'sedang_dipesan', 1, 10000),
(3, 22, 0, 23, '2020-12-25', 'sedang_dipesan', 1, 10000),
(4, 25, 0, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(5, 27, 0, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(6, 3, 0, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(7, 27, 0, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(8, 3, 0, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(9, 27, 0, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(10, 26, 0, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(11, 2, 11, 22, '2020-12-25', 'sudah_dipesan', 1, 10000),
(12, 28, 13, 22, '2020-12-25', 'batal_dipesan', 1, 10000),
(13, 27, 13, 22, '2020-12-25', 'batal_dipesan', 1, 10000),
(14, 1, 15, 22, '2020-12-25', 'sudah_dibayar', 2, 20000),
(15, 28, 15, 22, '2020-12-25', 'sudah_dibayar', 1, 10000),
(16, 22, 17, 24, '2020-12-26', 'sudah_dibayar', 1, 10000),
(17, 2, 17, 24, '2020-12-26', 'sudah_dibayar', 1, 10000),
(18, 23, 18, 24, '2020-12-26', 'sudah_dipesan', 1, 10000);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_order_detail`
--
CREATE TABLE `tbl_order_detail` (
`id_order_detail` int(11) NOT NULL,
`order_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_order_detail`
--
INSERT INTO `tbl_order_detail` (`id_order_detail`, `order_id`) VALUES
(5, 1),
(5, 4),
(5, 5),
(5, 1),
(5, 4),
(5, 5),
(7, 6),
(7, 7),
(8, 8),
(9, 9),
(10, 10),
(11, 11),
(13, 12),
(13, 13),
(15, 14),
(15, 15),
(17, 16),
(17, 17),
(18, 18);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_owner`
--
CREATE TABLE `tbl_owner` (
`id_owner` int(11) NOT NULL,
`nama_owner` varchar(100) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(191) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
`remember_token` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_pelanggan`
--
CREATE TABLE `tbl_pelanggan` (
`id_pelanggan` int(11) NOT NULL,
`kode` varchar(30) NOT NULL,
`nama_pelanggan` varchar(100) NOT NULL,
`no_meja` int(11) NOT NULL,
`password` varchar(200) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
`remember_token` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_pelanggan`
--
INSERT INTO `tbl_pelanggan` (`id_pelanggan`, `kode`, `nama_pelanggan`, `no_meja`, `password`, `created_at`, `updated_at`, `remember_token`) VALUES
(19, 'plg12', 'ca', 1, '$2y$10$2p3qfokxld.oCHnECJsm6OSRJctzBhxdlKu4RCI9qaUw2Tvgi0Z92', '2020-12-21 19:05:46', '2020-12-21 19:05:46', '2Loggr6r9nQ7tcKOKRWvQ4XjflOntn'),
(21, 'plg1', 'eren', 1, '$2y$10$R5m0KNeFREL/xIwirtO5Ce0MnkDoPCDvli1x8V3vfHuooAOltBtl.', '2020-12-23 19:37:38', '2020-12-23 19:37:38', '1G9iy8RAnAORymQGke1uDJLJ8lSlbUJpFXLj5r8JEnQDux5QKB3slbE7Hoou'),
(22, 'plg2', 'eer', 2, '$2y$10$5cYl/ahJY9VZX3IDi9yo4.QsL0XFtXdUGJ3nZW1rnNr5xBctmhDTm', '2020-12-24 18:21:29', '2020-12-24 18:21:29', 'qjDeMh3jW7XiNEpDFLi3wikwvkBXR7'),
(23, 'plg3', 'For', 1, '$2y$10$ABWRpJxQJGFywht2hPjPy.iVYZfqjidoyTTYnomR9DInWMhzPiTIu', '2020-12-24 18:52:54', '2020-12-24 18:52:54', 'uSFbKGxNWkqeyOIRDix26rF3NBfeU4'),
(24, 'plg4', 'candra', 1, '$2y$10$UNqgp.eAuShrTBPTmVjuw.G2eQ9eXvfW886CknPQ79XUs0QeILECe', '2020-12-25 21:46:05', '2020-12-25 21:46:05', 'pTfhk9MWtcbxro52LzBRoIsXZcCXfg');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_pengaturan`
--
CREATE TABLE `tbl_pengaturan` (
`id_pengaturan` int(11) NOT NULL,
`logo_restoran` text NOT NULL,
`nama_restoran` text NOT NULL,
`banner_1` text NOT NULL,
`banner_2` text NOT NULL,
`banner_3` text NOT NULL,
`small_banner1` text NOT NULL,
`small_banner2` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_suplier`
--
CREATE TABLE `tbl_suplier` (
`id_suplier` int(11) NOT NULL,
`nama_suplier` varchar(100) NOT NULL,
`nama_produk` varchar(100) NOT NULL,
`harga_produk` int(11) NOT NULL,
`tanggal_masuk` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_transaksi`
--
CREATE TABLE `tbl_transaksi` (
`id_transaksi` varchar(100) NOT NULL,
`order_detail_id` int(11) NOT NULL,
`tanggal_transaksi` date NOT NULL,
`total_bayar` int(11) NOT NULL,
`jumlah_pembayaran` int(11) NOT NULL,
`kembalian` int(11) NOT NULL,
`user_transaksi_id` int(11) NOT NULL,
`status_order` varchar(50) NOT NULL,
`diantar` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_transaksi`
--
INSERT INTO `tbl_transaksi` (`id_transaksi`, `order_detail_id`, `tanggal_transaksi`, `total_bayar`, `jumlah_pembayaran`, `kembalian`, `user_transaksi_id`, `status_order`, `diantar`) VALUES
('ICHBNRST3', 18, '2020-12-26', 10000, 0, 0, 24, 'belum_dibayar', 'belum'),
('ICHBNRST91', 15, '2020-12-25', 30000, 50000, -20000, 22, '', ''),
('ICHBNRST92', 17, '2020-12-26', 20000, 50000, 30000, 24, 'sudah_dibayar', '');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_waiter`
--
CREATE TABLE `tbl_waiter` (
`id_waiter` int(11) NOT NULL,
`nama_waiter` varchar(100) NOT NULL,
`jenis_kelamin` varchar(10) NOT NULL,
`alamat` text NOT NULL,
`no_hp` varchar(12) NOT NULL,
`email` varchar(50) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(191) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_at` timestamp NOT NULL DEFAULT current_timestamp(),
`remember_token` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data untuk tabel `tbl_waiter`
--
INSERT INTO `tbl_waiter` (`id_waiter`, `nama_waiter`, `jenis_kelamin`, `alamat`, `no_hp`, `email`, `username`, `password`, `created_at`, `updated_at`, `remember_token`) VALUES
(1, 'candra', 'L', 'kdw', '088', 'cs@g.com', 'waiter1', '$2y$10$lLWxQ.vQla130zc36RywC.DCfC9Te3XILVUe7XdIbgU7BUhLDbPoG', '2020-11-23 00:45:47', '2020-11-23 00:45:47', 'FjMPglZug5WeIUZVPIJevugrH5sLU3JDPM8CoJLuFkR9tz1WmHiS1qtkIxtR'),
(3, 'add', 'Laki-Laki', 'ad', 'ad', 'ad', 'ad', '$2y$10$2i/X5lV0ijngXqDGX43WZetNnl9anrTVfKjY4tE0A1QjB9ixHoeQK', '2020-11-26 00:52:49', '2020-11-26 01:12:14', NULL);
-- --------------------------------------------------------
--
-- Struktur dari tabel `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Dumping data untuk tabel `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'admin', 'admin@g.com', '2020-11-29 09:30:24', 'admin', NULL, '2020-11-17 09:30:24', '2020-11-17 09:30:24'),
(3, 'adminn', 'admin@gg.com', NULL, '21232f297a57a5a743894a0e4a801fc3', NULL, NULL, NULL),
(4, 'candra', 'adminnn', NULL, 'password', NULL, NULL, NULL),
(5, 'candraa', 'cs@g.com', NULL, '$2y$10$rPL9Qs4zC5K0Up7g9cWIOe2OwJzAe7wIQ4X/ygwcBtBIRfHivZre6', '26Rf2ZijiWLjHOHuaKI93CAzpXpbF9N1DW3T6n4YfBDPiiu8Ng', '2020-11-17 05:15:19', '2020-11-17 05:15:19');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Indeks untuk tabel `tbl_admin`
--
ALTER TABLE `tbl_admin`
ADD PRIMARY KEY (`id_admin`);
--
-- Indeks untuk tabel `tbl_kasir`
--
ALTER TABLE `tbl_kasir`
ADD PRIMARY KEY (`id_kasir`);
--
-- Indeks untuk tabel `tbl_kategori`
--
ALTER TABLE `tbl_kategori`
ADD PRIMARY KEY (`id_kategori`);
--
-- Indeks untuk tabel `tbl_laporan`
--
ALTER TABLE `tbl_laporan`
ADD PRIMARY KEY (`id_laporan`);
--
-- Indeks untuk tabel `tbl_masakan`
--
ALTER TABLE `tbl_masakan`
ADD PRIMARY KEY (`id_masakan`);
--
-- Indeks untuk tabel `tbl_order`
--
ALTER TABLE `tbl_order`
ADD PRIMARY KEY (`id_order`),
ADD KEY `masakan_id` (`masakan_id`);
--
-- Indeks untuk tabel `tbl_owner`
--
ALTER TABLE `tbl_owner`
ADD PRIMARY KEY (`id_owner`);
--
-- Indeks untuk tabel `tbl_pelanggan`
--
ALTER TABLE `tbl_pelanggan`
ADD PRIMARY KEY (`id_pelanggan`),
ADD UNIQUE KEY `kode` (`kode`);
--
-- Indeks untuk tabel `tbl_pengaturan`
--
ALTER TABLE `tbl_pengaturan`
ADD PRIMARY KEY (`id_pengaturan`);
--
-- Indeks untuk tabel `tbl_suplier`
--
ALTER TABLE `tbl_suplier`
ADD PRIMARY KEY (`id_suplier`);
--
-- Indeks untuk tabel `tbl_transaksi`
--
ALTER TABLE `tbl_transaksi`
ADD PRIMARY KEY (`id_transaksi`),
ADD KEY `order_id` (`order_detail_id`);
--
-- Indeks untuk tabel `tbl_waiter`
--
ALTER TABLE `tbl_waiter`
ADD PRIMARY KEY (`id_waiter`);
--
-- Indeks untuk tabel `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT untuk tabel `tbl_admin`
--
ALTER TABLE `tbl_admin`
MODIFY `id_admin` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
--
-- AUTO_INCREMENT untuk tabel `tbl_kasir`
--
ALTER TABLE `tbl_kasir`
MODIFY `id_kasir` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT untuk tabel `tbl_kategori`
--
ALTER TABLE `tbl_kategori`
MODIFY `id_kategori` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_laporan`
--
ALTER TABLE `tbl_laporan`
MODIFY `id_laporan` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_masakan`
--
ALTER TABLE `tbl_masakan`
MODIFY `id_masakan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=30;
--
-- AUTO_INCREMENT untuk tabel `tbl_order`
--
ALTER TABLE `tbl_order`
MODIFY `id_order` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;
--
-- AUTO_INCREMENT untuk tabel `tbl_owner`
--
ALTER TABLE `tbl_owner`
MODIFY `id_owner` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_pelanggan`
--
ALTER TABLE `tbl_pelanggan`
MODIFY `id_pelanggan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
--
-- AUTO_INCREMENT untuk tabel `tbl_pengaturan`
--
ALTER TABLE `tbl_pengaturan`
MODIFY `id_pengaturan` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_suplier`
--
ALTER TABLE `tbl_suplier`
MODIFY `id_suplier` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_waiter`
--
ALTER TABLE `tbl_waiter`
MODIFY `id_waiter` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT untuk tabel `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED 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 */;
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Anamakine: 127.0.0.1
-- Üretim Zamanı: 30 Tem 2021, 07:51:06
-- Sunucu sürümü: 10.4.20-MariaDB
-- PHP Sürümü: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Veritabanı: `cesme`
--
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `ayna_tas_malzeme`
--
CREATE TABLE `ayna_tas_malzeme` (
`ayna_tas_malzeme_id` int(11) NOT NULL,
`malzeme` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `bulundugu_alan`
--
CREATE TABLE `bulundugu_alan` (
`bulundugu_alan_id` int(11) NOT NULL,
`alan` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `cati_kaplama_m.`
--
CREATE TABLE `cati_kaplama_m.` (
`cati_kaplama_id` int(11) NOT NULL,
`kaplama` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `cati_ortusu`
--
CREATE TABLE `cati_ortusu` (
`cati_ortu_id` int(11) NOT NULL,
`ortu` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `cephe_orgu_m.`
--
CREATE TABLE `cephe_orgu_m.` (
`cephe_orgu_malzeme_id` int(11) NOT NULL,
`malzeme` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `cesme`
--
CREATE TABLE `cesme` (
`id` int(11) NOT NULL,
`lat` int(11) NOT NULL,
`lon` int(11) NOT NULL,
`ad` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL,
`bilgi_aciklama` varchar(250) COLLATE utf8mb4_turkish_ci NOT NULL,
`mimarin_adi` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL,
`stil_id` int(11) DEFAULT NULL,
`mimari_tip_id` int(11) DEFAULT NULL,
`yaptiran` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL,
`hazne_sayisi` int(11) DEFAULT NULL,
`hazne_yapim_malzeme_id` int(11) DEFAULT NULL,
`hazne_cati_tipi_id` int(11) DEFAULT NULL,
`hazne_cati_malzeme_id` int(11) DEFAULT NULL,
`cesmenin_durumu_id` int(11) DEFAULT NULL,
`sebeke_suyu` tinyint(1) DEFAULT NULL,
`kaynak_suyu` tinyint(1) DEFAULT NULL,
`kaynak_suyu_membagi` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL,
`cephe_orgu_malzeme_id` int(11) DEFAULT NULL,
`cati_kaplama_id` int(11) DEFAULT NULL,
`cati_ortu_id` int(11) DEFAULT NULL,
`sacak_durum_id` int(11) DEFAULT NULL,
`sacak_ozellik_id` int(11) DEFAULT NULL,
`bulundugu_alan_id` int(11) DEFAULT NULL,
`konumu_id` int(11) DEFAULT NULL,
`cephe_sayisi` int(11) DEFAULT NULL,
`alinlik` tinyint(1) DEFAULT NULL,
`silme` tinyint(1) DEFAULT NULL,
`masrapalik_id` int(11) DEFAULT NULL,
`lule_sayisi` int(11) DEFAULT NULL,
`yalak_durumu` tinyint(1) DEFAULT NULL,
`yalak_malzeme_id` int(11) DEFAULT NULL,
`testilik` tinyint(1) DEFAULT NULL,
`tugra` tinyint(1) DEFAULT NULL,
`tugra_kime_ait` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL,
`kemer` tinyint(1) DEFAULT NULL,
`kemer_tip_id` int(11) DEFAULT NULL,
`musluk` tinyint(1) DEFAULT NULL,
`musluk_sayi` int(11) DEFAULT NULL,
`ayna_tasi` tinyint(1) DEFAULT NULL,
`ayna_tasi_sayisi` int(11) DEFAULT NULL,
`ayna_tasi-malzeme_id` int(11) DEFAULT NULL,
`cesmecik` tinyint(1) DEFAULT NULL,
`cesmecik_sayi` int(11) DEFAULT NULL,
`kitabe_sayi` int(11) DEFAULT NULL,
`kitabe_malzeme_id` int(11) DEFAULT NULL,
`kitabe_tercume` varchar(250) COLLATE utf8mb4_turkish_ci DEFAULT NULL,
`diger_bilgiler` varchar(250) COLLATE utf8mb4_turkish_ci DEFAULT NULL,
`resim` varchar(100) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `fiziki_durum`
--
CREATE TABLE `fiziki_durum` (
`fiziki_durum_id` int(11) NOT NULL,
`durum` varchar(100) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `hazne_cati_m.`
--
CREATE TABLE `hazne_cati_m.` (
`hazne_cati_malzeme_id` int(11) NOT NULL,
`malz` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `hazne_cati_tipi`
--
CREATE TABLE `hazne_cati_tipi` (
`hazne_cati_tip_id` int(11) NOT NULL,
`cati_tip` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `hazne_yapi_m.`
--
CREATE TABLE `hazne_yapi_m.` (
`hazne_yapi_malzeme_id` int(11) NOT NULL,
`malzeme` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `kemer_tip`
--
CREATE TABLE `kemer_tip` (
`kemer_tip_id` int(11) NOT NULL,
`tip` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `kitabe_malzeme`
--
CREATE TABLE `kitabe_malzeme` (
`kitabe_malzeme_id` int(11) NOT NULL,
`malzeme` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `konum`
--
CREATE TABLE `konum` (
`konum_id` int(11) NOT NULL,
`konum` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `masrapalik`
--
CREATE TABLE `masrapalik` (
`masrapalik_id` int(11) NOT NULL,
`masrapalik` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `mimari_tipi`
--
CREATE TABLE `mimari_tipi` (
`mimari_tip_id` int(11) NOT NULL,
`tip` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `sacak_durum`
--
CREATE TABLE `sacak_durum` (
`sacak_durum_id` int(11) NOT NULL,
`durum` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `sacak_ozellik`
--
CREATE TABLE `sacak_ozellik` (
`sacak_ozellik_id` int(11) NOT NULL,
`ozellik` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `stil`
--
CREATE TABLE `stil` (
`stil_id` int(11) NOT NULL,
`stil` varchar(50) COLLATE utf8mb4_turkish_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
-- --------------------------------------------------------
--
-- Tablo için tablo yapısı `yalak_malzeme`
--
CREATE TABLE `yalak_malzeme` (
`yalak_malzeme_id` int(11) NOT NULL,
`malzeme` varchar(50) COLLATE utf8mb4_turkish_ci DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_turkish_ci;
--
-- Dökümü yapılmış tablolar için indeksler
--
--
-- Tablo için indeksler `ayna_tas_malzeme`
--
ALTER TABLE `ayna_tas_malzeme`
ADD PRIMARY KEY (`ayna_tas_malzeme_id`);
--
-- Tablo için indeksler `bulundugu_alan`
--
ALTER TABLE `bulundugu_alan`
ADD PRIMARY KEY (`bulundugu_alan_id`);
--
-- Tablo için indeksler `cati_kaplama_m.`
--
ALTER TABLE `cati_kaplama_m.`
ADD PRIMARY KEY (`cati_kaplama_id`);
--
-- Tablo için indeksler `cati_ortusu`
--
ALTER TABLE `cati_ortusu`
ADD PRIMARY KEY (`cati_ortu_id`);
--
-- Tablo için indeksler `cephe_orgu_m.`
--
ALTER TABLE `cephe_orgu_m.`
ADD PRIMARY KEY (`cephe_orgu_malzeme_id`);
--
-- Tablo için indeksler `cesme`
--
ALTER TABLE `cesme`
ADD PRIMARY KEY (`id`),
ADD KEY `stil_id` (`stil_id`),
ADD KEY `mimari_tip_id` (`mimari_tip_id`,`hazne_yapim_malzeme_id`,`hazne_cati_tipi_id`,`hazne_cati_malzeme_id`,`cesmenin_durumu_id`,`cephe_orgu_malzeme_id`,`cati_kaplama_id`,`cati_ortu_id`,`sacak_durum_id`,`sacak_ozellik_id`,`bulundugu_alan_id`,`konumu_id`,`masrapalik_id`,`yalak_malzeme_id`,`kemer_tip_id`,`ayna_tasi-malzeme_id`,`kitabe_malzeme_id`),
ADD KEY `cati_kaplama_id` (`cati_kaplama_id`),
ADD KEY `cesmenin_durumu_id` (`cesmenin_durumu_id`),
ADD KEY `sacak_ozellik_id` (`sacak_ozellik_id`),
ADD KEY `hazne_cati_tipi_id` (`hazne_cati_tipi_id`),
ADD KEY `hazne_yapim_malzeme_id` (`hazne_yapim_malzeme_id`),
ADD KEY `kitabe_malzeme_id` (`kitabe_malzeme_id`),
ADD KEY `hazne_cati_malzeme_id` (`hazne_cati_malzeme_id`),
ADD KEY `konumu_id` (`konumu_id`),
ADD KEY `sacak_durum_id` (`sacak_durum_id`),
ADD KEY `yalak_malzeme_id` (`yalak_malzeme_id`),
ADD KEY `kemer_tip_id` (`kemer_tip_id`),
ADD KEY `cati_ortu_id` (`cati_ortu_id`),
ADD KEY `masrapalik_id` (`masrapalik_id`),
ADD KEY `cephe_orgu_malzeme_id` (`cephe_orgu_malzeme_id`),
ADD KEY `bulundugu_alan_id` (`bulundugu_alan_id`),
ADD KEY `ayna_tasi-malzeme_id` (`ayna_tasi-malzeme_id`),
ADD KEY `mimari_tip_id_2` (`mimari_tip_id`);
--
-- Tablo için indeksler `fiziki_durum`
--
ALTER TABLE `fiziki_durum`
ADD PRIMARY KEY (`fiziki_durum_id`);
--
-- Tablo için indeksler `hazne_cati_m.`
--
ALTER TABLE `hazne_cati_m.`
ADD PRIMARY KEY (`hazne_cati_malzeme_id`);
--
-- Tablo için indeksler `hazne_cati_tipi`
--
ALTER TABLE `hazne_cati_tipi`
ADD PRIMARY KEY (`hazne_cati_tip_id`);
--
-- Tablo için indeksler `hazne_yapi_m.`
--
ALTER TABLE `hazne_yapi_m.`
ADD PRIMARY KEY (`hazne_yapi_malzeme_id`);
--
-- Tablo için indeksler `kemer_tip`
--
ALTER TABLE `kemer_tip`
ADD PRIMARY KEY (`kemer_tip_id`);
--
-- Tablo için indeksler `kitabe_malzeme`
--
ALTER TABLE `kitabe_malzeme`
ADD PRIMARY KEY (`kitabe_malzeme_id`);
--
-- Tablo için indeksler `konum`
--
ALTER TABLE `konum`
ADD PRIMARY KEY (`konum_id`);
--
-- Tablo için indeksler `masrapalik`
--
ALTER TABLE `masrapalik`
ADD PRIMARY KEY (`masrapalik_id`);
--
-- Tablo için indeksler `mimari_tipi`
--
ALTER TABLE `mimari_tipi`
ADD PRIMARY KEY (`mimari_tip_id`);
--
-- Tablo için indeksler `sacak_durum`
--
ALTER TABLE `sacak_durum`
ADD PRIMARY KEY (`sacak_durum_id`);
--
-- Tablo için indeksler `sacak_ozellik`
--
ALTER TABLE `sacak_ozellik`
ADD PRIMARY KEY (`sacak_ozellik_id`);
--
-- Tablo için indeksler `stil`
--
ALTER TABLE `stil`
ADD PRIMARY KEY (`stil_id`);
--
-- Tablo için indeksler `yalak_malzeme`
--
ALTER TABLE `yalak_malzeme`
ADD PRIMARY KEY (`yalak_malzeme_id`);
--
-- Dökümü yapılmış tablolar için AUTO_INCREMENT değeri
--
--
-- Tablo için AUTO_INCREMENT değeri `ayna_tas_malzeme`
--
ALTER TABLE `ayna_tas_malzeme`
MODIFY `ayna_tas_malzeme_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `bulundugu_alan`
--
ALTER TABLE `bulundugu_alan`
MODIFY `bulundugu_alan_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `cati_kaplama_m.`
--
ALTER TABLE `cati_kaplama_m.`
MODIFY `cati_kaplama_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `cati_ortusu`
--
ALTER TABLE `cati_ortusu`
MODIFY `cati_ortu_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `cephe_orgu_m.`
--
ALTER TABLE `cephe_orgu_m.`
MODIFY `cephe_orgu_malzeme_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `cesme`
--
ALTER TABLE `cesme`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `fiziki_durum`
--
ALTER TABLE `fiziki_durum`
MODIFY `fiziki_durum_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `hazne_cati_m.`
--
ALTER TABLE `hazne_cati_m.`
MODIFY `hazne_cati_malzeme_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `hazne_cati_tipi`
--
ALTER TABLE `hazne_cati_tipi`
MODIFY `hazne_cati_tip_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `hazne_yapi_m.`
--
ALTER TABLE `hazne_yapi_m.`
MODIFY `hazne_yapi_malzeme_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `kemer_tip`
--
ALTER TABLE `kemer_tip`
MODIFY `kemer_tip_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `kitabe_malzeme`
--
ALTER TABLE `kitabe_malzeme`
MODIFY `kitabe_malzeme_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `konum`
--
ALTER TABLE `konum`
MODIFY `konum_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `masrapalik`
--
ALTER TABLE `masrapalik`
MODIFY `masrapalik_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `mimari_tipi`
--
ALTER TABLE `mimari_tipi`
MODIFY `mimari_tip_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `sacak_durum`
--
ALTER TABLE `sacak_durum`
MODIFY `sacak_durum_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `sacak_ozellik`
--
ALTER TABLE `sacak_ozellik`
MODIFY `sacak_ozellik_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `stil`
--
ALTER TABLE `stil`
MODIFY `stil_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Tablo için AUTO_INCREMENT değeri `yalak_malzeme`
--
ALTER TABLE `yalak_malzeme`
MODIFY `yalak_malzeme_id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Dökümü yapılmış tablolar için kısıtlamalar
--
--
-- Tablo kısıtlamaları `cesme`
--
ALTER TABLE `cesme`
ADD CONSTRAINT `cesme_ibfk_1` FOREIGN KEY (`stil_id`) REFERENCES `stil` (`stil_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_10` FOREIGN KEY (`sacak_durum_id`) REFERENCES `sacak_durum` (`sacak_durum_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_11` FOREIGN KEY (`yalak_malzeme_id`) REFERENCES `yalak_malzeme` (`yalak_malzeme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_12` FOREIGN KEY (`kemer_tip_id`) REFERENCES `kemer_tip` (`kemer_tip_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_13` FOREIGN KEY (`cati_ortu_id`) REFERENCES `cati_ortusu` (`cati_ortu_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_14` FOREIGN KEY (`masrapalik_id`) REFERENCES `masrapalik` (`masrapalik_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_15` FOREIGN KEY (`mimari_tip_id`) REFERENCES `mimari_tipi` (`mimari_tip_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_16` FOREIGN KEY (`cephe_orgu_malzeme_id`) REFERENCES `cephe_orgu_m.` (`cephe_orgu_malzeme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_17` FOREIGN KEY (`bulundugu_alan_id`) REFERENCES `bulundugu_alan` (`bulundugu_alan_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_18` FOREIGN KEY (`ayna_tasi-malzeme_id`) REFERENCES `ayna_tas_malzeme` (`ayna_tas_malzeme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_2` FOREIGN KEY (`cati_kaplama_id`) REFERENCES `cati_kaplama_m.` (`cati_kaplama_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_3` FOREIGN KEY (`cesmenin_durumu_id`) REFERENCES `fiziki_durum` (`fiziki_durum_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_4` FOREIGN KEY (`sacak_ozellik_id`) REFERENCES `sacak_ozellik` (`sacak_ozellik_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_5` FOREIGN KEY (`hazne_cati_tipi_id`) REFERENCES `hazne_cati_tipi` (`hazne_cati_tip_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_6` FOREIGN KEY (`hazne_yapim_malzeme_id`) REFERENCES `hazne_yapi_m.` (`hazne_yapi_malzeme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_7` FOREIGN KEY (`kitabe_malzeme_id`) REFERENCES `kitabe_malzeme` (`kitabe_malzeme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_8` FOREIGN KEY (`hazne_cati_malzeme_id`) REFERENCES `hazne_cati_m.` (`hazne_cati_malzeme_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `cesme_ibfk_9` FOREIGN KEY (`konumu_id`) REFERENCES `konum` (`konum_id`) ON DELETE CASCADE ON UPDATE CASCADE;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
use master;
create database TMPSVV_UNIVER; |
-- Creates the table unique_id
-- Create a unique id
CREATE TABLE unique_id (id INT DEFAULT 1 UNIQUE, name VARCHAR(256));
|
--解約損害金情報
UPDATE END_AGREEMENT_WITHDRAW_INFO
SET
--発票印刷フラグ(元本)=印刷済
INVOICE_PRINTED_FLG = /*dto.invoicePrintKbnYes*/,
--単据番号(元本)=DTO.領収書番号
INVOICE_PRINCIPAL_PRINTED_NO = /*dto.invoicePrintedNo*/,
--新規者/更新者
MODIFY_USER = /*modifyUser*/,
--新規日付/更新日付
MODIFY_DATE = /*modifyDate*/
WHERE
--更新日時 <= パラメータ.日時
MODIFY_DATE <= /*businessDate*/ AND
--AND 契約番号 = DTO.契約番号
CONTRACT_NO = /*dto.contractNo*/ AND
--AND 発票印刷フラグ(元本) = 未印刷
INVOICE_PRINTED_FLG = /*dto.invoicePrintKbnNo*/
--AND 回数 = DTO.回数
AND COUPON = /*dto.coupon*/
|
WITH CTE_SALES_GROUP AS
(
SELECT
CTX.NU_CARTEIRA_VERSION,
MAX(CTX.CD_SALES_DISTRICT) CD_SALES_DISTRICT,
MAX(CTX.NO_SALES_DISTRICT) NO_SALES_DISTRICT,
MAX(CTX.CD_SALES_OFFICE) CD_SALES_OFFICE,
MAX(CTX.NO_SALES_OFFICE) NO_SALES_OFFICE,
CTX.CD_SALES_GROUP CD_SALES_GROUP,
MAX(CTX.NO_SALES_GROUP) NO_SALES_GROUP
FROM VND.ELO_CARTEIRA_SAP CTX
WHERE CTX.DH_CARTEIRA > (SYSDATE - 30)
GROUP BY
CTX.NU_CARTEIRA_VERSION,
CTX.CD_SALES_GROUP --,
--CTX.NO_SALES_GROUP
)
--SELECT * FROM CTE_SALES_GROUP
SELECT
CTSAP.CD_ELO_CARTEIRA_SAP,
CTSAP.NU_CARTEIRA_VERSION,
CTSAP.CD_CENTRO_EXPEDIDOR,
CTSAP.DS_CENTRO_EXPEDIDOR,
CTSAP.DH_CARTEIRA,
CTSAP.CD_SALES_ORG,
CTSAP.NU_CONTRATO_SAP,
CTSAP.CD_TIPO_CONTRATO,
CTSAP.NU_CONTRATO_SUBSTITUI,
CTSAP.DT_PAGO,
CTSAP.NU_CONTRATO,
CTSAP.NU_ORDEM_VENDA,
CTSAP.DS_STATUS_CONTRATO_SAP,
CTSAP.CD_CLIENTE,
CTSAP.NO_CLIENTE,
CTSAP.CD_INCOTERMS,
(SELECT PB.CD_SALES_DISTRICT
FROM CTE_SALES_GROUP PB
WHERE PB.CD_SALES_GROUP = CTSAP.CD_SALES_GROUP
AND PB.NU_CARTEIRA_VERSION = CTSAP.NU_CARTEIRA_VERSION
AND ROWNUM =1) CD_SALES_DISTRICT,
(SELECT PB.CD_SALES_OFFICE
FROM CTE_SALES_GROUP PB
WHERE PB.CD_SALES_GROUP = CTSAP.CD_SALES_GROUP
AND PB.NU_CARTEIRA_VERSION = CTSAP.NU_CARTEIRA_VERSION
AND ROWNUM =1) CD_SALES_OFFICE,
(SELECT PB.NO_SALES_OFFICE
FROM CTE_SALES_GROUP PB
WHERE PB.CD_SALES_GROUP = CTSAP.CD_SALES_GROUP
AND PB.NU_CARTEIRA_VERSION = CTSAP.NU_CARTEIRA_VERSION
AND ROWNUM =1) NO_SALES_OFFICE,
CTSAP.CD_SALES_GROUP,
(SELECT PB.NO_SALES_GROUP
FROM CTE_SALES_GROUP PB
WHERE PB.CD_SALES_GROUP = CTSAP.CD_SALES_GROUP
AND PB.NU_CARTEIRA_VERSION = CTSAP.NU_CARTEIRA_VERSION
AND ROWNUM =1) NO_SALES_GROUP,
CTSAP.CD_AGENTE_VENDA,
CTSAP.NO_AGENTE,
CTSAP.DH_VENCIMENTO_PEDIDO,
CTSAP.DT_CREDITO,
CTSAP.DT_INICIO,
CTSAP.DT_FIM,
CTSAP.DH_INCLUSAO,
CTSAP.DH_ENTREGA,
CTSAP.SG_ESTADO,
CTSAP.NO_MUNICIPIO,
CTSAP.DS_BAIRRO,
CTSAP.CD_PRODUTO_SAP,
CTSAP.NO_PRODUTO_SAP,
CTSAP.QT_PROGRAMADA,
CTSAP.QT_ENTREGUE,
CTSAP.QT_SALDO,
CTSAP.VL_UNITARIO,
CTSAP.VL_BRL,
CTSAP.VL_TAXA_DOLAR,
CTSAP.VL_USD,
CTSAP.PC_COMISSAO,
CTSAP.CD_SACARIA,
CTSAP.DS_SACARIA,
CTSAP.CD_CULTURA_SAP,
CTSAP.DS_CULTURA_SAP,
CTSAP.CD_BLOQUEIO_REMESSA,
CTSAP.CD_BLOQUEIO_FATURAMENTO,
CTSAP.CD_BLOQUEIO_CREDITO,
CTSAP.CD_BLOQUEIO_REMESSA_ITEM,
CTSAP.CD_BLOQUEIO_FATURAMENTO_ITEM,
CTSAP.CD_MOTIVO_RECUSA,
CTSAP.CD_LOGIN,
CTSAP.CD_SEGMENTACAO_CLIENTE,
CTSAP.DS_SEGMENTACAO_CLIENTE,
CTSAP.DS_SEGMENTO_CLIENTE_SAP,
CTSAP.CD_FORMA_PAGAMENTO,
CTSAP.CD_TIPO_PAGAMENTO,
CTSAP.DS_TIPO_PAGAMENTO,
CTSAP.CD_AGRUPAMENTO,
CTSAP.CD_BLOQUEIO_ENTREGA,
CTSAP.NU_CNPJ,
CTSAP.NU_CPF,
CTSAP.NU_INSCRICAO_ESTADUAL,
CTSAP.NU_INSCRICAO_MUNICIPAL,
CTSAP.NU_CEP,
CTSAP.DS_ENDERECO_RECEBEDOR,
CTSAP.CD_CLIENTE_RECEBEDOR,
CTSAP.NO_CLIENTE_RECEBEDOR,
CTSAP.CD_MOEDA,
CTSAP.CD_SUPPLY_GROUP,
CTSAP.DS_VENDA_COMPARTILHADA,
CTSAP.CD_STATUS_LIBERACAO,
CTSAP.CD_ITEM_PEDIDO,
CTSAP.CD_CLIENTE_PAGADOR,
CTSAP.NO_CLIENTE_PAGADOR,
CTSAP.VL_FRETE_DISTRIBUICAO,
CTSAP.CD_GRUPO_EMBALAGEM,
CTSAP.DS_CREDIT_BLOCK_REASON,
CTSAP.DH_CREDIT_BLOCK,
CTSAP.CD_ITEM_CONTRATO,
CTSAP.DS_ROTEIRO_ENTREGA,
CTSAP.DS_ENDERECO_PAGADOR,
(SELECT PB.NO_SALES_DISTRICT
FROM CTE_SALES_GROUP PB
WHERE PB.CD_SALES_GROUP = CTSAP.CD_SALES_GROUP
AND PB.NU_CARTEIRA_VERSION = CTSAP.NU_CARTEIRA_VERSION
AND ROWNUM =1) NO_SALES_DISTRICT
FROM VND.ELO_CARTEIRA_SAP CTSAP
WHERE
CTSAP.DH_CARTEIRA > (SYSDATE - 30)
;
|
--// Create_Link_table
-- Migration SQL that makes the change goes here.
create table Link (
id varchar(36) not null,
updatedOn bigint unsigned not null default 0,
createdOn bigint unsigned not null default 0,
echoedUserId varchar(36) not null,
partnerId varchar(36) not null,
partnerHandle varchar(36) not null,
partnerSettingsId varchar(36) not null,
storyId varchar(36) not null,
chapterId varchar(36) not null,
url varchar(255) not null,
description varchar(255) null,
pageTitle varchar(255) null,
imageId varchar(36) null,
primary key (id)
);
create index storyId on Link (storyId);
create index chapterId_url on Link (chapterId, url);
create index echoedUserId on Link (echoedUserId);
--//@UNDO
-- SQL to undo the change goes here.
drop table Link;
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `esx_scrap` (
`id` int(11) NOT NULL,
`vehicle` varchar(64) NOT NULL,
`multiplier` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
INSERT INTO `esx_scrap` (`id`, `vehicle`, `multiplier`) VALUES
(1, 'SULTANRS', 5),
(2, 'PANTO', 1),
(3, 'F620', 3),
(4, 'LANDSTAL', 2),
(5, 'Z190', 4);
ALTER TABLE `esx_scrap`
ADD PRIMARY KEY (`id`);
--
ALTER TABLE `esx_scrap`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
COMMIT;
|
DROP TABLE IF EXISTS smth;
-- DROP TABLE CATEGORY
-- DROP TABLE CATEGORY_EVENTS
-- DROP TABLE EVENT
-- DROP TABLE EVENTS_USERS
-- DROP TABLE LOCATION
-- DROP TABLE USER |
ALTER TABLE `log_activity_emails`
MODIFY `created` datetime(6) NOT NULL,
MODIFY `modified` datetime(6) NOT NULL,
MODIFY `messageid` varchar(255) NOT NULL;
|
/**
* SQL for check exist batch warning in table BY_SHISETSU_NYUKO_ERROR
* @author TuyenVHA
* @version $Id: CommonShisetsuService_checkExistBatchWarning_Sel_01.sql 9253 2014-06-28 03:22:15Z p__toen $
*/
SELECT
COUNT(BSNE.NYUKO_ERROR_NO)
FROM
BY_SHISETSU_NYUKO_ERROR BSNE
WHERE
BSNE.SHISETSU_CD = /*shisetsuCd*/'111111111'
AND BSNE.SCREEN_ID = /*screenId*/'BYSH03'
/*IF planId != null && planId != ""*/
AND BSNE.PLAN_ID = /*planId*/'111111111'
/*END*/
/*IF customerVoiceId != null && customerVoiceId != ""*/
AND BSNE.CUSTOMER_VOICE_ID = /*customerVoiceId*/'111111111'
/*END*/
AND BSNE.BATCH_WARN_FLG = '1'
|
-- MySQL dump 10.13 Distrib 5.7.17, for
macos10.12 (x86_64)
--
-- Host: 47.101.183.63 Database: cinema
-- ------------------------------------------------------
-- Server version 5.7.24
/*!40101 SET
@OLD_CHARACTER_SET_CLIENT=@@CHA
RACTER_SET_CLIENT */;
/*!40101 SET
@OLD_CHARACTER_SET_RESULTS=@@CH
ARACTER_SET_RESULTS */;
/*!40101 SET
@OLD_COLLATION_CONNECTION=@@COLL
ATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET
@OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET
@OLD_UNIQUE_CHECKS=@@UNIQUE_CHE
CKS, UNIQUE_CHECKS=0 */;
/*!40014 SET
@OLD_FOREIGN_KEY_CHECKS=@@FOREI
GN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET
@OLD_SQL_MODE=@@SQL_MODE,
SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET
@OLD_SQL_NOTES=@@SQL_NOTES,
SQL_NOTES=0 */;
--
-- Table structure for table `activity`
--
SET @@session.sql_mode
='ONLY_FULL_GROUP_BY,STRICT_TRANS_T
ABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTI
ON';
DROP TABLE IF EXISTS `activity`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activity` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`activity_name` varchar(45) NOT NULL,
`a_description` varchar(255) NOT NULL,
`end_time` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP,
`coupon_id` int(11) DEFAULT NULL,
`start_time` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=5
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `activity`
--
LOCK TABLES `activity` WRITE;
/*!40000 ALTER TABLE `activity` DISABLE
KEYS */;
INSERT INTO `activity` VALUES (2,'春季外卖
节','春季外卖节','2019-04-23 17:55:59',
5,'2019-04-20 17:55:59'),(3,'春季外卖节','春季外
卖节','2019-04-23 17:55:59',6,'2019-04-20
17:55:59'),(4,'测试活动','测试活动','2019-04-26
16:00:00',8,'2019-04-20 16:00:00');
/*!40000 ALTER TABLE `activity` ENABLE KEYS
*/;
UNLOCK TABLES;
---- Table structure for table `activity_movie`
--
DROP TABLE IF EXISTS `activity_movie`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `activity_movie` (
`activity_id` int(11) DEFAULT NULL,
`movie_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT
CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `activity_movie`
--
LOCK TABLES `activity_movie` WRITE;
/*!40000 ALTER TABLE `activity_movie`
DISABLE KEYS */;
INSERT INTO `activity_movie` VALUES (2,10),
(2,11),(2,16),(4,10);
/*!40000 ALTER TABLE `activity_movie`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `coupon`
--
DROP TABLE IF EXISTS `coupon`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`description` varchar(255) DEFAULT NULL,
`name` varchar(45) DEFAULT NULL,
`target_amount` float DEFAULT NULL,`discount_amount` float DEFAULT NULL,
`start_time` timestamp NOT NULL ON UPDATE
CURRENT_TIMESTAMP,
`end_time` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `coupon`
--
LOCK TABLES `coupon` WRITE;
/*!40000 ALTER TABLE `coupon` DISABLE
KEYS */;
INSERT INTO `coupon` VALUES (1,'测试优惠
券','春季电影节',20,5,'2019-04-20
17:47:54','2019-04-23 17:47:59'),(5,'测试优惠
券','品质联盟',30,4,'2019-04-20
21:14:46','2019-04-24 21:14:51'),(6,'春节电影节
优惠券','电影节优惠券',50,10,'2019-04-20
21:15:11','2019-04-21 21:14:56'),(8,'测试优惠
券','123',100,99,'2019-04-20
16:00:00','2019-04-26 16:00:00');
/*!40000 ALTER TABLE `coupon` ENABLE
KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `coupon_user`
--
DROP TABLE IF EXISTS `coupon_user`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupon_user` (
`coupon_id` int(11) NOT NULL,`user_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT
CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `coupon_user`
--
LOCK TABLES `coupon_user` WRITE;
/*!40000 ALTER TABLE `coupon_user` DISABLE
KEYS */;
INSERT INTO `coupon_user` VALUES (8,15),
(5,15),(8,15),(6,15),(5,15),(8,15),(6,15);
/*!40000 ALTER TABLE `coupon_user` ENABLE
KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `hall`
--
DROP TABLE IF EXISTS `hall`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `hall` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`column` int(11) DEFAULT NULL,
`row` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `hall`
--LOCK TABLES `hall` WRITE;
/*!40000 ALTER TABLE `hall` DISABLE KEYS */;
INSERT INTO `hall` VALUES (1,'1号厅',10,5),
(2,'2号厅',12,8);
/*!40000 ALTER TABLE `hall` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `movie`
--
DROP TABLE IF EXISTS `movie`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `movie` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`poster_url` varchar(255) DEFAULT NULL,
`director` varchar(255) DEFAULT NULL,
`screen_writer` varchar(255) DEFAULT NULL,
`starring` varchar(255) DEFAULT NULL,
`type` varchar(255) DEFAULT NULL,
`country` varchar(255) DEFAULT NULL,
`language` varchar(255) DEFAULT NULL,
`length` int(11) NOT NULL,
`start_date` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
`name` varchar(255) NOT NULL,
`description` text,
`status` int(11) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=19
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `movie`
--LOCK TABLES `movie` WRITE;
/*!40000 ALTER TABLE `movie` DISABLE KEYS
*/;
INSERT INTO `movie` VALUES (10,'http://
n.sinaimg.cn/translate/640/w600h840/20190312/
ampL-hufnxfm4278816.jpg','⼤森贵弘 /伊藤秀
樹','','神⾕浩史 /井上和彦 /⾼良健吾 /⼩林沙苗 /泽
城美雪','动画',NULL,NULL,120,'2019-04-14
14:54:31','夏⽬友⼈帐','在⼈与妖怪之间过着忙碌
⽇⼦的夏⽬,偶然与以前的同学结城重逢,由此
回忆起了被妖怪缠身的苦涩记忆。此时,夏⽬认
识了在归还名字的妖怪记忆中出现的⼥性·津村容
莉枝。和玲⼦相识的她,现在和独⼦椋雄⼀同过
着平稳的⽣活。夏⽬通过与他们的交流,⼼境也
变得平和。但这对⺟⼦居住的城镇,却似乎潜伏
着神秘的妖怪。在调查此事归来后,寄⽣于猫咪
⽼师身体的“妖之种”,在藤原家的庭院中,⼀夜之
间就⻓成树结出果实。⽽吃掉了与⾃⼰形状相似
果实的猫咪⽼师,竟然分裂成了3个',0),(11,'','安娜
·波顿',NULL,'布利·拉尔森','动作/冒险/科
幻',NULL,NULL,120,'2019-04-16 14:55:31','惊奇
队⻓','漫画中的初代惊奇⼥⼠曾经是⼀名美国空军
均情报局探员,暗恋惊奇先⽣。。。 ',0),
(12,'','1',NULL,'1','1',NULL,NULL,
120,'2019-04-16 14:57:31','1','1',0),
(13,'2','2',NULL,'2','2',NULL,NULL,
120,'2019-04-16 14:52:31','2','2',0),
(14,'','2',NULL,'2','2',NULL,NULL,
120,'2019-04-18 13:23:15','2','2',1),
(15,'1','1','1','1','1','1','1',111,'2019-04-16
15:00:24','nnmm,,,','1',0),(16,'https://
img3.doubanio.com/view/photo/s_ratio_poster/
public/p2549523952.webp','林孝谦','abcˆ','陈意
涵','爱情','⼤陆',NULL,123,'2019-04-18
13:23:15','⽐悲伤更悲伤的故事','唱⽚制作⼈张哲
凯(刘以豪)和王牌作词⼈宋媛媛(陈意涵)相依为
命,两⼈⾃幼身世坎坷只有彼此为伴,他们是亲⼈、是朋友,也彷佛是命中注定的另⼀半。⽗亲
罹患遗传重症⽽被⺟亲抛弃的哲凯,深怕⾃⼰随
时会发病不久⼈世,始终没有跨出友谊的界线对
媛媛展露爱意。眼⻅哲凯的病情加重,他暗⾃决
定⽤剩余的⽣命完成他们之间的终曲,再为媛媛
找个可以托付⼀⽣的好男⼈。这时,事业有 成温
柔体贴的医⽣(张书豪)适时的出现让他成为照顾媛
媛的最佳⼈选,⼆⼈按部就班发展着关系。⼀切
看似都在哲凯的计划下进⾏。然⽽,故事远⽐这
⾥所写更要悲伤......',1);
/*!40000 ALTER TABLE `movie` ENABLE KEYS
*/;
UNLOCK TABLES;
--
-- Table structure for table `movie_like`
--
DROP TABLE IF EXISTS `movie_like`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `movie_like` (
`movie_id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`like_time` timestamp NULL DEFAULT
CURRENT_TIMESTAMP,
PRIMARY KEY (`movie_id`,`user_id`)
) ENGINE=InnoDB DEFAULT
CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `movie_like`
--
LOCK TABLES `movie_like` WRITE;
/*!40000 ALTER TABLE `movie_like` DISABLE
KEYS */;INSERT INTO `movie_like` VALUES
(10,12,'2019-03-25 02:40:19'),(11,1,'2019-03-22
09:38:12'),(11,2,'2019-03-23 09:38:12'),
(11,3,'2019-03-22 08:38:12'),(12,1,'2019-03-23
09:48:46'),(12,3,'2019-03-25 06:36:22'),
(14,1,'2019-03-23 09:38:12'),(16,12,'2019-03-23
15:27:48');
/*!40000 ALTER TABLE `movie_like` ENABLE
KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `schedule`
--
DROP TABLE IF EXISTS `schedule`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `schedule` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`hall_id` int(11) NOT NULL,
`movie_id` int(11) NOT NULL,
`start_time` timestamp NOT NULL ON UPDATE
CURRENT_TIMESTAMP,
`end_time` timestamp NOT NULL,
`fare` double NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=69
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `schedule`
--
LOCK TABLES `schedule` WRITE;
/*!40000 ALTER TABLE `schedule` DISABLE
KEYS */;
INSERT INTO `schedule` VALUES(20,1,12,'2019-04-13 17:00:00','2019-04-13
18:00:00',20.5),(21,1,10,'2019-04-11
12:00:00','2019-04-11 13:00:00',90),
(27,1,11,'2019-04-17 18:01:00','2019-04-17
20:01:00',20.5),(28,1,11,'2019-04-19
16:00:00','2019-04-19 18:00:00',20.5),
(30,1,11,'2019-04-18 18:01:00','2019-04-18
20:01:00',20.5),(31,1,11,'2019-04-12
16:00:00','2019-04-12 18:00:00',20.5),
(32,1,11,'2019-04-12 20:00:00','2019-04-12
22:00:00',20.5),(37,1,11,'2019-04-15
00:00:00','2019-04-15 02:00:00',20.5),
(38,1,11,'2019-04-14 17:00:00','2019-04-14
19:00:00',20.5),(40,1,10,'2019-04-10
16:00:00','2019-04-10 18:00:00',20.5),
(41,1,11,'2019-04-10 19:00:00','2019-04-10
21:00:00',20.5),(42,1,11,'2019-04-10
22:00:00','2019-04-11 00:00:00',20.5),
(43,1,10,'2019-04-11 01:00:00','2019-04-11
03:00:00',20.5),(44,2,10,'2019-04-11
01:00:00','2019-04-11 03:00:00',20.5),
(45,2,10,'2019-04-10 22:00:00','2019-04-11
00:00:00',20.5),(46,2,11,'2019-04-10
19:00:00','2019-04-10 21:00:00',20.5),
(47,2,11,'2019-04-10 16:00:00','2019-04-10
18:00:00',20.5),(48,2,10,'2019-04-11
13:00:00','2019-04-11 15:59:00',20.5),
(50,1,10,'2019-04-15 16:00:00','2019-04-15
19:00:00',2),(51,1,10,'2019-04-17
05:00:00','2019-04-17 07:00:00',9),
(52,1,10,'2019-04-18 05:00:00','2019-04-18
07:00:00',9),(53,1,16,'2019-04-19
07:00:00','2019-04-19 10:00:00',9),
(54,1,16,'2019-04-16 19:00:00','2019-04-16
22:00:00',9),(55,1,15,'2019-04-17
23:00:00','2019-04-18 01:00:00',9),
(56,2,10,'2019-04-19 13:00:00','2019-04-19
15:59:00',20.5),(57,2,10,'2019-04-20
13:00:00','2019-04-20 15:59:00',20.5),
(58,2,10,'2019-04-21 13:00:00','2019-04-21
15:59:00',20.5),(61,1,13,'2019-04-2011:00:00','2019-04-20 13:00:00',25),
(62,1,11,'2019-04-20 08:00:00','2019-04-20
10:00:00',25),(63,2,15,'2019-04-20
16:01:30','2019-04-21 05:30:00',30),
(64,1,16,'2019-04-22 02:00:00','2019-04-22
05:30:00',30),(65,1,10,'2019-04-23
02:00:00','2019-04-23 05:30:00',30),
(66,2,13,'2019-04-21 07:31:29','2019-04-16
15:59:00',20.5),(67,2,10,'2019-04-25
13:00:00','2019-04-25 15:59:00',20.5),
(68,2,10,'2019-06-26 13:00:00','2019-06-26
15:59:00',20.5);
/*!40000 ALTER TABLE `schedule` ENABLE
KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `ticket`
--
DROP TABLE IF EXISTS `ticket`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticket` (
`user_id` int(11) DEFAULT NULL,
`schedule_id` int(11) DEFAULT NULL,
`column_index` int(11) DEFAULT NULL,
`row_index` int(11) DEFAULT NULL,
`state` tinyint(4) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` timestamp NULL DEFAULT
CURRENT_TIMESTAMP,
`consume` double NOT NULL default 1,
`way` int(11) not null default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=63
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;--
-- Dumping data for table `ticket`
--
LOCK TABLES `ticket` WRITE;
/*!40000 ALTER TABLE `ticket` DISABLE KEYS
*/;
INSERT INTO `ticket`
VALUES(12,50,5,3,2,1,'2019-04-23 13:50:52',
50,1);
/*!40000 ALTER TABLE `ticket` ENABLE KEYS
*/;
UNLOCK TABLES;
--
-- Table structure for table `ticket_refunded`
--
DROP TABLE IF EXISTS `ticket_refunded`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `ticket_refunded` (
`user_id` int(11) DEFAULT NULL,
`schedule_id` int(11) DEFAULT NULL,
`column_index` int(11) DEFAULT NULL,
`row_index` int(11) DEFAULT NULL,
`state` tinyint(4) DEFAULT NULL,
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` timestamp NULL DEFAULT
CURRENT_TIMESTAMP,
`consume` double NOT NULL default 1,
`way` int(11) not null default 0,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=63
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `ticket_refunded`--
LOCK TABLES `ticket_refunded` WRITE;
/*!40000 ALTER TABLE `ticket_refunded`
DISABLE KEYS */;
INSERT INTO `ticket_refunded`
VALUES(12,50,5,3,2,1,'2019-04-23 13:50:52',
50,1);
/*!40000 ALTER TABLE `ticket_refunded`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `user`
--
DROP TABLE IF EXISTS `user`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `user_id_uindex` (`id`),
UNIQUE KEY `user_username_uindex`
(`username`)
) ENGINE=InnoDB AUTO_INCREMENT=16
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `user`
--
LOCK TABLES `user` WRITE;
/*!40000 ALTER TABLE `user` DISABLE KEYS
*/;
INSERT INTO `user` VALUES(1,'testname','123456'),(3,'test','123456'),
(5,'test1','123456'),(7,'test121','123456'),
(8,'root','123456'),(10,'roottt','123123'),
(12,'zhourui','123456'),(13,'abc123','abc123'),
(15,'dd','123');
/*!40000 ALTER TABLE `user` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `view`
--
DROP TABLE IF EXISTS `view`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `view` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`day` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `view`
--
LOCK TABLES `view` WRITE;
/*!40000 ALTER TABLE `view` DISABLE KEYS
*/;
INSERT INTO `view` VALUES (1,30);
/*!40000 ALTER TABLE `view` ENABLE KEYS
*/;
UNLOCK TABLES;
--
-- Table structure for table `vip_card`
--DROP TABLE IF EXISTS `vip_card`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vip_card` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) DEFAULT NULL,
`balance` float DEFAULT NULL,
`join_time` timestamp NOT NULL DEFAULT
CURRENT_TIMESTAMP ON UPDATE
CURRENT_TIMESTAMP,
`consume` double NOT NULL default 0,
PRIMARY KEY (`id`),
UNIQUE KEY `vip_card_user_id_uindex`
(`user_id`)
) ENGINE=InnoDB AUTO_INCREMENT=8
DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client =
@saved_cs_client */;
--
-- Dumping data for table `vip_card`
--
LOCK TABLES `vip_card` WRITE;
/*!40000 ALTER TABLE `vip_card` DISABLE
KEYS */;
INSERT INTO `vip_card` VALUES
(1,15,375,'2019-04-21 13:54:38',50),
(2,12,660,'2019-04-17 18:47:42',50);
/*!40000 ALTER TABLE `vip_card` ENABLE
KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `refund_strategy`
--
DROP TABLE IF EXISTS `refund_strategy`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `refund_strategy`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`refund_percentage` float(9,6) NOT NULL,
`available_time` int(11) NOT NULL,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1
DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `refund_strategy`
--
LOCK TABLES `refund_strategy` WRITE;
/*!40000 ALTER TABLE `refund_strategy`
DISABLE KEYS */;
INSERT INTO `refund_strategy` VALUES
(0,0.85,36000),(null,0.9,86400);
/*!40000 ALTER TABLE `refund_strategy`
ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `vip_activity`
--
DROP TABLE IF EXISTS `vip_activity`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `vip_activity`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`description` varchar(255) DEFAULT NUll,
`cost_in_need` float(9,3) NOT NULL DEFAULT
'0',
`bonus_balance` float(9,3) NOT NULL
DEFAULT '0',
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1
DEFAULT CHARSET=utf8mb4;--
-- Dumping data for table `vip_activity`
--
LOCK TABLES `vip_activity` WRITE;
/*!40000 ALTER TABLE `vip_activity` DISABLE
KEYS */;
INSERT INTO `vip_activity` VALUES (0,"赠送余
额","充值100元送10元",100,10),(null,"赠送余额
2","充值200元送20元",200,30);
/*!40000 ALTER TABLE `vip_activity` ENABLE
KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `manager`
--
DROP TABLE IF EXISTS `manager`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `manager`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` VARCHAR(50) NOT NULL,
`password` VARCHAR(50) NOT NULL,
PRIMARY KEY(`id`),
UNIQUE KEY `user_id_uindex` (`id`),
UNIQUE KEY `user_username_uindex`
(`username`)
)ENGINE=InnoDB AUTO_INCREMENT=1
DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `manager`
--
LOCK TABLES `manager` WRITE;
/*!40000 ALTER TABLE `manager` DISABLEKEYS */;
INSERT INTO `manager` VALUES
(0,"root","root");
/*!40000 ALTER TABLE `manager` ENABLE
KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `chargerecord`
--
DROP TABLE IF EXISTS `chargerecord`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `chargerecord`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL,
`chargetime` TIMESTAMP NOT NULL,
`amount` double NOT NULL,
VIPActivity VARCHAR(255) DEFAULT NULL,
given int(11),
PRIMARY KEY(`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1
DEFAULT CHARSET=utf8mb4;
--
-- Table structure for table `consumerecord`
--
DROP TABLE IF EXISTS `consumerecord`;
/*!40101 SET @saved_cs_client =
@@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `consumerecord`(
`id` int(11) NOT NULL AUTO_INCREMENT,
`userid` int(11) NOT NULL,
`amount` double NOT NULL,`consumetime` TIMESTAMP NOT NULL,
`way` int(11) NOT NULL,
`seat` VARCHAR(255) NOT NULL,
`schedule_id` int(11) NOT NULL,
PRIMARY KEY (`id`)
)ENGINE=InnoDB AUTO_INCREMENT=1
DEFAULT CHARSET=utf8mb4;
--
-- Dumping events for database 'cinema'
--
--
-- Dumping routines for database 'cinema'
--
/*!40103 SET
TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE
*/;
/*!40014 SET
FOREIGN_KEY_CHECKS=@OLD_FOREIGN_
KEY_CHECKS */;
/*!40014 SET
UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS
*/;
/*!40101 SET
CHARACTER_SET_CLIENT=@OLD_CHARAC
TER_SET_CLIENT */;
/*!40101 SET
CHARACTER_SET_RESULTS=@OLD_CHARA
CTER_SET_RESULTS */;
/*!40101 SET
COLLATION_CONNECTION=@OLD_COLLATI
ON_CONNECTION */;
/*!40111 SET
SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2019-04-24 21:20:52 |
CREATE OR REPLACE VIEW DIALOG_STATUS AS (
SELECT
d.dialog_id,
aktor_id,
CASE WHEN lest_av_bruker_tid >= NVL(MAX(h.sendt), lest_av_bruker_tid) THEN 1 ELSE 0 END as lest_av_bruker,
CASE WHEN lest_av_veileder_tid >= NVL(MAX(h.sendt), lest_av_veileder_tid) THEN 1 ELSE 0 END as lest_av_veileder,
CASE WHEN skal_vente_pa_svar > 0 AND siste_status_endring >= NVL(MAX(bh.sendt), siste_status_endring) THEN 1 ELSE 0 END as venter_pa_svar,
CASE WHEN markert_som_ferdigbehandlet > 0 AND siste_status_endring >= NVL(MAX(bh.sendt), siste_status_endring) THEN 1 ELSE 0 END as ferdigbehandlet,
GREATEST(siste_status_endring, NVL(MAX(h.sendt), siste_status_endring)) as siste_endring
FROM DIALOG d
LEFT JOIN HENVENDELSE bh ON (d.DIALOG_ID = bh.DIALOG_ID AND bh.avsender_type = 'BRUKER')
LEFT JOIN HENVENDELSE h ON d.DIALOG_ID = h.DIALOG_ID
GROUP BY d.dialog_id, aktor_id, lest_av_bruker_tid, lest_av_veileder_tid, markert_som_ferdigbehandlet, skal_vente_pa_svar, siste_status_endring
);
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 23 déc. 2020 à 15:13
-- Version du serveur : 10.4.10-MariaDB
-- Version de PHP : 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `badel`
--
-- --------------------------------------------------------
--
-- Structure de la table `loginadmin`
--
DROP TABLE IF EXISTS `loginadmin`;
CREATE TABLE IF NOT EXISTS `loginadmin` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`prenom` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`nom` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`Sexe` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`pseudo` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`Role` int(3) NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Déchargement des données de la table `loginadmin`
--
INSERT INTO `loginadmin` (`Id`, `prenom`, `nom`, `Sexe`, `pseudo`, `password`, `Role`) VALUES
(1, 'Médoune Siby Georges', 'Baldé', 'Mr', 'MSGB', '123456', 1);
-- --------------------------------------------------------
--
-- Structure de la table `p1demandeurcollectif`
--
DROP TABLE IF EXISTS `p1demandeurcollectif`;
CREATE TABLE IF NOT EXISTS `p1demandeurcollectif` (
`idDC` int(20) NOT NULL AUTO_INCREMENT,
`formulaire_id` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`titre` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`nat_juridique` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`denomination` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`reconnaisance_juridique` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`pays` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`region` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`departement` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`commune` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`hors_senegal` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`date_creation` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`total_membre` int(255) NOT NULL,
`total_homme` int(255) NOT NULL,
`total_femme` int(255) NOT NULL,
PRIMARY KEY (`idDC`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Déchargement des données de la table `p1demandeurcollectif`
--
INSERT INTO `p1demandeurcollectif` (`idDC`, `formulaire_id`, `titre`, `nat_juridique`, `denomination`, `reconnaisance_juridique`, `pays`, `region`, `departement`, `commune`, `hors_senegal`, `date_creation`, `total_membre`, `total_homme`, `total_femme`) VALUES
(1, 'Form1607902907275', 'responsable_morale', 'gpf', 'SenDeveloppeur', 'oui', 'Sénégal', 'Dakar', 'Guédiawaye', 'Golf Sud', 'hello', '2020-12-13', 3, 3, 0);
-- --------------------------------------------------------
--
-- Structure de la table `p1demandeurindividuel`
--
DROP TABLE IF EXISTS `p1demandeurindividuel`;
CREATE TABLE IF NOT EXISTS `p1demandeurindividuel` (
`idDI` int(20) NOT NULL AUTO_INCREMENT,
`formulaire_id` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`prenom` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`nom` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`tel1` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`tel2` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`commune_rattach` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`commune_actuelle` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`sexe` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`tranche_age` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`etude` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`niveau_etude` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`formation_prof` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`sejour` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`pays_sejourne` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`motif_sejour` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`experience_prof` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`domaine_exp_prof` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`duree_exp_prof` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`statut_exp_prof` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`commune_exp_prof` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`departement_exp_prof` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`region_exp_prof` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`autre_region_exp_prof` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`hors_senegal` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`situation_prof` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`titre_accompagnement` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`idDI`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Structure de la table `p2demandeurcollectif`
--
DROP TABLE IF EXISTS `p2demandeurcollectif`;
CREATE TABLE IF NOT EXISTS `p2demandeurcollectif` (
`idDC` int(20) NOT NULL AUTO_INCREMENT,
`formulaire_id` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`activ_equip` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`activ_equip_depart` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`activ_equip_region` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`activ_equip_autre_region` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`activ_equip_hors_senegal` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`activ_economique` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`fonctionnalite` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`prise_decision` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`charte_relationnelle` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`plan_developpement` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`manuel_procedure` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`part_princ_technique` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`part_princ_financier` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`app_reseau` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`nature_reseau` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`localite_reseau` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`departement_reseau` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`international_reseau` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`mont_cap_social` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`nbre_empl_perman` varchar(1000) COLLATE utf8_unicode_ci NOT NULL,
`nbre_empl_tempor` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`mont_eparg_mob` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`mont_endettement` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`mont_sub_recu` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`idDC`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Déchargement des données de la table `p2demandeurcollectif`
--
INSERT INTO `p2demandeurcollectif` (`idDC`, `formulaire_id`, `activ_equip`, `activ_equip_depart`, `activ_equip_region`, `activ_equip_autre_region`, `activ_equip_hors_senegal`, `activ_economique`, `fonctionnalite`, `prise_decision`, `charte_relationnelle`, `plan_developpement`, `manuel_procedure`, `part_princ_technique`, `part_princ_financier`, `app_reseau`, `nature_reseau`, `localite_reseau`, `departement_reseau`, `international_reseau`, `mont_cap_social`, `nbre_empl_perman`, `nbre_empl_tempor`, `mont_eparg_mob`, `mont_endettement`, `mont_sub_recu`) VALUES
(2, NULL, 'OUI', 'DAKAR', 'DAKAR', 'AUSTRALIEZ', 'OECANIE', 'Epargne', 'OUI', 'VOTE', 'OUI', 'OUI', 'OUI', 'PNUD', 'ENDA', 'OUI', 'ORGANISME', 'GOSHH', 'BRECHEuit', 'national', '1.111.200', '12', '500', '12.000.056', '2.548.656', '25.265.541');
-- --------------------------------------------------------
--
-- Structure de la table `p2demandeurindividuel`
--
DROP TABLE IF EXISTS `p2demandeurindividuel`;
CREATE TABLE IF NOT EXISTS `p2demandeurindividuel` (
`idDI` int(20) NOT NULL AUTO_INCREMENT,
`formulaire_id` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`categories` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`sous_categories` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`parcours` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`marqueurs` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`idDI`),
KEY `idDI` (`idDI`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Structure de la table `p3demandeurindividuel`
--
DROP TABLE IF EXISTS `p3demandeurindividuel`;
CREATE TABLE IF NOT EXISTS `p3demandeurindividuel` (
`idDI` int(20) NOT NULL AUTO_INCREMENT,
`formulaire_id` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`soutien_immediat` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`regi_commerce` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`numero_regi_comm` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`ninea` varchar(10) COLLATE utf8_unicode_ci DEFAULT NULL,
`numero_ninea` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`reference_prof` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`numero_reference_prof` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`compte_bancaire_sfd` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`nom_banque_sfd` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`numero_compte_banque_sfd` varchar(1000) COLLATE utf8_unicode_ci DEFAULT NULL,
`soutien_parent` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`ville_parent` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
`pays_parent` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`idDI`),
KEY `idDI` (`idDI`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
ALTER TABLE Employee
ADD CONSTRAINT Employee_Superssn_FK
FOREIGN KEY(superssn)
REFERENCES Employee(SSN)
ON DELETE SET NULL;
|
ALTER TABLE `users_history` DROP INDEX `users_history_user_id_358ca354_fk_users_id`;
|
INSERT into math_expression (expression, result) VALUES ('(1+2)*3', 9.0);
|
CREATE PROC [ERP].[Usp_Sel_Cuenta]
@IdEmpresa INT
AS
BEGIN
SELECT C.ID,
C.Nombre,
E.ID IdEntidad,
ETD.NumeroDocumento,
B.ID IdBanco,
E.Nombre NombreBanco,
M.ID IdMoneda,
M.Nombre NombreMoneda,
IdTipoCuenta,
TC.Nombre NombreTipoCuenta,
C.IdPlanCuenta,
PC.CuentaContable,
ISNULL(C.MostrarEnFE, 0) MostrarEnFE
FROM ERP.Cuenta C
INNER JOIN ERP.Entidad E ON E.ID = C.IdEntidad
LEFT JOIN ERP.EntidadTipoDocumento ETD ON ETD.IdEntidad = E.ID
LEFT JOIN PLE.T3Banco B ON B.IdEntidad = C.IdEntidad
INNER JOIN Maestro.Moneda M ON M.ID = C.IdMoneda
INNER JOIN Maestro.TipoCuenta TC ON TC.ID = C.IdTipoCuenta
LEFT JOIN ERP.PlanCuenta PC ON PC.ID = C.IdPlanCuenta
WHERE C.IdEmpresa = @IdEmpresa AND C.FlagBorrador = 0 AND C.FLAG = 1
END |
-- this is joining tables and columns to have a small and concise table
select CONCAT(s.FirstName,' ', s.LastName) as 'Name', c.Description as 'Class'
from student s
join Schedule sc
on s.Id = sc.StudentId
join class c
on c.Id = sc.ClassId
where s.FirstName = 'Aaron'
and s.LastName = 'Zell' |
INSERT INTO [StaticModel].[Benefits] ([BenefitId], [Name], [ObjectDocument], [ObjectHash]) VALUES
(106109, 'Adventure Activities','{}', 0),
(106121, 'Business Class Cruise','{}', 0),
(106122, 'Business Class Cruise- Domestic','{}', 0),
(106103, 'Business equipment','{}', 0),
(106106, 'Cruise ','{}', 0),
(106112, 'Cruise - Domestic','{}', 0),
(106105, 'Golf hire equipment','{}', 0),
(106104, 'Luggage Cover','{}', 0),
(106110, 'Search & Rescue ','{}', 0),
(106108, 'Trip Cancellation','{}', 0),
(106107, 'Winter Sports ','{}', 0),
(106113, 'Winter Sports- Domestic','{}', 0)
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.0
-- Dumped by pg_dump version 10.0
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: assign; Type: SCHEMA; Schema: -; Owner: postgres
--
CREATE SCHEMA assign;
ALTER SCHEMA assign OWNER TO postgres;
SET search_path = assign, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: project; Type: TABLE; Schema: assign; Owner: postgres
--
CREATE TABLE project (
id integer NOT NULL,
name character varying(100) NOT NULL,
description character varying(300),
quota integer
);
ALTER TABLE project OWNER TO postgres;
--
-- Name: project_id_seq; Type: SEQUENCE; Schema: assign; Owner: postgres
--
CREATE SEQUENCE project_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE project_id_seq OWNER TO postgres;
--
-- Name: project_id_seq; Type: SEQUENCE OWNED BY; Schema: assign; Owner: postgres
--
ALTER SEQUENCE project_id_seq OWNED BY project.id;
--
-- Name: projectskill; Type: TABLE; Schema: assign; Owner: postgres
--
CREATE TABLE projectskill (
projectid integer NOT NULL,
skillid integer NOT NULL
);
ALTER TABLE projectskill OWNER TO postgres;
--
-- Name: skill; Type: TABLE; Schema: assign; Owner: postgres
--
CREATE TABLE skill (
id integer NOT NULL,
name character varying(100) NOT NULL
);
ALTER TABLE skill OWNER TO postgres;
--
-- Name: skill_id_seq; Type: SEQUENCE; Schema: assign; Owner: postgres
--
CREATE SEQUENCE skill_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE skill_id_seq OWNER TO postgres;
--
-- Name: skill_id_seq; Type: SEQUENCE OWNED BY; Schema: assign; Owner: postgres
--
ALTER SEQUENCE skill_id_seq OWNED BY skill.id;
--
-- Name: student; Type: TABLE; Schema: assign; Owner: postgres
--
CREATE TABLE student (
id integer NOT NULL,
name character varying NOT NULL,
projectid integer
);
ALTER TABLE student OWNER TO postgres;
--
-- Name: student_id_seq; Type: SEQUENCE; Schema: assign; Owner: postgres
--
CREATE SEQUENCE student_id_seq
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE student_id_seq OWNER TO postgres;
--
-- Name: student_id_seq; Type: SEQUENCE OWNED BY; Schema: assign; Owner: postgres
--
ALTER SEQUENCE student_id_seq OWNED BY student.id;
--
-- Name: studentskill; Type: TABLE; Schema: assign; Owner: postgres
--
CREATE TABLE studentskill (
studentid integer NOT NULL,
skillid integer NOT NULL
);
ALTER TABLE studentskill OWNER TO postgres;
--
-- Name: project id; Type: DEFAULT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY project ALTER COLUMN id SET DEFAULT nextval('project_id_seq'::regclass);
--
-- Name: skill id; Type: DEFAULT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY skill ALTER COLUMN id SET DEFAULT nextval('skill_id_seq'::regclass);
--
-- Name: student id; Type: DEFAULT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY student ALTER COLUMN id SET DEFAULT nextval('student_id_seq'::regclass);
--
-- Data for Name: project; Type: TABLE DATA; Schema: assign; Owner: postgres
--
COPY project (id, name, description, quota) FROM stdin;
2 PROJ829V another exciting description 4
1 PROJ38U project description 3
\.
--
-- Data for Name: projectskill; Type: TABLE DATA; Schema: assign; Owner: postgres
--
COPY projectskill (projectid, skillid) FROM stdin;
1 5
1 3
2 3
2 4
2 6
2 7
\.
--
-- Data for Name: skill; Type: TABLE DATA; Schema: assign; Owner: postgres
--
COPY skill (id, name) FROM stdin;
1 Data structures and algorithms
2 Computation theory
3 Formal methods
4 Computer architecture
5 Computer networks
6 Distributed systems
7 Computer graphics
8 Security & cryptography
9 Artificial intelligence
\.
--
-- Data for Name: student; Type: TABLE DATA; Schema: assign; Owner: postgres
--
COPY student (id, name, projectid) FROM stdin;
2 Amelia Cojocaru 1
1 Tudor Gradinaru 1
3 Denis Priboi 2
\.
--
-- Data for Name: studentskill; Type: TABLE DATA; Schema: assign; Owner: postgres
--
COPY studentskill (studentid, skillid) FROM stdin;
1 3
1 5
2 4
2 1
2 7
3 5
\.
--
-- Name: project_id_seq; Type: SEQUENCE SET; Schema: assign; Owner: postgres
--
SELECT pg_catalog.setval('project_id_seq', 2, true);
--
-- Name: skill_id_seq; Type: SEQUENCE SET; Schema: assign; Owner: postgres
--
SELECT pg_catalog.setval('skill_id_seq', 9, true);
--
-- Name: student_id_seq; Type: SEQUENCE SET; Schema: assign; Owner: postgres
--
SELECT pg_catalog.setval('student_id_seq', 3, true);
--
-- Name: project project_pkey; Type: CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY project
ADD CONSTRAINT project_pkey PRIMARY KEY (id);
--
-- Name: skill skill_pkey; Type: CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY skill
ADD CONSTRAINT skill_pkey PRIMARY KEY (id);
--
-- Name: student student_pkey; Type: CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY student
ADD CONSTRAINT student_pkey PRIMARY KEY (id);
--
-- Name: student project_fkey; Type: FK CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY student
ADD CONSTRAINT project_fkey FOREIGN KEY (projectid) REFERENCES project(id);
--
-- Name: projectskill project_fkey; Type: FK CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY projectskill
ADD CONSTRAINT project_fkey FOREIGN KEY (projectid) REFERENCES project(id);
--
-- Name: projectskill skill_fkey; Type: FK CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY projectskill
ADD CONSTRAINT skill_fkey FOREIGN KEY (skillid) REFERENCES skill(id);
--
-- Name: studentskill skill_fkey; Type: FK CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY studentskill
ADD CONSTRAINT skill_fkey FOREIGN KEY (skillid) REFERENCES skill(id);
--
-- Name: studentskill student_fkey; Type: FK CONSTRAINT; Schema: assign; Owner: postgres
--
ALTER TABLE ONLY studentskill
ADD CONSTRAINT student_fkey FOREIGN KEY (studentid) REFERENCES student(id);
--
-- PostgreSQL database dump complete
--
|
CREATE TABLE IF NOT EXISTS `twitter_details` (
`iUserID` INT NOT NULL,
`cDescription` VARCHAR(255) DEFAULT NULL,
`iFollowers` SMALLINT DEFAULT 0,
`iFollowing` SMALLINT DEFAULT 0,
`cImage` TEXT DEFAULT NULL,
`cLocation` VARCHAR(80) DEFAULT NULL,
PRIMARY KEY (`iUserID`)
);
CREATE TABLE IF NOT EXISTS `twitter_tweets` (
`iTweetID` BIGINT NOT NULL,
`iUserID` INT NOT NULL,
`cTweet` VARCHAR(140),
`iReTweet` SMALLINT DEFAULT 0,
`cScreenName` VARCHAR(32) DEFAULT NULL,
`tsTime` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`iTweetID`)
);
ALTER TABLE twitter DROP COLUMN description, DROP COLUMN status, DROP COLUMN followers, DROP COLUMN location; |
DELIMITER /
ALTER TABLE PERSON_SIGNATURE_MODULE
ADD CONSTRAINT FK_PERSON_SIGNATURE_ID
FOREIGN KEY (PERSON_SIGNATURE_ID)
REFERENCES PERSON_SIGNATURE (PERSON_SIGNATURE_ID)
/
DELIMITER ;
|
DROP DATABASE IF EXISTS `phalcon_sample`;
CREATE DATABASE `phalcon_sample`;
use `phalcon_sample`;
SET NAMES 'utf8';
CREATE TABLE `session` (
`session_id` varchar(35) NOT NULL,
`data` text NOT NULL,
`created_at` int(15) unsigned NOT NULL,
`modified_at` int(15) unsigned DEFAULT NULL,
PRIMARY KEY (`session_id`)
);
CREATE TABLE `group` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`enabled` BOOLEAN NOT NULL,
`name` VARCHAR(64) NOT NULL,
`info` VARCHAR(255) NULL,
`roles` TEXT,
`created_at` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE `user` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`enabled` BOOLEAN NOT NULL,
`suspended` BOOLEAN NOT NULL,
`gender` ENUM('male', 'female', 'unknown', 'both') NOT NULL,
`first_name` VARCHAR(64) NOT NULL,
`last_name` VARCHAR(64) NOT NULL,
`info` TEXT NULL,
`email` VARCHAR(128) NOT NULL,
`password` VARCHAR(128) NOT NULL,
`roles` TEXT,
`created_at` DATETIME DEFAULT NULL,
`expires_at` DATE DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1024 COLLATE=utf8_unicode_ci;
CREATE TABLE `company` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`enabled` BOOLEAN NOT NULL,
`slug` VARCHAR(255) NULL,
`name` VARCHAR(255) NOT NULL,
`initial` CHAR(1) NOT NULL,
`info` TEXT NULL,
`created_at` DATETIME DEFAULT NULL,
`updated_at` DATETIME DEFAULT NULL,
INDEX(`enabled`),
INDEX(`initial`),
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=3072 COLLATE=utf8_unicode_ci;
CREATE TABLE `company_revenue` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`company_id` INT UNSIGNED NOT NULL,
`workers_count` INT UNSIGNED NOT NULL,
`revenue` DECIMAL(10, 2) NOT NULL,
FOREIGN KEY fk_company_revenue_company_id (`company_id`) REFERENCES `company` (`id`) ON DELETE CASCADE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
CREATE TABLE `user_group` (
`user_id` INT UNSIGNED NOT NULL,
`group_id` INT UNSIGNED NOT NULL,
`created_at` TIMESTAMP NOT NULL,
FOREIGN KEY fk_user_group_user_id (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE,
FOREIGN KEY fk_user_group_group_id (`group_id`) REFERENCES `group` (`id`) ON DELETE CASCADE,
PRIMARY KEY (`user_id`, `group_id`)
) ENGINE=InnoDB;
INSERT INTO `user` (`id`, `enabled`, `roles`, `gender`, `first_name`, `last_name`, `info`, `email`, `password`, `created_at`) VALUES
(1, 1, '["ROLE_SUPERADMIN"]', 'unknown', 'User', 'System', 'System user.', 'system@enovative.pl', md5(RAND()), NOW()),
(2, 1, '["ROLE_USER"]', 'unknown', 'User', 'Test', 'Test user.', 'system@enovative.pl', md5(RAND()), NOW()),
(null, 1, '["ROLE_USER"]', 'male', 'Jacek', 'Siciarek', null, 'siciarek@gmail.com', md5('HelloWorld2014'), NOW())
;
INSERT INTO `group` (`enabled`, `name`, `info`, `roles`, `created_at`) VALUES
(1, 'Guests', 'Read only visitors.', '["ROLE_GUEST"]', NOW()),
(1, 'Users', 'Registered users.', '["ROLE_USER"]', NOW()),
(1, 'Editors', 'Articles editors.', '["ROLE_EDITOR"]', NOW()),
(1, 'Reviewers', 'Articles reviewers.', '["ROLE_REVIEWER"]', NOW()),
(1, 'Admins', 'System administrators.', '["ROLE_ADMIN"]', NOW()),
(1, 'Superadmins', 'System superadministrators.', '["ROLE_SUPERADMIN"]', NOW())
;
INSERT INTO `user_group` (`user_id`, `group_id`) VALUES
(1024, 2),
(1024, 5),
(1024, 6)
;
SHOW CREATE TABLE `company_revenue`\G |
DROP TABLE IF EXISTS USERS;
CREATE TABLE USERS(
userId varchar(12) NOT NULL ,
password varchar(12) NOT NULL ,
name varchar(20) NOT NULL ,
email varchar(50) ,
PRIMARY KEY (userId)
);
INSERT INTO USERS VALUES('nightbobo', 'nightbobo' , '보보형' , 'nightbobo@gmail.net'); |
use PHARMACY
create table discount(
id_discount int not null,
name_disc nvarchar(20) unique,
percent_discount int not null
constraint PK_discount primary key (id_discount)
)
create table [client-disc](
id_dis int not null,
id_client int not null,
date_start date,
date_end date,
constraint PK_c_d primary key (id_dis,id_client),
constraint FK_C foreign key ([id_client]) references [client]([id_client]),
constraint FK_d foreign key ([id_dis]) references [discount]([id_discount]),
)
|
--Consultas
--La Vista de turnos, se utiliza para poder ver dia y horario de los turnos asignados, asi como paciente, especialidad
--y Medico que lo atendera. Tambien dice el Telefono por si hubiera que llamarlo para confirmar el turno, o modificarlo.
--Por ultimo tiene el campo activo para ver si el paciente esta en condiciones administrativas para ser atendido.
--En caso de que al consultar diga que no esta activo, se procedera a llamarlo para informarle.
--Dentro de esta vista podriamos agregarle los parametros que necesitemos, por ejemplo los turnos del dia,
--o de un periodo determinado
Create View Vw_Turnos
as
select
T.Fecha_Hora,
M.Especialidad,
M.Nombre_Medico,
M.Apellido_Medico,
P.Nombre_Paciente,
P.Apellido_Paciente,
C.Nombre_Cobertura,
P.Telefono_Paciente,
P.Activo
from Turnos T
INNER JOIN Pacientes P
ON P.IdPaciente=T.IdPaciente
INNER JOIN Medicos M
ON M.IdMedico=T.IdMedico
INNER JOIN Coberturas C
ON C.IdCobertura=P.IdCobertura
select * from Vw_Turnos
select * from Vw_Turnos where Fecha_Hora='2019-12-07 10:20:00.000'
--La Vista de los medicos sirve para consultar el staff medico , con sus especialidades y el tel de contacto
--Puede consultarte por un medico en especifico, o por la especialidad requerida.
Create View Vw_Medicos
as
select
M.Nombre_Medico,
M.Apellido_Medico,
M.Fecha_Alta,
M.Especialidad,
M.Telefono_Medico,
U.Descripcion_Usuario
from Medicos M
INNER JOIN Usuarios U
ON U.IdUsuario=M.IdUsuario
select * from Vw_Medicos
select * from Vw_Medicos where Especialidad = 'Fisiatria'
select * from Vw_Medicos where Nombre_Medico = 'Juan'
--Esta vista sirve para ver el estado de las coberturas de los pacientes que tienen turno asignado.
--Por ejemplo, podria darse que una cobertura deje de tener convenio y por lo tanto con esta vista puede ver
--claramente quien es el paciente y cuando tendra el turno y si la cobertura se dio de baja, que no es lo mismo que
--el paciente este o no activo, que eso ya es extra cobertura.
drop View Vw_Coberturas_Pacientes
Create View Vw_Coberturas_Pacientes
as
select
C.Activo,
C.Nombre_Cobertura,
P.Nombre_Paciente,
P.Apellido_Paciente,
P.Telefono_Paciente,
T.Fecha_Hora
from Pacientes P
INNER JOIN Coberturas C
ON C.IdCobertura= P.IdCobertura
INNER JOIN Turnos T
ON T.IdPaciente=P.IdPaciente
select * from Vw_Coberturas_Pacientes
--La vista de auditoria permite ver la fecha, tabla y accion realizadas.
--Es mas comodo que realizar soolo un selec ya que solo muestra la accion concreta y la tabla afectada.
--puede filtrase por tabla o por accion en caso de ser necesario
Create View Vw_Auditoria
as
select
AG.Fecha,
AG.Accion,
AG.Tabla
from Auditoria_General AG
select * from Vw_Auditoria
select * from Vw_Auditoria where Accion= 'BAJA'
--La vista de Permisos Usuarios permite consultar las acciones que pueden realizar los distintos usuarios
--Puede consultarse uno en especifico o todos.
drop View Vw_Permiso_Usuario
Create View Vw_Permiso_Usuario
as
select
U.Descripcion_Usuario,
M.Descripcion_Menu,
M.Activo
from Usuarios U
INNER JOIN Usuarios_Permisos UP
ON UP.IdUsuario=U.IdUsuario
INNER JOIN Permisos P
ON P.IdPermiso=UP.IdPermiso
INNER JOIN Menu_Permisos MP
ON MP.IdPermiso=P.IdPermiso
INNER JOIN Menu M
ON M.IdMenu=MP.IdMenu
select * from Vw_Permiso_Usuario
where Descripcion_Usuario = 'SECRETARIA'
select * from Vw_Permiso_Usuario
where Descripcion_Usuario = 'PACIENTE' |
delete from "PlanGroup";
/* Data for the 'public.PlanGroup' table (Records 1 - 3) */
INSERT INTO public."PlanGroup" ("PlanGroupID", "Name", "Description", "ParentID", "HasSameGlobalPaymentMethodForAllPlans")
VALUES (1, E'SCP Plans', NULL, NULL, False);
INSERT INTO public."PlanGroup" ("PlanGroupID", "Name", "Description", "ParentID", "HasSameGlobalPaymentMethodForAllPlans")
VALUES (2, E'BEC Support Plans', NULL, NULL, False);
INSERT INTO public."PlanGroup" ("PlanGroupID", "Name", "Description", "ParentID", "HasSameGlobalPaymentMethodForAllPlans")
VALUES (3, E'Supplier Plans', NULL, NULL, False); |
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.4
-- Dumped by pg_dump version 10.4
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner: -
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: addition_resource; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.addition_resource (
res_uuid uuid NOT NULL,
master text NOT NULL,
project_uuid uuid NOT NULL,
phase_uuid uuid,
filename text NOT NULL,
description text NOT NULL,
file_addr text NOT NULL
);
--
-- Name: enrol_project; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.enrol_project (
email text NOT NULL,
project_uuid uuid NOT NULL,
user_type text NOT NULL,
mark integer
);
--
-- Name: group_relation; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.group_relation (
email text NOT NULL,
group_uuid uuid NOT NULL,
mem_type integer NOT NULL
);
--
-- Name: groups; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.groups (
group_uuid uuid NOT NULL,
group_name text NOT NULL,
project_uuid uuid NOT NULL,
description text,
mark double precision
);
--
-- Name: managements; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.managements (
email text NOT NULL,
group_uuid uuid NOT NULL
);
--
-- Name: phases; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.phases (
phase_uuid uuid NOT NULL,
project_uuid uuid NOT NULL,
phase_index integer NOT NULL,
phase_name text NOT NULL,
deadline timestamp(0) with time zone NOT NULL,
mark_release timestamp(0) with time zone,
submit_require integer NOT NULL,
spec_address text
);
--
-- Name: projects; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.projects (
project_uuid uuid NOT NULL,
master text NOT NULL,
project_name text NOT NULL,
deadline timestamp(0) with time zone NOT NULL,
mark_release timestamp(0) with time zone,
spec_address text,
group_method integer NOT NULL
);
--
-- Name: reminder; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.reminder (
reminder_uuid uuid NOT NULL,
master text NOT NULL,
project_uuid uuid NOT NULL,
ass_uuid uuid NOT NULL,
message text,
submit_check text NOT NULL,
post_time timestamp(0) with time zone NOT NULL
);
--
-- Name: submits; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.submits (
submit_uuid uuid NOT NULL,
group_uuid uuid NOT NULL,
ass_uuid uuid NOT NULL,
file_address text NOT NULL,
submit_time timestamp(0) with time zone NOT NULL,
mark double precision
);
--
-- Name: tasks; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.tasks (
task_uuid uuid NOT NULL,
phase_uuid uuid NOT NULL,
task_name text NOT NULL,
deadline timestamp(0) with time zone NOT NULL,
mark_release timestamp(0) with time zone,
submit_require integer NOT NULL,
spec_address text
);
--
-- Name: user_info; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.user_info (
email text NOT NULL,
password text NOT NULL,
name text NOT NULL,
gender text,
dob text,
user_type text NOT NULL,
photo text
);
--
-- Data for Name: addition_resource; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.addition_resource (res_uuid, master, project_uuid, phase_uuid, filename, description, file_addr) FROM stdin;
\.
--
-- Data for Name: enrol_project; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.enrol_project (email, project_uuid, user_type, mark) FROM stdin;
student1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student2@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student3@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student4@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student5@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student6@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student7@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student8@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student9@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student10@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
lam@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
martin@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
gelbero@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
thomas@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
roy@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
tremblay@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
byrne@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
brown@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
linda@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
barbara@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
susan@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
margaret@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
jessica@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
sarah@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
murphy@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
jones@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
williams@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
taylor@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
davies@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
wilson@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
evans@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
roberts@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
smith@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
walsh@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
noah@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
jack@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
harry@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
jacob@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
charlie@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
george@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
oscar@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
james@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
william@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
connor@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
callum@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
kyle@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
joe@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
reece@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
rhys@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
damian@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
liam@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
mason@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
ethan@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
michael@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
alexander@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
daniel@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
john@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
robert@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
david@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 student \N
student1@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 student \N
\.
--
-- Data for Name: group_relation; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.group_relation (email, group_uuid, mem_type) FROM stdin;
student10@gmail.com a5351b8a-c967-11e8-aca2-4c3275989ef5 0
lam@gmail.com 115b390f-f50e-4a39-9002-8bb160e2e476 0
martin@gmail.com 115b390f-f50e-4a39-9002-8bb160e2e476 1
gelbero@gmail.com 115b390f-f50e-4a39-9002-8bb160e2e476 1
thomas@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 0
roy@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 1
tremblay@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 1
byrne@gmail.com d59ee857-c394-420d-9d49-ad160448b676 0
brown@gmail.com d59ee857-c394-420d-9d49-ad160448b676 1
linda@gmail.com d59ee857-c394-420d-9d49-ad160448b676 1
murphy@gmail.com 1aadf9c6-123b-4090-b209-ece1891e4467 0
evans@gmail.com 1aadf9c6-123b-4090-b209-ece1891e4467 1
wilson@gmail.com 1aadf9c6-123b-4090-b209-ece1891e4467 1
barbara@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 1
susan@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 1
margaret@gmail.com 115b390f-f50e-4a39-9002-8bb160e2e476 1
jessica@gmail.com 115b390f-f50e-4a39-9002-8bb160e2e476 1
sarah@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 1
jones@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 1
williams@gmail.com 370f053f-68db-4d2e-975b-bc566eed449a 1
taylor@gmail.com d59ee857-c394-420d-9d49-ad160448b676 1
davies@gmail.com 1aadf9c6-123b-4090-b209-ece1891e4467 1
roberts@gmail.com a5351b8a-c967-11e8-aca2-4c3275989ef5 1
smith@gmail.com a5351b8a-c967-11e8-aca2-4c3275989ef5 1
student1@gmail.com a5351b8a-c967-11e8-aca2-4c3275989ef5 1
connor@gmail.com ed4773ec-d681-11e8-8421-4c32759e2eb9 1
joe@gmail.com ed4773ec-d681-11e8-8421-4c32759e2eb9 1
noah@gmail.com ed4773ec-d681-11e8-8421-4c32759e2eb9 1
student2@gmail.com ed4773ec-d681-11e8-8421-4c32759e2eb9 1
charlie@gmail.com ed47fb3a-d681-11e8-8c00-4c32759e2eb9 1
jacob@gmail.com ed47fb3a-d681-11e8-8c00-4c32759e2eb9 1
george@gmail.com ed47fb3a-d681-11e8-8c00-4c32759e2eb9 1
student6@gmail.com ed47fb3a-d681-11e8-8c00-4c32759e2eb9 1
oscar@gmail.com ed488f28-d681-11e8-9944-4c32759e2eb9 1
michael@gmail.com ed488f28-d681-11e8-9944-4c32759e2eb9 1
jack@gmail.com ed488f28-d681-11e8-9944-4c32759e2eb9 1
student3@gmail.com ed488f28-d681-11e8-9944-4c32759e2eb9 1
damian@gmail.com ed490c70-d681-11e8-b7b3-4c32759e2eb9 1
john@gmail.com ed490c70-d681-11e8-b7b3-4c32759e2eb9 1
rhys@gmail.com ed490c70-d681-11e8-b7b3-4c32759e2eb9 1
kyle@gmail.com ed490c70-d681-11e8-b7b3-4c32759e2eb9 1
ethan@gmail.com ed490c70-d681-11e8-b7b3-4c32759e2eb9 1
harry@gmail.com ed498308-d681-11e8-96c1-4c32759e2eb9 1
student5@gmail.com ed498308-d681-11e8-96c1-4c32759e2eb9 1
william@gmail.com ed498308-d681-11e8-96c1-4c32759e2eb9 1
walsh@gmail.com ed498308-d681-11e8-96c1-4c32759e2eb9 1
student4@gmail.com ed49e424-d681-11e8-9da0-4c32759e2eb9 1
student8@gmail.com ed49e424-d681-11e8-9da0-4c32759e2eb9 1
alexander@gmail.com ed49e424-d681-11e8-9da0-4c32759e2eb9 1
robert@gmail.com ed49e424-d681-11e8-9da0-4c32759e2eb9 1
liam@gmail.com ed4a42b6-d681-11e8-988d-4c32759e2eb9 1
student9@gmail.com ed4a42b6-d681-11e8-988d-4c32759e2eb9 1
student7@gmail.com ed4a42b6-d681-11e8-988d-4c32759e2eb9 1
david@gmail.com ed4a42b6-d681-11e8-988d-4c32759e2eb9 1
callum@gmail.com ed4a42b6-d681-11e8-988d-4c32759e2eb9 1
james@gmail.com ed4aeedc-d681-11e8-97f8-4c32759e2eb9 1
reece@gmail.com ed4aeedc-d681-11e8-97f8-4c32759e2eb9 1
mason@gmail.com ed4aeedc-d681-11e8-97f8-4c32759e2eb9 1
daniel@gmail.com ed4aeedc-d681-11e8-97f8-4c32759e2eb9 1
student1@gmail.com ed47fb3a-d681-11e8-8c00-4c32759e2eb9 1
\.
--
-- Data for Name: groups; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.groups (group_uuid, group_name, project_uuid, description, mark) FROM stdin;
115b390f-f50e-4a39-9002-8bb160e2e476 Club Win. 04a676cc-c968-11e8-b2f6-4c3275989ef5 Fight coding! \N
370f053f-68db-4d2e-975b-bc566eed449a Hustle & Flo. 04a676cc-c968-11e8-b2f6-4c3275989ef5 Fight coding! \N
d59ee857-c394-420d-9d49-ad160448b676 Mental Toss Flycoons. 04a676cc-c968-11e8-b2f6-4c3275989ef5 New star \N
1aadf9c6-123b-4090-b209-ece1891e4467 Wonder Women. 04a676cc-c968-11e8-b2f6-4c3275989ef5 fire on the hole \N
a5351b8a-c967-11e8-aca2-4c3275989ef5 First Group 04a676cc-c968-11e8-b2f6-4c3275989ef5 MEAN stack \N
ed4773ec-d681-11e8-8421-4c32759e2eb9 Group 1 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 1 \N
ed47fb3a-d681-11e8-8c00-4c32759e2eb9 Group 2 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 2 \N
ed488f28-d681-11e8-9944-4c32759e2eb9 Group 3 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 3 \N
ed490c70-d681-11e8-b7b3-4c32759e2eb9 Group 4 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 4 \N
ed498308-d681-11e8-96c1-4c32759e2eb9 Group 5 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 5 \N
ed49e424-d681-11e8-9da0-4c32759e2eb9 Group 6 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 6 \N
ed4a42b6-d681-11e8-988d-4c32759e2eb9 Group 7 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 7 \N
ed4aeedc-d681-11e8-97f8-4c32759e2eb9 Group 8 a5259728-c967-11e8-8220-4c3275989ef5 COMP9323 Project group 8 \N
\.
--
-- Data for Name: managements; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.managements (email, group_uuid) FROM stdin;
\.
--
-- Data for Name: phases; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.phases (phase_uuid, project_uuid, phase_index, phase_name, deadline, mark_release, submit_require, spec_address) FROM stdin;
04aabee4-c968-11e8-8dc6-4c3275989ef5 04a676cc-c968-11e8-b2f6-4c3275989ef5 1 Project Scoping & Group forming 2018-10-12 10:59:59+11 2018-10-13 11:00:00+11 0 None
a528cb28-c967-11e8-9304-4c3275989ef5 a5259728-c967-11e8-8220-4c3275989ef5 1 Initiation 2018-10-21 10:59:59+11 2018-10-21 11:00:00+11 0 None
a52b99de-c967-11e8-9bd2-4c3275989ef5 a5259728-c967-11e8-8220-4c3275989ef5 2 Planning 2018-10-26 10:59:59+11 2018-10-26 11:00:00+11 0 None
a52e00d4-c967-11e8-8949-4c3275989ef5 a5259728-c967-11e8-8220-4c3275989ef5 3 Execution 2018-10-30 10:59:59+11 2018-10-30 11:00:00+11 0 None
a53111fa-c967-11e8-93b0-4c3275989ef5 a5259728-c967-11e8-8220-4c3275989ef5 4 Closure 2018-11-03 10:59:59+11 2018-11-05 11:00:00+11 0 None
04adb2b6-c968-11e8-9522-4c3275989ef5 04a676cc-c968-11e8-b2f6-4c3275989ef5 2 Requirement document & Design document 2018-10-14 10:59:59+11 2018-10-15 11:00:00+11 0 None
04b1cd58-c968-11e8-8192-4c3275989ef5 04a676cc-c968-11e8-b2f6-4c3275989ef5 3 Software prototyping & Implementation 2018-10-16 10:59:59+11 2018-10-17 11:00:00+11 0 None
04b4dac8-c968-11e8-bc21-4c3275989ef5 04a676cc-c968-11e8-b2f6-4c3275989ef5 4 Implementation & Testing & Documentation 2018-10-18 10:59:59+11 2018-10-20 11:00:00+11 0 None
\.
--
-- Data for Name: projects; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.projects (project_uuid, master, project_name, deadline, mark_release, spec_address, group_method) FROM stdin;
04a676cc-c968-11e8-b2f6-4c3275989ef5 lecturer2@gmail.com COMP9900 Project 2018-10-21 10:59:59+11 2018-10-25 11:00:00+11 None 0
a5259728-c967-11e8-8220-4c3275989ef5 lecturer1@gmail.com COMP9323 Project 2018-10-21 10:59:59+11 2018-10-25 11:00:00+11 None 1
\.
--
-- Data for Name: reminder; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.reminder (reminder_uuid, master, project_uuid, ass_uuid, message, submit_check, post_time) FROM stdin;
e6aef29a-ca23-11e8-8c13-4c3275989ef5 lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a529fd7a-c967-11e8-a7be-4c3275989ef5 Task one proposal due soon. no 2018-10-17 22:26:57+11
e6b15800-ca23-11e8-be86-4c3275989ef5 lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a529fd7a-c967-11e8-a7be-4c3275989ef5 Task one proposal due soon, you have not submit. yes 2018-10-17 22:26:57+11
5cc5cde1-b608-4dde-ae8e-7583164fb808 lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a53257cc-c967-11e8-9495-4c3275989ef5 Task closed, no more submission accpected yes 2018-10-20 22:26:57+11
450a43be-0c38-41eb-9ca4-3ebae905b736 lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a53257cc-c967-11e8-9495-4c3275989ef5 Excels at developing programs yes 2018-10-20 22:26:57+11
610273b7-3100-42a4-a2a9-c7e6d95fac62 lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a53257cc-c967-11e8-9495-4c3275989ef5 Keeps documents organized via google drive to avoid duplicate information yes 2018-10-12 22:26:57+11
b6c36550-d678-11e8-a5a6-4c32759e2eb9 lecturer2@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 04a676cc-c968-11e8-b2f6-4c3275989ef5 Welcome to COMP3900 (Computer Science Project) / COMP9900 (Information Technology Project). See you all in our first lecture on Tuesday 24 July 2018 at 10am in Chemical Sc M18 (K-F10-M18). no 2018-10-09 10:59:59+11
8527db3a-d677-11e8-bb3e-4c32759e2eb9 lecturer2@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 04ac2358-c968-11e8-a538-4c3275989ef5 This is to let you know of the following: I just added the sample project proposal I discussed in the class to the Week 2 lecture slides. You have now two project proposal samples. These are by no means perfect. You should aim at doing better than that. Please have a look at them by opening the updated lecture Week 2 slides. Secondly, the Project Proposal Submission link is now available. Please see the right part of the course website on WebCMS3 for Upcoming Due Dates. There is one item "Project Proposal Submission" which is due 11-10-2018. yes 2018-10-11 10:59:59+11
b50ad708-d677-11e8-8c6d-4c32759e2eb9 lecturer2@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 04afe482-c968-11e8-8423-4c3275989ef5 This is to let you know that extra useful information about Topic 2 (e-portfolio) has been provided. You can find it under Project>Topics.\nPlease do have a look at this important information while working on your project proposal.\nIf you have any questions, please post them in the Forums under Project/Topics/Topic 2. no 2018-10-12 10:59:59+11
07883426-d678-11e8-8307-4c32759e2eb9 lecturer2@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 04b30358-c968-11e8-802b-4c3275989ef5 No COMP3900/COMP9900 Labs on 14-10-2018\nInformation about make-up sessions for M16A and M18A teams (some sessions are also open to T16A) is posted. no 2018-10-14 10:59:59+11
2b786536-d678-11e8-92d5-4c32759e2eb9 lecturer2@gmail.com 04a676cc-c968-11e8-b2f6-4c3275989ef5 04b6bc30-c968-11e8-af25-4c3275989ef5 Dear Students,\nThis is a gentle reminder of Project final Demo Starting from Mon15, Oct 2018. The Demo Schedule can be found in resource tab.\nSubmission links are up, please read the submission instructions carefully.\nGood Luck no 2018-10-17 10:59:59+11
5e6c4ec2-5d7c-44e0-a0cf-1d948df8afe3 lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a5259728-c967-11e8-8220-4c3275989ef5 Phase modification, read instructions. no 2018-10-09 22:26:57+11
f0891b0e-d920-4993-9e5a-d27f470c5f8e lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a5259728-c967-11e8-8220-4c3275989ef5 Achieves optimal levels of performance and accomplishment no 2018-10-10 22:26:57+11
be980096-58c0-4664-b600-4f40833013ec lecturer1@gmail.com a5259728-c967-11e8-8220-4c3275989ef5 a5259728-c967-11e8-8220-4c3275989ef5 Exceeded the original goal of TASK by 80% through methods given in class no 2018-10-11 22:26:57+11
\.
--
-- Data for Name: submits; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.submits (submit_uuid, group_uuid, ass_uuid, file_address, submit_time, mark) FROM stdin;
6a1a77ae-d680-11e8-bdc8-4c32759e2eb9 a5351b8a-c967-11e8-aca2-4c3275989ef5 04b6bc30-c968-11e8-af25-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270765.pdf 2018-10-23 15:59:25+11 84
77df641c-d680-11e8-9a9a-4c32759e2eb9 115b390f-f50e-4a39-9002-8bb160e2e476 04b30358-c968-11e8-802b-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270789.pdf 2018-10-23 15:59:49+11 40
d191b3f4-d67b-11e8-a870-4c32759e2eb9 370f053f-68db-4d2e-975b-bc566eed449a 04ac2358-c968-11e8-a538-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540268792.pdf 2018-10-23 15:26:32+11 60
f6e17502-d67b-11e8-a72b-4c32759e2eb9 d59ee857-c394-420d-9d49-ad160448b676 04ac2358-c968-11e8-a538-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540269072.pdf 2018-10-23 15:31:12+11 74
9acdff64-d67c-11e8-8afe-4c32759e2eb9 1aadf9c6-123b-4090-b209-ece1891e4467 04ac2358-c968-11e8-a538-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540269129.pdf 2018-10-23 15:32:09+11 81
693da730-d67a-11e8-b4a9-4c32759e2eb9 a5351b8a-c967-11e8-aca2-4c3275989ef5 04ac2358-c968-11e8-a538-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540268187.pdf 2018-10-23 15:16:27+11 90
b87e4986-d67b-11e8-8b5b-4c32759e2eb9 115b390f-f50e-4a39-9002-8bb160e2e476 04ac2358-c968-11e8-a538-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540268749.pdf 2018-10-23 15:25:49+11 90
14776e1a-d680-11e8-9121-4c32759e2eb9 115b390f-f50e-4a39-9002-8bb160e2e476 04afe482-c968-11e8-8423-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270622.pdf 2018-10-23 15:57:02+11 74
250c324c-d680-11e8-bad9-4c32759e2eb9 370f053f-68db-4d2e-975b-bc566eed449a 04afe482-c968-11e8-8423-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270650.pdf 2018-10-23 15:57:30+11 69
34b44a06-d680-11e8-8c16-4c32759e2eb9 d59ee857-c394-420d-9d49-ad160448b676 04afe482-c968-11e8-8423-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270676.pdf 2018-10-23 15:57:56+11 80
449e72b4-d680-11e8-b017-4c32759e2eb9 1aadf9c6-123b-4090-b209-ece1891e4467 04afe482-c968-11e8-8423-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270703.pdf 2018-10-23 15:58:23+11 76
04daef0c-d680-11e8-8a4e-4c32759e2eb9 a5351b8a-c967-11e8-aca2-4c3275989ef5 04afe482-c968-11e8-8423-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270596.pdf 2018-10-23 15:56:36+11 86
ad5d5fde-d682-11e8-96f4-4c32759e2eb9 ed49e424-d681-11e8-9da0-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271737.pdf 2018-10-23 16:15:37+11 74
911d39f4-d680-11e8-b333-4c32759e2eb9 370f053f-68db-4d2e-975b-bc566eed449a 04b30358-c968-11e8-802b-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270831.pdf 2018-10-23 16:00:31+11 75
c7e53630-d680-11e8-be6f-4c32759e2eb9 d59ee857-c394-420d-9d49-ad160448b676 04b30358-c968-11e8-802b-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270923.pdf 2018-10-23 16:02:03+11 69
4c141f8a-d680-11e8-a2a5-4c32759e2eb9 1aadf9c6-123b-4090-b209-ece1891e4467 04b30358-c968-11e8-802b-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270715.pdf 2018-10-23 15:58:35+11 73
61dc4cde-d680-11e8-8060-4c32759e2eb9 a5351b8a-c967-11e8-aca2-4c3275989ef5 04b30358-c968-11e8-802b-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270752.pdf 2018-10-23 15:59:12+11 87
7db6101e-d680-11e8-a2b4-4c32759e2eb9 115b390f-f50e-4a39-9002-8bb160e2e476 04b6bc30-c968-11e8-af25-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270798.pdf 2018-10-23 15:59:58+11 55
9a1510e8-d680-11e8-b1f5-4c32759e2eb9 370f053f-68db-4d2e-975b-bc566eed449a 04b6bc30-c968-11e8-af25-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270846.pdf 2018-10-23 16:00:46+11 67
cefafba8-d680-11e8-91c2-4c32759e2eb9 d59ee857-c394-420d-9d49-ad160448b676 04b6bc30-c968-11e8-af25-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270935.pdf 2018-10-23 16:02:15+11 72
5264e068-d680-11e8-b31e-4c32759e2eb9 1aadf9c6-123b-4090-b209-ece1891e4467 04b6bc30-c968-11e8-af25-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540270726.pdf 2018-10-23 15:58:46+11 76
2c5681c2-d682-11e8-903f-4c32759e2eb9 ed4773ec-d681-11e8-8421-4c32759e2eb9 a52cf4be-c967-11e8-8b38-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271521.pdf 2018-10-23 16:12:01+11 \N
321bff7e-d682-11e8-8589-4c32759e2eb9 ed4773ec-d681-11e8-8421-4c32759e2eb9 2733b150-c9ea-11e8-94ac-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271530.pdf 2018-10-23 16:12:10+11 \N
558f12c0-d682-11e8-8774-4c32759e2eb9 ed47fb3a-d681-11e8-8c00-4c32759e2eb9 2733b150-c9ea-11e8-94ac-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271590.pdf 2018-10-23 16:13:10+11 \N
6a7b7c50-d682-11e8-941f-4c32759e2eb9 ed488f28-d681-11e8-9944-4c32759e2eb9 a52cf4be-c967-11e8-8b38-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271625.pdf 2018-10-23 16:13:45+11 \N
833c01d8-d682-11e8-b5f2-4c32759e2eb9 ed490c70-d681-11e8-b7b3-4c32759e2eb9 2733b150-c9ea-11e8-94ac-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271667.pdf 2018-10-23 16:14:27+11 \N
89f95bf6-d682-11e8-8d45-4c32759e2eb9 ed490c70-d681-11e8-b7b3-4c32759e2eb9 a52cf4be-c967-11e8-8b38-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271678.pdf 2018-10-23 16:14:38+11 \N
b2aa907e-d682-11e8-a834-4c32759e2eb9 ed49e424-d681-11e8-9da0-4c32759e2eb9 a52cf4be-c967-11e8-8b38-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271746.pdf 2018-10-23 16:15:46+11 \N
2568fb7e-d682-11e8-9195-4c32759e2eb9 ed4773ec-d681-11e8-8421-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271509.pdf 2018-10-23 16:11:49+11 55
4ec88c98-d682-11e8-b96d-4c32759e2eb9 ed47fb3a-d681-11e8-8c00-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271579.pdf 2018-10-23 16:12:59+11 86
64b41dae-d682-11e8-9ae9-4c32759e2eb9 ed488f28-d681-11e8-9944-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271615.pdf 2018-10-23 16:13:35+11 69
f9bdf1fe-d682-11e8-99f3-4c32759e2eb9 ed4a42b6-d681-11e8-988d-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 None 2018-10-23 16:17:46+11 0
7ce7de9c-d682-11e8-b437-4c32759e2eb9 ed490c70-d681-11e8-b7b3-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271656.pdf 2018-10-23 16:14:16+11 76
9beec99a-d682-11e8-96a9-4c32759e2eb9 ed498308-d681-11e8-96c1-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271708.pdf 2018-10-23 16:15:08+11 79
c341f0c6-d682-11e8-be7a-4c32759e2eb9 ed4aeedc-d681-11e8-97f8-4c32759e2eb9 a529fd7a-c967-11e8-a7be-4c3275989ef5 /Users/alex/Documents/9323/Project-based-learning-Management-App/temp/1540271774.pdf 2018-10-23 16:16:14+11 82
\.
--
-- Data for Name: tasks; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.tasks (task_uuid, phase_uuid, task_name, deadline, mark_release, submit_require, spec_address) FROM stdin;
a529fd7a-c967-11e8-a7be-4c3275989ef5 a528cb28-c967-11e8-9304-4c3275989ef5 Proposal 2018-10-21 10:59:59+11 2018-10-21 11:00:00+11 1 None
a52cf4be-c967-11e8-8b38-4c3275989ef5 a52b99de-c967-11e8-9bd2-4c3275989ef5 Requirement document 2018-10-26 10:59:59+11 2018-10-26 11:00:00+11 1 None
2733b150-c9ea-11e8-94ac-4c3275989ef5 a52b99de-c967-11e8-9bd2-4c3275989ef5 Design document 2018-10-26 10:59:59+11 2018-10-26 11:00:00+11 1 None
a52fa206-c967-11e8-989a-4c3275989ef5 a52e00d4-c967-11e8-8949-4c3275989ef5 Implementation 2018-10-30 10:59:59+11 2018-10-30 11:00:00+11 1 None
a53257cc-c967-11e8-9495-4c3275989ef5 a53111fa-c967-11e8-93b0-4c3275989ef5 Demo 2018-11-03 10:59:59+11 2018-11-05 11:00:00+11 1 None
04ac2358-c968-11e8-a538-4c3275989ef5 04aabee4-c968-11e8-8dc6-4c3275989ef5 Proposal 2018-10-12 10:59:59+11 2018-10-13 11:00:00+11 1 None
04afe482-c968-11e8-8423-4c3275989ef5 04adb2b6-c968-11e8-9522-4c3275989ef5 Design document 2018-10-14 10:59:59+11 2018-10-15 11:00:00+11 1 None
04b30358-c968-11e8-802b-4c3275989ef5 04b1cd58-c968-11e8-8192-4c3275989ef5 Implementation 2018-10-16 10:59:59+11 2018-10-17 11:00:00+11 1 None
04b6bc30-c968-11e8-af25-4c3275989ef5 04b4dac8-c968-11e8-bc21-4c3275989ef5 Demo 2018-10-18 10:59:59+11 2018-10-20 11:00:00+11 1 None
\.
--
-- Data for Name: user_info; Type: TABLE DATA; Schema: public; Owner: -
--
COPY public.user_info (email, password, name, gender, dob, user_type, photo) FROM stdin;
lecturer1@gmail.com 123456 Emma female October 05 lecturer None
lecturer2@gmail.com 123456 James male October 05 lecturer None
mentor1@gmail.com 123456 Mary female October 05 mentor None
mentor2@gmail.com 123456 Allen male October 05 mentor None
student1@gmail.com 123456 Alex male October 05 student None
student2@gmail.com 123456 John male October 05 student None
student3@gmail.com 123456 Olivia female October 05 student None
student4@gmail.com 123456 Kevin male October 05 student None
student5@gmail.com 123456 Rose female October 05 student None
student6@gmail.com 123456 Jeanne female October 05 student None
student7@gmail.com 123456 Charles male October 05 student None
student8@gmail.com 123456 Shirley female October 05 student None
student9@gmail.com 123456 Robert male October 05 student None
student10@gmail.com 123456 Angel female October 05 student None
noah@gmail.com 123456 Noah male October 05 student None
jack@gmail.com 123456 Jack male October 05 student None
harry@gmail.com 123456 Harry male October 05 student None
jacob@gmail.com 123456 Jacob male October 05 student None
charlie@gmail.com 123456 Charlie male October 05 student None
thomas@gmail.com 123456 Thomas male October 05 student None
george@gmail.com 123456 George male October 05 student None
oscar@gmail.com 123456 Oscar male October 05 student None
james@gmail.com 123456 James male October 05 student None
william@gmail.com 123456 William male October 05 student None
connor@gmail.com 123456 Connor male October 05 student None
callum@gmail.com 123456 Callum male October 05 student None
kyle@gmail.com 123456 Kyle male October 05 student None
joe@gmail.com 123456 Joe male October 05 student None
reece@gmail.com 123456 Reece male October 05 student None
rhys@gmail.com 123456 Rhys male October 05 student None
damian@gmail.com 123456 Damian male October 05 student None
liam@gmail.com 123456 Liam male October 05 student None
mason@gmail.com 123456 Mason male October 05 student None
ethan@gmail.com 123456 Ethan male October 05 student None
michael@gmail.com 123456 Michael male October 05 student None
alexander@gmail.com 123456 Alexander male October 05 student None
daniel@gmail.com 123456 Daniel male October 05 student None
john@gmail.com 123456 John male October 05 student None
robert@gmail.com 123456 Robert male October 05 student None
david@gmail.com 123456 David male October 05 student None
linda@gmail.com 123456 Linda female October 05 student None
barbara@gmail.com 123456 Barbara female October 05 student None
susan@gmail.com 123456 Susan female October 05 student None
margaret@gmail.com 123456 Margaret female October 05 student None
jessica@gmail.com 123456 Jessica female October 05 student None
sarah@gmail.com 123456 Sarah female October 05 student None
murphy@gmail.com 123456 Murphy female October 05 student None
jones@gmail.com 123456 Jones female October 05 student None
williams@gmail.com 123456 Williams female October 05 student None
brown@gmail.com 123456 Brown female October 05 student None
taylor@gmail.com 123456 Taylor female October 05 student None
davies@gmail.com 123456 Davies female October 05 student None
wilson@gmail.com 123456 Wilson female October 05 student None
evans@gmail.com 123456 Evans female October 05 student None
tom@gmail.com 123456 Tom male October 05 student None
roberts@gmail.com 123456 Roberts female October 05 student None
smith@gmail.com 123456 Smith female October 05 student None
walsh@gmail.com 123456 Walsh female October 05 student None
byrne@gmail.com 123456 Byrne female October 05 student None
lam@gmail.com 123456 Lam female October 05 student None
martin@gmail.com 123456 Martin female October 05 student None
\.
--
-- Name: addition_resource addition_resource_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.addition_resource
ADD CONSTRAINT addition_resource_pkey PRIMARY KEY (res_uuid);
--
-- Name: group_relation group_relation_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.group_relation
ADD CONSTRAINT group_relation_pkey PRIMARY KEY (email, group_uuid);
--
-- Name: groups groups_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.groups
ADD CONSTRAINT groups_pkey PRIMARY KEY (group_uuid);
--
-- Name: managements managements_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.managements
ADD CONSTRAINT managements_pkey PRIMARY KEY (email, group_uuid);
--
-- Name: phases phases_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.phases
ADD CONSTRAINT phases_pkey PRIMARY KEY (phase_uuid);
--
-- Name: projects projects_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.projects
ADD CONSTRAINT projects_pkey PRIMARY KEY (project_uuid);
--
-- Name: reminder reminder_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.reminder
ADD CONSTRAINT reminder_pkey PRIMARY KEY (reminder_uuid);
--
-- Name: submits submits_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.submits
ADD CONSTRAINT submits_pkey PRIMARY KEY (submit_uuid);
--
-- Name: tasks tasks_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.tasks
ADD CONSTRAINT tasks_pkey PRIMARY KEY (task_uuid);
--
-- Name: user_info user_info_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.user_info
ADD CONSTRAINT user_info_pkey PRIMARY KEY (email);
--
-- PostgreSQL database dump complete
--
|
select ssn, lname, salary
from jmendoza.employee
where salary > (select avg(salary)
from jmendoza.employee)
and
dno in (select dno
from jmendoza.employee
where lower(lname) like '%n%')
|
CREATE TABLE users_new (
id SERIAL PRIMARY KEY,
username TEXT,
password varchar(40),
favNum integer,
price decimal,
class1 varchar(40),
degree varchar(40),
pie float,
name VARCHAR,
email VARCHAR
);
insert into users_new (
id,
username,
password,
favNum,
price,
class1,
degree,
pie,
name,
email
) VALUES(
1,
'faltherr',
'trees',
32,
1.00,
'bio1',
'biology',
3.14159,
'forest altherr',
'falther@goob.com'
);
insert into users_new (
id,
username,
password,
favNum,
price,
class1,
degree,
pie,
name,
email
) VALUES(
3,
'daphne',
'hairstyle',
11,
1.31,
'bio1',
'chemistry',
3.1,
'Daphne',
'MysterVan@goob.com'
);
-- create table backpack(
-- id serial,
-- backpackID VARCHAR(40),
-- item1 text,
-- item2 text
-- )
-- ALTER TABLE users_new ADD COLUMN packID INTEGER;
-- ALTER TABLE backpack ADD COLUMN uniquePack serial primary key
-- ALTER TABLE users_new
-- ADD CONSTRAINT fk_backpack
-- FOREIGN KEY (packID)
-- REFERENCES backpack(uniquePack);
-- select * from backpack
-- create table instructors (
-- id serial primary key,
-- subject varchar(20),
-- experience integer
-- )
-- insert into instructors(id, subject, experience) VALUES(1, 'math', 7);
-- insert into instructors(id, subject, experience) VALUES(2, 'science', 7);
-- insert into instructors(id, subject, experience) VALUES(3, 'english', 6);
-- insert into instructors(id, subject, experience) VALUES(4, 'math', 7);
-- insert into instructors(id, subject, experience) VALUES(5, 'biology', 6);
-- MANY TO MANY
-- create table student_teacher_junction
-- (
-- student_id int,
-- instructor_id int,
-- CONSTRAINT stdnt_prof_pk PRIMARY KEY (student_id, instructor_id),
-- CONSTRAINT FK_student
-- FOREIGN KEY (student_id) REFERENCES users_new (id),
-- CONSTRAINT FK_instructor
-- FOREIGN KEY (instructor_id) REFERENCES instructors (id)
-- );
-- insert into student_teacher_junction VALUES (1,1), (2,3), (1,2)
-- Select from many to many
-- SELECT *
-- FROM users_new as s
-- INNER JOIN student_teacher_junction as j
-- ON s.id = j.student_id
-- INNER JOIN instructors as i
-- Subquerrry competency
-- SELECT sub.*
-- FROM( SELECT *
-- FROM users_new
-- WHERE class1 = 'bio1'
-- )sub
-- WHERE degree = 'math' |
-- phpMyAdmin SQL Dump
-- version 4.3.1
-- http://www.phpmyadmin.net
--
-- Počítač: 127.0.0.1
-- Vytvořeno: Čtv 08. led 2015, 17:03
-- Verze serveru: 5.6.17
-- Verze PHP: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Databáze: `quatrofin`
--
-- --------------------------------------------------------
--
-- Struktura tabulky `diskuze`
--
CREATE TABLE IF NOT EXISTS `diskuze` (
`id` int(255) NOT NULL,
`jmeno` varchar(30) COLLATE utf8_czech_ci NOT NULL,
`email` varchar(50) COLLATE utf8_czech_ci NOT NULL,
`cas` datetime NOT NULL,
`text` varchar(500) COLLATE utf8_czech_ci NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
--
-- Vypisuji data pro tabulku `diskuze`
--
INSERT INTO `diskuze` (`id`, `jmeno`, `email`, `cas`, `text`) VALUES
(1, 'Milan Růžička', 'milda.ruzicka@gmail.com', '2014-12-10 21:53:51', 'Vítejte na našich stránkách... :-) Zde se můžete ptát na cokoliv co Vás napadne. Jestliže se zaregistrujete můžete využít i soukromé zprávy přímo Našim poradcům.'),
(2, 'Karel', 'karel@gmail.com', '2014-12-10 21:57:10', 'Dobrý den, nemohu reagovat (odpovídat) na Dotazy statních... Kde je chyba?? Děkuji Karel'),
(3, 'Lenka', 'sdflenka@seznam.cz', '2014-12-10 22:10:48', 'Dobrý den, líbí se mi Vaše stránky a jelikož potřebuji pro svou firmu taky nějaké, chtěla bych člověka co vám je dělal...'),
(4, 'Bohumil Vzácný', 'vzacny@quatrofin.cz', '2014-12-10 22:13:46', 'Chtěl bych Vám všem nabídnout bla bla. Prostě něco co tu bude napasný...');
-- --------------------------------------------------------
--
-- Struktura tabulky `odpoved`
--
CREATE TABLE IF NOT EXISTS `odpoved` (
`id` int(255) NOT NULL,
`cas` datetime NOT NULL,
`text` varchar(500) COLLATE utf8_czech_ci NOT NULL,
`diskuze_id` int(255) NOT NULL,
`uzivatel_id` int(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
--
-- Vypisuji data pro tabulku `odpoved`
--
INSERT INTO `odpoved` (`id`, `cas`, `text`, `diskuze_id`, `uzivatel_id`) VALUES
(1, '2014-12-10 21:58:51', 'Dobrý den, musíte mít autorizovaný učet. Při registraci Vám přišel email s autorizačním odkazem, jestliže se Vám někde zatoulal, můžete si z nabídky "Můj účet" zaslat nový autorizační odkaz!', 2, 2),
(2, '2014-12-10 22:11:20', 'Jsem to k Vašim službám... pište mi do soukromých zpráv, děkuji! :-)', 3, 1),
(3, '2014-12-10 22:12:51', 'Paráda! :-)', 1, 3),
(4, '2014-12-15 14:16:46', ':-) :-) :-)', 1, 1);
-- --------------------------------------------------------
--
-- Struktura tabulky `prijemce`
--
CREATE TABLE IF NOT EXISTS `prijemce` (
`uzivatel_id` int(255) NOT NULL,
`zprava_id` int(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
--
-- Vypisuji data pro tabulku `prijemce`
--
INSERT INTO `prijemce` (`uzivatel_id`, `zprava_id`) VALUES
(1, 14),
(2, 15),
(5, 16),
(3, 17),
(4, 18),
(6, 19),
(7, 20),
(8, 21);
-- --------------------------------------------------------
--
-- Struktura tabulky `uzivatel`
--
CREATE TABLE IF NOT EXISTS `uzivatel` (
`id` int(255) NOT NULL,
`jmeno` varchar(30) COLLATE utf8_czech_ci NOT NULL,
`email` varchar(50) COLLATE utf8_czech_ci NOT NULL,
`heslo` varchar(200) COLLATE utf8_czech_ci NOT NULL,
`telefon` int(9) NOT NULL,
`typ_uctu` varchar(10) COLLATE utf8_czech_ci NOT NULL,
`autorizace` varchar(30) COLLATE utf8_czech_ci NOT NULL,
`ban` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
--
-- Vypisuji data pro tabulku `uzivatel`
--
INSERT INTO `uzivatel` (`id`, `jmeno`, `email`, `heslo`, `telefon`, `typ_uctu`, `autorizace`, `ban`) VALUES
(1, 'Milan Růžička', 'milda.ruzicka@gmail.com', 'af48f6b133945b2d659cbbbd8818a8de', 603355187, 'admin', '1', 0),
(2, 'Bohumil Vzácný', 'vzacny@quatrofin.cz', 'af48f6b133945b2d659cbbbd8818a8de', 777222333, 'admin', '1', 0),
(3, 'Václav', 'vasek@seznam.cz', 'af48f6b133945b2d659cbbbd8818a8de', 0, 'user', '1', 0),
(4, 'Karel', 'karel@gmail.com', 'af48f6b133945b2d659cbbbd8818a8de', 660934534, 'user', '04IqmmBZ7wQXiAJqRFeMvYT8BHxi7r', 0),
(5, 'Jitka Zajímavá', 'zajimava@guatrofin.cz', 'af48f6b133945b2d659cbbbd8818a8de', 0, 'admin', '1', 0),
(6, 'Ladislav Nový', 'novyl@atlas.cz', 'af48f6b133945b2d659cbbbd8818a8de', 343534635, 'user', '1', 0),
(7, 'Lucka S.', 'luciess@gmail.com', 'af48f6b133945b2d659cbbbd8818a8de', 0, 'user', 'aQlsGreYOqcfpbgI88OG3MpGrWRLBw', 1),
(8, 'Lenka', 'sdflenka@seznam.cz', 'af48f6b133945b2d659cbbbd8818a8de', 345345345, 'user', 'PH5LiTJq53QkYNjL9YYkilRPOLGRRU', 0),
(9, 'Dominik', 'domca@seznam.cz', 'af48f6b133945b2d659cbbbd8818a8de', 0, 'user', 'pSKmPsgo16tRoiMqfAMV7c1Y5sbcbL', 0);
-- --------------------------------------------------------
--
-- Struktura tabulky `zprava`
--
CREATE TABLE IF NOT EXISTS `zprava` (
`id` int(255) NOT NULL,
`cas` datetime NOT NULL,
`predmet` varchar(30) COLLATE utf8_czech_ci NOT NULL,
`text` varchar(1000) COLLATE utf8_czech_ci NOT NULL,
`kod_zpravy` varchar(20) COLLATE utf8_czech_ci NOT NULL,
`uzivatel_id` int(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci;
--
-- Vypisuji data pro tabulku `zprava`
--
INSERT INTO `zprava` (`id`, `cas`, `predmet`, `text`, `kod_zpravy`, `uzivatel_id`) VALUES
(14, '2014-12-15 11:57:12', 'Zkouška admin', ' dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh ', 'odeslano', 1),
(15, '2014-12-15 11:57:12', 'Zkouška admin', ' dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh ', 'odeslano', 1),
(16, '2014-12-15 11:57:12', 'Zkouška admin', ' dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh dfg s hgsgh sgh ', 'odeslano', 1),
(17, '2014-12-15 12:01:06', 'Zkouška user', '46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř ', 'odeslano', 2),
(18, '2014-12-15 12:01:06', 'Zkouška user', '46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř ', 'odeslano', 2),
(19, '2014-12-15 12:01:07', 'Zkouška user', '46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř ', 'odeslano', 2),
(20, '2014-12-15 12:01:07', 'Zkouška user', '46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř ', 'odeslano', 2),
(21, '2014-12-15 12:01:07', 'Zkouška user', '46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř 46334 řžččšř ', 'odeslano', 2);
--
-- Klíče pro exportované tabulky
--
--
-- Klíče pro tabulku `diskuze`
--
ALTER TABLE `diskuze`
ADD PRIMARY KEY (`id`);
--
-- Klíče pro tabulku `odpoved`
--
ALTER TABLE `odpoved`
ADD PRIMARY KEY (`id`), ADD KEY `diskuze_id` (`diskuze_id`), ADD KEY `uzivatel_id` (`uzivatel_id`);
--
-- Klíče pro tabulku `prijemce`
--
ALTER TABLE `prijemce`
ADD KEY `zprava_id` (`zprava_id`), ADD KEY `uzivatel_id` (`uzivatel_id`);
--
-- Klíče pro tabulku `uzivatel`
--
ALTER TABLE `uzivatel`
ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `email` (`email`);
--
-- Klíče pro tabulku `zprava`
--
ALTER TABLE `zprava`
ADD PRIMARY KEY (`id`), ADD KEY `uzivatel_id` (`uzivatel_id`);
--
-- AUTO_INCREMENT pro tabulky
--
--
-- AUTO_INCREMENT pro tabulku `diskuze`
--
ALTER TABLE `diskuze`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT pro tabulku `odpoved`
--
ALTER TABLE `odpoved`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT pro tabulku `uzivatel`
--
ALTER TABLE `uzivatel`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT pro tabulku `zprava`
--
ALTER TABLE `zprava`
MODIFY `id` int(255) NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=22;
--
-- Omezení pro exportované tabulky
--
--
-- Omezení pro tabulku `odpoved`
--
ALTER TABLE `odpoved`
ADD CONSTRAINT `odpoved_ibfk_1` FOREIGN KEY (`uzivatel_id`) REFERENCES `uzivatel` (`id`),
ADD CONSTRAINT `odpoved_ibfk_2` FOREIGN KEY (`diskuze_id`) REFERENCES `diskuze` (`id`);
--
-- Omezení pro tabulku `prijemce`
--
ALTER TABLE `prijemce`
ADD CONSTRAINT `prijemce_ibfk_1` FOREIGN KEY (`zprava_id`) REFERENCES `zprava` (`id`),
ADD CONSTRAINT `prijemce_ibfk_2` FOREIGN KEY (`uzivatel_id`) REFERENCES `uzivatel` (`id`);
--
-- Omezení pro tabulku `zprava`
--
ALTER TABLE `zprava`
ADD CONSTRAINT `zprava_ibfk_1` FOREIGN KEY (`uzivatel_id`) REFERENCES `uzivatel` (`id`);
/*!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 */;
|
insert into diet values(1, 1);
insert into diet values(1, 7);
insert into diet values(2, 2);
insert into diet values(2, 3);
insert into diet values(3, 2);
insert into diet values(3, 4);
insert into diet values(4, 2);
insert into diet values(4, 4);
insert into diet values(5, 2);
insert into diet values(5, 4);
insert into diet values(6, 2);
insert into diet values(6, 4);
insert into diet values(6, 5);
insert into diet values(7, 1);
insert into diet values(7, 6);
insert into diet values(7, 7);
insert into diet values(8, 2);
insert into diet values(8, 4);
insert into diet values(9, 6);
insert into diet values(9, 8);
insert into diet values(10, 9);
insert into diet values(11, 2);
insert into diet values(11, 4);
insert into diet values(11, 10);
insert into diet values(12, 9);
insert into diet values(12, 11);
insert into diet values(13, 2);
insert into diet values(13, 4);
insert into diet values(14, 1);
insert into diet values(14, 7);
insert into diet values(15, 6);
insert into diet values(15, 8);
insert into diet values(15, 12);
insert into diet values(16, 6);
insert into diet values(16, 8);
insert into diet values(17, 12);
insert into diet values(17, 13);
insert into diet values(18, 4);
insert into diet values(18, 10);
insert into diet values(19, 1);
insert into diet values(19, 7);
insert into diet values(20, 1);
insert into diet values(20, 7); |
CREATE TABLE IF NOT EXISTS product (
product_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(128) NULL,
unit_price DECIMAL(8,2) NULL,
PRIMARY KEY (product_id)
);
CREATE TABLE IF NOT EXISTS account (
account_id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(128) NULL,
email_id VARCHAR(128) NULL,
phone INT NULL,
PRIMARY KEY (account_id)
);
CREATE TABLE IF NOT EXISTS order_table (
order_id INT NOT NULL AUTO_INCREMENT,
account_id INT NOT NULL,
product_id INT NOT NULL,
quantity INT NOT NULL,
date DATE NOT NULL,
status VARCHAR(64) NOT NULL,
PRIMARY KEY (order_id)
); |
insert into tax_rate
values ('201',0.02);
insert into tax_rate
values ('202',0.03);
insert into tax_rate
values ('203',0.02);
insert into tax_rate
values ('204',0.03);
insert into tax_rate
values ('205',0.025);
insert into tax_rate
values ('206',0.02);
insert into tax_rate
values ('207',0.02);
insert into tax_rate
values ('208',0.03);
insert into tax_rate
values ('209',0.02);
insert into tax_rate
values ('210',0.02);
insert into tax_rate
values ('212',0.02);
insert into tax_rate
values ('213',0.03);
insert into tax_rate
values ('214',0.02);
insert into tax_rate
values ('215',0.02);
insert into tax_rate
values ('216',0.03);
insert into tax_rate
values ('217',0.02);
insert into tax_rate
values ('218',0.025);
insert into tax_rate
values ('219',0.03);
insert into tax_rate
values ('224',0.02);
insert into tax_rate
values ('225',0.02);
insert into tax_rate
values ('228',0.02);
insert into tax_rate
values ('240',0.02);
insert into tax_rate
values ('242',0.02);
insert into tax_rate
values ('246',0.02);
insert into tax_rate
values ('248',0.025);
insert into tax_rate
values ('250',0.03);
insert into tax_rate
values ('252',0.02);
insert into tax_rate
values ('253',0.02);
insert into tax_rate
values ('254',0.02);
insert into tax_rate
values ('256',0.02);
insert into tax_rate
values ('264',0.02);
insert into tax_rate
values ('267',0.02);
insert into tax_rate
values ('268',0.02);
insert into tax_rate
values ('270',0.02);
insert into tax_rate
values ('281',0.02);
insert into tax_rate
values ('284',0.02);
insert into tax_rate
values ('301',0.02);
insert into tax_rate
values ('302',0.02);
insert into tax_rate
values ('303',0.02);
insert into tax_rate
values ('304',0.02);
insert into tax_rate
values ('305',0.02);
insert into tax_rate
values ('306',0.02);
insert into tax_rate
values ('307',0.02);
insert into tax_rate
values ('308',0.02);
insert into tax_rate
values ('309',0.02);
insert into tax_rate
values ('310',0.02);
insert into tax_rate
values ('311',0.02);
insert into tax_rate
values ('312',0.02);
insert into tax_rate
values ('313',0.02);
insert into tax_rate
values ('314',0.02);
insert into tax_rate
values ('315',0.02);
insert into tax_rate
values ('316',0.02);
insert into tax_rate
values ('317',0.02);
insert into tax_rate
values ('318',0.02);
insert into tax_rate
values ('319',0.02);
insert into tax_rate
values ('320',0.02);
insert into tax_rate
values ('323',0.02);
insert into tax_rate
values ('330',0.02);
insert into tax_rate
values ('334',0.02);
insert into tax_rate
values ('336',0.02);
insert into tax_rate
values ('340',0.02);
insert into tax_rate
values ('345',0.02);
insert into tax_rate
values ('352',0.02);
insert into tax_rate
values ('360',0.02);
insert into tax_rate
values ('401',0.02);
insert into tax_rate
values ('402',0.02);
insert into tax_rate
values ('403',0.02);
insert into tax_rate
values ('404',0.02);
insert into tax_rate
values ('405',0.02);
insert into tax_rate
values ('406',0.02);
insert into tax_rate
values ('407',0.02);
insert into tax_rate
values ('408',0.02);
insert into tax_rate
values ('409',0.02);
insert into tax_rate
values ('410',0.02);
insert into tax_rate
values ('411',0.02);
insert into tax_rate
values ('412',0.02);
insert into tax_rate
values ('413',0.02);
insert into tax_rate
values ('414',0.02);
insert into tax_rate
values ('415',0.02);
insert into tax_rate
values ('416',0.02);
insert into tax_rate
values ('417',0.02);
insert into tax_rate
values ('418',0.02);
insert into tax_rate
values ('419',0.02);
insert into tax_rate
values ('423',0.02);
insert into tax_rate
values ('424',0.02);
insert into tax_rate
values ('425',0.02);
insert into tax_rate
values ('435',0.02);
insert into tax_rate
values ('440',0.02);
insert into tax_rate
values ('441',0.02);
insert into tax_rate
values ('443',0.02);
insert into tax_rate
values ('450',0.02);
insert into tax_rate
values ('456',0.02);
insert into tax_rate
values ('469',0.02);
insert into tax_rate
values ('473',0.02);
insert into tax_rate
values ('484',0.02);
insert into tax_rate
values ('500',0.02);
insert into tax_rate
values ('501',0.02);
insert into tax_rate
values ('502',0.02);
insert into tax_rate
values ('503',0.02);
insert into tax_rate
values ('504',0.02);
insert into tax_rate
values ('505',0.02);
insert into tax_rate
values ('506',0.02);
insert into tax_rate
values ('507',0.02);
insert into tax_rate
values ('508',0.02);
insert into tax_rate
values ('509',0.02);
insert into tax_rate
values ('510',0.02);
insert into tax_rate
values ('512',0.02);
insert into tax_rate
values ('513',0.02);
insert into tax_rate
values ('514',0.02);
insert into tax_rate
values ('515',0.02);
insert into tax_rate
values ('516',0.02);
insert into tax_rate
values ('517',0.02);
insert into tax_rate
values ('518',0.02);
insert into tax_rate
values ('519',0.02);
insert into tax_rate
values ('520',0.02);
insert into tax_rate
values ('530',0.02);
insert into tax_rate
values ('540',0.02);
insert into tax_rate
values ('541',0.02);
insert into tax_rate
values ('559',0.02);
insert into tax_rate
values ('561',0.02);
insert into tax_rate
values ('562',0.02);
insert into tax_rate
values ('570',0.02);
insert into tax_rate
values ('573',0.02);
insert into tax_rate
values ('580',0.02);
insert into tax_rate
values ('900',0.02);
insert into tax_rate
values ('601',0.02);
insert into tax_rate
values ('602',0.02);
insert into tax_rate
values ('603',0.02);
insert into tax_rate
values ('604',0.02);
insert into tax_rate
values ('605',0.02);
insert into tax_rate
values ('606',0.02);
insert into tax_rate
values ('607',0.02);
insert into tax_rate
values ('608',0.02);
insert into tax_rate
values ('609',0.02);
insert into tax_rate
values ('610',0.02);
insert into tax_rate
values ('612',0.02);
insert into tax_rate
values ('613',0.02);
insert into tax_rate
values ('614',0.02);
insert into tax_rate
values ('615',0.02);
insert into tax_rate
values ('616',0.02);
insert into tax_rate
values ('617',0.02);
insert into tax_rate
values ('618',0.02);
insert into tax_rate
values ('619',0.02);
insert into tax_rate
values ('626',0.02);
insert into tax_rate
values ('630',0.02);
insert into tax_rate
values ('649',0.02);
insert into tax_rate
values ('650',0.02);
insert into tax_rate
values ('651',0.02);
insert into tax_rate
values ('660',0.02);
insert into tax_rate
values ('661',0.02);
insert into tax_rate
values ('662',0.02);
insert into tax_rate
values ('664',0.02);
insert into tax_rate
values ('670',0.02);
insert into tax_rate
values ('671',0.02);
insert into tax_rate
values ('678',0.02);
insert into tax_rate
values ('701',0.02);
insert into tax_rate
values ('702',0.02);
insert into tax_rate
values ('703',0.02);
insert into tax_rate
values ('704',0.02);
insert into tax_rate
values ('705',0.02);
insert into tax_rate
values ('706',0.02);
insert into tax_rate
values ('707',0.02);
insert into tax_rate
values ('708',0.02);
insert into tax_rate
values ('709',0.02);
insert into tax_rate
values ('712',0.02);
insert into tax_rate
values ('713',0.02);
insert into tax_rate
values ('714',0.02);
insert into tax_rate
values ('715',0.02);
insert into tax_rate
values ('716',0.02);
insert into tax_rate
values ('717',0.02);
insert into tax_rate
values ('718',0.02);
insert into tax_rate
values ('719',0.02);
insert into tax_rate
values ('720',0.02);
insert into tax_rate
values ('724',0.02);
insert into tax_rate
values ('727',0.02);
insert into tax_rate
values ('732',0.02);
insert into tax_rate
values ('734',0.02);
insert into tax_rate
values ('740',0.02);
insert into tax_rate
values ('757',0.02);
insert into tax_rate
values ('758',0.02);
insert into tax_rate
values ('760',0.02);
insert into tax_rate
values ('765',0.02);
insert into tax_rate
values ('767',0.02);
insert into tax_rate
values ('770',0.02);
insert into tax_rate
values ('773',0.02);
insert into tax_rate
values ('775',0.02);
insert into tax_rate
values ('780',0.02);
insert into tax_rate
values ('781',0.02);
insert into tax_rate
values ('784',0.02);
insert into tax_rate
values ('785',0.02);
insert into tax_rate
values ('786',0.02);
insert into tax_rate
values ('787',0.02);
insert into tax_rate
values ('801',0.02);
insert into tax_rate
values ('802',0.02);
insert into tax_rate
values ('803',0.02);
insert into tax_rate
values ('804',0.02);
insert into tax_rate
values ('805',0.02);
insert into tax_rate
values ('806',0.02);
insert into tax_rate
values ('807',0.02);
insert into tax_rate
values ('808',0.02);
insert into tax_rate
values ('809',0.02);
insert into tax_rate
values ('810',0.02);
insert into tax_rate
values ('812',0.02);
insert into tax_rate
values ('813',0.02);
insert into tax_rate
values ('814',0.02);
insert into tax_rate
values ('815',0.02);
insert into tax_rate
values ('816',0.02);
insert into tax_rate
values ('817',0.02);
insert into tax_rate
values ('818',0.02);
insert into tax_rate
values ('819',0.02);
insert into tax_rate
values ('828',0.02);
insert into tax_rate
values ('830',0.02);
insert into tax_rate
values ('831',0.02);
insert into tax_rate
values ('832',0.02);
insert into tax_rate
values ('843',0.02);
insert into tax_rate
values ('847',0.02);
insert into tax_rate
values ('850',0.02);
insert into tax_rate
values ('858',0.02);
insert into tax_rate
values ('860',0.02);
insert into tax_rate
values ('864',0.02);
insert into tax_rate
values ('867',0.02);
insert into tax_rate
values ('868',0.02);
insert into tax_rate
values ('869',0.02);
insert into tax_rate
values ('870',0.02);
insert into tax_rate
values ('876',0.02);
insert into tax_rate
values ('901',0.02);
insert into tax_rate
values ('902',0.02);
insert into tax_rate
values ('903',0.02);
insert into tax_rate
values ('904',0.02);
insert into tax_rate
values ('905',0.02);
insert into tax_rate
values ('906',0.02);
insert into tax_rate
values ('907',0.02);
insert into tax_rate
values ('908',0.02);
insert into tax_rate
values ('909',0.02);
insert into tax_rate
values ('910',0.02);
insert into tax_rate
values ('912',0.02);
insert into tax_rate
values ('913',0.02);
insert into tax_rate
values ('914',0.02);
insert into tax_rate
values ('915',0.02);
insert into tax_rate
values ('916',0.02);
insert into tax_rate
values ('917',0.02);
insert into tax_rate
values ('918',0.02);
insert into tax_rate
values ('919',0.02);
insert into tax_rate
values ('920',0.02);
insert into tax_rate
values ('925',0.02);
insert into tax_rate
values ('931',0.02);
insert into tax_rate
values ('935',0.02);
insert into tax_rate
values ('937',0.02);
insert into tax_rate
values ('940',0.02);
insert into tax_rate
values ('941',0.02);
insert into tax_rate
values ('949',0.02);
insert into tax_rate
values ('954',0.02);
insert into tax_rate
values ('956',0.02);
insert into tax_rate
values ('970',0.02);
insert into tax_rate
values ('972',0.02);
insert into tax_rate
values ('973',0.02);
insert into tax_rate
values ('978',0.02);
|
drop table if exists Administers;
CREATE TABLE Administers (
timeAdministered datetime NOT NULL,
treatmentGiverID integer,
treatmentID integer,
patientID integer,
PRIMARY KEY (treatmentID, treatmentGiverID, patientID),
FOREIGN KEY (treatmentGiverID) REFERENCES TreatmentGiver(treatmentGiverID),
FOREIGN KEY (patientID) REFERENCES Patient(patientID),
FOREIGN KEY (treatmentID) REFERENCES Treatment(treatmentID)
);
|
SELECT
ACCOUNT_CODE,
ACCOUNT_NAME,
PARENTS_ACCOUNT_CODE,
ACCOUNT_CODE_LEVEL,
ACCOUNT_CODE_CURRENCY,
CUSTOMER_CODE,
AGENCY_CUST_CODE,
OWNER_ACCOUNT_NO,
SAP_COOPERATION_OBJ_FLG,
SAP_COOPERATION_STATUS,
MODIFY_USER,
MODIFY_DATE
FROM ACCOUNT_CODE_MST
WHERE
ACCOUNT_CODE_LEVEL = CAST(/*accCodeLev*/ AS CHAR(1))
AND OWNER_ACCOUNT_NO = /*accountNo*/
|
-- Create tables for our ingredients and favorite recipes, plus the cache tables to save our results
CREATE TABLE IF NOT EXISTS favoriterecipes(
favoriterecipe_id VARCHAR(32) PRIMARY KEY,
title VARCHAR(256),
image_url VARCHAR(256),
directions_url VARCHAR(256),
source_title VARCHAR(256),
calories INT,
total_time INT
);
CREATE TABLE IF NOT EXISTS ingredients(
recipe_ref_id VARCHAR(32) REFERENCES favoriterecipes (favoriterecipe_id),
ingredient_desc VARCHAR(256),
weight INT
);
CREATE TABLE IF NOT EXISTS resultscache(
resultsrecipe_id VARCHAR(32) PRIMARY KEY,
title VARCHAR(256),
image_url VARCHAR(256),
directions_url VARCHAR(256),
source_title VARCHAR(256),
calories INT,
total_time INT
);
CREATE TABLE IF NOT EXISTS ingredientscache(
recipe_ref_id VARCHAR(32) REFERENCES resultscache (resultsrecipe_id),
ingredient_desc VARCHAR(256),
weight INT
);
|
CREATE EXTENSION get_sum;
SELECT get_sum(1::INT, 1::INT);
SELECT get_sum(101::INT, 202::INT);
SELECT get_sum(0::INT, 0::INT);
SELECT get_sum(-1::INT, 0::INT);
SELECT get_sum(-1::INT, -1::INT);
SELECT get_sum(-101::INT, -202::INT);
SELECT get_sum(NULL::INT, 11::INT);
SELECT get_sum(-1::INT, NULL::INT);
SELECT get_sum(0::INT, 2147483647::INT);
SELECT get_sum(-2147483648::INT, 0::INT);
SELECT get_sum(2147483647::INT, 2147483647::INT);
SELECT get_sum(-2147483648::INT, -2147483648::INT);
SELECT get_sum(-2147483648::INT, 2147483647::INT);
SELECT get_sum(2147483647::INT, -2147483648::INT);
SELECT get_sum(111111111111111::INT, 222222222222222::INT);
|
/* create advertiser login a*/
/*create table advertiser*/
CREATE TABLE advertiser
{
idadvertiser AUTO_INCREMENT int(11) ,
nameadv varchar(45) ,
email varchar(29) ,
phonenum varchar(45) ,
passw varchar(10),
CONSTRAINT pk_advertiser PRIMARY KEY(idadvertiser)
}
/* insert values to the table*/
INSERT INTO advertiser values(0,'chathu','chathu@gmail.com','0743156356','chathu37');
INSERT INTO advertiser values(0,'amila','amila@gmail.com','0713561428','amila37');
/* CHECK THE ADVERTISER TABLE*/
select*
from advertiser;
/*check the advertiser name like*/
select*
from advertiser
where nameadv LIKE 'c%';
/*delete the advertiser*/
delete advertiser
where nameadv = chathu;
/*checking for drop table*/
drop table advertiser;
/*create company login(user)*/
/*create user table*/
CREATE TABLE user
{
id int(11) ,
name varchar(45) ,
email varchar(45) ,
country varchar(45) ,
CONSTRAINT pk_user PRIMARY KEY(id)
}
/* check the user name like*/
select*
from user
where name LIKE 'a%';
/*check the user table*/
select*
from user;
/*check the user from the id*/
select *
from user
where user id=1;
/*drop the user table*/
drop table user;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50520
Source Host : localhost:3306
Source Database : truething
Target Server Type : MYSQL
Target Server Version : 50520
File Encoding : 65001
Date: 2016-07-06 17:51:31
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for message_info
-- ----------------------------
DROP TABLE IF EXISTS `message_info`;
CREATE TABLE `message_info` (
`id` varchar(32) NOT NULL,
`prj_code` varchar(50) DEFAULT NULL COMMENT '项目代码',
`msg_type` varchar(2) DEFAULT NULL COMMENT '消息类型',
`user_mobile` varchar(11) DEFAULT NULL COMMENT '手机号',
`msg_content` varchar(255) DEFAULT NULL COMMENT '消息内容',
`remark` varchar(255) DEFAULT NULL COMMENT '备注',
`crt_time` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of message_info
-- ----------------------------
INSERT INTO `message_info` VALUES ('293898b5f04e43f4af641cca088f4b95', 'medical', '1', '13564134186', '本次验证码为:5346,有效期180秒!', '测试', '2016-07-05 16:40:54');
|
--Query a list of CITY and STATE from the STATION table.
--The STATION table is described as follows: https://s3.amazonaws.com/hr-challenge-images/9336/1449345840-5f0a551030-Station.jpg
SELECT CITY, STATE
FROM STATION;
---------------------------------------------------------------------
--Query a list of CITY names from STATION for cities that have an even ID number. Print the results in any order, but exclude duplicates from the answer.
SELECT DISTINCT CITY
FROM STATION
WHERE MOD(ID, 2)=0;
-----------------------------------------------------------------------------------------------------------------------------------------------
--Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table.
SELECT (COUNT(CITY) - COUNT(DISTINCT CITY) ) AS DIFFERENCE
FROM STATION;
------------------------------------------------------------------------------------------------------------------------------------
--Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths
--(i.e.: number of characters in the name). If there is more than one smallest or largest city, choose the one that
--comes first when ordered alphabetically.
SELECT CITY,LENGTH(CITY)
FROM STATION
ORDER BY LENGTH(CITY), CITY ASC
LIMIT 1;
SELECT CITY, LENGTH(CITY)
FROM STATION
ORDER BY LENGTH(CITY) DESC
LIMIT 1;
---------------------------------------------------------------------------------------------------------------------------------------
--Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates
SELECT DISTINCT CITY
FROM STATION
WHERE CITY RLIKE '^[AEIOU]'; --This is the MySql keyword i.e. 'RLIKE' for pattern matching
-------------------------------------------
|
CREATE TABLE sys_order
(
`id` BIGINT NOT NULL AUTO_INCREMENT,
`user_id` BIGINT NOT NULL COMMENT '用户id',
`amount` BIGINT NOT NULL COMMENT '金额,精确到后面2位',
`target_id` BIGINT NOT NULL COMMENT '订单目标id',
`type` TINYINT COMMENT '0:赞赏作品,1:赞赏文章,2:买作品',
`create_time` datetime DEFAULT NOW(),
`update_time` datetime DEFAULT NOW(),
PRIMARY KEY (`id`),
INDEX (user_id)
)
|
use movimentacoes_cartoes;
----------------------------------------
-- carga tabela associado:
insert into associado (nome, sobrenome, idade, email)
values ('Marlos', 'Nascimento', 33, 'marlos.nascimento@sicooperative.com'),
('Ronaldo', 'Abreu', 22, 'ronaldo@abreu.com'),
('Maria', 'Madalena', 28, 'maria@madalena.com'),
('Antonio', 'Nunes', 50, 'antonio@nunes.com'),
('Eduarda', 'Aguiar', 19, 'eduarda@aguiar.com'),
('José', 'Silva', 48, 'jose@silva.com'),
('Abílio', 'Abreu', 62, 'abilio@abreu.com'),
('Pedro', 'Alves', 24, 'pedro@alves.com'),
('Marli', 'Ribeiro', 50, 'marli@ribeiro.com'),
('Bruna', 'Souza', 31, 'bruna@souza.com');
select * from associado;
----------------------------------------------
-- carga tabela conta
insert into conta (tipo_conta, data_criacao_conta, cod_associado)
values ('Conta corrente', '2015-05-03', 2),
('Conta poupança', '2010-09-15', 3),
('Conta investimento', '2013-10-01', 7),
('Conta corrente', '2014-12-07', 7),
('Conta corrente', '2012-01-17', 1),
('Conta corrente', '2011-04-15', 2),
('Conta investimento', '2007-07-07', 8),
('Conta poupança', '2020-08-23', 9),
('Conta corrente', '2022-01-07', 4),
('Conta investimento', '2022-02-01', 4);
select * from conta;
-------------------------------------------
-- carga tabela cartao
insert into cartao (num_cartao, nome_impresso, data_criacao_cartao, cod_associado, cod_conta)
values (1234, 'Marlos Nascimento', '2012-02-01', 1, 5),
(5678, 'Ronaldo Abreu', '2015-05-10', 2, 1),
(9012, 'Ronaldo Abreu', '2011-04-29', 2, 6),
(3456, 'Antonio Nunes', '2022-02-10', 4, 9),
(7890, 'Antonio Nunes', '2022-02-10', 4, 10),
(1122, 'Maria Madalena', '2010-10-01', 3, 5),
(2233, 'Pedro Alves', '2007-08-01', 8, 7),
(3344, 'Abílio Abreu', '2013-10-05', 7, 3),
(4455, 'Abílio Abreu', '2014-12-10', 7, 4),
(5566, 'Marli Ribeiro', '2020-09-01', 9, 8);
select * from cartao;
------------------------------------------------
-- carga tabela movimento
insert into movimento (vlr_transacao, des_transacao, data_movimento, cod_cartao)
values (215.23, 'Lojas ABC', '2012-03-15', 1),
(100.00, 'Ingresso Online', '2015-06-20', 2),
(632.50, 'Faculdades XYZ', '2022-02-11', 4),
(112.99, 'Esporte Center', '2022-02-12', 5),
(50.00, 'Recarga Fácil', '2013-02-01', 1),
(22.15, 'Lanchonete da Esquina', '2012-04-20', 1),
(42.17, 'Quitanda do Vovô', '2020-11-01', 8),
(119.90, 'Academia 123', '2020-12-15', 8),
(1189.90, 'Lojas ABC', '2014-12-10', 9),
(315.74, 'Esporte Center', '2015-05-15', 2);
select * from movimento;
----------------------------------
-- carga no Data Mart
insert into dm_movimento_flat (nome_associado, sobrenome_associado, idade_associado,
vlr_transacao_movimento, des_transacao_movimento, data_movimento, numero_cartao,
nome_impresso_cartao, data_criacao_cartao, tipo_conta, data_criacao_conta)
(select a.nome,
a.sobrenome,
a.idade,
m.vlr_transacao,
m.des_transacao,
m.data_movimento,
c.num_cartao,
c.nome_impresso,
c.data_criacao_cartao,
con.tipo_conta,
con.data_criacao_conta
from movimento m
inner join cartao c on m.cod_cartao = c.cod_cartao
inner join associado a on c.cod_associado = a.cod_associado
inner join conta con on c.cod_conta = con.cod_conta);
select * from dm_movimento_flat;
|
--Requires PostGIS Extension!
SET search_path = acs2011_5yr, public; --Change target schema here if other than acs2011_5yr
CREATE SEQUENCE geoheader_gid_seq;
ALTER TABLE geoheader
ADD COLUMN geom geometry(MultiPolygon, 4269),
ADD COLUMN gid int NOT NULL DEFAULT nextval('geoheader_gid_seq');
CREATE INDEX ON geoheader USING gist (geom);
--Add spatial layers for some common Census geographies.
--Assumes spatial tables have names matching filename from Census FTP site.
--States (sumlevel = 40 or '040')
--Import tl_2010_us_state10 with shp2pgsql
UPDATE geoheader g
SET geom = t.geom
FROM tl_2011_us_state t
WHERE g.sumlevel = 40 AND split_part(g.geoid, 'US', 2) = t.geoid
;
CREATE OR REPLACE VIEW geo_state AS
SELECT
gid,
geoid,
name,
geom
FROM geoheader
WHERE sumlevel = 40 and component = '00'
;
--Counties (sumlevel = 50 or '050')
--Import tl_2010_us_county10 with shp2pgsql
UPDATE geoheader g
SET geom = t.geom
FROM tl_2011_us_county t
WHERE g.sumlevel = 50 AND split_part(g.geoid, 'US', 2) = t.geoid
;
CREATE OR REPLACE VIEW geo_county AS
SELECT
gid,
geoid,
name,
geom
FROM geoheader
WHERE sumlevel = 50 and component = '00'
;
--Tracts (sumlevel = 140)
--Import tl_2010_*_tract10 by state with shp2pgsql
UPDATE geoheader g
SET geom = t.geom
FROM tl_2011_us_tract t
WHERE g.sumlevel = 140 AND split_part(g.geoid, 'US', 2) = t.geoid
;
CREATE OR REPLACE VIEW geo_tract AS
SELECT
gid,
geoid,
name,
geom
FROM geoheader
WHERE sumlevel = 140 and component = '00'
;
|
-- show triggers;
-- drop trigger before_movie_insert_movieCertificate;
delimiter $$
create trigger before_movie_insert_movieRuntime before insert on movie
for each row
begin
if new.movieRuntime <= 25 then
signal sqlstate '42000'
set message_text = 'Check constraint on movieRuntime in table movie failed. Runtime too short';
end if;
end$$
delimiter ;
delimiter $$
create trigger before_movie_insert_movieCertificate before insert on movie
for each row
begin
if new.movieCertificate not in ('N/A','PG','12','12A','15','15A','16','18') then
signal sqlstate '41000'
set message_text = 'Check constraint on movieCertificate in table movie failed. Only Irish ratings';
end if;
end$$
delimiter ;
delimiter $$
create trigger before_movie_insert_movieRating before insert on movie
for each row
begin
if (new.movieRating < 1) OR (new.movieRating > 5) then
signal sqlstate '42000'
set message_text = 'Check constraint on movieRating in table movie failed. Outrageous rating my good sir/madame';
end if;
end$$
delimiter ;
|
-- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 5.5.62 - MySQL Community Server (GPL)
-- OS do Servidor: Win64
-- HeidiSQL Versão: 11.0.0.5919
-- --------------------------------------------------------
/*!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' */;
-- Copiando estrutura do banco de dados para gamesfeed
CREATE DATABASE IF NOT EXISTS `gamesfeed` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci */;
USE `gamesfeed`;
-- Copiando estrutura para tabela gamesfeed.articles
CREATE TABLE IF NOT EXISTS `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`source_id` int(11) DEFAULT NULL,
`url` varchar(767) DEFAULT NULL,
`description` varchar(1000) DEFAULT NULL,
`img` text,
`import_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`ignore` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
UNIQUE KEY `url` (`url`),
KEY `FK_articles_sources` (`source_id`),
CONSTRAINT `FK_articles_sources` FOREIGN KEY (`source_id`) REFERENCES `sources` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=118240 DEFAULT CHARSET=latin1;
-- Copiando dados para a tabela gamesfeed.articles: ~0 rows (aproximadamente)
DELETE FROM `articles`;
/*!40000 ALTER TABLE `articles` DISABLE KEYS */;
/*!40000 ALTER TABLE `articles` ENABLE KEYS */;
-- Copiando estrutura para tabela gamesfeed.article_views
CREATE TABLE IF NOT EXISTS `article_views` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`article_url` varchar(767) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`visitor_ip` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`date_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `FK_article_views_articles` (`article_url`(191)) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=34398 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- Copiando dados para a tabela gamesfeed.article_views: ~0 rows (aproximadamente)
DELETE FROM `article_views`;
/*!40000 ALTER TABLE `article_views` DISABLE KEYS */;
/*!40000 ALTER TABLE `article_views` ENABLE KEYS */;
-- Copiando estrutura para tabela gamesfeed.sources
CREATE TABLE IF NOT EXISTS `sources` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL,
`url` text,
`ignore_before` text,
`ignore_after` text,
`post_tag` text,
`icon_url` text,
`active` tinyint(4) DEFAULT '1',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
-- Copiando dados para a tabela gamesfeed.sources: ~5 rows (aproximadamente)
DELETE FROM `sources`;
/*!40000 ALTER TABLE `sources` DISABLE KEYS */;
INSERT INTO `sources` (`id`, `name`, `url`, `ignore_before`, `ignore_after`, `post_tag`, `icon_url`, `active`) VALUES
(1, 'IGN', 'https://br.ign.com/', '<div id="gheader">', NULL, NULL, 'https://br.ign.com/s/ign/favicon.ico', 1),
(2, 'UOL Start', 'https://www.uol.com.br/start/', 'data-audience-click=\'{"component":"back-to-top","mediaName":"Home"}\'', NULL, NULL, 'https://conteudo.imguol.com.br/c/_layout/favicon/start.ico', 1),
(3, 'G1 Games', 'https://g1.globo.com/pop-arte/games/', '<div id="feed-placeholder" class="feed-placeholder">', '<div class="load-more gui-color-primary-bg">', NULL, 'https://s2.glbimg.com/xpIBVPTklmxqDclL56tW2p5NCy8=/32x32/smart/filters:strip_icc()/i.s3.glbimg.com/v1/AUTH_59edd422c0c84a879bd37670ae4f538a/internal_photos/bs/2018/t/z/UwpQGGQk2JFCACPcEdiQ/favicon-g1.jpeg', 1),
(4, 'Tecmundo Voxel', 'https://www.tecmundo.com.br/voxel/noticias', '<main id="js-main"', '<div class="tec--list z--mt-32" id="listaUltimosReviews">', NULL, 'https://www.tecmundo.com.br/desktop/favicon.ico', 1),
(5, 'VideoGamer', 'https://pt.videogamer.com/noticias', '<ul class="content-list u-clearfix">', '<li class="content-item invisible-md">', NULL, 'https://pt.videogamer.com/static/images/favicon.ico', 0);
/*!40000 ALTER TABLE `sources` ENABLE KEYS */;
-- Copiando estrutura para tabela gamesfeed.tags
CREATE TABLE IF NOT EXISTS `tags` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`source_id` int(11) DEFAULT NULL,
`tag_start` varchar(1000) DEFAULT NULL,
`tag_end` varchar(1000) DEFAULT NULL,
`tag_img` varchar(1000) DEFAULT NULL,
`tag_title` varchar(1000) DEFAULT NULL,
`tag_article` varchar(1000) DEFAULT NULL,
`tag_link` varchar(1000) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK__sources` (`source_id`),
CONSTRAINT `FK__sources` FOREIGN KEY (`source_id`) REFERENCES `sources` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
-- Copiando dados para a tabela gamesfeed.tags: ~5 rows (aproximadamente)
DELETE FROM `tags`;
/*!40000 ALTER TABLE `tags` DISABLE KEYS */;
INSERT INTO `tags` (`id`, `source_id`, `tag_start`, `tag_end`, `tag_img`, `tag_title`, `tag_article`, `tag_link`) VALUES
(1, 1, 'article', NULL, 'src', NULL, 'article', 'article'),
(2, 2, 'p', NULL, 'data-src', NULL, 'a', 'p'),
(4, 3, 'a', NULL, 'src', NULL, 'div|feed-post', 'a'),
(5, 4, 'a', NULL, 'data-src', 'title|Ir para: ', 'a', 'a'),
(6, 5, 'a', NULL, 'src', NULL, 'li|content-item', 'a');
/*!40000 ALTER TABLE `tags` 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 */;
|
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 27, 2019 at 05:49 PM
-- Server version: 5.7.25-0ubuntu0.16.04.2
-- PHP Version: 7.0.33-0ubuntu0.16.04.4
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: `concessionaire_manager`
--
CREATE DATABASE concessionaire_manager;
-- --------------------------------------------------------
--
-- Table structure for table `agency`
--
CREATE TABLE `agency` (
`id` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL,
`location_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `agency`
--
INSERT INTO `agency` (`id`, `name`, `location_id`) VALUES
(1, 'Concesionario Caracas', 1),
(2, 'Concesionario Maracay', 2);
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`id` bigint(20) NOT NULL,
`create_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted_date` datetime DEFAULT NULL,
`document_number` varchar(10) DEFAULT NULL,
`email` varchar(60) DEFAULT NULL,
`name` varchar(50) NOT NULL,
`phone_number` varchar(12) NOT NULL,
`status` varchar(10) DEFAULT 'ACTIVE',
`updated_date` datetime DEFAULT NULL,
`agency_id` bigint(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`id`, `create_date`, `deleted_date`, `document_number`, `email`, `name`, `phone_number`, `status`, `updated_date`, `agency_id`) VALUES
(1, '2019-04-26 19:57:07', NULL, '13608741', 'nestor.e.s.m@gmail.com', 'Nestor Sanchez', '0412332448', 'ACTIVE', NULL, 1),
(2, '2019-04-27 16:00:23', NULL, '2000000', 'dorotea@gmail.com', 'Doris Barazarte', '584123324480', NULL, '2019-04-27 16:33:36', 2),
(3, '2019-04-27 16:11:40', NULL, '1463256', 'dorotea@gmail.com', 'Doris Barazarte', '584123324480', NULL, NULL, 1);
-- --------------------------------------------------------
--
-- Table structure for table `location`
--
CREATE TABLE `location` (
`id` bigint(20) NOT NULL,
`name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `location`
--
INSERT INTO `location` (`id`, `name`) VALUES
(1, 'Caracas'),
(2, 'Maracay'),
(3, 'Maracaibo');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `agency`
--
ALTER TABLE `agency`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_dg0dp55afow6u56rf8ku91ojc` (`location_id`);
--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UK_mcxhs25405p3p7mrre6he23nf` (`document_number`),
ADD KEY `fk_customer_agency` (`agency_id`);
--
-- Indexes for table `location`
--
ALTER TABLE `location`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `agency`
--
ALTER TABLE `agency`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `location`
--
ALTER TABLE `location`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `agency`
--
ALTER TABLE `agency`
ADD CONSTRAINT `fk_agency_location` FOREIGN KEY (`location_id`) REFERENCES `location` (`id`);
--
-- Constraints for table `customer`
--
ALTER TABLE `customer`
ADD CONSTRAINT `fk_customer_agency` FOREIGN KEY (`agency_id`) REFERENCES `agency` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; |
DROP TABLE V_VIK_PRODUCT_GROUP;
CREATE TABLE V_VIK_PRODUCT_GROUP
(
ID NUMBER(10) ,
CP_CATEGORY VARCHAR2( CHAR) ,
PRODUCT_TYPE NUMBER(10) DEFAULT 0 NOT NULL,
GROUP_NAME NUMBER(10) DEFAULT 0 NOT NULL,
CP_CATEGORY_ID NUMBER(10) ,
IS_ACTIVE NUMBER(1) DEFAULT 0 NOT NULL,
CONSTRAINT PK_V_VIK_PRODUCT_GROUP PRIMARY KEY (ID) using index tablespace indexsml
)tablespace datasml;
--No sequence specified for this table
comment on table V_VIK_PRODUCT_GROUP is '';
comment on column V_VIK_PRODUCT_GROUP.ID is ' This field does not use a sequence. Value is generated using max()+1';
comment on column V_VIK_PRODUCT_GROUP.CP_CATEGORY is '';
comment on column V_VIK_PRODUCT_GROUP.PRODUCT_TYPE is 'BaseTVPackage=100 Decoder=101 Addon=102 BaseBroadband=200 BaseTelephony=201 Modem=202 BaseMobile=300 SIMCard=301 VariousMobile=302 VariousTV=103 VariousBroadband=203 VariousTelephony=204 Other1=401 Other2=402 Other3=403 Other4=404 Other5=405 Other6=406 Other7=407 ';
comment on column V_VIK_PRODUCT_GROUP.GROUP_NAME is 'TV=1 BroadbandAndTelephony=2 Mobile=3 Other=4 ';
comment on column V_VIK_PRODUCT_GROUP.CP_CATEGORY_ID is '';
comment on column V_VIK_PRODUCT_GROUP.IS_ACTIVE is '';
ALTER TABLE V_VIK_PRODUCT_GROUP ADD (
CONSTRAINT CK_V_VIK_PRODUCT_GROUP_3
CHECK (PRODUCT_TYPE in (100,101,102,200,201,202,300,301,302,103,203,204,401,402,403,404,405,406,407)));
ALTER TABLE V_VIK_PRODUCT_GROUP ADD (
CONSTRAINT CK_V_VIK_PRODUCT_GROUP_4
CHECK (GROUP_NAME in (1,2,3,4)));
ALTER TABLE V_VIK_PRODUCT_GROUP ADD (
CONSTRAINT CK_V_VIK_PRODUCT_GROUP_6
CHECK (IS_ACTIVE in (1,0)));
|
--
-- Simple bank database
--
set termout on
prompt Building small bank database. Please wait ...
set termout off
set feedback off
-- Remove old instances of database
drop table Branches;
drop table Customers;
drop table Accounts;
-- Create Accounts, Branches, Customers tables
create table Branches (
location varchar2(20),
address varchar2(20)
);
create table Customers (
name varchar2(10),
address varchar2(20)
);
create table Accounts (
holder varchar2(10),
branch varchar2(20),
balance real
);
-- Populate Branches table
insert into Branches values ('Clovelly', 'Clovelly Rd.');
insert into Branches values ('Coogee', 'Coogee Bay Rd.');
insert into Branches values ('Maroubra', 'Anzac Pde.');
insert into Branches values ('Randwick', 'Alison Rd.');
insert into Branches values ('UNSW', 'near Library');
-- Populate Customers table
insert into Customers values ('Adam', 'Randwick');
insert into Customers values ('Bob', 'Coogee');
insert into Customers values ('Chuck', 'Clovelly');
insert into Customers values ('David', 'Kensington');
insert into Customers values ('George', 'Maroubra');
insert into Customers values ('Graham', 'Maroubra');
insert into Customers values ('Greg', 'Coogee');
insert into Customers values ('Ian', 'Clovelly');
insert into Customers values ('Jack', 'Randwick');
insert into Customers values ('James', 'Clovelly');
insert into Customers values ('Jane', 'Bronte');
insert into Customers values ('Jenny', 'La Perouse');
insert into Customers values ('Jill', 'Malabar');
insert into Customers values ('Jim', 'Maroubra');
insert into Customers values ('Joe', 'Randwick');
insert into Customers values ('John', 'Kensington');
insert into Customers values ('Keith', 'Redfern');
insert into Customers values ('Steve', 'Coogee');
insert into Customers values ('Tony', 'Coogee');
insert into Customers values ('Victor', 'Randwick');
insert into Customers values ('Wayne', 'Kingsford');
-- Populate Accounts table
insert into Accounts values ('Adam', 'Coogee', 1000.00);
insert into Accounts values ('Bob', 'UNSW', 500.00);
insert into Accounts values ('Chuck', 'Clovelly', 660.00);
insert into Accounts values ('David', 'Randwick', 1500.00);
insert into Accounts values ('George', 'Maroubra', 2000.00);
insert into Accounts values ('Graham', 'Maroubra', 400.00);
insert into Accounts values ('Greg', 'Randwick', 9000.00);
insert into Accounts values ('Ian', 'Clovelly', 5500.00);
insert into Accounts values ('Jack', 'Coogee', 500.00);
insert into Accounts values ('James', 'Clovelly', 2700.00);
insert into Accounts values ('Jane', 'Maroubra', 350.00);
insert into Accounts values ('Jenny', 'Coogee', 4250.00);
insert into Accounts values ('Jill', 'UNSW', 5000.00);
insert into Accounts values ('Jim', 'UNSW', 2500.00);
insert into Accounts values ('Joe', 'UNSW', 900.00);
insert into Accounts values ('John', 'UNSW', 5000.00);
insert into Accounts values ('Keith', 'UNSW', 880.00);
insert into Accounts values ('Steve', 'UNSW', 1500.00);
insert into Accounts values ('Tony', 'Coogee', 2500.00);
insert into Accounts values ('Victor', 'UNSW', 250.00);
insert into Accounts values ('Wayne', 'UNSW', 250.00);
-- Make sure SQL*Plus starts talking to us again
set termout on
set feedback on
|
create or replace view fmv_bompvtuptodown as
select
s.sel_cle Key
,p.pvt_em_addr fromID
,p.pvt_cle fromName
--,f.f_cle
--,f.f_desc
,n.nmc_field
,n.fils_pro_nmc famID
,p.geo5_em_addr geoID
,p.dis6_em_addr disID
,p1.pvt_em_addr ToID
,case when p1.pvt_cle is null then
REPLACE(p.pvt_cle,f.f_cle,f1.f_cle)
else
p1.pvt_cle
end
ToName
,case when p1.pvt_cle is null then
REPLACE(p.pvt_desc,f.f_desc,f1.f_desc)
else
p1.pvt_desc
end
ToDesc
,n.qute
from sel s join rsp r on s.sel_bud=0 and s.sel_em_addr=r.sel13_em_addr
join pvt p on r.pvt14_em_addr=p.pvt_em_addr
join fam f on p.fam4_em_addr=f.fam_em_addr
join NMC n on n.pere_pro_nmc=p.fam4_em_addr and n.nmc_field<>83
left join pvt p1 on nvl(p.geo5_em_addr,0)=nvl(p1.geo5_em_addr,0)
and nvl(p.dis6_em_addr,0)=nvl(p1.dis6_em_addr,0)
and n.fils_pro_nmc=p1.fam4_em_addr
left join fam f1 on f1.fam_em_addr=n.fils_pro_nmc;
|
SELECT DepositGroup , MagicWandCreator, MIN (DepositCharge) AS MinDepositCharge
FROM WizzardDeposits
GROUP BY DepositGroup , MagicWandCreator
ORDER BY MagicWandCreator ,DepositGroup |
CREATE TABLE account (
id BIGSERIAL NOT NULL,
version BIGINT,
created TIMESTAMP WITH TIME ZONE,
modified TIMESTAMP WITH TIME ZONE,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
CONSTRAINT pk_account PRIMARY KEY (id),
CONSTRAINT unique_username UNIQUE(username),
CONSTRAINT unique_email UNIQUE(email)
); |
-- Plan count should match the number of tests. If it does
-- not then pg_prove will fail the test
SELECT plan(7);
-- Run the tests.
-- Columns
SELECT columns_are('problem', ARRAY[ 'problemid', 'input', 'output', 'name', 'description']);
SELECT col_type_is('problem', 'input', 'text', 'input column type is -- text' );
SELECT col_type_is('problem', 'output', 'text', 'output column type is -- text' );
SELECT col_type_is('problem', 'name', 'text', 'name column type is -- text' );
SELECT col_type_is('problem', 'description', 'text', 'description column type is -- text' );
-- Keys
SELECT has_pk('problem', 'Has a Primary Key' );
SELECT col_is_pk( 'problem', 'problemid', 'Column is Primary Key -- id' );
-- Finish the tests and clean up.
SELECT * FROM finish();
ROLLBACK; -- don't commit the transaction
|
--@drop_schema_tables.sql;
purge recyclebin;
CREATE TABLE Department(
did VARCHAR2(20),
Major VARCHAR2(20),
PRIMARY KEY (did),
constraint Major_notNull
check (Major != NULL)
);
CREATE TABLE Student(
sid VARCHAR2(20),
firstname VARCHAR2(20),
lastname VARCHAR2(20),
dob DATE,
gpa float,
PRIMARY KEY(sid),
constraint Firstname_notNull
check (firstname != NULL )
);
CREATE TABLE Course(
cid VARCHAR2(20),
name VARCHAR2(20),
GPA FLOAT,
semester VARCHAR2(20),
Availability VARCHAR2(20),
-- classroom VARCHAR2(20), --we decide not to go for classroom in this part
PRIMARY KEY(cid),
Constraint check_GPA
CHECK(GPA<4.3 AND GPA>=0)
);
CREATE TABLE Faculty (
fid VARCHAR2(20),
name VARCHAR2(20),
PRIMARY KEY(fid),
constraint fname_notNull
check (name != null)
);
CREATE TABLE Student_Service(
Student_No VARCHAR2(20),
Housing VARCHAR2(20),
Dining FLOAT,
Visa VARCHAR2(20),
PRIMARY KEY(Student_No)
);
CREATE TABLE Financial_Service(
pid VARCHAR2(20),
-- tax VARCHAR2(20),--left for expansion in the part3
financial_aid FLOAT,
-- tuition VARCHAR2(20),--left for expansion in the part3
PRIMARY KEY(pid),
constraint aid_notNegative
check (financial_aid >=0)
);
CREATE TABLE Employment(
SSN VARCHAR2(20),
TypeofEmploment VARCHAR2(20),
totalhours float,
payrate float,
PRIMARY KEY(SSN),
constraint totalWork_notZero
check (totalhours >=0)
);
CREATE TABLE Insurance(
iid VARCHAR2(20),
Company_Name VARCHAR2(20),
PRIMARY KEY(iid),
constraint companyname_notNull
check (Company_Name!=NULL)
);
--Below are relationship tables
CREATE TABLE Core (
-- Major VARCHAR2(20),--left for expansion in part3
did VARCHAR2(20),
cid VARCHAR2(20),
primary key(did,cid),
FOREIGN KEY (did) REFERENCES Department,
FOREIGN KEY (cid) REFERENCES Course
);
CREATE TABLE Affiliate (
sid VARCHAR2(20),
did VARCHAR2(20),
primary key(sid),
FOREIGN KEY (did) REFERENCES Department,
FOREIGN KEY (sid) REFERENCES Student
);
CREATE TABLE Register (
cid VARCHAR2(20),
sid VARCHAR2(20),
GPA float,
primary key(sid,cid),
FOREIGN KEY (cid) REFERENCES Course,
FOREIGN KEY (sid) REFERENCES Student,
Constraint check_GPA1
CHECK(GPA<=4.3 AND GPA>=0)
);
CREATE TABLE Receive(
sid VARCHAR2(20),
student_no VARCHAR2(20),
PRIMARY KEY (sid,student_no),
FOREIGN KEY (sid) REFERENCES Student,
FOREIGN KEY (student_no) REFERENCES Student_Service
);
CREATE TABLE Teach(
fid VARCHAR2(20),
cid VARCHAR2(20),
Primary key(fid,cid),
FOREIGN KEY (fid) REFERENCES faculty,
FOREIGN KEY (cid) REFERENCES Course
);
CREATE TABLE TA(
sid VARCHAR2(20),
cid VARCHAR2(20),
Primary key(sid,cid),
FOREIGN KEY (sid) REFERENCES Student,
FOREIGN KEY (cid) REFERENCES Course
);
CREATE TABLE Purchase(
sid VARCHAR2(20),
pid VARCHAR2(20),
PRIMARY KEY (sid,pid),
FOREIGN KEY (sid) REFERENCES Student,
FOREIGN KEY (pid) REFERENCES Financial_Service
);
CREATE TABLE Work_as(
sid VARCHAR2(20),
ssn VARCHAR2(20),
PRIMARY KEY (sid, ssn),
FOREIGN KEY (sid) REFERENCES Student,
FOREIGN KEY (ssn) REFERENCES Employment
);
CREATE TABLE Pay_roll(
pid VARCHAR2(20),
ssn VARCHAR2(20),
PRIMARY KEY ( pid, ssn),
FOREIGN KEY (pid) REFERENCES Financial_Service,
FOREIGN KEY (ssn) REFERENCES Employment
);
CREATE TABLE Belongs(
did VARCHAR2(20),
fid VARCHAR2(20),
primary key(did,fid),
foreign key(did) references Department,
foreign key (fid) references Faculty
);
CREATE TABLE Purchase_Insurance(
iid VARCHAR2(20),
pid VARCHAR2(20),
primary key(iid,pid),
foreign key(iid) references Insurance,
foreign key (pid) references Financial_service);
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 13 Sep 2019 pada 10.56
-- Versi server: 10.1.37-MariaDB
-- Versi 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 */;
--
-- Database: `dbtugasesg`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `jabatan`
--
CREATE TABLE `jabatan` (
`id_jabatan` int(11) NOT NULL,
`nama_jabatan` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `jabatan`
--
INSERT INTO `jabatan` (`id_jabatan`, `nama_jabatan`) VALUES
(1, 'Programmer'),
(2, 'Analisis'),
(3, 'Android Dev'),
(4, 'Bisnis Develop');
-- --------------------------------------------------------
--
-- Struktur dari tabel `karyawan`
--
CREATE TABLE `karyawan` (
`id_karyawan` int(11) NOT NULL,
`nama` varchar(200) DEFAULT NULL,
`jk` enum('Pria','Wanita') DEFAULT NULL,
`id_jabatan` int(11) DEFAULT NULL,
`no_hp` varchar(15) DEFAULT NULL,
`alamat` text
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `karyawan`
--
INSERT INTO `karyawan` (`id_karyawan`, `nama`, `jk`, `id_jabatan`, `no_hp`, `alamat`) VALUES
(1, 'Ahmad', 'Pria', 1, '085212325267', 'Jalan 1'),
(2, 'Lutfi', 'Pria', 2, '082293212398', 'Jalan 2'),
(3, 'Sidiq', 'Pria', 3, '089712389212', 'Jalan 4'),
(4, 'Nadia', 'Wanita', 1, '084361261277', 'Jalan 3');
-- --------------------------------------------------------
--
-- Struktur dari tabel `kehadiran`
--
CREATE TABLE `kehadiran` (
`id_kehadiran` int(11) NOT NULL,
`id_karyawan` int(11) DEFAULT NULL,
`tanggal` date DEFAULT NULL,
`jam_masuk` time DEFAULT NULL,
`jam_keluar` time DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `kehadiran`
--
INSERT INTO `kehadiran` (`id_kehadiran`, `id_karyawan`, `tanggal`, `jam_masuk`, `jam_keluar`) VALUES
(1, 1, '2019-09-02', '07:30:00', '16:00:00'),
(2, 1, '2019-09-03', '08:00:00', '16:30:00'),
(3, 4, '2019-09-02', '07:50:00', '17:00:00'),
(4, 2, '2019-09-02', '08:10:00', '17:30:00'),
(6, 4, '2019-09-13', '14:32:23', '14:38:14');
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `jabatan`
--
ALTER TABLE `jabatan`
ADD PRIMARY KEY (`id_jabatan`);
--
-- Indeks untuk tabel `karyawan`
--
ALTER TABLE `karyawan`
ADD PRIMARY KEY (`id_karyawan`),
ADD KEY `id_jabatan` (`id_jabatan`);
--
-- Indeks untuk tabel `kehadiran`
--
ALTER TABLE `kehadiran`
ADD PRIMARY KEY (`id_kehadiran`),
ADD KEY `id_karyawan` (`id_karyawan`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `jabatan`
--
ALTER TABLE `jabatan`
MODIFY `id_jabatan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `karyawan`
--
ALTER TABLE `karyawan`
MODIFY `id_karyawan` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT untuk tabel `kehadiran`
--
ALTER TABLE `kehadiran`
MODIFY `id_kehadiran` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- Ketidakleluasaan untuk tabel pelimpahan (Dumped Tables)
--
--
-- Ketidakleluasaan untuk tabel `karyawan`
--
ALTER TABLE `karyawan`
ADD CONSTRAINT `karyawan_ibfk_1` FOREIGN KEY (`id_jabatan`) REFERENCES `jabatan` (`id_jabatan`) ON DELETE CASCADE ON UPDATE CASCADE;
--
-- Ketidakleluasaan untuk tabel `kehadiran`
--
ALTER TABLE `kehadiran`
ADD CONSTRAINT `kehadiran_ibfk_1` FOREIGN KEY (`id_karyawan`) REFERENCES `karyawan` (`id_karyawan`) 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 */;
|
-- Adminer 4.7.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`username` varchar(50) NOT NULL,
`password` varchar(100) NOT NULL,
`user_type` varchar(100) NOT NULL,
PRIMARY KEY (`username`,`password`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `users` (`username`, `password`, `user_type`) VALUES
('admin', 'e4', 'admin'),
('kilian', 'user2', 'user'),
('roman', 'user3', 'user'),
('user', 'u', 'user'),
('virgile', 'user4', 'user');
-- 2020-11-09 10:32:27 |
###################
# INVALID OBJECTS #
###################
-- find a user's invalid objects
select object_name, object_type, status from user_objects where status != 'VALID';
-- find all invalid objects
set lines 120 pagesize 100
col owner format a20
col object_name format a25
select owner, object_name, object_type from dba_objects
where status != 'VALID' order by owner, object_name;
-- invalid system objects
set lines 120 pagesize 100
col owner format a20
col object_name format a25
select owner, object_name, object_type from dba_objects
where status != 'VALID' and owner in ('SYS','SYSTEM')
order by owner, object_name;
-- by user, type
set lines 120 pagesize 100
col owner format a30
break on owner
select owner, object_type, count(*) from dba_objects
where status != 'VALID'
group by owner, object_type
order by 1,2 desc;
-- by user
set lines 120 pagesize 100
col owner format a30
select owner, count(*) from dba_objects
where status != 'VALID'
group by owner
order by 2 desc;
-- recompile a view
alter view CTRL_RISK_DETAILS_TMP_VW compile;
alter materialized view CTRL_RISK_DETAILS_TMP_VW compile;
-- recompile an index
alter index I_PROXY_ROLE_DATA$_1 compile;
-- rebuild an index
alter index I_PROXY_ROLE_DATA$_1 rebuild;
-- recompile a PL/SQL package
alter package PARALLEL_JOBS_PKG compile;
-- recompile a package body
alter package PARALLEL_JOBS_PKG compile body;
-- recompile a trigger
alter trigger PARALLEL_JOBS_PKG compile;
-- recompile a user's invalid objects
set pagesize 0
set linesize 500
set head off
spool recomp_all.out
select 'alter package '||object_name||' compile package;'
from user_objects where object_type like 'PACKAGE%' and status != 'VALID';
select 'alter function '||object_name||' compile;'
from user_objects where object_type='FUNCTION' and status != 'VALID';
select 'alter procedure '||object_name||' compile;'
from user_objects where object_type='PROCEDURE' and status != 'VALID';
select 'alter view '||object_name||' compile;'
from user_objects where object_type='VIEW' and status != 'VALID';
spool off
@recomp_all.out
-- recompile all invalid objects
set pagesize 0
set linesize 500
set head off
spool recomp_all.out
select 'alter package '||owner||'.'||object_name||' compile package;'
from dba_objects where object_type like 'PACKAGE%' and status != 'VALID';
select 'alter function '||owner||'.'||object_name||' compile;'
from dba_objects where object_type='FUNCTION' and status != 'VALID';
select 'alter procedure '||owner||'.'||object_name||' compile;'
from dba_objects where object_type='PROCEDURE' and status != 'VALID';
select 'alter view '||owner||'.'||object_name||' compile;'
from dba_objects where object_type='VIEW' and status != 'VALID';
spool off
@recomp_all.out
-- OR --
set pagesize 0
set linesize 500
set head off
spool recomp_all.out
select distinct 'exec DBMS_UTILITY.COMPILE_SCHEMA('''||owner||''');'
from dba_objects where status != 'VALID';
spool off
@recomp_all.out
-- #############
-- # ORA-08102 #
-- #############
-- verify table is not corrupt
analyze table &tblname validate structure;
-- find offensive object
select owner, object_name, object_type from dba_objects where object_id=818188;
-- get DDL to recreate object
set long 10000000
select dbms_metadata.get_ddl('INDEX','USRUSER_IX04','ACTD00') from dual;
-- drop the object (may be different if not an index)
drop index USRUSER_IX04;
-- use DDL to recreate it
|
SELECT
date,
p.id as player_id,
name,
case
when plans=0 then '×'
when plans=1 then '△'
when plans=2 then '○'
end as plans,
sc_password,
te.team_id as team_id,
team_name,
mst_id
FROM m_schedule m
LEFT OUTER JOIN t_schedule t ON m.id=t.mst_id
LEFT OUTER JOIN player p ON p.id=t.player_id
LEFT OUTER JOIN team te ON te.team_id=p.team_id
order by player_id,date |
-- drop table account;
create table account (
sno int NOT NULL AUTO_INCREMENT,
userid varchar(50) NOT NULL,
password varchar(20) NOT NULL,
PRIMARY KEY(sno)
);
insert into account (userid, password) values('admin', 'admin');
-- drop table records;
create table records (
id int NOT NULL AUTO_INCREMENT,
members int NOT NULL,
batch varchar(8) NOT NULL,
eventType varchar(10) NOT NULL,
j1 int DEFAULT '0',
j2 int DEFAULT '0',
j3 int DEFAULT '0',
PRIMARY KEY(id)
);
insert into records (members, batch, eventType, j1, j2, j3) values('5','THIRD', 'DRAMA', '10', '10', '10'); |
SELECT *
FROM tb_ComprobanteCompra
WHERE ComprobanteID IN ("01","02","07","08") |
SELECT id, name, split_part( characteristics, ',' , 1 ) as characteristic
FROM monsters
ORDER BY id; |
set serveroutput on;
execute insertarmesas('RA01');
execute insertarmesas('RA02');
execute insertarmesas('RA03');
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 15, 2020 at 03:49 AM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `atm`
--
-- --------------------------------------------------------
--
-- Table structure for table `error`
--
CREATE TABLE `error` (
`id_eror` varchar(5) NOT NULL,
`masalah` varchar(256) NOT NULL,
`solusi` varchar(512) NOT NULL,
`tgl_input` timestamp NOT NULL DEFAULT current_timestamp(),
`tgl_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `error`
--
INSERT INTO `error` (`id_eror`, `masalah`, `solusi`, `tgl_input`, `tgl_update`) VALUES
('E0001', 'Alat printer terlalu panas', 'Dinginkan mesin printer dengan melepas semua konektor', '2020-06-14 02:50:28', '2020-06-14 02:50:28'),
('E0002', 'Kertas macet', 'Pertama keluarkan sisa kertas yang macet dari printer, Kedua bersihkan sobekan kertas yang ada di jalur keluar kertas, dan yang terakhir bersihkan roda roller printer', '2020-06-14 02:50:28', '2020-06-14 02:50:28'),
('E0003', 'Kertas print habis', 'Pertama ganti kertas print dengan yang baru, Kedua cek sensor print, terakhir cek kabel konektor', '2020-06-14 02:53:42', '2020-06-14 02:53:42'),
('E0004', 'Kesalahan pemotongan kertas', 'Pertama cek alat pemotong, cek presisi ukuran pemotong, periksa status pengaturan printer, cek sensor print, dan cek kabel konektor', '2020-06-14 02:53:42', '2020-06-14 02:53:42'),
('E0005', 'Printer tidak merespon', 'reset printer lewat aplikasi operator, cek pengaturan pada aplikasi, cek kabel konektor, cek kabel jaringan, opsi terakhir restart ATM', '2020-06-14 02:55:21', '2020-06-14 02:55:21'),
('E0006', 'Tuas pembuka kertas terbuka', 'Tutup tuas keluar kertas, dan cek sensor keluar kertas', '2020-06-14 02:55:21', '2020-06-14 02:55:21'),
('E0007', 'Ukuran cetak gambar tidak normal', 'cek posisi kertas, cek pengaturan ukuran pemotong pada sistem, dan cek pemotong kertas', '2020-06-14 02:57:28', '2020-06-14 02:57:28'),
('E0008', 'Kartu didalam cardreader', 'keluarkan kartu didalam cardreader', '2020-06-14 02:57:28', '2020-06-14 02:57:28'),
('E0009', 'Tidak dapat membaca kartu', 'cek kabel konektor cardreader, cek kabel jaringan, reset cardreader lewat aplikasi operator, dan cek pengaturan pada aplikasi', '2020-06-14 02:59:39', '2020-06-14 02:59:39'),
('E0010', 'Kartu Tertolak', 'keluarkan kartu didalam cardreader, cek kabel konektor cardreader, dan cek pengunci mulut kartu', '2020-06-14 02:59:39', '2020-06-14 02:59:39'),
('E0011', 'Kartu tidak bisa keluar', 'buka pengunci mulut cardreader, cek kabel konektor cardreader, dan bersihkan sensor cardreader', '2020-06-14 03:02:34', '2020-06-14 03:02:34'),
('E0012', 'Layar mati', 'cek kelistrikan utama dan ATM, restart ATM, cek kabel VGA, dan cek AD-BOARD', '2020-06-14 03:02:34', '2020-06-14 03:02:34'),
('E0013', 'Menu tidak lengkap', 'restart ATM, cek jaringan, dan cek harddisk', '2020-06-14 03:03:44', '2020-06-14 03:03:44'),
('E0014', 'Tampilan layar 002', 'restart modem, dan restart ATM', '2020-06-14 03:03:44', '2020-06-14 03:03:44'),
('E0015', 'Tampilan layar 001', 'setting konfigurasi jaringan ATM, setting konfigurasi modem, dan restart ATM', '2020-06-14 03:05:37', '2020-06-14 03:05:37'),
('E0016', 'Tampilan layar 003', 'tutup dan kunci brankas dengan baik dan benar', '2020-06-14 03:05:37', '2020-06-14 03:05:37'),
('E0017', 'Tidak dapat mengeluarkan uang', 'cek sensor cassete, cek sensor dispenser, dan cek sensor exit shutter', '2020-06-14 03:07:01', '2020-06-14 03:07:01'),
('E0018', 'Dispenser tidak bekerja', 'cek kabel konektor, cek motherboard, dan cek sensor tangan robot', '2020-06-14 03:07:01', '2020-06-14 03:07:01'),
('E0019', 'Mulut exit shutter tidak terbuka', 'cek tangan robot, cek kabel fleksibel, dan cek sensor exit shutter', '2020-06-14 03:08:30', '2020-06-14 03:08:30'),
('E0020', 'Tombol tidak berfungsi', 'restart ATM, input ulang masterkey atau ganti masterkey', '2020-06-14 03:08:30', '2020-06-14 03:08:30');
-- --------------------------------------------------------
--
-- Table structure for table `informasi_error`
--
CREATE TABLE `informasi_error` (
`id_informasi` int(11) NOT NULL,
`id_eror` varchar(5) DEFAULT NULL,
`id_teknisi` varchar(8) NOT NULL,
`id_mesin` varchar(3) NOT NULL,
`komentar` varchar(256) NOT NULL,
`tgl_input` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `informasi_error`
--
INSERT INTO `informasi_error` (`id_informasi`, `id_eror`, `id_teknisi`, `id_mesin`, `komentar`, `tgl_input`) VALUES
(1, 'E0001', 'T0000001', 'M01', 'Mesin Sudah terselesaikan dengan baik', '2020-06-14 07:16:54');
-- --------------------------------------------------------
--
-- Table structure for table `mesin`
--
CREATE TABLE `mesin` (
`id_mesin` varchar(3) NOT NULL,
`tipe_mesin` varchar(20) NOT NULL,
`keterangan` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `mesin`
--
INSERT INTO `mesin` (`id_mesin`, `tipe_mesin`, `keterangan`) VALUES
('M01', 'Hyosung', 'made in korea'),
('M02', 'Wincor', 'made in germany'),
('M03', 'NCR', 'made in United States'),
('M04', 'Diebold', ''),
('M05', 'Hitachi', ''),
('M06', 'OKI', '');
-- --------------------------------------------------------
--
-- Table structure for table `teknisi`
--
CREATE TABLE `teknisi` (
`id_teknisi` varchar(8) NOT NULL,
`nama_teknisi` varchar(60) NOT NULL,
`alamat` varchar(100) NOT NULL,
`no_hp` varchar(20) NOT NULL,
`email` varchar(40) NOT NULL,
`tgl_input` timestamp NOT NULL DEFAULT current_timestamp(),
`tgl_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `teknisi`
--
INSERT INTO `teknisi` (`id_teknisi`, `nama_teknisi`, `alamat`, `no_hp`, `email`, `tgl_input`, `tgl_update`) VALUES
('T0000001', 'Dwi Hananto', 'Kel.Mojosongo Kec.Jebres Kota Surakarta', '082242009199', 'solohananto@gmail.com', '2020-06-14 03:34:57', '2020-06-14 03:34:57');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id_user` mediumint(9) NOT NULL,
`username` varchar(20) NOT NULL,
`password` varchar(20) NOT NULL,
`id_teknisi` varchar(8) NOT NULL,
`tgl_input` timestamp NOT NULL DEFAULT current_timestamp(),
`tgl_update` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id_user`, `username`, `password`, `id_teknisi`, `tgl_input`, `tgl_update`) VALUES
(1, 'hananto', 'hananto', 'T0000001', '2020-06-14 03:36:48', '2020-06-14 03:36:48');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `error`
--
ALTER TABLE `error`
ADD PRIMARY KEY (`id_eror`),
ADD KEY `id_eror` (`id_eror`);
--
-- Indexes for table `informasi_error`
--
ALTER TABLE `informasi_error`
ADD PRIMARY KEY (`id_informasi`),
ADD KEY `id_teknisi` (`id_teknisi`),
ADD KEY `id_mesin` (`id_mesin`),
ADD KEY `id_error` (`id_eror`);
--
-- Indexes for table `mesin`
--
ALTER TABLE `mesin`
ADD PRIMARY KEY (`id_mesin`),
ADD KEY `id_mesin` (`id_mesin`);
--
-- Indexes for table `teknisi`
--
ALTER TABLE `teknisi`
ADD PRIMARY KEY (`id_teknisi`),
ADD KEY `id_teknisi` (`id_teknisi`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id_user`),
ADD KEY `id_user` (`id_user`),
ADD KEY `id_teknisi` (`id_teknisi`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `informasi_error`
--
ALTER TABLE `informasi_error`
MODIFY `id_informasi` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id_user` mediumint(9) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `informasi_error`
--
ALTER TABLE `informasi_error`
ADD CONSTRAINT `informasi_error_ibfk_1` FOREIGN KEY (`id_teknisi`) REFERENCES `teknisi` (`id_teknisi`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `informasi_error_ibfk_2` FOREIGN KEY (`id_mesin`) REFERENCES `mesin` (`id_mesin`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `informasi_error_ibfk_3` FOREIGN KEY (`id_eror`) REFERENCES `error` (`id_eror`) ON DELETE SET NULL ON UPDATE CASCADE;
--
-- Constraints for table `user`
--
ALTER TABLE `user`
ADD CONSTRAINT `user_ibfk_1` FOREIGN KEY (`id_teknisi`) REFERENCES `teknisi` (`id_teknisi`) 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 */;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.