text stringlengths 1 1.05M |
|---|
-- Find rearing downstream of spawning
-- Rearing streams/wetlands must be connected (to some degree) to spawning streams of the same spp,
-- so rearing model is applied per species to make connectivity/clustering straightforward
-- CHINOOK
WITH rearing AS
(
SELECT
s.segmented_stream_id,
s.geom
FROM bcfish... |
sequences km height kcat accept step
MDSTLGLEIIEVVEQAAIASAKWMGKGEKNTADQVAVEAMRERMNKIHMRGRIVIGEGERDDAPMLYIGEEVGICTREDAKSFCNPDELVEIDIAVDPCEGTNLVAYGQNGSMAVLAISEKGGLFAAPDFYMKKLAAPPAAKGHVDIDKSATENLKILSDCLNRSIEELVVVVMDRPRHKELIQEIRNAGARVRLISDGDVSAAISCAFSGTNIHALMGIGAAPEGVISAAAMRCLGGHFQGQLIYDPEVVKTGLIGESREGNLERLASMGIKNPDQVYNCEE... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50150
Source Host : localhost
Source Database : biopartsdb_development
Target Server Type : MySQL
Target Server Version : 50150
File Encoding : utf-8
Date: 05/... |
--liquibase formatted sql
--changeset platform:create-settings-roles context:"pub"
--validCheckSum: ANY
-- role settings_role
create role ${settRoleName} with password '${settRolePass}' login;
--changeset platform:create-settings-db runInTransaction:false context:"pub"
create database settings with owner=${settRoleNam... |
-- Procedure MenuItem_Del
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.MenuItem_Del
(
@Id int
)
AS
SET NOCOUNT ON
IF(@Id > 0)
DELETE FROM MenuItem
WHERE Id=@Id;
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
|
SELECT tab0.v1 AS v1 , tab4.v5 AS v5 , tab3.v4 AS v4 , tab2.v3 AS v3 , tab1.v2 AS v2
FROM (SELECT obj AS v1
FROM wsdbm__follows$$1$$
WHERE sub = 'wsdbm:User7502'
) tab0
JOIN (SELECT sub AS v1 , obj AS v2
FROM wsdbm__likes$$2$$
) tab1
ON(tab0.v1=tab1.v1)
JOIN (SELECT obj AS v3 , sub AS v2
F... |
CREATE PROCEDURE [dbo].[aspnet_PersonalizationAdministration_FindState] (
@AllUsersScope bit,
@ApplicationName NVARCHAR(256),
@PageIndex INT,
@PageSize INT,
@Path NVARCHAR(256) = NULL,
@UserName NVARCHAR(256) = NULL,
@InactiveSinceDate DATETIME = NULL)
AS
BEGIN
... |
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TYPE audit_status AS ENUM ('DELETED', 'UPDATED');
CREATE TABLE IF NOT EXISTS users_audit (
id SERIAL,
username VARCHAR NOT NULL,
first_name VARCHAR NOT NULL,
last_name VARCHAR NOT NULL,
role VARCHAR NOT NULL REFERENCES r... |
-- Tags: no-fasttest
DROP TABLE IF EXISTS json_square_brackets;
CREATE TABLE json_square_brackets (id UInt32, name String) ENGINE = Memory;
INSERT INTO json_square_brackets FORMAT JSONEachRow [{"id": 1, "name": "name1"}, {"id": 2, "name": "name2"}];
INSERT INTO json_square_brackets FORMAT JSONEachRow[];
INSERT INTO js... |
drop TABLE IF EXISTS external_mmoe_test_{TIME_STAMP} ;
create EXTERNAL table external_mmoe_test_{TIME_STAMP}(
clk bigint
,buy bigint
,pid string
,adgroup_id string
,cate_id string
,campaign_id string
,customer string
,brand string
,user_id string
,cms_segid string
,... |
CREATE DATABASE IF NOT EXISTS `prueba`;
USE `prueba`;
DROP TABLE IF EXISTS `reservaaula`;
CREATE TABLE `reservaaula` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`nombre` varchar(100) NOT NULL,
`materia` varchar(100) NOT NULL,
`fecha` varchar(100) NOT NULL,
`fechaemp` time NOT NULL,
`fechater` time NOT NULL,
... |
CREATE SCHEMA summer_camp;
USE summer_camp;
CREATE TABLE `role` (
role_id int NOT NULL AUTO_INCREMENT,
`role` varchar(10) NOT NULL,
PRIMARY KEY (role_id)
);
CREATE TABLE `user` (
username varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
role_id int NOT NULL,
FOREIGN KEY (role_id) REFEREN... |
-- client: molehill/0.0.1
select
rowid
, survived
, coalesce(age, ${td.last_results.age_median}) as age
, coalesce(fare, ${td.last_results.fare_median}) as fare
, coalesce(cast(embarked as varchar), 'missing') as embarked
, coalesce(cast(sex as varchar), 'missing') as sex
, coalesce(cast(pclass as varchar... |
DELETE FROM ?:extension WHERE `type` = 'module' AND `code` = 'affiliate';
DELETE FROM ?:setting WHERE `store_id` = '0' AND `group` = 'affiliate';
DELETE FROM ?:extension WHERE `type` = 'module' AND `code` = 'slideshow';
DELETE FROM ?:setting WHERE `store_id` = '0' AND `group` = 'slideshow';
DELETE FROM ?:extension WH... |
/*
** Drop old Foreign keys
*/
if exists (select top 1 1 from sys.objects where name='FK_Active_Forum' and parent_object_id=object_id('[{databaseOwner}].[{objectQualifier}Active]') and type in (N'F'))
alter table [{databaseOwner}].[{objectQualifier}Active] drop constraint [FK_Active_Forum]
go
if exists (se... |
USE studentportal;
insert into `logs`(`id`,`employeeid`,`page`,`action`,`time`) values (1,'2','Compensation Leave','Applied Cancel Request','2018-07-30 13:07:35');
insert into `logs`(`id`,`employeeid`,`page`,`action`,`time`) values (2,'1','Employee Details','View Employee Details','2019-01-24 16:01:18');
insert into `... |
-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 03-11-2021 a las 14:52:39
-- Versión del servidor: 5.7.36
-- Versión de PHP: 7.3.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
-- wal.test
--
-- execsql { INSERT INTO t2 VALUES('B', 1) }
INSERT INTO t2 VALUES('B', 1) |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 27, 2021 at 05:27 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- Verify data_bags
BEGIN;
SELECT id, name, organization_id, created_at, updated_at FROM goiardi.data_bags WHERE FALSE;
ROLLBACK;
|
-- Drops the passport_demo if it exists currently --
DROP DATABASE IF EXISTS passport_demo;
-- Creates the "passport_demo" database --
CREATE DATABASE passport_demo;
|
CREATE PROCEDURE [Stage].[TransformRbcBankTransactions]
AS
TRUNCATE TABLE [Stage].[RbcBankTransactions];
INSERT INTO [Stage].[RbcBankTransactions] (
[Account],
[Date],
[Description],
[Amount]
) SELECT
[Account Type] AS Account,
[Transaction Date] AS Date,
ISNULL([Description 1], '')
+ CASE WHEN [D... |
SELECT YEAR(toDateTime('2016-06-15 23:00:00')); |
CREATE TABLE person
(
id bigint NOT NULL PRIMARY KEY,
name text NOT NULL,
email text NOT NULL UNIQUE,
password text NOT NULL,
public_key text NOT NULL,
secret text NOT NULL,
verified boolean NOT NULL,
updated_at timestamp NOT NULL
... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 16, 2022 at 01:35 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.3.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
/*! SET storage_engine=INNODB */;
DROP TABLE IF EXISTS invoice_items;
CREATE TABLE invoice_items (
record_id serial unique,
id varchar(36) NOT NULL,
type varchar(24) NOT NULL,
invoice_id varchar(36) NOT NULL,
account_id varchar(36) NOT NULL,
bundle_id varchar(36),
subscription_id varchar(36... |
DROP TABLE candidates;
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: sql300.ezyro.com
-- Generation Time: Jul 02, 2021 at 02:28 PM
-- Server version: 5.6.48-88.0
-- PHP Version: 7.2.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
INSERT INTO `district` (`id`, `province_id`, `code`, `name`) VALUES
(1, 1, '01', 'Quận Ba Đình'),
(2, 1, '02', 'Quận Hoàn Kiếm'),
(3, 1, '03', 'Quận Hai Bà Trưng'),
(4, 1, '04', 'Quận Đống Đa'),
(5, 1, '05', 'Quận Tây Hồ'),
(6, 1, '06', 'Quận Cầu Giấy'),
(7, 1, '07', 'Quận Thanh Xuân'),
(8, 1, '08', 'Quận Hoàng Mai'),
... |
DROP PROCEDURE IF EXISTS restoreEmailContacts;
DELIMITER //
CREATE PROCEDURE restoreEmailContacts()
BEGIN
DECLARE authorX, idxX INT;
DECLARE emailValue, optX VARCHAR(255);
DECLARE done INT DEFAULT 0;
DECLARE cur CURSOR FOR
SELECT DISTINCT
ansd.primaryAuthor,
qc.opt,
a.r... |
SELECT
concat_ws(' ', a.first_name, a.last_name) nombre,
group_concat(b.first_name, ' ', b.last_name) sameName
FROM sakila.actor a
JOIN actor b ON (a.last_name = b.last_name AND a.actor_id != b.actor_id)
GROUP BY a.actor_id
ORDER BY a.last_name
; |
DECLARE @msg NVARCHAR(MAX) = N'';
-- Must be a compatible, on-prem version of SQL (2014+)
IF ( (SELECT SERVERPROPERTY ('EDITION')) <> 'SQL Azure'
AND (SELECT PARSENAME(CONVERT(NVARCHAR(128), SERVERPROPERTY ('PRODUCTVERSION')), 4)) < 12
)
-- or Azure Database (not Azure Data Warehouse), running at database ... |
-- @testpoint: opengauss关键字pctfree非保留),作为索引名,部分测试点合理报错
--前置条件,创建一个表
drop table if exists explain_test;
create table explain_test(id int,name varchar(10));
--关键字不带引号-成功
drop index if exists pctfree;
create index pctfree on explain_test(id);
drop index pctfree;
--关键字带双引号-成功
drop index if exists "pctfree";
create index... |
-- SPDX-License-Identifier: MIT
-- Copyright 2017 J. King, Dustin Wilson et al.
-- See LICENSE and AUTHORS files for details
create table arsse_tags(
-- user-defined subscription tags
id integer primary key, -- numeric ID
owner text not null refer... |
/*
* 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
REM INSERTING into SOK_PRODUCT_DETAIL_LU
SET DEFINE OFF;
|
--
-- Copyright 2020 The Android Open Source Project
--
-- 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... |
use ScaCompanyDB
DECLARE @InvoiceDate DATETIME2= GETDATE();
SELECT
ST03014 AS 'INVOICE_NUMBER',
ST03020 AS 'QTY_INVOICED',
ST03021 AS 'UNIT_NET_PRICE',
ST03062 AS 'SALES_ORDER_LINE_NUMBER',
(ST03020 * ST03021) AS 'SALES_VALUE',
CAST(ST03015 AS DATE)AS 'INVOICE_DATE',
ST03030 AS 'FULLY_SHIP... |
ALTER TABLE testschema.test_second_table
ADD CONSTRAINT "FKey_$%{}[]()&*^!@""'`\/#" FOREIGN KEY (so_id)
REFERENCES testschema.test_first_table (id) MATCH SIMPLE
ON UPDATE RESTRICT
ON DELETE RESTRICT
NOT VALID;
|
alter system set password_lock_time to '1s';
select pg_sleep(5);
show password_lock_time;
---------------------------------------------------------------------------
alter system set password_lock_time to '1.1s';
select pg_sleep(5);
show password_lock_time;
-------------------------------------------------------------... |
create database twitter_clone;
use twitter_clone;
create table usuarios(
id int not null primary key AUTO_INCREMENT,
nome varchar(100) not null,
email varchar(150) not null,
senha varchar(32) not null
);
create table tweets(
id int not null PRIMARY KEY AUTO_INCREMENT,
id_usuario int not null,
tweet varchar(14... |
-- left/right outer join - from "many" perspective
-- Kimberely is an employee
select first_name, last_name
from employee
where last_name like 'Gr%';
-- the inner join skips Kimberely
select first_name, last_name, name as department
from employee join department
using (department_id)
where last_name like 'Gr%';
-- l... |
-- Creation of table
CREATE TABLE monitoring
(
ts_bucket DateTime,
label_key String,
label_value String,
rules Nested
(
id String,
confusion_matrix Tuple(UInt64, UInt64, UInt64, UInt64),
triggered Array(String)
),
models Nested
(
id String,
scores ... |
-- @testpoint: 清空表数据后执行闪回
--step1: 查询enable_recyclebin默认值; expect:显示默认值off
show enable_recyclebin;
--step2: 修改enable_recyclebin为on; expect:修改成功
alter system set enable_recyclebin to on;
select pg_sleep(2);
show enable_recyclebin;
--step3: 清除回收站; expect:回收站清除成功
purge recyclebin;
--step4: 清除回收站; expect:回收站清除成功
drop t... |
create table user_statuses
(
id int primary key auto_increment,
user_id int not null,
visible bool not null default true,
score_updated_at datetime not null,
unique key user_id_unique_key (user_id),
foreign key user_statuses(user_id) references users(id)
) |
-- UPDATE wormholesystems_new SET statics='C247,U210,P060' WHERE solarsystemid=31002550;
-- UPDATE wormholesystems_new SET statics='J244,Z060' WHERE solarsystemid=31002514;
-- UPDATE wormholesystems_new SET statics='L005,C008,Q003' WHERE solarsystemid=31002587;
-- UPDATE wormholesystems_new SET statics='U210,K346... |
DECLARE @database_name sysname
DECLARE
@REPORT TABLE
(
server_name sysname
, database_name sysname
, schemaname sysname
, table_name sysname
, row_counts bigint
)
DECLARE Csr CURSOR FORWARD_ONLY STATIC FOR
SELECT DB.[name]
FROM master.dbo.sysdatabases DB
WHERE DB.[name] NOT IN ('tempdb'
,'mas... |
CREATE TABLE `location` (
`location_id` int(11) NOT NULL,
`address` varchar(100) DEFAULT NULL,
`phone` varchar(45) DEFAULT NULL,
`hours` varchar(100) DEFAULT NULL,
PRIMARY KEY (`location_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
DELIMITER ;;
DROP PROCEDURE IF EXISTS GetTokenData;;
CREATE PROCEDURE GetTokenData( IN `in_token_id` int(11), IN `in_token_guid` varchar(64), IN `in_password_age` int(11), IN `in_lifespan` int(11), `in_homeurl` varchar(256) )
BEGIN
DECLARE `reset_pass` enum('N','Y');
DECLARE `premium_until` datetime;
DEC... |
/*
Navicat Premium Data Transfer
Source Server : dev
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost
Source Database : pager_config
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : utf-8
Date: 01/29/2019 10:33:23... |
drop table if exists t2;
create table t2(i int,b int);
insert into t2 values(1,3),(2,3),(3,3),(4,3),(5,3),(6,3),(7,3),(8,3),(9,3);
(select i from t2 where i>2 order by i limit 6) union all (select i from t2 where i>7 order by i limit 1,2);
(select i from t2 where i>2 order by i limit 6) union all (select i from t2 wh... |
CREATE TABLE ofUser (
username NVARCHAR(64) NOT NULL,
storedKey VARCHAR(32),
serverKey VARCHAR(32),
salt VARCHAR(32),
iterations INTEGER,
plainPassword NVARCHAR(32),
encryptedPassword NVARCHAR(255),
name NV... |
DELETE FROM agi_av_gb_abgleich_import.gb_daten
;
DELETE FROM agi_av_gb_abgleich_import.differenzen_staging
;
DELETE FROM agi_av_gb_abgleich_import.uebersicht_des_vergleichs_staging
;
|
drop table tokens_stage;
drop table topics_stage;
drop table topic_doc_stage;
drop table topic_token_stage;
|
INSERT INTO `characteristicType` (`name`, `description`, `group`, `id`) VALUES
('checkbox', 'description', 3, 1),
('number', 'description', 4, 2),
('picklist', 'description', 2, 3),
('radio', 'description', 2, 4),
('text', 'description', 1, 5),
('textarea', 'description', 1, 6),
('image', 'description', -1, 7);
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.4 (Debian 10.4-2.pgdg90+1)
-- Dumped by pg_dump version 10.4 (Debian 10.4-2.pgdg90+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
S... |
CREATE VIEW public.v1 AS
SELECT t1.c1,
t2.c2
FROM public.t1,
public.t2;
ALTER TABLE public.v1 OWNER TO botov_av; |
ALTER TABLE user
ADD COLUMN address VARCHAR(255) NULL after last_name,
ADD COLUMN city VARCHAR(255) NULL after address,
ADD COLUMN postal_code VARCHAR(50) NULL after city,
ADD COLUMN state VARCHAR(100) NULL after postal_code,
ADD COLUMN entity_type VARCHAR(20) NULL after country,
... |
SELECT pull_request_id,
EXTRACT(epoch FROM (max(pull_request_merged_at) - max(pull_request_created_at))) AS merge_time_duration
FROM pull_requests AS prs
WHERE pull_request_merged_at IS NOT NULL
AND pr_author_login NOT IN (SELECT username FROM bots)
GROUP BY pull_request_id; |
select
--pposlovnipartner.naziv(ppartner),
d.status, d.datum_dok, d.godina, d.vrsta_dok, d.tip_dok, ppartner, d.broj_dok, d.broj_dok1, sd.proizvod, sd.cena, sd.valuta, sd.kolicina,
sd.k_robe, sd.realizovano, sd.rabat, sd.faktor, sd.cena1
,OdgovarajucaCena(D.Org_deo , Sd.proizvod , d.datum_dok, sd.faktor, sd.valuta,... |
-- 2021-04-14T13:45:09.787Z
-- 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,IsNotifyUserA... |
SELECT t.*
FROM stadium t
LEFT JOIN stadium p1 ON t.id - 1 = p1.id
LEFT JOIN stadium p2 ON t.id - 2 = p2.id
LEFT JOIN stadium n1 ON t.id + 1 = n1.id
LEFT JOIN stadium n2 ON t.id + 2 = n2.id
WHERE (t.people >= 100 AND p1.people >= 100 AND p2.people >= 100)
OR (t.people >= 100 AND n1.people >= 100 AND n2.people... |
use mndc;
insert into military_unit(mu_name,mu_type)
values
('해군',2),
('해군본부',2),
/**/('일반참모부',2),
/**/('기획관리참모부(구 전력기획참모부)',2),
/**/('인사참모부',2),
/**/('정보작전참모부(구 정보작전지원참모부)',2),
/**/('군수참모부',2),
/**/('정보화기획참모부(구 정보화기획실)',2),
/**/('특별참모부',2),
('직할부대',2),
/**/('진해기지사령부/진해특정경비지역사령부',2),
/**//**/('항만방어전대',2),
/**//**/('시설전... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.2 (Ubuntu 13.2-1.pgdg18.04+1)
-- Dumped by pg_dump version 13.2 (Ubuntu 13.2-1.pgdg18.04+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings =... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 30-Maio-2020 às 01:16
-- Versão do servidor: 10.4.11-MariaDB
-- versão do PHP: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
CREATE TABLE password_reminders (
"email" varchar(191) NOT NULL,
"token" varchar(191) NOT NULL,
"created_at" timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
);
|
SHOW server_version;
--
-- partitioned heap table with data
--
CREATE TABLE p_basic (id INTEGER, name TEXT) DISTRIBUTED BY (id) PARTITION BY RANGE(id) (START(1) END(3) EVERY(1));
INSERT INTO p_basic VALUES (1, 'Jane');
INSERT INTO p_basic VALUES (2, 'John');
--
-- range partitioned heap table and add partitions with ... |
DROP VIEW IF EXISTS vetd.groups_by_product_discount;
--;;
CREATE OR REPLACE VIEW vetd.groups_by_product_discount AS SELECT "gd"."id" AS "ref_id", "gd"."deleted" AS "ref_deleted", "gd"."product_id", "g"."id", "g"."idstr", "g"."created", "g"."deleted", "g"."gname", "g"."admin_org_id" FROM "group_discounts" "gd" INNER JOI... |
INSERT INTO users (user_name, user_email, user_password) VALUES ('Sarah', 'sarahfinck95@gmail.com', 'Boxing1');
INSERT INTO users (user_name, user_email, user_password) VALUES ('Becky', 'pcgwriter@yahoo.com', 'Webdev1');
INSERT INTO media (media_name, media_type, media_artist, media_location, media_rating, user_id) VA... |
begin;
select plan(10);
create table cif.test_table
(
id integer primary key generated always as identity,
allowed text,
not_allowed text
);
create role test_role;
select has_function(
'cif_private', 'verify_grant',
'Function verify_grant should exist'
);
-- Passes when should pass
grant all on table cif... |
drop table conversations_state;
|
select name, id from test;
|
CREATE SCHEMA IF NOT EXISTS db_hdb_guess
DEFAULT CHARACTER SET utf8
COLLATE utf8_general_ci;
USE db_hdb_guess;
DROP TABLE IF EXISTS `conn_test`;
CREATE TABLE `conn_test` (
`a` char(1) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
DROP TABLE IF EXISTS guess_match;
CREATE TABLE `guess_match` (
`id` BIGIN... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.6 (Debian 12.6-1.pgdg100+1)
-- Dumped by pg_dump version 12.6 (Debian 12.6-1.pgdg100+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;... |
INSERT INTO PROTOCOL_ACTION_TYPE (PROTOCOL_ACTION_TYPE_CODE,DESCRIPTION,TRIGGER_SUBMISSION,TRIGGER_CORRESPONDENCE,UPDATE_TIMESTAMP,UPDATE_USER,VER_NBR,FINAL_ACTION_FOR_BATCH_CORRESP,OBJ_ID)
VALUES(131,'Withdraw Submission Request','N','N',SYSDATE,'admin',1,'N',SYS_GUID())
/
INSERT INTO SUBMISSION_TYPE (SUBMISSIO... |
CREATE OR REPLACE FUNCTION MarkAllUpdatedExceptBulk (
zonenames varchar[],
change_ids bigint[]
) RETURNS void AS $$
DECLARE
nameserver_id_var int;
BEGIN
IF array_lower(zonenames, 1) != array_lower(change_ids, 1) OR array_upper(zonenames, 1) != array_upper(change_ids, 1) THEN
RAISE EXCEPTION 'number of zon... |
--
-- 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")... |
-- Adding new fields, creating/updating indices and foreign keys.
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
ALTER TABLE "COMPONENT"
ADD COLUMN "AUTHOR" VARCHAR(255),
ADD COLUMN "BLAKE2B_256" VARCHAR(64),
ADD COLUMN "BLAKE2B_384" VARCHAR(96),
ADD COLUMN "BLAKE2B_512" VARCHAR(128)... |
DROP TABLE IF EXISTS cards;
DROP TABLE IF EXISTS cardsets;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS sessions; |
/**************************************************************************
* Copyright 2016 Observational Health Data Sciences and Informatics (OHDSI)
*
* 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 Li... |
-- Copyright (c) YugaByte, Inc.
-- This file is empty because this migration is already taken care of by V57.
-- We would not need this if we had the feature where missing migrations
-- could be ignored.
|
ALTER DATABASE [$(DatabaseName)]
ADD FILEGROUP [WWIDW_InMemory_Data] CONTAINS MEMORY_OPTIMIZED_DATA;
|
BEGIN
CREATE TABLE app_institute (
id int auto_increment primary key,
name varchar(30) not null,
status char(1) default 'A',
user_add varchar(50) not null,
date_add datetime default current_timestamp,
user_update varchar(50),
date_update datetime
);
END
BEGIN
CREATE TABLE app_users (
id int auto_... |
--Unmapped drugs
SELECT *
FROM (
select ROW_NUMBER() OVER(ORDER BY count_big(drug_exposure_id) DESC) AS ROW_NUM,
drug_source_value as "Source Value",
floor((count_big(drug_exposure_id)+99)/100)*100 as "#Records",
floor((count_big(distinct person_id)+99)/100)*100 as "#Subjects"
from @cdmDat... |
DROP INDEX changes_parent_change_id_idx;
|
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pgaudit" to load this file.\quit
|
SELECT INJ.state as "State",
INJ.State_Rank as "State Rank",
INJ.Active_company_count as "Active Company Count [Q4-2016]",
INJ.Industry_type as "Industry Type",
INJ.Ticket_Volume_Rank as "Ticket Volume Rank [By Industry]",
INJ.ticket_volume as "Ticket Volume Count [By Industry] ",
... |
-- Name: GetFileIdByDigest
-- Schema: posda_files
-- Columns: ['file_id']
-- Args: ['digest']
-- Tags: ['import_events', 'QIN-GBM-DSC-MRI-DRO/Barrow']
-- Description: Counts query by Collection, Site
--
select file_id from file where digest = ? |
-- Laat alle werknemer informatie zien
SELECT *
--SELECT FirstName, LastName, IsTeamLeader, TeamLeaderId
FROM Employee AS e
LEFT JOIN EmployeeProductionWorker AS pw ON e.Id = pw.EmployeeId
LEFT JOIN EmployeeHRManager AS hr ON e.Id = hr.EmployeeId
LEFT JOIN EmployeeSalesManager AS sm ON e.Id = sm.EmployeeId;
-- Laat al... |
-- alter table which create using int,time,date,timestamp and range partition on date field having maxvalue of inserting data to remove partition
create table range_test(id int not null ,
test_time time,
test_date date,
test_timestamp timestamp,primary key(id,test_date))
PARTITION BY RANGE (te... |
SELECT contact_id, location_type_id, is_primary, phone, phone_ext, phone_numeric, phone_type_id
FROM civicrm_phone p JOIN civicrm_contact c ON p.contact_id = c.id
WHERE c.contact_type = 'individual' AND c.is_deleted = 0; |
-- CreateTable
CREATE TABLE "bootcamp" (
"id" UUID NOT NULL DEFAULT gen_random_uuid(),
"firstName" VARCHAR(30) NOT NULL,
"lastName" VARCHAR(30) NOT NULL,
CONSTRAINT "bootcamp_pkey" PRIMARY KEY ("id")
);
|
/*
* Copyright 2019 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
CREATE TABLE #Codesets (
ancestor_concept_id bigint NOT NULL,
concept_id bigint NOT NULL
)
;
INSERT INTO #Codesets (ancestor_concept_id, concept_id)
SELECT ancestor_concept_id, descendant_concept_id
FROM @cdm_database_schema.CONCEPT_ANCESTOR
WHERE ancestor_concept_id IN (@outcome_ids)
;
INSERT INTO @target_dat... |
/* Replace with your SQL commands */
update language_goals set goal = 5 where goal=100 and type='text';
update language_goals set goal = 5 where goal=100 and type='asr';
update language_goals set goal = 5000 where goal=10000 and type='ocr';
update language_goals set goal = 5000 where goal=10000 and type='parallel';
|
DROP FUNCTION IF EXISTS copy_rank_answers_to_tmp(in_questionnaire_id INT);
CREATE FUNCTION copy_rank_answers_to_tmp(in_questionnaire_id INT)
RETURNS VOID
LANGUAGE plpgsql AS $$
BEGIN
WITH rank_answers_to_copy AS (
SELECT * FROM questionnaire_answer_types(in_questionnaire_id, 'RankAnswer')
)
INSERT INTO tmp_ra... |
clear screen
set serveroutput on size unlimited
begin
insert into logger_prefs(pref_name, pref_value, pref_type) values ('LOGGER_AA_SIZE','100','LOGGER_AA');
commit;
end;
/
begin
insert into logger_prefs(pref_name, pref_value, pref_type) values ('LOGGER_AA_PREFIX','#','LOGGER_AA');
commit;
end;
/
begin
inser... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 15 Apr 2021 pada 08.34
-- Versi server: 10.1.32-MariaDB
-- Versi PHP: 5.6.36
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
/*---------authors table---------*/
INSERT INTO authors(author_id, name, nationality)
VALUE(NULL, 'Juan Rulfo', 'MEX');
INSERT INTO authors(name, nationality)
VALUES('Gabriel García Márquez', 'COL');
INSERT INTO authors
VALUES(NULL, 'Juan Gabriel Vazquez', 'COL');
INSERT INTO authors(name, nationality)
VALUES ('Juli... |
-- initialising the customer_type
update control_cif_cip cc set cc.type_cif = (select cu.customer_type from xafnfc.sttm_customer cu WHERE cu.customer_no = cc.customer_no)
SELECT * FROM control_cif_cip;
-- Rejected Records
SELECT cu.local_branch,cu.customer_no,decode(cp.sex,'F',cu.udf_3,cp.last_name) birth_name,
cp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.