text stringlengths 1 1.05M |
|---|
DROP FUNCTION IF EXISTS get_ledger_value(TEXT, TEXT, TEXT);
CREATE FUNCTION get_ledger_value(p_case_id TEXT, p_section_id TEXT, p_entry_id TEXT) RETURNS SETOF form_processor_ledgervalue AS $$
BEGIN
RETURN QUERY
SELECT * FROM form_processor_ledgervalue
WHERE case_id = p_case_id AND section_id = p_section_id... |
/****** Object: UserDefinedFunction [dbo].[fn_IsPrime] Script Date: 04/10/2016 16:35:53 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[fn_IsPrime]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[fn_IsPrime]
GO
/****** Object: UserDefinedFunction [dbo].[... |
INSERT IGNORE INTO site (setting, value) VALUE ('fixnamesperrun', '10');
UPDATE site set value = '123' where setting = 'sqlpatch';
|
insert into filters
(filter, name, type, description, options, organization, created_by)
values
(md5(random()::text || clock_timestamp()::text)::uuid, $1, $2, $3, $4, $5, $6)
returning * |
-- file:text.sql ln:38 expect:true
select concat_ws('#',1,2,3,'hello',true, false, to_date('20100309','YYYYMMDD'))
|
--
-- Name: planet_osm_polygon_wikidata; Type: INDEX; Schema: public; Owner: osmimporter; Tablespace:
--
DO $$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM pg_class c
JOIN pg_namespace n ON n.oid = c.relnamespace
WHERE c.relname = 'planet_osm_polygon_wikidata'
AND n.nspname = 'public'
) THEN
... |
SELECT
a.USERID GP_User_ID,
um.USERNAME [User_Name],
a.CMPNYNAM Company_Name,
a.LOGINDAT+a.LOGINTIM Login_Date_and_Time,
coalesce(b.batch_count,0) Batch_Activity_Records,
coalesce(r.resource_count,0) Resource_Activity_Records,
coalesce(t.table_locks,0) Table_Lock_Records
FROM DYNAMICS..ACTIVITY a
LEFT OUTE... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 17, 2021 at 11:18 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
CREATE TABLE profile (
profileId INT UNSIGNED AUTO_INCREMENT NOT NULL,
profileHandle VARCHAR(32) NOT NULL,
profileFirstName VARCHAR(32) NOT NULL,
profileLastName VARCHAR(32) NOT NULL,
profileEmail VARCHAR(128) NOT NULL,
profileWebsite VARCHAR(32),
profilePassHash VARCHAR(20) NOT NULL,
profileP... |
# cldr ful http://cldr.unicode.org/ MIT-like
06997486-n ful:lemma Akaan
06987812-n ful:lemma Amarik
06988057-n ful:lemma Aarabeere
06944480-n ful:lemma Belaruuse
06945569-n ful:lemma Bulgariire
06970946-n ful:lemma Bengali
06944911-n ful:lemma Cekkere
06950528-n ful:lemma Docceere
06976392-n ful:lemma Gerke
06947032-n ... |
use payroll
execute p_add_time_entry @employee_id=52, @entry_date='2018-09-28 00:00:00', @hours_worked=6
execute p_add_time_entry @employee_id=46, @entry_date='2018-09-28 00:00:00', @hours_worked=6
execute p_add_time_entry @employee_id=57, @entry_date='2018-09-28 00:00:00', @hours_worked=5
execute p_add_time_entry @e... |
CREATE TABLE bpk (
id SERIAL PRIMARY KEY,
bpk character varying(1024),
pnr character varying(255)
);
|
create table "simple_reference_003"."summary_expected" (
gender VARCHAR(10),
ct BIGINT
);
insert into "simple_reference_003"."summary_expected" (gender, ct) values
('Female', 40),
('Male', 60);
create table "simple_reference_003"."seed" (
id BIGSERIAL PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50)... |
/*
+---------------+----------+
| Column Name | Type |
+---------------+----------+
| sub_id | int |
| parent_id | int |
+---------------+----------+
There is no primary key for this table, it may have duplicate rows.
Each row can be a post or comment on the post.
parent_id is null for posts... |
grant all on *.* to root@'%' identified by 'root';flush privileges; |
/* drop tables */
SET foreign_key_checks=0;
DROP TABLE IF EXISTS industry;
DROP TABLE IF EXISTS company;
DROP TABLE IF EXISTS pub;
DROP TABLE IF EXISTS prelease;
DROP TABLE IF EXISTS article;
DROP TABLE IF EXISTS pair;
DROP TABLE IF EXISTS block;
SET foreign_key_checks=1;
/* create tables*/
CREATE TABLE IF NOT ... |
-- =============================================
-- Author: Ken Taylor
-- Create date: February 12, 2014
-- Description: Given a Kerberos/LoginId, Return a list of pending orders that the user has access to.
-- Notes:
-- Replaces vPendingOrders.
-- Query takes the recent orders that a person needs to access.
--
-... |
-- ================================================
-- Insert Model Usage info into ModelUsageTbl
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
use ModelMgmtDB
go
-- =============================================
-- Create date: 5/29/2019
-- Description: Insert mod... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 23, 2018 at 06:37 AM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 5.6.36
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... |
CREATE TABLE IF NOT EXISTS file_new (
"id" text NOT NULL,
"drive" text NOT NULL,
"name" text NOT NULL,
"parent" text NOT NULL,
"size" integer NOT NULL,
"md5" text NOT NULL,
"trashed" boolean NOT NULL,
PRIMARY KEY(id, drive)
);
CREATE TABLE IF NOT EXISTS folder_new (
"id" text NOT NU... |
SELECT b1.name,
count(*)
FROM site AS s,
so_user AS u1,
tag AS t1,
tag_question AS tq1,
question AS q1,
badge AS b1,
account AS acc
WHERE s.site_id = u1.site_id
AND s.site_id = b1.site_id
AND s.site_id = t1.site_id
AND s.site_id = tq1.site_id
AND s.site_id = q1.site_id
AND... |
drop table if exists beacon;
create table beacon (
uuid text,
major int,
minor int,
category text
)
distributed randomly;
|
UPDATE `creature_template` SET `faction` = 1216 WHERE `entry` IN (14187, 22528, 31924, 37240, 14188, 22699,31963, 37281);
UPDATE `creature_template` SET `faction` = 1214 WHERE `entry` IN (14185, 22712, 32049, 37370, 14186, 22569, 32053, 37374);
|
CREATE TABLE `comments` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` varchar(255) NOT NULL,
`comment` varchar(255) NOT NULL,
`deleted` INT DEFAULT 0
);
|
CREATE TABLE conference_rooms (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL UNIQUE,
description VARCHAR NOT NULL,
typev VARCHAR NOT NULL,
building VARCHAR NOT NULL,
link_to_building TEXT [] NOT NULL,
capacity INTEGER NOT NULL,
floor VARCHAR NOT NULL,
section VARCHAR NOT NULL
)
|
CREATE TABLE IF NOT EXISTS public.forecast_location (
id serial PRIMARY KEY,
nick text UNIQUE NOT NULL,
address text NOT NULL,
lat double precision NOT NULL,
lng double precision NOT NULL
);
|
-- [er]create a class naming as '('
create class DML_00(01 (
int_col1 integer,
int_col2 integer
) ;
drop class DML_00(01;
|
-- CreateTable
CREATE TABLE "Todo" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"name" TEXT NOT NULL,
"completed" BOOLEAN NOT NULL DEFAULT false
);
|
/*
Navicat MySQL Data Transfer
Source Server : 192.168.31.7_3306
Source Server Version : 80016
Source Host : 192.168.31.7:3306
Source Database : shop_190505
Target Server Type : MYSQL
Target Server Version : 80016
File Encoding : 65001
Date: 2019-10-11 15:54:25
*/
SET FOREIGN_KEY_... |
--
-- TRANSACTIONS
--
BEGIN;
SELECT *
INTO TABLE xacttest
FROM aggtest;
INSERT INTO xacttest (a, b) VALUES (777, 777.777);
END;
-- should retrieve one value--
SELECT a FROM xacttest WHERE a > 100;
BEGIN;
CREATE TABLE disappear (a int4);
DELETE FROM aggtest;
-- should be empty
SELECT * FROM aggtest;
ABO... |
--
-- Copyright 2009-2016 the original author or authors.
--
-- 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
--
-- Unles... |
/*
HackerRank SQL: Weather Observation Station 19
https://www.hackerrank.com/challenges/weather-observation-station-19
Difficulty: easy
Created on Mon Nov 12 15:12:05 2018
@author: Arthur Dysart
*/
/*
Solution
ROUND( POWER(), MAX(), MIN())
*/
SELECT
-- Apply Pythagorean theorem to determine Euclidean distance
... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-05-2021 a las 20:52:24
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
SELECT
s.name,
s.address
FROM
"${database}"."${schema}"."${prefix}supplier" s,
"${database}"."${schema}"."${prefix}nation" n
WHERE
s.suppkey IN (
SELECT
ps.suppkey
FROM
"${database}"."${schema}"."${prefix}partsupp" ps
WHERE
ps.partkey IN (
SELECT
p.par... |
/*
SQLyog Ultimate v13.1.1 (64 bit)
MySQL - 10.4.10-MariaDB : Database - aro
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOR... |
SET AUTOCOMMIT = 0;
START TRANSACTION;
CREATE DATABASE IF NOT EXISTS `node_react_sample_db` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
USE `node_react_sample_db`;
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` varchar(20) NOT NUL... |
prompt --application/pages/page_00016
begin
wwv_flow_api.create_page(
p_id=>16
,p_user_interface_id=>wwv_flow_api.id(327304041051455600)
,p_name=>'Order details'
,p_page_mode=>'NORMAL'
,p_step_title=>'Order details'
,p_step_sub_title_type=>'TEXT_WITH_SUBSTITUTIONS'
,p_first_item=>'NO_FIRST_ITEM'
,p_autocomplete_on_off... |
create table public.f_person
(
person_id integer not null,
family_name character varying(50),
given1_name character varying(50),
given2_name character varying(50),
prefix_name character varying(50),
suffix_name character varying(50),
preferred_language character varying(50),
ssn character varying(50),
active i... |
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : CaretClassifier_xgbTree_pca
-- Dataset : FourClass_10
-- Database : teradata
-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
-- Model deployment code
WITH "... |
CREATE DATABASE "Simple.gdb" default character set utf8;
CREATE TABLE Simple
(
Id INTEGER NOT NULL,
Sport VARCHAR(50) NOT NULL,
Sport_fi VARCHAR(50) NOT NULL,
Sport_de VARCHAR(50) NOT NULL,
Sport_ja VARCHAR(50) NOT NULL,
PRIMARY KEY(Id)
);
INSERT INTO Simple VALUES(0, 'Soccer', '', '', '');
INSERT INTO Si... |
SELECT MIN(an.name) AS writer_pseudo_name,
MIN(t.title) AS movie_title
FROM company_name AS cn JOIN
(movie_companies AS mc JOIN
(title AS t JOIN
(cast_info AS ci JOIN
role_type AS rt ON ci.role_id = rt.id JOIN (name AS n JOIN aka_name AS an ON an.person_id = n.id)
ON n.id = ci.person_id)
... |
-- file:rowsecurity.sql ln:1478 expect:true
CREATE TABLE r2 (a int)
|
create table ACT_ID_PROPERTY (
NAME_ varchar(64),
VALUE_ varchar(300),
REV_ integer,
primary key (NAME_)
);
insert into ACT_ID_PROPERTY
values ('schema.version', '6.3.1.0', 1);
create table ACT_ID_BYTEARRAY (
ID_ varchar(64),
REV_ integer,
NAME_ varchar(191),
BYTES_ bytea... |
SELECT t1.name as "Employee Name", t2.dept_name as "Department Name", t1.pay "Year pay"
FROM employee as t1
JOIN department as t2 on ( t1.department_id = t2.department_id )
;
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 27-Mar-2017 às 02:23
-- Versão do servidor: 10.1.13-MariaDB
-- PHP Version: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
CREATE TABLE gc_cur_scrsummary_player (
id INTEGER PRIMARY KEY
, gc_player_id TEXT
, gc_player_name TEXT
, gc_cur_scrsummary_id INTEGER
, FOREIGN KEY (gc_cur_scrsummary_id) REFERENCES gc_cur_scrsummary (id)
)
;
|
-- -------------------------------------------------------------------------
-- Descripción : Script de creación de Vistas
-- Fecha Creación : 10/08/2017
-- Fecha Modificación :
-- Parámetros :
-- Autor : Carlos Sanchez
-- ... |
-- Please use the following SQL Statements to create the DataBase for DuckID
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
CREATE DATABASE `duckid`;
CREATE TABLE `tickets` (
`ticket_id` int(255) NOT NULL,
`ticket_infos` text NOT NULL,
`ticket_message` varchar(256) NOT NULL,
`ticket_attach... |
USE `counter_0_1`;
# first truncating everything
DELETE FROM `items`;
ALTER TABLE `items` AUTO_INCREMENT=1;
DELETE FROM `permissions`;
ALTER TABLE `permissions`;
DELETE FROM `lists`;
ALTER TABLE `lists` AUTO_INCREMENT=1;
DELETE FROM `users`;
ALTER TABLE `users` AUTO_INCREMENT=1;
# then reinserting
INSERT INTO `users`... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Erstellungszeit: 06. Mai 2020 um 19:45
-- Server-Version: 5.7.30-0ubuntu0.18.04.1
-- PHP-Version: 7.0.33-0ubuntu0.16.04.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
/* File generated automatically by dynamo */
/* The tag definition. */
CREATE TABLE awa_tag (
/* the tag identifier */
`id` BIGINT NOT NULL,
/* the tag name */
`name` VARCHAR(255) BINARY NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/* */
CREATE TABLE awa_tagged_entity (
/* the tag ent... |
create extension if not exists citext;
create extension if not exists pgcrypto;
create table guests (
id uuid PRIMARY key default gen_random_uuid(),
created_at timestamptz not null default current_timestamp,
email citext not null,
verified bool not null default false,
ip_address inet
);
create unique index g... |
CREATE TABLE meals (
id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR NOT NULL,
time DATETIME NOT NULL
)
|
-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: changelog.groovy
-- Ran at: 5/19/14 3:47 PM
-- Liquibase version: 2.0.1
-- *********************************************************... |
-- master.dbo.transaction_log definition
-- Drop table
-- DROP TABLE master.dbo.transaction_log;
CREATE TABLE master.dbo.transaction_log (
id int IDENTITY(0,1) NOT NULL,
username varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
api varchar(100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
api_method... |
SELECT mc.CountryCode, m.MountainRange, p.PeakName, p.Elevation
FROM Peaks p
JOIN Mountains m ON p.MountainId = m.Id
JOIN MountainsCountries mc ON m.Id = mc.MountainId
WHERE mc.CountryCode = 'BG' AND Elevation > 2835
ORDER BY Elevation DESC |
USE [BorderlessDb]
GO
-- ADD
ALTER PROCEDURE dbo.Translations_Add
(
@Text nvarchar(500),
@PhraseId uniqueidentifier,
@LanguageId uniqueidentifier,
@UserId uniqueidentifier
)
AS
BEGIN
DECLARE @Id uniqueidentifier = NEWID();
INSERT INTO [dbo].[Translations] ([ID], [Text], [PhraseID], [LanguageID], [UserID])
V... |
-- CreateEnum
CREATE TYPE "StatusType" AS ENUM ('SENDING', 'ERROR', 'SENDED', 'CANCEL', 'REMOVED');
-- CreateTable
CREATE TABLE "users" (
"id" TEXT NOT NULL,
"name" VARCHAR(100) NOT NULL,
"email" VARCHAR(200) NOT NULL,
"password" TEXT NOT NULL,
"created_at" DATE NOT NULL DEFAULT CURRENT_TIMESTAMP,
... |
SELECT ALL 'a';
SELECT DISTINCT 'a';
SELECT ALL * FROM (SELECT 1 UNION ALL SELECT 1);
SELECT DISTINCT * FROM (SELECT 2 UNION ALL SELECT 2);
SELECT sum(number) FROM numbers(10);
SELECT sum(ALL number) FROM numbers(10);
SELECT sum(DISTINCT number) FROM numbers(10);
SELECT sum(ALL x) FROM (SELECT 1 x UNION ALL SELECT 1)... |
-- differences with src/main/assembly/dist/install/db-tables.sql in order to support HSQLDB syntax
-- * SERIAL --> INTEGER IDENTITY
-- * TEXT --> VARCHAR(10000)
CREATE TABLE Deposit (
depositId CHAR(36) NOT NULL PRIMARY KEY,
bagName VARCHAR(10000),
creationTimestamp TIMESTAMP WITH TIME ZONE NOT NULL,
d... |
use shopping;
-- insert into user(user_name,user_password) values('user1','111111'),('user2','222222');
-- select * from user;
-- delete from user where user_id=3;
-- select * from user;
-- delete from user where user_id=4;
-- select * from user;
-- insert into equip(equip_name,equip_money,user_id) values
-- ('equip1',... |
-- Alterando tabela vendas
ALTER TABLE vendas ADD observacoes TEXT DEFAULT NULL NULL;
|
USE [ANTERO]
GO
/****** Object: View [dw].[v_koski_lukio_opiskelijat_uudet] Script Date: 20.5.2021 8:51:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
DROP view if exists [dw].[v_koski_lukio_opiskelijat_uudet_cultures]
GO
CREATE VIEW [dw].[v_koski_lukio_opiskelijat_uudet_cultures] AS
SELECT DIST... |
--+ holdcas on;
set names utf8;
CREATE TABLE test_jp(
id INT NOT NULL AUTO_INCREMENT,
ch CHAR utf8_ja_exp DEFAULT NULL,
vc VARCHAR(32) utf8_ja_exp DEFAULT NULL,
str STRING utf8_ja_exp DEFAULT NULL
);
-- Latin chars
INSERT INTO test_jp(ch, vc, str) VALUES(UPPER('ぁ'), UPPER('ぁ'), CONCAT(' ', UPPER('ぁ')));
INSERT INTO... |
insert into glyphs values(NULL, 5, 1, 2, 24, 1, 0, 800, 0, 86);
insert into glyphs values(NULL, 5, 2, 2, 24, 2, 0, 800, 86, 173);
insert into glyphs values(NULL, 5, 3, 2, 24, 3, 0, 800, 173, 260);
insert into glyphs values(NULL, 5, 4, 2, 24, 4, 0, 800, 260, 346);
insert into glyphs values(NULL, 5, 5, 2, 25, 1, 0, 800, ... |
BEGIN;
DROP TABLE IF EXISTS zeroex.view_api_affiliate_data;
CREATE TABLE IF NOT EXISTS zeroex.view_api_affiliate_data (
tx_hash BYTEA
, trace_address INTEGER[]
, block_number BIGINT
, block_time TIMESTAMPTZ
, caller BYTEA
, callee BYTEA
, affiliate_address BYTEA
, quote_timestamp BIGINT
... |
DROP VIEW IF EXISTS report.RV_Salesgroups;
Create VIEW report.RV_Salesgroups AS
select x.DateInvoiced, x.ProductSalesgroup,
Case When
x.PartnerSalesGroupValue = '0010'
THEN x.qtyInvoiced
ELSE 0
END
AS QtyInvoicedDiscounter,
Case When
x.PartnerSalesGroupValue = '0020'
THEN x.qtyInvoiced
ELSE 0
END
AS Q... |
-- Copyright 2020 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 in ... |
CREATE TABLE people (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
`email` VARCHAR(255),
`age` INTEGER,
`contact` BOOLEAN DEFAULT false,
`phone` VARCHAR(50)
);
CREATE TABLE `user` (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
`username` VARCHAR(255) UNIQUE NOT NULL,
... |
-- table
CREATE TEMPORARY TABLE `temp_geo_area` (
`id` bigint NOT NULL AUTO_INCREMENT,
`type` tinyint(4) NOT NULL,
`name` varchar(255) NOT NULL,
`short_name` varchar(255) NOT NULL,
`url` varchar(255) DEFAULT NULL,
`inflname` varchar(255) NOT NULL,
`parent` bigint NOT NULL,
`tz_id` int NOT NULL,
`lon` ... |
----------------------------------------------------------------------------
-- Trivadis AG, Infrastructure Managed Services
-- Saegereistrasse 29, 8152 Glattbrugg, Switzerland
----------------------------------------------------------------------------
-- Name......: 01_create_catalog_user.sql
-- Author....: Stefa... |
CREATE TABLE [dbo].[legacy_data]
(
[id] INT IDENTITY (1, 1) NOT NULL,
[title] NVARCHAR (1024) NOT NULL,
[unique_id] UNIQUEIDENTIFIER NOT NULL,
[is_batcher] BIT NULL,
[data_content] VARBINARY (MAX) NULL,
[amount] NUMERIC (14, 4) NULL,
[creat... |
CREATE FUNCTION func533() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE298);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE331);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE42);val:=(SELECT COUNT(*)INTO MYCOUN... |
--DO NOT MODIFY THIS FILE, IT IS GENERATED AUTOMATICALLY FROM SOURCES
-- Complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION observatory" to load this file. \quit
-- Version number of the extension release
CREATE OR REPLACE FUNCTION cdb_observatory_version()
RETURNS text ... |
-- collateA.test
--
-- execsql {SELECT a FROM t1 WHERE c='xyzzy '}
SELECT a FROM t1 WHERE c='xyzzy ' |
/*
* Simple sort
*/
[sql]
select v1 from t0 order by v1
[result]
logical sort (col)
logical project (col)
logical project (col,col,col)
logical project (col,col,col)
logical scan
[end]
[sql]
select v1,v2 from t0 order by v3
[result]
logical project (col,col)
logical sort (c... |
SET LONG 5000
SELECT DBMS_METADATA.get_DDL( 'CONSTRAINT', CONSTRAINT_NAME, USER )
FROM USER_CONSTRAINTS
WHERE CONSTRAINT_TYPE = UPPER('&tipo_cons')
ORDER BY TABLE_NAME, CONSTRAINT_NAME
/
|
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10000, 42, 0, 0, '_SAI_saimod_person', 'action', NULL);
REPLACE INTO `system_api` (`ID`, `group`, `type`, `parentID`, `parentValue`, `name`, `verify`) VALUES (10001, 42, 3, 0, '_SAI_saimod_person', 'search', 'STRING'... |
-- sanity check of system catalog
SELECT attrelid, attname, attgenerated FROM pg_attribute WHERE attgenerated NOT IN ('', 's');
CREATE TABLE gtest0 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (55) STORED);
CREATE TABLE gtest1 (a int PRIMARY KEY, b int GENERATED ALWAYS AS (a * 2) STORED);
SELECT table_name, column_... |
delimiter |
CREATE TRIGGER hooks_bu
BEFORE UPDATE ON hooks
FOR EACH ROW BEGIN
SET NEW.updated_at=NOW();
SET NEW.updated_by=CURRENT_USER();
END;
|
delimiter ;
|
ALTER PROCEDURE dw.p_lataa_f_avop_tilasto AS
TRUNCATE TABLE dw.f_avop_tilasto
INSERT INTO dw.f_avop_tilasto (
d_organisaatio_id,
d_koulutusluokitus_id,
d_kieli_id,
d_alueluokitus_id,
d_kalenteri_id,
koulutusmuoto,
kysymysryhma_fi, kysymysryhma_sv, kysymysryhma_en,
kysely_fi, kysely_sv, kysely_en,
k... |
DELETE FROM userq;
INSERT INTO userq (id, name, age, email) VALUES
(1, 'Jone', 18, 'test1@baomidou.com'),
(2, 'Jack', 20, 'test2@baomidou.com'),
(3, 'Tom', 28, 'test3@baomidou.com'),
(4, 'Sandy', 21, 'test4@baomidou.com'),
(5, 'Billie', 24, 'test5@baomidou.com');
INSERT INTO user2 (id, name, age) VALUES
(1, 'Jone', 1... |
DROP FUNCTION IF EXISTS menuBulkUpdate;
CREATE OR REPLACE FUNCTION menuBulkUpdate(nodes JSON[])
RETURNS INTEGER AS $$
DECLARE
node json;
id integer;
labelStr text;
parentid integer;
pos integer;
BEGIN
FOREACH node IN ARRAY nodes
LOOP
id := node->'id';
labelStr := ... |
-- Convert schema '/home/jjohnston/sites/Xqursion/share/migrations/_source/deploy/2/001-auto.yml' to '/home/jjohnston/sites/Xqursion/share/migrations/_source/deploy/3/001-auto.yml':;
;
BEGIN;
;
CREATE TABLE dependencies (
id char(64) NOT NULL,
dependency_group_id char(64) NOT NULL,
step_id char(64) NOT NULL,
... |
SELECT
{% for key, value in (("a", 3), ("b", 7)) %}{{ some_func(value) }} as {{ key }}{% if not loop.last %},{% endif %}{% endfor %}
FROM some_table
|
accept CRN PROMPT 'Enter the CL Account No ==> '
accept BRN PROMPT 'Enter the Branch ==> '
set head on
set array 1
set linesize 10000
set pagesize 50000
set long 10000
set echo on
set trimspool on
set colsep ';'
set numformat 9999999999999999.99
SPOOL c:\CLACC_DETAILS.SQL
SELECT * FROM ACVW_ALL_AC_ENTRIES... |
USE [VipunenTK_DW]
GO
/****** Object: View [dbo].[v_f_3_1a_Oppisopimus_paaasiallinen_toiminta] Script Date: 7.8.2018 11:00:19 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[v_f_3_1a_Oppisopimus_paaasiallinen_toiminta] AS
SELECT
tilastointivuosi = [tilv]
,tilv_da... |
-- Populate
-- All employees added into the database
INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES ('John', 'Doe', 1, 3);
INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES ('Mike', 'Chan', 2, 1);
INSERT INTO employee (first_name, last_name, role_id, manager_id) VALUES... |
DROP TABLE IF EXISTS tbl_yields; |
-- file:triggers.sql ln:1333 expect:true
create trigger trig_upd_after after update on parted_stmt_trig
for each statement execute procedure trigger_notice()
|
/* https://docs.microsoft.com/en-us/azure/synapse-analytics/sql-data-warehouse/performance-tuning-result-set-caching */
/* TPC_H Query 1 - Pricing Summary Report */
/*
Excute 3 times, RSC off, RSC on cold, RSC hot
*/-- takes between 12 seconds
-- result set caching
/*
ALTER DATABASE [tpch] SET RESULT_SET_CACHING off;... |
drop table if exists Releases;
drop table if exists Commits_Parent_Child;
drop table if exists Branches;
drop table if exists Snapshots;
drop table if exists Commits;
drop table if exists Repos;
CREATE TABLE Repos (
Repo_Name varchar(100) NOT NULL,
CONSTRAINT PK_Repos PRIMARY KEY CLUSTERED (Repo_Name)
);
... |
{% macro redshift__create_external_table(source_node) %}
{%- set columns = source_node.columns.values() -%}
{%- set external = source_node.external -%}
{%- set partitions = external.partitions -%}
{# https://docs.aws.amazon.com/redshift/latest/dg/r_CREATE_EXTERNAL_TABLE.html #}
{# This assumes you have al... |
create table if not exists `user` (
-- index
`id` int(8) unsigned zerofill not null auto_increment comment '本条记录的id',
-- body
`username` varchar(16) not null default '' comment '用户名',
`email` varchar(32) not null default '' comment '邮箱,用于身份验证',
`password` varchar(32) not null default '' comment '密码',
`typ... |
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION uniphant" to load this file. \quit
CREATE SCHEMA IF NOT EXISTS AUTHORIZATION api;
GRANT USAGE ON SCHEMA api TO web_anon;
GRANT USAGE ON SCHEMA webauthn TO web_anon;
GRANT web_anon TO postgrest;
DROP FUNCTION api.get_... |
ALTER TABLE "sessions" RENAME COLUMN "token" TO "_token_tmp"; |
drop table water.purposes; |
CREATE TABLE topic (
id bigint NOT NULL,
created_date timestamp without time zone DEFAULT now() NOT NULL,
last_modified_date timestamp without time zone DEFAULT now() NOT NULL,
version bigint DEFAULT 0 NOT NULL,... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 21, 2022 at 04:00 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 24, 2020 at 07:22 AM
-- Server version: 10.1.39-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.