sql stringlengths 6 1.05M |
|---|
GO
PRINT N'Creating [Business].[Carrier]...';
GO
CREATE TABLE [Business].[Carrier] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[Name] NVARCHAR (3000) NOT NULL,
[NotificationId] UNIQUEIDENTIFIER NOT NULL CONSTRAINT FK_Carrier_Notification FOREIGN KEY REFERENCES [... |
<filename>src/Modules/SimplCommerce.Module.SampleData/SampleContent/ResetToSampleData_Postgres.sql
DELETE FROM "Cms_MenuItem";
DELETE FROM "Core_Entity";
DELETE FROM "ShoppingCart_CartItem";
DELETE FROM "ShoppingCart_Cart";
DELETE FROM "Payments_Payment";
DELETE FROM "Shipments_ShipmentItem";
DELETE FROM "Shipments_Sh... |
<reponame>joellabes/dbt-audit-helper
{% macro compare_column_values(a_query, b_query, primary_key, column_to_compare) %}
with a_query as (
{{ a_query }}
),
b_query as (
{{ b_query }}
),
joined as (
select
coalesce(a_query.{{ primary_key }}, b_query.{{ primary_key }}) as {{ primary_key }},
... |
<filename>src/main/resources/liquibase/harness/change/expectedSql/sqlite/dropDefaultValue.sql
INVALID TEST
Liquibase does not support dropping default value for Sqlite
-- See https://docs.liquibase.com/change-types/drop-default-value.html |
--
-- Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
--
-- WSO2 Inc. 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:... |
<gh_stars>1-10
select employee_id, "Emp #", last_name "Employee", job_id "Job", hire_date "Hire Date"
from employees
/
|
drop index if exists api_log_2018_idx;
drop index if exists api_log_2019_idx;
drop index if exists api_log_2020_idx;
drop index if exists api_log_2021_idx;
drop index if exists api_log_2022_idx;
drop index if exists api_log_2023_idx;
drop index if exists api_log_2024_idx;
drop index if exists api_log_2025_idx;
drop ind... |
call log('create_index.sql', 'begin');
call create_index('variant_results', 'hgvs_text');
call create_index('variant_results', 'gene');
call log('create_index.sql', 'done');
|
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Anamakine: localhost
-- Üretim Zamanı: 07 Tem 2020, 22:25:12
-- Sunucu sürümü: 8.0.17
-- PHP Sürümü: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
ALTER TABLE "speakers_speaker" ADD COLUMN "sessions_preference" integer; |
SELECT
u.id,
jsonb_agg(users_rights) AS rights
FROM
users u
LEFT JOIN users_rights ON u.id = users_rights.user_id
GROUP BY
u.id |
<filename>misc/reset-grault.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.14 (Ubuntu 10.14-0ubuntu0.18.04.1)
-- Dumped by pg_dump version 10.14 (Ubuntu 10.14-0ubuntu0.18.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding =... |
-- CreateTable
CREATE TABLE "_FavoriteHomes" (
"A" TEXT NOT NULL,
"B" TEXT NOT NULL
);
-- CreateIndex
CREATE UNIQUE INDEX "_FavoriteHomes_AB_unique" ON "_FavoriteHomes"("A", "B");
-- CreateIndex
CREATE INDEX "_FavoriteHomes_B_index" ON "_FavoriteHomes"("B");
-- AddForeignKey
ALTER TABLE "_FavoriteHomes" ADD ... |
CREATE DATABASE IF NOT EXISTS `edu_project` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_swedish_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `edu_project`;
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: edu_project
-- ---------------------------------------------------... |
customers = { id, full_name, email, password, phone, cpf, avatar, created_at, updated_at, active };
id int(11)
full_name varchar(50)
email varchar(50) UNIQUE
password varchar(60)
phone varchar(15)
cpf varchar(14)
avatar varchar(60)
created_at datetime
updated_at datetime
active int(1)
/* Structure of tabele `customer... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 19, 2021 at 11:22 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
<reponame>yasukit1414/sqlserverlinux
CREATE DATABASE GeoTest ON PRIMARY
( NAME = 'geo_file0', FILENAME = '/var/opt/mssql/data/geo_file0.mdf' , SIZE = 100MB , FILEGROWTH = 0 ),
Filegroup GeoFG
( NAME = 'geo_file1' , FILENAME = '/var/opt/mssql/data/geo_file1.ndf' , SIZE = 1GB , FILEGROWTH = 0 ),
( NAME = 'geo_fil... |
--
-- API Package Body for Seqfeature_Source.
--
-- Scaffold auto-generated by gen-api.pl (H.Lapp, 2002).
--
-- $Id: Seqfeature_Source.pkb,v 1.1.1.1 2002-08-13 19:51:10 lapp Exp $
--
--
-- Copyright 2002-2003 Genomics Institute of the Novartis Research Foundation
-- Copyright 2002-2008 <NAME>
--
-- This file is part... |
INSERT INTO pos_itemtemp VALUES("IATT190004262","193033","191001","192005","42000","1","42000","21000","21000","1","1","1","IAT1112190859","NHO2018000007","PAID","","193033"),
("IATT190004262","193054","191002","192010","20000","1","20000","0","20000","1","1","1","IAT1112190859","NHO2018000007","PAID","","193054"),
("I... |
<gh_stars>1-10
create table authorizations
(
id bigint NOT NULL,
access_token varchar(100),
secret_token varchar(100),
primary key (id)
); |
<reponame>NensiSkenderi/t-sql-scripts
--find products by searching by name
use NORTHWND
go
select * from Products;
create or alter procedure find_product_by_name(@prod_name varchar(100))
as
begin
--SET NOCOUNT ON; --ca esh kjo?
select * from Products
where ProductName = @prod_name;
end;
exec f... |
<gh_stars>1-10
-- Deploy procedures/generate_secret to pg
BEGIN;
CREATE FUNCTION generate_secret(
len int default 32,
symbols boolean default false
) RETURNS text
AS $$
DECLARE
v_set text;
v_bytea bytea;
v_output text;
x int;
y int;
b_index int;
BEGIN
v_set = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ... |
<reponame>James-Millan/BoeingHackathon
DROP TABLE IF EXISTS Users;
DROP TABLE IF EXISTS Pins;
DROP TABLE IF EXISTS Tags;
DROP TABLE IF EXISTS Contributions;
DROP TABLE IF EXISTS PinLikes;
DROP TABLE IF EXISTS ContributionLikes;
DROP TABLE IF EXISTS PinTags;
CREATE TABLE Users (
id INTEGER PRIMARY KEY AUTO... |
CREATE TABLE IF NOT EXISTS EnumeratedLocalWindowsUsersSettings (
EnumeratedLocalWindowsUsersSettings_ID INTEGER PRIMARY KEY,
EnumeratedWindowsUser_ID INTEGER NOT NULL,
WindowsLocalUserSettings_ID INTEGER NOT NULL,
UNIQUE (
EnumeratedWindowsUser_ID,
WindowsLocalUserSettings_ID
... |
<filename>src/test/resources/exclusive2.test_8.sql
-- exclusive2.test
--
-- execsql {PRAGMA cache_size}
PRAGMA cache_size |
-- file:plpgsql.sql ln:2984 expect:false
raise notice 'pl_qual_names.param1 = %', pl_qual_names.param1
|
-- Your SQL goes here
create or replace view notification_service_api.notification_templates as
select
ngt.label,
nt.subject,
nt.template,
nt.created_at,
ngt.subject as default_subject,
ngt.template as default_template
from notification_service.notification_gl... |
-- Copyright (c) Microsoft Corporation.
-- Licensed under the MIT License.
CREATE PROC [Persisted].[ObtainTitle] AS
-- ==============================================================================================================
-- Author: Adatis
-- Description: Performs a full data load. Incremental loads are not ... |
<gh_stars>100-1000
/*
* Tencent is pleased to support the open source community by making BK-JOB蓝鲸智云作业平台 available.
*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-JOB蓝鲸智云作业平台 is licensed under the MIT License.
*
* License for BK-JOB蓝鲸智云作业平台:
* ---------------------------... |
-- MySQL dump 10.13 Distrib 5.5.8, for Linux (x86_64)
--
-- Host: localhost Database: useradmin
-- ------------------------------------------------------
-- Server version 5.5.8
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... |
alter table award modify CFDA_NUMBER VARCHAR2(7); |
DELIMITER $$
CREATE OR REPLACE FUNCTION get_random_var_laplace(_sensitivity INT) RETURNS DECIMAL DETERMINISTIC
BEGIN
SET @_random = RAND() - 0.5;
SET @_var = 0 - ((_sensitivity / 0.03) * SIGN(@_random) * Log(1 - (2 * ABS(@_random))));
RETURN @_var;
end $$
DELIMITER ;
DROP PROCEDURE IF EXISTS average_salary... |
BEGIN;
UPDATE teams SET auth=json_build_object('admin', auth::json);
COMMIT;
|
--This script is used for unit test cases, DO NOT CHANGE!
DROP TABLE IF EXISTS User;
CREATE TABLE User (UserId LONG PRIMARY KEY AUTO_INCREMENT NOT NULL,
UserName VARCHAR(30) NOT NULL,
EmailAddress VARCHAR(30) NOT NULL);
CREATE UNIQUE INDEX idx_ue on User(UserName,EmailAddress);
INSERT INTO User (UserName, EmailAd... |
WITH tab AS (
SELECT t.cohort_definition_id,
t.subject_id,
t.cohort_start_date,
coalesce(min(o.cohort_start_date), max(t.cohort_end_date)) AS event_date,
CASE WHEN min(o.cohort_start_date) IS... |
<filename>Tellma.Database.Application/bll/Stored Procedures/bll.Users_Validate__Save.sql<gh_stars>1-10
CREATE PROCEDURE [bll].[Users_Validate__Save]
@Entities [UserList] READONLY,
@Roles [dbo].[RoleMembershipList] READONLY,
@Top INT = 200,
@IsError BIT OUTPUT
AS
BEGIN
SET NOCOUNT ON;
DECLARE @ValidationErrors [d... |
<reponame>Caprowni/concourse
ALTER TABLE resource_caches ADD COLUMN version_md5 text;
UPDATE resource_caches SET version_md5 = md5(version::text);
ALTER TABLE resource_caches ALTER COLUMN version_md5 SET NOT NULL;
DROP INDEX resource_caches_resource_config_id_version_params_hash_uniq;
CREATE UNIQUE INDEX resource_... |
<filename>env/postgres/initdb.d/02_projections_table.sql<gh_stars>10-100
CREATE TABLE projections (
no BIGSERIAL,
name VARCHAR(150) NOT NULL,
status VARCHAR(150) NOT NULL,
position JSONB,
state JSONB,
locked_until CHAR(26),
PRIMARY KEY (no),
UNIQUE (name)
);
|
-- Add support for UUID generation
CREATE EXTENSION "uuid-ossp";
CREATE TABLE messages (
id uuid primary key default uuid_generate_v4(),
body text not null,
created_at timestamp default now()
);
-- Setup connection permissions for chirp_messages
ALTER ROLE chirp_messages WITH LOGIN;
GRANT CONNECT ON DATAB... |
<reponame>karpikpl/DbEx
CREATE PROCEDURE [Test].[spGetContact]
@ContactId AS INT
AS
BEGIN
SET NOCOUNT ON;
SELECT * FROM [Test].[Contact] AS [c] WHERE [c].[ContactId] = @ContactId
END |
<filename>ujikom1.sql
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 24, 2017 at 11:42 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 7.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... |
<filename>scripts/015_delete_trigger.sql
DROP TRIGGER IF EXISTS sync_last_changed_password ON users;
CREATE TRIGGER sync_last_changed_password BEFORE UPDATE OF hashed_password ON users FOR EACH ROW EXECUTE PROCEDURE sync_last_changed_password();
|
<filename>sql/getCategories.sql<gh_stars>0
drop procedure if exists getCategories;
delimiter ;;
/*
* Get the categories of an article, ordered by the number of articles belonging to each one of them.
* If article_name is null, all categories are returned.
*/
create procedure getCategories(in article_name varchar(12... |
select distinct st.org_id,
hou.name "Org Name",
ve.segment1 "Supplier Number",
ve.vendor_name "Name",
ve.vendor_name_alt "Alternate Name",
ve.num_1099,
ve.type_1099,
ve.organization_type_lookup_code "Organization",
st.vendor_site_code "Site",
hz.... |
<reponame>jasonsie88/NYCU_DBMS_FP
create table outdoor_detail(
activity_id int NOT NULL,
name varchar(100) NOT NULL,
area varchar(15) NOT NULL,
address varchar(100) NOT NULL,
phone varchar(100) NOT NULL,
opening_hours varchar(100) NOT NULL,
PRIMARY KEY (activity_id)
);
create table indoor_d... |
<reponame>mubahood/buy-and-sell-2<filename>app2 (2).sql
-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 26, 2022 at 03:47 AM
-- Server version: 10.3.34-MariaDB
-- PHP Version: 7.3.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
ST... |
<reponame>NeveenBeiram/book_app
DROP TABLE IF EXISTS bookshelf;
CREATE TABLE bookshelf (
id SERIAL PRIMARY KEY,
author VARCHAR(255),
title VARCHAR(255),
isbn VARCHAR(255),
image_url VARCHAR(255),
description TEXT
);
-- INSERT INTO bookshelf
-- VALUES (a,b, value3,v4,v5);
INSERT INTO bookshelf (author, t... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.2
-- Dumped by pg_dump version 11.2
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', '', fal... |
<reponame>daemel/dicom-server<gh_stars>0
/****************************************************************************************
Guidelines to create migration scripts - https://github.com/microsoft/healthcare-shared-components/tree/master/src/Microsoft.Health.SqlServer/SqlSchemaScriptsGuidelines.md
This diff is bro... |
DROP PROCEDURE IF EXISTS `cartInfo`;
DELIMITER //
CREATE PROCEDURE cartInfo()
BEGIN
SELECT
`products`.`name`,
`products`.`price`,
`order`.`quantity`,
`products`.`price` * `order`.`quantity` AS `total`
FROM
`order`
JOIN
`products`
WHERE
`order`.product_id = `products`.product_id;... |
<reponame>szgabsz91/iit-www
insert into People values(
1,
(select ref(pi) from PersonInfos pi where pi.id = 1),
CarCollection(
(select ref(c) from Cars c where c.licensePlateNumber = 'AB12 CDE')
)
);
insert into People values(
2,
(select ref(pi) from PersonInfos pi where pi.id = 2),
CarCollection(
... |
alter table egmrs_registration alter column marriageact DROP NOT NULL;
update eg_action set enabled=false where contextroot='mrs' and name='RegistrationactwiseReport';
|
/**
* SQL文件内容格式说明
* 文件格式为标准的sql文件格式进行了一点扩展
* sql名和sql必须满足成对的出现,形如 a b a b a b a b ...
* a为sql名,b为sql(可多行),a与b之间可以有注释
**/
-- aaaaaaaaaaaaaaa
-- bbbbbbbbbbbbbbb
/*[other]*/
/*cccccccccccccc*/
/*xxxxxxxxxxxxxx*/
update test."user"
set name = 'cyx', --姓名
password = '<PASSWORD>' --密码
where id = 5;
/*ddddddd
cmd
dd... |
<reponame>AxelTerizaki/karaokemugen-app<filename>migrations/20210524000000.undo.updateGuestsSendStats.sql
UPDATE users SET flag_sendstats = NULL
WHERE type = 2; |
<reponame>bogdanghita/public_bi_benchmark-master_project
SELECT SUM("Motos_2"."InversionUS") AS "sum:InversionUS:ok", CAST(EXTRACT(YEAR FROM "Motos_2"."FECHA") AS BIGINT) AS "yr:FECHA:ok" FROM "Motos_2" WHERE ((CAST(EXTRACT(YEAR FROM "Motos_2"."FECHA") AS BIGINT) >= 2010) AND (CAST(EXTRACT(YEAR FROM "Motos_2"."FECHA"... |
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: musdb
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40... |
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/drop_table/860e3e6b.sql<gh_stars>10-100
-- file:join.sql ln:449 expect:true
DROP TABLE t3
|
<reponame>SkyFire/CCDB406_PUBLIC<filename>CCDB/database/main_db/world/spelldifficulty_dbc.sql
/*!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 *... |
-- --------------------------------------------------------
-- Host: 172.16.17.32
-- Server version: 5.6.49-log - Source distribution
-- Server OS: Linux
-- HeidiSQL Version: 11.0.0.5919
-- --------------------------------------------------------
/*!... |
XQUERY
xs:boolean("true"),
xs:boolean("false"),
xs:boolean(1),
xs:boolean(0)
|
CREATE DATABASE IF NOT EXISTS `ga` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `ga`;
-- MySQL dump 10.13 Distrib 5.6.24, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: ga
-- ------------------------------------------------------
-- Server version 5.6.27-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_S... |
<gh_stars>0
select * from oauth_client_details;
insert into oauth_client_details (client_id, resource_ids, client_secret, scope, authorized_grant_types, web_server_redirect_uri, authorities, access_token_validity, refresh_token_validity ) values('test', 'res1', '$2a$10$ofuJ5MMaxMJGoyQt8mgadOnMk.R6O2aiTsC9fPjhJ8h5z6Zy1... |
<reponame>phalodi/spark-semantic
create or replace function typecode(lit varchar(200))
returns SMALLINT
language sql contains sql no external action deterministic
begin
return case
when lit='http://www.w3.org/2001/XMLSchema#string' then 5003
when lit='http://www.w3.org/2001/XMLSchema#boolean' then 5004
when lit... |
<filename>support/grant.sql<gh_stars>1-10
GRANT ALL
ON vitrodb_test.*
TO 'vitro'@'localhost' IDENTIFIED BY 'vitro123';
FLUSH PRIVILEGES;
|
<reponame>chalice19/ClickHouse<filename>tests/queries/0_stateless/01773_datetime64_add_ubsan.sql
-- The result is unspecified but UBSan should not argue.
SELECT ignore(addHours(now64(3), inf)) FROM numbers(2); -- { serverError 407 }
|
select student_id,min(course_id) course_id,grade
from Enrollments
where (student_id,grade) in (
select student_id,max(grade) grade
from Enrollments
group by student_id
)
group by student_id,grade
--SQL架构
--表:Enrollments
--
--+---------------+---------+
--| Column Name | Type |
--+---------------+------... |
<reponame>candYgene/pbg-ld
--
-- Bulk loading RDF graphs into Virtuoso Quad Store.
--
SET u{DATA_DIR} __DATA_DIR__ ;
SET u{FILE_NAME} *.gz ;
SET u{LOG_LEVEL} 2 ;
-- delete named graphs
-- SPARQL CLEAR GRAPH <graph-iri> ;
-- register RDF files to load; graph URIs in *.graph files
DELETE FROM DB.DBA.load_list ;
ld_dir... |
-- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: 192.168.127.12 Database: eladmin
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... |
select
-- Required Columns
a.tenant_id as resource,
case
when status = 'ENABLED' then 'ok'
else 'alarm'
end as status,
case
when status = 'ENABLED' then 'CloudGuard enabled.'
else 'CloudGuard disabled.'
end as reason,
-- Additional Dimensions
reporting_region,
c.name
from
oci_cloud_g... |
<reponame>pzhao12testa/sharding-jdbc<gh_stars>100-1000
CREATE TABLE t_order_0 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE t_order_1 (order_id INT NOT NULL, user_id INT NOT NULL, status VARCHAR(45) NULL, PRIMARY KEY (order_id));
CREATE TABLE t_order_item_0... |
<reponame>komainu8/pgroonga
SELECT pgroonga_match_positions_character(
'Groonga is a fast and accurate full text search engine based on ' ||
'inverted index. One of the characteristics of Groonga is that a ' ||
'newly registered document instantly appears in search results. ' ||
'Also, Groonga allows updates wi... |
<gh_stars>0
-- MySQL dump 10.19 Distrib 10.3.32-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: radius
-- ------------------------------------------------------
-- Server version 10.3.32-MariaDB-0ubuntu0.20.04.1-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 S... |
--------------------------------------------------------------------------------
-- White Space
def $lf = 10
def $cr = 13
def $simpleWS = 0 | 9 | 12 | 32
def SimpleEOL = { $cr; $lf } | $lf
def EOL = SimpleEOL <| $cr
def Comment = { Match "%"; Many (M... |
<gh_stars>1-10
--------------------------------------------------------------------------------
-- postgresql-dbpatch - PostgreSQL database patch change management extension
--
-- Copyright 2016 Crown copyright (c)
-- Land Information New Zealand and the New Zealand Government.
-- All rights reserved
--
-- This softwa... |
<reponame>anbya/contohUploadKeGit<gh_stars>0
INSERT INTO pos_itemtemp VALUES("IATT200005294","193046","191002","192010","10000","1","10000","0","10000","1","1","1","IAT1202200850","NHO2018000007","PAID","","193046"),
("IATT200005294","193011","191001","192001","40000","1","40000","0","40000","1","1","1","IAT1202200850"... |
--=================================================================================================
-- Disable all the triggers in the database.
--=================================================================================================
SET NOCOUNT ON
DECLARE @TSQL NVARCHAR(MAX)
DECLARE Data_Cursor CURSOR F... |
<reponame>leanwi/Sierra-Utils<filename>scripts/sql/rnum_with_checksum.sql<gh_stars>0
-- Checksum calculator from record_number::int
create or replace function pg_temp.rnumChecksum(rnum int) returns char(1) as
$$
select coalesce(
nullif(
(
-- Check digit calculation by <NAME>.
-- The University of Syd... |
<reponame>danivalades/flagging
-- This query returns up to 48 hours of the latest data
SELECT *
FROM model_outputs
WHERE time BETWEEN
(SELECT MAX(time) - interval '47 hours' FROM model_outputs)
AND
(SELECT MAX(time) FROM model_outputs)
|
CREATE PROC usp_GetEmployeesFromTown (@townName VARCHAR(50))
AS
SELECT e.FirstName,
e.LastName
FROM Employees AS e
JOIN Addresses AS a
ON a.AddressID = e.AddressID
JOIN Towns AS t
ON t.TownID = a.TownID
WHERE t.[Name] = @townName |
<filename>dbv-1/data/revisions/4.17/badal.sql
Use Ratemanagement3;
insert into tblGatewayConfig (GatewayId, Title, Name, Status, Created_at, CreatedBy) VALUES ('7', 'Key', 'key', '1','2018-04-10 17:44:39','RateManagementSystem');
insert into tblGatewayConfig (GatewayId, Title, Name, Status, Created_at, CreatedBy) VALU... |
<filename>data/build.sql
CREATE TABLE IF NOT EXISTS starboard (
RootMessageID integer PRIMARY KEY,
StarMessageID INTEGER,
Stars INTEGER DEFAULT 1
)
DROP TABLE IF EXISTS posts
CREATE TABLE posts (
ID integer PRIMARY KEY AUTO_INCREMENT
) |
<reponame>lgcarrier/AFW
SET DEFINE OFF;
create or replace package afw_29_asurn_qualt_pkg
as
procedure exect_reqt (pva_liste_contrl in varchar2
,pnu_page in number default null);
end afw_29_asurn_qualt_pkg;
/
|
<filename>Packages/Lecture/LectureBody.sql
/*
* body Lecture
*/
create or replace PACKAGE BODY Lecture IS
PROCEDURE listAdherent(liste out liste_Cursor) IS
BEGIN
SET TRANSACTION READ ONLY;
OPEN liste FOR SELECT * FROM ADHERENT;
COMMIT;
END;
PROCEDURE listEmpruntsForAdherent(idAdh NUMBE... |
<gh_stars>100-1000
-- collate4.test
--
-- execsql {
-- CREATE TABLE collate4t3(a COLLATE NOCASE, b COLLATE TEXT);
-- INSERT INTO collate4t3 VALUES( 'a', 'a' );
-- INSERT INTO collate4t3 VALUES( 'b', 'b' );
-- INSERT INTO collate4t3 VALUES( NULL, NULL );
-- INSERT INTO collate4t3 VALUES( 'B', 'B' );... |
-- file:without_oid.sql ln:21 expect:true
INSERT INTO wo SELECT i+1 FROM wi
|
USE devops_ci_auth;
SET NAMES utf8mb4;
DROP PROCEDURE IF EXISTS ci_auth_schema_update;
DELIMITER <CI_UBF>
CREATE PROCEDURE ci_auth_schema_update()
BEGIN
DECLARE db VARCHAR(100);
SET AUTOCOMMIT = 0;
SELECT DATABASE() INTO db;
IF EXISTS(SELECT 1
FROM information_schema.COLUMNS
... |
<gh_stars>1-10
update sys_setting set name = 'nonwear_time_th' where name = 'notwearing_time_th';
update sys_setting set name = 'nonwear_sma_th' where name = 'notwearing_sma_th';
|
<filename>MyUSC/SQL/sp/sp_DeleteVenueUsage.sql<gh_stars>0
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
... |
<filename>api/src/main/resources/db/migration/1.0/V1.0.8__DDL-CREATE_TABLE-program_requirement.sql
-- PROGRAM_REQUIREMENT definition
CREATE TABLE "PROGRAM_REQUIREMENT"
( "PROGRAM_REQUIREMENT_ID" RAW(16) DEFAULT SYS_GUID(),
"GRADUATION_PROGRAM_CODE" VARCHAR2(20) NOT NULL ENABLE,
"PROGRAM_REQUIREMENT_CODE" VARCH... |
<gh_stars>0
DROP TABLE IF EXISTS `pages`;
CREATE TABLE `pages` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`subject_id` bigint(20) DEFAULT NULL,
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`permalink` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NUL... |
<reponame>valitydev/reporter
CREATE INDEX IF NOT EXISTS invoice_status_created_at_brin
ON rpt.invoice USING brin(status_created_at) WITH (pages_per_range='1');
|
<reponame>HalfMortise/snap-sql
ALTER DATABASE ecorsi CHARACTER SET utf8 COLLATE utf8_unicode_ci;
-- never do this on live data!!!!!
DROP TABLE if EXISTS comment;
-- the CREATE TABLE function is a function that takes the arguments to layout the table's schema
CREATE TABLE comment (
commentId BINARY(16) NOT NULL,
c... |
<reponame>jsnb-devoted/dbt_artifacts
{{ config( materialized='incremental', unique_key='manifest_model_id' ) }}
with dbt_models as (
select * from {{ ref('stg_dbt__models') }}
),
dbt_models_incremental as (
select *
from dbt_models
{% if is_incremental() %}
-- this filter will only be applied ... |
<gh_stars>0
------------------------------------------------
-- Export file for user TPPADMIN@UCCI --
-- Created by Kelatev on 12.07.2017, 14:20:03 --
------------------------------------------------
set define off
spool DDL.log
prompt
prompt Creating table MD_SYNC_TABLE
prompt ============================
pr... |
<reponame>NT5/SAO<filename>res/sql/tables/Grupos.sql
CREATE TABLE IF NOT EXISTS `Grupos` (
`Id_Grupo` INT NOT NULL AUTO_INCREMENT,
`Año_Grupo` INT NOT NULL,
`Cod_Interno` VARCHAR(350) NOT NULL,
`Id_Carrera` INT NOT NULL,
`CreateAt` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
UNIQUE K... |
<gh_stars>1-10
drop table if exists items;
create table items(
id integer primary key autoincrement,
name char(80) not null,
abstract text not null,
filename char(80) not null,
category integer not null
);
create table comments(
id integer primary key autoincrement,
nick char(32) not null,
... |
<filename>database/scripts/postgresql/archive/PostgresUpgrade_v7.1_v7.2.sql<gh_stars>1-10
-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: changelog_master.groovy
-- Ran at: 7/29/13 ... |
<filename>src/main/resources/liquibase/harness/change/expectedSql/mysql/dropDefaultValue.sql
ALTER TABLE posts ALTER title SET DEFAULT 'title_test'
ALTER TABLE posts ALTER title DROP DEFAULT
|
CREATE TABLE oldnametable (test_id INT NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_OLDNAMETABLE PRIMARY KEY (test_id))
ALTER TABLE oldnametable RENAME newnametable
|
<filename>QueryTranslator/WatDivQuerySet/SQL/WatDiv1M_Basic/F5-5--SO-OS-SS-VP__WatDiv1M.sql<gh_stars>10-100
SELECT tab0.v1 AS v1 , tab1.v0 AS v0 , tab4.v5 AS v5 , tab5.v6 AS v6 , tab3.v4 AS v4 , tab2.v3 AS v3
FROM (SELECT obj AS v0
FROM gr__offers$$2$$
WHERE sub = 'wsdbm:Retailer93'
) tab1
JOIN (SELECT ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.