sql stringlengths 6 1.05M |
|---|
<gh_stars>10-100
-- file:foreign_data.sql ln:464 expect:true
ALTER FOREIGN DATA WRAPPER foo OPTIONS (gotcha 'true')
|
USE test;
DROP TABLE IF EXISTS test.student_sport;
CREATE TABLE student_sport (
Student VARCHAR(50),
Sport VARCHAR(50)
);
INSERT INTO student_sport values ('Venus', 'Tennis');
|
-- For aggregate or non-aggregate records (RecordType = 1 or 2): PrimaryPlaceofPerformanceZIP+4 must not be provided for
-- any format of PrimaryPlaceOfPerformanceCode other than XX##### or XX####R."
SELECT
row_number,
record_type,
place_of_performance_code,
place_of_performance_zip4a,
afa_generated... |
-- Stworzenie tabeli
-- IDENTITY oznacza, że ta wartośc będzie się sama inkrementować i wypełniać, nie trzeba jej wpisywać jawnie przy wstawianiu
-- PRIMARY KEY oznacza, że jest to klucz główny tej tabeli, musi być unikalny
-- NOT NULL oznacza, że pole musi być wypełnione
CREATE TABLE Persons (
PersonID int NOT NU... |
<reponame>irhas-kf/aplikasi_pengadilan_agama_v2<gh_stars>0
/*
SQLyog Ultimate v10.42
MySQL - 5.5.5-10.4.11-MariaDB : Database - db_pengadilanagama
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHEC... |
<gh_stars>0
# ---------------------------------------------------------------------- #
# Script generated with: DeZign for Databases V9.1.0 #
# Target DBMS: MySQL 5 #
# Project file: PROJ-ZACK.dez #
# Projec... |
DROP DATABASE IF EXISTS dict_db_01036;
CREATE DATABASE dict_db_01036;
CREATE TABLE dict_db_01036.dict_data (key UInt64, val UInt64) Engine=Memory();
CREATE DICTIONARY dict_db_01036.dict
(
key UInt64 DEFAULT 0,
val UInt64 DEFAULT 10
)
PRIMARY KEY key
SOURCE(CLICKHOUSE(HOST 'localhost' PORT 9000 USER 'default' TABLE... |
-- migrate:up
DELETE from users_devices where device_id = 'dario_android' and username = 'dario';
DELETE from users_devices where device_id = 'b526979c-cade-4198-8fa4-fb077ef7544g' and username = 'dario';
DELETE from users_devices where device_id = 'b526979c-cade-4198-8fa4-fb077ef7544f' and username = 'dario';
DELETE ... |
<filename>sql/bookend.sql
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
CREATE OR REPLACE FUNCTION _timescaledb_internal.first_sfunc(internal, anyelement, "any")
RETURNS internal
AS '... |
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, skin_female) VALUES
('hacker', 1, 'level1', 'Level 1', '0', '{}', '{}'),
('hacker', 2, 'level2', 'Level 2', '0', '{}', '{}'),
('hacker', 3, 'level3', 'Level 3', '0', '{}', '{}'),
('hacker', 4, 'level4', 'Level 4', '0', '{}', '{}'),
('... |
insert overwrite into testInsertOverwriteWithCompression select l_orderkey, l_partkey, l_quantity from default.lineitem where l_orderkey = 3; |
CREATE TABLE FUNCS (
FUNC_ID BIGINT NOT NULL,
CLASS_NAME VARCHAR(4000),
CREATE_TIME INTEGER NOT NULL,
DB_ID BIGINT,
FUNC_NAME VARCHAR(128),
FUNC_TYPE INTEGER NOT NULL,
OWNER_NAME VARCHAR(128),
OWNER_TYPE VARCHAR(10)
);
CREATE UNIQUE INDEX UNIQUEFUNCTION ON FUNCS (FUNC_NAME, DB_ID);
CREATE INDEX FUNCS_N... |
create table t(n numeric(38,0));
insert into t values(1);
select * from t where n=1;
select * from t where n=1.0;
select * from t where n<0.0;
drop table t; |
--use function as an argument
select sec_to_time(time_to_sec('15:20:44'));
select sec_to_time(time_to_sec(time'15:20:44'));
select sec_to_time(time_to_sec(timestamp'1977-10-23 15:20:44'));
select sec_to_time(time_to_sec(datetime'15:20:44.123 10/23/1977'));
select sec_to_time(time_to_sec(to_time('15:20:44')));
select ... |
ALTER TABLE metric
ADD CONSTRAINT metric_m_name_check CHECK ((m_name ~ '^[a-z0-9_]+$'::text));
|
CREATE OR ALTER FUNCTION dbo.tvf_Principals
(
@PrincipalType int = 1,
@PrincipalStatus nvarchar(50) = 3
)
RETURNS @Principals TABLE
(
ObjectId uniqueidentifier NULL,
Identifier nvarchar(100) NULL,
DisplayName nvarchar(500) NULL,
PrincipalT... |
SELECT
id,
subject_id AS "subjectId",
grade_id AS "gradeId",
is_cummulative AS "isCummulative",
objective_id AS "objectiveId",
evaluation_number AS "evaluationNumber"
FROM ${ schema~ }.calification
WHERE id = ${id}
|
<filename>sql/001-create-tables.sql<gh_stars>0
---- drop ----
DROP TABLE IF EXISTS `users`;
---- create ----
create table IF not exists `users` (
`id` INT(11) AUTO_INCREMENT,
`name` VARCHAR(256) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
INSERT INTO `users` (`name`) VALUES
('Taro'),
... |
<reponame>dsun412/sql-scripts
-- Set utf8mb4 charset with utf8mb4_unicode_ci collation
SET NAMES utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Verify Settings
SHOW VARIABLES WHERE Variable_name LIKE 'character\_set\_%' OR Variable_name LIKE 'collation%';
-- Use this option --default-character-set=utf8mb4
-- Create database... |
<reponame>ayulestari10/linkroute
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 08 Feb 2018 pada 09.18
-- Versi Server: 10.1.10-MariaDB
-- PHP Version: 7.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_S... |
set pages 9999;
column redo_log_space_requests format 999,999,999
select
to_char(snap_time,'HH24'),
avg(newmem.value-oldmem.value) redo_log_space_requests
from
perfstat.stats$sysstat oldmem,
perfstat.stats$sysstat newmem,
perfstat.stats$snapshot sn
where
newmem.snap_id = sn.snap_id
and
oldmem... |
create table researches (
id int primary key auto_increment,
ip_address varchar (255),
site varchar (255),
type varchar (40),
query varchar (255),
result text,
create_date datetime default now(),
update_date datetime
) engine=innodb; |
<reponame>bensheldon/open311status<filename>db/views/global_indices_v01.sql<gh_stars>10-100
WITH
service_request_indices AS (
SELECT
('ServiceRequest-' || service_requests.id)::text AS id,
'ServiceRequest'::text AS searchable_type,
service_requests.id::int AS searchable_id,
(
... |
<filename>ontask/tests/fixtures/test_empty_key_after_merge.sql<gh_stars>10-100
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.2
-- Dumped by pg_dump version 11.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standa... |
-- 系统配置
INSERT INTO `system_config` (`id`, `name`, `field`, `key`, `parent_id`, `order`, `value`, `component`, `status`, `created_at`, `updated_at`, `field_type`, `icon`, `type`, `options`, `required`) VALUES (5, '站点配置', 'system', 'system', 0, 0, 'aaaaa', 'Input', 0, '2021-08-31 16:39:50', '2021-09-09 16:18:03', '', 'a... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.27)
# Database: go_starter
# Generation Time: 2020-01-17 13:52:51 +0000
# ********************************************... |
<gh_stars>100-1000
USE Practice;
DROP TABLE IF EXISTS course_grade_pivoted;
CREATE TABLE course_grade_pivoted AS
SELECT
name
,MAX(CASE WHEN course = 'CS106B' THEN grade ELSE NULL END) AS 'CS106B'
,MAX(CASE WHEN course = 'CS229' THEN grade ELSE NULL END) AS 'CS229'
,MAX(CASE WHEN course = 'CS224N' THEN grade EL... |
<gh_stars>1000+
--
-- Build a temporary table of duplicate PP_MRP records which are about same C_OrderLine.
drop table if exists PP_MRP_Duplicates;
create temporary table PP_MRP_Duplicates as
select t.*, mrp.PP_MRP_ID
from
(
select C_OrderLine_ID
, max(PP_MRP_ID) as Last_PP_MRP_ID
, count(*)
from PP_MRP mrp
where... |
<filename>servers/slapd/back-sql/rdbms_depend/mysql/testdb_metadata.sql
-- mappings
-- objectClass mappings: these may be viewed as structuralObjectClass, the ones that are used to decide how to build an entry
-- id a unique number identifying the objectClass
-- name the name of the objectClass; it MUST match the na... |
--CREATE VIEW elhcustom.v_OnTrack AS
--ALTER VIEW elhcustom.v_OnTrack AS
--This View gathers the courses a student has already passed from his or her transcript and the courses he or she is currently taking. It calculates
--the number of credits he/she has earned toward each graduation requirement.
--****WARNING:... |
<filename>target/classes/db/migration/V02__CLASS_BASE.sql
CREATE TABLE school (
id BIGINT(11) AUTO_INCREMENT PRIMARY KEY,
name_school VARCHAR(100),
name_social VARCHAR(45),
cnpj VARCHAR(14),
ie VARCHAR(14),
im VARCHAR(14),
complement_home VARCHAR(45),
number_home VARCHAR(10),
id_street BIGINT(11),
FOREIG... |
<filename>microservicio/infraestructura/src/main/resources/sql/libro/eliminar.sql<gh_stars>0
delete
from libro
where id = :id |
CREATE SCHEMA AUTHORIZATION slello;
CREATE TABLE slello.visibility (
id SERIAL PRIMARY KEY,
name VARCHAR(30) NOT NULL
);
INSERT INTO slello.visibility(name) VALUES ('OPEN');
INSERT INTO slello.visibility(name) VALUES ('CLOSED');
INSERT INTO slello.visibility(name) VALUES ('SECRET');
CREATE TABLE slello.a... |
<filename>cuebot/src/main/resources/conf/ddl/postgres/migrations/V8__Increase_hostname_length.sql
-- Increase the length of hostnames for IPv6 address.
ALTER TABLE "host" ALTER COLUMN "str_name" TYPE VARCHAR(45);
ALTER TABLE "host_tag" ALTER COLUMN "str_tag" TYPE VARCHAR(45);
|
CREATE TABLE city (
id integer NOT NULL,
name text NOT NULL,
countrycode character(3) NOT NULL,
district text NOT NULL,
population integer NOT NULL
);
CREATE TABLE country (
code character(3) NOT NULL,
name text NOT NULL,
continent text NOT NULL,
region text NOT NULL,
surfaceare... |
CREATE PROCEDURE [sp_ins_Account] (
@EntityType nvarchar(50),
@EntityID int
)
AS
INSERT INTO [dbo].[Account] (
[EntityType],
[EntityID]
)
VALUES (
@EntityType,
@EntityID
) |
<reponame>xuwei-k/flyway-play<gh_stars>100-1000
create table person (
id int not null,
name varchar(100) not null
);
|
#standardSQL
# percent of pages with score_progressive_jpeg
# -1, 0 - 25, 25 - 50, 50 - 75, 75 - 100
SELECT
client,
COUNTIF(score < 0) / COUNT(0) AS percent_negative,
COUNTIF(score >= 0 AND score < 25) / COUNT(0) AS percent_0_25,
COUNTIF(score >= 25 AND score < 50) / COUNT(0) AS percent_25_50,
COUNTIF(score ... |
<filename>src/test/tinc/tincrepo/mpp/gpdb/tests/storage/uao/uao_ddl/sql/analyze_ao_table_first_update.sql
-- @description : Update UAO tables and Analyze after first Insert only
--
-- Create AO tables
DROP TABLE IF EXISTS sto_uao_city_analyze_first_upd cascade;
BEGIN;
CREATE TABLE sto_uao_city_analyze_first_upd (
... |
<gh_stars>1-10
-- @product_version gpdb: [4.3.0.0-]
CREATE TABLE resync_uao_vacuum1(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change_datatype_col numeric,
a_ts_without times... |
<gh_stars>0
# Host: localhost (Version: 5.5.38)
# Date: 2015-04-04 13:06:52
# Generator: MySQL-Front 5.3 (Build 4.120)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "gg_company"
#
DROP TABLE IF EXISTS `gg_company`;
CREATE TABLE `gg_company` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`company_name` varchar(... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
alter table PID_ENTITY_PROTEIN disable constraint SYS_C0016474;
alter table PID_ENTITY_PROTEIN disable constraint SYS_C0016475;
alter table PID_ENTITY_PROTEIN dis... |
<reponame>charles-cowart/microsetta-private-api
-- tablefunc is an additional supplied module that comes with postgres
-- and enables data pivoting in queries
CREATE EXTENSION IF NOT EXISTS tablefunc;
-- add an index on project_barcodes' barcode field
CREATE INDEX ind_barcode on barcodes.project_barcode (barcode);
--... |
<reponame>laudarch/GTAS
create table passenger_details_from_message
(
id bigint unsigned auto_increment
primary key,
created_at datetime null,
created_by varchar(20) null,
updated_at datetime null,
updated_by varchar(20) null,
pdfm_age int null,
pdfm_deleted bit not null,
dob dat... |
<filename>sql/db_update_0.8-alpha5_0.8-alpha6_mysql.sql
ALTER TABLE {PREFIX}plugins ADD path varchar(255) default null;
|
-- @testpoint: opengauss关键字maxtrans(非保留),作为函数名,部分测试点合理报错
--关键字不带引号-成功
drop function if exists maxtrans;
create function maxtrans(i integer)
returns integer
as $$
begin
return i+1;
end;
$$ language plpgsql;
/
--关键字带双引号-成功
drop function if exists "maxtrans";
create function "maxtrans"(i integer)
returns integer
as $... |
-- This file is automatically generated by LogicalPlanToSQLSuite.
select *
from (select *
from src b
where exists (select a.key
from src a
where b.value = a.value and a.key = b.key and a.value > 'val_9')) a
-------------------------------------------------------------... |
<filename>pop_punk_a_pedia.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 10, 2018 at 12:39 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SE... |
<gh_stars>0
/* creates the database */
CREATE DATABASE IF NOT EXISTS `testing` CHARACTER SET utf8 COLLATE utf8_general_ci;
/* creates the user and grants privileges */
GRANT ALL ON `testing`.* TO `user`@localhost IDENTIFIED BY '<PASSWORD>';
FLUSH PRIVILEGES;
/* create the player table */
CREATE TABLE IF NOT EXISTS ... |
DROP TRIGGER IF EXISTS after_delete_image;
DELIMITER ;;
CREATE DEFINER=web@localhost TRIGGER after_delete_image AFTER DELETE ON images FOR EACH ROW
BEGIN
INSERT INTO images_deleted (id, path) VALUES (OLD.id, OLD.path);
END ;;
DELIMITER ;
|
<filename>nelangsa.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 25, 2018 at 12:59 AM
-- Server version: 10.0.17-MariaDB
-- PHP Version: 5.5.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 07, 2015 at 05:31 PM
-- Server version: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
<gh_stars>0
DROP TABLE IF EXISTS app.todos;
DROP TABLE IF EXISTS app.tasks;
DROP TABLE IF EXISTS app.users;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE app.users (
id UUID DEFAULT uuid_generate_v4(),
name TEXT NOT NULL,
email TEXT NOT NULL UNIQUE,
password_hash TEXT NOT NULL,
PRIMARY KEY (id)... |
<reponame>wangze690/jumeisc
/*
Navicat MySQL Data Transfer
Source Server : practise
Source Server Version : 50505
Source Host : localhost:3306
Source Database : jumei
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2017-12-12 09:01:42
*/
SET FO... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 21, 2017 at 04:59 PM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
<gh_stars>0
ALTER TABLE LA_CARD_LABEL_VALUE ADD FOREIGN KEY(CARD_LABEL_VALUE_LIST_VALUE_FK) REFERENCES LA_CARD_LABEL_LIST_VALUE(CARD_LABEL_LIST_VALUE_ID);
|
------------------------------------------------------
-- table: cancel. indexes
------------------------------------------------------
-- index: cuix_cancel_key
-- drop index cuix_cancel_key;
create unique index cuix_cancel_key on cancel using btree (key);
alter table cancel cluster on cuix_cancel_key;
|
<filename>airlytics-kafka-consumer/src/test/resources/purchase-data-validation-sql/onUpgradedRevenueShouldBeNegative.sql<gh_stars>0
select
product,
count(*)
from
%s.purchase_events pe
where
name = 'UPGRADED'
and revenue_usd_micros > 0
group by
product |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 15-09-2018 a las 00:43:45
-- Versión del servidor: 5.7.23-0ubuntu0.16.04.1
-- Versión de PHP: 7.0.31-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zon... |
--CREATE FUNCTION [dbo].[ufn_sqlwatch_get_error_detail_text]()
--RETURNS nvarchar(max)
--AS
--BEGIN
-- return (select case when ERROR_MESSAGE() is not null then (
-- select 'ERROR_NUMBER=' + isnull(convert(nvarchar(max),ERROR_NUMBER()),'') + char(10) +
--'ERROR_SEVERITY=' + isnull(convert(nvarchar(max),ERROR_SEVERIT... |
<filename>db/sql/6219__alter_proc_p_lataa_d_opettajapatevyys.sql
USE [ANTERO]
GO
/****** Object: StoredProcedure [dw].[p_lataa_d_opettajapatevyys] Script Date: 13.5.2022 8:28:02 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dw].[p_lataa_d_opettajapatevyys] AS
TRUNCATE TABLE dw.d_o... |
<reponame>iotconnect-apps/AppConnect-AirQualityMonitoring<filename>iot.solution.database/dbo/Tables/TelemetrySummary_Hourwise.sql
CREATE TABLE [dbo].[TelemetrySummary_Hourwise] (
[guid] UNIQUEIDENTIFIER NOT NULL,
[deviceGuid] UNIQUEIDENTIFIER NOT NULL,
[date] DATETIME NOT NULL,
[att... |
-- @Namespace SessionManagement
-- @Name CountPortalUser
-- @Return ClrTypes:int Mode:Single
CREATE PROCEDURE [dbo].[hlsyssession_query_countportaluser] @productid SMALLINT, @objectid INT, @objectdefid INT
AS
SELECT COUNT(*)
FROM [dbo].[hlsyssession]
WHERE productid = @productid AND objectid = @objectid AND objectd... |
create database dms_demo_db
using dms_demo_db
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[counterparty](
[counterparty_id] [int] NOT NULL,
[counterparty_short_name] [nvarchar](50) NOT NULL,
[counterparty_full_name] [nvarchar](250) NOT NULL
) ON [PRIMARY]
GO
CREATE TABLE [dbo].[trade](
... |
-- randexpr1.test
--
-- db eval {SELECT 17-13-case 19 when 17+case case t1.b when t1.b then coalesce((select coalesce((select 11 from t1 where (coalesce((select t1.a from t1 where (abs(f)/abs(case t1.e when 11 then a else t1.c end))<c),b)*a- -t1.e) not between t1.e and -13),19) from t1 where d>19 or d not between f a... |
<reponame>dram/metasfresh<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5565960_sys_gh9863_CreditMemo_For_Paid_Invoice_Messages.sql
-- 2020-08-31T11:28:25.800Z
-- URL zum Konzept
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy... |
-- MySQL Script generated by MySQL Workbench
-- Mon Feb 15 09:20:31 2021
-- 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='ON... |
ALTER TABLE PROTOCOL_VOTE_ABSTAINEES MODIFY ROLODEX_ID DECIMAL(6,0); |
DROP TRIGGER IF EXISTS trigger_flag ON osm_mountain_linestring;
DROP TRIGGER IF EXISTS trigger_store ON osm_mountain_linestring;
DROP TRIGGER IF EXISTS trigger_refresh ON mountain_linestring.updates;
CREATE SCHEMA IF NOT EXISTS mountain_linestring;
CREATE TABLE IF NOT EXISTS mountain_linestring.osm_ids
(
osm_id b... |
GO
PRINT N'Dropping FK_Organisation_BusinessAddress...';
GO
ALTER TABLE [Organisation].[Organisation] DROP CONSTRAINT [FK_Organisation_BusinessAddress];
GO
GO
PRINT N'Dropping FK_Organisation_NotificationAddress...';
GO
ALTER TABLE [Organisation].[Organisation] DROP CONSTRAINT [FK_Organisation_NotificationAddres... |
CREATE TABLE revisions (
id SERIAL PRIMARY KEY,
document_id INTEGER NOT NULL REFERENCES documents(id),
created TIMESTAMP NOT NULL,
contents TEXT NOT NULL
)
|
<gh_stars>0
ALTER TABLE "identities" RENAME TO "_identities_tmp";
CREATE TABLE "identities" (
"id" TEXT PRIMARY KEY,
"schema_id" TEXT NOT NULL,
"traits" TEXT NOT NULL,
"created_at" DATETIME NOT NULL,
"updated_at" DATETIME NOT NULL
);
INSERT INTO "identities" (id, schema_id, traits, created_at, updated_at) SELECT id, tr... |
{% materialization vault_insert_by_period, default -%}
{%- set full_refresh_mode = (should_full_refresh()) -%}
{% if target.type == "sqlserver" %}
{%- set target_relation = this.incorporate(type='table') -%}
{% else %}
{%- set target_relation = this -%}
{% endif %}
{%- set existin... |
<reponame>unison/unison
-- This SQL reindexes most tables in unison
-- This is worth doing peridically to recover unused index pages
-- WARNING: reindexing exclusively locks the specified table; write AND READS
-- will block until it finishes.
-- see also recluster.sql
reindex table pmsm_pmhmm;
reindex table palignmen... |
<gh_stars>0
/*
How to remove all shared drafts and start with a clean state using Collaborative Editing
Purpose: Important Definitions
To understand more about this KB, the following definitions are necessary:
CE: Collaborative Editing.
Personal draft: a draft that is visible only by its creator and was s... |
<reponame>enter-haken/rasmus<filename>database_scripts/role.sql
SET search_path TO rasmus,public;
-- todo: who can add/update/delete a role
-- todo: seed base roles: admin, readonly
-- json view -> role description with associated privileges
CREATE TABLE role(
id UUID NOT NULL PRIMARY KEY DEFAULT gen_random_uuid()... |
<reponame>189569400/ClickHouse
SELECT count(1) FROM {table}
SELECT count(1) FROM {table} WHERE AdvEngineID != 0
SELECT sum(AdvEngineID), count(1), avg(ResolutionWidth) FROM {table}
SELECT sum(UserID) FROM {table}
SELECT count(UserID) FROM ( SELECT DISTINCT UserID FROM {table} ) AS d
SELECT count(SearchPhrase) FROM ( SE... |
DROP TRIGGER app_configs_updated_at on app_configs;
DROP TABLE app_configs;
|
<reponame>illuminatixs-newbms/Lidium
CREATE TABLE IF NOT EXISTS `wz_questpartydata` (
`id` int(11) NOT NULL,
`questid` int(11) NOT NULL DEFAULT 0,
`rank` varchar(1) NOT NULL DEFAULT '',
`mode` varchar(13) NOT NULL DEFAULT '',
`property` varchar(255) NOT NULL DEFAULT '',
`value` int(11) NOT NULL DEFAULT 0
) ... |
--
-- Name: wal_size; Type: TABLE; Schema: public; Owner: pgwatch2
--
CREATE TABLE public.wal_size (
"time" timestamp with time zone NOT NULL,
dbname text NOT NULL,
data jsonb NOT NULL,
tag_data jsonb
)
PARTITION BY RANGE ("time");
ALTER TABLE public.wal_size OWNER TO pgwatch2;
--
--... |
{% macro mysql5__get_catalog(information_schema, schemas) -%}
{%- call statement('catalog', fetch_result=True) -%}
select
columns.table_database,
columns.table_schema,
columns.table_name,
tables.table_type,
columns.table_comment,
tables.table_owner,
colum... |
<gh_stars>1-10
drop table if exists t1;
create table t1(type int, a json);
insert into t1 values (1, json_object('age', 20));
insert into t1 values (2, json_object('age', 15));
insert into t1 values (2, json_object('age', 20));
insert into t1 values (2, json_object('age', 30));
select type, count(*), max(a->'$.age'), ... |
-- @testpoint: opengauss关键字new(非保留),作为存储过程名,部分测试点合理报错
--关键字不带引号-成功
drop procedure if exists new;
create procedure new(
section number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
select sum(salary), count(*) into salary_sum, staffs_count from staffs where section_id = section;
end;
/
--关键... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 15, 2018 at 06:26 PM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 5.6.35-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
<gh_stars>0
ALTER TABLE lipas.laavu_kota_kammi RENAME TO laavu_kota_tai_kammi;
ALTER TABLE lipas.frisbeegolf_rata RENAME TO frisbeegolfrata;
ALTER TABLE lipas.kavely_ulkoilureitti RENAME TO kavelyreitti_ulkoilureitti;
ALTER TABLE lipas.laavu_kota_tai_kammi DROP CONSTRAINT laavu_kota_kammi_pk;
ALTER TABLE lipas.frisbeeg... |
<filename>inf2.sql
CREATE TABLE IF NOT EXISTS flights (
"Место прибытия" text,
"Номер самолёта" text,
"Тип" text);
CREATE TABLE IF NOT EXISTS info (
"Номер самолёта" text,
"Количество мест" integer,
"Количество купленных билетов" integer,
"Тип" text);
INSERT INTO flights("Место прибытия", ... |
INSERT INTO Funcionarios (Nome,Sobrenome)
VALUES ('Catarina','Strada')
,('Tadeu','Vitelli');
INSERT INTO Funcionarios (Nome,Sobrenome)
VALUES ('Lucas','souza')
UPDATE Funcionarios
SET Sobrenome = 'Nogueira'
WHERE IdFuncionario = 4; |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50722
Source Host : 127.0.0.1:3306
Source Database : dxhc
Target Server Type : MYSQL
Target Server Version : 50722
File Encoding : 65001
Date: 2019-11-11 11:33:40
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
<reponame>jyates92/Handlebars-
INSERT INTO burgers (burger_name) VALUES ('Bacon Cheeseburger');
INSERT INTO burgers (burger_name) VALUES ('Veggie Burger');
INSERT INTO burgers (burger_name) VALUES ('Chicken Burger'); |
CREATE PROCEDURE [dbo].[dnn_GetFileContent]
@FileId int
AS
BEGIN
SELECT Content
FROM dbo.[dnn_Files]
WHERE FileId = @FileId
END
|
drop table if exists FM_TRAN_DEF;
/*==============================================================*/
/* Table: FM_TRAN_DEF */
/*==============================================================*/
create table FM_TRAN_DEF
(
EVENT_TYPE varchar(50) not null comment '事件类型 MB_EVENT... |
SET DEFINE OFF;
CREATE TABLE DREF_SERVICE_GRP
(
SERVICE_TYPE VARCHAR2(15 BYTE),
DESCRIPTION VARCHAR2(50 BYTE),
GROUPING VARCHAR2(50 BYTE)
)
TABLESPACE DTW_ADV_TABLES
RESULT_CACHE (MODE DEFAULT)
PCTUSED 0
PCTFREE 10
INITRANS 1
MAXTRANS 255
STORAGE (
INITIAL 80K
... |
-- file:plpgsql.sql ln:3325 expect:true
create or replace function compos() returns int as $$
begin
return (1, 'hello')::compostype
|
<reponame>Shuttl-Tech/antlr_psql
-- file:rangefuncs.sql ln:26 expect:true
create temporary view vw_ord as select * from (values (1)) v(n) join rows from(foot(1),foot(2)) with ordinality as z(a,b,c,d,ord) on (n=ord)
|
<reponame>Shuttl-Tech/antlr_psql
-- file:rangefuncs.sql ln:360 expect:true
SELECT * FROM foob(42, 99) AS p(a,b)
|
-- CreateTable
CREATE TABLE "refresh_token" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"expiresIn" INTEGER NOT NULL,
"userId" INTEGER NOT NULL,
FOREIGN KEY ("userId") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE CASCADE
);
-- CreateIndex
CREATE UNIQUE INDEX "refresh_token_userId_unique... |
--------------------------------------------------------
-- DDL for Index SYS_C007207
--------------------------------------------------------
CREATE UNIQUE INDEX "PRMSADMIN"."SYS_C007207" ON "PRMSADMIN"."INVITATION" ("INVID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 10... |
drop table if exists reason_text;
create table reason_text
(
r_reason_sk int,
r_reason_id string,
r_reason_desc string
)
USING csv
OPTIONS(header "false", delimiter "|", path "${TPCDS_GENDATA_DIR}/reason")
;
drop table if exists reason;
create table reason
using parq... |
<filename>tests/queries/0_stateless/01091_num_threads.sql
set log_queries=1;
set log_query_threads=1;
SELECT 1;
SYSTEM FLUSH LOGS;
WITH
(
SELECT query_id
FROM system.query_log
WHERE (query = 'SELECT 1')
ORDER BY event_time DESC
LIMIT 1
) AS id
SELECT uniqExact(thread_i... |
USE ota;
CREATE TABLE CandleSource (
CandleSourceId int AUTO_INCREMENT PRIMARY KEY,
Name varchar(15) BINARY NOT NULL,
CONSTRAINT CkInstrument_Name UNIQUE(Name)
)
INSERT INTO CandleSource (Name) values ('Downloaded');
INSERT INTO CandleSource (Name) values ('Calculated');
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.