sql
stringlengths
6
1.05M
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; CREATE TABLE IF NOT EXISTS `account` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NOT NULL, `de...
<gh_stars>1-10 DELETE FROM `labels` WHERE `module`='InstitutionSiteStudentAbsences' and`field`='security_user_id'; DELETE FROM `labels` WHERE `module`='StaffAbsences' and`field`='security_user_id'; DELETE FROM `labels` WHERE `module`='StudentAttendances' and`field`='security_user_id'; DELETE FROM `labels` WHERE `module...
ALTER EXTENSION postgis_tiger_geocoder ADD function count_words(character varying); ALTER EXTENSION postgis_tiger_geocoder ADD function create_census_base_tables(); ALTER EXTENSION postgis_tiger_geocoder ADD function cull_null(character varying); ALTER EXTENSION postgis_tiger_geocoder ADD function diff_zip(character va...
# ************************************************************ # Sequel Pro SQL dump # Version 4541 # # http://www.sequelpro.com/ # https://github.com/sequelpro/sequelpro # # Host: 127.0.0.1 (MySQL 5.5.5-10.3.12-MariaDB) # Database: c2 # Generation Time: 2019-03-17 18:00:31 +0000 # *************************************...
-- -- PostgreSQL database dump -- -- Dumped from database version 10.18 (Ubuntu 10.18-2.heroku1+1) -- Dumped by pg_dump version 10.19 (Ubuntu 10.19-0ubuntu0.18.04.1) SET statement_timeout = 0; SET lock_timeout = 0; SET idle_in_transaction_session_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_stri...
create table HibClassA ( id int not null, name varchar(255) null, hibClassB_id int null, primary key (id) ) lock datarows GO create table HibClassA_AUD ( id int not null, REV int not null, REVTYPE tinyint null, name varchar(255) null, hibClassB...
create extension if not exists "uuid-ossp";
<reponame>Axlgrep/postgres -- -- COPY -- -- directory paths are passed to us in environment variables \getenv abs_srcdir PG_ABS_SRCDIR \getenv abs_builddir PG_ABS_BUILDDIR -- CLASS POPULATION -- (any resemblance to real life is purely coincidental) -- \set filename :abs_srcdir '/data/agg.data' COPY aggtest FROM :'fil...
drop table if exists t; drop table if exists temp; drop table if exists t__p__p101; drop table if exists t__p__p102; create table t(t timestamp,v varchar(100)) partition by list(last_day(t)) ( partition p0 values in ('1970-3-31'), partition p1 values in ('1971-2-28'), partition p2 values in ('1972-2-29'), partition p3...
select firstname, lastname, city, state from Person left join Address on Person.personid=Address.personid;
CREATE TABLE IF NOT EXISTS `tblTask` ( `TaskID` int(11) NOT NULL AUTO_INCREMENT, `CompanyID` int(11) NOT NULL, `UsersIDs` int(11) NOT NULL, `AccountIDs` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL, `BoardID` int(11) NOT NULL, `BoardColumnID` int(11) NOT NULL, `BackGroundColour` varchar(50) COLLATE ut...
CREATE NONCLUSTERED INDEX [IX_OpportunityItem_OpportunityId_IsSaved_IsCompleted_IsDeleted] ON [dbo].[OpportunityItem] ([OpportunityId],[IsSaved],[IsCompleted],[IsDeleted])
ALTER TABLE `team` ADD `lastAnswerTime` DATETIME NULL AFTER `endTime`, ADD `lastPingTime` DATETIME NULL AFTER `lastAnswerTime`, ADD `finalAnswerTime` DATETIME NULL AFTER `lastPingTime`; ALTER TABLE `history_team` ADD `lastAnswerTime` DATETIME NULL AFTER `endTime`, ADD `lastPingTime` DATETIME NULL AFTER `lastAnswerTime`...
<filename>Gufos/M_03_MuriloMilani_DQL.sql Use M_Gufos Select * from Categorias Select * from Usuarios Select * from Eventos Select * from Presencas Select * from Categorias order by IdCategoria asc; Select * from Categorias order by IdCategoria desc; Select * from Eventos order by Titulo asc; Select * from Usua...
/*!40101 SET NAMES binary*/; /*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40103 SET TIME_ZONE='+00:00' */; INSERT INTO `wp_users` VALUES (1,"rupalt","$P$BzoNQHEp9j/wmzBUjY/5tGEhcSJRy40","rupalt","<EMAIL>","","2018-06-27 03:05:52","",0,"Rupal"), (2,"Yash","$P$B/Tqo6hAVXVweSumjC1CCSrv6heHRR.","yash","<EMAIL>","","2018-07-22 0...
<filename>db/schema.sql DROP DATABASE IF EXISTS company; CREATE DATABASE company; USE company; DROP TABLE IF EXISTS employee; DROP TABLE IF EXISTS roles; DROP TABLE IF EXISTS department; CREATE TABLE department ( id INTEGER(11) AUTO_INCREMENT PRIMARY KEY, name VARCHAR(30) NOT NULL ); CREATE TABLE roles ( id IN...
/* All Queries to Produce trafficSense experimental tables from imported OSM data. -------------------------------------- -- WARNING: ALPHA VERSION -------------- -------------------------------------- (c) 2014.10 Aalto University v: 2014.10.29a Contact <EMAIL> for any more info, suggestions, etc. */ ...
DELETE p1 FROM Person p1, Person p2 WHERE p1.Email = p2.Email AND p1.Id > p2.Id; OR with x AS ( SELECT id ,ROW_NUMBER() OVER(PARTITION BY EMAIL ORDER BY ID ASC) AS RN FROM PERSON) DELETE FROM Person WHERE id IN ( SELECT id FROM x WHERE RN >1)
CREATE TABLE usuario ( codigo INTEGER AUTO_INCREMENT PRIMARY KEY, nick VARCHAR(50) NOT NULL, email VARCHAR(50) NOT NULL, senha VARCHAR(72) NOT NULL, avatar VARCHAR(72) NOT NULL, musica BOOLEAN NOT NULL); CREATE TABLE reputacao ( id_usuario INTEGER NOT NULL, pontuacao INTEGER NOT NULL, FOREIGN KEY (id...
drop table has_favorites; drop table has_video; drop table has_zone; drop table send_comment; drop table has_comment; drop table upload_video; drop table has_tag; drop table sort_video; drop table likes; drop table user_relationship; drop table visit; drop table send_message; drop table GET_MESSAGE; drop table users; ...
CREATE TABLE member_history ( guild_id BIGINT NOT NULL, member_id BIGINT NOT NULL, version_at TIMESTAMP NOT NULL, tag TEXT, nick TEXT, PRIMARY KEY (guild_id, member_id, version_at) );
-- -- PostgreSQL database dump -- SET statement_timeout = 0; -- SET lock_timeout = 0; -- SET idle_in_transaction_session_timeout = 0; -- SET client_encoding = 'UTF8'; -- -- SET standard_conforming_strings = on; -- SELECT pg_catalog.set_config('search_path', '', false); -- SET check_function_bodies = false; -- SET xmlo...
<gh_stars>10-100 -- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 5.1.63-community - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL version: 7.0.0.4053 -- Date/time: 201...
-- -- Indexes for dumped tables -- -- -- Indexes for table `dictionary_webster1913_definitions` -- ALTER TABLE `dictionary_webster1913_definitions` ADD PRIMARY KEY (`definition_id`), ADD KEY `word_id` (`word_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `dictionary_webster1913_d...
<reponame>BearerPipelineTest/sqlc<gh_stars>1000+ CREATE TABLE bar (id serial not null); CREATE TABLE foo (id serial not null, bar serial references bar(id)); -- name: TableName :one SELECT foo.id FROM foo JOIN bar ON foo.bar = bar.id WHERE bar.id = $1 AND foo.id = $2;
-- -- Table: #__finder_filters -- CREATE TABLE "#__finder_filters" ( "filter_id" serial NOT NULL, "title" character varying(255) NOT NULL, "alias" character varying(255) NOT NULL, "state" smallint DEFAULT 1 NOT NULL, "created" timestamp without time zone DEFAULT '1970-01-01 00:00:00' NOT NULL, "created_by" ...
CREATE TABLE regio_it.app_auth ( username character varying(255) NOT NULL, password character varying NOT NULL, tenant character varying(100) NOT NULL, token character varying, token_update_timestamp time with time zone, CONSTRAINT "PK_app_auth" PRIMARY KEY (username) );
<filename>sdks/java/testing/tpcds/src/main/resources/queries/query59.sql -- 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 --...
<reponame>lw-lin/incubator-ranger<gh_stars>0 -- 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...
DROP TABLE IF EXISTS `phpcms_mobile`; CREATE TABLE IF NOT EXISTS `phpcms_mobile` ( `siteid` smallint(5) unsigned NOT NULL DEFAULT '1', `sitename` varchar(100) NOT NULL, `logo` varchar(100) DEFAULT NULL, `domain` varchar(100) DEFAULT NULL, `status` tinyint(2) DEFAULT NULL, `keywords` varchar(100) DEFA...
<gh_stars>1-10 /****** Object: Table [T_AuxInfo_Category] ******/ /****** RowCount: 18 ******/ SET IDENTITY_INSERT [T_AuxInfo_Category] ON INSERT INTO [T_AuxInfo_Category] (ID, Name, Target_Type_ID, Sequence) VALUES (1000,'Lysis Method',500,2) INSERT INTO [T_AuxInfo_Category] (ID, Name, Target_Type_ID, Sequence) V...
-- // CB-3372 remove CDP 1.0 blueprints and templates -- Migration SQL that makes the change goes here. UPDATE blueprint SET status = 'DEFAULT_DELETED' WHERE status = 'DEFAULT' AND name LIKE 'CDP 1.0%'; UPDATE clustertemplate SET status = 'DEFAULT_DELETED' WHERE status = 'DEFAULT' AND name LIKE 'CDP 1.0%'; -- //@UND...
-- -- insert with DEFAULT in the target_list -- create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing'); insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT); insert into inserttest (col2, col3) values (3, DEFAULT); insert into inserttest (col1, col2, col3) values (D...
DROP TABLE IF EXISTS usuarios CASCADE; CREATE TABLE usuarios ( id bigserial PRIMARY KEY , numero varchar(255) NOT NULL UNIQUE , nombre varchar(255) , password varchar(64) ); DROP TABLE IF EXISTS citas CASCADE; CREATE TABLE citas ( id bigserial PRIMARY KEY , instante timestam...
<reponame>carobme/pgwatch2 -- small modifications to SQL from https://github.com/ioguix/pgsql-bloat-estimation -- NB! monitoring user needs SELECT grant on all tables or a SECURITY DEFINER wrapper around that SQL BEGIN; CREATE OR REPLACE FUNCTION get_table_bloat_approx_sql( OUT full_table_name text, OUT ap...
<reponame>MCYBA/holochain<filename>crates/holochain_sqlite/src/sql/cell/state_dump/dht_ops_in_validation_limbo.sql -- no-sql-format -- SELECT Header.blob as header_blob, Entry.blob as entry_blob, DhtOp.type as dht_type, DhtOp.hash as dht_hash, DhtOp.rowid as rowid FROM Header JOIN DhtOp ON DhtOp.header_ha...
<filename>sql/BookInfo_Author/Functions/FN_ParseAuthorIdList/FN_ParseAuthorIdList.drop.sql -- Drop the function 'FN_ParseAuthorIdList' in schema 'dbo' IF EXISTS ( SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE SPECIFIC_SCHEMA = N'dbo' AND SPECIFIC_NAME = N'FN_ParseAuthorIdList' ) DROP FUNCTION dbo.[FN_ParseAuthorI...
<reponame>Pirastrino/prisma-dbml-generator -- CreateEnum CREATE TYPE "Role" AS ENUM ('ADMIN', 'USER'); -- CreateTable CREATE TABLE "User" ( "id" SERIAL NOT NULL, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, "updatedAt" TIMESTAMP(3) NOT NULL, "email" TEXT NOT NULL, "name" TEXT, "...
<filename>src/main/resources/schema.sql create table if not exists Article ( id identity, title varchar(200), status int, type varchar(20) ); create table if not exists Task ( id identity, title varchar(200), priority int ); create table if not exists Event ( id identity, title varchar(200), categ...
<reponame>liangzi4000/grab-share-info<filename>sql/yjbb/600070.sql EXEC [EST].[Proc_yjbb_Ins] @Code = N'600070',@CutoffDate = N'2017-09-30',@EPS = N'0.25',@EPSDeduct = N'0',@Revenue = N'13.57亿',@RevenueYoy = N'122.77',@RevenueQoq = N'-0.68',@Profit = N'1.31亿',@ProfitYoy = N'2131.83',@ProfiltQoq = N'-22.18',@NAVPerUnit ...
<gh_stars>0 -- phpMyAdmin SQL Dump -- version 4.3.11 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: 02 Apr 2017 pada 02.43 -- Versi Server: 5.6.24 -- PHP Version: 5.6.8 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI...
<reponame>NataliaDe/speciald ALTER TABLE `dones_object` ADD COLUMN `type_damage` TEXT NOT NULL COMMENT 'Объект: тип повреждения' AFTER `object`; ALTER TABLE `dones_object` ADD COLUMN `avto_vid` INT NOT NULL DEFAULT '0' COMMENT 'Вид объекта "автотранспорт": поле "вид"=avtotransport_vid.id' AFTER `is_aps_influence`, ...
<gh_stars>0 CREATE TABLE `settleBook` ( `tower_end_num` varchar(42) DEFAULT NULL COMMENT '铁塔购电截止读数', `tower_end_num` varchar(42) DEFAULT NULL COMMENT '铁塔购电截止读数', `tower_end_num` varchar(42) DEFAULT NULL COMMENT '铁塔购电截止读数', `tower_end_num` varchar(42) DEFAULT NULL COMMENT '铁塔购电截止读数', `tower_end_num` varchar(4...
-------------------------------------------------------------------------------- -- REPORT FORM ----------------------------------------------------------------- -------------------------------------------------------------------------------- ----------------------------------------------------------------------------...
<filename>Databases & API sheet/click_lunch (7).sql -- phpMyAdmin SQL Dump -- version 4.8.3 -- https://www.phpmyadmin.net/ -- -- Host: localhost -- Generation Time: Apr 15, 2019 at 01:59 PM -- Server version: 5.6.41 -- PHP Version: 7.0.32 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; S...
<gh_stars>0 DROP TABLE IF EXISTS user_authority; DROP TABLE IF EXISTS authority; DROP TABLE IF EXISTS users; CREATE TABLE users ( id BIGINT IDENTITY PRIMARY KEY, username VARCHAR, password VARCHAR, firstname VARCHAR, lastname VARCHAR ); CREATE TABLE authority ( id BIGINT IDENTITY ...
<reponame>painel-dlx/confpag-dlx<filename>bd/gateway-pagamento.sql<gh_stars>0 drop table if exists confpag.GatewayPagamento; create table confpag.GatewayPagamento ( gateway_pagamento_id int not null primary key auto_increment, nome varchar(100) not null, usuario_id int not null references dlx.Usuario (usuar...
/* Navicat MySQL Data Transfer Source Server : 123 Source Server Version : 50713 Source Host : localhost:3306 Source Database : template Target Server Type : MYSQL Target Server Version : 50713 File Encoding : 65001 Date: 2016-11-10 01:07:58 */ SET FOREIGN_KEY_CHECKS=0; -- ------...
--liquibase formatted sql --changeset jhr:6 CREATE TABLE SITD.PRINCIPAL_ROLE ( PRINCIPAL CHAR(36) NOT NULL, ROLE VARCHAR(32) NOT NULL, CONSTRAINT PRINCIPAL_ROLE_PK PRIMARY KEY (PRINCIPAL, ROLE) ); CREATE INDEX SITD.PRINCIPAL_IDX ON SITD.PRINCIPAL_ROLE (PRINCIPAL); CREATE INDEX SITD.PR_ROLE_IDX ON SITD.PR...
INSERT ALL WHEN SAL > 10000 THEN INTO sal_history VALUES(EMPID,HIREDATE,SAL) WHEN MGR > 200 THEN INTO mgr_history VALUES(EMPID,MGR,SAL) SELECT employee_id EMPID,hire_date HIREDATE, salary SAL, manager_id MGR FROM employees WHERE employee_id > 200 /
<filename>database/create.sql CREATE TABLE IF NOT EXISTS user ( id INTEGER PRIMARY KEY, userName TEXT UNIQUE, hash TEXT NOT NULL ); CREATE TABLE IF NOT EXISTS container ( id INTEGER PRIMARY KEY, data TEXT NOT NULL, passwordSalt TEXT NOT NULL, initializationVector TEXT NOT NULL, cipher TEXT NOT NU...
<reponame>makyo/ideawheel drop table if exists auth_users; create table auth_users ( id integer primary key autoincrement, username text unique not null, hashword text not null, salt integer not null, email text not null, display_name text default '', blurb text default '', artist_type text default 'thinker of ...
<gh_stars>1-10 -- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64) -- -- Host: 192.168.20.20 Database: teste -- ------------------------------------------------------ -- Server version 5.5.60-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULT...
<gh_stars>1-10 DROP INDEX IF EXISTS ux_users_username; DROP INDEX IF EXISTS ux_users_email; CREATE UNIQUE INDEX ux_users_username ON public.user(username); CREATE UNIQUE INDEX ux_users_email ON public.user(lower(email));
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: 09-Out-2019 às 05:11 -- Versão do servidor: 10.1.38-MariaDB -- versão do PHP: 7.3.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @O...
SELECT L.CODFILIAL, L.TIPOLANC, L.RECNUM, L.DTLANC, L.DTCOMPETENCIA COMPETENCIA, L.CODCONTA, C.CONTA, L.TIPOPARCEIRO TIPO, L.CODFORNEC, F.FORNECEDOR, L.HISTORICO, L.VALOR, L.DTVENC FROM PCLANC L, PCFORNEC F, PCCONTA C WHERE F.CODFORN...
<filename>Redgate/Stored Procedures/dbo.usp_Jira_Refresh_Update_End.sql SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO -- ============================================= -- Author: <NAME> -- Create date: 2019-09-12 -- Description: Sets the end time of a Jira refresh -- =========================================...
CREATE TABLE aaa ( id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, a VARCHAR(16) NOT NULL, b VARCHAR(64) NOT NULL, c VARCHAR(16) NOT NULL ); -- Even though a name is given here ("xyz") the name that MySQL uses is "c" ALTER TABLE aaa ADD UNIQUE xyz (c, a, b);
<reponame>JeffBarnard/WingtipTicketsSaaS-DbPerTenant<gh_stars>10-100 CREATE PROCEDURE [dbo].[SaveLastCopiedRowVersion] ( -- Add the parameters for the stored procedure here @tableName nvarchar(50), @trackerKey nvarchar(50), @lastCopiedValue varchar(25), @runId nvarchar(max), @runTimeStamp datet...
create role r_TruongPhong; create role r_TruongChiNhanh; create role r_TruongDuAn; create role r_GiamDoc; create role r_NhanVien; grant r_TruongPhong to nv001, nv002, nv003, nv004, nv005, nv006, nv007, nv008, nv009, nv010, nv011, nv012, nv013, nv014, nv015; grant r_TruongChiNhanh to nv016, nv017, nv018, nv019, nv020; ...
-- ********************************************************************* -- Update Database Script -- ********************************************************************* -- Change Log: 2020_05_13_diff.xml -- Ran at: 5/13/20, 9:14 PM -- Against: hobbify@jdbc:postgresql://localhost:5432/hobbify_master -- Liquibase vers...
-- $Id$ INSERT INTO CAR_FUNCTIONALITY ( ID, DESCRIPTION, PATH, MENU_ID ) VALUES ('DisplayCDROperationsWithErrorsFunc', 'Chamadas/Eventos/Dados Com Erro', 'cellular/displayCdrOperationsWithErrors', 'CellularConsultMenu'); INSERT INTO CAR_FUNC_CLIENT (FUNC_ID,CLIENT_TYPE) Values ('DisplayCDROperationsWithErrorsFunc',-2...
<reponame>irrationalgenius/pantry-mac<filename>src/db/views/stats_visits_by_quarter.sql CREATE OR REPLACE VIEW pantry.stats_visits_by_quarter AS SELECT date_trunc('quarter'::text, guest_visits.date_visit::timestamp with time zone) AS visit_quarter, count(DISTINCT guest_visits.id) AS visits FROM pantry.guest_vis...
DROP TABLE IF EXISTS `spotter_archive`; CREATE TABLE `spotter_archive` ( `spotter_archive_id` int(11) NULL, `flightaware_id` varchar(25) NOT NULL, `ident` varchar(25) NOT NULL, `registration` varchar(25), `airline_name` varchar(255), `airline_icao` varchar(10), `airline_country` varchar(255), `airline_...
CREATE TABLE scada ( uuid STRING, systemtime STRING, amplitude100 DOUBLE, amplitude500 DOUBLE, amplitude1000 DOUBLE, lownoise DOUBLE, midnoise DOUBLE, highnoise DOUBLE, amps DOUBLE, ipaddress STRING, host STRING, host_name STRING, macaddress STRING, endtime STRING, runti...
SELECT COUNT(*) FROM CORP.EMP WHERE JOB = 'CLERK';
<filename>tests/queries/0_stateless/01101_literal_column_clash.sql -- https://github.com/ClickHouse/ClickHouse/issues/9810 select cast(1 as String) from (select 1 as iid) as t1 join (select '1' as sid) as t2 on t2.sid = cast(t1.iid as String); -- even simpler cases select cast(7 as String), * from (select 3 "'String'"...
INSERT INTO dynamic_ks.dynamic_table(id, clust, udtList) VALUES(${id},{id: ${id}, "VALUE": 'value'},[{id: ${id}, "VALUE": 'value1'}, {id: ${id}, "VALUE": 'value2'}]);
ALTER TABLE "selfservice_settings_flows" ADD COLUMN "messages" json;
drop DATABASE grafana;
<gh_stars>100-1000 CREATE OR REPLACE FUNCTION delete_blob_meta(TEXT) RETURNS SETOF BIGINT AS $$ BEGIN RETURN QUERY WITH deleted AS ( DELETE FROM blobs_blobmeta WHERE "key" = $1 RETURNING * ) SELECT COUNT(*) FROM deleted; END $$ LANGUAGE plpgsql;
<reponame>thunder-/paprika<gh_stars>0 CREATE INDEX apy_dan_id_idx ON process_definitions_actions_properties (dan_id); CREATE INDEX apy_name_idx ON process_definitions_actions_properties (name); CREATE INDEX apy_dan_id_name_idx ON process_definitions_actions_properties (dan_id, name);
<filename>query_scripts/ficep_properties.sql -- phpMyAdmin SQL Dump -- version 5.1.0 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Creato il: Lug 02, 2021 alle 10:32 -- Versione del server: 10.4.19-MariaDB -- Versione PHP: 8.0.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:...
<filename>temple/YBlogTemple/content/YBlog.Core/wwwroot/db.sql USE [YBlog] GO /****** Object: Table [dbo].[Advertisement] Script Date: 8/23/2018 1:04:44 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Advertisement]( [Id] [int] IDENTITY(1,1) NOT NULL, [Createdate] [datetime] NOT NU...
<filename>queries/6 compare datasets.sql<gh_stars>0 with openMaps as( select * FROM ways_addresses ), cityOfPhoenix as( select *, trim(replace(replace(replace(upper(substr("ADDRESS",1,instr("ADDRESS",' ')-1)),' ',' '),' ',' '),' ',' ')) as "joinAddress", ...
INSERT INTO `com_terminal_users` (`terminal_id`, `user_id`, `company_id`) SELECT `sal_terminals`.`id` as `terminal_id`, `com_employee`.`id` as `user_id`, `com_companies`.`id` as `company_id` FROM `com_employee` JOIN `com_companies` on `com_employee`.`company_id` = `com_companies`.`id` JOIN `sal_terminals` on `com_em...
DROP PROCEDURE IF EXISTS `proc_get_eid_county_partners_details`; DELIMITER // CREATE PROCEDURE `proc_get_eid_county_partners_details` (IN C_id INT(11), IN filter_year INT(11), IN from_month INT(11), IN to_year INT(11), IN to_month INT(11)) BEGIN SET @QUERY = "SELECT `p`.name AS `partner`, ...
CREATE TRIGGER Products_AfterInsert_Trigger ON [BackOffice].[dbo].[Products] AFTER INSERT AS BEGIN DECLARE @h UNIQUEIDENTIFIER ; DECLARE @id varchar(10); DECLARE @name varchar(10); DECLARE @description varchar(15); SELECT @id = CONVERT(varchar, i.id) FROM inserted i; SELECT @name = i.name FROM inserted i; ...
CREATE TABLE `@shuipfcms@@zhubiao@` ( `id` mediumint(8) unsigned NOT NULL auto_increment, `catid` smallint(5) unsigned NOT NULL DEFAULT '0', `typeid` smallint(5) unsigned NOT NULL DEFAULT '0', `title` varchar(255) NOT NULL DEFAULT '', `style` varchar(24) NOT NULL DEFAULT '', `thumb` varchar(255) NOT NULL DE...
-- phpMyAdmin SQL Dump -- version 4.1.6 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Mar 04, 2017 at 02:10 PM -- Server version: 5.6.16 -- PHP Version: 5.5.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /...
DROP TABLE movies IF EXISTS; CREATE TABLE movies ( id VARCHAR(10), title VARCHAR(500), description VARCHAR(2000) );
create or replace function assert.get_test_errors() returns assert.error[] as $$ begin return ( SELECT COALESCE(array_agg(E.error), '{}') FROM assert.errors AS E WHERE test_id = assert.get_current_test_id() AND run_num = currval('assert.ru...
<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: 21 Sep 2018 pada 09.40 -- Versi Server: 5.7.23-0ubuntu0.18.04.1 -- PHP Version: 7.2.7-0ubuntu0.18.04.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SE...
<filename>localtests/datetime-to-timestamp/create.sql<gh_stars>1-10 drop table if exists gh_ost_test; create table gh_ost_test ( id int unsigned auto_increment, i int not null, ts0 timestamp default current_timestamp, ts1 timestamp, dt2 datetime, t datetime, updated tinyint unsigned default 0, primary...
SELECT VARP(VacationHours) AS [VARPVacation] -- 822.874 , VAR(VacationHours) AS [VARVacation] -- 826.192 , STDEVP(VacationHours) AS [STDEVPVacation] -- 28.686 , STDEV(VacationHours) AS [STDEVVacation] -- 28.744 , VARP(SickLeaveHours) AS [VARPSickHours] -- 211.140 , V...
drop table EMPLOYEE; drop table DEPARTMENT; drop table COMPANY;
-- You need to retrieve the ProfessorId from Professors table. INSERT INTO [dbo].[Students] ([Name], [RollNumber], [ProfessorId],[Fees]) VALUES ('AAA', 'A101', '99C2F1E8-87A3-4103-955B-EC728CE84F2F', 2000.56) GO INSERT INTO [dbo].[Students] ([Name], [RollNumber], [ProfessorId],[Fees]) VALUES ('BBB', 'A102', '65CA4196-...
<filename>source/sql/1001-CreateOrganization.sql<gh_stars>1-10 CREATE TABLE `Organization` ( Id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, `Name` varchar(200) not null, IsActive tinyint not null default 1 ); INSERT INTO Organization ( `Name` ) Values ( 'Axolotl' );
CREATE TABLE av_survey( Response_ID INTEGER NOT NULL PRIMARY KEY ,Start_Date TIMESTAMP WITH TIME ZONE NOT NULL ,End_Date TIMESTAMP WITH TIME ZONE NOT NULL ,Status VARCHAR(10) NOT NULL ,Source_Type VARCHAR(11) NOT NULL ,InteractPedestrian VARCH...
-- file:jsonb.sql ln:178 expect:true select '[{"b": "c"}, {"b": "cc"}]'::jsonb ->> 'z'
<gh_stars>100-1000 -- original: boundary1.test -- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test SELECT a FROM t1 WHERE rowid >= 4398046511103 ORDER BY x ;SELECT a FROM t1 WHERE rowid < 4398046511103 ORDER BY a ;SELECT a FROM t1 WHERE rowid < 4398046511103 ORDER BY a DESC ;SELECT a FROM t1 WHERE rowid < 4...
<filename>samples/databases/wide-world-importers/wwi-dw-ssdt/wwi-dw-ssdt/Integration/Stored Procedures/MigrateStagedOrderData.sql  CREATE PROCEDURE Integration.MigrateStagedOrderData WITH EXECUTE AS OWNER AS BEGIN SET NOCOUNT ON; SET XACT_ABORT ON; BEGIN TRAN; DECLARE @LineageKey int = (SELECT TOP(1)...
<reponame>jfreese816/ETL-Project -- Exported from QuickDBD: https://www.quickdatabasediagrams.com/ -- Link to schema: https://app.quickdatabasediagrams.com/#/d/S8OCBH -- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here. Drop table "covid_progression_California"; Drop table "...
<gh_stars>0 /* Navicat Premium Data Transfer Source Server : 本地 Source Server Type : MySQL Source Server Version : 80023 Source Host : localhost:3306 Source Schema : ddmysql Target Server Type : MySQL Target Server Version : 80023 File Encoding : 65001 Date: 07/07/20...
/* Navicat MySQL Data Transfer Source Server : 52 Source Server Version : 50158 Source Host : 192.168.0.52:3306 Source Database : cloud_note Target Server Type : MYSQL Target Server Version : 50158 File Encoding : 65001 Date: 2014-09-02 16:52:07 */ SET FOREIGN_KEY_CHECKS=0; DROP ...
/* * Copyright 2019-2029 geekidea(https://github.com/geekidea) * * 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 ...
CREATE EXTENSION citus;
INSERT INTO `station` VALUES (1, 'AQI', '安徽', '安庆'); INSERT INTO `station` VALUES (2, 'AQX', '安徽', '安庆西'); INSERT INTO `station` VALUES (3, 'BBU', '安徽', '蚌埠'); INSERT INTO `station` VALUES (4, 'BBN', '安徽', '蚌埠南'); INSERT INTO `station` VALUES (5, 'BZH', '安徽', '亳州'); INSERT INTO `station` VALUES (6, 'CBE', '安徽', '巢北'); ...
IF OBJECT_ID('inventory.get_return_type') IS NOT NULL DROP FUNCTION inventory.get_return_type; GO CREATE FUNCTION inventory.get_return_type(@checkout_id bigint) RETURNS national character varying(50) AS BEGIN RETURN ( SELECT TOP 1 inventory.checkout_details.transaction_type FROM inventory.checkout...
SELECT COUNT(a.reporting_period_ods_code) FROM (SELECT DISTINCT reporting_period_ods_code FROM (SELECT col2 AS reporting_period_ods_code, col6 AS reporting_period, "$path" AS s3key FROM raw_mi WHERE col1='HR' AND REGEXP_LIKE("$path",'Stats6_.{6}.dat$')...