text stringlengths 1 1.05M |
|---|
INSERT INTO users (name, email, week_start, validated) VALUES ('user', 'updateEntry_CorrectUser', 1, false); |
CREATE PROC [dbo].[h3giUpdateActiveTopUpChannels]
AS
BEGIN
DECLARE @catalogueVersionId INT
SET @catalogueVersionId = dbo.fn_GetActiveCatalogueVersion()
INSERT INTO h3giChannelTopUp (channelCode,catalogueProductId)
SELECT ch.channelCode, cat.catalogueProductID
FROM h3giProductCatalogue cat
INNER JOIN h3giC... |
select `l_orderkey`, sum(`l_extendedprice` * (1 - `l_discount`)) as `revenue`, `o_orderdate`, `o_shippriority`
from `lineitem`
where `c_mktsegment` = 'market segment' and `c_custkey` = `o_custkey` and `l_orderkey` = `o_orderkey` and `o_orderdate` < date '2013-03-05' and `l_shipdate` > date '2013-03-05'
group by `l_orde... |
CREATE DATABASE IF NOT EXISTS fraud;
DROP TABLE IF EXISTS fraud.fraud_payment;
create table fraud.fraud_payment (
timestamp Date,
id String,
eventTime UInt64,
eventTimeHour UInt64,
fraudType String,
comment String,
email String,
ip String,
fingerprint ... |
select distinct u.user_id seller_id, ifnull(if(u.favorite_brand = t.item_brand,'yes','no'),'no') 2nd_item_fav_brand
from Users u
left join
(select seller_id, item_brand, rank() over (partition by seller_id order by order_date) rnk
from Orders o
left join Items i on i.item_id = o.item_id) t on t.rnk = 2 and t.seller_... |
INSERT INTO BIGLIETTO2 (tipo_biglietto, costo_biglietto) VALUES ('Premium', 55);
INSERT INTO BIGLIETTO2 (tipo_biglietto, costo_biglietto) VALUES ('Standard', 30);
|
/****** Object: User Defined Function dbo.GetAALB Script Date: 5/1/2004 6:12:46 PM ******/
CREATE FUNCTION dbo.GetAALB
(
@PublicID int
)
RETURNS int
BEGIN
RETURN(SELECT AAL FROM Publics WHERE PublicID = @PublicID)
END
|
-- MySQL Script generated by MySQL Workbench
-- Sat Mar 16 17:38:18 2019
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TR... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
PRINT N'Dropping [edfi].[CredentialAcademicSubject... |
--
---- check maxvalue for range partition
--
--/* int2 */: sucess
create table test_maxvalue_datatype_int2(a int2)
partition by range(a)
(
partition test_maxvalue_datatype_int2_p1 values less than (1),
partition test_maxvalue_datatype_int2_p2 values less than (maxvalue)
);
select c.relname, a.attname, t.typname from... |
drop package ORDERENTRY;
create or replace
PACKAGE ORDERENTRY
AS
/*
* Package : Order Entry Package Spec
* Version : 1.2
* Author : Dominic Giles
* Last Update : 12 June 2011
* Description : Used in stress test of Oracle by swingbench test harness;
*
*/
PROCEDURE ... |
alter table "public"."mesures" drop constraint "mesures_mandataire_id_numero_rg_ti_id_key";
|
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'uspVerifyASUserAccessToEntityProjectRequirementIdent')
AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
DROP PROCEDURE uspVerifyASUserAccessToEntityProjectRequirementIdent
GO
/* uspVerifyASUserAccessToEntityProjectRequirementIdent
*
* Used to add a file to ... |
CREATE PROCEDURE [dbo].[TruncateStandardOptions]
AS
BEGIN
DELETE FROM [dbo].[StandardOption]
END
|
drop schema if exists api cascade;
create schema api;
set search_path = api, public;
-- this role will be used as the owner of the views in the api schema
-- it is needed for the definition of the RLS policies
drop role if exists api;
create role api;
grant api to current_user; -- this is a workaround for RDS where th... |
USE Assignments;
GO
CREATE OR ALTER FUNCTION dbo.fn_getModuleDetails(@moduleId NVARCHAR(30))
RETURNS TABLE
RETURN (SELECT
m.ModuleName,
a.AssignmentName,
g.Grade
FROM Assignment a
JOIN StudentAssignment sa
ON (a.AssignmentID = sa.AssignmentID)
... |
--
-- insert with DEFAULT in the target_list
--
create table inserttest (col1 int4, col2 int4 NOT NULL, col3 text default 'testing');
insert into inserttest (col1, col2, col3) values (DEFAULT, DEFAULT, DEFAULT);
insert into inserttest (col2, col3) values (3, DEFAULT);
insert into inserttest (col1, col2, col3) values (D... |
CREATE DATABASE IF NOT EXISTS `dcms` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `dcms`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: 127.0.0.1 Database: yolkdcms
-- ------------------------------------------------------
-- Server version 5.6.16
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
CREATE SEQUENCE public.table_payment_router_id_seq
INCREMENT 1 START 1 MINVALUE 1 MAXVALUE 9223372036854775807 CACHE 1;
ALTER SEQUENCE public.table_payment_router_id_seq
OWNER TO soglad;
-- Table: public.payment_router
-- DROP TABLE public.payment_router;
CREATE TABLE public.payment_router
(
id BIGINT ... |
UPDATE webhooks
SET name = 'minion-visualization',
url = 'http://minion-visualization/hook'
WHERE name = 'sleuther-visualization';
UPDATE webhooks
SET name = 'minion-broken-link',
url = 'http://minion-broken-link/hook'
WHERE name = 'sleuther-broken-link';
UPDATE webhooks
SET name = 'min... |
-- Drop table if exists
DROP TABLE IF EXISTS mortgage;
DROP TABLE IF EXISTS sales;
-- Create new table
CREATE TABLE mortgage (
mortgage_id SERIAL PRIMARY KEY,
mortgage_name VARCHAR(50),
mortgage_rate FLOAT
);
-- Create new table to import data
CREATE TABLE sales (
sales_id SERIAL PRIMARY KEY,
payment_id INT... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 24, 2019 at 09:42 AM
-- Server version: 5.7.26-0ubuntu0.18.04.1
-- PHP Version: 7.2.19-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+0... |
-- +migrate Up
-- https://wiki.postgresql.org/wiki/First/last_(aggregate)
-- Create a function that always returns the first non-NULL item
CREATE FUNCTION public.first_agg ( anyelement, anyelement )
RETURNS anyelement LANGUAGE SQL IMMUTABLE STRICT AS $$ SELECT $1 $$;
-- And then wrap an aggregate around it
CREATE A... |
create or replace view "AIRBYTE_DATABASE"._AIRBYTE_TEST_NORMALIZATION."UNNEST_ALIAS_CHILDREN_OWNER_AB3" as (
-- SQL model to build a hash column based on the values of this record
select
md5(cast(coalesce(cast(_AIRBYTE_CHILDREN_HASHID as
varchar
), '') || '-' || coalesce(cast(OWNER_ID as
varchar... |
SELECT
BIT_LENGTH('1337') AS `__aliased--value` |
INSERT INTO licenta.bus_route_trip (trip_id, bus_route_id, direction, trip_name) VALUES (1, 5, 0, '48_Dus');
INSERT INTO licenta.bus_route_trip (trip_id, bus_route_id, direction, trip_name) VALUES (6, 5, 1, '48_Intors');
INSERT INTO licenta.bus_route_trip (trip_id, bus_route_id, direction, trip_name) VALUES (13, 6, 0, ... |
create table Attachment (
id number(19,0) not null,
accessType number(10,0),
attachedAt timestamp,
attachmentContentId number(19,0) not null,
contentType varchar2(255 char),
name varchar2(255 char),
attachment_size number(10,0),
attachedBy_id varchar2(... |
CREATE TABLE IF NOT EXISTS remote_storage_configurations
(
id UUID PRIMARY KEY,
name VARCHAR(256)
CONSTRAINT unq_RemoteStorageConfigurations_Name UNIQUE NOT NULL,
api_key VARCHAR(256),
provider_name VARCHAR(256),
url VARCHAR(2... |
/* Users */
INSERT INTO users(user_name, password, email, credit_limit) VALUES('kyle', 'password', 'kyle.williamson@mycit.ie', 1000)
INSERT INTO users(user_name, password, email, credit_limit) VALUES('joel', 'password', 'joelis.satkauskas@mycit.ie', 1000)
INSERT INTO users(user_name, password, email, credit_limit) VA... |
--+ holdcas on;
set names utf8;
drop table if exists t1;
create table t1 (id int,col_binary varchar(10) collate binary, col_euckr varchar(10) collate euckr_bin, col_utf8 varchar(10) collate utf8_bin, col_iso varchar(10) collate iso88591_bin);
insert into t1 values(1,'문자열', '문자열', '문자열', 'ÀÏ');
insert into t1 values(2,c... |
{% set payment_methods = ['credit_card', 'coupon', 'bank_transfer', 'gift_card'] %}
with payments as (
select * from {{ ref('stg_jaffle_shop__payments') }}
),
final as (
select
order_id,
{% for payment_method in payment_methods -%}
sum(case when payment_method = '{{payment_method}}... |
USE `cjms`;
SELECT
ss.`name` AS `spaceship_name`, sp.`name` AS `spaceport_name`
FROM
`spaceships` AS `ss`
JOIN
`journeys` AS `j` ON ss.`id` = j.`spaceship_id`
JOIN
`spaceports` AS `sp` ON j.`destination_spaceport_id` = sp.`id`
ORDER BY ss.`light_speed_rate` DESC
LIMIT 1; |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 20, 2020 at 02:12 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
SELECT productname,
productiondate,
expirationdate
FROM products;
|
-- vine table
CREATE TABLE vine_table (
review_id TEXT PRIMARY KEY,
star_rating INTEGER,
helpful_votes INTEGER,
total_votes INTEGER,
vine TEXT
) |
CREATE DATABASE keycloak WITH ENCODING UTF8;
CREATE USER keycloak WITH PASSWORD 'password';
ALTER DATABASE keycloak OWNER TO keycloak;
\c keycloak
CREATE SCHEMA keycloak;
ALTER SCHEMA keycloak OWNER TO keycloak; |
DROP TABLE IF EXISTS checkedout;
DROP TABLE IF EXISTS tools;
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INTEGER PRIMARY KEY,
username TEXT
);
CREATE TABLE tools (
id INTEGER PRIMARY KEY,
name TEXT,
description TEXT,
lastReturned TEXT,
timesBorrowed INTEGER
);
CREATE TABLE checkedout (
user_id INTEGER,
tool_id ... |
-- MySQL dump 10.13 Distrib 8.0.19, for Linux (x86_64)
--
-- Host: localhost Database: kvfireworks
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... |
UPDATE salary
set sex = case when sex = 'm' then 'f' else 'm' end |
DELETE FROM PERSON;
DELETE FROM PLACE;
DROP SEQUENCE "PERSON_SEQUENCE";
CREATE SEQUENCE "PERSON_SEQUENCE" MINVALUE 1 MAXVALUE 99999999999 INCREMENT BY 1 START WITH 1 NOORDER NOCYCLE;
DROP SEQUENCE "PLACE_SEQUENCE";
CREATE SEQUENCE "PLACE_SEQUENCE" MINVALUE 1 MAXVALUE 99999999999 INCREMENT BY 1 START WITH 1 NOORDER N... |
--IMPORT timestamp.sql
|
-- permission_for_manage_expenses_categories --
INSERT INTO `phppos_modules_actions` (`action_id`, `module_id`, `action_name_key`, `sort`) VALUES ('manage_categories', 'expenses', 'items_manage_categories', 316);
INSERT INTO phppos_permissions_actions (module_id, person_id, action_id)
SELECT DISTINCT phppos_permissions... |
--liquibase formatted sql
-- changeset id:migration-insert-into-final_project_task_template context:weit
INSERT INTO final_project_task_template (name, project_id, master)
SELECT CONCAT('Final ', name), project_id, master
FROM public.project_task_template
-- changeset id:migration-final-project-tasks-master context:w... |
CREATE TABLE [dbo].[Groups] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Title] NVARCHAR (150) NULL,
[IsDeleted] BIT NULL,
[Created] DATETIMEOFFSET (7) CONSTRAINT [DF_Group_Created] DEFAULT (sysdatetimeoffset()) NULL,
[Modified] DATETIMEOF... |
/*
Table: Employees
+---------------+---------+
| Column Name | Type |
+---------------+---------+
| employee_id | int |
| employee_name | varchar |
| manager_id | int |
+---------------+---------+
employee_id is the primary key for this table.
Each row of this table indicates that the employee with... |
DROP DATABASE IF EXISTS `ry-config`;
CREATE DATABASE `ry-config` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
USE `ry-config`;
/******************************************/
/* 表名称 = config_info */
/******************************************/
CREATE TAB... |
USE employeeDB;
INSERT INTO Roles (id, title, salary, department_id)
values (101, "Engineer", 100000, 1);
INSERT INTO Roles (id, title, salary, department_id)
values (201, "Analyzer", 150000, 2);
INSERT INTO Roles (id, title, salary, department_id)
values (301, "Sales Rep", 90000, 3);
INSERT INTO Roles (id, title, ... |
UPDATE metadata SET value=
'Witajcie<br/><br/><br/>
Poniżej lista nowych postów z ostatnich $days$ dni.<br/><br/>
$if(newPosts)$
Wpisy programistów:<br/>
$newPosts: {post|
- <a href="$post.url$">$post.title$</a> by $post.authorLabel$<br/>
}$
<br/>
<br/>
$endif$
$if(newPostsFromCompanies)$
Wpisy z blogów ... |
prompt --application/shared_components/navigation/tabs/parent
begin
-- Manifest
-- TOP LEVEL TABS: 116
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2021.04.15'
,p_release=>'21.1.7'
,p_default_workspace_id=>9690978936188613
,p_default_application_id=>116
,p_default_id_offset=>0
,p_defau... |
/* ---------------------------------------------------------------------- */
/* Script generated with: DeZign for Databases 12.1.0 */
/* Target DBMS: MS SQL Server 2017 */
/* Project file: S07_01_APP_CRT_V1.dez */
/* Project n... |
CREATE TABLE [dbo].[WebPartConfig] (
[PartConfigId] INT NOT NULL,
[PartId] INT NOT NULL,
[Name] VARCHAR (256) NOT NULL,
[FileName] VARCHAR (256) NOT NULL,
CONSTRAINT [PK_WebPartConfig] PRIMARY KEY CLUSTERED ([PartConfigId] ASC)
);
|
CREATE TABLE [Production].[ProductPhoto]
(
[ProductPhotoID] INT IDENTITY (1, 1) NOT NULL,
[ThumbNailPhoto] VARBINARY (MAX) NULL,
[ThumbnailPhotoFileName] NVARCHAR (50) NULL,
[LargePhoto] VARBINARY (MAX) NULL,
[LargePhotoFileName] NVARCHAR (50) NULL,
[RowStat... |
BEGIN;
ALTER TABLE ONLY public.encryption_keys
ADD COLUMN uuid text;
COMMIT; |
\set ECHO off
set log_error_verbosity = 'terse';
set client_min_messages = 'fatal';
create language plpgsql;
set client_min_messages = 'warning';
drop schema pgq_ext cascade;
\i sql/old_ext.sql
\i structure/upgrade.sql
\set ECHO all
--
-- test batch tracking
--
select pgq_ext.is_batch_done('c', 1);
select pgq_ext.s... |
BEGIN;
ALTER TABLE external_service_repos
DROP CONSTRAINT IF EXISTS external_service_repos_repo_id_external_service_id_unique;
COMMIT;
|
SELECT b.EMPLID
, REG_REGION
, ETHNIC_GRP_CD
, SETID
, APS_EC_NDS_AUS
, PRIMARY_INDICATOR
FROM (--IMPLICIT POPULATION FILTER
SELECT EMPLID
, MAX(a.STRM) AS STRM
FROM PS_STDNT_CAR_TERM a
JOIN PS_TERM_TBL b
ON b.STRM = a.STRM
AND a... |
CREATE TABLE country (id VARCHAR(2) NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB;
INSERT INTO `country` (`id`, `name`) VALUES ('AF', 'Afiganistaŋ');
INSERT INTO `country` (`id`, `name`) VALUES ('AX', 'Åland Islands');
INSERT INTO `country` (`id`, `name`) VALUES ('AL', 'Alibani');
INSERT INTO `... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 15, 2019 at 09:54 AM
-- Server version: 10.2.24-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... |
--An example to get data for the last 30 days
declare @start_date datetime
declare @end_date datetime
set @end_date = getdate()
set @start_date = DATEADD(DAY,-30,@end_date)
SELECT account4_.account_name AS col_0_0_,
account4_.sub_name AS col_1_0_,
... |
-- +micrate Up
CREATE TABLE villagers (
id BIGSERIAL PRIMARY KEY,
name VARCHAR,
created_at TIMESTAMP,
updated_at TIMESTAMP,
race VARCHAR,
gender VARCHAR,
village_id BIGINT
);
-- +micrate Down
DROP TABLE IF EXISTS villagers;
|
UPDATE fact_queries SET query = '
SELECT CASE
WHEN LEN (notes) > 40 THEN LEFT (notes,40) + ''...''
ELSE notes
END AS ''Notes'',
date AS Date,
e.agelabel AS Age,
d.genderlabel AS Gender,
ISNULL(diagnosisLabel, ''No Diagnosis'') as Diagnosis
FROM
FACT_visits a left JOIN LKUP_diagnosisMulti b
... |
-- file:create_view.sql ln:564 expect:true
create view tt21v as
select * from tt5 natural inner join tt6
|
DROP DATABASE IF EXISTS registrar_db;
CREATE DATABASE registrar_db;
USE registrar_db;
CREATE TABLE deparment (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30),
);
CREATE TABLE ROLE (); |
SET NOCOUNT ON
--:SETVAR jobname "Test Job Name"
--:SETVAR jobowner "domain\user"
--:SETVAR jobowner "sa"
DECLARE @delete_result int
DECLARE @jobId binary(16)
SELECT @jobId = job_id FROM msdb.dbo.sysjobs WHERE (name = N'$(jobname)')
IF (@jobId IS NOT NULL)
BEGIN
EXEC @delete_result = msdb.dbo.sp_delete_job @job... |
-- @description query01 for HCatalog test on small data
SELECT * FROM hcatalog.default.hive_table ORDER BY s1;
|
-- database: hive; groups: example_smoketest; tables: nation
-- delimiter: |; ignoreOrder: false; types: INTEGER|VARCHAR|INTEGER|VARCHAR
--! name: query_1
SELECT * FROM nation
--!
0|ALGERIA|0| haggle. carefully final deposits detect slyly agai|
1|ARGENTINA|1|al foxes promise slyly according to the regular accounts. bol... |
CREATE TABLE book(id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, title VARCHAR(255), pages INT, author_id BIGINT NOT NULL);
CREATE TABLE author(id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, name VARCHAR(255)); |
CREATE TABLE foo (bar text not null, bat text not null);
-- name: LowerSwitchedOrder :many
SELECT bar FROM foo WHERE bar = $1 AND bat = LOWER($2);
|
DROP TABLE IF EXISTS ingredients;
CREATE TABLE ingredients (
id SERIAL PRIMARY KEY,
cheese BOOLEAN,
pineapple BOOLEAN,
chicken BOOLEAN,
sasuage BOOLEAN,
pepperoni BOOLEAN,
mushroom BOOLEAN,
ingredients_id INTEGER,
FOREIGN KEY (ingredients_id) REFERENCES pizza(id) ON DELETE CASCADE
);
INSERT INTO ing... |
SELECT
c.id,
CONCAT(c.first_name, ' ', c.last_name) AS 'full_name',
c.ucn
FROM colonists AS c
ORDER BY
c.first_name ASC,
c.last_name ASC,
c.id ASC; |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 07-01-2022 a las 17:05:13
-- Versión del servidor: 10.4.20-MariaDB
-- Versión de PHP: 7.4.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE TYPE public.typ_enum AS ENUM (
'wat',
'wut',
'weed'
);
ALTER TYPE public.typ_enum OWNER TO botov_av; |
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : CaretClassifier_earth
-- Dataset : BinaryClass_10
-- Database : firebird
-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
-- Model deployment code
WITH earth... |
create table canvaslms_enrollments (
term varchar2(12),
crn varchar2(12),
user_id number,
enrollment_id number,
course_id number,
section_id number,
type varchar2(32),
pidm number,
url varchar2(128),
created_on date default sysdate,
constraint pk_canvalms_enrollments primary ... |
drop table if exists steps; |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3308
-- Generation Time: Feb 17, 2022 at 04:50 AM
-- Server version: 8.0.18
-- PHP Version: 7.4.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
INSERT into safetytips (title, body, createdAt, updatedAt) VALUES ("Be Alert", "Always be alert and aware of the people around you.", NOW(), NOW());
INSERT into safetytips (title, body, createdAt, updatedAt) VALUES ("Prevention", "Educate yourself concerning prevention tactics.", NOW(), NOW());
INSERT into safetytips (... |
CREATE PROCEDURE [dbo].[spPMUpdateMeasurmentDocument]
@token_id NVARCHAR(50),
@filter_msrdcm_id_Pk BIGINT = NULL,
@filter_msrdcm_external_identifier NVARCHAR(500) = NULL,
@filter_msrdcm_task_Fk BIGINT = NULL,
@filter_msrdcm_device_type NVARCHAR(20) = NULL,
@filter_msrdcm_technical_object_Fk BIGINT = NULL,
... |
-- MySQL dump 10.13 Distrib 5.6.42, for Win64 (x86_64)
--
-- Host: 192.168.0.104 Database: cms_solarshop
-- ------------------------------------------------------
-- Server version 5.5.53
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
SET max_block_size = 10;
SET max_rows_in_set = 20;
SET set_overflow_mode = 'throw';
SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(300)); -- { serverError 191 }
SELECT arrayJoin([5, 25]) IN (SELECT DISTINCT toUInt8(intDiv(number, 10)) FROM numbers(190));
SELECT arrayJoin([5, 25]... |
chr7 13032351 13032434 2 2 1 1 0 48
chr7 13032566 13033828 2 2 0 1 0 43
chr7 13032822 13033828 2 2 1 1 0 12
chr7 13034043 13034634 2 2 1 1 0 30
|
-- vtabD.test
--
-- execsql {
-- CREATE TABLE t1(a, b);
-- CREATE INDEX i1 ON t1(a);
-- CREATE INDEX i2 ON t1(b);
-- CREATE VIRTUAL TABLE tv1 USING echo(t1);
-- }
CREATE TABLE t1(a, b);
CREATE INDEX i1 ON t1(a);
CREATE INDEX i2 ON t1(b);
CREATE VIRTUAL TABLE tv1 USING echo(t1); |
--
-- Copyright 2018 ZTE Corporation.
--
-- 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 agree... |
use veiculojsf_db;
INSERT INTO `PAIS` (`pa_id`, `pa_nome`, `pa_sigla`) VALUES (1, 'Brasil', 'BR');
INSERT INTO `ESTADO` (`est_id`, `est_nome`, `est_uf`, `pa_id`) VALUES
(1, 'Acre', 'AC', 1),
(2, 'Alagoas', 'AL', 1),
(3, 'Amazonas', 'AM', 1),
(4, 'Amapá', 'AP', 1),
(5, 'Bahia', 'BA', 1),
(6, 'Cear... |
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS foo;
DROP TABLE IF EXISTS bar;
CREATE TABLE foo (a INT, b INT, c CHAR(100)) ;
INSERT INTO foo SELECT i as a, i as b, '' as c FROM generate_series(1, 100000) AS i;
INSERT INTO foo SELECT i as a, i as b, '' as c FROM ... |
SELECT a.client_name as Job,decode (a.status, 'ENABLED', 'TRUE', 'FALSE') as Enabled1,c.window_name as Window1,c.schedule_name as Schedule_Name,c.start_date as Start_Date,c.repeat_interval as Repeat_Interval,to_char(c.duration) as Duration FROM dba_autotask_client a,dba_scheduler_wingroup_members b,dba_scheduler_window... |
# Author: Madhur Gupta
# Github: github.com/guptamadhur
# Project: Hacker Rank Practice SQL
select DISTINCT CITY from STATION WHERE CITY NOT RLIKE "[aeiou]$" AND CITY NOT RLIKE "^[aeiou]"; |
\timing
/** Create the room */
INSERT INTO room (name) VALUES ('CHIPUG Virtual');
/** Look at initial calendar on May 30, 2018 */
SELECT *
FROM calendar
WHERE calendar_date = '2021-10-28'
ORDER BY lower(calendar_range);
/** Liberty only allows bookings from 8am - 1pm, and 4pm to 10pm on Mon - Fri */
INSERT INTO avai... |
CREATE TABLE "statements"."MessageIdempotentStore"("id" BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 0) NOT NULL,"error" VARCHAR(2000),"messageId" VARCHAR(1000) NOT NULL,CONSTRAINT "MessageIdempotentStore_PK" PRIMARY KEY("id"),CONSTRAINT "MessageIdempotentStore_messageId_UNQ" UNIQUE("messageId"));
ALTER TABLE "s... |
drop package blah_member_rel;
drop package yippe_member_rel;
drop table blah_member_rels;
drop table yippe_member_rels;
begin
acs_rel_type.drop_type('blah_member_rel');
acs_rel_type.drop_type('yippe_member_rel');
end;
/
show errors
|
CREATE OR REPLACE TRIGGER "TR_SPECPARTATT_AIUD_FLAT"
AFTER INSERT OR UPDATE OR DELETE ON SPECIMEN_PART_ATTRIBUTE
FOR EACH ROW
DECLARE id NUMBER;
BEGIN
IF deleting THEN
select derived_from_cat_item into id from specimen_part where collection_object_id = :OLD.collection_object_id;
ELSE
select ... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 26, 2021 at 01:21 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
set serveroutput on
set linesize 100
set pagesize 100
create or replace procedure my_cur_proc
(
v_dept_no IN number ,
my_cur OUT Sys_RefCursor
)
is
begin
open my_cur FOR select * from rika.emp where deptno=v_dept_no;
dbms_output.put_line('procedure ran successfully and return a cursor which is open '... |
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50722
Source Host : 127.0.0.1:3306
Source Schema : zuihou_column
Target Server Type : MySQL
Target Server Version : 50722
File Encoding : 65001
Date: 12/07/2... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 16-Jul-2019 Ã s 14:37
-- Versão do servidor: 10.1.38-MariaDB
-- versão do PHP: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... |
-- file_validate function sets the entityId of a file if not already set or deleted
CREATE OR REPLACE FUNCTION _file_storage.file_trigger() RETURNS trigger AS $$
function validateFile(fileName, entityId, types) {
if (fileName == null || fileName.length < 39) {
throw new Error('Invalid fileName.');
... |
-- MySQL dump 10.13 Distrib 8.0.26, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: blueolz8_blueocean
-- ------------------------------------------------------
-- Server version 8.0.26
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... |
-- Strings.
SELECT '""'::jsonb; -- OK.
SELECT $$''$$::jsonb; -- ERROR, single quotes are not allowed
SELECT '"abc"'::jsonb; -- OK
SELECT '"abc'::jsonb; -- ERROR, quotes not closed
SELECT '"abc
def"'::jsonb; -- ERROR, unescaped newline in string constant
SELECT '"\n\"\\"'::jsonb; -- OK, legal escapes
SELEC... |
-- 2017-09-27T13:26:24.341
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544514,0,TO_TIMESTAMP('2017-09-27 13:26:24','YYYY-MM-DD HH24:MI:SS'),100,'de.... |
PRINT 'MOVIE_FIGURES_BY_YEAR' FROM BEGINNING LIMIT 2;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.