sql stringlengths 6 1.05M |
|---|
<reponame>Shuttl-Tech/antlr_psql
-- file:create_table_like.sql ln:73 expect:true
CREATE INDEX ctlt1_fnidx ON ctlt1 ((a || b))
|
CREATE PROCEDURE [WebApi].[UpdateCityFromJson](@City NVARCHAR(MAX), @CityID int,@UserID int)
WITH EXECUTE AS OWNER
AS BEGIN
UPDATE Application.Cities SET
CityName = json.CityName,
StateProvinceID = json.StateProvinceID,
LatestRecordedPopulation = json.LatestRecordedPopulation,
LastEditedBy = @UserID
FROM OPE... |
<filename>Rapport/rapport.sql
SELECT 1 AS test
SELECT 2 AS test |
<reponame>emystein/jdbc-script-runner
DROP TABLE post IF EXISTS;
DROP TABLE author IF EXISTS;
|
drop table customer if exists;
drop table group_role if exists;
drop table rgroup if exists;
drop table role if exists;
drop table user_group if exists;
create table customer (id bigint generated by default as identity, language_id integer not null, last_visit_time timestamp, currency varchar(255) not null, expired boo... |
<reponame>andreylipattsev/almanac.httparchive.org<gh_stars>1-10
#standardSQL
# Pages that provide `/.well-known/gpc.json` for Global Privacy Control
WITH totals AS (
SELECT
_TABLE_SUFFIX,
COUNT(0) AS total_websites
FROM
`httparchive.technologies.2021_07_01_*`
GROUP BY
_TABLE_SUFFIX
)
SELECT
_T... |
<reponame>estebanzimanyi/Geo3D
/*-------------------------------------------------------------------------
*
* geo3D_topo_ops.sql
* Topological operations for 3D geometries
*
* Portions Copyright (c) 2017, <NAME>, Université Libre de Bruxelles
* Portions Copyright (c) 1996-2017, PostgreSQL Global Developm... |
-- @author prabhd
-- @created 2013-02-01 12:00:00
-- @modified 2013-02-01 12:00:00
-- @tags cte HAWQ
-- @product_version gpdb: [4.3-],hawq: [1.1-]
-- @db_name world_db
-- @skip OPT-2497
-- @description test27d: DML with CTE [UPDATE]
SELECT * FROM newfoo ORDER BY 1;
WITH CTE(c,d) as
(
SELECT a,b FROM foo WHERE ... |
<reponame>thamhut/phalcon
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50624
Source Host : localhost:3306
Source Database : fightsport
Target Server Type : MYSQL
Target Server Version : 50624
File Encoding : 65001
Date: 2015-08-10 14:42:02
*/
SE... |
<filename>CompressIndexes.sql
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*------------------------------------------------------------------------------------------------------
Description Identifies Indexes that are not compressed and compresses them
Tables where the indexes aren't compressed make... |
<reponame>Capping-WAR/API
-- File: War.sql
-- Description: Create Sql Commands for War DB
-- Date: 2019-09-20
-- Author: <NAME>
\c war;
-- create statements --
--Reviewers--
create table Reviewers(
reviewerId integer not null,
emailAddress text not null,
firstName text not null,
lastName text not nu... |
<reponame>ratuverlaily/praktikumsmk<filename>elerning.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 14, 2021 at 08:01 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTI... |
INSERT INTO AUTHORS (AUTHOR_ID, FIRST_NAME, LAST_NAME) VALUES (101, 'George', 'Orwell');
INSERT INTO BOOKS (BOOK_ID, TITLE, NUM_PAGES) VALUES (201, 'Animal Farm', 112);
INSERT INTO BOOKS (BOOK_ID, TITLE, NUM_PAGES) VALUES (202, '1984', 328);
INSERT INTO AUTHORS_BOOKS VALUES (101, 201);
INSERT INTO AUTHORS_BOOKS VALUE... |
\connect election;
set search_path to federal;
/*
US HOUSE OF REPRESENTATIVES
*/
insert into federal_rep
select to_date(election_date, 'MM/DD/YYYY'), state, district, candidate, party,
to_number(votes, '999999999'), 'full', to_date('1/3/2013','MM/DD/YYYY'),
to_date('1/2/2015','MM/DD/YYYY'), 'general'
from federal_raw... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 22-Dez-2021 às 21:43
-- Versão do servidor: 10.4.22-MariaDB
-- versão do PHP: 7.3.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner:
--
CREATE EXTENSION IF NOT EXISTS plpgsql WITH SCHEMA pg_cata... |
<gh_stars>0
/*
Warnings:
- You are about to drop the column `userId` on the `Followers` table. All the data in the column will be lost.
- Added the required column `followedId` to the `Followers` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "Fol... |
<filename>Exams/Exam 13 February 2021/01.DDL.sql
CREATE TABLE Users
(
Id INT PRIMARY KEY IDENTITY,
Username VARCHAR(30) NOT NULL,
[Password] VARCHAR(30) NOT NULL,
Email VARCHAR(50) NOT NULL
)
CREATE TABLE Repositories
(
Id INT PRIMARY KEY IDENTITY,
[Name] VARCHAR(50)
)
CREATE TABLE RepositoriesContributors
(
R... |
DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE Bamazon;
USE Bamazon;
CREATE TABLE products (
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(30) NOT NULL,
department_name VARCHAR(30) NOT NULL,
price DECIMAL(10,2) NOT NULL,
stock_quantity INT NOT NULL,
PRIMARY KEY (item_id)
);
INSERT INTO products (... |
USE [Grasews2.0]
GO
INSERT INTO [dbo].[XsdComplexElement]
([IdXsdDocument]
,[XsdComplexElementName]
,[RegistrationDateTime]
,[XsdToWsdlRelationType]
,[IdWsdlInput])
VALUES
(1
,'complex element 1'
,getdate()
,3
... |
<reponame>agorinenko/TaskManager
EXECUTE ver.insert_version ?, ?, ?, ?; |
create table characters (
user_id bigint not null unique,
name varchar(12) not null unique primary key,
class_name varchar(20) not null,
spec varchar(32)
);
create table events (
id int unsigned auto_increment primary key,
name varchar(64) not null,
date timestamp not null,
channel_id bigint not null,
message... |
SELECT
thread_reply_notifications.id, recipient_id, dismissed,
reply_id, replies.submission_id, submission_votes.kind AS submission_vote_kind,
replies.short_id AS reply_short_id, replies.body AS reply_body,
reply_votes.kind AS reply_vote_kind, replies.created_at AS reply_created_at,
replies.updated_at AS repl... |
INSERT INTO Reader.Category (categoryId, title)
SELECT
id AS categoryId,
title AS title
FROM ttrss_feed_categories;
INSERT INTO Reader.Feed (feedId, categoryId, url, title, frequency, isEnabled, dateChecked)
SELECT
id AS feedId,
cat_id AS categoryId,
feed_url AS url,
title AS title,
IF(update_interval >= 0, up... |
-- file:portals.sql ln:13 expect:true
DECLARE foo4 SCROLL CURSOR FOR SELECT * FROM tenk2
|
<gh_stars>0
# Host: localhost (Version: 5.5.53)
# Date: 2017-09-26 01:54:55
# Generator: MySQL-Front 5.3 (Build 4.234)351615
/*!40101 SET NAMES utf8 */;
#
# Structure for table "gb_admin"
#
DROP TABLE IF EXISTS `gb_admin`;
CREATE TABLE `gb_admin` (
`id` mediumint(9) NOT NULL AUTO_INCREMENT COMMENT '管理员id',
`w... |
--
-- Table structure for table `lzfolderstructure`
--
DROP TABLE IF EXISTS `lzfolderstructure`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lzfolderstructure` (
`id` int(11) NOT NULL,
`name` varchar(45) NOT NULL,
`isActive` tinyint(4)... |
<filename>src/Framework.Database/Security/Entity.sql
CREATE SCHEMA [Entity]
AUTHORIZATION [dbo];
|
<filename>src/test/tinc/tincrepo/mpp/gpdb/tests/storage/filerep_end_to_end/resync/sql/resync_create_drop_index.sql<gh_stars>1-10
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
CREATE TABLE resync_heap_table_unique_index(
text_col text,
bigint_col bigint,
char_vary_col character varyi... |
<reponame>wotchin/openGauss-server<filename>src/test/regress/sql/gin_test2.sql<gh_stars>100-1000
-- 分区表gin 创建 修改 重建 删除 测试
-- Set GUC paramemter
SET ENABLE_SEQSCAN=OFF;
SET ENABLE_INDEXSCAN=OFF;
SET ENABLE_BITMAPSCAN=ON;
-- 创建分区表
DROP TABLE IF EXISTS test_gin_student;
CREATE TABLE test_gin_student
(
num int,
... |
<filename>0.1.x/JFPC-Beans/src/main/java/org/jfpc/beans/platform/MS3C2/MS3C2.sql
CREATE TABLE ms3c2
(
puk VARCHAR(24) DEFAULT '0' NOT NULL,
k01_ywbsid VARCHAR(24),
k02_sjhm VARCHAR(24),
k03_dxwgid VARCHAR(24),
f01_wgzt VARCHAR(20),
f02_fszt VARCHAR(20),
f03_wgfhzt VARCHAR(20),
bbb VARCHA... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 16, 2017 at 02:07 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... |
-- Create the app database
CREATE DATABASE ycc_checkin;
-- CHARACTER SET charset_name
-- COLLATE collation_name
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Dec 23, 2019 at 03:48 AM
-- Server version: 5.7.26
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `tour_app`
--
-- -------------------------... |
CREATE OR REPLACE FUNCTION public.update_user(session_ text, id_ integer, can_add_ boolean, can_reserve_ boolean, can_delete_ boolean)
RETURNS boolean
LANGUAGE plpgsql
AS $function$
declare
user_id_ integer;
begin
select user_id into user_id_ from sessions where id = session_;
if not((select count(*) from session... |
<reponame>Khromushkin/study-kotlin-liquibase-job<filename>src/main/resources/db/changesets/test_table/init_dml_dev.sql
insert into test_service_name.test_table (key, value)
values ('dev_key_1', 'dev_value_1'); |
<reponame>mefellows/follow
INSERT INTO users (first_name, last_name, email, device_id) VALUES ('Matt', 'Fellows', '<EMAIL>', '445996f8-d088-11e6-bf26-cec0c932ce01');
INSERT INTO users (first_name, last_name, email, device_id) VALUES ('Matt', 'Fellows', '<EMAIL>', '445996f8-d088-11e6-bf26-cec0c932ce01');
-- Note: Longit... |
CREATE INDEX IF NOT EXISTS ix_operations_pkh_not_null
ON tezos.operations USING btree
(pkh COLLATE pg_catalog."default", kind COLLATE pg_catalog."default")
WHERE pkh IS NOT NULL;
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Aug 27, 2019 at 12:03 PM
-- Server version: 5.7.24
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
<filename>Tables/dbo.ProgramType.sql
CREATE TABLE [dbo].[ProgramType]
(
[ProgramTypePK] [int] NOT NULL IDENTITY(1, 1),
[Creator] [varchar] (256) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[CreateDate] [datetime] NOT NULL,
[ProgramFK] [int] NOT NULL,
[TypeCodeFK] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE... |
SET DEFINE OFF;
ALTER TABLE AFW_13_FORMT_RESRC ADD (
CONSTRAINT AFW_13_FORMT_RESRC_FK2
FOREIGN KEY (REF_TYPE_FICHR)
REFERENCES AFW_13_TYPE_FICHR (SEQNC)
ENABLE VALIDATE)
/
|
DROP TABLE pangkatgol;
CREATE TABLE `pangkatgol` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pangkat` varchar(45) DEFAULT NULL,
`golongan` varchar(12) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=latin1;
INSERT INTO pangkatgol VALUES("1","PEMBINA UTAMA","IV/E");
INSERT INTO ... |
/* リスト4-1 データ登録前のb2テーブルを確認 */
SELECT *
FROM b2
ORDER BY published_at DESC;
/* リスト4-3 基本的なINSERT文 */
INSERT INTO b2 (id, title, published_at)
VALUES ('1', 'Pythonエンジニア ファーストブック', '2017-09-09');
/* リスト4-5 INSERT文を実行し、結果を確認 */
INSERT INTO b2 (id, title, published_at)
VALUES ('1', 'Pythonエンジニア ファーストブック', '2017-09-09')... |
DROP FUNCTION IF EXISTS auth.get_apps(_user_id integer, _office_id integer, _culture text);
CREATE FUNCTION auth.get_apps(_user_id integer, _office_id integer, _culture text)
RETURNS TABLE
(
app_name text,
name text,
version_number ... |
SELECT
*
FROM
TEST T
WHERE
1 = 1
/*IF SF.isNotEmpty(name) */
AND T.NAME = /*name*/''
/*END*/
|
<filename>Learning Modules/Operational Analytics/Tenant Analytics/ExtractTickets.sql
-- Connect to and run against the jobaccount database in catalog-mt-<User> server
-- Replace <User> below with your user name
DECLARE @User nvarchar(50);
DECLARE @server2 nvarchar(50);
SET @User = '<User>';
-- Create job to retrieve t... |
<reponame>tcsuder/best_restaurants-javaW3D2
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owne... |
INSERT INTO `shuyang_module` (`module`, `name`, `url`, `iscore`, `version`, `description`, `setting`, `listorder`, `disabled`, `installdate`, `updatedate`) VALUES ('vote', '投票', '', '0', '1.0', '', 'array (\r\n 1 => \r\n array (\r\n \'default_style\' => \'default\',\r\n \'vote_tp_template\' => \'vote_tp\',\r\n ... |
<filename>database/qlvacxindb.sql<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: localhost Database: qlvacxindb
-- ------------------------------------------------------
-- Server version 5.7.11-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CH... |
-- begin DDCT_TAG
create table DDCT_TAG (
ID varchar(36) not null,
VERSION integer not null,
CREATE_TS timestamp,
CREATED_BY varchar(50),
UPDATE_TS timestamp,
UPDATED_BY varchar(50),
DELETE_TS timestamp,
DELETED_BY varchar(50),
--
VALUE_ varchar(255) not null,
--
primary ... |
SELECT SUM(amount) AS Total_pagamentos FROM sakila.payment; |
<reponame>hemmerling/sql-stanford2013
With Recursive Mystery(X,Y) As
(Select A As X, A As Y From T
Union
Select m1.X, m2.Y
From Mystery m1, Mystery m2
Where m2.X = m1.Y + 1)
Select Max(Y-X) + 1 From Mystery;
|
ALTER TABLE test.t ADD CONSTRAINT foo FOREIGN KEY(pid) REFERENCES p(pid) |
<filename>src/main/resources/db/migration/V201702271013__SchemaDataActive.sql
ALTER TABLE SCHEMA_DATA ADD ACTIVE INTEGER DEFAULT 1 NOT NULL; |
ALTER TABLE mst.invoice_template
ADD COLUMN name CHARACTER VARYING;
ALTER TABLE mst.invoice_template
ADD COLUMN invoice_template_created_at TIMESTAMP WITHOUT TIME ZONE;
|
<reponame>Sunil2011/growsari1
SELECT date(os1.created_at),
SUM((super8_price - price)*quantity) AS investment
FROM `order` o
JOIN order_item oi ON oi.order_id = o.id
JOIN order_status os1 ON os1.order_id = o.id
LEFT JOIN order_status os2 ON os2.order_id = o.id
AND os1.id < os2.id
WHERE os2.id IS NULL
AND os1.s... |
CREATE TABLE `sline_kindorderlist` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`webid` int(2) unsigned DEFAULT '0',
`typeid` int(1) unsigned DEFAULT NULL COMMENT '栏目类型',
`aid` varchar(255) DEFAULT NULL COMMENT '文章的aid',
`classid` int(11) DEFAULT NULL COMMENT '分类id',
`displayorder` int(11) unsigned DEFAULT '9999... |
<gh_stars>10-100
DROP INDEX "conference_id";
DROP INDEX "attendee_id";
DROP INDEX "role_id";
DROP INDEX "group_id";
DROP INDEX "group_conference_id";
CREATE INDEX "group_conference_id" ON "Group" ("conferenceId");
CREATE INDEX "group_enabled" ON "Group" ("enabled");
CREATE INDEX "group_include_unauthenticated" ON "Gr... |
-- @testpoint: 创建临时表使用concurrently创建索引
SET ENABLE_SEQSCAN=off;
RESET ENABLE_INDEXSCAN;
RESET ENABLE_BITMAPSCAN;
show ENABLE_SEQSCAN;
show ENABLE_INDEXSCAN;
show ENABLE_BITMAPSCAN;
-- create global tmp table
DROP TABLE IF EXISTS ddl_index_case0205;
CREATE GLOBAL TEMPORARY TABLE ddl_index_case0205(id INT, first_name... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint: opengauss关键字specifictype非保留),作为索引名,部分测试点合理报错
--前置条件,创建一个表
drop table if exists explain_test;
create table explain_test(id int,name varchar(10));
--关键字不带引号-成功
drop index if exists specifictype;
create index specifictype on explain_test(id);
drop index specificty... |
<reponame>opengauss-mirror/Yat<filename>openGaussBase/testcase/KEYWORDS/source/Opengauss_Function_Keyword_Source_Case0032.sql
-- @testpoint:opengauss关键字source(非保留),作为用户名
--关键字explain作为用户名不带引号,创建成功
drop user if exists source;
CREATE USER source PASSWORD '<PASSWORD>';
drop user source;
--关键字explain作为用户名加双引号,创建成功
drop ... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 29, 2018 at 03:42 PM
-- Server version: 5.7.23
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- noinspection SqlResolveForFile
ALTER TABLE console_space_favorites RENAME TO favorites;
ALTER TABLE favorites ADD connected_space_ids VARCHAR2(2048) NULL;
-- noinspection SqlWithoutWhere
UPDATE favorites SET connected_space_ids = connectedspaceids;
ALTER TABLE favorites DROP COLUMN connectedspaceids;
ALTER TABLE fav... |
/*------------------------------------------------------------------------------------
Project/Ticket#: GRS
<Description> Create CRUD Routines for GRS_PlaceGetter tables </Description>
<Version> 1.0.0 </version>
----------------------------------------------------... |
-- show_os_stats.sql
-- populated by the timed_os_statistics init parameter
--
col sname format a15
col pname format a15
col pval1 format 99,999,999,999.9999
col pval2 format a22
set line 80
select *
from sys.aux_stats$
order by sname
/
|
<reponame>canselkundukan/hu-bby361-2020
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Anamakine: 127.0.0.1
-- Üretim Zamanı: 03 Kas 2020, 20:45:22
-- Sunucu sürümü: 10.4.14-MariaDB
-- PHP Sürümü: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
---------------------------------------------------------------------
-- TK 70-461 - Chapter 15 - Implementing Indexes and Statistics
-- Exercises
---------------------------------------------------------------------
---------------------------------------------------------------------
-- Lesson 01 - Implementing Inde... |
CREATE TABLE access_tokens (
userId bigint NOT NULL,
tokenId varchar NOT NULL,
isRevoked tinyint NOT NULL DEFAULT '0',
expiry int NOT NULL
);
CREATE TABLE "clients" (
"id" bigint NOT NULL,
"secret" varchar NOT NULL,
"name" varchar NOT NULL,
"redirect_url" varchar NOT NULL,
"is_confidential" tinyint N... |
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/select/d6de07af.sql
-- file:combocid.sql ln:93 expect:true
SELECT ctid,cmin,* FROM combocidtest
|
create table t (a int, b varchar(20)); |
CREATE TABLE [dbo].[tbl_Static_Items](
[itemId] [bigint] NOT NULL,
[name] [varchar](200) NOT NULL,
CONSTRAINT [PK_tbl_Static_Items] PRIMARY KEY CLUSTERED
(
[itemId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMAR... |
Declare @id int = 1,
@rowcount int = 0,
@query nvarchar(2500) CREATE TABLE #tmp(id int, full_stat_name varchar(2000))
Insert into #tmp
SELECT
ROW_NUMBER() OVER(
ORDER BY
(
SELECT
NULL
)
) AS [seq_nmbr],
QUOTENAME(sm.[name])+ '.' + QUOTENAME(tb.[name]) + '(' + QUOTENAME(st.[... |
# --- !Ups
create table users (
"id" BIGSERIAL NOT NULL PRIMARY KEY,
"name" VARCHAR NOT NULL,
"username" VARCHAR NOT NULL,
"email" VARCHAR NOT NULL,
"password" VARCHAR NOT NULL
);
# --- !Downs
DROP TABLE IF EXISTS "users";
|
<filename>coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/log/Release_3_1_sp_1_logs/KCIRB-1264.sql
ALTER TABLE VALID_PROTO_ACTION_ACTION ADD (
COMM_DECISION_MOTION_TYPE_CODE VARCHAR2(3) NULL,
CONSTRAINT FK_VALID_PROTO_ACTION_ACTION_3 FOREIGN KEY (COMM_DECISION_MOTION_TYPE_CODE)
REFERENC... |
-- phpMyAdmin SQL Dump
-- version 3.3.2
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Ven 29 Mars 2013 à 13:31
-- Version du serveur: 5.1.41
-- Version de PHP: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARAC... |
<gh_stars>1000+
-- Tags: no-s3-storage
drop table if exists test_agg_proj_02302;
create table test_agg_proj_02302 (x Int32, y Int32, PROJECTION x_plus_y (select sum(x - y), argMax(x, y) group by x + y)) ENGINE = MergeTree order by tuple() settings index_granularity = 1;
insert into test_agg_proj_02302 select intDiv(n... |
-- add column to track task status of campaigns and populate data from existing
-- campaign projects
ALTER TABLE
public.campaigns
ADD
COLUMN task_status_summary jsonb DEFAULT '{"FLAGGED": 0, "INVALID": 0, "LABELED": 0, "UNLABELED": 0, "VALIDATED": 0, "LABELING_IN_PROGRESS": 0, "VALIDATION_IN_PROGRESS": 0}' :: json... |
-- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
COL mods_owner HEAD OWNER FOR A20
COL mods_table_name HEAD TABLE_NAME FOR A30
COL mods_object_name HEAD OBJECT_NAME FO... |
# create table with edit history of posts (title and body edits, comments)
#standardsql
SELECT *
FROM (
SELECT
pv.PostId as PostId,
pv.PostTypeId as PostTypeId,
PostHistoryId as EventId,
CASE
WHEN pv.PostHistoryTypeId=2 THEN "InitialBody"
ELSE "BodyEdit"
END as Event,
UserId,
pv.CreationDate A... |
# --- !Ups
ALTER TABLE organization ADD grafana_id varchar(255);
ALTER TABLE organization ADD google_account varchar(255);
# --- !Downs
ALTER TABLE organization DROP COLUMN grafana_id, DROP COLUMN google_account;
|
<reponame>photogamerun/weiwodb<filename>presto-product-tests/src/main/resources/sql-tests/testcases/order_by/orderByExpression.sql<gh_stars>1-10
-- database: presto; groups: orderby, limit
select totalprice*1.0625, custkey from tpch.tiny.orders order by 1 limit 20 |
SELECT
data
FROM
lair_keystore
WHERE
tag = ?1;
|
<gh_stars>1-10
-- The `retrievals` table keeps track of all retrieval operations
CREATE TABLE retrievals
(
-- A unique identifier for this retrieval operation
id INT GENERATED ALWAYS AS IDENTITY,
-- The peer ID of the retrieval-initiating peer
retriever_id INT ... |
<reponame>bk-rs/clickhouse-rs
SELECT
hex(toIPv6('fc00:e968:6179::de52:7100')) AS val,
toTypeName(val) AS ty
|
<filename>sql/019_drop_games.sql
drop table if exists games ;
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Янв 14 2019 г., 17:39
-- Версия сервера: 5.6.41
-- Версия PHP: 7.1.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 12-05-2021 a las 00:08:01
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... |
<reponame>captainabap/Einstieg-in-SQLScript<filename>Listings/Listings/Kapitel 4/Listing 4.32.sql
-- Listing 4.32.sql
-- Auslagerung der Datumsberechnung in eine Funktion
SELECT *
FROM bw_daten
WHERE calday <= TO_DATS(UDF_ADD_DAYS_TO_LAST_SUNDAY(0))
AND calday >= TO_DATS(UDF_ADD_DAYS_TO_LAST_SUNDAY(27));
|
/*
Navicat Premium Data Transfer
Source Server : MySQL
Source Server Type : MySQL
Source Server Version : 80022
Source Host : localhost:3306
Source Schema : ssmbuild
Target Server Type : MySQL
Target Server Version : 80022
File Encoding : 65001
Date: 05/03/2022 19:56... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 11, 2021 at 08:14 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.39
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
CREATE DATABASE banking;
USE banking;
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers`
(
`customer_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`date_of_birth` date NOT NULL,
`city` varchar(100) NOT NULL,
`zipcode` varchar(10) ... |
<filename>DBADashDB/dbo/Stored Procedures/InstanceInfo_Get.sql<gh_stars>0
CREATE PROC [dbo].[InstanceInfo_Get](@InstanceID INT)
AS
WITH T AS (
SELECT CAST(I.Collation AS NVARCHAR(MAX)) AS Collation,
CAST(I.SQLVersion AS NVARCHAR(MAX)) AS SQLVersion,
CAST(CASE WHEN I.InstantFileInitializationEnabled=1THEN N'Yes' E... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: team_education
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC... |
-- awr_itl_waits_10g.sql.sql
-- show historic ITL Waits
-- <NAME>
--
-- <EMAIL>
@clears
@get_date_range
-- d_date_format set by get_date_range.sql
with waits as (
select
sh.instance_number
, sh.sql_id
, sh.blocking_session
, sh.blocking_session_status blocker_status
, bitand(sh.p1,65535) lockmode
fro... |
-- !Ups
ALTER TABLE report_files ADD COLUMN storage_filename VARCHAR;
UPDATE report_files SET storage_filename = id WHERE storage_filename IS NULL;
ALTER TABLE report_files ALTER COLUMN storage_filename SET NOT NULL;
-- !Downs
ALTER TABLE report_files DROP COLUMN storage_filename;
|
-- +migrate Up
--- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE t_ominous(x INTEGER PRIMARY KEY ASC);
-- +migrate Down
-- SQL section 'Down' is executed when this migration is rolled back
DROP TABLE t_ominous;
|
CREATE TABLE dhcpstatus (
status_id INT PRIMARY KEY,
status VARCHAR(10) NOT NULL
);
INSERT INTO dhcpstatus (status_id, status) VALUES (1, 'dynamic');
INSERT INTO dhcpstatus (status_id, status) VALUES (2, 'static');
INSERT INTO dhcpstatus (status_id, status) VALUES (3, 'declined');
INSERT INTO dhcpstatus (status_i... |
--
-- Name: person; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.person (
id integer NOT NULL,
first_name character varying(255),
last_name character varying(255),
birthdate date,
passport_number character varying(255),
country_origin character varying(255),
country_b... |
<filename>modules/t/test-genome-DBs/homo_sapiens/core/density_feature.sql<gh_stars>0
CREATE TABLE `density_feature` (
`density_feature_id` int(11) NOT NULL auto_increment,
`density_type_id` int(11) NOT NULL default '0',
`seq_region_id` int(11) NOT NULL default '0',
`seq_region_start` int(11) NOT NULL default '0... |
<filename>server/services/store/sqlstore/migrations/postgres_files/000002_system_settings_table.up.sql
CREATE TABLE IF NOT EXISTS system_settings (
id VARCHAR(100),
value TEXT,
PRIMARY KEY (id)
);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.