blob_id stringlengths 40 40 | language stringclasses 1
value | repo_name stringlengths 5 133 | path stringlengths 3 276 | src_encoding stringclasses 33
values | length_bytes int64 23 9.61M | score float64 2.52 5.28 | int_score int64 3 5 | detected_licenses listlengths 0 44 | license_type stringclasses 2
values | text stringlengths 23 9.43M | download_success bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|
1a163ae0a962d91d919a4c2f329f95054ef20d41 | SQL | aiodauidha/c3-wwn | /week5/src/34.sql | UTF-8 | 133 | 3.078125 | 3 | [] | no_license | USE test;
SELECT DISTINCT t1.SNO
FROM Student t1,
Choose t2
WHERE t1.SNO = t2.SNO AND (t2.CourseID = "C1" OR t2.CourseID = "C3"); | true |
2d7b5d720ccae2b647f7a77303de6b95766c025e | SQL | OvidiuEDSgrup/TET | /IMPL/SALARIATI.sql | UTF-8 | 2,282 | 2.546875 | 3 | [] | no_license | SELECT TOP 0 *
INTO SALARIATI_PERSONAL
FROM PERSONAL
----INSERT SALARIATI_PERSONAL
SELECT --*,
LEFT(S.COD,6) --Marca char 6
,LEFT(S.NUME,50) --Nume char 50
,LEFT(ISNULL((SELECT MAX(f.Cod_functie) FROM functii f where f.Denumire like s.functie),s.functie),6) --Cod_functie char 6
,'1' --Loc_de_munca char 9
,0 --Loc_de_munca_din_pontaj bit 1
,'' --Categoria_salarizare char 4
,'' --Grupa_de_munca char 1
,0 --Salar_de_incadrare float 8
,0 --Salar_de_baza float 8
,0 --Salar_orar float 8
,'' --Tip_salarizare char 1
,'' --Tip_impozitare char 1
,0 --Pensie_suplimentara smallint 2
,0 --Somaj_1 smallint 2
,0 --As_sanatate smallint 2
,0 --Indemnizatia_de_conducere float 8
,0 --Spor_vechime real 4
,0 --Spor_de_noapte real 4
,0 --Spor_sistematic_peste_program real 4
,0 --Spor_de_functie_suplimentara float 8
,0 --Spor_specific float 8
,0 --Spor_conditii_1 float 8
,0 --Spor_conditii_2 float 8
,0 --Spor_conditii_3 float 8
,0 --Spor_conditii_4 float 8
,0 --Spor_conditii_5 float 8
,0 --Spor_conditii_6 float 8
,0 --Sindicalist bit 1
,0 --Salar_lunar_de_baza float 8
,0 --Zile_concediu_de_odihna_an smallint 2
,0 --Zile_concediu_efectuat_an smallint 2
,0 --Zile_absente_an smallint 2
,'' --Vechime_totala datetime 8
,'' --Data_angajarii_in_unitate datetime 8
,'' --Banca char 25
,'' --Cont_in_banca char 25
,null --Poza image 16
,CASE LEFT(S.CNP,1) WHEN '1' THEN 1 WHEN 2 THEN 0 ELSE NULL END --Sex bit 1
,'19'+STUFF(STUFF(RIGHT(LEFT(S.CNP,7),6),3,0,'-'),6,0,'-') --Data_nasterii datetime 8
,LEFT(S.CNP,13) --Cod_numeric_personal char 13
,'' --Studii char 10
,'' --Profesia char 10
,'' --Adresa char 30
,'' --Copii char 30
,0 --Loc_ramas_vacant bit 1
,'' --Localitate char 30
,'' --Judet char 15
,'' --Strada char 25
,'' --Numar char 5
,0 --Cod_postal int 4
,'' --Bloc char 10
,'' --Scara char 2
,'' --Etaj char 2
,'' --Apartament char 5
,0 --Sector smallint 2
,'' --Mod_angajare char 1
,'' --Data_plec datetime 8
,'' --Tip_colab char 3
,'' --grad_invalid char 1
,0 --coef_invalid real 4
,0 --alte_surse bit 1
-- SELECT *
from SALARIATI S
SELECT STUFF('832332',3,0,'-')
--select *
--into personal_agv
--from personal
--TRUNCATE table personal
--INSERT personal
select * from SALARIATI_PERSONAL
select * from personal
select * from functii
--UPDATE personal
set Cod_functie='1' | true |
6f35457e21fc39a71f6524e9d7069373305bbf3c | SQL | sensoham21/Van_Order | /Question1.sql | UTF-8 | 156 | 2.953125 | 3 | [] | no_license | SELECT DATE_FORMAT(order_datetime, '%H') AS Hour_of_day,
COUNT(idvanOrder) AS Count_of_order
FROM vanorder
GROUP BY Hour_of_day
ORDER BY Hour_of_day; | true |
97d16c9a1d457efe0c0503ce33956b6a78b01dc2 | SQL | bellmit/origin | /family_order/sql/.svn/pristine/97/97d16c9a1d457efe0c0503ce33956b6a78b01dc2.svn-base | UTF-8 | 1,306 | 2.53125 | 3 | [] | no_license | SELECT /*+use_nl(b)*/a.partition_id,to_char(a.user_id) user_id,a.biz_code,a.pre_charge,to_char(a.max_item_pre_day) max_item_pre_day,to_char(a.max_item_pre_mon) max_item_pre_mon,a.is_text_ecgn,a.default_ecgn_lang,a.text_ecgn_en,a.text_ecgn_zh,to_char(a.start_date,'yyyy-mm-dd hh24:mi:ss') start_date,to_char(a.end_date,'yyyy-mm-dd hh24:mi:ss') end_date,a.rsrv_num1,a.rsrv_num2,a.rsrv_num3,to_char(a.rsrv_num4) rsrv_num4,to_char(a.rsrv_num5) rsrv_num5,a.rsrv_str1,a.rsrv_str2,a.rsrv_str3,a.rsrv_str4,a.rsrv_str5,to_char(a.rsrv_date1,'yyyy-mm-dd hh24:mi:ss') rsrv_date1,to_char(a.rsrv_date2,'yyyy-mm-dd hh24:mi:ss') rsrv_date2,to_char(a.rsrv_date3,'yyyy-mm-dd hh24:mi:ss') rsrv_date3
FROM tf_f_user_grpmbmp_info a,tf_f_cust_group b,tf_f_user c
WHERE b.group_id=:GROUP_ID
AND b.remove_tag = '0'
AND b.cust_id=c.cust_id
AND c.remove_tag = '0'
AND c.user_id=a.user_id
AND mod(c.user_id,10000)=a.partition_id
AND a.end_date>SYSDATE
AND c.product_id IN (SELECT param_code FROM td_s_commpara
WHERE param_attr=:PARAM_ATTR
AND param_code<>:PRODUCT_ID
AND para_code5=:PARA_CODE5
AND (eparchy_code = :EPARCHY_CODE OR :EPARCHY_CODE IS NULL)
AND end_date>SYSDATE) | true |
490410b69749f10396cfada11ce20252dbef39c2 | SQL | annavolkova1/test_case_1 | /src/main/resources/db/migration/changelog.sql | UTF-8 | 502 | 3.046875 | 3 | [] | no_license | -- liquibase formatted sql
-- changeset anna:11
DROP TABLE IF EXISTS well;
CREATE TABLE IF NOT EXISTS well
(
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` VARCHAR(32) NOT NULL UNIQUE
);
DROP TABLE IF EXISTS equipment;
CREATE TABLE IF NOT EXISTS equipment
(
`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
`name` VARCHAR(32) NOT NULL UNIQUE,
`Well_id` INTEGER,
FOREIGN KEY (`Well_id`)
REFERENCES well(id)
ON DELETE CASCADE
);
-- mvn liquibase:update | true |
61e3b5e037c29f5cc293b1c49cea75b98859686f | SQL | AuthorProxy/HackerRankChallenges | /SQL/03. Aggregation/002. Revising Aggregations - The Sum Function.sql | UTF-8 | 167 | 2.890625 | 3 | [
"MIT"
] | permissive | -- # Problem: https://www.hackerrank.com/challenges/revising-aggregations-sum/problem
-- # Score: 10
SELECT SUM(POPULATION) FROM City WHERE District = 'California';
| true |
1c95462570eec20a9d2f29c655dee12f2f4c3afa | SQL | butter-fly/belling-ImChat | /src/main/webapp/sql/imchat.sql | UTF-8 | 1,518 | 3.078125 | 3 | [] | no_license | /*
MySQL Data Transfer
Source Host: localhost
Source Database: imchat
Target Host: localhost
Target Database: imchat
Date: 2017/3/29 10:01:41
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`userid` varchar(255) DEFAULT NULL COMMENT '用户名',
`password` varchar(255) DEFAULT NULL COMMENT '密码',
`nickname` varchar(255) DEFAULT NULL COMMENT '昵称',
`sex` int(1) DEFAULT NULL COMMENT '性别',
`age` int(5) DEFAULT NULL COMMENT '年龄',
`profilehead` varchar(255) DEFAULT NULL COMMENT '头像',
`profile` varchar(255) DEFAULT NULL COMMENT '简介',
`firsttime` varchar(255) DEFAULT NULL COMMENT '注册时间',
`lasttime` varchar(255) DEFAULT NULL COMMENT '最后登录时间',
`status` int(1) DEFAULT NULL COMMENT '账号状态(1正常 0禁用)',
KEY `userid` (`userid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records
-- ----------------------------
INSERT INTO `t_user` VALUES ('王五', '123', '测试用户', '1', '23', null, null, '2017-01-11 19:22:21', '2017-03-27 16:27:03', '1');
INSERT INTO `t_user` VALUES ('管理员', '123', '蝴蝶飞飞', '1', '23', null, null, '2017-01-11 19:22:21', '2017-03-27 16:31:54', '1');
INSERT INTO `t_user` VALUES ('张三', '123', '张三', '1', '34', null, null, null, null, '1');
INSERT INTO `t_user` VALUES ('李四', '123', '李四', '1', '15', null, null, null, null, '1');
| true |
7f1fb8122021bfd1b58c20677f254830bb9039d5 | SQL | sergiomm116/DAMGit | /BASES DE DATOS/EJERCICIOS/TEMA 3 - CONSULTAS SQL/1-CONSULTAS BASICAS SQL/EJERCICIOS_CONSULTAS_HOSPITAL.sql | UTF-8 | 919 | 3.171875 | 3 | [] | no_license | -- EJERCICIO 1
SELECT MEDICO, APELLIDO, NOMBRE FROM MEDICOS WHERE ESPECIALIDAD='2' AND UNIVERSIDAD LIKE "%MADRID%" OR "%Madrid%"
-- EJERCICIO 2
SELECT NOMBRE, APELLIDOS FROM ENFERMEROS WHERE SEXO="M" AND
-- EJERCICIO 3
SELECT NOMBRE, APELLIDOS, EDAD, POBLACION FROM PACIENTES WHERE CODIGOPOSTAL LIKE "28%" AND TELEFONO LIKE "%54"
-- EJERCICIO 4
SELECT * FROM PACIENTES WHERE DNI IN(SELECT DNI FROM INGRESOS WHERE COD_ENFERMERO="A002"
-- EJERCICIO 5
SELECT NOMBRE, APELLIDOS, NOMBRE_ENFERMEDAD FROM PACIENTES, ENFERMEDADES WHERE ORIGEN="VIRICO" AND AÑO_DESCUBRIMIENTO>="1925"
-- EJERCICIO 6
SELECT * FROM PACIENTES WHERE FECHA_ALTA IS NULL
-- EJERCICIO 7
SELECT * FROM PACIENTES WHERE DNI IN (SELECT DNI FROM INGRESOS WHERE COD_ENFERMEDAD IN (SELECT COD_ENFERMEDAD FROM ENFERMEDADES WHERE NOMBRE="HEPATITIS"))
-- EJERCICIO 8
SELECT * FROM MEDICOS WHERE COD_MEDICO NOT EXISTS IN (SELECT COD_MEDICO FROM PACIENTE)
| true |
f716e59da3b177fbf49b4daeb8baa72a29aadfcb | SQL | mbeven/FINM_2016_SPRING | /FINM 32400/quickfix-1.14.3/quickfix/src/sql/mysql/messages_log_table.sql | UTF-8 | 705 | 2.9375 | 3 | [
"BSD-2-Clause"
] | permissive | USE quickfix;
DROP TABLE IF EXISTS messages_log;
CREATE TABLE messages_log (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
time DATETIME NOT NULL,
time_milliseconds INT NOT NULL,
beginstring CHAR(8),
sendercompid VARCHAR(64),
targetcompid VARCHAR(64),
session_qualifier VARCHAR(64),
text BLOB NOT NULL,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS messages_backup_log;
CREATE TABLE messages_backup_log (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
time DATETIME NOT NULL,
time_milliseconds INT NOT NULL,
beginstring CHAR(8),
sendercompid VARCHAR(64),
targetcompid VARCHAR(64),
session_qualifier VARCHAR(64),
text BLOB NOT NULL,
PRIMARY KEY (id)
);
| true |
5268307e0e7950d98db95e73539ac770727507d2 | SQL | rishitaggarwal1/Tutor_Finder | /sql_file/tutor_finder.sql | UTF-8 | 4,349 | 3.125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 05, 2020 at 08:22 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 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: `tutor_finder`
--
-- --------------------------------------------------------
--
-- Table structure for table `tution_request`
--
CREATE TABLE `tution_request` (
`tution_id` int(11) NOT NULL,
`student_id` int(11) NOT NULL,
`tutor_id` int(11) NOT NULL,
`is_accepted` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tution_request`
--
INSERT INTO `tution_request` (`tution_id`, `student_id`, `tutor_id`, `is_accepted`) VALUES
(1591373751, 1591118807, 1, 0),
(1591373839, 1591118807, 1591286557, 1),
(1591375699, 1591118807, 0, -1);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`user_id` int(11) NOT NULL,
`name` varchar(60) NOT NULL,
`email_id` varchar(60) NOT NULL,
`password` varchar(200) NOT NULL,
`mobile` varchar(20) NOT NULL,
`type` varchar(25) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`user_id`, `name`, `email_id`, `password`, `mobile`, `type`) VALUES
(0, 'Rishit Aggarwal', 'rishitaggarwal1@gmail.com', '81dc9bdb52d04dc20036dbd8313ed055', '7015457296', 'Tutor'),
(1, 'Ritik Aggarwal', 'ritikaggarwal@gmail.com', '81dc9bdb52d04dc20036dbd8313ed055', '7015457529', 'Tutor'),
(1591118807, 'RA', 'ra@ra.com', '81dc9bdb52d04dc20036dbd8313ed055', '1234', 'Student'),
(1591286557, 'Abcd', 'a@a.com', '81dc9bdb52d04dc20036dbd8313ed055', '9996505966', 'Tutor');
-- --------------------------------------------------------
--
-- Table structure for table `user_information`
--
CREATE TABLE `user_information` (
`user_id` int(11) NOT NULL,
`highest_qualification` varchar(50) NOT NULL DEFAULT '-',
`gender` varchar(20) NOT NULL,
`address` varchar(200) NOT NULL DEFAULT '-',
`district` varchar(50) NOT NULL DEFAULT '-',
`state` varchar(50) NOT NULL DEFAULT '-',
`above_class` varchar(50) NOT NULL,
`subject1` varchar(50) NOT NULL,
`subject2` varchar(50) NOT NULL,
`subject3` varchar(50) NOT NULL,
`average_tution_fees` varchar(50) NOT NULL DEFAULT '-',
`about` varchar(200) NOT NULL,
`recent_school` varchar(100) NOT NULL,
`profile_image` varchar(200) NOT NULL,
`degree_image` varchar(200) NOT NULL,
`resume` varchar(200) NOT NULL,
`rating` int(11) NOT NULL DEFAULT '0',
`people_rated` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_information`
--
INSERT INTO `user_information` (`user_id`, `highest_qualification`, `gender`, `address`, `district`, `state`, `above_class`, `subject1`, `subject2`, `subject3`, `average_tution_fees`, `about`, `recent_school`, `profile_image`, `degree_image`, `resume`, `rating`, `people_rated`) VALUES
(0, 'B.Tech', 'Male', 'Meerut', 'Meerut', 'Uttar Pradesh', '10th', 'Physics', 'Chemistry', 'Maths', '10,000', 'Very Passionate to do work.', 'Arya Senior Seconday School', '1.jpg', '1.jpg', '1.jpg', 2, 5),
(1, 'MSc (Science)', 'Male', 'Kurukshetra', 'Kurukshetra', 'Haryana', '9th', 'Physics', 'Chemistry', 'Biology', '5000', 'Love to do work.', 'D.A.V. Public School', '1.jpg', '1.jpg', '1.jpg', 4, 4),
(1591286557, 'M.S (Science)', 'Male', 'Dehradun', 'Dehradun', 'Uttrakhand', '11th', 'Physics', 'Chemistry', 'Biology', '8000', 'Very hardworking.', 'DPS Public School', '1.jpg', '', '', 4, 3);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tution_request`
--
ALTER TABLE `tution_request`
ADD PRIMARY KEY (`tution_id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`user_id`),
ADD UNIQUE KEY `email_id` (`email_id`);
--
-- Indexes for table `user_information`
--
ALTER TABLE `user_information`
ADD PRIMARY KEY (`user_id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
9374ad4ede854e20fac11e1213a08b73cfd5a3b3 | SQL | SpurgeonPrakash/Complete-SQL-Mastery | /16 creating a copy of table.sql | UTF-8 | 434 | 3.0625 | 3 | [] | no_license | create table MALE_Salaries as
SELECT e.emp_no,e.birth_date,e.gender,s.salary FROM employees.employees e
join employees.salaries s
on e.emp_no=s.emp_no
where e.gender = 'M'
# emp_no, birth_date, gender, salary
10001, 1953-09-02, M, 60117
10002, 1953-09-02, M, 62102
10003, 1953-09-02, M, 66074
10004, 1953-09-02, M, 66596
10005, 1953-09-02, M, 66961
10006, 1953-09-02, M, 71046
10007, 1953-09-02, M, 74333
10008, 1953-09-02, M, 75286 | true |
964611ccc2ffd3f3d517297e688be29ecb0db0e2 | SQL | DANIELEGBETABI/siga-geolocator | /app/sql/ClientesUltimaVenta.sql | UTF-8 | 1,127 | 3.375 | 3 | [] | no_license | SELECT
[Clientes].NroDocumento
,[Clientes].NombreCliente
,[Clientes].Direccion
,[Localidades].NombreLocalidad
,LEFT([Localidades].IdLocalidad,4) AS CodigoPostal
,[Provincias].NombreProvincia
,[Clientes].Telefono
,[Clientes].Celular
,[Empleados].NombreEmpleado AS Vendedor
,[Clientes].Activo
,( SELECT TOP 1 [Ventas].[Fecha]
FROM [Ventas]
WHERE ([Ventas].[NroDocCliente] = [Clientes].NroDocumento)
AND ([Ventas].[IdTipoComprobante] = 'COTIZACION' OR [Ventas].[IdTipoComprobante] = 'FACT')
ORDER BY [Ventas].Fecha DESC
) AS UltimaVenta
,( SELECT SUM([Ventas].[ImporteTotal])
FROM [Ventas]
WHERE ([Ventas].[NroDocCliente] = [Clientes].NroDocumento)
AND ([Ventas].[IdTipoComprobante] = 'COTIZACION' OR [Ventas].[IdTipoComprobante] = 'FACT')
AND ([Ventas].Fecha > DATEADD(YEAR, -1, GETDATE()))
) AS VentaUltimoAno
FROM [Clientes]
LEFT JOIN [Localidades] ON ([Clientes].IdLocalidad = [Localidades].IdLocalidad)
LEFT JOIN [Provincias] ON ([Localidades].IdProvincia = [Provincias].IdProvincia)
LEFT JOIN [Empleados] ON ([Clientes].NroDocVendedor = [Empleados].NroDocEmpleado)
ORDER BY UltimaVenta DESC | true |
3d7aa74888d0ef8523e0849a1f84f57e698b249e | SQL | catarinamachado/uminho-miei | /3/BD/EventsWorkbench/Manipulation/QuerieView.sql | UTF-8 | 690 | 3.1875 | 3 | [] | no_license | CREATE VIEW FDivulgacaoInfluencia as
Select
D.*,
count(PEPD.Participante_Entidade_Id) as Influenciados
From
Divulgacao as D,
PermiteEntrada_Evento_Participante_Divulgacao as PEPD
where
PEPD.Divulgacao_id = D.id
group by
PEPD.Divulgacao_id
order by
count(PEPD.Participante_Entidade_Id) DESC;
CREATE VIEW FContagemTipoDivulgacao as
Select
D.tipo,
count(D.tipo) as Contagem
From
Divulgacao as D,
PermiteEntrada_Evento_Participante_Divulgacao as PEPD
where
PEPD.Divulgacao_id = D.id
group by
D.tipo
order by
count(D.tipo) DESC;
| true |
e08056805a6e71bfb148a693e7f217b160ea9b8f | SQL | MigeloR/Catalogador | /pkmn_data.sql | UTF-8 | 4,118 | 3.203125 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.6.49, for Win64 (x86_64)
--
-- Host: localhost Database: pkmn
-- ------------------------------------------------------
-- Server version 5.6.49-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `pkmn_tipos`
--
DROP TABLE IF EXISTS `pkmn_tipos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pkmn_tipos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pkmn_id` int(11) DEFAULT NULL,
`tipos_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pkmn_tipos`
--
LOCK TABLES `pkmn_tipos` WRITE;
/*!40000 ALTER TABLE `pkmn_tipos` DISABLE KEYS */;
INSERT INTO `pkmn_tipos` VALUES (1,1,11),(2,1,16),(3,2,11),(4,2,16),(5,3,11),(6,3,16),(7,4,4),(8,5,4),(9,6,4),(10,6,17),(11,7,1),(12,8,1),(13,9,1),(14,10,3),(15,11,3),(16,12,3),(17,12,17),(18,13,3),(19,13,16),(20,14,3),(21,14,16),(22,15,3),(23,15,16),(24,16,12),(25,16,17),(26,17,12),(27,17,17),(28,18,12),(29,18,17);
/*!40000 ALTER TABLE `pkmn_tipos` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `pokemon`
--
DROP TABLE IF EXISTS `pokemon`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `pokemon` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(70) DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `pokemon`
--
LOCK TABLES `pokemon` WRITE;
/*!40000 ALTER TABLE `pokemon` DISABLE KEYS */;
INSERT INTO `pokemon` VALUES (15,'beedrill'),(9,'blastoise'),(1,'bulbasaur'),(12,'butterfree'),(10,'caterpie'),(6,'charizard'),(4,'charmander'),(5,'charmeleon'),(2,'ivysaur'),(14,'kakuna'),(11,'metapod'),(18,'pidgeot'),(17,'pidgeotto'),(16,'pidgey'),(19,'pikachu'),(20,'raichu'),(21,'ratata'),(7,'squirtle'),(3,'venusaur'),(8,'warturtle'),(13,'weedle');
/*!40000 ALTER TABLE `pokemon` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tipos`
--
DROP TABLE IF EXISTS `tipos`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tipos` (
`id` int(9) NOT NULL AUTO_INCREMENT,
`nombre` varchar(20) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `nombre` (`nombre`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tipos`
--
LOCK TABLES `tipos` WRITE;
/*!40000 ALTER TABLE `tipos` DISABLE KEYS */;
INSERT INTO `tipos` VALUES (2,'acero'),(1,'agua'),(3,'bicho'),(5,'dragon'),(6,'electrico'),(7,'fantasma'),(4,'fuego'),(8,'hada'),(9,'hielo'),(10,'lucha'),(12,'normal'),(11,'planta'),(18,'psiquico'),(13,'roca'),(14,'siniestro'),(15,'tierra'),(16,'veneno'),(17,'volador');
/*!40000 ALTER TABLE `tipos` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2021-02-22 13:46:24
| true |
fc8a44ade9be56a4fd25f996e7b329fe71819568 | SQL | abdulhamid07/Aplikasi-ZakatFitrah-Berbasis-Desktop | /db_zakat.sql | UTF-8 | 4,062 | 3.09375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Inang: 127.0.0.1
-- Waktu pembuatan: 05 Jul 2017 pada 18.47
-- Versi Server: 5.5.27
-- Versi PHP: 5.4.7
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 */;
--
-- Basis data: `db_zakat`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `dt_mustahiq`
--
CREATE TABLE IF NOT EXISTS `dt_mustahiq` (
`nomor` int(11) NOT NULL,
`tglInput` char(10) NOT NULL,
`gol` varchar(20) NOT NULL,
`namaMustahiq` varchar(30) NOT NULL,
`alamat` text NOT NULL,
`ket` text NOT NULL,
`jmlUang` int(11) NOT NULL,
`jmlBeras` int(11) NOT NULL,
`panitia` varchar(20) NOT NULL,
PRIMARY KEY (`nomor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `dt_mustahiq`
--
INSERT INTO `dt_mustahiq` (`nomor`, `tglInput`, `gol`, `namaMustahiq`, `alamat`, `ket`, `jmlUang`, `jmlBeras`, `panitia`) VALUES
(1, '05-07-2017', 'AMILIN', 'AHMAD', 'SIDOMULYO', '', 40000, 1, 'hamid'),
(3, '05-07-2017', 'AMILIN', 'ABDUL HAMID', 'Bantul', '', 40000, 1, 'hamid');
--
-- Trigger `dt_mustahiq`
--
DROP TRIGGER IF EXISTS `update_after_mustahiq`;
DELIMITER //
CREATE TRIGGER `update_after_mustahiq` AFTER INSERT ON `dt_mustahiq`
FOR EACH ROW update log_muzakki set currDate=new.tglInput,
totalUang=totalUang-new.jmlUang,
totalBeras=totalBeras-new.jmlBeras
//
DELIMITER ;
-- --------------------------------------------------------
--
-- Struktur dari tabel `dt_muzakki`
--
CREATE TABLE IF NOT EXISTS `dt_muzakki` (
`nomor` int(11) NOT NULL,
`tglInput` char(10) NOT NULL,
`namaMuzakki` varchar(30) NOT NULL,
`Alamat` text NOT NULL,
`jmlJiwa` int(11) NOT NULL,
`jmlZakat` int(11) NOT NULL,
`jmlBeras` int(11) NOT NULL,
`panitia` varchar(30) NOT NULL,
PRIMARY KEY (`nomor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `dt_muzakki`
--
INSERT INTO `dt_muzakki` (`nomor`, `tglInput`, `namaMuzakki`, `Alamat`, `jmlJiwa`, `jmlZakat`, `jmlBeras`, `panitia`) VALUES
(0, '05-07-2017', 'MASUD ALHAFIZ', 'Imogiri', 3, 60000, 0, 'hamid'),
(1, '05-07-2017', 'ABDUL HAMID', 'BANTUL', 5, 80000, 1, 'hamid'),
(2, '05-07-2017', 'ENDRA SETIAWAN', 'wonosari', 3, 40000, 1, 'hamid'),
(4, '05-07-2017', 'SARWAN HAMID', 'Manding', 4, 20000, 3, 'hamid'),
(5, '05-07-2017', 'RIFAN ARDIANSYAH', 'manding', 3, 20000, 2, 'hamid');
--
-- Trigger `dt_muzakki`
--
DROP TRIGGER IF EXISTS `update_log_muzakki`;
DELIMITER //
CREATE TRIGGER `update_log_muzakki` AFTER INSERT ON `dt_muzakki`
FOR EACH ROW update log_muzakki set currDate=new.tglInput,
totalUang=totalUang+new.jmlZakat,
totalBeras=totalBeras+new.jmlBeras
//
DELIMITER ;
-- --------------------------------------------------------
--
-- Struktur dari tabel `log_muzakki`
--
CREATE TABLE IF NOT EXISTS `log_muzakki` (
`currDate` varchar(10) NOT NULL,
`totalUang` int(9) NOT NULL,
`totalBeras` int(6) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `log_muzakki`
--
INSERT INTO `log_muzakki` (`currDate`, `totalUang`, `totalBeras`) VALUES
('05-07-2017', 20000, 0);
-- --------------------------------------------------------
--
-- Struktur dari tabel `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`idUser` int(11) NOT NULL AUTO_INCREMENT,
`nmLengkap` varchar(25) NOT NULL,
`usrName` varchar(20) NOT NULL,
`psw` varchar(100) NOT NULL,
`email` varchar(40) NOT NULL,
PRIMARY KEY (`idUser`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
--
-- Dumping data untuk tabel `users`
--
INSERT INTO `users` (`idUser`, `nmLengkap`, `usrName`, `psw`, `email`) VALUES
(1, 'Abdul Hamid', 'hamid', 'hamid', 'hamyd.abdul6@gmail.com');
/*!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 */;
| true |
9b3d274e32df9aa96aa3a5159e1ce67f215d8b93 | SQL | aftahoe/jobfairfun | /jobfairserver/src/main/resources/db/mysql/initDB.sql | UTF-8 | 1,664 | 3.734375 | 4 | [] | no_license | CREATE DATABASE IF NOT EXISTS jobfair_test_db DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
USE jobfair_test_db;
CREATE TABLE IF NOT EXISTS COMPANY (
ID bigint(20) NOT NULL AUTO_INCREMENT,
LINK varchar(255),
NAME varchar(255),
EMAIL varchar(255),
PRIMARY KEY (ID),
UNIQUE (LINK)
) engine=InnoDB;
CREATE TABLE IF NOT EXISTS JOB (
ID bigint(20) NOT NULL AUTO_INCREMENT,
COMPENSATION varchar(255),
ISSUEDATE varchar(255),
LOCATION varchar(255),
POSITIONNAME varchar(255),
POSITIONNUMBER varchar(255),
CONTRACTTYPE varchar(255),
DESCRIPTION TEXT,
COMPANY bigint(20),
PRIMARY KEY (ID),
FOREIGN KEY(COMPANY) references COMPANY(ID)
) engine=InnoDB;
CREATE TABLE IF NOT EXISTS CANDIDATE (
ID bigint(20) NOT NULL AUTO_INCREMENT,
EMAIL varchar(255),
PASSWORD varchar(255),
NAME varchar(255),
TOKEN varchar(255),
APITOKEN varchar(255),
LOCALE varchar(255),
RESUME varchar(255),
INTRODUCTION varchar(255),
WORKETHIC varchar(255),
PRIMARY KEY (EMAIL)
) engine=InnoDB;
CREATE TABLE IF NOT EXISTS QUESTION (
ID bigint(20) NOT NULL AUTO_INCREMENT,
QUESTIONTEXT varchar(255),
ANSWER smallint,
JOB bigint(20),
PRIMARY KEY (ID),
FOREIGN KEY (JOB) references JOB(ID)
) engine=InnoDB;
CREATE TABLE IF NOT EXISTS QUESTIONOPTION (
ID bigint(20) NOT NULL AUTO_INCREMENT,
OPTIONTEXT varchar(255),
QUESTION bigint(20),
PRIMARY KEY (ID),
FOREIGN KEY (QUESTION) references QUESTION(ID)
) engine=InnoDB;
CREATE TABLE IF NOT EXISTS SKILL (
SKILLNAME varchar(255),
CANDIDATE bigint(20),
PRIMARY KEY (SKILLNAME),
FOREIGN KEY (CANDIDATE) references CANDIDATE(ID)
) engine=InnoDB;
| true |
0277d6d0df05fdfbc15b50da26d6577ae6248f3c | SQL | kurtheld/13AprHW | /SQL_Homework.sql | UTF-8 | 11,987 | 4.40625 | 4 | [] | no_license | USE sakila;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 1a. Display the first and last names of all actors from the table actor.
SELECT
first_name 'First Name', last_name 'Last Name'
FROM
actor;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 1b. Display the first and last name of each actor in a single column in upper case letters. Name the column Actor Name.
SELECT
UPPER(CONCAT(first_name, ' ', last_name)) AS 'Actor Name'
FROM
actor;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 2a. You need to find the ID number, first name, and last name of an actor, of whom you know only the first name, "Joe." What is one query would you use to obtain this information?
SELECT actor_id, first_name, last_name FROM actor WHERE first_name="JOE";
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 2b. Find all actors whose last name contain the letters GEN:
SELECT
last_name
FROM
actor
WHERE
last_name LIKE '%GEN%';
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 2c. Find all actors whose last names contain the letters LI. This time, order the rows by last name and first name, in that order:
SELECT
last_name
FROM
actor
WHERE
last_name LIKE '%LI%'
ORDER BY last_name;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 2d. Using IN, display the country_id and country columns of the following countries: Afghanistan, Bangladesh, and China:
SELECT
country_id, country
FROM
country
WHERE
country IN ('Afghanistan' , 'Bangladesh', 'China');
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 3a. You want to keep a description of each actor. You don't think you will be performing queries on a description, so create a column in the table actor named description and use the data type BLOB (Make sure to research the type BLOB, as the difference between it and VARCHAR are significant).
ALTER TABLE actor
ADD description BLOB;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 3b. Very quickly you realize that entering descriptions for each actor is too much effort. Delete the description column.
ALTER TABLE actor
DROP COLUMN description;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 4a. List the last names of actors, as well as how many actors have that last name.
SELECT
last_name, COUNT(last_name)
FROM
actor
GROUP BY last_name;
--ORDER BY COUNT(last_name) DESC;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 4b. List last names of actors and the number of actors who have that last name, but only for names that are shared by at least two actors.
SELECT
last_name, COUNT(last_name)
FROM
actor
GROUP BY last_name
HAVING COUNT(last_name) >= 2;
--ORDER BY COUNT(last_name) DESC;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 4c. The actor HARPO WILLIAMS was accidentally entered in the actor table as GROUCHO WILLIAMS. Write a query to fix the record.
UPDATE
actor
SET
first_name = "HARPO"
WHERE
first_name LIKE 'Groucho' and last_name Like "Williams";
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 4C (CONT.) confirming change in table.
SELECT first_name, last_name
FROM
actor
WHERE
first_name LIKE 'HARPO' and last_name Like "Williams";
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 4d. Perhaps we were too hasty in changing GROUCHO to HARPO. It turns out that GROUCHO was the correct name after all! In a single query, if the first name of the actor is currently HARPO, change it to GROUCHO.
UPDATE
actor
SET
first_name = "GROUCHO"
WHERE
first_name LIKE 'HARPO' and last_name Like "Williams";
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 4C (CONT.) confirming change in table.
SELECT
first_name, last_name
FROM
actor
WHERE
first_name LIKE 'GROUCHO'
AND last_name LIKE 'Williams';
-- 5a. You cannot locate the schema of the address table. Which query would you use to re-create it?
-- I would use a "CREATE TABLE" query to recreate teh address table.
-- CREATE TABLE (
-- address_id SMALLINT (11)
-- address VARCHAR(50 )
-- address2 VARCHAR(50)
-- district VARCHAR(20)
-- cit_id SMALLINT (5)
-- postal_code VARCHAR (10)
-- phone VARCHAR (20)
-- location VARCHAR GEOMETRY
-- last_update TIMEST AMP
);
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 6a. Use JOIN to display the first and last names, as well as the address, of each staff member. Use the tables staff and address:
SELECT
staff.first_name,
staff.last_name,
address.address,
address.address2
FROM
staff
INNER JOIN
address ON staff.address_id = address.address_id;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- --
SELECT
staff.first_name,
staff.last_name,
payment.staff_id,
SUM(payment.amount)
FROM
payment
INNER JOIN
staff ON payment.staff_id = staff.staff_id
GROUP BY payment.staff_id;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 6b. Use JOIN to display the total amount rung up by each staff member in August of 2005. Use tables staff and payment.
SELECT
staff.first_name,
staff.last_name,
payment.staff_id,
SUM(payment.amount)
FROM
payment
INNER JOIN
staff ON payment.staff_id = staff.staff_id
WHERE
payment_date BETWEEN '2005-08-01 00:00:0' AND '2005-08-31 11:59:59'
GROUP BY payment.staff_id;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 6c. List each film and the number of actors who are listed for that film. Use tables film_actor and film. Use inner join.
SELECT
film.title, COUNT(film_actor.actor_id)
FROM
film
INNER JOIN
film_actor ON film.film_id = film_actor.film_id
GROUP BY film_actor.film_id;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 6d. How many copies of the film Hunchback Impossible exist in the inventory system?
SELECT
film.title, COUNT(inventory.film_id)
FROM
film
INNER JOIN
inventory ON film.film_id = inventory.film_id
WHERE film.title = "Hunchback Impossible"
GROUP BY inventory.film_id;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 6e. Using the tables payment and customer and the JOIN command, list the total paid by each customer. List the customers alphabetically by last name:
SELECT
first_name, last_name, SUM(payment.amount)
FROM
payment
INNER JOIN
customer ON payment.customer_id = customer.customer_id
GROUP BY customer.customer_id
ORDER BY customer.last_name;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7a. The music of Queen and Kris Kristofferson have seen an unlikely resurgence. As an unintended consequence, films starting with the letters K and Q have also soared in popularity. Use subqueries to display the titles of movies starting with the letters K and Q whose language is English.
SELECT * FROM
film
INNER JOIN
language ON film.language_id = language.language_id
WHERE title LIKE "Q%"
OR title like "K%"
AND language.name = "english";
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7b. Use subqueries to display all actors who appear in the film Alone Trip.
SELECT
actor.first_name, actor.last_name
FROM
actor
INNER JOIN
film_actor ON film_actor.actor_id = actor.actor_id
INNER JOIN
film_actor ON film.film_id = film_actor.film_id
WHERE title = "ALONE TRIP";
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7c. You want to run an email marketing campaign in Canada, for which you will need the names and email addresses of all Canadian customers. Use joins to retrieve this information.
SELECT
customer.first_name, customer.last_name, address.address, city.city_id, country.country
FROM
customer
INNER JOIN
address ON customer.address_id = address.address_id
INNER JOIN
city on address.city_id = city.city_id
INNER JOIN
country ON country.country_id = city.country_id
WHERE country.country_id =
(
SELECT country_id
FROM country
WHERE country = "Canada");
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7d. Sales have been lagging among young families, and you wish to target all family movies for a promotion. Identify all movies categorized as family films.
SELECT
film.title, film_category.category_id, category.name
FROM
film
INNER JOIN
film_category on film.film_id = film_category.film_id
INNER JOIN
category ON film_category.category_id = category.category_id
WHERE film_category.category_id =
(
SELECT category_id
FROM category
WHERE name = "Family");
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7e. Display the most frequently rented movies in descending order.
SELECT
film.title, COUNT(film.film_id)
FROM
film
INNER JOIN
inventory ON inventory.film_id = film.film_id
INNER JOIN
rental ON inventory.inventory_id = rental.inventory_id
GROUP BY film.film_id
ORDER BY COUNT(film.film_id) DESC;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7f. Write a query to display how much business, in dollars, each store brought in.
SELECT
store.store_id, SUM(payment.amount)
FROM
payment
INNER JOIN
customer ON payment.customer_id = customer.customer_id
INNER JOIN
store ON customer.store_id = store.store_id
GROUP BY store.store_id;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7g. Write a query to display for each store its store ID, city, and country.
SELECT
store.store_id, city.city, country.country
FROM
store
INNER JOIN
address ON store.address_id = address.address_id
INNER JOIN
city ON address.city_id = city.city_id
INNER JOIN
country ON city.country_id = country.country_id;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 7h. List the top five genres in gross revenue in descending order. (Hint: you may need to use the following tables: category, film_category, inventory, payment, and rental.)
SELECT
category.name, SUM(payment.amount)
FROM
payment
INNER JOIN
rental on payment.rental_id = rental.rental_id
INNER JOIN
inventory on rental.inventory_id = inventory.inventory_id
INNER JOIN
film_category on inventory.film_id = film_category.film_id
INNER JOIN
category on film_category.category_id = category.category_id
GROUP BY category.name
ORDER BY SUM(payment.amount) DESC LIMIT 5;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 8a. In your new role as an executive, you would like to have an easy way of viewing the Top five genres by gross revenue. Use the solution from the problem above to create a view. If you haven't solved 7h, you can substitute another query to create a view.
CREATE VIEW top_five_genres AS
SELECT
category.name, SUM(payment.amount)
FROM
payment
INNER JOIN
rental on payment.rental_id = rental.rental_id
INNER JOIN
inventory on rental.inventory_id = inventory.inventory_id
INNER JOIN
film_category on inventory.film_id = film_category.film_id
INNER JOIN
category on film_category.category_id = category.category_id
GROUP BY category.name
ORDER BY SUM(payment.amount) DESC LIMIT 5;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 8b. How would you display the view that you created in 8a?
SELECT * FROM
top_five_genres;
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- 8c. You find that you no longer need the view top_five_genres. Write a query to delete it.
DROP VIEW
top_five_genres;
| true |
96d35fe883921e28177e24a40d08dcebe741322e | SQL | LikiPiki/RewriteNotes | /tables.sql | UTF-8 | 392 | 2.625 | 3 | [] | no_license | -- if change schema rebild docker compose
CREATE TABLE IF NOT EXISTS users (
id SERIAL PRIMARY KEY,
username TEXT UNIQUE NOT NULL,
password text NOT NULL,
is_admin BOOLEAN DEFAULT FALSE
);
CREATE TABLE IF NOT EXISTS notes (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL,
title TEXT NOT NULL,
content TEXT NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
); | true |
9ef1e5c13f271cb967b371515ac611735c49002b | SQL | fanrazi/wita_intern | /wita_intern.sql | UTF-8 | 7,896 | 2.984375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 11, 2021 at 12:17 PM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.6.28
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: `wita_new_intern`
--
-- --------------------------------------------------------
--
-- Table structure for table `dokumen`
--
CREATE TABLE `dokumen` (
`id` int(11) NOT NULL,
`nama_d` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`file` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `dokumen`
--
INSERT INTO `dokumen` (`id`, `nama_d`, `file`) VALUES
(1, 'visa jepang', 'visa_jepang.pdf');
-- --------------------------------------------------------
--
-- Table structure for table `domestik`
--
CREATE TABLE `domestik` (
`id` int(11) NOT NULL,
`nama_dom` varchar(25) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `domestik`
--
INSERT INTO `domestik` (`id`, `nama_dom`) VALUES
(1, 'Bandung'),
(2, 'Bali'),
(3, 'Jakarta'),
(4, 'Jawa Tengah Other City'),
(5, 'Jawa Timur Other City'),
(6, 'Kalimantan'),
(7, 'Komodo Island'),
(8, 'Surabaya'),
(9, 'Lombok'),
(10, 'Bangka Belitung'),
(11, 'Sulawesi'),
(12, 'Jogja'),
(13, 'Sumba'),
(14, 'Sumatera'),
(15, 'Puncak'),
(16, 'Jawa Barat'),
(17, 'Semarang & Solo'),
(18, 'Batam Bintan');
-- --------------------------------------------------------
--
-- Table structure for table `hotel_dom`
--
CREATE TABLE `hotel_dom` (
`id` int(11) NOT NULL,
`id_city` int(11) NOT NULL,
`nama_h` varchar(50) NOT NULL,
`file` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `hotel_dom`
--
INSERT INTO `hotel_dom` (`id`, `id_city`, `nama_h`, `file`) VALUES
(5, 2, 'Pop', '3Hr Paket Surabaya Madakaripura Bromo.pdf'),
(6, 1, 'Pop', '3Hr Paket Surabaya Madakaripura Bromo.pdf');
-- --------------------------------------------------------
--
-- Table structure for table `hotel_int`
--
CREATE TABLE `hotel_int` (
`id` int(11) NOT NULL,
`id_city` int(11) NOT NULL,
`nama_h` varchar(50) NOT NULL,
`file` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `hotel_int`
--
INSERT INTO `hotel_int` (`id`, `id_city`, `nama_h`, `file`) VALUES
(1, 36, 'Pop', '3Hr Paket Surabaya Madakaripura Bromo.pdf');
-- --------------------------------------------------------
--
-- Table structure for table `internasional`
--
CREATE TABLE `internasional` (
`id` int(11) NOT NULL,
`nama_int` varchar(50) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `internasional`
--
INSERT INTO `internasional` (`id`, `nama_int`) VALUES
(1, 'Costa Cruise'),
(2, 'Honeymoon Package'),
(3, 'MSC/NCL Cruise'),
(4, 'Royal Caribbean'),
(5, 'Philippine'),
(6, 'Maldives Srilanka'),
(7, 'Hong Kong SQ'),
(8, 'Christmas New Year'),
(9, 'Macau'),
(10, 'New Zealand'),
(11, 'Dubai'),
(12, 'Turkey'),
(13, 'Nepal'),
(14, 'WIFI ROUTER'),
(15, 'Genting Dream Cruise'),
(16, 'Visa'),
(17, 'Hong Kong Land Tour'),
(18, 'Cambodia Siem Reap'),
(19, 'Europe'),
(20, 'Australia'),
(21, 'Japan'),
(22, 'Vietnam'),
(23, 'India'),
(24, 'Singapore'),
(25, 'Disney Cruise'),
(26, 'Hong Kong CX'),
(27, 'Hong Kong GA'),
(28, 'Asuransi'),
(29, 'Malaysia'),
(30, 'Lebaran'),
(31, 'F1'),
(32, 'Hong Kong Hotel'),
(33, 'Hong Kong Optional Tour'),
(34, 'Thailand'),
(35, 'China'),
(36, 'America'),
(37, 'Taiwan'),
(38, 'Korea');
-- --------------------------------------------------------
--
-- Table structure for table `paket_dom`
--
CREATE TABLE `paket_dom` (
`id` int(11) NOT NULL,
`id_city` int(11) NOT NULL,
`nama_p` varchar(50) NOT NULL,
`file` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `paket_dom`
--
INSERT INTO `paket_dom` (`id`, `id_city`, `nama_p`, `file`) VALUES
(1, 2, '3Hr Paket Surabaya Madakaripura Bromo', '3Hr Paket Surabaya Madakaripura Bromo.pdf');
-- --------------------------------------------------------
--
-- Table structure for table `paket_int`
--
CREATE TABLE `paket_int` (
`id` int(11) NOT NULL,
`id_city` int(11) NOT NULL,
`nama_p` varchar(50) NOT NULL,
`file` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `tiket`
--
CREATE TABLE `tiket` (
`id` int(11) NOT NULL,
`nama_t` varchar(100) COLLATE utf8_unicode_ci NOT NULL,
`file` text COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `tiket`
--
INSERT INTO `tiket` (`id`, `nama_t`, `file`) VALUES
(1, 'tiket agus', 'Invoice-57.pdf');
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`username` varchar(15) COLLATE utf8_unicode_ci NOT NULL,
`password` varchar(8) COLLATE utf8_unicode_ci NOT NULL,
`level` varchar(10) COLLATE utf8_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `username`, `password`, `level`) VALUES
(1, 'admin', 'WTTUR', 'admin'),
(2, 'IT', 'witait', 'it');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `dokumen`
--
ALTER TABLE `dokumen`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `domestik`
--
ALTER TABLE `domestik`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `hotel_dom`
--
ALTER TABLE `hotel_dom`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `hotel_int`
--
ALTER TABLE `hotel_int`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `internasional`
--
ALTER TABLE `internasional`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `paket_dom`
--
ALTER TABLE `paket_dom`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `paket_int`
--
ALTER TABLE `paket_int`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tiket`
--
ALTER TABLE `tiket`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `dokumen`
--
ALTER TABLE `dokumen`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `domestik`
--
ALTER TABLE `domestik`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT for table `hotel_dom`
--
ALTER TABLE `hotel_dom`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `hotel_int`
--
ALTER TABLE `hotel_int`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `internasional`
--
ALTER TABLE `internasional`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=40;
--
-- AUTO_INCREMENT for table `paket_dom`
--
ALTER TABLE `paket_dom`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `paket_int`
--
ALTER TABLE `paket_int`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tiket`
--
ALTER TABLE `tiket`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
/*!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 */;
| true |
898c9617c67b82b88241e3c9c514f37b12cd2181 | SQL | MDunitz/DidYouDoThat | /SQL_server/db/schema.sql | UTF-8 | 731 | 3.53125 | 4 | [] | no_license | DROP TABLE IF EXISTS users CASCADE;
CREATE TABLE users (
id SERIAL PRIMARY KEY,
UserName VARCHAR(100),
hashedPass VARCHAR(250),
email VARCHAR(250) UNIQUE,
token VARCHAR(500)
);
DROP TABLE IF EXISTS tasks CASCADE;
CREATE TABLE tasks (
id SERIAL PRIMARY KEY,
TaskName VARCHAR(250),
userID INTEGER NULL DEFAULT NULL,
timesPerWeek INTEGER,
FOREIGN KEY(userID) REFERENCES users(id)
);
DROP TABLE IF EXISTS taskData CASCADE;
CREATE TABLE taskData (
id SERIAL PRIMARY KEY,
taskID INTEGER,
userID INTEGER,
currDate DATE,
Done BOOLEAN,
otherInfo VARCHAR(250),
FOREIGN KEY (taskID) REFERENCES tasks(id),
FOREIGN KEY (userID) REFERENCES users(id),
UNIQUE (taskID, userID, currDate)
);
| true |
0319bf77dc471abd3b9afea7dafda072b4aa6f38 | SQL | mahbuburriad/Bashundhara-Housing-Limited | /Database/bashundhara_housing_limited.sql | UTF-8 | 19,137 | 3.046875 | 3 | [
"Apache-2.0"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 10, 2017 at 06:57 PM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
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: `bashundhara_housing_limited`
--
-- --------------------------------------------------------
--
-- Table structure for table `apartment`
--
CREATE TABLE `apartment` (
`aid` int(11) NOT NULL,
`apartment_name` varchar(255) NOT NULL,
`price` int(255) NOT NULL,
`flat_size` int(11) NOT NULL,
`bed` int(255) NOT NULL,
`kitchen` int(11) NOT NULL,
`balcony` int(222) NOT NULL,
`site` varchar(50) NOT NULL,
`washroom` int(200) NOT NULL,
`apartment_details` text NOT NULL,
`flat_no` varchar(255) NOT NULL,
`house_no` varchar(255) NOT NULL,
`road_no` varchar(255) NOT NULL,
`block_no` varchar(32) NOT NULL,
`apartment_for` varchar(255) NOT NULL,
`date_a` varchar(30) NOT NULL,
`month_a` varchar(200) NOT NULL,
`year_a` varchar(255) NOT NULL,
`contact_no` varchar(255) NOT NULL,
`email_id` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `apartment`
--
INSERT INTO `apartment` (`aid`, `apartment_name`, `price`, `flat_size`, `bed`, `kitchen`, `balcony`, `site`, `washroom`, `apartment_details`, `flat_no`, `house_no`, `road_no`, `block_no`, `apartment_for`, `date_a`, `month_a`, `year_a`, `contact_no`, `email_id`) VALUES
(1, 'FancyMail', 0, 0, 0, 0, 0, '', 0, 'FancyMail is designed to help make your campaign more professional, featuring seven layouts, eight colors and three layout options. Each layout provides an optimal viewing experience across a wide range of devices and screen sizes.', '5', '4', '15', 'C', 'sell', '14', '15', '14', '+8801456464666', 'email@gmail.com'),
(2, 'Vila', 0, 1250, 3, 1, 2, 'Middle', 2, 'asdf asdfjnnoi noasdofhojasdfo ohnaosdnfoknasdofuhoiasuhdfio', '141', '15', '14', 'E', 'Rent', '4', '4', '4', '+88014774', 'asdfasdf@gma'),
(3, 'afasdf', 456456, 452, 4563, 4566, 456, 'Left', 456, '456fasdfasdf', '456', '6456', '456', 'C', 'Rent', '4', '4', '4', '+8801', 'frasdg'),
(4, 'afasdf', 456456, 452, 4563, 4566, 456, 'Left', 456, '456fasdfasdf', '456', '6456', '456', 'C', 'Rent', '4', '4', '4', '+8801', 'frasdg');
-- --------------------------------------------------------
--
-- Table structure for table `duty`
--
CREATE TABLE `duty` (
`did` int(11) NOT NULL,
`fors` varchar(255) DEFAULT NULL,
`rfrom` varchar(255) NOT NULL,
`rto` varchar(255) NOT NULL,
`tfrom` varchar(255) NOT NULL,
`tto` varchar(255) NOT NULL,
`date` varchar(32) NOT NULL,
`month` varchar(30) NOT NULL,
`year` varchar(200) NOT NULL,
`date_t` varchar(255) NOT NULL,
`month_t` varchar(255) NOT NULL,
`year_t` varchar(255) NOT NULL,
`block` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `duty`
--
INSERT INTO `duty` (`did`, `fors`, `rfrom`, `rto`, `tfrom`, `tto`, `date`, `month`, `year`, `date_t`, `month_t`, `year_t`, `block`) VALUES
(1, 'cleaner', '1', '12', '12:45 am', '1:45 am', '27', '04', '17', '30', '04', '17', 'B'),
(2, 'cleaner', '14', '124', '11:45 am', '9:45 am', '25pp', '04', '17', '31', '04', '17', 'Ba'),
(4, 'guard', 'adf', 'asdf', 'asdf', 'asdf', 'asdfa', 'sdfasdf', '', 'asdf', 'asdf', 'asdf', 'adsf'),
(5, 'cleaner', 'adf', 'asdf', 'asdf', 'asdf', 'asdfa', 'sdfasdf', '', 'asdf', 'asdf', 'asdf', 'adsf');
-- --------------------------------------------------------
--
-- Table structure for table `email`
--
CREATE TABLE `email` (
`eid` int(11) NOT NULL,
`subject` varchar(2000) DEFAULT NULL,
`ebody` text NOT NULL,
`date_e` varchar(255) NOT NULL,
`month_e` varchar(255) NOT NULL,
`year_e` varchar(255) NOT NULL,
`fromemail` varchar(300) NOT NULL,
`reciever` varchar(300) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `email`
--
INSERT INTO `email` (`eid`, `subject`, `ebody`, `date_e`, `month_e`, `year_e`, `fromemail`, `reciever`) VALUES
(1, 'Campaign Monitor', 'Campaign Monitor provides a free email template builder that allows you to build mobile-ready templates, which display well on both desktop clients and mobile devices. Each template has been fully tested in all email clients, including Gmail and Outlook.', '04', '03', '2017', 'guest', 'manager'),
(2, 'Campaign Monitor', 'Campaign Monitor provides a free email template builder that allows you to build mobile-ready templates, which display well on both desktop clients and mobile devices. Each template has been fully tested in all email clients, including Gmail and Outlook.', '04', '03', '2017', 'guest', 'land_owner'),
(3, 'Campaign Monitor', 'Campaign Monitor provides a free email template builder that allows you to build mobile-ready templates, which display well on both desktop clients and mobile devices. Each template has been fully tested in all email clients, including Gmail and Outlook.', '04', '03', '2017', 'guest', 'security'),
(4, 'Freelancer', 'Metromix is a multi-purpose responsive email template built for products', '14', '5', '17', 'manager', 'land_owner'),
(6, 'asdf', 'asdf', 'adf', 'asdf', 'asdf', 'manager', 'guest'),
(7, 'fdasd', 'fasdff', '14', '13', '2001', 'manager', 'guest');
-- --------------------------------------------------------
--
-- Table structure for table `guest_list`
--
CREATE TABLE `guest_list` (
`id` int(11) NOT NULL,
`user_id` varchar(255) NOT NULL,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(32) NOT NULL,
`gender` varchar(30) NOT NULL,
`mobileno` varchar(20) NOT NULL,
`month` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`year` int(10) NOT NULL,
`Flat` varchar(255) NOT NULL,
`House` varchar(255) NOT NULL,
`Road` varchar(255) NOT NULL,
`Thana` varchar(100) NOT NULL,
`District` varchar(200) NOT NULL,
`Country` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `guest_list`
--
INSERT INTO `guest_list` (`id`, `user_id`, `first_name`, `last_name`, `email`, `password`, `gender`, `mobileno`, `month`, `date`, `year`, `Flat`, `House`, `Road`, `Thana`, `District`, `Country`) VALUES
(5, '', 'Mahbubur Riad', 'adsf', 'adsf', 'asdf', 'Male', '+8801', 'January', '1', 1900, 'a', 'sdaf', 'asd', 'fsda', 'fds', 'fasd'),
(7, '', 'adsf', 'adsf', 'afsdf', 'sdf', 'Male', '+88014e', 'January', '1', 1900, 'afsdf', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf'),
(8, 'asdf', 'nai', 'adsf', 'asdf', 'asdf', 'Male', '+8801', 'January', '1', 1900, 'asdf', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf'),
(11, 'ullah', 'Khan', 'Bahadur', 'khan@outloo.com', '45311AD', 'Male', '+8801', 'May', '1', 1900, '56354', '453', '5', 'A', 'A', 'A'),
(12, 'adsf', 'fasdf', 'asdf', 'df', 'asdf', 'Female', '+8801333333333', 'April', '16', 1915, 'adf', 'asdf', 'asdf', 'asdfa', 'sdf', 'asdf'),
(13, 'adsf', 'fasdf', 'asdf', 'df', '', 'Other', '+8801333333333', 'April', '16', 1915, 'adf', 'asdf', 'asdf', 'asdfa', 'sdf', 'asdf'),
(14, 'adsf', 'fasdf', 'asdf', 'df', '', 'Female', '+8801', 'April', '16', 1915, 'adf', 'asdf', 'asdf', 'asdfa', 'sdf', 'asdf');
-- --------------------------------------------------------
--
-- Table structure for table `land_owner_list`
--
CREATE TABLE `land_owner_list` (
`id` int(11) NOT NULL,
`user_id` varchar(255) NOT NULL,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(32) NOT NULL,
`gender` varchar(30) NOT NULL,
`mobileno` varchar(20) NOT NULL,
`month` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`year` int(10) NOT NULL,
`Flat_L` varchar(255) NOT NULL,
`House_L` varchar(255) NOT NULL,
`Road_L` varchar(255) NOT NULL,
`block` varchar(255) NOT NULL,
`price` int(255) NOT NULL,
`Flat` varchar(255) NOT NULL,
`House` varchar(255) NOT NULL,
`Road` varchar(255) NOT NULL,
`Thana` varchar(100) NOT NULL,
`District` varchar(200) NOT NULL,
`Country` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `land_owner_list`
--
INSERT INTO `land_owner_list` (`id`, `user_id`, `first_name`, `last_name`, `email`, `password`, `gender`, `mobileno`, `month`, `date`, `year`, `Flat_L`, `House_L`, `Road_L`, `block`, `price`, `Flat`, `House`, `Road`, `Thana`, `District`, `Country`) VALUES
(1, 'mahbubur.riad', 'Md. Mahbubur', 'Riad Khan', 'mahbubur.riad@gmail.com', '54455445777', 'Male', '01711567411', 'January', '1', 1900, '45', '5', '5', 'H', 0, '54', '655', '654', 'Khilkhet', 'Dhaka', 'Bangladesh'),
(3, 'nobi.kayed', 'Nobi', 'al kayed', 'nobi.kayed@gmail.com', '824726547', 'Female', '+8801745135111', 'August', '15', 1978, '15', '16', '17', 'B', 1452, '87', '45', '15', 'Khilkhet', 'Dhaka', 'Bangladesh'),
(4, 'nobi.kayed', 'Mahbubur', 'al kayed', 'nobi.kayed@gmail.com', '', 'Female', '+8801745135111', 'August', '15', 1978, '15', '16', '17', 'B', 0, '87', '45', '15', 'Khilkhet', 'Dhaka', 'Bangladesh'),
(5, 'nobi.kayed', 'Khan', 'al kayed', 'nobi.kayed@gmail.com', '', 'Female', '+8801', 'August', '15', 1978, '15', '16', '17', 'B', 0, '87', '45', '15', 'Khilkhet', 'Dhaka', 'Bangladesh'),
(6, 'khairul.islam', 'Khairul', 'Islam', 'khairul.isalm@gmail.com', '123456789', 'Male', '+8801789613156', 'September', '17', 1968, 'All', '16', '17', 'I', 14387751, '14', '16', '18', 'Khilkhet', 'Dhaka', 'Bangladesh'),
(7, 'asdf', 'asdfasdf', 'adsf', 'adf', 'asdf', 'Male', '+8801544544165', 'January', '1', 1900, 'adf', 'asdf', 'asdf', 'I', 5511, 'asdf', 'asdf', 'asdf', 'asdfa', 'sdf', 'asdf');
-- --------------------------------------------------------
--
-- Table structure for table `notice`
--
CREATE TABLE `notice` (
`sl` int(200) NOT NULL,
`notice_title` varchar(2000) DEFAULT NULL,
`notice_write` text NOT NULL,
`date_n` varchar(255) NOT NULL,
`month_n` varchar(255) NOT NULL,
`year_n` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `notice`
--
INSERT INTO `notice` (`sl`, `notice_title`, `notice_write`, `date_n`, `month_n`, `year_n`) VALUES
(1, 'Antwort', 'The Market e-newsletter and email template builder comes with eight prebuilt module-based responsive layouts, including 24 color variations and 28 various elements to help build your layout.The template builder allows you to create your template in three easy steps, and can even prepare them for MailChimp or Campaign Monitor. All major email clients are supported, including Outlook.', '22', '04', '17'),
(3, 'adsf', 'jhasbfkjlsadkjffngkjasdfnklojansdkojfjnaskojdf', '25', '04', '2001');
-- --------------------------------------------------------
--
-- Table structure for table `plot`
--
CREATE TABLE `plot` (
`pid` int(11) NOT NULL,
`plot_name` varchar(255) NOT NULL,
`plot_size` int(255) NOT NULL,
`price` int(255) NOT NULL,
`plot_details` text NOT NULL,
`house_no1` varchar(255) NOT NULL,
`road_no1` varchar(255) NOT NULL,
`block_no1` varchar(32) NOT NULL,
`plot_for1` varchar(255) NOT NULL,
`date_a1` varchar(30) NOT NULL,
`month_a1` varchar(200) NOT NULL,
`year_a1` varchar(255) NOT NULL,
`contact_no1` varchar(255) NOT NULL,
`email_id1` varchar(255) NOT NULL,
`flat_no1` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `plot`
--
INSERT INTO `plot` (`pid`, `plot_name`, `plot_size`, `price`, `plot_details`, `house_no1`, `road_no1`, `block_no1`, `plot_for1`, `date_a1`, `month_a1`, `year_a1`, `contact_no1`, `email_id1`, `flat_no1`) VALUES
(1, 'Metromix', 0, 0, ' is a multi-purpose responsive email template built for products, marketing and businesses.', '4', '5', 'E', 'Rent', '4', '5', '5', '+8801785844663', 'XXX@gmail.com', '4'),
(2, 'asfd', 1452, 1450000, 'asdfasdfasdfasdf', '16', '18', 'J', 'sell', '14', '07', '1204', '+88017454110', 'asdfasdf', '14');
-- --------------------------------------------------------
--
-- Table structure for table `stuff_list`
--
CREATE TABLE `stuff_list` (
`id` int(11) NOT NULL,
`user_id` varchar(255) NOT NULL,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(32) NOT NULL,
`gender` varchar(30) NOT NULL,
`mobileno` varchar(20) NOT NULL,
`month` varchar(255) NOT NULL,
`date` varchar(255) NOT NULL,
`year` int(10) NOT NULL,
`stuffas` varchar(255) DEFAULT NULL,
`Flat` varchar(255) NOT NULL,
`House` varchar(255) NOT NULL,
`Road` varchar(255) NOT NULL,
`Thana` varchar(100) NOT NULL,
`District` varchar(200) NOT NULL,
`Country` varchar(255) NOT NULL,
`salary` int(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `stuff_list`
--
INSERT INTO `stuff_list` (`id`, `user_id`, `first_name`, `last_name`, `email`, `password`, `gender`, `mobileno`, `month`, `date`, `year`, `stuffas`, `Flat`, `House`, `Road`, `Thana`, `District`, `Country`, `salary`) VALUES
(5, 'khan.mohammad.abul', 'Abul Khan', 'Bahadur', 'khan.mohammad.abul@gmail.com', '8247236', 'Male', '+8801545456655', 'January', '1', 1900, 'manager', '14', '16', '18', 'Dhaka', 'Khilkhet', 'Bangladesh', 10000),
(6, 'afdsf', 'asdf', 'asdf', 'asdf', 'asdf', 'Male', '+8801444', 'January', '1', 1900, 'manager', 'asf', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf', 5000),
(7, 'afdsf', 'asdf', 'asdf', 'asdf', '', 'Male', '+8801444', 'January', '1', 1900, 'manager', 'asf', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf', 60),
(8, 'afdsf', 'asdf', 'asdf', 'asdf', '', 'Male', '+8801', 'January', '1', 1900, 'manager', 'asf', 'asdf', 'asdf', 'asdf', 'asdf', 'asdf', 600),
(9, 'asdfff', 'asdftt', 'asdf', 'adfsff', '44444', 'Female', '+880154544444', 'March', '14', 1913, 'guard', 'asdf', 'adf', 'asdf', 'sadf', 'asdf', 'asdf', 50000),
(10, 'asdfff', 'asdftt', 'asdf', 'adfsff', '', 'Female', '+880154544444', 'March', '14', 1913, 'cleaner', 'asdf', 'adf', 'asdf', 'sadf', 'asdf', 'asdf', 50000),
(11, 'asdfff', 'asdftt', 'asdf', 'adfsff', '', 'Female', '+8801', 'March', '14', 1913, 'land_manager', 'asdf', 'adf', 'asdf', 'sadf', 'asdf', 'asdf', 50000),
(12, 'asdfff', 'asdftt', 'asdf', 'adfsff', '', 'Female', '+8801', 'March', '14', 1913, 'manager', 'asdf', 'adf', 'asdf', 'sadf', 'asdf', 'asdf', 50000),
(13, '', 'novi', 'al kayed', '', '', 'Male', '+8801', 'January', '1', 1900, 'manager', '', '', '', '', '', '', 10000),
(14, '', 'patuari', 'Khan', '', '', 'Male', '+8801', 'January', '1', 1900, 'manager', '', '', '', '', '', '', 10000),
(15, '', 'Jiban', 'Khan', '', '', 'Male', '+8801', 'January', '1', 1900, 'manager', '', '', '', '', '', '', 10000),
(16, 'khan.bahadur', 'Mohammad Khan', 'Bahadur', 'khan.bahadur', 'Default', 'Male', '+8801544564564', 'January', '1', 1900, 'manager', '5', '52', '45', 'Bashundhara', 'Dhaka', 'Bangladesh', 4555);
-- --------------------------------------------------------
--
-- Table structure for table `stuff_regi`
--
CREATE TABLE `stuff_regi` (
`id` int(11) NOT NULL,
`user_id2` varchar(255) NOT NULL,
`first_name2` varchar(255) NOT NULL,
`last_name2` varchar(255) DEFAULT NULL,
`email2` varchar(255) NOT NULL,
`gender2` varchar(30) NOT NULL,
`mobileno2` varchar(20) NOT NULL,
`month2` varchar(255) NOT NULL,
`date2` varchar(255) NOT NULL,
`year2` int(10) NOT NULL,
`stuffas2` varchar(255) DEFAULT NULL,
`session` varchar(255) NOT NULL,
`year` int(255) NOT NULL,
`ssc` varchar(255) DEFAULT NULL,
`school` varchar(255) DEFAULT NULL,
`hsc` varchar(255) DEFAULT NULL,
`college` varchar(255) DEFAULT NULL,
`graduate` varchar(255) DEFAULT NULL,
`university` varchar(255) DEFAULT NULL,
`Flat2` varchar(255) DEFAULT NULL,
`House2` varchar(255) DEFAULT NULL,
`Road2` varchar(255) NOT NULL,
`Thana2` varchar(100) DEFAULT NULL,
`District2` varchar(200) DEFAULT NULL,
`Country2` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `stuff_regi`
--
INSERT INTO `stuff_regi` (`id`, `user_id2`, `first_name2`, `last_name2`, `email2`, `gender2`, `mobileno2`, `month2`, `date2`, `year2`, `stuffas2`, `session`, `year`, `ssc`, `school`, `hsc`, `college`, `graduate`, `university`, `Flat2`, `House2`, `Road2`, `Thana2`, `District2`, `Country2`) VALUES
(2, 'khan.bahadur', 'Mohammad Khan', 'Bahadur', 'khan.bahadur', 'Male', '+8801754554444', 'August', '17', 1993, 'manager', '', 0, '141454', 'Dha', '544', 'aaafdsg', '45', 'afd', '5', '52', '45', 'Bashundhara', 'Dhaka', 'Bangladesh'),
(3, 'asdf', 'asdf', 'asdf', 'adsf', 'Male', '+8801444444444', 'January', '1', 1900, 'manager', 'Summer', 17, '4.3', 'Dhola Ura Chowdhury High School', '5.0', 'Dhaka College', '2.85', 'Dhaka University', '1D', '12', '12', 'Banani', 'Dhaka', 'Bangladesh');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `apartment`
--
ALTER TABLE `apartment`
ADD PRIMARY KEY (`aid`);
--
-- Indexes for table `duty`
--
ALTER TABLE `duty`
ADD PRIMARY KEY (`did`);
--
-- Indexes for table `email`
--
ALTER TABLE `email`
ADD PRIMARY KEY (`eid`);
--
-- Indexes for table `guest_list`
--
ALTER TABLE `guest_list`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `land_owner_list`
--
ALTER TABLE `land_owner_list`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `notice`
--
ALTER TABLE `notice`
ADD PRIMARY KEY (`sl`);
--
-- Indexes for table `plot`
--
ALTER TABLE `plot`
ADD PRIMARY KEY (`pid`);
--
-- Indexes for table `stuff_list`
--
ALTER TABLE `stuff_list`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `stuff_regi`
--
ALTER TABLE `stuff_regi`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `apartment`
--
ALTER TABLE `apartment`
MODIFY `aid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `duty`
--
ALTER TABLE `duty`
MODIFY `did` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;
--
-- AUTO_INCREMENT for table `email`
--
ALTER TABLE `email`
MODIFY `eid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `guest_list`
--
ALTER TABLE `guest_list`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;
--
-- AUTO_INCREMENT for table `land_owner_list`
--
ALTER TABLE `land_owner_list`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `notice`
--
ALTER TABLE `notice`
MODIFY `sl` int(200) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `plot`
--
ALTER TABLE `plot`
MODIFY `pid` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `stuff_list`
--
ALTER TABLE `stuff_list`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `stuff_regi`
--
ALTER TABLE `stuff_regi`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
2c342a4f85c4ddd9d5532fc05efbdd20ccb46e07 | SQL | Yilotana1/student_hostel | /src/main/resources/db/migration/V3__Insert_test_data.sql | UTF-8 | 885 | 2.859375 | 3 | [] | no_license | # floor data
INSERT INTO floor (number, apartments_count, head_student)
VALUES (1, NULL, NULL);
INSERT INTO floor (number, apartments_count, head_student)
VALUES (2, NULL, NULL);
INSERT INTO floor (number, apartments_count, head_student)
VALUES (3, NULL, NULL);
# apartment data
INSERT INTO apartment (number, floor_id, type_id)
VALUES (1, 1, 2);
INSERT INTO apartment (number, floor_id, type_id)
VALUES (2, 1, 3);
INSERT INTO apartment (number, floor_id, type_id)
VALUES (3, 2, 1);
# user data
INSERT INTO user
(phone, username, email, password, firstname, lastname, role_id, apartment_id)
VALUES ('38078954371', 'Andrey', 'andrey@gmail.com', 'qwerty54321',
'Andrey', 'Ivanov', 2, 3);
INSERT INTO user
(phone, username, email, password, firstname, lastname, role_id, apartment_id)
VALUES ('38068750353', 'Nat123', 'natalia@gmail.com', 'qwerty54321',
'Natalia', 'Vasilenko', 1, 2); | true |
2f082d80e1919fab24e9c47ca8aca2ba5e3983ef | SQL | BlaskoEric/CSE572-Database-Systems | /Labs/Lab6/lab06b_Eric.sql | UTF-8 | 3,255 | 4.3125 | 4 | [] | no_license | --Lab: Lab 6B Query
--Name: Eric Blasko
--turn off pause
SET PAUSE OFF
--start output spool
spool lab06BOutput_Eric.txt
--1. display employee id, last name and hire date of any employee
-- in the same department as ZlotKey, excluding Zlotkey. Sorted
-- by employee id
SELECT employee_id,last_name,hire_date
FROM HR.employees
WHERE department_id = (SELECT department_id
FROM HR.employees
WHERE last_name = 'Zlotkey')
AND last_name <> 'Zlotkey'
ORDER BY employee_id;
--2. display employee id and last names of all employees who earn
-- more than average salary of all employees. Sorted by ascending
-- order of salary, then employee id
SELECT department_id,last_name
FROM HR.employees
WHERE salary > (SELECT AVG(salary)
FROM HR.employees)
ORDER BY salary ASC, employee_id;
--3. display employee id and last name of all employees whose dept
-- location id is 1700
SELECT employee_id,last_name
FROM HR.employees
WHERE department_id IN (SELECT department_id
FROM HR.departments
WHERE location_id = '1700');
--4. display employee id, last name and job id of all employees
-- who reports to 'King'. King is manager of employees
SELECT employee_id,last_name,job_id
FROM HR.employees
WHERE manager_id IN (SELECT employee_id
FROM HR.employees
WHERE last_name = 'King');
--5. display employee id, last names and job id of all employees in
-- the 'Executive' departments
SELECT employee_id,last_name,job_id
FROM HR.employees
WHERE department_id IN (SELECT department_id
FROM HR.departments
WHERE department_name = 'Executive');
--6. display department id, number of staff, average salary, min salary
-- max salary, and total salary of all departments. Sorted by dept id
SELECT department_id,COUNT(*) as NO_STAFF,AVG(salary) as AVG_SALARY,
MIN(salary) AS MIN_SALARY,MAX(salary) AS MAX_SALARY,SUM(salary) AS TOTAL_SALARY
FROM HR.employees
GROUP BY department_id
ORDER BY department_id;
--7. display department id, number of staff, average salary, min salary
-- max salary, and total salary of departments between 50 and 100 only.
-- Sorted by department id
SELECT department_id,COUNT(*) as NO_STAFF,AVG(salary) as AVG_SALARY,
MIN(salary) AS MIN_SALARY,MAX(salary) AS MAX_SALARY,SUM(salary) AS TOTAL_SALARY
FROM HR.employees
WHERE department_id BETWEEN 50 AND 100
GROUP BY department_id
ORDER BY department_id;
--8. display job id, number of staff, average salary, min salary, max salary
-- total salary of all job id types. Sorted by job id
SELECT job_id,COUNT(*) as NO_STAFF,AVG(salary) as AVG_SALARY,
MIN(salary) AS MIN_SALARY,MAX(salary) AS MAX_SALARY,SUM(salary) AS TOTAL_SALARY
FROM HR.employees
GROUP BY job_id
ORDER BY job_id;
--9. display job id, number of staff, average salary, min salary, max salary
-- and total salary of all job id whose average salary is greater than 5000.
-- Sorted by job id
SELECT job_id,COUNT(*) as NO_STAFF,AVG(salary) as AVG_SALARY,
MIN(salary) AS MIN_SALARY,MAX(salary) AS MAX_SALARY,SUM(salary) AS TOTAL_SALARY
FROM HR.employees
GROUP BY job_id
HAVING AVG(salary) > 5000
ORDER BY job_id;
spool off
| true |
4e68daaf3e220fd70bb0c6b8df60bb94caf53bcf | SQL | victor-bern/go_ecommerce | /src/database/migrations/000002_create_product_table.up.sql | UTF-8 | 247 | 2.890625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS product (
id serial PRIMARY KEY,
title VARCHAR (250) NOT NULL,
description VARCHAR (250) NOT NULL,
price FLOAT (6) NOT NULL,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW()
); | true |
3fbc75b3dc3c929d30614c1d34c97faeb1153e3e | SQL | Florgardu/ort_tercerCuartimestre | /bd2/TPBD2-FINAL-V.2/vista.sql | UTF-8 | 493 | 3.453125 | 3 | [] | no_license | ---Vista para buscar inconsitencisas:
--si una copia aparece como “D” pero esa misma copia esta
--en prestamo sin con fecha de devolución (es decir, esta prestada).
CREATE VIEW v_copias_prestamos_inconsistencia as
select c.NRO_COPIA , c.NRO_LIBRO, c.ESTADO , p.F_PREST , p.F_DEVOL
from COPIAS c
inner join PRESTAMO p ON P.NRO_COPIA = C.NRO_COPIA
AND P.NRO_libro = C.NRO_LIBRO
WHERE P.F_DEVOL IS NULL
AND c.ESTADO ='D'
--select * from v_copias_prestamos_inconsistencia
| true |
dd7704aa8601ee768fe0260b8696efe96195479f | SQL | Supakoa/PojaBrokcaNaKha | /oldWork/database/form.sql | UTF-8 | 2,091 | 3.15625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 10, 2019 at 03:40 PM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `petition`
--
-- --------------------------------------------------------
--
-- Table structure for table `form`
--
CREATE TABLE `form` (
`form_id` int(11) NOT NULL,
`name` text NOT NULL,
`detail` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `form`
--
INSERT INTO `form` (`form_id`, `name`, `detail`) VALUES
(1, 'แบบคำร้องขอตรวจสอบผลการเรียน', ''),
(2, 'แบบฟอร์มแจ้งสาเหตุการขาดสอบรายวิชาศึกษาทั่วไป', ''),
(3, 'แบบคำร้องขอแก้ไขผลการเรียน', ''),
(4, 'แบบคำร้องขอสอบภายหลัง', ''),
(5, 'แบบใบลาป่วย ลากิจ', ''),
(6, 'ใบคำร้องขอรหัสผ่านเข้าระบบ', ''),
(7, 'แบบคำร้องทั่วไป', ''),
(8, 'ติดต่อเจ้าหน้าที่', '');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `form`
--
ALTER TABLE `form`
ADD PRIMARY KEY (`form_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `form`
--
ALTER TABLE `form`
MODIFY `form_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
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 */;
| true |
cbdc2ac90e22d06f0eab71e66ae4e1624324c604 | SQL | mulder3062/JpaExample | /ddl/mariadb/create_tables.sql | UTF-8 | 621 | 3.609375 | 4 | [
"MIT"
] | permissive | create table todo
(
todo_id bigint auto_increment primary key,
title varchar(255) null,
user_id varchar(32) null,
status varchar(20) null,
last_modified_date datetime null,
created_date datetime null,
constraint fk_user_todo foreign key (user_id) references user (user_id)
) engine=InnoDB charset=utf8mb4 collate=utf8mb4_unicode_ci comment 'TODO';
create table user
(
user_id varchar(32) not null primary key,
name varchar(255) null,
last_modified_date datetime null,
created_date datetime null
) engine=InnoDB charset=utf8mb4 collate=utf8mb4_unicode_ci comment '사용자';
| true |
d58b3998e2c8871eb92d0ab977991662ebe5aacd | SQL | leo-cavalcante/data-ft-par-labs | /Notes/Week-2/2.2.sql | UTF-8 | 5,271 | 4.65625 | 5 | [] | no_license | #Who Have Published What At Where?
select a.au_id, a.au_fname, a.au_lname, t.title, p.pub_name
from titles t
inner join titleauthor ta on t.title_id=ta.title_id
inner join authors a on ta.au_id=a.au_id
inner join publishers p on p.pub_id=t.pub_id;
# Who Have Published How Many At Where?
select a.au_id, a.au_fname, a.au_lname, p.pub_name, count(t.title)
from titles t
inner join titleauthor ta on t.title_id=ta.title_id
inner join authors a on ta.au_id=a.au_id
inner join publishers p on p.pub_id=t.pub_id
group by a.au_id, p.pub_name;
#Who are the top 3 authors who have sold the highest number of titles?
select a.au_id, a.au_fname, a.au_lname, sum(qty) as total
from authors a
inner join titleauthor ta on ta.au_id=a.au_id
inner join titles t on t.title_id=ta.title_id
inner join sales s on s.title_id=ta.title_id
group by a.au_id
order by 4 desc
limit 3;
select a.au_id, a.au_fname, a.au_lname, coalesce(sum(qty),0) as total
from authors a
left join titleauthor ta on ta.au_id=a.au_id
left join titles t on t.title_id=ta.title_id
left join sales s on s.title_id=ta.title_id
group by a.au_id
order by 4 desc;
select *
from sales s
inner join titleauthor ta on s.title_id=ta.title_id
right join authors a on ta.au_id=a.au_id;
Select st.stor_name AS Store,
Count(Distinct(ord_num)) AS Orders,
Count(title_id) AS Items,
Sum(qty) AS Qty
From sales s
Inner Join stores st ON st.stor_id=s.stor_id
Group by Store;
Select st.stor_name AS Store,
Count(title_id)/Count(Distinct(ord_num)) AS titles_per_order,
Sum(qty)/Count(title_id) AS Qty_per_title
From sales s
Inner Join stores st ON st.stor_id=s.stor_id
Group by Store;
select store, items/orders, qty/items
from (
Select st.stor_name AS Store,
Count(Distinct(ord_num)) AS Orders,
Count(title_id) AS Items,
Sum(qty) AS Qty
From sales s
Inner Join stores st ON st.stor_id=s.stor_id
Group by Store) as summary;
select store, ord_num, ord_date, title, s.qty, price, t.type
from (
Select st.stor_id,
st.stor_name AS Store,
Count(Distinct(ord_num)) AS Orders,
Count(title_id) AS Items,
Sum(qty) AS Qty
From sales s
Inner Join stores st ON st.stor_id=s.stor_id
Group by Store) as summary
inner join sales s on s.stor_id=summary.stor_id
inner join titles t on t.title_id=s.title_id
where items/orders>1;
with summary as
(
Select st.stor_id,
st.stor_name AS Store,
Count(Distinct(ord_num)) AS Orders,
Count(title_id) AS Items,
Sum(qty) AS Qty
From sales s
Inner Join stores st ON st.stor_id=s.stor_id
Group by Store)
select store, ord_num, ord_date, title, s.qty, price, t.type
from summary
inner join sales s on s.stor_id=summary.stor_id
inner join titles t on t.title_id=s.title_id
where items/orders>1;
select * from summary;
create temporary table summary
Select st.stor_id,
st.stor_name AS Store,
Count(Distinct(ord_num)) AS Orders,
Count(title_id) AS Items,
Sum(qty) AS Qty
From sales s
Inner Join stores st ON st.stor_id=s.stor_id
Group by Store;
select * from summary;
select store, ord_num, ord_date, title, s.qty, price, t.type
from summary
inner join sales s on s.stor_id=summary.stor_id
inner join titles t on t.title_id=s.title_id
where items/orders>1;
create table summary1
Select st.stor_id,
st.stor_name AS Store,
Count(Distinct(ord_num)) AS Orders,
Count(title_id) AS Items,
Sum(qty) AS Qty
From sales s
Inner Join stores st ON st.stor_id=s.stor_id
Group by Store;
select * from summary1;
delete from summary1
where qty<80;
select * from summary;
update summary1
set qty=qty+5
where items=6;
drop table summary1;
select * from summary1;
#Step 1: Calculate the royalty of each sale for each author and the advance for each author and publication
select s.ord_num, a.au_id, a.au_fname, a.au_lname, t.title, t.pub_id, s.qty, t.price, t.advance, t.royalty, ta.royaltyper, t.advance*ta.royaltyper/100 as advance, s.qty*t.price*t.royalty/100*ta.royaltyper/100 as royalty
from sales s
inner join titles t
on s.title_id=t.title_id
inner join titleauthor ta
on t.title_id=ta.title_id
inner join authors a
on ta.au_id=a.au_id
order by 1;
#Step 2: Aggregate the total royalties for each title and author
select au_id, au_fname, au_lname, title, sum(royalty) as total_royalties_per_title, advance
from (
select a.au_id, a.au_fname, a.au_lname, t.title, s.qty*t.price*t.royalty/100*ta.royaltyper/100 as royalty, t.advance*ta.royaltyper/100 as advance
from sales s
inner join titles t
on s.title_id=t.title_id
inner join titleauthor ta
on t.title_id=ta.title_id
inner join authors a
on ta.au_id=a.au_id) t1
group by au_id, title;
#Step 3: Calculate the total profits of each author
select au_id, au_fname, au_lname, sum(total_royalties_per_book+advance) as total_profit from(
select au_id, au_fname, au_lname, title, sum(royalty) as total_royalties_per_book, advance
from (
select a.au_id, a.au_fname, a.au_lname, t.title, s.qty*t.price*t.royalty/100*ta.royaltyper/100 as royalty, t.advance*ta.royaltyper/100 as advance
from sales s
inner join titles t
on s.title_id=t.title_id
inner join titleauthor ta
on t.title_id=ta.title_id
inner join authors a
on ta.au_id=a.au_id) t1
group by au_id, title) t2
group by au_id;
| true |
0033343a3e81540207d02e510812e413991bcb1b | SQL | KaterynaTrushko/sql | /12_Date/SQLQuery6.sql | UTF-8 | 1,217 | 3.390625 | 3 | [] | no_license | /*ЗАДАНИЕ 6.
Напишите SQL-запрос без оператора FROM, который вернет одну строку с результатами выполнения функции
DATETIMEFROMPARTS(). Задать следующие аргументы: год – 2019, месяц - 8, день – 31, час -23, минута – 59, секунда –
59, миллисекунда – 999. Создайте второй столбец с результатами выполнения функции DATETIMEFROMPARTS(). Задать
следующие аргументы: год – 2019, месяц - 8, день – 31, час -23, минута – 59, секунда – 59, миллисекунда – 998.
Создайте третий столбец с результатами выполнения функции DATEDIFF(), которая посчитает разницу в миллисекундах
между датами из двух первых столбцов
*/
select
DATETIMEFROMPARTS(2019,8,31,23,59,59,999)
,DATETIMEFROMPARTS(2019,8,31,23,59,59,998)
,DATEDIFF(dd,DATETIMEFROMPARTS(2019,8,31,23,59,59,998),DATETIMEFROMPARTS(2019,8,31,23,59,59,999)) as diff
| true |
a943596181635a0ed43a7a8664ebeb6ff5226e45 | SQL | Cubelrti/GymSpring | /sqlFile/spring_study.sql | UTF-8 | 2,678 | 3.3125 | 3 | [] | no_license | /*
Navicat Premium Data Transfer
Source Server : 主机mysql
Source Server Type : MySQL
Source Server Version : 80012
Source Host : localhost:3306
Source Schema : spring_study
Target Server Type : MySQL
Target Server Version : 80012
File Encoding : 65001
Date: 27/04/2019 19:16:52
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for gym
-- ----------------------------
DROP TABLE IF EXISTS `gym`;
CREATE TABLE `gym` (
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`name` varchar(255) DEFAULT NULL,
`location` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
`modify_date` date DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for gym_trainer
-- ----------------------------
DROP TABLE IF EXISTS `gym_trainer`;
CREATE TABLE `gym_trainer` (
`gym_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`trainer_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
PRIMARY KEY (`gym_id`,`trainer_id`),
KEY `trainer_id` (`trainer_id`),
CONSTRAINT `gym_id_` FOREIGN KEY (`gym_id`) REFERENCES `gym` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `trainer_id` FOREIGN KEY (`trainer_id`) REFERENCES `trainer` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for hibernate_sequence
-- ----------------------------
DROP TABLE IF EXISTS `hibernate_sequence`;
CREATE TABLE `hibernate_sequence` (
`next_val` bigint(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for trainer
-- ----------------------------
DROP TABLE IF EXISTS `trainer`;
CREATE TABLE `trainer` (
`id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`name` varchar(255) DEFAULT NULL,
`age` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
`headpic` varchar(255) DEFAULT NULL,
`introduce` varchar(255) DEFAULT NULL,
`phone` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`name` varchar(255) DEFAULT NULL,
`age` int(32) DEFAULT NULL,
`sex` varchar(255) DEFAULT NULL,
`mobile` varchar(255) DEFAULT NULL,
`id` varchar(255) NOT NULL,
`password` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
SET FOREIGN_KEY_CHECKS = 1;
| true |
3eae53dbb5ef3f47505b0625e97d56eedbde6d85 | SQL | padilhaalucas/modaResaCalendar | /backend/prisma/migrations/20210611111243_unique/migration.sql | UTF-8 | 924 | 3.375 | 3 | [] | no_license | /*
Warnings:
- A unique constraint covering the columns `[brandName]` on the table `Client` will be added. If there are existing duplicate values, this will fail.
- Added the required column `email` to the `StaffMember` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_StaffMember" (
"id" TEXT NOT NULL PRIMARY KEY,
"email" TEXT NOT NULL,
"firstname" TEXT NOT NULL,
"lastName" TEXT NOT NULL
);
INSERT INTO "new_StaffMember" ("firstname", "id", "lastName") SELECT "firstname", "id", "lastName" FROM "StaffMember";
DROP TABLE "StaffMember";
ALTER TABLE "new_StaffMember" RENAME TO "StaffMember";
CREATE UNIQUE INDEX "StaffMember.email_unique" ON "StaffMember"("email");
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;
-- CreateIndex
CREATE UNIQUE INDEX "Client.brandName_unique" ON "Client"("brandName");
| true |
ae0693e779b6d7b4e09458e3b9eead92b6e59f0e | SQL | lynacong/bank | /gov.df.f_ebank.lyn/gov.df.f_ebank.lyn.web/src/main/resource/f_ebank/ebank_databaseComment.sql | UTF-8 | 55,156 | 2.75 | 3 | [] | no_license | -- ebank_balance_limit_month这张表没有注释
#########################################################################################
SQL_CREATE_COMMENT_EBANK_ACC_BILL = comment on column EBANK_ACC_BILL_DESYEAR.id is '主键'@\
comment on column EBANK_ACC_BILL_DESYEAR.bill_no is '凭证编号'@\
comment on column EBANK_ACC_BILL_DESYEAR.en_code is '预算单位编码'@\
comment on column EBANK_ACC_BILL_DESYEAR.en_name is '预算单位名称'@\
comment on column EBANK_ACC_BILL_DESYEAR.en_code1 is '一级预算单位编码'@\
comment on column EBANK_ACC_BILL_DESYEAR.en_name1 is '一级预算单位名称'@\
comment on column EBANK_ACC_BILL_DESYEAR.pay_account_no is '付款人账号'@\
comment on column EBANK_ACC_BILL_DESYEAR.pay_account_name is '付款人名称'@\
comment on column EBANK_ACC_BILL_DESYEAR.pay_account_bank_name is '原付款人银行'@\
comment on column EBANK_ACC_BILL_DESYEAR.pay_money is '支付金额'@\
comment on column EBANK_ACC_BILL_DESYEAR.pb_code is '代理银行编码'@\
comment on column EBANK_ACC_BILL_DESYEAR.pb_name is '代理银行名称'@\
comment on column EBANK_ACC_BILL_DESYEAR.create_date is '生成日期'@\
comment on column EBANK_ACC_BILL_DESYEAR.is_end is '是否结束'@\
comment on column EBANK_ACC_BILL_DESYEAR.is_valid is '是否有效'@\
comment on column EBANK_ACC_BILL_DESYEAR.confirm_date is '确认日期'@\
comment on column EBANK_ACC_BILL_DESYEAR.confirm_user is '确认用户'@\
comment on column EBANK_ACC_BILL_DESYEAR.set_year is '年度'@\
comment on column EBANK_ACC_BILL_DESYEAR.finance_code is '区划'@\
comment on column EBANK_ACC_BILL_DESYEAR.hold1 is '预算字段1'@\
comment on column EBANK_ACC_BILL_DESYEAR.hold2 is '预算字段2'@\
comment on column EBANK_ACC_BILL_DESYEAR.hold3 is '预算字段3'@\
comment on column EBANK_ACC_BILL_DESYEAR.hold4 is '预算字段4'@\
comment on column EBANK_ACC_BILL_DESYEAR.print_date is '打印日期'@\
comment on column EBANK_ACC_BILL_DESYEAR.print_num is '打印次数'@\
comment on column EBANK_ACC_BILL_DESYEAR.print_user is '打印用户'@\
comment on column EBANK_ACC_BILL_DESYEAR.billtype_code is '单据类型'
SQL_CREATE_COMMENT_EBANK_AGENT_BILL = comment on column EBANK_AGENT_BILL_DESYEAR.tre_no is '国库主体代码'@\
comment on column EBANK_AGENT_BILL_DESYEAR.finance_org_no is '财政机关代码'@\
comment on column EBANK_AGENT_BILL_DESYEAR.pay_dictate_no is '支付交易序号'@\
comment on column EBANK_AGENT_BILL_DESYEAR.pay_msg_no is '支付报文编号'@\
comment on column EBANK_AGENT_BILL_DESYEAR.pay_entrust_date is '交易委托日期'@\
comment on column EBANK_AGENT_BILL_DESYEAR.send_operator is '签章发送操作人员'@\
comment on column EBANK_AGENT_BILL_DESYEAR.register_operator is '登记操作人'@\
comment on column EBANK_AGENT_BILL_DESYEAR.register_date is '登记时间'@\
comment on column EBANK_AGENT_BILL_DESYEAR.input_operator is '补录操作人员'@\
comment on column EBANK_AGENT_BILL_DESYEAR.input_date is '补录时间'@\
comment on column EBANK_AGENT_BILL_DESYEAR.create_operator is '生成人'@\
comment on column EBANK_AGENT_BILL_DESYEAR.vt_code is '凭证类型'@\
comment on column EBANK_AGENT_BILL_DESYEAR.clear_date is '清算日期'@\
comment on column EBANK_AGENT_BILL_DESYEAR.voucher_receive_date is '凭证签收日期'
SQL_CREATE_COMMENT_EBANK_ASSP_VOUCHER = comment on table EBANK_ASSP_VOUCHER_DESYEAR is '电子凭证'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.id is 'ID'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.vt_code is '凭证类型'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.voucher_no is '凭证号'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.voucher_date is '凭证日期(发送日期或接收日期)'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.status is '凭证状态:0未接收 1、已接收 2、接收失败 3、签收成功 4、签收失败 5、已回单 6、被退回'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.is_send is '1表示发出去的凭证,0表示接收到的凭证'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.is_valid is '是否有效'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.last_update_date is '最后修改状态日期'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.set_year is '年度'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.finance_code is '区划'@\
comment on column EBANK_ASSP_VOUCHER_DESYEAR.remark is '备注:可以是退回原因等'
SQL_CREATE_COMMENT_EBANK_BALANCE_RECORD = comment on column EBANK_BALANCE_RECORD_DESYEAR.sum_id is '扣除额度id'@\
comment on column EBANK_BALANCE_RECORD_DESYEAR.use_money is '金额'@\
comment on column EBANK_BALANCE_RECORD_DESYEAR.account_kind is '额度类型'@\
comment on column EBANK_BALANCE_RECORD_DESYEAR.op_time is '扣额度时间'@\
comment on column EBANK_BALANCE_RECORD_DESYEAR.voucher_id is '凭证id'
SQL_CREATE_COMMENT_EBANK_CLEARMONEY_RECOUNT = comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.set_year is '年度'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.finance_code is '财政机构'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.main_id is '主建id'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.bill_no is '划款单号'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.pb_code is '银行编码'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.pb_name is '银行名称'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.mk_code is '资金性质编码'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.mk_name is '资金性质名称'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.agent_account_no is '划款帐户帐号'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.agent_account_name is '划款帐户名称'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.agent_account_bank is '划款帐户银行'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.agent_account_bankcode is '划款帐户银行编码'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.payee_account_no is '收款帐户帐号(垫款户)'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.payee_account_name is '收款帐户名称(垫款户)'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.clear_date is '清算日期'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.total_money is '分解金额'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.total_num is '笔数'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.status is '状态 0新增加 1支付 2支付确认'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.remark is '备注'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.create_date is '创建时间'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.pay_date is '支付时间'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.last_op_user is '最后修改人'@\
comment on column EBANK_CLEARMONEY_RECOUNT_DESYEAR.last_op_date is '最后修改时间'
SQL_CREATE_COMMENT_EBANK_CORE_LOG = comment on column EBANK_CORE_LOG_DESYEAR.log_id is '日志ID'@\
comment on column EBANK_CORE_LOG_DESYEAR.method is '调用方法'@\
comment on column EBANK_CORE_LOG_DESYEAR.op_time is '操作时间'@\
comment on column EBANK_CORE_LOG_DESYEAR.finance_code is '财政机构'@\
comment on column EBANK_CORE_LOG_DESYEAR.data_type is '报文类型'@\
comment on column EBANK_CORE_LOG_DESYEAR.in_params is '输入参数'@\
comment on column EBANK_CORE_LOG_DESYEAR.out_params is '输出参数'@\
comment on column EBANK_CORE_LOG_DESYEAR.voucher_no is '凭证号'@\
comment on column EBANK_CORE_LOG_DESYEAR.user_id is '用户ID'@\
comment on column EBANK_CORE_LOG_DESYEAR.pay_account_no is '付款人账号'@\
comment on column EBANK_CORE_LOG_DESYEAR.pay_account_name is '付款人名字'@\
comment on column EBANK_CORE_LOG_DESYEAR.pay_account_bank is '付款人开户行'@\
comment on column EBANK_CORE_LOG_DESYEAR.payee_account_no is '收款人账号'@\
comment on column EBANK_CORE_LOG_DESYEAR.payee_account_name is '收款人名称'@\
comment on column EBANK_CORE_LOG_DESYEAR.payee_account_bank is '收款人银行'@\
comment on column EBANK_CORE_LOG_DESYEAR.pay_money is '支付金额'@\
comment on column EBANK_CORE_LOG_DESYEAR.agent_business_no is '交易流水号'@\
comment on column EBANK_CORE_LOG_DESYEAR.process_status is '处理状态 : 0,未处理;1,处理中; 2处理完成 '@\
comment on column EBANK_CORE_LOG_DESYEAR.errormsg is '出错信息'@\
comment on column EBANK_CORE_LOG_DESYEAR.is_success is '交易是否成功:0,失败;1成功'@\
comment on column EBANK_CORE_LOG_DESYEAR.tran_teller_no is '交易柜员'@\
comment on column EBANK_CORE_LOG_DESYEAR.tran_branch_id is '交易机构'@\
comment on column EBANK_CORE_LOG_DESYEAR.tran_amt is '交易金额'@\
comment on column EBANK_CORE_LOG_DESYEAR.tran_date is '交易日期'@\
comment on column EBANK_CORE_LOG_DESYEAR.tran_remark is '交易摘要'@\
comment on column EBANK_CORE_LOG_DESYEAR.crdtle_flag is '抹账标志,0 未抹账 1 已抹账'@\
comment on column EBANK_CORE_LOG_DESYEAR.errorcode is '错误代码'@\
comment on column EBANK_CORE_LOG_DESYEAR.file_name is '待扩展'@\
comment on column EBANK_CORE_LOG_DESYEAR.accept_number is '待扩展'@\
comment on column EBANK_CORE_LOG_DESYEAR.seq_no is '提交交易系统流水号'
SQL_CREATE_COMMENT_EBANK_DAY_BILL = comment on column EBANK_DAY_BILL_DESYEAR.id is '主键'@\
comment on column EBANK_DAY_BILL_DESYEAR.bill_no is '凭证编号'@\
comment on column EBANK_DAY_BILL_DESYEAR.pay_money is '支付金额'@\
comment on column EBANK_DAY_BILL_DESYEAR.pos_money is '支款金额'@\
comment on column EBANK_DAY_BILL_DESYEAR.neg_money is '退款金额'@\
comment on column EBANK_DAY_BILL_DESYEAR.bl_code is '指标来源编码'@\
comment on column EBANK_DAY_BILL_DESYEAR.bl_name is '指标来源名称'@\
comment on column EBANK_DAY_BILL_DESYEAR.pb_code is '代理银行编码'@\
comment on column EBANK_DAY_BILL_DESYEAR.pb_name is '代理银行名称'@\
comment on column EBANK_DAY_BILL_DESYEAR.mk_code is '资金性质编码'@\
comment on column EBANK_DAY_BILL_DESYEAR.mk_name is '资金性质名称'@\
comment on column EBANK_DAY_BILL_DESYEAR.pk_code is '支付方式编码'@\
comment on column EBANK_DAY_BILL_DESYEAR.pk_name is '支付方式名称'@\
comment on column EBANK_DAY_BILL_DESYEAR.create_date is '生成日期'@\
comment on column EBANK_DAY_BILL_DESYEAR.is_valid is '是否有效'@\
comment on column EBANK_DAY_BILL_DESYEAR.confirm_date is '确认日期'@\
comment on column EBANK_DAY_BILL_DESYEAR.confirm_user is '确认用户'@\
comment on column EBANK_DAY_BILL_DESYEAR.set_year is '年度'@\
comment on column EBANK_DAY_BILL_DESYEAR.finance_code is '区划'@\
comment on column EBANK_DAY_BILL_DESYEAR.hold1 is '预算字段1'@\
comment on column EBANK_DAY_BILL_DESYEAR.hold2 is '预算字段2'@\
comment on column EBANK_DAY_BILL_DESYEAR.hold3 is '预算字段3'@\
comment on column EBANK_DAY_BILL_DESYEAR.hold4 is '预算字段4'@\
comment on column EBANK_DAY_BILL_DESYEAR.print_date is '打印日期'@\
comment on column EBANK_DAY_BILL_DESYEAR.print_num is '打印次数'@\
comment on column EBANK_DAY_BILL_DESYEAR.print_user is '打印用户'@\
comment on column EBANK_DAY_BILL_DESYEAR.send_operator is '签章发送操作人员'@\
comment on column EBANK_DAY_BILL_DESYEAR.create_operator is '生成人'@\
comment on column EBANK_DAY_BILL_DESYEAR.vt_code is '凭证类型'
SQL_CREATE_COMMENT_EBANK_PAY_BATCH_BILL = comment on table EBANK_PAY_BATCH_BILL_DESYEAR is '支付凭证单据表'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.id is '主键'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.bill_no is '支付凭证号'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.set_year is '年度'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.vt_code is '交易凭证类型'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pay_money is '汇总金额'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.ori_vt_code is '主凭证类型编号'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.ori_bill_no is '主支付凭证编号'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.finance_code is '财政机构'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.en_code is '预算单位编码'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.en_name is '预算单位编码'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pay_account_no is '付款人账号'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pay_account_name is '付款人名称'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pay_account_bank_name is '付款人银行'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pay_bank_code is '代理银行编码'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pay_bank_name is '代理银行名称'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.xpay_date is '实际凭证确认日期'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.xpay_money is '实际支付汇总金额'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pm_code is '结算方式代码'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.pf_code is '支付管理类型代码'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.operator is '操作人'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.send_date is '签章发送时间'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.send_operator is '签章发送操作人'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.work_flow_entity_id is '工作流关联字段'@\
comment on column EBANK_PAY_BATCH_BILL_DESYEAR.voucher_receive_date is '凭证签收日期'
SQL_CREATE_COMMENT_EBANK_PAY_BATCH_DETAIL = comment on table EBANK_PAY_BATCH_DETAIL_DESYEAR is '支付凭证'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.id is '主键'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.bill_no is '支付主单编号'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.payee_account_no is '收款人账户编号'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.payee_account_name is '收款人账户名称'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.payee_account_bank is '收款人账户银行'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.finance_code is '财政机构'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.pay_money is '计划金额'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.remark is '备注'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.xpay_date is '支付日期'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.xagent_business_no is '银行交易流水号'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.xpay_money is '计划金额'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.xpayee_account_no is '收款人账户编号'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.xpayee_account_bank_name is '收款人账户名称'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.hold1 is '预留字段1'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.hold2 is '预留字段2'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.hold3 is '预留字段3'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.hold4 is '预留字段4'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.set_year is '年度'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.bill_status is '1:待支付 2:支付成功 3:支付失败 4:退款'@\
comment on column EBANK_PAY_BATCH_DETAIL_DESYEAR.message is '支付失败原因'
SQL_CREATE_COMMENT_EBANK_PAY_BILL = comment on column EBANK_PAY_BILL_DESYEAR.id is '主键'@\
comment on column EBANK_PAY_BILL_DESYEAR.bill_no is '凭证编号'@\
comment on column EBANK_PAY_BILL_DESYEAR.set_year is '年度'@\
comment on column EBANK_PAY_BILL_DESYEAR.bi_code is '项目分类编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bi_name is '项目分类名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.bis_code is '预算项目编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bis_name is '预算项目名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.bo_code is '核算类型编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bo_name is '核算类型名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_code1 is '功能科目(类)编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_name1 is '功能科目(类)名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_code2 is '功能科目(款)编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_name2 is '功能科目(款)名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_code3 is '功能科目(项)编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_name3 is '功能科目(项)名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.bsi_code is '经济科目编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bsi_name is '经济科目名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.en_code1 is '主管预算单位编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.en_name1 is '主管预算单位名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.en_code is '基层预算单位编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.en_name is '基层预算单位名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.mk_code is '资金性质编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.mk_name is '资金性质名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.payee_account_no is '收款人账号'@\
comment on column EBANK_PAY_BILL_DESYEAR.payee_account_name is '收款人名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.payee_account_bank is '收款人开户行'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_account_no is '付款人账号'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_account_name is '付款人名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_account_bank is '付款人开户行'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_money is '支付金额'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_summary_code is '支付摘要编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_summary_name is '支付摘要名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.pf_code is '支付管理类型编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.pf_name is '支付管理类型名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.pk_code is '支付方式编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.pk_name is '支付方式名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.pm_code is '结算方式编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.pm_name is '结算方式名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.print_date is '打印日期'@\
comment on column EBANK_PAY_BILL_DESYEAR.hold1 is '预算字段1'@\
comment on column EBANK_PAY_BILL_DESYEAR.hold2 is '预算字段2'@\
comment on column EBANK_PAY_BILL_DESYEAR.hold3 is '预算字段3'@\
comment on column EBANK_PAY_BILL_DESYEAR.hold4 is '预算字段4'@\
comment on column EBANK_PAY_BILL_DESYEAR.agent_account_no is '划款账户账号'@\
comment on column EBANK_PAY_BILL_DESYEAR.agent_account_name is '划款账户名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.agent_account_bank is '划款账户开户行'@\
comment on column EBANK_PAY_BILL_DESYEAR.agent_business_no is '交易流水号'@\
comment on column EBANK_PAY_BILL_DESYEAR.billtype_code is '单据类型 1-直接 2-授权'@\
comment on column EBANK_PAY_BILL_DESYEAR.check_no is '支票号'@\
comment on column EBANK_PAY_BILL_DESYEAR.clear_date is '清算日期'@\
comment on column EBANK_PAY_BILL_DESYEAR.confirm_user is '确认用户'@\
comment on column EBANK_PAY_BILL_DESYEAR.create_date is '生成日期'@\
comment on column EBANK_PAY_BILL_DESYEAR.is_end is '是否结束'@\
comment on column EBANK_PAY_BILL_DESYEAR.is_valid is '是否有效'@\
comment on column EBANK_PAY_BILL_DESYEAR.origin_model is '业务标示'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_date is '支付日期'@\
comment on column EBANK_PAY_BILL_DESYEAR.plan_id is '计划额度ID'@\
comment on column EBANK_PAY_BILL_DESYEAR.input_money is '原金额'@\
comment on column EBANK_PAY_BILL_DESYEAR.agent_bill_no is '划款单号'@\
comment on column EBANK_PAY_BILL_DESYEAR.day_bill_no is '日报单号'@\
comment on column EBANK_PAY_BILL_DESYEAR.acc_bill_no is '入账通知书单号'@\
comment on column EBANK_PAY_BILL_DESYEAR.refund_type is '退款类型'@\
comment on column EBANK_PAY_BILL_DESYEAR.ori_bill_no is '原凭证号'@\
comment on column EBANK_PAY_BILL_DESYEAR.remark is '备注信息'@\
comment on column EBANK_PAY_BILL_DESYEAR.pb_code is '代理银行编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.pb_name is '代理银行名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_code is '功能科目编码'@\
comment on column EBANK_PAY_BILL_DESYEAR.bs_name is '功能科目名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.payee_bank_no is '收款行号'@\
comment on column EBANK_PAY_BILL_DESYEAR.finance_code is '财政机构'@\
comment on column EBANK_PAY_BILL_DESYEAR.bill_status is '凭证业务状态:0 签收,1 已垫款,2 支付,3 已回单,4 已清算,5 已退回 ,6垫款状态确认(重庆银行特色),7撤销垫款但未进行撤销垫款状态确认(重庆银行特色),8自助柜面支付失败'@\
comment on column EBANK_PAY_BILL_DESYEAR.advince is '退回财政原因'@\
comment on column EBANK_PAY_BILL_DESYEAR.advance_operator is '垫款操作人员'@\
comment on column EBANK_PAY_BILL_DESYEAR.advance_date is '垫款时间'@\
comment on column EBANK_PAY_BILL_DESYEAR.confirm_advance_operator is '垫款状态确认或审核人员'@\
comment on column EBANK_PAY_BILL_DESYEAR.confirm_advance_date is '垫款状态确认时间'@\
comment on column EBANK_PAY_BILL_DESYEAR.cancel_advance_operator is '撤销垫款人员'@\
comment on column EBANK_PAY_BILL_DESYEAR.cancel_advance_date is '撤销垫款时间'@\
comment on column EBANK_PAY_BILL_DESYEAR.return_operator is '退回财政操作人'@\
comment on column EBANK_PAY_BILL_DESYEAR.return_date is '退回财政时间'@\
comment on column EBANK_PAY_BILL_DESYEAR.send_operator is '签章发送操作人员'@\
comment on column EBANK_PAY_BILL_DESYEAR.create_operator is '录入操作人员'@\
comment on column EBANK_PAY_BILL_DESYEAR.pay_operator is '审核人员'@\
comment on column EBANK_PAY_BILL_DESYEAR.cancel_check_operator is '撤销审核人员'@\
comment on column EBANK_PAY_BILL_DESYEAR.cancel_check_date is '撤销审核时间'@\
comment on column EBANK_PAY_BILL_DESYEAR.delete_bill_operator is '作废操作人'@\
comment on column EBANK_PAY_BILL_DESYEAR.delete_bill_date is '作废时间'@\
comment on column EBANK_PAY_BILL_DESYEAR.xpayee_account_no is '收款人账号'@\
comment on column EBANK_PAY_BILL_DESYEAR.xpayee_account_name is '收款人名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.xpayee_account_bank is '收款人银行'@\
comment on column EBANK_PAY_BILL_DESYEAR.mode_code is '1柜面业务2.自助柜面业务'@\
comment on column EBANK_PAY_BILL_DESYEAR.mode_name is '1柜面业务2.自助柜面业务'@\
comment on column EBANK_PAY_BILL_DESYEAR.business_type_code is '业务类型编码 '@\
comment on column EBANK_PAY_BILL_DESYEAR.business_type_name is '业务类型名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.vt_code is '凭证类型'@\
comment on column EBANK_PAY_BILL_DESYEAR.refund_money is '已退金额'@\
comment on column EBANK_PAY_BILL_DESYEAR.advance_no is '垫款户账号'@\
comment on column EBANK_PAY_BILL_DESYEAR.advance_name is '垫款户名称'@\
comment on column EBANK_PAY_BILL_DESYEAR.voucher_receive_date is '凭证签收日期'@\
comment on column EBANK_PAY_BILL_DESYEAR.exchange_text is '记录交换中心返回数据'
SQL_CREATE_COMMENT_EBANK_PAY_DETAIL = comment on column EBANK_PAY_DETAIL_DESYEAR.id is '主键'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.clear_bill_id is '汇总清算单ID'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.voucher_no is '支付明细编号'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.voucher_bill_id is '支付凭证id'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.voucher_bill_no is '支付凭证单号'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.en_name is '预算单位名称'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bs_name is '功能科目名称'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.hold1 is '预留字段1'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.hold2 is '预留字段2'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.hold3 is '预留字段3'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.hold4 is '预留字段4'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.en_code is '预算单位编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bs_code is '功能科目编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.pay_money is '支付金额'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.set_year is '年度'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bap_name is '支付账户'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.finance_code is '财政机构'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bis_code is '预算项目编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bis_name is '预算项目名称'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bi_code is '项目分类编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bi_name is '项目分类名称'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bo_code is '预算类型编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bo_name is '预算类型名称'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bsi_code is '经济分类编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bsi_name is '经济分类名称'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.check_no is '支票号(结算号)'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.en_code1 is '一级预算单位编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.old_pay_id is '退款明细旧id'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.refund_money is '退款金额'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.agent_bill_id is '划款单ID'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.acc_bill_id is '入账通知书id'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.acc_bill_no is '入账通知书凭证编号'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.day_bill_id is '支出日报id'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.create_date is '创建日期'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.business_type_code is '业务类型编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.business_type_name is '业务类型名称'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.mb_code is '业务处室编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.mb_name is '业务处室'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bp_code is '指标特性编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bp_name is '指标特性'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.input_money is '原始金额'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.ori_voucher_no is '原退款明细单号'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.is_end is '1完成清算'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.bap_code is '支付账户编码'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.agent_bill_no is '划款单号'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.day_bill_no is '支付日报表单号'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.mode_code is '1柜面业务,2自助柜面业务'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.work_flow_entity_id is '工作流关联id'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.sum_id is '额度扣除字段'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.advance_no is '垫款户账号'@\
comment on column EBANK_PAY_DETAIL_DESYEAR.advance_name is '垫款户名称'
SQL_CREATE_COMMENT_EBANK_PAYCARD_BILL = comment on table EBANK_PAYCARD_BILL_DESYEAR is '公务卡凭证单据主单'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.id is '主单Id(卡信息单ID、变更单ID、注销单ID)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.finance_code is '财政机构代码'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.budgetlevelcode is '预算级次'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.set_year is '业务年度'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.cardyear is '开卡年度'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.billtype_code is '凭证单据类型编号'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.voudate is '凭证日期(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.voucherno is '凭证号(公务卡单据单号,卡信息单号、变更单号、注销单号)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.cardbankid is '发卡行ID'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.cardbankcode is '发卡行编码'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.cardbankname is '发卡行名称'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold1 is '预留字段1(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold2 is '预留字段2(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold3 is '预留字段3(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold4 is '预留字段4(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.remark is '备注'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.ts is '时间戳(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.is_valid is '是否有效'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.is_end is '流程是否结束'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.cardno is '公务卡卡号'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.requestbillno is '下载请求单号(对应公务卡消费明细下载请求单号)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.serialno is '消费授权号(消费小票上的授权号或流水号)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.consumedate is '消费日期(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.consumemoney is '消费金额[消费的实际金额]'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.downloadtype is '下载类型消费记录下载的请求条件组合类型【1:授权号、2:消费日期+消费金额】'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.agencyid is '预算单位ID'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.agencycode is '预算单位编码'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold5 is '预留字段1(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold6 is '预留字段2(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold7 is '预留字段3(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.hold8 is '预留字段4(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.origin_model is '来源标志:0:为录入 1:导入'@\
comment on column EBANK_PAYCARD_BILL_DESYEAR.sortcode is '排序码'
SQL_CREATE_COMMENT_EBANK_PAYCARD_BILL_DETAIL = comment on table EBANK_PAYCARD_BILL_DETAIL_DESYEAR is '公务卡凭证单据明细单'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.id is '明细Id(流水号)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardbillid is '主单Id(与主单id内容一致)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.finance_code is '财政机构代码'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.set_year is '业务年度'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.billtype_code is '凭证单据类型编号'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardholder is '持卡人姓名'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardholderrank is '持卡人职级'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardholderno is '身份证号码'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.agencyid is '预算单位ID(新)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.agencycode is '预算单位编码(新)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.agencyname is '预算单位名称(新)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardid is '公务卡ID(新)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardno is '公务卡卡号(新)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.creditnum is '信用额度'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.mobilenum is '持卡人手机号'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardmadedate is '制卡日期(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardtype is '公务卡类型(1 个人卡 2单位卡)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardstatus is '卡状态(新)(1正常、2停用、3注销)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardbegindate is '开卡日期(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardenddate is '停用日期(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold1 is '预留字段1(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold2 is '预留字段2(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold3 is '预留字段3(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold4 is '预留字段4(基本信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardchangetype is '变更类型(0手工录入,1换卡号,2换单位,3变更卡状态,4Excel导入)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardchangedate is '变更日期(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.oldcardid is '原公务卡ID'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.oldcardno is '原公务卡卡号'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.oldagencyid is '原预算单位编码'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.oldagencycode is '原预算单位编码'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.oldagencyname is '原预算单位名称'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.oldcardstatus is '原卡状态(1正常、2停用、3注销)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.remark is '备注'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.ts is '时间戳(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.is_valid is '是否有效'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.is_end is '流程是否结束'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.consume_time is '消费时间(时间 格式:yyyy-MM-dd hh24:mi:ss)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.serialno is '消费授权号(消费小票上的授权号或流水号)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.consumemoney is '消费金额[消费的实际金额]'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.merchant_name is '消费商家名称'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.transaction_addr is '消费商家地址'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardbankname is '发卡行名称'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardbankcode is '发卡行编码'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.cardbankid is '发卡行ID'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold5 is '预留字段1(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold6 is '预留字段2(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold7 is '预留字段3(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.hold8 is '预留字段4(消费信息)'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.origin_model is '来源标志:0:为录入 1:导入'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.opcountsucess is '操作成功次数计算器'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.opcountfail is '操作失败次数计数器'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.reason is '操作后返回的成功或失败消息和原因'@\
comment on column EBANK_PAYCARD_BILL_DETAIL_DESYEAR.sortcode is '排序码'
SQL_CREATE_COMMENT_EBANK_PLAN_AGENT_BILL = comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.id is 'id'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.bill_no is '凭证号'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.create_date is '凭证日期'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.finance_code is '财政'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.set_year is '年度'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.vt_code is '凭证类型'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.mk_code is '资金性质编码'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.mk_name is '资金性质名称'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.pb_code is '代理银行编码'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.pb_name is '代理银行名称'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.set_month is '月份'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.plan_money is '金额'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.en_code1_num is '一级预算单位数量'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.remark is '附言'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.xacct_date is '处理日期'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.bis_code is '预算项目编码'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.bis_name is '预算项目名称'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.send_date is '签章发送日期'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.send_operator is '签章发送操作人员'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.create_operator is '生成人'@\
comment on column EBANK_PLAN_AGENT_BILL_DESYEAR.voucher_receive_date is '凭证签收日期'
SQL_CREATE_COMMENT_EBANK_PLAN_AGENTEN_BILL = comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.id is '财政授权支付额度到账通知书Id'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.rg_code is '行政区划代码'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.set_year is '业务年度'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.create_date is '凭证日期'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.bill_no is '凭证号'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.bis_code is '预算类型编码'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.bis_name is '预算类型名称'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.mk_code is '资金性质编码'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.mk_name is '资金性质名称'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.en_code1 is '一级预算单位编码'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.en_name1 is '一级预算单位名称'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.en_name is '基层预算单位名称'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.en_code is '基层预算单位编码'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.plan_money is '汇总计划金额'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.set_month is '计划月份'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.pb_code is '代理银行编码'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.pb_name is '代理银行名称'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.agency_acco_code is '单位零余额账户'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.agency_acco_name is '单位零余额账户名称'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.agency_bank_no is '单位零余额开户银行行号'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.agency_bank_name is '单位零余额开户银行名称'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.vt_code is '凭证类型编号'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.send_operator is '签章发送操作人员'@\
comment on column EBANK_PLAN_AGENTEN_BILL_DESYEAR.create_operator is '生成人'
SQL_CREATE_COMMENT_EBANK_PLAN_VOUCHER = comment on column EBANK_PLAN_VOUCHER_DESYEAR.id is '计划明细Id'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.voucher_no is '计划明细编号'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.agent_bill_id is '财政授权支付额度通知单Id'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.agenten_bill_id is '额度到账通知书id'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bis_code is '预算类型编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bis_name is '预算类型名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.mk_code is '资金性质编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.mk_name is '资金性质名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.en_code is '基层预算单位编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.en_name is '基层预算单位名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.en_code1 is '一级预算单位编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.en_name1 is '一级预算单位名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_code is '支出功能分类科目编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_name is '支出功能分类科目名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_code1 is '支出功能分类类编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_name1 is '支出功能分类类名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_code2 is '支出功能分类款编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_name2 is '支出功能分类款名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_code3 is '支出功能分类项编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bs_name3 is '支出功能分类项名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.inpm_code is '收支管理编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.inpm_name is '收支管理名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.tracking_id is '业务追溯识别码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.plan_money is '额度金额'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.remark is '备注'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.agency_acco_code is '单位零余额账户'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.agency_acco_name is '单位零余额账户名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.agency_bank_name is '单位零余额帐户开户行'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bsi_code is '经济分类科目编码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.bsi_name is '经济分类科目名称'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.rg_code is '行政区划代码'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.set_year is '业务年度'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.set_month is '计划月份'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.sum_id is '额度id'@\
comment on column EBANK_PLAN_VOUCHER_DESYEAR.work_flow_entity_id is '工作流关联id'
SQL_CREATE_COMMENT_EBANK_VOUCHER_RECEIVE_LOG = comment on table EBANK_VOUCHER_RECEIVE_LOG_DESYEAR is '电子凭证接收记录日志表'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.id is '主键ID,取自序列'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.finance_code is '区划'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.set_year is '年度'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.vt_code is '凭证类型'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.voucher_no is '凭证号'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.voucher_flag is '凭证类型:0,接收单,1回单, 2退回单'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.voucher_status is '凭证状态:0未处理、1签收成功、2签收失败、3已退回'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.voucher_date is '凭证接收日期'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.last_op_date is '最后一次操作日期'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.op_count is '操作次数'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.back_reason is '被退回原因'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.fail_reason is '处理失败原因'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.message is '业务报文内容'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.message_hash is '报文HASH:用于判断两条凭证报文内容是否相同'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.remark is '备注'@\
comment on column EBANK_VOUCHER_RECEIVE_LOG_DESYEAR.is_valid is '是否有效'
SQL_CREATE_COMMENT_EBANK_BALANCE_ELE_DETAIL = comment on column EBANK_BALANCE_ELE_DETAIL_DESYEAR.sum_id is '额度id'@\
comment on column EBANK_BALANCE_ELE_DETAIL_DESYEAR.ele_code is '要素编码'@\
comment on column EBANK_BALANCE_ELE_DETAIL_DESYEAR.ele_name is '要素名称'@\
comment on column EBANK_BALANCE_ELE_DETAIL_DESYEAR.finance_code is '财政机构'@\
comment on column EBANK_BALANCE_ELE_DETAIL_DESYEAR.ele is '要素类型'
SQL_CREATE_COMMENT_EBANK_BALANCE_LIMIT = comment on column EBANK_BALANCE_LIMIT_DESYEAR.sum_id is '额度id'@\
comment on column EBANK_BALANCE_LIMIT_DESYEAR.avi_money is '总额度'@\
comment on column EBANK_BALANCE_LIMIT_DESYEAR.use_money is '已用额度'
SQL_CREATE_COMMENT_EBALANCE_RECEIVE_LOG = comment on table EBALANCE_RECEIVE_LOG_DESYEAR is '电子凭证接收记录日志表'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.id is '主键ID,取自序列'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.rg_code is '区划'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.set_year is '年度'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.vt_code is '凭证类型'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.voucher_no is '凭证号'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.voucher_flag is '凭证类型:1正常接收单, 2退回单'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.voucher_status is '凭证状态:0未处理、1签收成功、2签收失败、3已退回'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.voucher_date is '凭证接收日期'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.last_op_date is '最后一次操作日期'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.op_count is '操作次数'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.back_reason is '被退回原因'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.fail_reason is '处理失败原因'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.message is '业务报文内容'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.message_hash is '报文HASH:用于判断两条凭证报文内容是否相同'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.remark is '备注'@\
comment on column EBALANCE_RECEIVE_LOG_DESYEAR.is_valid is '是否有效'
SQL_CREATE_COMMENT_EBALANCE_RECON_BILL = comment on column EBALANCE_RECON_BILL_DESYEAR.rg_code is '区划'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.set_year is '年度'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.vt_code is '凭证类型'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.create_date is '创建时间'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.voucher_check_no is '对账单号'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.child_pack_num is '子包编码'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.current_pack_no is '当前包号'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.pb_code is '代理银行编码'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.pb_name is '代理银行名称'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.begin_date is '对账开始时间'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.end_date is '对账结束时间'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.all_num is '明细总数'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.all_amt is '总金额'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.status is '对账状态'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.xcheckresult is '对账结果'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.xdiffnum is '不符笔数'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.cb_code is '清算行编码'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.cb_name is '清算航名称'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.clear_account_no is '清算行账号'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.clear_account_name is '清算行名称'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.en_code is '预算单位编码'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.en_name is '预算单位名称'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.id is '主单号'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.receive_count is '接收总数'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.latest_op_date is '最后操作日期'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.latest_op_user is '最后操作人'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.create_user is '创建人'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.is_valid is '是否可用'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.mk_code is '资金性质'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.mk_name is '资金性质'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.pk_code is '支出类型'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.pk_name is '支出类型'@\
comment on column EBALANCE_RECON_BILL_DESYEAR.sum_amt is '累计授权支付金额(2514、8514对账主单多出一个金额合计字段“SumAmt累计授权支付金额”)'
SQL_CREATE_COMMENT_EBALANCE_RECON_DETAIL = comment on column EBALANCE_RECON_DETAIL_DESYEAR.voucher_no is '凭证单号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.detail_id is '对账数据的明细id'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.mk_code is '资金性质编码'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.mk_name is '资金性质名称'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bo_code is '核算类型'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bo_name is '核算类型'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.en_code1 is '预算单位'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.en_name1 is '预算单位'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.en_code is '预算单位'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.en_name is '预算单位'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bs_code is '功能分类'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bs_name is '功能分类'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bi_code is '项目分类'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bi_name is '项目分类'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pay_account_no is '付款人账号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pay_account_name is '付款人名称'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pay_account_bank is '付款人银行'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.set_month is '月份'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.mb_code is '业务处(科)室'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.mb_name is '业务处(科)室'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bk_code is '支出类型'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bk_name is '支出类型'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bsi_code is '经济分类'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bsi_name is '经济分类'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bis_code is '预算项目'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.bis_name is '预算项目'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pk_code is '支付方式'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pk_name is '支付方式'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.payee_account_no is '收款人账号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.payee_account_name is '收款人名称'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.payee_account_bank is '收款人银行'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pm_code is '结算类型'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pm_name is '结算类型'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curdirpayamt is '本期直接支付金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curdirbackamt is '本期直接支付退款金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curdirpayamtsum is '累计直接支付金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curdirbackamtsum is '累计直接支付退款金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curauthplanamt is '本期下达额度金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curauthpayamt is '本期授权支付金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curauthbackamt is '本期授权支付退款金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curauthplanamtsum is '累计下达额度金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curauthpayamtsum is '累计授权支付金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curauthbackamtsum is '累计授权支付退款金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.remainplanamt is '授权额度结余金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.xcheckresult is '对账结果'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.xcheckreason is '不符原因'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.current_pack_no is '当前包号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.payagentbillno is '划款单号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pb_code is '代理银行编码'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pb_name is '代理银行名称'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.voucher_check_no is '对账单号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.xresult_voucher_no is '回单凭证号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.xcurrent_pack_no is '回单包号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.predatemoney is '上期额度余额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curreckmoney is '本期已清算额度'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curdatemoney is '本期额度余额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.pay_voucher_no is '支付凭证号'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.cb_code is '清算行编码'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.cb_name is '清算行名称'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.curpayamt is '本期金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.sumpayamt is '累计金额'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.taxorgcode is '税务征收机关代码'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.taxorgname is '征收机关名称'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.budgetlevelcode is '预算级次'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.budgetsubjectcode is '收入分类科目编码'@\
comment on column EBALANCE_RECON_DETAIL_DESYEAR.budgetsubjectname is '收入分类科目名称' | true |
5f6ed0e9b383cc219deea294fb3dfb26ded2ac50 | SQL | metal-messiah/mtn-rest-service | /core/src/main/resources/db/migration/V1.0.0.11__store_volume.sql | UTF-8 | 509 | 3.09375 | 3 | [] | no_license | ALTER TABLE `store_casing` CHANGE COLUMN `volume_total` `store_volume_id` INT(11) NULL DEFAULT NULL AFTER `volume_note`;
ALTER TABLE `store_casing` ADD CONSTRAINT `FK_store_casing_store_volume` FOREIGN KEY (`store_volume_id`) REFERENCES `store_volume` (`store_volume_id`) ON UPDATE CASCADE ON DELETE SET NULL;
ALTER TABLE `store_volume` ADD INDEX `Index 3` (`legacy_casing_id`);
ALTER TABLE `store` ADD INDEX `Index 5` (`store_name`);
ALTER TABLE `user_profile` ADD INDEX `Index 2` (`legacy_user_id`);
| true |
ca05cbe5d4f01c89c83b60b6ef3b2616d7a57013 | SQL | mariok32/ProyectoFG-Mario | /CloudSpace.sql | UTF-8 | 5,626 | 3.1875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 10-06-2017 a las 20:48:38
-- Versión del servidor: 5.7.16-0ubuntu0.16.04.1
-- Versión de PHP: 7.0.8-0ubuntu0.16.04.3
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: `CloudSpace`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `archivos`
--
CREATE TABLE `archivos` (
`id_archivo` int(4) NOT NULL,
`fecha_subida_archivos` date NOT NULL,
`comentario` varchar(256) NOT NULL,
`peso_archivo_MB` int(255) NOT NULL,
`nombre_archivo` int(11) NOT NULL,
`usuario.id` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `equipos_de_trabajo`
--
CREATE TABLE `equipos_de_trabajo` (
`id_equipo` int(4) NOT NULL,
`fecha_creacion` date NOT NULL,
`nombre_equipo` text NOT NULL,
`estado` int(1) NOT NULL,
`usuario.id_usuario` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `equipos_de_trabajo`
--
INSERT INTO `equipos_de_trabajo` (`id_equipo`, `fecha_creacion`, `nombre_equipo`, `estado`, `usuario.id_usuario`) VALUES
(1, '2017-05-28', 'TESTGROUP', 1, 'mariok32');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Forma`
--
CREATE TABLE `Forma` (
`equipos_de_trabajo.id_equipo` int(4) NOT NULL,
`usuarios.id_usuarios` varchar(256) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `Forma`
--
INSERT INTO `Forma` (`equipos_de_trabajo.id_equipo`, `usuarios.id_usuarios`) VALUES
(1, 'mariok32'),
(1, 'mariok322'),
(1, 'mariok322');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `Reporte`
--
CREATE TABLE `Reporte` (
`id_fallos` int(4) NOT NULL,
`usuarios.id_usuario` varchar(255) NOT NULL,
`Titulo` varchar(255) NOT NULL,
`texto` varchar(1000) NOT NULL,
`fecha_reporte` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `Reporte`
--
INSERT INTO `Reporte` (`id_fallos`, `usuarios.id_usuario`, `Titulo`, `texto`, `fecha_reporte`) VALUES
(1, 'mariok32', 'Bienvenido a la plataforma online CloudSpace', 'Cloudspace, es una plataforma de almacenamiento online, multiplataforma y ademas gratuita', '2017-06-04'),
(2, 'mariok32', 'Prueba', 'Prueba', '2017-06-04'),
(3, 'mariok32', 'Prueba', 'Prueba', '2017-06-04');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `tiene`
--
CREATE TABLE `tiene` (
`equipos_de_trabajo.id_equipo` int(4) NOT NULL,
`archivos.id_archivo` int(4) NOT NULL,
`id_relacion` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuarios`
--
CREATE TABLE `usuarios` (
`id_usuario` varchar(256) NOT NULL,
`correo_electronico` varchar(256) NOT NULL,
`tipo_usuario` int(11) NOT NULL,
`fecha_registro_usuario` date NOT NULL,
`contraseña` varchar(256) NOT NULL,
`activado` int(1) DEFAULT NULL,
`cuota_MB` int(11) NOT NULL,
`espacio_usuado` int(11) NOT NULL,
`nombre_usuario` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `usuarios`
--
INSERT INTO `usuarios` (`id_usuario`, `correo_electronico`, `tipo_usuario`, `fecha_registro_usuario`, `contraseña`, `activado`, `cuota_MB`, `espacio_usuado`, `nombre_usuario`) VALUES
('mariok32', 'mariok32@hotmail.com', 1, '2017-06-07', 'emulador', 1, 5000, 0, 'Mario López Segura'),
('mariok322', 'mariok32m@gmail.com', 0, '2017-06-07', 'emulador', 1, 5000, 0, 'Mario López Segura');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `archivos`
--
ALTER TABLE `archivos`
ADD PRIMARY KEY (`id_archivo`);
--
-- Indices de la tabla `equipos_de_trabajo`
--
ALTER TABLE `equipos_de_trabajo`
ADD PRIMARY KEY (`id_equipo`);
--
-- Indices de la tabla `Reporte`
--
ALTER TABLE `Reporte`
ADD PRIMARY KEY (`id_fallos`),
ADD UNIQUE KEY `id_fallos` (`id_fallos`);
--
-- Indices de la tabla `tiene`
--
ALTER TABLE `tiene`
ADD PRIMARY KEY (`archivos.id_archivo`),
ADD UNIQUE KEY `archivos.id_archivo` (`archivos.id_archivo`);
--
-- Indices de la tabla `usuarios`
--
ALTER TABLE `usuarios`
ADD PRIMARY KEY (`id_usuario`),
ADD UNIQUE KEY `correo_electronico` (`correo_electronico`),
ADD UNIQUE KEY `id_usuario` (`id_usuario`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `archivos`
--
ALTER TABLE `archivos`
MODIFY `id_archivo` int(4) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT de la tabla `equipos_de_trabajo`
--
ALTER TABLE `equipos_de_trabajo`
MODIFY `id_equipo` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT de la tabla `Reporte`
--
ALTER TABLE `Reporte`
MODIFY `id_fallos` int(4) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT de la tabla `tiene`
--
ALTER TABLE `tiene`
MODIFY `archivos.id_archivo` int(4) NOT NULL AUTO_INCREMENT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
06ba780a1726131b93e2f6781206e164f4c65f56 | SQL | victorbueno8/CurriculumOnline | /helpers/curriculumdb.sql | UTF-8 | 6,940 | 3.546875 | 4 | [] | no_license | -- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema curriculumdb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema curriculumdb
-- -----------------------------------------------------
-- CREATE SCHEMA IF NOT EXISTS `curriculumdb` DEFAULT CHARACTER SET utf8 ;
-- USE `curriculumdb` ;
-- -----------------------------------------------------
-- Table `usuario`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `usuario` (
`email` VARCHAR(45) NOT NULL,
`senha` VARCHAR(45) NOT NULL,
`perfil` VARCHAR(45) NOT NULL DEFAULT 'candidato',
PRIMARY KEY (`email`));
-- -----------------------------------------------------
-- Table `curso_complementar`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `curso_complementar` (
`email` VARCHAR(45) NOT NULL,
`cursocompl` VARCHAR(45) NOT NULL,
`horascompl` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`email`, `cursocompl`),
CONSTRAINT `curso_complementar_email`
FOREIGN KEY (`email`)
REFERENCES `usuario` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `empresa`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `empresa` (
`email` VARCHAR(45) NOT NULL,
`razao_social` VARCHAR(45) NOT NULL,
`nome_fantasia` VARCHAR(45) NOT NULL,
`cnpj` VARCHAR(45) NULL DEFAULT NULL,
`responsavel` VARCHAR(45) NOT NULL,
`endereco` VARCHAR(45) NULL DEFAULT NULL,
`bairro` VARCHAR(45) NULL DEFAULT NULL,
`cidade` VARCHAR(45) NOT NULL,
`estado` VARCHAR(45) NOT NULL,
`segmento` VARCHAR(45) NOT NULL,
`atividade` VARCHAR(45) NOT NULL,
`porte` VARCHAR(45) NOT NULL,
`info_gerais` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`email`),
CONSTRAINT `empresa_email`
FOREIGN KEY (`email`)
REFERENCES `usuario` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `empresa_contato`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `empresa_contato` (
`email` VARCHAR(45) NOT NULL,
`contato` VARCHAR(45) NOT NULL,
`tipo` VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (`email`, `contato`),
CONSTRAINT `empresacontato_email`
FOREIGN KEY (`email`)
REFERENCES `usuario` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `experiencia`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `experiencia` (
`email` VARCHAR(45) NOT NULL,
`empresa` VARCHAR(45) NOT NULL,
`cargo` VARCHAR(45) NOT NULL,
`entrada` INT(11) NULL DEFAULT NULL,
`saida` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`email`, `empresa`, `cargo`),
CONSTRAINT `experiencia_email`
FOREIGN KEY (`email`)
REFERENCES `usuario` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `formacao`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `formacao` (
`email` VARCHAR(45) NOT NULL,
`curso` VARCHAR(45) NOT NULL,
`instituicao` VARCHAR(45) NOT NULL,
`status` VARCHAR(45) NULL DEFAULT NULL,
`conclusao` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`email`, `curso`, `instituicao`),
CONSTRAINT `formacao_email`
FOREIGN KEY (`email`)
REFERENCES `usuario` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `idioma`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `idioma` (
`email` VARCHAR(45) NOT NULL,
`idioma` VARCHAR(45) NOT NULL,
`nivel` VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (`email`, `idioma`),
CONSTRAINT `idioma_email`
FOREIGN KEY (`email`)
REFERENCES `usuario` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `info_pessoal`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `info_pessoal` (
`email` VARCHAR(45) NOT NULL,
`nomeCompleto` VARCHAR(64) NOT NULL,
`idade` INT(11) NULL DEFAULT NULL,
`sexo` VARCHAR(45) NULL DEFAULT NULL,
`estadoCivil` VARCHAR(45) NULL DEFAULT NULL,
`nacionalidade` VARCHAR(45) NULL DEFAULT NULL,
`objetivo` VARCHAR(64) NULL DEFAULT NULL,
`endereco` VARCHAR(64) NULL DEFAULT NULL,
`cidade` VARCHAR(45) NULL DEFAULT NULL,
`estado` VARCHAR(45) NULL DEFAULT NULL,
`telefone` VARCHAR(45) NULL DEFAULT NULL,
`info_adicional` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`email`),
CONSTRAINT `usuario_email`
FOREIGN KEY (`email`)
REFERENCES `usuario` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `vaga`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vaga` (
`numero` INT(11) NOT NULL AUTO_INCREMENT,
`email` VARCHAR(45) NOT NULL,
`area` VARCHAR(45) NOT NULL,
`vaga` VARCHAR(45) NOT NULL,
`descricao` TEXT NULL DEFAULT NULL,
`quantidade` INT(11) NULL DEFAULT NULL,
`data` DATETIME NULL DEFAULT NULL,
`salario` DOUBLE NULL DEFAULT NULL,
PRIMARY KEY (`numero`, `email`),
INDEX `vaga_empresaemail_idx` (`email` ASC),
CONSTRAINT `vaga_empresaemail`
FOREIGN KEY (`email`)
REFERENCES `empresa` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
-- -----------------------------------------------------
-- Table `vaga_candidato`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `vaga_candidato` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`vaga_numero` INT(11) NOT NULL,
`vaga_empresa` VARCHAR(45) NOT NULL,
`candidato_email` VARCHAR(45) NOT NULL,
`data` DATETIME NULL DEFAULT NULL,
`status` VARCHAR(45) NULL DEFAULT NULL,
PRIMARY KEY (`id`, `vaga_numero`, `candidato_email`, `vaga_empresa`),
INDEX `vaga_idx` (`vaga_numero` ASC, `vaga_empresa` ASC),
INDEX `candidato_idx` (`candidato_email` ASC),
CONSTRAINT `candidato`
FOREIGN KEY (`candidato_email`)
REFERENCES `info_pessoal` (`email`)
ON DELETE CASCADE
ON UPDATE CASCADE,
CONSTRAINT `vaga`
FOREIGN KEY (`vaga_numero` , `vaga_empresa`)
REFERENCES `vaga` (`numero` , `email`)
ON DELETE CASCADE
ON UPDATE CASCADE);
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
| true |
64b9f241c5b000a80e614f17723fc0610b84a0e3 | SQL | jitendra3109/Airlines_Database_Design | /Sql /schema_sql.sql | UTF-8 | 3,420 | 3.78125 | 4 | [] | no_license | DROP SCHEMA airline CASCADE;
CREATE SCHEMA airline;
SET search_path TO airline;
CREATE TABLE company
(
c_id CHAR(3) PRIMARY KEY NOT NULL,
c_name VARCHAR(20) NOT NULL,
head_quarter VARCHAR(20),
company_url VARCHAR(30)
);
CREATE TABLE flight_status
(
flight_status_id CHAR(1) PRIMARY KEY NOT NULL,
flight_status_name VARCHAR(20) NOT NULL
);
CREATE TABLE flight_detail
(
flight_no CHAR(5) PRIMARY KEY NOT NULL,
flight_name VARCHAR(30) NOT NULL,
c_id CHAR(3),
flight_status_id CHAR(1) REFERENCES flight_status(flight_status_id),
FOREIGN KEY(c_id) REFERENCES company(c_id)
);
CREATE TABLE route
(
route_id CHAR(4) PRIMARY KEY NOT NULL,
source VARCHAR(20) NOT NULL,
destination VARCHAR(20) NOT NULL,
distance INT
);
CREATE TABLE days
(
day_id VARCHAR(4) PRIMARY KEY NOT NULL,
day_name VARCHAR(13) NOT NULL
);
CREATE TABLE all_path
(
flight_no CHAR(5) REFERENCES flight_detail(flight_no),
route_id CHAR(4) REFERENCES route(route_id),
PRIMARY KEY(flight_no, route_id)
);
CREATE TABLE flight_route
(
flight_no CHAR(5) REFERENCES flight_detail(flight_no),
flight_route_id CHAR(6) NOT NULL,
depart_time TIME NOT NULL,
arrival_time TIME NOT NULL,
day_id VARCHAR(4) NOT NULL REFERENCES days(day_id),
route_id CHAR(4) NOT NULL REFERENCES route(route_id),
PRIMARY KEY(flight_route_id, flight_no)
);
CREATE TABLE users
(
user_id CHAR(9) PRIMARY KEY NOT NULL,
fname VARCHAR(15) NOT NULL,
lname VARCHAR(15),
gender VARCHAR(10) NOT NULL,
dob DATE NOT NULL,
emailid VARCHAR(30),
contact_no CHAR(10),
state VARCHAR(15),
country VARCHAR(15)
);
create table class (
class_id int primary key NOT NULL,
class_name varchar(20)
);
CREATE TABLE ticket
(
pnr_no CHAR(10) NOT NULL,
user_id CHAR(9) NOT NULL,
flight_no CHAR(5) REFERENCES flight_detail(flight_no),
class_id int,
route_id CHAR(4) REFERENCES route(route_id),
ticket_date DATE NOT NULL,
journey_date DATE NOT NULL,
PRIMARY KEY(pnr_no)
);
CREATE TABLE passenger_status
(
passenger_status_id CHAR(3) PRIMARY KEY NOT NULL,
passenger_status_name VARCHAR(15)
);
CREATE TABLE passenger
(
pnr_no CHAR(10) REFERENCES ticket(pnr_no),
seat_no INT NOT NULL,
fname VARCHAR(15) NOT NULL,
lname VARCHAR(15),
gender VARCHAR(10),
age INT,
passenger_status_id char(3) NOT NULL REFERENCES passenger_status(passenger_status_id),
PRIMARY KEY(pnr_no, seat_no)
);
CREATE TABLE fare_detail
(
route_id char(4) NOT NULL references route(route_id),
class_id int references class(class_id),
passenger_status_id CHAR(3) NOT NULL REFERENCES passenger_status(passenger_status_id),
fare INT NOT NULL,
flight_no CHAR(5) REFERENCES flight_detail(flight_no),
primary key (class_id,flight_no,passenger_status_id,route_id)
);
| true |
025cbc96247c29403900f0375aac32329eefa1a8 | SQL | gladiopeace/digital-data-syn | /documents/oms/TB_PUBID.sql | GB18030 | 1,858 | 3.34375 | 3 | [] | no_license | /*
================================================================================
ṹ:TB_PUBID
ṹ:¥
ṹĿ:
================================================================================
*/
drop sequence SEQ_TB_PUBID;
drop index AK_TB_PUBID;
drop table TB_PUBID;
create table TB_PUBID (
PUBID_ID INTEGER not null, /*¥ID */
PUBID001 INTEGER not null, /*˾ID */
PUBID002 INTEGER not null, /*Ӫ֯ID */
PUBID003 VARCHAR2(10) not null, /*¥ */
PUBID004 VARCHAR2(30) not null, /*¥ */
CREATE_USER VARCHAR2(12), /*Ա */
USER_GROUP VARCHAR2(12), /*Ա */
CREATE_DATE DATE, /* */
MODIFIER VARCHAR2(12), /*Ա */
MODI_DATE DATE, /* */
FLAG NUMBER(1), /*״̬ */
constraint PK_TB_PUBID primary key (PUBID_ID)
);
create unique index AK_TB_PUBID on TB_PUBID (PUBID003);
create sequence SEQ_TB_PUBID minvalue 1 maxvalue 9999999999999999999999999999 start with 1 increment by 1 nocache;
grant select on TB_PUBID to public;
grant index on TB_PUBID to public;
grant update on TB_PUBID to public;
grant delete on TB_PUBID to public;
grant insert on TB_PUBID to public;
grant select on SEQ_TB_PUBID to public; | true |
b87e866aaf3a0a3877916cb57983cf7a7408c8c0 | SQL | AlvinMcCray/ETL_Project | /Resources/ETL_Project.sql | UTF-8 | 662 | 3.796875 | 4 | [] | no_license | -- Create tables for raw data to be loaded into
DROP TABLE players;
CREATE TABLE players (
player VARCHAR,
college VARCHAR,
born FLOAT,
birth_city VARCHAR,
birth_state VARCHAR
);
SELECT * FROM players;
DROP TABLE nba_twitter;
CREATE TABLE nba_twitter (
player VARCHAR,
twitter_favorite_count FLOAT,
twitter_retweet_count FLOAT
);
-- SELECT * FROM nba_twitter;
-- Joins tables
SELECT players.player, players.college, players.born,
players.birth_city, players.birth_state, nba_twitter.twitter_favorite_count,
nba_twitter.twitter_retweet_count
FROM players
JOIN nba_twitter
ON players.player = nba_twitter.player;
SELECT * FROM nba_twitter; | true |
2faccf5299c660b7551ce236c6bec2b1cf9aaaa8 | SQL | KhlifSeifEddinne/laravelPosts | /saiflaravelproject.sql | UTF-8 | 7,250 | 3.171875 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : lun. 14 déc. 2020 à 15:39
-- Version du serveur : 10.4.14-MariaDB
-- Version de PHP : 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de données : `saiflaravelproject`
--
-- --------------------------------------------------------
--
-- Structure de la table `failed_jobs`
--
CREATE TABLE `failed_jobs` (
`id` bigint(20) UNSIGNED NOT NULL,
`connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
`queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
`payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
`failed_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-- --------------------------------------------------------
--
-- Structure de la table `migrations`
--
CREATE TABLE `migrations` (
`id` int(10) UNSIGNED NOT NULL,
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `migrations`
--
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES
(1, '2014_10_12_000000_create_users_table', 1),
(2, '2014_10_12_100000_create_password_resets_table', 1),
(3, '2019_08_19_000000_create_failed_jobs_table', 1),
(4, '2020_11_26_125320_create_posts_table', 1),
(5, '2020_11_26_224538_create_saifs_table', 2),
(6, '2020_11_26_233309_create_omars_table', 3),
(7, '2020_11_27_000225_ali', 4),
(8, '2020_11_27_000654_create_alis_table', 5),
(9, '2020_11_27_000809_create_mouniras_table', 5),
(10, '2020_11_27_002541_create_fat7is_table', 6),
(11, '2020_12_07_004056_add_user_idto_posts', 7),
(12, '2020_12_09_141900_add_cover_image_to_posts', 8);
-- --------------------------------------------------------
--
-- Structure de la table `password_resets`
--
CREATE TABLE `password_resets` (
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`token` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `password_resets`
--
INSERT INTO `password_resets` (`email`, `token`, `created_at`) VALUES
('khlifseifeddinne@gmail.com', '$2y$10$nYdBb.gmQ.Vntp7DbsWE.OYtX3gQDe6qD47hCbXYinL4RhhDCLrWC', '2020-12-06 23:07:51');
-- --------------------------------------------------------
--
-- Structure de la table `posts`
--
CREATE TABLE `posts` (
`id` int(10) UNSIGNED NOT NULL,
`title` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`body` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`user_id` int(11) NOT NULL,
`cover_image` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Déchargement des données de la table `posts`
--
INSERT INTO `posts` (`id`, `title`, `body`, `created_at`, `updated_at`, `user_id`, `cover_image`) VALUES
(24, 'a', 'a', '2020-12-09 14:05:10', '2020-12-09 16:09:22', 2, 'téléchargement (2)_1607533762.jfif'),
(29, 'ds', 'ds', '2020-12-09 15:09:22', '2020-12-09 15:58:21', 1, 'téléchargement_1607533101.jfif'),
(32, 'ss', 'ss', '2020-12-09 15:17:26', '2020-12-09 15:57:48', 3, 'téléchargement (1)_1607533068.jfif'),
(33, 'se', 'se', '2020-12-09 15:39:57', '2020-12-09 15:39:57', 3, 'noimage.jpg'),
(34, 'dff', 'dff', '2020-12-09 15:44:07', '2020-12-09 15:44:07', 3, 'noimage.jpg');
-- --------------------------------------------------------
--
-- Structure de la table `saifs`
--
CREATE TABLE `saifs` (
`id` bigint(20) UNSIGNED NOT NULL,
`Text` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`body` mediumtext 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;
-- --------------------------------------------------------
--
-- Structure de la table `users`
--
CREATE TABLE `users` (
`id` bigint(20) UNSIGNED NOT NULL,
`name` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`email_verified_at` timestamp NULL DEFAULT NULL,
`password` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`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;
--
-- Déchargement des données de la table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES
(1, 'Saif', 'khlifseifeddinne@gmail.com', NULL, '$2y$10$zt08JNn1uQTvf42ZZpBMuuI9cm/0FcFlTC8CEwXDcosTDavBWiX7.', 'lTGx5fMuzcnrRzfVOQ1FqWdnqUbVSNsFIvNfq7y0U0tIyVKuwKKEHcLtycIg', '2020-12-06 23:05:04', '2020-12-06 23:05:04'),
(2, 'khlif', 'saif@gmail.com', NULL, '$2y$10$i8rnnFAJZZvgE2F4m58CAuhBm47BHFn.WsExpfMbKO0HT3cq1gbNK', NULL, '2020-12-07 00:06:56', '2020-12-07 00:06:56'),
(3, 'admin', 'admin@gmail.com', NULL, '$2y$10$lfE5oAOdt4BP5530LGusae2R2hULPUwaTb/feNGaTGeoKLQMrsM66', NULL, '2020-12-08 17:14:25', '2020-12-08 17:14:25');
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `failed_jobs`
--
ALTER TABLE `failed_jobs`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `migrations`
--
ALTER TABLE `migrations`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `password_resets`
--
ALTER TABLE `password_resets`
ADD KEY `password_resets_email_index` (`email`);
--
-- Index pour la table `posts`
--
ALTER TABLE `posts`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `saifs`
--
ALTER TABLE `saifs`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `users_email_unique` (`email`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `failed_jobs`
--
ALTER TABLE `failed_jobs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `migrations`
--
ALTER TABLE `migrations`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT pour la table `posts`
--
ALTER TABLE `posts`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=36;
--
-- AUTO_INCREMENT pour la table `saifs`
--
ALTER TABLE `saifs`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `users`
--
ALTER TABLE `users`
MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
4688f926705edc67606a8448da7d7f9ff64c246d | SQL | Winteuchnyx/private-discussion-project | /PDP/mahasiswa.sql | UTF-8 | 3,722 | 2.8125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Inang: 127.0.0.1
-- Waktu pembuatan: 05 Jul 2017 pada 06.41
-- Versi Server: 5.5.34
-- Versi PHP: 5.4.22
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 */;
--
-- Basis data: `mahasiswa`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `biodata`
--
CREATE TABLE IF NOT EXISTS `biodata` (
`nim` char(9) NOT NULL,
`nama` varchar(50) DEFAULT NULL,
`alamat` varchar(200) DEFAULT NULL,
PRIMARY KEY (`nim`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `biodata`
--
INSERT INTO `biodata` (`nim`, `nama`, `alamat`) VALUES
('161401075', 'Randy Fikri', 'Medan'),
('161401087', 'Theo Ignathius', 'Binjai'),
('161401090', 'William', 'abdul'),
('161401093', 'Winto Junior Khosasih', 'jl.kambes'),
('161401096', 'Hensen Tia', 'Jl.Pembangunan'),
('161401135', 'Ricky Yohannes', 'jakarta'),
('161401138', 'Joshua JR sidabutar', 'medan');
-- --------------------------------------------------------
--
-- Struktur dari tabel `general`
--
CREATE TABLE IF NOT EXISTS `general` (
`foto` varchar(255) NOT NULL,
`username` varchar(255) NOT NULL,
`pesan` longtext NOT NULL,
`tanggal` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `general`
--
INSERT INTO `general` (`foto`, `username`, `pesan`, `tanggal`) VALUES
('ikon/user.jpg', 'winto', 'saya', '2017-07-05 04:34:36');
-- --------------------------------------------------------
--
-- Struktur dari tabel `grup`
--
CREATE TABLE IF NOT EXISTS `grup` (
`grup` varchar(255) NOT NULL,
`password` text NOT NULL,
`sesi` varchar(255) NOT NULL,
PRIMARY KEY (`grup`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Struktur dari tabel `login`
--
CREATE TABLE IF NOT EXISTS `login` (
`username` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
PRIMARY KEY (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `login`
--
INSERT INTO `login` (`username`, `password`) VALUES
('winto', 'winto123');
-- --------------------------------------------------------
--
-- Struktur dari tabel `notes`
--
CREATE TABLE IF NOT EXISTS `notes` (
`username` varchar(255) NOT NULL,
`pesan` longtext NOT NULL,
`tanggal` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `notes`
--
INSERT INTO `notes` (`username`, `pesan`, `tanggal`) VALUES
('winto', 'first launching', '2017-06-22 14:39:52');
-- --------------------------------------------------------
--
-- Struktur dari tabel `signup`
--
CREATE TABLE IF NOT EXISTS `signup` (
`foto` varchar(255) NOT NULL DEFAULT 'ikon/user.jpg',
`nim` int(11) NOT NULL,
`nama` varchar(254) NOT NULL,
`email` varchar(254) NOT NULL,
`jeniskelamin` varchar(254) NOT NULL,
`username` varchar(254) NOT NULL,
`password` text NOT NULL,
PRIMARY KEY (`nama`,`email`,`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data untuk tabel `signup`
--
INSERT INTO `signup` (`foto`, `nim`, `nama`, `email`, `jeniskelamin`, `username`, `password`) VALUES
('ikon/user.jpg', 161401093, 'Winto Junior Khosasih', 'piao.wjk@gmail.com', 'laki-laki', 'winto', 'winto12345');
/*!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 */;
| true |
f5934bcb7f50276b356937cb5d4eb3d6b97c6243 | SQL | trancx/ybtx | /trunk/game/gas/sql/toolsmall.sql | GB18030 | 1,383 | 3.265625 | 3 | [] | no_license | ################################################################
#̳
################################################################
##Ʒ¼
create table tbl_toolsmall_item_buyed
(
tib_uDetailID bigint unsigned not null auto_increment, #detail_id
cs_uId bigint unsigned not null, #buyer id
is_uType tinyint unsigned not null, #item type
is_sName varchar(96) not null, #item name
tib_uCount bigint unsigned not null, #buy count
tib_dtTime datetime not null,
primary key(tib_uDetailID),
key(tib_dtTime),
foreign key(cs_uId) references tbl_char_static(cs_uId) on update cascade on delete cascade
)engine=innodb;
#
create table tbl_toolsmall_item_geter
(
tib_uDetailID bigint unsigned not null, #order id
cs_uId bigint unsigned not null, #buyer id
unique key(tib_uDetailID),
foreign key(cs_uId) references tbl_char_static(cs_uId) on update cascade on delete cascade,
foreign key(tib_uDetailID) references tbl_toolsmall_item_buyed(tib_uDetailID) on update cascade on delete cascade
)engine=innodb;
#Ʒmemory
create table tbl_toolsmall_tabtype_memory
(
ttm_uTabType tinyint unsigned not null,
is_uType tinyint unsigned not null, #item type
is_sName varchar(96) not null, #item name
unique key(ttm_uTabType,is_uType,is_sName)
)engine=MEMORY;
| true |
a0f6bde237916d62fff6fd1e9bc2759527f4e52c | SQL | agusseputra/capil_api | /db_capil.sql | UTF-8 | 6,133 | 2.75 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 11, 2019 at 09:10 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `db_capil`
--
-- --------------------------------------------------------
--
-- Table structure for table `data_login`
--
CREATE TABLE `data_login` (
`username` varchar(100) DEFAULT NULL,
`email` varchar(45) DEFAULT NULL,
`akses` varchar(45) DEFAULT NULL,
`id_user` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `data_login`
--
INSERT INTO `data_login` (`username`, `email`, `akses`, `id_user`) VALUES
('agus@gmail.com', 'agus@gmail.com', 'api', 1);
-- --------------------------------------------------------
--
-- Table structure for table `data_penduduk_capil`
--
CREATE TABLE `data_penduduk_capil` (
`pasienid` mediumint(8) UNSIGNED NOT NULL,
`norm` varchar(15) NOT NULL DEFAULT '',
`nama` varchar(100) DEFAULT NULL,
`alamat` varchar(200) DEFAULT NULL,
`tempatlahir` varchar(50) DEFAULT NULL,
`tgllahir` date DEFAULT NULL,
`kelamin` enum('L','P') DEFAULT NULL,
`umur` smallint(6) DEFAULT NULL,
`statusperkawinan` varchar(15) DEFAULT NULL,
`agama` varchar(15) DEFAULT NULL,
`telepon` varchar(50) DEFAULT NULL,
`goldarah` varchar(5) DEFAULT NULL,
`kebangsaan` char(30) DEFAULT NULL,
`pendidikan` varchar(50) DEFAULT NULL,
`pekerjaan` varchar(50) DEFAULT NULL,
`propinsi` varchar(50) DEFAULT NULL,
`kabupaten` varchar(50) DEFAULT NULL,
`kecamatan` varchar(50) DEFAULT NULL,
`desa` varchar(50) DEFAULT NULL,
`photo` longblob DEFAULT NULL,
`regdate` date DEFAULT NULL,
`regtime` time DEFAULT NULL,
`notes` text DEFAULT NULL,
`inactive` tinyint(1) DEFAULT 0,
`cardprinted` tinyint(1) DEFAULT 0,
`pasientype` varchar(20) DEFAULT NULL,
`pasiensubtype` varchar(20) DEFAULT NULL,
`fax` varchar(45) DEFAULT NULL,
`mobile` varchar(45) DEFAULT NULL,
`email` varchar(100) DEFAULT NULL,
`mothername` varchar(150) DEFAULT NULL,
`fathername` varchar(150) DEFAULT NULL,
`companyid` varchar(15) DEFAULT NULL,
`iksemployeename` varchar(150) DEFAULT NULL,
`payrollno` varchar(15) DEFAULT NULL,
`companydept` varchar(45) DEFAULT NULL,
`relation` varchar(15) DEFAULT NULL,
`typebayar` varchar(40) DEFAULT NULL,
`typebayarid` varchar(50) DEFAULT NULL,
`idno` varchar(45) DEFAULT NULL,
`isaskes` tinyint(1) DEFAULT 0,
`umurbl` smallint(6) DEFAULT NULL,
`umurhr` smallint(6) DEFAULT NULL,
`wn` varchar(4) DEFAULT NULL,
`pasiencash` tinyint(1) DEFAULT 0,
`nobpjs` varchar(13) DEFAULT NULL,
`nik` varchar(16) DEFAULT NULL,
`pisa` smallint(6) DEFAULT NULL,
`kdprovider` varchar(12) DEFAULT NULL,
`nmprovider` varchar(80) DEFAULT NULL,
`klsrawat` varchar(25) DEFAULT NULL,
`peserta` varchar(75) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `data_penduduk_capil`
--
INSERT INTO `data_penduduk_capil` (`pasienid`, `norm`, `nama`, `alamat`, `tempatlahir`, `tgllahir`, `kelamin`, `umur`, `statusperkawinan`, `agama`, `telepon`, `goldarah`, `kebangsaan`, `pendidikan`, `pekerjaan`, `propinsi`, `kabupaten`, `kecamatan`, `desa`, `photo`, `regdate`, `regtime`, `notes`, `inactive`, `cardprinted`, `pasientype`, `pasiensubtype`, `fax`, `mobile`, `email`, `mothername`, `fathername`, `companyid`, `iksemployeename`, `payrollno`, `companydept`, `relation`, `typebayar`, `typebayarid`, `idno`, `isaskes`, `umurbl`, `umurhr`, `wn`, `pasiencash`, `nobpjs`, `nik`, `pisa`, `kdprovider`, `nmprovider`, `klsrawat`, `peserta`) VALUES
(1, '', 'Ketut AGus Seputra', 'Sangket Sukasada', 'Sangket', '2019-10-27', 'L', 12, 'single', 'Hindu', '02154787', 'B', 'Indonesia', 'SD', 'Anak-anak', 'Bali', 'Buleleng', 'BUleleng', 'BUleleng', 0x3f, '2019-10-27', NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0, '123456', '0989878987172839', NULL, NULL, NULL, NULL, NULL),
(126638, '', 'Made Bagia', 'Jineng Dalem', 'Singaraja', '1990-09-09', 'L', 30, 'menikah', 'Hindu', '099909', 'A', 'Indonesia', 'SD', 'Dosen', 'Bali', 'Buleleng', 'Buleleng', 'Jineng Dalem', NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0, '321', '9829283938948104', NULL, NULL, NULL, NULL, NULL),
(126639, '', 'Made Sandi', 'Sukasada', 'Sukasada', '1990-08-08', 'L', 30, 'menikah', 'Hindu', '999', 'O', 'Indonesia', 'Sd', 'Dosen', 'Bali', 'Denpasar', 'Denpasar Barat', 'Pemogan', NULL, NULL, NULL, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, 0, '99999', '0805048374859682', NULL, NULL, NULL, NULL, NULL);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `data_login`
--
ALTER TABLE `data_login`
ADD PRIMARY KEY (`id_user`),
ADD UNIQUE KEY `username_UNIQUE` (`username`);
--
-- Indexes for table `data_penduduk_capil`
--
ALTER TABLE `data_penduduk_capil`
ADD PRIMARY KEY (`pasienid`),
ADD UNIQUE KEY `pasienid` (`pasienid`,`norm`),
ADD KEY `FK_pasien` (`typebayar`),
ADD KEY `pasientype` (`pasientype`),
ADD KEY `nik` (`nik`),
ADD KEY `nobpjs` (`nobpjs`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `data_login`
--
ALTER TABLE `data_login`
MODIFY `id_user` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `data_penduduk_capil`
--
ALTER TABLE `data_penduduk_capil`
MODIFY `pasienid` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=126640;
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 */;
| true |
eb2e7ed83204da40c059b4e63dad933eddb0ebb0 | SQL | Ahmed-Sobeih/Query_digital_store | /city_with_highest_total.sql | UTF-8 | 126 | 3.4375 | 3 | [] | no_license | select c.city, sum(i.total)
from customer c
join invoice i
on i.customerid = c.customerid
group by 1
order by 2 DESC
limit 1;
| true |
8808c32ee99baceebfe9d24716342ad2a8f2ca63 | SQL | taylancelikjuventus/BankManagement | /database/bankmanagement1.sql | UTF-8 | 7,224 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 09, 2021 at 05:19 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
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: `bankmanagement1`
--
-- --------------------------------------------------------
--
-- Table structure for table `account`
--
CREATE TABLE `account` (
`id` int(11) NOT NULL,
`acc_id` varchar(255) NOT NULL,
`cust_id` varchar(255) NOT NULL,
`acc_type` varchar(255) NOT NULL,
`balance` int(11) NOT NULL,
`opened_datetime` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `account`
--
INSERT INTO `account` (`id`, `acc_id`, `cust_id`, `acc_type`, `balance`, `opened_datetime`) VALUES
(6, 'AC001', 'CS001', 'Fix', 7050, '2021-09-09T18:06:10.605'),
(7, 'AC002', 'CS002', 'Saving', 9000, '2021-09-09T18:07:26.047'),
(8, 'AC003', 'CS003', 'Fix', 16500, '2021-09-09T18:08:30.500');
-- --------------------------------------------------------
--
-- Table structure for table `branch`
--
CREATE TABLE `branch` (
`id` int(11) NOT NULL,
`branch` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `branch`
--
INSERT INTO `branch` (`id`, `branch`) VALUES
(1, 'branch_1'),
(2, 'branch_2');
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`id` int(11) NOT NULL,
`cust_id` varchar(255) NOT NULL,
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`street` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`branch` varchar(255) NOT NULL,
`phone` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`id`, `cust_id`, `firstname`, `lastname`, `street`, `city`, `branch`, `phone`) VALUES
(6, 'CS001', 'Bob', 'Black', 'xyz', 'London', 'branch_1', 123456),
(7, 'CS002', 'John', 'Cash', 'abc', 'Paris', 'branch_1', 789456),
(8, 'CS003', 'Brock', 'Lesnar', 'def', 'New York', 'branch_1', 456987);
-- --------------------------------------------------------
--
-- Table structure for table `deposit`
--
CREATE TABLE `deposit` (
`id` int(11) NOT NULL,
`acc_id` varchar(255) NOT NULL,
`cust_id` varchar(255) NOT NULL,
`datetime` varchar(255) NOT NULL,
`balance` int(11) NOT NULL,
`deposit` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `deposit`
--
INSERT INTO `deposit` (`id`, `acc_id`, `cust_id`, `datetime`, `balance`, `deposit`) VALUES
(29, 'AC001', 'CS001', '2021-09-09T18:08:49.723', 5000, 200),
(30, 'AC002', 'CS002', '2021-09-09T18:09:19.485', 8000, 2000),
(31, 'AC001', 'CS001', '2021-09-09T18:09:55.068', 5200, 1800),
(32, 'AC003', 'CS003', '2021-09-09T18:10:14.356', 15000, 2200);
-- --------------------------------------------------------
--
-- Table structure for table `loans`
--
CREATE TABLE `loans` (
`loan_id` int(11) NOT NULL,
`acc_id` varchar(255) NOT NULL,
`int_rate` double NOT NULL,
`num_of_years` double NOT NULL,
`amount_of_loan` double NOT NULL,
`monthly_payment` double NOT NULL,
`total_payment` double NOT NULL,
`datetime` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `loans`
--
INSERT INTO `loans` (`loan_id`, `acc_id`, `int_rate`, `num_of_years`, `amount_of_loan`, `monthly_payment`, `total_payment`, `datetime`) VALUES
(10, 'AC002', 5, 2, 1200, 55.25, 1325.93, '2021-09-09T18:14:01.401'),
(11, 'AC003', 4.7, 3, 4000, 127.9, 4604.43, '2021-09-09T18:14:24.042'),
(12, 'AC001', 4.6, 1.5, 3000, 178.55, 3213.88, '2021-09-09T18:14:55.018'),
(13, 'AC003', 4.85, 2.5, 5000, 188.11, 5643.16, '2021-09-09T18:15:45.993');
-- --------------------------------------------------------
--
-- Table structure for table `transfer`
--
CREATE TABLE `transfer` (
`id` int(11) NOT NULL,
`f_account` varchar(255) NOT NULL,
`to_account` varchar(255) NOT NULL,
`Balance` int(11) NOT NULL,
`amount` int(11) NOT NULL,
`datetime` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `transfer`
--
INSERT INTO `transfer` (`id`, `f_account`, `to_account`, `Balance`, `amount`, `datetime`) VALUES
(7, 'AC001', 'AC003', 6850, 500, '2021-09-09T18:11:39.925'),
(8, 'AC002', 'AC001', 9700, 700, '2021-09-09T18:12:10.809');
-- --------------------------------------------------------
--
-- Table structure for table `withdraw`
--
CREATE TABLE `withdraw` (
`id` int(11) NOT NULL,
`acc_id` varchar(255) NOT NULL,
`cust_id` varchar(255) NOT NULL,
`datetime` varchar(255) NOT NULL,
`balance` int(11) NOT NULL,
`withdraw` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `withdraw`
--
INSERT INTO `withdraw` (`id`, `acc_id`, `cust_id`, `datetime`, `balance`, `withdraw`) VALUES
(7, 'AC001', 'CS001', '2021-09-09T18:10:31.331', 7000, 150),
(8, 'AC002', 'CS002', '2021-09-09T18:10:48.603', 10000, 300),
(9, 'AC003', 'CS003', '2021-09-09T18:11:04.411', 17200, 1200);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `account`
--
ALTER TABLE `account`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `branch`
--
ALTER TABLE `branch`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `deposit`
--
ALTER TABLE `deposit`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `loans`
--
ALTER TABLE `loans`
ADD PRIMARY KEY (`loan_id`);
--
-- Indexes for table `transfer`
--
ALTER TABLE `transfer`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `withdraw`
--
ALTER TABLE `withdraw`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `account`
--
ALTER TABLE `account`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `branch`
--
ALTER TABLE `branch`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `customer`
--
ALTER TABLE `customer`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `deposit`
--
ALTER TABLE `deposit`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=33;
--
-- AUTO_INCREMENT for table `loans`
--
ALTER TABLE `loans`
MODIFY `loan_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `transfer`
--
ALTER TABLE `transfer`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `withdraw`
--
ALTER TABLE `withdraw`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
84e80fb3b7ce1e6d76ec50459c6af847d9c7d9ac | SQL | kkaren/BasesDadesAvan_Practiques | /Practica2_BDA/date_dimension.sql | UTF-8 | 965 | 3.859375 | 4 | [] | no_license | DROP TABLE IF EXISTS "Date Dimension";
CREATE TABLE "Date Dimension"
(
"Date Key" serial,
"Date" date,
"Full Day Description" text,
"Day Of Week" text,
"Calendar Month" text,
"Calendar Year" integer,
"Fiscal Year Month" text,
"Holiday Indicator" text,
"Weekday Indicator" text
);
INSERT INTO "Date Dimension"
("Date", "Full Day Description", "Day Of Week", "Calendar Month",
"Calendar Year", "Fiscal Year Month", "Holiday Indicator",
"Weekday Indicator")
SELECT
day,
rtrim(to_char(day, 'Month')) || to_char(day, ' DD, YYYY'),
to_char(day, 'Day'),
rtrim(to_char(day, 'Month')),
date_part('year', day),
'F' || to_char(day, 'YYYY-MM'),
'', --omitting (trivial 'Holiday'/'Non-Holiday, but how to get this ??),
CASE
WHEN date_part('isodow', day) IN (6, 7) THEN 'Weekend'
ELSE 'Weekday'
END
FROM
generate_series('2015-01-01'::date, '2025-12-31'::date, '1 day') day;
| true |
ac79bb713cd3affa377fdf1fbbb139b8ded9bcaf | SQL | jefsonleonidas/dev-environment | /sql/EMS/select/select_node_data_data_type.sql | UTF-8 | 623 | 3.953125 | 4 | [] | no_license | SELECT nd.id_ne_component, nd.id_data_unit, nd.name, nd.id_data_type, dt.name, nd.committed_value
FROM
(
SELECT *
FROM
(
SELECT id_node_data, id_ne_component, name
FROM node_data
WHERE id_ne_component IN (
SELECT id_ne_component
FROM ne_component
--WHERE naMe ILIKE 'ODU %'
)
) AS nd
INNER JOIN
(
SELECT id_data_unit, id_node_data, id_data_type,committed_value
FROM data_unit
) AS du
ON nd.id_node_data = du.id_node_data
ORDER BY nd.name
) AS nd
INNER JOIN
(
SELECT id_data_unit_type_enum, name
FROM data_unit_type_enum
) as dt
ON dt.id_data_unit_type_enum = nd.id_data_type | true |
cd3e98ae32f6710f9c56ca1006e2d40ffefde0b9 | SQL | toncho666/Procedures-optimization-noSQL | /lesson9.sql | UTF-8 | 3,732 | 4.46875 | 4 | [] | no_license | #___________________________________________________________________________________________
/*Создайте таблицу logs типа Archive.
*Пусть при каждом создании записи в таблицах users, catalogs и products в таблицу logs помещается
*- время и дата создания записи;
*- название таблицы;
*- идентификатор первичного ключа и содержимое поля name.*/
/*
delimiter ||
use shop||
drop table if exists logs||
create table logs (
id bigint(20) unsigned not null auto_increment,
created_at datetime default current_timestamp,
table_name Varchar(20) not null, # название таблицы
primary_key bigint(20) not null, # первичный ключ
name varchar(255) not null, # наименование
primary key (id)
)engine = Archive||
# создаем триггер на вставку записей в таблицу users
drop trigger if exists insert_users||
create trigger insert_users after insert on users
for each row
begin
insert into logs set table_name='users', primary_key=new.id, name = new.name;
end||
# создаем триггер на вставку записей в таблицу catalogs
drop trigger if exists insert_catalogs||
create trigger insert_catalogs after insert on catalogs
for each row
begin
insert into logs set table_name='catalogs', primary_key=new.id, name = new.name;
end||
# создаем триггер на вставку записей в таблицу products
drop trigger if exists insert_products||
create trigger insert_products after insert on products
for each row
begin
insert into logs set table_name='products', primary_key=new.id, name = new.name;
end||
# тестовые вставки
insert into catalogs values (default, 'processors')||
insert into users values (default, 'Екатерина', '1978-05-12', default, default)||
insert into products values (default, 'processors', 'processors description', 122312, 3, default, default)||
# просмотр лога
select * from logs||
delimiter ;
*/
#___________________________________________________________________________________________
/*(по желанию) Создайте SQL-запрос, который помещает в таблицу users миллион записей.
*/
delimiter ||
# создадим таблицу users1
drop table if exists users1||
create table users1 (
id bigint(20) unsigned not null auto_increment,
name varchar(255) default null COMMENT 'Имя покупателя',
birthday_at date default null COMMENT 'Дата рождения покупателя',
created_at datetime default current_timestamp,
updated_at datetime default current_timestamp on update current_timestamp,
primary key (`id`)
) ENGINE=Archive COMMENT='Покупатели'||
drop procedure if exists add_num_rows||
create procedure add_num_rows(num int)
begin
declare i int default 0;
while i < num DO
insert into users1 values (default, concat('user ', i),'1978-05-02',default, default);
set i = i+1;
end while;
end||
# в качестве параметра передадим функции требуемое для добавления количество строк (1 000 000 записей добавляется за 15 минут)
# если указываем Engine = InnoDB - время выполнения запроса около 30 минут на 1 000 000 записей.
call add_num_rows(10000)||
select * from users1|| #все записи таблицы users1
select count(*) from users1|| # количество записей таблицы users1
delimiter ;
| true |
eb56dc3e2bea422a5f9ef88758bd20e5541504dc | SQL | BloomBooks/analytics-postgreSQL | /2019 notes which may be obsolete/03 Views - for PNG-RISE-BloomReaderDashboard/TimesPerMonPNG.sql | UTF-8 | 1,000 | 3.78125 | 4 | [
"MIT"
] | permissive | REVOKE SELECT ON bloomreader.TimePerMonPNG FROM bloomreaderuser;
DROP VIEW bloomreader.TimePerMonPNG CASCADE;
CREATE VIEW bloomreader.TimePerMonPNG AS
SELECT a.id,
CAST((a.timestamp AT TIME ZONE 'AEST') AS date) AS timedate
FROM (SELECT * FROM bloomreader.application_opened
UNION ALL
SELECT * FROM bloomreaderbeta.application_opened )AS a
INNER JOIN public.ip2loc_sm_tab AS b ON
b.country_name = 'Papua New Guinea' and
public.ip2int(a.context_ip) = b.context_ip
WHERE CAST((a.timestamp AT TIME ZONE 'AEST') AS date) > ((date_trunc('month', (CAST((current_date AT TIME ZONE 'AEST') AS date))) - interval '1 day') - INTERVAL '12 months')
AND CAST((a.timestamp AT TIME ZONE 'AEST') AS date) < date_trunc('month', (CAST((current_date AT TIME ZONE 'AEST') AS date)))
GROUP BY CAST((a.timestamp AT TIME ZONE 'AEST') AS date), a.id, a.context_ip;
GRANT SELECT ON bloomreader.TimePerMonPNG TO bloomreaderuser;
select * FROM bloomreader.TimePerMonPNG; | true |
e6c7a4aeee701bb39d43af5b2cae84b161a82da8 | SQL | Mritunjoy71/CSE_216-Database-Sessional | /Database Project TV channel management/Project/DataBase Project SQL/Table_Codes.sql | UTF-8 | 2,314 | 3.203125 | 3 | [] | no_license | CREATE TABLE "Agriculture" (
"Program_id" int,
"Program_name" varchar2(50),
"cast" varchar2(50)
);
CREATE INDEX "pk" ON "Agriculture" ("Program_id");
CREATE TABLE "Ad_during_program" (
"product_id" int,
"program_id" int
);
CREATE INDEX "pk" ON "Ad_during_program" ("product_id");
CREATE INDEX "fk" ON "Ad_during_program" ("program_id");
CREATE TABLE "Reality_Show" (
"program_id" int,
"Program_name" varchar2(50),
"cast" varchar2(50)
);
CREATE INDEX "pk" ON "Reality_Show" ("program_id");
CREATE TABLE "News" (
"Program_id" int,
"news_hour" int,
"cast" varchar2(50)
);
CREATE INDEX "pk" ON "News" ("Program_id");
CREATE TABLE "serials" (
"Program_id" int,
"Cast" varchar2(50),
"serial_name" varchar2(50)
);
CREATE INDEX "pk" ON "serials" ("Program_id");
CREATE TABLE "Channel" (
"Program_id" int,
"Emp_id" int,
"" <type>
);
CREATE INDEX "pk" ON "Channel" ("Program_id");
CREATE TABLE "Talk_show" (
"Program_id" int,
"program_name" varchar2(50),
"cast" varchar2(50)
);
CREATE INDEX "pk" ON "Talk_show" ("Program_id");
CREATE TABLE "Programs" (
"Program_id" int,
"Program_type" varchar2(50),
"Sponsor" varchar2(50),
"TRP" varchar2(50),
"Starting_date" varchar2(50),
"end_date" date,
"Starting_time" varchar2(50),
"Number_of_epi" int,
"emp_id" int
);
CREATE INDEX "pk" ON "Programs" ("Program_id");
CREATE TABLE "Life_style" (
"Program_id" Type,
"Program_name" varchar2(50),
"cast" varchar2(50)
);
CREATE INDEX "pk" ON "Life_style" ("Program_id");
CREATE TABLE "Employee" (
"Emp_id" int,
"Emp_name" varchar2(50),
"Email" varchar2(50),
"Gender" varchar2(50),
"Mobile" int,
"Address" varchar2(50),
"Salary" int,
"Designation" varchar2(50),
"Hire_date" date
);
CREATE INDEX "pk" ON "Employee" ("Emp_id");
CREATE TABLE "Advertisement" (
"Product_id" int,
"Product_name" varchar2(50),
"Slot" int,
"Sponsor_fee" int
);
CREATE INDEX "pk" ON "Advertisement" ("Product_id");
CREATE TABLE "Casting" (
"Casting_id" int,
"Cast_name" varchar2(50),
"Casting_fee" varchar2(50)
);
CREATE INDEX "pk" ON "Casting" ("Casting_id");
CREATE TABLE "Cast" (
"Casting_id" int,
"program_id" int,
"" <type>
);
CREATE INDEX "Key" ON "Cast" ("Casting_id");
CREATE INDEX "fk" ON "Cast" ("program_id");
| true |
ead16af9ebdea017e64fca8178ae8be57b2c07fa | SQL | radtek/abs3 | /sql/mmfo/bars/View/v_birthday_staff_ca.sql | WINDOWS-1251 | 1,783 | 3.328125 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARS/View/V_BIRTHDAY_STAFF_CA.sql =========*** Ru
PROMPT =====================================================================================
PROMPT *** Create view V_BIRTHDAY_STAFF_CA ***
CREATE OR REPLACE FORCE VIEW BARS.V_BIRTHDAY_STAFF_CA ("OKPO", "BIRTHDAY", "FIO", "AGE") AS
SELECT UNIQUE c1.okpo,
TRUNC (p.bday),
--c.birthday,
--c.fio,
INITCAP (c1.nmk),
--EXTRACT (YEAR FROM SYSDATE) - EXTRACT (YEAR FROM birthday)
EXTRACT (YEAR FROM SYSDATE) - EXTRACT (YEAR FROM p.bday)
FROM -- ca_staff c
customer c1, person p, customerw c2
WHERE c1.date_off IS NULL
AND c1.rnk = c2.rnk
AND c2.rnk = p.rnk
AND c2.tag = 'WORK'
AND LOWER (c2.VALUE) LIKE '%%'
AND SUBSTR (TO_CHAR (p.bday /*birthday*/
, 'dd/mm/yyyy'), 1, 5) =
SUBSTR (TO_CHAR (TRUNC (SYSDATE), 'dd/mm/yyyy'), 1, 5);
PROMPT *** Create grants V_BIRTHDAY_STAFF_CA ***
grant SELECT on V_BIRTHDAY_STAFF_CA to BARSREADER_ROLE;
grant SELECT on V_BIRTHDAY_STAFF_CA to UPLD;
PROMPT =====================================================================================
PROMPT *** End *** ========== Scripts /Sql/BARS/View/V_BIRTHDAY_STAFF_CA.sql =========*** En
PROMPT =====================================================================================
| true |
8ceff608fa7e28b1d496e5e6d14572a53650c309 | SQL | codythompson/cs345Proj | /test/book.sql | UTF-8 | 150 | 2.953125 | 3 | [] | no_license | select copies.copyid, books.title, loans.due
from loans
left join copies on loans.copyid = copies.copyid
left join books on copies.isbn = books.isbn;
| true |
0cc72dd57f067fa15879901849014d1eb8aa677f | SQL | Saro0800/Basi_di_Dati | /Laboratori/LAB 02/LAB_02.sql | UTF-8 | 4,848 | 3.890625 | 4 | [] | no_license | /* Esercizio 1
-------------------------------------------------------
*/
SELECT D.DELIVERERID, D.NAME, D.INITIALS
FROM DELIVERERS D
WHERE D.DELIVERERID NOT IN ( SELECT P.DELIVERERID
FROM PENALTIES P
);
/* Esercizio 2
-------------------------------------------------------
*/
SELECT D.DELIVERERID
FROM DELIVERERS D
WHERE D.DELIVERERID IN ( SELECT P.DELIVERERID
FROM PENALTIES P
WHERE P.DELIVERERID IN ( SELECT DISTINCT P.DELIVERERID
FROM PENALTIES P
WHERE P.AMOUNT = 25)
AND P.AMOUNT = 30);
/* Esercizio 3
-------------------------------------------------------
*/
SELECT D.DELIVERERID, D.NAME
FROM DELIVERERS D
WHERE D.DELIVERERID IN ( SELECT P.DELIVERERID
FROM PENALTIES P
GROUP BY P.DELIVERERID, P.DATA
HAVING COUNT(*)>1
);
/* Esercizio 4
-------------------------------------------------------
*/
SELECT CD.DELIVERERID
FROM COMPANYDEL CD
GROUP BY CD.DELIVERERID
HAVING COUNT(*) = ( SELECT COUNT(*)
FROM COMPANIES C
);
/* Esercizio 5
-------------------------------------------------------
*/
SELECT CD.DELIVERERID
FROM COMPANYDEL CD
WHERE CD.COMPANYID IN ( SELECT COMPANYID
FROM COMPANYDEL
WHERE DELIVERERID = 57
)
AND CD.DELIVERERID <> 57;
/* Esercizio 6
-------------------------------------------------------
*/
SELECT D.DELIVERERID, D.NAME
FROM PENALTIES P, DELIVERERS D
WHERE P.DELIVERERID = D.DELIVERERID
AND P.DATA <= TO_DATE('31/12/1980','DD/MM/YYYY')
AND P.DATA >= TO_DATE('01/01/1980','DD/MM/YYYY')
GROUP BY D.DELIVERERID, D.NAME
HAVING COUNT(*) > ( SELECT COUNT(*)
FROM PENALTIES P1
WHERE D.DELIVERERID = P1.DELIVERERID
AND P1.DATA <= TO_DATE('31/12/1981','DD/MM/YYYY')
AND P1.DATA >= TO_DATE('01/01/1981','DD/MM/YYYY')
);
/* Esercizio 7
-------------------------------------------------------
*/
SELECT P.DELIVERERID
FROM PENALTIES P
GROUP BY P.DELIVERERID
HAVING COUNT(*) = ( SELECT MAX(NPenalties)
FROM (SELECT COUNT(*) AS NPenalties
FROM PENALTIES P1
GROUP BY P1.DELIVERERID
)
);
/* Esercizio 8
-------------------------------------------------------
*/
SELECT CD.DELIVERERID
FROM COMPANYDEL CD
WHERE CD.DELIVERERID <> 57
AND CD.COMPANYID IN ( SELECT CD1.COMPANYID
FROM COMPANYDEL CD1
WHERE CD1.DELIVERERID = 57
)
GROUP BY CD.DELIVERERID
HAVING COUNT(*) = ( SELECT COUNT(*)
FROM COMPANYDEL CD2
WHERE CD2.DELIVERERID = 57
);
/* Esercizio 9
-------------------------------------------------------
*/
SELECT DISTINCT DELIVERERID
FROM COMPANYDEL
WHERE DELIVERERID <> 57
AND DELIVERERID NOT IN ( SELECT DELIVERERID
FROM COMPANYDEL
WHERE COMPANYID NOT IN ( SELECT COMPANYID
FROM COMPANYDEL
WHERE DELIVERERID = 57)
);
/* Esercizio 10
-------------------------------------------------------
*/
SELECT DISTINCT DELIVERERID
FROM COMPANYDEL
WHERE DELIVERERID <> 57
AND DELIVERERID NOT IN ( SELECT DELIVERERID
FROM COMPANYDEL
WHERE COMPANYID NOT IN ( SELECT COMPANYID
FROM COMPANYDEL
WHERE DELIVERERID = 57)
)
GROUP BY DELIVERERID
HAVING COUNT(*) = ( SELECT COUNT(*)
FROM COMPANYDEL CD2
WHERE CD2.DELIVERERID = 57
);
| true |
43941d02233e6e3bab025005f99d2d88d217955d | SQL | EfeClojure/gidicodersworkout | /resources/migrations/20150911211033-add-workout-table.up.sql | UTF-8 | 296 | 2.59375 | 3 | [] | no_license | CREATE TABLE workout (
-- If you type 'serial' there's no need to precede it with 'int'
workout_id serial PRIMARY KEY
, creator_id integer NOT NULL
, workout_title text NOT NULL
, workout_text text NOT NULL
, start_date varchar(30) NOT NULL
, end_date varchar(30)
, is_active boolean
);
| true |
adaab587be2c3362cb80e3fe54195c661bad2722 | SQL | burdavicinav/sql_sepo | /_up/2018_06_05/pkg_sepo_raw_operations.sql | WINDOWS-1251 | 3,322 | 3.3125 | 3 | [] | no_license | CREATE OR REPLACE PACKAGE pkg_sepo_raw_operations
IS
--
-- exporttodbf
--
NULL_BYTE CONSTANT RAW(1) := Utl_Raw.cast_to_raw(Chr(0));
--
END_FILE CONSTANT RAW(1) := Utl_Raw.cast_to_raw(Chr(26));
--
CP866 CONSTANT NUMBER := 1;
WIN1251 CONSTANT NUMBER := 2;
FUNCTION GetBytes(
p_raw RAW,
p_count NUMBER
)
RETURN RAW;
-- (4 )
FUNCTION GetBytes(
p_number BINARY_INTEGER,
p_count_bytes NUMBER DEFAULT 4
)
RETURN RAW;
--
FUNCTION GetBytes(
p_str VARCHAR2,
p_isterminal BOOLEAN DEFAULT TRUE,
p_is_convert BOOLEAN DEFAULT FALSE,
p_cs_old NUMBER DEFAULT WIN1251,
p_cs_new NUMBER DEFAULT CP866)
RETURN RAW;
--
FUNCTION GetBytes(
p_date DATE
)
RETURN RAW;
FUNCTION GetNullBytes(
p_count NUMBER
)
RETURN RAW;
END;
/
CREATE OR REPLACE PACKAGE BODY pkg_sepo_raw_operations
IS
FUNCTION GetBytes(
p_raw RAW,
p_count NUMBER
)
RETURN RAW
IS
BEGIN
RETURN Utl_Raw.copies(p_raw, p_count);
END;
FUNCTION GetBytes(
p_number BINARY_INTEGER,
p_count_bytes NUMBER DEFAULT 4
)
RETURN RAW
IS
l_raw RAW(4);
BEGIN
l_raw := Utl_Raw.REVERSE(Utl_Raw.cast_from_binary_integer(p_number));
l_raw := Utl_Raw.SubStr(l_raw, 1, p_count_bytes);
RETURN l_raw;
END;
FUNCTION CharsetToDefinition(p_num NUMBER)
RETURN VARCHAR2
IS
BEGIN
IF p_num = 1 THEN
RETURN 'AMERICAN_AMERICA.RU8PC866';
ELSIF p_num = 2 THEN
RETURN 'AMERICAN_AMERICA.CL8MSWIN1251';
END IF;
END;
FUNCTION GetBytes(
p_str VARCHAR2,
p_isterminal BOOLEAN DEFAULT TRUE,
p_is_convert BOOLEAN DEFAULT FALSE,
p_cs_old NUMBER DEFAULT WIN1251,
p_cs_new NUMBER DEFAULT CP866)
RETURN RAW
IS
l_raw RAW(255);
BEGIN
l_raw := Utl_Raw.cast_to_raw(p_str);
IF p_isterminal THEN
l_raw := Utl_Raw.Concat(l_raw, null_byte);
END IF;
IF p_is_convert THEN
l_raw := Utl_Raw.Convert(
l_raw,
CharsetToDefinition(p_cs_new),
CharsetToDefinition(p_cs_old)
);
END IF;
RETURN l_raw;
END;
FUNCTION GetBytes(
p_date DATE
)
RETURN RAW
IS
l_days BINARY_INTEGER;
l_hours BINARY_INTEGER;
l_minutes BINARY_INTEGER;
l_seconds BINARY_INTEGER;
l_miliseconds BINARY_INTEGER;
l_date RAW(4);
l_time RAW(4);
BEGIN
IF p_date IS NOT NULL THEN
l_days := To_Char(p_date, 'J');
l_hours := To_Char(p_date, 'HH24');
l_minutes := To_Char(p_date, 'MM');
l_seconds := To_Char(p_date, 'SS');
l_miliseconds :=
l_hours * 3600 * 1000 +
l_minutes * 60 * 1000 +
l_seconds * 1000;
l_date := GetBytes(l_days, 4);
l_time := GetBytes(l_miliseconds, 4);
RETURN Utl_Raw.Concat(l_date, l_time);
END IF;
RETURN '1';
END;
FUNCTION GetNullBytes(
p_count NUMBER
)
RETURN RAW
IS
BEGIN
RETURN GetBytes(null_byte, p_count);
END;
END;
/ | true |
a360b39cad7b178cf89282c5c3378c0b2b1bbc61 | SQL | rmcgibony/sql-to-graph | /load_db.cql | UTF-8 | 3,362 | 3.359375 | 3 | [
"MIT"
] | permissive | MATCH (n)
OPTIONAL MATCH (n)-[r]-()
DELETE n,r;
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/customers.csv' as line
CREATE (c:Customer {id: line.CustomerID})
SET c.company_name = line.CompanyName,
c.contact_name = line.ContactName;
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/employees.csv' as line
CREATE (e:Employee {id: line.EmployeeID})
SET e.first_name = line.FirstName,
e.last_name = line.LastName;
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/phones.csv' as line
CREATE (p:Phone {number: line.phone});
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/addresses.csv' as line
CREATE (a:Address {address: line.address});
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/orders.csv' as line
CREATE (r:Return {order_id: line.OrderID})
SET r.amount = TOINT(line.total);
// Relationships
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/customers.csv' as line
MATCH (c:Customer {id: line.CustomerID})
MATCH (p:Phone {number: line.Phone})
CREATE (c)-[:HAS_PHONE]->(p);
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/customers.csv' as line
MATCH (c:Customer {id: line.CustomerID})
MATCH (a:Address {address: line.Address})
CREATE (c)-[:HAS_ADDRESS]->(a);
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/employees.csv' as line
MATCH (e:Employee {id: line.EmployeeID})
MATCH (p:Phone {number: line.HomePhone})
CREATE (e)-[:HAS_PHONE]->(p);
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/employees.csv' as line
MATCH (e:Employee {id: line.EmployeeID})
MATCH (a:Address {address: line.Address})
CREATE (c)-[:HAS_ADDRESS]->(a);
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/orders.csv' as line
MATCH (e:Employee {id: line.EmployeeID})
MATCH (r:Return {order_id: line.OrderID})
CREATE (e)-[:PROCESSED]->(r);
LOAD CSV WITH HEADERS FROM 'file:///C:/Users/rmcgibony/Box Sync/Ryan McGibony/Graph Databases Talk/tmp/orders.csv' as line
MATCH (c:Customer {id: line.CustomerID})
MATCH (r:Return {order_id: line.OrderID})
CREATE (c)-[rel:REQUESTED]->(r)
SET rel.date = line.ShippedDate;
// Insert suspicious relationships
CREATE (e:Employee {id:10, first_name:'Roger', last_name:'Thompson'});
MATCH (a:Address {address:'8 Johnstown Road'}), (e:Employee {id:10})
CREATE (e)-[r:HAS_ADDRESS]->(a);
MATCH (e:Employee {id:10}), (p:Phone {number:'(503) 555-6874'})
CREATE (e)-[r:HAS_PHONE]->(p);
CREATE (r:Return {order_id:11078, return_date:'1996-08-10', amount:2100});
MATCH (c:Customer {id:'HUNGO'}), (r:Return {order_id:11078})
CREATE (c)-[:REQUESTED]->(r);
MATCH (e:Employee {id:10}), (r:Return {order_id:11078})
CREATE (e)-[:PROCESSED]->(r);
CREATE (r:Return {order_id:11079, return_date:'1996-08-12', amount:1350});
MATCH (c:Customer {id:'BSBEV'}), (r:Return {order_id:11079})
CREATE (c)-[:REQUESTED]->(r);
MATCH (e:Employee {id:10}), (r:Return {order_id:11079})
CREATE (e)-[:PROCESSED]->(r); | true |
d105397b0f721c318ca26fbae025125ed72e4318 | SQL | khvpn/panel_500 | /install.sql | UTF-8 | 20,393 | 2.640625 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 17, 2019 at 02:00 PM
-- Server version: 5.7.17-log
-- PHP Version: 5.6.30
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 */;
--
--
-- --------------------------------------------------------
--
-- Table structure for table `all_filesvpn`
--
CREATE TABLE `all_filesvpn` (
`id` int(11) NOT NULL,
`file_name` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`file_sim` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`file_pro` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`file_ovpn` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`file_ehi` varchar(255) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `all_filesvpn`
--
INSERT INTO `all_filesvpn` (`id`, `file_name`, `file_sim`, `file_pro`, `file_ovpn`, `file_ehi`) VALUES
(1, 'https://m.mediafire.com/welcome', '', '', '', '');
-- --------------------------------------------------------
--
-- Table structure for table `all_program`
--
CREATE TABLE `all_program` (
`id` int(11) NOT NULL,
`pritunl` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`pcvpn` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`appvpn` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`apphttp` varchar(255) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `all_program`
--
INSERT INTO `all_program` (`id`, `pritunl`, `pcvpn`, `appvpn`, `apphttp`) VALUES
(1, 'https://m.mediafire.com/welcome', '', '', '');
-- --------------------------------------------------------
--
-- Table structure for table `asset`
--
CREATE TABLE `asset` (
`id` int(11) NOT NULL,
`promox` int(1) NOT NULL DEFAULT '1',
`rekening` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`bank` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`pemilik` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`nohp` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`provider` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`webname` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`fbchat` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`fbface` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`fbgroup` varchar(999) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `asset`
--
INSERT INTO `asset` (`id`, `promox`, `rekening`, `bank`, `pemilik`, `nohp`, `provider`, `webname`, `fbchat`, `fbface`, `fbgroup`) VALUES
(1, 1, NULL, NULL, 'ชื่อwallet', 'เบอร์wallet', 'เครือข่ายมือถือ', NULL, NULL, NULL, NULL),
(2, 1, 'โบนัสการเติมเงิน', 'ยังไม่มี ช่วงนี้จน...', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 1, NULL, NULL, NULL, NULL, NULL, 'ชื่อเว็บไซต์', 'ติดต่อแอดมิน', 'หน้าเฟสแอดมิน', 'กลุ่มเว็บไซต์');
-- --------------------------------------------------------
--
-- Table structure for table `ci_sessions`
--
CREATE TABLE `ci_sessions` (
`id` varchar(40) CHARACTER SET utf8 NOT NULL,
`ip_address` varchar(45) CHARACTER SET utf8 NOT NULL,
`timestamp` int(10) UNSIGNED NOT NULL DEFAULT '0',
`data` blob NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `continent`
--
CREATE TABLE `continent` (
`Id` int(11) NOT NULL,
`Name` varchar(20) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `continent`
--
INSERT INTO `continent` (`Id`, `Name`) VALUES
(1, 'Asia'),
(2, 'North America'),
(3, 'Europe'),
(4, 'South America'),
(5, 'Africa'),
(6, 'Oceania');
-- --------------------------------------------------------
--
-- Table structure for table `country`
--
CREATE TABLE `country` (
`Id` int(11) NOT NULL,
`Name` varchar(20) CHARACTER SET utf8 DEFAULT NULL,
`Country` varchar(20) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `country`
--
INSERT INTO `country` (`Id`, `Name`, `Country`) VALUES
(1, 'Asia', 'Singapore'),
(2, 'Asia', 'Thailand'),
(3, 'Asia', 'Japan'),
(4, 'Asia', 'Hongkong'),
(5, 'Europe', 'Netherlands'),
(6, 'Europe', 'Germani'),
(7, 'Europe', 'France'),
(8, 'Europe', 'Luxembourg'),
(9, 'North-America', 'NY-USA'),
(10, 'North-America', 'Canada'),
(11, 'North-America', 'LA-USA'),
(12, 'South-America', 'NY-USA'),
(14, 'Africa', 'Johanesburg'),
(15, 'Oceania', 'Australia'),
(16, 'North-America', 'Austria');
-- --------------------------------------------------------
--
-- Table structure for table `deposit`
--
CREATE TABLE `deposit` (
`id` int(11) NOT NULL,
`userid` int(11) NOT NULL,
`pesan` text CHARACTER SET utf8 NOT NULL,
`is_confirmed` tinyint(1) NOT NULL DEFAULT '0',
`jumlah` int(11) DEFAULT NULL,
`created_at` date NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `histrory`
--
CREATE TABLE `histrory` (
`NumberWallet` varchar(14) NOT NULL,
`money` float NOT NULL,
`username` varchar(255) NOT NULL,
`status` int(11) NOT NULL,
`id` int(11) NOT NULL,
`NumberPhone` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `new_news`
--
CREATE TABLE `new_news` (
`id` int(11) NOT NULL,
`news_title` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`news_new` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`news_data` varchar(255) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `new_news`
--
INSERT INTO `new_news` (`id`, `news_title`, `news_new`, `news_data`) VALUES
(1, 'NULL', 'NULL', 'NULL');
-- --------------------------------------------------------
--
-- Table structure for table `pro_ais`
--
CREATE TABLE `pro_ais` (
`id` int(11) NOT NULL,
`a_descrip` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`a_phone` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`a_link` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`a_button` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pro_dtac`
--
CREATE TABLE `pro_dtac` (
`id` int(11) NOT NULL,
`d_descrip` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`d_phone` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`d_link` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`d_button` varchar(255) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `pro_true`
--
CREATE TABLE `pro_true` (
`id` int(11) NOT NULL,
`t_descrip` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`t_phone` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`t_link` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
`t_button` varchar(255) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `server`
--
CREATE TABLE `server` (
`Id` int(11) NOT NULL,
`HostName` varchar(23) DEFAULT NULL,
`RootPasswd` varchar(25) NOT NULL,
`MaxUser` int(11) NOT NULL DEFAULT '50',
`Expired` int(11) NOT NULL DEFAULT '7',
`ServerName` varchar(20) DEFAULT NULL,
`Location` varchar(20) DEFAULT NULL,
`OpenSSH` varchar(20) NOT NULL DEFAULT '22',
`Dropbear` varchar(20) NOT NULL DEFAULT '443',
`Price` int(10) DEFAULT '10',
`Status` int(11) NOT NULL DEFAULT '1',
`limitssh` varchar(20) NOT NULL DEFAULT '2',
`limitvpn` varchar(20) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=tis620;
-- --------------------------------------------------------
--
-- Table structure for table `sshuser`
--
CREATE TABLE `sshuser` (
`id` int(11) NOT NULL,
`username` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`hostname` varchar(20) NOT NULL,
`created_by` varchar(20) NOT NULL,
`created_at` date NOT NULL,
`expired_at` int(11) NOT NULL DEFAULT '30',
`serverid` int(11) NOT NULL,
`price` int(11) DEFAULT NULL,
`exp` varchar(55) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `tbl_roles`
--
CREATE TABLE `tbl_roles` (
`roleId` tinyint(4) NOT NULL COMMENT 'role id',
`role` varchar(50) NOT NULL COMMENT 'role text'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `tbl_roles`
--
INSERT INTO `tbl_roles` (`roleId`, `role`) VALUES
(1, 'Admin'),
(2, 'Yönetici'),
(3, 'Çalışan');
-- --------------------------------------------------------
--
-- Table structure for table `terms_use`
--
CREATE TABLE `terms_use` (
`id` int(11) NOT NULL,
`terms_agree` varchar(999) CHARACTER SET utf8 DEFAULT NULL,
`terms_note` varchar(999) CHARACTER SET utf8 DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `terms_use`
--
INSERT INTO `terms_use` (`id`, `terms_agree`, `terms_note`) VALUES
(1, 'การใช้งาน ความเร็วอินเตอร์เน็ต ขึ้นอยู่หลายปัจจัย หากเน็ตช้าหรือมีปัญหา กรุณาตรวจสอบปัญหาให้แน่ชัดก่อน ว่าเกิดจากอะไร เเล้วค่อยเเจ้งปัญหามา หากปัญหาเกิดจาก เครื่องหรือพื้นที่ใช้งาน ทางผู้ดูเเลจะไม่สามารถเเก้ไขปัญหาให้ได้ ผู้ดูเเลสามารถแก้ได้เฉพาะปัญหา ที่เกิดจากเซิฟเวอร์เท่านั้น', 'กรณีโฮสดับ โดนอุด ต้องรอจนกว่าจะหาโฮสใหม่ได้ จะไม่มีการคืนเงินทุกกรณี');
-- --------------------------------------------------------
--
-- Table structure for table `token`
--
CREATE TABLE `token` (
`id` int(11) NOT NULL,
`login` varchar(50) DEFAULT NULL,
`wallet` varchar(50) DEFAULT NULL,
`add_vpn` varchar(50) DEFAULT NULL,
`nohp` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `token`
--
INSERT INTO `token` (`id`, `login`, `wallet`, `add_vpn`, `nohp`) VALUES
(1, 'ล็อกอินเข้าสู่ระบบ', 'ตรวจสอบการเติมเงิน', 'ตรวจสอบการเช่าเซิร์ฟ', 'NULL');
-- --------------------------------------------------------
--
-- Table structure for table `truemoney`
--
CREATE TABLE `truemoney` (
`id` bigint(20) NOT NULL,
`card` varchar(14) NOT NULL,
`uid` varchar(50) NOT NULL,
`uip` varchar(16) NOT NULL,
`amount` int(4) NOT NULL DEFAULT '0',
`status` int(11) NOT NULL,
`time` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `tw_transactions`
--
CREATE TABLE `tw_transactions` (
`id` int(11) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`txn_id` varchar(50) DEFAULT NULL,
`type` varchar(50) DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `userlimit`
--
CREATE TABLE `userlimit` (
`Id` int(11) NOT NULL,
`Hostname` varchar(23) CHARACTER SET utf8 DEFAULT NULL,
`Counter` int(11) DEFAULT NULL,
`Date` date DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) UNSIGNED NOT NULL,
`username` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`password` varchar(255) NOT NULL DEFAULT '',
`avatar` varchar(255) DEFAULT 'default.jpg',
`saldo` float NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL,
`is_admin` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`is_confirmed` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`active` int(1) NOT NULL DEFAULT '1',
`online` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT 'offline',
`online_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`script_vpns` tinyint(1) UNSIGNED NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `vpn_script`
--
CREATE TABLE `vpn_script` (
`id` int(11) NOT NULL,
`ip` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`buy` varchar(255) NOT NULL,
`exp` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `vpn_script`
--
INSERT INTO `vpn_script` (`id`, `ip`, `name`, `buy`, `exp`) VALUES
(1, '127.0.0.1', '', '', '');
-- --------------------------------------------------------
--
-- Table structure for table `wallet`
--
CREATE TABLE `wallet` (
`id` int(11) NOT NULL,
`passwd` varchar(50) DEFAULT NULL,
`phone` varchar(50) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`nohp` varchar(50) DEFAULT NULL,
`persen` int(2) NOT NULL DEFAULT '0',
`x2` int(1) NOT NULL DEFAULT '1'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `wallet`
--
INSERT INTO `wallet` (`id`, `passwd`, `phone`, `email`, `nohp`, `persen`, `x2`) VALUES
(1, 'รหัสผ่านwallet', 'ใส่เบอร์', 'อีเมล์wallet', NULL, 0, 1);
-- --------------------------------------------------------
--
-- Table structure for table `website`
--
CREATE TABLE `website` (
`id` int(11) NOT NULL,
`brand` varchar(20) CHARACTER SET utf8 NOT NULL DEFAULT 'lnw-service',
`author` varchar(20) CHARACTER SET utf8 NOT NULL,
`title` text CHARACTER SET utf8,
`description` text CHARACTER SET utf8 NOT NULL,
`keyword` text CHARACTER SET utf8 NOT NULL,
`theme_servers` int(1) NOT NULL,
`theme_create` int(1) NOT NULL DEFAULT '2',
`api_truewallet` int(1) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Dumping data for table `website`
--
INSERT INTO `website` (`id`, `brand`, `author`, `title`, `description`, `keyword`, `theme_servers`, `theme_create`, `api_truewallet`) VALUES
(1, 'lnw-service', '', NULL, '', '', 4, 1, 0);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `all_filesvpn`
--
ALTER TABLE `all_filesvpn`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `all_program`
--
ALTER TABLE `all_program`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `asset`
--
ALTER TABLE `asset`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `ci_sessions`
--
ALTER TABLE `ci_sessions`
ADD PRIMARY KEY (`id`),
ADD KEY `ci_sessions_timestamp` (`timestamp`);
--
-- Indexes for table `continent`
--
ALTER TABLE `continent`
ADD PRIMARY KEY (`Id`);
--
-- Indexes for table `country`
--
ALTER TABLE `country`
ADD PRIMARY KEY (`Id`);
--
-- Indexes for table `deposit`
--
ALTER TABLE `deposit`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `histrory`
--
ALTER TABLE `histrory`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `new_news`
--
ALTER TABLE `new_news`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pro_ais`
--
ALTER TABLE `pro_ais`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pro_dtac`
--
ALTER TABLE `pro_dtac`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pro_true`
--
ALTER TABLE `pro_true`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `server`
--
ALTER TABLE `server`
ADD PRIMARY KEY (`Id`);
--
-- Indexes for table `sshuser`
--
ALTER TABLE `sshuser`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_roles`
--
ALTER TABLE `tbl_roles`
ADD PRIMARY KEY (`roleId`);
--
-- Indexes for table `terms_use`
--
ALTER TABLE `terms_use`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `token`
--
ALTER TABLE `token`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `truemoney`
--
ALTER TABLE `truemoney`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tw_transactions`
--
ALTER TABLE `tw_transactions`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `userlimit`
--
ALTER TABLE `userlimit`
ADD PRIMARY KEY (`Id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `vpn_script`
--
ALTER TABLE `vpn_script`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `wallet`
--
ALTER TABLE `wallet`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `website`
--
ALTER TABLE `website`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `all_filesvpn`
--
ALTER TABLE `all_filesvpn`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `all_program`
--
ALTER TABLE `all_program`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `asset`
--
ALTER TABLE `asset`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `continent`
--
ALTER TABLE `continent`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `country`
--
ALTER TABLE `country`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `deposit`
--
ALTER TABLE `deposit`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `histrory`
--
ALTER TABLE `histrory`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `new_news`
--
ALTER TABLE `new_news`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `pro_ais`
--
ALTER TABLE `pro_ais`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pro_dtac`
--
ALTER TABLE `pro_dtac`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pro_true`
--
ALTER TABLE `pro_true`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `server`
--
ALTER TABLE `server`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `sshuser`
--
ALTER TABLE `sshuser`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tbl_roles`
--
ALTER TABLE `tbl_roles`
MODIFY `roleId` tinyint(4) NOT NULL AUTO_INCREMENT COMMENT 'role id', AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `terms_use`
--
ALTER TABLE `terms_use`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `token`
--
ALTER TABLE `token`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `truemoney`
--
ALTER TABLE `truemoney`
MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `tw_transactions`
--
ALTER TABLE `tw_transactions`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `userlimit`
--
ALTER TABLE `userlimit`
MODIFY `Id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `vpn_script`
--
ALTER TABLE `vpn_script`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `wallet`
--
ALTER TABLE `wallet`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `website`
--
ALTER TABLE `website`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
28851c3c312e80bcb00b928eda54d8192a0e456a | SQL | bellmit/flexdb | /2.HOST/3.Procedure/cf0020.sql | UTF-8 | 2,235 | 3.359375 | 3 | [] | no_license | CREATE OR REPLACE PROCEDURE cf0020 (
PV_REFCURSOR IN OUT PKG_REPORT.REF_CURSOR,
OPT IN VARCHAR2,
BRID IN VARCHAR2,
F_DATE IN VARCHAR2,
T_DATE IN VARCHAR2
)
IS
--
-- PURPOSE: BRIEFLY EXPLAIN THE FUNCTIONALITY OF THE PROCEDURE
--
-- MODIFICATION HISTORY
-- PERSON DATE COMMENTS
-- HUYNQ CREATED
-- --------- ------ -------------------------------------------
V_STROPTION VARCHAR2 (5); -- A: ALL; B: BRANCH; S: SUB-BRANCH
V_STRBRID VARCHAR2 (4); -- USED WHEN V_NUMOPTION > 0
v_text varchar2(1000);
-- DECLARE PROGRAM VARIABLES AS SHOWN ABOVE
BEGIN
-- insert into temp_bug(text) values('CF0001');commit;
V_STROPTION := OPT;
IF (V_STROPTION <> 'A') AND (BRID <> 'ALL')
THEN
V_STRBRID := BRID;
ELSE
V_STRBRID := '%%';
END IF;
-- GET REPORT'S PARAMETERS
-- END OF GETTING REPORT'S PARAMETERS
-- GET REPORT'S DATA
OPEN PV_REFCURSOR
FOR
SELECT AF.OPNDATE,CF.custodycd,CF.idcode,CF.address,
CF.fullname,CF.iddate,CF.idplace,CF.CUSTTYPE,CTRY.CDCONTENT COUNTRY,tl.txdate
FROM CFMAST CF, Vw_Tllog_All TL,
(SELECT CUSTID, acctno, MIN( OPNDATE) OPNDATE
FROM AFMAST
GROUP BY CUSTID, acctno )AF, ALLCODE CTRY
WHERE AF.CUSTID = CF.CUSTID
AND CF.custodycd IS NOT NULL
AND CTRY.CDTYPE='CF'
AND CTRY.CDNAME='COUNTRY'
AND CF.COUNTRY=CTRY.CDVAL
and tl.msgacct =af.acctno
and tl.tltxcd ='2249'
AND tl.txdate >= TO_DATE (F_DATE, 'DD/MM/YYYY')
AND tl.txdate <= TO_DATE (T_DATE, 'DD/MM/YYYY')
AND SUBSTR(CF.CUSTID,1,4) LIKE V_STRBRID;
-- v_text:='1 ';
EXCEPTION
WHEN OTHERS
THEN
--insert into temp_bug(text) values('CF0001');commit;
RETURN;
END; -- PROCEDURE
/
| true |
08542cd3c5f144ae41ee6ad25829e547fb7f58e3 | SQL | devi06/snowflake-tutorials | /scripts/import_s3.sql | UTF-8 | 1,342 | 3.1875 | 3 | [
"Apache-2.0"
] | permissive | -- - create table
drop table emp_basic;
create or replace table emp_basic (
first_name string ,
last_name string ,
email string ,
streetaddress string ,
city string ,
start_date date
);
create or replace file format my_csv_format
type = csv field_delimiter = ',' skip_header = 1 null_if = ('NULL', 'null') empty_field_as_null = true compression = gzip;
create or replace stage my_s3_stage url='s3://becloudready/data-analytics'
credentials=(aws_key_id='<AKIA6ERB5MRO66YMPKO3>' aws_secret_key='<OSmJkK8UMhgPHHQOTqowa6OOLw/FUFKfM0FAcAsk>')
file_format = (type = csv field_optionally_enclosed_by='"');
copy into EMP_BASIC
from s3://shuba3/data-analytics credentials=(aws_key_id='<AKIA6ERB5MRO66YMPKO3>' aws_secret_key='<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>')
file_format = (type = csv field_optionally_enclosed_by='"')
pattern = '.*employees0[1-5].csv'
on_error = 'skip_file';
copy into EMP_BASIC
from @my_s3_stage
file_format = (type = csv field_optionally_enclosed_by='"')
pattern = '.*employees0[1-5].csv'
on_error = 'skip_file';
snowsql -c example -d sf_tuts -w SF_TUTS_WH -q "select * from EMP_BASIC" -o output_format=csv -o header=false -o timing=false -o friendly=false > output_file.csv
s3://shuba3/employees01.my_csv
snowsql -c example -d sf_tuts -w SF_TUTS_WH -q "select * from EMP_BASIC" -o output_format=csv -o header=false -o timing=false -o friendly=false > output_file.csv
| true |
c854c9864b822883c1756c4bf30727d0f0aec7a3 | SQL | jylilov/DBManual | /src/main/resources/sql/create_ships_tables.sql | UTF-8 | 5,027 | 2.953125 | 3 | [] | no_license | create table Classes (class varchar(50), type varchar(2), country varchar(20), numGuns smallint, bore real, displacement int);
create table Ships (name varchar(50), class varchar(50), launched smallint);
create table Battles (name varchar(20), date timestamp);
create table Outcomes (ship varchar(50), battle varchar(50), result varchar(10));
insert into classes(class, type, country, numGuns, bore, displacement) values ('Bismarck', 'bb', 'Germany', 8, 15.0, 42000);
insert into classes(class, type, country, numGuns, bore, displacement) values ('Iowa', 'bb', 'USA', 9, 16.0, 46000);
insert into classes(class, type, country, numGuns, bore, displacement) values ('Kongo', 'bc', 'Japan', 8, 14.0, 32000);
insert into classes(class, type, country, numGuns, bore, displacement) values ('North Carolina', 'bb', 'USA', 12, 16.0, 37000);
insert into classes(class, type, country, numGuns, bore, displacement) values ('Renown', 'bc', 'Gt.Britain', 6, 15.0, 32000);
insert into classes(class, type, country, numGuns, bore, displacement) values ('Revenge', 'bb', 'Gt.Britain', 8, 15.0, 29000);
insert into classes(class, type, country, numGuns, bore, displacement) values ('Tennessee', 'bb', 'USA', 12, 14.0, 32000);
insert into classes(class, type, country, numGuns, bore, displacement) values ('Yamato', 'bb', 'Japan', 9, 18.0, 65000);
insert into ships(name, class, launched) values ('California', 'Tennessee', 1921);
insert into ships(name, class, launched) values ('Haruna', 'Kongo', 1916);
insert into ships(name, class, launched) values ('Hiei', 'Kongo', 1914);
insert into ships(name, class, launched) values ('Iowa', 'Iowa', 1943);
insert into ships(name, class, launched) values ('Kirishima', 'Kongo', 1915);
insert into ships(name, class, launched) values ('Kongo', 'Kongo', 1913);
insert into ships(name, class, launched) values ('Missouri', 'Iowa', 1944);
insert into ships(name, class, launched) values ('Musashi', 'Yamato', 1942);
insert into ships(name, class, launched) values ('New Jersey', 'Iowa', 1943);
insert into ships(name, class, launched) values ('North Carolina', 'North Carolina', 1941);
insert into ships(name, class, launched) values ('Ramillies', 'Revenge', 1917);
insert into ships(name, class, launched) values ('Renown', 'Renown', 1916);
insert into ships(name, class, launched) values ('Repulse', 'Renown', 1916);
insert into ships(name, class, launched) values ('Resolution', 'Renown', 1916);
insert into ships(name, class, launched) values ('Revenge', 'Revenge', 1916);
insert into ships(name, class, launched) values ('Royal Oak', 'Revenge', 1916);
insert into ships(name, class, launched) values ('Royal Sovereign', 'Revenge', 1916);
insert into ships(name, class, launched) values ('South Dakota', 'North Carolina', 1941);
insert into ships(name, class, launched) values ('Tennessee', 'Tennessee', 1920);
insert into ships(name, class, launched) values ('Washington', 'North Carolina', 1941);
insert into ships(name, class, launched) values ('Wisconsin', 'Iowa', 1944);
insert into ships(name, class, launched) values ('Yamato', 'Yamato', 1941);
insert into battles(name, date) values ('#Cuba62a', '1962-10-20 00:00:00.000');
insert into battles(name, date) values ('#Cuba62b', '1962-10-25 00:00:00.000');
insert into battles(name, date) values ('Guadalcanal', '1942-11-15 00:00:00.000');
insert into battles(name, date) values ('North Atlantic', '1941-05-25 00:00:00.000');
insert into battles(name, date) values ('North Cape', '1943-12-26 00:00:00.000');
insert into battles(name, date) values ('Surigao Strait', '1944-10-25 00:00:00.000');
insert into Outcomes(ship, battle, result) values ('Bismarck', 'North Atlantic', 'sunk');
insert into Outcomes(ship, battle, result) values ('California', 'Guadalcanal', 'damaged');
insert into Outcomes(ship, battle, result) values ('CAlifornia', 'Surigao Strait', 'ok');
insert into Outcomes(ship, battle, result) values ('Duke of York', 'North Cape', 'ok');
insert into Outcomes(ship, battle, result) values ('Fuso', 'Surigao Strait', 'sunk');
insert into Outcomes(ship, battle, result) values ('Hood', 'North Atlantic', 'sunk');
insert into Outcomes(ship, battle, result) values ('King George V', 'North Atlantic', 'ok');
insert into Outcomes(ship, battle, result) values ('Kirishima', 'Guadalcanal', 'sunk');
insert into Outcomes(ship, battle, result) values ('Prince of Wales', 'North Atlantic', 'damaged');
insert into Outcomes(ship, battle, result) values ('Rodney', 'North Atlantic', 'OK');
insert into Outcomes(ship, battle, result) values ('Schamhorst', 'North Cape', 'sunk');
insert into Outcomes(ship, battle, result) values ('South Dakota', 'Guadalcanal', 'damaged');
insert into Outcomes(ship, battle, result) values ('Tennessee', 'Surigao Strait', 'ok');
insert into Outcomes(ship, battle, result) values ('Washington', 'Guadalcanal', 'ok');
insert into Outcomes(ship, battle, result) values ('West Virginia', 'Surigao Strait', 'ok');
insert into Outcomes(ship, battle, result) values ('Yamashiro', 'Surigao Strait', 'sunk'); | true |
403d0a0f569dd807e170e9732274a86e7be18eac | SQL | manikg360/UrlShortner | /SQL/short_urls.sql | UTF-8 | 364 | 2.890625 | 3 | [] | no_license | CREATE DATABASE `shortner_database`;
CREATE TABLE `shortner_database`.`short_urls` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`long_url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`short_code` varchar(25) COLLATE utf8_unicode_ci NOT NULL,
`created` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
| true |
7eb95f4dfbdecf67e68d4fd56fdebe4684e17852 | SQL | Alexandre-Schwarze/Projet-NAV | /sql/showUpdateAlerte.sql | UTF-8 | 771 | 3.4375 | 3 | [] | no_license | CREATE DEFINER=`root`@`localhost` PROCEDURE `showUpdateAlerte`()
BEGIN
/* affiche les alertes de moins de 5 minute*/
Select alertes.longitude, alertes.latitude, alertes.type_alerte_iDtype_alerte, type_alerte.nom
from alertes, alerte_utilisateur, type_alerte
where alertes.type_alerte_iDtype_alerte = type_alerte.iDtype_alerte
and alerte_utilisateur.alertes_iDalertes = alertes.iDalertes
and alerte_utilisateur.date_alerte >= date_sub(now(), interval 5 minute);
delete from alerte_utilisateur
where exists (select * from alertes, alerte_utilisateur
where alertes.iDalertes = alerte_utilisateur.alertes_iDalertes
and alerte_utilisateur.date_alerte <= date_sub(now(), interval 5 minute)) ;
END | true |
fd4ea30c568f73e556835541a7ce10b8a94141c0 | SQL | MRayhanAP/CommissionArt | /DATABASE FILE/commissionart.sql | UTF-8 | 16,140 | 2.984375 | 3 | [
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 05, 2021 at 08:28 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `commissionart`
--
-- --------------------------------------------------------
--
-- Table structure for table `tbl_brand`
--
CREATE TABLE `tbl_brand` (
`brand_id` int(11) NOT NULL,
`brand_name` varchar(255) NOT NULL,
`brand_description` text NOT NULL,
`publication_status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_brand`
--
INSERT INTO `tbl_brand` (`brand_id`, `brand_name`, `brand_description`, `publication_status`) VALUES
(1, 'Symphony', 'Symphony Desc', 1),
(2, 'Twitch', 'Twitch desc', 1),
(3, 'IPhone', 'IPhone Desc<br>', 1),
(4, 'Special Agent', 'H&M Desc', 1),
(5, 'Cartoon', 'Cartoon Desc', 1),
(6, 'Twitch', 'Twitch Desc', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_category`
--
CREATE TABLE `tbl_category` (
`id` int(11) NOT NULL,
`category_name` varchar(100) NOT NULL,
`category_description` text NOT NULL,
`publication_status` tinyint(4) NOT NULL COMMENT 'Published=1,Unpublished=0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_category`
--
INSERT INTO `tbl_category` (`id`, `category_name`, `category_description`, `publication_status`) VALUES
(1, 'Chibi', 'Chibi Desc', 1),
(2, 'Laptop', 'Laptop Desc', 1),
(3, 'Avatar', 'Avatar Desc', 1),
(4, 'Emoji', 'Emoji Desc', 1),
(5, 'Fan Art', 'Special Agent Desc ', 1),
(6, 'Fan Art', 'Shoes & Sneakers Desc', 1),
(7, 'Avatar', 'Avatar Desc.', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_customer`
--
CREATE TABLE `tbl_customer` (
`customer_id` int(11) NOT NULL,
`customer_name` varchar(50) NOT NULL,
`customer_email` varchar(100) NOT NULL,
`customer_password` varchar(32) NOT NULL,
`customer_address` text NOT NULL,
`customer_city` varchar(50) NOT NULL,
`customer_zipcode` varchar(20) NOT NULL,
`customer_phone` varchar(20) NOT NULL,
`customer_country` varchar(100) NOT NULL,
`customer_active` tinyint(4) NOT NULL COMMENT 'Active=1,Unactive=0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_customer`
--
INSERT INTO `tbl_customer` (`customer_id`, `customer_name`, `customer_email`, `customer_password`, `customer_address`, `customer_city`, `customer_zipcode`, `customer_phone`, `customer_country`, `customer_active`) VALUES
(9, 'Christine', 'christine@gmail.com', '5f4dcc3b5aa765d61d8327deb882cf99', '458 Ralph Street', 'DEMO', '12500', '7458450000', 'Afghanistan', 1),
(10, 'Bob Gardin', 'bobg@gmail.com', '5f4dcc3b5aa765d61d8327deb882cf99', '3556 Denver Avenue', 'Miram Loma', '3006', '7850002580', 'Australia', 1),
(11, 'rey', 'rey@gmail.com', 'd2b3ea2dfddc40efdc6941359436c847', 'Sngsr', 'Malang', '123', '123', 'Malang', 0);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_option`
--
CREATE TABLE `tbl_option` (
`option_id` int(11) NOT NULL,
`site_logo` varchar(100) NOT NULL,
`site_favicon` varchar(100) NOT NULL,
`site_copyright` varchar(255) NOT NULL,
`site_contact_num1` varchar(100) NOT NULL,
`site_contact_num2` varchar(100) NOT NULL,
`site_facebook_link` varchar(100) NOT NULL,
`site_twitter_link` varchar(100) NOT NULL,
`site_google_plus_link` varchar(100) NOT NULL,
`site_email_link` varchar(100) NOT NULL,
`contact_title` varchar(255) NOT NULL,
`contact_subtitle` varchar(255) NOT NULL,
`contact_description` text NOT NULL,
`company_location` varchar(255) NOT NULL,
`company_number` varchar(100) NOT NULL,
`company_email` varchar(100) NOT NULL,
`company_facebook` varchar(100) NOT NULL,
`company_twitter` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_option`
--
INSERT INTO `tbl_option` (`option_id`, `site_logo`, `site_favicon`, `site_copyright`, `site_contact_num1`, `site_contact_num2`, `site_facebook_link`, `site_twitter_link`, `site_google_plus_link`, `site_email_link`, `contact_title`, `contact_subtitle`, `contact_description`, `company_location`, `company_number`, `company_email`, `company_facebook`, `company_twitter`) VALUES
(1, 'logo1.png', 'logo2.png', 'Developed By Rostom Ali', '7865454100', '7865454100', 'https://www.facebook.com', 'https://www.twitter.com', 'https://www.plus.google.com', 'https://www.gmail.com', 'Contact Page', 'Contact Page Subtitle', 'Contact Desc..', '565 Blecker\'s Street', '7865454100', 'https://www.gmail.com', 'https://www.facebook.com', 'https://www.twitter.com');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_order`
--
CREATE TABLE `tbl_order` (
`order_id` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`shipping_id` int(11) NOT NULL,
`payment_id` int(11) NOT NULL,
`order_total` float NOT NULL,
`actions` varchar(50) NOT NULL DEFAULT 'Pending'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_order`
--
INSERT INTO `tbl_order` (`order_id`, `customer_id`, `shipping_id`, `payment_id`, `order_total`, `actions`) VALUES
(10, 9, 11, 16, 178250, 'Pending'),
(11, 10, 12, 17, 23862.5, 'Pending');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_order_details`
--
CREATE TABLE `tbl_order_details` (
`order_details_id` int(11) NOT NULL,
`order_id` int(11) NOT NULL,
`product_id` int(11) NOT NULL,
`product_name` varchar(255) NOT NULL,
`product_price` float NOT NULL,
`product_sales_quantity` int(11) NOT NULL,
`product_image` varchar(55) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_order_details`
--
INSERT INTO `tbl_order_details` (`order_details_id`, `order_id`, `product_id`, `product_name`, `product_price`, `product_sales_quantity`, `product_image`) VALUES
(1, 2, 5, 'Product Five', 10000, 1, NULL),
(2, 3, 5, 'Product Five', 10000, 4, NULL),
(3, 3, 3, 'Product Three', 3500, 3, NULL),
(4, 3, 1, 'Product One', 20000, 1, NULL),
(5, 8, 4, 'Product Four', 350000, 1, 'pic3.jpg'),
(6, 9, 4, 'Product Four', 350000, 1, 'pic3.jpg'),
(7, 10, 6, 'Samsung Galaxy S21 Ultra', 155000, 1, 'sm21u.jpg'),
(8, 11, 2, 'Face Covers 3-Pack', 1250, 1, 'feature-pic2.jpg'),
(9, 11, 1, 'Fan Art Valorant\r\nby Tr4uma', 15, 1, 'feature-pic1.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_payment`
--
CREATE TABLE `tbl_payment` (
`payment_id` int(11) NOT NULL,
`payment_type` varchar(50) NOT NULL,
`actions` varchar(50) NOT NULL DEFAULT 'pending'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_payment`
--
INSERT INTO `tbl_payment` (`payment_id`, `payment_type`, `actions`) VALUES
(1, 'cashon', 'pending'),
(2, 'ssl', 'pending'),
(3, 'cashon', 'pending'),
(4, 'cashon', 'pending'),
(5, 'cashon', 'pending'),
(6, 'cashon', 'pending'),
(7, 'cashon', 'pending'),
(8, 'cashon', 'pending'),
(9, 'cashon', 'pending'),
(10, 'cashon', 'pending'),
(11, 'cashon', 'pending'),
(12, 'cashon', 'pending'),
(13, 'cashon', 'pending'),
(14, 'cashon', 'pending'),
(15, 'cashon', 'pending'),
(16, 'cashon', 'pending'),
(17, 'cashon', 'pending');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_product`
--
CREATE TABLE `tbl_product` (
`product_id` int(11) NOT NULL,
`product_title` varchar(255) NOT NULL,
`product_short_description` text NOT NULL,
`product_long_description` text NOT NULL,
`product_image` varchar(255) NOT NULL,
`product_price` int(11) NOT NULL,
`product_quantity` int(11) NOT NULL,
`product_feature` tinyint(4) NOT NULL,
`product_category` int(11) NOT NULL,
`product_brand` int(11) NOT NULL,
`product_author` int(11) NOT NULL,
`product_view` int(11) NOT NULL DEFAULT 0,
`published_date` timestamp NOT NULL DEFAULT current_timestamp(),
`publication_status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_product`
--
INSERT INTO `tbl_product` (`product_id`, `product_title`, `product_short_description`, `product_long_description`, `product_image`, `product_price`, `product_quantity`, `product_feature`, `product_category`, `product_brand`, `product_author`, `product_view`, `published_date`, `publication_status`) VALUES
(1, 'by Tr4uma', 'Start from : 15$', 'Fanart Valorant Agent bernama Jett.', 'animpic7.jpg', 15, 50, 1, 6, 5, 1, 0, '2017-11-30 14:24:41', 1),
(2, 'by Andre', 'Start from : 5$', 'Art Ninja Sketch.', 'animpic3.jpg', 5, 50, 1, 5, 5, 1, 0, '2017-11-30 14:29:04', 1),
(3, 'by gmardion', 'Start from : 10$', 'Fanart Special Agent game.\r\n\r\n', 'animpic4.jpg', 10, 35, 1, 5, 4, 1, 0, '2017-11-30 14:38:25', 1),
(4, 'by emmiinnoo', 'Start from : 10$', 'Emoji twitch.\r\n\r\n', 'animpic8.jpg', 10, 150, 1, 4, 2, 1, 0, '2017-11-30 14:38:57', 1),
(5, 'by emmiinnoo', 'Start from : 15$ ', 'Avatar twitch', 'animpic6.jpg', 15, 56, 1, 1, 6, 1, 0, '2017-11-30 14:40:34', 1),
(6, 'by Elvya', 'Start from : 10$', 'Classic Art', 'animpic5.jpg', 10, 12, 1, 3, 2, 1, 0, '2021-05-12 09:20:39', 1),
(7, 'by Endg', 'Start from : 15$', 'FanArt Cartoon.', 'animpic.jpg', 15, 26, 1, 5, 5, 1, 0, '2021-05-12 16:00:39', 1),
(8, 'by Rey', 'Start from : 15$', '<font face=\"Arial, Verdana\"><span style=\"font-size: 13.3333px;\">Avatar Art.</span></font>', 'animpic2.jpg', 15, 21, 1, 7, 2, 1, 0, '2021-05-12 16:31:50', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_shipping`
--
CREATE TABLE `tbl_shipping` (
`shipping_id` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`shipping_name` varchar(50) NOT NULL,
`shipping_email` varchar(100) NOT NULL,
`shipping_address` text NOT NULL,
`shipping_city` varchar(100) NOT NULL,
`shipping_country` varchar(50) NOT NULL,
`shipping_phone` varchar(20) NOT NULL,
`shipping_zipcode` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_shipping`
--
INSERT INTO `tbl_shipping` (`shipping_id`, `customer_id`, `shipping_name`, `shipping_email`, `shipping_address`, `shipping_city`, `shipping_country`, `shipping_phone`, `shipping_zipcode`) VALUES
(11, 0, 'Christine', 'christinem@gmail.com', '245 Ralph Street', 'Steyr', 'Austria', '7456320000', '12500'),
(12, 0, 'Bob', 'bob@gmail.com', '3556 Denver Avenue', 'Mira Loma', 'Australia', '7458000025', '3006');
-- --------------------------------------------------------
--
-- Table structure for table `tbl_slider`
--
CREATE TABLE `tbl_slider` (
`slider_id` int(11) NOT NULL,
`slider_title` varchar(255) NOT NULL,
`slider_image` varchar(255) NOT NULL,
`slider_link` varchar(255) NOT NULL,
`publication_status` tinyint(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_slider`
--
INSERT INTO `tbl_slider` (`slider_id`, `slider_title`, `slider_image`, `slider_link`, `publication_status`) VALUES
(1, 'slider', 'anim1.jpg', 'http://localhost/shop/single/5', 1),
(2, 'slider 2', 'anim2.jpg', 'http://localhost/shop/single/5', 1),
(3, 'slider 3', 'anim3.jpg', 'http://localhost/shop/add/slider 3', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tbl_user`
--
CREATE TABLE `tbl_user` (
`user_id` int(11) NOT NULL,
`user_name` varchar(255) NOT NULL,
`user_email` varchar(255) NOT NULL,
`user_password` varchar(255) NOT NULL,
`user_role` tinyint(4) NOT NULL,
`created_time` timestamp NOT NULL DEFAULT current_timestamp(),
`updated_time` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tbl_user`
--
INSERT INTO `tbl_user` (`user_id`, `user_name`, `user_email`, `user_password`, `user_role`, `created_time`, `updated_time`) VALUES
(1, 'admin', 'admin@gmail.com', '21232f297a57a5a743894a0e4a801fc3', 1, '2017-11-13 18:31:36', '2017-11-13 18:31:36'),
(2, 'editor', 'editor@gmail.com', '5aee9dbd2a188839105073571bee1b1f', 2, '2017-11-13 18:31:36', '2017-11-13 18:31:36'),
(3, 'author', 'author@gmail.com', '02bd92faa38aaa6cc0ea75e59937a1ef', 3, '2017-11-13 18:31:36', '2017-11-13 18:31:36');
-- --------------------------------------------------------
--
-- Table structure for table `user_role`
--
CREATE TABLE `user_role` (
`role_id` int(11) NOT NULL,
`role_name` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_role`
--
INSERT INTO `user_role` (`role_id`, `role_name`) VALUES
(1, 'Admin'),
(2, 'Author'),
(3, 'Editor');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tbl_brand`
--
ALTER TABLE `tbl_brand`
ADD PRIMARY KEY (`brand_id`);
--
-- Indexes for table `tbl_category`
--
ALTER TABLE `tbl_category`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tbl_customer`
--
ALTER TABLE `tbl_customer`
ADD PRIMARY KEY (`customer_id`);
--
-- Indexes for table `tbl_option`
--
ALTER TABLE `tbl_option`
ADD PRIMARY KEY (`option_id`);
--
-- Indexes for table `tbl_order`
--
ALTER TABLE `tbl_order`
ADD PRIMARY KEY (`order_id`);
--
-- Indexes for table `tbl_order_details`
--
ALTER TABLE `tbl_order_details`
ADD PRIMARY KEY (`order_details_id`);
--
-- Indexes for table `tbl_payment`
--
ALTER TABLE `tbl_payment`
ADD PRIMARY KEY (`payment_id`);
--
-- Indexes for table `tbl_product`
--
ALTER TABLE `tbl_product`
ADD PRIMARY KEY (`product_id`);
--
-- Indexes for table `tbl_shipping`
--
ALTER TABLE `tbl_shipping`
ADD PRIMARY KEY (`shipping_id`);
--
-- Indexes for table `tbl_slider`
--
ALTER TABLE `tbl_slider`
ADD PRIMARY KEY (`slider_id`);
--
-- Indexes for table `tbl_user`
--
ALTER TABLE `tbl_user`
ADD PRIMARY KEY (`user_id`);
--
-- Indexes for table `user_role`
--
ALTER TABLE `user_role`
ADD PRIMARY KEY (`role_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tbl_brand`
--
ALTER TABLE `tbl_brand`
MODIFY `brand_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tbl_category`
--
ALTER TABLE `tbl_category`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `tbl_customer`
--
ALTER TABLE `tbl_customer`
MODIFY `customer_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tbl_option`
--
ALTER TABLE `tbl_option`
MODIFY `option_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `tbl_order`
--
ALTER TABLE `tbl_order`
MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `tbl_order_details`
--
ALTER TABLE `tbl_order_details`
MODIFY `order_details_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `tbl_payment`
--
ALTER TABLE `tbl_payment`
MODIFY `payment_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=18;
--
-- AUTO_INCREMENT for table `tbl_product`
--
ALTER TABLE `tbl_product`
MODIFY `product_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `tbl_shipping`
--
ALTER TABLE `tbl_shipping`
MODIFY `shipping_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `tbl_slider`
--
ALTER TABLE `tbl_slider`
MODIFY `slider_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `tbl_user`
--
ALTER TABLE `tbl_user`
MODIFY `user_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `user_role`
--
ALTER TABLE `user_role`
MODIFY `role_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
741a5f88bb442bb4703db8aac1e4606891c15930 | SQL | youngsinatra189/DatabaseAppDev | /c.sql | UTF-8 | 2,934 | 3.53125 | 4 | [] | no_license | /*
File: c.sql
Author: Roshan Sahu
Oracle Username: s6_sahuro
Description: Passes in information about a new vehicle record and uses newVehRecord procedure to insert the record into Car*/
SET SERVEROUTPUT ON;
-- Obtaining the information of the car the user wishes to create a record for
ACCEPT p_custname PROMPT 'Enter the name of the customer of the vehicle: '
ACCEPT p_carmake PROMPT 'Enter the make of the vehicle: '
ACCEPT p_carmodel PROMPT 'Enter the model of the vehicle: '
ACCEPT p_caryear PROMPT 'Enter the year of the vehicle: '
ACCEPT p_extcolor PROMPT 'Enter the color of the vehicle: '
ACCEPT p_cartrim PROMPT 'Enter the trim of the vehicle: '
ACCEPT p_enginetype PROMPT 'Enter the engine type of the vehicle: '
ACCEPT p_purchinvno PROMPT 'Enter the purhcase number of the vehicle: '
ACCEPT p_purchcost PROMPT 'Enter the purchase cost of the vehicle: '
ACCEPT p_freightcost PROMPT 'Enter the freight cost of the vehicle: '
ACCEPT p_carlistprice PROMPT 'Enter the car list price of the vehicle: '
DECLARE
-- Declaring the car serial number so it can be constructed before it is passed to the procedure
v_carserial car.carserial%TYPE;
-- Declaring the confirmation message
v_confirmation VARCHAR2(100);
-- Exception handling
NO_INPUT EXCEPTION;
VALID_YEAR EXCEPTION;
BEGIN
-- If there was a required field to make the carserial no that was not provided
IF '&p_custname' = '' OR '&p_custname' IS NULL OR '&p_carmake' = '' OR '&p_carmake' IS NULL
OR '&p_carmodel' = '' OR '&p_carmodel' IS NULL OR '&p_caryear' = '' OR '&p_caryear' IS NULL
OR '&p_extcolor' = '' OR '&p_extcolor' IS NULL OR '&p_carmodel' = '' OR '&p_carmodel' IS NULL THEN
RAISE NO_INPUT;
END IF;
IF length('&p_caryear') != 4 OR '&p_caryear' > 0 THEN
RAISE VALID_YEAR;
END IF;
-- Constructing a new car serial # for the new recod: The first character of the car make, last two digits of car year, first digita of
-- ext color, first three digits of car model, and a zero
v_carserial := (substr('&p_carmake', 1, 1)|| substr('&p_caryear', 3, 2) || substr('&p_extcolor', 1, 1) || substr('&p_carmodel', 1, 3) || '0');
-- Calling the new vehicle record procedure
newVehRecord(UPPER(v_carserial), UPPER('&p_custname'), UPPER('&p_carmake'), UPPER('&p_carmodel'), '&p_caryear', '&p_extcolor', '&p_cartrim',
'&p_enginetype', '&p_purchinvno', '&p_purchcost', '&p_freightcost', '&p_carlistprice', v_confirmation);
-- Printing out the confirmation record
DBMS_OUTPUT.PUT_LINE(v_confirmation);
EXCEPTION
WHEN VALID_YEAR THEN
DBMS_OUTPUT.PUT_LINE('Please ensure you enter a valid year');
WHEN NO_INPUT THEN
DBMS_OUTPUT.PUT_LINE('Please ensure all required fields are completed');
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE('Please contact the system administrator');
END;
/
EXIT; | true |
fd2e9260c18d34b5eb477f38ff0b19cd90aea3e1 | SQL | xXGeistmeisterXx/tlis-server | /db/init.sql | UTF-8 | 1,179 | 3.515625 | 4 | [
"MIT"
] | permissive | CREATE DATABASE IF NOT EXISTS TLIS;
CREATE TABLE IF NOT EXISTS customers (
id MEDIUMINT KEY AUTO_INCREMENT,
number VARCHAR(16),
first_name VARCHAR(32),
last_name VARCHAR(32),
email VARCHAR(64),
grade TINYINT,
staff TINYINT(1)
);
CREATE TABLE IF NOT EXISTS techs (
id MEDIUMINT KEY AUTO_INCREMENT,
customer_id MEDIUMINT,
username VARCHAR(32),
permission TINYINT,
password BINARY(128),
salt BINARY(32)
);
CREATE TABLE IF NOT EXISTS assets(
id MEDIUMINT KEY AUTO_INCREMENT,
number INT,
type TINYINT
);
CREATE TABLE IF NOT EXISTS asset_types(
id MEDIUMINT KEY AUTO_INCREMENT,
name VARCHAR(32),
prefix VARCHAR(6),
max_time_out BIGINT,
description VARCHAR(200)
);
CREATE TABLE IF NOT EXISTS transactions_out(
id MEDIUMINT KEY AUTO_INCREMENT,
type TINYINT,
asset_id MEDIUMINT,
customer_id MEDIUMINT,
tech_id MEDIUMINT,
time_now BIGINT,
time_due BIGINT,
notes VARCHAR(200)
);
CREATE TABLE IF NOT EXISTS transactions_in(
id MEDIUMINT KEY,
type TINYINT,
tech_id MEDIUMINT,
time_now BIGINT,
notes VARCHAR(200)
);
CREATE TABLE IF NOT EXISTS transaction_types(
id MEDIUMINT KEY AUTO_INCREMENT,
name VARCHAR(32),
description VARCHAR(200)
);
| true |
973e918c7ac583d292ec4e96cc5f2ebfa8d01ac9 | SQL | VEuPathDB/offprint | /lib/sql/oprdb.create.userdb.user.sql | UTF-8 | 1,075 | 2.90625 | 3 | [
"Apache-2.0"
] | permissive | DEFINE user=&1
DEFINE passwd=&2
CREATE USER &&user IDENTIFIED BY &&passwd DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE TEMP;
ALTER USER &&user ACCOUNT UNLOCK;
GRANT CREATE SESSION TO &&user;
GRANT RESOURCE TO &&user;
ALTER USER &&user DEFAULT ROLE ALL;
ALTER USER &&user QUOTA UNLIMITED ON USERS;
ALTER USER &&user QUOTA UNLIMITED ON GUS;
GRANT COMM_WDK_W TO &&user;
-- ACL used by EuPathDB /dashboard to run
-- select UTL_INADDR.get_host_name as server_name, UTL_INADDR.get_host_address as server_ip from dual;
-- (users.xml ACL must have already been created)
GRANT EXECUTE on utl_inaddr to &&user;
BEGIN DBMS_NETWORK_ACL_ADMIN.add_privilege (
acl => 'users.xml',
principal => UPPER('&&user'),
is_grant => TRUE,
privilege => 'resolve');
END;
/
| true |
6f847cd50732d0708a87cddf08a8b514f41488a1 | SQL | serrudojc/TalentoDigital2019FullStack | /07_recopilacion/usuarios/usuariostodo.sql | UTF-8 | 3,182 | 2.71875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 21-10-2019 a las 00:46:00
-- Versión del servidor: 10.4.6-MariaDB
-- Versión de PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `tododb`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `usuariostodo`
--
CREATE TABLE `usuariostodo` (
`id` int(11) NOT NULL,
`nombre` varchar(50) NOT NULL,
`apellido` varchar(50) NOT NULL,
`usuario` varchar(50) NOT NULL,
`pass` varchar(100) NOT NULL,
`email` varchar(50) NOT NULL,
`fechaRegistro` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `usuariostodo`
--
INSERT INTO `usuariostodo` (`id`, `nombre`, `apellido`, `usuario`, `pass`, `email`, `fechaRegistro`) VALUES
(1, 'Jorge Delano', '', 'jorgelin', '$2y$10$tulODBB1MPe07/EtN5n4ne/SeLQ5tKfK1OQUQsqBkLIfl1ZVwJSGm', 'jorgedelano@gmail.com', '2019-10-12'),
(2, 'Osmar Montgomery', '', 'osmarcito', '$2y$10$uTX//dG5VrQTzTyo5wFVNeYES2CRsNFDXQGJe.uIO9ZtB7A0LKW8C', 'osmarmontgomery@gmail.com', '2019-10-12'),
(3, 'Ramon Sosto', '', 'ramoncito', '$2y$10$6BTnxif.aGlagY5wstuMZ.xKqeaFQ7sHUuWKqG.djPPucT58kluie', 'ramon.sosto@hotmail.com', '2019-10-12'),
(4, 'Miguel fernandez', '', 'migue', '$2y$10$KTQKtnN9icsA7EdJU2Ff6eGvgH.aoVap/p6KGvjIUrfN5xWm9slpe', 'miguelito@uol.com', '2019-10-12'),
(5, 'sergio manuel lopez', '', 'semalo', '$2y$10$m.Jv5/koSMmClXpDXOG.veU.l6V.WsU0ZqPGmdNy5E65lcbBeXQ5C', 'sergio@speedy.com.ar', '2019-10-12'),
(6, 'administrador', '', 'admin', '$2y$10$UaPuG75vdYcmI4p3J3wW0OwEskYxeyMJ0hCsGrIia.jW6UREQjxke', 'admin@gmail.com', '2019-10-12'),
(7, 'alguien con pass alguien', '', 'alguien', '$2y$10$OSzdA8aBa434b/Pkm7yMoOQFKO1GAZYL8Rgad/Q2MuaIZojDqwXFu', 'alguien@hotmail.com', '2019-10-12'),
(8, 'contraseña', '', 'contraseña', '$2y$10$6bwWt5.2qlPSdIxkrxCfi.E3p64ueR96iWSS2n54B7Q74vYNWdydW', 'con@gmail.com', '2019-10-15'),
(9, 'daniel', '', 'daniel', '$2y$10$4ZkT9itGpowFjfw2uaNDbeMB8.p18AlP6AItSIr.Fim4KTm2Htf7O', 'daniel@gmail.com', '2019-10-16'),
(10, 'pepe', 'pepo', 'pepe', '$2y$10$mfkolcn24e67u22w5peAy.gJbLlPpl.zZzzK4x49GHrfvaf5pRetC', 'pepe@gmail.com', '2019-10-21'),
(15, 'marcelo', 'tinelli', 'jorge', '$2y$10$V51x0ZHHyBuQTp9T862N3O83a7jukanx0gznzTMFGorgB7P2mDDPq', 'tinelli@yahoo.com', '2019-10-21'),
(16, 'donato', 'murcia', 'donato', '$2y$10$TNksAPNJWuBjFVY6Lz61v.DEqLypvhlcb63WCHY8FhA2VBSSjjICS', 'donato@gmail.com', '2019-10-21');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `usuariostodo`
--
ALTER TABLE `usuariostodo`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `usuariostodo`
--
ALTER TABLE `usuariostodo`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
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 */;
| true |
d1b27f6d0c375b00c46a53952ca2fdd3657d7e37 | SQL | Himura2la/Cosplay2-Automation | /sql/program.sql | UTF-8 | 474 | 4.125 | 4 | [] | no_license | SELECT
card_code ||' '|| voting_number ||'. '|| voting_title ||' ('||
REPLACE(GROUP_CONCAT(DISTINCT value), ',', ', ') ||')'
FROM
list, requests
LEFT JOIN (SELECT request_id, value FROM [values]
WHERE title = 'Город' AND
section_title NOT LIKE '%помощниках')
ON request_id = requests.id
WHERE
list.id = topic_id AND
requests.id = request_id AND
status = 'approved' AND
default_duration > 0
GROUP BY voting_number
ORDER BY voting_number | true |
f502879e0a6d07011f7b5876ae0e50a7acf7b42d | SQL | hastapasta/financereport | /trunk/shell_scripts/mysql_profile/query2.sql | UTF-8 | 174 | 2.828125 | 3 | [] | no_license | FLUSH STATUS;
select count(id) from fact_data where date_format(fact_data.date_collected,'%Y-%m-%d')>'2011-01-01' AND ((fact_data.entity_id=@eid and fact_data.metric_id=1));
| true |
59394f362844ce63fbd67aae51c58de25664ebe0 | SQL | Van-IoT2020/Git_BaoCaoOpenSource | /eproject_sem1.sql | UTF-8 | 28,542 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th7 28, 2020 lúc 03:32 PM
-- Phiên bản máy phục vụ: 10.4.11-MariaDB
-- Phiên bản PHP: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Cơ sở dữ liệu: `eproject_sem1`
--
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `account`
--
CREATE TABLE `account` (
`id` int(10) NOT NULL,
`fullname` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`email` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`phone` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`password` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`login_type` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`gender` tinyint(1) NOT NULL DEFAULT 1,
`date_of_birth` date DEFAULT NULL,
`level` tinyint(1) NOT NULL DEFAULT 3,
`avatar` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created` int(10) DEFAULT NULL,
`branch_id` int(10) DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `account`
--
INSERT INTO `account` (`id`, `fullname`, `email`, `phone`, `password`, `login_type`, `gender`, `date_of_birth`, `level`, `avatar`, `created`, `branch_id`, `status`) VALUES
(11, 'Huỳnh Văn Hữu Ân', 'huynhvahuuan3620@gmail.com', '0787782050', '202cb962ac59075b964b07152d234b70', 'email', 1, '2001-10-03', 1, '1595857353-admin.jpg', 1595045127, 1, 1),
(13, 'Chung Thị Lệ Quyên', 'chungthilequyen@gmail.com', '0987654321', 'e10adc3949ba59abbe56e057f20f883e', 'email', 0, '2001-02-14', 2, NULL, 1595087217, 6, 1),
(18, 'Trần Tấn Tài', 'tai@gmail.com', '0327894566', '202cb962ac59075b964b07152d234b70', 'email', 1, '1997-08-20', 3, '1595499717-61735826_145100506647718_5930619188824506368_n.jpg', 1595499651, 1, 1);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `branch`
--
CREATE TABLE `branch` (
`id` int(10) NOT NULL,
`address` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `branch`
--
INSERT INTO `branch` (`id`, `address`, `status`) VALUES
(1, 'None', 1),
(3, 'Quận 1, TP. Hồ Chí Minh', 1),
(4, 'Quận 2, TP. Hồ Chí Minh', 1),
(5, 'Quận 3, TP. Hồ Chí Minh', 1),
(6, 'Quận Thủ Đức, TP. Hồ Chí Minh', 1),
(7, 'Quận Bình Thạnh, TP. Hồ Chí Minh', 1),
(8, 'Quận Hóc Môn, TP. Hồ Chí Minh', 1),
(9, '180 Cao Lỗ, phường 4, Quận 8, TP. Hồ Chí Minh', 1);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `invoice_detail`
--
CREATE TABLE `invoice_detail` (
`id` int(10) NOT NULL,
`pay_invoice_id` int(10) NOT NULL,
`product_id` int(10) NOT NULL,
`amount` int(10) NOT NULL,
`price` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `invoice_detail`
--
INSERT INTO `invoice_detail` (`id`, `pay_invoice_id`, `product_id`, `amount`, `price`) VALUES
(9, 57, 4, 4, 59000),
(10, 57, 26, 2, 120000),
(11, 57, 51, 5, 80000),
(12, 58, 49, 1, 146000),
(13, 58, 50, 1, 50000),
(14, 58, 51, 1, 80000),
(15, 59, 3, 1, 72000),
(16, 59, 41, 1, 199000),
(17, 62, 27, 1, 66000),
(18, 66, 45, 1, 750000),
(19, 66, 27, 2, 66000);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `pay_invoice`
--
CREATE TABLE `pay_invoice` (
`id` int(10) NOT NULL,
`customer_id` int(10) NOT NULL,
`employee_id` int(10) DEFAULT NULL,
`address` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`created` int(10) NOT NULL,
`purchase_form` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`status` tinyint(4) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `pay_invoice`
--
INSERT INTO `pay_invoice` (`id`, `customer_id`, `employee_id`, `address`, `created`, `purchase_form`, `status`) VALUES
(57, 17, 0, '1716 Huỳnh Tấn Phát, TP. Hồ Chí Minh', 1595329411, 'online', 0),
(58, 17, 0, '1716 Huỳnh Tấn Phát, TP. Hồ Chí Minh', 1595329481, 'online', 1),
(59, 18, 0, '123 ADV', 1595736845, 'online', 1),
(63, 25, 13, NULL, 1595856223, 'direct', 1),
(64, 20, 13, NULL, 1595856240, 'direct', 1),
(65, 14, 13, NULL, 1595856252, 'direct', 1),
(66, 18, 13, NULL, 1595857422, 'direct', 1);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `product`
--
CREATE TABLE `product` (
`id` int(10) NOT NULL,
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`product_type_id` int(10) NOT NULL,
`width` int(10) NOT NULL,
`height` int(10) NOT NULL,
`avatar` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`material` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`quantitative` int(10) NOT NULL,
`amount` int(10) NOT NULL,
`price` int(10) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `product`
--
INSERT INTO `product` (`id`, `name`, `product_type_id`, `width`, `height`, `avatar`, `material`, `quantitative`, `amount`, `price`, `status`) VALUES
(1, 'Lịch Để Bàn 2020 - Unicorn', 1, 16, 16, '0b3db489fcdeefe85d5928ca797e53be.jpg', 'giấy Bristol 210gsm', 300, 0, 55000, 1),
(2, 'Lịch Lò Xo Đinh Tị 2020', 1, 18, 21, '4cb111c5edde27d7e9f09d487aa37676.jpg', 'Được làm từ giấy Ford 60 gsm.', 400, 0, 78000, 1),
(3, 'Lịch Để Bàn 2020 - Trái Cây', 1, 25, 18, '43315a979de735aa7d15571999bb1829.jpg', 'Giấy', 350, 0, 72000, 1),
(4, 'Tạp chí Wowweekend vol 2\r\n', 2, 20, 30, '338820cd57595d91680403d0c51281d0.jpg', 'Giấy', 600, 0, 59000, 1),
(5, 'Tạp chí TravelMag số 36', 2, 30, 40, 'a4e521853cc3d0392a16b511c5ada797.jpg', 'Giấy', 500, 0, 84000, 1),
(6, 'Tạp Chí Cách Mạng Công Nghệ 4.0', 2, 50, 60, 'c86e418fba7333bfa5d512cad3be10f3.jpg', 'Giấy', 800, 0, 63000, 1),
(7, 'Tạp chí Wowweekend vol 3', 2, 30, 50, '8602d4a43f7b8d580c03f099787e3004.jpg', 'Giấy', 300, 1, 69000, 1),
(13, 'Sổ Tay Nhật Ký Đọc Sách', 3, 8, 13, '1594637239-dsc_0036.u2566.d20170508.t104530.923656.jpg', 'Giấy chất lượng cao', 300, 1, 36000, 1),
(14, 'Sổ Ghi Chép Đẹp', 3, 14, 20, '1594638649-1594638434-0e4b3cfa01dd0861f23b5f5df8de74c6.png', 'Chất liệu da: da PU nhập khẩu cao cấp thân thiện với môi trường, chất liệu giấy: giấy kem dày chống lóa tiêu chuẩn quốc tế', 300, 1, 159000, 1),
(15, 'Lịch Để Bàn 2020 - Hồng Hạc', 1, 16, 16, '1594810364-7c68a017d6a0cec32f2f62eab6727c04.png', 'Giấy Bristol 210gsm', 100, 1, 55000, 1),
(16, 'Lịch Để Bàn 2020 Cute Cartoon', 1, 12, 15, '1594810827-3de0dc5f6a7d64c7e93bd4625a09c9d6.png', 'Giấy', 150, 1, 54000, 1),
(17, 'Lịch bàn phong thủy', 1, 18, 18, '1594811171-4bc8f56472f64c50008b6155eac53cd3.jpg', 'Giấy', 100, 1, 176000, 1),
(18, 'Lịch Để Bàn Đế Xanh 2020', 1, 18, 20, '1594812468-0f960803655c90e5898786cc266be9f1.png', 'Giấy mỹ thuật chất lượng cao', 200, 1, 99000, 1),
(19, 'Lịch Để Bàn 2020 - Chuột', 1, 15, 16, '1594812638-7c873b28a8f348df4ef103497d085422.jpg', 'Giấy', 150, 1, 55000, 1),
(20, 'Lịch Bàn 2020 Angia Art', 1, 15, 15, '1594812796-97c87ae31bd70598f9f212d19daf0490.jpg', 'Giấy chất lượng cao', 200, 1, 66000, 1),
(21, 'Lịch mini 2020', 1, 14, 16, '1594813027-42ff2fccf363293d438e90c8174afd27.jpg', 'Giấy', 300, 1, 40000, 1),
(22, 'Lịch để bàn 2020 Square', 1, 15, 16, '1594814967-4a726794b533c3c2f182698f3b5d4d78.jpg', 'Giấy chất lượng cao', 200, 1, 58000, 1),
(23, 'Lịch Bàn 2020 Square', 1, 15, 16, '1594815108-fa3782efef6f6d29ec2cc43c0789f6bf.jpg', 'Giấy', 100, 1, 55000, 1),
(24, 'Lịch Để Bàn 2020 - Hình Gấu', 1, 15, 16, '1594815254-52c32ec36c907000c2eb69fe5098dad9.jpg', 'Giấy', 150, 1, 55000, 1),
(25, 'Lịch Để Bàn 2020 Nhã Nam', 1, 21, 16, '1594815440-a6028d37cc5d79f0ee5bf46fbaa1911c.jpg', 'Giấy cứng', 100, 1, 55000, 1),
(26, 'Lịch Bàn Artbook 2020', 1, 20, 26, '1594815561-593ca50ace845cae07f926a34c10cae0.jpg', 'Giấy ivory', 200, 1, 120000, 1),
(27, 'Lịch Bàn - The Celestial Horoscopes', 1, 16, 20, '1594815780-d8a9b4dadfb65b176c1318b2218829f3.jpg', 'Giấy chất lượng cao', 200, 1, 66000, 1),
(28, 'Tạp Chí Pi - Tập 4, Số 5', 2, 25, 40, '1594816014-1ccc757bb1ad30ecf0eba00e2512ddfc.jpg', 'Giấy', 200, 1, 30000, 1),
(29, 'Tạp Chí Pi - Tập 4, Số 4', 2, 25, 40, '1594816151-305b2a53fc8b66800eb91a0048a324bb.jpg', 'Giấy', 200, 1, 30000, 1),
(30, 'Tạp Chí Pi - Tập 4, Số 3', 2, 25, 40, '1594816295-8dc229b63bb18ee5b3ff580e7d46e0f7.jpg', 'Giấy', 250, 1, 30000, 1),
(31, 'Tạp Chí Pi - Tập 4, Số 1-2', 2, 25, 40, '1594816542-57a3bf5665cab3b5f22b9d80fb64c04d.jpg', 'Giấy', 250, 1, 30000, 1),
(32, 'Tạp Chí Pi - Tập 3, Số 11', 2, 25, 40, '1594816708-a283eab2ffec9984a5d126576b8a1d48.jpg', 'Giấy', 250, 1, 30000, 1),
(33, 'Tạp Chí Pi - Tập 3, Số 10', 2, 25, 40, '1594816937-80b583c0bac623244413aee2c4678e99.jpg', 'Giấy', 250, 1, 30000, 1),
(34, 'Tạp chí Khoa Học Làn Da Skinmag', 2, 20, 30, '1594817100-c2cce4059740733a6d35ce4b0e8bc473.png', 'Giấy', 200, 1, 120000, 1),
(35, 'Pi Tạp Chí Toán Học', 2, 20, 30, '1594817175-img301.u3059.d20170716.t122719.913090.jpg', 'Giấy', 200, 1, 25000, 1),
(36, 'Tạp Chí Thế Giới Tuổi Thơ', 2, 20, 30, '1594817250-0b49f5cfefab3c708754848e8904b3a6.jpg', 'Giấy', 250, 1, 22000, 1),
(37, 'Tạp Chí Pi Tập 1 - Số 11', 2, 20, 30, '1594817437-15c3bbce1d0a26d910e58f5f09c76053.jpg', 'Giấy', 250, 1, 25000, 1),
(38, 'Tạp Chí Đồng Hành Số 30', 2, 25, 30, '1594817535-6080f42f0d01dfc3f2b25f1d0a67d90e.jpg', 'Giấy', 300, 1, 33000, 1),
(39, 'Tạp Chí Ô Tô - Số 112', 2, 26, 33, '1594817616-a02f8bba14f85fdfeceb812e00466831.jpg', 'Giấy chất lượng cao', 255, 1, 23000, 1),
(40, 'Tạp Chí Ô Tô - Số 113', 2, 26, 33, '1594817679-6f9be628d6574ba445923f6beee42037.jpg', 'Giấy chất lượng cao', 250, 1, 23000, 1),
(41, 'Tạp chí Toán học và Tuổi trẻ 2015', 2, 20, 30, '1594817790-a68306d26d3ee0a1fdd458f2417b3ed0.jpg', 'Giấy', 250, 1, 199000, 1),
(42, 'Sổ Tay A Gift from Heaven', 3, 20, 30, '1594818030-fbee41a967cf66cac6d5748daef1e4f1.jpg', 'Giấy chất lượng cao', 200, 1, 30000, 1),
(43, 'Sổ tay planner', 3, 20, 30, '1594818179-323334273de5b5b7e572542419fa0cc4.jpg', 'Giấy chất lượng cao', 300, 1, 45000, 1),
(44, 'Sổ Tay TiKi Inspiration - Unicorn', 3, 25, 30, '1594818377-2ff5870b4897362d52c65426659b03a4.jpg', 'Giấy', 150, 1, 21000, 1),
(45, 'E-smart Notebook', 3, 20, 30, '1594818607-0fbbf3f54f192d334c507bb2ded04059.jpg', 'Giấy chất lượng cao', 200, 1, 750000, 1),
(46, 'Power Thinking Notebook', 3, 20, 30, '1594818882-dc145b95d9493dddba95ac68189555e0.jpg', 'Giấy', 200, 1, 115000, 1),
(47, 'Sổ Notebook JT9025-1', 3, 20, 30, '1594818958-12433c5325c37263fbc56cab3c7980bb.jpg', 'Giấy', 200, 1, 37000, 1),
(48, 'Notebook - Spring Is Coming', 3, 30, 40, '1594819056-90562b205e6cc4bea3fad2cd67b54299.jpg', 'Giấy', 200, 1, 60000, 1),
(49, 'Sổ Memo Notebook', 3, 30, 20, '1594819194-d833f94e3c26e3126fcab43fa0ed82bb.jpg', 'Giấy', 300, 1, 146000, 1),
(50, 'Notebook - Winter Around Here', 3, 25, 30, '1594819310-fb99c5f4e03697d1c9502e73f77a504f.jpg', 'Giấy', 350, 1, 50000, 1),
(51, 'Notebook - Welcome Autumn', 3, 30, 40, '1594819441-055363c4333377fab1d1e1a7f533c98a.jpg', 'Giấy chất lượng cao', 300, 1, 80000, 1),
(52, 'Sổ CW2510', 3, 20, 25, '1594819558-710898ca8f1dcd1bcd9ed6152184effe.jpg', 'Giấy chất lượng cao', 300, 1, 40000, 1),
(53, 'Notebook Softcover A6 White', 3, 30, 30, '1594819629-38c209e9b675a4ed20d141c5cfd6df96.jpg', 'Giấy', 300, 1, 512000, 1),
(54, 'Sổ tay', 3, 20, 20, '1594819720-83b30b59b59159f17f4a103761c426bd.jpg', 'Giấy chất lượng cao', 300, 1, 165000, 1),
(55, 'Notebook Bìa Cứng', 3, 30, 30, '1594819846-fa78696236239016d799820210124773.jpg', 'Giấy chất lượng cao', 300, 1, 65000, 1);
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `product_image`
--
CREATE TABLE `product_image` (
`id` int(10) NOT NULL,
`id_product` int(10) NOT NULL,
`image` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `product_image`
--
INSERT INTO `product_image` (`id`, `id_product`, `image`) VALUES
(1, 1, '0b3db489fcdeefe85d5928ca797e53be.jpg'),
(2, 1, '5efc67367a0474b989662bee82628c4e.jpg'),
(3, 1, '421e3e6e8ba6ec7f34ab0fde8cc248c5.jpg'),
(4, 1, '777ce113c7d12911de9e3267d34c9d67.jpg'),
(5, 2, '91ad9638744d0771d5e1bbf5c302f4d8.jpg'),
(6, 2, '91a1f7156c91f4c90bb0d203145dd245.jpg'),
(8, 2, '4cb111c5edde27d7e9f09d487aa37676.jpg'),
(9, 2, 'bef048029dbfc6bb73d073069ede6e31.jpg'),
(10, 3, '43315a979de735aa7d15571999bb1829.jpg'),
(11, 3, 'ac88f8fd391d811a97ab6a43dc015d1c.jpg'),
(12, 3, 'bea224808c95bf1a28d811bf75ba240f.jpg'),
(13, 3, '4d1db9b0ec0a97b50503e6cb6b6a9085.jpg'),
(14, 4, '338820cd57595d91680403d0c51281d0.jpg'),
(15, 4, 'e3327a0d138e87ff5d12fc9dff28a1c9.jpg'),
(16, 4, '2ef9a24273b687f11a44fb95515146fd.jpg'),
(17, 4, '87f56e117b9318dafa8c99b951a4c2bf.jpg'),
(18, 5, 'a4e521853cc3d0392a16b511c5ada797.jpg'),
(19, 5, 'a6c8ce5d81cc01d8a2e20c7162b6df18.jpg'),
(20, 5, '00244f137a5123ca3b21f671149aa151.jpg'),
(21, 5, '42e07105e945ea9c1ce4ea7b8c54a2cb.jpg'),
(25, 6, 'c86e418fba7333bfa5d512cad3be10f3.jpg'),
(26, 6, '6f3106813c8347190835a1fb3a9cad63.jpg'),
(34, 7, '8602d4a43f7b8d580c03f099787e3004.jpg'),
(35, 7, '01434bcf63adac3bf9edaa855e0e56c3.jpg'),
(36, 7, '0dcb7042bb75c8fa87942018fe175d96.jpg'),
(38, 7, '1594633064-4777522aa5fd6370165e34aee0b184c3.jpg'),
(39, 13, '1594637222-dsc_0038.u2566.d20170508.t104531.2624.jpg'),
(40, 13, '1594637230-dsc_0037.u2566.d20170508.t104530.968091.jpg'),
(41, 13, '1594637239-dsc_0036.u2566.d20170508.t104530.923656.jpg'),
(42, 14, '1594638649-1594638434-0e4b3cfa01dd0861f23b5f5df8de74c6.png'),
(43, 14, '1594638661-764b390c1dec3a4186f3ce12ba4cfb7f.png'),
(44, 14, '1594638671-40b1f4e6ba593a284c389aa298e23e4d.png'),
(45, 14, '1594638680-2a814a4696888ec78c83f93d615595b2.png'),
(46, 15, '1594810418-244a1d20829b848bc02b5c4a82e34233.png'),
(47, 15, '1594810483-f0f4723342d0c2de3b29fe3e7e9cd2c7.jpg'),
(48, 15, '1594810537-1144e7a541a0f1da7bcce79a182d8bb4.png'),
(49, 15, '1594810635-1594810364-7c68a017d6a0cec32f2f62eab6727c04.png'),
(50, 16, '1594810913-1594810827-3de0dc5f6a7d64c7e93bd4625a09c9d6.png'),
(51, 16, '1594810925-90f15c39e53bdfb74cc51a5953666f71.jpg'),
(52, 16, '1594810934-8873a2963259a720181a70f4af6fd754.png'),
(53, 16, '1594810940-1b766d9492883481fb9d8e91a8e7f7e9.png'),
(54, 17, '1594811183-4bc8f56472f64c50008b6155eac53cd3.jpg'),
(55, 17, '1594811190-f827b912f31a40d38e3c5aceed691255.jpg'),
(56, 17, '1594811202-27c1a3ff15911b70c528c884e42acd20.jpg'),
(57, 17, '1594811209-28edcd882513d50846e73dee47561031.jpg'),
(58, 18, '1594812477-0f960803655c90e5898786cc266be9f1.png'),
(59, 18, '1594812490-1486d635d03a0350dbe19bfde58b796a.png'),
(60, 18, '1594812496-6eb7699d4d5e52f60a08d0975603fa4a.png'),
(61, 18, '1594812502-95e5bf3f0f780ebbcb5892e180b1188d.png'),
(62, 19, '1594812651-7c873b28a8f348df4ef103497d085422.jpg'),
(63, 19, '1594812658-c7f81086cf12f545984bf977a02d683e.jpg'),
(64, 19, '1594812664-8502b78cc406bd9125d29d8df298a615.jpg'),
(65, 19, '1594812671-9347873c6ff11e4eac194dd0bfb522c0.jpg'),
(66, 20, '1594812804-97c87ae31bd70598f9f212d19daf0490.jpg'),
(67, 20, '1594812810-d1c435b79e5407e42beab9427bc489da.jpg'),
(68, 20, '1594812815-949122757b985f7caa37ddf802de3333.jpg'),
(69, 20, '1594812823-62c32a64f867a40da11b1978c3e99d9b.jpg'),
(70, 21, '1594813038-42ff2fccf363293d438e90c8174afd27.jpg'),
(71, 21, '1594813045-1fc9db9725d60f0c6a01643dbac84eeb.jpg'),
(72, 21, '1594813051-132cfab0a94e077dd1ffdbbb12990864.jpg'),
(73, 21, '1594813058-942fe7bb1dc442c37206da6ee5b7f241.jpg'),
(74, 22, '1594814988-4a726794b533c3c2f182698f3b5d4d78.jpg'),
(75, 22, '1594814994-ef00da76113511f051b0f5683d170d99.jpg'),
(76, 22, '1594815000-37c85dce59c8d11e87af9cda8c2e8628.jpg'),
(77, 22, '1594815005-ee6cb7425eae50f980a1a39f354095f4.jpg'),
(78, 23, '1594815115-fa3782efef6f6d29ec2cc43c0789f6bf.jpg'),
(79, 23, '1594815121-74627482dc40c9007affd0081638fa75.jpg'),
(80, 24, '1594815264-52c32ec36c907000c2eb69fe5098dad9.jpg'),
(81, 24, '1594815270-81a8aadd10b19add982713609d9a4442.jpg'),
(82, 24, '1594815275-28b45d83df276c7350b15c6d0434cacc.jpg'),
(83, 24, '1594815280-095865c56f58b32df3b4268863789a98.jpg'),
(84, 25, '1594815448-a6028d37cc5d79f0ee5bf46fbaa1911c.jpg'),
(85, 25, '1594815454-4286dcccdc7cc8e5cf1a1a0c0e825fff.jpg'),
(86, 25, '1594815459-4a2198fa6de7bf93e320240a02bffcf5.jpg'),
(87, 25, '1594815464-6a3c14ba214c600d1f9939bd9a2fda9f.jpg'),
(88, 26, '1594815568-593ca50ace845cae07f926a34c10cae0.jpg'),
(89, 27, '1594815791-d8a9b4dadfb65b176c1318b2218829f3.jpg'),
(90, 27, '1594815808-713f7d124cc5c558d3cb2fb1253b40c2.jpg'),
(91, 27, '1594815815-43a1aef261dcb03a2c812875cbc57ccd.jpg'),
(92, 27, '1594815820-db3e12f1a7e9af7f15ac39c91e91a4c4.jpg'),
(93, 28, '1594816023-1ccc757bb1ad30ecf0eba00e2512ddfc.jpg'),
(94, 28, '1594816029-a2b2b3d7c90bd243bb2272db15e2005a.jpg'),
(95, 28, '1594816035-0f85367d10e706c49d7de9c5ca9fd73e.jpg'),
(96, 28, '1594816040-9ce2596679699b299c479f5a06269cba.jpg'),
(97, 29, '1594816167-305b2a53fc8b66800eb91a0048a324bb.jpg'),
(98, 29, '1594816174-13bda66d3cdc5ceb19ed11713dbda7a6.jpg'),
(99, 29, '1594816179-06e57443ed337c9b193429d2fa3d063f.jpg'),
(100, 29, '1594816184-b7fecb089dcb3bc17bedb9d7f9fa6130.jpg'),
(101, 30, '1594816302-8dc229b63bb18ee5b3ff580e7d46e0f7.jpg'),
(102, 30, '1594816310-4521f6024aa2ec2b2019414f8bd2e981.jpg'),
(103, 30, '1594816315-f77e36b31fa16a62d14d95bedc483b2e.jpg'),
(104, 30, '1594816321-1036d531c54f1585f14d363ee9af929d.jpg'),
(105, 31, '1594816550-57a3bf5665cab3b5f22b9d80fb64c04d.jpg'),
(106, 31, '1594816597-923bc9cf396e9573974b28c7522558ad.jpg'),
(107, 31, '1594816605-d1c703e5aba1cec84f087ffc9ff687a7.jpg'),
(108, 31, '1594816610-c7a8cf3d53bd380314cdcae5fa5f598a.jpg'),
(109, 32, '1594816719-a283eab2ffec9984a5d126576b8a1d48.jpg'),
(110, 32, '1594816725-9d99e8b9888a5ac87fe4dd6c0bbbd456.jpg'),
(111, 32, '1594816730-162bc284f130d344d250cdc13c6fd40c.jpg'),
(112, 32, '1594816736-318db361842dd1feed4b02fa51753dc1.jpg'),
(113, 33, '1594816957-80b583c0bac623244413aee2c4678e99.jpg'),
(114, 33, '1594816962-41720a31f760368d0602047359dee4c5.jpg'),
(115, 33, '1594816967-747f59f3862356a5cc13f818834205a1.jpg'),
(116, 33, '1594816972-5d34626722f3b29919a8c0bec4f45e2e.jpg'),
(117, 34, '1594817108-c2cce4059740733a6d35ce4b0e8bc473.png'),
(118, 35, '1594817185-img301.u3059.d20170716.t122719.913090.jpg'),
(119, 36, '1594817282-0b49f5cfefab3c708754848e8904b3a6.jpg'),
(120, 37, '1594817443-15c3bbce1d0a26d910e58f5f09c76053.jpg'),
(121, 37, '1594817450-1021b95fce2ee68cf99a36279be08b2e.jpg'),
(122, 38, '1594817543-6080f42f0d01dfc3f2b25f1d0a67d90e.jpg'),
(123, 38, '1594817549-edf0eb4b772eefa430454c89061ebc6f.jpg'),
(124, 38, '1594817554-1b3b7e5c3ae5890a63cd4145e50ca816.jpg'),
(125, 39, '1594817624-a02f8bba14f85fdfeceb812e00466831.jpg'),
(126, 40, '1594817689-6f9be628d6574ba445923f6beee42037.jpg'),
(127, 41, '1594817797-a68306d26d3ee0a1fdd458f2417b3ed0.jpg'),
(128, 41, '1594817802-bc0fad86a7f78e94844327a18c8c2958.jpg'),
(129, 41, '1594817807-0ecf83e280c0c948500b99b761090792.jpg'),
(130, 41, '1594817813-729874a82a698d1d824bb84cf605cee6.jpg'),
(131, 42, '1594818036-fbee41a967cf66cac6d5748daef1e4f1.jpg'),
(132, 42, '1594818042-b3563b77269e4cac8467e7595e1a22db.jpg'),
(133, 42, '1594818048-4b48b87e236565e3a27f884f1c74947f.jpg'),
(134, 42, '1594818053-0d8f3a213da090215cfbc702b4d9d2af.jpg'),
(135, 43, '1594818185-323334273de5b5b7e572542419fa0cc4.jpg'),
(136, 43, '1594818192-1f0e31f2f275a06941b2e39f36ca58a8.jpg'),
(137, 43, '1594818197-d05dc9dc55f1588d07cd6ba1f45e1239.jpg'),
(138, 43, '1594818202-7bb2645f598a1cf34096ce834efac780.jpeg'),
(139, 44, '1594818383-2ff5870b4897362d52c65426659b03a4.jpg'),
(140, 44, '1594818389-45107f507c2c2f8ad4fac69c9c2a848b.jpg'),
(141, 44, '1594818393-c78daac473d781951db62111395218f2.jpg'),
(142, 44, '1594818398-cf37dd60da97b95c2981463c1038d759.jpg'),
(143, 45, '1594818614-0fbbf3f54f192d334c507bb2ded04059.jpg'),
(144, 45, '1594818620-8cdb2d8493ae211511c30718b6cd6fd6.jpg'),
(145, 45, '1594818624-a22fe9994dcccb51f1c7545e8aa30bd0.jpg'),
(146, 45, '1594818629-416b505733d13115d22117235b8d265a.jpg'),
(147, 46, '1594818892-dc145b95d9493dddba95ac68189555e0.jpg'),
(148, 46, '1594818898-1a0199bcab64afd870a900778a8954ef.jpg'),
(149, 46, '1594818902-00aab586d0f828692d3c22f2de61d2ee.jpg'),
(150, 47, '1594818965-12433c5325c37263fbc56cab3c7980bb.jpg'),
(151, 48, '1594819067-90562b205e6cc4bea3fad2cd67b54299.jpg'),
(152, 48, '1594819074-ae548b48c0b21fefe3e6ebf2d4ee7a36.jpg'),
(153, 48, '1594819080-6a4af7ebda7a4d439a2b6d7ad23e762a.jpg'),
(154, 48, '1594819084-7db1e032e2169f566b3e9d76abe3da77.jpg'),
(155, 49, '1594819200-d833f94e3c26e3126fcab43fa0ed82bb.jpg'),
(156, 49, '1594819206-323d344f4b6a83a8f8d01fc57aaf544b.jpg'),
(157, 49, '1594819212-bf905ebcb798b2e55fe82ff72ff89915.jpg'),
(158, 49, '1594819217-c57fe6617e53782d5b959b205bada329.jpg'),
(159, 50, '1594819319-fb99c5f4e03697d1c9502e73f77a504f.jpg'),
(160, 50, '1594819325-3179e12456a2f119fd4a39cb95100215.jpg'),
(161, 50, '1594819330-25dc56c1e22ea2a544d278fad81e5d75.jpg'),
(162, 50, '1594819335-dbed76f1211c4122c342751eb16aa752.jpg'),
(163, 51, '1594819449-055363c4333377fab1d1e1a7f533c98a.jpg'),
(164, 51, '1594819453-a97b8337b0a0751c8eeece9a3b2513fa.jpg'),
(165, 51, '1594819458-c28fbcfa94f37e356828bcfe805e4fff.jpg'),
(166, 51, '1594819463-a810bb11db5a09a828bd4913bfd4e737.jpg'),
(167, 52, '1594819566-710898ca8f1dcd1bcd9ed6152184effe.jpg'),
(168, 53, '1594819638-38c209e9b675a4ed20d141c5cfd6df96.jpg'),
(169, 54, '1594819727-83b30b59b59159f17f4a103761c426bd.jpg'),
(170, 54, '1594819734-ef1bf0dec51c3527514e2332c59d7d80.jpg'),
(171, 54, '1594819739-b3ee4fd07a98bfb13b7a1e76795357c5.jpg'),
(172, 54, '1594819743-43b5e1fac9ecf06a2384bdc4f2feab24.jpg'),
(173, 55, '1594819854-fa78696236239016d799820210124773.jpg'),
(174, 55, '1594819859-ed09828cbc561337454f4103a1bd2618.jpg'),
(175, 55, '1594819863-2315d7075da59554654f0463809399ec.jpg'),
(176, 55, '1594819868-af5791c28c260074b1bf4468bf4a8c2f.jpg');
-- --------------------------------------------------------
--
-- Cấu trúc bảng cho bảng `product_type`
--
CREATE TABLE `product_type` (
`id` int(11) NOT NULL,
`name` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`process` int(5) NOT NULL,
`packing` varchar(200) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`unit_of_measure` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
`function` text COLLATE utf8mb4_unicode_ci NOT NULL,
`user_manual` text COLLATE utf8mb4_unicode_ci NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
--
-- Đang đổ dữ liệu cho bảng `product_type`
--
INSERT INTO `product_type` (`id`, `name`, `process`, `packing`, `unit_of_measure`, `function`, `user_manual`) VALUES
(1, 'Lịch', 14, '5pcs', 'Gram', '<p>Lịch là một hệ thống để đặt tên cho các chu kỳ thời gian,thông thường là theo các ngày. Lịch cũng là một vật liệu (giấy,..) để minh họa cho hệ thống chu kỳ thời gian và đây cũng là cách hiểu thông dụng nhất của từ lịch, và được sử dụng để biểu thị danh sách một tập hợp cụ thể nào đó của các sự kiện đã được lập kế hoạch (ví dụ như lịch học, lịch xét xử...).</p>\r\n', 'Sử dụng lịch một cách hiệu quả có thể giúp cho người dùng có thể sử dụng thời gian một cách hiệu quả hơn.'),
(2, 'Tạp chí', 16, '5pcs', 'Gram', 'Giống như báo viết, tạp chí ra đời mang chức năng cơ bản là thu thập, xử lý và truyền tải, đưa thông tin về tất cả các lĩnh vực của đời sống kinh tế, văn hóa, xã hội... đến mọi người nhằm đáp ứng yêu cầu thông tin của đông đảo công chúng.', 'Đọc tạp chí có thể giúp cho người sử dụng biết thêm nhiều thứ xung quanh mình hằng ngày.'),
(3, 'Nhật kí', 100, '5pcs', 'Gram', 'Nhật ký cá nhân thông thường được coi như một thể tài ngoài văn học hay cận văn học, là loại văn ghi chép của cá nhân trong đời sống hàng ngày. Do vậy, nhật ký thường chân thành và công nhiên trong phát ngôn; bao giờ cũng chỉ ghi lại những gì đã diễn ra, đã nếm trải, đã thử nghiệm, và ít khi hồi cố. Nhật ký được viết ra chỉ cho bản thân người ghi chứ không tính đến việc được công chúng tiếp nhận, và đây là điểm phân biệt nó với nhật ký văn học. Nhật ký cá nhân thường nói về các sự kiện của đời tư với tính chất xác thực đặc biệt. Bên cạnh các sự kiện đời tư, nhật ký cũng nói lên những ý kiến nhận xét về cuộc đời, thường được rút ra từ các suy nghĩ về cuộc sống của bản thân người ghi.', 'Dùng để ghi lại những gì trải qua mỗi ngày hay lịch trình làm việc của người dùng');
--
-- Chỉ mục cho các bảng đã đổ
--
--
-- Chỉ mục cho bảng `account`
--
ALTER TABLE `account`
ADD PRIMARY KEY (`id`),
ADD KEY `branch_id` (`branch_id`);
--
-- Chỉ mục cho bảng `branch`
--
ALTER TABLE `branch`
ADD PRIMARY KEY (`id`);
--
-- Chỉ mục cho bảng `invoice_detail`
--
ALTER TABLE `invoice_detail`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `pay_invoice_id` (`pay_invoice_id`,`product_id`);
--
-- Chỉ mục cho bảng `pay_invoice`
--
ALTER TABLE `pay_invoice`
ADD PRIMARY KEY (`id`);
--
-- Chỉ mục cho bảng `product`
--
ALTER TABLE `product`
ADD PRIMARY KEY (`id`),
ADD KEY `product_type_id` (`product_type_id`);
--
-- Chỉ mục cho bảng `product_image`
--
ALTER TABLE `product_image`
ADD PRIMARY KEY (`id`),
ADD KEY `id_product` (`id_product`);
--
-- Chỉ mục cho bảng `product_type`
--
ALTER TABLE `product_type`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT cho các bảng đã đổ
--
--
-- AUTO_INCREMENT cho bảng `account`
--
ALTER TABLE `account`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=27;
--
-- AUTO_INCREMENT cho bảng `branch`
--
ALTER TABLE `branch`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT cho bảng `invoice_detail`
--
ALTER TABLE `invoice_detail`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=20;
--
-- AUTO_INCREMENT cho bảng `pay_invoice`
--
ALTER TABLE `pay_invoice`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=67;
--
-- AUTO_INCREMENT cho bảng `product`
--
ALTER TABLE `product`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;
--
-- AUTO_INCREMENT cho bảng `product_image`
--
ALTER TABLE `product_image`
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=177;
--
-- AUTO_INCREMENT cho bảng `product_type`
--
ALTER TABLE `product_type`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- Các ràng buộc cho các bảng đã đổ
--
--
-- Các ràng buộc cho bảng `product`
--
ALTER TABLE `product`
ADD CONSTRAINT `product_ibfk_1` FOREIGN KEY (`product_type_id`) REFERENCES `product_type` (`id`);
--
-- Các ràng buộc cho bảng `product_image`
--
ALTER TABLE `product_image`
ADD CONSTRAINT `product_image_ibfk_1` FOREIGN KEY (`id_product`) REFERENCES `product` (`id`);
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
e8893a2a5fe5d7ecec4bb6be82be68ff24d167d6 | SQL | SCM-SISTEMA/scm | /documentos/imprimirContrato/campos_tabela_cleinte.sql | UTF-8 | 1,791 | 2.765625 | 3 | [
"BSD-3-Clause"
] | permissive |
ALTER TABLE public.tab_cliente
ADD COLUMN operando boolean;
ALTER TABLE public.tab_cliente
ADD COLUMN parceria boolean;
ALTER TABLE public.tab_cliente
ADD COLUMN qnt_clientes integer;
ALTER TABLE public.tab_cliente
ADD COLUMN link_dedicado boolean;
ALTER TABLE public.tab_cliente
ADD COLUMN zero800 boolean;
ALTER TABLE public.tab_cliente
ADD COLUMN consultoria_mensal boolean;
ALTER TABLE public.tab_cliente
ADD COLUMN engenheiro_tecnico boolean;
COMMENT ON COLUMN public.tab_cliente.operando IS 'Já está operando?';
COMMENT ON COLUMN public.tab_cliente.parceria IS 'Tem parceria?';
COMMENT ON COLUMN public.tab_cliente.qnt_clientes IS 'Quantidade de clientes';
COMMENT ON COLUMN public.tab_cliente.link_dedicado IS 'Possui link dedicado?';
COMMENT ON COLUMN public.tab_cliente.zero800 IS 'Possui 0800?';
COMMENT ON COLUMN public.tab_cliente.consultoria_mensal IS 'Paga consultoria SCM mensal?';
COMMENT ON COLUMN public.tab_cliente.engenheiro_tecnico IS 'Possui engenheiro ou técnico responsável?';
ALTER TABLE public.tab_cliente ALTER COLUMN operando SET DEFAULT false;
ALTER TABLE public.tab_cliente ALTER COLUMN parceria SET DEFAULT false;
ALTER TABLE public.tab_cliente ALTER COLUMN link_dedicado SET DEFAULT false;
ALTER TABLE public.tab_cliente ALTER COLUMN consultoria_mensal SET DEFAULT false;
ALTER TABLE public.tab_cliente ALTER COLUMN zero800 SET DEFAULT false;
ALTER TABLE public.tab_cliente ALTER COLUMN engenheiro_tecnico SET DEFAULT false;
update public.tab_cliente set operando=false, parceria=false, link_dedicado=false, consultoria_mensal=false, zero800=false, engenheiro_tecnico=false
INSERT INTO public.tab_atributos_valores(
fk_atributos_valores_atributos_id, sgl_valor,
dsc_descricao)
VALUES (80, 'S', 'Skype');
| true |
52346ca1a6a107bc21054f345b82f34fec581812 | SQL | AyrtonHenrique/fiap-spring | /batch/src/main/resources/schema-all.sql | UTF-8 | 385 | 2.625 | 3 | [] | no_license | -- drop table if exists tb_ClienteAluno;
(SELECT * FROM TB_CLIENTEALUNO)
-- create table if not exists tb_clientealuno
-- (
-- rm bigint generated by default as identity,
-- nome Varchar(100),
-- turma varchar(20),
-- cpf varchar(20),
-- rg varchar(20),
-- dataNascimento timestamp,
-- primary key (rm)
-- ) | true |
56372c7f8303c7ea9b2cb887a2629e085645e383 | SQL | Miguel619/cs50 | /pset7/movies/8.sql | UTF-8 | 219 | 3.671875 | 4 | [] | no_license | /* list the names of all people who starred in Toy Story */
SELECT people.name FROM stars
INNER JOIN people ON stars.person_id = people.id
INNER JOIN movies ON stars.movie_id = movies.id
WHERE movies.title = "Toy Story" | true |
af60ddf2fab925f0bdb168f510d6c23da0cfed09 | SQL | set808/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/13-count_shows_by_genre.sql | UTF-8 | 285 | 3.640625 | 4 | [] | no_license | -- lists all shows in hbtn_0d_tvsows that have at least 1 genre linked
SELECT tv_genres.name AS genre, COUNT(tv_show_genres.genre_id) AS number_shows
FROM tv_show_genres
INNER JOIN tv_genres
ON tv_genres.id = tv_show_genres.genre_id
GROUP BY tv_genres.name
ORDER BY number_shows DESC;
| true |
3056602a32f0afa0dd7fd3f25d120584ff1b58c9 | SQL | eh8491/data-models | /mobile/v1/bigquery/sql-runner/sql/standard/02-screen-views/01-main/00-setup-screen-views.sql | UTF-8 | 6,434 | 3.453125 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | /*
Copyright 2021 Snowplow Analytics Ltd. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
DECLARE RUN_ID TIMESTAMP;
-- A table storing an identifier for this run of a model - used to identify runs of the model across multiple modules/steps (eg. base, page views share this id per run)
CREATE TABLE IF NOT EXISTS {{.scratch_schema}}.mobile_metadata_run_id{{.entropy}} (
run_id TIMESTAMP
);
-- Insert new run_id if one doesn't exist
SET RUN_ID = (SELECT run_id FROM {{.scratch_schema}}.mobile_metadata_run_id{{.entropy}} LIMIT 1);
IF RUN_ID IS NULL THEN
INSERT INTO {{.scratch_schema}}.mobile_metadata_run_id{{.entropy}} (
SELECT
CURRENT_TIMESTAMP()
);
END IF;
-- Permanent metadata table
CREATE TABLE IF NOT EXISTS {{.output_schema}}.datamodel_metadata{{.entropy}} (
run_id TIMESTAMP,
model_version STRING,
model STRING,
module STRING,
run_start_tstamp TIMESTAMP,
run_end_tstamp TIMESTAMP,
rows_this_run INT64,
distinct_key STRING,
distinct_key_count INT64,
time_key STRING,
min_time_key TIMESTAMP,
max_time_key TIMESTAMP,
duplicate_rows_removed INT64,
distinct_keys_removed INT64
)
PARTITION BY DATE(run_start_tstamp);
-- Setup temp metadata tables for this run
CREATE OR REPLACE TABLE {{.scratch_schema}}.mobile_sv_metadata_this_run{{.entropy}} (
id STRING,
run_id TIMESTAMP,
model_version STRING,
model STRING,
module STRING,
run_start_tstamp TIMESTAMP,
run_end_tstamp TIMESTAMP,
rows_this_run INT64,
distinct_key STRING,
distinct_key_count INT64,
time_key STRING,
min_time_key TIMESTAMP,
max_time_key TIMESTAMP,
duplicate_rows_removed INT64,
distinct_keys_removed INT64
);
INSERT INTO {{.scratch_schema}}.mobile_sv_metadata_this_run{{.entropy}} (
SELECT
'run',
run_id,
'{{.model_version}}',
'mobile',
'screen-views',
CURRENT_TIMESTAMP(),
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
FROM {{.scratch_schema}}.mobile_metadata_run_id{{.entropy}}
);
-- Create page views table if it doesn't exist
CREATE TABLE IF NOT EXISTS {{.output_schema}}.mobile_screen_views{{.entropy}} (
screen_view_id STRING NOT NULL,
event_id STRING,
app_id STRING,
user_id STRING,
device_user_id STRING,
network_userid STRING,
session_id STRING,
session_index INT64,
previous_session_id STRING,
session_first_event_id STRING,
screen_view_in_session_index INT64,
screen_views_in_session INT64,
dvce_created_tstamp TIMESTAMP,
collector_tstamp TIMESTAMP,
derived_tstamp TIMESTAMP,
model_tstamp TIMESTAMP,
screen_view_name STRING,
screen_view_transition_type STRING,
screen_view_type STRING,
screen_fragment STRING,
screen_top_view_controller STRING,
screen_view_controller STRING,
screen_view_previous_id STRING,
screen_view_previous_name STRING,
screen_view_previous_type STRING,
platform STRING,
dvce_screenwidth INT64,
dvce_screenheight INT64,
device_manufacturer STRING,
device_model STRING,
os_type STRING,
os_version STRING,
android_idfa STRING,
apple_idfa STRING,
apple_idfv STRING,
open_idfa STRING,
device_latitude FLOAT64,
device_longitude FLOAT64,
device_latitude_longitude_accuracy FLOAT64,
device_altitude FLOAT64,
device_altitude_accuracy FLOAT64,
device_bearing FLOAT64,
device_speed FLOAT64,
geo_country STRING,
geo_region STRING,
geo_city STRING,
geo_zipcode STRING,
geo_latitude FLOAT64,
geo_longitude FLOAT64,
geo_region_name STRING,
geo_timezone STRING,
user_ipaddress STRING,
useragent STRING,
carrier STRING,
network_technology STRING,
network_type STRING,
build STRING,
version STRING
)
PARTITION BY DATE(derived_tstamp)
CLUSTER BY {{range $i, $cluster_field := .cluster_by}} {{if lt $i 4}} {{if $i}}, {{end}} {{$cluster_field}} {{end}} {{else}} app_id,device_user_id,session_id {{end}};
--Cluster using `.cluster_by` var, else use defaults. Max 4 cluster by fields allowed
-- Create staging table - acts as input to sessions step
CREATE TABLE IF NOT EXISTS {{.scratch_schema}}.mobile_screen_views_staged{{.entropy}} (
screen_view_id STRING NOT NULL,
event_id STRING,
app_id STRING,
user_id STRING,
device_user_id STRING,
network_userid STRING,
session_id STRING,
session_index INT64,
previous_session_id STRING,
session_first_event_id STRING,
screen_view_in_session_index INT64,
screen_views_in_session INT64,
dvce_created_tstamp TIMESTAMP,
collector_tstamp TIMESTAMP,
derived_tstamp TIMESTAMP,
model_tstamp TIMESTAMP,
screen_view_name STRING,
screen_view_transition_type STRING,
screen_view_type STRING,
screen_fragment STRING,
screen_top_view_controller STRING,
screen_view_controller STRING,
screen_view_previous_id STRING,
screen_view_previous_name STRING,
screen_view_previous_type STRING,
platform STRING,
dvce_screenwidth INT64,
dvce_screenheight INT64,
device_manufacturer STRING,
device_model STRING,
os_type STRING,
os_version STRING,
android_idfa STRING,
apple_idfa STRING,
apple_idfv STRING,
open_idfa STRING,
device_latitude FLOAT64,
device_longitude FLOAT64,
device_latitude_longitude_accuracy FLOAT64,
device_altitude FLOAT64,
device_altitude_accuracy FLOAT64,
device_bearing FLOAT64,
device_speed FLOAT64,
geo_country STRING,
geo_region STRING,
geo_city STRING,
geo_zipcode STRING,
geo_latitude FLOAT64,
geo_longitude FLOAT64,
geo_region_name STRING,
geo_timezone STRING,
user_ipaddress STRING,
useragent STRING,
carrier STRING,
network_technology STRING,
network_type STRING,
build STRING,
version STRING
)
PARTITION BY DATE(derived_tstamp)
CLUSTER BY {{range $i, $cluster_field := .cluster_by}} {{if lt $i 4}} {{if $i}}, {{end}} {{$cluster_field}} {{end}} {{else}} app_id,device_user_id,session_id {{end}};
--Cluster using `.cluster_by` var, else use defaults. Max 4 cluster by fields allowed
| true |
6a1ec568716012f5e932c56ec04c0b841aa64ead | SQL | siamik/siamik.github.io | /itn_database.sql | UTF-8 | 10,780 | 3 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 17, 2015 at 08:35 PM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: `itn_base`
--
-- --------------------------------------------------------
--
-- Table structure for table `jadwal`
--
CREATE TABLE IF NOT EXISTS `jadwal` (
`id_jadwal` int(11) NOT NULL,
`hari_jadwal` varchar(7) DEFAULT NULL,
`jam_jadwal` timestamp NULL DEFAULT NULL,
`kelas_id_kelas` int(11) NOT NULL,
PRIMARY KEY (`id_jadwal`,`kelas_id_kelas`),
KEY `fk_jadwal_kelas1` (`kelas_id_kelas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `jadwal`
--
INSERT INTO `jadwal` (`id_jadwal`, `hari_jadwal`, `jam_jadwal`, `kelas_id_kelas`) VALUES
(1, 'senin', '2015-04-06 13:30:00', 1),
(2, 'senin', '2015-04-06 16:00:00', 1),
(3, 'senin', '2015-04-06 19:20:00', 1),
(4, 'senin', '2015-04-06 21:00:00', 1),
(5, 'senin', '2015-04-06 22:30:00', 1),
(6, 'selasa', '2015-04-07 13:30:00', 1),
(7, 'selasa', '2015-04-07 16:00:00', 1),
(8, 'selasa', '2015-04-07 19:20:00', 1),
(9, 'selasa', '2015-04-17 21:00:00', 1),
(10, 'selasa', '2015-04-07 22:30:00', 1),
(11, 'rabu', '2015-04-08 13:30:00', 1),
(12, 'rabu', '2015-04-08 16:00:00', 1),
(13, 'rabu', '2015-04-08 19:20:00', 1),
(14, 'rabu', '2015-04-08 21:00:00', 1),
(15, 'rabu', '2015-04-08 22:30:00', 1),
(16, 'kamis', '2015-04-09 13:30:00', 1),
(17, 'kamis', '2015-04-09 16:00:00', 1),
(18, 'kamis', '2015-04-09 19:30:00', 1),
(19, 'kamis', '2015-04-09 21:00:00', 1),
(20, 'kamis', '2015-04-09 22:30:00', 1),
(21, 'jumat', '2015-04-10 13:30:00', 1),
(22, 'jumat', '2015-04-10 16:00:00', 1),
(23, 'jumat', '2015-04-10 20:20:00', 1),
(24, 'jumat', '2015-04-10 22:00:00', 1);
-- --------------------------------------------------------
--
-- Table structure for table `kelas`
--
CREATE TABLE IF NOT EXISTS `kelas` (
`id_kelas` int(11) NOT NULL,
`nomer_kelas` varchar(45) DEFAULT NULL,
`gedung_kelas` varchar(45) DEFAULT NULL,
`kapasitas_kelas` varchar(45) DEFAULT NULL,
`jurusan_kelas` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id_kelas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `kelas`
--
INSERT INTO `kelas` (`id_kelas`, `nomer_kelas`, `gedung_kelas`, `kapasitas_kelas`, `jurusan_kelas`) VALUES
(1, '307', 'B', '45', 'Teknik Informatika'),
(2, '308', 'B', '45', 'Teknik Informatika'),
(3, '309', 'B', '45', 'Teknik Informatika'),
(4, '310', 'B', '45', 'Teknik Informatika'),
(5, '311', 'B', '45', 'Teknik Informatika'),
(6, '311', 'B', '45', 'Teknik Informatika'),
(7, '312', 'B', '45', 'Teknik Informatika'),
(8, '313', 'B', '45', 'Teknik Informatika'),
(9, '314', 'B', '45', 'Teknik Informatika'),
(10, '315', 'B', '45', 'Teknik Informatika'),
(11, '316', 'B', '45', 'Teknik Informatika'),
(12, '317', 'B', '45', 'Teknik Informatika'),
(13, '318', 'B', '45', 'Teknik Informatika');
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE IF NOT EXISTS `login` (
`id_login` int(11) NOT NULL,
`nim_mhs` int(11) NOT NULL,
`nip_dosen` int(11) NOT NULL,
`password_login` varchar(45) NOT NULL,
`profile_mhs_id_mhs` int(11) NOT NULL,
`profile_mhs_jadwal_id_jadwal` int(11) NOT NULL,
`profile_mhs_jadwal_kelas_id_kelas` int(11) NOT NULL,
`profile_dosen_id_dosen` int(11) NOT NULL,
`profile_dosen_jadwal_id_jadwal` int(11) NOT NULL,
`profile_dosen_jadwal_kelas_id_kelas` int(11) NOT NULL,
PRIMARY KEY (`id_login`,`profile_mhs_id_mhs`,`profile_mhs_jadwal_id_jadwal`,`profile_mhs_jadwal_kelas_id_kelas`,`profile_dosen_id_dosen`,`profile_dosen_jadwal_id_jadwal`,`profile_dosen_jadwal_kelas_id_kelas`),
UNIQUE KEY `nim_mhs_UNIQUE` (`nim_mhs`),
UNIQUE KEY `nip_dosen_UNIQUE` (`nip_dosen`),
KEY `fk_login_profile_mhs1` (`profile_mhs_id_mhs`,`profile_mhs_jadwal_id_jadwal`,`profile_mhs_jadwal_kelas_id_kelas`),
KEY `fk_login_profile_dosen1` (`profile_dosen_id_dosen`,`profile_dosen_jadwal_id_jadwal`,`profile_dosen_jadwal_kelas_id_kelas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `login`
--
INSERT INTO `login` (`id_login`, `nim_mhs`, `nip_dosen`, `password_login`, `profile_mhs_id_mhs`, `profile_mhs_jadwal_id_jadwal`, `profile_mhs_jadwal_kelas_id_kelas`, `profile_dosen_id_dosen`, `profile_dosen_jadwal_id_jadwal`, `profile_dosen_jadwal_kelas_id_kelas`) VALUES
(1, 13650001, 111, 'password1', 1, 1, 1, 1111, 1, 1),
(2, 13650002, 112, 'password2', 2, 1, 1, 1112, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `matkul`
--
CREATE TABLE IF NOT EXISTS `matkul` (
`id_matkul` int(11) NOT NULL,
`kode_matkul` tinyint(4) NOT NULL,
`sks_matkul` tinyint(4) NOT NULL,
`semester_matkul` tinyint(4) NOT NULL,
`nip_dosen` int(11) NOT NULL,
`jadwal_id_jadwal` int(11) NOT NULL,
`jadwal_kelas_id_kelas` int(11) NOT NULL,
PRIMARY KEY (`id_matkul`,`jadwal_id_jadwal`,`jadwal_kelas_id_kelas`),
UNIQUE KEY `nip_dosen_UNIQUE` (`nip_dosen`),
UNIQUE KEY `kode_matkul_UNIQUE` (`kode_matkul`),
KEY `fk_matkul_jadwal1` (`jadwal_id_jadwal`,`jadwal_kelas_id_kelas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `matkul`
--
INSERT INTO `matkul` (`id_matkul`, `kode_matkul`, `sks_matkul`, `semester_matkul`, `nip_dosen`, `jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) VALUES
(1, 1, 1, 1, 111, 1, 1),
(2, 2, 2, 2, 112, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `profile_dosen`
--
CREATE TABLE IF NOT EXISTS `profile_dosen` (
`id_dosen` int(11) NOT NULL,
`nip_dosen` int(11) NOT NULL,
`nama_dosen` varchar(30) NOT NULL,
`asisten_dosen` varchar(30) NOT NULL,
`jadwal_id_jadwal` int(11) NOT NULL,
`jadwal_kelas_id_kelas` int(11) NOT NULL,
PRIMARY KEY (`id_dosen`,`jadwal_id_jadwal`,`jadwal_kelas_id_kelas`),
UNIQUE KEY `nip_dosen_UNIQUE` (`nip_dosen`),
KEY `fk_profile_dosen_jadwal1` (`jadwal_id_jadwal`,`jadwal_kelas_id_kelas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `profile_dosen`
--
INSERT INTO `profile_dosen` (`id_dosen`, `nip_dosen`, `nama_dosen`, `asisten_dosen`, `jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) VALUES
(1111, 111, 'M Medina Almas P.hD', '', 1, 1),
(1112, 112, 'Dr. Bill Tanthowi Jauhari', 'Siti Fitriyah M.Kom', 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `profile_mhs`
--
CREATE TABLE IF NOT EXISTS `profile_mhs` (
`id_mhs` int(11) NOT NULL,
`nim_mhs` int(11) NOT NULL,
`nama_mhs` varchar(45) NOT NULL,
`angkatan_mhs` tinyint(4) NOT NULL,
`tempat_lahir_mhs` varchar(30) NOT NULL,
`tanggal_lahir_mhs` date NOT NULL,
`asal_kota_mhs` varchar(30) DEFAULT NULL,
`nomer_telphone_mhs` int(11) DEFAULT NULL,
`jadwal_id_jadwal` int(11) NOT NULL,
`jadwal_kelas_id_kelas` int(11) NOT NULL,
PRIMARY KEY (`id_mhs`,`jadwal_id_jadwal`,`jadwal_kelas_id_kelas`),
UNIQUE KEY `nim_mhs_UNIQUE` (`nim_mhs`),
KEY `fk_profile_mhs_jadwal1` (`jadwal_id_jadwal`,`jadwal_kelas_id_kelas`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `profile_mhs`
--
INSERT INTO `profile_mhs` (`id_mhs`, `nim_mhs`, `nama_mhs`, `angkatan_mhs`, `tempat_lahir_mhs`, `tanggal_lahir_mhs`, `asal_kota_mhs`, `nomer_telphone_mhs`, `jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) VALUES
(1, 13650001, 'Innamul Hassan', 127, 'Aceh', '1995-01-01', 'Aceh', 85123123, 1, 1),
(2, 13650002, 'M Ikbal Muzzaki', 127, 'Lumajang', '1994-02-02', 'Lumajang', 87234234, 1, 1);
-- --------------------------------------------------------
--
-- Table structure for table `profile_ortu`
--
CREATE TABLE IF NOT EXISTS `profile_ortu` (
`id_ortu` int(11) NOT NULL,
`nama_ortu` varchar(45) DEFAULT NULL,
`alamat_ortu` varchar(45) DEFAULT NULL,
`kota_ortu` varchar(45) DEFAULT NULL,
`propinsi_ortu` varchar(45) DEFAULT NULL,
`nomer_telphone_ortu` varchar(45) DEFAULT NULL,
`profile_mhs_id_mhs` int(11) NOT NULL,
PRIMARY KEY (`id_ortu`,`profile_mhs_id_mhs`),
KEY `fk_profile_ortu_profile_mhs` (`profile_mhs_id_mhs`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `profile_ortu`
--
INSERT INTO `profile_ortu` (`id_ortu`, `nama_ortu`, `alamat_ortu`, `kota_ortu`, `propinsi_ortu`, `nomer_telphone_ortu`, `profile_mhs_id_mhs`) VALUES
(1, 'Ainatul Mardhiyah M.Cs', 'Malang', 'Malang', 'Jawa Timur', '911', 1),
(2, 'Isnaeni Agustin', 'Lamongan', 'Lamongan', 'Jawa Timur', '123', 2);
--
-- Constraints for dumped tables
--
--
-- Constraints for table `jadwal`
--
ALTER TABLE `jadwal`
ADD CONSTRAINT `fk_jadwal_kelas1` FOREIGN KEY (`kelas_id_kelas`) REFERENCES `kelas` (`id_kelas`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `login`
--
ALTER TABLE `login`
ADD CONSTRAINT `fk_login_profile_dosen1` FOREIGN KEY (`profile_dosen_id_dosen`, `profile_dosen_jadwal_id_jadwal`, `profile_dosen_jadwal_kelas_id_kelas`) REFERENCES `profile_dosen` (`id_dosen`, `jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_login_profile_mhs1` FOREIGN KEY (`profile_mhs_id_mhs`, `profile_mhs_jadwal_id_jadwal`, `profile_mhs_jadwal_kelas_id_kelas`) REFERENCES `profile_mhs` (`id_mhs`, `jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `matkul`
--
ALTER TABLE `matkul`
ADD CONSTRAINT `fk_matkul_jadwal1` FOREIGN KEY (`jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) REFERENCES `jadwal` (`id_jadwal`, `kelas_id_kelas`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `profile_dosen`
--
ALTER TABLE `profile_dosen`
ADD CONSTRAINT `fk_profile_dosen_jadwal1` FOREIGN KEY (`jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) REFERENCES `jadwal` (`id_jadwal`, `kelas_id_kelas`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `profile_mhs`
--
ALTER TABLE `profile_mhs`
ADD CONSTRAINT `fk_profile_mhs_jadwal1` FOREIGN KEY (`jadwal_id_jadwal`, `jadwal_kelas_id_kelas`) REFERENCES `jadwal` (`id_jadwal`, `kelas_id_kelas`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `profile_ortu`
--
ALTER TABLE `profile_ortu`
ADD CONSTRAINT `fk_profile_ortu_profile_mhs` FOREIGN KEY (`profile_mhs_id_mhs`) REFERENCES `profile_mhs` (`id_mhs`) 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 */;
| true |
87177a374b69e8e86725411bf9a8c27d4afd92bb | SQL | TheYoungSensei/projet_sql | /rapport/codes/perte_visibilite.sql | UTF-8 | 479 | 3.421875 | 3 | [] | no_license | DROP VIEW IF EXISTS shyeld.perte_visibilite;
CREATE VIEW shyeld.perte_visibilite AS
SELECT DISTINCT sh.id_superhero, sh.nom_superhero, sh.date_derniere_apparition, sh.derniere_coordonneeX, sh.derniere_coordonneeY
FROM shyeld.superheros sh
WHERE (date_part('year', age(sh.date_derniere_apparition)) >= 1
OR date_part('month', age(sh.date_derniere_apparition)) >= 1
OR date_part('day', age(sh.date_derniere_apparition)) > 15)
AND sh.est_vivant = TRUE
ORDER BY sh.nom_superhero; | true |
c3ef622b4f89d21c6e3aba2622318c8aaa6e41a4 | SQL | nss-evening-cohort-05/chinook-mccutchan | /sales_agents.sql | UTF-8 | 214 | 3.453125 | 3 | [
"MIT"
] | permissive | /*Provide a query showing only the Employees who are Sales Agents.*/
/*Map*/
SELECT e.FirstName, e.LastName, e.EmployeeId, e.Title
/*What tables*/
FROM Employee e
/*Filter*/
WHERE e.Title = "Sales Support Agent" | true |
b0de729d4a50d599512426d9a3d79c01f4bd9553 | SQL | afanprima22/gresik | /db/spgs.sql | UTF-8 | 1,978 | 2.875 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 20, 2017 at 04:34 PM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 5.6.15
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: `gresik_live`
--
-- --------------------------------------------------------
--
-- Table structure for table `spgs`
--
CREATE TABLE `spgs` (
`spg_id` int(11) NOT NULL,
`spg_name` varchar(50) NOT NULL,
`spg_address` varchar(100) NOT NULL,
`spg_birth` date NOT NULL,
`spg_hp` varchar(20) NOT NULL,
`spg_rek` varchar(20) NOT NULL,
`spg_bank` varchar(20) NOT NULL,
`spg_npwp` varchar(20) NOT NULL,
`spg_name_npwp` varchar(20) NOT NULL,
`spg_ktp` varchar(20) NOT NULL,
`division_id` int(11) NOT NULL,
`spg_status` varchar(15) NOT NULL,
`spg_begin` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `spgs`
--
INSERT INTO `spgs` (`spg_id`, `spg_name`, `spg_address`, `spg_birth`, `spg_hp`, `spg_rek`, `spg_bank`, `spg_npwp`, `spg_name_npwp`, `spg_ktp`, `division_id`, `spg_status`, `spg_begin`) VALUES
(1, 'Burhan Udin', 'Jombang', '2017-10-17', '1243541', '42524', 'BCA', '263533', 'SAMI', '1241341', 1, 'Aktif', '2017-10-23');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `spgs`
--
ALTER TABLE `spgs`
ADD PRIMARY KEY (`spg_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `spgs`
--
ALTER TABLE `spgs`
MODIFY `spg_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
e443490f08be64dd09fbfd54006fc3ac1dfe2235 | SQL | pavelcik/jpa1-starterkit | /target/classes/import.sql | UTF-8 | 7,978 | 2.5625 | 3 | [] | no_license |
insert into car(CAR_NAME,car_type,car_brand,production_year,color,engine_capacity,mileage,engine_power,price_by_day) VALUES ('TOYOTA YARIS','HATCHBACK','TOYOTA','2017','SILVER',1.4,20400,90,220);
insert into car(CAR_NAME,car_type,car_brand,production_year,color,engine_capacity,mileage,engine_power,price_by_day) VALUES ('FORD FIESTA','HATCHBACK','FORD','2014','SILVER',1.5,42300,75,200);
insert into car(CAR_NAME,car_type,car_brand,production_year,color,engine_capacity,mileage,engine_power,price_by_day) VALUES ('SEAT LEON','HATCHBACK','SEAT','2015','BLACK',2.0,32400,120,240);
insert into car(CAR_NAME,car_type,car_brand,production_year,color,engine_capacity,mileage,engine_power,price_by_day) VALUES ('VOLKSWAGEN PASSAT','SEDAN','VOLKSWAGEN','2015','BLACK',2.0,32400,150,220);
insert into car(CAR_NAME,car_type,car_brand,production_year,color,engine_capacity,mileage,engine_power,price_by_day) VALUES ('VOLVO V40','COMBI','VOLVO','2004','BLUE',2.0,132400,160,420);
insert into car(CAR_NAME,car_type,car_brand,production_year,color,engine_capacity,mileage,engine_power,price_by_day) VALUES ('AUDI A6','SEDAN','AUDI','2015','SILVER',2.0,92358,190,500);
insert into car(CAR_NAME,car_type,car_brand,production_year,color,engine_capacity,mileage,engine_power,price_by_day) VALUES ('RENAULT TRAFFIC','VAN','RENAULT','2016','GREY',1.6,43299,140,300);
insert into division(city,street_address,phone_number,email_address) values ('POZNAN','CHABROWA 3','21345672','POZNAN@RENTAL.PL');
insert into division(city,street_address,phone_number,email_address) values('WROCLAW','MYSIA 1','71345672','WROCLAW@RENTAL.PL');
insert into division(city,street_address,phone_number,email_address) values ('KRAKOW','WISLANA 51','42532621','KRAKOW@RENTAL.PL');
insert into WORKERS(position_name,name,surname,age,division_id) values ('Salesman','DANUTA','CZOP',47,3);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Director','JOZEF','KOWALSKI',57,3);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Accountant','RENATA','WISNIEWSKA',39,3);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Salesman','WOJCIECH','WITEK',29,2);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Accountant','KAMIL','WILCZEK',42,2);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Director','RENATA','MAZUT',49,2);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Director','RYSZARD','WODNIK',54,1);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Salesman','WERONIKA','KLONOWICZ',31,1);
insert into WORKERS(position_name,name,surname,age,division_id) values ('Accountant','ZDZISLAWA','KONIOWSKA',51,1);
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Marian','Pudzianowski','1959-12-23','Warszawa','Wolska 12/2','1234121213134343','marian.pudzianowski@wp.pl');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Witold','Puszkin','1969-02-13','Poznan','Kolista 16/7','9729008006240820','witold.puszkin@poczta.interia.pl');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Katarzyna','Figura','1964-11-20','Poznan','Zimna 12','5583411427138849','katarzyna.figura@gmail.com');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Marcin','Stankiewicz','1978-04-03','Wroclaw','Wojenna 213','6234141213738373','marcin.stankiewicz@gmail.com');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Adam','Bodnar','1981-01-23','Olawa','Blizniacza 12','3766639495056039','adam.bodnar@wp.pl');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Patryk','Wojna','1991-01-23','Wisla','Kolumnowa 123/33','6033331291736272','patryk.wojna@buziaczek.pl');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Jolanta','Kwasniewska','1951-07-14','Warszawa','Nasturcjowa 22','3162379798041340','slodkajola@gmail.com');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Boguslawa','Wanders','1959-10-12','Wroclaw','Kolejowa 18/27','2402329038855372','bogusia_wanders@poczta.interia.pl');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Jan','Kowalski','1979-10-22','Krakow','Zamkowa 18/12','4589721024582516','poprostujanek@gmail.com');
insert into client(name,surname,date_of_birth,city,street_address,credit_card_number,email_address) values ('Zofia','Nowak','1989-03-12','Zakopane','Goralska 28','6524163832574980','zofia.nowak@capgemini.com');
insert into car_workers(cars_id,workers_id) values (6,9);
insert into car_workers(cars_id,workers_id) values (2,1);
insert into car_workers(cars_id,workers_id) values (2,2);
insert into car_workers(cars_id,workers_id) values (7,3);
insert into car_workers(cars_id,workers_id) values (3,4);
insert into car_workers(cars_id,workers_id) values (3,5);
insert into car_workers(cars_id,workers_id) values (1,5);
insert into car_workers(cars_id,workers_id) values (4,6);
insert into car_workers(cars_id,workers_id) values (4,7);
insert into car_workers(cars_id,workers_id) values (5,8);
insert into car_workers(cars_id,workers_id) values (5,8);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (1,6,'2017-10-12','2017-10-14',2,3);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (2,6,'2017-10-08','2017-10-09',2,1);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (3,3,'2017-09-12','2017-09-19',1,3);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (4,2,'2017-09-17','2017-09-25',1,1);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (5,7,'2017-10-17','2017-10-22',2,2);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (6,7,'2017-09-17','2017-09-21',2,3);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (7,3,'2017-10-24','2017-10-27',2,1);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (8,3,'2017-10-13','2017-10-14',2,2);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (9,1,'2017-10-12','2017-10-15',3,3);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (10,4,'2017-09-22','2017-09-25',3,1);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (2,6,'2017-10-02','2017-10-04',3,2);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (2,5,'2017-10-12','2017-10-16',3,1);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (3,5,'2017-10-11','2017-10-16',3,3);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (5,7,'2017-09-23','2017-09-28',3,3);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (6,1,'2017-09-23','2017-09-27',2,2);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (7,1,'2017-09-29','2017-10-01',2,1);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (8,4,'2017-09-29','2017-10-04',1,1);
insert into rent_details(CLIENT_ID,CAR_ID,rental_date,return_date,place_of_rent_id,place_of_return_id) values (7,3,'2017-10-29','2017-10-29',2,3); | true |
afc23d27baf8d5a799d03eab6e03a9d9be22ee5e | SQL | freddieb12345/MyEmployeeTracker | /data.sql | UTF-8 | 653 | 3.4375 | 3 | [
"MIT",
"LicenseRef-scancode-warranty-disclaimer"
] | permissive | USE employees_db; -- import the employees database
INSERT INTO department (name) -- Creates default values within the department table for the user to use
VALUES
('Finance'),
('Legal'),
('Audit'),
('Tech'),
('HR'),
('Security');
INSERT INTO role (title, salary, department_id) -- Creates default values for the roles table, assigning a standard salary and department_id to each role
VALUES
('Accountant', 50000, 1),
('Lawyer', 100000, 2),
('Team Manager', 70000, 3),
('Web Developer', 40000, 4),
('Intern', 18000, 5);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES
('Freddie', 'Brewin', 1, 123),
('Dan', 'James', 2, 456);
| true |
5b0dd815d75c4535baf79901360e690acd09c431 | SQL | abelderviche/electronicalh | /protected/migrations/dump.sql | UTF-8 | 4,208 | 3.046875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: electronicalh
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.28-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `products_categories`
--
DROP TABLE IF EXISTS `products_categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products_categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`enabled` tinyint(4) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products_categories`
--
LOCK TABLES `products_categories` WRITE;
/*!40000 ALTER TABLE `products_categories` DISABLE KEYS */;
INSERT INTO `products_categories` VALUES (1,'Cables',1),(2,'Audio',1),(3,'Computación',1),(4,'Video',1),(5,'Periféricos',1);
/*!40000 ALTER TABLE `products_categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products_offers`
--
DROP TABLE IF EXISTS `products_offers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products_offers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_category` int(11) DEFAULT NULL,
`name` varchar(45) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`price` double(10,2) DEFAULT NULL,
`image` varchar(100) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_category_idx` (`id_category`),
CONSTRAINT `fk_category` FOREIGN KEY (`id_category`) REFERENCES `products_categories` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT=' ';
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products_offers`
--
LOCK TABLES `products_offers` WRITE;
/*!40000 ALTER TABLE `products_offers` DISABLE KEYS */;
INSERT INTO `products_offers` VALUES (1,4,'asdasd','asdasdasd3333',1223.00,'69166_credicoop.png,89837_municipal.png'),(4,2,'test2','asdasd',22.00,'supervielle.png'),(5,3,'asd','descr',50.50,NULL);
/*!40000 ALTER TABLE `products_offers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(45) DEFAULT NULL,
`lastname` varchar(45) DEFAULT NULL,
`username` varchar(45) DEFAULT NULL,
`password` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'abel','derviche','aderviche','admin');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping events for database 'electronicalh'
--
--
-- Dumping routines for database 'electronicalh'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2018-06-11 12:50:57
| true |
89581d4f638459fef98675153cd7297e72f392c3 | SQL | IUIDSL/kgap_lincs-idg | /sql/drugcentral_pd_drugs.sql | UTF-8 | 534 | 3.703125 | 4 | [
"CC0-1.0"
] | permissive | SELECT DISTINCT
ids.identifier AS pubchem_cid,
s.id dc_struct_id,
s.name dc_name,
s.smiles,
s.inchikey,
atc.l1_code,
atc.l1_name
FROM
omop_relationship omop
JOIN
structures s ON omop.struct_id = s.id
JOIN
identifier ids ON ids.struct_id = s.id
JOIN
struct2atc s2atc ON s2atc.struct_id = s.id
JOIN
atc ON atc.code = s2atc.atc_code
WHERE
ids.id_type = 'PUBCHEM_CID'
AND atc.l1_name = 'NERVOUS SYSTEM'
AND omop.relationship_name = 'indication'
AND omop.concept_name ~* 'Parkinson'
ORDER BY
s.name
;
| true |
ccb59d886a007a795cbb827bef1cc70d05eb582f | SQL | tinaw25/Exercises | /Exercise_6/zalando.sql | UTF-8 | 3,772 | 3.125 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `zalando` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `zalando`;
-- MySQL dump 10.13 Distrib 5.6.17, for osx10.6 (i386)
--
-- Host: 127.0.0.1 Database: zalando
-- ------------------------------------------------------
-- Server version 5.6.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `customers`
--
DROP TABLE IF EXISTS `customers`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customers` (
`customer_id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(45) NOT NULL,
`password` varchar(45) NOT NULL,
`password_check` varchar(45) NOT NULL,
`title` varchar(8) NOT NULL,
`first_name` varchar(45) NOT NULL,
`last_name` varchar(45) NOT NULL,
`mobile` int(11) NOT NULL,
`find_us` varchar(80) NOT NULL,
`terms` tinyint(4) NOT NULL,
`email_list` tinyint(4) NOT NULL,
`title_new` varchar(8) NOT NULL,
`name_first` varchar(45) NOT NULL,
`name_last` varchar(45) NOT NULL,
`address_1` varchar(45) NOT NULL,
`address_2` varchar(45) NOT NULL,
`city` varchar(45) NOT NULL,
`zip_code` int(11) NOT NULL,
`country` varchar(45) NOT NULL,
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `customers`
--
LOCK TABLES `customers` WRITE;
/*!40000 ALTER TABLE `customers` DISABLE KEYS */;
/*!40000 ALTER TABLE `customers` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products`
--
DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `products` (
`product_id` int(11) NOT NULL AUTO_INCREMENT,
`product_name` varchar(80) NOT NULL,
`brand` varchar(45) NOT NULL,
`price` double NOT NULL,
`size` varchar(45) NOT NULL,
`picture` varchar(45) NOT NULL,
`description` text NOT NULL,
`delevery_time` varchar(45) NOT NULL,
`goods_number` int(11) NOT NULL,
`category` varchar(45) NOT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products`
--
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (1,'Esprit ','Esprit',129,'L','1.jpg','jhsdjhf shdjfhgs fgsjdgf gjsdgf js fgjsdgf jsdgfjs gfjsgfjs df sgfjsgf sjgfjsd f','2 dage',123456,'Langærmede T-shirt'),(2,'Mexx','Mexx',149,'S','2.jpg','dfsdf sdfkshf fhskdhf hksdhf hksdhf hkshf hfkshfk hfkshdf ksdfgfgh','1 dag',234689,'Langærmede T-shirt');
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2014-09-09 21:50:54
| true |
cfa5d649a03ba395fa04171c2d9c90786faeb266 | SQL | Vivek-Kamble/MySQL-Notes | /assignment_sql.sql | UTF-8 | 3,663 | 3.109375 | 3 | [] | no_license | use chetan
create table student_details
(
stud_id int primary key,stud_name varchar(50),stud_age varchar (50),stud_gen varchar (10), stud_address varchar(50),
stud_phone varchar(10), stud_mail varchar (50));
select * from student_details
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (1,'chetan',18,'male','ANDHERI',7208385802,'chetan18@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (2,'Vivek',18,'male','VIKROLI',9685469877,'vivek18@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (3,'Ashish',19,'male','Airoli',9376543211,'ashtg14@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (4,'prakash',17,'male','Parel',7208385802,'prakash17@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (5,'subodh',20,'male','kamothe',7387299051,'subo32@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (6,'jui',18,'female','juinagar',9665092565,'jui54@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (7,'rutuja',18,'female','Roha',7298756233,'rutu@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (8,'Amol',20,'male','uran',8889687455,'amol12@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (9,'pratik',18,'male','pawai',7208385802,'ppratk3@gmail.com' );
insert into student_details (stud_id,stud_name,stud_age,stud_gen,stud_address,stud_phone,stud_mail) values (10,'jagrit',19,'male','thane',7208385802,'jagrit21@gmail.com' );
create table marks_detail
( Marks_id int primary key,stud_marks int, stud_total int, stud_grade varchar(10),stud_Result varchar(50),
fk_stud_id int foreign key references student_details( stud_id));
select * from student_details
select * from marks_detail
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (1,500,650,'A','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (2,400,650,'A','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (3,450,650,'B','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (4,300,650,'C','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (5,550,650,'A','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (6,560,650,'A','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (7,200,650,'F','UNSUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (8,390,650,'D','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (9,560,650,'A','SUCCESSFUL');
insert into marks_detail (Marks_id,stud_marks,stud_total,stud_grade,stud_Result) values (10,200,650,'A','SUCCESSFUL');
create table employee_details
( emp_id int primary key, emp_name varchar(50),emp_gender varchar(50),emp_age int,emp_phono int,emp_mail varchar(50),emp_salary int);
insert into employee_details (emp_id,emp_name,emp_gender,emp_phono,emp_mail,emp_salary) values (1,
| true |
18b1051f6cdc9673636f3b13180d9d25b6f67f22 | SQL | damoklov/db-procedures-iot | /functions.sql | UTF-8 | 641 | 3.953125 | 4 | [] | no_license | USE `mydb`;
DROP FUNCTION IF EXISTS FindMaxStudentBirthDate;
DROP FUNCTION IF EXISTS FindCityOfEachStudent;
DELIMITER //
CREATE FUNCTION FindMaxStudentBirthDate()
RETURNS DATETIME
BEGIN
RETURN (SELECT MAX(`birth_date`) FROM `student`);
END //
DELIMITER ;
DELIMITER //
CREATE FUNCTION FindCityOfEachStudent(studentID INT)
RETURNS VARCHAR(45)
BEGIN
RETURN (SELECT name FROM `city` WHERE id = studentID);
END //
DELIMITER ;
SELECT id, first_name
FROM `student`
WHERE birth_date = FindMaxStudentBirthDate();
SELECT id, first_name, last_name, FindCityOfEachStudent(city_id) AS city FROM `student`;
SELECT MAX(`birth_date`) FROM `student`; | true |
4cf01f27701e36b12827c8ff36fc3586e1a1310d | SQL | wien-subs/recrutare | /SQL/user.sql | UTF-8 | 711 | 2.59375 | 3 | [
"WTFPL"
] | permissive | /*
#Wien-Subs Developer Team#
Source Server : local
Source Server Version : 100206
Source Host : localhost:3306
Source Database : recrutare
Target Server Type : MYSQL
Target Server Version : 100206
File Encoding : 65001
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` text NOT NULL,
`password` longtext NOT NULL,
`session` text DEFAULT NULL,
`mail` text NOT NULL,
`forgot` varchar(255) NOT NULL DEFAULT 'no',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
| true |
59f635276a08626a801b525619040b326c851e2f | SQL | BrambilasCodes/TrabalhosBD1_RicardoBrambila | /Trabalho03_BD1_RicardoBrambila/Trabalho03_Mysql_BD1_RicardoBrambila.sql | UTF-8 | 5,766 | 3.484375 | 3 | [] | no_license | CREATE TABLE Dia(
codigo int primary key AUTO_INCREMENT,
nome varchar(32) not null UNIQUE
);
CREATE TABLE HorarioFuncionamento(
abertura varchar(50) not null,
fechamento varchar(50) not null,
dia_cod int,
primary key (abertura, fechamento),
constraint dia_cod_fk foreign key(dia_cod) references Dia(codigo)
);
CREATE TABLE Estado(
codigo int primary key AUTO_INCREMENT,
nome varchar(64) not null UNIQUE
);
CREATE TABLE Cidade(
codigo int primary key AUTO_INCREMENT,
nome varchar(128),
estado_cod int not null,
constraint estado_cod_fk foreign key(estado_cod) references Estado(codigo)
);
CREATE TABLE Endereco(
codigo int primary key AUTO_INCREMENT,
cep int default 00000000,
rua varchar(64) not null,
cidade_cod int not null,
constraint cidade_cod_fk foreign key(cidade_cod) references Cidade(codigo)
);
CREATE TABLE Tipo_Comida(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE
);
CREATE TABLE Funcao(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE
);
CREATE TABLE Pessoa(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE,
telefone varchar(20),
identidade varchar(30),
nascimento varchar(10),
cpf varchar(30)
);
CREATE TABLE Estabelecimento(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE
);
CREATE TABLE Pais(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE
);
CREATE TABLE Cervejaria(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE
);
CREATE TABLE Ingrediente(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE
);
CREATE TABLE Estilo(
codigo int primary key AUTO_INCREMENT,
nome varchar(128) not null UNIQUE,
descricao varchar(1024)
);
CREATE TABLE Rotulo(
codigo int primary key AUTO_INCREMENT,
nome varchar(50) not null,
validade varchar(50),
temperatura_minima int,
temperatura_maxima int,
teor_alcoolico double,
estilo_cod int not null,
cervejaria_cod int not null,
pais_origem_cod int not null,
constraint estilo_cod_fk foreign key(estilo_cod) references Estilo(codigo),
constraint cervejaria_cod_fk foreign key(cervejaria_cod) references Cervejaria(codigo),
constraint pais_origem_cod_fk foreign key(pais_origem_cod) references Pais(codigo)
);
CREATE TABLE Rotulo_Ingrediente(
rotulo_codigo int,
ingrediente_cod int,
constraint ri_rotulo_codigo_fk foreign key(rotulo_codigo) references Rotulo(codigo),
constraint ri_ingrediente_cod_fk foreign key(ingrediente_cod) references Ingrediente(codigo),
constraint ri_rotulo_ingrediente_pk primary key (rotulo_codigo, ingrediente_cod)
);
CREATE TABLE Rotulo_Pais_Producao(
rotulo_codigo int,
pais_cod int,
constraint rpp_rotulo_codigo_fk foreign key(rotulo_codigo) references Rotulo(codigo),
constraint rpp_pais_cod_fk foreign key(pais_cod) references Pais(codigo),
constraint rpp_rotulo_pais_producao_pk primary key (rotulo_codigo, pais_cod)
);
CREATE TABLE Rotulo_Estabelecimento(
rotulo_codigo int,
estabelecimento_cod int,
constraint re_rotulo_codigo_fk foreign key (rotulo_codigo) references Rotulo(codigo),
constraint re_estabelecimento_cod_fk foreign key (estabelecimento_cod) references Estabelecimento(codigo),
constraint re_rotulo_estabelecimento_pk primary key (rotulo_codigo, estabelecimento_cod)
);
CREATE TABLE Propriedade(
estabelecimento_cod int,
pessoa_cod int,
constraint p_estabelecimento_cod_fk foreign key (estabelecimento_cod) references Estabelecimento(codigo),
constraint p_pessoa_cod_fk foreign key(pessoa_cod) references Pessoa(codigo),
constraint p_propriedade_pk primary key (estabelecimento_cod, pessoa_cod)
);
CREATE TABLE Pessoa_Funcao(
pessoa_cod int,
funcao_cod int,
constraint pf_pessoa_cod_fk foreign key(pessoa_cod) references Pessoa(codigo),
constraint pf_funcao_cod_fk foreign key(funcao_cod) references Funcao(codigo),
constraint pf_pessoa_funcao_pk primary key (pessoa_cod, funcao_cod)
);
CREATE TABLE Trabalha(
estabelecimento_cod int,
pessoa_cod int,
funcao_cod int,
constraint t_estabelecimento_cod_fk foreign key(estabelecimento_cod) references Estabelecimento(codigo),
constraint t_pessoa_cod_fk foreign key(pessoa_cod) references Pessoa(codigo),
constraint t_funcao_cod_fk foreign key(funcao_cod) references Funcao(codigo),
constraint t_trabalha_pk primary key (estabelecimento_cod, pessoa_cod, funcao_cod)
);
CREATE TABLE Estabelecimento_TipoComida(
estabelecimento_cod int,
tipo_comida_cod int,
constraint et_estabelecimento_cod_fk foreign key(estabelecimento_cod) references Estabelecimento(codigo),
constraint et_tipo_comida_cod_fk foreign key(tipo_comida_cod) references Tipo_Comida(codigo),
constraint et_estabelecimento_tipo_comida_pk primary key (estabelecimento_cod, tipo_comida_cod)
);
CREATE TABLE Estabelecimento_HorarioFuncionamento(
estabelecimento_cod int,
horariofuncionamento_abertura varchar(30),
horariofuncionamento_fechamento varchar(30),
constraint eh_estabelecimento_cod_fk foreign key(estabelecimento_cod) references Estabelecimento(codigo),
constraint eh_horariofuncionamento_fk foreign key(horariofuncionamento_abertura, horariofuncionamento_fechamento) references HorarioFuncionamento(abertura, fechamento),
constraint eh_estabelecimento_horario_funcionamento_pk primary key (estabelecimento_cod, horariofuncionamento_abertura, horariofuncionamento_fechamento)
);
CREATE TABLE Estabelecimento_Endereco(
estabelecimento_cod int,
endereco_cod int,
constraint ee_estabelecimento_cod_fk foreign key(estabelecimento_cod) references Estabelecimento(codigo),
constraint ee_endereco_cod_fk foreign key(endereco_cod) references Endereco(codigo),
constraint ee_estabelecimento_endereco_pk primary key (estabelecimento_cod, endereco_cod)
); | true |
033efced3472ac85023c85b6e21e51887d446090 | SQL | techtronics/upa | /Insidencias/reportes/nuevas/dae/agregar direcciones.sql | UTF-8 | 1,045 | 3.34375 | 3 | [] | no_license | select a.rut,a.dv,
c.dire_tcalle as direccion, c.dire_tnro as nro,
c.dire_tblock as depto, c.dire_tpoblacion as poblacion,
(select cast(max(comp_mdocumento) as numeric) from contratos a, compromisos b, alumnos c
where a.cont_ncorr=b.comp_ndocto
and a.matr_ncorr=c.matr_ncorr
and a.peri_ccod in (202,204,206)
and c.pers_ncorr=pe.pers_ncorr
and b.tcom_ccod=2
and emat_ccod not in (8,9)
--and c.ofer_ncorr=protic.ultima_oferta_matriculado(pe.pers_ncorr)
) as arancel_real_sis
From sd_agregar_direcciones_2 a, personas pe, direcciones c
where a.rut=pe.pers_nrut
and pe.pers_ncorr *= c.pers_ncorr
and c.tdir_ccod=1
select * from compromisos where comp_ndocto=41296
select * from sd_comentarios_abril_2007
select cast(rut as numeric) as rut,cast(comentario as varchar(8000)) as glosa,
convert(datetime,'04/04/2007',103) as fecha,pers_ncorr
from sd_comentarios_abril_2007 a, personas b
where a.rut=b.pers_nrut | true |
459837b9d7a614d066a3f98fa1a53486977df0fa | SQL | Ex-Soft/test | /sql/MSSQL/TestMasterDetail/dml.sql | UTF-8 | 1,033 | 3.78125 | 4 | [] | no_license | select
*
from
dbo.TestDetailWithNullableIdMaster [detail]
left join dbo.TestMaster [master] on [master].id = [detail].IdMaster;
select
*
from
dbo.TestMaster [master]
left join dbo.TestDetail [detail] on [detail].IdMaster = [master].Id
order by [master].Id, [detail].Val;
-- update dbo.TestDetail set IdMaster = 1 where id = 2;
-- update dbo.TestDetail set Val = N'' where id = 16;
-- update dbo.TestDetail set Val = null where id = 16;
;with cte
as
(
select
[master].Id,
[master].Val as MasterVal,
[detail].Val as DetailVal,
row_number() over (partition by [master].Id order by [detail].Id) as rn
from
TestMaster [master]
join TestDetail [detail] on [detail].IdMaster = [master].Id
)
select
*
from
cte
where
rn = 1;
select
[master].Id,
[master].Val as MasterVal,
[detail].Val as DetailVal
from
TestMaster [master]
cross apply
(
select top 1
Val
from
TestDetail [detail]
where
IdMaster = [master].Id
order by Id
) as [detail];
| true |
8159b419e9436748737ed3d8da0e05ee03b033d9 | SQL | ibasu/contact-points | /src/main/resources/db/migration/V1.0__ddl.sql | UTF-8 | 710 | 3.53125 | 4 | [] | no_license | CREATE TABLE CONTACT_POINTS_PHONE(
ID VARCHAR (255) NOT NULL PRIMARY KEY,
CUSTOMER_ID VARCHAR(255) NOT NULL,
CONTACT_NO_CODE VARCHAR (3) NOT NULL,
CONTACT_NO INTEGER(10) NOT NULL,
STATUS VARCHAR (50) NOT NULL,
REASON VARCHAR (100),
CREATION_TIME TIMESTAMP NOT NULL,
LAST_UPDATED_TIME TIMESTAMP,
USER_ID VARCHAR (20),
USER_NOTES VARCHAR (2000),
VERSION INTEGER NOT NULL,
UNIQUE KEY UNIQUE_CONTACT (CUSTOMER_ID, CONTACT_NO)
);
CREATE INDEX CONTACT_POINTS_PHONE_CUSTOMER_ID_IDX ON CONTACT_POINTS_PHONE (CUSTOMER_ID);
CREATE INDEX CONTACT_POINTS_PHONE_CONTACT_NO_IDX ON CONTACT_POINTS_PHONE (CONTACT_NO_CODE);
CREATE INDEX CONTACT_POINTS_PHONE_STATUS_IDX ON CONTACT_POINTS_PHONE (STATUS);
| true |
2353830698b985c10b2458d596c0fe8dd9623766 | SQL | Limingy1/17Java8 | /04 SQLServer2005基础/第6章 课程设计/上机作业/张聪/超市收银项目.sql | GB18030 | 5,172 | 3.8125 | 4 | [] | no_license | --Ʒ Category
create table Category(
Cid int primary key identity(1,1),
Cname nvarchar(20) unique not null,
Description nvarchar(25) null
)
--ƷϢ Ware
create table Ware(
Wid int primary key,
Wname nvarchar(30) unique not null,
Cid int not null foreign key references Category(Cid),
PurchasePrice decimal(10,2) not null,--
SalesPrice decimal(10,2) not null,--ۼ
Amount decimal(10,2) not null--
)
--Ա Employee
create table Employee(
Eid int primary key identity(1001,1),
Ename nvarchar(4) not null,
Epassword nvarchar(10) check(len(Epassword)>6),
Remark nvarchar(50)
)
--ۼ¼ Salesinfo
create table Salesinfo(
Sid int primary key identity(1,1),
Wid int foreign key references Ware(Wid) not null,
SalesDate datetime not null,
SalesAmount decimal(10,2) not null,
Eid int not null foreign key references Employee(Eid)
)
-- ƷCategory
insert into Category(cname,description) values('ʳƷ')
insert into Category(cname,description) values('ջ')
insert into Category(cname,description) values('װ')
insert into Category(cname,description) values('ҵ')
-- ƷϢ Ware
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61601','˧',1,'3.8','5','500')
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61602','ũȪȪˮ',1,'0.1','2','6000')
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61603','',2,'2.3','6','2333')
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61604','ưϴ¶',2,'10','18','2333')
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61605','adivas˶',3,'50','388','200')
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61606','HIKE˶Ь',3,'20','288','150')
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61607',' ',4,'100','258','100')
insert into Ware(Wid,Wname,Cid,PurchasePrice,SalesPrice,Amount)values('61608',' ľ ̻',4,'1500','3000','50')
-- Ա Employee
insert into Employee(Ename,Epassword)values('','1234567896')
insert into Employee(Ename,Epassword)values('Ϭ','1234567897')
insert into Employee(Ename,Epassword)values('Ƿ','1234567898')
insert into Employee(Ename,Epassword)values('','1234567899')
-- ۼ¼ Salesinfo
update Ware set Amount=Amount-1 where Wname=''
insert into Salesinfo(Wid,SalesDate,SalesAmount,Eid)values('61603','2017-12-03','1',1001)
update Ware set Amount=Amount-20 where Wname='ũȪȪˮ'
insert into Salesinfo(Wid,SalesDate,SalesAmount,Eid)values('61602','2017-12-19','1',1002)
--ѯ
select*from Category
select*from Ware
select*from Employee
select*from Salesinfo
--1.ѯÿƷıţƣƷӸߵ
select wid,Wname,SalesPrice-PurchasePrice as from ware order by desc
--2.ͳÿƷʾƷƼӸߵ
select Wname,sum(SalesAmount) as from Ware W,SalesInfo S where
W.wid=S.wid group by Wname order by sum(SalesAmount) desc
--3.ͳÿƷ,ʾƷ
select cname,sum(SalesAmount) as
from Category c,Ware w,SalesInfo s
where c.cid=w.cid and w.wid=s.wid
group by c.cname
--4.ͳÿƷĿǰӯܶ
select w.wname,sum(s.salesamount*(w.salesprice-w.purchaseprice))
from ware w,salesInfo s
where w.wid=s.wid group by w.wname
--5.Ա251Ʒ
update ware set amount=amount-5 where wid=61602
insert into salesInfo(Wid,eid,salesdate,salesamount) values(61602,1002,'2012-06-30',5)
--6.ܶԱ
select e.ename,sum((w.salesprice-w.purchaseprice)*s.salesamount) as ܶ
from employee e,salesInfo s,ware w where e.eid=s.eid and w.wid=s.wid
group by e.ename order by ܶ desc
--7.ѯƷǰƷƼ
select top 5 w.wname,sum(s.salesamount)
from ware w,salesInfo s where w.wid=s.wid
group by w.wname order by desc
--8.ͳ2017ƷǰƷƼ
select top 5 w.wname,sum(s.salesamount)
from ware w,salesInfo s where w.wid=s.wid and s.salesdate
between'2017-12-03'and '2017-12-19' group by w.wname
order by desc
--9.ͳÿԱ2017ʾԱƼ
select e.ename,sum(s.salesamount) from employee e,salesInfo s
where e.eid=s.eid and s.salesdate between'2017-12-03'and '2017-12-19'
group by e.ename order by desc
--10.ͳ2017
select sum((w.salesprice-w.purchaseprice)*s.salesamount)
from ware w,salesInfo s where w.wid=s.wid and s.salesdate
between'2017-12-03'and '2017-12-19'
| true |
532e3a73910489067afb7c4a91a9299a53af0e38 | SQL | sonkamuseva/air_ticket_generator | /air_ticket_generatorDUMP(step2).sql | UTF-8 | 27,524 | 3.0625 | 3 | [] | no_license | --
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.5
-- Dumped by pg_dump version 9.6.5
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: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_catalog;
--
-- Name: EXTENSION plpgsql; Type: COMMENT; Schema: -; Owner:
--
COMMENT ON EXTENSION plpgsql IS 'PL/pgSQL procedural language';
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: aiports_planes_relation; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE aiports_planes_relation (
airport_id integer NOT NULL,
plane_id integer NOT NULL
);
ALTER TABLE aiports_planes_relation OWNER TO postgres;
--
-- Name: airlines; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE airlines (
airline_id integer NOT NULL,
airline_name character varying(255) NOT NULL,
date_of_foundation date NOT NULL,
headquaters character varying(255) NOT NULL,
international boolean NOT NULL,
fleet_size integer NOT NULL,
number_of_destinations integer NOT NULL,
website character varying(255) NOT NULL
);
ALTER TABLE airlines OWNER TO postgres;
--
-- Name: airlines_airline_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE airlines_airline_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE airlines_airline_id_seq OWNER TO postgres;
--
-- Name: airlines_airline_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE airlines_airline_id_seq OWNED BY airlines.airline_id;
--
-- Name: airports; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE airports (
airport_id integer NOT NULL,
airport_name character varying(255) NOT NULL,
city character varying(255) NOT NULL,
address character varying(255) NOT NULL,
time_zone character varying(255) NOT NULL,
international boolean NOT NULL,
active boolean NOT NULL
);
ALTER TABLE airports OWNER TO postgres;
--
-- Name: airports_airlines_relation; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE airports_airlines_relation (
airport_id integer NOT NULL,
airline_id integer NOT NULL
);
ALTER TABLE airports_airlines_relation OWNER TO postgres;
--
-- Name: airports_airport_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE airports_airport_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE airports_airport_id_seq OWNER TO postgres;
--
-- Name: airports_airport_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE airports_airport_id_seq OWNED BY airports.airport_id;
--
-- Name: flights; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE flights (
flight_id integer NOT NULL,
flight_number character varying(255) NOT NULL,
date_of_flight date NOT NULL,
airline_id integer NOT NULL,
plane_id integer NOT NULL,
time_of_departure time with time zone NOT NULL,
time_of_arrival time with time zone NOT NULL,
departure_airport_id integer NOT NULL,
arrival_airport_id integer NOT NULL
);
ALTER TABLE flights OWNER TO postgres;
--
-- Name: flights_flight_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE flights_flight_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE flights_flight_id_seq OWNER TO postgres;
--
-- Name: flights_flight_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE flights_flight_id_seq OWNED BY flights.flight_id;
--
-- Name: planes; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE planes (
plane_id integer NOT NULL,
model character varying(255) NOT NULL,
count_of_places integer NOT NULL,
national_origin character varying(255) NOT NULL,
manufacturer character varying(255) NOT NULL,
first_flight date NOT NULL
);
ALTER TABLE planes OWNER TO postgres;
--
-- Name: planes_airlines_relation; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE planes_airlines_relation (
airline_id integer NOT NULL,
plane_id integer NOT NULL
);
ALTER TABLE planes_airlines_relation OWNER TO postgres;
--
-- Name: planes_plane_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE planes_plane_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE planes_plane_id_seq OWNER TO postgres;
--
-- Name: planes_plane_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE planes_plane_id_seq OWNED BY planes.plane_id;
--
-- Name: reservation; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE reservation (
reservation_id integer NOT NULL,
reservation_number character varying(255) NOT NULL,
reservation_date date NOT NULL,
customer character varying(255) NOT NULL,
number_of_tickets integer NOT NULL
);
ALTER TABLE reservation OWNER TO postgres;
--
-- Name: reservation_reservation_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE reservation_reservation_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE reservation_reservation_id_seq OWNER TO postgres;
--
-- Name: reservation_reservation_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE reservation_reservation_id_seq OWNED BY reservation.reservation_id;
--
-- Name: tickets; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE tickets (
ticket_id integer NOT NULL,
ticket_number integer NOT NULL,
passenger_name character varying(255) NOT NULL,
seat_number character varying(255) NOT NULL,
reservation_id integer NOT NULL,
flight_id integer NOT NULL,
possible_to_return boolean NOT NULL
);
ALTER TABLE tickets OWNER TO postgres;
--
-- Name: tickets_ticket_id_seq; Type: SEQUENCE; Schema: public; Owner: postgres
--
CREATE SEQUENCE tickets_ticket_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE tickets_ticket_id_seq OWNER TO postgres;
--
-- Name: tickets_ticket_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: postgres
--
ALTER SEQUENCE tickets_ticket_id_seq OWNED BY tickets.ticket_id;
--
-- Name: airlines airline_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airlines ALTER COLUMN airline_id SET DEFAULT nextval('airlines_airline_id_seq'::regclass);
--
-- Name: airports airport_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airports ALTER COLUMN airport_id SET DEFAULT nextval('airports_airport_id_seq'::regclass);
--
-- Name: flights flight_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY flights ALTER COLUMN flight_id SET DEFAULT nextval('flights_flight_id_seq'::regclass);
--
-- Name: planes plane_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY planes ALTER COLUMN plane_id SET DEFAULT nextval('planes_plane_id_seq'::regclass);
--
-- Name: reservation reservation_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY reservation ALTER COLUMN reservation_id SET DEFAULT nextval('reservation_reservation_id_seq'::regclass);
--
-- Name: tickets ticket_id; Type: DEFAULT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tickets ALTER COLUMN ticket_id SET DEFAULT nextval('tickets_ticket_id_seq'::regclass);
--
-- Data for Name: aiports_planes_relation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY aiports_planes_relation (airport_id, plane_id) FROM stdin;
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
1 10
1 11
1 12
1 13
1 14
1 15
1 16
1 17
1 18
1 19
1 20
1 21
1 22
1 23
1 24
1 25
1 26
1 27
1 28
1 29
1 30
1 31
1 32
1 33
1 34
1 35
1 36
1 37
1 38
2 1
2 2
2 3
2 4
2 5
2 6
2 7
2 8
2 9
2 10
2 11
2 12
2 13
2 14
2 15
2 16
2 17
2 18
2 19
2 20
2 21
2 22
2 23
2 24
2 25
2 26
2 27
2 28
2 29
2 30
2 31
2 32
2 33
2 34
2 35
2 36
2 37
2 38
3 1
3 2
3 3
3 4
3 5
3 6
3 7
3 8
3 9
3 10
3 11
3 12
3 13
3 14
3 15
3 16
3 17
3 18
3 19
3 20
3 21
3 22
3 23
3 24
3 25
3 26
3 27
3 28
3 29
3 30
3 31
3 32
3 33
3 34
3 35
3 36
3 37
3 38
4 1
4 2
4 3
4 4
4 5
4 6
4 7
4 8
4 9
4 10
4 11
4 12
4 13
4 14
4 15
4 16
4 17
4 18
4 19
4 20
4 21
4 22
4 23
4 24
4 25
4 26
4 27
4 28
4 29
4 30
4 31
4 32
4 33
4 34
4 35
4 36
4 37
4 38
5 1
5 2
5 3
5 4
5 5
5 6
5 7
5 8
5 9
5 10
5 11
5 12
5 13
5 14
5 15
5 16
5 17
5 18
5 19
5 20
5 21
5 22
5 23
5 24
5 25
5 26
5 27
5 28
5 29
5 30
5 31
5 32
5 33
5 34
5 35
5 36
5 37
5 38
6 1
6 2
6 3
6 4
6 5
6 6
6 7
6 8
6 9
6 10
6 11
6 12
6 13
6 14
6 15
6 16
6 17
6 18
6 19
6 20
6 21
6 22
6 23
6 24
6 25
6 26
6 27
6 28
6 29
6 30
6 31
6 32
6 33
6 34
6 35
6 36
6 37
6 38
7 1
7 2
7 3
7 4
7 5
7 6
7 7
7 8
7 9
7 10
7 11
7 12
7 13
7 14
7 15
7 16
7 17
7 18
7 19
7 20
7 21
7 22
7 23
7 24
7 25
7 26
7 27
7 28
7 29
7 30
7 31
7 32
7 33
7 34
7 35
7 36
7 37
7 38
8 1
8 2
8 3
8 4
8 6
8 8
8 10
8 11
8 12
8 13
8 14
8 15
8 16
8 17
8 18
8 19
8 21
8 22
8 23
8 28
8 32
8 33
8 34
9 1
9 2
9 3
9 4
9 5
9 6
9 7
9 8
9 9
9 10
9 11
9 12
9 13
9 14
9 15
9 16
9 17
9 18
9 19
9 20
9 21
9 22
9 23
9 24
9 25
9 26
9 27
9 28
9 29
9 30
9 31
9 32
9 33
9 34
9 35
9 36
9 37
9 38
10 1
10 2
10 3
10 4
10 6
10 8
10 9
10 10
10 11
10 12
10 13
10 14
10 15
10 16
10 17
10 18
10 21
10 22
10 28
10 32
10 33
10 34
11 1
11 2
11 3
11 4
11 5
11 6
11 7
11 8
11 9
11 10
11 11
11 12
11 13
11 14
11 15
11 16
11 17
11 18
11 19
11 20
11 21
11 22
11 23
11 24
11 25
11 26
11 27
11 28
11 29
11 30
11 31
11 32
11 33
11 34
11 35
11 36
11 37
11 38
12 1
12 2
12 6
12 7
12 8
12 10
12 11
12 12
12 13
12 14
12 17
12 18
12 19
12 20
12 21
12 22
12 23
12 24
12 25
12 26
12 28
12 29
12 32
12 33
12 34
13 1
13 2
13 6
13 8
13 11
13 12
13 13
13 14
13 21
13 22
13 26
13 29
13 32
13 33
13 34
14 1
14 2
14 3
14 4
14 6
14 8
14 10
14 11
14 12
14 13
14 14
14 17
14 18
14 21
14 22
14 24
14 26
14 28
14 29
14 32
14 33
14 34
15 1
15 2
15 6
15 7
15 8
15 11
15 12
15 13
15 14
15 15
15 16
15 17
15 18
15 19
15 20
15 21
15 22
15 24
15 25
15 28
15 29
16 1
16 2
16 6
16 12
16 13
16 21
16 22
16 24
16 26
16 29
16 32
16 33
16 34
17 1
17 2
17 6
17 11
17 12
17 13
17 14
17 17
17 18
17 21
17 22
19 1
19 2
19 6
19 7
19 8
19 11
19 12
19 13
19 14
19 15
19 16
19 17
19 18
19 19
19 20
19 21
19 22
19 24
19 25
19 28
19 29
20 1
20 2
20 6
20 11
20 12
20 13
20 14
20 17
20 18
20 21
20 22
\.
--
-- Data for Name: airlines; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY airlines (airline_id, airline_name, date_of_foundation, headquaters, international, fleet_size, number_of_destinations, website) FROM stdin;
1 Aeroflot 1923-02-09 Moscow, Russia t 214 129 www.aeroflot.ru
2 Transaero 1990-12-28 Moscow, Russia t 97 156 www.transaero.ru
3 S7 Airlines 1957-05-01 Ob, Novosibirsk Oblast, Russia t 76 146 www.s7.ru
4 Utair 1967-01-01 Khanty-Mansiysk, Russia t 65 72 www.utair.ru
5 Rossiya 1932-06-24 Saint Petersburg, Russia t 61 80 www.rossiya-airlines.com
6 Yamal 1997-01-01 Salekhard, Russia f 36 38 www.yamal.aero
7 Nordwind Airlines 2008-01-01 Moscow, Russia t 21 81 www.nordwindairlines.ru
8 I fly 2009-10-30 Moscow, Russia t 10 15 www.iflyltd.ru
9 Ural Airlines 1943-01-01 Yekaterinburg, Russia t 43 101 www.uralairlines.ru
10 NordStar Airlines 2008-12-17 Norilsk, Russia f 15 45 www.nordstar.su
11 Pobeda 2014-09-16 Moscow, Russia t 14 32 www.pobeda.aero
12 Yakutia 2002-01-01 Yakutsk, Russia t 17 40 www.yakutia.aero
13 Metrojet 1993-01-01 Kogalym, Russia t 6 16 www.metrojet.ru
14 Izhavia 1992-01-01 Izhevsk, Russia f 12 17 www.izhavia.su
15 Gazpromavia 1995-02-03 Moscow, Russia t 157 18 www.gazpromavia.ru
16 Nordavia 2004-01-01 Arkhangelsk, Russia f 9 21 www.Nordavia.ru
\.
--
-- Name: airlines_airline_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('airlines_airline_id_seq', 1, false);
--
-- Data for Name: airports; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY airports (airport_id, airport_name, city, address, time_zone, international, active) FROM stdin;
1 Pulkovo Saint-Petersburg Pulkovo highway, 41, 196140 UTC+3 t t
2 Sheremetyevo Moscow Khimki, 141400 UTC+3 t t
3 Vnukovo Moscow Vnukovo, 119027 UTC+3 t t
4 Domodedovo Moscow Domodedovo, 142015 UTC+3 t t
5 Koltsovo Yekaterinburg Bakhchivanjee street, 1, 620025 UTC+5 t t
6 Sochi Sochi Sochi, 354355 UTC+3 t t
7 Tolmachevo Novosibirsk Ob, 633104 UTC+7 t t
8 Pashkovsky Krasnodar Krasnodar, 350037 UTC+3 t t
9 Ufa Ufa Bulgakovo, 450501 UTC+5 t t
10 Kurumoch Samara Samara, 443901 UTC+4 t t
11 Simferopol Simferopol Malchenko street, 16, 95491 UTC+3 t t
12 Roshchino Tyumen Ilyushin street, 23, 625033 UTC+5 t t
13 Salekhard Salekhard Aviatsionnaya street, 22, 629004 UTC+5 f t
14 Tsentralny Omsk Transsibirskaya street, 28, 644103 UTC+6 t t
15 Balandino Chelyabinsk Balandino, 454133 UTC+5 t t
16 Kurgan Kurgan Gagarin street, 41d, 640015 UTC+5 f t
17 Platov Rostov-on-Don Rostov Oblast, 346713 UTC+3 t f
18 Maykop Maykop Promishlennaya street, 385006 UTC+3 f f
19 Mineralnye Vody Mineralnye Vody Mineralnye Vody, 357205 UTC+3 t t
20 Strigino Nizhny Novgorod Bezvodnaya street, 603069 UTC+3 t t
\.
--
-- Data for Name: airports_airlines_relation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY airports_airlines_relation (airport_id, airline_id) FROM stdin;
1 10
1 7
1 3
1 1
1 5
1 14
1 11
1 9
1 4
1 12
1 6
2 7
2 1
3 8
3 15
3 14
3 11
3 5
3 4
3 12
4 10
4 3
4 14
4 9
4 6
5 10
5 7
5 3
5 1
5 5
5 15
5 11
5 9
5 4
5 12
5 6
6 10
6 7
6 3
6 1
6 5
6 14
6 11
6 9
6 4
6 12
6 6
7 8
7 10
7 7
7 3
7 1
7 5
7 9
7 4
7 12
7 6
8 10
8 7
8 3
8 1
8 14
8 5
8 9
8 4
8 12
8 6
9 10
9 7
9 3
9 1
9 5
9 15
9 14
9 11
9 9
9 4
9 6
10 1
10 8
10 10
10 7
10 11
10 5
10 3
10 9
10 4
11 7
11 3
11 1
11 14
11 5
11 9
11 6
12 1
12 3
12 5
12 4
12 6
12 15
13 6
13 3
14 3
14 1
14 4
14 5
14 6
14 12
14 9
15 8
15 7
15 3
15 1
15 5
15 14
15 11
15 9
15 6
16 4
19 1
19 5
19 4
19 3
19 9
19 12
19 7
20 10
20 7
20 3
20 1
20 15
20 5
20 4
20 6
\.
--
-- Name: airports_airport_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('airports_airport_id_seq', 1, false);
--
-- Data for Name: flights; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY flights (flight_id, flight_number, date_of_flight, airline_id, plane_id, time_of_departure, time_of_arrival, departure_airport_id, arrival_airport_id) FROM stdin;
1 SU039 2017-11-02 1 1 18:45:00-03 20:00:00-03 1 2
2 S7126 2017-11-05 3 21 22:50:00-04 23:30:00-03 10 4
3 UT897 2017-11-27 4 12 06:50:00-05 07:50:00-03 16 3
4 U6210 2017-11-16 9 2 15:30:00-03 20:30:00-05 8 5
5 YC45 2017-11-15 6 26 18:30:00-05 20:05:00-05 13 12
6 O7355 2017-11-15 3 6 22:40:00-05 01:40:00-06 12 14
7 DP414 2017-11-09 11 6 06:45:00-05 07:15:00-03 15 3
8 N4187 2017-12-01 7 17 08:05:00-03 10:05:00-03 2 17
9 TR525 2017-11-17 2 13 10:30:00-07 12:05:00-03 7 11
10 Y71032 2017-12-22 10 29 17:00:00-03 19:25:00-05 6 4
11 KG5678 2017-12-24 13 2 19:35:00-03 22:45:00-03 19 1
12 IZ109 2017-01-01 14 32 10:50:00-03 15:35:00-05 6 9
13 SU6402 2017-11-30 5 21 06:15:00-05 07:10:00-03 5 1
14 5N6463 2017-11-11 16 13 21:35:00-03 01:40:00-05 4 9
15 GZ777 2017-11-07 15 36 15:10:00-03 18:20:00-03 20 6
\.
--
-- Name: flights_flight_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('flights_flight_id_seq', 45, true);
--
-- Data for Name: planes; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY planes (plane_id, model, count_of_places, national_origin, manufacturer, first_flight) FROM stdin;
1 Airbus A320-200 150 Multi-national Airbus 1987-02-22
2 Airbus A321-200 185 Multi-national Airbus 1996-03-01
3 Airbus A330-200 316 Multi-national Airbus 1992-11-02
4 Airbus A330-300 310 Multi-national Airbus 1992-11-02
5 Airbus A350-900 325 Multi-national Airbus 2013-06-14
6 Boeing 737-800 175 United States Boeing Commercial Airplanes 1997-02-09
7 Boeing 777-300ER 396 United States Boeing Commercial Airplanes 1994-06-12
8 Sukhoi Superjet 100 98 Russia Komsomolsk-on-Amur Aircraft Production Association 2008-05-19
9 Irkut MC-21 165 Russia United Aircraft Corporation 2017-05-28
10 Tu-214 180 Soviet Union Kazan Aircraft Production Association 1989-01-02
11 Boeing 737-300 145 United States Boeing Commercial Airplanes 1984-02-24
12 Boeing 737-400 163 United States Boeing Commercial Airplanes 1984-02-24
13 Boeing 737-500 127 United States Boeing Commercial Airplanes 1984-02-24
14 Boeing 737-700 148 United States Boeing Commercial Airplanes 1997-02-09
15 Boeing 747-400 416 United States Boeing Commercial Airplanes 1988-04-29
16 Boeing 747-8I 587 United States \nBoeing Commercial Airplanes 2011-03-20
17 Boeing 767-200ER 245 United States Boeing Commercial Airplanes 1981-09-26
18 Boeing 767-300ER 290 United States Boeing Commercial Airplanes 1981-09-26
19 Boeing 777-200 313 United States Boeing Commercial Airplanes 1994-06-12
20 Boeing 777-200ER 313 United States Boeing Commercial Airplanes 1994-06-12
21 Airbus A319-100 356 Multi-national Airbus 1987-02-22
22 Airbus A320neo 195 Multi-national Airbus 2014-09-25
23 Embraer E170 72 Brazil Embraer 2004-03-17
24 ATR 72-500 70 France/Italy ATR 1988-10-27
25 Boeing 777-300 396 United States Boeing Commercial Airplanes 1994-06-12
26 Bombardier CRJ200 50 Canada Bombardier Aerospace 1991-05-10
27 Let L-410 19 Czech Republic Let Kunovice 1969-04-16
28 Boeing 757-200 225 United States Boeing Commercial Airplanes 1982-02-19
29 ATR 42-500 48 France/Italy ATR 1984-08-16
30 Bombardier Q400 82 Canada Bombardier Aerospace 1983-06-20
31 Bombardier Q300 50 Canada Bombardier Aerospace 1983-06-20
32 An-24 50 Soviet Union Antonov 1959-10-29
33 Yak-42 104 Soviet Union Yakovlev 1975-03-07
34 Yak-40 32 Soviet Union Yakovlev 1966-10-21
35 Dassault Falcon 900 19 France Dassault Aviation 1984-09-21
36 Dassault Falcon 900EX EASy 19 France Dassault Aviation 1984-09-21
37 Dassault Falcon 900LX 19 France Dassault Aviation 1984-09-21
38 Dassault Falcon 7X 14 France Dassault Aviation 2005-05-05
\.
--
-- Data for Name: planes_airlines_relation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY planes_airlines_relation (airline_id, plane_id) FROM stdin;
1 1
1 2
1 3
1 4
1 5
1 6
1 7
1 8
1 9
2 10
2 2
2 6
2 11
2 12
2 13
2 14
2 15
2 16
2 17
2 18
2 19
2 20
2 25
3 21
3 1
3 2
3 22
3 6
3 23
4 24
4 12
4 13
4 6
4 17
5 21
5 1
5 6
5 15
5 19
5 25
6 1
6 2
6 12
6 26
6 27
6 8
7 2
7 3
7 6
7 18
7 20
7 7
8 3
8 4
8 28
9 21
9 1
9 2
10 29
10 11
10 6
11 6
12 28
12 6
12 30
12 31
12 8
12 32
13 2
13 1
14 32
14 33
15 34
15 8
15 35
15 36
15 37
15 38
15 14
16 13
\.
--
-- Name: planes_plane_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('planes_plane_id_seq', 1, false);
--
-- Data for Name: reservation; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY reservation (reservation_id, reservation_number, reservation_date, customer, number_of_tickets) FROM stdin;
1 852456719 2017-10-26 Maksimov Oleg Ivanovich 1
2 937524183 2017-10-24 Ivanov Maksim Olegovich 2
3 109387622 2017-10-19 Gagarin Nikolay Andreevich 2
4 993865254 2017-10-01 Baragoz Ilya Aleksandrovich 1
5 626738559 2017-10-06 Gordienko Sofya Alekseevna 1
6 987635577 2017-09-26 Marchenko Inna Vitalyevna 1
7 109735524 2017-10-11 Strazhko Anatoliy Igorevich 1
8 877365345 2017-09-18 Tsekhanovich Irina Sergeevna 2
9 309876256 2017-10-27 Chebikina Vlada Igorevna 1
10 465355144 2017-09-04 Valuev Valentin Mikhailovich 1
11 198765435 2017-09-13 Chubarov Dmitriy Vasilyevich 2
12 789653214 2017-09-30 Kovalenko Sofya Germanovna 1
13 234678543 2017-10-08 Kuznetsov Dmitriy Vladimirovich 1
14 236789322 2017-10-29 Rubanovich Artem Victorovich 2
15 259753146 2017-09-02 Kantorovich David Solomonovich 3
16 976367876 2017-08-17 Kopin Shamil Lvovich 1
17 989744322 2017-10-06 Zaitseva Sarah Abramovna 1
18 936621677 2017-10-15 Rozhnov Grigoriy Aleksandrovich 1
\.
--
-- Name: reservation_reservation_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('reservation_reservation_id_seq', 19, true);
--
-- Data for Name: tickets; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY tickets (ticket_id, ticket_number, passenger_name, seat_number, reservation_id, flight_id, possible_to_return) FROM stdin;
1 321 Maksimov Oleg Ivanovich 13A 1 10 f
2 342 Ivanov Maksim Olegovich 10D 2 11 t
3 343 Ivanova Alla Olegovna 10F 2 11 t
4 123 Gagarin Nikolay Andreevich 01B 3 8 t
5 124 Gagarina Anna Nikolaevna 01C 3 8 t
6 267 Baragoz Ilya Aleksandrovich 26B 4 15 t
7 556 Gordienko Sofya Alekseevna 12E 5 7 t
8 167 Marchenko Darya Aleksandrovna 03F 6 1 t
9 332 Strazhko Anatoliy Igorevich 08C 7 12 f
10 192 Tsekhanovich Irina Sergeevna 37D 8 4 t
11 193 Brigin Sergey Vadimovich 37E 8 4 t
12 418 Chebikina Vlada Igorevna 41A 9 3 f
13 1021 Valuev Valentin Mikhailovich 11B 10 5 t
14 911 Chubarov Dmitriy Vasilyevich 20F 11 6 f
15 912 Chubarov Gleb Vasilyevich 20E 11 6 f
16 111 Kovalenko Valentina Germanovna 31A 12 9 f
17 1992 Kuznetsov Dmitriy Vladimirovich 09C 13 13 t
18 1134 Rubanovich Artem Victorovich 15A 14 10 t
19 1135 Rubanovich Victor Nikolaevich 15B 14 10 t
20 777 Kantorovich David Solomonovich 02A 15 14 f
21 778 Kantorovich Iosif Davidovich 02B 15 14 f
22 779 Kantorovich Berta Iosifovna 03A 15 14 f
23 634 Kopin Shamil Lvovich 27C 16 2 t
24 511 Zaitseva Sarah Abramovna 32D 17 13 f
25 115 Rozhnov Grigoriy Aleksandrovich 33F 18 15 t
\.
--
-- Name: tickets_ticket_id_seq; Type: SEQUENCE SET; Schema: public; Owner: postgres
--
SELECT pg_catalog.setval('tickets_ticket_id_seq', 25, true);
--
-- Name: aiports_planes_relation aiports_planes_relation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY aiports_planes_relation
ADD CONSTRAINT aiports_planes_relation_pkey PRIMARY KEY (airport_id, plane_id);
--
-- Name: airlines airlines_airline_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airlines
ADD CONSTRAINT airlines_airline_name_key UNIQUE (airline_name);
--
-- Name: airlines airlines_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airlines
ADD CONSTRAINT airlines_pkey PRIMARY KEY (airline_id);
--
-- Name: airlines airlines_website_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airlines
ADD CONSTRAINT airlines_website_key UNIQUE (website);
--
-- Name: airports airports_address_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airports
ADD CONSTRAINT airports_address_key UNIQUE (address);
--
-- Name: airports_airlines_relation airports_airlines_relation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airports_airlines_relation
ADD CONSTRAINT airports_airlines_relation_pkey PRIMARY KEY (airport_id, airline_id);
--
-- Name: airports airports_airport_name_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airports
ADD CONSTRAINT airports_airport_name_key UNIQUE (airport_name);
--
-- Name: airports airports_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airports
ADD CONSTRAINT airports_pkey PRIMARY KEY (airport_id);
--
-- Name: flights flights_flight_number_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY flights
ADD CONSTRAINT flights_flight_number_key UNIQUE (flight_number);
--
-- Name: flights flights_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY flights
ADD CONSTRAINT flights_pkey PRIMARY KEY (flight_id);
--
-- Name: planes_airlines_relation planes_airlines_relation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY planes_airlines_relation
ADD CONSTRAINT planes_airlines_relation_pkey PRIMARY KEY (airline_id, plane_id);
--
-- Name: planes planes_model_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY planes
ADD CONSTRAINT planes_model_key UNIQUE (model);
--
-- Name: planes planes_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY planes
ADD CONSTRAINT planes_pkey PRIMARY KEY (plane_id);
--
-- Name: reservation reservation_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY reservation
ADD CONSTRAINT reservation_pkey PRIMARY KEY (reservation_id);
--
-- Name: reservation reservation_reservation_number_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY reservation
ADD CONSTRAINT reservation_reservation_number_key UNIQUE (reservation_number);
--
-- Name: tickets tickets_passenger_name_flight_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tickets
ADD CONSTRAINT tickets_passenger_name_flight_id_key UNIQUE (passenger_name, flight_id);
--
-- Name: tickets tickets_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tickets
ADD CONSTRAINT tickets_pkey PRIMARY KEY (ticket_id);
--
-- Name: tickets tickets_seat_number_flight_id_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tickets
ADD CONSTRAINT tickets_seat_number_flight_id_key UNIQUE (seat_number, flight_id);
--
-- Name: tickets tickets_ticket_number_key; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY tickets
ADD CONSTRAINT tickets_ticket_number_key UNIQUE (ticket_number);
--
-- Name: aiports_planes_relation aiports_planes_relation_airport_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY aiports_planes_relation
ADD CONSTRAINT aiports_planes_relation_airport_id_fkey FOREIGN KEY (airport_id) REFERENCES airports(airport_id);
--
-- Name: aiports_planes_relation aiports_planes_relation_plane_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY aiports_planes_relation
ADD CONSTRAINT aiports_planes_relation_plane_id_fkey FOREIGN KEY (plane_id) REFERENCES planes(plane_id);
--
-- Name: airports_airlines_relation airports_airlines_relation_airline_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airports_airlines_relation
ADD CONSTRAINT airports_airlines_relation_airline_id_fkey FOREIGN KEY (airline_id) REFERENCES airlines(airline_id);
--
-- Name: airports_airlines_relation airports_airlines_relation_airport_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY airports_airlines_relation
ADD CONSTRAINT airports_airlines_relation_airport_id_fkey FOREIGN KEY (airport_id) REFERENCES airports(airport_id);
--
-- Name: flights flights_airline_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY flights
ADD CONSTRAINT flights_airline_id_fkey FOREIGN KEY (airline_id) REFERENCES airlines(airline_id);
--
-- Name: flights flights_arrival_airport_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY flights
ADD CONSTRAINT flights_arrival_airport_id_fkey FOREIGN KEY (arrival_airport_id) REFERENCES airports(airport_id);
--
-- Name: flights flights_departure_airport_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY flights
ADD CONSTRAINT flights_departure_airport_id_fkey FOREIGN KEY (departure_airport_id) REFERENCES airports(airport_id);
--
-- Name: flights flights_plane_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY flights
ADD CONSTRAINT flights_plane_id_fkey FOREIGN KEY (plane_id) REFERENCES planes(plane_id);
--
-- Name: planes_airlines_relation planes_airlines_relation_airline_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY planes_airlines_relation
ADD CONSTRAINT planes_airlines_relation_airline_id_fkey FOREIGN KEY (airline_id) REFERENCES airlines(airline_id);
--
-- Name: planes_airlines_relation planes_airlines_relation_plane_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY planes_airlines_relation
ADD CONSTRAINT planes_airlines_relation_plane_id_fkey FOREIGN KEY (plane_id) REFERENCES planes(plane_id);
--
-- PostgreSQL database dump complete
--
| true |
d7e314e31d1bda607e599bb4cd90167573831262 | SQL | naveendhasarathan/eBatch | /eBatch/eBatch.Database/eBatch.Database/dbo/Stored Procedures/GetMenu.sql | UTF-8 | 527 | 3.625 | 4 | [] | no_license | create procedure GetMenu
(@UserId int)
as begin
select UserId,moduleId,moduleName from
(select UR.UserId ,RM.moduleId, cv.codevalue as moduleName, cv.sortorder
from tblUsers U
JOIN tblUser_role UR ON U.Id= UR.UserId
JOIN tblrolemodule RM ON UR.roleId=RM.roleId
JOIN tblCodeValue cv ON cv.Id= RM.moduleId
where u.Id = @UserId
UNION ALL
Select UserId, moduleId, cv.codevalue as moduleName,cv.sortorder from tblUser_module um
JOIN tblCodeValue cv ON cv.Id= um.moduleId
where um.UserId = @UserId) A
order by sortorder
end | true |
0de39e0e80507a81357ab9dbc932cf9d1b3b4d38 | SQL | chrto/server | /storage/sql/tables.sql | UTF-8 | 436 | 3.40625 | 3 | [] | no_license | -- SQLite
CREATE TABLE IF NOT EXISTS users (
`id` UUID PRIMARY KEY NOT NULL,
`first_name` VARCHAR(50) NOT NULL,
`last_name` VARCHAR(50) NOT NULL,
`email` VARCHAR(50) NOT NULL,
`active` TINYINT(1) NOT NULL DEFAULT 1,
`role` VARCHAR(10) NOT NULL DEFAULT 'User' check (role in ('Admin', 'User')),
`createdAt` DATETIME NOT NULL,
`updatedAt` DATETIME NOT NULL,
constraint uq_users_email UNIQUE (email)
);
| true |
d8eba9a4dd9b72bf82983b7f6c2625c65cb4bb75 | SQL | LangeHenrik/SDU-ITI-F19 | /latra16/Assignment1/src/config/migration.sql | UTF-8 | 2,591 | 3.5 | 4 | [] | no_license | -- Reset database
DROP DATABASE IF EXISTS latra16;
CREATE DATABASE latra16;
USE latra16;
-- Create tables
CREATE TABLE latra16.user (
user_id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) NOT NULL UNIQUE,
hashPassword VARCHAR(255) NOT NULL,
firstName VARCHAR(255) NOT NULL,
lastName VARCHAR(255) NOT NULL,
city VARCHAR(255),
zip INT NOT NULL,
email VARCHAR(255),
phone VARCHAR(255),
reg_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE latra16.photo (
photo_id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
caption VARCHAR(255) NOT NULL,
upload_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
uploader_id INT NOT NULL REFERENCES user(user_id),
photo_name VARCHAR(255) NOT NULL
);
-- Insert data
INSERT INTO latra16.user
(username, hashPassword, firstName, lastName, city, zip, email, phone)
VALUES
('lassetraberg', 'Lasse123!','Lasse', 'Traberg-Larsen', 'Odense', '5270', 'lasse@traberg-larsen.dk', '28499228');
INSERT INTO latra16.user
(username, hashPassword, firstName, lastName, city, zip, email, phone)
VALUES
('champagnepapi', 'Moet1743!','Aubrey', 'Graham', 'Toronto', '666', 'drizzydrake@ovo.com', '2025550189');
INSERT INTO latra16.photo
(title, caption, uploader_id, photo_name)
VALUES
('The Alps of Austria', 'This photo was taken on High179.', '1', '8908be87f4fe5858006d55799ca52e0859dd8587.jpg');
INSERT INTO latra16.photo
(title, caption, uploader_id, photo_name)
VALUES
('Trollstigen in Norway', 'An avalance made it impossible to continue.', '2', 'b1dc29f784c26e53ace590dc13a2ee706d1338fc.jpg');
INSERT INTO latra16.photo
(title, caption, uploader_id, photo_name)
VALUES
('Atlanterhavsveien', 'This road is said to be one of the most dangerous roads in the world!', '1', 'a6d02fad7e9c702f6cc72f5d4a53f25a5980f5f6.jpg');
INSERT INTO latra16.photo
(title, caption, uploader_id, photo_name)
VALUES
('Frozen Forests', 'The forests of the Alps are truly magical.', '2', 'db5981c136d341fb623ec4f7ab0db45cc487f0b5.jpg');
INSERT INTO latra16.photo
(title, caption, uploader_id, photo_name)
VALUES
('Top of the World', 'I am on the top of the world. Just as in my career.', '2', '4c378820fad5b8b7dcabde2baf92a1cf498bd51e.jpg');
INSERT INTO latra16.photo
(title, caption, uploader_id, photo_name)
VALUES
('The Danish Ocean', 'Exploring Denmark from the seaside!', '1', 'ac261c5d766ef99be9db1b850e3378035e832d75.jpg');
INSERT INTO latra16.photo
(title, caption, uploader_id, photo_name)
VALUES
('Island Hopping', 'On a catemaran in Croatia, everything is good!', '2', '6080a373ac834d8a16e4e073fb2362e644759105.jpg'); | true |
dac7ee4521affcc8f0aa10fe743c82b3767231ed | SQL | yKanazawa/aws_monthly_amount | /sql/tokyo_ec2_linux_spec.sql | UTF-8 | 848 | 3.03125 | 3 | [] | no_license | SELECT
SUBSTRING_INDEX(`Instance Type`, '.', 1) AS `Instance Index`
,`Instance Type`
,`Instance Family`
,`Current Generation`
,`vCPU`
,`Physical Processor`
,`Processor Architecture`
-- ,`Processor Features`
,`Clock Speed`
,`Memory`
,`Storage`
-- ,`Storage Media`
-- ,`Volume Type`
-- ,`Max Volume Size`
-- ,`Max IOPS/volume`
-- ,`Max IOPS Burst Performance`
-- ,`Max throughput/volume`
-- ,`Provisioned`
-- ,`EBS Optimized`
,`Dedicated EBS Throughput`
,`Network Performance`
,`Enhanced Networking Supported`
,`GPU`
FROM
ec2
WHERE
`Location` = 'Asia Pacific (Tokyo)'
AND `Operating System` = 'Linux'
AND `TermType` = 'OnDemand'
AND `Tenancy` = 'Shared'
ORDER BY
`Instance Index`
,`Current Generation`
,`PricePerUnit`
| true |
53c970c54a64015eb57d2be008aefa211eb61b2d | SQL | alexstanro/cubrid-testcases | /sql/_02_user_authorization/_02_authorization/_001_grant/cases/1028.sql | UTF-8 | 1,167 | 3.234375 | 3 | [
"BSD-3-Clause"
] | permissive | --+ holdcas on;
--Grant two users all privileges on superclass and subclass with keyword of except
CALL login('dba','') ON CLASS db_user;
CREATE CLASS DCL1 (id INTEGER);
CREATE CLASS DCL2 UNDER DCL1 (id INTEGER);
CREATE CLASS DCL3 UNDER DCL1 (id INTEGER);
CALL add_user('DCL_USER1','DCL1') ON CLASS db_user;
CALL add_user('DCL_USER2','DCL2') ON CLASS db_user;
GRANT ALL PRIVILEGES ON ALL DCL1 (EXCEPT DCL2) TO DCL_USER1, DCL_USER2;
CALL login('DCL_USER1','DCL1') ON CLASS db_user;
INSERT INTO DCL1(id) VALUES(1);
UPDATE DCL1 SET id=2 WHERE id=1;
SELECT id FROM DCL1;
DELETE FROM DCL1 WHERE id=1;
INSERT INTO DCL3(id) VALUES(1);
UPDATE DCL3 SET id=2 WHERE id=1;
SELECT id FROM DCL3;
DELETE FROM DCL3 WHERE id=1;
CALL login('DCL_USER2','DCL2') ON CLASS db_user;
INSERT INTO DCL1(id) VALUES(1);
UPDATE DCL1 SET id=2 WHERE id=1;
SELECT id FROM DCL1;
DELETE FROM DCL1 WHERE id=1;
INSERT INTO DCL3(id) VALUES(1);
UPDATE DCL3 SET id=2 WHERE id=1;
SELECT id FROM DCL3;
DELETE FROM DCL3 WHERE id=1;
CALL login('dba','') ON CLASS db_user;
CALL drop_user('DCL_USER1') ON CLASS db_user;
CALL drop_user('DCL_USER2') ON CLASS db_user;
DROP CLASS ALL DCL1;
--+ holdcas off;
| true |
6e53605dba9e2e21d88acd120e1491325a267bfd | SQL | yarden95c/DBProject | /sql_scripts/export_only_structure.sql | UTF-8 | 6,285 | 3.390625 | 3 | [] | no_license | CREATE DATABASE IF NOT EXISTS `facts_generator_final` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `facts_generator_final`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: music_fact_generator
-- ------------------------------------------------------
-- Server version 5.7.20-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `area`
--
DROP TABLE IF EXISTS `area`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `area` (
`id_area` int(11) NOT NULL,
`area_name` varchar(100) DEFAULT NULL,
`area_type` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id_area`),
KEY `area_name` (`area_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `artists`
--
DROP TABLE IF EXISTS `artists`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `artists` (
`id_artist` int(11) NOT NULL,
`artist_name` varchar(100) DEFAULT NULL,
`sort_name` varchar(100) DEFAULT NULL,
`begin_date_year` int(4) DEFAULT NULL,
`begin_date_month` int(2) DEFAULT NULL,
`begin_date_day` int(2) DEFAULT NULL,
`end_date_year` int(4) DEFAULT NULL,
`end_date_month` int(2) DEFAULT NULL,
`end_date_day` int(2) DEFAULT NULL,
`id_area` int(8) DEFAULT NULL,
`gender` varchar(45) DEFAULT NULL,
`type` varchar(45) DEFAULT NULL,
`comment` varchar(100) DEFAULT NULL,
`num_of_hits` decimal(32,0) DEFAULT NULL,
PRIMARY KEY (`id_artist`),
FOREIGN KEY (`id_area`) REFERENCES area(`id_area`),
KEY `artist_name` (`artist_name`),
KEY `year` (`begin_date_year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `genres`
--
DROP TABLE IF EXISTS `genres`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `genres` (
`id_genre` int(11) NOT NULL,
`genere_name` varchar(45) NOT NULL,
PRIMARY KEY (`id_genre`),
KEY `genere_name` (`genere_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `songs`
--
DROP TABLE IF EXISTS `songs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `songs` (
`release_date_year` int(11) DEFAULT NULL,
`id_song` varchar(45) NOT NULL,
`song_name` varchar(100) DEFAULT NULL,
`num_of_hits` bigint(21) DEFAULT '0',
PRIMARY KEY (`id_song`),
KEY `song_name` (`song_name`),
KEY `year` (`release_date_year`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id_user` int(11) NOT NULL AUTO_INCREMENT,
`first_name` text NOT NULL,
`last_name` text NOT NULL,
`email` text NOT NULL,
`password` text NOT NULL,
`id_area` int(11) NOT NULL,
`id_favorite_genre` int(11) NOT NULL,
`create_time` text,
`birthday_year` int(4) NOT NULL,
`birthday_month` int(2) NOT NULL,
`birthday_day` int(2) NOT NULL,
PRIMARY KEY (`id_user`),
FOREIGN KEY (`id_area`) REFERENCES area(`id_area`),
FOREIGN KEY (`id_favorite_genre`) REFERENCES genres(`id_genre`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `favoriteartistbyuser`
--
DROP TABLE IF EXISTS `favoriteartistbyuser`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `favoriteartistbyuser` (
`id_user` int(11) NOT NULL,
`id_artist` int(11) NOT NULL,
FOREIGN KEY (`id_artist`) REFERENCES artists(`id_artist`),
FOREIGN KEY (`id_user`) REFERENCES users(`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `favoritesongbyuser`
--
DROP TABLE IF EXISTS `favoritesongbyuser`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `favoritesongbyuser` (
`id_user` int(11) NOT NULL,
`id_song` varchar(45) NOT NULL,
FOREIGN KEY (`id_song`) REFERENCES songs(`id_song`),
FOREIGN KEY (`id_user`) REFERENCES users(`id_user`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `genresbyartist`
--
DROP TABLE IF EXISTS `genresbyartist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `genresbyartist` (
`id_artist` int(11) NOT NULL,
`id_genre` int(11) NOT NULL,
FOREIGN KEY (`id_artist`) REFERENCES artists(`id_artist`),
FOREIGN KEY (`id_genre`) REFERENCES genres(`id_genre`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `songsbyartist`
--
DROP TABLE IF EXISTS `songsbyartist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `songsbyartist` (
`id_artist` int(11) NOT NULL,
`id_song` varchar(45) NOT NULL,
FOREIGN KEY (`id_artist`) REFERENCES artists(`id_artist`),
FOREIGN KEY (`id_song`) REFERENCES songs(`id_song`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
-- Dump completed on 2018-01-16 22:13:09
| true |
6a439043fb50599968e3a43b556fcb2546a6c23e | SQL | VincentWangcf/Vendavo | /webquote3.0trunk/DB_Changes/Branches/V2.2/2.2.1/005updateTRIGGERAUDIT_QUOTE_ITEM.sql | UTF-8 | 2,014 | 3.109375 | 3 | [] | no_license | create or replace TRIGGER AUDIT_QUOTE_ITEM
BEFORE INSERT OR UPDATE OF QUOTED_MFR_ID,QUOTED_PART_NUMBER,QUOTE_NUMBER,COST,COST_INDICATOR,LEAD_TIME,MOQ,MOV,MPQ,PMOQ,QTY_INDICATOR,QUOTED_QTY,RESALE_INDICATOR,SHIPMENT_VALIDITY,STATUS,MIN_SELL_PRICE,NORM_SELL_PRICE,PRICE_VALIDITY,STAGE,FINAL_QUOTATION_PRICE,QUOTED_PRICE ON QUOTE_ITEM
FOR EACH ROW
BEGIN
IF (:new.PMOQ = '0+') AND :new.MOQ is not null THEN
:new.PMOQ := concat(:new.MOQ, '+');
END IF;
INSERT INTO AUDIT_QUOTE_ITEM VALUES
(
:new.QUOTE_NUMBER
,SYSDATE
,:old.STAGE
,:new.STAGE
,:old.STATUS
,:new.STATUS
,:old.QUOTED_MFR_ID
,:new.QUOTED_MFR_ID
,:old.QUOTED_PART_NUMBER
,:new.QUOTED_PART_NUMBER
,:old.QUOTED_QTY
,:new.QUOTED_QTY
,:old.PMOQ
,:new.PMOQ
,:old.QTY_INDICATOR
,:new.QTY_INDICATOR
,:old.COST_INDICATOR
,:new.COST_INDICATOR
,:old.COST
,:new.COST
,:old.LEAD_TIME
,:new.LEAD_TIME
,:old.MPQ
,:new.MPQ
,:old.MOQ
,:new.MOQ
,:old.MOV
,:new.MOV
,:old.PRICE_VALIDITY
,:new.PRICE_VALIDITY
,:old.SHIPMENT_VALIDITY
,:new.SHIPMENT_VALIDITY
,:new.LAST_UPDATED_BY
,:new.QUOTE_ID
,:new.ID
,:old.resale_indicator
,:new.resale_indicator
,(SELECT form_number FROM quote WHERE id = :new.QUOTE_ID)
,(SELECT biz_unit FROM quote WHERE id = :new.QUOTE_ID)
,:old.quoted_price
,:new.quoted_price
,NVL2(:old.QUOTED_MFR_ID, (SELECT name FROM manufacturer WHERE id = :old.QUOTED_MFR_ID), :old.QUOTED_MFR_ID)
,NVL2(:new.QUOTED_MFR_ID, (SELECT name FROM manufacturer WHERE id = :new.QUOTED_MFR_ID), :new.QUOTED_MFR_ID)
,NVL2(:new.LAST_UPDATED_BY, (SELECT name FROM app_user WHERE EMPLOYEE_ID = :new.LAST_UPDATED_BY), :new.LAST_UPDATED_BY)
,NVL2(:new.LAST_UPDATED_BY, (SELECT employee_id FROM app_user WHERE EMPLOYEE_ID = :new.LAST_UPDATED_BY), :new.LAST_UPDATED_BY)
);
END; | true |
01644ce94e3af21bcace40389e80f8f77bbde583 | SQL | oguzsoydemir/oguzsoydemir-online-customer-service | /DB-Schema.sql | UTF-8 | 846 | 3.375 | 3 | [] | no_license | use chat;
create table `ROOM` (
`socketID` varchar(30),
`roomID` char(38) not null,
`title` varchar(150),
`date` datetime,
`isAdmin` boolean,
`isActive` boolean
);
create table `USER`(
`userID` int not null AUTO_INCREMENT primary key,
`name` varchar(30) not null,
`surname` varchar(30) not null,
`email` varchar(50) not null
);
ALTER TABLE `USER` AUTO_INCREMENT = 1000;
create table `USER_SOCKET`(
`userID` int not null,
`socketID` varchar(30)
);
create table `ADMIN`(
`adminID` int not null AUTO_INCREMENT primary key,
`name` varchar(30),
`password` varchar(30)
);
create table `ADMIN_SOCKET`(
`adminID` int not null,
`socketID` varchar(30)
);
create table `MESSAGES`(
`messageID` int not null AUTO_INCREMENT primary key,
`message` varchar(5000) not null ,
`roomID` char(38) not null,
`senderSocketID` varchar(30),
`date` datetime
);
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.