text stringlengths 1 1.05M |
|---|
-- add upstream species codes to pscis/model combined table
ALTER TABLE fish_passage.pscis_model_combined ADD COLUMN species_codes text[];
UPDATE fish_passage.pscis_model_combined a
SET species_codes = spp.species_codes
FROM
(
SELECT
pscis_model_combined_id,
array_agg(species_codes) as species_codes
FROM
... |
-- @testpoint:openGauss关键字Goto(非保留),同时作为表名和列名带引号,建表成功
drop table if exists "Goto";
create table "Goto"(
c_id int, c_int int, c_integer integer, c_bool int, c_boolean int, c_bigint integer,
c_real real, c_double real,
c_decimal decimal(38), c_number number(38), c_numeric numeric(38),
c_char char(50) default null, ... |
/*
Navicat Premium Data Transfer
Source Server : localhost_mysql
Source Server Type : MySQL
Source Server Version : 50726
Source Host : localhost:3306
Source Schema : innovative
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 09/0... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 29, 2017 at 10:21 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
-- @testpoint:openGauss关键字generated(非保留),作为列名带引号并且更新时使用该列,建表成功,generated的值更新为100
drop table if exists explain_test;
create table explain_test(
c_id int, c_int int, c_integer integer, c_bool int, c_boolean int, c_bigint integer,
c_real real, c_double real,
c_decimal decimal(38), c_number number(38), c_numeric num... |
--Signup-80
ALTER TABLE signup_meetings ADD category varchar2(255 char) default null; |
CREATE ROLE [DataViewing] AUTHORIZATION [dbo]
GO
-- Grant access rights to a specific schema in the database
GRANT
-- REFERENCES,
SELECT,
VIEW DEFINITION
ON SCHEMA::dbo
TO DataViewing
GO
-- Grant access rights to a specific schema in the database
GRANT
-- REFERENCES,
SELECT,
VIEW DEFINITION
ON SCHEMA::... |
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 17, 2017 at 10:02 AM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
CREATE FUNCTION [catalog].[get_version_log_size]()
RETURNS bigint
AS
BEGIN
DECLARE @value bigint
SELECT @value = internal.get_space_used('internal.object_versions')
RETURN @value
END
|
create table T(A int not null);
insert into T values(NULL);
|
CREATE VIEW [dbo].[netsqlazman_StoreAttributesView]
AS
SELECT [netsqlazman_Stores].StoreId, [netsqlazman_Stores].Name, [netsqlazman_Stores].Description, [netsqlazman_StoreAttributes].StoreAttributeId, [netsqlazman_StoreAttributes].AttributeKey, [netsqlazman_StoreAttributes].AttributeValue
FROM dbo.[netsqla... |
#standardSQL
# 13_23a: Tag Managers share on eCommerce origins broken down by device
SELECT
_TABLE_SUFFIX AS client,
app,
COUNT(DISTINCT url) AS freq,
total,
COUNT(DISTINCT url) / total AS pct
FROM
`httparchive.technologies.2020_08_01_*`
JOIN (
SELECT
_TABLE_SUFFIX,
url
FROM
`httparchive.tec... |
/*
SQLyog Job Agent v10.42 Copyright(c) Webyog Inc. All Rights Reserved.
MySQL - 5.5.5-10.1.13-MariaDB : Database - hris
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 ... |
/* assumes pg_show_plans extension */
select
max((extract(epoch from now()) * 1e9)::int8) as epoch_ns,
max(extract(epoch from now() - query_start))::int as max_s,
avg(extract(epoch from now() - query_start))::int as avg_s,
count(*),
array_to_string(array_agg(distinct usename order by usename), ',') as "users"... |
-- studio page and widget
DELETE FROM `tp`, `tw`, `tpw`
USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_profiler';
|
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 20, 2021 at 03:45 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 14, 2017 at 09:30 AM
-- Server version: 5.7.14
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
--test like function and its two operands are nchar and varchar
create class tb(
col1 varchar,
col2 nchar(20),
col3 date,
col4 time,
col5 timestamp
);
insert into tb values('varchar', n'nchar', '5/5/2008', '8:8:8 am', '5/5/2008 8:8:8 am');
insert into tb values('aaa1', n'naaa1', '5/5/2008', '8:8:8 am', '5/5/2008 ... |
CREATE TABLE [dbo].[Table]
(
[Id] INT NOT NULL PRIMARY KEY IDENTITY,
[UrlCorta] NCHAR(10) NULL,
[UrlLarga] NCHAR(3000) NULL,
[FechaCreacion] DATETIME NULL,
[FechaExpira] DATETIME NULL,
[Habilitado] TINYINT NULL,
[NumVisitas] BIGINT NULL
)
|
USE [ANTERO]
GO
IF EXISTS
(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='sa' AND TABLE_NAME='sa_suorat_amk7d_rekrytointi_valitun_kaikki_tiedot')
BEGIN
DROP TABLE [sa].[sa_suorat_amk7d_rekrytointi_valitun_kaikki_tiedot];
END
IF NOT EXISTS
(SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='sa... |
ALTER TABLE service ADD need_client_list INTEGER;
ALTER TABLE service ADD CONSTRAINT service_need_client_list_ck CHECK (need_client_list IN (0, 1));
UPDATE service SET need_client_list = 1;
ALTER TABLE service MODIFY (need_client_list INTEGER CONSTRAINT service_need_client_list_nn NOT NULL);
QUIT;
|
INSERT INTO matches(key, event, match_level, match_number, set_number)
VALUES (
?,
(SELECT id FROM events WHERE code == ?),
(SELECT id FROM match_levels WHERE key == ?),
?, ?
); |
-- Null numbers = 0
SELECT Name, ISNULL(TRY_CAST (Size As Integer),0) AS NumericSize
FROM SalesLT.Product;
-- Null strings = blank string
SELECT ProductNumber, ISNULL(Color,'') + ',' + ISNULL(Size,'') As ProductDetails
FROM SalesLT.Product;
-- find first non-null date
SELECT Name, Coalesce(DiscontinuedDate, SellEndDa... |
CREATE OR REPLACE FUNCTION public.add_asset_group()
RETURNS trigger
LANGUAGE plpgsql
AS $function$
DECLARE
groupId INTEGER;
BEGIN
INSERT INTO groups("name", "groupType", "createdById")
values('auto', 'auto', NEW."createdById")
RETURNING id INTO groupId;
INSERT INTO groups_users("groupId", "user... |
-- Name: GetXlsxToConvert
-- Schema: posda_files
-- Columns: ['file_id', 'file_type', 'file_sub_type', 'collection', 'site', 'subject', 'visibility', 'date_last_categorized']
-- Args: ['collection']
-- Tags: ['radcomp']
-- Description: Add a filter to a tab
select
file_id, file_type, file_sub_type, collection, site... |
/* This sql template creates categorical lab values based on the observed lab value
comapred to the listed normal range of the test.
A variable called `test_abnormal` checks if the lab value is within the listed normal range.
It is coded as follows: abnormal yes=1/no=0
There is a second variable called `test_ordina... |
PRAGMA foreign_keys= off;
BEGIN TRANSACTION;
UPDATE schema_information SET value = "6" WHERE key = "version";
CREATE TABLE `transaction`
(
transaction_id CHAR(44) NOT NULL PRIMARY KEY, -- sha256 in base64
shard_id CHAR(32) NOT NULL,
transaction_date INT NOT NULL,
node_id_origi... |
CREATE USER machtest WITH PASSWORD 'testdb';
CREATE DATABASE machtest_dev WITH OWNER machtest;
CREATE DATABASE machtest_test WITH OWNER machtest;
\c machtest_dev
CREATE EXTENSION "uuid-ossp";
\c machtest_test
CREATE EXTENSION "uuid-ossp";
|
DROP DATABASE IF EXISTS IDCP;
CREATE DATABASE IDCP;
USE IDCP;
CREATE TABLE IF NOT EXISTS BUG_REPORT(
BUG_ID INT AUTO_INCREMENT PRIMARY KEY,
NAME VARCHAR(255),
EMAIL VARCHAR(255),
COMMENT TEXT
);
CREATE TABLE IF NOT EXISTS IDCP_USER(
USER_ID VARCHAR(255) PRIMARY KEY,
USER_PWD VARCHAR(255) NOT NULL,
... |
kern.sysv.shmmax=4194304
kern.sysv.shmmin=1
kern.sysv.shmmni=32
kern.sysv.shmseg=8
kern.sysv.shmall=1024
|
insert into main.sqlite_master (type, name, tbl_name, rootpage, sql) values ('table', 'woord', 'woord', 2, 'CREATE TABLE woord
(
id INTEGER not null
constraint woord_pk
primary key autoincrement,
uid VARCHAR(36) not null,
content VARCHAR(255) not null,
created_at BIGINT not null
)');
insert into main.sqlite_ma... |
CREATE OR REPLACE FUNCTION actualizar_avance(tipo integer, avanceActual integer, id_medida_new integer) RETURNS void AS $q$
DECLARE
meta integer;
BEGIN
case tipo
when 1 then
select into meta "metaDinero" from eventos where id_medida = id_medida_new;
UPDATE eventos set "actualDinero" = avanceActual where... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 11-Set-2021 às 04:34
-- Versão do servidor: 10.4.13-MariaDB
-- versão do PHP: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
{%- macro get_adapter_type() -%}
{%- set macro = adapter.dispatch('get_adapter_type', 'dbtvault')() -%}
{%- do return(macro) -%}
{%- endmacro %}
{%- macro default__get_adapter_type() -%}
{%- do return("snowflake") -%}
{%- endmacro -%}
{%- macro sqlserver__get_adapter_type() -%}
{%- do return("sq... |
alter table heap_table_for_alter set tablespace twophase_test_ts2;
|
-- specify the schema used
USE NewsCrawler;
-- select all articles extracted
SELECT * FROM articles;
-- count the number of articles per site
SELECT COUNT(*) FROM articles WHERE website="tanea.gr";
-- Return the different websites articles have been extracted
SELECT DISTINCT website FROM articles;
-- Delete article... |
-- Add a foreign key column to employee-table refrencing company-table
ALTER TABLE EMPLOYEE
ADD CONSTRAINT COMPANY_TO_EMPLOYEE
FOREIGN KEY (COMPANY_ID) REFERENCES COMPANY(ID);
|
-- Работаем в Oracle APEX
-- Создадим базу с содержимым на двух языках (как студенты разных кафедр сдавали предметы в сессию).
drop table STUDENT_TEST;
drop table TEST_RU;
drop table TEST_EN;
drop table STUDENT;
drop table FACULTY_RU;
drop table FACULTY_EN;
create table FACULTY_RU (
Faculty_Letter varchar2(5),
... |
IF OBJECT_ID('[Reports].[TransitStatesConcat]') IS NULL
EXEC('CREATE VIEW [Reports].[TransitStatesConcat] AS SELECT 1 AS [NOTHING];')
GO
ALTER VIEW [Reports].[TransitStatesConcat]
AS
SELECT
T.NotificationId,
STUFF(( SELECT ', ' + TS.CountryCode AS [text()]
FROM [Reports].[Transi... |
CREATE TABLE localities (id BIGINT NOT NULL,
results_id BIGINT REFERENCES results (id) NOT NULL,
PRIMARY KEY (results_id, id),
name TEXT,
state_id BIGINT,
type TEXT,
elec... |
/* @name Create */
WITH relationship AS (
INSERT INTO follow_relationships (follower_id, followee_id)
VALUES (:followerId, :followeeId)
RETURNING id
)
UPDATE profile_keys
SET in_follow_relationship_id = (SELECT id FROM relationship)
WHERE owner_id = :followeeId
AND recipient_id = :followerId;
/* @name Dest... |
SELECT pg_stat_database.datname,
pg_stat_database.blks_read,
pg_stat_database.blks_hit,
round((pg_stat_database.blks_hit::double precision
/ (pg_stat_database.blks_read
+ pg_stat_database.blks_hit
+ 1)::double precision * 100::double precis... |
/* contrib/dist_fdw/dist_fdw--1.0.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION dist_fdw" to load this file. \quit
CREATE FUNCTION dist_fdw_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT NOT FENCED;
CREATE FUNCTION dist_fdw_validat... |
USE dqlab;
CREATE TABLE IF NOT EXISTS products (
`product_id` INT,
`desc_product` VARCHAR(73) CHARACTER SET utf8,
`category` VARCHAR(21) CHARACTER SET utf8,
`base_price` INT
);
INSERT INTO
products
VALUES
(1, 'OLIVIA KULOT OLV03', 'Pakaian Wanita', 110000),
(2, 'BLANIK BLOUSE ... |
-- @testpoint:opengauss关键字condition_number(非保留),作为模式名
--关键字不带引号-成功
drop schema if exists condition_number;
create schema condition_number;
drop schema condition_number;
--关键字带双引号-成功
drop schema if exists "condition_number";
create schema "condition_number";
drop schema "condition_number";
--关键字带单引号-合理报错
drop schem... |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!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' */;
CREATE TABLE IF NOT EXISTS `locale... |
--
-- Test domains.
--
-- Test Comment / Drop
create domain domaindroptest int4;
comment on domain domaindroptest is 'About to drop this..';
create domain dependenttypetest domaindroptest;
-- fail because of dependent type
drop domain domaindroptest;
drop domain domaindroptest cascade;
-- this should fail because ... |
/****** Object: Table [T_Organism_DB_File] ******/
/****** RowCount: 544 ******/
SET IDENTITY_INSERT [T_Organism_DB_File] ON
INSERT INTO [T_Organism_DB_File] (ID, FileName, Organism_ID, Description, Active, NumProteins, NumResidues, Valid, OrgFile_RowVersion) VALUES (100,'Zebrafish_2002-03-29.fasta',18,'',0,586,254... |
CREATE PROCEDURE [Demo].[spPersonGetDetail]
@PersonId AS UNIQUEIDENTIFIER
AS
BEGIN
/*
* This is automatically generated; any changes will be lost.
*/
SET NOCOUNT ON;
SELECT
[p].[PersonId]
,[p].[FirstName]
,[p].[LastName]
,[p].[Birthday]
,[p].[GenderId]
,[p].... |
/*
SQLyog Ultimate v11.27 (64 bit)
MySQL - 5.7.14-log : Database - blog
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECK... |
DROP TABLE [HPA].[HDC_INFO];
GO
CREATE TABLE [HPA].[HDC_INFO] (
[PK_HDC_INFO] [INT] NOT NULL IDENTITY (1, 1)
CONSTRAINT PK_HDC_INFO PRIMARY KEY,
[PRISON_NUMBER] [VARCHAR](8) NOT NULL,
[DATE] [DATE] NULL,
[TIME] [DECIMAL](10) NULL,
[STAGE] [VAR... |
/* HitDirs.ddl */
//----------------------------------------------------------------------------------------
//
// Project: CCore 3.00
//
// Tag: Desktop
//
// License: Boost Software License - Version 1.0 - August 17th, 2003
//
// see http://www.boost.org/LICENSE_1_0.txt or the local copy
//
// Copyrigh... |
/* Replace with your SQL commands */
DROP TABLE IF EXISTS users; |
DROP TABLE IF EXISTS satd.Commits, satd.SATD, satd.SATDInFile, satd.Projects;
CREATE TABLE IF NOT EXISTS satd.Projects (
p_id INT AUTO_INCREMENT NOT NULL,
p_name VARCHAR(255) NOT NULL UNIQUE,
p_url VARCHAR(255) NOT NULL UNIQUE,
PRIMARY KEY (p_id)
);
CREATE TABLE IF NOT EXISTS satd.SATDInFile (
f_id INT ... |
--
-- Upgrade script
--
-- Adds a dynamic_p column to notification_requests
--
-- @author Lars Pind (lars@pinds.com)
-- @creation-date 2003-02-06
--
-- add the column
alter table notification_requests add dynamic_p bool;
alter table notification_requests alter dynamic_p set default 'f';
update notification_request... |
-- PHP Version: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!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 utf8mb4 ... |
CREATE TABLE [config].[PersonalReminder]
(
[PersonalReminderID] INT NOT NULL IDENTITY(1, 1),
[CronSchedule] VARCHAR(64) NOT NULL,
[DiscordChannelID] DECIMAL(20, 0) NOT NULL,
[UserToRemind] DECIMAL(20, 0) NOT NULL,
[Text] VARCHAR(1024) NOT NULL,
CONSTRAINT [PK_PersonalReminder] PRIMARY KEY CLUSTE... |
-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: website
-- ------------------------------------------------------
-- Server version 5.5.46-0ubuntu0.14.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@C... |
INSERT INTO mine_incident_followup_investigation_type
(
mine_incident_followup_investigation_type_code,
description,
display_order,
active_ind,
create_user,
update_user
)
VALUES
('HUK', 'Historical - Unknown', 40, 'F', 'system-mds', 'system-mds')
ON CONFLICT DO NOTHING;
ALTER TABLE mine_incident ADD COLUMN ... |
-- =============================================
-- Author: Bill Campbell
-- Create date: 20180930
-- Description: Reconstructs a batch of segments
-- inta a X12 string
-- =============================================
CREATE PROCEDURE [dbo].[usp_Batch_ExtractAsX12]
@batchId INT,
@x12 VARCHAR(MAX) OUTPUT
AS
BEGIN
... |
DROP TABLE IF EXISTS tundra
|
-- @product_version gpdb: [4.3-4.3.98]
DROP EXTERNAL TABLE IF EXISTS exttab_cte_1;
DROP EXTERNAL TABLE IF EXISTS exttab_cte_2;
DROP TABLE IF EXISTS exttab_cte_err;
-- Generate the file with very few errors
\! python @script@ 10 2 > @data_dir@/exttab_cte_1.tbl
-- does not reach reject limit
CREATE EXTERNAL TABLE extt... |
-- row based filtering
SELECT * FROM pglogical_regress_variables()
\gset
\c :provider_dsn
SELECT pglogical.replicate_ddl_command($$
CREATE TABLE public.basic_dml (
id serial primary key,
other integer,
data text,
"SomeThing" interval
);
$$);
-- used to check if initial copy does row filtering
\COPY basic_dm... |
with extension_oids as (
select
objid
from
pg_depend d
WHERE
d.refclassid = 'pg_extension'::regclass
), enums as (
SELECT
t.oid as enum_oid,
n.nspname as "schema",
pg_catalog.format_type(t.oid, NULL) AS "name"
FROM pg_catalog.pg_type t
LEFT JOIN pg_catalog.pg_namespace n ... |
CREATE EXTENSION IF NOT EXISTS postgis CASCADE;
CREATE EXTENSION IF NOT EXISTS btree_gist CASCADE;
CREATE SCHEMA IF NOT EXISTS clouds;
-- STAGE 0: Create necessary functions and tables
-- DROP FUNCTION clouds.construct_TTB
CREATE OR REPLACE FUNCTION clouds.construct_TTB(
origin GEOMETRY,
inner_radius NUMERIC... |
-- Storage for PR
CREATE TABLE alldata_pr() inherits (alldata);
GRANT SELECT on alldata_pr to nobody,apache;
CREATE UNIQUE index alldata_PR_idx on alldata_PR(station, day);
CREATE INDEX alldata_PR_day_idx on alldata_PR(day);
CREATE INDEX alldata_PR_sday_idx on alldata_PR(sday);
CREATE INDEX alldata_PR_stationid_idx o... |
SET SCHEMA 'zafira';
INSERT INTO SETTINGS (NAME, VALUE, TOOL) VALUES
('GOOGLE_CLIENT_SECRET_ORIGIN', '', 'GOOGLE'),
('GOOGLE_ENABLED', false, 'GOOGLE'),
('LDAP_DN', '', 'LDAP'),
('LDAP_SEARCH_FILTER', '', 'LDAP'),
('LDAP_URL', '', 'LDAP'),
('LDAP_MANAGER_USER', '', 'LDAP'),
('LDAP_MANAGER_P... |
--Drop Sequence for Tables
drop table addresses;
drop table customerCarts;
drop table managersCarts;
drop table customerOrderHistory;
drop table storeOrderHistory;
drop table customerOrderLineItems;
drop table inventoryLineItems;
drop table inventory;
drop table storeOrderLineItems;
drop table managers;
drop table loca... |
-- phpMyAdmin SQL Dump
-- version 4.4.13.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 09 Feb 2017 pada 10.16
-- Versi Server: 5.6.31-0ubuntu0.15.10.1
-- PHP Version: 5.6.11-1ubuntu3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLI... |
-- This query extracts:
-- i) a patient's first code status
-- ii) a patient's last code status
-- iii) the time of the first entry of DNR or CMO
with t1 as
(
select icustay_id, charttime, value
-- use row number to identify first and last code status
, ROW_NUMBER() over (PARTITION BY icustay_id order b... |
alter table PETCLINIC_VISIT add column DTYPE varchar(31) ;
alter table PETCLINIC_VISIT add column TREATMENT_ROOM_ID varchar(36) ;
|
CREATE INDEX ON key USING GIN (id gin_trgm_ops);
CREATE INDEX ON key USING GIN (description gin_trgm_ops); |
CREATE TABLE `demo`.`mapservice` (
`globalid` INT(10) NOT NULL , `id` INT(11) NOT NULL , `employeename` VARCHAR(255) NOT NULL ,
`location` VARCHAR(255) NOT NULL , `skilllevel` INT(3) NOT NULL , `skillset` VARCHAR(1000) NOT NULL ,
`submission_status` INT(3) NOT NULL , `bid_status` INT(3) NOT NULL , `agreed_status` IN... |
-- additional info https://docs.microsoft.com/ru-ru/sql/relational-databases/data-compression/data-compression
declare @table_name sys.sysname, @IS_CLUSTERED bit, @SQL nvarchar(1000)
declare @c cursor
set @c = cursor local fast_forward for
select distinct s.name + '.' + o.name, coalesce( (select 1 from sys.indexes ... |
SELECT
v.product_id AS productId,
v.id AS skuId,
p.purchase_prices AS purchasePrices,
i.urls AS urls,
inv.inventory_count AS inventoryCount
FROM `raw.variants` v
LEFT JOIN `tmp.item_purchase_prices` p ON p.sku_id = v.id
LEFT JOIN `tmp.variant_images` i ON i.sku_id = v.id
LEFT JOIN `tmp.invento... |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!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' */;
# Dumping structure for table galaxy.force_sensitive_quest_list
D... |
-- Narkk`s Handbombs
-- By Mikadmin For Arkania
-- Fix spawn & gameobject_template
REPLACE INTO `gameobject_template` (`entry`, `type`, `displayId`, `name`, `IconName`, `castBarCaption`, `unk1`, `faction`, `flags`, `size`, `questItem1`, `questItem2`, `questItem3`, `questItem4`, `questItem5`, `questItem6`, `data0`, `da... |
--CREATE DATABASE [movie-db];
USE [movie-db];
CREATE TABLE [dbo].[Directors](
[Id] [int] IDENTITY(1,1) PRIMARY KEY,
[Name] [nvarchar](50) NOT NULL,
);
CREATE TABLE [dbo].[Movies](
[Id] [int] IDENTITY(1,1) PRIMARY KEY,
[Name] [nvarchar](50) NOT NULL,
[DirectorId] [int] NOT NU... |
/**
* \file
* \brief Unit tests for the public types.
* \author Chris Oldwood
*/
create procedure test._@Test@_False_ShouldReturnZero
as
declare @actual ssunit.Bool = ssunit.False();
exec ssunit.AssertIntegerEqualTo 0, @actual;
go
create procedure test._@Test@_True_ShouldReturnOne
as
declare @actual ssunit.B... |
/*
SQLyog Enterprise v12.08 (32 bit)
MySQL - 5.6.41 : Database - xy
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@... |
INSERT INTO crypto_algorithm (algorithm_id, external_id, encryptor_class, encryptor_params)
VALUES(1000504, 'psGLvQpt9Q', 'de.adorsys.psd2.consent.service.security.provider.aes.AesEcbInstanceFactoryImpl', 'AES/ECB/PKCS5Padding_#_5_#_256_#_1024_#_PBKDF2WithHmacSHA256');
INSERT INTO crypto_algorithm (algorithm_id, exter... |
/*
* Greenplum system views and functions.
*
* Portions Copyright (c) 2009-2010, Greenplum inc.
* Portions Copyright (c) 2012-Present VMware, Inc. or its affiliates.
*
*/
BEGIN;
CREATE SCHEMA gp_toolkit;
GRANT USAGE ON SCHEMA gp_toolkit TO public;
--------------------------------------------------------------... |
DROP DATABASE IF EXISTS FCA;
CREATE DATABASE FCA;
USE FCA;
DROP TABLE IF EXISTS customer;
CREATE TABLE customer
(
ID INT NOT NULL AUTO_INCREMENT,
Voornaam VARCHAR(50),
Tussenvoegsel VARCHAR(10),
Achternaam VARCHAR(50),
Telefoonnummer INT,
Email VARCHAR(50),
Geboortedatum VARCHAR(50),
Plaats VARCHAR(30)... |
-- Verify arunashop:tables on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;
|
INSERT INTO tweb_apbd(`berkas_id`,`lembaga_id`, `lembaga_kode`, `wilayah_kode`,`tahun`, `rekening_kode`, `uraian`, `nominal`,`nominal_sebelum`, `nominal_sesudah`, `nominal_perubahan`, `nominal_persen`, `keterangan`, `created_by`, `updated_by`) VALUES
('213','144','1.19.01','3401','2015','1.19.1.19.02.00.00.5.','BELANJ... |
SET FOREIGN_KEY_CHECKS=0;
CREATE TABLE IF NOT EXISTS `adm_attr_group` (
`id_adm_attr_group` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id_adm_attr_group',
`name` varchar(64) DEFAULT NULL COMMENT '组名',
PRIMARY KEY (`id_adm_attr_group`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS `adm_ci_type` ... |
/*
This script is to redact a brief response and also all related audit messages.
This is very dangerous - you should only run it after testing on non-production environments, and with the agreement of
IA.
To apply this script, target the correct environment with `cf target -s <desired environment>`, then run
`cf con... |
autocommit off;
call login('dba') on class db_user;
call add_user('USER13_1') on class db_user;
call add_user('USER13_2') on class db_user;
create class foo13(da int, db int, dc int);
call login('USER13_1') on class db_user;
select *
from db_class
where class_name = 'foo13'
order by class_name;
call login('dba') on ... |
SELECT datname, xact_commit, xact_rollback,
CASE WHEN xact_commit = 0 THEN 0 ELSE round((( xact_rollback::decimal / (xact_commit + xact_rollback)::decimal) * 100.0 )::decimal, 3) END as ratio
FROM pg_stat_database
ORDER BY xact_rollback DESC;
|
-- -----------------------------------------------------
-- Data for table `frfrfrfr`.`category`
-- -----------------------------------------------------
START TRANSACTION;
INSERT INTO `frfrfrfr`.`category` (`name`) VALUES ('fruit');
INSERT INTO `frfrfrfr`.`category` (`name`) VALUES ('vegetable');
COMMIT;
-- ----... |
create function governance.proposal_votes(id bigint)
returns TABLE
(
user_id text,
support boolean,
block_timestamp bigint,
power numeric
)
language plpgsql
as
$$
begin
return query select disti... |
-- drop table if exists trade_account_manager.product;
create table trade_account_manager.product(
name char(63) primary key not null,
user_superior_trader char(63) not null,
enable boolean not null default true,
create_time datetime not null default current_timestamp,
update_time timestamp not nu... |
INSERT INTO `wy_module` (`module`, `name`, `url`, `iscore`, `version`, `description`, `setting`, `listorder`, `disabled`, `installdate`, `updatedate`) VALUES ('sms', '短信平台', 'sms/', 0, '1.0', '短信平台', '', 0, 0, '2011-9-2', '2011-9-2'); |
--TEST: test with tables with list partition
create table var_samp_p_list(
col1 char(20),
col2 varchar(100),
col3 nchar(10),
col4 nchar varying,
col5 string,
col6 varchar
)
partition by list (col2) (
partition p1 values in ('This is a dog.'),
partition p2 values in ('This is a rabbit.'),
partition p3 values i... |
-- aggerror.test
--
-- execsql {
-- UPDATE t1 SET a=41 WHERE a=40
-- }
UPDATE t1 SET a=41 WHERE a=40 |
{@createTable}?{
IF OBJECT_ID('@resultsDatabaseSchema.achilles_@detailType', 'U') IS NOT NULL
drop table @resultsDatabaseSchema.achilles_@detailType;
}
--HINT DISTRIBUTE_ON_KEY(analysis_id)
{!@createTable}?{
insert into @resultsDatabaseSchema.achilles_@detailType
}
select @fieldNames
{@createTable}?{
into @re... |
/* ================================================
* Oracle XFiles Demonstration.
*
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"... |
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"username" TEXT NOT NULL,
"password" TEXT NOT NULL,
"name" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
C... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 23, 2019 at 02:52 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50717
Source Host : 127.0.0.1:3306
Source Database : ssms
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2017-11-26 17:28:50
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.