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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
35b95fa9accf007a3cf1741912699a8da14d329e | SQL | ddtian38/bamazon | /bamazon.sql | UTF-8 | 802 | 3.078125 | 3 | [] | no_license | DROP TABLE IF EXISTS bamazonDB;
CREATE DATABASE bamazonDB;
USE bamazonDB;
CREATE TABLE products(
item_id INT AUTO_INCREMENT,
product_name VARCHAR(100) NOT NULL,
department_name VARCHAR(100) NOT NULL,
price DOUBLE(10,2) NOT NULL,
stock_quantity INT NOT NULL
);
INSERT INTO products
(product_name, department_name, price, stock_quantity)
VALUE
("ESV Study Bible", "Books", 30, 20 ),
("Apple Macbook", "Electronics", 1990, 100 ),
("Galaxy S9", "Electronics", 699.99, 20 ),
("House M.D.", "TV Shows", 50, 10 ),
("Mere Christianity", "Book", 12, 20 ),
("B-Alexa", "Electronics", 50, 100 ),
("Wilson NFL Super Grip", "Sports & Outdoors", 12, 1 ),
("Wilson Sporting Goods Vapor Baseball Bat", "Sports & Outdoors", 50, 0),
("2018 Tesla 3", "Vehicles", 47200, 2 ),
("Death Star Plans", "Book", 100, 1 ) | true |
56cb099bc66c9961ed90067f39c3c9cba0543084 | SQL | ManWithShotgun/l2i-JesusXD-3 | /static/gs/sql/server/class_list.sql | UTF-8 | 8,634 | 2.78125 | 3 | [] | no_license | /*
SQLyog Enterprise - MySQL GUI v7.15
MySQL - 5.0.27-community-nt : Database - l2it
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*Table structure for table `class_list` */
DROP TABLE IF EXISTS `class_list`;
CREATE TABLE `class_list` (
`class_name` varchar(20) NOT NULL default '',
`id` int(10) unsigned NOT NULL default '0',
`parent_id` int(11) NOT NULL default '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*Data for the table `class_list` */
LOCK TABLES `class_list` WRITE;
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Fighter',0,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Warrior',1,0);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Gladiator',2,1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Duelist',88,2);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Warlord',3,1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Dreadnought',89,3);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Knight',4,0);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Paladin',5,4);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_PhoenixKnight',90,5);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_DarkAvenger',6,4);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_HellKnight',91,6);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Rogue',7,0);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_TreasureHunter',8,7);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Adventurer',93,8);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Hawkeye',9,7);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Sagittarius',92,9);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Mage',10,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Wizard',11,10);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Sorceror',12,11);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Archmage',94,12);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Necromancer',13,11);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Soultaker',95,13);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Warlock',14,11);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_ArcanaLord',96,14);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Cleric',15,10);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Bishop',16,15);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Cardinal',97,16);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Prophet',17,15);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('H_Hierophant',98,17);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_Fighter',18,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_Knight',19,18);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_TempleKnight',20,19);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_EvaTemplar',99,20);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_SwordSinger',21,19);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_SwordMuse',100,21);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_Scout',22,18);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_PlainsWalker',23,22);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_WindRider',101,23);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_SilverRanger',24,22);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_MoonlightSentinel',102,24);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_Mage',25,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_Wizard',26,25);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_SpellSinger',27,26);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_MysticMuse',103,27);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_ElementalSummoner',28,26);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_ElementalMaster',104,28);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_Oracle',29,25);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_Elder',30,29);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('E_EvaSaint',105,30);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_Fighter',31,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_PaulusKnight',32,31);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_ShillienKnight',33,32);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_ShillienTemplar',106,33);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_BladeDancer',34,32);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_SpectralDancer',107,34);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_Assassin',35,31);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_AbyssWalker',36,35);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_GhostHunter',108,36);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_PhantomRanger',37,35);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_GhostSentinel',109,37);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_Mage',38,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_DarkWizard',39,38);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_Spellhowler',40,39);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_StormScreamer',110,40);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_PhantomSummoner',41,39);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_SpectralMaster',111,41);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_ShillienOracle',42,38);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_ShillienElder',43,42);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('DE_ShillienSaint',112,43);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Fighter',44,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Raider',45,44);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Destroyer',46,45);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Titan',113,46);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Monk',47,44);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Tyrant',48,47);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_GrandKhauatari',114,48);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Mage',49,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Shaman',50,49);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Overlord',51,50);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Dominator',115,51);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Warcryer',52,50);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('O_Doomcryer',116,52);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('D_Fighter',53,-1);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('D_Scavenger',54,53);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('D_BountyHunter',55,54);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('D_FortuneSeeker',117,55);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('D_Artisan',56,53);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('D_Warsmith',57,56);
insert into `class_list`(`class_name`,`id`,`parent_id`) values ('D_Maestro',118,57);
UNLOCK TABLES;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; | true |
0d84200ec1a128ec1313280a68c1a7243d776c34 | SQL | KiroKirilov/SoftUni | /ProfessionalModules/C#DBFundamentals/DatabasesBasics/Exam(TripService)/Exam(24.06.2018)/Bonus.sql | UTF-8 | 208 | 3.609375 | 4 | [] | no_license | --Problem 20 - Cancel Trip
CREATE TRIGGER tr_CancelDeleted
ON Trips
INSTEAD OF DELETE
AS
BEGIN
UPDATE Trips
SET CancelDate='2018-06-24'
WHERE CancelDate IS NULL
AND Id IN (SELECT Id
FROM deleted)
END | true |
195dc0ed8e2f1d57b5cff3992988355fcbb5c47a | SQL | VincentWei2021/hadoopsubmarine | /docs/database/submarine.sql | UTF-8 | 3,955 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | -- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses this file to You under the Apache License, Version 2.0
-- (the "License"); you may not use this file except in compliance with
-- the License. You may obtain a copy of the License at
-- http://www.apache.org/licenses/LICENSE-2.0
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
-- ----------------------------
-- Table structure for sys_user
-- ----------------------------
DROP TABLE IF EXISTS `sys_user`;
CREATE TABLE `sys_user` (
`id` varchar(32) NOT NULL COMMENT '主键id',
`name` varchar(100) default NULL COMMENT '真实姓名',
`username` varchar(100) default NULL COMMENT '登录账号',
`password` varchar(255) default NULL COMMENT '密码',
`avatar` varchar(255) default NULL COMMENT '头像',
`birthday` datetime default NULL COMMENT '生日',
`sex` int(1) default NULL COMMENT '性别(1:男, 2:女)',
`email` varchar(32) default NULL COMMENT '电子邮件',
`phone` varchar(32) default NULL COMMENT '电话',
`org_code` varchar(64) default NULL COMMENT '部门code',
`status` int(1) default NULL COMMENT '状态(1:正常 0:冻结)',
`deleted` int(1) default NULL COMMENT '删除状态(1,正常,0已删除)',
`lastLoginIp` varchar(32) default NULL COMMENT 'last login ip',
`lastLoginTime` datetime default NULL COMMENT 'last login time',
`create_by` varchar(32) default NULL COMMENT '创建人',
`create_time` datetime default NULL COMMENT '创建时间',
`update_by` varchar(32) default NULL COMMENT '更新人',
`update_time` datetime default NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `sys_user_name` USING BTREE (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='system user';
-- ----------------------------
-- Table structure for sys_dict
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict`;
CREATE TABLE `sys_dict` (
`id` varchar(32) NOT NULL,
`dict_code` varchar(100) default NULL COMMENT '字典编码',
`dict_name` varchar(100) default NULL COMMENT '字典名称',
`description` varchar(255) default NULL COMMENT '描述',
`deleted` int(1) default 0 COMMENT '删除状态(0正常,1已删除)',
`type` int(1) default 0 COMMENT '字典类型(0为string,1为number)',
`create_by` varchar(32) default NULL COMMENT '创建人',
`create_time` datetime default NULL COMMENT '创建时间',
`update_by` varchar(32) default NULL COMMENT '更新人',
`update_time` datetime default NULL COMMENT '更新时间',
PRIMARY KEY (`id`),
UNIQUE KEY `sys_dict_dict_code` USING BTREE (`dict_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Table structure for sys_dict_item
-- ----------------------------
DROP TABLE IF EXISTS `sys_dict_item`;
CREATE TABLE `sys_dict_item` (
`id` varchar(32) NOT NULL,
`dict_id` varchar(32) default NULL COMMENT '字典id',
`item_text` varchar(100) default NULL COMMENT '字典项文本',
`item_value` varchar(100) default NULL COMMENT '字典项值',
`description` varchar(255) default NULL COMMENT '描述',
`sort_order` int(3) default 0 COMMENT '排序',
`deleted` int(1) default 0 COMMENT '删除状态(0正常,1已删除)',
`create_by` varchar(32) default NULL,
`create_time` datetime default NULL,
`update_by` varchar(32) default NULL,
`update_time` datetime default NULL,
PRIMARY KEY (`id`),
CONSTRAINT `FK_SYS_DICT_ITEM_DICT_ID` FOREIGN KEY (`dict_id`) REFERENCES `sys_dict` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
| true |
3da13bdf51f7332ba070d7e722138a0b6b79c5fe | SQL | mf4lsb/Telkom-Kujang | /database/telkom_indonesia.sql | UTF-8 | 39,419 | 3.046875 | 3 | [
"LicenseRef-scancode-unknown-license-reference",
"MIT"
] | permissive | -- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 30, 2019 at 02:01 AM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.1.18
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: `telkom_indonesia`
--
-- --------------------------------------------------------
--
-- Table structure for table `tb_alpro`
--
CREATE TABLE `tb_alpro` (
`id_alpro` int(11) NOT NULL,
`sto_id` int(11) NOT NULL,
`nama` varchar(128) NOT NULL,
`cluster` varchar(10000) NOT NULL,
`alamat_odp` varchar(10000) NOT NULL,
`kelurahan` varchar(250) NOT NULL,
`odc_id` int(11) NOT NULL,
`nama_odp` varchar(250) NOT NULL,
`port_odp` int(11) NOT NULL,
`used_odp` int(11) NOT NULL,
`date_live` date NOT NULL,
`modul` varchar(128) NOT NULL,
`type` varchar(128) NOT NULL,
`power` varchar(128) NOT NULL,
`karakter_odp` varchar(10000) NOT NULL,
`competitor_id` varchar(250) NOT NULL,
`tikor` varchar(10000) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_alpro`
--
INSERT INTO `tb_alpro` (`id_alpro`, `sto_id`, `nama`, `cluster`, `alamat_odp`, `kelurahan`, `odc_id`, `nama_odp`, `port_odp`, `used_odp`, `date_live`, `modul`, `type`, `power`, `karakter_odp`, `competitor_id`, `tikor`) VALUES
(6, 5, '', '', '', '', 29, '03', 8, 3, '1970-01-01', '', '', '', '', '9', ''),
(8, 5, 'TES', 'BAYU NIRWANA', 'bogor nirwana residance', 'tes', 3, '03', 8, 8, '1970-01-01', '', 'Menengah-Atas', 'Tinggi', '', '1', '-6.605778,106.770028');
-- --------------------------------------------------------
--
-- Table structure for table `tb_competitor`
--
CREATE TABLE `tb_competitor` (
`id` int(11) NOT NULL,
`competitor` varchar(250) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_competitor`
--
INSERT INTO `tb_competitor` (`id`, `competitor`) VALUES
(1, 'First Media'),
(2, 'Biznet'),
(3, 'MyRepublic'),
(4, 'Transdata'),
(5, 'XLcom'),
(6, 'MNC'),
(7, 'Iconplus'),
(9, 'NONE');
-- --------------------------------------------------------
--
-- Table structure for table `tb_datel`
--
CREATE TABLE `tb_datel` (
`id` int(11) NOT NULL,
`nama_datel` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_datel`
--
INSERT INTO `tb_datel` (`id`, `nama_datel`) VALUES
(1, 'Kujang'),
(2, 'Cibinong'),
(3, 'Sentul'),
(4, 'Depok');
-- --------------------------------------------------------
--
-- Table structure for table `tb_odc`
--
CREATE TABLE `tb_odc` (
`id_odc` int(11) NOT NULL,
`sto_id` int(11) NOT NULL,
`kode_odc` varchar(250) NOT NULL,
`alamat` varchar(10000) NOT NULL,
`demands` int(11) NOT NULL,
`total_odp` int(11) NOT NULL,
`port` int(11) NOT NULL,
`used` int(11) NOT NULL,
`available` int(11) NOT NULL,
`rsv` int(11) NOT NULL,
`area` varchar(128) NOT NULL,
`karakter` varchar(10000) NOT NULL,
`tipe_rumah` varchar(128) NOT NULL,
`huni` varchar(128) NOT NULL,
`daya_beli` varchar(128) NOT NULL,
`tikor` varchar(1000) NOT NULL,
`img` varchar(255) NOT NULL DEFAULT 'default.jpg'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_odc`
--
INSERT INTO `tb_odc` (`id_odc`, `sto_id`, `kode_odc`, `alamat`, `demands`, `total_odp`, `port`, `used`, `available`, `rsv`, `area`, `karakter`, `tipe_rumah`, `huni`, `daya_beli`, `tikor`, `img`) VALUES
(2, 5, 'FAD', 'Perumahan Taman Yasmin Sektor 6, Jl. Pinang Perak 4', 20, 2, 32, 20, 3, 2, 'Cluster', 'ODC TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Sedang', '-6.555430,106.767487', 'default.jpg'),
(3, 5, 'FAE', 'Jl. Pahlawan', 837, 68, 704, 338, 364, 2, 'Scatter', 'Berada di seberang bank BRI, disekitarnya terdapat banyak toko-toko bangunan', 'Menengah', 'Tinggi', 'Sedang', '-6.616090,106.804430', 'FAE.PNG'),
(4, 5, 'FAH', 'Jl. Bogor Baru', 486, 19, 184, 158, 16, 4, 'Scatter', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Sedang', '-6.5918, 106.81189', 'default.jpg'),
(5, 5, 'FAL', 'Jl. Layungsari III', 1107, 90, 968, 293, 673, 2, 'Scatter', 'Berada dekat dengan pemukiman warga dan juga kantor pos', 'Menengah', 'Tinggi', 'Sedang', '-6.612313,106.800366', 'FAL.PNG'),
(6, 5, 'FAN', 'Jl. Kapten Yusuf', 0, 73, 920, 193, 721, 6, 'Scatter', 'Disekitarnya banyak ruko, terdapat perumahan Muara Asri di seberangnya', 'Menengah', 'Tinggi', 'Sedang', '-6.611342,106.792142', 'FAN.PNG'),
(7, 5, 'FBG', 'Perumahan Taman Yasmin, Jl. Wijaya Kusuma Raya', 759, 67, 616, 458, 125, 1, 'Cluster', 'ODC mencatu daerah cluster dan okupansi cukup besar (banyak yang sudah menggunakan Indihome).', 'Mewah', 'Tinggi', 'Tinggi', '-6.566767,106.771517', 'Screenshot_1.png'),
(8, 5, 'FAP', 'Komplek DPRD, Jl. Perkasa Komp. DPRD', 0, 6, 48, 44, 1, 0, 'Cluster', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Sedang', '-6.526293, 106.799408', 'default.jpg'),
(9, 5, 'FBH', 'Jl. Cilendek', 1363, 127, 1248, 498, 575, 3, 'Scatter', 'Disekitarnya terdapat banyak ruko ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.576303,106.772009', 'photo6181665808757926089.jpg'),
(10, 5, 'FAQ', 'Jl. Pulo Empang', 546, 46, 444, 67, 372, 5, 'Scatter', 'Terletak di pinggir jalan raya, disekitarnya terdapat pemukiman warga', 'Menengah', 'Tinggi', 'Rendah', '-6.606400,106.793236', 'FAQ.PNG'),
(11, 5, 'FAS', 'Jl. Ir. H. Juanda', 356, 94, 1032, 742, 285, 5, 'Scatter', 'Terletak di pinggir jalan raya, disekitarnya terdapat restoran dan banyak perkantoran', 'Menengah', 'Tinggi', 'Sedang', '-6.601097,106.795004', 'FAS.PNG'),
(12, 5, 'FBJ', 'Gg. Mesjid, Cilendek Timur', 759, 75, 912, 199, 698, 2, 'Cluster', 'terletak di bagian gerbang belakang cluster Bumi Menteng Asri,dan pemukiman warga diluar cluster', 'Mewah', 'Tinggi', 'Tinggi', '-6.575665,106.775466', 'photo6183975225557887136.jpg'),
(13, 5, 'FBK', 'Jl. Kelor Raya', 1671, 91, 944, 184, 760, 0, 'Scatter', 'Berada dikawasan padat penduduk.', 'Menengah', 'Tinggi', 'Sedang', '-6.578756,106.774066', 'photo6181665808757926090.jpg'),
(14, 5, 'FBL', 'Jl. Dr. Semeru', 150, 0, 0, 0, 0, 0, 'Scatter', 'ODC Terletak di pinggir jalan raya, namun terdapat cluster Dinas dan sebuah instansi.', 'Menengah', 'Tinggi', 'Rendah', '-6.577353,106.772856', 'photo6181311619984894247.jpg'),
(15, 5, 'FAT', 'Jalan Jembatan Merah', 1519, 15, 240, 41, 198, 1, 'Scatter', ' Suasana daerahnya ramai kendaraan, terdapat banyak toko-toko, dan ada sekolah.', 'Sederhana', 'Tinggi', 'Rendah', '-6.595631,106.786649', 'FAT.PNG'),
(16, 5, 'FBM', 'Jl. Manunggal', 466, 124, 1248, 312, 932, 4, 'Scatter', 'Berada dekat dengan kawasan penduduk dan banyak toko.', 'Menengah', 'Tinggi', 'Sedang', '-6.586442,106.783235', 'photo6181665808757926091.jpg'),
(17, 5, 'FAU', 'Jalan Jembatan Merah', 1519, 72, 728, 262, 464, 2, 'Scatter', 'Suasana daerahnya ramai kendaraan,terdapat banyak toko-toko dan ada sekolah.', 'Sederhana', 'Tinggi', 'Rendah', '-6.595631,106.786649', 'FAU.PNG'),
(18, 5, 'FAV', 'Jalan Jembatan Merah', 1513, 61, 744, 194, 548, 2, 'Scatter', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Sedang', '-6.595333,106.786687', 'FAV.PNG'),
(19, 5, 'FBN', 'Jl. Merdeka', 918, 95, 896, 373, 520, 3, 'Scatter', 'Berada di kawasan penduduk dan banyak toko disekitarnya.', 'Menengah', 'Tinggi', 'Sedang', '-6.588226,106.787844', 'Screenshot_2.png'),
(20, 5, 'FAW', 'Jl. Paledang', 763, 79, 640, 449, 184, 7, 'Scatter', 'TIDAK DITEMUKAN', 'Sederhana', 'Tinggi', 'Rendah', '-6.587864,106.788998', 'default.jpg'),
(21, 5, 'FBP', 'Perumahan Taman Yasmin Sektor 3, Jl. Culan Raya', 446, 115, 968, 276, 690, 2, 'Cluster', 'Disekitarnya banyak hunian namun tidak ramai.', 'Menengah', 'Tinggi', 'Sedang', '-6.561618,106.775012', 'default.jpg'),
(22, 5, 'FAX', 'Jl. Ciwaringin, Gg. Sukarna', 683, 79, 760, 285, 472, 3, 'Scatter', 'Disekitarnya terdapat banyak toko-toko dan ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.587864,106.788998', 'FAX.PNG'),
(23, 5, 'FBQ', 'Perumahan Taman Cimanggu, Jl. Taman Cimanggu Tengah', 1035, 138, 1104, 226, 834, 4, 'Cluster', 'ODC terletak dekat dengan sport area dan tempat ibadah,daerah juga berpotensi untuk penjualan', 'Menengah', 'Tinggi', 'Tinggi', '-6.562902,106.779115', 'photo6181665808757926092.jpg'),
(24, 5, 'FAY', 'Jl. Poras', 1757, 150, 1448, 671, 767, 10, 'Scatter', ' Suasana daerahnya ramai karena ada pemukiman warga, ruko dan sekolah.', 'Sederhana', 'Tinggi', 'Sedang', '-6.583016,106.769292', 'FAY.PNG'),
(25, 5, 'FBS', 'Jl. Taman Cimanggu Utara, Kedung Waringin', 1225, 104, 864, 401, 460, 3, 'Cluster', 'ODC mencatu cluster, dekat dengan puskesmas dan ada restoran', 'Menengah', 'Tinggi', 'Tinggi', '-6.561755,106.780447', 'Screenshot_11.png'),
(26, 5, 'FAZ', 'Jl. Meranti I', 0, 70, 696, 445, 247, 4, 'Scatter', 'Disekitarnya terdapat supermarket dan beberapa toko,ODC terletak di pinggir jalan raya', 'Menengah', 'Tinggi', 'Sedang', '-6.600424,106.779570', 'FAZ.PNG'),
(27, 5, 'FCF', 'Jl. Ks. Tubun', 612, 0, 0, 0, 0, 0, 'Scatter', 'ODC terletak berada di pinggir jalan dekat dengan kawasan pemukiman warga dan toko-toko.', 'Menengah', 'Tinggi', 'Sedang', '-6.564324,106.810324', 'fcf.PNG'),
(28, 5, 'FBT', 'Perumahan Cimanggu Center Point, Jl. Cimanggu Boulevard', 517, 107, 936, 279, 635, 4, 'Cluster', 'ODC mencatu cluster, dekat dengan supermarket', 'Menengah', 'Tinggi', 'Tinggi', '-6.565605,106.783040', 'Screenshot_3.png'),
(29, 5, 'FB', 'Jl.Tentara Pelajar 3, Gg. Mantri Guru', 564, 21, 168, 81, 85, 2, 'Scatter', 'DIsekitarnya terdapat toko-toko,dan diseberangnya ada SPBU, namun penamaan ODC keliru pada data yg diberi sebelumnya (awalnya fbu)', 'Menengah', 'Tinggi', 'Sedang', '-6.573767,106.788063', 'FB.PNG'),
(30, 5, 'FBU', 'Jl. Tentara Pelajar', 650, 68, 832, 241, 635, 4, 'Scatter', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Tinggi', '-6.573702,106.787963', 'default.jpg'),
(31, 5, 'FBB', 'Jl. Aria Surialaga', 0, 83, 944, 383, 556, 5, 'Scatter', 'ODC terletak di pinggir jalan raya, disekitarnya ada pemukiman warga', 'Menengah', 'Tinggi', 'Rendah', '-6.601176,106.780246', 'FBB.PNG'),
(32, 5, 'FBV', 'Jl. Tentara Pelajar', 1138, 87, 952, 264, 6685, 3, '', 'ODC terletak dekat dengan cluster yang banyak huniannya, dan terdapat gedung perkantoran.', 'Menengah', 'Tinggi', 'Sedang', '-6.575615,106.788000', 'photo6181607873944070418.jpg'),
(33, 5, 'FCG', 'Jl. Ceremai Ujung', 564, 0, 0, 0, 0, 0, 'Scatter', 'daerah pemukiman warga, dekat dengan perumahan My Residence, banyak huni', 'Menengah-Atas', 'Tinggi', 'Sedang', '-6.574103,106.805454', 'default.jpg'),
(34, 5, 'FBC', 'Jl. Raya Dramaga Bogor', 770, 57, 568, 203, 358, 7, 'Scatter', 'Terletak dekat pasar, kondisi disekitarnya ramai kendaraan', 'Sederhana', 'Tinggi', 'Rendah', '-6.594243,106.777902', 'FBC.PNG'),
(35, 5, 'FBW', 'Jl. Kb. Pedes 25-27, Kb. Pedes', 1694, 103, 1000, 375, 621, 4, 'Scatter', 'ODC terletak dekat kantor Kecamatan Sareal, terdapat banyak Sekolah Dasar, dan ruko.', 'Menengah', 'Tinggi', 'Sedang', '-6.568560,106.799703', 'photo6181311619984894248.jpg'),
(36, 5, 'FBD', 'Perumahan Taman Yasmin 5, Jl. Palem Putri 1', 2753, 151, 1680, 550, 973, 8, 'Cluster', 'ODC mencatu daerah perumahan Taman Yasmin dengan potensi penjualan yang bagus.', 'Mewah', 'Tinggi', 'Tinggi', '-6.560759,106.767103', 'FBD.PNG'),
(37, 5, 'FCH', 'Jl. Achmad Adnawijaya,Bantarjati', 1649, 0, 0, 0, 0, 0, 'Scatter', 'DIsekitarnya terdapat ruko-ruko,dan pemukiman warga', 'Menengah', 'Tinggi', 'Sedang', '-6.569452,106.811147', 'default.jpg'),
(38, 5, 'FBX', 'Jl. Merak', 1096, 129, 1192, 583, 604, 5, 'Scatter', 'Disekitarnya terdapat gedung perkantoran, toko-toko, banyak hunian.', 'Menengah', 'Tinggi', 'Sedang', '-6.573324,106.802111', 'photo6181607873944070419.jpg'),
(39, 5, 'FBE', 'Jl. Brigjen Saptadji Hadiprawira', 1671, 53, 576, 155, 338, 1, 'Scatter', 'ODC terletak dipinggir jalan dengan kondisi ramai disekitarnya ada toko-toko dan supermarket.', 'Menengah', 'Tinggi', 'Sedang', '-6.568965,106.766086', 'FBE.PNG'),
(40, 5, 'FBY', 'Jl. A. Yani', 1369, 78, 632, 220, 410, 2, 'Scatter', 'Disekitarnya ramai hunian karena terdapat gedung perkantoran, berada di pinggir jalan', 'Menengah', 'Tinggi', 'Sedang', '-6.573309,106.802267', 'photo6181665808757926093.jpg'),
(41, 5, 'FBZ', 'Jl. Re. Martadinata 9, Cibogor', 1207, 130, 1176, 404, 768, 4, 'Scatter', 'Terletak dekat Rel Kereta, disekitarnya merupakan daerah pemukiman warga dan ada toko bangunan', 'Menengah', 'Tinggi', 'Rendah', '-6.574793,106.793167', 'photo6181607873944070420.jpg'),
(42, 5, 'FBF', 'Perumahan Taman Yasmin, Jl. Wijaya Kusuma 2', 1082, 96, 832, 340, 351, 0, 'Cluster', 'ODC mencatu daerah cluster, dengan potensi cukup besar', 'Mewah', 'Tinggi', 'Tinggi', '-6.569616,106.768108', 'FBF.PNG'),
(43, 5, 'FC', 'Jl. Lawang Gintung', 215, 0, 0, 0, 0, 0, 'Scatter', 'ODC berada di pinggir jalan raya, dan digunakan sebagai tempat berjualan', 'Menengah', 'Tinggi', 'Sedang', '-6.620412, 106.814108', 'IMG20190702103055.jpg'),
(44, 5, 'FCJ', 'Perumahan Bantar Jati, Jl. Villa Bukit Raya', 2548, 0, 0, 0, 0, 0, 'Cluster', 'Terletak di depan SMA 7 Bogor, dekat cluster dan pemukiman warga.', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.578723, 106.814223', 'default.jpg'),
(45, 5, 'FCA', 'Jl. Jend. Sudirman', 790, 54, 456, 225, 196, 5, 'Scatter', 'Daerah ODC merupakan kawasan toko-toko dan suasananya sepi.', 'Menengah', 'Tinggi', 'Sedang', '-6.587339,106.797117', 'Screenshot_45.png'),
(46, 5, 'FCB', 'Jl. Jendral Sudirman, taman Peranginan', 539, 129, 1152, 1062, 83, 7, 'Scatter', 'Terletak di pinggir jalan raya, disekitarnya terdapat ruko-ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.587139,106.797040', 'photo6181311619984894249.jpg'),
(47, 5, 'FCC', 'Perumahan Sinbad Agung Residence, Jl. Desa Sukaramai', 0, 70, 560, 157, 398, 5, 'Cluster', 'ODC mencatu perumahan mewah dengan ramai huni potensi penjualan besar', 'Mewah', 'Tinggi', 'Tinggi', '-6.630494,106.819387', 'photo6181607873944070421.jpg'),
(48, 5, 'FCK', 'Perumahan Dalurung Raya, Jl. Dalurung Raya', 2964, 0, 0, 0, 0, 0, 'Cluster', '', 'Menengah', 'Tinggi', 'Tinggi', '-6.579755, 106.809142', 'default.jpg'),
(49, 5, 'FCD', 'Jl. Nasional 11, Kedung Badak', 1227, 50, 400, 287, 111, 2, 'Scatter', 'Disekitar ODC terdapat banyak restoran/cafe.', 'Menengah', 'Tinggi', 'Sedang', '-6.562438,106.795090', 'Screenshot_5.png'),
(50, 5, 'FCE', 'Gg. Mesjid, Jl. Sholeh Iskandar', 0, 95, 760, 249, 508, 3, 'Scatter', 'Disekitar ODC banyak pemukiman wwarga namun jarang dihuni.', 'Menengah', 'Tinggi', 'Rendah', '-6.561247,106.805051', 'photo6181607873944070422.jpg'),
(51, 5, 'FCL', 'Jl. Papandayan (samping kantor WITEL Pajajaran)', 1121, 0, 0, 0, 0, 0, 'Scatter', 'Kondisi dekat ODC banyak yang berjualan, terdapat perumahan dan beberapa gedung perkantoran.', 'Menengah', 'Tinggi', 'Tinggi', '-6.586982, 106.805415', 'FCL.PNG'),
(52, 5, 'FCM', 'Jl. Sempur Kaler', 418, 0, 0, 0, 0, 0, 'Cluster', 'ODC terletak strategis dekat dengan sekolah, tempat ibadah dan didalam cluster.', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.588834,106.799717', 'FCM.PNG'),
(53, 5, 'FCN', 'Perumahan Haji Kota Bogor, Jl. Tumenggung Wiradiredja', 2883, 0, 0, 0, 0, 0, 'Cluster', 'ODC mencatu perumahan kelas menengah, banyak hunian, suasana ramai, daya beli tinggi sehingga berpotensi untuk penjualan', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.589348,106.826568', 'default.jpg'),
(54, 5, 'FCP', 'Jl. Achmad Adnawijaya,Bantarjati', 2656, 0, 0, 0, 0, 0, 'Scatter', 'Disekitar ODC hanya terdapat banyak caffe dan ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.590969,106.816828', 'FCP.jpg'),
(55, 5, 'FCQ', 'Jl. Achmad Adnawijaya, Tanah Baru', 2363, 0, 0, 0, 0, 0, 'Scatter', 'Disekitar ODC hanya terdapat banyak caffe dan ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.591026,106.816797', 'FCQ.PNG'),
(56, 5, 'FCS', 'Perumahan Bogor Baru', 2471, 0, 0, 0, 0, 0, 'Cluster', 'ODC mencatu cluster dan disekitarnya terdapat supermarket, tempat-tempat makan dan banyak kost-kostan', 'Menengah', 'Tinggi', 'Tinggi', '-6.591709,106.810231', 'FCS.jpg'),
(57, 5, 'FCT', 'Jl. Lodaya 1,Babakan,Bogor Tengah', 691, 0, 0, 0, 0, 0, 'Scatter', 'terletak disamping Burger King dan terdapat gedung-gedung perkantoran', 'Menengah', 'Tinggi', 'Sedang', '-6.592209,106.804906', 'default.jpg'),
(58, 5, 'FCU', 'Jl. Raya Bogor-Sukabumi', 1343, 0, 0, 0, 0, 0, 'Scatter', 'terletak pinggir jalan raya, terdapat hotel dan beberapa toko', 'Menengah', 'Tinggi', 'Tinggi', '-6.607873,106.810021', 'default.jpg'),
(59, 5, 'FCV', 'Jl. Otto Iskandardinata, paledang', 344, 0, 0, 0, 0, 0, 'Scatter', 'Terletak di depan sekolah dasar dekat dengan tugu kujang,dan kebun raya bogor. ', 'Menengah', 'Tinggi', 'Tinggi', '-6.601648,106.804413', 'FCV.PNG'),
(60, 5, 'FCW', 'Perumahan Bogor Riverside, Blk. C', 451, 0, 0, 0, 0, 0, 'Cluster', 'terletak dalam cluster dan berpotensi.', 'Menengah', 'Tinggi', 'Tinggi', '-6.630289,106.828075', 'FCW_Odc.jpg'),
(61, 5, 'FCX', 'Perumahan Durian Raya, Jl. Cempedak Raya', 1516, 0, 0, 0, 0, 0, 'Cluster', 'ODC terletak pinggir jalan raya mencatu cluster, dan terdapat beberapa toko', 'Menengah', 'Tinggi', 'Sedang', '-6.618371, 106.819527', 'default.jpg'),
(62, 5, 'FCY', 'Perumahan Pajajaran Indah, Jl. Raya Pajajaran', 872, 0, 0, 0, 0, 0, 'Cluster', 'Terletak di pinggir jalan raya dan di depan SPBU', 'Mewah', 'Tinggi', 'Tinggi', '-6.612597,106.813156', 'default.jpg'),
(63, 5, 'FCZ', 'Perumahan Baranangsiang Indah, Arcadomas', 0, 0, 0, 0, 0, 0, 'Cluster', 'Terletak di dalam perumahan baranangsiang indah berpotensi untuk penjualan.', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.611168, 106.820988', 'FCZ.PNG'),
(64, 5, 'FDA', 'Perumahan Baranangsiang Indah, Jl. Baranangsiang Indah', 0, 0, 0, 0, 0, 0, 'Cluster', 'ODC terletak di belakang perumahan berpotensi untuk penjualan.', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.612685,106.828019', 'default.jpg'),
(65, 5, 'FDB', 'Jl. Raya Tajur', 1994, 0, 0, 0, 0, 0, 'Scatter', 'Posisi ODC terletak disamping pertigaan jalan, disekitarnya terdapat toko-toko dan supermarket.', 'Menengah', 'Tinggi', 'Sedang', '-6.637701,106.831117', 'default.jpg'),
(66, 5, 'FDC', 'Komplek Pakuan, Jl. Wijaya Kusuma Raya', 3412, 67, 568, 297, 268, 3, 'Cluster', 'Suasana di cluster ramai berpotensi untuk penjualan.', 'Mewah', 'Tinggi', 'Tinggi', '-6.630494,106.819387', 'default.jpg'),
(67, 5, 'FDE', 'Jl. Raya Pajajaran', 747, 59, 664, 433, 230, 1, 'Scatter', 'dekat tempat berjualan, terdapat beberapa gedung perkantoran, supermarket, dan toko-toko', 'Menengah', 'Tinggi', 'Tinggi', '-6.620902,106.816452', 'default.jpg'),
(68, 5, 'FDF', 'Jl. Siliwangi', 324, 39, 408, 178, 229, 1, 'Scatter', 'terletak di pinggir jalan raya, disekitarnya banyak yang berjualan dan terdapat beberapa toko.', 'Menengah', 'Tinggi', 'Sedang', '-6.617883,106.811929', 'default.jpg'),
(69, 5, 'FDG', 'Jl. Siliwangi', 649, 13, 120, 84, 35, 1, 'Scatter', 'Terletak dipinggir jalan raya, banyak yang berjualan dan terdapat beberapa toko, bersampingan dengan ODC FDF', 'Menengah', 'Tinggi', 'Sedang', '-6.617883,106.811929', 'default.jpg'),
(70, 5, 'FDH', 'Perumahan Budi Agung', 325, 20, 224, 72, 149, 3, 'Cluster', 'ODC terletak di dalam cluster namun belum dipasang, kondisi cluster ramai huni dan berpotensi untuk penjualan', 'Menengah', 'Tinggi', 'Tinggi', '-6.55625, 106.79161', 'default.jpg'),
(71, 5, 'FDJ', 'Jl. Lawang Gintung', 1360, 91, 960, 417, 538, 5, 'Scatter', 'Terletak di pinggir jalan raya,disekitarnya digunakan sebagai tempat untuk berjualan', 'Menengah', 'Tinggi', 'Sedang', '-6.620412, 106.814108', 'default.jpg'),
(72, 5, 'FDP', 'Komplek DPRD, Jl. Perkasa Komp. DPRD', 2799, 95, 864, 211, 647, 6, 'Cluster', 'ODC terletak di dalam cluster namun suasananya sepi jadi kurang berpotensi untuk melakukan penjualan ditempat ini.', 'Menengah', 'Tinggi', 'Sedang', '-6.633175,106.812895', 'FDP.PNG'),
(73, 5, 'FDK', 'Jl. Siliwangi', 1501, 105, 1200, 511, 687, 2, 'Scatter', 'Terletak di pinggir jalan raya, disekitarnya digunakan sebagai tempat untuk ibadah', 'Menengah', 'Tinggi', 'Sedang', '-6.612777,106.807412', 'FDK_Odc.jpg'),
(74, 5, 'FDL', 'Jl. Warung Bandrek, Gg. Aut No. 15', 839, 38, 352, 172, 178, 2, 'Scatter', 'Terletak di daerah pasar, Di sekitarnya terdapat banyak toko-toko.', 'Menengah', 'Tinggi', 'Sedang', '-6.610216,106.804279', 'default.jpg'),
(75, 5, 'FDQ', 'Komplek DPRD, Jl. Perkasa Komp. DPRD', 1284, 48, 528, 179, 345, 4, 'Cluster', 'ODC terletak di dalam cluster namun suasananya sepi jadi kurang berpotensi untuk melakukan penjualan ditempat ini.', 'Menengah', 'Tinggi', 'Sedang', '-6.633175,106.812895', 'FDQ.PNG'),
(76, 5, 'FDM', 'Jl.Otto Iskandardinata', 1375, 142, 1560, 954, 601, 5, 'Scatter', 'tedapat banyak toko-toko, pasar, pemukiman warga, terletak di pinggir jalan raya', 'Menengah', 'Tinggi', 'Sedang', '-6.603064,106.799318', 'default.jpg'),
(77, 5, 'FDS', 'Jl. Batutulis', 2029, 110, 1240, 620, 613, 7, 'Scatter', 'Terletak dipinggir jalan dengan suasana ramai kendaraan dan agak jauh dari pemukiman', 'Menengah', 'Tinggi', 'Sedang', '-6.618847, 106.806967', 'FDS.PNG'),
(78, 5, 'FDT', 'Jl. Batutulis', 891, 79, 816, 393, 422, 1, 'Scatter', 'Terletak dipinggir jalan dengan suasana ramai kendaraan dan agak jauh dari pemukiman. Bersebrangan dengan ODC-BOO-FDS', 'Menengah', 'Tinggi', 'Sedang', '-6.618931, 106.806896', 'FDT.PNG'),
(79, 5, 'FFA', 'Perumahan Danau Bogor Raya, Jl. Danau Bogor Raya', 465, 46, 392, 241, 142, 9, 'Cluster', 'dekat dengan sport club danau bogor raya dengan tipe perumahan mewah', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.598126,106.830025', 'FFA_Odc.jpg'),
(80, 5, 'FDU', 'Jl. Alun', 1013, 91, 1008, 348, 651, 9, 'Scatter', 'terdapat toko-toko berada di daerah pasar dengan daya beli sedang', 'Menengah', 'Tinggi', 'Sedang', '-6.607901,106.795181', 'FDU.PNG'),
(81, 5, 'FDV', 'Jl. Aria Surialaga', 0, 35, 472, 90, 379, 3, 'Scatter', 'pinggir jalan raya dekat dengan pemukiman warga', 'Menengah', 'Tinggi', 'Rendah', '-6.606929,106.788816', 'FDV.PNG'),
(82, 5, 'FDN', 'Jl. Pahlawan', 2468, 145, 1608, 1005, 590, 13, 'Scatter', 'terletak dipinggir jalan raya,disekitarnya banyak supermarket dan ruko-ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.609303,106.797562', 'default.jpg'),
(83, 5, 'FEA', 'Jl. Malabar 1', 713, 2, 16, 12, 0, 4, 'Scatter', 'terdapat gedung perkantoran, sekolah dan supermarket, suasana ramai, daya beli sedang', 'Menengah', 'Tinggi', 'Rendah', '-6.595082,106.805988', 'FEA.PNG'),
(84, 5, 'FEB', 'Bogor Raya Residence, Jl. Pangeran Sangjang', 0, 28, 224, 40, 183, 1, 'Cluster', 'perumahan kelas menengah-atas, banyak hunian, suasana ramai, daya beli tinggi', 'Sederhana', 'Tinggi', 'Tinggi', '-6.587522,106.833283', 'FEB.PNG'),
(85, 5, 'FFB', 'berada di pinggir jalan raya lokasi dekat dengan perempatan lampu merah dan terdapat ruko', 465, 32, 256, 161, 94, 1, '', 'berada di pinggir jalan raya lokasi dekat dengan perempatan lampu merah dan terdapat ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.581011, 106.806866', 'WhatsApp_Image_2019-07-26_at_14_42_41.jpg'),
(86, 5, 'FEC', 'Perumahan Giraha Pajajaran, Jl. Raya Parung Banteng', 0, 30, 240, 138, 96, 6, 'Cluster', 'berada di pinggir jalan dekat dengan toko bangunan berada di ketinggian yang berbeda dengan jalan', 'Menengah', 'Sedang', 'Sedang', '-6.619516,106.832406', 'FEC.PNG'),
(87, 5, 'FG', 'Perumahan Taman Seruni, Jl. Taman Seruni Raya', 1670, 31, 368, 178, 164, 6, 'Cluster', 'di dalam perumahan dengan tipe perumahan menengah keatas, dekat dengan pos satpam taman seruni', 'Menengah', 'Tinggi', 'Sedang', '-6.574014,106.823710', 'WhatsApp_Image_2019-07-26_at_14_48_57.jpg'),
(88, 5, 'FEE', 'Perumahan Griya Bogor Raya, Jl. Venus', 628, 57, 500, 218, 278, 4, 'Cluster', 'dekat dengan pos satpam berada di dalam perumahan kelas menengah yang memiliki banyak hunian', 'Menengah', 'Tinggi', 'Sedang', '-6.617382,106.825203', 'FEE.PNG'),
(89, 5, 'FEF', 'Perumahan Pajajaran Regency, Jl. Pajajaran Regency Raya', 0, 31, 248, 89, 157, 2, 'Cluster', 'berada di dalam perumahan kelas menengah-atas yang memiliki banyak hunian', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.611757, 106.826871', 'FEF.PNG'),
(90, 5, 'FEG', 'Jl. Lawang Gintung', 839, 11, 96, 75, 19, 2, 'Scatter', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Sedang', '-6.620375,106.814177', 'default.jpg'),
(91, 5, 'FEJ', 'Perumahan Taman Yasmin Sektor 7, Jl. Bambu Raya', 0, 74, 592, 380, 210, 2, 'Cluster', 'berada di dalam perumahan kelas menengah-atas dengan kemungkinan daya beli tinggi dan banyak rumah yang sudah di huni', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.571523,106.778466', 'default.jpg'),
(92, 5, 'FEK', 'Pasar Anyar, Jl. Sawo Jajar', 1061, 8, 64, 51, 13, 0, 'Scatter', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Rendah', '-6.58863, 106.7942', 'default.jpg'),
(93, 5, 'FGD', 'Perumahan Bogor Nirwana Residence', 0, 44, 424, 137, 279, 8, 'Cluster', 'TIDAK DITEMUKAN', 'Mewah', 'Tinggi', 'Tinggi', '-6.621037,106.796850', 'default.jpg'),
(94, 5, 'FEL', 'Perumahan Bogor Nirwana Residence', 0, 88, 704, 238, 459, 7, 'Cluster', 'di dalam perumahan BNR tepatnya di cluster Arga Padma Nirwana yang memiliki tipe perumahan mewah', 'Mewah', 'Tinggi', 'Tinggi', '-6.630057,106.795008', 'FEL.PNG'),
(95, 5, 'FEM', 'Perumahan Bogor Nirwana Residence, Jalan Pabuaran Lendeh', 0, 29, 232, 50, 182, 0, 'Cluster', 'di dalam perumahan BNR tepatnya di cluster The Fusion yang memiliki tipe perumahan mewah', 'Mewah', 'Tinggi', 'Tinggi', '-6.637240,106.796374', 'FEM.PNG'),
(96, 5, 'FEN', 'Perumahan Bogor Nirwana Residence', 0, 55, 464, 150, 311, 3, 'Cluster', 'di dalam perumahan BNR tepatnya di cluster Nirwana yang memiliki tipe perumahan mewah', 'Mewah', 'Tinggi', 'Tinggi', '-6.628495,106.797033', 'FEN.PNG'),
(97, 5, 'FEQ', 'Villa Duta, Jl. Mustika', 337, 32, 256, 183, 70, 3, 'Cluster', 'di dalam perumahan Villa Duta dengan tipe perumahan mewah', 'Mewah', 'Tinggi', 'Tinggi', '-6.607259,106.815618', 'FEQ.PNG'),
(98, 5, 'FH', 'Jl. A. Yani', 382, 12, 96, 59, 36, 1, 'Scatter', 'terdapat gedung perkantoran lokasi berada di pinggir jalan dekat dengan ODC-BOO-FBY dan FBX', 'Menengah', 'Tinggi', 'Sedang', '-6.573309,106.802267', 'fh-min.JPG'),
(99, 5, 'FES', 'Villa Duta, Jl. Permata', 1689, 48, 488, 303, 183, 2, 'Cluster', 'di dalam perumahan Villa Duta dengan tipe perumahan mewah', 'Mewah', 'Tinggi', 'Tinggi', '-6.605324,106.816391', 'FES.PNG'),
(100, 5, 'FET', 'Jl. A. Yani', 430, 19, 152, 68, 84, 0, 'Scatter', 'TIDAK DITEMUKAN', 'Sederhana', 'Tinggi', 'Sedang', '-6.57795, 106.7988', 'default.jpg'),
(101, 5, 'FEW', 'Apartment Zarindah Mansion, Jl. Bangbarung Raya', 667, 9, 88, 23, 65, 0, 'Cluster', 'ODC berada di dalam apartment ', 'Mewah', 'Tinggi', 'Tinggi', '-6.584265, 106.815157', 'FEW.PNG'),
(102, 5, 'FZ', 'Perumahan Pakuan 2,', 1367, 31, 496, 83, 412, 0, 'Cluster', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Sedang', '-6.630481,106.820969', 'default.jpg'),
(103, 5, 'FJ', 'Nusa Indah Regency, Jl. Pangeran Sogiri', 786, 16, 152, 71, 71, 10, 'Cluster', 'di depan perumahan nusa indah dengan tipe perumahan menengah keatas', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.573585,106.822330', 'WhatsApp_Image_2019-07-26_at_15_52_25.jpg'),
(104, 5, 'FY', 'Jl. Raya Bogor-Sukabumi', 1432, 4, 36, 14, 22, 0, 'Scatter', 'TIDAK DITEMUKAN', 'Menengah', 'Tinggi', 'Sedang', '-6.601698,106.804668', 'default.jpg'),
(105, 5, 'FJA', 'Perumahan Bogor Nirwana Residence, Jl. Bogor Nirwana Residence', 0, 9, 72, 19, 53, 0, 'Cluster', 'dekat pintu masuk gerbang utama BNR dekat cluster Invinite Residence dengan tipe perumahan mewah', 'Mewah', 'Tinggi', 'Tinggi', '-6.617925,106.798260', 'fja.jpg'),
(106, 5, 'FX', 'Jl. Achmad Sobana', 380, 8, 64, 50, 14, 0, 'Scatter', 'berada di pinggir jalan raya lokasi dekat dengan perempatan lampu merah dan terdapat ruko', 'Menengah', 'Tinggi', 'Sedang', '-6.580825, 106.807113', 'FX.PNG'),
(107, 5, 'FJB', 'Perumahan Bogor Nirwana Residence', 0, 26, 208, 112, 95, 1, 'Cluster', 'di dalam perumahan BNR dengan tipe perumahan mewah', 'Mewah', 'Tinggi', 'Tinggi', '-6.623086,106.798033', 'fjb.jpg'),
(108, 5, 'FW', 'Jl. Papandayan (samping kantor WITEL Pajajaran)', 1121, 27, 296, 199, 22, 70, 'Scatter', 'di sekitarnya banyak yang berjualan terdapat perumahan dan beberapa gedung perkantoran', 'Mewah', 'Tinggi', 'Tinggi', '-6.586996, 106.805419', 'FW.PNG'),
(109, 5, 'FJC', 'Perumahan Bogor Nirwana Residence', 0, 19, 152, 81, 68, 3, 'Cluster', 'di dalam perumahan BNR dengan tipe perumahan mewah berada di pinggir jalan', 'Mewah', 'Tinggi', 'Tinggi', '-6.621037,106.796850', 'fjc.jpg'),
(110, 5, 'FV', 'Perumahan Indraprasta Townhouse, Jl. Gatot Kaca Raya', 500, 5, 40, 25, 13, 0, 'Cluster', 'perumahan kelas menengah-atas (town house) (ODC ada namun tidak ada nama)', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.567542,106.811735', 'FV.PNG'),
(111, 5, 'FK', 'Jl. Achmad Adnawijaya,Bantarjati', 700, 13, 112, 52, 33, 0, 'Scatter', 'Di sekitarnya terdapat ruko-ruko, dan pemukiman warga', 'Menengah', 'Tinggi', 'Sedang', '-6.569653,106.811112', 'FK.jpg'),
(112, 5, 'FU', 'Perumahan Villa Tajur, Jl. Satriamaya', 0, 32, 256, 112, 119, 5, 'Cluster', 'kondisi cluster ramai penghuni sehingga memungkinkan untuk melakukan penjualan', 'Mewah', 'Tinggi', 'Tinggi', '-6.635973,106.835223', 'FU.PNG'),
(113, 5, 'FL', 'Perumahan Cimanggu Hejo, Jl. Perikanan Darat', 650, 20, 168, 85, 83, 0, 'Cluster', 'terdapat di dalam perumahan Cimanggu Hejo dekat gerbang utama pojok kiri', 'Menengah', 'Tinggi', 'Sedang', '-6.569777,106.784611', 'FL.jpg'),
(114, 5, 'FM', 'Perumahan Danau Bogor Raya, Jl. Golf Estate Bogor Raya', 0, 45, 360, 169, 182, 9, 'Cluster', 'suasana disekitar ODC ramai berpotensi untuk melakukan penjualan', 'Mewah', 'Tinggi', 'Tinggi', '-6.604552,106.836917', 'fm.jpg'),
(115, 5, 'FP', 'Komplek Pakuan, Jl. Pakuan Hill Raya, cluster Latania', 1367, 20, 288, 85, 201, 2, '', 'cluster berada di dalam perumahan suasana cluster disetiap rumah nampak banyak penghuni namun dari data banyak yang sudah menggunakan Indihome.', 'Menengah-Atas', 'Tinggi', 'Tinggi', '-6.635785,106.818785', 'fp.jpg'),
(116, 5, 'FQ', 'Perumahan Cirua Asri, Jl. Anyelir', 0, 33, 280, 249, 29, 2, 'Cluster', 'ODC mencatu cluster namun tidak perlu melakukan penjualan karena pengguna indihome sudah banyak', 'Menengah', 'Tinggi', 'Sedang', '-6.555789,106.826886', 'fq-min.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `tb_sto`
--
CREATE TABLE `tb_sto` (
`id` int(11) NOT NULL,
`nama_sto` varchar(128) NOT NULL,
`kode_sto` varchar(128) NOT NULL,
`datel_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_sto`
--
INSERT INTO `tb_sto` (`id`, `nama_sto`, `kode_sto`, `datel_id`) VALUES
(1, 'Leuwiliang', 'LWL', 1),
(2, 'Semplak', 'SPL', 1),
(3, 'Parung', 'PAR', 1),
(4, 'Pagelaran', 'PAG', 1),
(5, 'Bogor', 'BOO', 1),
(6, 'Cigudeg', 'CGD', 1),
(7, 'Jasinga', 'JSA', 1),
(8, 'Lebak Wangi', 'LBI', 1),
(9, 'Ciapus', 'CPS', 1),
(10, 'Dramaga', 'DMG', 1),
(11, 'Ciseeng', 'CSE', 1),
(12, 'Cijeruk', 'CJU', 1);
-- --------------------------------------------------------
--
-- Table structure for table `tb_user_access`
--
CREATE TABLE `tb_user_access` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`sto_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `tb_user_access`
--
INSERT INTO `tb_user_access` (`id`, `user_id`, `sto_id`) VALUES
(1, 8, 1),
(3, 6, 1),
(4, 6, 2),
(5, 6, 3),
(6, 6, 4),
(7, 6, 12),
(8, 6, 11),
(9, 6, 10),
(10, 6, 9),
(11, 6, 8),
(12, 6, 7),
(13, 6, 6),
(14, 6, 5),
(15, 25, 4),
(16, 24, 5),
(17, 25, 9),
(18, 25, 12),
(19, 23, 1),
(20, 23, 10),
(21, 23, 7),
(22, 27, 5),
(23, 26, 5),
(24, 23, 5),
(25, 28, 5),
(26, 25, 5),
(27, 29, 5),
(28, 9, 5),
(29, 9, 6),
(30, 30, 5),
(31, 30, 1),
(32, 30, 2),
(33, 30, 3),
(34, 30, 4),
(35, 30, 6),
(36, 30, 12),
(37, 30, 11),
(38, 30, 10),
(39, 30, 9),
(40, 30, 8),
(41, 30, 7),
(42, 31, 1),
(43, 31, 2),
(44, 31, 3),
(45, 31, 4),
(46, 31, 5),
(47, 31, 6),
(48, 31, 7),
(49, 31, 8),
(50, 31, 9),
(51, 31, 10),
(52, 31, 11),
(53, 31, 12);
-- --------------------------------------------------------
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`name` varchar(128) NOT NULL,
`username` varchar(128) NOT NULL,
`password` varchar(256) NOT NULL,
`role_id` int(11) NOT NULL,
`is_active` int(1) NOT NULL,
`date_created` int(11) NOT NULL,
`image` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user`
--
INSERT INTO `user` (`id`, `name`, `username`, `password`, `role_id`, `is_active`, `date_created`, `image`) VALUES
(6, 'Muhamad Naufal Syaiful Bahri', 'mnsbahri', '$2y$10$IpsO.OJapjM9R.9ASpfXqOusfrVp23bsu4ewoLz7g7bDnLenAEqo.', 1, 1, 1562554707, 'alarm.jpg'),
(8, 'Budi Sarudi', 'budisarudi', '$2y$10$2Y3jguj1yKYStP4x8vCN0ODxJT/flh/OprH5mP1alkhMFvT0Awz3C', 3, 1, 1562628957, 'default.png'),
(9, 'Udin Sarudin', 'udinsarudin123', '$2y$10$Rh4zS1ebPKJgt3.vdGqPQucfNvWeUL9fmxkxzkqnIsLoAFgFQyHPK', 6, 1, 1562935737, 'default.png'),
(13, 'Betutut Ciluk', 'betutut123', '$2y$10$h5kL1sbkANfViUwbSL6CwutADZX6joNc7NRhMiOljj6BYBBBna5O.', 5, 1, 1562946862, 'default.png'),
(24, 'caaacaaa', 'caaacaaa', '$2y$10$7B.AEr74yuWQUAkcyXgju.s96JiIIEKxUsng.1b6rtyl5dzg4h78K', 2, 1, 1563873166, 'default.png'),
(25, 'SYARIEF ADAM HIBATULLAH', 'adamsyaaar_', '$2y$10$/UaVbNHb8MAMMshtGdgjZuQ4mokV6dKUliRfiYyo9tX.VaxQ/n9mW', 2, 1, 1563935942, 'default.png'),
(26, 'Shalahuddin Fikri Haekal', 'haekalLW', '$2y$10$8BGtqzZUMR3iSnCTh.6lx.v43ayA6A1OeaZUQ9o9h3hzb3rfCUTpO', 2, 1, 1563936060, 'default.png'),
(27, 'Annisa Ditia', 'Ditiannisa1204', '$2y$10$zmZdHcrzcFxR8THXO.UOXOm5WlQ.SDI6HXp8gE/ALz1vvANt/nzqm', 2, 1, 1563936119, 'default.png'),
(28, 'Muhammad Elsandrie Rakatama', 'RRQellemon', '$2y$10$U3Dsp8GktTVQHvhzqaBUSO1Qm.6PsKHkaZRY2BpAmFBOJd2sAtFnW', 3, 1, 1563959724, 'download.jpg'),
(29, 'Fauzan Dizki Alif Azmi Siregar', 'alifsiregar', '$2y$10$ullxEts9.4ri5hXYq0z.j.gHh6zHC/202U99bR4VVIR0aVR/TdrJS', 2, 1, 1564125638, 'default.png'),
(30, 'edi sumarsono', 'edisumarsono', '$2y$10$prEjl7jx5yIAHeCf/pk.qO5mWPqQkA2PDWbV0I9qIMBEoJqXp8n7C', 2, 1, 1564391776, 'fotoku_.jpg'),
(31, 'NOVI ARDITA', 'noviardita', '$2y$10$.LBZ0uJ13ICvJ7c0RtlxauDRO8t8YnmfBvYo8VqEhN7vNh31FK6IG', 2, 1, 1564393213, 'default.png');
-- --------------------------------------------------------
--
-- Table structure for table `user_access_menu`
--
CREATE TABLE `user_access_menu` (
`id` int(11) NOT NULL,
`role_id` int(11) NOT NULL,
`menu_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_access_menu`
--
INSERT INTO `user_access_menu` (`id`, `role_id`, `menu_id`) VALUES
(1, 1, 1),
(2, 1, 2),
(3, 1, 3),
(4, 2, 2),
(5, 2, 3),
(6, 3, 3),
(7, 1, 4),
(8, 5, 3),
(9, 5, 2),
(11, 6, 3),
(12, 2, 1),
(13, 5, 1);
-- --------------------------------------------------------
--
-- Table structure for table `user_menu`
--
CREATE TABLE `user_menu` (
`id` int(11) NOT NULL,
`menu` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_menu`
--
INSERT INTO `user_menu` (`id`, `menu`) VALUES
(1, 'Admin'),
(2, 'Asman Sales & Cust. Care'),
(3, 'Kepala Usaha dan Bisnis'),
(4, 'Menu');
-- --------------------------------------------------------
--
-- Table structure for table `user_role`
--
CREATE TABLE `user_role` (
`id` int(11) NOT NULL,
`role` varchar(128) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_role`
--
INSERT INTO `user_role` (`id`, `role`) VALUES
(1, 'Admin'),
(2, 'Asman Sales & Cust. Care'),
(3, 'KAUBIS'),
(4, 'NONE (Default)'),
(5, 'Kakandatel'),
(6, 'KSTO');
-- --------------------------------------------------------
--
-- Table structure for table `user_sub_menu`
--
CREATE TABLE `user_sub_menu` (
`id` int(11) NOT NULL,
`menu_id` int(11) NOT NULL,
`title` varchar(128) NOT NULL,
`url` varchar(128) NOT NULL,
`icon` varchar(128) NOT NULL,
`is_active` int(1) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_sub_menu`
--
INSERT INTO `user_sub_menu` (`id`, `menu_id`, `title`, `url`, `icon`, `is_active`) VALUES
(1, 1, 'Dashboard', 'admin', 'fas fa-fw fa-tachometer-alt', 0),
(2, 3, 'My Profile', 'user/profile', 'fas fa-fw fa-user-circle', 0),
(3, 1, 'Access Role', 'admin/role', 'fas fa-fw fa-user-tie', 1),
(4, 1, 'Total User', 'admin', 'fas fa-fw fa-users', 0),
(5, 1, 'Activity Log', 'admin', 'fas fa-fw fa-list-alt', 0),
(6, 2, 'Role Kaubis', 'user', 'fab fa-fw fa-black-tie', 0),
(7, 3, 'Pengelolaan Demands Kujang', 'user/alpro', 'fas fa-fw fa-tools', 1),
(8, 4, 'Menu Management', 'menu', 'fas fa-fw fa-folder', 0),
(9, 4, 'Sub Menu Management', 'menu/submenu', 'fas fa-folder-open', 1),
(10, 1, 'Role User', 'admin/roleuser', 'fab fa-fw fa-black-tie', 1),
(11, 2, 'Datel', 'asman/datel', 'fas fa-fw fa-building', 0),
(12, 2, 'STO', 'asman/sto', 'fas fa-fw fa-satellite-dish', 1),
(13, 2, 'ODC', 'asman/odc', 'fas fa-fw fa-globe', 1),
(14, 1, 'Role A&K', 'admin/roleak', 'fas fa-fw fa-male', 0),
(15, 1, 'Competitor', 'admin/competitor', 'fas fa-fw fa-burn', 1);
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tb_alpro`
--
ALTER TABLE `tb_alpro`
ADD PRIMARY KEY (`id_alpro`);
--
-- Indexes for table `tb_competitor`
--
ALTER TABLE `tb_competitor`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tb_datel`
--
ALTER TABLE `tb_datel`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tb_odc`
--
ALTER TABLE `tb_odc`
ADD PRIMARY KEY (`id_odc`);
--
-- Indexes for table `tb_sto`
--
ALTER TABLE `tb_sto`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `tb_user_access`
--
ALTER TABLE `tb_user_access`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_access_menu`
--
ALTER TABLE `user_access_menu`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_menu`
--
ALTER TABLE `user_menu`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_role`
--
ALTER TABLE `user_role`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_sub_menu`
--
ALTER TABLE `user_sub_menu`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tb_alpro`
--
ALTER TABLE `tb_alpro`
MODIFY `id_alpro` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `tb_competitor`
--
ALTER TABLE `tb_competitor`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;
--
-- AUTO_INCREMENT for table `tb_datel`
--
ALTER TABLE `tb_datel`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `tb_odc`
--
ALTER TABLE `tb_odc`
MODIFY `id_odc` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=117;
--
-- AUTO_INCREMENT for table `tb_sto`
--
ALTER TABLE `tb_sto`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `tb_user_access`
--
ALTER TABLE `tb_user_access`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=54;
--
-- AUTO_INCREMENT for table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;
--
-- AUTO_INCREMENT for table `user_access_menu`
--
ALTER TABLE `user_access_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=14;
--
-- AUTO_INCREMENT for table `user_menu`
--
ALTER TABLE `user_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `user_role`
--
ALTER TABLE `user_role`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `user_sub_menu`
--
ALTER TABLE `user_sub_menu`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=16;
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 |
fd6a75208e36970b84b4b6d90b067831ec6eb467 | SQL | XiaolinQian/node | /sql/migrations/1552266000000_up_example.sql | UTF-8 | 291 | 3.078125 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `example` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
`name` varchar(255) NOT NULL COMMENT '名字',
PRIMARY KEY (`id`),
UNIQUE KEY `id_UNIQUE` (`id`),
UNIQUE KEY `no_UNIQUE` (`no`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='例子'; | true |
b012c4a15274cab52df2bf6f6c2f4d39e9659c7a | SQL | sebassilva/proyectoBases | /s-04-tablas-externas.sql | UTF-8 | 935 | 3.078125 | 3 | [] | no_license | -- @Autores: López Santibáñez Jiménez, Luis Gerardo
-- Silva García, Carlos Sebastián
-- Fecha de creación: 09/06/2018
-- Descripción: Crea ua tabla externa partiendo de un archivo csv, podrían ser empleados de una base anterior
CREATE DIRECTORY ext_tab_dir AS '/home/oracle/app';
CONNECT system/system;
GRANT READ ON DIRECTORY ext_tab_dir TO LSSG_PROY_ADMIN;
CONNECT LSSG_PROY_ADMIN/LSSG_PROY_ADMIN;
CREATE TABLE ext_tab (
empno CHAR(4),
ename CHAR(20),
job CHAR(20),
deptno CHAR(2))
ORGANIZATION EXTERNAL (
TYPE oracle_loader
DEFAULT DIRECTORY ext_tab_dir
ACCESS PARAMETERS (
RECORDS DELIMITED BY NEWLINE
BADFILE 'bad_%a_%p.bad'
LOGFILE 'log_%a_%p.log'
FIELDS TERMINATED BY ','
MISSING FIELD VALUES ARE NULL
REJECT ROWS WITH ALL NULL FIELDS
(
empno,
ename,
job,
deptno))
LOCATION ('info.dat')
)
PARALLEL
REJECT LIMIT 0
NOMONITORING;
--Id, Name, Description, StartDate "24-03-2008" | true |
6098b5b35b8547e6ddc61d99d2a5e049c5751256 | SQL | mariaathena/kaggle_projects | /expedia_ctr/create_sql_database/load_data.sql | UTF-8 | 1,433 | 2.5625 | 3 | [] | no_license | -- Load data into SQL database
CREATE TABLE train
(
date_time VARCHAR,
site_name VARCHAR,
posa_continent VARCHAR,
user_location_country VARCHAR,
user_location_region VARCHAR,
user_location_city VARCHAR,
orig_destination_distance VARCHAR,
user_id VARCHAR,
is_mobile VARCHAR,
is_package VARCHAR,
channel VARCHAR,
srch_ci VARCHAR,
srch_co VARCHAR,
srch_adults_cnt VARCHAR,
srch_children_cnt VARCHAR,
srch_rm_cnt VARCHAR,
srch_destination_id VARCHAR,
srch_destination_type_id VARCHAR,
hotel_continent VARCHAR,
hotel_country VARCHAR,
hotel_market VARCHAR,
is_booking VARCHAR,
cnt VARCHAR,
hotel_cluster VARCHAR
);
COPY train FROM '/Users/mariaathena/Dropbox (Personal)/00 Imperial College/1603 Digital Marketing/HomeWork 4/data/train.csv' WITH CSV HEADER;
CREATE TABLE test
(
id VARCHAR,
date_time VARCHAR,
site_name VARCHAR,
posa_continent VARCHAR,
user_location_country VARCHAR,
user_location_region VARCHAR,
user_location_city VARCHAR,
orig_destination_distance VARCHAR,
user_id VARCHAR,
is_mobile VARCHAR,
is_package VARCHAR,
channel VARCHAR,
srch_ci VARCHAR,
srch_co VARCHAR,
srch_adults_cnt VARCHAR,
srch_children_cnt VARCHAR,
srch_rm_cnt VARCHAR,
srch_destination_id VARCHAR,
srch_destination_type_id VARCHAR,
hotel_continent VARCHAR,
hotel_country VARCHAR,
hotel_market VARCHAR
);
COPY test FROM '/Users/mariaathena/Dropbox (Personal)/00 Imperial College/1603 Digital Marketing/HomeWork 4/data/test.csv' WITH CSV HEADER;
| true |
6d82b2add779db282f1699c1976846a13f8770f1 | SQL | shan/codelabs | /R/PlatinumGenomes-QC/sql/check-sex.sql | UTF-8 | 1,387 | 4.09375 | 4 | [
"Apache-2.0"
] | permissive | #standardSQL
--
-- Compute the homozygous and heterozygous variant counts for each individual
-- within chromosome X to help determine whether the sex phenotype value is
-- correct for each individual.
--
WITH filtered_snp_calls AS (
SELECT
call.call_set_name,
CAST((SELECT LOGICAL_AND(gt > 0) FROM UNNEST(call.genotype) gt) AS INT64) AS hom_AA,
CAST(EXISTS (SELECT gt FROM UNNEST(call.genotype) gt WHERE gt > 0)
AND EXISTS (SELECT gt FROM UNNEST(call.genotype) gt WHERE gt = 0) AS INT64) AS het_RA
FROM
`@GENOME_CALL_OR_MULTISAMPLE_VARIANT_TABLE` v, v.call call
WHERE
reference_name IN ('chrX', 'X')
# Locations of PAR1 and PAR2 on GRCh37.
AND start NOT BETWEEN 59999 AND 2699519
AND start NOT BETWEEN 154931042 AND 155260559
# Only include biallelic snps.
AND reference_bases IN ('A','C','G','T')
AND ARRAY_LENGTH(alternate_bases) = 1
AND alternate_bases[ORDINAL(1)] IN ('A','C','G','T')
# Skip non-passing calls.
AND NOT EXISTS (SELECT ft FROM UNNEST(call.FILTER) ft WHERE ft NOT IN ('PASS', '.'))
)
SELECT
call_set_name,
ROUND(SUM(het_RA)/(SUM(hom_AA) + SUM(het_RA)), 3) AS perct_het_alt_in_snvs,
ROUND(SUM(hom_AA)/(SUM(hom_AA) + SUM(het_RA)), 3) AS perct_hom_alt_in_snvs,
SUM(hom_AA) AS hom_AA_count,
SUM(het_RA) AS het_RA_count
FROM filtered_snp_calls
GROUP BY
call_set_name
ORDER BY
call_set_name
| true |
2b97a459cd288ffbf5385d9128b78ee89884e169 | SQL | mmathias01/dbt-snowplow-web | /models/page_views/scratch/redshift/snowplow_web_pv_yauaa.sql | UTF-8 | 1,055 | 3 | 3 | [
"LicenseRef-scancode-warranty-disclaimer",
"Apache-2.0"
] | permissive | {{
config(
sort='page_view_id',
dist='page_view_id',
enabled=(var('snowplow__enable_yauaa') and target.type == 'redshift' | as_bool())
)
}}
select
pv.page_view_id,
ya.device_class,
ya.agent_class,
ya.agent_name,
ya.agent_name_version,
ya.agent_name_version_major,
ya.agent_version,
ya.agent_version_major,
ya.device_brand,
ya.device_name,
ya.device_version,
ya.layout_engine_class,
ya.layout_engine_name,
ya.layout_engine_name_version,
ya.layout_engine_name_version_major,
ya.layout_engine_version,
ya.layout_engine_version_major,
ya.operating_system_class,
ya.operating_system_name,
ya.operating_system_name_version,
ya.operating_system_version
from {{ var('snowplow__yauaa_context') }} ya
inner join {{ ref('snowplow_web_page_view_events') }} pv
on ya.root_id = pv.event_id
and ya.root_tstamp = pv.collector_tstamp
where ya.root_tstamp >= (select lower_limit from {{ ref('snowplow_web_pv_limits') }})
and ya.root_tstamp <= (select upper_limit from {{ ref('snowplow_web_pv_limits') }})
| true |
053252fda33436c4cfed641e794f64abf0650264 | SQL | HenriqueMDC/Exercicios-BancoDeDados | /DELETE alunos.sql | UTF-8 | 659 | 2.75 | 3 | [] | no_license | -- DELETE alunos WHERE nome LIKE '%Francisco%';
-- DELETE alunos WHERE YEAR(data_nascimento) = 1994;
-- DELETE alunos WHERE signo = 'Gêmios';
-- DELETE alunos WHERE nome LIKE 'Reinaldo%';
-- DELETE alunos WHERE nome LIKE '%Carvalho';
-- DELETE alunos WHERE MONTH(data_nascimento) = 07;
-- DELETE alunos WHERE nota_1 > nota_2 AND nota_4 < nota_3;
-- DELETE alunos WHERE cpf LIKE '145.%';
-- DELETE alunos WHERE cor_preferida = 'Bordo' AND signo = 'Capricórnio' OR cor_preferida = 'Cinza-Claro' AND signo = 'Aquários';
-- DELETE alunos WHERE (nota_1 + nota_2 + nota_3 + nota_4) < 4;
-- DELETE alunos WHERE DAY(data_nascimento) = 28;
SELECT * FROM alunos; | true |
aae991a5dcd9f9a8053b31c4a1bf8b1a0947d230 | SQL | CastilloJuliusDave/PHP-JS-AJax-jQuery | /Capstone2/attendance.sql | UTF-8 | 7,029 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 30, 2019 at 01:19 AM
-- Server version: 10.1.34-MariaDB-0ubuntu0.18.04.1
-- PHP Version: 7.2.10-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `attendance`
--
-- --------------------------------------------------------
--
-- Table structure for table `Attendance_Master`
--
CREATE TABLE `Attendance_Master` (
`id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`time_in` datetime NOT NULL,
`time_out` datetime NOT NULL,
`last_activity` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`status` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `Employee_Login_Master`
--
CREATE TABLE `Employee_Login_Master` (
`id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`password` varchar(100) NOT NULL,
`last_login` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`register_date` datetime NOT NULL,
`user_type_id` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `Employee_Master`
--
CREATE TABLE `Employee_Master` (
`id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`first_name` varchar(100) NOT NULL,
`last_name` varchar(100) NOT NULL,
`middle_name` varchar(100) NOT NULL,
`birth_day` date NOT NULL,
`address` varchar(255) NOT NULL,
`phone_main` varchar(11) NOT NULL,
`phone_home` varchar(11) NOT NULL,
`email` varchar(100) NOT NULL,
`gender` varchar(10) NOT NULL,
`status_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `Employee_Status_Master`
--
CREATE TABLE `Employee_Status_Master` (
`id` int(11) NOT NULL,
`status` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `Employee_Status_Master`
--
INSERT INTO `Employee_Status_Master` (`id`, `status`) VALUES
(1, 'On Leave'),
(2, 'Terminated'),
(3, 'Suspended'),
(4, 'Active');
-- --------------------------------------------------------
--
-- Table structure for table `Leave_Master`
--
CREATE TABLE `Leave_Master` (
`id` int(11) NOT NULL,
`employee_id` int(11) NOT NULL,
`start_date` datetime NOT NULL,
`end_date` datetime NOT NULL,
`leave_type_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
-- --------------------------------------------------------
--
-- Table structure for table `Leave_Type_Master`
--
CREATE TABLE `Leave_Type_Master` (
`id` int(11) NOT NULL,
`leave_type` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `Leave_Type_Master`
--
INSERT INTO `Leave_Type_Master` (`id`, `leave_type`) VALUES
(1, 'Sick Leave'),
(2, 'Paid Vacation Leave'),
(3, 'Unpaid Vacation Leave\r\n\r\n'),
(4, 'Matternity Leave');
-- --------------------------------------------------------
--
-- Table structure for table `User_Type_Master`
--
CREATE TABLE `User_Type_Master` (
`id` int(11) NOT NULL,
`user_type` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `User_Type_Master`
--
INSERT INTO `User_Type_Master` (`id`, `user_type`) VALUES
(1, 'Admin'),
(2, 'Employee'),
(3, 'HR');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `Attendance_Master`
--
ALTER TABLE `Attendance_Master`
ADD PRIMARY KEY (`id`),
ADD KEY `employee_id` (`employee_id`);
--
-- Indexes for table `Employee_Login_Master`
--
ALTER TABLE `Employee_Login_Master`
ADD PRIMARY KEY (`id`),
ADD KEY `employee_id` (`employee_id`),
ADD KEY `user_type_id` (`user_type_id`);
--
-- Indexes for table `Employee_Master`
--
ALTER TABLE `Employee_Master`
ADD PRIMARY KEY (`id`),
ADD KEY `status_id` (`status_id`);
--
-- Indexes for table `Employee_Status_Master`
--
ALTER TABLE `Employee_Status_Master`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `Leave_Master`
--
ALTER TABLE `Leave_Master`
ADD PRIMARY KEY (`id`),
ADD KEY `employee_id` (`employee_id`),
ADD KEY `leave_type_id` (`leave_type_id`);
--
-- Indexes for table `Leave_Type_Master`
--
ALTER TABLE `Leave_Type_Master`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `User_Type_Master`
--
ALTER TABLE `User_Type_Master`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `Attendance_Master`
--
ALTER TABLE `Attendance_Master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `Employee_Login_Master`
--
ALTER TABLE `Employee_Login_Master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `Employee_Master`
--
ALTER TABLE `Employee_Master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `Employee_Status_Master`
--
ALTER TABLE `Employee_Status_Master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `Leave_Master`
--
ALTER TABLE `Leave_Master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `Leave_Type_Master`
--
ALTER TABLE `Leave_Type_Master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT for table `User_Type_Master`
--
ALTER TABLE `User_Type_Master`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `Attendance_Master`
--
ALTER TABLE `Attendance_Master`
ADD CONSTRAINT `Attendance_Master_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `Employee_Master` (`id`);
--
-- Constraints for table `Employee_Login_Master`
--
ALTER TABLE `Employee_Login_Master`
ADD CONSTRAINT `Employee_Login_Master_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `Employee_Master` (`id`),
ADD CONSTRAINT `Employee_Login_Master_ibfk_2` FOREIGN KEY (`user_type_id`) REFERENCES `User_Type_Master` (`id`);
--
-- Constraints for table `Employee_Master`
--
ALTER TABLE `Employee_Master`
ADD CONSTRAINT `Employee_Master_ibfk_1` FOREIGN KEY (`status_id`) REFERENCES `Employee_Status_Master` (`id`);
--
-- Constraints for table `Leave_Master`
--
ALTER TABLE `Leave_Master`
ADD CONSTRAINT `Leave_Master_ibfk_1` FOREIGN KEY (`employee_id`) REFERENCES `Employee_Master` (`id`),
ADD CONSTRAINT `Leave_Master_ibfk_2` FOREIGN KEY (`leave_type_id`) REFERENCES `Leave_Type_Master` (`id`);
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
c55b48678ce9f9e985bd550411ea2a12e8e40f39 | SQL | Ravath/MightyGM | /Pathfinder/SQL/SqlGeneration.sql | UTF-8 | 56,836 | 2.984375 | 3 | [] | no_license | CREATE SCHEMA pathfinder;
create table pathfinder.dataobject(
id serial NOT NULL,
primary key(id));
create table pathfinder.requismodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.requisdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.requisexemplar(
fk_model_id integer,
valeur character varying(15) NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.racemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
force integer NOT NULL,
dexterite integer NOT NULL,
constitution integer NOT NULL,
intelligence integer NOT NULL,
sagesse integer NOT NULL,
charisme integer NOT NULL,
vd integer NOT NULL,
fk_classemodel_classepredilection integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.racedescription(
description text NOT NULL,
fk_model_id integer,
physique text NOT NULL,
societe text NOT NULL,
relations text NOT NULL,
alignement text NOT NULL,
aventuriers text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.raceexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.languemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
alphabet character varying(10) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.languedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.langueexemplar(
fk_model_id integer,
comprend bool NOT NULL,
parle bool NOT NULL,
lit bool NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.absdvmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
dvtype integer NOT NULL,
facteurcompetence integer NOT NULL,
bba integer NOT NULL,
reflexes integer NOT NULL,
vigueur integer NOT NULL,
volonte integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.absdvdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.absdvexemplar(
fk_model_id integer,
niveau integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.tablesorts(
niveauclasse integer NOT NULL,
lvl1 integer NOT NULL,
lvl2 integer NOT NULL,
lvl3 integer NOT NULL,
lvl4 integer NOT NULL,
lvl5 integer NOT NULL,
lvl6 integer NOT NULL,
lvl7 integer NOT NULL,
lvl8 integer NOT NULL,
lvl9 integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.divinitemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
alignementloi integer NOT NULL,
alignementbien integer NOT NULL,
fk_armemodel_armedepredilection integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.divinitedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.diviniteexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.domainemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fk_pouvoirspecialmodel_pouvoir integer,
fk_pouvoirspecialmodel_pouvoirlvl8 integer,
fk_sortmodel_sorti integer,
fk_sortmodel_sortii integer,
fk_sortmodel_sortiii integer,
fk_sortmodel_sortiv integer,
fk_sortmodel_sortv integer,
fk_sortmodel_sortvi integer,
fk_sortmodel_sortvii integer,
fk_sortmodel_sortviii integer,
fk_sortmodel_sortix integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.domainedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.domaineexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.competencemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
caracteristique integer NOT NULL,
sansformation bool NOT NULL,
malusarmure bool NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.competencedescription(
description text NOT NULL,
fk_model_id integer,
testcompetence text NOT NULL,
action text NOT NULL,
nouvellestentatives text NOT NULL,
special text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.competenceexemplar(
fk_model_id integer,
fk_soustypemodel_specialite integer,
rang integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.soustypemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fk_competencemodel_competence integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.soustypedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.soustypeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.donmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
typedon integer NOT NULL,
fk_donmodel_donrequis integer,
donmartial bool NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.dondescription(
description text NOT NULL,
fk_model_id integer,
conditions text NOT NULL,
avantage text NOT NULL,
normal text NOT NULL,
special text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.donexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirclassemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fk_pouvoirspecialmodel_pouvoir integer,
niveau integer NOT NULL,
fk_absclassemodel_classe integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirclassedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirclasseexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirspecialmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
type integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirspecialdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirspecialexemplar(
fk_model_id integer,
valeur character varying(15) NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.objetmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
poids integer NOT NULL,
prix integer NOT NULL,
solidite integer NOT NULL,
resistance integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.objetdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.objetexemplar(
fk_model_id integer,
soliditecourante integer NOT NULL,
taille integer NOT NULL,
fk_matiere_matiere integer)INHERITS(pathfinder.dataobject);
create table pathfinder.specialarmemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.specialarmedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.specialarmeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.matiere(
)INHERITS(pathfinder.dataobject);
create table pathfinder.listesortclassemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fk_absclassemodel_classe integer,
niveau integer NOT NULL,
fk_sortmodel_sort integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.listesortclassedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.listesortclasseexemplar(
fk_model_id integer,
maitrisedessorts bool NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.sortmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
ecole integer NOT NULL,
branche integer NOT NULL,
testsauvegarde integer,
typetestsauvegarde integer NOT NULL,
rm bool NOT NULL,
compverbale bool NOT NULL,
compgestuelle bool NOT NULL,
compfocalisateurdivin bool NOT NULL,
fk_composantematerielle_compmaterielle integer,
fk_composantefocalisateur_compfocalisateur integer,
tempsincantation integer NOT NULL,
facteurtempsincantation integer NOT NULL,
portee integer NOT NULL,
facteurportee integer NOT NULL,
cibles integer NOT NULL,
facteurcible integer NOT NULL,
facteurciblerparniveau bool NOT NULL,
effettype integer,
facteureffet integer NOT NULL,
facteureffetparniveau bool NOT NULL,
faconnable bool NOT NULL,
descriptioncibles character varying(50) NOT NULL,
descriptionzoneeffet character varying(50) NOT NULL,
duree integer NOT NULL,
facteurduree integer NOT NULL,
terminaison bool NOT NULL,
facteurparniveau bool NOT NULL,
dureeprecision character varying(50),
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.sortdescription(
description text NOT NULL,
fk_model_id integer,
descriptioncourte text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.sortexemplar(
fk_model_id integer,
pouvoirmagique bool NOT NULL,
frequence integer NOT NULL,
niveauempacement integer NOT NULL,
fk_classemodel_classe integer,
nombreutilisations integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.abscomposantesort(
nom character varying(25) NOT NULL,
cout integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.objetintelligent(
intelligence integer NOT NULL,
sagesse integer NOT NULL,
charisme integer NOT NULL,
ego integer NOT NULL,
alignementloi integer NOT NULL,
alignementbien integer NOT NULL,
empathie bool NOT NULL,
telepathie bool NOT NULL,
parole bool NOT NULL,
sens integer NOT NULL,
visiodanslenoir bool NOT NULL,
visionaveugle bool NOT NULL,
lecturedeslangues bool NOT NULL,
lecturedelamagie bool NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.sortbaton(
fk_batonmodel_baton integer,
charge integer NOT NULL,
fk_sortmodel_sort integer)INHERITS(pathfinder.dataobject);
create table pathfinder.enchantementobjetmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
alteration integer NOT NULL,
prix integer NOT NULL,
ecoleaura integer NOT NULL,
puissanceaura integer NOT NULL,
nls integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.enchantementobjetdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.enchantementobjetexemplar(
fk_model_id integer,
value character varying(15) NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.piegemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fp integer NOT NULL,
type integer NOT NULL,
declencheur integer NOT NULL,
remise integer NOT NULL,
desarmement integer NOT NULL,
ddfouille integer NOT NULL,
dddesamorcage integer NOT NULL,
prix integer NOT NULL,
duree integer NOT NULL,
fosse bool NOT NULL,
liquide bool NOT NULL,
gaz bool NOT NULL,
neratejamais bool NOT NULL,
ciblesmultiples bool NOT NULL,
retardement integer NOT NULL,
pieux bool NOT NULL,
fk_attaquepiege_attaque integer,
fk_afflictionmodel_affliction integer,
fk_sortexemplar_sort integer,
nls integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.piegedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.piegeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.attaquepiege(
adistance bool NOT NULL,
attaque integer NOT NULL,
nbrdes integer NOT NULL,
typedes integer NOT NULL,
zonecritique integer NOT NULL,
facteurcritique integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.afflictionmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
typeaffliction integer NOT NULL,
blessure bool NOT NULL,
contact bool NOT NULL,
ingestion bool NOT NULL,
inhalation bool NOT NULL,
piege bool NOT NULL,
sort bool NOT NULL,
dd integer NOT NULL,
jetsauvegarde integer NOT NULL,
facteurfrequence integer NOT NULL,
frequence integer NOT NULL,
facteurincubation integer NOT NULL,
incubation integer NOT NULL,
facteurdureemax integer NOT NULL,
dureemax integer NOT NULL,
guerisonjsconsecutifs integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.afflictiondescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.afflictionexemplar(
fk_model_id integer,
tour integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.etatmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.etatdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.etatexemplar(
fk_model_id integer,
valeur character varying(15) NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.soustypecreaturemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.soustypecreaturedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.soustypecreatureexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.archetypemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
modfp integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.archetypedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.archetypeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.organisationsociale(
nombremin integer NOT NULL,
nombremax integer NOT NULL,
nomgroupe character varying(15) NOT NULL,
p_noncombatants integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.tresor(
armes integer NOT NULL,
objetsprecieux integer NOT NULL,
objetsmagiques integer NOT NULL,
argent integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.armenaturellemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
nombre integer NOT NULL,
nbrddegats integer NOT NULL,
tailleddegats integer NOT NULL,
facteurcritique integer NOT NULL,
zonecritique integer NOT NULL,
typedegat integer NOT NULL,
secondaire bool NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.armenaturelledescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armenaturelleexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.particularitemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
type integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.particularitedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.particulariteexemplar(
fk_model_id integer,
valeur character varying(15) NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fk_typecreaturemodel_type integer,
taille integer NOT NULL,
allonge integer NOT NULL,
milieunaturel integer NOT NULL,
climat integer NOT NULL,
alignementloi integer NOT NULL,
alignementbien integer NOT NULL,
frequencealignement integer NOT NULL,
fk_tresor_tresor integer,
fp integer NOT NULL,
dv integer NOT NULL,
ajustementdeniveau integer NOT NULL,
evolutionparniveaudeclasse bool NOT NULL,
force integer NOT NULL,
dexterite integer NOT NULL,
constitution integer NOT NULL,
intelligence integer NOT NULL,
sagesse integer NOT NULL,
charisme integer NOT NULL,
armurenaturelle integer NOT NULL,
rm integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.personnagedescription(
description text NOT NULL,
fk_model_id integer,
narrative text NOT NULL,
combat text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.personnageexemplar(
fk_model_id integer,
degats integer NOT NULL,
degatsnonlethaux integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.parentemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fk_racemodel_race integer,
chancesparentsenvie integer NOT NULL,
chancespereenvie integer NOT NULL,
chancesmereenvie integer NOT NULL,
chancesorphelin integer NOT NULL,
chancesenfantunique integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.parentedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.parenteexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.paysnatal(
fk_parentemodel_parente integer,
chances integer NOT NULL,
resultat text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.fratrie(
fk_parentemodel_parente integer,
chances integer NOT NULL,
resultat text NOT NULL,
nbrdes integer NOT NULL,
typedes integer NOT NULL,
bonus integer NOT NULL,
parentbiologique bool NOT NULL,
fk_racemodel_race integer)INHERITS(pathfinder.dataobject);
create table pathfinder.absoddtablemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
chances integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.absoddtabledescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.absoddtableexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.resolutionconflitmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
modpcon integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.resolutionconflitdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.resolutionconflitexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.traitmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
type integer NOT NULL,
fk_racemodel_race integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.traitdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.traitexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.donhistoiremodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.donhistoiredescription(
description text NOT NULL,
fk_model_id integer,
conditionrequise text NOT NULL,
avantage text NOT NULL,
objectif text NOT NULL,
avantagereussite text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.donhistoireexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.gestionnaireitrmmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
salaire integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.gestionnaireitrmdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.gestionnaireitrmexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.constructibleitrmmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
marchandisescreation integer NOT NULL,
influencecreation integer NOT NULL,
travailcreation integer NOT NULL,
coutcreation integer NOT NULL,
magiecreation integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.constructibleitrmdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.constructibleitrmexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.evenementhonorable(
type integer NOT NULL,
evenement character varying(255) NOT NULL,
ptshonneur integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.evenementrenomee(
evenement character varying(255) NOT NULL,
ptsrenomee integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.ageracial(
fk_racemodel_race integer,
debutjeunesse integer NOT NULL,
debutadulte integer NOT NULL,
nbrdespeuple integer NOT NULL,
typedespeuple integer NOT NULL,
nbrdesadepte integer NOT NULL,
typedesadepte integer NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.responsablepolitiquemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.responsablepolitiquedescription(
description text NOT NULL,
fk_model_id integer,
avantage text NOT NULL,
fonctioninoccupee text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.responsablepolitiqueexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.ameliorationterrainmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
superposable bool NOT NULL,
prixpc integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.ameliorationterraindescription(
description text NOT NULL,
fk_model_id integer,
terrain text NOT NULL,
effet text NOT NULL,
prix text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.ameliorationterrainexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.terrainroyaumemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
dureeexploration integer NOT NULL,
dureepreparation integer NOT NULL,
coutpreparation integer NOT NULL,
coutferme integer NOT NULL,
coutroute integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.terrainroyaumedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.terrainroyaumeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.batimentroyaumemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
nbrlots integer NOT NULL,
coutpc integer NOT NULL,
bonuseconomie integer NOT NULL,
bonusloyaute integer NOT NULL,
bonusstablite integer NOT NULL,
bonuscorruption integer NOT NULL,
bonuscriminalite integer NOT NULL,
bonusloi integer NOT NULL,
bonusfolklore integer NOT NULL,
bonussociete integer NOT NULL,
bonusproductivite integer NOT NULL,
bonusgloire integer NOT NULL,
bonusinfamie integer NOT NULL,
bonusinsatisfaction integer NOT NULL,
objmagfaible integer NOT NULL,
objmagintermediaire integer NOT NULL,
objmagpuissant integer NOT NULL,
objmaganneau integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.batimentroyaumedescription(
description text NOT NULL,
fk_model_id integer,
special text NOT NULL)INHERITS(pathfinder.dataobject);
create table pathfinder.batimentroyaumeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.formegouvernementmodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.formegouvernementdescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.formegouvernementexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.tactiquearmeemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.tactiquearmeedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.tactiquearmeeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armeeroyaumemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
taille integer NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.armeeroyaumedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armeeroyaumeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.ressourcearmeemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.ressourcearmeedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.ressourcearmeeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirarmeemodel(
name character varying(40) NOT NULL,
tag character varying(7) NOT NULL,
fk_pouvoirspecialmodel_pouvoirorigine integer,
unique(name),
unique(tag))INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirarmeedescription(
description text NOT NULL,
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.pouvoirarmeeexemplar(
fk_model_id integer)INHERITS(pathfinder.dataobject);
create table pathfinder.racemodeltolanguemodel_languesbase(
fk_racemodel_join integer,
fk_languemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.racemodeltolanguemodel_languesupplementaire(
fk_racemodel_join integer,
fk_languemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.racemodeltopouvoirspecialmodel_pouvoirs(
fk_racemodel_join integer,
fk_pouvoirspecialmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.absdvmodeltocompetencemodel_competences(
fk_absdvmodel_join integer,
fk_competencemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.divinitemodeltodomainemodel_domaines(
fk_divinitemodel_join integer,
fk_domainemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.themesfromdivinitedescription(
fk_divinitedescription_from integer,
themes character varying(15))INHERITS(pathfinder.dataobject);
create table pathfinder.donmodeltodonmodel_autresdonsrequis(
fk_donmodel_joinautresdonsrequis integer,
fk_donmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.registresfromsortmodel(
fk_sortmodel_from integer,
registres integer)INHERITS(pathfinder.dataobject);
create table pathfinder.sortexemplartodonmodel_metamagie(
fk_sortexemplar_join integer,
fk_donmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.objetintelligenttolanguemodel_languesconnues(
fk_objetintelligent_join integer,
fk_languemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.enchantementobjetmodeltosortmodel_sortscreation(
fk_enchantementobjetmodel_join integer,
fk_sortmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.enchantementobjetmodeltorequisexemplar_requisport(
fk_enchantementobjetmodel_join integer,
fk_requisexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.enchantementobjetmodeltorequisexemplar_requiscreation(
fk_enchantementobjetmodel_join integer,
fk_requisexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.soustypecreaturemodeltopouvoirspecialexemplar_pouvoirs(
fk_soustypecreaturemodel_join integer,
fk_pouvoirspecialexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.archetypemodeltoparticulariteexemplar_particularites(
fk_archetypemodel_join integer,
fk_particulariteexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armenaturellemodeltoparticulariteattaqueexemplar_special(
fk_armenaturellemodel_join integer,
fk_particulariteattaqueexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltosoustypecreaturemodel_soustype(
fk_personnagemodel_join integer,
fk_soustypecreaturemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltoorganisationsociale_organisationsociale(
fk_personnagemodel_join integer,
fk_organisationsociale_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltolangueexemplar_langues(
fk_personnagemodel_join integer,
fk_langueexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.evolutionsfrompersonnagemodel(
fk_personnagemodel_from integer,
evolutions integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltoabsdvexemplar_classes(
fk_personnagemodel_join integer,
fk_absdvexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltoarmenaturelleexemplar_attaquesnaturelles(
fk_personnagemodel_join integer,
fk_armenaturelleexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltoparticulariteexemplar_particularites(
fk_personnagemodel_join integer,
fk_particulariteexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltocompetenceexemplar_competences(
fk_personnagemodel_join integer,
fk_competenceexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltodonexemplar_dons(
fk_personnagemodel_join integer,
fk_donexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltolistesortclasseexemplar_sortsconnus(
fk_personnagemodel_join integer,
fk_listesortclasseexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltosortexemplar_sorts(
fk_personnagemodel_join integer,
fk_sortexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltoarmeexemplar_armes(
fk_personnagemodel_join integer,
fk_armeexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltoarmureexemplar_armures(
fk_personnagemodel_join integer,
fk_armureexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltomaterielexemplar_equipement(
fk_personnagemodel_join integer,
fk_materielexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnagemodeltoobjectmagiqueexemplar_objetsmagiques(
fk_personnagemodel_join integer,
fk_objectmagiqueexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnageexemplartoafflictionexemplar_afflictions(
fk_personnageexemplar_join integer,
fk_afflictionexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnageexemplartoetatexemplar_etats(
fk_personnageexemplar_join integer,
fk_etatexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.personnageexemplartoarchetypemodel_archetypes(
fk_personnageexemplar_join integer,
fk_archetypemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.gestionnaireitrmmodeltocompetenceexemplar_competences(
fk_gestionnaireitrmmodel_join integer,
fk_competenceexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.batimentroyaumemodeltobatimentroyaumemodel_reduction(
fk_batimentroyaumemodel_joinreduction integer,
fk_batimentroyaumemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armeeroyaumemodeltoressourcearmeemodel_ressources(
fk_armeeroyaumemodel_join integer,
fk_ressourcearmeemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armemodeltospecialarmeexemplar_specialarme(
fk_armemodel_join integer,
fk_specialarmeexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armeexemplartoenchantementarmeexemplar_enchantements(
fk_armeexemplar_join integer,
fk_enchantementarmeexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armeexemplartomunitionexemplar_munitions(
fk_armeexemplar_join integer,
fk_munitionexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.munitionexemplartoenchantementarmeexemplar_enchantements(
fk_munitionexemplar_join integer,
fk_enchantementarmeexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.armureexemplartoenchantementarmureexemplar_enchantements(
fk_armureexemplar_join integer,
fk_enchantementarmureexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.objectmagiquemodeltosortmodel_sortscreation(
fk_objectmagiquemodel_join integer,
fk_sortmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.objectmagiquemodeltorequisexemplar_requisport(
fk_objectmagiquemodel_join integer,
fk_requisexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.objectmagiquemodeltorequisexemplar_requiscreation(
fk_objectmagiquemodel_join integer,
fk_requisexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.typecreaturemodeltopouvoirspecialexemplar_pouvoirs(
fk_typecreaturemodel_join integer,
fk_pouvoirspecialexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.conflitexemplartoacteurconflitmodel_acteurs(
fk_conflitexemplar_join integer,
fk_acteurconflitmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.batimentitrmmodeltosallebatimentitrmexemplar_salles(
fk_batimentitrmmodel_join integer,
fk_sallebatimentitrmexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.organisationitrmmodeltoemployeitrmexemplar_employes(
fk_organisationitrmmodel_join integer,
fk_employeitrmexemplar_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.batimentroyaumemodelamelioreentobatimentroyaumemodelameliorede(
fk_batimentroyaumemodel_joinamelioreenameliorede integer,
fk_batimentroyaumemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.batimentroyaumemodelamelioredetobatimentroyaumemodelamelioreen(
fk_batimentroyaumemodel_joinamelioredeamelioreen integer,
fk_batimentroyaumemodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.sallebatimentitrmmodelameldetosallebatimentitrmmodelamelen(
fk_sallebatimentitrmmodel_joinameldeamelen integer,
fk_sallebatimentitrmmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.sallebatimentitrmmodelamelentosallebatimentitrmmodelamelde(
fk_sallebatimentitrmmodel_joinamelenamelde integer,
fk_sallebatimentitrmmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.employeitrmmodelameldetoemployeitrmmodelamelen(
fk_employeitrmmodel_joinameldeamelen integer,
fk_employeitrmmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.employeitrmmodelamelentoemployeitrmmodelamelde(
fk_employeitrmmodel_joinamelenamelde integer,
fk_employeitrmmodel_join integer)INHERITS(pathfinder.dataobject);
create table pathfinder.absclassemodel(
armescourantes bool NOT NULL,
armesguerre bool NOT NULL,
armureslegeres bool NOT NULL,
armuresintermediaires bool NOT NULL,
armureslourdes bool NOT NULL,
primary key(id))INHERITS(pathfinder.absdvmodel);
create table pathfinder.absclassedescription(
role text NOT NULL,
primary key(id))INHERITS(pathfinder.absdvdescription);
create table pathfinder.absclasseexemplar(
primary key(id))INHERITS(pathfinder.absdvexemplar);
create table pathfinder.sortsconnus(
fk_absclassemodel_classe integer,
primary key(id))INHERITS(pathfinder.tablesorts);
create table pathfinder.sortsquotidiens(
fk_absclassemodel_classe integer,
primary key(id))INHERITS(pathfinder.tablesorts);
create table pathfinder.pouvoirspecialclassemodel(
niveaumin integer NOT NULL,
primary key(id))INHERITS(pathfinder.pouvoirspecialmodel);
create table pathfinder.pouvoirspecialclassedescription(
primary key(id))INHERITS(pathfinder.pouvoirspecialdescription);
create table pathfinder.pouvoirspecialclasseexemplar(
primary key(id))INHERITS(pathfinder.pouvoirspecialexemplar);
create table pathfinder.lignageensorceleurmodel(
fk_competencemodel_competence integer,
fk_pouvoirspecialmodel_arcane integer,
fk_pouvoirspecialmodel_pouvoirlvl1 integer,
fk_pouvoirspecialmodel_pouvoirlvl3 integer,
fk_pouvoirspecialmodel_pouvoirlvl9 integer,
fk_pouvoirspecialmodel_pouvoirlvl15 integer,
fk_pouvoirspecialmodel_pouvoirlvl20 integer,
fk_sortmodel_sortlvl3 integer,
fk_sortmodel_sortlvl5 integer,
fk_sortmodel_sortlvl7 integer,
fk_sortmodel_sortlvl9 integer,
fk_sortmodel_sortlvl11 integer,
fk_sortmodel_sortlvl13 integer,
fk_sortmodel_sortlvl15 integer,
fk_sortmodel_sortlvl17 integer,
fk_sortmodel_sortlvl19 integer,
fk_donexemplar_dons integer,
primary key(id))INHERITS(pathfinder.pouvoirspecialmodel);
create table pathfinder.lignageensorceleurdescription(
primary key(id))INHERITS(pathfinder.pouvoirspecialdescription);
create table pathfinder.lignageensorceleurexemplar(
primary key(id))INHERITS(pathfinder.pouvoirspecialexemplar);
create table pathfinder.ecolemagemodel(
fk_pouvoirspecialmodel_capacite1 integer,
fk_pouvoirspecialmodel_capacite2 integer,
fk_pouvoirspecialmodel_capacitelvl8 integer,
primary key(id))INHERITS(pathfinder.pouvoirspecialmodel);
create table pathfinder.ecolemagedescription(
primary key(id))INHERITS(pathfinder.pouvoirspecialdescription);
create table pathfinder.ecolemageexemplar(
primary key(id))INHERITS(pathfinder.pouvoirspecialexemplar);
create table pathfinder.armemodel(
typearme integer NOT NULL,
maniement integer NOT NULL,
nbrddegats integer NOT NULL,
tailleddegats integer NOT NULL,
facteurcritique integer NOT NULL,
zonecritique integer NOT NULL,
typedegat integer NOT NULL,
typedegatcomplementaire integer,
typedegatcplisalternative bool NOT NULL,
fk_armemodel_secondetete integer,
facteurportee integer,
fk_munitionmodel_munition integer,
primary key(id))INHERITS(pathfinder.objetmodel);
create table pathfinder.armedescription(
primary key(id))INHERITS(pathfinder.objetdescription);
create table pathfinder.armeexemplar(
armedemaitre bool NOT NULL,
alteration integer NOT NULL,
primary key(id))INHERITS(pathfinder.objetexemplar);
create table pathfinder.munitionmodel(
quantite integer NOT NULL,
fk_armemodel_arme integer,
primary key(id))INHERITS(pathfinder.objetmodel);
create table pathfinder.munitiondescription(
primary key(id))INHERITS(pathfinder.objetdescription);
create table pathfinder.munitionexemplar(
alteration integer NOT NULL,
stock integer NOT NULL,
primary key(id))INHERITS(pathfinder.objetexemplar);
create table pathfinder.armuremodel(
bonusca integer NOT NULL,
malustests integer NOT NULL,
dexmax integer NOT NULL,
echecsorts integer NOT NULL,
categorie integer NOT NULL,
primary key(id))INHERITS(pathfinder.objetmodel);
create table pathfinder.armuredescription(
primary key(id))INHERITS(pathfinder.objetdescription);
create table pathfinder.armureexemplar(
armuredemaitre bool NOT NULL,
alteration integer NOT NULL,
primary key(id))INHERITS(pathfinder.objetexemplar);
create table pathfinder.materielmodel(
categorie integer NOT NULL,
primary key(id))INHERITS(pathfinder.objetmodel);
create table pathfinder.materieldescription(
primary key(id))INHERITS(pathfinder.objetdescription);
create table pathfinder.materielexemplar(
primary key(id))INHERITS(pathfinder.objetexemplar);
create table pathfinder.armedesiegemodel(
nbrdesdgts integer NOT NULL,
typedesdgts integer NOT NULL,
zonecritique integer NOT NULL,
facteurportee integer NOT NULL,
porteemin integer NOT NULL,
serviteurs integer NOT NULL,
primary key(id))INHERITS(pathfinder.objetmodel);
create table pathfinder.armedesiegedescription(
primary key(id))INHERITS(pathfinder.objetdescription);
create table pathfinder.armedesiegeexemplar(
primary key(id))INHERITS(pathfinder.objetexemplar);
create table pathfinder.composantematerielle(
fk_sortmodel_sort integer,
primary key(id))INHERITS(pathfinder.abscomposantesort);
create table pathfinder.composantefocalisateur(
fk_sortmodel_sort integer,
primary key(id))INHERITS(pathfinder.abscomposantesort);
create table pathfinder.objectmagiquemodel(
usage integer NOT NULL,
ecoleaura integer NOT NULL,
puissanceaura integer NOT NULL,
nls integer NOT NULL,
typeobjetmagique integer NOT NULL,
primary key(id))INHERITS(pathfinder.objetmodel);
create table pathfinder.objectmagiquedescription(
primary key(id))INHERITS(pathfinder.objetdescription);
create table pathfinder.objectmagiqueexemplar(
fk_objetintelligent_intelligence integer,
primary key(id))INHERITS(pathfinder.objetexemplar);
create table pathfinder.enchantementarmemodel(
armemelee bool NOT NULL,
armedistance bool NOT NULL,
primary key(id))INHERITS(pathfinder.enchantementobjetmodel);
create table pathfinder.enchantementarmedescription(
primary key(id))INHERITS(pathfinder.enchantementobjetdescription);
create table pathfinder.enchantementarmeexemplar(
primary key(id))INHERITS(pathfinder.enchantementobjetexemplar);
create table pathfinder.enchantementarmuremodel(
armure bool NOT NULL,
bouclier bool NOT NULL,
primary key(id))INHERITS(pathfinder.enchantementobjetmodel);
create table pathfinder.enchantementarmuredescription(
primary key(id))INHERITS(pathfinder.enchantementobjetdescription);
create table pathfinder.enchantementarmureexemplar(
primary key(id))INHERITS(pathfinder.enchantementobjetexemplar);
create table pathfinder.typecreaturemodel(
alignementloi integer NOT NULL,
alignementbien integer NOT NULL,
frequencealignement integer NOT NULL,
formationarmecourante bool NOT NULL,
formationarmeguerre bool NOT NULL,
formationarmure bool NOT NULL,
mange bool NOT NULL,
dors bool NOT NULL,
respire bool NOT NULL,
primary key(id))INHERITS(pathfinder.absdvmodel);
create table pathfinder.typecreaturedescription(
primary key(id))INHERITS(pathfinder.absdvdescription);
create table pathfinder.typecreatureexemplar(
primary key(id))INHERITS(pathfinder.absdvexemplar);
create table pathfinder.particulariteattaquemodel(
primary key(id))INHERITS(pathfinder.particularitemodel);
create table pathfinder.particulariteattaquedescription(
primary key(id))INHERITS(pathfinder.particularitedescription);
create table pathfinder.particulariteattaqueexemplar(
primary key(id))INHERITS(pathfinder.particulariteexemplar);
create table pathfinder.pjmodel(
fk_joueur_id integer,
primary key(id))INHERITS(pathfinder.personnagemodel);
create table pathfinder.pjdescription(
primary key(id))INHERITS(pathfinder.personnagedescription);
create table pathfinder.pjexemplar(
primary key(id))INHERITS(pathfinder.personnageexemplar);
create table pathfinder.pnjmodel(
primary key(id))INHERITS(pathfinder.personnagemodel);
create table pathfinder.pnjdescription(
primary key(id))INHERITS(pathfinder.personnagedescription);
create table pathfinder.pnjexemplar(
primary key(id))INHERITS(pathfinder.personnageexemplar);
create table pathfinder.monstremodel(
primary key(id))INHERITS(pathfinder.personnagemodel);
create table pathfinder.monstredescription(
primary key(id))INHERITS(pathfinder.personnagedescription);
create table pathfinder.monstreexemplar(
primary key(id))INHERITS(pathfinder.personnageexemplar);
create table pathfinder.foyerinhabituelmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.foyerinhabitueldescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.foyerinhabituelexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.circonstancesnaissancemodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.circonstancesnaissancedescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.circonstancesnaissanceexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.professionparentsmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.professionparentsdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.professionparentsexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.raceparentsadoptifsmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.raceparentsadoptifsdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.raceparentsadoptifsexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.noblessemodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.noblessedescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.noblesseexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.evenementenfancemodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.evenementenfancedescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.evenementenfanceexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.historiqueclassemodel(
fk_classemodel_classe integer,
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.historiqueclassedescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.historiqueclasseexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.associeinfluentmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.associeinfluentdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.associeinfluentexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.conflitmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.conflitdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.conflitexemplar(
fk_origineconflitmodel_origine integer,
fk_resolutionconflitmodel_resolution integer,
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.acteurconflitmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.acteurconflitdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.acteurconflitexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.origineconflitmodel(
pcon integer NOT NULL,
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.origineconflitdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.origineconflitexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.relationamoureusemodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.relationamoureusedescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.relationamoureuseexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.relationaveccompagnonsmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.relationaveccompagnonsdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.relationaveccompagnonsexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.handicapmodel(
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.handicapdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.handicapexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.lucratifitrmmodel(
recettes integer NOT NULL,
recettesor bool NOT NULL,
recettesmarchandises bool NOT NULL,
recettesinfluence bool NOT NULL,
recettestravail bool NOT NULL,
recettesmagie bool NOT NULL,
duree integer NOT NULL,
taillemin integer NOT NULL,
taillemax integer NOT NULL,
primary key(id))INHERITS(pathfinder.constructibleitrmmodel);
create table pathfinder.lucratifitrmdescription(
avantage text NOT NULL,
primary key(id))INHERITS(pathfinder.constructibleitrmdescription);
create table pathfinder.lucratifitrmexemplar(
primary key(id))INHERITS(pathfinder.constructibleitrmexemplar);
create table pathfinder.batimentitrmmodel(
primary key(id))INHERITS(pathfinder.constructibleitrmmodel);
create table pathfinder.batimentitrmdescription(
primary key(id))INHERITS(pathfinder.constructibleitrmdescription);
create table pathfinder.batimentitrmexemplar(
primary key(id))INHERITS(pathfinder.constructibleitrmexemplar);
create table pathfinder.organisationitrmmodel(
primary key(id))INHERITS(pathfinder.constructibleitrmmodel);
create table pathfinder.organisationitrmdescription(
primary key(id))INHERITS(pathfinder.constructibleitrmdescription);
create table pathfinder.organisationitrmexemplar(
primary key(id))INHERITS(pathfinder.constructibleitrmexemplar);
create table pathfinder.evenementbatimentitrmmodel(
fk_batimentitrmmodel_batiment integer,
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.evenementbatimentitrmdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.evenementbatimentitrmexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.evenementorganisationitrmmodel(
fk_organisationitrmmodel_organisation integer,
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.evenementorganisationitrmdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.evenementorganisationitrmexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.evenementmodel(
continu bool NOT NULL,
royaume bool NOT NULL,
communaute bool NOT NULL,
nefaste bool NOT NULL,
primary key(id))INHERITS(pathfinder.absoddtablemodel);
create table pathfinder.evenementdescription(
primary key(id))INHERITS(pathfinder.absoddtabledescription);
create table pathfinder.evenementexemplar(
primary key(id))INHERITS(pathfinder.absoddtableexemplar);
create table pathfinder.classemodel(
classepnj bool NOT NULL,
primary key(id))INHERITS(pathfinder.absclassemodel);
create table pathfinder.classedescription(
primary key(id))INHERITS(pathfinder.absclassedescription);
create table pathfinder.classeexemplar(
primary key(id))INHERITS(pathfinder.absclasseexemplar);
create table pathfinder.classeprestigemodel(
primary key(id))INHERITS(pathfinder.absclassemodel);
create table pathfinder.classeprestigedescription(
primary key(id))INHERITS(pathfinder.absclassedescription);
create table pathfinder.classeprestigeexemplar(
primary key(id))INHERITS(pathfinder.absclasseexemplar);
create table pathfinder.pouvoirragemodel(
primary key(id))INHERITS(pathfinder.pouvoirspecialclassemodel);
create table pathfinder.pouvoirragedescription(
primary key(id))INHERITS(pathfinder.pouvoirspecialclassedescription);
create table pathfinder.pouvoirrageexemplar(
primary key(id))INHERITS(pathfinder.pouvoirspecialclasseexemplar);
create table pathfinder.representationbardiquemodel(
primary key(id))INHERITS(pathfinder.pouvoirspecialclassemodel);
create table pathfinder.representationbardiquedescription(
primary key(id))INHERITS(pathfinder.pouvoirspecialclassedescription);
create table pathfinder.representationbardiqueexemplar(
primary key(id))INHERITS(pathfinder.pouvoirspecialclasseexemplar);
create table pathfinder.gracepaladinmodel(
primary key(id))INHERITS(pathfinder.pouvoirspecialclassemodel);
create table pathfinder.gracepaladindescription(
primary key(id))INHERITS(pathfinder.pouvoirspecialclassedescription);
create table pathfinder.gracepaladinexemplar(
primary key(id))INHERITS(pathfinder.pouvoirspecialclasseexemplar);
create table pathfinder.talentsroublardmodel(
maitreroublard bool NOT NULL,
primary key(id))INHERITS(pathfinder.pouvoirspecialclassemodel);
create table pathfinder.talentsroublarddescription(
primary key(id))INHERITS(pathfinder.pouvoirspecialclassedescription);
create table pathfinder.talentsroublardexemplar(
primary key(id))INHERITS(pathfinder.pouvoirspecialclasseexemplar);
create table pathfinder.anneauxmodel(
primary key(id))INHERITS(pathfinder.objectmagiquemodel);
create table pathfinder.anneauxdescription(
primary key(id))INHERITS(pathfinder.objectmagiquedescription);
create table pathfinder.anneauxexemplar(
primary key(id))INHERITS(pathfinder.objectmagiqueexemplar);
create table pathfinder.armemagiquemodel(
fk_armeexemplar_arme integer,
primary key(id))INHERITS(pathfinder.objectmagiquemodel);
create table pathfinder.armemagiquedescription(
primary key(id))INHERITS(pathfinder.objectmagiquedescription);
create table pathfinder.armemagiqueexemplar(
primary key(id))INHERITS(pathfinder.objectmagiqueexemplar);
create table pathfinder.armuremagiquemodel(
fk_armureexemplar_armure integer,
primary key(id))INHERITS(pathfinder.objectmagiquemodel);
create table pathfinder.armuremagiquedescription(
primary key(id))INHERITS(pathfinder.objectmagiquedescription);
create table pathfinder.armuremagiqueexemplar(
primary key(id))INHERITS(pathfinder.objectmagiqueexemplar);
create table pathfinder.batonmodel(
primary key(id))INHERITS(pathfinder.objectmagiquemodel);
create table pathfinder.batondescription(
primary key(id))INHERITS(pathfinder.objectmagiquedescription);
create table pathfinder.batonexemplar(
chargesrestantes integer NOT NULL,
primary key(id))INHERITS(pathfinder.objectmagiqueexemplar);
create table pathfinder.objetmerveilleuxmodel(
emplacement integer NOT NULL,
primary key(id))INHERITS(pathfinder.objectmagiquemodel);
create table pathfinder.objetmerveilleuxdescription(
primary key(id))INHERITS(pathfinder.objectmagiquedescription);
create table pathfinder.objetmerveilleuxexemplar(
primary key(id))INHERITS(pathfinder.objectmagiqueexemplar);
create table pathfinder.sceptremodel(
primary key(id))INHERITS(pathfinder.objectmagiquemodel);
create table pathfinder.sceptredescription(
primary key(id))INHERITS(pathfinder.objectmagiquedescription);
create table pathfinder.sceptreexemplar(
primary key(id))INHERITS(pathfinder.objectmagiqueexemplar);
create table pathfinder.sallebatimentitrmmodel(
extension bool NOT NULL,
primary key(id))INHERITS(pathfinder.lucratifitrmmodel);
create table pathfinder.sallebatimentitrmdescription(
primary key(id))INHERITS(pathfinder.lucratifitrmdescription);
create table pathfinder.sallebatimentitrmexemplar(
nbr integer NOT NULL,
primary key(id))INHERITS(pathfinder.lucratifitrmexemplar);
create table pathfinder.employeitrmmodel(
primary key(id))INHERITS(pathfinder.lucratifitrmmodel);
create table pathfinder.employeitrmdescription(
primary key(id))INHERITS(pathfinder.lucratifitrmdescription);
create table pathfinder.employeitrmexemplar(
primary key(id))INHERITS(pathfinder.lucratifitrmexemplar);
| true |
0cf85046277f6a37508112ca507acd015d766988 | SQL | typilus/typilus | /src/data_preparation/metadata/bigquery4TypedPyRepos.sql | UTF-8 | 586 | 3.40625 | 3 | [
"MIT"
] | permissive | CREATE TEMP FUNCTION check4Typing(arr ARRAY<STRING>)
RETURNS BOOL
LANGUAGE js AS """
return arr && arr.some(function(ele) {
return ele.startsWith("import typing") || ele.startsWith("from typing import") || ele.includes("# type: ") ;
});
""";
WITH typedRepos AS (
SELECT sample_repo_name AS repo
FROM `fh-bigquery.github_extracts.contents_py`
WHERE check4Typing(SPLIT(content, "\n"))
GROUP BY repo
)
SELECT repo
FROM typedRepos INNER JOIN `fh-bigquery.github_extracts.repo_stars` AS repoStars
ON typedRepos.repo = repoStars.repo_name
ORDER BY stars DESC
LIMIT 1000;
| true |
5aaac1b62fab3283a5250ebbaa9be6676c62320c | SQL | chembl/unichem2index | /alter/spool2M.sql | UTF-8 | 986 | 3.203125 | 3 | [
"MIT"
] | permissive | set colsep "|"
set echo off
set termout off
set underline off
set heading off
set feedback off
set linesize 32767
set trimspool on
set trimout on
set verify off
set newpage 0
set pagesize 0
spool /opt/unichem/csv_file2M.csv
SELECT UCI || '|' || STANDARDINCHI || '|' || STANDARDINCHIKEY || '|' || PARENT_SMILES || '|' || SRC_COMPOUND_ID || '|' || src_id || '|' || NAME_LONG || '|' || NAME_LABEL || '|' || DESCRIPTION || '|' || BASE_ID_URL
FROM (
SELECT uc.UCI,
uc.STANDARDINCHI,
uc.STANDARDINCHIKEY,
pa.PARENT_SMILES,
xref.SRC_COMPOUND_ID,
so.src_id,
so.NAME_LONG,
so.NAME_LABEL,
so.DESCRIPTION,
so.BASE_ID_URL
FROM UC_INCHI UC,
SS_PARENTS pa,
UC_SOURCE@reader1dblink so,
UC_XREF@reader1dblink xref
WHERE xref.UCI = uc.UCI
AND UC.UCI >= 0
AND UC.UCI < 2000000
AND uc.UCI = pa.UCI
AND xref.src_id = so.src_id
);
spool off
| true |
63907573b8b377beb8237b315cdbdb14402a9610 | SQL | The-Ark-Informatics/ark | /ark-database/db-scripts/patch/20110711_v0.1.3/mysql/20110720_study_2_unit_type_schemaPatch.sql | UTF-8 | 929 | 4 | 4 | [] | no_license | use study;
CREATE TABLE `study`.`unit_type` (
`ID` INT NOT NULL AUTO_INCREMENT ,
`NAME` VARCHAR(45) NOT NULL ,
`DESCRIPTION` VARCHAR(255) NULL ,
PRIMARY KEY (`ID`) ,
UNIQUE INDEX `NAME_UNIQUE` (`NAME` ASC) )
ENGINE = InnoDB;
-- Make add an additional column FK to ArkModule (in case units will need to be separated per module)
ALTER TABLE `study`.`unit_type` ADD COLUMN `ARK_MODULE_ID` INT NULL DEFAULT NULL AFTER `DESCRIPTION`
, DROP INDEX `NAME_UNIQUE`
, ADD UNIQUE INDEX `NAME_MODULE_UNIQUE` (`NAME` ASC, `ARK_MODULE_ID` ASC) ;
ALTER TABLE `study`.`unit_type` CHANGE COLUMN `ARK_MODULE_ID` `ARK_MODULE_ID` INT(11) NULL DEFAULT NULL AFTER `ID` ;
ALTER TABLE `study`.`unit_type`
ADD CONSTRAINT `FK_UNIT_TYPE_ARK_MODULE_ID`
FOREIGN KEY (`ARK_MODULE_ID` )
REFERENCES `study`.`ark_module` (`ID` )
ON DELETE NO ACTION
ON UPDATE NO ACTION
, ADD INDEX `FK_UNIT_TYPE_ARK_MODULE_ID` (`ARK_MODULE_ID` ASC) ;
| true |
75937c7c7970b8dbbdb419cf42affaf6b73c2763 | SQL | dextra/pganalytics_community | /node_pga_2_0/pga/sql/sostats_cpuusage.sql | UTF-8 | 511 | 3.609375 | 4 | [
"PostgreSQL"
] | permissive | SELECT
timestamp AS "datetime",
_user AS "cpu_user_perc",
_system AS "cpu_system_perc",
_nice AS "cpu_nice_perc",
_iowait AS "cpu_iowait_perc",
_steal AS "cpu_steal_perc",
_idle AS "cpu_idle_perc"
FROM sn_sysstat_cpu d
INNER JOIN sn_stat_snapshot sss ON (sss.snap_id = d.snap_id)
WHERE 1=1
AND sss.customer_id = ${customer_id}
AND sss.server_id = ${server_id}
AND sss.datetime >= ${date_from}::timestamptz
AND sss.datetime <= ${date_to}::timestamptz + '1 minute'::interval
AND d.cpu = -1
ORDER BY d.timestamp;
| true |
63f298619ce9003a1e5c98fa5978671870065b1a | SQL | wendyar/turing | /datos/datos_servidor.sql | UTF-8 | 14,831 | 3.1875 | 3 | [] | no_license | /**
* @Author: Wendy Guadalupe Magaña Argente <wendylu>
* @Date: 2017-09-06T03:21:57-05:00
* @Email: wendyargente@nube.unadmexico.mx
* @Project: Turing
* @Filename: localhost.sql
* @Last modified by: wendylu
* @Last modified time: 2017-09-06T03:24:27-05:00
* @License: MIT
*/
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Sep 06, 2017 at 08:21 AM
-- Server version: 10.1.20-MariaDB
-- PHP Version: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `id2705905_biblioteca`
--
CREATE DATABASE IF NOT EXISTS `id2705905_biblioteca` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE `id2705905_biblioteca`;
-- --------------------------------------------------------
--
-- Table structure for table `autor`
--
CREATE TABLE `autor` (
`id` int(11) NOT NULL,
`nombres` varchar(45) DEFAULT NULL,
`apellidos` varchar(45) DEFAULT NULL,
`pais_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `autor`
--
INSERT INTO `autor` (`id`, `nombres`, `apellidos`, `pais_id`) VALUES
(1, 'BRAUN', 'E.', 246),
(2, 'Agudelo Fernández', 'F.', 246),
(3, 'Ray ', 'Bradbury', 230),
(4, 'Herbert George', 'Wells', 229),
(5, 'Orson Scott ', 'Card', 230),
(6, 'Stephen', 'Hawking', 229),
(7, 'Isaac', 'Asimov', 182),
(8, 'Philip', 'K. Dick', 230),
(9, 'Carl', 'Sagan', 230),
(10, 'Andy', 'Weir', 230);
-- --------------------------------------------------------
--
-- Table structure for table `categorias`
--
CREATE TABLE `categorias` (
`id` int(11) NOT NULL,
`nombre` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `categorias`
--
INSERT INTO `categorias` (`id`, `nombre`) VALUES
(1, 'Tecnología'),
(2, 'Ciencia Ficción'),
(3, 'Cuentos y relatos'),
(4, 'Misterio y suspenso'),
(5, 'Astronomía'),
(6, 'Filosofía');
-- --------------------------------------------------------
--
-- Table structure for table `historial`
--
CREATE TABLE `historial` (
`usuario_id` int(11) NOT NULL,
`libro_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `libro`
--
CREATE TABLE `libro` (
`id` int(11) NOT NULL,
`titulo` varchar(45) DEFAULT NULL,
`descripcion` text,
`autor_id` int(11) NOT NULL,
`categorias_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `libro`
--
INSERT INTO `libro` (`id`, `titulo`, `descripcion`, `autor_id`, `categorias_id`) VALUES
(1, 'Tecnología Rebelde', 'Constituye un libro útil para explorar y ejem', 1, 1),
(2, 'Crónicas marcianas', 'Crónicas marcianas es una serie de relatos del escritor estadounidense Ray Bradbury. Los relatos carecen de una línea argumental lineal fija, pero la referencia contextual y temporal es la misma en todos ellos.', 3, 2),
(3, 'La máquina del tiempo', 'La máquina del tiempo es una novela de ficción del escritor británico Herbert George Wells, publicada por primera vez en Londres en el año 1895 por William Heinemann. Consta de dieciséis capítulos y un epílogo.', 4, 2),
(4, 'El juego de Ender', 'El juego de Ender es la novela más conocida de Orson Scott Card. Obtuvo los dos premios más prestigiosos de la ciencia ficción: el Premio Nébula a la mejor novela en 1985 y el Premio Hugo a la mejor novela en 1986.', 5, 2),
(5, 'Los ojos de Davidson', 'Los cuentos incluidos en este volumen ejemplifican la variedad de la imaginación de Wells, y, porque nos parecen absolutamente originales, proponen lecturas paralelas en la obra de otros autores más o menos alejados.', 4, 3),
(6, 'La isla del Dr. Moreau', 'Publicada en 1896, entre «La máquina del tiempo» y «El hombre invisible», La isla del Dr. Moreau es una de las novelas más inquietantes de la literatura moderna, inscribiéndose de lleno en la crítica y ominosa intuición que H.G. Wells (1866-1946) ', 4, 4),
(7, 'A Brief History of Time', 'Breve historia del tiempo o Historia del tiempo: del Big Bang a los agujeros negros es un libro de divulgación científica escrito por el físico británico Stephen Hawking, prologado por Carl Sagan y publicado por primera vez en 1988.', 6, 5),
(8, 'Yo, Robot', 'Yo, robot, de Isaac Asimov, es un volumen publicado en 1950 en el que se recogen una serie de relatos enlazados por la temática y el hilo argumental.', 7, 2),
(9, 'Ubik', 'Ubik es una novela de ciencia ficción escrita en 1969 por Philip K. Dick, donde trata principalmente de numerosas realidades o universos, cada uno dentro de otro. Además incluye ideas de la vida después de la muerte.', 8, 2),
(10, 'El fin de la eternidad', 'El fin de la eternidad es una novela de ciencia ficción escrita por Isaac Asimov en 1955. La novela trata sobre el tema de una sociedad capaz de viajar a través del tiempo y cuenta con abundantes elementos de misterio y suspense.', 7, 2),
(11, 'El mundo y sus demonios', 'El mundo y sus demonios. La ciencia como una luz en la oscuridad, es un libro de Carl Sagan publicado en 1995 que intenta explicar el método científico al ciudadano corriente, y anima a los lectores a utilizar el pensamiento crítico o escéptico.', 9, 6),
(12, 'El marciano', 'El marciano es la novela debut del escritor estadounidense Andy Weir. Fue originalmente autopublicada en 2011, tras lo cual Crown Publishing adquirió los derechos reeditándola en 2014.', 10, 2);
-- --------------------------------------------------------
--
-- Table structure for table `pais`
--
CREATE TABLE `pais` (
`id` int(11) NOT NULL,
`nombre` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Dumping data for table `pais`
--
INSERT INTO `pais` (`id`, `nombre`) VALUES
(1, 'Afghanistan'),
(2, 'Albania'),
(3, 'Algeria'),
(4, 'American Samoa'),
(5, 'Andorra'),
(6, 'Angola'),
(7, 'Anguilla'),
(8, 'Antarctica'),
(9, 'Antigua and Barbuda'),
(10, 'Argentina'),
(11, 'Armenia'),
(12, 'Aruba'),
(13, 'Australia'),
(14, 'Austria'),
(15, 'Azerbaijan'),
(16, 'Bahamas'),
(17, 'Bahrain'),
(18, 'Bangladesh'),
(19, 'Barbados'),
(20, 'Belarus'),
(21, 'Belgium'),
(22, 'Belize'),
(23, 'Benin'),
(24, 'Bermuda'),
(25, 'Bhutan'),
(26, 'Bolivia'),
(27, 'Bosnia and Herzegovina'),
(28, 'Botswana'),
(29, 'Bouvet Island'),
(30, 'Brazil'),
(31, 'British Indian Ocean Territory'),
(32, 'Brunei Darussalam'),
(33, 'Bulgaria'),
(34, 'Burkina Faso'),
(35, 'Burundi'),
(36, 'Cambodia'),
(37, 'Cameroon'),
(38, 'Canada'),
(39, 'Cape Verde'),
(40, 'Cayman Islands'),
(41, 'Central African Republic'),
(42, 'Chad'),
(43, 'Chile'),
(44, 'China'),
(45, 'Christmas Island'),
(46, 'Cocos (Keeling) Islands'),
(47, 'Colombia'),
(48, 'Comoros'),
(49, 'Congo'),
(50, 'Cook Islands'),
(51, 'Costa Rica'),
(52, 'Croatia (Hrvatska)'),
(53, 'Cuba'),
(54, 'Cyprus'),
(55, 'Czech Republic'),
(56, 'Denmark'),
(57, 'Djibouti'),
(58, 'Dominica'),
(59, 'Dominican Republic'),
(60, 'East Timor'),
(61, 'Ecuador'),
(62, 'Egypt'),
(63, 'El Salvador'),
(64, 'Equatorial Guinea'),
(65, 'Eritrea'),
(66, 'Estonia'),
(67, 'Ethiopia'),
(68, 'Falkland Islands (Malvinas)'),
(69, 'Faroe Islands'),
(70, 'Fiji'),
(71, 'Finland'),
(72, 'France'),
(73, 'France, Metropolitan'),
(74, 'French Guiana'),
(75, 'French Polynesia'),
(76, 'French Southern Territories'),
(77, 'Gabon'),
(78, 'Gambia'),
(79, 'Georgia'),
(80, 'Germany'),
(81, 'Ghana'),
(82, 'Gibraltar'),
(83, 'Guernsey'),
(84, 'Greece'),
(85, 'Greenland'),
(86, 'Grenada'),
(87, 'Guadeloupe'),
(88, 'Guam'),
(89, 'Guatemala'),
(90, 'Guinea'),
(91, 'Guinea-Bissau'),
(92, 'Guyana'),
(93, 'Haiti'),
(94, 'Heard and Mc Donald Islands'),
(95, 'Honduras'),
(96, 'Hong Kong'),
(97, 'Hungary'),
(98, 'Iceland'),
(99, 'India'),
(100, 'Isle of Man'),
(101, 'Indonesia'),
(102, 'Iran (Islamic Republic of)'),
(103, 'Iraq'),
(104, 'Ireland'),
(105, 'Israel'),
(106, 'Italy'),
(107, 'Ivory Coast'),
(108, 'Jersey'),
(109, 'Jamaica'),
(110, 'Japan'),
(111, 'Jordan'),
(112, 'Kazakhstan'),
(113, 'Kenya'),
(114, 'Kiribati'),
(115, 'Korea, Democratic People\'s Republic of'),
(116, 'Korea, Republic of'),
(117, 'Kosovo'),
(118, 'Kuwait'),
(119, 'Kyrgyzstan'),
(120, 'Lao People\'s Democratic Republic'),
(121, 'Latvia'),
(122, 'Lebanon'),
(123, 'Lesotho'),
(124, 'Liberia'),
(125, 'Libyan Arab Jamahiriya'),
(126, 'Liechtenstein'),
(127, 'Lithuania'),
(128, 'Luxembourg'),
(129, 'Macau'),
(130, 'Macedonia'),
(131, 'Madagascar'),
(132, 'Malawi'),
(133, 'Malaysia'),
(134, 'Maldives'),
(135, 'Mali'),
(136, 'Malta'),
(137, 'Marshall Islands'),
(138, 'Martinique'),
(139, 'Mauritania'),
(140, 'Mauritius'),
(141, 'Mayotte'),
(142, 'Mexico'),
(143, 'Micronesia, Federated States of'),
(144, 'Moldova, Republic of'),
(145, 'Monaco'),
(146, 'Mongolia'),
(147, 'Montenegro'),
(148, 'Montserrat'),
(149, 'Morocco'),
(150, 'Mozambique'),
(151, 'Myanmar'),
(152, 'Namibia'),
(153, 'Nauru'),
(154, 'Nepal'),
(155, 'Netherlands'),
(156, 'Netherlands Antilles'),
(157, 'New Caledonia'),
(158, 'New Zealand'),
(159, 'Nicaragua'),
(160, 'Niger'),
(161, 'Nigeria'),
(162, 'Niue'),
(163, 'Norfolk Island'),
(164, 'Northern Mariana Islands'),
(165, 'Norway'),
(166, 'Oman'),
(167, 'Pakistan'),
(168, 'Palau'),
(169, 'Palestine'),
(170, 'Panama'),
(171, 'Papua New Guinea'),
(172, 'Paraguay'),
(173, 'Peru'),
(174, 'Philippines'),
(175, 'Pitcairn'),
(176, 'Poland'),
(177, 'Portugal'),
(178, 'Puerto Rico'),
(179, 'Qatar'),
(180, 'Reunion'),
(181, 'Romania'),
(182, 'Russian Federation'),
(183, 'Rwanda'),
(184, 'Saint Kitts and Nevis'),
(185, 'Saint Lucia'),
(186, 'Saint Vincent and the Grenadines'),
(187, 'Samoa'),
(188, 'San Marino'),
(189, 'Sao Tome and Principe'),
(190, 'Saudi Arabia'),
(191, 'Senegal'),
(192, 'Serbia'),
(193, 'Seychelles'),
(194, 'Sierra Leone'),
(195, 'Singapore'),
(196, 'Slovakia'),
(197, 'Slovenia'),
(198, 'Solomon Islands'),
(199, 'Somalia'),
(200, 'South Africa'),
(201, 'South Georgia South Sandwich Islands'),
(202, 'Spain'),
(203, 'Sri Lanka'),
(204, 'St. Helena'),
(205, 'St. Pierre and Miquelon'),
(206, 'Sudan'),
(207, 'Suriname'),
(208, 'Svalbard and Jan Mayen Islands'),
(209, 'Swaziland'),
(210, 'Sweden'),
(211, 'Switzerland'),
(212, 'Syrian Arab Republic'),
(213, 'Taiwan'),
(214, 'Tajikistan'),
(215, 'Tanzania, United Republic of'),
(216, 'Thailand'),
(217, 'Togo'),
(218, 'Tokelau'),
(219, 'Tonga'),
(220, 'Trinidad and Tobago'),
(221, 'Tunisia'),
(222, 'Turkey'),
(223, 'Turkmenistan'),
(224, 'Turks and Caicos Islands'),
(225, 'Tuvalu'),
(226, 'Uganda'),
(227, 'Ukraine'),
(228, 'United Arab Emirates'),
(229, 'United Kingdom'),
(230, 'United States'),
(231, 'United States minor outlying islands'),
(232, 'Uruguay'),
(233, 'Uzbekistan'),
(234, 'Vanuatu'),
(235, 'Vatican City State'),
(236, 'Venezuela'),
(237, 'Vietnam'),
(238, 'Virgin Islands (British)'),
(239, 'Virgin Islands (U.S.)'),
(240, 'Wallis and Futuna Islands'),
(241, 'Western Sahara'),
(242, 'Yemen'),
(243, 'Zaire'),
(244, 'Zambia'),
(245, 'Zimbabwe');
-- --------------------------------------------------------
--
-- Table structure for table `permisos`
--
CREATE TABLE `permisos` (
`id` int(11) NOT NULL,
`nombre` varchar(45) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `usuario`
--
CREATE TABLE `usuario` (
`id` int(11) NOT NULL,
`nombreUsuario` varchar(45) DEFAULT NULL,
`nombreReal` varchar(45) DEFAULT NULL,
`contrasena` varchar(45) DEFAULT NULL,
`correo` varchar(45) DEFAULT NULL,
`fechaRegistro` datetime DEFAULT NULL,
`permisos_id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `autor`
--
ALTER TABLE `autor`
ADD PRIMARY KEY (`id`),
ADD KEY `fk_autor_pais_idx` (`pais_id`);
--
-- Indexes for table `categorias`
--
ALTER TABLE `categorias`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `historial`
--
ALTER TABLE `historial`
ADD PRIMARY KEY (`usuario_id`,`libro_id`),
ADD KEY `fk_usuario_has_libro_libro1_idx` (`libro_id`),
ADD KEY `fk_usuario_has_libro_usuario1_idx` (`usuario_id`);
--
-- Indexes for table `libro`
--
ALTER TABLE `libro`
ADD PRIMARY KEY (`id`,`autor_id`,`categorias_id`),
ADD KEY `fk_libro_autor1_idx` (`autor_id`),
ADD KEY `fk_libro_categorias1_idx` (`categorias_id`);
--
-- Indexes for table `pais`
--
ALTER TABLE `pais`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `permisos`
--
ALTER TABLE `permisos`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `usuario`
--
ALTER TABLE `usuario`
ADD PRIMARY KEY (`id`,`permisos_id`),
ADD KEY `fk_usuario_permisos1_idx` (`permisos_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `autor`
--
ALTER TABLE `autor`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `categorias`
--
ALTER TABLE `categorias`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `libro`
--
ALTER TABLE `libro`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `pais`
--
ALTER TABLE `pais`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=247;
--
-- AUTO_INCREMENT for table `permisos`
--
ALTER TABLE `permisos`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `usuario`
--
ALTER TABLE `usuario`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `autor`
--
ALTER TABLE `autor`
ADD CONSTRAINT `fk_autor_pais` FOREIGN KEY (`pais_id`) REFERENCES `pais` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `historial`
--
ALTER TABLE `historial`
ADD CONSTRAINT `fk_usuario_has_libro_libro1` FOREIGN KEY (`libro_id`) REFERENCES `libro` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_usuario_has_libro_usuario1` FOREIGN KEY (`usuario_id`) REFERENCES `usuario` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `libro`
--
ALTER TABLE `libro`
ADD CONSTRAINT `fk_libro_autor1` FOREIGN KEY (`autor_id`) REFERENCES `autor` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION,
ADD CONSTRAINT `fk_libro_categorias1` FOREIGN KEY (`categorias_id`) REFERENCES `categorias` (`id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
--
-- Constraints for table `usuario`
--
ALTER TABLE `usuario`
ADD CONSTRAINT `fk_usuario_permisos1` FOREIGN KEY (`permisos_id`) REFERENCES `permisos` (`id`) 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 |
63791614edefbd9d0ec0f93dcf1da33230001539 | SQL | Aren-Stark/Java-FSE | /Java Basics Learning Path - Stage 1/SQL Programming/Databse Management/Car rental system - Create Table/query.sql | UTF-8 | 994 | 3.453125 | 3 | [] | no_license | CREATE TABLE Owners (
owner_id VARCHAR(10) NOT NULL,
owner_name VARCHAR(20) NULL,
address VARCHAR(20)NULL,
phone_no BIGINT NULL,
email_id VARCHAR(20) NULL,
PRIMARY KEY (owner_id)
);
CREATE TABLE Cars (
car_id VARCHAR(10) NOT NULL PRIMARY KEY,
car_name VARCHAR(20) NULL,
car_type VARCHAR(20) NULL,
owner_id VARCHAR(10) NULL,
FOREIGN KEY (owner_id) REFERENCES Owners(owner_id)
);
CREATE TABLE Customers (
customer_id VARCHAR(10) NOT NULL PRIMARY KEY,
customer_name VARCHAR(20) NULL,
address VARCHAR(20)NULL,
phone_no BIGINT NULL,
email_id VARCHAR(20) NULL
);
CREATE TABLE Rentals (
rental_id VARCHAR(10) NOT NULL PRIMARY KEY,
customer_id VARCHAR(10) NULL,
car_id VARCHAR(10) NULL,
pickup_date DATE NULL,
return_date DATE NULL,
km_driven INT NULL,
fare_amount Double(10,2) NULL,
FOREIGN KEY (customer_id) REFERENCES Customers(customer_id),
FOREIGN KEY (car_id) REFERENCES Cars(car_id)
);
| true |
2b5b26f25f91b6aa25c79cf4c9594fca5a3a47dc | SQL | MandyArthur/LearnPhpSqlProjects | /seatbooking/seatbookingdatabase.sql | UTF-8 | 1,794 | 2.75 | 3 | [] | no_license | SELECT * FROM movie;
/*
===========================Buy Domain Table=======================
CREATE TABLE `buy_domain` (
`domain_id` int(64) NOT NULL auto_increment,
`domain_theatre_id` varchar(64) NOT NULL, //Here it is buyer
`domain_name` varchar(128) NOT NULL,
`domain_extension` varchar(128) NOT NULL,
`domain_price` varchar(30) NOT NULL,
PRIMARY KEY (`domain_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=100 ;
============================CONTACT===============================
===========================Requested Domain Table=================
CREATE TABLE `request_domain` (
`request_id` int(64) NOT NULL auto_increment,
`request_domain_id` varchar(64) NOT NULL,
`request_theatre_id` varchar(64) NOT NULL,
PRIMARY KEY (`request_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=100 ;
===========================ShowCase Domain=========================
CREATE TABLE `showcase_domain` (
`showcase_domain_id` int(64) NOT NULL auto_increment,
`showcase_domain_name` varchar(128) NOT NULL,
`showcase_domain_extension` varchar(128) NOT NULL,
`showcase_domain_price` varchar(30) NOT NULL,
PRIMARY KEY (`showcase_domain_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=100 ;
===================================================================
//Not used presently
=====================================VALIDITY=======================
CREATE TABLE `validity`(
`employer_id` int(4) NOT NULL auto_increment,
`plan` varchar(30) NOT NULL,
`number` int(4) NOT NULL,
`validity1` int(4) NOT NULL,
`downloads` int(4) NOT NULL,
`validity2` date NOT NULL,
PRIMARY KEY (`employer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=100;
=====================================================================
*>
| true |
c91267a4d673086f58b0e6a17d6d0a3fcb890417 | SQL | shubhamkj5/Databases | /Stored_Procedure_LAB1.sql | UTF-8 | 1,330 | 3.703125 | 4 | [] | no_license | ####1
Drop View if exists names_department;
CREATE VIEW names_department AS
SELECT concat(firstName, ' ',LastName) as Name, department
FROM details;
select * from names_department;
#####2
Drop procedure if exists update_department;
DELIMITER //
CREATE PROCEDURE update_department
(
id_param INT,
department_param VARCHAR(25)
)
BEGIN
DECLARE sql_error TINYINT DEFAULT FALSE;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
SET sql_error = TRUE;
START TRANSACTION;
UPDATE details
SET department = department_param
WHERE id = id_param;
IF sql_error = FALSE THEN
COMMIT;
ELSE
ROLLBACK;
END IF;
END//
CALL update_department(1, "Swimming");
#####3
Drop procedure if exists update_rate_position;
DELIMITER //
CREATE PROCEDURE update_rate_position
(
IN position_param VARCHAR(25),
IN rate_param INT,
OUT update_count INT
)
BEGIN
DECLARE sql_error TINYINT DEFAULT FALSE;
DECLARE CONTINUE HANDLER FOR SQLEXCEPTION
SET sql_error = TRUE;
START TRANSACTION;
UPDATE details
SET rate = rate+rate*(rate_param/100)
WHERE position = position_param;
IF sql_error = FALSE THEN
SET update_count = 1;
COMMIT;
ELSE
SET update_count = 0;
ROLLBACK;
END IF;
END//
call update_rate_position("Lecturer",10,@update_count)
#Select @update_count; | true |
196b20a30123e583264c451b41b9d8a095532e3e | SQL | Celsocw/bd | /sql m3.sql | UTF-8 | 7,047 | 3.359375 | 3 | [] | no_license | /* colocar 14 dígitos no CNPJ e 11 dígitos no CPF*/
CREATE DATABASE SolNascente;
USE solnascente;
CREATE TABLE condominio(
idCondominio TINYINT(2) PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(50),
cnpj INT(13),
bairro VARCHAR(100),
rua VARCHAR(100),
cep INT(8),
numero INT(8)
);
CREATE TABLE condominos(
idCondominos TINYINT(2) PRIMARY KEY AUTO_INCREMENT,
idCondominio TINYINT(2) NOT NULL,
nome VARCHAR(50),
cpf INT(13),
email VARCHAR(60),
senha VARCHAR(8),
telefone_celular INT(14),
telefone_fixo INT(14),
endereco VARCHAR(100),
bloco VARCHAR(5),
apt INT(4),
CONSTRAINT fk_condominos_condominio FOREIGN KEY (idCondominio) REFERENCES condominio (idCondominio)
);
CREATE TABLE salao(
idSalao TINYINT(2) PRIMARY KEY AUTO_INCREMENT,
idCondominio TINYINT(3),
numero INT(2),
CONSTRAINT fk_sala_condominio FOREIGN KEY (idCondominio) REFERENCES condominio (idCondominio)
);
CREATE TABLE locacao_salao(
idLocacao_salao TINYINT(2) PRIMARY KEY AUTO_INCREMENT,
idCondominio TINYINT(3),
idSalao TINYINT(2),
idCondominos TINYINT(2),
CONSTRAINT fk_locacao_salao_condominio FOREIGN KEY (idCondominio) REFERENCES condominio (idCondominio),
CONSTRAINT fk_locacao_salao_salao FOREIGN KEY (idSalao) REFERENCES salao (idSalao),
CONSTRAINT fk_locacao_salao_condominos FOREIGN KEY (idCondominos) REFERENCES condominos (idCondominos)
);
CREATE TABLE funcionarios(
idFuncionarios TINYINT(3) PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(50),
cpf INT(13),
turno CHAR(1),
funcao VARCHAR(15),
salario FLOAT(9),
endereco VARCHAR(100),
idCondominio TINYINT(3),
CONSTRAINT fk_funcionarios_condominio FOREIGN KEY (idCondominio) REFERENCES condominio (idCondominio)
);
CREATE TABLE achados_perdidos(
idAchados_perdidos TINYINT(2) PRIMARY KEY AUTO_INCREMENT,
descricao VARCHAR(255),
idCondominio TINYINT(3),
idFuncionarios TINYINT(3),
CONSTRAINT fk_achados_perdidos_condominio FOREIGN KEY (idCondominio) REFERENCES condominio (idCondominio),
CONSTRAINT fk_achados_perdidos_funcionarios FOREIGN KEY (idCondominio) REFERENCES funcionarios (idFuncionarios)
);
CREATE TABLE categoria_ocorrencia(
idCategoria_ocorrencia TINYINT(3) PRIMARY KEY AUTO_INCREMENT,
severidade VARCHAR(10)
);
CREATE TABLE ocorrencia(
idOcorrencia TINYINT(3) PRIMARY KEY AUTO_INCREMENT,
idCategoria_ocorrencia TINYINT(4),
idCondominio TINYINT(3),
descricao VARCHAR(100),
CONSTRAINT fk_ocorrencia_categoria_ocorrencia FOREIGN KEY (idCategoria_ocorrencia) REFERENCES categoria_ocorrencia (idCategoria_ocorrencia),
CONSTRAINT fk_ocorrencia_condominio FOREIGN KEY (idCondominio) REFERENCES condominio (idCondominio)
);
INSERT INTO condominio (nome, cnpj, bairro, rua, cep, numero) VALUES
('Acácia Imperial',0000147852369, 'Esperança', 'agustin24', 12548725,38),
('Alto Boa Vista',0000321546874, 'Coliseu', 'augustin26', 12547843, 39);
INSERT INTO condominos (idCondominio, nome, cpf, email, senha, telefone_celular, telefone_fixo, endereco, bloco, apt) VALUES
(1, 'Marcelo', 00123514852, 'marcelo.albert.reis@hotmail.com', 3128, 01984835997,01984835997, 'Esperanca', 'A', 01),
(2, 'Gabriel', 00518717671, 'gabriel@hotmail.com', 2831, 01984838727,0198483217, 'Coliseu', 'A', 02);
INSERT INTO salao (idCondominio, numero) VALUES
(1,001),(1,002),(1,003);
INSERT INTO locacao_salao (idCondominio, idSalao, idCondominos) VALUES
(2,1,2),(1,2,1);
INSERT INTO funcionarios (nome, cpf, turno, funcao, salario, endereco, idCondominio) VALUES
('Celso',00012354524,'M','diretor',40000.00, 'Esperanca', 1),
('Marcos',00054787821,'V','diretor',40000.00, 'Coliseu', 2),
('Dante',00059877821,'V','diretor geral',400000.00, 'Esperanca', 1),
('Zeca',00054787351,'N','Zelador',1200.00, 'Esperanca', 1),
('Matheus',00054788791,'M','organizador',500.00, 'Coliseu', 2);
INSERT INTO achados_perdidos (descricao, idCondominio, idFuncionarios) VALUES
('Iphone X esquecido no dia 01/07/21',1,1),
('Notebook com Windows 11 esquecido no dia 02/07/21',1,2);
INSERT INTO categoria_ocorrencia (severidade) VALUES
('Baixa'),
('Media'),
('Alta');
INSERT INTO ocorrencia (idCategoria_ocorrencia, idCondominio, descricao) VALUES
(2,1, 'O morador Marcelo está incomodando pra caramba aqui, muita havy, muito som alto!'),
(2,1, 'O morador Gabriel está incomodando pra caramba aqui, ele é muito quieto, é preocupante'),
(3,1, 'O Diretor não se mexe para sanar o problema da falta de água às 14 horas da tarde..'),
(1,2, 'O Diretor ainda não cobrou os tributos do condomínio.. Estranho, como proceder?');
/*Consulta as reclamações*/
SELECT cat.severidade, descricao FROM ocorrencia oc
INNER JOIN categoria_ocorrencia cat ON cat.idCategoria_ocorrencia = oc.idCategoria_ocorrencia;
/*Consulta a quantidade total de reclamações*/
SELECT COUNT(cat.idCategoria_ocorrencia) AS Quantidade_Reclamacoes FROM ocorrencia oc
INNER JOIN categoria_ocorrencia cat ON cat.idCategoria_ocorrencia = oc.idCategoria_ocorrencia;
/*Consulta a quantidade de reclamações com severidade media*/
SELECT COUNT(cat.idCategoria_ocorrencia) AS Quantidade_Reclamacoes FROM ocorrencia oc
INNER JOIN categoria_ocorrencia cat ON cat.idCategoria_ocorrencia = oc.idCategoria_ocorrencia
WHERE cat.severidade ="Media" ;
/*Consulta a quantidade de reclamações com severidade media*/
SELECT COUNT(cat.idCategoria_ocorrencia) AS Quantidade_Reclamacoes FROM ocorrencia oc
INNER JOIN categoria_ocorrencia cat ON cat.idCategoria_ocorrencia = oc.idCategoria_ocorrencia
WHERE cat.severidade ="Baixa" ;
/*Consulta os condomínios que tem produtos perdidos*/
SELECT co.nome, ap.descricao FROM achados_perdidos ap
INNER JOIN Condominio co ON co.idCondominio = ap.idAchados_perdidos;
/*Consulta as locações em determinados condomínios*/
SELECT co.nome AS Nome_Condominio, sa.numero AS numero_salao, conds.nome AS Nome_condomino FROM locacao_salao ls
INNER JOIN condominio co ON co.idCondominio = ls.idCondominio
INNER JOIN salao sa ON sa.idSalao = ls.idSalao
INNER JOIN condominos conds ON conds.idCondominos = ls.idCondominos;
/*Consulta maior salário dos funcionários */
SELECT MAX(salario) AS maior_salario, nome from funcionarios;
/*Consulta menor salário dos funcionários */
SELECT MIN(salario) AS menor_salario, nome from funcionarios;
/*Consulta a quantidade de condominos independendo de seus condominios*/
SELECT COUNT(idCondominos) AS Quantidade_Condominos FROM condominos;
/*Consulta a tabela condominio*/
SELECT idCondominio AS identificador, nome, cnpj, bairro, rua, numero,cep FROM condominio;
/*UPDATE com WHERE*/
UPDATE funcionarios SET salario = 1000000 WHERE idFuncionarios = 1;
UPDATE locacao_salao SET idCondominio=1 WHERE idLocacao_salao = 2;
UPDATE ocorrencia SET idCategoria_ocorrencia = 3 WHERE idOcorrencia = 1;
UPDATE funcionarios SET salario = 500 WHERE idFuncionarios = 3;
UPDATE achados_perdidos SET descricao = "Não lembro" WHERE idAchados_perdidos = 2;
/*DELETE com WHERE*/
DELETE FROM funcionarios WHERE idFuncionarios = 3;
DELETE FROM achados_perdidos WHERE idAchados_perdidos = 1;
DELETE FROM locacao_salao WHERE idLocacao_salao = 2;
DELETE FROM ocorrencia WHERE idOcorrencia = 1;
DELETE FROM achados_perdidos WHERE idAchados_perdidos = 2;
| true |
d60f6d7e676842f0085fa9d5e342c572068b9dc7 | SQL | HarrshaVardhan/SQL-Project | /Programming with Mosh/06.Writing Complex Query.sql | UTF-8 | 4,594 | 4.625 | 5 | [] | no_license | /*************************************/
/* Subqueries */
/**************************************/
/* products that are more expensive than lettuce */
USE mosh_sql_store;
SELECT *
FROM products
WHERE unit_price > (
SELECT unit_price FROM products
WHERE name REGEXP('lettuce')
);
/* find employees who earn more than average */
USE mosh_sql_hr;
SELECT *
FROM employees
WHERE salary > (
SELECT AVG(salary) FROM employees
);
/*************************************/
/* IN */
/**************************************/
USE mosh_sql_store;
/* products that have never been ordered*/
SELECT p.product_id, p.name, oi.order_id
FROM products p
LEFT JOIN order_items oi ON oi.product_id = p.product_id
WHERE oi.product_id IS NULL;
SELECT p.product_id, p.name
FROM products p
WHERE p.product_id NOT IN(
SELECT DISTINCT product_id
FROM order_items
);
/* find clients without invoices */
USE mosh_sql_invoicing;
SELECT *
FROM clients
WHERE client_id NOT IN (
SELECT DISTINCT client_id
FROM invoices
);
/*************************************/
/* Subqueries Vs Joins */
/**************************************/
/*customers who have ordered lettuce*/
SELECT DISTINCT c.customer_id, c.first_name, c.last_name
FROM customers c
JOIN orders o ON o.customer_id = c.customer_id
JOIN order_items oi ON oi.order_id = o.order_id
JOIN products p ON p.product_id = oi.product_id
WHERE p.name LIKE '%lettuce%';
/*************************************/
/* ALL keyword */
/*************************************/
/*invoices larger than invoices of client 3*/
USE mosh_sql_invoicing;
SELECT *
FROM invoices
WHERE invoice_total > ALL (
SELECT invoice_total FROM invoices
WHERE client_id = 3
);
SELECT *
FROM invoices
WHERE invoice_total > (
SELECT MAX(invoice_total) FROM invoices
WHERE client_id = 3
);
/*************************************/
/* ANY keyword */
/*************************************/
/*clients with at least 2 invoices*/
SELECT *
FROM clients
WHERE client_id = ANY (
SELECT client_id
FROM invoices
GROUP BY client_id
HAVING COUNT(client_id) >= 2
);
/*************************************/
/* Correlated Subqueries */
/*************************************/
/*employees whose salary is above the average in their office*/
USE mosh_sql_hr;
SELECT *
FROM employees e
WHERE salary > (
SELECT AVG(salary)
FROM employees
WHERE office_id = e.office_id
GROUP BY office_id
);
/*client's own invoices that are larger than client's average invoice amount*/
USE mosh_sql_invoicing;
SELECT *
FROM invoices i
WHERE invoice_total > (
SELECT AVG(invoice_total)
FROM invoices
WHERE client_id = i.client_id
);
/***********************************************************************************/
/* EXISTS Operator */
/* if result set of sub queries is too large, we better use EXISTS rather than IN */
/***********************************************************************************/
/*clients that have an inovice*/
SELECT *
FROM clients c
WHERE EXISTS (
SELECT client_id
FROM invoices
WHERE client_id = c.client_id
);
/*products never been ordered */
SELECT *
FROM products p
WHERE NOT EXISTS(
SELECT product_id
FROM order_items
WHERE product_id = p.product_id
);
SELECT *
FROM products p
WHERE product_id NOT IN(
SELECT product_id
FROM order_items
);
/*************************************/
/* Subqueries in SELECT */
/*************************************/
USE mosh_sql_invoicing;
SELECT client_id,name,
(SELECT SUM(invoice_total) FROM invoices WHERE client_id = c.client_id) AS total_sales,
(SELECT AVG(invoice_total) FROM invoices WHERE client_id = c.client_id) AS average,
(SELECT total_sales - average) AS difference
FROM clients c;
SELECT c.client_id, c.name, SUM(i.invoice_total) AS total_sales,
AVG(i.invoice_total) AS average, SUM(i.invoice_total) - AVG(i.invoice_total) AS difference
FROM invoices i
RIGHT JOIN clients c ON c.client_id = i.client_id
GROUP BY 1;
/*************************************/
/* Subqueries in FROM */
/*************************************/
SELECT *
FROM (
SELECT c.client_id, c.name, SUM(i.invoice_total) AS total_sales,
AVG(i.invoice_total) AS average, SUM(i.invoice_total) - AVG(i.invoice_total) AS difference
FROM invoices i
RIGHT JOIN clients c ON c.client_id = i.client_id
GROUP BY 1
) AS tbl1
WHERE total_sales IS NOT NULL; | true |
ff65a35a050b4247713020757d0f7ad28701945f | SQL | mahmoudshawky123/database-tables | /SQLQuery4.sql | UTF-8 | 886 | 3.015625 | 3 | [] | no_license | create database ibms
use ibms
create table account
(
ID int primary key,username char(20),loginpassword char(25),category varchar(25),picture varchar(100)
)
create table customer
(
ID int primary key,firstname char(20),nextname char(25),books_issued varchar(25),location varchar(100),registeration_date time,picture varchar(100)
)
create table books
(
ID int primary key,name char(20),category varchar(25),author varchar(25),publisher varchar(100),salary int,quantity float
)
create table staff
(
ID int primary key,name char(20),salary int,phone char(30),address varchar(100),email char,picture varchar(100)
)
create table category
(
ID int primary key,category varchar(25)
)
create table salary
(
ID int primary key,bookssalary int,staffsalary int
)
create table booksreturned
(
ID int primary key,bookname char(25),returndate time,IDcutomers int
)
| true |
00dfe621c484ab55f50b29c25ef4bd8da30f8b66 | SQL | Niloy1010/SQL-FINAL-PROJECT-Music-Store- | /Final Project/Scripts/TRIGGERS/trigger_new_client_order_items.sql | UTF-8 | 869 | 3.65625 | 4 | [] | no_license | DROP TRIGGER IF EXISTS new_cliient;
DELIMITER //
CREATE TRIGGER new_cliient
BEFORE INSERT ON order_items
FOR EACH ROW
BEGIN
DECLARE client_id_new_var INT;
DECLARE client_id_client_var INT;
DECLARE row_not_found tinyint DEFAULT FALSE;
DECLARE client_id_cursor CURSOR FOR
SELECT client_id
FROM order_items;
DECLARE CONTINUE HANDLER FOR NOT FOUND
SET row_not_found = TRUE;
SELECT new.client_id
INTO client_id_new_var;
OPEN client_id_cursor;
WHILE row_not_found = FALSE DO
FETCH client_id_cursor into client_id_client_var;
IF client_id_client_var = client_id_new_var THEN
SIGNAL SQLSTATE 'HY000'
SET MESSAGE_TEXT = "Client already exists. Delete client row first from order_items";
END IF;
END WHILE;
CLOSE client_id_cursor;
END//
DELIMITER ; | true |
5b99a6ded46e528d81714f9f4ed8013ab59583e4 | SQL | SeekMentore/SeekMentore | /src/database/mysql/changes/2018-05-08-03-41.sql | UTF-8 | 635 | 2.640625 | 3 | [] | no_license | USE SEEK_MENTORE;
CREATE TABLE LOGON_TRACKER(
LOGON_ID INT NOT NULL AUTO_INCREMENT,
USER_ID VARCHAR(100) NOT NULL,
USER_TYPE VARCHAR(100) NOT NULL,
LOGIN_TIME TIMESTAMP NOT NULL,
LOGIN_FROM VARCHAR(1000),
MACHINE_IP VARCHAR(1000),
PRIMARY KEY (LOGON_ID));
CREATE TABLE PASSWORD_CHANGE_TRACKER(
PASSWORD_CHANGE_ID INT NOT NULL AUTO_INCREMENT,
USER_ID VARCHAR(100) NOT NULL,
USER_TYPE VARCHAR(100) NOT NULL,
CHANGE_TIME TIMESTAMP NOT NULL,
ENCYPTED_PASSWORD_OLD VARCHAR(1000) NOT NULL,
ENCYPTED_PASSWORD_NEW VARCHAR(1000) NOT NULL,
PRIMARY KEY (PASSWORD_CHANGE_ID));
-- Executed till here In Prod Do not write any more create new file
| true |
f209fae322f58e944b6a0f91a8a5c78962e56eed | SQL | replydev/Notes-Server | /queries/create_notes_table.sql | UTF-8 | 206 | 2.609375 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `notes` (
`id` INT(11) NOT NULL,
`data` LONGTEXT NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',
PRIMARY KEY (`id`) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
; | true |
42117c6a7f479441fc07e816fd163668c0f3fb0c | SQL | chaitalizn/employee-tracker | /db/seeds.sql | UTF-8 | 1,009 | 3.03125 | 3 | [] | no_license | INSERT INTO department (name)
VALUES
('General Management'),
('Marketing'),
('Operations'),
('Finance'),
('Sales'),
('IT'),
('HR');
INSERT INTO roles (title, salary, department_id)
VALUES
('Manager', 85000, 1),
('Project manager', 85000, 1),
('Marketing specialist', 70000, 2),
('Business analyst', 75000, 5),
('HR personnel', 65000, 7),
('Accountant', 66000, 4),
('Sales representative', 60000, 5),
('Administrative assistant', 62000, 1),
('Customer Service representative', 55000, 5);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES
('Austin', 'Greene', 1, NULL),
('Christopher', 'Randall', 1, NULL),
('Charles', 'Peters', 2, 1),
('Olivia', 'Anderson', 3, 2),
('Virginia', 'Stewart', 4, 2),
('Max', 'Taylor', 5, 1),
('Eric', 'Underwood', 6, 1),
('Sarah', 'Rampling', 7, 1),
('Michael', 'Walsh', 8, 1),
('Dorothy', 'Smith', 9, 2),
('Anna', 'Avery', 7, 1),
('Chloe', 'Paterson', 6, 1),
('Elizabeth', 'Bell', 8, 2),
('Rachel', 'Simpson', 9, 2),
('Rachel', 'Chapman', 7, 1);
| true |
ad5308332fab538c20f134c04898bdf35b164b5b | SQL | miths1108/PiGen | /codd-data-gen/resources/cdgclient/postgres/projection queries_old/q240.sql | UTF-8 | 136 | 2.53125 | 3 | [] | no_license | SELECT distinct d_year, d_qoy, i_category
FROM web_sales, item, date_dim
WHERE ws_sold_date_sk = d_date_sk
AND ws_item_sk = i_item_sk
;
| true |
17b44bf0376e174820bc43b1c05b5095bf383958 | SQL | tgeary90/PLSQLProject | /new_staff_app.sql | UTF-8 | 890 | 2.890625 | 3 | [] | no_license | REM ************************************
REM EBSY702
REM MINI_PROJECT
REM Created By: Tom Geary
REM Date: 07/01/2012
REM File: new_staff_app.sql
REM ************************************
-- Q9.
-- PL/SQL App to test new_staff procedure
-----------------------------------------
/*
TASOS: PLEASE RUN SCRIPTS:
ASSIGN_OFFICE.SQL
ASSIGN_STAFF.SQL
TO HAVE ACCESS TO THE REQUIRED FUNCTIONS
*/
-----------------------------------------
SET SERVEROUTPUT ON
SET VERIFY OFF
DECLARE
v_gender staff.gender%TYPE := '&gender' ;
e_invalid_gender EXCEPTION ;
BEGIN
IF v_gender NOT IN ('m','f','M','F')
THEN
RAISE e_invalid_gender ;
END IF ;
NEW_STAFF( p_fname => '&fname', p_lname => '&lname', p_s_telno => '&s_telno', p_gender => v_gender ) ;
EXCEPTION
WHEN e_invalid_gender THEN
DBMS_OUTPUT.PUT_LINE( 'FAIL: invalid gender - ' || v_gender ) ;
END ;
/
| true |
5fa18dd0b82c1be203791fb5466a5fe90298bc19 | SQL | fmrone/RestWithAspNetUdemy | /Aula 07 - Repository/RestWithAspNetUdemy/db/migrations/V1_0_7__Recreate_Table_Books.sql | UTF-8 | 258 | 2.53125 | 3 | [] | no_license | use rest_with_asp_net_udemy;
CREATE TABLE IF NOT EXISTS books
(
Id int(10) auto_increment primary key,
Title longtext not null,
Author longtext not null,
LaunchDate datetime(6) not null,
Price decimal(65, 2) not null
)
ENGINE=InnoDB DEFAULT CHARSET=latin1;
| true |
3f02e5b48c1e02464022c37ae426ba75468bcaeb | SQL | github-googleforwork/bvi | /schemas/bigquery/bigquery_custom_schemas/custom/custom_collab_profiles_latest.sql | UTF-8 | 770 | 3.515625 | 4 | [
"Apache-2.0"
] | permissive | -- CUSTOM custom_collab_profiles_latest (view)
-- Review: 25/01/2018
SELECT
ou,
custom_1,
custom_2,
custom_3,
SUM(readers) AS readers,
SUM(creators) AS creators,
SUM(collaborators) AS collaborators,
SUM(sharers) AS sharers,
SUM(anyprofile) AS anyprofile,
SUM(active) AS active,
SUM(idles) AS idles,
ROUND(SUM(readers)/SUM(active), 2) AS P_readers,
ROUND(SUM(creators)/SUM(active), 2) AS P_creators,
ROUND(SUM(collaborators)/SUM(active), 2) AS P_collaborators,
ROUND(SUM(sharers)/SUM(active), 2) AS P_sharers,
ROUND(SUM(idles)/SUM(active), 2) AS P_idles
FROM
[YOUR_PROJECT_ID:custom.custom_collab_profiles]
WHERE
_PARTITIONTIME >= DATE_ADD((SELECT MAX(date) FROM [YOUR_PROJECT_ID:adoption.adoption_30day]),-30,"DAY")
GROUP BY 1,2,3,4
| true |
c4f8be8b90e7f2908c4f071a1de5c31a16fcfbec | SQL | cadl272/civ6mods | /1577362869/ModSupport/CoryModSupport.sql | UTF-8 | 469 | 2.59375 | 3 | [] | no_license | --- YNAEMP
CREATE TABLE IF NOT EXISTS StartPosition (MapName TEXT, Civilization TEXT, Leader TEXT, X INT default 0, Y INT default 0);
INSERT INTO StartPosition
(Civilization, Leader, MapName, X, Y)
VALUES ('CIVILIZATION_CVS_PHILIPPINES', 'LEADER_CIVITAS_CORY', 'GiantEarth', 88, 40),
('CIVILIZATION_CVS_PHILIPPINES', 'LEADER_CIVITAS_CORY', 'GreatestEarthMap', 89, 34),
('CIVILIZATION_CVS_PHILIPPINES', 'LEADER_CIVITAS_CORY', 'CordiformEarth', 69, 34); | true |
96e97e731f82359255921d09b8ac39f9fb60ab25 | SQL | aitalvivem/AitalDisem | /sec/database_creation_tools/sql/script_aitaldisem.sql | UTF-8 | 4,917 | 3.484375 | 3 | [
"MIT"
] | permissive | -- ------------------------------------------------------------
-- Script MySQL.
-- ------------------------------------------------------------
-- ---------------------------------------------------------
-- CREATE DataBase: aitaldisem
-- ---------------------------------------------------------
DROP DATABASE IF EXISTS aitaldisem;
CREATE DATABASE IF NOT EXISTS aitaldisem;
USE aitaldisem;
-- ------------------------------------------------------------
-- Table: Item
-- ------------------------------------------------------------
CREATE TABLE item(
Qid Varchar (50) NOT NULL ,
nomFr Varchar (50) NOT NULL ,
descFr Varchar (255) NOT NULL ,
nomOc Varchar (50) NOT NULL ,
descOc Varchar (255) NOT NULL ,
nomEn Varchar (50) NOT NULL ,
descEn Varchar (255) NOT NULL
,CONSTRAINT item_PK PRIMARY KEY (Qid)
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: Variete
-- ------------------------------------------------------------
CREATE TABLE variete(
idVar Int NOT NULL AUTO_INCREMENT,
varieteCon Varchar (50) NOT NULL ,
varieteWiki Varchar (50) NOT NULL ,
etiquetteFr Varchar (50) NOT NULL ,
etiquetteOc Varchar (50) NOT NULL ,
etiquetteEn Varchar (50) NOT NULL
,CONSTRAINT variete_PK PRIMARY KEY (idVar)
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: Traduction
-- ------------------------------------------------------------
CREATE TABLE traduction(
idTrad Int NOT NULL AUTO_INCREMENT,
orth Varchar (50) NOT NULL
,CONSTRAINT traduction_PK PRIMARY KEY (idTrad)
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: Categorie
-- ------------------------------------------------------------
CREATE TABLE categorie(
codeCat Int NOT NULL AUTO_INCREMENT,
catWiki Varchar (50) NOT NULL ,
etiquetteFr Varchar (50) NOT NULL ,
etiquetteOc Varchar (50) NOT NULL ,
etiquetteEn Varchar (50) NOT NULL ,
priorite Int NOT NULL
,CONSTRAINT categorie_PK PRIMARY KEY (codeCat)
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: Lexeme
-- ------------------------------------------------------------
CREATE TABLE lexeme(
Lid Varchar (50) NOT NULL ,
orth Varchar (50) NOT NULL ,
freq Float NOT NULL ,
codeCat Int NOT NULL ,
erreur Varchar (255) DEFAULT NULL
,CONSTRAINT lexeme_PK PRIMARY KEY (Lid)
,CONSTRAINT lexeme_categorie_FK FOREIGN KEY (codeCat) REFERENCES categorie(codeCat)
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: Logs
-- ------------------------------------------------------------
CREATE TABLE logs(
id Int NOT NULL AUTO_INCREMENT,
Sid Varchar (50) NOT NULL,
Qid Varchar (50) NOT NULL,
dateLog DATETIME
,CONSTRAINT logs_PK PRIMARY KEY (id)
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: Association
-- ------------------------------------------------------------
CREATE TABLE association(
Qid Varchar (50) NOT NULL ,
Lid Varchar (50) NOT NULL ,
nbOui Int NOT NULL ,
nbNon Int NOT NULL ,
verse Int NOT NULL ,
repAcquise Int DEFAULT 0 ,
valeurRep Varchar (50) DEFAULT NULL
,CONSTRAINT association_PK PRIMARY KEY (Qid,Lid)
,CONSTRAINT association_item_FK FOREIGN KEY (Qid) REFERENCES item(Qid) ON DELETE CASCADE
,CONSTRAINT association_lexeme0_FK FOREIGN KEY (Lid) REFERENCES lexeme(Lid) ON DELETE CASCADE
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: EtreUtilise
-- ------------------------------------------------------------
CREATE TABLE etreutilise(
idVar Int NOT NULL ,
Lid Varchar (50) NOT NULL
,CONSTRAINT etreutilise_PK PRIMARY KEY (idVar,Lid)
,CONSTRAINT etreutilise_variete_FK FOREIGN KEY (idVar) REFERENCES variete(idVar) ON DELETE CASCADE
,CONSTRAINT etreutilise_lexeme0_FK FOREIGN KEY (Lid) REFERENCES lexeme(Lid) ON DELETE CASCADE
)ENGINE=InnoDB;
-- ------------------------------------------------------------
-- Table: Correspondre
-- ------------------------------------------------------------
CREATE TABLE correspondre(
idTrad Int NOT NULL ,
Lid Varchar (50) NOT NULL
,CONSTRAINT correspondre_PK PRIMARY KEY (idTrad,Lid)
,CONSTRAINT correspondre_traduction_FK FOREIGN KEY (idTrad) REFERENCES traduction(idTrad) ON DELETE CASCADE
,CONSTRAINT correspondre_lexeme0_FK FOREIGN KEY (Lid) REFERENCES lexeme(Lid) ON DELETE CASCADE
)ENGINE=InnoDB;
| true |
b5fc7d01bc4084d4b14f7b6929edffbd7fae66ac | SQL | francisco0522/holbertonschool-higher_level_programming | /0x0E-SQL_more_queries/5-unique_id.sql | UTF-8 | 164 | 2.625 | 3 | [] | no_license | -- script that creates the table unique_id on your MySQL server.
CREATE TABLE IF NOT EXISTS unique_id (id INT DEFAULT 1 NOT NULL, name VARCHAR(256), UNIQUE (id));
| true |
b3693470358e3d0884657b55696240a2714b4c00 | SQL | matthewcotton/CS50-ProblemSets | /pset7/9.sql | UTF-8 | 156 | 3.578125 | 4 | [] | no_license | SELECT name FROM people
WHERE id IN
(SELECT DISTINCT person_id FROM stars
INNER JOIN movies ON movies.id = stars.movie_id
WHERE year = 2004)
ORDER BY birth; | true |
70db51ff3aba1ca634c35059db7990d6f5c01172 | SQL | rzu59210/blog_lprsc | /blog_wk.sql | UTF-8 | 4,737 | 3.21875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Lun 16 Février 2015 à 13:10
-- Version du serveur: 5.5.40-0ubuntu0.14.04.1
-- Version de PHP: 5.5.9-1ubuntu4.5
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 */;
--
-- Base de données: `blog_wk`
--
-- --------------------------------------------------------
--
-- Structure de la table `articles`
--
CREATE TABLE IF NOT EXISTS `articles` (
`Id` int(3) NOT NULL AUTO_INCREMENT,
`Texte` varchar(255) NOT NULL,
`Date` varchar(11) NOT NULL,
`Titre` varchar(250) NOT NULL,
`User_id` int(11) NOT NULL,
PRIMARY KEY (`Id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=84 ;
--
-- Contenu de la table `articles`
--
INSERT INTO `articles` (`Id`, `Texte`, `Date`, `Titre`, `User_id`) VALUES
(79, 'Le Lorem Ipsum est simplement du faux texte employé dans la composition et la mise en page avant impression. Le Lorem Ipsum est le faux texte standard de l''imprimerie depuis les années 1500, quand un peintre anonyme assembla ensemble des morceaux de tex', '4', 'Tennis de table', 0),
(81, 'J''aime prendre des flèches, sa me rend heureux. J''ai aussi des oiseaux domestiques pour des poneys magrébins venus d''australie pour piner des phoques albinos.', '11. 12. 201', 'The arrow', 0),
(82, 'Ce champs est un nouvelle objet qui ne dis rien', '8. 2. 2015', 'Nouveau', 9),
(83, 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam dictum placerat iaculis. Fusce fringilla tristique commodo. Vestibulum convallis ligula a sodales feugiat. Aliquam a ante nec neque tristique tristique. Sed in mollis massa, id viverra lorem', '8. 2. 2015', 'Je suis Jean', 10);
-- --------------------------------------------------------
--
-- Structure de la table `commentaire`
--
CREATE TABLE IF NOT EXISTS `commentaire` (
`id` int(5) NOT NULL AUTO_INCREMENT,
`Article_id` int(5) NOT NULL,
`Auteur` varchar(11) NOT NULL,
`Texte` varchar(5000) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=22 ;
--
-- Contenu de la table `commentaire`
--
INSERT INTO `commentaire` (`id`, `Article_id`, `Auteur`, `Texte`) VALUES
(4, 0, 'Test', 'sdfksdlg kl'),
(5, 0, 'Test', 'sdfksdlg kl'),
(6, 0, 'Jean ', 'Je vous cer'),
(7, 64, '', ''),
(8, 64, '', ''),
(9, 64, 'Alfred', 'L''info c''es'),
(10, 64, 'Alfred', 'L''info c''es'),
(11, 64, 'Mohamed', 'Bonsoir j''a'),
(12, 80, 'Jean-Claude', 'Bonjour,\r\nVotre blog est magnifique ! \r\nCordialement.'),
(13, 80, 'Dominique', 'Il y a une chose qui ne va pas'),
(14, 80, 'Dominique', 'Il y a une chose qui ne va pas'),
(15, 80, 'Lol', 'moi de meme'),
(16, 80, 'Lol', 'moi de meme'),
(17, 80, 'Lol', 'moi de meme'),
(18, 80, 'Therese', 'sdv dfgdfgddfdfgdg fgdfg'),
(19, 80, 'Mohamed', 'Halla wackba\r\n'),
(20, 79, 'Babar', 'Je suis un éléphant\r\n'),
(21, 82, 'Trevor', 'J''adore les gateatx');
-- --------------------------------------------------------
--
-- Structure de la table `utilisateurs`
--
CREATE TABLE IF NOT EXISTS `utilisateurs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(100) NOT NULL,
`mdp` varchar(100) NOT NULL,
`Nom` varchar(255) NOT NULL,
`Prenom` varchar(255) NOT NULL,
`Sid` varchar(32) NOT NULL,
`expiration` int(10) NOT NULL,
PRIMARY KEY (`id`),
KEY `email` (`email`),
KEY `mdp` (`mdp`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
--
-- Contenu de la table `utilisateurs`
--
INSERT INTO `utilisateurs` (`id`, `email`, `mdp`, `Nom`, `Prenom`, `Sid`, `expiration`) VALUES
(1, 'Wallaert.kevin@hotmail.fr', 'Admin59210', '', '', 'ede20c179f3750c1e0341d21bdd0d97d', 1423410501),
(4, 'Wallaert.luc@neuf.fr', 'Test', '', '', '94b4277a267ead5505fd1529837be3cf', 1422957388),
(5, 'wallaert.kevin@hotmail.fr', '9b6c1a3a1e24e5e9bf8a0cf8eea927b1', '', '', 'ede20c179f3750c1e0341d21bdd0d97d', 1423410501),
(6, 'wallaert.kevin@hotmail.fr', '9b6c1a3a1e24e5e9bf8a0cf8eea927b1', '', '', 'ede20c179f3750c1e0341d21bdd0d97d', 1423410501),
(7, 'wallaert.kevin@hotmail.fr', '9b6c1a3a1e24e5e9bf8a0cf8eea927b1', '', '', 'ede20c179f3750c1e0341d21bdd0d97d', 1423410501),
(8, 'wallaert.kev@hotmail.fr', '25f9e794323b453885f5181f1b624d0b', '', '', '', 0),
(9, 'Wallaert.kevin@hotmail.fr', 'Kevin59210', 'Wallaert', 'Kevin', 'ede20c179f3750c1e0341d21bdd0d97d', 1423410501),
(10, 'Jean@laquet.fr', 'Kevin59210', 'Laquet', 'Jean', 'bcaa87cb24905f20cfede3c79a5974d7', 1423407039);
/*!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 |
9b2cd4e60f9784a6d7b56fbdf282ec1bf5dc3eed | SQL | bitgittry/BaseCodeAnalysis | /trunk/dbv/stored_routines/LottoSportsBookCreditCustomer.sql | UTF-8 | 8,230 | 3.46875 | 3 | [] | no_license | DROP procedure IF EXISTS `LottoSportsBookCreditCustomer`;
DELIMITER $$
CREATE DEFINER=`bit8_admin`@`127.0.0.1` PROCEDURE `LottoSportsBookCreditCustomer`(
sportsBookParticipationID BIGINT, transactionRef VARCHAR(100), extBetRef VARCHAR(40), minimalData TINYINT(1), OUT statusCode INT)
root: BEGIN
-- extBetRef is always null for IFLEX and is always with a value in AMELCO
DECLARE playWagerType VARCHAR(80) DEFAULT 'Type1';
DECLARE sbBetID, singleMultTypeID, gameManufacturerID, clientStatID, lotteryCouponId BIGINT DEFAULT 0;
DECLARE betTransactionRef VARCHAR(64) DEFAULT NULL;
-- DECLARE extBetRef VARCHAR(40) DEFAULT NULL;
DECLARE isProcessed,winNotification, lossNotification, taxEnabled, calucatedByProvider, verticalVersion, skipStatusUpdate TINYINT(1) DEFAULT 0;
DECLARE sbBetStatusCode, numSingles, numMultiples, numBetEntries, existingWins INT DEFAULT 0;
DECLARE winAmount, taxAmount DECIMAL (18,5) DEFAULT 0;
DECLARE gamePlayIDReturned BIGINT DEFAULT NULL;
SET statusCode = 0;
SELECT gs1.value_string as vs1
INTO playWagerType
FROM gaming_settings gs1
WHERE gs1.name='PLAY_WAGER_TYPE';
SELECT gaming_sb_bets.sb_bet_id, gaming_sb_bets.game_manufacturer_id, gaming_sb_bets.transaction_ref,
gaming_sb_bets.is_processed, gaming_sb_bets.status_code, gaming_sb_bets.num_singles, gaming_sb_bets.num_multiplies,
IFNULL(gaming_lottery_coupons.win_notification,0), IFNULL(gaming_lottery_coupons.loss_notification,0),
gaming_sb_bets.client_stat_id, gaming_lottery_coupons.lottery_coupon_id, IFNULL(gaming_lottery_coupons.vertical_version,0)
INTO sbBetID, gameManufacturerID, betTransactionRef, isProcessed, sbBetStatusCode, numSingles, numMultiples,winNotification, lossNotification,
clientStatID, lotteryCouponId, verticalVersion
FROM gaming_lottery_participations FORCE INDEX (PRIMARY)
STRAIGHT_JOIN gaming_lottery_dbg_tickets ON gaming_lottery_dbg_tickets.lottery_dbg_ticket_id=gaming_lottery_participations.lottery_dbg_ticket_id
STRAIGHT_JOIN gaming_lottery_coupons ON gaming_lottery_coupons.lottery_coupon_id = gaming_lottery_dbg_tickets.lottery_coupon_id
STRAIGHT_JOIN gaming_sb_bets FORCE INDEX (lottery_dbg_ticket_id) ON gaming_sb_bets.lottery_dbg_ticket_id = gaming_lottery_dbg_tickets.lottery_dbg_ticket_id
WHERE gaming_lottery_participations.lottery_participation_id = sportsBookParticipationID;
SET numBetEntries = numSingles+numMultiples;
IF (sbBetStatusCode != 5 OR isProcessed=0 OR numBetEntries=0) THEN
SET statusCode=3;
LEAVE root;
END IF;
-- UPDATE COUPON STATUS AND PARTICIPATION STATUS
UPDATE gaming_lottery_participations FORCE INDEX (PRIMARY)
STRAIGHT_JOIN gaming_lottery_dbg_tickets ON gaming_lottery_dbg_tickets.lottery_dbg_ticket_id = gaming_lottery_participations.lottery_dbg_ticket_id
STRAIGHT_JOIN gaming_lottery_coupons ON gaming_lottery_coupons.lottery_coupon_id = gaming_lottery_dbg_tickets.lottery_coupon_id
SET
gaming_lottery_coupons.lottery_wager_status_id = 6, -- WinReceived
gaming_lottery_participations.lottery_wager_status_id = 6 -- WinReceived
WHERE gaming_lottery_participations.lottery_participation_id = sportsBookParticipationID;
SET @total_net = 0.0;
SET @total_refund = 0.0;
SET @total_gross = 0.0;
SELECT SUM(IFNULL(net, 0)), SUM(IFNULL(refund, 0)), SUM(IFNULL(gross, 0)) INTO @total_net, @total_refund, @total_gross
FROM gaming_lottery_participation_prizes
WHERE lottery_participation_id = sportsBookParticipationID AND prize_status = 5 AND approval_status_id = 2104
AND IFNULL(bet_ref,'')= CASE WHEN extBetRef IS NULL THEN IFNULL(bet_ref,'') ELSE extBetRef END;
SET winAmount = IF(@total_net > 0, @total_net, @total_refund);
IF (extBetRef is NULL) THEN
IF (numBetEntries=1) THEN
SET extBetRef=NULL;
ELSEIF (numBetEntries>1 AND numMultiples=1) THEN
SELECT bet_ref INTO extBetRef FROM gaming_sb_bet_multiples FORCE INDEX (sb_bet_id) WHERE gaming_sb_bet_multiples.sb_bet_id=sbBetID LIMIT 1;
ELSE
SELECT bet_ref INTO extBetRef FROM gaming_sb_bet_singles FORCE INDEX (sb_bet_id) WHERE gaming_sb_bet_singles.sb_bet_id=sbBetID LIMIT 1;
END IF;
END IF;
-- in Amelco winnings can be incremental, so they are considered adjustments only if a previous win exists with the same betRef
SELECT COUNT(sb_bet_win_id)
INTO existingWins FROM gaming_sb_bet_wins where sb_bet_id = sbBetID AND transaction_ref=extBetRef;
-- the win will have the same transaction ref of the bet
-- type 1 or tyoe 2 is handled in the sp
CALL CommonWalletSportsGenericCreditCustomerByBetRef(gameManufacturerID,
transactionRef, betTransactionRef, extBetRef, winAmount, 1, 0, 0, minimalData, gamePlayIDReturned, statusCode);
-- for AMELCO the awarding of the winnings can be incremental, so the status is changed only if all the outcomes of the bet are received.
IF ((verticalVersion=1) AND
(SELECT COUNT(sb_bet_id) FROM gaming_sb_bet_wins where sb_bet_id=sbBetID)
< (SELECT COUNT(sb_bet_id) FROM gaming_game_rounds where sb_bet_id=sbBetID AND sb_extra_id is not null))
THEN
SET skipStatusUpdate=1;
END IF;
-- in Amelco winnings can be incremental, so they are considered adjustments only if a previous win exists with the same betRef
IF ((verticalVersion=1) AND (existingWins=0))
THEN
UPDATE gaming_game_plays SET payment_transaction_type_id=13 where game_play_id= gamePlayIDReturned;
UPDATE gaming_game_plays_sb SET payment_transaction_type_id=13 where game_play_id= gamePlayIDReturned;
END IF;
-- UPDATE COUPON STATUS AND PARTICIPATION STATUS
UPDATE gaming_lottery_participations FORCE INDEX (PRIMARY)
STRAIGHT_JOIN gaming_lottery_dbg_tickets ON gaming_lottery_dbg_tickets.lottery_dbg_ticket_id = gaming_lottery_participations.lottery_dbg_ticket_id
STRAIGHT_JOIN gaming_lottery_coupons ON gaming_lottery_coupons.lottery_coupon_id = gaming_lottery_dbg_tickets.lottery_coupon_id
SET
gaming_lottery_coupons.lottery_coupon_status_id = CASE WHEN skipStatusUpdate=1 THEN gaming_lottery_coupons.lottery_coupon_status_id ELSE 2111 END, -- CLOSED
gaming_lottery_participations.lottery_participation_status_id = CASE WHEN skipStatusUpdate=1 THEN gaming_lottery_participations.lottery_participation_status_id ELSE 2111 END -- CLOSED
WHERE gaming_lottery_participations.lottery_participation_id = sportsBookParticipationID;
SELECT value_bool
INTO taxEnabled
FROM gaming_settings
WHERE name = 'TAX_ON_GAMEPLAY_ENABLED';
-- is tax on win calculated by provider
SELECT gct.calculated_by_provider
INTO calucatedByProvider
FROM gaming_client_stats gcs
INNER JOIN gaming_clients gc ON gc.client_id = gcs.client_id
INNER JOIN clients_locations cl ON cl.client_id = gc.client_id
INNER JOIN gaming_country_tax gct ON gct.country_id = cl.country_id
WHERE gcs.client_stat_id = clientStatID
AND cl.is_primary = 1 AND cl.is_active = 1
AND gct.is_current = 1 AND gct.tax_rule_type_id = 2 AND gct.licence_type_id = 3
ORDER BY gct.date_start DESC
LIMIT 1;
IF (statusCode = 0 AND gamePlayIDReturned IS NOT NULL AND taxEnabled = 1 AND calucatedByProvider = 1) THEN
-- CPREQ-294 tax player
SET taxAmount = @total_gross - @total_net;
UPDATE gaming_game_plays
INNER JOIN gaming_game_rounds ON gaming_game_plays.game_round_id = gaming_game_rounds.game_round_id
INNER JOIN gaming_game_plays_sb ON gaming_game_plays_sb.game_round_id = gaming_game_rounds.game_round_id AND gaming_game_plays_sb.game_play_id = gaming_game_plays.game_play_id
SET gaming_game_plays.amount_tax_player = taxAmount,
gaming_game_rounds.amount_tax_player = taxAmount,
gaming_game_plays_sb.amount_tax_player = taxAmount,
gaming_game_rounds.amount_tax_player_original = IFNULL(gaming_game_rounds.amount_tax_player_original, taxAmount)
WHERE gaming_game_plays.game_play_id = gamePlayIDReturned;
END IF;
-- CPREQ-216
IF( IFNULL(winAmount,0) > 0 AND winNotification = 1) THEN
CALL PlaceClientNotificationInstance(sbBetID, 'SBWin');
ELSEIF(lossNotification = 1) THEN
CALL PlaceClientNotificationInstance(sbBetID, 'SBLoss');
END IF;
END root$$
DELIMITER ;
| true |
4ac32465de96e1c32d58ca6581e6a260cff58ed5 | SQL | josmyJJ/finalProject | /sampleData/sampleData.sql | UTF-8 | 3,971 | 3.390625 | 3 | [] | no_license | -- Department
INSERT INTO `harrison_college1`.`department` (`department_id`, `name`) VALUES ('1', 'English');
INSERT INTO `harrison_college1`.`department` (`department_id`, `name`) VALUES ('2', 'CS');
INSERT INTO `harrison_college1`.`department` (`department_id`, `name`) VALUES ('3', 'History');
-- MAJOR
INSERT INTO `major` (`major_id`,`name`,`department_id`) VALUES (1,'Computer Science',2);
INSERT INTO `major` (`major_id`,`name`,`department_id`) VALUES (2,'Literature',1);
INSERT INTO `major` (`major_id`,`name`,`department_id`) VALUES (3,'Statistics',3);
INSERT INTO `major` (`major_id`,`name`,`department_id`) VALUES (4,'Graphic Design',4);
INSERT INTO `major` (`major_id`,`name`,`department_id`) VALUES (5,'Interior Design',4);
-- Course
INSERT INTO `course` (`course_id`,`crn`,`detail`,`name`,`num_of_credits`,`subject_code`,`department_id`,`major_id`) VALUES (1,1245,'Basic English','English',3,'EN102',1,2);
INSERT INTO `course` (`course_id`,`crn`,`detail`,`name`,`num_of_credits`,`subject_code`,`department_id`,`major_id`) VALUES (2,1345,'Advanced English','Literature',4,'EN104',1,2);
INSERT INTO `course` (`course_id`,`crn`,`detail`,`name`,`num_of_credits`,`subject_code`,`department_id`,`major_id`) VALUES (3,1445,'Basic Math','Algebra',3,'MATH01',3,3);
INSERT INTO `course` (`course_id`,`crn`,`detail`,`name`,`num_of_credits`,`subject_code`,`department_id`,`major_id`) VALUES (4,2123,'Intermediate Math','Precalculus',3,'MATH03',3,3);
INSERT INTO `course` (`course_id`,`crn`,`detail`,`name`,`num_of_credits`,`subject_code`,`department_id`,`major_id`) VALUES (6,4567,'Intro to Algoritham','Algoritham',3,'CS234',2,1);
-- Instructor
INSERT INTO `harrison_college1`.`instructor` (`instructor_id`, `employee_number`, `name`, `office_number`, `department_id`) VALUES ('1', '56789', 'Dave Wolf', '345', '2');
INSERT INTO `harrison_college1`.`instructor` (`instructor_id`, `employee_number`, `name`, `office_number`) VALUES ('2', '2345', 'Dem ', '200');
-- Classroom
INSERT INTO `classroom` (`classroom_id`,`building_name`,`max_capacity`,`room_number`) VALUES (1,'Alton Henley',20,'200');
INSERT INTO `classroom` (`classroom_id`,`building_name`,`max_capacity`,`room_number`) VALUES (2,'CBS410',40,'450');
INSERT INTO `classroom` (`classroom_id`,`building_name`,`max_capacity`,`room_number`) VALUES (3,'MSN3',30,'459');
-- Student
INSERT INTO `student` (`student_id`,`name`,`number`,`year_of_entry`,`depart_id`,`major_id`) VALUES (1,'Josemey',565766,'2018',1,1);
INSERT INTO `student` (`student_id`,`name`,`number`,`year_of_entry`,`depart_id`,`major_id`) VALUES (2,'Thinzar',333345,'2017',1,2);
INSERT INTO `student` (`student_id`,`name`,`number`,`year_of_entry`,`depart_id`,`major_id`) VALUES (3,'Chiddimma',455656,'2018',2,3);
-- ClassSQl
INSERT INTO `class` (`class_id`,`course_number`,`crn_number`,`subject_code`,`time`,`classroom_id`,`course_id`,`instructor_id`,`semester_id`) VALUES (1,2345,'101','EN101','9am -10am',1,1,1,NULL);
INSERT INTO `class` (`class_id`,`course_number`,`crn_number`,`subject_code`,`time`,`classroom_id`,`course_id`,`instructor_id`,`semester_id`) VALUES (2,2367,'405','MA56','12pm - 1.15pm',2,2,2,NULL);
-- Semester
INSERT INTO `harrison_college1`.`semester` (`smester_id`, `name`) VALUES ('1', 'Spring');
INSERT INTO `harrison_college1`.`semester` (`smester_id`, `name`) VALUES ('2', 'Summer');
INSERT INTO `harrison_college1`.`semester` (`smester_id`, `name`) VALUES ('3', 'Fall');
INSERT INTO `harrison_college1`.`semester` (`smester_id`) VALUES ('4');
-- Grade
INSERT INTO `harrison_college1`.`grade` (`grade_id`, `course_id`, `instructor_id`, `semester_id`, `student_id`, `grade`) VALUES ('1', '1', '1', '1', '1', 'A');
INSERT INTO `harrison_college1`.`grade` (`grade_id`, `course_id`, `instructor_id`, `semester_id`, `student_id`, `grade`) VALUES ('2', '2', '1', '1', '2', 'A');
INSERT INTO `harrison_college1`.`grade` (`grade_id`, `course_id`, `instructor_id`, `semester_id`, `student_id`) VALUES ('3', '3', '2', '2', '3');
| true |
4a4fb3f8cc68e6f971130b21309810ca79ed04e1 | SQL | stvhwang/nba2016-17 | /POIRPlayers/POIRPlayers.sql | UTF-8 | 4,884 | 4.46875 | 4 | [
"MIT"
] | permissive | --POIRPlayers.sql
--Sums up point per player from the POIR table
--Computes minutes from when POIR is satisfied to end of game, including overtimes.
select min_added.player, min_added.POIR_points, min_added.team,
-- a period of 5 or more indicates overtime, each of 5 min
case
when max_period >4 then (max_minute + ((max_period -4)*5))
else max_minute
end as true_max_min
from
(
select pg.player, pg.POIR_points, pg.team,
-- subquery to find max minute_adjusted
(
With full_game as (
With game_time as (
--converts the hh:mm:ss to be mm:ss, adding 12 min per period leaving period 4 and OT unadjusted.
--Also replaces 'TIE' in the score margin with '0'
select
ROW_NUMBER () OVER (ORDER BY eventnum),
CASE
WHEN period <= 3 THEN (DATE_PART('hour', pctimestring)::integer+((4-period)*12))
ELSE (DATE_PART('hour', pctimestring)::integer)
END as minute_adjusted,
DATE_PART('minute', pctimestring) as game_second,
eventnum,
Case
when scoremargin = 'TIE' then '0'
else scoremargin
end
from da_nba.game0021600009
where (eventmsgtype = 1 or eventmsgtype = 3) and (score != 'null')
)
--add row numering for all baskets scored, event message type 1 and 3,
--excludes event type 3 with null in the score, which are missed free throws.
--converts game minutes and seconds into integers
--the difference of the scoremargin for each row and the row prior is how many points scored
select
distinct(gta.row_number),
gta.minute_adjusted,
gta.game_second::integer seconds,
period,
player1_name player,
player1_team_abbreviation team,
score,
gta.scoremargin,
(ABS(gta.scoremargin::integer - gtb.scoremargin::integer)) points_scored
from da_nba.game0021600009 nba, game_time gta, game_time gtb
where
(eventmsgtype = 1 or eventmsgtype = 3) and (score != 'null')
and nba.eventnum = gta.eventnum
and gta.row_number = (gtb.row_number + 1)
Order by gta.row_number
)
--filter to show only scores that happened after first instance of the POIR.
--"Point of Improbable Return" = a score margin twice that of minutes remaining.
--(formula WIP)
select
minute_adjusted
from full_game
where row_number = (
--determines the first row the PIOR check is met
--for if a comeback is successful, the POIR check will not be met
select
row_number
from full_game
where (ABS(scoremargin::integer)) >= (2*minute_adjusted)
limit 1
)) max_minute,
--subquery to find max period
(select
max(period) as max_period
from da_nba.game0021600009
limit 1
) max_period
from (
select player, sum(points_scored) POIR_points, team
from (
With full_game as (
With game_time as (
--converts the hh:mm:ss to be mm:ss, adding 12 min per period leaving period 4 and OT unadjusted.
--Also replaces 'TIE' in the score margin with '0'
select
ROW_NUMBER () OVER (ORDER BY eventnum),
CASE
WHEN period <= 3 THEN (DATE_PART('hour', pctimestring)::integer+((4-period)*12))
ELSE (DATE_PART('hour', pctimestring)::integer)
END as minute_adjusted,
DATE_PART('minute', pctimestring) as game_second,
eventnum,
Case
when scoremargin = 'TIE' then '0'
else scoremargin
end
from da_nba.game0021600009
where (eventmsgtype = 1 or eventmsgtype = 3) and (score != 'null')
)
--add row numering for all baskets scored, event message type 1 and 3,
--excludes event type 3 with null in the score, which are missed free throws.
--converts game minutes and seconds into integers
--the difference of the scoremargin for each row and the row prior is how many points scored
select
distinct(gta.row_number),
gta.minute_adjusted,
gta.game_second::integer seconds,
player1_name player,
player1_team_abbreviation team,
score,
gta.scoremargin,
(ABS(gta.scoremargin::integer - gtb.scoremargin::integer)) points_scored
from da_nba.game0021600009 nba, game_time gta, game_time gtb
where
(eventmsgtype = 1 or eventmsgtype = 3) and (score != 'null')
and nba.eventnum = gta.eventnum
and gta.row_number = (gtb.row_number + 1)
Order by gta.row_number
)
--filter to show only scores that happened after first instance of the POIR.
--"Point of Improbable Return" = a score margin twice that of minutes remaining.
--(formula WIP)
select
row_number,
minute_adjusted,
seconds,
player,
team,
score,
scoremargin,
points_scored
from full_game
where row_number >= (
--determines the first row the PIOR check is met
--for if a comeback is successful, the POIR check will not be met
select
row_number
from full_game
where (ABS(scoremargin::integer)) >= (2*minute_adjusted)
limit 1
)
and team !=(
-- the team that scores when POIR activates is the leading team
-- so track players who are not on the leading team
select
team
from full_game
where (ABS(scoremargin::integer)) >= (2*minute_adjusted)
limit 1
)
) poir_game
group by player, team
order by POIR_points desc
) pg
) min_added
| true |
5d25c679d0cf9da158abd6d32c592e143759a093 | SQL | cuba-labs/aggregation-distribute | /modules/core/db/init/hsql/10.create-db.sql | UTF-8 | 874 | 3.046875 | 3 | [] | no_license | -- begin APP_TASK
create table APP_TASK (
ID varchar(36) not null,
VERSION integer not null,
CREATE_TS timestamp,
CREATED_BY varchar(50),
UPDATE_TS timestamp,
UPDATED_BY varchar(50),
DELETE_TS timestamp,
DELETED_BY varchar(50),
--
NAME varchar(255),
PROJECT_ID varchar(36),
EXAMPLE_TWO double precision,
EXAMPLE_THREE integer,
ESTIMATION double precision,
TIME_CONSUMED integer,
TYPE_ integer,
PRIORITY integer,
--
primary key (ID)
)^
-- end APP_TASK
-- begin APP_PROJECT
create table APP_PROJECT (
ID varchar(36) not null,
VERSION integer not null,
CREATE_TS timestamp,
CREATED_BY varchar(50),
UPDATE_TS timestamp,
UPDATED_BY varchar(50),
DELETE_TS timestamp,
DELETED_BY varchar(50),
--
TITLE varchar(255),
--
primary key (ID)
)^
-- end APP_PROJECT
| true |
63428273df25950ac895af235b39698006476698 | SQL | geowarin/brg | /modules/data-model/src/main/resources/db/migration/2019.11/V2019_11_0__Posts.sql | UTF-8 | 2,015 | 3.859375 | 4 | [] | no_license | create extension if not exists "pgcrypto";
-- create schema forum_example;
-- create schema forum_example_private;
create table forum_example.person
(
-- id serial primary key,
-- id uuid primary key default uuid_generate_v1mc(),
id uuid primary key default gen_random_uuid(),
first_name text not null check (char_length(first_name) < 80),
last_name text check (char_length(last_name) < 80),
about text,
created_at timestamp default now()
);
comment on table forum_example.person is 'A user of the forum.';
comment on column forum_example.person.id is 'The primary unique identifier for the person.';
comment on column forum_example.person.first_name is 'The person’s first name.';
comment on column forum_example.person.last_name is 'The person’s last name.';
comment on column forum_example.person.about is 'A short description about the user, written by the user.';
comment on column forum_example.person.created_at is 'The time this person was created.';
create type forum_example.post_topic as enum (
'discussion',
'inspiration',
'help',
'showcase'
);
create table forum_example.post
(
id serial primary key,
author_id uuid not null references forum_example.person (id),
headline text not null check (char_length(headline) < 280),
body text,
topic forum_example.post_topic,
created_at timestamp default now()
);
comment on table forum_example.post is 'A forum post written by a user.';
comment on column forum_example.post.id is 'The primary key for the post.';
comment on column forum_example.post.headline is 'The title written by the user.';
comment on column forum_example.post.author_id is 'The id of the author user.';
comment on column forum_example.post.topic is 'The topic this has been posted in.';
comment on column forum_example.post.body is 'The main body text of our post.';
comment on column forum_example.post.created_at is 'The time this post was created.'; | true |
1606c460fc3066198eb438faab11288ccff68330 | SQL | pegaso2021/rimeva | /tutoriales_ftp.sql | UTF-8 | 2,145 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 26-03-2019 a las 07:31:24
-- Versión del servidor: 10.1.35-MariaDB
-- Versión de PHP: 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 */;
--
-- Base de datos: `tutoriales_ftp`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `archivo`
--
CREATE TABLE `archivo` (
`archivo_id` int(11) NOT NULL,
`archivo_fecha` datetime NOT NULL,
`archivo_descripcion` varchar(200) NOT NULL,
`archivo_archivo` varchar(100) NOT NULL,
`archivo_descarga` varchar(100) NOT NULL,
`archivo_peso` decimal(9,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Volcado de datos para la tabla `archivo`
--
INSERT INTO `archivo` (`archivo_id`, `archivo_fecha`, `archivo_descripcion`, `archivo_archivo`, `archivo_descarga`, `archivo_peso`) VALUES
(4, '2019-03-20 00:59:20', 'Primera imagen', 'Sin título.png', '5c91d6b1759e7.png', '299.78'),
(5, '2019-03-20 01:03:26', 'Firma digital', '10104425530.pfx', '5c91d7ac46d41.pfx', '4.86'),
(6, '2019-03-25 23:16:40', 'Mi foto de chibolo o niño', 'Koala.jpg', '5c99a79995967.jpg', '780.83'),
(7, '2019-03-25 23:23:27', 'Zip de prueba', 'R-20603564783-01-F001-00000001.zip', '5c99a93d9d297.zip', '1.22');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `archivo`
--
ALTER TABLE `archivo`
ADD PRIMARY KEY (`archivo_id`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `archivo`
--
ALTER TABLE `archivo`
MODIFY `archivo_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
aa474f4bfa4bac7da2b55d3c8167cdbb7e8cc607 | SQL | YupION/PPL-UwU | /sewapaja.sql | UTF-8 | 3,812 | 2.671875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 16, 2020 at 04:40 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `sewapaja`
--
-- --------------------------------------------------------
--
-- Table structure for table `tabel_barang`
--
CREATE TABLE `tabel_barang` (
`id_barang` int(11) NOT NULL,
`merk` varchar(50) NOT NULL,
`jenis` varchar(50) NOT NULL,
`warna` varchar(50) NOT NULL,
`status` varchar(50) NOT NULL,
`harga` varchar(50) NOT NULL,
`image` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tabel_barang`
--
INSERT INTO `tabel_barang` (`id_barang`, `merk`, `jenis`, `warna`, `status`, `harga`, `image`) VALUES
(1, 'Nikon', 'Camera', 'Black', '0', '20000', 'https://cdn.pocket-lint.com/r/s/1200x/assets/images/147435-cameras-review-nikon-z6-review-image1-sizm65qcod.jpg'),
(2, 'Sony', 'Camera', 'Pink', '0', '150000', 'https://static.bhphoto.com/images/images1000x1000/1294398073_750065.jpg'),
(3, 'Leica', 'Camera', 'Black', '0', '200000', 'https://cdn.vox-cdn.com/thumbor/_IeUn2OMXM8IYDLcOeFhUDKXHww=/0x171:1506x959/fit-in/1200x630/cdn.vox-cdn.com/uploads/chorus_asset/file/13075479/LeicaSide.0.0.1430441592.jpg'),
(4, 'Leica', 'Camera', 'White', '0', '200000', 'https://cdn11.bigcommerce.com/s-r16b86mn51/images/stencil/original/products/2253/12939/M10-P_weiss_FRONT_RGB__73894.1576612211.jpg?c=2&imbypass=on&imbypass=on'),
(5, 'Sony', 'Camera', 'Black', '0', '150000', 'https://thegoodguys.sirv.com/products/50023829/50023829_97995.PNG?scale.height=505&scale.width=773&canvas.height=505&canvas.width=773&canvas.opacity=0&q=90'),
(6, 'Canon', 'Camera', 'Black', '0', '170000', 'https://www.bhphotovideo.com/images/images2500x2500/canon_1072c001_powershot_sx620_hs_digital_1251151.jpg');
-- --------------------------------------------------------
--
-- Table structure for table `tabel_user`
--
CREATE TABLE `tabel_user` (
`id` int(5) NOT NULL,
`nik` int(50) NOT NULL,
`nama` varchar(50) CHARACTER SET latin1 NOT NULL,
`email` varchar(50) CHARACTER SET latin1 NOT NULL,
`alamat` varchar(50) CHARACTER SET latin1 NOT NULL,
`telp` int(12) NOT NULL,
`username` varchar(25) CHARACTER SET latin1 NOT NULL,
`pass` varchar(30) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `tabel_user`
--
INSERT INTO `tabel_user` (`id`, `nik`, `nama`, `email`, `alamat`, `telp`, `username`, `pass`) VALUES
(2, 1111111, 'admin', 'admin@gmail.com', 'admin rumah', 8213681, 'admin', 'admin'),
(3, 1111710093, 'alvin', 'alvin@gmail.com', 'rumah alvin', 2147483647, 'alvin', 'alvin');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `tabel_barang`
--
ALTER TABLE `tabel_barang`
ADD PRIMARY KEY (`id_barang`);
--
-- Indexes for table `tabel_user`
--
ALTER TABLE `tabel_user`
ADD PRIMARY KEY (`username`),
ADD UNIQUE KEY `id` (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `tabel_barang`
--
ALTER TABLE `tabel_barang`
MODIFY `id_barang` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `tabel_user`
--
ALTER TABLE `tabel_user`
MODIFY `id` int(5) 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 |
dae954eda81616c12b688bbf03dc3f73a55c6ea0 | SQL | kkurzhal/room-reservation-backend | /room_schedule.sql | UTF-8 | 1,063 | 3.71875 | 4 | [] | no_license | DROP DATABASE IF EXISTS room_schedule;
CREATE DATABASE room_schedule;
USE room_schedule;
CREATE TABLE requests
(
id INT(11) AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
`date` DATE NOT NULL,
from_time TIME NOT NULL,
to_time TIME NOT NULL,
time_stamp DATETIME NOT NULL,
approved TINYINT(1)
)ENGINE=InnoDB;
CREATE TABLE users
(
id INT(11) AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL
)ENGINE=InnoDB;
CREATE TABLE room_types
(
id INT(11) AUTO_INCREMENT PRIMARY KEY,
type VARCHAR(255)
)ENGINE=InnoDB;
CREATE TABLE buildings
(
id INT(11) AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255)
)ENGINE=InnoDB;
CREATE TABLE rooms
(
id INT(11) AUTO_INCREMENT PRIMARY KEY,
`number` VARCHAR(5) NOT NULL,
capacity INT(11) NOT NULL,
`type` INT(11) NOT NULL,
building INT(11) NOT NULL,
FOREIGN KEY(`type`) REFERENCES room_types(id),
FOREIGN KEY(building) REFERENCES buildings(id)
)ENGINE=InnoDB;
| true |
67df6bb8e42c7f8786021b8c27d5990233994190 | SQL | uss-hopper/snap-challenges-Ianwfoster | /snap-10-16/snap.ddl | UTF-8 | 556 | 3.25 | 3 | [
"Apache-2.0"
] | permissive |
create table if not exists task(
taskId binary(20) not null,
taskDueDate datetime,
taskDescription varchar(256),
taskPriority varchar(64) not null,
taskStartDate datetime,
taskStatus varchar(64) not null,
taskTitle varchar(225) not null,
unique(taskId),
INDEX(taskTitle),
primary key(taskId)
)
SELECT tweet.tweetContent, profile.profileAtHandle
FROM tweet
INNER JOIN `like` ON tweet.tweetId = like.likeTweetId
INNER JOIN profile ON like.likeProfileId = profile.profileId
WHERE tweet.tweetId = UNHEX('0536faef082b454e9d444cdbe7887d7a'); | true |
fa4c0721f7fb7ae21baba27dd6beb69b06c5d24f | SQL | twglhk/TSQL-Tutorial | /SQLQuery13.sql | UTF-8 | 394 | 3.203125 | 3 | [] | no_license |
USE BaseballData
CREATE TABLE GameTable(
testId INTEGER NOT NULL,
gold INTEGER NULL,
createDate DATETIME NOT NULL,
PRIMARY KEY(createDate)
)
ALTER TABLE GameTable
ADD Jem INTEGER
ALTER TABLE GameTable
ADD CONSTRAINT PK_testId PRIMARY KEY(testId)
ALTER TABLE GameTable
DROP COLUMN Jem
ALTER TABLE GameTable
DROP CONSTRAINT PK_testId
ALTER TABLE GameTable
ALTER COLUMN gold FLOAT NULL | true |
767d35a6eed5103b080e0204309d143720d19688 | SQL | JudieT215/BamazonJT | /bamazonSQL.sql | UTF-8 | 880 | 3.40625 | 3 | [] | no_license | DROP DATABASE IF EXISTS bamazonJT_DB;
CREATE DATABASE bamazonJT_DB;
USE bamazonJT_DB;
CREATE TABLE bamazon_products(
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(100) NULL,
department_name VARCHAR(100) NULL,
price DECIMAL(10,2),
stock_quantity INT default 0,
PRIMARY KEY (item_id)
);
INSERT INTO bamazon_products (product_name, department_name, price, stock_quantity)
VALUES ("Cupake", "Food", 1.75, 100), ("Stuffed Cat", "Toy", 14.25, 20), ("Face Cream", "Beauty", 100.60, 6), ("Ice Cream", "Food", 3.50, 45), ("Pens", "Office", 5.00, 75), ("Leggings", "Clothing", 100.00, 11), ("SUPER SPEICAL Candle", "Homegood", 300.40, 2), ("Stuffed Dog", "Toy", 50.00, 6);
INSERT INTO bamazon_products (product_name, department_name, price, stock_quantity)
VALUES ("Chips", "Food", 1.25, 60), ("Candy", "Food", 4.50, 40);
SELECT * FROM bamazon_products;
| true |
f44900bff51a016ec94d7dff4fde056577aedffb | SQL | hussainulhassan/EventManagementApplication | /Database/rest_api_data.sql | UTF-8 | 2,420 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 17, 2021 at 08:32 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
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: `rest_api_data`
--
-- --------------------------------------------------------
--
-- Table structure for table `buses`
--
CREATE TABLE `buses` (
`id` int(11) NOT NULL,
`bus_no` varchar(10) NOT NULL,
`driver_name` varchar(30) NOT NULL,
`route_from` varchar(20) NOT NULL,
`route_to` varchar(30) NOT NULL,
`seats` varchar(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `buses`
--
INSERT INTO `buses` (`id`, `bus_no`, `driver_name`, `route_from`, `route_to`, `seats`) VALUES
(40, 'okk-678', 'Aslam', 'Lahore', 'Harappa', '16'),
(42, 'SLL-78', 'Ajmal', 'Lahore', 'Jehlam', '18');
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`username` varchar(20) NOT NULL,
`email` varchar(30) NOT NULL,
`pswd` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `username`, `email`, `pswd`) VALUES
(1, 'Afaq', 'afaq@gmail.com', '12345'),
(2, 'Ahmad', 'ahmad@gmail.com', '129087'),
(3, 'Abdul Jabbar', 'jabbar@gmail.com', '12345'),
(4, 'Ali Raza', 'ali@gmail.com', '097767');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `buses`
--
ALTER TABLE `buses`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `buses`
--
ALTER TABLE `buses`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
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 |
5744973460e768ae2ed875a165333d834fe4f42b | SQL | jomedinas7/luciddb | /farrago/examples/miniplan/unitsql/miniplan.sql | UTF-8 | 2,347 | 3.515625 | 4 | [
"GPL-1.0-or-later",
"Apache-2.0",
"GPL-2.0-only"
] | permissive | -- $Id$
-- Test the miniplan tutorial
-- If you get difs in this test, please update
-- http://pub.eigenbase.org/wiki/HowToWriteAnOptimizer
-- as part of updating the .ref file. Thanks!
create schema miniplan;
set schema 'miniplan';
set path 'miniplan';
-- register UDX we'll use to populate test data
create function ramp(n int)
returns table(i int)
language java
parameter style system defined java
no sql
external name 'class net.sf.farrago.test.FarragoTestUDR.ramp';
-- define two physical partitions with identical table definition
-- column pk: primary key
-- column hicard: will contain mostly distinct values
-- column locard: will contain mostly duplicate values
create table t1(pk int not null primary key, hicard int, locard int);
create table t2(pk int not null primary key, hicard int, locard int);
-- define a logical view combining the physical partitions
create view v as select * from t1 union all select * from t2;
-- populate the first partition, manipulating the UDX output to produce the
-- desired data patterns
insert into t1(pk,hicard,locard)
select i,i*0.9,i*0.04 from table(ramp(1000));
-- populate the second partition (with a similar but not identical data
-- distribution)
insert into t2(pk,hicard,locard)
select i+1000,i*0.8,i*0.05 from table(ramp(1000));
-- make some stats on the data distribution available to the optimizer
analyze table t1 compute statistics for all columns;
analyze table t2 compute statistics for all columns;
create jar miniplan_plugin
library 'file:${FARRAGO_HOME}/examples/miniplan/plugin/FarragoMiniplan.jar'
options(0);
alter session implementation set jar miniplan.miniplan_plugin;
!set outputformat csv
explain plan for
select * from sales.depts union all select * from sales.depts;
explain plan excluding attributes for select sum(hicard) from miniplan.v;
explain plan excluding attributes for select sum(hicard) from miniplan.v;
explain plan excluding attributes for
select locard,sum(hicard) from miniplan.v group by locard;
explain plan excluding attributes for
select hicard,sum(locard) from miniplan.v group by hicard;
alter session set "volcano" = true;
explain plan excluding attributes for
select locard,sum(hicard) from miniplan.v group by locard;
explain plan excluding attributes for
select hicard,sum(locard) from miniplan.v group by hicard;
| true |
2d58755537f4acd2d3ec8c8ae56933f4e159644c | SQL | google/nomulus | /core/src/test/resources/google/registry/reporting/icann/whois_counts_test_cloud_sql.sql | UTF-8 | 1,250 | 3.171875 | 3 | [
"Apache-2.0",
"LicenseRef-scancode-free-unknown"
] | permissive | #standardSQL
-- Copyright 2017 The Nomulus Authors. 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.
-- Query for WHOIS metrics.
-- This searches the monthly appengine logs for Whois requests, and
-- counts the number of hits via both endpoints (port 43 and the web).
SELECT
STRING(NULL) AS tld,
CASE
WHEN requestPath = '/_dr/whois' THEN 'whois-43-queries'
WHEN SUBSTR(requestPath, 0, 7) = '/whois/' THEN 'web-whois-queries'
WHEN SUBSTR(requestPath, 0, 6) = '/rdap/' THEN 'rdap-queries'
END AS metricName,
COUNT(requestPath) AS count
FROM
`domain-registry-alpha.cloud_sql_icann_reporting.monthly_logs_201709`
GROUP BY
metricName
HAVING
metricName IS NOT NULL
| true |
b10d1e0e01d083fddc3ce9e7e6fd4bc9ceb6796d | SQL | rweald/docgraph-data-analysis | /state-level-graph-analysis/referrals-by-state.hive.sql | UTF-8 | 401 | 3.59375 | 4 | [
"MIT"
] | permissive | SELECT
doc1_state,
doc2_state,
SUM(number_patients) as patients
FROM (
SELECT
doc1,
doc2,
number_patients,
doc1_state.state as doc1_state,
doc2_state.state as doc2_state
FROM referrers
JOIN npi_to_state doc1_state ON doc1_state.npi_number = referrers.doc1
JOIN npi_to_state doc2_state ON doc2_state.npi_number = referrers.doc2
) sub1
GROUP BY doc1_state, doc2_state
| true |
5641121eb979acad7d48afb6672e64bd21951b99 | SQL | inuro/PokemonGO | /export_weakness_table.sql | UTF-8 | 1,181 | 3.078125 | 3 | [] | no_license | \a
\pset fieldsep '\t'
\pset tuples_only t
\o ~/weakness.tsv
select
A.pokemon_id, B.jp, A.uid, A.type_1, A.type_2,
calc_weakness('NORMAL',A.type_1,A.type_2) as Normal,
calc_weakness('FIGHTING',A.type_1,A.type_2) as Fighting,
calc_weakness('FLYING',A.type_1,A.type_2) as Flying,
calc_weakness('POISON',A.type_1,A.type_2) as Poison,
calc_weakness('GROUND',A.type_1,A.type_2) as Ground,
calc_weakness('ROCK',A.type_1,A.type_2) as Rock,
calc_weakness('BUG',A.type_1,A.type_2) as Bug,
calc_weakness('GHOST',A.type_1,A.type_2) as Ghost,
calc_weakness('STEEL',A.type_1,A.type_2) as Steel,
calc_weakness('FIRE',A.type_1,A.type_2) as Fire,
calc_weakness('WATER',A.type_1,A.type_2) as Water,
calc_weakness('GRASS',A.type_1,A.type_2) as Grass,
calc_weakness('ELECTRIC',A.type_1,A.type_2) as Electric,
calc_weakness('PSYCHIC',A.type_1,A.type_2) as Psychic,
calc_weakness('ICE',A.type_1,A.type_2) as Ice,
calc_weakness('DRAGON',A.type_1,A.type_2) as Dragon,
calc_weakness('DARK',A.type_1,A.type_2) as Dark,
calc_weakness('FAIRY',A.type_1,A.type_2) as Fairy
from _pokemon A left join localize_pokemon B using(uid)
where uid !~ '_SHADOW$';
\o
\pset tuples_only f
\pset fieldsep '|'
\a
| true |
f2756fc688ebc3d764baa9f0609a3f9f0dbb7d61 | SQL | zhangm-aj/DAMDEMO | /bim.sql | UTF-8 | 5,512 | 3.328125 | 3 | [] | no_license | /*
SQLyog Ultimate v12.08 (64 bit)
MySQL - 5.5.49 : Database - damdemo
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!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 */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/`damdemo` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `damdemo`;
/*Table structure for table `dam_user` */
DROP TABLE IF EXISTS `dam_user`;
CREATE TABLE `dam_user` (
`uid` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(20) NOT NULL DEFAULT '' COMMENT '姓名',
`email` varchar(90) NOT NULL DEFAULT '' COMMENT '电子邮件',
`password` varchar(512) NOT NULL DEFAULT '' COMMENT '加密密码',
`created` date NOT NULL COMMENT '创建时间',
`screenName` varchar(20) NOT NULL DEFAULT '' COMMENT '姓名',
PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8;
/*Table structure for table `example_quick_file` */
DROP TABLE IF EXISTS `example_quick_file`;
CREATE TABLE `example_quick_file` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'file id',
`name` varchar(200) NOT NULL COMMENT '文件名',
`length` bigint(20) unsigned zerofill NOT NULL DEFAULT '00000000000000000000' COMMENT '文件大小',
`translate_status` varchar(20) DEFAULT NULL COMMENT '转换状态',
`databag_status` varchar(20) DEFAULT NULL COMMENT '离线包状态',
`create_time` datetime NOT NULL COMMENT '创建时间',
`project_id` int(20) DEFAULT NULL,
`folder_id` bigint(20) NOT NULL,
`version` float DEFAULT NULL,
`is_folder` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1681934386546145 DEFAULT CHARSET=utf8;
/*Table structure for table `example_quick_integrate` */
DROP TABLE IF EXISTS `example_quick_integrate`;
CREATE TABLE `example_quick_integrate` (
`id` bigint(20) NOT NULL COMMENT 'integrate id',
`name` varchar(200) NOT NULL COMMENT '集成项目名',
`file_num` int(11) NOT NULL COMMENT '集成文件数目',
`integrate_status` varchar(50) NOT NULL COMMENT '集成状态,prepare,processing,success,failed',
`databag_status` varchar(50) DEFAULT NULL COMMENT '离线包状态',
`create_time` datetime NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='快速入门集成模型表';
/*Table structure for table `example_quick_integrate_file` */
DROP TABLE IF EXISTS `example_quick_integrate_file`;
CREATE TABLE `example_quick_integrate_file` (
`id` bigint(20) NOT NULL,
`integrate_id` bigint(20) NOT NULL,
`file_id` bigint(20) NOT NULL,
`file_name` varchar(200) NOT NULL,
`specialty` varchar(32) DEFAULT NULL,
`specialty_sort` float(255,0) DEFAULT NULL,
`floor` varchar(32) DEFAULT NULL,
`floor_sort` float(255,0) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `integrate_id` (`integrate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*Table structure for table `file_message` */
DROP TABLE IF EXISTS `file_message`;
CREATE TABLE `file_message` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`path` varchar(255) DEFAULT NULL,
`fileName` varchar(255) DEFAULT NULL,
`userName` varchar(255) DEFAULT NULL,
`created` int(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
/*Table structure for table `t_contents` */
DROP TABLE IF EXISTS `t_contents`;
CREATE TABLE `t_contents` (
`cid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(200) DEFAULT NULL,
`titlePic` varchar(55) DEFAULT NULL,
`slug` varchar(200) DEFAULT NULL,
`created` int(10) unsigned DEFAULT '0',
`modified` int(10) unsigned DEFAULT '0',
`content` text COMMENT '内容文字',
`authorId` int(10) unsigned DEFAULT '0',
`type` varchar(16) DEFAULT 'post',
`status` varchar(16) DEFAULT 'publish',
`tags` varchar(200) DEFAULT NULL,
`categories` varchar(200) DEFAULT NULL,
`hits` int(10) unsigned DEFAULT '0',
`commentsNum` int(10) unsigned DEFAULT '0',
`allowComment` tinyint(1) DEFAULT '1',
`allowPing` tinyint(1) DEFAULT '1',
`allowFeed` tinyint(1) DEFAULT '1',
`username` varchar(30) DEFAULT NULL,
PRIMARY KEY (`cid`) USING BTREE,
UNIQUE KEY `slug` (`slug`) USING BTREE,
KEY `created` (`created`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
/*Table structure for table `t_project` */
DROP TABLE IF EXISTS `t_project`;
CREATE TABLE `t_project` (
`created` int(10) unsigned DEFAULT NULL,
`pid` bigint(20) NOT NULL AUTO_INCREMENT,
`pname` varchar(255) DEFAULT NULL,
PRIMARY KEY (`pid`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;
/*Table structure for table `t_relationships` */
DROP TABLE IF EXISTS `t_relationships`;
CREATE TABLE `t_relationships` (
`cid` int(10) unsigned NOT NULL,
`mid` int(10) unsigned NOT NULL,
PRIMARY KEY (`cid`,`mid`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
| true |
ff981a9662bfc99d34b077830095ee9ec157eb8b | SQL | thangcong1998/graduation_web | /database/seeds/script/mysql_m_functions.sql | UTF-8 | 8,340 | 2.640625 | 3 | [] | no_license | INSERT INTO m_functions(card_template_id,organization_id,sub_code,name,code,english_name, is_staff, is_volunteer) VALUES
("1","1","OCA","Chủ tịch","A01","President", 1, 1),
("1","1","OCA","Phó Chủ tịch","A02","Vice President", 1, 1),
("1","1","OCA","Tổng Thư ký","A03","Secretary-General", 1, 1),
("1","1","OCA","Chủ tịch danh dự","A04","Honorary President", 1, 1),
("1","1","OCA","Phó Chủ tịch danh dự","A05","Honorary Vice President", 1, 1),
("1","1","OCA","Cố vấn","A06","Advisors", 1, 1),
("1","1","OCA","Trưởng Ban Thường trực","A07","Chairman of Standing Committee", 1, 1),
("1","1","OCA","Trưởng Ban Điều phối","A08","Chairman of Coordination Committee", 1, 1),
("1","1","OCA","Tổng Giám đốc","A09","Director General", 1, 1),
("1","1","OCA","Giám đốc Chuyên môn","A10","Technical Director", 1, 1),
("1","1","OCA","Thành viên EB","A11","EB Members", 1, 1),
("1","1","OCA","Khách mời đi cùng","A12","Accompanying Guest", 1, 1),
("2","3","NOC","Chủ tịch","A21","President", 1, 1),
("2","3","NOC","Tổng Thư ký","A22","Secretary General", 1, 1),
("2","3","NOC","Khách NOC (VIP được mời bởi NOC)","A23","NOC Guest (VIP invited by NOC)", 1, 1),
("2","3","NOC","Đại sứ NOC","A24","NOC Ambassador", 1, 1),
("2","3","NOC","Nhân viên","A25","Entourage", 1, 1),
("2","3","NOC","Bảo vệ hộ tống","A26","Guard escort", 1, 1),
("2","3","NOC","Khách mời đi cùng","A27","Accompanying Guest", 1, 1),
("3","2","NOC","Chủ tịch","A31","President", 1, 1),
("3","2","IOC","Phó Chủ tịch","A32","Vice President", 1, 1),
("3","2","IOC","Tổng Thư ký","A33","Secretary General", 1, 1),
("3","2","IOC","Chủ tịch Danh dự","A34","Honorary President", 1, 1),
("3","2","IOC","Thành viên Điều hành","A35","Executive Members", 1, 1),
("3","2","IOC","Tổng Giám đốc","A36","Director General", 1, 1),
("3","2","IOC","Khách mời đi cùng","A37","Accompanying Guest", 1, 1),
("4","4","IF","Chủ tịch","A41","President", 1, 1),
("4","4","IF","Tổng Thư ký","A42","Secretary-General", 1, 1),
("4","4","IF","Khách mời đi cùng","A43","Accompanying Guest", 1, 1),
("4","5","AF","Chủ tịch","A44","President", 1, 1),
("4","5","AF","Tổng Thư ký","A45","Secretary-General", 1, 1),
("4","5","AF","Khách mời đi cùng","A46","Accompanying Guest", 1, 1),
("4","9","WADA","Trưởng Ban","A51","Chairman", 1, 1),
("4","9","WADA","Tổng Giám đốc","A52","Director General", 1, 1),
("4","9","WADA","Giám đốc","A53","Director", 1, 1),
("4","9","WADA","Khách mời đi cùng","A54","Accompanying Guest", 1, 1),
("4","11","SC","Trưởng Ban","A61","Chairman", 2, 1),
("4","11","SC","Phó Trưởng Ban","A62","Vice Chairman", 2, 1),
("4","11","SC","Thành viên","A63","Member", 2, 1),
("4","12","COC","Trưởng Ban","A64","Chairman", 2, 1),
("4","12","COC","Phó Trưởng Ban","A65","Vice Chairman", 2, 1),
("4","7","XSGOC","Trưởng Ban","A71","Chairman", 1, 1),
("4","7","XSGOC","Phó Trưởng Ban","A72","Vice Chairman", 1, 1),
("4","7","XSGOC","Thành viên","A73","Member", 1, 1),
("5",null,null,"Cán bộ thành viên","A81","Staff members", 1, 1),
("5",null,null,"Thành viên Ban Thường trực","A82","Member of the Standing Committee", 1, 1),
("5",null,null,"Đại lý tiếp thị","A83","Marketing agent", 1, 1),
("5",null,null,"Nhà chuyên môn","A84","Specialist", 1, 1),
("6","3","NOC","Trưởng đoàn","B01","Team manager", 1, 1),
("6","9","WADA","Thành viên","B11","Member", 1, 1),
("6","2","IOC","Cán bộ thành viên","B21","Staff members", 1, 1),
("6","4","IF","Đại biểu chuyên môn","B31","Professional delegates", 1, 1),
("6","4","IF","Thành viên Ban Điều hành","B32","Member of the Executive Board", 1, 1),
("6","4","IF","Khách mời kèm theo của TD","B33","Attached guests of TD", 1, 1),
("6","5","AF","Đại biểu chuyên môn","B34","Professional delegates", 1, 1),
("6","5","AF","Thành viên Ban Điều hành","B35","Member of the Executive Board", 1, 1),
("6","5","AF","Khách mời kèm theo của TD","B36","Attached guests of TD", 1, 1),
("6","12","COC","Thành viên","B41","Member", 2, 1),
("6","12","COC","Trưởng Tiểu ban","B42","Head of the Subcommittee", 2, 1),
("6","12","COC","Phó trưởng Tiểu ban","B43","Deputy Head of the Subcommittee", 2, 1),
("6","13","LOC","Trưởng Ban","B44","Chairman", 2, 1),
("6","13","LOC","Phó Trưởng Ban","B45","Vice Chairman", 2, 1),
("6","10","NF","Chủ tịch","B46","President", 1, 1),
("6","10","NF","Phó Chủ tịch","B47","Vice President", 1, 1),
("6","10","NF","Tổng Thư ký","B48","General secretary", 1, 1),
("7","3","NOC","Thành viên","C01","Member", 1, 1),
("7","3","NOC","Tùy viên","C02","Attache", 1, 1),
("7","3","NOC","Phó trưởng đoàn","C03","Deputy head of the delegation", 1, 1),
("7","6","VNSGOC","Thành viên của Tiểu ban","C11","Member of the Subcommittee", 1, 1),
("7","6","VNSGOC","Thành viên","C12","Member", 1, 1),
("7","6","VNSGOC","Trưởng Tiểu ban","C13","Head of the Subcommittee", 1, 1),
("7","6","VNSGOC","Phó trưởng Tiểu ban","C14","Deputy Head of the Subcommittee", 1, 1),
("8","4","ITO","Cán bộ chuyên môn quốc tế","D01","Staff with international expertise", 1, 1),
("8","5","NTO","Cán bộ chuyên môn quốc gia","D02","National professional officer", 1, 1),
("9","3","E","Nhân viên báo chí","E01","Press staff", 1, 1),
("9","3","EP","Nhiếp ảnh gia","E02","Photographer", 1, 1),
("9","3","ET","Nhân viên hỗ trợ","E03","Support staff", 1, 1),
("10","3","RT","Phát thanh viên bản quyền","R01","Right Holding Broadcaster", 1, 1),
("10","3","RT-1","Giám sát viên","R02","Supervisor", 1, 1),
("10","3","RT-1","Nhà sản xuất","R03","Producer", 1, 1),
("10","3","RT-1","Nhà phê bình","R04","Commentator", 1, 1),
("10","3","RT-2","Nhân viên kỹ thuật","R05","Technical", 1, 1),
("10","3","RT-2","Người quay phim","R06","Cameraman", 1, 1),
("10","3","RT-3","Cán bộ hỗ trợ","R07","Support Staff", 1, 1),
("11","6","HB","Phát thanh viên nước chủ nhà","H01","Host country announcer", 1, 1),
("11","6","HB-1","Giám sát viên","H02","Supervisor", 1, 1),
("11","6","HB-1","Nhà sản xuất","H03","Producer", 1, 1),
("11","6","HB-1","Nhà phê bình","H04","Commentator", 1, 1),
("11","6","HB-2","Nhân viên kỹ thuật","H05","Technical", 1, 1),
("11","6","HB-2","Người quay phim","H06","Cameraman", 1, 1),
("11","6","HB-3","Cán bộ hỗ trợ","H07","Support Staff", 1, 1),
("13","3","NOC","Nhân viên quản lý (HQ)","F01","Management staff (HQ)", 1, 1),
("13","3","NOC","Cán Bộ","F02","Officer", 1, 1),
("13","3","NOC","Huấn luyện viên","F03","Coach", 1, 1),
("13","3","NOC","Bác sĩ","F04","Doctor", 1, 1),
("13","3","NOC","Y tá","F05","Nurse", 1, 1),
("13","3","NOC","Nhân viên mát xa","F06","Massage staff", 1, 1),
("13","3","NOC","Nhà vật lý trị liệu","F07","Physiotherapist", 1, 1),
("13","3","NOC","Đầu bếp","F08","Chef", 1, 1),
("14","3","NOC","Nhân viên bổ sung","F11","Additional staff", 1, 1),
("12","3","NOC","Vận động viên","F21","Athletes", 1, 1),
("16",null,null,"Khách mời đặc biệt","G01","The special guest", 1, 1),
("21","6","VNSGOC","Cộng sự chính thức","S01","Official partner", 1, 1),
("21","6","VNSGOC","Người bảo lãnh chính thức","S02","Official sponsor", 1, 1),
("21","6","VNSGOC","Các nhà thầu","S03","Contractors", 1, 1),
("17","12","COC","Thành viên của các Tiểu ban","P01","Members of the Subcommittees", 2, 1),
("17","12","COC","Cán bộ","P02","Officer", 2, 1),
("17","12","COC","Cán bộ phụ trách địa điểm thi đấu","P03","The officer in charge of the competition venue", 2, 1),
("17","12","COC","Nhân viên Khách sạn","P04","Hotel staff", 1, 1),
("17","12","COC","Nhân viên chuyên chở","P05","Transportation staff", 1, 1),
("18","6","VNSGOC","Phụ tá của NOC","V01","Assistant of the NOC", 1, 2),
("18","6","VNSGOC","Tình nguyện viên","V02","Volunteers",1, 2),
("18","6","VNSGOC","Các tình nguyện viên thuộc địa điểm thi đấu","V03","Volunteers from the competition site", 1, 2),
("18","6","VNSGOC","Tình nguyện viên khách sạn","V04","Volunteer hotel", 1, 2),
("18","6","VNSGOC","Tình nguyện viên chuyên chở","V05","Volunteer transportation", 1, 2),
("19","6","VNSGOC","Bảo vệ","X01","Guard", 1, 1)
| true |
0dc19d4bac88d630f99f4a7e06fc2703013a1623 | SQL | RajivMuneshwer/SHOPIFY_PRO_PIC | /Pictures/SQL/UPDATETriggerProducts.sql | UTF-8 | 1,083 | 2.984375 | 3 | [] | no_license | CREATE TRIGGER up_shopify
AFTER UPDATE
ON
Products
FOR EACH ROW
UPDATE Shopify
SET
Variant_Barcode = NEW.CodeNumber,
Type = NEW.GroupName,
Tags = NEW.Tags,
Handle = (LOWER(REPLACE((SELECT DescriptiveText
FROM PLUS
WHERE CodeText = NEW.CodeNumber)," ","-"))),
Title = (SELECT DescriptiveText FROM PLUS WHERE CodeText = NEW.CodeNumber),
Body_HTML = (SELECT DescriptiveText FROM PLUS WHERE CodeText = NEW.CodeNumber),
Variant_Price = (SELECT Prices11 FROM PLUS WHERE CodeText = NEW.CodeNumber),
Variant_Inventory_Qty = (SELECT StockCurrent FROM PLUS WHERE CodeText = NEW.CodeNumber),
Variant_SKU = (SUBSTRING((SELECT DescriptiveText FROM PLUS WHERE CodeText = NEW.CodeNumber)
FROM (LOCATE("#",(SELECT DescriptiveText FROM PLUS WHERE CodeText = NEW.CodeNumber)) + 1)
FOR (LOCATE(" ",(SELECT DescriptiveText FROM PLUS WHERE CodeText = NEW.CodeNumber), LOCATE("#",(SELECT DescriptiveText FROM PLUS WHERE CodeText = NEW.CodeNumber)))) - (LOCATE("#",(SELECT DescriptiveText FROM PLUS WHERE CodeText = NEW.CodeNumber)))))
WHERE
Variant_Barcode = NEW.CodeNumber
| true |
8bbb4c56213115b784f577fb51c40b1d3dcdab64 | SQL | arudenko2002/sst_speed_layer_data | /bigquery/speedlayer_staging/metadata/project.sql | UTF-8 | 1,292 | 3.8125 | 4 | [] | no_license | #standardSQL
with project as (select
ANY_VALUE([cast(master_artist_id as string), master_artist]) as master_artist_array,
project_id,
project_title,
min(project_release_date) as project_release_date,
min(first_project_activity_week) as first_project_activity_week,
min(earliest_project_release_date) as earliest_project_release_date,
array_agg(distinct sub_genre_code) as genres,
array_agg(distinct label_family_id) as label_families
from `umg-marketing.metadata.product`
where master_artist_id <> -1
and project_title <> ''
group by
project_id,
project_title)
select
p.project_id as _id,
p.project_title as title,
p.master_artist_array[offset(0)] as artist_id,
p.master_artist_array[offset(1)] as artist,
p.project_release_date as release_date,
p.earliest_project_release_date as earliest_release_date,
p.first_project_activity_week as first_activity_week,
ifnull(r.rank, 99999999) as rank,
array(select el
from unnest(p.genres) as el
where el is not null
and el <> '') as genres,
array(select el
from unnest(p.label_families) as el
where el is not null) as label_families
from project p
left outer join `umg-dev.consumption_speed_layer_aggregation.top_project_v1_15000104` r on cast(p.project_id as string) = r.project_id
order by rank | true |
03b044b25f536adf1841f82cf0950fb3ccb680ff | SQL | AnaVuc/psi-All-pain-No-gain | /baza.ddl | UTF-8 | 3,491 | 3.453125 | 3 | [
"MIT"
] | permissive |
CREATE TABLE Admin
(
Korisnicko_ime CHAR(18) NOT NULL,
Password CHAR(18) NULL
);
ALTER TABLE Admin
ADD CONSTRAINT XPKAdmin PRIMARY KEY (Korisnicko_ime);
CREATE TABLE Moderator
(
Korisnicko_ime_mod CHAR(18) NOT NULL,
Password CHAR(18) NULL
);
ALTER TABLE Moderator
ADD CONSTRAINT XPKModerator PRIMARY KEY (Korisnicko_ime_mod);
CREATE TABLE Ostavljena_za
(
idRec INTEGER NOT NULL,
idR INTEGER NOT NULL,
Korisnicko_ime CHAR(18) NOT NULL
);
ALTER TABLE Ostavljena_za
ADD CONSTRAINT XPKOstavljena_za PRIMARY KEY (idRec,idR,Korisnicko_ime);
CREATE TABLE Poseceni_restorani
(
idR INTEGER NOT NULL,
Korisnicko_ime CHAR(18) NOT NULL
);
ALTER TABLE Poseceni_restorani
ADD CONSTRAINT XPKPoseceni_restorani PRIMARY KEY (idR,Korisnicko_ime);
CREATE TABLE Radno_vreme
(
idRV CHAR(18) NOT NULL,
idR INTEGER NOT NULL,
Ponedeljak CHAR(18) NULL,
Utorak CHAR(18) NULL,
Sreda CHAR(18) NULL,
Cetvrtak CHAR(18) NULL,
Petak CHAR(18) NULL,
Subota CHAR(18) NULL,
Nedelja CHAR(18) NULL
);
ALTER TABLE Radno_vreme
ADD CONSTRAINT XPKRadno_vreme PRIMARY KEY (idRV);
CREATE TABLE Recenzija
(
idRec INTEGER NOT NULL,
Korisnicko_ime_mod CHAR(18) NULL,
idR INTEGER NOT NULL,
Tekst TEXT NULL,
Ocena INTEGER NULL
);
ALTER TABLE Recenzija
ADD CONSTRAINT XPKRecenzija PRIMARY KEY (idRec);
CREATE TABLE Registrovan_korisnik
(
Korisnicko_ime CHAR(18) NOT NULL,
Password CHAR(18) NULL,
Ime CHAR(18) NULL,
Prezime CHAR(18) NULL
);
ALTER TABLE Registrovan_korisnik
ADD CONSTRAINT XPKRegistrovan_korisnik PRIMARY KEY (Korisnicko_ime);
CREATE TABLE Restoran
(
idR INTEGER NOT NULL,
Ime CHAR(18) NULL,
Broj_telefona CHAR(18) NULL,
Adresa CHAR(18) NULL,
Sajt CHAR(18) NULL,
Vrsta_hrane CHAR(18) NULL,
Cenovni_rang CHAR(18) NULL,
Prosecna_ocena CHAR(18) NULL,
idSl CHAR(18) NULL,
Opis TEXT NULL
);
ALTER TABLE Restoran
ADD CONSTRAINT XPKRestoran PRIMARY KEY (idR);
CREATE TABLE Slika
(
idSl CHAR(18) NOT NULL,
Opis TEXT NULL,
Slika LONGBLOB NULL,
idRec INTEGER NULL
);
ALTER TABLE Slika
ADD CONSTRAINT XPKSlika PRIMARY KEY (idSl);
ALTER TABLE Ostavljena_za
ADD CONSTRAINT R_17 FOREIGN KEY (idRec) REFERENCES Recenzija (idRec);
ALTER TABLE Ostavljena_za
ADD CONSTRAINT R_18 FOREIGN KEY (idR, Korisnicko_ime) REFERENCES Poseceni_restorani (idR, Korisnicko_ime);
ALTER TABLE Poseceni_restorani
ADD CONSTRAINT R_15 FOREIGN KEY (idR) REFERENCES Restoran (idR);
ALTER TABLE Poseceni_restorani
ADD CONSTRAINT R_16 FOREIGN KEY (Korisnicko_ime) REFERENCES Registrovan_korisnik (Korisnicko_ime);
ALTER TABLE Radno_vreme
ADD CONSTRAINT R_9 FOREIGN KEY (idR) REFERENCES Restoran (idR);
ALTER TABLE Recenzija
ADD CONSTRAINT R_7 FOREIGN KEY (idR) REFERENCES Restoran (idR);
ALTER TABLE Recenzija
ADD CONSTRAINT R_19 FOREIGN KEY (Korisnicko_ime_mod) REFERENCES Moderator (Korisnicko_ime_mod);
ALTER TABLE Restoran
ADD CONSTRAINT R_20 FOREIGN KEY (idSl) REFERENCES Slika (idSl);
ALTER TABLE Slika
ADD CONSTRAINT R_11 FOREIGN KEY (idRec) REFERENCES Recenzija (idRec);
| true |
a8cb39443a7970af8ad7a12fb15e83daae0b1f6a | SQL | VB6Hobbyst7/VB-2 | /평택굿모닝병원_아미스/APEX96/Log/20201006.sql | UHC | 29,233 | 2.578125 | 3 | [] | no_license | [12:32:42 ]
[2010053230] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053230' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result : NTM 缺
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '33099' and resultflag < 3
[12:32:42 ]
[2010053230] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053230' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
[2010054360] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054360' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '47425' and resultflag < 3
[12:32:42 ]
[2010054360] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054360' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
[2010053512] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053512' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '38828' and resultflag < 3
[12:32:42 ]
[2010053512] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053512' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
[2010054279] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054279' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '48173' and resultflag < 3
[12:32:42 ]
[2010054279] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054279' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
[2010053999] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053999' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:42 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '39589' and resultflag < 3
[12:32:42 ]
[2010053999] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053999' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
[2010060315] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010060315' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201006' and resultno = '2991' and resultflag < 3
[12:32:43 ]
[2010060315] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010060315' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
[2010051641] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010051641' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '40447' and resultflag < 3
[12:32:43 ]
[2010051641] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010051641' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
[2010061198] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010061198' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201006' and resultno = '18042' and resultflag < 3
[12:32:43 ]
[2010061198] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010061198' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
[2010051858] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010051858' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '41947' and resultflag < 3
[12:32:43 ]
[2010051858] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010051858' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
[2010052260] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010052260' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '44888' and resultflag < 3
[12:32:43 ]
[2010052260] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010052260' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:43 ]
[2010054508] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054508' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:44 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '45294' and resultflag < 3
[12:32:44 ]
[2010054508] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054508' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:44 ]
[2010054639] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054639' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0042' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[12:32:44 ]
UPDATE resultofnum SET textresultval = 'Study: MTB/NTM
Specimen: DNA isloated from sputum
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
Result :
COMMENTS:
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '47406' and resultflag < 3
[12:32:44 ]
[2010054639] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010054639' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0045' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[13:50:41 ]
[2010051400] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010051400' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0041' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[13:50:41 ]
UPDATE resultofnum SET textresultval = 'Study: Acute Diarrhea Causing Bacteria
Specimen: DNA isolated from Rectal swab
Method: 19 Pathogen Multiplex Real-time PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Campylobacter Jejuni Negative Negative
*Campylobacter Coli Negative Negative
Clostridium perfrigens Negative Negative
Vibrio cholera Negative Negative
Vibrio vulnificus Negative Negative
Vibrio parahaemolyticus Negative Negative
Listeria monocytogenes Negative Negative
*Salmonella spp. Negative Negative
Bacillus cereus Negative Negative
Yersinia enterocolitica Negative Negative
Staphylococcus aureus Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT1) Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT2) Negative Negative
EnteroToxigenic E. Coli(ETEC, LT) Negative Negative
EnteroToxigenic E. Coli(ETEC, ST) Negative Negative
EnteroAggregative E. Coli(EAEC) Negative Negative
EnteroPathogenic E. Coli(EPEC, bfpA ) Negative Negative
EnteroPathogenic E. Coli(EPEC, eaeA ) Negative Negative
*Enterolnvasive E. Coli(EIEC/Shigella) Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '39677' and resultflag < 3
[13:50:41 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010051400'
[13:50:41 ]
[2010031242] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010031242' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0041' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[13:50:41 ]
UPDATE resultofnum SET textresultval = 'Study: Acute Diarrhea Causing Bacteria
Specimen: DNA isolated from Rectal swab
Method: 19 Pathogen Multiplex Real-time PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Campylobacter Jejuni Negative Negative
*Campylobacter Coli Negative Negative
Clostridium perfrigens Negative Negative
Vibrio cholera Negative Negative
Vibrio vulnificus Negative Negative
Vibrio parahaemolyticus Negative Negative
Listeria monocytogenes Negative Negative
*Salmonella spp. Negative Negative
Bacillus cereus Negative Negative
Yersinia enterocolitica Negative Negative
Staphylococcus aureus Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT1) Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT2) Negative Negative
EnteroToxigenic E. Coli(ETEC, LT) Negative Negative
EnteroToxigenic E. Coli(ETEC, ST) Negative Negative
EnteroAggregative E. Coli(EAEC) Negative Negative
EnteroPathogenic E. Coli(EPEC, bfpA ) Negative Negative
EnteroPathogenic E. Coli(EPEC, eaeA ) Negative Negative
*Enterolnvasive E. Coli(EIEC/Shigella) Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '42896' and resultflag < 3
[13:50:41 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010031242'
[13:50:41 ]
[2010053692] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053692' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0041' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[13:50:41 ]
UPDATE resultofnum SET textresultval = 'Study: Acute Diarrhea Causing Bacteria
Specimen: DNA isolated from Rectal swab
Method: 19 Pathogen Multiplex Real-time PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Campylobacter Jejuni Negative Negative
*Campylobacter Coli Negative Negative
Clostridium perfrigens Negative Negative
Vibrio cholera Negative Negative
Vibrio vulnificus Negative Negative
Vibrio parahaemolyticus Negative Negative
Listeria monocytogenes Negative Negative
*Salmonella spp. Negative Negative
Bacillus cereus Negative Negative
Yersinia enterocolitica Negative Negative
Staphylococcus aureus Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT1) Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT2) Negative Negative
EnteroToxigenic E. Coli(ETEC, LT) Negative Negative
EnteroToxigenic E. Coli(ETEC, ST) Negative Negative
EnteroAggregative E. Coli(EAEC) Negative Negative
EnteroPathogenic E. Coli(EPEC, bfpA ) Negative Negative
EnteroPathogenic E. Coli(EPEC, eaeA ) Negative Negative
*Enterolnvasive E. Coli(EIEC/Shigella) Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '43193' and resultflag < 3
[13:50:41 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010053692'
[13:50:41 ]
[2010060332] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010060332' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0041' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[13:50:41 ]
UPDATE resultofnum SET textresultval = 'Study: Acute Diarrhea Causing Bacteria
Specimen: DNA isolated from Rectal swab
Method: 19 Pathogen Multiplex Real-time PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Campylobacter Jejuni Negative Negative
*Campylobacter Coli Negative Negative
Clostridium perfrigens Negative Negative
Vibrio cholera Negative Negative
Vibrio vulnificus Negative Negative
Vibrio parahaemolyticus Negative Negative
Listeria monocytogenes Negative Negative
*Salmonella spp. Negative Negative
Bacillus cereus Negative Negative
Yersinia enterocolitica Negative Negative
Staphylococcus aureus Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT1) Negative Negative
*EnteroHemorrhage E. Coli(EHEC, VT2) Negative Negative
EnteroToxigenic E. Coli(ETEC, LT) Negative Negative
EnteroToxigenic E. Coli(ETEC, ST) Negative Negative
EnteroAggregative E. Coli(EAEC) Negative Negative
EnteroPathogenic E. Coli(EPEC, bfpA ) Negative Negative
EnteroPathogenic E. Coli(EPEC, eaeA ) Negative Negative
*Enterolnvasive E. Coli(EIEC/Shigella) Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201006' and resultno = '3504' and resultflag < 3
[13:50:41 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010060332'
[16:18:56 ]
[2010051399] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010051399' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0044' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[16:18:56 ]
UPDATE resultofnum SET textresultval = 'Study: Screening Test of Acute Diarrhea Causing Virus
(Group A Rotavirus, Norovirus GI, II, Adeno Virus)
Specimen: RNA isolated from Rectal swab
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Adenovirus Negative Negative
Astrovirus Negative Negative
*Rotavirus Negative Negative
*Noro GI virus Negative Negative
*Noro GII virus Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '39676' and resultflag < 3
[16:18:56 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010051399'
[16:18:56 ]
[2010031243] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010031243' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0044' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[16:18:56 ]
UPDATE resultofnum SET textresultval = 'Study: Screening Test of Acute Diarrhea Causing Virus
(Group A Rotavirus, Norovirus GI, II, Adeno Virus)
Specimen: RNA isolated from Rectal swab
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Adenovirus Negative Negative
Astrovirus Negative Negative
*Rotavirus Negative Negative
*Noro GI virus Negative Negative
*Noro GII virus Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '42897' and resultflag < 3
[16:18:56 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010031243'
[16:18:56 ]
[2010053693] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010053693' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0044' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[16:18:56 ]
UPDATE resultofnum SET textresultval = 'Study: Screening Test of Acute Diarrhea Causing Virus
(Group A Rotavirus, Norovirus GI, II, Adeno Virus)
Specimen: RNA isolated from Rectal swab
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Adenovirus Negative Negative
Astrovirus Negative Negative
*Rotavirus Negative Negative
*Noro GI virus Negative Negative
*Noro GII virus Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201005' and resultno = '43194' and resultflag < 3
[16:18:56 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010053693'
[16:18:56 ]
[2010060331] SELECT R.RESULTDATE, R.RESULTNO, R.ACPTDATE, R.ACPTSEQ, R.REFVALFLAG, R.RESULTITEMCODE as resultitemcode, R.PATID, L.CHANNELNO FROM REGISTINFOS F, ResultofNum R, LabRsltItemBases L WHERE R.SpcmNo = '2010060331' AND R.SpcmNo = F.SpcmNo AND R.OrderCode = 'LG0044' AND L.ResultItemCode = R.ResultItemCode ORDER BY R.AcptDate, R.AcptSeq
[16:18:56 ]
UPDATE resultofnum SET textresultval = 'Study: Screening Test of Acute Diarrhea Causing Virus
(Group A Rotavirus, Norovirus GI, II, Adeno Virus)
Specimen: RNA isolated from Rectal swab
Method: Multiplex Real-time Reverse Transcription PCR
Clinical Diagnosis :
Pathologic Diagnosis :
˻ ġ
*Adenovirus Negative Negative
Astrovirus Negative Negative
*Rotavirus Negative Negative
*Noro GI virus Negative Negative
*Noro GII virus Negative Negative
COMMENTS:
ϴ.
', resultindate = TO_CHAR(SYSDATE, 'YYYYMMDD'), resultintime = TO_CHAR(SYSDATE, 'HH24MI'), resultinid = '0160033', resultflag = '1' WHERE resultdate = '20201006' and resultno = '3503' and resultflag < 3
[16:18:56 ]
UPDATE REGISTINFOS SET RsvAcptState = 4, ResultState = 1 WHERE ResultState < 3 and spcmno = '2010060331'
| true |
302f0fee90dee827d811f47445718d4eb9548fec | SQL | AlexWoo176/QuanLyThuVien | /QuanLyThuVien.sql | UTF-8 | 9,384 | 3.046875 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: qltv
-- ------------------------------------------------------
-- Server version 8.0.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 */;
/*!50503 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 `chuongtrinhmuontra`
--
DROP TABLE IF EXISTS `chuongtrinhmuontra`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `chuongtrinhmuontra` (
`MaMuonDaTra` varchar(255) NOT NULL,
`MaSach` varchar(255) NOT NULL,
`GhiChu` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`DaTra` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`NgayTra` date NOT NULL,
PRIMARY KEY (`MaMuonDaTra`),
KEY `MaSach` (`MaSach`),
CONSTRAINT `chuongtrinhmuontra_ibfk_1` FOREIGN KEY (`MaSach`) REFERENCES `sach` (`MaSach`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `chuongtrinhmuontra`
--
LOCK TABLES `chuongtrinhmuontra` WRITE;
/*!40000 ALTER TABLE `chuongtrinhmuontra` DISABLE KEYS */;
/*!40000 ALTER TABLE `chuongtrinhmuontra` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `docgia`
--
DROP TABLE IF EXISTS `docgia`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `docgia` (
`MaDocGia` varchar(255) NOT NULL,
`TenDocGia` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`DiaChi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`SoThe` varchar(255) NOT NULL,
PRIMARY KEY (`MaDocGia`),
KEY `SoThe` (`SoThe`),
CONSTRAINT `docgia_ibfk_1` FOREIGN KEY (`SoThe`) REFERENCES `thethuvien` (`SoThe`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `docgia`
--
LOCK TABLES `docgia` WRITE;
/*!40000 ALTER TABLE `docgia` DISABLE KEYS */;
/*!40000 ALTER TABLE `docgia` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `muontra`
--
DROP TABLE IF EXISTS `muontra`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `muontra` (
`MaMuonTra` varchar(255) NOT NULL,
`SoThe` varchar(255) NOT NULL,
`MaNhanVien` varchar(255) NOT NULL,
`NgayMuon` date NOT NULL,
`MaSach` varchar(255) NOT NULL,
`MaTacGia` varchar(255) NOT NULL,
`MaTheLoai` varchar(255) NOT NULL,
PRIMARY KEY (`MaMuonTra`),
KEY `SoThe` (`SoThe`),
KEY `MaNhanVien` (`MaNhanVien`),
KEY `MaTheLoai` (`MaTheLoai`),
KEY `MaTacGia` (`MaTacGia`),
KEY `MaSach` (`MaSach`),
CONSTRAINT `muontra_ibfk_1` FOREIGN KEY (`SoThe`) REFERENCES `thethuvien` (`SoThe`),
CONSTRAINT `muontra_ibfk_2` FOREIGN KEY (`MaNhanVien`) REFERENCES `nhanvien` (`MaNhanVien`),
CONSTRAINT `muontra_ibfk_3` FOREIGN KEY (`MaTheLoai`) REFERENCES `theloai` (`MaTheLoai`),
CONSTRAINT `muontra_ibfk_4` FOREIGN KEY (`MaTacGia`) REFERENCES `tacgia` (`MaTacGia`),
CONSTRAINT `muontra_ibfk_5` FOREIGN KEY (`MaSach`) REFERENCES `sach` (`MaSach`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `muontra`
--
LOCK TABLES `muontra` WRITE;
/*!40000 ALTER TABLE `muontra` DISABLE KEYS */;
/*!40000 ALTER TABLE `muontra` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `nhanvien`
--
DROP TABLE IF EXISTS `nhanvien`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `nhanvien` (
`MaNhanVien` varchar(255) NOT NULL,
`HoTen` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`NgaySinh` date NOT NULL,
`SoDienThoai` int NOT NULL,
PRIMARY KEY (`MaNhanVien`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `nhanvien`
--
LOCK TABLES `nhanvien` WRITE;
/*!40000 ALTER TABLE `nhanvien` DISABLE KEYS */;
/*!40000 ALTER TABLE `nhanvien` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `nhaxuatban`
--
DROP TABLE IF EXISTS `nhaxuatban`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `nhaxuatban` (
`MaNXB` varchar(255) NOT NULL,
`TenNXB` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`DiaChi` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`Email` varchar(255) NOT NULL,
`ThongTinNguoiDaiDien` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`MaNXB`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `nhaxuatban`
--
LOCK TABLES `nhaxuatban` WRITE;
/*!40000 ALTER TABLE `nhaxuatban` DISABLE KEYS */;
/*!40000 ALTER TABLE `nhaxuatban` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `sach`
--
DROP TABLE IF EXISTS `sach`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `sach` (
`MaSach` varchar(255) NOT NULL,
`TenSach` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`MaTacGia` varchar(255) NOT NULL,
`MaTheLoai` varchar(255) NOT NULL,
`MaNXB` varchar(255) NOT NULL,
`NamXuatBan` year DEFAULT NULL,
PRIMARY KEY (`MaSach`),
KEY `MaTacGia` (`MaTacGia`),
KEY `MaTheLoai` (`MaTheLoai`),
KEY `MaNXB` (`MaNXB`),
CONSTRAINT `sach_ibfk_1` FOREIGN KEY (`MaTacGia`) REFERENCES `tacgia` (`MaTacGia`),
CONSTRAINT `sach_ibfk_2` FOREIGN KEY (`MaTheLoai`) REFERENCES `theloai` (`MaTheLoai`),
CONSTRAINT `sach_ibfk_3` FOREIGN KEY (`MaNXB`) REFERENCES `nhaxuatban` (`MaNXB`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `sach`
--
LOCK TABLES `sach` WRITE;
/*!40000 ALTER TABLE `sach` DISABLE KEYS */;
/*!40000 ALTER TABLE `sach` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `tacgia`
--
DROP TABLE IF EXISTS `tacgia`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `tacgia` (
`MaTacGia` varchar(255) NOT NULL,
`TenTacGia` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`Website` varchar(255) DEFAULT NULL,
`GhiChu` text,
PRIMARY KEY (`MaTacGia`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `tacgia`
--
LOCK TABLES `tacgia` WRITE;
/*!40000 ALTER TABLE `tacgia` DISABLE KEYS */;
/*!40000 ALTER TABLE `tacgia` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `theloai`
--
DROP TABLE IF EXISTS `theloai`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `theloai` (
`MaTheLoai` varchar(255) NOT NULL,
`TenTheLoai` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL,
PRIMARY KEY (`MaTheLoai`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `theloai`
--
LOCK TABLES `theloai` WRITE;
/*!40000 ALTER TABLE `theloai` DISABLE KEYS */;
/*!40000 ALTER TABLE `theloai` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `thethuvien`
--
DROP TABLE IF EXISTS `thethuvien`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `thethuvien` (
`SoThe` varchar(255) NOT NULL,
`HoTen` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`NgaySinh` date NOT NULL,
`SoDienThoai` int NOT NULL,
PRIMARY KEY (`SoThe`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `thethuvien`
--
LOCK TABLES `thethuvien` WRITE;
/*!40000 ALTER TABLE `thethuvien` DISABLE KEYS */;
/*!40000 ALTER TABLE `thethuvien` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-05-05 16:44:40
| true |
257797a9c96b4d4db1e74930f31918e4e39f182d | SQL | irshadkhan248/JavaPythonAndroidMysqlCode | /irshad dir/kamal/demo_mysql/L9/prac6.sql | UTF-8 | 478 | 3.046875 | 3 | [] | no_license | delimiter $$
use L9_db
drop procedure if exists p13 $$
create procedure p13()
begin
declare a int default 0;
declare b int default 0;
declare c int default 0;
declare c1 cursor for select marks from student;
open c1;
declare exit handler for 1329 begin end;
if m >=85 then set a=a+1
else if (m<85 and m>=60) then set b=b+1
else set c=c+1;
close c1;
select concat('marks > 85', a,' marks less than 85 ', b,' marks less than 60',c);
end $$
delimiter ; | true |
ecb3c897616d934fe408e05e90171aaf8904d108 | SQL | jkwagneriii/employeeTracker | /db/seeds.sql | UTF-8 | 1,021 | 2.859375 | 3 | [] | no_license | USE employee_db;
-- DEPARTMENT
INSERT INTO department (departmentName) VALUES ("Production");
INSERT INTO department (departmentName) VALUES ("Research and Development");
INSERT INTO department (departmentName) VALUES ("Marketing");
INSERT INTO department (departmentName) VALUES ("Film and Technology");
-- ROLE
INSERT INTO roles (title, salary, department_id) VALUES ('Director', 100, 1);
INSERT INTO roles (title, salary, department_id) VALUES ('Script Supervisor', 75, 2);
INSERT INTO roles (title, salary, department_id) VALUES ('Billboard Graphics', 50, 3);
INSERT INTO roles (title, salary, department_id) VALUES ('Cinematographer', 90, 4);
-- EMPLOYEE
INSERT INTO employee (first_name, last_name, role_id) VALUES ('Jangles', 'McRickity', 1);
INSERT INTO employee (first_name, last_name, role_id) VALUES ('Sloan', 'Bobkins', 2);
INSERT INTO employee (first_name, last_name, role_id) VALUES ('Delaware', 'Shumps', 3);
INSERT INTO employee (first_name, last_name, role_id) VALUES ('Chancellor', 'McRickity', 4);
| true |
6b3cdd4fa1b30335e063408132270056ec76070c | SQL | Roy-05/itc-528 | /Saket Roy Assignment-7/Saket Roy ex_7_17_airline_coverage.sql | UTF-8 | 1,158 | 3.359375 | 3 | [] | no_license | create or replace procedure ex7_17_airline_coverage as
cursor flight_dest_cur is
select distinct dest_region
from flight;
cursor flight_details(dest in varchar2) is
select flight_no, name, dest_city
from flight
where dest_region = dest;
flight_dest varchar2(15);
begin
open flight_dest_cur;
loop
fetch flight_dest_cur into flight_dest;
exit when flight_dest_cur%notfound;
dbms_output.put_line(chr(10)||chr(13)); -- CRLF for formatting
dbms_output.put_line(rpad('Geographic Region:', 25) || flight_dest);
dbms_output.put_line('------------------');
dbms_output.put_line(chr(10)||chr(13)); -- CRLF for formatting
dbms_output.put_line(rpad('Carrier', 25) || rpad('Flights', 10) || 'Destination');
dbms_output.put_line(rpad('-------', 25) || rpad('-------', 10) || '-----------');
for flight_row in flight_details(flight_dest)
loop
dbms_output.put_line(rpad(flight_row.name, 25) || rpad(flight_row.flight_no, 10) || flight_row.dest_city);
end loop;
end loop;
close flight_dest_cur;
end;
| true |
57367aee6267c76ab49063cdb4717a33dd41c8de | SQL | CDONhom14/BaoCaoNhom14 | /export_BH_1.sql | WINDOWS-1258 | 81,780 | 2.640625 | 3 | [
"MIT",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | --------------------------------------------------------
-- File created - Friday-May-04-2018
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Type REPCAT$_OBJECT_NULL_VECTOR
--------------------------------------------------------
CREATE OR REPLACE TYPE "SYSTEM"."REPCAT$_OBJECT_NULL_VECTOR" AS OBJECT
(
-- type owner, name, hashcode for the type represented by null_vector
type_owner VARCHAR2(30),
type_name VARCHAR2(30),
type_hashcode RAW(17),
-- null_vector for a particular object instance
-- ROBJ REVISIT: should only contain the null image, and not version#
null_vector RAW(2000)
)
/
--------------------------------------------------------
-- DDL for Sequence LOGMNR_EVOLVE_SEQ$
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."LOGMNR_EVOLVE_SEQ$" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence LOGMNR_SEQ$
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."LOGMNR_SEQ$" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE ORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence LOGMNR_UIDS$
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."LOGMNR_UIDS$" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 100 NOCACHE ORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence MVIEW$_ADVSEQ_GENERIC
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."MVIEW$_ADVSEQ_GENERIC" MINVALUE 1 MAXVALUE 4294967295 INCREMENT BY 1 START WITH 1 CACHE 50 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence MVIEW$_ADVSEQ_ID
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."MVIEW$_ADVSEQ_ID" MINVALUE 1 MAXVALUE 4294967295 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_EXCEPTIONS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_EXCEPTIONS_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_FLAVORS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_FLAVORS_S" MINVALUE -2147483647 MAXVALUE 2147483647 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_FLAVOR_NAME_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_FLAVOR_NAME_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_REFRESH_TEMPLATES_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_REFRESH_TEMPLATES_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_REPPROP_KEY
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_REPPROP_KEY" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_RUNTIME_PARMS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_RUNTIME_PARMS_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_TEMPLATE_OBJECTS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_TEMPLATE_OBJECTS_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_TEMPLATE_PARMS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_TEMPLATE_PARMS_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_TEMPLATE_REFGROUPS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_TEMPLATE_REFGROUPS_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_TEMPLATE_SITES_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_TEMPLATE_SITES_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_TEMP_OUTPUT_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_TEMP_OUTPUT_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_USER_AUTHORIZATIONS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_USER_AUTHORIZATIONS_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT$_USER_PARM_VALUES_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT$_USER_PARM_VALUES_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence REPCAT_LOG_SEQUENCE
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."REPCAT_LOG_SEQUENCE" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Sequence TEMPLATE$_TARGETS_S
--------------------------------------------------------
CREATE SEQUENCE "SYSTEM"."TEMPLATE$_TARGETS_S" MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
--------------------------------------------------------
-- DDL for Table admin
--------------------------------------------------------
CREATE TABLE "SYSTEM"."admin"
( "ID" NUMBER(*,0),
"username" VARCHAR2(32 BYTE),
"password" VARCHAR2(32 BYTE),
"name" VARCHAR2(32 BYTE),
"ADMIN_GROUP_ID" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Table admin_group
--------------------------------------------------------
CREATE TABLE "SYSTEM"."admin_group"
( "ID" NUMBER(*,0),
"name" VARCHAR2(128 BYTE),
"sort_order" NUMBER(*,0),
"permissions" CLOB
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("permissions") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table catalog
--------------------------------------------------------
CREATE TABLE "SYSTEM"."catalog"
( "ID" NUMBER(*,0),
"name" NVARCHAR2(128),
"site_title" VARCHAR2(128 BYTE),
"meta_desc" VARCHAR2(255 BYTE),
"meta_key" VARCHAR2(255 BYTE),
"parent_id" NUMBER(*,0),
"sort_order" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Table comment
--------------------------------------------------------
CREATE TABLE "SYSTEM"."comment"
( "ID" NUMBER(*,0),
"ID_PRODUCT" NUMBER(*,0),
"parent_id" NUMBER(*,0),
"user_name" VARCHAR2(3999 BYTE),
"user_email" VARCHAR2(100 BYTE),
"ID_USERS" NUMBER(*,0),
"user_ip" VARCHAR2(20 BYTE),
"content" CLOB,
"created" NUMBER(*,0),
"count_like" NUMBER(*,0),
"status" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("content") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table contact
--------------------------------------------------------
CREATE TABLE "SYSTEM"."contact"
( "ID" NUMBER(*,0),
"name" VARCHAR2(100 BYTE),
"email" VARCHAR2(50 BYTE),
"address" VARCHAR2(255 BYTE),
"title" VARCHAR2(255 BYTE),
"content" CLOB,
"phone" VARCHAR2(20 BYTE),
"created" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("content") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table content_static
--------------------------------------------------------
CREATE TABLE "SYSTEM"."content_static"
( "ID" NUMBER(*,0),
"key" VARCHAR2(128 BYTE),
"content" CLOB
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("content") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table info
--------------------------------------------------------
CREATE TABLE "SYSTEM"."info"
( "ID" NUMBER(*,0),
"title" NVARCHAR2(255),
"content" CLOB,
"meta_desc" NVARCHAR2(255),
"meta_key" NVARCHAR2(255),
"created" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("content") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table maker
--------------------------------------------------------
CREATE TABLE "SYSTEM"."maker"
( "ID" NUMBER(*,0),
"name" VARCHAR2(255 BYTE),
"info" CLOB,
"meta_desc" VARCHAR2(255 BYTE),
"meta_key" VARCHAR2(255 BYTE),
"site_title" VARCHAR2(255 BYTE),
"sort_order" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("info") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table menu
--------------------------------------------------------
CREATE TABLE "SYSTEM"."menu"
( "ID" NUMBER(*,0),
"parent_id" NUMBER(*,0),
"title" VARCHAR2(128 BYTE),
"url" VARCHAR2(255 BYTE),
"sort_order" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Table new
--------------------------------------------------------
CREATE TABLE "SYSTEM"."new"
( "ID" NUMBER(*,0),
"title" NVARCHAR2(255),
"intro" NVARCHAR2(255),
"content" CLOB,
"meta_desc" VARCHAR2(255 BYTE),
"meta_key" VARCHAR2(255 BYTE),
"image_link" VARCHAR2(250 BYTE),
"created" NUMBER(*,0),
"feature" BLOB,
"count_view" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("content") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
LOB ("feature") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table order
--------------------------------------------------------
CREATE TABLE "SYSTEM"."order"
( "ID" NUMBER(*,0),
"ID_ORDER" NUMBER(*,0),
"product_id" NUMBER(*,0),
"qty" NUMBER(*,0),
"amount" NUMBER(15,4),
"data" CLOB,
"status" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("data") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table product
--------------------------------------------------------
CREATE TABLE "SYSTEM"."product"
( "ID" NUMBER(*,0),
"ID_CATALOG" NUMBER(*,0),
"name" NVARCHAR2(100),
"ID_MAKER" NUMBER(*,0),
"price" NUMBER(15,4),
"content" CLOB,
"discount" NUMBER(*,0),
"image_link" NVARCHAR2(50),
"image_list" CLOB,
"created" NUMBER(*,0),
"view" NUMBER(*,0),
"meta_key" NVARCHAR2(255),
"site_title" NVARCHAR2(255),
"warranty" NVARCHAR2(50),
"total" NUMBER(*,0),
"buyed" NUMBER(*,0),
"rate_total" NUMBER(*,0),
"rate_count" NUMBER(*,0),
"gifts" NVARCHAR2(100),
"video" NVARCHAR2(255),
"meta_desc" NVARCHAR2(255),
"feature" BLOB
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("content") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
LOB ("image_list") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))
LOB ("feature") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table slide
--------------------------------------------------------
CREATE TABLE "SYSTEM"."slide"
( "ID" NUMBER(*,0),
"name" NVARCHAR2(100),
"image_name" NVARCHAR2(100),
"image_link" NVARCHAR2(50),
"link" NVARCHAR2(150),
"info" NVARCHAR2(100),
"sort_order" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Table support
--------------------------------------------------------
CREATE TABLE "SYSTEM"."support"
( "ID" NUMBER(*,0),
"name" NVARCHAR2(100),
"yahoo" NVARCHAR2(50),
"gmail" NVARCHAR2(50),
"skype" NVARCHAR2(50),
"phone" NVARCHAR2(20),
"sort_order" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Table transaction
--------------------------------------------------------
CREATE TABLE "SYSTEM"."transaction"
( "ID" NUMBER(*,0),
"type" NUMBER(*,0),
"status" NUMBER(*,0),
"user_id" NUMBER(*,0),
"user_name" NVARCHAR2(50),
"user_email" NVARCHAR2(50),
"user_phone" NVARCHAR2(20),
"amount" NUMBER(15,4),
"payment" NVARCHAR2(32),
"payment_info" CLOB,
"message" NVARCHAR2(255),
"security" NVARCHAR2(16),
"created" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM"
LOB ("payment_info") STORE AS BASICFILE (
TABLESPACE "SYSTEM" ENABLE STORAGE IN ROW CHUNK 8192 RETENTION
NOCACHE LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)) ;
--------------------------------------------------------
-- DDL for Table user
--------------------------------------------------------
CREATE TABLE "SYSTEM"."user"
( "ID" NUMBER(*,0),
"name" NVARCHAR2(50),
"email" NVARCHAR2(50),
"phone" NVARCHAR2(15),
"address" NVARCHAR2(128),
"password" NVARCHAR2(40),
"created" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Table video
--------------------------------------------------------
CREATE TABLE "SYSTEM"."video"
( "ID" NUMBER(*,0),
"count_view" NUMBER(*,0),
"name" NVARCHAR2(255),
"images" NVARCHAR2(100),
"intro" NVARCHAR2(200),
"link" NVARCHAR2(200),
"feature" NUMBER(*,0),
"created" NUMBER(*,0),
"view" NUMBER(*,0)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for View AQ$DEF$_AQCALL
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."AQ$DEF$_AQCALL" ("QUEUE", "MSG_ID", "CORR_ID", "MSG_PRIORITY", "MSG_STATE", "DELAY", "DELAY_TIMESTAMP", "EXPIRATION", "ENQ_TIME", "ENQ_TIMESTAMP", "ENQ_USER_ID", "ENQ_TXN_ID", "DEQ_TIME", "DEQ_TIMESTAMP", "DEQ_USER_ID", "DEQ_TXN_ID", "RETRY_COUNT", "EXCEPTION_QUEUE_OWNER", "EXCEPTION_QUEUE", "USER_DATA", "ORIGINAL_QUEUE_NAME", "ORIGINAL_QUEUE_OWNER", "EXPIRATION_REASON") AS
SELECT q_name QUEUE, msgid MSG_ID, corrid CORR_ID, priority MSG_PRIORITY, decode(state, 0, 'READY',
1, 'WAIT',
2, 'PROCESSED',
3, 'EXPIRED',
10, 'BUFFERED_EXPIRED') MSG_STATE, cast(FROM_TZ(delay, '00:00')
at time zone sessiontimezone as date) DELAY, cast(FROM_TZ(delay, '00:00')
at time zone sessiontimezone as timestamp) DELAY_TIMESTAMP, expiration, cast(FROM_TZ(enq_time, '00:00')
at time zone sessiontimezone as date) ENQ_TIME, cast(FROM_TZ(enq_time, '00:00')
at time zone sessiontimezone as timestamp)
ENQ_TIMESTAMP, enq_uid ENQ_USER_ID, enq_tid ENQ_TXN_ID, cast(FROM_TZ(deq_time, '00:00')
at time zone sessiontimezone as date) DEQ_TIME, cast(FROM_TZ(deq_time, '00:00')
at time zone sessiontimezone as timestamp)
DEQ_TIMESTAMP, deq_uid DEQ_USER_ID, deq_tid DEQ_TXN_ID, retry_count, decode (state, 0, exception_qschema,
1, exception_qschema,
2, exception_qschema,
NULL) EXCEPTION_QUEUE_OWNER, decode (state, 0, exception_queue,
1, exception_queue,
2, exception_queue,
NULL) EXCEPTION_QUEUE, user_data, decode (state, 3,
decode (deq_tid, 'INVALID_TRANSACTION', NULL,
exception_queue), NULL)
ORIGINAL_QUEUE_NAME, decode (state, 3,
decode (deq_tid, 'INVALID_TRANSACTION', NULL,
exception_qschema), NULL)
ORIGINAL_QUEUE_OWNER, decode(state, 3,
decode(deq_time, NULL,
decode(deq_tid, NULL,
decode (expiration , NULL , 'MAX_RETRY_EXCEEDED',
'TIME_EXPIRATION'),
'INVALID_TRANSACTION', NULL,
'MAX_RETRY_EXCEEDED'), NULL), NULL)
EXPIRATION_REASON FROM "DEF$_AQCALL" WHERE state != 7 AND state != 9 WITH READ ONLY
;
--------------------------------------------------------
-- DDL for View AQ$DEF$_AQERROR
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."AQ$DEF$_AQERROR" ("QUEUE", "MSG_ID", "CORR_ID", "MSG_PRIORITY", "MSG_STATE", "DELAY", "DELAY_TIMESTAMP", "EXPIRATION", "ENQ_TIME", "ENQ_TIMESTAMP", "ENQ_USER_ID", "ENQ_TXN_ID", "DEQ_TIME", "DEQ_TIMESTAMP", "DEQ_USER_ID", "DEQ_TXN_ID", "RETRY_COUNT", "EXCEPTION_QUEUE_OWNER", "EXCEPTION_QUEUE", "USER_DATA", "ORIGINAL_QUEUE_NAME", "ORIGINAL_QUEUE_OWNER", "EXPIRATION_REASON") AS
SELECT q_name QUEUE, msgid MSG_ID, corrid CORR_ID, priority MSG_PRIORITY, decode(state, 0, 'READY',
1, 'WAIT',
2, 'PROCESSED',
3, 'EXPIRED',
10, 'BUFFERED_EXPIRED') MSG_STATE, cast(FROM_TZ(delay, '00:00')
at time zone sessiontimezone as date) DELAY, cast(FROM_TZ(delay, '00:00')
at time zone sessiontimezone as timestamp) DELAY_TIMESTAMP, expiration, cast(FROM_TZ(enq_time, '00:00')
at time zone sessiontimezone as date) ENQ_TIME, cast(FROM_TZ(enq_time, '00:00')
at time zone sessiontimezone as timestamp)
ENQ_TIMESTAMP, enq_uid ENQ_USER_ID, enq_tid ENQ_TXN_ID, cast(FROM_TZ(deq_time, '00:00')
at time zone sessiontimezone as date) DEQ_TIME, cast(FROM_TZ(deq_time, '00:00')
at time zone sessiontimezone as timestamp)
DEQ_TIMESTAMP, deq_uid DEQ_USER_ID, deq_tid DEQ_TXN_ID, retry_count, decode (state, 0, exception_qschema,
1, exception_qschema,
2, exception_qschema,
NULL) EXCEPTION_QUEUE_OWNER, decode (state, 0, exception_queue,
1, exception_queue,
2, exception_queue,
NULL) EXCEPTION_QUEUE, user_data, decode (state, 3,
decode (deq_tid, 'INVALID_TRANSACTION', NULL,
exception_queue), NULL)
ORIGINAL_QUEUE_NAME, decode (state, 3,
decode (deq_tid, 'INVALID_TRANSACTION', NULL,
exception_qschema), NULL)
ORIGINAL_QUEUE_OWNER, decode(state, 3,
decode(deq_time, NULL,
decode(deq_tid, NULL,
decode (expiration , NULL , 'MAX_RETRY_EXCEEDED',
'TIME_EXPIRATION'),
'INVALID_TRANSACTION', NULL,
'MAX_RETRY_EXCEEDED'), NULL), NULL)
EXPIRATION_REASON FROM "DEF$_AQERROR" WHERE state != 7 AND state != 9 WITH READ ONLY
;
--------------------------------------------------------
-- DDL for View AQ$_DEF$_AQCALL_F
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."AQ$_DEF$_AQCALL_F" ("Q_NAME", "ROW_ID", "MSGID", "CORRID", "PRIORITY", "STATE", "DELAY", "EXPIRATION", "ENQ_TIME", "ENQ_UID", "ENQ_TID", "DEQ_TIME", "DEQ_UID", "DEQ_TID", "RETRY_COUNT", "EXCEPTION_QSCHEMA", "EXCEPTION_QUEUE", "CSCN", "DSCN", "CHAIN_NO", "LOCAL_ORDER_NO", "TIME_MANAGER_INFO", "STEP_NO", "USER_DATA", "QUEUE_ID") AS
SELECT /*+ NO_MERGE (qo) USE_NL(qt) */ qt.q_name Q_NAME, qt.rowid ROW_ID, qt.msgid MSGID, qt.corrid CORRID, qt.priority PRIORITY, qt.state STATE, cast(FROM_TZ(qt.delay, '00:00') at time zone sessiontimezone as timestamp) DELAY, qt.expiration EXPIRATION, cast(FROM_TZ(qt.enq_time, '00:00') at time zone sessiontimezone as timestamp) ENQ_TIME, qt.enq_uid ENQ_UID, qt.enq_tid ENQ_TID, cast(FROM_TZ(qt.deq_time, '00:00') at time zone sessiontimezone as timestamp) DEQ_TIME, qt.deq_uid DEQ_UID, qt.deq_tid DEQ_TID, qt.retry_count RETRY_COUNT, qt.exception_qschema EXCEPTION_QSCHEMA, qt.exception_queue EXCEPTION_QUEUE, qt.cscn CSCN, qt.dscn DSCN, qt.chain_no CHAIN_NO, qt.local_order_no LOCAL_ORDER_NO, cast(FROM_TZ(qt.time_manager_info, '00:00') at time zone sessiontimezone as timestamp) TIME_MANAGER_INFO, qt.step_no STEP_NO, qt.user_data USER_DATA , qo.qid QUEUE_ID FROM "DEF$_AQCALL" qt, SYS.ALL_INT_DEQUEUE_QUEUES qo WHERE qt.q_name = qo.name AND qo.owner = 'SYSTEM' WITH READ ONLY
;
--------------------------------------------------------
-- DDL for View AQ$_DEF$_AQERROR_F
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."AQ$_DEF$_AQERROR_F" ("Q_NAME", "ROW_ID", "MSGID", "CORRID", "PRIORITY", "STATE", "DELAY", "EXPIRATION", "ENQ_TIME", "ENQ_UID", "ENQ_TID", "DEQ_TIME", "DEQ_UID", "DEQ_TID", "RETRY_COUNT", "EXCEPTION_QSCHEMA", "EXCEPTION_QUEUE", "CSCN", "DSCN", "CHAIN_NO", "LOCAL_ORDER_NO", "TIME_MANAGER_INFO", "STEP_NO", "USER_DATA", "QUEUE_ID") AS
SELECT /*+ NO_MERGE (qo) USE_NL(qt) */ qt.q_name Q_NAME, qt.rowid ROW_ID, qt.msgid MSGID, qt.corrid CORRID, qt.priority PRIORITY, qt.state STATE, cast(FROM_TZ(qt.delay, '00:00') at time zone sessiontimezone as timestamp) DELAY, qt.expiration EXPIRATION, cast(FROM_TZ(qt.enq_time, '00:00') at time zone sessiontimezone as timestamp) ENQ_TIME, qt.enq_uid ENQ_UID, qt.enq_tid ENQ_TID, cast(FROM_TZ(qt.deq_time, '00:00') at time zone sessiontimezone as timestamp) DEQ_TIME, qt.deq_uid DEQ_UID, qt.deq_tid DEQ_TID, qt.retry_count RETRY_COUNT, qt.exception_qschema EXCEPTION_QSCHEMA, qt.exception_queue EXCEPTION_QUEUE, qt.cscn CSCN, qt.dscn DSCN, qt.chain_no CHAIN_NO, qt.local_order_no LOCAL_ORDER_NO, cast(FROM_TZ(qt.time_manager_info, '00:00') at time zone sessiontimezone as timestamp) TIME_MANAGER_INFO, qt.step_no STEP_NO, qt.user_data USER_DATA , qo.qid QUEUE_ID FROM "DEF$_AQERROR" qt, SYS.ALL_INT_DEQUEUE_QUEUES qo WHERE qt.q_name = qo.name AND qo.owner = 'SYSTEM' WITH READ ONLY
;
--------------------------------------------------------
-- DDL for View MVIEW_EVALUATIONS
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."MVIEW_EVALUATIONS" ("RUNID", "MVIEW_OWNER", "MVIEW_NAME", "RANK", "STORAGE_IN_BYTES", "FREQUENCY", "CUMULATIVE_BENEFIT", "BENEFIT_TO_COST_RATIO") AS
select
t1.runid# as runid,
summary_owner AS mview_owner,
summary_name AS mview_name,
rank# as rank,
storage_in_bytes,
frequency,
cumulative_benefit,
benefit_to_cost_ratio
from SYSTEM.MVIEW$_ADV_OUTPUT t1, SYSTEM.MVIEW$_ADV_LOG t2, ALL_USERS u
where
t1.runid# = t2.runid# and
u.username = t2.uname and
u.user_id = userenv('SCHEMAID') and
t1.output_type = 1
order by t1.rank#;
COMMENT ON TABLE "SYSTEM"."MVIEW_EVALUATIONS" IS 'This view gives DBA access to summary evaluation output'
;
--------------------------------------------------------
-- DDL for View MVIEW_EXCEPTIONS
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."MVIEW_EXCEPTIONS" ("RUNID", "OWNER", "TABLE_NAME", "DIMENSION_NAME", "RELATIONSHIP", "BAD_ROWID") AS
select
t1.runid# as runid,
owner,
table_name,
dimension_name,
relationship,
bad_rowid
from SYSTEM.MVIEW$_ADV_EXCEPTIONS t1, SYSTEM.MVIEW$_ADV_LOG t2, ALL_USERS u
where
t1.runid# = t2.runid# and
u.username = t2.uname and
u.user_id = userenv('SCHEMAID');
COMMENT ON TABLE "SYSTEM"."MVIEW_EXCEPTIONS" IS 'This view gives DBA access to dimension validation results'
;
--------------------------------------------------------
-- DDL for View MVIEW_FILTER
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."MVIEW_FILTER" ("FILTERID", "SUBFILTERNUM", "SUBFILTERTYPE", "STR_VALUE", "NUM_VALUE1", "NUM_VALUE2", "DATE_VALUE1", "DATE_VALUE2") AS
select
a.filterid# as filterid,
a.subfilternum# as subfilternum,
decode(a.subfiltertype,1,'APPLICATION',2,'CARDINALITY',3,'LASTUSE',
4,'FREQUENCY',5,'USER',6,'PRIORITY',7,'BASETABLE',
8,'RESPONSETIME',9,'COLLECTIONID',10,'TRACENAME',
11,'SCHEMA','UNKNOWN') AS subfiltertype,
a.str_value,
to_number(decode(a.num_value1,-999,NULL,a.num_value1)) AS num_value1,
to_number(decode(a.num_value2,-999,NULL,a.num_value2)) AS num_value2,
a.date_value1,
a.date_value2
from system.mview$_adv_filter a, system.mview$_adv_log b, ALL_USERS u
WHERE a.filterid# = b.runid#
AND b.uname = u.username
AND u.user_id = userenv('SCHEMAID');
COMMENT ON TABLE "SYSTEM"."MVIEW_FILTER" IS 'Workload filter records'
;
--------------------------------------------------------
-- DDL for View MVIEW_FILTERINSTANCE
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."MVIEW_FILTERINSTANCE" ("RUNID", "FILTERID", "SUBFILTERNUM", "SUBFILTERTYPE", "STR_VALUE", "NUM_VALUE1", "NUM_VALUE2", "DATE_VALUE1", "DATE_VALUE2") AS
select
a.runid# as runid,
a.filterid# as filterid,
a.subfilternum# as subfilternum,
decode(a.subfiltertype,1,'APPLICATION',2,'CARDINALITY',3,'LASTUSE',
4,'FREQUENCY',5,'USER',6,'PRIORITY',7,'BASETABLE',
8,'RESPONSETIME',9,'COLLECTIONID',10,'TRACENAME',
11,'SCHEMA','UNKNOWN') AS subfiltertype,
a.str_value,
to_number(decode(a.num_value1,-999,NULL,a.num_value1)) AS num_value1,
to_number(decode(a.num_value2,-999,NULL,a.num_value2)) AS num_value2,
a.date_value1,
a.date_value2
from system.mview$_adv_filterinstance a;
COMMENT ON TABLE "SYSTEM"."MVIEW_FILTERINSTANCE" IS 'Workload filter instance records'
;
--------------------------------------------------------
-- DDL for View MVIEW_LOG
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."MVIEW_LOG" ("ID", "FILTERID", "RUN_BEGIN", "RUN_END", "TYPE", "STATUS", "MESSAGE", "COMPLETED", "TOTAL", "ERROR_CODE") AS
select
m.runid# as id,
m.filterid# as filterid,
m.run_begin,
m.run_end,
decode(m.run_type,1,'EVALUATE',2,'EVALUATE_W',3,'RECOMMEND',
4,'RECOMMEND_W',5,'VALIDATE',6,'WORKLOAD',
7,'FILTER','UNKNOWN') AS type,
decode(m.status,0,'UNUSED',1,'CANCELLED',2,'IN_PROGRESS',3,'COMPLETED',
4,'ERROR','UNKNOWN') AS status,
m.message,
m.completed,
m.total,
m.error_code
from system.mview$_adv_log m, all_users u
where m.uname = u.username
and u.user_id = userenv('SCHEMAID');
COMMENT ON TABLE "SYSTEM"."MVIEW_LOG" IS 'Advisor session log'
;
--------------------------------------------------------
-- DDL for View MVIEW_RECOMMENDATIONS
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."MVIEW_RECOMMENDATIONS" ("RUNID", "ALL_TABLES", "FACT_TABLES", "GROUPING_LEVELS", "QUERY_TEXT", "RECOMMENDATION_NUMBER", "RECOMMENDED_ACTION", "MVIEW_OWNER", "MVIEW_NAME", "STORAGE_IN_BYTES", "PCT_PERFORMANCE_GAIN", "BENEFIT_TO_COST_RATIO") AS
select
t1.runid# as runid,
t1.from_clause as all_tables,
fact_tables,
grouping_levels,
query_text,
rank# as recommendation_number,
action_type as recommended_action,
summary_owner as mview_owner,
summary_name as mview_name,
storage_in_bytes,
pct_performance_gain,
benefit_to_cost_ratio
from SYSTEM.MVIEW$_ADV_OUTPUT t1, SYSTEM.MVIEW$_ADV_LOG t2, ALL_USERS u
where
t1.runid# = t2.runid# and
u.username = t2.uname and
u.user_id = userenv('SCHEMAID') and
t1.output_type = 0
order by t1.rank#;
COMMENT ON TABLE "SYSTEM"."MVIEW_RECOMMENDATIONS" IS 'This view gives DBA access to summary recommendations'
;
--------------------------------------------------------
-- DDL for View MVIEW_WORKLOAD
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."MVIEW_WORKLOAD" ("WORKLOADID", "IMPORT_TIME", "QUERYID", "APPLICATION", "CARDINALITY", "RESULTSIZE", "LASTUSE", "FREQUENCY", "OWNER", "PRIORITY", "QUERY", "RESPONSETIME") AS
select
a.collectionid# as workloadid,
a.collecttime as import_time,
a.queryid# as queryid,
a.application,
a.cardinality,
a.resultsize,
a.qdate as lastuse,
a.frequency,
a.uname as owner,
a.priority,
a.sql_text as query,
a.exec_time as responsetime
from SYSTEM.MVIEW$_ADV_WORKLOAD A, SYSTEM.MVIEW$_ADV_LOG B, ALL_USERS D
WHERE a.collectionid# = b.runid#
AND b.uname = d.username
AND d.user_id = userenv('SCHEMAID');
COMMENT ON TABLE "SYSTEM"."MVIEW_WORKLOAD" IS 'This view gives DBA access to shared workload'
;
--------------------------------------------------------
-- DDL for View PRODUCT_PRIVS
--------------------------------------------------------
CREATE OR REPLACE FORCE VIEW "SYSTEM"."PRODUCT_PRIVS" ("PRODUCT", "USERID", "ATTRIBUTE", "SCOPE", "NUMERIC_VALUE", "CHAR_VALUE", "DATE_VALUE", "LONG_VALUE") AS
SELECT PRODUCT, USERID, ATTRIBUTE, SCOPE,
NUMERIC_VALUE, CHAR_VALUE, DATE_VALUE, LONG_VALUE
FROM SQLPLUS_PRODUCT_PROFILE
WHERE USERID = 'PUBLIC' OR USER LIKE USERID
;
REM INSERTING into SYSTEM."admin"
SET DEFINE OFF;
Insert into SYSTEM."admin" (ID,"username","password","name",ADMIN_GROUP_ID) values (1,'PHUNG','123','ADMIN',1);
Insert into SYSTEM."admin" (ID,"username","password","name",ADMIN_GROUP_ID) values (2,'DUNG','1234','Mod',2);
REM INSERTING into SYSTEM."admin_group"
SET DEFINE OFF;
Insert into SYSTEM."admin_group" (ID,"name","sort_order") values (2,'Mod',2);
Insert into SYSTEM."admin_group" (ID,"name","sort_order") values (1,'Admin',1);
REM INSERTING into SYSTEM."catalog"
SET DEFINE OFF;
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (1,'Laptop',null,null,null,0,0);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (2,'i?n tho?i',null,null,null,0,1);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (3,'Tivi',null,null,null,0,2);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (4,' Acer',null,null,null,1,0);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (5,' Apple',null,null,null,1,1);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (6,'Asus',null,null,null,1,2);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (7,'Dell',null,null,null,1,3);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (8,'HP',null,null,null,1,5);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (9,'Apple',null,null,null,2,0);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (10,'Asus',null,null,null,2,1);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (11,'BlackBerry',null,null,null,2,3);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (12,'HTC',null,null,null,2,4);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (13,'AKAI',null,null,null,3,0);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (14,'JVC',null,null,null,3,1);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (15,'LG',null,null,null,3,2);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (16,'Panasonic',null,null,null,3,3);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (17,'Samsung',null,null,null,3,5);
Insert into SYSTEM."catalog" (ID,"name","site_title","meta_desc","meta_key","parent_id","sort_order") values (18,'Toshiba',null,null,null,3,6);
REM INSERTING into SYSTEM."comment"
SET DEFINE OFF;
Insert into SYSTEM."comment" (ID,ID_PRODUCT,"parent_id","user_name","user_email",ID_USERS,"user_ip","created","count_like","status") values (1,7,0,'Tan Phung','tanphung@gmail.com',16,null,1408798677,10,1);
Insert into SYSTEM."comment" (ID,ID_PRODUCT,"parent_id","user_name","user_email",ID_USERS,"user_ip","created","count_like","status") values (2,7,1,'Nhat Minh','nhatminh@gmail.com',16,null,1408799662,3,1);
Insert into SYSTEM."comment" (ID,ID_PRODUCT,"parent_id","user_name","user_email",ID_USERS,"user_ip","created","count_like","status") values (3,7,0,'Trung Tri','trungtri@gmail.com',16,null,1408800324,8,1);
REM INSERTING into SYSTEM."contact"
SET DEFINE OFF;
REM INSERTING into SYSTEM."content_static"
SET DEFINE OFF;
Insert into SYSTEM."content_static" (ID,"key") values (3,'footer');
Insert into SYSTEM."content_static" (ID,"key") values (18,'shipping');
REM INSERTING into SYSTEM."info"
SET DEFINE OFF;
Insert into SYSTEM."info" (ID,"title","meta_desc","meta_key","created") values (1,'Gi?i thi?u',null,null,1409044792);
Insert into SYSTEM."info" (ID,"title","meta_desc","meta_key","created") values (2,'Hu?ng d?n mua hng',null,null,1409044950);
REM INSERTING into SYSTEM."maker"
SET DEFINE OFF;
Insert into SYSTEM."maker" (ID,"name","meta_desc","meta_key","site_title","sort_order") values (0,'miyu',null,null,null,1);
REM INSERTING into SYSTEM."menu"
SET DEFINE OFF;
REM INSERTING into SYSTEM."new"
SET DEFINE OFF;
Insert into SYSTEM."new" (ID,"title","intro","meta_desc","meta_key","image_link","created","count_view") values (1,'Nh l?u siu xe hng m ? s?ng, ?? ch?i bi?n ??o ht khch','(Dn tr) - Lo?t ?? ch?i trung thu bi?n ??o h??ng v? qu h??ng m?i xu?t hi?n nh?ng ? ht khch, cc m?t hng vng m xa x? khng cn ???c nhi?u ng??i mua s?m.',null,null,'n1-242e1.jpg',1407553602,1);
Insert into SYSTEM."new" (ID,"title","intro","meta_desc","meta_key","image_link","created","count_view") values (2,'Arsenal ??ng bn Vermaelen cho Barcelona','(Dn tr) - Theo nh?ng thng tin t? bo gi?i Anh, Arsenal ? quy?t ??nh t? ch?i MU, ?? bn trung v? Vermarlen cho Barcelona. M?c gi c?a trung v? ny vo kho?ng 15 tri?u b?ng.',null,null,'Vermaelen-d4361.jpg',1407553674,2);
Insert into SYSTEM."new" (ID,"title","intro","meta_desc","meta_key","image_link","created","count_view") values (3,'H N?i: CSGT tm ng??i thn gip chu b 8 tu?i ?i l?c','(Dn tr) - Theo ng??i thn chu Chi, trong lc gia ?nh ngh? tr?a, chu Chi m?i ch?i ? ?i l?c t? pha ph??ng Ng?c Lm (qu?n Long Bin) sang n?i thnh. Trong lc ?ang hoang mang tm chu, gia ?nh nh?n ???c tin bo c?a l?c l??ng c?nh st giao thng.',null,null,'455-549e4.jpg',1407553969,9);
Insert into SYSTEM."new" (ID,"title","intro","meta_desc","meta_key","image_link","created","count_view") values (4,'M? t?ng c??ng khng kch Iraq','(Dn tr) - Sau khi T?ng th?ng Obama ph chu?n cho khng kch cc m?c tiu c?a nhm phi?n qun H?i gio IS ? mi?n b?c Iraq, L?u N?m Gc ? ti?n hnh 3 ??t khng kch.',null,null,'1-7d48c.jpg',1407554007,0);
REM INSERTING into SYSTEM."order"
SET DEFINE OFF;
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (7,6,2,1,4000000,1);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (8,7,2,1,4000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (9,8,8,1,10000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (10,9,8,1,10000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (11,10,8,1,10000000,2);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (12,11,8,1,10000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (13,12,8,2,20000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (14,13,8,1,10000000,1);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (15,14,3,1,5000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (16,15,3,1,5000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (17,16,3,1,5000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (18,17,3,1,5000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (19,18,3,1,5000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (20,19,3,1,5000000,0);
Insert into SYSTEM."order" (ID,ID_ORDER,"product_id","qty","amount","status") values (21,20,8,1,10000000,0);
REM INSERTING into SYSTEM."product"
SET DEFINE OFF;
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (2,15,'Tivi LG 4000',0,4000000,200000,'product2.jpg',0,4,null,null,'12 thng',0,0,4,1,'USB 4G','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (3,13,'Tivi Akai',0,5000000,0,'product1.jpg',0,8,null,null,'12 thng',0,0,4,1,'USB 4G','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (4,16,'Tivi Panasonic',0,6000000,0,'product3.jpg',0,4,null,null,'12 thng',0,0,12,3,'USB 4G','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (5,17,'Tivi Samsung',0,5500000,0,'product4.jpg',0,1,null,null,'12 thng',0,0,0,0,'USB 4G','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (6,15,'Tivi LG 5000',0,5000000,0,'product5.jpg',0,1,null,null,'12 thng',0,0,0,0,'USB 4G','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (7,18,'Tivi Toshiba',0,6200000,400000,'product6.jpg',0,74,null,null,'12 thng',0,0,7,2,'USB 4G','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (8,14,'Tivi JVC 500',0,10000000,500000,'product7.jpg',0,112,null,null,'12 thng',0,0,17,5,'USB 4G','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
Insert into SYSTEM."product" (ID,ID_CATALOG,"name",ID_MAKER,"price","discount","image_link","created","view","meta_key","site_title","warranty","total","buyed","rate_total","rate_count","gifts","video","meta_desc") values (9,15,'Tivi LG 520',0,5400000,0,'product13.jpg',0,19,null,null,'12 thng',0,0,4,1,'0','https://www.youtube.com/watch?v=zAEYQ6FDO5U',null);
REM INSERTING into SYSTEM."slide"
SET DEFINE OFF;
Insert into SYSTEM."slide" (ID,"name","image_name","image_link","link","info","sort_order") values (1,'Slide 1',null,'11.jpg','http://dantri.com.vn/','0',1);
Insert into SYSTEM."slide" (ID,"name","image_name","image_link","link","info","sort_order") values (2,'Slide 2',null,'21.jpg','http://dantri.com.vn/',null,2);
Insert into SYSTEM."slide" (ID,"name","image_name","image_link","link","info","sort_order") values (3,'Slide 3',null,'31.jpg','http://dantri.com.vn/',null,3);
REM INSERTING into SYSTEM."support"
SET DEFINE OFF;
Insert into SYSTEM."support" (ID,"name","yahoo","gmail","skype","phone","sort_order") values (1,'tua','tuacntt','tua@gmail.com','tuacntt','01686039488',1);
REM INSERTING into SYSTEM."transaction"
SET DEFINE OFF;
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (7,0,1,15,'tua','tua@gmail.com','01686039488',4000000,'nganluong',null,null,1405548000);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (8,0,0,15,'tua','tua@gmail.com','01686039488',4000000,'nganluong',null,null,1407917785);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (9,0,0,0,'tua','tuat@gmail.com','01686039488',10000000,'nganluong','111',null,1407918071);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (10,0,0,0,'tua','tua@gmail.com','01686039488',10000000,'nganluong','111111',null,1407918235);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (11,0,2,0,'tua','tua@gmail.com','111111',10000000,'nganluong','111',null,1407918299);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (12,0,1,0,'tua','tua@gmail.com','7667676',10000000,'nganluong',null,null,1407923211);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (13,0,1,0,'tua','tua@gmail.com','11',20000000,'nganluong','11',null,1407926712);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (14,0,1,0,'tua','tua@gmail.com','01686039488',10000000,'nganluong',null,null,1407981011);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (15,0,0,19,'tua','tua@gmail.com','01686039488',5000000,'baokim',null,null,1408099561);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (16,0,0,19,'tua','tua@gmail.com','01686039488',5000000,'baokim',null,null,1408099692);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (17,0,0,19,'tua','tua@gmail.com','01686039488',5000000,'baokim',null,null,1408099749);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (18,0,0,19,'tua','tua@gmail.com','01686039488',5000000,'baokim',null,null,1408099776);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (19,0,0,19,'tua','tua@gmail.com','01686039488',5000000,'baokim',null,null,1408099813);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (20,0,0,19,'tua','tua@gmail.com','01686039488',5000000,'baokim',null,null,1408099856);
Insert into SYSTEM."transaction" (ID,"type","status","user_id","user_name","user_email","user_phone","amount","payment","message","security","created") values (21,0,0,0,'tua','tua@gmail.com','01686039488',10000000,'dathang',null,null,1408159002);
REM INSERTING into SYSTEM."user"
SET DEFINE OFF;
Insert into SYSTEM."user" (ID,"name","email","phone","address","password","created") values (16,'dung','dung@yahoo.com','0921827210','111111','96e79218965eb72c92a549dd5a330112',1405589118);
Insert into SYSTEM."user" (ID,"name","email","phone","address","password","created") values (19,'phung','phung@gmail.com','01686039488','111','96e79218965eb72c92a549dd5a330112',0);
REM INSERTING into SYSTEM."video"
SET DEFINE OFF;
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (10,0,'Chuy?n Tnh Trn Facebook - H? Vi?t Trung [Official]','1386147113843_video.jpg',null,'http://www.youtube.com/watch?v=3ZlLyU2L4P0',1386146497,2013,4);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (8,0,'Ch? cn trong m? ?i khng em','1386147092891_video.jpg',null,'http://www.youtube.com/watch?v=RfNJ43HBzOM',1386146505,2013,6);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (7,0,'[HD] Anh Xin L?i - Minh V??ng M4U','1386147058495_video.jpg',null,'http://www.youtube.com/watch?v=OCZ4D9qT8lI',1386146502,2013,17);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (16,0,'Nh?t Em Vo Tim - H? Vi?t Trung [Official]','1386147135763_video.jpg',null,'http://www.youtube.com/watch?v=fkDSnN_I_Ig',0,1386147135,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (17,0,'Ch? Yu Mnh Em - Chu Kh?i Phong [Official]','1386147154302_video.jpg',null,'http://www.youtube.com/watch?v=l2MydtlKra8',0,1386147154,4);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (18,0,'S? Ngho - Chu Kh?i Phong [Official]','138614718279_video.jpg',null,'http://www.youtube.com/watch?v=LJRvv8U6Dos',1386147576,1386147182,1);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (19,0,'Tr Ch?i ??ng Cay - Chu Kh?i Phong [Official]','138614721063_video.jpg',null,'http://www.youtube.com/watch?v=3J8d8-YgOlU',1386147575,1386147210,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (20,0,'S?u Tm Thi?p H?ng - Quang L ? Quyn ( Liveshow Quang L )','1386147271236_video.jpg',null,'http://www.youtube.com/watch?v=Kd5OrV4Y_bs',0,1386147271,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (21,0,'G c?a tri tim Quang L - Mai Thin Vn','1386147292776_video.jpg',null,'http://www.youtube.com/watch?v=9oVxDQsgXIQ',1386147577,1386147292,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (22,0,'C Hng Xm - Quang L','1386147310490_video.jpg',null,'http://www.youtube.com/watch?v=nA9ub4zlel8',0,1386147310,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (23,0,'Lam Truong - Mai Mai','1386147353743_video.jpg',null,'http://www.youtube.com/watch?v=o1igATj9lMw',0,1386147353,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (24,0,'L? Yu Em R?i - B?ng Ki?u','1386147364632_video.jpg',null,'http://www.youtube.com/watch?v=HYi-5dM_c34',0,1386147364,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (25,0,'Ba?n Ti?nh Cu?i - B??ng Ki?u','1386147389790_video.jpg',null,'http://www.youtube.com/watch?v=pNr7jEQ8LT8',0,1386147389,2);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (26,1,'Pht cu?i - B?ng Ki?u','1386150063515_video.jpg',null,'http://www.youtube.com/watch?v=sA_gM6_eqXU',0,1386150063,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (27,0,'Gi?c M? (Live) - Bi Anh Tu?n ft Yanbi','1386150103768_video.jpg',null,'http://www.youtube.com/watch?v=XLr463dUNgQ',0,1386150103,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (28,4,'Anh Nh? Em - Tu?n H?ng','1386150121482_video.jpg',null,'http://www.youtube.com/watch?v=ewNQtt1RiSk',0,1386150121,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (29,0,'LE QUYEN HUNG - Nhu Giac Chiem Bao','1386150141608_video.jpg',null,'http://www.youtube.com/watch?v=DaMARvh0kms',0,1386150141,0);
Insert into SYSTEM."video" (ID,"count_view","name","images","intro","link","feature","created","view") values (30,10,'D? Vng Cu?c Tnh - Duy M?nh ft Tu?n H?ng','140905101897_video.jpg',null,'http://www.youtube.com/watch?v=g8I-LoBIFgQ',0,1409051018,0);
--------------------------------------------------------
-- DDL for Index SYS_C007152
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007152" ON "SYSTEM"."admin" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007151
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007151" ON "SYSTEM"."admin_group" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007154
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007154" ON "SYSTEM"."catalog" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007171
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007171" ON "SYSTEM"."comment" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007155
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007155" ON "SYSTEM"."contact" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007156
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007156" ON "SYSTEM"."content_static" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007157
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007157" ON "SYSTEM"."info" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007158
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007158" ON "SYSTEM"."maker" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007159
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007159" ON "SYSTEM"."menu" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007160
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007160" ON "SYSTEM"."new" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007165
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007165" ON "SYSTEM"."order" ("ID_ORDER")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007162
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007162" ON "SYSTEM"."product" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007167
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007167" ON "SYSTEM"."slide" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007168
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007168" ON "SYSTEM"."support" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007161
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007161" ON "SYSTEM"."transaction" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007169
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007169" ON "SYSTEM"."user" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Index SYS_C007170
--------------------------------------------------------
CREATE UNIQUE INDEX "SYSTEM"."SYS_C007170" ON "SYSTEM"."video" ("ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ;
--------------------------------------------------------
-- DDL for Procedure ORA$_SYS_REP_AUTH
--------------------------------------------------------
set define off;
CREATE OR REPLACE PROCEDURE "SYSTEM"."ORA$_SYS_REP_AUTH" as
begin
EXECUTE IMMEDIATE 'GRANT SELECT ON SYSTEM.repcat$_repschema TO SYS ' ||
'WITH GRANT OPTION';
EXECUTE IMMEDIATE 'GRANT SELECT ON SYSTEM.repcat$_repprop TO SYS ' ||
'WITH GRANT OPTION';
EXECUTE IMMEDIATE 'GRANT SELECT ON SYSTEM.def$_aqcall TO SYS ' ||
'WITH GRANT OPTION';
EXECUTE IMMEDIATE 'GRANT SELECT ON SYSTEM.def$_calldest TO SYS ' ||
'WITH GRANT OPTION';
EXECUTE IMMEDIATE 'GRANT SELECT ON SYSTEM.def$_error TO SYS ' ||
'WITH GRANT OPTION';
EXECUTE IMMEDIATE 'GRANT SELECT ON SYSTEM.def$_destination TO SYS ' ||
'WITH GRANT OPTION';
end;
/
--------------------------------------------------------
-- DDL for Package DBMS_REPCAT_AUTH
--------------------------------------------------------
CREATE OR REPLACE PACKAGE "SYSTEM"."DBMS_REPCAT_AUTH" wrapped
a000000
1
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
9
bf d6
0cfc6e4Sm6mfaMYwsbW2JygBepcwg/BKmJ4VZy/pO06UXsVUMejsissTcGWYR4qeK4TPqfDK
q7UPH+SmKP6nW9zmxMZnuK1VDzM0Iv9O4E4SvvsnHWn+EPF9hR+oBFe3fEro6RQ5R5Ejd1nr
e+fAK010dExf76gg/c6ZB3YxGPHDOqkGI4lV6HNsd57gKLwTd0bxan5UwJriIpt7Vjc=
/
--------------------------------------------------------
-- DDL for Package Body DBMS_REPCAT_AUTH
--------------------------------------------------------
CREATE OR REPLACE PACKAGE BODY "SYSTEM"."DBMS_REPCAT_AUTH" wrapped
a000000
1
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
abcd
b
b9d 39c
PBMGkNCh5NDAdLezCHsLvZaVi/swg5UrNSCDfI4Zvp0VB6GpRld+By6E2nVdlFHT2g2kK9zM
8jSnsuee7mkmJD+W3Mo36HQvUfOe7jH5vP7tu1i0jDykzR0pUhJZUcY6xVrSwNPoNVPcT72N
eHhGwyRBj2+0vKbgTmcZKBMJzETRfOl2YGDDVB3FvKBSixMMqfWSX8uh3wPGOi8W9vOASC3z
0UvPqL7KR78SykUEoBCxpMGmE8pgElC/dagmVpIIt7QA6sneMlNb2OO/1zTN44ACRsm+2JAo
zD41TcuGaNUqDYNDRbPEKzeRZeXxrx1UvOWsYTNaO6icaV/NrtZbmXpDuGA/sqnz4jnKFK8S
0VC+Yjh2iJEV5edD2+8pyMgx44NVDiAQ+sjjDkpGc0IxXrm/v52yduhnj/xnkualIm/RyAv0
Q/YzRAHy7NvyavbajIvCFoZWpbO3Jw8NwkoU25ysfgvXZJrw4vPjh4hHR4Mpto6jFMM+dZPW
3N9HL971bTBgyAL0BjASEFXe83D+IoBYX0VQVk5+t7p7iUsmfyK5t+cECNpNOL6UaACcsAYB
Le+yLOAqFHSvCXlWcECxG7wXjAA2/XmBwvKBNLcggXKVp3i9cNzab0Mq9qSAcIYgRFxRdAOe
sTDZNOx6HkJTbCRKCMiJzgjQQW476DlOZD+9Gwh+AA/Y3PIDOfyhlvXT6HsjW33mASJUuORB
la5Jb3rB4syO6QO2a5vSHu26Gwib2EflS8bqC1hZhpHsvM+mAaWJ2x72JyrPe8V7Ohjbre49
gRsjAtspIYfP5958sSnHdkz32nGAXnrEY95lEHGwkuXLlj9y6I21aAyd3/lJkuEAEBxzZVnm
IaNJBwl8u33+SqGLZzILy1QxmA+pF8yUaQ+yRU/5+3n1mY4=
/
--------------------------------------------------------
-- DDL for Synonymn CATALOG
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."CATALOG" FOR "SYS"."CATALOG";
--------------------------------------------------------
-- DDL for Synonymn COL
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."COL" FOR "SYS"."COL";
--------------------------------------------------------
-- DDL for Synonymn PRODUCT_USER_PROFILE
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."PRODUCT_USER_PROFILE" FOR "SYSTEM"."SQLPLUS_PRODUCT_PROFILE";
--------------------------------------------------------
-- DDL for Synonymn PUBLICSYN
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."PUBLICSYN" FOR "SYS"."PUBLICSYN";
--------------------------------------------------------
-- DDL for Synonymn SYSCATALOG
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."SYSCATALOG" FOR "SYS"."SYSCATALOG";
--------------------------------------------------------
-- DDL for Synonymn SYSFILES
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."SYSFILES" FOR "SYS"."SYSFILES";
--------------------------------------------------------
-- DDL for Synonymn TAB
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."TAB" FOR "SYS"."TAB";
--------------------------------------------------------
-- DDL for Synonymn TABQUOTAS
--------------------------------------------------------
CREATE OR REPLACE SYNONYM "SYSTEM"."TABQUOTAS" FOR "SYS"."TABQUOTAS";
--------------------------------------------------------
-- DDL for Queue DEF$_AQERROR
--------------------------------------------------------
BEGIN DBMS_AQADM.CREATE_QUEUE(
Queue_name => 'SYSTEM.DEF$_AQERROR',
Queue_table => 'SYSTEM.DEF$_AQERROR',
Queue_type => 0,
Max_retries => 5,
Retry_delay => 0,
dependency_tracking => TRUE,
comment => 'Error Queue for Deferred RPCs');
END;
/
--------------------------------------------------------
-- DDL for Queue DEF$_AQCALL
--------------------------------------------------------
BEGIN DBMS_AQADM.CREATE_QUEUE(
Queue_name => 'SYSTEM.DEF$_AQCALL',
Queue_table => 'SYSTEM.DEF$_AQCALL',
Queue_type => 0,
Max_retries => 5,
Retry_delay => 0,
dependency_tracking => TRUE,
comment => 'Deferred RPC Queue');
END;
/
--------------------------------------------------------
-- DDL for Queue Table DEF$_AQCALL
--------------------------------------------------------
BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE(
Queue_table => '"SYSTEM"."DEF$_AQCALL"',
Queue_payload_type => 'VARIANT',
storage_clause => 'PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 TABLESPACE SYSTEM',
Sort_list => 'ENQ_TIME',
Compatible => '8.0.3');
END;
/
--------------------------------------------------------
-- DDL for Queue Table DEF$_AQERROR
--------------------------------------------------------
BEGIN DBMS_AQADM.CREATE_QUEUE_TABLE(
Queue_table => '"SYSTEM"."DEF$_AQERROR"',
Queue_payload_type => 'VARIANT',
storage_clause => 'PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 TABLESPACE SYSTEM',
Sort_list => 'ENQ_TIME',
Compatible => '8.0.3');
END;
/
--------------------------------------------------------
-- Constraints for Table admin
--------------------------------------------------------
ALTER TABLE "SYSTEM"."admin" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table admin_group
--------------------------------------------------------
ALTER TABLE "SYSTEM"."admin_group" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table catalog
--------------------------------------------------------
ALTER TABLE "SYSTEM"."catalog" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table comment
--------------------------------------------------------
ALTER TABLE "SYSTEM"."comment" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table contact
--------------------------------------------------------
ALTER TABLE "SYSTEM"."contact" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table content_static
--------------------------------------------------------
ALTER TABLE "SYSTEM"."content_static" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table info
--------------------------------------------------------
ALTER TABLE "SYSTEM"."info" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table maker
--------------------------------------------------------
ALTER TABLE "SYSTEM"."maker" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table menu
--------------------------------------------------------
ALTER TABLE "SYSTEM"."menu" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table new
--------------------------------------------------------
ALTER TABLE "SYSTEM"."new" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table order
--------------------------------------------------------
ALTER TABLE "SYSTEM"."order" ADD PRIMARY KEY ("ID_ORDER")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table product
--------------------------------------------------------
ALTER TABLE "SYSTEM"."product" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table slide
--------------------------------------------------------
ALTER TABLE "SYSTEM"."slide" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table support
--------------------------------------------------------
ALTER TABLE "SYSTEM"."support" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table transaction
--------------------------------------------------------
ALTER TABLE "SYSTEM"."transaction" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table user
--------------------------------------------------------
ALTER TABLE "SYSTEM"."user" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Constraints for Table video
--------------------------------------------------------
ALTER TABLE "SYSTEM"."video" ADD PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "SYSTEM" ENABLE;
--------------------------------------------------------
-- Ref Constraints for Table admin
--------------------------------------------------------
ALTER TABLE "SYSTEM"."admin" ADD FOREIGN KEY ("ADMIN_GROUP_ID")
REFERENCES "SYSTEM"."admin_group" ("ID") ENABLE;
--------------------------------------------------------
-- Ref Constraints for Table comment
--------------------------------------------------------
ALTER TABLE "SYSTEM"."comment" ADD FOREIGN KEY ("ID_PRODUCT")
REFERENCES "SYSTEM"."product" ("ID") ENABLE;
ALTER TABLE "SYSTEM"."comment" ADD FOREIGN KEY ("ID_USERS")
REFERENCES "SYSTEM"."user" ("ID") ENABLE;
--------------------------------------------------------
-- Ref Constraints for Table order
--------------------------------------------------------
ALTER TABLE "SYSTEM"."order" ADD FOREIGN KEY ("ID")
REFERENCES "SYSTEM"."transaction" ("ID") ENABLE;
--------------------------------------------------------
-- Ref Constraints for Table product
--------------------------------------------------------
ALTER TABLE "SYSTEM"."product" ADD FOREIGN KEY ("ID_CATALOG")
REFERENCES "SYSTEM"."catalog" ("ID") ENABLE;
ALTER TABLE "SYSTEM"."product" ADD FOREIGN KEY ("ID_MAKER")
REFERENCES "SYSTEM"."maker" ("ID") ENABLE;
| true |
9f061c2e4b5e75eb70aad180742a3475785c2a0c | SQL | hakula139/IDBS-Spring20-Fudan | /assignments/ass1/submission/18307130252/8.sql | UTF-8 | 225 | 3.5 | 4 | [
"MIT"
] | permissive | select employee.id, name, X.num
from employee left outer join ((select employee_id as id, count(*) as num
from record
group by employee_id) as X )
on employee.id = X.id
where X.num > 1
order by X.num desc;
| true |
a03f7e5b8b8ea0f351ac2220ee9a3da58ea660aa | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/low/day24/select0733.sql | UTF-8 | 178 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-23T07:33:00Z' AND timestamp<'2017-11-24T07:33:00Z' AND temperature>=43 AND temperature<=79
| true |
f45dac104f9b45215c7c4f12d5cd358f2504b205 | SQL | gnsaddy/RVCE | /SecondSemester/DBMS/companyDB1.sql | UTF-8 | 1,947 | 3.796875 | 4 | [] | no_license | # Tables creation
create database companyDB;
use companyDB;
create table Employee (ssn int primary key not null,
ename varchar(20) not null,
sex varchar(5) not null,
dob date not null,
salary int not null,
hire date not null,
superSSn int,
did int);
desc Employee;
create table Department (did int primary key not null,
dname varchar(30) not null,
startdate date not null,
ssn int,
foreign key (ssn) references Employee (ssn) ON UPDATE CASCADE ON DELETE CASCADE);
desc Department;
create table Project (pid int primary key not null,
pname varchar(30) not null,
ploc varchar(30) not null,
did int,
foreign key (did) references Department (did) ON UPDATE CASCADE ON DELETE CASCADE);
desc Project;
create table Dependent (ssn int,
name varchar(30) not null,
rel varchar(30) not null,
dob date not null,
foreign key (ssn) references Employee (ssn) ON UPDATE CASCADE ON DELETE CASCADE);
desc Dependent;
create table WorksIn (ssn int,
pid int,
hours time not null,
foreign key (ssn) references Employee (ssn) ON UPDATE CASCADE ON DELETE CASCADE,
foreign key (pid) references Project (pid) ON UPDATE CASCADE ON DELETE CASCADE);
desc WorksIn;
create table Dept_loc (did int,
dloc varchar(30) not null,
foreign key (did) references Department (did) ON UPDATE CASCADE ON DELETE CASCADE);
desc Dept_loc;
# Alteration in tables
Alter table Employee ADD foreign key (did) references Department (did) ON UPDATE CASCADE ON DELETE CASCADE;
Alter table Employee ADD foreign key (superSSN) references Employee (ssn) ON UPDATE CASCADE ON DELETE CASCADE;
-- # Alteration of columns
-- Alter table Employee change superSSn superSSN int;
-- Alter table Employee change did did int;
-- Alter table Department change ssn ssn int;
-- Alter table Project change did did int;
-- Alter table Dependent change ssn ssn int;
-- Alter table WorksIn change ssn ssn int;
-- Alter table WorksIn change pid pid int;
-- Alter table Dept_loc change did did int;
| true |
fd7b30ed6fd3c54ec928806c0999e2585cdea340 | SQL | matus-cuper/fiit-dbs | /doc/queries/view.sql | UTF-8 | 935 | 4.28125 | 4 | [] | no_license | CREATE MATERIALIZED VIEW main_table_1 AS
SELECT s.student_id, s.name, s.surname, s.birth_at,
COALESCE(gss.avg, 5.00) AS gss_avg,
COALESCE(a.count, 0) AS a_count,
COALESCE(r.count, 0) AS r_count,
COALESCE(g.count, 0) AS g_count_all,
COALESCE(g.count_success, 0) AS g_count_success
FROM students s
LEFT JOIN
(
SELECT gss.student_id, ROUND(AVG(gss.mark), 2) AS avg
FROM graduations_from_ss gss
GROUP BY gss.student_id
) gss ON s.student_id = gss.student_id
LEFT JOIN
(
SELECT a.student_id, COUNT(*)
FROM awards a
GROUP BY a.student_id
) a ON s.student_id = a.student_id
LEFT JOIN
(
SELECT r.student_id, COUNT(*)
FROM registrations r
GROUP BY r.student_id
) r ON s.student_id = r.student_id
LEFT JOIN
(
SELECT g.student_id, COUNT(*),
SUM(CASE WHEN g.graduated = TRUE THEN 1 ELSE 0 END) AS count_success
FROM graduations g
GROUP BY g.student_id
) g ON s.student_id = g.student_id;
| true |
ad00e1e9afb0ed86539cbfd3ed83adde11343232 | SQL | Theadre/Covoiturage | /covoiturage.sql | UTF-8 | 7,011 | 3.359375 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : sam. 19 oct. 2019 à 19:45
-- Version du serveur : 5.7.18-log
-- Version 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 données : `covoiturage`
--
-- --------------------------------------------------------
--
-- Structure de la table `annonce`
--
CREATE TABLE `annonce` (
`id` int(11) NOT NULL,
`idConducteur` int(11) DEFAULT NULL,
`villeA` varchar(50) DEFAULT NULL,
`dateA` date DEFAULT NULL,
`villeD` varchar(50) DEFAULT NULL,
`dateD` date DEFAULT NULL,
`nPlace` int(50) DEFAULT NULL,
`prix` int(50) DEFAULT NULL,
`voiture` int(50) DEFAULT NULL,
`auteur` int(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `annonce`
--
INSERT INTO `annonce` (`id`, `idConducteur`, `villeA`, `dateA`, `villeD`, `dateD`, `nPlace`, `prix`, `voiture`, `auteur`) VALUES
(1, 1, 'gg', '2019-10-19', 'dd', '2019-10-19', 2, 2, 1, 1),
(20, 1, 'ville 2', '2019-10-19', 'ville 1', '2019-10-19', 4, 1000, 20, 1);
-- --------------------------------------------------------
--
-- Structure de la table `commentaireannonce`
--
CREATE TABLE `commentaireannonce` (
`texte` varchar(50) DEFAULT NULL,
`id` int(11) NOT NULL,
`utilisateurAuteur` int(11) DEFAULT NULL,
`datePublication` date DEFAULT NULL,
`annonceAssocie` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `commentaireannonce`
--
INSERT INTO `commentaireannonce` (`texte`, `id`, `utilisateurAuteur`, `datePublication`, `annonceAssocie`) VALUES
('exemple texte', 1, 1, '2019-10-19', 1),
('exemple texte', 2, 1, '2019-10-19', 1),
('exemple texte', 3, 1, '2019-10-19', 1);
-- --------------------------------------------------------
--
-- Structure de la table `commentaireutilisateur`
--
CREATE TABLE `commentaireutilisateur` (
`texte` varchar(50) DEFAULT NULL,
`utilisateurAuteur` int(11) DEFAULT NULL,
`datePublication` date DEFAULT NULL,
`utilisateurAssocie` int(11) DEFAULT NULL,
`id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `commentaireutilisateur`
--
INSERT INTO `commentaireutilisateur` (`texte`, `utilisateurAuteur`, `datePublication`, `utilisateurAssocie`, `id`) VALUES
('exemple texteteste', 1, '2019-10-18', 1, 1),
('exemple texteteste', 1, '2019-10-18', 1, 2),
('reh', 2, '2019-10-18', 2, 3),
('reh', 2, '2019-10-18', 2, 4),
('exemple texte', 1, '2019-10-19', 1, 5),
('exemple texte', 1, '2019-10-19', 1, 6),
('exemple texte sssss', 3, '2019-10-19', 4, 7);
-- --------------------------------------------------------
--
-- Structure de la table `reservation`
--
CREATE TABLE `reservation` (
`date` date DEFAULT NULL,
`idUtilisateur` int(11) DEFAULT NULL,
`idAnnonce` int(11) DEFAULT NULL,
`status` varchar(50) DEFAULT NULL,
`id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `reservation`
--
INSERT INTO `reservation` (`date`, `idUtilisateur`, `idAnnonce`, `status`, `id`) VALUES
('2019-10-19', 1, 1, '', 1),
('2019-10-19', 1, 1, 'active', 2);
-- --------------------------------------------------------
--
-- Structure de la table `user`
--
CREATE TABLE `user` (
`nom` varchar(20) DEFAULT NULL,
`prenom` varchar(20) DEFAULT NULL,
`mail` varchar(20) DEFAULT NULL,
`date` date DEFAULT NULL,
`id` int(11) NOT NULL,
`note` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Déchargement des données de la table `user`
--
INSERT INTO `user` (`nom`, `prenom`, `mail`, `date`, `id`, `note`) VALUES
('dfdf', 'dfdf', 'dfdf', '2019-10-10', 1, 1),
('hthhhh', 'hhhh', 'hhhh', '2019-10-17', 2, 3),
('Monsieur', 'Sow', 'sow@unilim', '2019-10-18', 3, 250),
('Monsieur', 'Sow', 'sow@unilim', '2019-10-18', 4, 250),
('qxqx', 'qxqx', 'qxqx', '2019-10-19', 5, 22),
('f', 'f', 'f', '2019-10-19', 6, 2);
-- --------------------------------------------------------
--
-- Structure de la table `voiture`
--
CREATE TABLE `voiture` (
`id` int(10) UNSIGNED NOT NULL,
`marque` varchar(40) DEFAULT NULL,
`model` varchar(50) DEFAULT NULL,
`couleur` varchar(20) DEFAULT NULL,
`nPlace` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Déchargement des données de la table `voiture`
--
INSERT INTO `voiture` (`id`, `marque`, `model`, `couleur`, `nPlace`) VALUES
(20, 'Peugeot', '780', 'blanche', 8),
(21, 'Peugeot', '780', 'blanche', 8),
(22, 'Peugeot', '780', 'blanche', 8),
(23, 'Peugeot', '780', 'blanche', 8),
(24, 'Peugeot', '780', 'blanche', 8),
(25, 'Peugeot', '780', 'blanche', 8),
(26, 'grehgiruh', 'hrfgiuehiru', 'hieruguerh', 0),
(27, 'erhgh', 'gvhgfuyfeg', 'uyguyegfuzy', 80),
(28, 'erhgh', 'gvhgfuyfeg', 'uyguyegfuzy', 80),
(29, 'csc', 'cscs', 'scsc', 4),
(30, 'q', 'q', 'q', 1);
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `annonce`
--
ALTER TABLE `annonce`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `voiture` (`voiture`) USING BTREE;
--
-- Index pour la table `commentaireannonce`
--
ALTER TABLE `commentaireannonce`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `commentaireutilisateur`
--
ALTER TABLE `commentaireutilisateur`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `reservation`
--
ALTER TABLE `reservation`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `voiture`
--
ALTER TABLE `voiture`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `annonce`
--
ALTER TABLE `annonce`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22;
--
-- AUTO_INCREMENT pour la table `commentaireannonce`
--
ALTER TABLE `commentaireannonce`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT pour la table `commentaireutilisateur`
--
ALTER TABLE `commentaireutilisateur`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT pour la table `reservation`
--
ALTER TABLE `reservation`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT pour la table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT pour la table `voiture`
--
ALTER TABLE `voiture`
MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;
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 |
791baa43f3d5adfcba9775ef712c023844aa3245 | SQL | v-syrytsia/SPD | /spd-java-boot-camp/hw-5/build/resources/main/db/migration/V4__Create_trips_passengers_table.sql | UTF-8 | 239 | 3.140625 | 3 | [] | no_license | create table trips_passengers
(
trip integer not null,
passenger varchar(50) not null,
primary key (trip, passenger),
foreign key (trip) references trips(id),
foreign key (passenger) references passengers (name)
); | true |
59029a7f31441f5eccc903952d5a43b962fce7a4 | SQL | spure02/HotelDatabaseManagement | /sql/create_indexes.sql | UTF-8 | 773 | 2.875 | 3 | [] | no_license | DROP INDEX IF EXISTS hotel_index;
DROP INDEX IF EXISTS staff_index;
DROP INDEX IF EXISTS room_index;
DROP INDEX IF EXISTS customer_index;
DROP INDEX IF EXISTS company_index;
DROP INDEX IF EXISTS booking_index;
DROP INDEX IF EXISTS repair_index;
DROP INDEX IF EXISTS request_index;
DROP INDEX IF EXISTS assigned_index;
CREATE INDEX hotel_index
ON Hotel
(hotelID);
CREATE INDEX staff_index
ON Staff
(staffID);
CREATE INDEX room_index
ON Room
(roomID);
CREATE INDEX customer_index
ON Customer
(customerID);
CREATE INDEX company_index
ON MaintenanceCompany
(cmpID);
CREATE INDEX booking_index
ON Booking
(bookingDate);
CREATE INDEX repair_index
ON Repair
(mCompany);
CREATE INDEX request_index
ON Request
(managerID);
CREATE INDEX assigned_index
ON Assigned
(staffID); | true |
1857c3fff400d159040691de3f18dbd8fcb02e01 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day08/select1216.sql | UTF-8 | 266 | 2.96875 | 3 | [] | no_license |
SELECT sen.name
FROM SENSOR sen, SENSOR_TYPE st, COVERAGE_INFRASTRUCTURE ci
WHERE sen.SENSOR_TYPE_ID=st.id AND st.name='WiFiAP' AND sen.id=ci.SENSOR_ID AND ci.INFRASTRUCTURE_ID=ANY(array['2221','2039','6024','4032','4231','5051','3074','2100_9','3232','2100_6'])
| true |
aba1307547eb83bba634d9ad78a926a45aea244a | SQL | AbertoRey/ProyectoFinal | /db/project.sql | UTF-8 | 6,377 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 04-11-2020 a las 12:45:22
-- Versión del servidor: 10.4.14-MariaDB
-- Versión de PHP: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Base de datos: `project`
--
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `admin`
--
CREATE TABLE `admin` (
`admin_id` int(11) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(500) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `admin`
--
INSERT INTO `admin` (`admin_id`, `email`, `password`) VALUES
(2, 'admin@admin.com', 'admin');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `answer`
--
CREATE TABLE `answer` (
`qid` text NOT NULL,
`ansid` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `answer`
--
INSERT INTO `answer` (`qid`, `ansid`) VALUES
('5fa20ebd3fb24', '5fa20ebd51dcd'),
('5fa20ebd84a77', '5fa20ebd8ca6f'),
('5fa20ebdb82d3', '5fa20ebddb7cf'),
('5fa20ebe25b4e', '5fa20ebe35d1e');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `history`
--
CREATE TABLE `history` (
`email` varchar(50) NOT NULL,
`eid` text NOT NULL,
`score` int(11) NOT NULL,
`level` int(11) NOT NULL,
`sahi` int(11) NOT NULL,
`wrong` int(11) NOT NULL,
`date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `history`
--
INSERT INTO `history` (`email`, `eid`, `score`, `level`, `sahi`, `wrong`, `date`) VALUES
('JohnDoe@gmail.com', '5fa20e746ab11', 8, 4, 3, 1, '2020-11-04 03:23:08');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `options`
--
CREATE TABLE `options` (
`qid` varchar(50) NOT NULL,
`option` varchar(5000) NOT NULL,
`optionid` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `options`
--
INSERT INTO `options` (`qid`, `option`, `optionid`) VALUES
('5fa20ebd3fb24', 'juan', '5fa20ebd51dcd'),
('5fa20ebd3fb24', 'pedro', '5fa20ebd51dd5'),
('5fa20ebd3fb24', 'luis', '5fa20ebd51dd6'),
('5fa20ebd3fb24', 'mateo', '5fa20ebd51dd7'),
('5fa20ebd84a77', '', '5fa20ebd8ca6f'),
('5fa20ebd84a77', '', '5fa20ebd8ca76'),
('5fa20ebd84a77', '', '5fa20ebd8ca78'),
('5fa20ebd84a77', '', '5fa20ebd8ca79'),
('5fa20ebdb82d3', '12', '5fa20ebddb7b7'),
('5fa20ebdb82d3', '34', '5fa20ebddb7cb'),
('5fa20ebdb82d3', '56', '5fa20ebddb7cf'),
('5fa20ebdb82d3', '11', '5fa20ebddb7d1'),
('5fa20ebe25b4e', 'pedro', '5fa20ebe35d1e'),
('5fa20ebe25b4e', 'luis', '5fa20ebe35d25'),
('5fa20ebe25b4e', 'guerrido', '5fa20ebe35d26'),
('5fa20ebe25b4e', 'pensulino', '5fa20ebe35d27');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `questions`
--
CREATE TABLE `questions` (
`eid` text NOT NULL,
`qid` text NOT NULL,
`qns` text NOT NULL,
`choice` int(10) NOT NULL,
`sn` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `questions`
--
INSERT INTO `questions` (`eid`, `qid`, `qns`, `choice`, `sn`) VALUES
('5fa20e746ab11', '5fa20ebd3fb24', 'Quien es el principito?', 4, 1),
('5fa20e746ab11', '5fa20ebd84a77', '', 4, 2),
('5fa20e746ab11', '5fa20ebdb82d3', 'cuantos años tiene?', 4, 3),
('5fa20e746ab11', '5fa20ebe25b4e', 'quien es su amigo?', 4, 4);
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `quiz`
--
CREATE TABLE `quiz` (
`eid` text NOT NULL,
`title` varchar(100) NOT NULL,
`sahi` int(11) NOT NULL,
`wrong` int(11) NOT NULL,
`total` int(11) NOT NULL,
`time` bigint(20) NOT NULL,
`intro` text NOT NULL,
`tag` varchar(100) NOT NULL,
`date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `quiz`
--
INSERT INTO `quiz` (`eid`, `title`, `sahi`, `wrong`, `total`, `time`, `intro`, `tag`, `date`) VALUES
('5fa20e746ab11', 'Principito', 3, 1, 4, 9, 'El principito es una novela corta y la obra más famosa del escritor y aviador francés Antoine de Saint-Exupéry', '', '2020-11-04 02:14:12');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `rank`
--
CREATE TABLE `rank` (
`email` varchar(50) NOT NULL,
`score` int(11) NOT NULL,
`time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `rank`
--
INSERT INTO `rank` (`email`, `score`, `time`) VALUES
('JohnDoe@gmail.com', 8, '2020-11-04 03:23:08');
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `user`
--
CREATE TABLE `user` (
`name` varchar(50) NOT NULL,
`gender` varchar(5) NOT NULL,
`college` varchar(100) NOT NULL,
`email` varchar(50) NOT NULL,
`mob` bigint(20) NOT NULL,
`password` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Volcado de datos para la tabla `user`
--
INSERT INTO `user` (`name`, `gender`, `college`, `email`, `mob`, `password`) VALUES
('John Doe', 'M', 'Ingeniería de sistemas', 'JohnDoe@gmail.com', 1234567890, '827ccb0eea8a706c4c34a16891f84e7b'),
('User', 'M', 'cimt', 'user@user.com', 11, 'e10adc3949ba59abbe56e057f20f883e');
--
-- Índices para tablas volcadas
--
--
-- Indices de la tabla `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`admin_id`);
--
-- Indices de la tabla `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`email`);
--
-- AUTO_INCREMENT de las tablas volcadas
--
--
-- AUTO_INCREMENT de la tabla `admin`
--
ALTER TABLE `admin`
MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
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 |
e597aa472a19639112ba6be95bf14f9972d0a5b1 | SQL | wangchongjie/olap-access | /src/test/resources/database/xxx_olap_create.sql | UTF-8 | 1,771 | 3.34375 | 3 | [
"Apache-2.0"
] | permissive | SET names utf8;
create database olap;
USE olap;
DROP TABLE IF EXISTS DailyGroupStats;
CREATE TABLE `DailyGroupStats` (
`Date` date NOT NULL COMMENT '日期',
`UserId` int(10) NOT NULL COMMENT '用户id',
`PlanId` int(10) NOT NULL COMMENT '计划id',
`GroupId` int(10) NOT NULL COMMENT '推广组id',
`Search` bigint(20) NOT NULL COMMENT '展现',
`Click` bigint(20) NOT NULL COMMENT '点击',
`Cost` bigint(20) NOT NULL COMMENT '消费',
KEY `userid_date_idx` (`UserId`,`Date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='推广组维度';
USE olap;
DROP TABLE IF EXISTS DailyGroupUvStats;
CREATE TABLE `DailyGroupUvStats` (
`Date` date NOT NULL COMMENT '日期',
`UserId` int(10) NOT NULL COMMENT '用户id',
`PlanId` int(10) NOT NULL COMMENT '计划id',
`GroupId` int(10) NOT NULL COMMENT '推广组id',
`SrchUv` bigint(20) NOT NULL COMMENT '展现uv',
`ClkUv` bigint(20) NOT NULL COMMENT '点击uv',
`TransUv` bigint(20) NOT NULL COMMENT '消费uv',
KEY `userid_date_idx` (`UserId`,`Date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='推广组Uv维度';
USE olap;
DROP TABLE IF EXISTS DailyGroupTransStats;
CREATE TABLE `DailyGroupTransStats` (
`Date` date NOT NULL COMMENT '日期',
`TransSiteId` int(10) NOT NULL COMMENT '网站id',
`TransTargetId` int(10) NOT NULL COMMENT '转化id',
`UserId` int(10) NOT NULL COMMENT '用户id',
`PlanId` int(10) NOT NULL COMMENT '计划id',
`GroupId` int(10) NOT NULL COMMENT '推广组id',
`DirectTransCnt` bigint(20) NOT NULL COMMENT '直接转化',
`IndirectTransCnt` bigint(20) NOT NULL COMMENT '间接转化',
KEY `userid_date_idx` (`UserId`,`Date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='推广组维度'; | true |
471429a9714ccfd005763a432733a0d32ea53809 | SQL | JSouza27/trybe-projects | /Back-end development/project-22-mysql-vocabulary-booster/desafio4.sql | UTF-8 | 455 | 3.765625 | 4 | [] | no_license | SELECT j.JOB_TITLE Cargo, ROUND(AVG(e.SALARY), 2) `Média salarial`,
CASE
WHEN ROUND(AVG(e.SALARY), 2) BETWEEN 2000 AND 5800 THEN "Júnior"
WHEN ROUND(AVG(e.SALARY), 2) BETWEEN 5801 AND 7500 THEN "Pleno"
WHEN ROUND(AVG(e.SALARY), 2) BETWEEN 7501 AND 10500 THEN "Sênior"
WHEN ROUND(AVG(e.SALARY), 2) > 1050 THEN 'CEO'
END Senioridade
FROM hr.jobs j
INNER JOIN hr.employees e
ON j.JOB_ID = e.JOB_ID
GROUP BY j.JOB_TITLE
ORDER BY `Média salarial`, Cargo;
| true |
0154d2648a2d3a391bd89d0c043a4fa1b92cb3d8 | SQL | fraanek/spilo | /postgres-appliance/tests/schema.sql | UTF-8 | 508 | 3.078125 | 3 | [
"Apache-2.0"
] | permissive | CREATE DATABASE test_db;
\c test_db
CREATE EXTENSION timescaledb;
CREATE TABLE "fOo" (id bigint NOT NULL PRIMARY KEY);
SELECT create_hypertable('"fOo"', 'id', chunk_time_interval => 100000);
INSERT INTO "fOo" SELECT * FROM generate_series(1, 3000000);
ALTER TABLE "fOo" ALTER COLUMN id SET STATISTICS 500;
CREATE UNLOGGED TABLE "bAr" ("bUz" INTEGER);
ALTER TABLE "bAr" ALTER COLUMN "bUz" SET STATISTICS 500;
INSERT INTO "bAr" SELECT * FROM generate_series(1, 300000);
CREATE TABLE with_oids() WITH OIDS;
| true |
2d6c954361d3b71f0b22f8fc3ff981dc9c7f6119 | SQL | mrizkifadil26/sppkp | /archive/harga.sql | UTF-8 | 3,840 | 3.328125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Oct 02, 2018 at 06:43 AM
-- 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 */;
--
-- Database: `harga`
--
CREATE DATABASE harga;
USE harga;
-- --------------------------------------------------------
--
-- Table structure for table `harga`
--
CREATE TABLE `harga` (
`tanggal` varchar(8) NOT NULL,
`id_komoditi` int(11) NOT NULL,
`harga` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `harga`
--
INSERT INTO `harga` (`tanggal`, `id_komoditi`, `harga`) VALUES
('20180930', 1, '900'),
('20180930', 4, '2000'),
('20180930', 5, '2000'),
('20180930', 6, '1000');
-- --------------------------------------------------------
--
-- Table structure for table `komoditi`
--
CREATE TABLE `komoditi` (
`id` int(11) NOT NULL,
`komoditi` varchar(100) NOT NULL,
`satuan` varchar(100) NOT NULL,
`hapus` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `komoditi`
--
INSERT INTO `komoditi` (`id`, `komoditi`, `satuan`, `hapus`) VALUES
(1, 'Beras Premium', 'kg', 0),
(3, 'sd2', 'nds2', 1),
(4, 'Gula Pasir Lokal', 'kg', 0),
(5, 'Kedelai Impor', 'kg', 0),
(6, 'Minyak Goreng Kemasan', 'liter', 0);
-- --------------------------------------------------------
--
-- Table structure for table `pengguna`
--
CREATE TABLE `pengguna` (
`id` varchar(100) NOT NULL,
`pass` varchar(32) NOT NULL,
`role` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `pengguna`
--
INSERT INTO `pengguna` (`id`, `pass`, `role`) VALUES
('operator', '123', 'operator'),
('admin', '123', 'admin'),
('surveyor', '123', 'surveyor');
-- --------------------------------------------------------
--
-- Table structure for table `survey`
--
CREATE TABLE `survey` (
`tanggal` varchar(8) NOT NULL,
`id_komoditi` int(11) NOT NULL,
`surveyor` varchar(100) NOT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`harga` varchar(100) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `survey`
--
INSERT INTO `survey` (`tanggal`, `id_komoditi`, `surveyor`, `timestamp`, `harga`) VALUES
('20180930', 1, 'surveyor', '2018-09-30 12:17:05', '2000'),
('20180930', 4, 'surveyor', '2018-09-30 12:17:05', '1000'),
('20180930', 5, 'surveyor', '2018-09-30 12:17:05', '500'),
('20180930', 6, 'surveyor', '2018-09-30 12:17:05', '3000'),
('20180930', 1, 'surveyor2', '2018-09-30 12:39:51', '900'),
('20180930', 4, 'surveyor2', '2018-09-30 12:39:51', '2000'),
('20180930', 5, 'surveyor2', '2018-09-30 12:39:51', '2000'),
('20180930', 6, 'surveyor2', '2018-09-30 14:41:42', '1000');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `harga`
--
ALTER TABLE `harga`
ADD PRIMARY KEY (`tanggal`,`id_komoditi`);
--
-- Indexes for table `komoditi`
--
ALTER TABLE `komoditi`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `pengguna`
--
ALTER TABLE `pengguna`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `survey`
--
ALTER TABLE `survey`
ADD PRIMARY KEY (`tanggal`,`id_komoditi`,`surveyor`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `komoditi`
--
ALTER TABLE `komoditi`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
/*!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 |
1772e9a9e0a810d46f8f143d78bf0dc25ef48253 | SQL | anamariadem/UBB-Assignments | /Semester3/Data Bases/Lab1/Atp-DB-Lab1.sql | UTF-8 | 1,488 | 3.640625 | 4 | [] | no_license | --DROP TABLE Player
CREATE TABLE Player
(PlayerId INT PRIMARY KEY,
FirstName VARCHAR(50),
LastName VARCHAR(50),
DateOfBirth DATE,
RankId INT REFERENCES Ranking(RankId)
)
CREATE TABLE Tournament
(TournamentId INT PRIMARY KEY,
TournamentName VARCHAR(50),
StartDate DATE)
CREATE TABLE Coach
( CoachId INT PRIMARY KEY,
CoachName VARCHAR(50),
PlayerId INT REFERENCES Player(PlayerId)
)
CREATE TABLE Sponsor
( SponsorId INT PRIMARY KEY,
SponsorName VARCHAR(50))
CREATE TABLE TennisMatch
(MatchId INT PRIMARY KEY,
MatchScore VARCHAR(50),
TournamentId INT REFERENCES Tournament(TournamentId)
)
CREATE TABLE Umpire
( UmpireId INT PRIMARY KEY,
UmpireName VARCHAR(50),
MatchId INT REFERENCES TennisMatch(MatchID)
)
CREATE TABLE TournamentWinner
(PlayerId INT PRIMARY KEY REFERENCES Player(PlayerId),
Section VARCHAR(50),
TournamentId INT REFERENCES Tournament(TournamentId)
)
DROP TABLE TournamentWinner
CREATE TABLE Player_Tournamnet
(PlayerId INT REFERENCES Player(PlayerId),
TournamentId INT REFERENCES Tournament(TournamentId),
PRIMARY KEY(PlayerId, TournamentId))
CREATE TABLE Player_Sponsor
(PlayerId INT REFERENCES Player(PlayerId),
SponsorId INT REFERENCES Sponsor(SponsorId),
PRIMARY KEY(PlayerId, SponsorId))
CREATE TABLE Player_Match
(PlayerId INT REFERENCES Player(PlayerId),
MatchId INT REFERENCES TennisMatch(MatchId),
PRIMARY KEY(PlayerId, MatchId))
ALTER TABLE Player
ADD OriginCountry VARCHAR(50); | true |
07899930cfde8b8bdbc327a193a1b8eb5914d465 | SQL | Tanyc/syscoin | /sql/invite/invite.sql | UTF-8 | 2,129 | 2.9375 | 3 | [] | no_license | DROP TABLE IF EXISTS `bi_invite`;
CREATE TABLE `bi_invite` (
`id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`UID` int(8) NOT NULL UNIQUE,
`BUIDS` varchar(160),
`b_num` int(2) NOT NULL DEFAULT 0,
`score` int(5) NOT NULL DEFAULT 0,
`p_score` int(5) NOT NULL DEFAULT 0,
`p_money` int(3) NOT NULL DEFAULT 0,
`last_score` int(3) NOT NULL DEFAULT 0,
`CTIME` varchar(11),
PRIMARY KEY (`id`)
)DEFAULT CHARSET =utf8;
-- ----------------------------
-- id:晒奖id
-- UID:推广用户id
-- BUIDS:被推广用户的id,以";"间隔,当前最多保存20位
-- b_num:被推广人数
-- score:推广分数
-- p_score:已兑换的分数
-- p_money:已兑换的现金
-- last_score:最后获得奖励分数
-- CTIME:最后获得奖励时间
-- ----------------------------
INSERT INTO `bi_invite` VALUES ('1','1873372', '1873373,1985454,5248541,548751', '4','2654','215','10','100','1400473645');
INSERT INTO `bi_invite` VALUES (null,'1873373', '1873373', '1','2654854','2152','1','105','1400473655');
INSERT INTO `bi_invite` VALUES (null,'1873374', '1873373,1985454', '2','2654454','2125','0','1580','1400473665');
INSERT INTO `bi_invite` VALUES (null,'1873375', '1873373,1985454,5248541,5458751', '4','26548','215','0','205','1400473685');
INSERT INTO `bi_invite` VALUES (null,'1873376', '1873373,54584584,5458751', '3','2654854','21524','1','1320','1400473745');
INSERT INTO `bi_invite` VALUES (null,'1873377', '1873373,1985454,5248541,5458751', '4','8454','2155','5','111','1400473545');
INSERT INTO `bi_invite` VALUES (null,'1873378', '1873373,2545454,5248541,584542', '4','545454','25','6','108','1400473335');
INSERT INTO `bi_invite` VALUES (null,'1873379', '1873373,2545415,5248541,5252522', '4','5254','2152','3','109','1400473225');
INSERT INTO `bi_invite` VALUES (null,'1873310', '1873373,5555545,5248541,54542545', '4','55554','2152','2','112','1400473945');
INSERT INTO `bi_invite` VALUES (null,'1873311', '1873373,1985454,5248541,5458751', '4','554','2185','0','10','1400473642');
INSERT INTO `bi_invite` VALUES (null,'1873312', '1873373,5454544,54584584,554545,5458751', '5','54554','21555','1000','100','1400475645'); | true |
130317bc9b01b13ab352e041ceb4b8aa14555262 | SQL | ichirin2501/i5q | /sql/alter-log.sql | UTF-8 | 656 | 3.53125 | 4 | [] | no_license | ALTER TABLE footprints ADD UNIQUE `uniq_user_id_owner_id` (`user_id`, `owner_id`);
ALTER TABLE relations ADD INDEX `idx_one_created_at` (`one`, `created_at`);
ALTER TABLE entries ADD INDEX `idx_user_id_private_created_at` (`user_id`, `private`, `created_at`);
ALTER TABLE comments ADD COLUMN `owner_id` int(11) NOT NULL;
UPDATE comments JOIN entries ON comments.entry_id = entries.id SET comments.owner_id = entries.user_id;
ALTER TABLE comments ADD INDEX `idx_owner_id_created_at` (`owner_id`, `created_at`);
ALTER TABLE users ADD COLUMN `salt` varchar(6) DEFAULT NULL;
UPDATE users JOIN salts ON users.id = salts.user_id SET users.salt = salts.salt;
| true |
82e76ef5e01a4f314c147d64eb447e8b928ef81b | SQL | Nurjaman/tes | /uts_interoperability/b_ummi_zakiyah/database.sql | UTF-8 | 3,667 | 2.703125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 08, 2017 at 07:00 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: `database`
--
-- --------------------------------------------------------
--
-- Table structure for table `b_ummi_zakiyah_ibrati_data`
--
CREATE TABLE IF NOT EXISTS `b_ummi_zakiyah_ibrati_data` (
`nim` varchar(9) NOT NULL,
`nama` varchar(25) NOT NULL,
`nama_panggilan` varchar(25) NOT NULL,
`jenis_kelamin` varchar(25) NOT NULL,
`alamat` varchar(50) NOT NULL,
`kota` varchar(25) NOT NULL,
`kecamatan` varchar(25) NOT NULL,
`provinsi` varchar(25) NOT NULL,
`tempat_lahir` varchar(25) NOT NULL,
`tanggal_lahir` date NOT NULL,
`email` varchar(25) NOT NULL,
`no_hp` varchar(13) NOT NULL,
`status` varchar(25) NOT NULL,
`hobi` varchar(25) NOT NULL,
`pekerjaan` varchar(25) NOT NULL,
PRIMARY KEY (`nim`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `b_ummi_zakiyah_ibrati_data`
--
INSERT INTO `b_ummi_zakiyah_ibrati_data` (`nim`, `nama`, `nama_panggilan`, `jenis_kelamin`, `alamat`, `kota`, `kecamatan`, `provinsi`, `tempat_lahir`, `tanggal_lahir`, `email`, `no_hp`, `status`, `hobi`, `pekerjaan`) VALUES
('D11151035', 'Muhamad Chairul Kamil', 'Kamil', 'Laki-Laki', 'Jl. Pesantren', 'Cimahi', 'Cimahi Utara', 'Jawa Barat', 'Bandung', '1997-09-10', 'kamil@gmail.com', '087826327292', 'Mahasiswa', 'Main Gitar', 'Pelajar'),
('D11151045', 'Nita Apriyanti Rachayu', 'Nita', 'Perempuan', 'Jl. Cipageran', 'Cimahi', 'Cimahi Utara', 'Jawa Barat', 'Bandung', '1997-04-25', 'nita@gmail.com', '082216743837', 'Mahasiswa', 'Bisnis', 'Pelajar'),
('D11151046', 'Novita Kusuma Astuti', 'Novita', 'Perempuan', 'Cigugur Tengah', 'Cimahi', 'Cimahi Selatan', 'Jawa Barat', 'Cimahi', '1997-11-01', 'novita@gmail.com', '089658529345', 'Mahasiswa', 'Menggambar', 'Pelajar'),
('D11151047', 'Putri Aditya Syapitri', 'Putri', 'Perempuan', 'Leuwigajah', 'Cimahi', 'Leuwigajah', 'Jawa Barat', 'Bandung', '1997-04-19', 'putri@gmail.com', '089658331983', 'Mahasiswa', 'Makan', 'Pelajar'),
('D11151049', 'Razzak Ibnain Oktarianto', 'Razzak', 'Laki-Laki', 'Palarang', 'Bandung Barat', 'Padalarang', 'Jawa Barat', 'Bandung', '1997-10-01', 'razzak@gmail.com', '082217891797', 'Mahasiswa', 'Mancing', 'Pelajar'),
('D11151050', 'Rizki Bagja Nugraha', 'Bagja', 'Laki-Laki', 'Lembang', 'Bandung Barat', 'Lembang', 'Jawa Barat', 'Lembang', '1997-08-19', 'bagja@gmail.com', '087876543456', 'Mahasiswa', 'Main Gitar', 'Pelajar'),
('D11151067', 'Maulana Ramdhan', 'Maul', 'Laki-Laki', 'Jl. Cipageran', 'Bandung Barat', 'Bandung Barat', 'Jawa Barat', 'Cimahi', '1997-02-07', 'maulana@gmail.com', '082217501774', 'Mahasiswa', 'Mancing', 'Pelajar'),
('D11151068', 'Ummi Zakiyah Ibrati', 'Ummi', 'Perempuan', 'Jl. Margaluyu', 'Cimahi', 'Cimahi Tengah', 'Jawa Barat', 'Purworejo', '1997-09-12', 'ibratiu@gmail.com', '082217501774', 'Mahasiswa', 'Dengerin Musik', 'Pelajar'),
('D11152048', 'Ray Andika Winata', 'Ray', 'Laki-Laki', 'Aceh', 'Langsa', 'Langsa', 'Nanggroe Aceh Darussalam', 'Aceh', '1996-10-04', 'ray@gmail.com', '082272950679', 'Mahasiswa', 'Menggambar', 'Pelajar'),
('E11161004', 'Dysti Nuhretha Sani', 'Dysti', 'Perempuan', 'Jl. Margaluyu', 'Cimahi', 'Cimahi Tengah', 'Jawa Barat', 'Bandung', '1997-03-21', 'dysti@gmail.com', '081323232323', 'Mahasiswa', 'Membaca', 'Pelajar');
/*!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 |
7a641941c4b9bafb4a02fb926be08d718e74ccf1 | SQL | keesdoornenbal/ArtPlace | /artplace/schema.sql | UTF-8 | 1,772 | 3.875 | 4 | [] | no_license | DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS post;
DROP TABLE IF EXISTS artpiece;
DROP TABLE IF EXISTS wallet;
DROP TABLE IF EXISTS contract;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE wallet (
id INTEGER PRIMARY KEY AUTOINCREMENT,
owner_id INTEGER NOT NULL,
balance DECIMAL(11, 2) NOT NULL,
FOREIGN KEY (owner_id) REFERENCES user (id)
);
CREATE TABLE contract(
id INTEGER PRIMARY KEY AUTOINCREMENT,
artpiece_id INTEGER NOT NULL,
enddate TIMESTAMP NOT NULL,
price DECIMAL(10, 2) NOT NULL,
lender_id INTEGER NOT NULL,
borrower_id INTEGER,
FOREIGN KEY (artpiece_id) REFERENCES artpiece (id),
FOREIGN KEY (lender_id) REFERENCES user (id),
FOREIGN KEY (borrower_id) REFERENCES user (id)
);
CREATE TABLE transaction (
id INTEGER PRIMARY KEY AUTOINCREMENT,
amount INTEGER NOT NULL,
wallet_from INTEGER NOT NULL,
wallet_to INTEGER NOT NULL,
FOREIGN KEY (wallet_from) REFERENCES wallet (id)
FOREIGN KEY (wallet_to) REFERENCES wallet (id)
);
CREATE TABLE post (
id INTEGER PRIMARY KEY AUTOINCREMENT,
author_id INTEGER NOT NULL,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
title TEXT NOT NULL,
body TEXT NOT NULL,
contract_id INTEGER,
FOREIGN KEY (author_id) REFERENCES user (id),
FOREIGN KEY (contract_id) REFERENCES contract (id)
);
CREATE TABLE artpiece (
id INTEGER PRIMARY KEY AUTOINCREMENT,
renter_id INTEGER,
owner_id INTEGER NOT NULL,
uploadtime TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
artpiecename TEXT NOT NULL,
image BLOB NOT NULL,
imagetype TEXT NOT NULL,
value DECIMAL(10, 2) NOT NULL,
FOREIGN KEY (owner_id) REFERENCES user (id),
FOREIGN KEY (renter_id) REFERENCES user (id)
);
| true |
6cfbc2d42907aef1644c767a7dca998a8f51e0a8 | SQL | radtek/abs3 | /sql/mmfo/barstrans/Table/out_dest_adr.sql | WINDOWS-1251 | 2,455 | 3.375 | 3 | [] | no_license |
PROMPT =====================================================================================
PROMPT *** Run *** ========== Scripts /Sql/BARSTRANS/Table/OUT_DEST_ADR.sql =========*** Run
PROMPT =====================================================================================
PROMPT *** Create table OUT_DEST_ADR ***
begin
execute immediate '
CREATE TABLE BARSTRANS.OUT_DEST_ADR
(ADR_NAME VARCHAR2(50),
ADR_DESC VARCHAR2(255),
BASE_HOST VARCHAR2(255),
IS_ACTIVE NUMBER(1,0),
IS_LOCAL NUMBER(1,0)
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
TABLESPACE BRSSMLD ';
exception when others then
if sqlcode=-955 then null; else raise; end if;
end;
/
COMMENT ON TABLE BARSTRANS.OUT_DEST_ADR IS ' ';
COMMENT ON COLUMN BARSTRANS.OUT_DEST_ADR.BASE_HOST IS ' ';
COMMENT ON COLUMN BARSTRANS.OUT_DEST_ADR.IS_ACTIVE IS ' 1-, 2-';
COMMENT ON COLUMN BARSTRANS.OUT_DEST_ADR.IS_LOCAL IS ' 1-, 2-';
COMMENT ON COLUMN BARSTRANS.OUT_DEST_ADR.ADR_NAME IS ' ';
COMMENT ON COLUMN BARSTRANS.OUT_DEST_ADR.ADR_DESC IS ' ';
PROMPT *** Create constraint PK_OUT_DEST_ADR ***
begin
execute immediate '
ALTER TABLE BARSTRANS.OUT_DEST_ADR ADD CONSTRAINT PK_OUT_DEST_ADR PRIMARY KEY (ADR_NAME)
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
TABLESPACE BRSSMLI ENABLE';
exception when others then
if sqlcode=-2260 or sqlcode=-2261 or sqlcode=-2264 or sqlcode=-2275 or sqlcode=-1442 then null; else raise; end if;
end;
/
PROMPT *** Create index PK_OUT_DEST_ADR ***
begin
execute immediate '
CREATE UNIQUE INDEX BARSTRANS.PK_OUT_DEST_ADR ON BARSTRANS.OUT_DEST_ADR (ADR_NAME)
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
TABLESPACE BRSSMLI ';
exception when others then
if sqlcode=-955 then null; else raise; end if;
end;
/
PROMPT =====================================================================================
PROMPT *** End *** ========== Scripts /Sql/BARSTRANS/Table/OUT_DEST_ADR.sql =========*** End
PROMPT =====================================================================================
| true |
a4eb3bfffc10b80ba1d9b0d02338a24353ca6cbe | SQL | varusblack/recomendador-peliculas-joomla | /com_peliculas/admin/install.sql | UTF-8 | 1,985 | 3.15625 | 3 | [] | no_license | CREATE TABLE IF NOT EXISTS `#__actorespelicula` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idFamoso` int(11) NOT NULL,
`idPelicula` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `famosoPelicula` (`idFamoso`,`idPelicula`),
KEY `idFamoso` (`idFamoso`),
KEY `idPelicula` (`idPelicula`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__categorias` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`categoria` varchar(100) CHARACTER SET utf8 COLLATE utf8_spanish2_ci NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `Categoria unica` (`categoria`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__famosos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ;
CREATE TABLE IF NOT EXISTS `#__peliculas` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`titulo` varchar(255) NOT NULL,
`anno` varchar(20) NOT NULL,
`videoRelease` varchar(255) NOT NULL,
`tituloEspanol` varchar(255) NOT NULL,
`idDirector` int(11) DEFAULT NULL,
`resumenEspa` text NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `Pelicula de fecha unica` (`titulo`,`anno`),
KEY `idDirector` (`idDirector`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `#__categoriaspeliculas` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`idPelicula` int(11) NOT NULL,
`idCategoria` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idPelicula` (`idPelicula`,`idCategoria`),
KEY `idCategoria` (`idCategoria`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci;
ALTER TABLE `#__users` ADD `vector` FLOAT NOT NULL;
CREATE TABLE IF NOT EXISTS `#__votos` (
`idUsuario` int(11) NOT NULL,
`idPelicula` int(11) NOT NULL,
`voto` decimal(10,2) NOT NULL,
`timestamp` int(11) NOT NULL,
KEY `idUsuario` (`idUsuario`),
KEY `idPelicula` (`idPelicula`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci;
UPDATE #__USERS SET name=id; | true |
35945c902719e167e2deb925cdc134bd270ccf67 | SQL | opengauss-mirror/openGauss-server | /src/test/regress/sql/hw_partition_interval_parallel_prepare.sql | UTF-8 | 465 | 3.421875 | 3 | [
"LicenseRef-scancode-mulanpsl-2.0-en",
"LicenseRef-scancode-unknown-license-reference",
"PostgreSQL",
"BSD-3-Clause",
"LGPL-2.0-or-later",
"LicenseRef-scancode-unicode",
"LicenseRef-scancode-warranty-disclaimer",
"curl",
"GPL-1.0-or-later",
"LGPL-2.1-or-later",
"LGPL-2.1-only",
"CC-BY-4.0",
... | permissive | -- prepare the parrallel modifed table;
DROP TABLE IF EXISTS partition_interval_parallel;
create table partition_interval_parallel
(
c1 int,
c2 int,
c3 date not null
)
partition by range (c3)
INTERVAL ('1 month')
(
PARTITION partition_interval_parallel_p1 VALUES LESS THAN ('2020-05-01'),
PARTITION partition_interval_parallel_p2 VALUES LESS THAN ('2020-06-01')
);
CREATE INDEX idx1_partition_interval_parallel on partition_interval_parallel(c3) local ;
| true |
beba35c69da6e67833f45b96ae9beefc0b3c2f79 | SQL | kgjoni/CreateDBApp | /CreateDBApp/CreateDBApp/bin/Debug/BikeHike.sql | UTF-8 | 930 | 3.390625 | 3 | [] | no_license | CREATE TABLE Customer (
CID INT IDENTITY(1, 1) PRIMARY KEY,
FirstName NVARCHAR(64) NOT NULL,
LastName NVARCHAR(64) NOT NULL,
Email NVARCHAR(128) NOT NULL
);
CREATE TABLE Byke_Type (
BTID INT IDENTITY(1, 1) PRIMARY KEY,
Description NVARCHAR(128) NOT NULL,
PricePerHour FLOAT NOT NULL
);
CREATE TABLE Bike (
BID INT IDENTITY(1, 1) PRIMARY KEY,
BTID INT NOT NULL FOREIGN KEY REFERENCES Byke_Type(BTID),
ServiceYear SMALLINT NOT NULL
);
CREATE TABLE Rentals (
RID INT IDENTITY(1, 1) PRIMARY KEY,
CID INT NOT NULL FOREIGN KEY REFERENCES Customer(CID),
BID INT NOT NULL FOREIGN KEY REFERENCES Bike(BID),
RentalStart DATETIME NOT NULL,
RentalEnd DATETIME NOT NULL,
Duration TIME,
AmountDue FLOAT NOT NULL
);
CREATE TABLE History (
AID INT IDENTITY(1, 1) PRIMARY KEY,
CID INT NOT NULL FOREIGN KEY REFERENCES Customer(CID),
BID INT NOT NULL FOREIGN KEY REFERENCES Bike(BID),
IsRented NVARCHAR(4)
); | true |
d70669e4ca4430de7f07a9fe910681654c61f879 | SQL | ssythe/RobloxLabsTemp | /SQL/RobloxAnalytics/Tables/Foreign/ServiceContext.sql | UTF-8 | 308 | 2.609375 | 3 | [
"Apache-2.0"
] | permissive | CREATE DATABASE IF NOT EXISTS `RobloxAnalytics`;
CREATE TABLE IF NOT EXISTS `RobloxAnalytics`.`ServiceContexts` (
`ID` INT NOT NULL AUTO_INCREMENT,
`Created` DATETIME NOT NULL,
`Updated` DATETIME NOT NULL,
`Name` TEXT NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `ID_UNIQUE` (`ID`)
) ENGINE=InnoDB;
| true |
48696a3c5327a1b418b882b3095c01a0050c5040 | SQL | silence-do-good/stress-test-Postgres-and-MySQL | /dump/high/day16/select0015.sql | UTF-8 | 178 | 2.65625 | 3 | [] | no_license |
SELECT timeStamp, temperature FROM ThermometerOBSERVATION o
WHERE timestamp>'2017-11-15T00:15:00Z' AND timestamp<'2017-11-16T00:15:00Z' AND temperature>=46 AND temperature<=60
| true |
da43198c3c68a8a77153af46f614a6cf5198aa33 | SQL | drylandmicrobes/meta_BSC_FICUS | /lib/schema.sql | UTF-8 | 872 | 2.9375 | 3 | [] | no_license | CREATE TABLE gene_phylo (
source_sample VARCHAR(32) NOT NULL,
gene_id VARCHAR(32) PRIMARY KEY NOT NULL,
percent_id varchar(8) NULL,
tax_kingdom VARCHAR(32) NOT NULL,
tax_phylum VARCHAR(32) NOT NULL,
tax_class VARCHAR(32) NOT NULL,
tax_order VARCHAR(64) NOT NULL,
tax_family VARCHAR(64) NOT NULL,
tax_genus VARCHAR(64) NOT NULL,
tax_species VARCHAR(128) NOT NULL,
tax_strain VARCHAR(128) NOT NULL
);
/* CREATE UNIQUE INDEX ix_gene_id ON gene_phylo (gene_id); */
CREATE INDEX ix_source ON gene_phylo (source_sample);
CREATE INDEX ix_kingdom ON gene_phylo (tax_kingdom);
CREATE INDEX ix_phylum ON gene_phylo (tax_phylum);
CREATE INDEX ix_class ON gene_phylo (tax_class);
CREATE INDEX ix_tax ON gene_phylo (tax_phylum,tax_class,tax_order,tax_family,tax_genus);
CREATE INDEX ix_genus ON gene_phylo (tax_genus);
CREATE INDEX ix_pid ON gene_phylo (percent_id);
| true |
2f072326338ff0936a0208c38ea4516eeaeea253 | SQL | ashaban/rakisis | /pembejeo.sql | UTF-8 | 10,707 | 3.03125 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 24, 2018 at 09:30 AM
-- Server version: 5.5.59-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.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 */;
--
-- Database: `pembejeo`
--
-- --------------------------------------------------------
--
-- Table structure for table `advance_payments`
--
CREATE TABLE IF NOT EXISTS `advance_payments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sales_id` int(11) NOT NULL,
`items` text NOT NULL,
`amount_paid` float NOT NULL,
`date_paid` date NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `branches`
--
CREATE TABLE IF NOT EXISTS `branches` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`type` varchar(30) NOT NULL,
`location` text NOT NULL,
`last_updated` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;
--
-- Dumping data for table `branches`
--
INSERT INTO `branches` (`id`, `name`, `type`, `location`, `last_updated`) VALUES
(10, 'Makao Makuu', 'hq', 'Sokoni', '2018-03-24 07:28:31');
-- --------------------------------------------------------
--
-- Table structure for table `contract_termination`
--
CREATE TABLE IF NOT EXISTS `contract_termination` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`employee_id` int(11) NOT NULL,
`date_terminated` date NOT NULL,
`reason` text NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `credits`
--
CREATE TABLE IF NOT EXISTS `credits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`amount` float NOT NULL,
`paid` float NOT NULL,
`date_credited` date NOT NULL,
`status` varchar(30) NOT NULL DEFAULT 'notCleared',
`description` text NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
-- --------------------------------------------------------
--
-- Table structure for table `customers`
--
CREATE TABLE IF NOT EXISTS `customers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` text NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
-- --------------------------------------------------------
--
-- Table structure for table `dailyExpenditures`
--
CREATE TABLE IF NOT EXISTS `dailyExpenditures` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`expId` int(11) NOT NULL,
`others` mediumtext NOT NULL,
`description` text NOT NULL,
`amount` float NOT NULL,
`date` date NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
-- --------------------------------------------------------
--
-- Table structure for table `debits`
--
CREATE TABLE IF NOT EXISTS `debits` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`amount` float NOT NULL,
`paid` float NOT NULL,
`date_debited` date NOT NULL,
`status` varchar(30) NOT NULL DEFAULT 'notCleared',
`description` text NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `designation`
--
CREATE TABLE IF NOT EXISTS `designation` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(30) NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
-- --------------------------------------------------------
--
-- Table structure for table `employees`
--
CREATE TABLE IF NOT EXISTS `employees` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`firstname` varchar(30) NOT NULL,
`middlename` varchar(30) NOT NULL,
`surname` varchar(30) NOT NULL,
`salary` float NOT NULL,
`employee_phone` varchar(30) NOT NULL,
`emergency_phone` varchar(30) NOT NULL,
`emergency_name` text NOT NULL,
`emergency_relation` text NOT NULL,
`date_hired` date NOT NULL,
`designation` text NOT NULL,
`status` varchar(30) NOT NULL DEFAULT 'employee',
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `expenditures`
--
CREATE TABLE IF NOT EXISTS `expenditures` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` varchar(100) NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
CREATE TABLE IF NOT EXISTS `items` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` mediumtext NOT NULL,
`buying_price` float NOT NULL,
`selling_price` float NOT NULL,
`unit` int(11) NOT NULL,
`total_units` int(11) NOT NULL,
`selling_price_unit` float NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
-- --------------------------------------------------------
--
-- Table structure for table `items_transfer`
--
CREATE TABLE IF NOT EXISTS `items_transfer` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`itemId` int(11) NOT NULL,
`quantity_transfered` int(11) NOT NULL,
`date_transfered` date NOT NULL,
`stock_id_from` int(11) NOT NULL,
`stock_id_to` int(11) NOT NULL,
`source_branch` int(11) NOT NULL,
`destination_branch` int(11) NOT NULL,
`transfer_type` varchar(30) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
-- --------------------------------------------------------
--
-- Table structure for table `retailStock`
--
CREATE TABLE IF NOT EXISTS `retailStock` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`batch_number` int(11) NOT NULL,
`itemId` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`available` int(11) NOT NULL,
`buyingPrice` float NOT NULL,
`date` date NOT NULL,
`expire_date` date NOT NULL,
`branch_id` int(11) NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
-- --------------------------------------------------------
--
-- Table structure for table `salary_payments`
--
CREATE TABLE IF NOT EXISTS `salary_payments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`employee_id` int(11) NOT NULL,
`basic_salary` float NOT NULL,
`amount_deducted` float NOT NULL,
`deduction_descriptions` text NOT NULL,
`salary_month` varchar(30) NOT NULL,
`salary_year` year(4) NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
-- --------------------------------------------------------
--
-- Table structure for table `sales`
--
CREATE TABLE IF NOT EXISTS `sales` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`itemId` int(11) NOT NULL,
`customer_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`price` float NOT NULL,
`date` date NOT NULL,
`salerId` int(11) NOT NULL,
`batchNumber` mediumtext NOT NULL,
`type` varchar(30) NOT NULL,
`pay_mode` varchar(30) NOT NULL,
`branch_id` int(11) NOT NULL,
`invoice_number` mediumtext NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
-- --------------------------------------------------------
--
-- Table structure for table `units`
--
CREATE TABLE IF NOT EXISTS `units` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(120) NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fname` varchar(30) NOT NULL,
`mname` varchar(30) NOT NULL,
`lname` varchar(30) NOT NULL,
`uname` varchar(30) NOT NULL,
`passwd` varchar(100) NOT NULL,
`branch` int(11) NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `fname`, `mname`, `lname`, `uname`, `passwd`, `branch`, `last_modified`) VALUES
(13, 'Administrator', '', 'Administrator', 'admin@technogap.co.tz', '21232f297a57a5a743894a0e4a801fc3', 10, '2018-03-24 07:29:08');
-- --------------------------------------------------------
--
-- Table structure for table `wholeStock`
--
CREATE TABLE IF NOT EXISTS `wholeStock` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`itemId` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`available` int(11) NOT NULL,
`buying_price` float NOT NULL,
`date_stocked` date NOT NULL,
`expire_date` date NOT NULL,
`branch_id` int(11) NOT NULL,
`last_modified` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;
/*!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 |
69d5fed10815e97fe9aab9d8e43d87485d00aec6 | SQL | leyufore/graduateDesign_electronic_cash | /电子现金系统实现/数据库/Dump20160626.sql | UTF-8 | 3,605 | 2.859375 | 3 | [] | no_license | -- MySQL dump 10.13 Distrib 5.7.9, for osx10.9 (x86_64)
--
-- Host: localhost Database: ecash
-- ------------------------------------------------------
-- Server version 5.7.12
/*!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 `USER`
--
DROP TABLE IF EXISTS `USER`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `USER` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`identification_id` bigint(20) NOT NULL,
`bank_account` bigint(20) NOT NULL,
`balance` int(11) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `identification_id_UNIQUE` (`identification_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `USER`
--
LOCK TABLES `USER` WRITE;
/*!40000 ALTER TABLE `USER` DISABLE KEYS */;
INSERT INTO `USER` VALUES (1,541,20160607004017,10000),(2,412,20160607004022,10000),(3,514,20160607004640,9995),(4,123456,20160607004804,9997);
/*!40000 ALTER TABLE `USER` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `coin`
--
DROP TABLE IF EXISTS `coin`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coin` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`sign_id` text NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `coin`
--
LOCK TABLES `coin` WRITE;
/*!40000 ALTER TABLE `coin` DISABLE KEYS */;
INSERT INTO `coin` VALUES (1,'b6tKcxrOJY5iemfywaNGCJNe74aaWF/HdKZuo+ngxhPt6kbU4DNIO4BOLEdrcFKCX5yxj8NfDwyw3dw6mYA8Fny5eP+S1Wmft4hNqcDKgNrv+lKvG4RbgJcLPAy/WyScMy82ww0m1vzdKeBm7ySxlnuoq0vnqWBQ5DjmjOb5gvO7ll5Sjlazc5yCd5wM3Y48i2qfnodiS/gKQkPiAOFhqkteGdJAfuTlDSLK/P5Z9W/GGk6/wGhzwFnmPYFbfEEAUVU9EME5LjQNCXwPLjMMBDFcmS0o+n7pj2BNP9vsVG5j0se1xLGx7JB1dH9/cmedGThRidY9b+SNJk5zGU0Agg=='),(2,'sBPv5eqF92CgWBtlVALOadtlOe3enWPKJMdCwcyqDPAi+lwFNaonO66Hpb5No41JP9+Ze5AUGqTFYR7/lXQyFIwxeCQn5JuHsZSuD/EVOoU48SLfINl0h2glRdEzmG8JSJNCKlrBWqKyf3EE/Qtiarh6gDF1rksHOHw0wtiKmop3CgBvl1GAwo9J2oM8w/BMZlvRv1xBec4sRI07zc+kds8fGF2oyPNpiIm8G+VO/Qsjd3XINkjkbUbYqH1Q6wkZpOgCFEZ3giNbeiKkBVEsPpYqsATZqv5yu3jPeoyFMmLfxrrpqynOCJuw0DS8y8XC4mnvkBwS9Oxy9eaEWU6LVQ=='),(3,'BrvJsxlp5t66cT8G3ZUetpJLnpuTTj+TFyWjhEs8RAk8sdlEjNkJoY6rhivGnDnwQfi6a5ye+92bOTpzD1u2H3eFZEJIKH0m0074DDHrlRfthbO3uKl0Y5PEoiZNZt2ShVnn4JOknchE24EAHdyYT6HAWypVgpVZoobop34V6UJ87ZFawLcghIGl/ByNuFJ7y4mT+5n6zJxOVad1EUegGxW2tm3tP20w7P6Hfmm1V/BdbIJDgM7x3qH5e9d0Ptel0N4gOs+VtKyYOowD2mlUzbPpMKPOKoDkotQvaMYLqRyYLa/TMn5GlE0AHZk2XrRk+AKEgcDIeFKby/cQ8355Vw=='),(4,'dzQ68XdFAsa3TSvIWpXLC9nr9akBbQ28YCubbp4wnocPkhcQdaf7cVnDbG1r4IxZzXVsJKbHRerxXIINFrGNZ2jSVQGyVJxQBAYz2HXqs0tzg50eFWBu7Rr634KJtgyNPLEABbspxOEmn8fF9baBdlpY6C/vBA8nsNGrl0bpBq7m27FQrEJJ+eEupBUI6nonecymS+T4x0PF4LyOflraNbYP+NuPbAgJ96CX2ynt072g7d6hIluRKg+rTnurtA/GZnF3sJlalHawrOOkG+acwHfAzSvRHKjxwD884GWsHUK7uilvcyaWhhVfcmAQWHGR+9Rj1ZkkUj5eCnB8gPhFkA=='),(5,'bvwxVbow9ndnUXeDWjdmRo6wJHWOnAYjrhDU6W69QWE0OLZ3N6RkOnyyVkrFgccdwl1Ouu4Ltnn3o+dxAdoG2QxSId1kJoqZiB4gfaQ+yBreUIKI1Ey9N8yWXszAAwhbUIIwRPg7J8z/ENOTC/h4V3c6R7fS9sH8XyaD6SII13pLZz14dXdlSgQGqoIS0VfAc7sVwQEepjjnle+mVo3knScMMK7FjscGfxMKBZJPKHShlvW5vvlgUreRvCfS6se76369owz2BQzVLfRJoMBtRYZWrFY0HVa6Zh2aJ9/JJhHnC6o97R8l22/aX/6yjOjAwzVCWWBecvZqUcZolEWwAQ=='),(6,'WeyDo0/13GRt2Qx9c4Fxt3rOrGMh78s9OGbT/I4mBQk+mhdfWjbb4OJjFHgdpC9IzFzdZ9WZMabZuWNgmT7ETe7YTAlCEoWLR5lZkMI+ESXruelJ8+DQUYMyR6EpF1K+Q4sBADWrjwv6l/Ny2gyRib/UsKqwzjGDo8e/Qc1tqHGcM+ZhfaSs/tM/TlnZAYec1xG9soknk7L19G2PqHf0ncgtd1KiFhDF1CZGmOHtbsU/ssckwwZMBPf43JQlx17sPyGBvEV/ZHgw71bgGusz4u/BsfQyIWAJg+Vxa+iUNBQckfSK1lgpufC+ja3JTQNgUnrP5epOlZwoR5pyFZ1IbQ=='),(7,'KNVta7j0XSKgeAvmDp6Tw10UEg/YFpgZ5L8DGNAffp6cUUCSkVfrFDR/qtGT1bYnRSZdw8TbW+QQep+jf1Bocw+WAIgWAbzOwC+/t1GbYkCz2zuUwgUGmrbIX6SgjsBAtz63U+Gut3zZYcf9W+OAcYrrZI28E+AmTgrUqjW1kaGoCSMoc0q9J3FAHSLc0LmUF1A59IwYfscs046BsOceHMnuXtTiRdXmKs9zwedl4A5yUVdfrqqUPeSa35A9VuJz4jp9fNUFnbxR/5KOn6QBYtJ5pjjtdDAs79mrETcFxwMJ6dv+dtQx6iD2f1itQhJBXwDOQhiLpjX4rOKcOiFH6A=='),(8,'PZet7GhSu6C5oclbUyzZn4EJrpYNgsEpTufxdTV2b0vbMAybkg7/GH1kHlhP1xdQ26u/XNwupoNlBWKYAQSpgPOIPm9CeIfauDIGDXJMAhQcfT7uGBEpmWhqxn1LRqW2jDPzsWe+mw1uxm/MUS2spH+jpjUbXmxBPfJtcOkJ8K6KIbTCQItWnUZ/D+zUdg+U9mmjwjrUP31mPZGZv+otzVfzQYCeV5jd7ORtzbfW0o9IrieU2vgCxbxhd43lV3U+2colAMOBOIrp59XcLLIjy6+SBo4Vzsgn+8JbOiqst8j8KvZJ0Zg586vgZyPJhG0VG5hq1o78wzXrR66pqcb3Lg=='),(9,'R8MZnwZs0OTuwOAvNhT0UbItaNJOr5zMTaBz6Lw/NaNiigw01of6PWIAAoRd+2Rvna9Abjv+ESvVc2byDeNJNnE3OtjOB66xDd5qNtxsj9v7Uhex+xr7Z8bFLjJmU7X9VMEYyHaWxVwjreV/UsOaKeRUzsyew7VRQ+lYbHUZp7ShnqCurqLy6/8l3Og/c1tyoFUROA9/W1AawQ1HMAIO/hOdjNyeuSjf3ASK4pTMbQuHecEUon3nQG/BrNUdZIgB2pLFjcQPVyvMwni+3k28XFzvGliqzzxbJmzdp+IuggQmtFF/k8c2a1nrB1CgGdm8Q0LCL7aJAtenTBMS9FzUZg=='),(10,'dH0GzZmviXfjruMqAFMrd/4q5kuYEgmkM2X6RBpRnRXAbVCkh/9HrCzzOogDYATH0hky05EwFlJUxjKUwo/52EqagZN4xnpCErtlZ2671s9WL6OKC5sRqa2iB9vJ1LyZkg88CeqoptnwPci6y9TBXZxBcgOSW84XRH2ObWyzQm7eMbuJkM8K0BC13Npd7meQlhdCWTZJhM+LRuOR6ca/UjnRiPlmSRf7TfIkt1/XNgVz3WtEM61qb/fUXKB9iu2UuAvjS8CkbOJPtn6lBBy99aK1cOn4ioTTNnF70PqL+PwNlZSbqi3vOXst1OuU3EmCiULDcmTLaN3Jx/w8gWKmLg==');
/*!40000 ALTER TABLE `coin` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `spendcoin`
--
DROP TABLE IF EXISTS `spendcoin`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `spendcoin` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`coin_id` text NOT NULL,
`sign_id` text NOT NULL,
PRIMARY KEY (`ID`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `spendcoin`
--
LOCK TABLES `spendcoin` WRITE;
/*!40000 ALTER TABLE `spendcoin` DISABLE KEYS */;
INSERT INTO `spendcoin` VALUES (1,'L+NWR2nVAH6pArvM0b8rrg==','FIjila3nMRWolG8+NwTf315rnmRJYLuscrbVmuhLh7hM40n64ntgUAwDcMyjJjPXs3jXfRb4KTkssWTulw1uAZiWMtjglgo1IIbPc+KVRUPH2wh6i2rzOcPvipOXY2brKFyS13W49YbuYL/3JAzNeewnn3ejQZEznkwk8pQobccHvETLVEn9pK3+XCJfWb2bHtH5cJw+T6Qs+xfnX5bhOa1osHRAAeBm30ewwEysj3vEkfrQZ3wjhYvMgpjEoytJehcLx/62WOsKI1xI9+iTEYpbam5PKiNDW+Fv5hUmvMov0eDBbNElqlB5ErD23KQ9MaiNBQcW06TgqS1EDKMTxw=='),(2,'TSOGtOJjQv6UJiMJzrouDQ==','ATLRoHFGYoiJOqCSWX/MUtDeWckoOwPG5p+eeA1SlM2DXwM2byQCu2WyS9WWDaTMbBFb9GZqYwk7UrFpMuvfDbh6MmvpCizOrguI+MKuJot7feo8W/0PUgcgYj/Xt2npscj6r8sV01nefb4h1KeRf8obqkWAx2k/vhzWiNWaSzJWy0jTInKA6XZi5FyP5mY6llLwoIcNHKOcU0u9DXX3K8bTx9O+9x5tz3obH7FOlBv8FN6Xm5aG0ArloiY9XEPtMuL/2kqZXCL041xidFKUZM9I2JarGMUJRgL9FzN3tXyvI1DiKIejd0dtQZJu0ICsQi6sVxO8BykwNO/A/YF1dw==');
/*!40000 ALTER TABLE `spendcoin` 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 2016-06-26 14:21:43
| true |
032b5f3c60061e43b2a4d78a13ddefc9a0fe2b05 | SQL | i3652/PHP_exercise | /mywebsite.sql | UTF-8 | 2,368 | 3.25 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : mar. 19 mai 2020 à 15:10
-- Version du serveur : 10.4.11-MariaDB
-- Version de PHP : 7.4.4
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 : `mywebsite`
--
-- --------------------------------------------------------
--
-- Structure de la table `items`
--
CREATE TABLE `items` (
`id` int(11) NOT NULL,
`itemname` text NOT NULL,
`price` int(11) NOT NULL,
`amount` int(11) NOT NULL,
`exp_d` date NOT NULL,
`type` text NOT NULL,
`notes` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `items`
--
INSERT INTO `items` (`id`, `itemname`, `price`, `amount`, `exp_d`, `type`, `notes`) VALUES
(1, 'eggs', 1, 3, '2020-06-13', '', 'yeah'),
(4, 'cake', 5, 3, '2020-06-13', 'Candy', 'nothing');
-- --------------------------------------------------------
--
-- Structure de la table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL,
`name` text NOT NULL,
`username` text NOT NULL,
`email` text NOT NULL,
`password` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
--
-- Déchargement des données de la table `user`
--
INSERT INTO `user` (`id`, `name`, `username`, `email`, `password`) VALUES
(2, 'illa', 'abou', 'abou@quentin.com', '202cb962ac59075b964b07152d234b70');
--
-- Index pour les tables déchargées
--
--
-- Index pour la table `items`
--
ALTER TABLE `items`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `user`
--
ALTER TABLE `user`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT pour les tables déchargées
--
--
-- AUTO_INCREMENT pour la table `items`
--
ALTER TABLE `items`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;
--
-- AUTO_INCREMENT pour la table `user`
--
ALTER TABLE `user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
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 |
cec1895bab64d40563ad07cace6c4e223de7de50 | SQL | edrinb/db_scripts | /spm2.sql | UTF-8 | 1,410 | 2.984375 | 3 | [] | no_license | DECLARE
l_sql_tune_task_id VARCHAR2(100);
BEGIN
l_sql_tune_task_id := DBMS_SQLTUNE.create_tuning_task (
begin_snap => 24767,
end_snap => 24976,
sql_id => '2q94zb7djr2xn',
scope => DBMS_SQLTUNE.scope_comprehensive,
time_limit => 300,
task_name => '2q94zb7djr2xn',
description => 'Tuning task for statement 2q94zb7djr2xn2 in AWR.');
DBMS_OUTPUT.put_line('l_sql_tune_task_id: ' || l_sql_tune_task_id);
END;
begin
dbms_sqltune.accept_sql_profile(task_name => 'dts4pgvmtfrys',
replace => TRUE);
end;
begin
--DBMS_SQLTUNE.reset_tuning_task(task_name => '4gjprumcfyj9w');
DBMS_SQLTUNE.execute_tuning_task(task_name => '2q94zb7djr2xn');
--DBMS_SQLTUNE.drop_tuning_task (task_name => '2q94zb7djr2xn');
end;
SELECT task_name, status FROM dba_advisor_log where task_name = '2q94zb7djr2xn_AWR_tuning_task'
SELECT DBMS_SQLTUNE.report_tuning_task('2q94zb7djr2xn') AS recommendations FROM dual;
begin
dbms_sqltune.accept_sql_profile(task_name => '2q94zb7djr2xn',
task_owner => 'LMDBPROD', replace => TRUE);
end;
begin dbms_sqltune.create_sql_plan_baseline(task_name =>
'2q94zb7djr2xn', owner_name => 'LMDBPROD', plan_hash_value =>
1311086720);
end;
| true |
4d43a83d929dbc2db510b0322be65c2a5356e93a | SQL | 1Basile/DevOps_online_Kiev_2021_Q2 | /m1/task3.1/data_base_backup.sql | UTF-8 | 5,151 | 3.125 | 3 | [] | no_license | -- MySQL dump 10.18 Distrib 10.3.27-MariaDB, for debian-linux-gnu (i686)
--
-- Host: localhost Database: book_list
-- ------------------------------------------------------
-- Server version 10.3.27-MariaDB-0+deb10u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `authors`
--
DROP TABLE IF EXISTS `authors`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `authors` (
`unique_id` int(11) DEFAULT NULL,
`author` varchar(20) DEFAULT NULL,
`status` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `authors`
--
LOCK TABLES `authors` WRITE;
/*!40000 ALTER TABLE `authors` DISABLE KEYS */;
INSERT INTO `authors` VALUES (1,' A. Kovel','R'),(2,'Alexandre Dumas','N'),(3,'Jack London','N'),(4,'Harper Lee','R'),(5,'Louisa May Brothers','N'),(6,'Toni Morrison','N'),(7,'Alan Moore','N'),(8,'Robert Krikman','N'),(9,'Charlie Mackesy','N'),(10,'Michael Connelly','N'),(11,'Arthur Conan Doyle','N'),(12,'Agatha Christie','R'),(13,'Stephen King','N'),(14,'The Hounting of Hill','N'),(15,'Josh Malerman','N'),(0,NULL,NULL);
/*!40000 ALTER TABLE `authors` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `books`
--
DROP TABLE IF EXISTS `books`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `books` (
`name` varchar(40) NOT NULL,
`genre` varchar(40) DEFAULT NULL,
`unique_id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`unique_id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `books`
--
LOCK TABLES `books` WRITE;
/*!40000 ALTER TABLE `books` DISABLE KEYS */;
INSERT INTO `books` VALUES ('Life of Pi','Action and Adventure',1),('The Three Musketeers','Action and Adventure',2),('The Call of the Wild','Action and Adventure',3),('To Kill a Mockingbird','Classics',4),('Little Women','Classics',5),('Beloved','Classics',6),('Watchmen','Comic Book',7),('The Walking Dead','Comic Book',8),('The Boy, the Mole, the Fox and the Horse','Comic Book',9),('The Night Fire','Detective and Mystery',10),('The Adventures of Sherlock Holmes','Detective and Mystery',11),('And Then There Were None','Detective and Mystery',12),('Carrie','Horror',13),('The Hounting of Hill House','Horror',14),('Bird Box','Horror',15),('An Eternal Golden Braid','Consciousness',16);
/*!40000 ALTER TABLE `books` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `final_book_table`
--
DROP TABLE IF EXISTS `final_book_table`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `final_book_table` (
`name` varchar(40) DEFAULT NULL,
`genre` varchar(30) DEFAULT NULL,
`author` varchar(20) DEFAULT NULL,
`status` char(1) DEFAULT NULL,
`unique_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `final_book_table`
--
LOCK TABLES `final_book_table` WRITE;
/*!40000 ALTER TABLE `final_book_table` DISABLE KEYS */;
INSERT INTO `final_book_table` VALUES ('Life of Pi','Action and Adventure',' A. Kovel','R',1),('The Three Musketeers','Action and Adventure','Alexandre Dumas','N',2),('The Call of the Wild','Action and Adventure','Jack London','N',3),('To Kill a Mockingbird','Classics','Harper Lee','R',4),('Little Women','Classics','Louisa May Brothers','N',5),('Beloved','Classics','Toni Morrison','N',6),('Watchmen','Comic Book','Alan Moore','N',7),('The Walking Dead','Comic Book','Robert Krikman','N',8),('The Boy, the Mole, the Fox and the Horse','Comic Book','Charlie Mackesy','N',9),('The Night Fire','Detective and Mystery','Michael Connelly','N',10),('The Adventures of Sherlock Holmes','Detective and Mystery','Arthur Conan Doyle','N',11),('And Then There Were None','Detective and Mystery','Agatha Christie','R',12),('Carrie','Horror','Stephen King','N',13),('The Hounting of Hill House','Horror','The Hounting of Hill','N',14),('Bird Box','Horror','Josh Malerman','N',15);
/*!40000 ALTER TABLE `final_book_table` 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-03-30 18:23:13
| true |
78b14ee0ea5457e579cf676b940b69a9e4b92d70 | SQL | MzxVegle/Struts2HomeWork | /database/mydatabase.sql | UTF-8 | 8,696 | 3.0625 | 3 | [] | no_license | /*
Navicat MySQL Data Transfer
Source Server : MyConnection
Source Server Version : 50720
Source Host : 127.0.0.1:3306
Source Database : mydatabase
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date: 2018-06-07 20:00:05
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for article_group
-- ----------------------------
DROP TABLE IF EXISTS `article_group`;
CREATE TABLE `article_group` (
`article_group_id` int(11) NOT NULL,
`article_group_name` varchar(100) NOT NULL,
`article_group_create_time` date DEFAULT NULL,
`article_group_alter_time` date DEFAULT NULL,
PRIMARY KEY (`article_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of article_group
-- ----------------------------
INSERT INTO `article_group` VALUES ('1', 'c++', '2018-03-16', '2018-03-16');
INSERT INTO `article_group` VALUES ('2', 'java', '2018-03-16', '2018-03-16');
INSERT INTO `article_group` VALUES ('3', 'c#', '2018-03-16', '2018-03-16');
-- ----------------------------
-- Table structure for article_info
-- ----------------------------
DROP TABLE IF EXISTS `article_info`;
CREATE TABLE `article_info` (
`article_id` int(11) NOT NULL,
`article_group_id` int(11) NOT NULL,
`article_name` int(11) NOT NULL,
`article_content` text,
`article_create_time` date DEFAULT NULL,
`article_alter_time` date DEFAULT NULL,
PRIMARY KEY (`article_id`),
KEY `FK_(article_group_id)` (`article_group_id`),
CONSTRAINT `FK_(article_group_id)` FOREIGN KEY (`article_group_id`) REFERENCES `article_group` (`article_group_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of article_info
-- ----------------------------
-- ----------------------------
-- Table structure for diary
-- ----------------------------
DROP TABLE IF EXISTS `diary`;
CREATE TABLE `diary` (
`diary_id` int(11) NOT NULL,
`diary_content` text NOT NULL,
`diary_create_time` date NOT NULL,
`diary_alter_time` date NOT NULL,
PRIMARY KEY (`diary_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of diary
-- ----------------------------
-- ----------------------------
-- Table structure for file
-- ----------------------------
DROP TABLE IF EXISTS `file`;
CREATE TABLE `file` (
`file_id` int(11) NOT NULL,
`file_group_id` int(11) NOT NULL,
`file_name` varchar(25) NOT NULL,
`file_addr` text NOT NULL,
`file_notice` text,
`file_upload_time` date DEFAULT NULL,
PRIMARY KEY (`file_id`),
KEY `FK(file)` (`file_group_id`),
CONSTRAINT `FK(file)` FOREIGN KEY (`file_group_id`) REFERENCES `file_group` (`file_group_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of file
-- ----------------------------
-- ----------------------------
-- Table structure for file_group
-- ----------------------------
DROP TABLE IF EXISTS `file_group`;
CREATE TABLE `file_group` (
`file_group_id` int(11) NOT NULL,
`file_group_name` varchar(50) NOT NULL,
`file_group_create_time` date DEFAULT NULL,
`file_group_alter_time` date DEFAULT NULL,
`file_group_notice` varchar(255) DEFAULT NULL,
PRIMARY KEY (`file_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of file_group
-- ----------------------------
-- ----------------------------
-- Table structure for leave_word
-- ----------------------------
DROP TABLE IF EXISTS `leave_word`;
CREATE TABLE `leave_word` (
`leave_word` varchar(255) NOT NULL,
`addr` varchar(35) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of leave_word
-- ----------------------------
-- ----------------------------
-- Table structure for photo
-- ----------------------------
DROP TABLE IF EXISTS `photo`;
CREATE TABLE `photo` (
`photo_id` int(11) NOT NULL,
`graph_id` int(11) NOT NULL,
`photo_name` varchar(25) NOT NULL,
`photo_addr` varchar(255) NOT NULL,
`photo_notice` text,
`photo_upload_time` date DEFAULT NULL,
PRIMARY KEY (`photo_id`),
KEY `FK(photo)` (`graph_id`),
CONSTRAINT `FK(photo)` FOREIGN KEY (`graph_id`) REFERENCES `photograph` (`graph_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of photo
-- ----------------------------
-- ----------------------------
-- Table structure for photograph
-- ----------------------------
DROP TABLE IF EXISTS `photograph`;
CREATE TABLE `photograph` (
`graph_id` int(11) NOT NULL,
`graph_name` varchar(25) NOT NULL,
`graph_create_time` date DEFAULT NULL,
`graph_alter_time` date DEFAULT NULL,
PRIMARY KEY (`graph_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of photograph
-- ----------------------------
-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` varchar(10) NOT NULL,
`password` varchar(25) NOT NULL,
`permission` varchar(7) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of user
-- ----------------------------
INSERT INTO `user` VALUES ('admin', 'admin', 'admin');
INSERT INTO `user` VALUES ('Jocker', 'Jocker', 'admin');
INSERT INTO `user` VALUES ('mzzxttao', 'mzzxttao', 'normal');
-- ----------------------------
-- Table structure for userinfo
-- ----------------------------
DROP TABLE IF EXISTS `userinfo`;
CREATE TABLE `userinfo` (
`id` varchar(15) NOT NULL,
`username` varchar(15) NOT NULL,
`realname` varchar(15) DEFAULT NULL,
`sex` varchar(3) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`reg_time` date DEFAULT NULL,
KEY `FK(id)` (`id`),
CONSTRAINT `FK(id)` FOREIGN KEY (`id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ----------------------------
-- Records of userinfo
-- ----------------------------
INSERT INTO `userinfo` VALUES ('admin', 'admin', '666', '男', '22', '2018-03-16');
INSERT INTO `userinfo` VALUES ('Jocker', 'Jocker', '', '女', '22', '2018-03-16');
-- ----------------------------
-- Procedure structure for delete_data
-- ----------------------------
DROP PROCEDURE IF EXISTS `delete_data`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_data`(in id varchar(10),out mess text)
BEGIN
if EXISTS(Select * from `user` WHERE `user`.id = id ) THEN
DELETE from `user` where `user`.id = id;
set mess = '注销用户成功!';
ELSE
set mess = CONCAT('不存在用户名:',id,'注销用户失败!');
END IF;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for reg_user
-- ----------------------------
DROP PROCEDURE IF EXISTS `reg_user`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `reg_user`(in id varchar(15),in pwd varchar(15),in permission varchar(7),in username varchar(15),in realname varchar(15),in sex varchar(3),in age int,out mess text)
BEGIN
DECLARE reg_date date;
set reg_date = NOW();
if EXISTS(Select * from `user` WHERE `user`.id = id ) THEN
set mess = '用户已经存在!注册失败';
ELSE
INSERT `user` VALUES(id,pwd,permission);
INSERT userinfo VALUES(id,username, realname,sex,age,reg_date);
set mess = CONCAT('注册成功!用户名:',id);
END IF;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for update_user_info
-- ----------------------------
DROP PROCEDURE IF EXISTS `update_user_info`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `update_user_info`(in id varchar(15),in username varchar(15),in realname varchar(15),in sex varchar(3),in age int,out mess text)
BEGIN
IF EXISTS(SELECT * from userinfo where userinfo.id = id) THEN
UPDATE userinfo set userinfo.username=username,userinfo.realname=realname,userinfo.sex = sex,userinfo.age = age where userinfo.id = id;
SET mess = CONCAT('更改',id,'用户的信息成功!');
ELSE
set mess = '未找到该用户!';
END IF;
END
;;
DELIMITER ;
-- ----------------------------
-- Procedure structure for update_user_pwd
-- ----------------------------
DROP PROCEDURE IF EXISTS `update_user_pwd`;
DELIMITER ;;
CREATE DEFINER=`root`@`localhost` PROCEDURE `update_user_pwd`(in id varchar(15),in pwd varchar(15) ,out mess text)
BEGIN
IF EXISTS(SELECT count(*) from `user` WHERE `user`.id = id) THEN
UPDATE `user` SET `user`.`password`=pwd where `user`.id = id;
set mess = CONCAT('更改',id,'用户的密码成功!');
ELSE
set mess='用户不存在,请先添加用户再修改!';
END IF;
END
;;
DELIMITER ;
| true |
d18c6582d6643fc1ca70e34fe16e318a2432e9e3 | SQL | yboren/virtlab | /guestbook/createTable.sql | UTF-8 | 597 | 2.921875 | 3 | [] | no_license | create database guestbook;
CREATE TABLE `messages` (
`id` int(11) NOT NULL auto_increment,
`parent` int(11) default '0',
`thread` int(11) default '0',
`name` tinytext,
`email` tinytext,
`subject` tinytext,
`time` int(11) NOT NULL default '0',
`ip` varchar(15) default NULL,
`topic_emoticon` int(11) NOT NULL default '0',
PRIMARY KEY (`id`),
KEY `thread` (`thread`),
KEY `id` (`id`),
KEY `parent` (`parent`)
) TYPE=MyISAM;
CREATE TABLE `messages_text` (
`mesid` int(11) NOT NULL default '0',
`message` text NOT NULL,
UNIQUE KEY `mesid` (`mesid`)
) TYPE=MyISAM;
| true |
3a035a2fdf97c88d1143b0244d1582867c8b51e9 | SQL | Baneeishaque/QR_Smart_Shopping_Solution_Server | /android/smartappqrcode.sql | UTF-8 | 9,094 | 3.046875 | 3 | [] | no_license | -- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 29, 2017 at 08:11 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 7.0.13
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: `smartappqrcode`
--
-- --------------------------------------------------------
--
-- Table structure for table `cart`
--
CREATE TABLE `cart` (
`cartID` int(10) NOT NULL,
`ItemID` int(100) DEFAULT NULL,
`Quantity` int(10) DEFAULT NULL,
`Unitamount` float DEFAULT NULL,
`Total` float DEFAULT NULL,
`userID` int(100) DEFAULT NULL,
`code` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Table structure for table `customer`
--
CREATE TABLE `customer` (
`cutomerID` int(100) NOT NULL,
`customerame` varchar(50) DEFAULT NULL,
`customeraddress` varchar(100) DEFAULT NULL,
`customeremail` varchar(50) DEFAULT NULL,
`customermobile` varchar(50) DEFAULT NULL,
`customerplace` varchar(25) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `customer`
--
INSERT INTO `customer` (`cutomerID`, `customerame`, `customeraddress`, `customeremail`, `customermobile`, `customerplace`) VALUES
(33, 'a', 'b', 'g', '9', 'f');
-- --------------------------------------------------------
--
-- Table structure for table `login`
--
CREATE TABLE `login` (
`lodID` int(20) NOT NULL,
`loginUsername` varchar(20) DEFAULT NULL,
`loginPassword` varchar(20) DEFAULT NULL,
`utype` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `login`
--
INSERT INTO `login` (`lodID`, `loginUsername`, `loginPassword`, `utype`) VALUES
(8, 'sur', 'sur', 'staff'),
(9, 'jiji', 'jiji', 'sales'),
(10, 'hnyt', 'aa', 'staff'),
(16, 'sumesh', 'sum', 'staff'),
(28, 'banee', '9895204814', 'Salesman'),
(33, 'c', 'd', 'customer');
-- --------------------------------------------------------
--
-- Table structure for table `party`
--
CREATE TABLE `party` (
`partyID` int(100) NOT NULL,
`Name` varchar(20) DEFAULT NULL,
`Place` varchar(30) DEFAULT NULL,
`Address` varchar(50) DEFAULT NULL,
`PIN` int(6) DEFAULT NULL,
`Phone` bigint(20) DEFAULT NULL,
`OpeningBalance` int(10) DEFAULT NULL,
`payment` int(10) DEFAULT NULL,
`currentbalance` int(10) DEFAULT NULL,
`openingdate` varchar(10) DEFAULT NULL,
`emailaddress` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `party`
--
INSERT INTO `party` (`partyID`, `Name`, `Place`, `Address`, `PIN`, `Phone`, `OpeningBalance`, `payment`, `currentbalance`, `openingdate`, `emailaddress`) VALUES
(1, 'abc', 'calicut', 'calicut', 111111, 12366, 1000, 10, NULL, '1992-12-12', 'abc@gmail'),
(2, 'hamdi', 'calicut', 'space mall', 188, 1888, 10000, NULL, NULL, NULL, NULL),
(3, 'hajee', 'palakkad', 'palakkad', 255, 188, 10000, NULL, NULL, NULL, NULL),
(4, 'ssm', 'ss', 'ss', 33, 33, 1000, NULL, NULL, NULL, NULL),
(5, 'asna', 'sa', 'as', 323, 23, 1000000, 100, 444, '1993-12-12', 'dfd'),
(6, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 900, NULL, NULL),
(7, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 990, NULL, NULL),
(8, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 990, NULL, NULL),
(9, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 990, NULL, NULL),
(10, 'aaa', 'as', 's', 3, 3, 23, NULL, NULL, '1993-12-12', 'es'),
(11, 'NDK', 'Tanur', 'Tanur ', 676307, 9446827218, 0, NULL, NULL, '', 'ndk@gmail.com');
-- --------------------------------------------------------
--
-- Table structure for table `product`
--
CREATE TABLE `product` (
`ProductID` int(25) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`purchaseamount` int(50) DEFAULT NULL,
`mrp` int(50) DEFAULT NULL,
`brand` varchar(100) DEFAULT NULL,
`manufacturedate` varchar(10) DEFAULT NULL,
`expdate` varchar(10) DEFAULT NULL,
`taxpercentage` int(10) DEFAULT NULL,
`taxamount` int(50) DEFAULT NULL,
`description` varchar(100) DEFAULT NULL,
`otherexpence` int(50) DEFAULT NULL,
`billnumber` int(50) DEFAULT NULL,
`billdate` varchar(10) DEFAULT NULL,
`party` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `product`
--
INSERT INTO `product` (`ProductID`, `name`, `purchaseamount`, `mrp`, `brand`, `manufacturedate`, `expdate`, `taxpercentage`, `taxamount`, `description`, `otherexpence`, `billnumber`, `billdate`, `party`) VALUES
(1, 'LUXASOAP', 100, 110, 'LUX', '12', '12', 1, 10, 'S', 1, 11, '12', 'ABC'),
(2, 'mango', 10, 100, 'moochi', '1993', '1995', 2, 10, 'no', 10, 12, '1993', 'hamdi'),
(3, 'thenga', 10, 100, 'theng', '1993', '1995', 2, 10, 'no', 1, 12, '1993', 'hamdi'),
(4, 'jam', 100, 1000, 'kadalil', '1990', '1999', 4, 10, 'nil', 10, 12, '1993', 'hajee'),
(5, 'jamoon', 10, 100, 'kissan', '1992', '1999', 2, 1, 'mango', 1, 11, '1993', 'asna'),
(7, 'jam', 10, 100, 'kissan', '100', '1999', 2, 10, 'grapes', 10, 11, '1994', 'ssm'),
(8, 'powder', 100, 150, 'cuticura', '1999', '2010', 4, 100, 'female', 100, 11, '2000', 'hajee'),
(11, 'jjja', 3, 3, '3', '3', '3', NULL, 3, '3', 3, 11, '11', 'hajee'),
(12, 'mutayi', 11, 1000, 'lollipop', '1900', '100', NULL, 1, 'ss', 1, 11, '1999', 'hamdi'),
(13, 'fairness', 10, 100, 'fairlovely', '12', '13', NULL, 10, 'as', 10, 111, '11', 'hamdi'),
(14, 'soap', 1, 10, 'hamam', '11', '11', NULL, 1, 's', 1, 1, '1', 'hamdi'),
(16, 'Windows', 500, 525, 'XP', '25-12-2017', '26-12-2018', NULL, 2, 'Microsoft Corporation', 0, 5, '23-12-2017', 'NDK');
-- --------------------------------------------------------
--
-- Table structure for table `sales`
--
CREATE TABLE `sales` (
`SalesID` int(20) NOT NULL,
`date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`Total` float DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `sales`
--
INSERT INTO `sales` (`SalesID`, `date`, `Total`) VALUES
(1, '2017-03-29 06:02:34', 1000),
(2, '2017-03-29 06:08:35', 10000);
-- --------------------------------------------------------
--
-- Table structure for table `staff`
--
CREATE TABLE `staff` (
`staffID` int(10) NOT NULL,
`Name` varchar(60) DEFAULT NULL,
`Address` varchar(50) DEFAULT NULL,
`PIN` int(6) DEFAULT NULL,
`Mobile` bigint(12) DEFAULT NULL,
`Email` varchar(50) DEFAULT NULL,
`image` blob,
`specialID` varchar(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `staff`
--
INSERT INTO `staff` (`staffID`, `Name`, `Address`, `PIN`, `Mobile`, `Email`, `image`, `specialID`) VALUES
(8, 'sresh', 'hh', 33, 3232332, '22', 0x70656e64696e67, 'sur'),
(9, 'jijith', 'as', 33, 232, 'zsd', 0x70656e64696e67, 'jiji'),
(10, 'hinayath', 'sa', 33, 22, '22qw', 0x70656e64696e67, 'hnyt'),
(17, 'sumesh', 'sss', 77, 77, 'jjsd', 0x70656e64696e67, 'sumesh'),
(18, 'Rakesh', 'xs', 33, 434, 'dss', 0x70656e64696e67, 'rakesh'),
(19, 'rakesh', 'ad', 33, 44, 'e', 0x70656e64696e67, 'rakesh'),
(21, 'rakesh', 'c', 3, 4, 'df', 0x70656e64696e67, 'rakesh'),
(22, 'rakesh', 'cv', 334, 55, 'hhs', 0x70656e64696e67, 'rakesh'),
(24, 'moyanth', 'as', 33, 3243, 'ds', 0x70656e64696e67, 'moyanth'),
(26, 'maya', 'maya', 66, 44, 'e', 0x70656e64696e67, 'maya'),
(30, 'Banee', 'tanalur ', 676307, 9446827219, 'banee@gmail.com', 0x70656e64696e67, 'banee');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `cart`
--
ALTER TABLE `cart`
ADD PRIMARY KEY (`cartID`);
--
-- Indexes for table `customer`
--
ALTER TABLE `customer`
ADD PRIMARY KEY (`cutomerID`);
--
-- Indexes for table `login`
--
ALTER TABLE `login`
ADD PRIMARY KEY (`lodID`);
--
-- Indexes for table `party`
--
ALTER TABLE `party`
ADD PRIMARY KEY (`partyID`);
--
-- Indexes for table `product`
--
ALTER TABLE `product`
ADD PRIMARY KEY (`ProductID`);
--
-- Indexes for table `sales`
--
ALTER TABLE `sales`
ADD PRIMARY KEY (`SalesID`);
--
-- Indexes for table `staff`
--
ALTER TABLE `staff`
ADD PRIMARY KEY (`staffID`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `cart`
--
ALTER TABLE `cart`
MODIFY `cartID` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11;
--
-- AUTO_INCREMENT for table `login`
--
ALTER TABLE `login`
MODIFY `lodID` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- AUTO_INCREMENT for table `party`
--
ALTER TABLE `party`
MODIFY `partyID` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `product`
--
ALTER TABLE `product`
MODIFY `ProductID` int(25) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
--
-- AUTO_INCREMENT for table `sales`
--
ALTER TABLE `sales`
MODIFY `SalesID` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
| true |
a1484da934591aa30eb22d34cfe25959e49efaf1 | SQL | astralm/astralbotBack | /src/mysql/functions/updateIntent.sql | UTF-8 | 5,496 | 3.625 | 4 | [] | no_license | BEGIN
DECLARE validOperation TINYINT(1) DEFAULT validStandartOperation(userHash, socketHash);
DECLARE userID, organizationID, socketID, conditionsLength, conditionsIterator, entitiesIterator, entitiesLength, lastGroupID, conditionsCount, botID, oldGroupID INT(11);
DECLARE connectionID VARCHAR(128);
DECLARE conditionValue, lastAnswer TEXT;
DECLARE lastName VARCHAR(64);
DECLARE responce, entities JSON;
SET responce = JSON_ARRAY();
IF validOperation = 1
THEN BEGIN
SELECT user_id, organization_id INTO userID, organizationID FROM users WHERE user_hash = userHash;
SELECT socket_id, socket_connection_id INTO socketID, connectionID FROM sockets WHERE socket_hash = socketHash;
SELECT
intent_json ->> "$.intent_name",
intent_json ->> "$.answer_text",
group_id,
bot_id
INTO
lastName,
lastAnswer,
lastGroupID,
botID
FROM intent_json WHERE intent_id = intentID;
IF name IS NOT NULL AND name != lastName
THEN SET lastName = name;
END IF;
IF answer IS NOT NULL AND answer != lastAnswer
THEN SET lastAnswer = answer;
END IF;
SET oldGroupID = lastGroupID;
SET lastGroupID = groupID;
UPDATE intents SET intent_name = lastName, group_id = lastGroupID WHERE intent_id = intentID AND organization_id = organizationID;
IF oldGroupID IS NOT NULL
THEN SET responce = JSON_MERGE(responce, dispatchGroup(organizationID, oldGroupID));
END IF;
IF lastGroupID IS NOT NULL
THEN SET responce = JSON_MERGE(responce, dispatchGroup(organizationID, lastGroupID));
END IF;
SET responce = JSON_MERGE(responce, JSON_OBJECT(
"action", "Procedure",
"data", JSON_OBJECT(
"query", "dispatchGroups",
"values", JSON_ARRAY(
organizationID,
botID
)
)
));
UPDATE answers SET answer_text = lastAnswer WHERE intent_id = intentID AND organization_id = organizationID;
DELETE FROM conditions WHERE intent_id = intentID AND organization_id = organizationID;
SET conditionsLength = JSON_LENGTH(conditions);
SET conditionsIterator = 0;
conditionsLoop: LOOP
IF conditionsIterator >= conditionsLength
THEN LEAVE conditionsLoop;
END IF;
SET entities = JSON_EXTRACT(conditions, CONCAT("$[", conditionsIterator, "]"));
SET entitiesLength = JSON_LENGTH(entities);
SET entitiesIterator = 0;
SET conditionValue = "";
entitiesLoop: LOOP
IF entitiesIterator >= entitiesLength
THEN LEAVE entitiesLoop;
END IF;
SET conditionValue = CONCAT(conditionValue, ",", JSON_EXTRACT(entities, CONCAT("$[", entitiesIterator, "]")));
SET entitiesIterator = entitiesIterator + 1;
ITERATE entitiesLoop;
END LOOP;
SET conditionValue = RIGHT(conditionValue, LENGTH(conditionValue) - 1);
INSERT INTO conditions (intent_id, user_id, condition_entities) VALUES (intentID, userID, conditionValue);
SET conditionsIterator = conditionsIterator + 1;
ITERATE conditionsLoop;
END LOOP;
DELETE c1 FROM conditions c1, conditions c2 WHERE c1.condition_id > c2.condition_id AND c1.condition_entities = c2.condition_entities AND c1.intent_id = intentID AND c2.intent_id = intentID AND c1.organization_id = organizationID AND c2.organization_id = organizationID;
UPDATE states SET state_json = JSON_SET(state_json, "$.page", 28) WHERE socket_id = socketID;
SET responce = JSON_MERGE(responce, dispatchIntent(organizationID, intentID));
SET responce = JSON_MERGE(responce, JSON_ARRAY(
JSON_OBJECT(
"action", "Procedure",
"data", JSON_OBJECT(
"query", "dispatchIntents",
"values", JSON_ARRAY(
organizationID,
botID
)
)
),
JSON_OBJECT(
"action", "sendToSocket",
"data", JSON_OBJECT(
"socket", connectionID,
"data", JSON_ARRAY(
JSON_OBJECT(
"action", "merge",
"data", JSON_OBJECT(
"page", 28
)
),
JSON_OBJECT(
"action", "changePage",
"data", JSON_OBJECT(
"page", CONCAT("app/intent:", intentID)
)
)
)
)
)
));
END;
END IF;
RETURN responce;
END | true |
fc1c13d1869ae0b88857f667eb2b609ad1c0bfc0 | SQL | rahulyhg/OpenDCIM_GSPE | /create.sql | UTF-8 | 36,566 | 3.484375 | 3 | [] | no_license | --
-- Table structure for table fac_Cabinet
--
DROP TABLE IF EXISTS fac_Cabinet;
CREATE TABLE fac_Cabinet (
CabinetID int(11) NOT NULL AUTO_INCREMENT,
DataCenterID int(11) NOT NULL,
Location varchar(20) NOT NULL,
LocationSortable varchar(20) NOT NULL,
AssignedTo int(11) NOT NULL,
ZoneID int(11) NOT NULL,
CabRowID int(11) NOT NULL,
CabinetHeight int(11) NOT NULL,
Model varchar(80) NOT NULL,
Keylock varchar(30) NOT NULL,
MaxKW float(11) NOT NULL,
MaxWeight int(11) NOT NULL,
InstallationDate date NOT NULL,
MapX1 int(11) NOT NULL,
MapX2 int(11) NOT NULL,
FrontEdge varchar(7) NOT NULL DEFAULT "Top",
MapY1 int(11) NOT NULL,
MapY2 int(11) NOT NULL,
Notes text NULL,
U1Position varchar(7) NOT NULL DEFAULT "Default",
PRIMARY KEY (CabinetID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS fac_AC;
CREATE TABLE fac_AC (
ACID int(11) NOT NULL AUTO_INCREMENT,
DataCenterID int(11) NOT NULL,
Location varchar(20) NOT NULL,
LocationSortable varchar(20) NOT NULL,
AssignedTo int(11) NOT NULL,
ZoneID int(11) NOT NULL,
CabRowID int(11) NOT NULL,
Model varchar(80) NOT NULL,
ColCap float(11) NOT NULL,
InstallationDate date NOT NULL,
MapX1 int(11) NOT NULL,
MapX2 int(11) NOT NULL,
MapY1 int(11) NOT NULL,
MapY2 int(11) NOT NULL,
Notes text NULL,
PRIMARY KEY (ACID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for fac_CabRow
--
DROP TABLE IF EXISTS fac_CabRow;
CREATE TABLE fac_CabRow (
CabRowID int(11) NOT NULL AUTO_INCREMENT,
Name varchar(120) NOT NULL,
DataCenterID int(11) NOT NULL,
ZoneID int(11) NOT NULL,
PRIMARY KEY (CabRowID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for fac_CabContainer
--
DROP TABLE IF EXISTS fac_Container;
CREATE TABLE fac_Container (
ContainerID int(11) NOT NULL AUTO_INCREMENT,
Name varchar(120) NOT NULL,
ParentID int(11) NOT NULL DEFAULT '0',
DrawingFileName varchar(255) DEFAULT NULL,
MapX int(11) NOT NULL,
MapY int(11) NOT NULL,
PRIMARY KEY (ContainerID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for table `fac_CabinetTags`
--
DROP TABLE IF EXISTS fac_CabinetTags;
CREATE TABLE fac_CabinetTags (
CabinetID int(11) NOT NULL,
TagID int(11) NOT NULL,
PRIMARY KEY (CabinetID,TagID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for table `fac_SensorReadings`
--
DROP TABLE IF EXISTS fac_SensorReadings;
CREATE TABLE fac_SensorReadings (
DeviceID int(11) NOT NULL,
Temperature float NOT NULL,
Humidity float NOT NULL,
LastRead datetime NOT NULL,
PRIMARY KEY (DeviceID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Add a new table for sensor probe templates
--
DROP TABLE IF EXISTS fac_SensorTemplate;
CREATE TABLE fac_SensorTemplate (
TemplateID INT(11) NOT NULL AUTO_INCREMENT,
ManufacturerID INT(11) NOT NULL,
Model VARCHAR(80) NOT NULL,
TemperatureOID VARCHAR(256) NOT NULL,
HumidityOID VARCHAR(256) NOT NULL,
TempMultiplier FLOAT(8) NOT NULL DEFAULT 1,
HumidityMultiplier FLOAT(8) NOT NULL DEFAULT 1,
mUnits VARCHAR(7) NOT NULL DEFAULT "english",
PRIMARY KEY(TemplateID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for fac_Slots
--
DROP TABLE IF EXISTS fac_Slots;
CREATE TABLE fac_Slots (
TemplateID INT(11) NOT NULL,
Position INT(11) NOT NULL,
BackSide TINYINT(1) NOT NULL,
X INT(11) NULL,
Y INT(11) NULL,
W INT(11) NULL,
H INT(11) NULL,
PRIMARY KEY (TemplateID, Position, BackSide)
) ENGINE = InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for fac_TemplatePorts
--
DROP TABLE IF EXISTS fac_TemplatePorts;
CREATE TABLE IF NOT EXISTS fac_TemplatePorts (
TemplateID int(11) NOT NULL,
PortNumber int(11) NOT NULL,
Label varchar(40) NOT NULL,
MediaID int(11) NOT NULL DEFAULT '0',
ColorID int(11) NOT NULL DEFAULT '0',
Notes varchar(80) NOT NULL,
PRIMARY KEY (TemplateID,PortNumber),
UNIQUE KEY LabeledPort (TemplateID,PortNumber,Label)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- TemplatePowerPorts table content the power connections of a device template
--
DROP TABLE IF EXISTS fac_TemplatePowerPorts;
CREATE TABLE fac_TemplatePowerPorts (
TemplateID int(11) NOT NULL,
PortNumber int(11) NOT NULL,
Label varchar(40) NOT NULL,
PortNotes varchar(80) NOT NULL,
PRIMARY KEY (TemplateID,PortNumber),
UNIQUE KEY LabeledPort (TemplateID,PortNumber,Label)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `fac_CDUTemplate`
--
DROP TABLE IF EXISTS fac_CDUTemplate;
CREATE TABLE fac_CDUTemplate (
TemplateID int(11) NOT NULL AUTO_INCREMENT,
ManufacturerID int(11) NOT NULL,
Model varchar(80) NOT NULL,
Managed int(1) NOT NULL,
ATS int(1) NOT NULL,
SNMPVersion varchar(2) NOT NULL DEFAULT '2c',
VersionOID varchar(80) NOT NULL,
Multiplier varchar(6) NULL DEFAULT NULL,
OID1 varchar(80) NOT NULL,
OID2 varchar(80) NOT NULL,
OID3 varchar(80) NOT NULL,
ATSStatusOID varchar(80) NOT NULL,
ATSDesiredResult varchar(80) NOT NULL,
ProcessingProfile varchar(20) NOT NULL DEFAULT "SingleOIDWatts",
Voltage int(11) NOT NULL,
Amperage int(11) NOT NULL,
NumOutlets int(11) NOT NULL,
PRIMARY KEY (TemplateID),
KEY ManufacturerID (ManufacturerID),
UNIQUE KEY (ManufacturerID, Model)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Add ColorCoding Table
--
DROP TABLE IF EXISTS fac_ColorCoding;
CREATE TABLE fac_ColorCoding (
ColorID INT(11) NOT NULL AUTO_INCREMENT,
Name VARCHAR(20) NOT NULL,
DefaultNote VARCHAR(40),
PRIMARY KEY(ColorID),
UNIQUE KEY Name (Name)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Create a table for things that we want to cache, such as the Navigation Menu
--
CREATE TABLE fac_DataCache (
ItemType varchar(80) not null,
Value mediumtext not null, primary key (ItemType)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_DataCenter
--
DROP TABLE IF EXISTS fac_DataCenter;
CREATE TABLE fac_DataCenter (
DataCenterID int(11) NOT NULL AUTO_INCREMENT,
Name varchar(255) NOT NULL,
SquareFootage int(11) NOT NULL,
DeliveryAddress varchar(255) NOT NULL,
Administrator varchar(80) NOT NULL,
MaxkW int(11) NOT NULL,
DrawingFileName varchar(255) NOT NULL,
EntryLogging tinyint(1) NOT NULL,
ContainerID INT(11) NOT NULL,
MapX int(11) NOT NULL,
MapY int(11) NOT NULL,
U1Position varchar(7) NOT NULL DEFAULT "Default",
PRIMARY KEY (DataCenterID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_Department
--
DROP TABLE IF EXISTS fac_Department;
CREATE TABLE fac_Department (
DeptID int(11) NOT NULL AUTO_INCREMENT,
Name varchar(255) NOT NULL,
ExecSponsor varchar(80) NOT NULL,
SDM varchar(80) NOT NULL,
Classification varchar(80) NOT NULL,
DeptColor VARCHAR( 7 ) NOT NULL DEFAULT '#FFFFFF',
PRIMARY KEY (DeptID),
UNIQUE KEY Name (Name)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_DeptContacts
--
DROP TABLE IF EXISTS fac_DeptContacts;
CREATE TABLE fac_DeptContacts (
DeptID int(11) NOT NULL,
ContactID int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_Decommission
--
DROP TABLE IF EXISTS fac_Decommission;
CREATE TABLE fac_Decommission (
SurplusDate DATE NOT NULL,
Label varchar(80) NOT NULL,
SerialNo varchar(40) NOT NULL,
AssetTag varchar(20) NOT NULL,
UserID varchar(80) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_Device
--
DROP TABLE IF EXISTS fac_Device;
CREATE TABLE fac_Device (
DeviceID int(11) NOT NULL AUTO_INCREMENT,
Label varchar(80) NOT NULL,
SerialNo varchar(40) NOT NULL,
AssetTag varchar(20) NOT NULL,
PrimaryIP varchar(254) NOT NULL,
SNMPVersion varchar(2) NOT NULL,
v3SecurityLevel varchar(12) NOT NULL,
v3AuthProtocol varchar(3) NOT NULL,
v3AuthPassphrase varchar(80) NOT NULL,
v3PrivProtocol varchar(3) NOT NULL,
v3PrivPassphrase varchar(80) NOT NULL,
SNMPCommunity varchar(80) NOT NULL,
SNMPFailureCount TINYINT(1) NOT NULL,
Hypervisor varchar(40) NOT NULL,
APIUsername varchar(80) NOT NULL,
APIPassword varchar(80) NOT NULL,
APIPort smallint(4) NOT NULL,
ProxMoxRealm varchar(80) NOT NULL,
Owner int(11) NOT NULL,
EscalationTimeID int(11) NOT NULL,
EscalationID int(11) NOT NULL,
PrimaryContact int(11) NOT NULL,
Cabinet int(11) NOT NULL,
Position int(11) NOT NULL,
Height int(11) NOT NULL,
Ports int(11) NOT NULL,
FirstPortNum int(11) NOT NULL,
TemplateID int(11) NOT NULL,
NominalWatts int(11) NOT NULL,
PowerSupplyCount int(11) NOT NULL,
DeviceType varchar(23) NOT NULL DEFAULT "Server",
ChassisSlots smallint(6) NOT NULL,
RearChassisSlots smallint(6) NOT NULL,
ParentDevice int(11) NOT NULL,
MfgDate date NOT NULL,
InstallDate date NOT NULL,
WarrantyCo VARCHAR(80) NOT NULL,
WarrantyExpire date NULL,
Notes text NULL,
Status varchar(20) NOT NULL DEFAULT 'Production',
HalfDepth tinyint(1) NOT NULL DEFAULT '0',
BackSide tinyint(1) NOT NULL DEFAULT '0',
AuditStamp DATETIME NOT NULL,
Weight int(11) NOT NULL DEFAULT '0',
DeviceLifecycle VARCHAR(80) NOT NULL,
PeriodicMaintenance VARCHAR(80) NOT NULL,
PRIMARY KEY (DeviceID),
KEY SerialNo (SerialNo,`AssetTag`,`PrimaryIP`),
KEY AssetTag (AssetTag),
KEY Cabinet (Cabinet),
KEY TemplateID (TemplateID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Create a table specifically for device image caching, optimize later
--
DROP TABLE IF EXISTS fac_DeviceCache;
CREATE TABLE fac_DeviceCache (
DeviceID int(11) NOT NULL,
Front mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
Rear mediumtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
UNIQUE KEY DeviceID (DeviceID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_DeviceTags
--
DROP TABLE IF EXISTS fac_DeviceTags;
CREATE TABLE fac_DeviceTags (
DeviceID int(11) NOT NULL,
TagID int(11) NOT NULL,
PRIMARY KEY (DeviceID,TagID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for table fac_DeviceTemplate
--
DROP TABLE IF EXISTS fac_DeviceTemplate;
CREATE TABLE fac_DeviceTemplate (
TemplateID int(11) NOT NULL AUTO_INCREMENT,
ManufacturerID int(11) NOT NULL,
Model varchar(80) NOT NULL,
Height int(11) NOT NULL,
Weight int(11) NOT NULL,
Wattage int(11) NOT NULL,
DeviceType varchar(23) NOT NULL DEFAULT "Server",
PSCount int(11) NOT NULL,
NumPorts int(11) NOT NULL,
Notes text NOT NULL,
FrontPictureFile VARCHAR(255) NOT NULL,
RearPictureFile VARCHAR(255) NOT NULL,
ChassisSlots SMALLINT(6) NOT NULL,
RearChassisSlots SMALLINT(6) NOT NULL,
SNMPVersion VARCHAR(2) NOT NULL DEFAULT '2c',
GlobalID int(11) NOT NULL DEFAULT 0,
ShareToRepo tinyint(1) NOT NULL DEFAULT 0,
KeepLocal tinyint(1) NOT NULL DEFAULT 0,
PRIMARY KEY (TemplateID),
UNIQUE KEY ManufacturerID (ManufacturerID,Model)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_EscalationTimes
--
DROP TABLE IF EXISTS fac_EscalationTimes;
CREATE TABLE fac_EscalationTimes (
EscalationTimeID int(11) NOT NULL AUTO_INCREMENT,
TimePeriod varchar(80) NOT NULL,
PRIMARY KEY (EscalationTimeID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_Escalations
--
DROP TABLE IF EXISTS fac_Escalations;
CREATE TABLE fac_Escalations (
EscalationID int(11) NOT NULL AUTO_INCREMENT,
Details varchar(80) NULL,
PRIMARY KEY (EscalationID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table `fac_GenericLog`
--
DROP TABLE IF EXISTS fac_GenericLog;
CREATE TABLE `fac_GenericLog` (
UserID varchar(80) NOT NULL,
Class varchar(40) NOT NULL,
ObjectID varchar(80) NOT NULL,
ChildID int(11) DEFAULT NULL,
Action varchar(40) NOT NULL,
Property varchar(40) NOT NULL,
OldVal varchar(255) NOT NULL,
NewVal varchar(255) NOT NULL,
Time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_Manufacturer
--
DROP TABLE IF EXISTS fac_Manufacturer;
CREATE TABLE fac_Manufacturer (
ManufacturerID int(11) NOT NULL AUTO_INCREMENT,
Name varchar(80) NOT NULL,
GlobalID int(11) NOT NULL DEFAULT 0,
SubscribeToUpdates int(1) NOT NULL DEFAULT 0,
PRIMARY KEY (ManufacturerID),
UNIQUE KEY Name (Name)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table `fac_Ports`
--
DROP TABLE IF EXISTS fac_Ports;
CREATE TABLE fac_Ports (
DeviceID int(11) NOT NULL,
PortNumber int(11) NOT NULL,
Label varchar(40) NOT NULL,
MediaID int(11) NOT NULL DEFAULT '0',
ColorID int(11) NOT NULL DEFAULT '0',
ConnectedDeviceID int(11) DEFAULT NULL,
ConnectedPort int(11) DEFAULT NULL,
Notes varchar(80) NOT NULL,
PRIMARY KEY (DeviceID,PortNumber),
UNIQUE KEY LabeledPort (DeviceID,PortNumber,Label),
UNIQUE KEY ConnectedDevice (ConnectedDeviceID,ConnectedPort),
KEY Notes (Notes)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table `fac_MediaTypes`
--
DROP TABLE IF EXISTS fac_MediaTypes;
CREATE TABLE IF NOT EXISTS fac_MediaTypes (
MediaID int(11) NOT NULL AUTO_INCREMENT,
MediaType varchar(40) NOT NULL,
ColorID INT(11) NOT NULL,
PRIMARY KEY (mediaid),
UNIQUE KEY mediatype (mediatype)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci AUTO_INCREMENT=1;
--
-- Table structure for table fac_PanelSchedule
--
DROP TABLE IF EXISTS fac_PanelSchedule;
CREATE TABLE fac_PanelSchedule (
PanelID int(11) NOT NULL AUTO_INCREMENT,
PolePosition int(11) NOT NULL,
NumPoles int(11) NOT NULL,
Label varchar(80) NOT NULL,
PRIMARY KEY (PanelID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_PDUStats
--
DROP TABLE IF EXISTS fac_PDUStats;
create table fac_PDUStats(
PDUID int(11) NOT NULL,
Wattage int(11) NOT NULL,
LastRead datetime DEFAULT NULL,
PRIMARY KEY (PDUID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_People
--
DROP TABLE IF EXISTS fac_People;
CREATE TABLE fac_People (
PersonID int(11) NOT NULL AUTO_INCREMENT,
UserID varchar(255) NOT NULL,
LastName varchar(40) NOT NULL,
FirstName varchar(40) NOT NULL,
Phone1 varchar(20) NOT NULL,
Phone2 varchar(20) NOT NULL,
Phone3 varchar(20) NOT NULL,
Email varchar(80) NOT NULL,
APIKey varchar(80) NOT NULL,
AdminOwnDevices tinyint(1) NOT NULL,
ReadAccess tinyint(1) NOT NULL,
WriteAccess tinyint(1) NOT NULL,
DeleteAccess tinyint(1) NOT NULL,
ContactAdmin tinyint(1) NOT NULL,
RackRequest tinyint(1) NOT NULL,
RackAdmin tinyint(1) NOT NULL,
BulkOperations tinyint(1) NOT NULL,
SiteAdmin tinyint(1) NOT NULL,
APIToken varchar(80) NOT NULL,
Disabled tinyint(1) NOT NULL,
PRIMARY KEY(PersonID),
UNIQUE KEY UserID (UserID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_PowerConnection
--
DROP TABLE IF EXISTS fac_PowerConnection;
CREATE TABLE fac_PowerConnection (
PDUID int(11) NOT NULL,
PDUPosition VARCHAR(11) NOT NULL,
DeviceID int(11) NOT NULL,
DeviceConnNumber int(11) NOT NULL,
UNIQUE KEY PDUID (PDUID,PDUPosition),
UNIQUE KEY DeviceID (DeviceID,DeviceConnNumber)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_PowerDistribution
--
DROP TABLE IF EXISTS fac_PowerDistribution;
CREATE TABLE fac_PowerDistribution (
PDUID int(11) NOT NULL AUTO_INCREMENT,
Label varchar(40) NOT NULL,
CabinetID int(11) NOT NULL,
TemplateID int(11) NOT NULL,
IPAddress varchar(254) NOT NULL,
SNMPCommunity varchar(50) NOT NULL,
FirmwareVersion varchar(40) NOT NULL,
PanelID int(11) NOT NULL,
BreakerSize int(11) NOT NULL,
PanelPole varchar(20) NOT NULL,
InputAmperage int(11) NOT NULL,
FailSafe tinyint(1) NOT NULL,
PanelID2 int(11) NOT NULL,
PanelPole2 varchar(20) NOT NULL,
PRIMARY KEY (PDUID),
KEY CabinetID (CabinetID),
KEY PanelID (PanelID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_PowerPanel
--
DROP TABLE IF EXISTS fac_PowerPanel;
CREATE TABLE fac_PowerPanel (
PanelID int(11) NOT NULL AUTO_INCREMENT,
PanelLabel varchar(80) NOT NULL,
NumberOfPoles int(11) NOT NULL,
MainBreakerSize int(11) NOT NULL,
PanelVoltage int(11) NOT NULL,
NumberScheme varchar(10) NOT NULL DEFAULT "Sequential",
ParentPanelID int(11) NOT NULL,
ParentBreakerName varchar(80) NOT NULL,
PanelIPAddress varchar(30) NOT NULL,
TemplateID int(11) NOT NULL,
MapDataCenterID INT(11) NOT NULL,
MapX1 INT(11) NOT NULL,
MapX2 INT(11) NOT NULL,
MapY1 INT(11) NOT NULL,
MapY2 INT(11) NOT NULL,
PRIMARY KEY (PanelID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Create new table for power ports
--
DROP TABLE IF EXISTS fac_PowerPorts;
CREATE TABLE fac_PowerPorts (
DeviceID int(11) NOT NULL,
PortNumber int(11) NOT NULL,
Label varchar(40) NOT NULL,
ConnectedDeviceID int(11) DEFAULT NULL,
ConnectedPort int(11) DEFAULT NULL,
Notes varchar(80) NOT NULL,
PRIMARY KEY (DeviceID,PortNumber),
UNIQUE KEY LabeledPort (DeviceID,PortNumber,Label),
UNIQUE KEY ConnectedDevice (ConnectedDeviceID,ConnectedPort),
KEY Notes (Notes)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_RackRequest
--
DROP TABLE IF EXISTS fac_RackRequest;
CREATE TABLE fac_RackRequest (
RequestID int(11) NOT NULL AUTO_INCREMENT,
RequestorID int(11) NOT NULL,
RequestTime datetime NOT NULL,
CompleteTime datetime NOT NULL,
Label varchar(40) NOT NULL,
SerialNo varchar(40) NOT NULL,
MfgDate date NOT NULL,
AssetTag varchar(40) NOT NULL,
Hypervisor varchar(40) NOT NULL,
Owner int(11) NOT NULL,
DeviceHeight int(11) NOT NULL,
EthernetCount int(11) NOT NULL,
VLANList varchar(80) NOT NULL,
SANCount int(11) NOT NULL,
SANList varchar(80) NOT NULL,
DeviceClass varchar(80) NOT NULL,
DeviceType varchar(23) NOT NULL DEFAULT "Server",
LabelColor varchar(80) NOT NULL,
CurrentLocation varchar(120) NOT NULL,
SpecialInstructions text NOT NULL,
PRIMARY KEY (RequestID),
KEY RequestorID (RequestorID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_Tags
--
DROP TABLE IF EXISTS fac_Tags;
CREATE TABLE fac_Tags (
TagID int(11) NOT NULL AUTO_INCREMENT,
Name varchar(128) NOT NULL,
PRIMARY KEY (`TagID`),
UNIQUE KEY `Name` (`Name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
INSERT INTO fac_Tags VALUES (NULL, 'Report');
INSERT INTO fac_Tags VALUES (NULL , 'NoReport');
--
-- Table structure for table fac_VMInventory
--
DROP TABLE IF EXISTS fac_VMInventory;
CREATE TABLE fac_VMInventory (
VMIndex int(11) NOT NULL AUTO_INCREMENT,
DeviceID int(11) NOT NULL,
LastUpdated datetime NOT NULL,
vmID int(11) NOT NULL,
vmName varchar(80) NOT NULL,
vmState varchar(80) NOT NULL,
Owner int(11) NOT NULL,
PrimaryContact int(11) NOT NULL,
PRIMARY KEY (VMIndex),
UNIQUE KEY `VMList` (`vmID`, `vmName`),
KEY ValidDevice (DeviceID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table structure for table fac_Zone
--
DROP TABLE IF EXISTS fac_Zone;
CREATE TABLE fac_Zone (
ZoneID int(11) NOT NULL AUTO_INCREMENT,
DataCenterID int(11) NOT NULL,
Description varchar(120) NOT NULL,
MapX1 int(11) NOT NULL,
MapY1 int(11) NOT NULL,
MapX2 int(11) NOT NULL,
MapY2 int(11) NOT NULL,
MapZoom int(11) DEFAULT '100' NOT NULL,
PRIMARY KEY (ZoneID),
KEY DataCenterID (DataCenterID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for fac_SupplyBin
--
DROP TABLE IF EXISTS fac_SupplyBin;
CREATE TABLE fac_SupplyBin (
BinID int(11) NOT NULL AUTO_INCREMENT,
Location varchar(40) NOT NULL,
PRIMARY KEY (BinID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for fac_Supplies
--
DROP TABLE IF EXISTS fac_Supplies;
CREATE TABLE fac_Supplies (
SupplyID int(11) NOT NULL AUTO_INCREMENT,
PartNum varchar(40) NOT NULL,
PartName varchar(80) NOT NULL,
MinQty int(11) NOT NULL,
MaxQty int(11) NOT NULL,
PRIMARY KEY (SupplyID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for fac_BinContents
--
DROP TABLE IF EXISTS fac_BinContents;
CREATE TABLE fac_BinContents (
BinID int(11) NOT NULL,
SupplyID int(11) NOT NULL,
Count int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for fac_BinAudits
--
DROP TABLE IF EXISTS fac_BinAudits;
CREATE TABLE fac_BinAudits (
BinID int(11) NOT NULL,
UserID int(11) NOT NULL,
AuditStamp datetime NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
--
-- Table structure for fac_CabinetToolTip
--
DROP TABLE IF EXISTS fac_CabinetToolTip;
CREATE TABLE fac_CabinetToolTip (
SortOrder smallint(6) DEFAULT NULL,
Field varchar(20) NOT NULL,
Label varchar(30) NOT NULL,
Enabled tinyint(1) DEFAULT '1',
UNIQUE KEY Field (Field)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Add base ToolTip configuration options
--
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'AssetTag', 'Asset Tag', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'ChassisSlots', 'Number of Slots in Chassis:', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'DeviceID', 'Device ID', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'DeviceType', 'Device Type', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'EscalationID', 'Details', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'EscalationTimeID', 'Time Period', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'VM Hypervisor', 'VM Hypervisor', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'InstallDate', 'Install Date', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'MfgDate', 'Manufacture Date', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'NominalWatts', 'Nominal Draw (Watts)', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'Owner', 'Departmental Owner', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'Ports', 'Number of Data Ports', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'PowerSupplyCount', 'Number of Power Supplies', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'PrimaryContact', 'Primary Contact', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'PrimaryIP', 'Primary IP', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'Status', 'Device Status', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'SerialNo', 'Serial Number', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'SNMPCommunity', 'SNMP Read Only Community', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'TemplateID', 'Device Class', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'WarrantyCo', 'Warranty Company', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'WarrantyExpire', 'Warranty Expiration', 0);
INSERT INTO fac_CabinetToolTip VALUES(NULL, 'Weight', 'Weight', 1);
--
-- Add table for cdu tooltips
--
DROP TABLE IF EXISTS fac_CDUToolTip;
CREATE TABLE fac_CDUToolTip (
SortOrder smallint(6) DEFAULT NULL,
Field varchar(20) NOT NULL,
Label varchar(30) NOT NULL,
Enabled tinyint(1) DEFAULT '1',
UNIQUE KEY Field (Field)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Add base ToolTip configuration options
--
INSERT INTO fac_CDUToolTip VALUES(NULL, 'PanelID', 'Source Panel', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'PanelVoltage', 'Voltage', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'BreakerSize', 'Breaker Size', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'PanelPole', 'Panel Pole Number', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'InputAmperage', 'Input Amperage', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'Model', 'Model', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'IPAddress', 'IP Address', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'Uptime', 'Uptime', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'FirmwareVersion', 'Firmware Version', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'SNMPCommunity', 'SNMP Community', 0);
INSERT INTO fac_CDUToolTip VALUES(NULL, 'NumOutlets', 'Used/Total Connections', 0);
--
-- Table structure and insert script for table fac_Config
--
DROP TABLE IF EXISTS fac_Config;
CREATE TABLE fac_Config (
Parameter varchar(40) NOT NULL,
Value varchar(200) NOT NULL,
UnitOfMeasure varchar(40) NOT NULL,
ValType varchar(40) NOT NULL,
DefaultVal varchar(200) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO fac_Config VALUES
('Version','4.5','','',''),
('OrgName','PT VIO Intelligence Computer Facilities','Name','string','PT VIO Intelligence Computer Facilities'),
('ClassList','ITS, Internal, Customer','List','string','ITS, Internal, Customer'),
('SpaceRed','80','percentage','float','80'),
('SpaceYellow','60','percentage','float','60'),
('WeightRed','80','percentage','float','80'),
('WeightYellow','60','percentage','float','60'),
('PowerRed','80','percentage','float','80'),
('PowerYellow','60','percentage','float','60'),
('RackWarningHours', 4, 'Hours', 'integer', '4'),
('RackOverdueHours', 1, 'Hours', 'integer', '1'),
('CriticalColor','#cc0000','HexColor','string','#cc0000'),
('CautionColor','#cccc00','HexColor','string','#cccc00'),
('GoodColor','#0a0','HexColor','string','#0a0'),
('MediaEnforce', 'disabled', 'Enabled/Disabled', 'string', 'disabled'),
('OutlineCabinets', 'disabled', 'Enabled/Disabled', 'string', 'disabled'),
('LabelCabinets', 'disabled', 'Enabled/Disabled', 'string', 'disabled'),
('DefaultPanelVoltage','208','Volts','int','208'),
('annualCostPerUYear','200','Dollars','float','200'),
('Locale','en_US.utf8','TextLocale','string','en_US.utf8'),
('timezone', 'America/Chicago', 'string', 'string', 'America/Chicago'),
('PDFLogoFile','logo.png','Filename','string','logo.png'),
('PDFfont','Arial','Font','string','Arial'),
('SMTPServer','smtp.your.domain','Server','string','smtp.your.domain'),
('SMTPPort','25','Port','int','25'),
('SMTPHelo','your.domain','Helo','string','your.domain'),
('SMTPUser','','Username','string',''),
('SMTPPassword','','Password','string',''),
('MailFromAddr','DataCenterTeamAddr@your.domain','Email','string','DataCenterTeamAddr@your.domain'),
('MailSubject','ITS Facilities Rack Request','EmailSub','string','ITS Facilities Rack Request'),
('MailToAddr','DataCenterTeamAddr@your.domain','Email','string','DataCenterTeamAddr@your.domain'),
('ComputerFacMgr','DataCenterMgr Name','Name','string','DataCenterMgr Name'),
('NetworkCapacityReportOptIn', 'OptIn', 'OptIn/OptOut', 'string', 'OptIn' ),
('NetworkThreshold', '75', 'Percentage', 'integer', '75' ),
('FacMgrMail','DataCenterMgr@your.domain','Email','string','DataCenterMgr@your.domain'),
('InstallURL','','URL','string','https://dcim.your.domain'),
('UserLookupURL','https://','URL','string','https://'),
('HeaderColor', '#006633', 'HexColor', 'string', '#006633'),
('BodyColor', '#F0E0B2', 'HexColor', 'string', '#F0E0B2'),
('LinkColor', '#000000', 'HexColor', 'string', '#000000'),
('VisitedLinkColor', '#8D90B3', 'HexColor', 'string', '#8D90B3'),
('LabelCase','upper','string','string','upper'),
('mDate','blank','string','string','blank'),
('wDate','blank','string','string','blank'),
('NewInstallsPeriod', '7', 'Days', 'int', '7' ),
('VMExpirationTime','7','Days','int','7'),
('mUnits', 'english', 'English/Metric', 'string', 'english'),
('snmpwalk', '/usr/bin/snmpwalk', 'path', 'string', '/usr/bin/snmpwalk'),
('snmpget', '/usr/bin/snmpget', 'path', 'string', '/usr/bin/snmpget'),
('SNMPCommunity','public', 'string', 'string', 'public' ),
('cut', '/bin/cut', 'path', 'string', '/bin/cut'),
('ToolTips', 'Disabled', 'Enabled/Disabled', 'string', 'Disabled'),
('CDUToolTips', 'Disabled', 'Enabled/Disabled', 'string', 'Disabled'),
('PageSize', 'Letter', 'string', 'string', 'Letter'),
('path_weight_cabinet', '1', '', 'int', '1'),
('path_weight_rear', '1', '', 'int', '1'),
('path_weight_row', '4', '', 'int', '4'),
('TemperatureRed', '30', 'degrees', 'float', '30'),
('TemperatureYellow', '25', 'degrees', 'float', '25'),
('HumidityRedHigh', '75', 'percentage', 'float', '75'),
('HumidityRedLow', '35', 'percentage', 'float', '35'),
('HumidityYellowHigh', '55', 'percentage', 'float', '55'),
('HumidityYellowLow', '45', 'percentage', 'float', '45'),
('WorkOrderBuilder', 'disabled', 'Enabled/Disabled', 'string', 'Disabled'),
('RackRequests', 'enabled', 'Enabled/Disabled', 'string', 'Enabled'),
('dot', '/usr/bin/dot', 'path', 'string', '/usr/bin/dot'),
('AppendCabDC', 'disabled', 'Enabled/Disabled', 'string', 'Disabled'),
('APIUserID', '', 'Email', 'string', ''),
('APIKey', '', 'Key', 'string', ''),
('RequireDefinedUser', 'disabled', 'Enabled/Disabled', 'string', 'Disabled'),
('SNMPVersion', '2c', 'Version', 'string', '2c'),
('U1Position', 'Bottom', 'Top/Bottom', 'string', 'Bottom'),
('RCIHigh', '80', 'degrees', 'float', '80'),
('RCILow', '65', 'degress', 'float', '65'),
('FilterCabinetList', 'disabled', 'Enabled/Disabled', 'string', 'Disabled'),
('CostPerKwHr', '.25', 'Currency', 'float', '.25'),
('v3SecurityLevel', '', 'noAuthNoPriv/authNoPriv/authPriv', 'string', 'noAuthNoPriv'),
('v3AuthProtocol', '', 'SHA/MD5', 'string', 'SHA'),
('v3AuthPassphrase', '', 'Password', 'string', ''),
('v3PrivProtocol', '', 'SHA/MD5', 'string', 'SHA'),
('v3PrivPassphrase', '', 'Password', 'string', ''),
('PatchPanelsOnly','enabled', 'Enabled/Disabled', 'string', 'enabled'),
('LDAPServer', 'localhost', 'URI', 'string', 'localhost'),
('LDAPBaseDN', 'dc=opendcim,dc=org', 'DN', 'string', 'dc=opendcim,dc=org'),
('LDAPBindDN', 'cn=%userid%,ou=users,dc=opendcim,dc=org', 'DN', 'string', 'cn=%userid%,ou=users,dc=opendcim,dc=org'),
('LDAPBaseSearch', '(&(objectClass=posixGroup)(memberUid=%userid%))', 'DN', 'string', '(&(objectClass=posixGroup)(memberUid=%userid%))'),
('LDAPUserSearch', '(|(uid=%userid%))', 'DN', 'string', '(|(uid=%userid%))'),
('LDAPSessionExpiration', '0', 'Seconds', 'int', '0'),
('LDAPSiteAccess', 'cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPReadAccess', 'cn=ReadAccess,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=ReadAccess,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPWriteAccess', 'cn=WriteAccess,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=WriteAccess,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPDeleteAccess', 'cn=DeleteAccess,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=DeleteAccess,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPAdminOwnDevices', 'cn=AdminOwnDevices,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=AdminOwnDevices,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPRackRequest', 'cn=RackRequest,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=RackRequest,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPRackAdmin', 'cn=RackAdmin,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=RackAdmin,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPBulkOperations', 'cn=BulkOperations,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=BulkOperations,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPContactAdmin', 'cn=ContactAdmin,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=ContactAdmin,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('LDAPSiteAdmin', 'cn=SiteAdmin,cn=openDCIM,ou=groups,dc=opendcim,dc=org', 'DN', 'string', 'cn=SiteAdmin,cn=openDCIM,ou=groups,dc=opendcim,dc=org'),
('SAMLStrict', 'enabled', 'string', 'Enabled/Disabled', 'enabled'),
('SAMLDebug', 'disabled', 'string', 'Enabled/Disabled', 'disabled'),
('SAMLBaseURL', '', 'URL', 'string', 'https://opendcim.local'),
('SAMLShowSuccessPage', 'enabled', 'string', 'Enabled/Disabled', 'enabled'),
('SAMLspentityId', '', 'URL', 'string', 'https://opendcim.local'),
('SAMLspacsURL', '', 'URL', 'string', 'https://opendcim.local/saml/acs.php'),
('SAMLspslsURL', '', 'URL', 'string', 'https://opendcim.local'),
('SAMLspx509cert', '', 'string', 'string', ''),
('SAMLspprivateKey', '', 'string', 'string', ''),
('SAMLidpentityId', '', 'URL', 'string', 'https://accounts.google.com/o/saml2?idpid=XXXXXXXXX'),
('SAMLidpssoURL', '', 'URL', 'string', 'https://accounts.google.com/o/saml2/idp?idpid=XXXXXXXXX'),
('SAMLidpslsURL', '', 'URL', 'string', ''),
('SAMLidpcertFingerprint', '', 'string', 'string', 'FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF:FF'),
('SAMLidpcertFingerprintAlgorithm', '', 'string', 'string', 'sha1'),
('SAMLaccountPrefix', '', 'string', 'string', 'DOMAIN\\'),
('SAMLaccountSuffix', '', 'string', 'string', '@example.org')
;
--
-- Table structure for fac_DeviceCustomAttribute
--
DROP TABLE IF EXISTS fac_DeviceCustomAttribute;
CREATE TABLE fac_DeviceCustomAttribute(
AttributeID int(11) NOT NULL AUTO_INCREMENT,
Label varchar(80) NOT NULL,
AttributeType varchar(8) NOT NULL DEFAULT "string",
Required tinyint(1) NOT NULL DEFAULT 0,
AllDevices tinyint(1) NOT NULL DEFAULT 0,
DefaultValue varchar(65000),
PRIMARY KEY (AttributeID),
UNIQUE (Label)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for fac_DeviceTemplateCustomValue
--
DROP TABLE IF EXISTS fac_DeviceTemplateCustomValue;
CREATE TABLE fac_DeviceTemplateCustomValue (
TemplateID int(11) NOT NULL,
AttributeID int(11) NOT NULL,
Required tinyint(1) NOT NULL DEFAULT 0,
Value varchar(65000),
PRIMARY KEY (TemplateID, AttributeID)
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table structure for fac_DeviceCustomValue
--
DROP TABLE IF EXISTS fac_DeviceCustomValue;
CREATE TABLE fac_DeviceCustomValue (
DeviceID int(11) NOT NULL,
AttributeID int(11) NOT NULL,
Value varchar(65000),
PRIMARY KEY (DeviceID, AttributeID)
) ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for monitoring long running jobs
--
CREATE TABLE IF NOT EXISTS fac_Jobs (
SessionID varchar(80) NOT NULL,
Percentage int(11) NOT NULL DEFAULT "0",
Status varchar(255) NOT NULL,
PRIMARY KEY(SessionID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Tables for tracking Projects/ Services
--
DROP TABLE IF EXISTS fac_Projects;
CREATE TABLE fac_Projects (
ProjectID int(11) NOT NULL AUTO_INCREMENT,
ProjectName varchar(80) NOT NULL,
ProjectSponsor varchar(80) NOT NULL,
ProjectStartDate date NOT NULL,
ProjectExpirationDate date NOT NULL,
ProjectActualEndDate date NOT NULL,
PRIMARY KEY (ProjectID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS fac_ProjectMembership;
CREATE TABLE fac_ProjectMembership (
ProjectID int(11) NOT NULL,
MemberType varchar(7) NOT NULL DEFAULT 'Device',
MemberID int(11) NOT NULL,
PRIMARY KEY (`ProjectID`, `MemberType`, `MemberID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Tables for tracking how things leave
--
CREATE TABLE fac_Disposition (
DispositionID INT(11) NOT NULL AUTO_INCREMENT,
Name VARCHAR(80) NOT NULL,
Description VARCHAR(255) NOT NULL,
ReferenceNumber VARCHAR(80) NOT NULL,
Status VARCHAR(10) NOT NULL DEFAULT 'Active',
PRIMARY KEY (DispositionID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
CREATE TABLE fac_DispositionMembership (
DispositionID INT(11) NOT NULL,
DeviceID INT(11) NOT NULL,
DispositionDate DATE NOT NULL,
DisposedBy VARCHAR(80) NOT NULL,
PRIMARY KEY (DeviceID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INTO fac_Disposition VALUES ( 1, 'Salvage', 'Items sent to a qualified e-waste disposal provider.', '', 'Active');
INSERT INTO fac_Disposition VALUES ( 2, 'Returned to Customer', 'Item has been removed from the data center and returned to the customer.', '', 'Active');
--
-- Add a table of Status Field values to allow
--
CREATE TABLE fac_DeviceStatus (
StatusID INT(11) NOT NULL AUTO_INCREMENT,
Status varchar(40) NOT NULL,
ColorCode VARCHAR(7) NOT NULL,
PRIMARY KEY(StatusID)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=UTF8;
INSERT INTO fac_DeviceStatus (Status, ColorCode) VALUES ('Reserved', '#00FFFF');
INSERT INTO fac_DeviceStatus (Status, ColorCode) VALUES ('Test', '#FFFFFF');
INSERT INTO fac_DeviceStatus (Status, ColorCode) VALUES ('Development', '#FFFFFF');
INSERT INTO fac_DeviceStatus (Status, ColorCode) VALUES ('QA', '#FFFFFF');
INSERT INTO fac_DeviceStatus (Status, ColorCode) VALUES ('Production', '#FFFFFF');
INSERT INTO fac_DeviceStatus (Status, ColorCode) VALUES ('Spare', '#FFFFFF');
INSERT INTO fac_DeviceStatus (Status, ColorCode) VALUES ('Disposed', '#FFFFFF');
| true |
34a33d19b6596e5eb0efab526ac0b1b88e55b3b1 | SQL | MarcinCzekaj00/Spring-Social-REST-API | /src/main/resources/schema.sql | UTF-8 | 824 | 3.6875 | 4 | [] | no_license | DROP TABLE IF EXISTS authorities;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
username VARCHAR(45) NOT NULL,
password VARCHAR(70) NOT NULL,
enabled TINYINT NOT NULL DEFAULT 1,
PRIMARY KEY (username));
CREATE TABLE authorities (
user_role_id int(11) NOT NULL AUTO_INCREMENT,
username varchar(45) NOT NULL,
authority varchar(45) NOT NULL,
PRIMARY KEY (user_role_id),
UNIQUE KEY uni_username_role (authority,username),
KEY fk_username_idx (username),
CONSTRAINT fk_username FOREIGN KEY (username) REFERENCES users (username));
| true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.