sql stringlengths 6 1.05M |
|---|
IF EXISTS (SELECT 1 FROM sys.procedures WHERE schema_id = SCHEMA_ID(N'Tigra') AND name = N'ArchiveRequirement')
BEGIN
DROP PROCEDURE [Tigra].[ArchiveRequirement];
END
GO
CREATE PROCEDURE [Tigra].[ArchiveRequirement]
(
@CellID INT,
@Tag VARCHAR(100)
)
AS
BEGIN
DECLARE @RevisionID BIGINT;
SELECT @RevisionID = MAX(... |
ALTER TABLE general_meeting ADD CONSTRAINT general_meeting_agenda_unique UNIQUE (meeting_agenda_id);
|
<reponame>jonathangreen/simplified-server-core
-- It used to be that patrons.username,
-- patrons.authorization_identifier, and patrons.external_identifier
-- each had to be unique. Now, the *combination* of each of those fields
-- with patrons.library_id must be unique.
DROP INDEX IF EXISTS ix_patrons_authorization_i... |
<filename>models/raw_vault/sats/sat_inv_supp_region_details.sql
{%- set source_model = "v_stg_inventory" -%}
{%- set src_pk = "SUPPLIER_PK" -%}
{%- set src_hashdiff = "SUPPLIER_NATION_HASHDIFF" -%}
{%- set src_payload = ["SUPPLIER_NATION_NAME", "SUPPLIER_NATION_COMMENT"] -%}
{%- set src_eff = "EFFECTIVE_FROM" -%}
{%- s... |
<reponame>Zilvereyes/ServerThree
ALTER TABLE db_version CHANGE COLUMN required_c12472_01_mangos_npc_vendor required_c12472_02_mangos_npc_vendor_template bit;
ALTER TABLE npc_vendor_template ADD COLUMN `condition_id` mediumint(8) unsigned NOT NULL default '0' AFTER ExtendedCost;
|
<filename>database/altertableolas-20170710.sql
use olas;
CREATE TABLE `subject_semester_archive` (
`subsema_id` int(11) NOT NULL,
`subsema_subsemid` int(11) NOT NULL,
`subsema_subid` int(11) NOT NULL,
`subsema_prgid` int(11) NOT NULL,
`subsema_semester` int(5) NOT NULL,
`subsema_subtype` varchar(255) NOT N... |
<reponame>Zhaojia2019/cubrid-testcases<filename>sql/_22_news_service_mysql_compatibility/_03_hint_rewriting/cases/_06_join_6354.sql
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
create table t1 (id int primary key not null, a int, b int, c int);
insert into t1 values (1,1,1,1), (2,2,2,2);
create ind... |
<reponame>anthill-platform/anthill-leaderboard
CREATE EVENT `records_expiration`
ON SCHEDULE EVERY 5 MINUTE STARTS CURRENT_TIMESTAMP
DO
DELETE
FROM `records`
WHERE `records`.`expire_at` < NOW(); |
<reponame>dermesser/geohub<gh_stars>0
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.6
-- Dumped by pg_dump version 12.6
-- pg_dump -s -U <owner> -n geohub -O
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standar... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 05 Feb 2018 pada 04.41
-- Versi Server: 10.1.19-MariaDB
-- PHP Version: 7.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
create database cadastros
default character set utf8
default collate utf8_general_ci;
create table pessoas (
id int not null auto_increment,
nome varchar(30) not null,
nascimento date,
sexo enum('M', 'F'),
peso decimal(5,2),
altura decimal(3,2),
nacionalidade varchar(20) DEFAULT 'Brasil',
PRI... |
<filename>database/dbo.sql
/*
Navicat Premium Data Transfer
Source Server : 本机mssql
Source Server Type : SQL Server
Source Server Version : 13004001
Source Host : .:1433
Source Catalog : MyBlogs
Source Schema : dbo
Target Server Type : SQL Server
Target Server Version :... |
<reponame>FarhanRasyidK/transportkuh<filename>application/tranpotkuh/transportkuh.sql
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 19 Apr 2018 pada 08.23
-- Versi Server: 10.1.26-MariaDB
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SE... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 06, 2019 at 03:12 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.0.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 20 Nov 2021 pada 07.55
-- Versi server: 10.4.18-MariaDB
-- Versi PHP: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SE... |
<filename>modules/boonex/editor/install/sql/enable.sql
-- Settings
SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
INSERT INTO `sys_options_types` (`group`, `name`, `caption`, `icon`, `order`) VALUES
('modules', 'bx_editor', '_bx_editor_adm_stg_cpt_type', 'bx_editor@modules... |
<gh_stars>1-10
/*
+--------------------------+
|NORDIC PHASE DATA POLICIES|
+--------------------------+
This file contains the sql commands for creating the correct policies for nordic_phase_data table.
*/
/*
ADMIN POLICIES
--------------
*/
--Admin policy. Allow admins to access all operations freely.
CREATE POLIC... |
#add new fields into refunds to fill out table reports
ALTER TABLE `ticketba_lvtn`.`transaction_refunds`
ADD COLUMN `quantity` INT(10) NOT NULL DEFAULT null AFTER `created`,
ADD COLUMN `retail_price` DECIMAL(10,2) NOT NULL DEFAULT null AFTER `quantity`,
ADD COLUMN `processing_fee` DECIMAL(10,2) NOT NULL DEFAULT null A... |
/* Replace with your SQL commands */
UPDATE services
SET programId = (
SELECT id FROM programs WHERE programName = "Financial Education / Coaching"
)
WHERE serviceName = "Leadership Development - Monthly Meetings";
DELETE FROM services
WHERE serviceName = "General Consultation"
OR serviceName = "Translation"
OR serv... |
<gh_stars>10-100
CREATE TABLE subdivision_IL (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_IL" ("id", "name", "level") VALUES (E'IL-HA', E'Haifa', E'district');
INSERT INTO "subdivision_IL" ("id", "name", "level") VALUES (E'IL-JM', E'Jeruzalem', E'di... |
alter table taginstance
drop constraint taginstance_problemid_fkey,
add constraint taginstance_problemid_fkey
foreign key (problemId)
references problem(id)
on delete cascade;
|
-- This query selects deciles of calc_value by month from CCG-level
-- data, and adds this as new columns to the existing table that
-- includes practice-level data.
SELECT
global_deciles.month AS month,
global_deciles.denominator AS denominator,
global_deciles.numerator AS numerator,
global_deciles.practice_10... |
<filename>src/test/resources/sql/select/b0870d8d.sql
-- file:timestamptz.sql ln:361 expect:true
SELECT '2011-03-27 02:00:00'::timestamp AT TIME ZONE 'Europe/Moscow'
|
-- file:plpgsql.sql ln:1095 expect:false
retval text
|
insert into Accounts(customer_id,acc_number,branch_id,balance) values ('C1','0001',1,1000.00);
insert into Accounts(customer_id,acc_number,branch_id,balance) values ('C2','0002',1,500.00);
insert into Accounts(customer_id,acc_number,branch_id,balance) values ('C3','0003',1,501.00);
|
/* Create external schema using Spectrum from the pre-defined Glue Catalog */
/* Replace XXXXXXXXXXXX with an actual AWS account number */
create external schema ext_sfdev_appflow
from data catalog
database 'sfdev-appflow'
iam_role 'arn:aws:iam::XXXXXXXXXXXX:role/sfdev-appflow-redshift'
create external database if not ... |
<reponame>dram/metasfresh<filename>backend/de.metas.contracts/src/main/sql/postgresql/system/50-de.metas.contracts/5499030_sys_gh4475-app_add_contract_option_fields.sql
-- 2018-08-08T09:31:04.313
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Elemen... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 25, 2018 at 07:15 AM
-- Server version: 8.0.11
-- PHP Version: 7.2.10-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... |
<gh_stars>1-10
/*
Navicat MySQL Data Transfer
Source Server : wvanheem_core_local
Source Server Version : 50509
Source Host : 127.0.0.1
Source Database : core
Target Server Version : 50509
File Encoding : utf-8
Date: 06/21/2012 17:32:23 PM
*/
SET NAMES utf8;
SET FOREIGN_KEY_C... |
<filename>views/install/setup.sql
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE IF NOT EXISTS gx_adsense (
id smallint(5) unsigned NOT NULL auto_increment,
title varchar(50) NOT NULL,
content text NOT NULL,
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
INSERT INTO ... |
<reponame>fivetran-chloe/dbt_stripe
with invoice_line_item as (
select *
from `dbt-package-testing`.`stripe`.`invoice_line_item`
), fields as (
select
id as invoice_line_item_id,
invoice_id,
amount,
currency,
description,
discountable as is_discountable,
plan_i... |
<reponame>Traffop/ATSPM
-- DROP PROCEDURE [dbo].[CreateTable]
CREATE PROCEDURE [dbo].[CreateTable]
@StagingTableName nvarchar(100) ,
@TableNumber int ,
@PartitionNumber int ,
@PartitionYear int,
@PartitionMonth int,
@Verbose int
AS
DECLARE @NumberOfTables int
DECLARE @Status int
DECLARE @Counter int
... |
-- phpMyAdmin SQL Dump
-- version 4.1.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Gen 07, 2019 alle 23:06
-- Versione del server: 5.6.33-log
-- PHP Version: 5.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
--OPTIONAL ADDITIONAL ANALYSES
--incomplete
-- SPAN OF SERVICE
-- Returns the time in seconds of the first/last departure; note that the last departure may actually be an arrival if its a terminal stop. Hours of service is different. Some post-processing should be done on rows with early_departures=true because that ... |
<reponame>Datasilk/Kandu
CREATE PROCEDURE [dbo].[Teams_GetAllForUser]
@spUserId int,
@userId int
AS
SET NOCOUNT ON;
--check security for user who is executing this SP
SELECT su.groupId
INTO #sec
FROM [SecurityUsers] su
JOIN SecurityGroups sg ON sg.groupId = su.groupId
JOIN Security s ON s.groupId = sg.group... |
<reponame>turbot/steampipe-mod-kubernetes-compliance
select
-- Required Columns
name as resource,
case
when allowed_host_paths is null then 'alarm'
else 'ok'
end as status,
case
when allowed_host_paths is null then 'Containers can use all host paths.'
else 'Containers using specified host path... |
CREATE TABLE Post
(
id UNIQUEIDENTIFIER PRIMARY KEY,
title VARCHAR(MAX) NOT NULL,
created DATE NOT NULL
)
CREATE INDEX IX_Post_created ON Post(created)
CREATE TABLE Invoice
(
number VARCHAR(20) PRIMARY KEY,
dueDate DATE NOT NULL,
total DECIMAL(15,2) NOT NULL,
paid DATETIME,
canceled BIT NOT NUL... |
--+ holdcas on;
set names binary;
SELECT SUBSTRING_INDEX('www.cubrid.org','.','2');
SELECT SUBSTRING_INDEX('字符.串1','.','1');
SELECT SUBSTRING_INDEX('字符.串1字符.串1字符.串1', '.','1');
SELECT SUBSTRING_INDEX('字符.串1字符.串1字符.串1字符.串1字符.串1', '串1字符','2.1');
SELECT SUBSTRING_INDEX (cast( _utf8'12345가.나다라마.가나다라마' as string charset... |
alter table "job_queues"."ChannelStackCreateJob" alter column "cloudFormationStackArn" drop not null;
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 16, 2021 at 01:09 PM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
/* ---------------------------------------------------------------------------------------------------------------------------------
Routine Name: loadTest.sql
Author: <NAME>
Date: 09/04/2019
------------------------------------------------------------------------------------------------------------------... |
<filename>gretl/initialisierung/sql/createViewLFP3aufGP.sql
CREATE VIEW ${dbschema}.v_berechnungen_lfp3_auf_gp_${bfs_nr} AS
SELECT
*
FROM
${dbschema}.berechnungen_lfp3_auf_gp
WHERE
bfs_nr = ${bfs_nr}
; |
CREATE TABLE "Rentabilidad_1"(
"col_000" decimal(18, 12) NOT NULL,
"col_001" double NOT NULL,
"col_002" double NOT NULL,
"col_003" decimal(18, 14) NOT NULL,
"col_004" double NOT NULL,
"col_005" double NOT NULL,
"col_006" double NOT NULL,
"col_007" decimal(17, 14) NOT NULL,
"col_008" double NOT NULL,
... |
<reponame>sergb213/pgtoolsservice
{#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#}
SELECT
last_value,
seqmin AS min_value,
seqmax AS max_value,
seqstart AS start_value,
seqcache AS cache_val... |
<reponame>MessiDaGod/okta-nodejs-sql-server-example
INSERT INTO [dbo].[events]
(
[userId]
, [title]
, [description]
, [startDate]
, [startTime]
, [endDate]
, [endTime]
)
VALUES
(
@userId
, @title
, @description
, @startDate
, @startTime
, @endDate
, @endTime
... |
<reponame>josephchoe/database-message-store<filename>revert/tables/messages.sql
-- Revert database-message-store:tables/messages from pg
BEGIN;
DROP TABLE message_store.messages;
COMMIT;
|
<reponame>joselucaspj/playcash
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Máquina: 127.0.0.1
-- Data de Criação: 06-Maio-2016 às 16:22
-- Versão do servidor: 5.5.32
-- versão do PHP: 5.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_S... |
CREATE TABLE [dbo].[HomeWorks]
(
[Id] INT NOT NULL PRIMARY KEY,
[MemberId] INT NOT NULL,
[LessonId] INT NOT NULL,
[Name] NVARCHAR(50) NOT NULL,
[CreatedAt] DATETIME NOT NULL DEFAULT GETDATE(),
[UpdatedAt] DATETIME NOT NULL DEFAULT GETDATE(),
[Link] NVARCHAR(200) NOT NULL,
[Mark] INT... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 17, 2021 at 11:54 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
/*
8. Create a table to show the top 10 "life-threatening" vehicles (brands) , which each had over 10,000 collision,
along with the number of killed victims per vehicle and the percentage of collison/death ratio.
*/
/*
Note: As we look at this problem, we notice that grouping by "vehicle brands" with two differe... |
-- Adminer 4.7.6 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `ugroups`;
CREATE TABLE `ugroups` (
`ugroup_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) COLLATE utf8mb4_unicode... |
<reponame>A1rPun/nurture
select 'Hello world!';
|
<gh_stars>1-10
DROP TABLE IF EXISTS DICT.LOCKS CASCADE;
CREATE TABLE IF NOT EXISTS DICT.LOCKS
(
key text primary key,
data text
);
ALTER TABLE DICT.LOCKS OWNER to exodus;
INSERT INTO DICT.LOCKS (key,data) values (E'STATION',E'F3StationSL101');
INSERT INTO DICT.LOCKS (key,data) values (E'SES... |
CREATE PROCEDURE [dbo].[sproc_GetCustomerBySupportRep]
(
@SupportRepId int
)
AS
SELECT CAST((SELECT * FROM [Customer] WHERE SupportRepId = @SupportRepId FOR JSON PATH) AS VARCHAR(MAX)) AS JSONDATA |
CREATE PROCEDURE sprockit__internal_ManageLogs.[test GIVEN retention period negative THEN no executions deleted]
AS
-- ARRANGE
UPDATE sprockit.Property
SET PropertyValue = -50
WHERE PropertyName = 'LogRetentionPeriod'
SELECT BatchId
INTO #expected
FROM sprockit.Execution;
-- ACT
EXEC sprockit._internal_ManageLogs
... |
ALTER TABLE recall ALTER COLUMN noms_number SET NOT NULL; |
<gh_stars>1-10
-- Your SQL goes here
CREATE TABLE IF NOT EXISTS movies
(
id VARCHAR NOT NULL,
title VARCHAR NOT NULL,
genre VARCHAR NOT NULL,
plot VARCHAR NOT NULL,
poster VARCHAR NOT NULL,
runtime VARCHAR NOT NULL,
PRIMARY KEY (id)
)
|
<gh_stars>1-10
create table
test_normalization.`unnest_alias_children__dbt_tmp`
as (
-- Final base SQL model
select
_airbyte_unnest_alias_hashid,
ab_id,
`owner`,
_airbyte_ab_id,
_airbyte_emitted_at,
CURRENT_TIMESTAMP
as _airbyte_normalized_at,
_airbyte_children_hashid
f... |
select db_fail_unless_row_count_greater_zero('update C_Calendar set IsDefault=''Y'', Updated=TO_TIMESTAMP(''2020-08-19 08:00:00'', ''YYYY-MM-DD HH24:MI:SS''), UpdatedBy=100 where c_calendar_id=1000000;');
|
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... |
<gh_stars>0
select
store,
sector,
city,
zipcode,
major_business_type,
minor_business_type,
major_buying_type,
minor_buying_type,
market_type
from {{ source('strauss', 'customer_new') }} |
DROP TABLE IF EXISTS machine_info;
CREATE TABLE machine_info
(
`id` bigint NOT NULL AUTO_INCREMENT comment 'id',
`ip` varchar(1024) comment '机器信息',
`gmt_create` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`comments` text COMMENT '注释',
PRIMARY KEY (`id`)
);
DROP ... |
<reponame>alex-dyner/tetraoxygenDataLakeHive
/*Hive*/
create database adyner;
CREATE TABLE adyner.sales_top10_countries (
country_name varchar(1024)
,total_amount decimal(38,2)
)
COMMENT 'Report for top 10 countries by total sales amount'
ROW FORMAT DELIMITED FIELDS TERMINATED BY ','
STORED AS TEXTFILE
LOCAT... |
<filename>database/config-database/sql/manual-scripts/user_manager_config.sql
INSERT INTO config
(app_id, config_id, config_data)
VALUES
('eds-user-manager', 'keycloak', '{
"realm": "endeavour",
"realm-public-key": "<Keycloak public key here>",
"auth-server-url": "<Keycloak url here>",
"ssl-required": "external... |
<gh_stars>0
drop table if exists img;
create table if not exists img(
id serial primary key,
filename varchar not null unique,
bytes bytea not null
---------------------------
-- constraint unique_filename_album_name unique (filename, album_name)
);
--case class Img(
-- id: Optio... |
<reponame>difu/DataspaceConnector
CREATE TABLE public.authentication (
dtype character varying(31) NOT NULL,
id bigint NOT NULL,
deleted boolean DEFAULT false,
password character varying(255),
username character varying(255),
key character varying(255),
value character varying(255)
);
CREAT... |
<reponame>Git-liuxiaoyu/cloud-hospital-parent<filename>cloud-hospital-parent/cloud-hospital-nacos-parent/take-number-service/src/main/resources/h_takenumber.sql
/*
Navicat Premium Data Transfer
Source Server : 刘小雨
Source Server Type : MySQL
Source Server Version : 80025
Source Host : 172.16.1... |
#standardSQL
# Top 100 third party domains by request volume
SELECT
thirdPartyDomain,
COUNT(0) AS totalRequests,
ROUND(COUNT(0) * 100 / MAX(totalRequestCount), 4) AS percentRequests,
SUM(requestBytes) AS totalBytes
FROM (
SELECT
respSize AS requestBytes,
NET.HOST(url) AS requestDomain,
Domai... |
INSERT INTO `s_holiday`(`id`, `holiday`, `status`, `holiday_name`) VALUES ('1', '2021-01-01 14:51:37', 1, '元旦');
INSERT INTO `s_holiday`(`id`, `holiday`, `status`, `holiday_name`) VALUES ('10', '2021-02-16 00:00:00', 1, '初五');
INSERT INTO `s_holiday`(`id`, `holiday`, `status`, `holiday_name`) VALUES ('11', '2021-02-17 ... |
<reponame>b-0-x/steampipe-mod-azure-compliance<gh_stars>10-100
select
-- Required Columns
s.id as resource,
case
when sku_name = 'free' then 'alarm'
else 'ok'
end as status,
case
when sku_name = 'free' then s.title || ' SKU does not supports private link.'
else s.title || ' SKU supports privat... |
{# ========================== Fetch Materialized View Properties ========================= #}
{% if (vid and datlastsysoid) or scid %}
SELECT
c.oid,
c.xmin,
c.relname AS name,
c.reltablespace AS spcoid,
c.relispopulated AS with_data,
CASE WHEN length(spcname) > 0 THEN spcname ELSE
(SELEC... |
<gh_stars>1-10
-- add attribute of Shared when date of table exist
create class c_nc (it int);
insert into c_nc values (2);
alter class c_nc add attribute nc string Shared 'a';
select * from c_nc;
drop class c_nc; |
-- @testpoint: 测试利用select into语句给real类型的变量赋值
--前置:创建表及插入数据
drop table if exists proc_select_into_11;
create table proc_select_into_11(c_int int ,c_integer integer not null ,c_bigint bigint,c_number number default 0.2332,c_number1 number(12,2),c_number2 number(12,6),c_double binary_double,c_decimal decimal,c_decimal1 d... |
<reponame>vipkailiai/fcvova
CREATE TABLE btFootballClub (
id smallint(5) unsigned NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL DEFAULT '',
id_country smallint(4) unsigned NOT NULL,
venue VARCHAR(100) DEFAULT NULL,
coach VARCHAR(100) DEFAULT NULL,
... |
<reponame>ZhengPeiRu21/mod-individual-progression<filename>sql/world/base/dungeon_shadowfang_keep.sql
-- Son of Arugal
UPDATE `creature_template` SET `minlevel`=24, `maxlevel`=25 WHERE `entry`=2529;
-- Deathsworn Captain
UPDATE `creature_template` SET `minlevel`=25, `maxlevel`=25 WHERE `entry`=3872;
-- Shadowfang Moo... |
CREATE SEQUENCE source_id_seq;
CREATE SEQUENCE news_id_seq;
CREATE TABLE source(
id INT NOT NULL DEFAULT nextval('source_id_seq'),
identifier VARCHAR (50),
name VARCHAR (50),
PRIMARY KEY (id)
);
CREATE TABLE news(
id INT NOT NULL DEFAULT nextval('news_id_seq'),
title VARCHAR (255) NOT NULL,
... |
drop schema ims;
CREATE SCHEMA IF NOT EXISTS `ims`;
USE `ims` ;
DROP TABLE IF EXISTS 'customers';
CREATE TABLE IF NOT EXISTS `ims`.`customers` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(40) DEFAULT NULL,
`surname` VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (`id`)
);
DROP TABLE IF EXISTS `... |
DROP TABLE IF EXISTS entradas;
-- cria tabela para guardar os posts do blog
CREATE TABLE entradas (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title STRING NOT NULL,
texto STRING NOT NULL
);
-- criação de um esquema para armazenar o conteúdo enviado pelos usuários do blog |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 21, 2018 at 01:28 PM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
/*
Various tests to try joining 2016 to 2020 employment data
Top-line stats:
* 130,285 rows in 2016 file
* 417,105 rows in raw 2020 file
*/
USE EMP2020
GO
--=======Test 1: Left join 2020 to 2016 on LOCNUM<>INFOID_16================
SELECT
t20.LOCNUM,
t20.LOCEMP AS EMP20,
t16.F_EMP16 AS EMP16
INTO #jn_emp20_to_... |
<filename>Database/report/Stored Procedures/ParameterInvoice.sql
CREATE PROCEDURE report.[ParameterInvoice]
AS
SELECT
NULL AS Value,
' - All -' AS Label
UNION ALL
SELECT
1 AS Value,
'Len na fakturaciu' AS Label
|
<reponame>eduranm/digitalab<filename>bd/ITMS_accesos_servicio_2018.sql
INSERT INTO tb_ITMS_accesos_servicio(anio,id_servicio,accesos) values(2018,(SELECT id_servicio from tc_ITMS_servicios where nombre_servicio='UpToDate'),299447);
INSERT INTO tb_ITMS_accesos_servicio(anio,id_servicio,accesos) values(2018,(SELECT id_se... |
SET DEFINE OFF;
create or replace package body afw_17_notfc_sms_twilio_pkg
as
gxm_repns_servr xmltype;
gva_acoun_id varchar2 (100);
gva_authn_token varchar2 (100);
gva_empla_walt varchar2 (100);
gva_mot_passe_walt varchar2 (100);
function encod_sms (pva_mesg in varchar2)
retur... |
<reponame>stevencyrway/quasar<gh_stars>10-100
DROP MATERIALIZED VIEW IF EXISTS public.member_event_log CASCADE;
CREATE MATERIALIZED VIEW public.member_event_log AS
(SELECT
MD5(concat(a.northstar_id, a."timestamp", a.action_id, a.action_serial_id)) AS event_id,
a.northstar_id AS northstar_id,
a."timestamp"... |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.223.111_devops
Source Server Version : 50727
Source Host : 192.168.223.111:3306
Source Database : devops
Target Server Type : MYSQL
Target Server Version : 50727
File Encoding : 65001
Date: 2020-04-30 10:23:29
*/
... |
<reponame>dckesler/wallet<gh_stars>0
externalCustomerId: STRING,
type: STRING,
isFromQuote: BOOLEAN,
id: STRING,
createdAt: TIMESTAMP,
updatedAt: TIMESTAMP,
baseCurrencyAmount: FLOAT,
quoteCurrencyAmount: FLOAT,
feeAmount: FLOAT,
extraFeeAmount: FLOAT,
networkFeeAmount: FLOAT,
areFeesIncluded: BOOLEAN,
flow: STRING,
st... |
<reponame>DrorSh/generic_parser<gh_stars>1-10
DROP TABLE IF EXISTS public.wos_contributor_email_addr;
DROP TABLE IF EXISTS public.wos_chapters;
DROP TABLE IF EXISTS public.wos_reprint_address_dois;
DROP TABLE IF EXISTS public.wos_reprint_address_email_addr;
DROP TABLE IF EXISTS public.wos_grant_alt_agencies;
DROP TABLE... |
DROP DATABASE `cslqm_task_svr`;
CREATE DATABASE `cslqm_task_svr`;
use cslqm_task_svr;
CREATE TABLE `task_svr_user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`username` varchar(50) NOT NULL UNIQUE COMMENT '账号',
`password` varchar(50) DEFAULT '' COMMENT '密码',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT C... |
<reponame>alekitto/zombodb<gh_stars>1000+
--
-- requires that zombodb.default_elasticsearch_url be set in postgresql.conf
--
CREATE TABLE issue_235 AS SELECT oid::bigint AS id, relname::text AS relname FROM pg_class LIMIT 10; -- just need some data from somewhere
CREATE INDEX idxissue_235 ON issue_235 USING zombodb ( (... |
--===============================================
-- DDL for database objects to test pg_featureserv
--
--===============================================
CREATE SCHEMA pgfs_test;
-- DROP SCHEMA pgfs_test CASCADE;
--=====================================================================
CREATE TABLE pgfs_test.test_jso... |
--
-- SELECT_DISTINCT
--
--
-- awk '{print $3;}' onek.data | sort -n | uniq
--
SELECT DISTINCT
two
FROM
tmp
ORDER BY
1;
--
-- awk '{print $5;}' onek.data | sort -n | uniq
--
SELECT DISTINCT
ten
FROM
tmp
ORDER BY
1;
--
-- awk '{print $16;}' onek.data | sort -d | uniq
--
SELECT DISTINCT
s... |
-- Deploy phoebot:containers to pg
BEGIN;
CREATE TABLE container (
containerID uuid NOT NULL DEFAULT gen_random_uuid(),
added timestamp(0) NOT NULL DEFAULT current_timestamp,
changed timestamp(0) NOT NULL DEFAULT current_timestamp,
deleted timestamp(0),
enabled boolean NOT N... |
<reponame>athl64/yii2-simple
-- phpMyAdmin SQL Dump
-- version 4.3.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 23, 2015 at 01:01 PM
-- Server version: 5.5.39
-- PHP Version: 5.4.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<gh_stars>1-10
CREATE TABLE users (
user_id integer unique,
email varchar(100)
); |
-- cleaning airport names for better matching;
CREATE OR REPLACE FUNCTION lake_clean(lake_name text)
RETURNS text
LANGUAGE sql IMMUTABLE STRICT PARALLEL SAFE AS
$func$
select trim( translate( regexp_replace( nameclean( lake_name ) ,
$$[[:<:]](lake|lac|lagune|laguna|de|lago|lough|limni|see|di|ozero|reservoi... |
create table if not exists team (
id bigint auto_increment,
divisionId bigint not NULL,
poolId bigint default NULL,
name varchar(60) not NULL,
nameId varchar(10) not NULL,
color varchar(24) not NULL default '',
region varchar(... |
<reponame>mabbason/ls-ls230<gh_stars>0
DROP TABLE IF EXISTS `students`;
DROP TABLE IF EXISTS `bookings`;
DROP TABLE IF EXISTS `staffs`;
CREATE TABLE IF NOT EXISTS `students` (
`id` integer NOT NULL PRIMARY KEY AUTOINCREMENT,
`email` varchar,
`name` varchar
);
INSERT INTO `students` VALUES (1,'<EMAIL>','<NAME>');
I... |
<filename>ads-service/src/main/resources/data.sql
-- delete from ad;
--delete from comment;
--delete from location;
-- Location
insert into location(id, country, city)
values (1, 'Arizona', 'Phoenix');
insert into location(id, country, city)
values (2, 'China', 'Wuhan');
insert into location(id, country, city)
values ... |
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-08-2015 a las 06:35:03
-- Versión del servidor: 5.6.24
-- Versión de PHP: 5.5.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... |
<reponame>MiroslavKisov/Software-University
USE Geography
--VERSION 1
GO
SELECT TOP 5 CountryName AS [Country],
CASE
WHEN PeakName IS NULL THEN '(no highest peak)'
ELSE PeakName
END AS [Highest Peak Name],
CASE
WHEN Elevation IS NULL THEN 0
ELSE Elevation
END AS [Highest Peak E... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.