sql stringlengths 6 1.05M |
|---|
--Annual targets for here1
INSERT INTO report.annual_target (service_provider, indicator, target, start_date, end_date) VALUES ((SELECT sp.id FROM report.dim_service_provider sp, report.dim_anm a WHERE sp.service_provider = a.id AND anmidentifier='here1'), (SELECT ID FROM report.dim_indicator WHERE indicator='ANC'),161... |
<filename>tests/queries/0_stateless/02293_grouping_function.sql<gh_stars>1000+
SELECT
number,
grouping(number, number % 2, number % 3) AS gr
FROM numbers(10)
GROUP BY
GROUPING SETS (
(number),
(number % 2)
)
ORDER BY number, gr; -- { serverError BAD_ARGUMENTS }
-- { echoOn }
SELECT
... |
<reponame>photogamerun/weiwodb
-- database: presto; requires: com.facebook.presto.tests.ImmutableTpchTablesRequirements; tables: nation; groups: union;
SELECT count(*)
FROM nation
UNION ALL
SELECT sum(n_nationkey)
FROM nation
GROUP BY n_regionkey
UNION ALL
SELECT n_regionkey
FROM nation
|
-- migrate:up
CREATE OR REPLACE FUNCTION slugify("value" TEXT)
RETURNS TEXT AS $$
-- from https://www.kdobson.net/2019/ultimate-postgresql-slug-function/
-- removes accents (diacritic signs) from a given string --
WITH "unaccented" AS (
SELECT unaccent("value") AS "value"
),
-- lowercases the string
"l... |
<reponame>devrsi0n/graphql-engine<gh_stars>1-10
DROP INDEX hdb_catalog.event_log_delivered_idx;
DROP INDEX hdb_catalog.event_log_created_at_idx;
/* This index powers `fetchEvents` */
CREATE INDEX event_log_fetch_events
ON hdb_catalog.event_log (locked NULLS FIRST, next_retry_at NULLS FIRST, created_at)
WHERE deliv... |
<reponame>sweetcolor/logistics
CREATE OR REPLACE
FUNCTION insert_fuels()
RETURNS INT AS
$$
BEGIN
INSERT INTO fuels (mark, price, created_at, updated_at) VALUES ('A-98', 26, now(), now());
INSERT INTO fuels (mark, price, created_at, updated_at) VALUES ('A-95+', 24, now(), now());
INSERT INTO fuels (mark, price,... |
<reponame>Zhaojia2019/cubrid-testcases<gh_stars>1-10
-- [er]create table ddl_0001, create serial no named ddl_0001_01,create an active trigger based on AFTER INSERT ON ddl_0001 event and use new object , serial no
CREATE CLASS ddl_0001(
col1 int unique,
col2 varchar(100) default '???' not null,
... |
UPDATE tokens SET permission=?, token=? WHERE user=?; |
<gh_stars>0
create or replace procedure unwrap_9i_v1(p_name VARCHAR2 := ' ') is
/*
CREATE GLOBAL TEMPORARY TABLE UW_SRC ( IDX NUMBER, SRC VARCHAR2(80),
CONSTRAINT "UW_SRC_PK" PRIMARY KEY ("IDX") ENABLE);
CREATE GLOBAL TEMPORARY TABLE UW_DIANA ( P NUMBER, IDX NUMBER, VAL NUMBER,
CONSTRAINT "UW_DIANA_PK" PR... |
<filename>queries/stackoverflow/q11/6c1a78c7bccea5ca00d484ed35276dc86a426779.sql
SELECT COUNT(*)
FROM
tag as t,
site as s,
question as q,
tag_question as tq
WHERE
t.site_id = s.site_id
AND q.site_id = s.site_id
AND tq.site_id = s.site_id
AND tq.question_id = q.id
AND tq.tag_id = t.id
AND (s.site_name in ('stackoverflow... |
<reponame>alittihadalislami/sim<gh_stars>0
INSERT INTO t_nilai_ijz (mapel_id, santri_id, tahun_id, nrp)
SELECT 12 AS mapel_id, i.`santri_id`, i.`tahun_id`, 85 AS nrp
FROM t_nilai_ijz i
WHERE i.`mapel_id` = 1 |
<filename>XML_WITH_XMLs/zestaw3_7.sql
UPDATE INVOICE_XML2
SET SYS_NC_ROWINFO$ = UPDATEXML(SYS_NC_ROWINFO$, '/Invoice/InvoiceLines/InvoiceLine/Track6[Genre="Metal"]/Unitprice/text()', '0.77')
where existsNode(SYS_NC_ROWINFO$, '//Invoice[@id<100]') = 1; |
CREATE PROCEDURE [dbo].[GetCommandArguments]
@CommandId uniqueidentifier = NULL
AS
BEGIN
SET NOCOUNT ON;
SELECT Position, ArgumentValue
FROM [dbo].[CommandArguments]
WHERE CommandID = @CommandId
ORDER BY Position ASC
END |
select max(ifnull(salary, 0)) as SecondHighestSalary
from employee
where salary != (select max(ifnull(salary, 0)) from employee) |
CREATE TABLE [crm].[DocTax] (
[DocTaxId] INT IDENTITY (1, 1) NOT NULL,
[DocTaxName] NVARCHAR (128) NULL,
[PdocTax] DECIMAL (18, 4) NULL,
[DebitDocAcc] NVARCHAR (10) NULL,
[CreditDocAcc] NVARCHAR (10) NULL,
CONSTRAINT [PK_DocTax] PRIMARY KEY CLUSTERED ([DocTaxId] ASC... |
-- phpMyAdmin SQL Dump
-- version 3.5.3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 02, 2019 at 10:53 AM
-- Server version: 5.1.62
-- PHP Version: 5.4.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
--
DROP TABLE FUNCTION_CODES;
--
CREATE TABLE FUNCTION_CODES
(
FUNCTION_NAME varchar(24) PRIMARY KEY,
FUNCTION_TYPE varchar(24),
CAN_UNIT_NAME varchar(24),
FUNCTION_CODE integer NOT NULL UNIQUE,
DESCRIPTION6 varchar(128) NOT NULL UNIQUE
);
|
<filename>ctci_v6/ch14/14.01_-_Multiple_Apartments/multiple_apartments.sql
SELECT TenantName
FROM Tenants
INNER JOIN (SELECT TenantID
FROM AptTenants
GROUP BY TenantID
HAVING count(*) > 1) A
ON Tenants.TenantID = A.TenantID
|
<reponame>carlosBrav/document-management-api<gh_stars>0
# --- !Ups
INSERT INTO `TIPO_DOCUMENTO` (`ID`, `NOMBRE_TIPO`,`FLAG1`,`FLAG2`, `FECHA_CREACION`, `FECHA_MODIFICACION`) values ('14545','EXPEDIENTE','0','P',CURRENT_TIMESTAMP,CURRENT_TIMESTAMP);
INSERT INTO `TIPO_DOCUMENTO` (`ID`, `NOMBRE_TIPO`,`FLAG1`,`FLAG2`, `FE... |
--Add new domain 'Regimen'
DO $$
DECLARE
z int;
ex int;
pDomain_id constant varchar(20):='Regimen';
pDomain_name constant varchar(255):= 'Treatment Regimen';
BEGIN
DROP SEQUENCE IF EXISTS v5_concept;
SELECT MAX (concept_id) + 1 INTO ex FROM concept WHERE concept_id >= 31967 AND concept_id ... |
create procedure [core].[utm_campaign_target_web_level5_sync]
as begin
set nocount on
declare @mt_dt datetime2(0) = sysdatetime()
declare @load_dt datetime2(0) = dateadd(dd, -3, @mt_dt)
drop table if exists #utm_campaign_target_web_level5
create table #utm_campaign_target_web_level5 (
utm_key bigint not null,... |
/* ---------------------------------------------------------------------- */
/* Script generated with: DeZign for Databases 12.1.0 */
/* Target DBMS: MS SQL Server 2017 */
/* Project file: S08_02_APP_CRT_V1.dez */
/* Project n... |
<gh_stars>0
-- Table edfilms.Assignment --
CREATE TABLE edfilms.Assignment (
AssignmentIdentifier VARCHAR(255) NOT NULL,
LMSSourceSystemDescriptorId INT NOT NULL,
Title VARCHAR(255) NOT NULL,
AssignmentCategoryDescriptorId INT NOT NULL,
AssignmentDescription VARCHAR(1024) NULL,
StartDateTime TIM... |
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `core_config_data_generated`;
SET foreign_key_checks = 1;
|
INSERT INTO FOO (DATA) VALUES ('Foo') WHERE NOT EXISTS (SELECT * FROM FOO WHERE DATA = 'Foo');
INSERT INTO FOO (DATA) VALUES ('Bar') WHERE NOT EXISTS (SELECT * FROM FOO WHERE DATA = 'Bar'); |
<filename>distro/sql/upgrade/cmmn/flowable.postgres.upgradestep.6200.to.6210.cmmn.sql
ALTER TABLE ACT_CMMN_CASEDEF ADD DGRM_RESOURCE_NAME_ VARCHAR(4000);
ALTER TABLE ACT_CMMN_CASEDEF ADD HAS_START_FORM_KEY_ BOOLEAN;
ALTER TABLE ACT_CMMN_DEPLOYMENT_RESOURCE ADD GENERATED_ BOOLEAN;
ALTER TABLE ACT_CMMN_RU_CASE_INST A... |
DROP TABLE IF EXISTS `log_activity_addon_mkt`;
DROP TABLE IF EXISTS `log_activity_app_mkt`;
DROP TABLE IF EXISTS `log_activity_attachment_mkt`;
DROP TABLE IF EXISTS `log_activity_comment_mkt`;
DROP TABLE IF EXISTS `log_activity_group_mkt`;
DROP TABLE IF EXISTS `log_activity_user_mkt`;
DROP TABLE IF EXISTS `log_activity... |
<gh_stars>0
-- @testpoint:opengauss关键字procedural(非保留),作为外部数据源名
--关键字不带引号-成功
drop data source if exists procedural;
create data source procedural;
drop data source procedural;
--关键字带双引号-成功
drop data source if exists "procedural";
create data source "procedural";
drop data source "procedural";
--关键字带单引号-合理报错
drop dat... |
-- phpMyAdmin SQL Dump
-- version 4.2.6deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 30, 2015 at 08:00 AM
-- Server version: 5.5.43-0ubuntu0.14.10.1
-- PHP Version: 5.5.12-2ubuntu4.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
<reponame>AlbertoHdezS/PC-Building-Database<filename>juegos.sql
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 19-06-2020 a las 16:18:22
-- Versión del servidor: 10.2.24-MariaDB
-- Versión de PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZER... |
<reponame>researchcode/PAtlasCo
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-06-2022 a las 02:31:04
-- Versión del servidor: 10.1.36-MariaDB
-- Versión de PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSA... |
delete from ReviewEntity;
delete from BookEntity_AuthorEntity;
delete from AuthorEntity;
delete from BookEntity;
delete from EditorialEntity;
insert into EditorialEntity (id, name) values (100,'<NAME>');
insert into EditorialEntity (id, name) values (200,'Siruela');
insert into BookEntity (id, name, isbn, im... |
CREATE TABLE IF NOT EXISTS Tournament (
tournament_id SERIAL NOT NULL PRIMARY KEY,
version INT,
name VARCHAR(32),
number_Of_Participants INT,
number_Of_Games INT,
is_Active BO... |
drop trigger IF EXISTS decrease_excursion_times_included;
create trigger decrease_excursion_times_included
after delete on main_tripdefinition_excursions for each row
update main_excursion set times_included = times_included - 1
where main_excursion.id = OLD.excursion_id;
|
<filename>query_pivot_table_ledger_uts.sql
SET SESSION group_concat_max_len = 10000;
SET @sql_dynamic = (
SELECT
GROUP_CONCAT(
CONCAT('b.`', y.id, '`') SEPARATOR ' + '
)
FROM (
SELECT
x.*,
(SELECT COUNT(*) FROM mapelgabungan WHERE mapelgabungan.mapel_id = x.id) as is_gabungan
FROM (
SELECT
... |
<gh_stars>0
-- medium with distinct discids more than X seconds apart
-- durations are computed on beginning of the last track.
-- Available as "Releases with conflicting disc IDs" report in MBS
-- 2020-09-16: 2061
WITH
mc AS (
SELECT
UNNEST(ARRAY_AGG(cdtoc)) AS cdtoc,
medium
FROM
medi... |
-- --------------
-- Label
-- --------------
CREATE TABLE IF NOT EXISTS `tbl_label` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`model_type` INTEGER,
`model_id` INTEGER,
`value` TEXT,
`maintainer` TEXT,
`created` DATETIME
);
CREATE INDEX `idx_label_model` ON `tbl_label` (`model_type`, `model_id`);
CREATE INDEX `... |
<reponame>ImKogan/MTA2014
-- Sets up database
-- usage: sudo -u postgres psql -f db_setup.sql
-- Change as you wish, but must match settings.ini in django app!
CREATE USER mta2014 WITH PASSWORD '<PASSWORD>';
CREATE DATABASE mta2014 OWNER mta2014;
-- change user
\c mta2014;
CREATE EXTENSION postgis;
|
<reponame>pashamur/pardex
EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON) SELECT count(*) FROM messages WHERE read='t';
|
create table r_level_2_head_of_level_2
(
borough_id NUMBER not null,
staff_id NUMBER not null,
row_version NUMBER default 0 not null,
constraint xpkr_level_2_head_of_level_2 primary key (borough_id, staff_id)
);
alter table r_level_2_head_of_level_2
add (constraint r_1365 fo... |
<reponame>tushartushar/dbSmellsData
SELECT COUNT(*) FROM meta_coord WHERE table_name='" + tableName + "'
select coord_system_id, name, version from coord_system where attrib like \"default_version%\" order by coord_system_id
SELECT method_link_id FROM method_link WHERE class LIKE 'ConstrainedElement.%')");
select logic... |
COPY departments FROM '/tmp/departments.csv' DELIMITER ',' CSV HEADER;
COPY employees FROM '/tmp/employees.csv' DELIMITER ',' CSV HEADER;
COPY dept_emp FROM '/tmp/dept_emp.csv' DELIMITER ',' CSV HEADER;
COPY dept_manager FROM '/tmp/dept_manager.csv' DELIMITER ',' CSV HEADER;
COPY salaries FROM '/tmp/salaries.csv' DELIM... |
CREATE TABLE songs (
id INTEGER PRIMARY KEY,
title TEXT,
artist TEXT,
mood TEXT,
duration INTEGER,
released INTEGER);
INSERT INTO songs (title, artist, mood, duration, released)
VALUES ("<NAME>", "Queen", "epic", 60, 1975);
INSERT INTO songs (title, artist, mood, duration, release... |
CREATE DATABASE `china`;
USE `china`;
CREATE TABLE social_credit (id varchar(32), credits int); |
<gh_stars>1000+
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Purchase_InOut_Customs_Details(IN c_order_id numeric);
CREATE OR REPLACE FUNCTION de_metas_endcustomer_fresh_reports.Docs_Purchase_InOut_Customs_Details(IN c_order_id numeric)
RETURNS TABLE
(
name character varying(255),
value characte... |
<filename>sql/ddl.sql
DROP TABLE device_identifier;
DROP TABLE device_model;
DROP TABLE user_session;
DROP TABLE users;
CREATE TABLE device_model
(
manufactur text NOT NULL,
model text NOT NULL,
name text NOT NULL,
description text NOT NULL,
CONSTRAINT "PK_DEVICE_MODEL" PRIMARY KEY (manufactur, model)
)
WIT... |
<filename>labs/lab10-11/Student.sql
--<NAME>, <NAME>, Anul 2
set serveroutput on;
declare
v_first boolean;
v_nr_linii integer;
begin
for x in (select * from user_tables) loop
if (x.nested = 'YES') then
dbms_output.put_line('Tabelul ' || x.table_name || ' are ' || x.num_rows || ' in... |
CREATE UNIQUE INDEX "PK_VPD_COLLECTION_LOCALITY" ON "VPD_COLLECTION_LOCALITY" ("COLLECTION_ID", "LOCALITY_ID")
|
<reponame>PPACI/hub<filename>database/migrations/functions/packages/get_package_summary.sql
-- get_package_summary returns some details for the provided package as a json
-- object.
create or replace function get_package_summary(p_input jsonb)
returns setof json as $$
declare
v_package_id uuid;
v_package_name t... |
<filename>resources/sql/autopatches/20150430.multimeter.2.host.sql
CREATE TABLE {$NAMESPACE}_multimeter.multimeter_host (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
name LONGTEXT COLLATE {$COLLATE_TEXT} NOT NULL,
nameHash BINARY(12) NOT NULL,
UNIQUE KEY `key_hash` (nameHash)
) ENGINE=InnoDB, COLLATE {... |
<gh_stars>100-1000
DROP TABLE IF EXISTS `tags`;
CREATE TABLE `tags`
(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(2000) DEFAULT NULL,
`type` VARCHAR(255) DEFAULT NULL,
`count` INT(11) DEFAULT NULL,
`created_date` DATETIME DEFAULT CURRENT_TIMESTAMP,
`u... |
-----------------------------------------------------------------------
-- $Id$
--
-- Copyright (c) 2009 <NAME> <<EMAIL>>
--
-- This is free software; you can redistribute and/or modify it under
-- the terms of the GNU General Public Licence. See the COPYING file.
-------------------------------------------------------... |
<gh_stars>10-100
CREATE OR REPLACE FUNCTION public.hasBeenInvited(attendee_row "Attendee")
RETURNS boolean
LANGUAGE plpgsql
STABLE
AS $function$
DECLARE
invite_id uuid;
BEGIN
IF (EXISTS (SELECT id INTO invite_id FROM "Invitation" WHERE "attendeeId" = attendee_row.id)) THEN
RETURN EXISTS (SELECT 1 FROM "Ema... |
<gh_stars>0
-- @testpoint: truncate table
drop table if exists alter_table_tb08;
create table alter_table_tb08
(
c1 int,
c2 bigint,
c3 varchar(20)
);
insert into alter_table_tb08 values('11',null,'sss');
insert into alter_table_tb08 values('21','','sss');
insert into alter_table_tb08 values('31',66,'');
insert into alt... |
<gh_stars>0
-- name: create-event<!
-- Create a new event
INSERT INTO event (task_id, success)
VALUES (:task::integer, :success::boolean)
-- name: get-event
-- Get an event by its ID
SELECT * FROM event WHERE event_id = :id::int
|
<gh_stars>0
CREATE DEFINER=`neon-user`@`localhost` PROCEDURE `prc_getAccountManager`(
IN `p_CompanyID` INT,
IN `p_CurrencyID` INT,
IN `p_StartDate` DATETIME,
IN `p_EndDate` DATETIME,
IN `p_UserID` VARCHAR(50),
IN `p_isAdmin` INT,
IN `p_ReportType` VARCHAR(50),
IN `p_lSortCol` VARCHAR(50),
IN `p_SortOrder` VARC... |
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 02, 2017 at 06:50 AM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
-- MySQL dump 10.13 Distrib 5.5.57, for debian-linux-gnu (x86_64)
--
-- Host: db658689442.db.1and1.com Database: db658689442
-- ------------------------------------------------------
-- Server version 5.5.57-0+deb7u1-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... |
/*
Warnings:
- Changed the type of `startTime` on the `Schedule` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- Changed the type of `endTime` on the `Schedule` table. No cast exists, the column would be dropped and recreate... |
prompt --application/set_environment
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Oracle... |
<filename>migrations/sqls/20190613044500-checkin-down.sql
/* Replace with your SQL commands */
DROP TABLE checkin;
DROP TABLE checkout;
DROP TABLE employees;
DROP TABLE admins; |
CREATE TABLE public.user_table (
userId serial NOT NULL,
user_name varchar(25) NOT NULL,
user_email varchar(64) NOT NULL,
user_password varchar(64) NOT NULL,
lisence_id int NULL
);
ALTER TABLE public.user_table ADD CONSTRAINT user_table_pk PRIMARY KEY (userId);
ALTER TABLE public.user_table ADD CONSTRAINT user_na... |
<reponame>viniputz/testeapp
show tables;
SELECT * FROM produtos; |
<reponame>apburnes/shared-vehicle-views
create extension postgis;
create extension "uuid-ossp";
create table shared_vehicles (
id uuid primary key default uuid_generate_v4(),
vehicle_id varchar,
name varchar,
last_reported timestamp,
location_id varchar,
location_type varchar,
system_id varchar,
... |
CREATE TABLE IF NOT EXISTS aws.glacier_vault (
id SMALLSERIAL,
region VARCHAR(20) NOT NULL,
vault_name VARCHAR(50) NOT NULL,
CONSTRAINT pk_aws_glacier_vault PRIMARY KEY (id),
CONSTRAINT uq_aws_glacier_vault$region$vault_name UNIQUE (region, vault_name)
);
GRANT SELECT
ON aws.glacier_vault
TO ... |
-- file:privileges.sql ln:958 expect:true
SELECT has_function_privilege('regress_user2', 'testns.foo()', 'EXECUTE')
|
<filename>egov/egov-works/src/main/resources/db/migration/main/V20160509120610__works_contractorbill_alter_table.sql
------------------START------------------
ALTER TABLE EGW_CONTRACTORBILL ALTER COLUMN CANCELLATIONREMARKS TYPE varchar(256);
-------------------END-------------------
--rollback ALTER TABLE EGW_CONTRACTO... |
<reponame>aadimanchanda/Azure_Synapse_Toolbox
/*
===============================
Node Memory Usage
===============================
The following query will show how much memory is currently in use by each
SQLDW node compared to the max for current DWU.
If memory utilization regularly hits it's limits ... |
<reponame>kalintsenkov/SoftUni-Software-Engineering
SELECT p.FirstName,
p.LastName,
p.Age
FROM Passengers AS p
LEFT JOIN Tickets AS t
ON t.PassengerId = p.Id
WHERE t.PassengerId IS NULL
ORDER BY p.Age DESC,
p.FirstName,
p.LastName
|
select t.json_document.title,
t.json_document.completed,
created_on
from todos t |
<reponame>cjporteo/sql-zoo-solns<gh_stars>0
SELECT institution, subject
FROM nss
WHERE question='Q15' AND score >= 100
|
<filename>tests/queries/0_stateless/02271_fix_column_matcher_and_column_transformer.sql<gh_stars>1000+
-- Tags: no-backward-compatibility-check:22.4.2
DROP TABLE IF EXISTS github_events;
CREATE TABLE github_events
(
`file_time` DateTime,
`event_type` Enum8('CommitCommentEvent' = 1, 'CreateEvent' = 2, 'DeleteEv... |
<filename>posda/posdatools/queries/sql/CreateNonDicomFileById.sql<gh_stars>1-10
-- Name: CreateNonDicomFileById
-- Schema: posda_files
-- Columns: []
-- Args: ['file_id', 'file_type', 'file_sub_type', 'collection', 'site', 'subject']
-- Tags: ['radcomp']
-- Description: Add a filter to a tab
insert into non_dicom_file... |
prompt --application/set_environment
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Oracle... |
with conversation_part_history as (
select *
from {{ var('conversation_part_history') }}
),
--Obtains the first and last values for conversations where the part type was close and part was authored by an admin.
conversation_admin_events as (
select
conversation_id,
first_value(author_id ignore nulls) ove... |
<reponame>suryatmodulus/pg_graphql
create or replace function graphql.build_delete(
ast jsonb,
variable_definitions jsonb = '[]',
variables jsonb = '{}'
)
returns text
language plpgsql
as $$
declare
result text;
block_name text = graphql.slug();
field_rec graphql.field = f
from... |
UPDATE creature_template SET ScriptName='boss_xt_002' WHERE entry=33293;
|
--
-- oxmxyadlvfjbdjQL database dump
--
-- Dumped from database version 10.7
-- Dumped by pg_dump version 11.2
-- Started on 2019-04-24 13:17:40
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_... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 26, 2021 at 09:01 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
<reponame>vov4uk/FinancistoAdapter
UPDATE account SET type='ELECTRONIC', card_issuer='PAYPAL' where type='PAYPAL';
|
<reponame>khoilr/lampart-interview
-- MySQL dump 10.13 Distrib 8.0.28, for macos12.2 (arm64)
--
-- Host: localhost Database: lampart
-- ------------------------------------------------------
-- Server version 8.0.28
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_R... |
drop database if exists bamazonDB;
create database bamazonDB;
use bamazonDB;
CREATE TABLE products(
item_id integer auto_increment not null,
product_name CHAR(50) not null,
department_name CHAR(50) not null,
price DECIMAL(10,2) NULL,
stock_quantaty INT UNSIGNED NULL,
primary key (item_id)
);
INSERT INTO prod... |
<filename>app/config_template/schema/management_report_views.sql
-- VISITS
DROP TABLE IF EXISTS `tmp_visits`;
CREATE TABLE `tmp_visits` AS
SELECT
`r`.`locatie_id`,
`r`.`klant_id`,
DATE(`r`.`binnen`) AS 'date',
`g`.`volledig` AS 'gender',
sum(TIME_TO_SEC(TIMEDIFF(`buiten`, `binnen`))) AS 'duration'
FROM `... |
SET foreign_key_checks = 0;
#
# TABLE STRUCTURE FOR: banners
#
DROP TABLE IF EXISTS `banners`;
CREATE TABLE `banners` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`image` text NOT NULL,
`banner` text NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1',
`created_by` int(11) NOT NULL,
`modified_by` int(11) NOT NU... |
<filename>Built in functions/2.sql
--2
USE SoftUni
GO
SELECT [FirstName], [LastName]
FROM [Employees]
WHERE [LastName] LIKE '%ei%'
|
<reponame>dkanunik/cyclopoid
-- MySQL dump 10.13 Distrib 8.0.15, for Linux (x86_64)
--
-- Host: localhost Database: cyclopoid
-- ------------------------------------------------------
-- Server version 8.0.15
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=... |
SELECT x.*
{% if not use_temp_table %}INTO {{ schema_name }}.{{ table_name_dedup }}{% endif %}
FROM {{ schema_name }}.{{ table_name }} x
INNER JOIN (
SELECT {{ group_cols }},
COUNT(*) AS dup_count
FROM {{ schema_name }}.{{ table_name }}
GROUP BY {{ group_cols }}
) y
... |
CREATE DATABASE IF NOT EXISTS shop
DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
use shop;
DROP TABLE IF EXISTS user;
CREATE TABLE user(
userID VARCHAR(20) default '' NOT NULL,
userPassword VARCHAR(20) default '' NOT NULL,
userName VARCHAR(20)default '' NOT NULL,
userAdd VARCHAR(50),
... |
<reponame>pezhmankasraee/axis
INSERT INTO recipe(id, name, people) VALUES(1, 'Baked Omelet With Broccoli & Tomato', 4);
INSERT INTO ingredient(id, name) VALUES(1, 'milk');
INSERT INTO ingredient(id, name) VALUES(2, 'cottage cheese');
INSERT INTO ingredient(id, name) VALUES(3, 'broccoli');
INSERT INTO ingredient(id, ... |
-- Run this, or portions of this, to upgrade from one
-- version to another. Newer entries are at the bottom.
-----------------------------------------------------------------------
-----------------------------------------------------------------------
--------------------------------------------------------------... |
<reponame>Fr4nc3/oracle-db-samples
--------------------------------------------------------
-- SHOW TABLESPACE FREE SPACE
--------------------------------------------------------
SELECT TABLESPACE_NAME,SUM(BYTES)/1024/1024/1024 "FREE SPACE(GB)" FROM DBA_FREE_SPACE GROUP BY TABLESPACE_NAME;
-- Displaying the Free S... |
<gh_stars>0
###############################################################################
#
# This is the test database used to test the form widgets.
#
INSERT INTO Contact
(name, address1, address2, city, state, zip, email_address,
phone_number, web_site, description, country)
VALUES
(... |
<reponame>hizulu/distributed-messaging-ZeroMQ-Pipeline
/*
SQLyog Ultimate
MySQL - 8.0.12 : Database - db_ta
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SE... |
DROP TABLE citations;
# Create new citations tables
CREATE TABLE citations
(
id INTEGER DEFAULT 0 NOT NULL,
citation_number VARCHAR(100) NULL,
citation_date DATE NULL,
first_name VARCHAR(50) NULL,
last_name VARCHAR(50) NULL,
date_of_birth... |
<filename>Portal/Binaries/Database/Tables/WebRegistry.create.sql<gh_stars>1-10
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WebRegistry]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[WebRegistry](
[RegistryId] [int] NOT NULL,
[Key] [n... |
CREATE TABLE IF NOT EXISTS rbac_roles (
id VARCHAR(36) NOT NULL PRIMARY KEY,
parent_id VARCHAR(36),
realm_id VARCHAR(100) NOT NULL,
organization_id VARCHAR(36) NOT NULL,
name VARCHAR(150) NOT NULL,
description TEXT,
created_by VARCHAR(36),
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_by VAR... |
IF NOT EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'api.koulutuksenkustannukset'))
EXEC dbo.sp_executesql @statement = N'
CREATE VIEW api.koulutuksenkustannukset AS
SELECT 1 AS a
'
GO
ALTER VIEW api.koulutuksenkustannukset AS
SELECT vuosi AS "Tilastovuosi"
,rekno AS "Sektori Koodi"
,d5.nimi AS... |
<reponame>UWIT-IAM/uw-redcap-client
-- Deploy seattleflu/schema:receiving/enrollment/processing-log to pg
-- requires: receiving/enrollment
begin;
alter table receiving.enrollment
add column processing_log jsonb not null default '[]'
constraint enrollment_processing_log_is_array
check (jsonb_t... |
CREATE TABLE DataLocation (
DataShard INTEGER NOT NULL,
PKey INTEGER NOT NULL
);
CREATE INDEX DataShardIndex ON DataLocation (DataShard);
|
<reponame>bartmika/mothership-server<filename>scripts/sql/0001_initial_down.sql<gh_stars>0
DROP TABLE users CASCADE;
DROP TABLE tenants CASCADE;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.