sql stringlengths 6 1.05M |
|---|
<filename>config/db.sql
DROP DATABASE IF EXISTS p4blog;
CREATE DATABASE p4blog CHARACTER SET 'utf8';
USE p4blog;
-- ***** Tables for the Blog part *****
CREATE TABLE Posts
(
id SMALLINT(5) UNSIGNED PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(50) NOT NULL UNIQUE,
content LONGT... |
/****** Object: StoredProcedure [system_p].[GetShotInfoPreplotLineInfo] Script Date: 01.07.2019 19:40:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [system_p].[GetShotInfoPreplotLineInfo] (
@KeyList nvarchar(max)
)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result s... |
<reponame>NYCPlanning/civic-data-loader
-- create table to load csv from the nyc open data portal
DROP TABLE IF EXISTS nysdec_facilities_solidwaste;
CREATE TABLE nysdec_facilities_solidwaste (
Facility_Name text,
Location_Address text,
Location_Address2 text,
City text,
State text,
Zip_Code text,
County t... |
<gh_stars>1-10
CREATE TABLE [dbo].[dnn_Assemblies] (
[AssemblyID] INT IDENTITY (1, 1) NOT NULL,
[PackageID] INT NULL,
[AssemblyName] NVARCHAR (250) NOT NULL,
[Version] NVARCHAR (20) NOT NULL,
CONSTRAINT [PK_dnn_PackageAssemblies] PRIMARY KEY CLUSTERED ([AssemblyID] ... |
<filename>backend/prisma/migrations/20201231122158_init/migration.sql
-- CreateTable
CREATE TABLE "Project" (
"id" SERIAL,
"title" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL,
"email" TEXT NOT NULL,
"name" TEXT,
"password" TE... |
<reponame>semanticinsight/BIML-DataProvisioning-Framework<filename>BIML.Framework.RDBMS/SemanticInsight.Weave/SemanticInsight.SSISDB/semanticinsight/Stored Procedures/get_data_object_mapping_id.sql
CREATE procedure [semanticinsight].[get_data_object_mapping_id]
(
@@source_component_application_name nvarch... |
<reponame>zjustus/ShelbyArena<gh_stars>1-10
DECLARE @event_id int = 1086
/*
SELECT
reg.person_id,
phone.phone_number,
phone.sms_enabled
FROM dbo.evnt_registrant as reg
LEFT JOIN dbo.core_person_phone as phone on reg.person_id = phone.person_id
where profile_id = @event_id
*/
/** This updates phone numb... |
<filename>egov/egov-commons/src/main/resources/db/migration/main/V20160127144355__common_jpa_changes_revertfile.sql
ALTER TABLE Accountdetailtype Drop COLUMN version ;
ALTER TABLE Bank Drop COLUMN version ;
ALTER TABLE Bankbranch Drop COLUMN version ;
ALTER TABLE ChartOfACcountDetail Drop COLUMN ve... |
<filename>samples/applications/iot-smart-grid/Db/dbo/Stored Procedures/InsertMeterMeasurement.sql
CREATE PROCEDURE [dbo].[InsertMeterMeasurement]
@Batch AS dbo.udtMeterMeasurement READONLY,
@BatchSize INT
WITH NATIVE_COMPILATION, SCHEMABINDING
AS
BEGIN ATOMIC WITH (TRANSACTION ISOLATION LEVEL=SNAPSHOT, LANGUAGE=... |
<gh_stars>1-10
CREATE INDEX "userid_idx" on requests ("userid");
|
<filename>core/db/migrations/2.sql
ALTER TABLE `page` ADD UNIQUE KEY `time_insert` (`time_insert`);
ALTER TABLE `post` ADD UNIQUE KEY `time_insert` (`time_insert`);
ALTER TABLE `user` ADD UNIQUE KEY `time_insert` (`time_insert`);
|
drop database inholland;
create database inholland;
use inholland;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE TABLE IF NOT EXISTS `admin` (
`adminID` varchar(6) NOT NULL DEFAULT 'admin',
`password` varchar(45) NOT NULL DEFAULT '<PASSWORD>'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT... |
<reponame>fivetran-jamie/dbt_asana
with __dbt__CTE__asana_task_followers as (
with task_follower as (
select *
from `dbt-package-testing`.`dbt_jamie`.`stg_asana_task_follower`
),
asana_user as (
select *
from `dbt-package-testing`.`dbt_jamie`.`stg_asana_user`
),
agg_followers as (
se... |
<filename>src/test/resources/tpch_test_query/presto_new/query21.sql
select s_name, count(1) as numwait
from ( select s_name from ( select s_name, t2.orderkey, l_suppkey, countsuppkey, maxsuppkey
from ( select l.orderkey, count(l.suppkey) countsuppkey, max(l.suppkey) as maxsuppkey
from SCRAMBLE_SCHE... |
<reponame>shanghai-edu/oauth-server-lite<gh_stars>1-10
create database oauth
DEFAULT CHARACTER SET utf8mb4
DEFAULT COLLATE utf8mb4_general_ci;
USE oauth;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `oauth_access_token`;
CREATE TABLE `oauth_access_token` (
`id` int(10) UNSIGNED NOT NULL ... |
select date, count(*) c
from {{ ref('noaa_gsod') }}
group by 1
order by 1 desc
limit 10
|
<filename>db/Stored Procedures/UpdateDocument.sql<gh_stars>1-10
CREATE PROCEDURE [dbo].[UpdateDocument]
(
@ID UNIQUEIDENTIFIER,
@ParentID UNIQUEIDENTIFIER,
@Title NVARCHAR(128),
@Body NVARCHAR(max),
@Slug NVARCHAR(256),
@Username NVARCHAR(128),
@Tags [dbo].[TagList] READONLY,
@IsPublic... |
<filename>ddcms/sqlTemplate/articleType/index.sql
###ArticleType分页查询 带模糊查询功能
#sql("getPage")
SELECT * FROM dms_article_type
WHERE (
dms_article_type.name LIKE #para(searchKey)
)
AND
dms_article_type.create_time BETWEEN #para(dateStartStr) AND #para(dateEndStr)
#if(sortName!=null)
ORDER BY dms_ar... |
<gh_stars>1-10
#-- Copyright 2022 Google LLC
#--
#-- 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
#--
#-- https://www.apache.org/licenses/LICENSE-2.0
#--
#-- Unless required by applica... |
SELECT *
FROM t1 AS t1
WHERE EXISTS (SELECT 1
FROM t2 AS t2
WHERE t1.col1 = t2.col1);
|
CREATE OR REPLACE FUNCTION concat_array_elements(text[]) RETURNS TEXT AS $$
my $arg = shift;
my $result = "";
return undef if (!defined $arg);
# as an array reference
for (@$arg) {
$result .= $_;
}
# also works as a string
$result .= $arg;
return $result;
$$ LANGUAGE plper... |
/*
Navicat MySQL Data Transfer
Source Server : localhoat
Source Server Version : 50505
Source Host : localhost:3306
Source Database : arz
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2016-09-29 22:44:32
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... |
-- Restart DB
DELETE FROM credentials;
DELETE FROM platform;
DELETE FROM userbase;
DELETE FROM client;
DELETE FROM user_data;
DELETE FROM "user";
ALTER SEQUENCE credentials_id_seq RESTART WITH 1;
ALTER SEQUENCE platform_id_seq RESTART WITH 1;
ALTER SEQUENCE userbase_id_seq RESTART WITH 1;
ALTER SEQUENCE client_id_seq ... |
<reponame>Hamza-seniorDev/ci-wo
-- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 10.1.31-MariaDB - mariadb.org binary distribution
-- 服务器操作系统: Win32
-- HeidiSQL 版本: 9.5.0.5239
-- ----------------... |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 07, 2015 at 06:24 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 29-01-2018 a las 02:17:12
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 11 Nov 2016 pada 10.10
-- Versi Server: 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_CLIENT ... |
CREATE OR REPLACE PACKAGE TT_Timer_Set AS
/***************************************************************************************************
Name: tt_timer_set.pks Author: <NAME> Date: 29-Jan-2019
Package spec component in the Oracle timer_set_oracle module. This module facilita... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.3.11
-- Generation Time: Oct 31, 2020 at 05:36 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.3.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_... |
<gh_stars>10-100
-- file:alter_table.sql ln:1612 expect:true
create text search parser alter1.prs(start = prsd_start, gettoken = prsd_nexttoken, end = prsd_end, lextypes = prsd_lextype)
|
CREATE PROC dbo.CustomCheckTest_Get(@InstanceIDs VARCHAR(MAX)=NULL)
AS
SELECT DISTINCT Test
FROM dbo.CustomChecks cc
WHERE (EXISTS(SELECT 1
FROM STRING_SPLIT(@InstanceIDs,',') ss
WHERE ss.Value = cc.InstanceID)
OR @InstanceIDs IS NULL)
ORDER BY Test |
-- Note this procedure is not included in the regular build, it
-- is called during the post deployment process.
-- This is due to the fact it updates temporal tables, and SSDT
-- will throw up an error when this occurs, despite the fact we
-- have procedures to deactivate the temporal tables and reactivate
-- when ... |
select d.nom, tarif
from danse as d
inner join seance as s on d.idDanse=s.idSeance
where dateSeance between '2021-04-02' and '2021-04-05' |
<reponame>MBY381/RBAC0-TEST-DEMO
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2021/10/28 23:46:18 */
/*==============================================================*/
drop table ... |
<filename>v3.1/Database/dbo/Tables/EFormations.sql<gh_stars>0
CREATE TABLE [dbo].[EFormations]
(
--From MergedXSDs XSD
--From 'genericRailML' Namespace
[EFormationsId] BIGINT NOT NULL,
[Formation] SMALLINT NOT NULL,
CONSTRAINT [PK_EFormationsId] PRIMARY KEY CLUSTERED ([EFormationsId] ASC),
CONSTRAINT [FK_EForm... |
BEGIN TRANSACTION;
CREATE TABLE "Broker__c" (
sf_id VARCHAR(255) NOT NULL,
"Name" VARCHAR(255),
"Broker_Id__c" VARCHAR(255),
"Email__c" VARCHAR(255),
"Mobile_Phone__c" VARCHAR(255),
"Phone__c" VARCHAR(255),
"Picture__c" VARCHAR(255),
"Title__c" VARCHAR(255),
PRIMARY KEY (sf_id)
);
INSERT INTO "Broker__... |
DROP TABLE IF EXISTS `t_account_two_backup`;
CREATE TABLE `t_account_two_backup`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`amount` decimal(19, 2) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE = InnoDB;
|
ALTER DATABASE TIMEZONE UTC
ALTER DATABASE VALIDATION True
CREATE CLASS Entity EXTENDS V ABSTRACT
CREATE PROPERTY Entity.uuid String
ALTER PROPERTY Entity.uuid MANDATORY True
CREATE INDEX Entity.uuid UNIQUE_HASH_INDEX
CREATE PROPERTY Entity.name String
ALTER PROPERTY Entity.name MANDATORY True
CREATE INDEX Entity.name... |
CREATE TABLE cache (
-- entry key.
key VARCHAR NOT NULL,
-- time it was added.
expires_at TIMESTAMP NOT NULL,
-- value in the cache.
value VARCHAR NOT NULL,
PRIMARY KEY(key)
);
CREATE INDEX idx_cache_expires_at ON cache(expires_at); |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2017 at 08:26 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 14-10-2016 a las 17:51:20
-- Versión del servidor: 5.7.9
-- Versión de PHP: 5.6.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
<gh_stars>0
-- <Migration ID="b41d5dc3-220a-48ed-94f0-3cf453fe676e" />
GO
/**************************************************************************
** CREATED BY: <NAME>
** CREATED DATE: 2017.08.02
** CREATION: Create customer movie rentals table.
***************************************************************... |
<reponame>shyamalpunekar/animal-shelter-DAO
SET MODE PostgreSQL;
CREATE TABLE IF NOT EXISTS animal (
id int PRIMARY KEY auto_increment,
animalName VARCHAR,
); |
<filename>StarlingFeatherMXML4DIY/src/tests/sql/InsertError.sql<gh_stars>1-10
INSERT INTO main.testTable
(
foo, -- doesn't exist, so throws an error
colInt
)
VALUES
(
:colString,
:colInt
) |
<reponame>MartinKokesCz/playground
-- Adminer 4.2.1 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
CREATE DATABASE `nextras_orm_generator` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `nextras_orm_generator`;
CREATE TABLE `book` (
`id` int(... |
<gh_stars>1-10
REPLACE INTO ?:status_descriptions (`status_id`, `description`, `email_subj`, `email_header`, `lang_code`)
SELECT
status_id,
'În așteptare' as description,
'a fost creat.' as email_subj,
'Certificatul dvs. de cadou a fost creat cu succes. Vă rugăm să așteptați până când va fi activat.' as... |
<reponame>cbn-alpin/gefiproj-api
INSERT INTO public.utilisateur (id_u, nom_u, prenom_u, initiales_u, email_u, password_u, active_u)
VALUES (1, 'monnom', 'super', 'ms', '<EMAIL>',
'$pbkdf2-sha256$29000$fo8xBsD4f6.1FiLEeK/V.g$tAVL90p3.1hZilV7vDVci2hywMdoGrE5nVnFWsmtW4A', true);
INSERT INTO public.utilisateur (id_... |
<reponame>justinlimkz/omop-learn-aou<filename>sql/Cohorts/gen_mi_cohort.sql<gh_stars>1-10
/*
Construct the cohort table used in an example End-of-Life prediction Model
Inclusion criteria:
- Enrolled in 95% of months of training
- Enrolled in 95% of days during outcome window
*/
with
mi_dates as (
... |
-- MySQL dump 10.17 Distrib 10.3.22-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: demo
-- ------------------------------------------------------
-- Server version 10.3.22-MariaDB-0+deb10u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RES... |
<gh_stars>1-10
DROP INDEX time_points_pushed_at_index ON time_points;
|
-- Your SQL goes here
CREATE TABLE wbws_lists (
id SERIAL PRIMARY KEY,
parent_id INTEGER ,
channel_id INTEGER ,
book_id INTEGER ,
paragraph INTEGER ,
title VARCHAR(255) NOT NULL,
setting TEXT NOT NULL,
content JSON NOT NULL,
status TStatus... |
<gh_stars>1-10
-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: changelog.groovy
-- Ran at: 9/21/12 3:44 PM
-- Liquibase version: 2.0.1
-- ******************************************... |
/**
* <feature scope="SanteDB.Persistence.Data.ADO" id="20201214-01" name="Update:20201214-01" applyRange="1.1.0.0-1.2.0.0" invariantName="FirebirdSQL">
* <summary>Update: Add PURGED status key</summary>
* <remarks>Adds status key PURGED to the database</remarks>
* <isInstalled>select ck_patch('20201214-01') fro... |
<filename>oauth2-server/src/main/resources/data.sql
INSERT INTO `oauth_client_details` VALUES ('client1', 'resources1', 'secret', 'read,write', 'authorization_code', 'http://localhost:8080/client/test', 'ROLE_CLIENT', NULL, NULL, NULL, NULL);
INSERT INTO `oauth_client_details` VALUES ('client2', 'resources2', 'secret',... |
{% macro dbt__incremental_delete(schema, model) -%}
{%- set unique_key = model['config'].get('unique_key') -%}
{%- set identifier = model['name'] -%}
delete
from "{{ schema }}"."{{ identifier }}"
where ({{ unique_key }}) in (
select ({{ unique_key }})
from "{{ identifier }}__dbt_incremental_tmp"
)... |
<filename>setup/000-imbo.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS public.imageinfo (
"id" serial NOT NULL,
"user" character varying COLLATE pg_catalog."default" NOT NULL,
"imageIdentifier" character varying COLLATE pg_catalog."default" NOT NULL,
"size" integer NOT NULL,
"extension" character varying COLLATE ... |
<filename>dht.sql
-- MySQL dump 10.13 Distrib 5.7.25, for Linux (x86_64)
--
-- Host: 192.168.1.24 Database: dht
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.37-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... |
DROP DATABASE IF EXISTS moviePlanner_db;
CREATE DATABASE moviePlanner_db;
USE moviePlanner_db;
CREATE TABLE movies
(
id INT AUTO_INCREMENT NOT NULL,
movie VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
);
INSERT INTO movies (movie)
VALUES
("Superbad"),
("Hercules"),
("Titanic");
|
<gh_stars>0
USE [master];
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT * FROM sys.databases WHERE name = 'School')
DROP DATABASE School;
GO
-- Create the School database.
CREATE DATABASE School;
GO
-- Specify a simple recovery model
-- to keep the log growth to a minimum.
ALTER DATABASE S... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 17 Jun 2021 pada 06.36
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.2.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<reponame>precog-iiitd/Signals_Matter_TheWebConf_2019
SELECT id, creation_date, last_access_date, up_votes, down_votes, reputation, views
FROM [bigquery-public-data:stackoverflow.users]
|
<reponame>manureta/segmentacion
/*
titulo: finciones.sql
descripción: funciones pra operar sobre manzanas y circuitos
autor: -h
fecha: 2019-04-28 Do
*/
create or replace function manzana(
frac integer,
radio integer,
mza integer)
-- obtiene subllistado con solo la manzana del listado
-- solo el lado, hn... |
<filename>db/users.sql
CREATE USER `capture_shoe_boxes`@'localhost' IDENTIFIED BY '<PASSWORD>';
CREATE USER `diff_shoe_boxes`@'localhost' IDENTIFIED BY '<PASSWORD>';
CREATE USER `is_exist_researcher_api`@'localhost' IDENTIFIED BY '<PASSWORD>';
GRANT INSERT ON is_exist_researcher.capture TO `capture_shoe_boxes`@'localh... |
<filename>Revising the select query II.sql
SELECT CITY.name
FROM CITY
WHERE POPULATION >120000
AND COUNTRYCODE = "USA"; |
<gh_stars>1-10
ALTER TABLE users
ADD COLUMN last_billing_ts TIMESTAMPTZ NOT NULL DEFAULT NOW();
|
INSERT INTO books (title)
VALUES ("Les Fleurs Du Mal"),
("Livro do Desassossego"),
("Leaves of Grass");
INSERT INTO books (title,devoured)
VALUES ("Castelos de Raiva", true),
("Mensagem", true),
("Mrs. Dalloway", true) |
CREATE TABLE IF NOT EXISTS user (
user_id INTEGER PRIMARY KEY,
user_name TEXT,
descrip TEXT,
cookies INTEGER
);
CREATE TABLE IF NOT EXISTS guild (
guild_id INTEGER PRIMARY KEY,
guild_name TEXT,
prefix TEXT,
mod_mail INTEGER,
log_channel INTEGER
); |
WITH startbuffer AS (
SELECT System.Timestamp() AS timestamp, MIN(grocery_items) AS GroceryItems, COUNT(*) AS count
FROM deviceinput
WHERE grocery_items < 4
GROUP BY TUMBLINGWINDOW(s, 10)
),
startbase AS (
SELECT timestamp, GroceryItems
FROM startbuffer
... |
<gh_stars>1-10
/*
1635. Hopper Company Queries I
Hard
SQL Schema
Table: Drivers
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| driver_id | int |
| join_date | date |
+-------------+---------+
driver_id is the primary key for this table.
Each row of this table contains the d... |
/*!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... |
<filename>packages/acs-templating/sql/oracle/template-demo-notes-sample.sql
declare
security_context_root acs_objects.object_id%TYPE;
default_context acs_objects.object_id%TYPE;
registered_users acs_objects.object_id%TYPE;
unregistered_visitor acs_objects.object_id%TYPE;
owning_party ... |
/************************************************/
/* Database cleanup script */
/************************************************/
-- =============================================
-- Delete all content from database
-- =============================================
delete from membership... |
<filename>src/db/add_image.sql
-- name: add-image!
INSERT INTO Image(Id, Origin, Filter) VALUES (:uuid, :origin, :filter);
|
#getByRemarkId
SELECT rem_id, rde_description, rde_order FROM {schema}.remark_description rem_desc WHERE rem_desc.rem_id=? ORDER BY rem_desc.rde_order ASC;
|
-- MODULE XTS735
-- SQL Test Suite, V6.0, Interactive SQL, xts735.sql
-- 59-byte ID
-- TEd Version #
-- AUTHORIZATION CTS1
SELECT USER FROM HU.ECCO;
-- RERUN if USER value does not match preceding AUTHORIZATION comment
ROLLBACK WORK;
-- date_time print
-- TEST:7035 INSERT National character l... |
-- @testpoint:opengauss关键字passing(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists passing;
create database passing;
drop database passing;
--关键字带双引号-成功
drop database if exists "passing";
create database "passing";
drop database "passing";
--关键字带单引号-合理报错
drop database if exists 'passing';
create database 'passing';... |
create schema shipping_schema;
set current_schema='shipping_schema';
create node group ship_ng0 with (datanode1);
create table shipping_test_row (a int, b int, c text, d integer[]);
create table shipping_test_col (a int, b int, c text)with (orientation = column);
create table shipping_test_replicalte (a int, b int, c t... |
insert into teacher values (1, '<EMAIL>');
insert into teacher values (2, '<EMAIL>');
insert into student values (1, '<EMAIL>', 0);
insert into student values (2, '<EMAIL>', 0);
insert into student values (3, '<EMAIL>', 0);
insert into student values (4, '<EMAIL>', 1);
insert into student values (5, '<EMAIL>', 0);
inse... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 02, 2020 at 05:26 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>0
set search_path to raw, stage, working, campaign_finance;
show search_path;
select *
from working.pacs;
-- Per Walter via email 2020.10.02
insert into working.pacs (keep, pac_name, validated)
values
(True, 'Fair Fight', True),
(True, 'Fair Fight Inc', True),
(True, 'Fair Fight, Inc.', True);
... |
DROP DATABASE `votes_db`;
CREATE DATABASE IF NOT EXISTS `votes_db`;
USE `votes_db`;
CREATE TABLE IF NOT EXISTS `youth_vote` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`vote_counts` INT NOT NULL DEFAULT 0,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
`updated` DATETIME NOT NULL DEFAULT CURRENT_T... |
SET DEFINE OFF;
create or replace package afw_01_destn_evenm_notfb_pkg
authid current_user
is
type gty_destn is record
(
nom_formt varchar2 (200)
,adres_destn varchar2 (500)
,numr_telph_destn varchar2 (16)
);
type gta_destn is table of gty_destn;
function resdr (pnu_seqnc_destn... |
<reponame>lindsay-stevens/openclinica_sqldatamart
CREATE OR REPLACE FUNCTION openclinica_fdw.fdw_setup(
IN foreign_server_host_name TEXT,
IN foreign_server_host_address TEXT,
IN foreign_server_port TEXT,
IN foreign_server_database TEXT,
IN foreign_ser... |
drop table if exists gen_water;
drop sequence if exists gen_water_seq;
create sequence gen_water_seq;
create table gen_water as
select nextval('gen_water_seq') AS id
,0 AS way_area
,10 AS res
,ST_CollectionExtract(unnest(ST_ClusterWithin(way, 10)), 3)::geometry(MultiPolygon, 3857) as way
... |
<reponame>maquinon1612/BD<filename>EvaluableGrupoA/2019/06plsqlEjEvaluableGrupoA2019-answers.sql<gh_stars>1-10
-- -------------------------------------------------------------
-- EJERCICIO EVALUABLE PLSQL+triggers GRUPO A. 19.12.2019. SOLUCION
-- -------------------------------------------------------------
-- Alumn... |
<reponame>Rejanio/analises
---- Query usada para importar os dados via Big Query em https://basedosdados.org/dataset/br-tse-eleicoes/resource/7c47f0e4-c8ef-46fe-a61d-9179e5adab64
SELECT
*
FROM
`basedosdados.br_tse_eleicoes.resultados_candidato_municipio` AS r
LEFT JOIN (
SELECT
*
... |
-- rowid.test
--
-- execsql {
-- DELETE FROM t2 WHERE a!=2;
-- INSERT INTO t2(b) VALUES(111);
-- SELECT * FROM t2;
-- }
DELETE FROM t2 WHERE a!=2;
INSERT INTO t2(b) VALUES(111);
SELECT * FROM t2; |
with invoice_lines as (
select *,
jsonb_array_elements(lines_data) as lines
from {{ref('invoices')}} as i
), invoice_lines2 as (
select
il.customer_id,
il.invoice_id,
il.created_on,
lines ->> 'id' as line_id, -- this is the subscription_id if it is a subscription item
lines -> 'plan' ->> 'billing_scheme' as b... |
create view "postgres"._airbyte_test_normalization."nested_stream_with_c__column___with__quotes_ab2__dbt_tmp" as (
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
select
_airbyte_partition_hashid,
cast(currency as
varchar
) as currency,
_airbyte_emi... |
-- 2019-12-06T05:54:10.569Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstance... |
<filename>scripts/create_test_db.sql
CREATE DATABASE "gratipay-test" WITH OWNER = gratipay;
|
<filename>recipes/tables/item.sql
# item.sql
DROP TABLE IF EXISTS item;
#@ _CREATE_TABLE_
CREATE TABLE item
(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name CHAR(20),
colors ENUM('chartreuse','mauve','lime green','puce') DEFAULT 'puce',
PRIMARY KEY (id)
);
#@ _CREATE_TABLE_
|
CREATE DATABASE `matthew_eilar` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
CREATE TABLE `clients` (
`ClientId` int NOT NULL AUTO_INCREMENT,
`StylistId` int DEFAULT NULL,
`Name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`ClientId`)
) ENGINE=InnoDB AUTO_... |
insert into PUB_MENU (ID, HAS_CHILD, ICON, NODE, PARENT_ID, PATH, SORT, TITLE, IS_SHOW, REMARK)
values ('U000', 'Y', null, '0', null, null, 0, '运管顶级菜单', '1', null);
insert into PUB_MENU (ID, HAS_CHILD, ICON, NODE, PARENT_ID, PATH, SORT, TITLE, IS_SHOW, REMARK)
values ('U008', 'Y', 'fa fa-sun-o', '1', 'U000', null, 8... |
-- SelectCommand
-- 2015/04/14 Sandeep
SELECT
[CommandId]
FROM
[AsyncProcessingServiceStatusManagementTable]
WHERE
[Id] = @P1 |
CREATE OR REPLACE FUNCTION prom_api.matcher(labels jsonb)
RETURNS prom_api.matcher_positive
AS $func$
SELECT ARRAY(
SELECT coalesce(l.id, -1) -- -1 indicates no such label
FROM label_jsonb_each_text(labels-'__name__') e
LEFT JOIN _prom_catalog.label l
ON (l.key = e.ke... |
{% snapshot snap_0 %}
{{
config(
target_database=database,
target_schema=schema,
unique_key='iso3',
strategy='timestamp',
updated_at='snap_0_updated_at',
)
}}
select *, current_timestamp as snap_0_updated_at from {{ ref('model_0') }}
{% endsnapshot %} |
<filename>src/main/resources/db_scripts/postgres-rutherford-functions.sql
--
-- Merge and Delete Users
--
-- Authors: <NAME>, <NAME>
-- Last Modified: 2020-08-12
--
CREATE OR REPLACE FUNCTION mergeuser(targetuseridtokeep bigint, targetuseridtodelete bigint) RETURNS boolean
LANGUAGE plpgsql
AS $$
BEGIN
UPDATE assign... |
DROP INDEX IF EXISTS orders_date;
|
--==========================================================
--==========================================================
\set ECHO all
set current_schema = hw_es_multi_column_stats;
set default_statistics_target=-2;
--========================================================== analyze t ((a, b))
select relname, relpag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.