sql stringlengths 6 1.05M |
|---|
DROP TABLE IF EXISTS part_tbl;
CREATE TABLE part_tbl (a int, b int, c int) PARTITION BY RANGE(b) (START(1) END(2) EVERY(1));
INSERT INTO part_tbl SELECT i, 1, i FROM generate_series(1,10)i;
-- check gdd is enabled
show gp_enable_global_deadlock_detector;
1:BEGIN;
1:DELETE FROM part_tbl_1_prt_1 WHERE c = 9;
2:BEGIN;
2... |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [Profile.Data].[Publication.ISI.PubGeneral](
[RecID] [int] NOT NULL,
[InstId] [int] NULL,
[Hot] [varchar](3) NULL,
[SortKey] [bigint] NULL,
[TimesCited] [int] NULL,
[ItemIssue] [int] NULL,
[CoverDate] [varchar](10) NULL,
[RefKe... |
--Aug 12, 2015
-- Remove the test barcodes (900000000 and above) so new barcode system works
DO $do$
DECLARE
bc varchar;
sid varchar;
agl uuid;
agk uuid;
pn varchar;
BEGIN
-- Wipe out test barcodes that are already attached to kits and surveys
FOR bc, sid IN
SELECT barcode, survey_id FROM ag.ag_kit_barcodes WHERE... |
----------------------------
-- Copyright (C) 2021 CARTO
----------------------------
CREATE OR REPLACE SECURE FUNCTION @@SF_PREFIX@@quadkey.ZXY_FROMQUADINT
(quadint BIGINT)
RETURNS OBJECT
AS $$
OBJECT_CONSTRUCT(
'z', BITAND(QUADINT, 31),
'x', BITAND(BITSHIFTRIGHT(QUADINT, 5), BITSHIFTLEFT(1, BITAN... |
<gh_stars>0
-- @testpoint: jsonb格式校验:Str-jsonb(不符合格式合理报错)
--符合规范(使用反斜杠转义后,数据库显示包含反斜杠)
select '"abcdefg"'::jsonb;
select '"1"'::jsonb;
select '"$$"'::jsonb;
select '"\"$$\""'::jsonb;
select '"[\"www@13^\", 1, {\"name\": \"john\"}, \"2\"]"'::jsonb;
--不符合规范
select 'abcdefg'::jsonb;
select '''abcdefg'''::jsonb;
select '\... |
<filename>gretljobs/migriert/avt_oeffentlicher_verkehr-migriert210331/avt_oeffentlicher_verkehr_netz.sql<gh_stars>0
SELECT
CASE
WHEN typ = 1
THEN 'Bus'
WHEN (typ = 2 OR typ = 3)
THEN 'Bahn'
END AS verkehrsmittel,
FALSE AS tunnel,
ST_Multi(wkb_geometry) AS geometri... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 25 Mar 2021 pada 17.29
-- Versi server: 10.4.18-MariaDB
-- Versi PHP: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
SELECT * FROM customers LEFT JOIN orders ON customers.cid = orders.cid
WHERE orders.order_date IN ('2010-12-31', '2011-01-01')
|
CREATE OR REPLACE PROCEDURE SP_UPDATE_CONSUMER
(
P_OSR_USA_ID_REF IN NUMBER,
P_OSR_CONSUMER_KEY IN VARCHAR2,
P_OSR_CONSUMER_SECRET IN VARCHAR2,
P_OSR_REQUESTER_NAME IN VARCHAR2,
P_OSR_REQUESTER... |
<filename>src/hg/lib/stsMapMouse.sql
# stsMapMouse.sql was originally generated by the autoSql program, which also
# generated stsMapMouse.c and stsMapMouse.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#STS marker and its position on ... |
--Undercover Catalogue
--<NAME>
--Version 0.4.0 - 25 November 2019
--Module: Databases
--Script: Get
BEGIN
--get all databases on server
SELECT @@SERVERNAME AS ServerName,
databases.name AS DBName,
databases.database_id AS DatabaseID,
server_principals.name AS OwnerName,
databases.compatibility_level AS Compa... |
DROP TABLE IF EXISTS emails;
|
create extension if not exists "ltree";
-- We'll create a table that has just a single field of type ltree.
create table node(
path ltree not null
);
-- Inserting the following allows us to capture in the DB this tree
-- representation:
-- Foo
-- |
-- +- Bar
-- | |
-- | `- Quux
-- |
-- `- Baz
insert... |
USE Wochenmarkt
GO
BEGIN TRANSACTION TH_UniqueUser
--TC:1.1 User mit anderem Vornamen --> möglich
INSERT INTO app.Mitglied
(AdresseId, Email, Passwort, Telefon, Vorname, Nachname, Geburtsdatum, ProbezeitVon, ProbezeitBis)
VALUES ((SELECT AdresseId FROM app.Adresse WHERE Strasse LIKE 'Kantonsstrasse'),'<EMAIL... |
UPDATE `creature_template` SET `minlevel`=85, `maxlevel`=85, `modelid1`=11686, `modelid2`=0, `faction_A`=16, `faction_H`=16, `unit_flags`=33554434, `flags_extra`=2, `ScriptName`='npc_ertan_vortex' WHERE `entry`=46007;
INSERT INTO `creature_template_addon` (`entry`, `auras`) VALUES
(46007, '86267 0');
INSERT INTO `cre... |
----------------------------------
-- grant for HHS_HR_RW_ROLE
----------------------------------
GRANT DELETE, INSERT, SELECT, UPDATE ON HHS_HR.DSS_CMS_TIME_TO_HIRE TO HHS_HR_RW_ROLE;
GRANT DELETE, INSERT, SELECT, UPDATE ON HHS_HR.DSS_CMS_TIME_TO_HIRE_STG TO HHS_HR_RW_ROLE;
----------------------------------
... |
<reponame>hanhanyh/dotNetCoreLYDemo<filename>szdb.sql
# Host: 172.16.58.3 (Version 5.7.22-log)
# Date: 2018-08-24 16:10:30
# Generator: MySQL-Front 6.0 (Build 2.20)
#
# Structure for table "lytable"
#
DROP TABLE IF EXISTS `lytable`;
CREATE TABLE `lytable` (
`Id` int(11) NOT NULL AUTO_INCREMENT,
`detail` text ... |
CREATE TABLE application_status_change (
application_status_change_id SERIAL PRIMARY KEY,
application_guid uuid NOT NULL,
application_status_code varchar NOT NULL,
change_date timestamp with time zone DEFAULT now() NOT NULL ,
note ... |
CREATE TABLE "lts_admin_jvm_gc" (
"id" NUMBER(11) NOT NULL PRIMARY KEY,
"gmt_created" NUMBER(20) NULL ,
"identity" NVARCHAR2(64) NULL ,
"timestamp" NUMBER(20) NULL ,
"node_type" NVARCHAR2(32) NULL ,
"node_group" NVARCHAR2(64) NULL ,
"young_gc_collection_count" NUMBER(20) NULL ,
"young_gc_collection_time" NUMBER(20) NUL... |
<filename>hasura/migrations/default/1585547020553_alter_table_public_type_review_alter_column_comment/up.sql
ALTER TABLE "public"."type_review" ALTER COLUMN "comment" DROP NOT NULL;
COMMENT ON COLUMN "public"."type_review"."comment" IS E''; |
-- MySQL dump 10.19 Distrib 10.3.32-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: radius
-- ------------------------------------------------------
-- Server version 10.3.32-MariaDB-0ubuntu0.20.04.1-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHAR... |
INSERT INTO misc_message (message_type, message_value) VALUES ("INSULT", "Better luck next time.");
INSERT INTO misc_message (message_type, message_value) VALUES ("INSULT", "Did you just really do that?");
INSERT INTO misc_message (message_type, message_value) VALUES ("INSULT", "And you will never see heaven.");
INSERT... |
-- @testpoint:opengauss关键字Collation(保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists Collation_test cascade;
--关键字不带引号-合理报错
create table Collation_test(id int,name Collation);
--关键字带双引号-合理报错
create table Collation_test(id int,name "Collation");
--关键字带单引号-合理报错
create table Collation_test(id int,name 'Collation');
--... |
USE Bank
SELECT TOP (1000) * FROM Bank.dbo.Clients
SELECT TOP (1000) * FROM Bank.dbo.AccountTypes
SELECT TOP (1000) * FROM Bank.dbo.Accounts |
# Write your MySQL query statement below
select min(abs(x1.x-x2.x)) shortest
from point x1, point x2
where x1.x <> x2.x |
<gh_stars>0
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[Report].[GetALLBOccupancyReportData]') AND type in (N'P', N'PC'))
DROP PROCEDURE [Report].[GetALLBOccupancyReportData]
GO
CREATE PROCEDURE [Report].[GetALLBOccupancyReportData]
@Page INT,
@PageSize INT
AS
BEGIN
SELECT
[Learner_refe... |
<reponame>guillermocastro/BlueBriksDB<gh_stars>0
CREATE TABLE [crm].[Partner] (
[PartnerId] INT IDENTITY (1, 1) NOT NULL,
[PartnerName] NVARCHAR (128) NULL,
[PartnerNo] NVARCHAR (10) NULL,
[TermId] INT NULL,
[PaymentId] INT NULL,
[Tin] NVARCH... |
-- find the count of all employees in each department and for each town
USE TelerikAcademy
SELECT
COUNT(*) [Employees Count]
,d.Name AS [Department]
,t.Name AS [Town]
FROM Employees e
INNER JOIN Departments d
ON e.DepartmentID = d.DepartmentID
INNER JOIN Addresses a
ON e.AddressID = a.AddressID
INNER JOIN Town... |
<reponame>Mehdinahri/gestfinanci-re<filename>database/gestion-fn.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : lun. 21 sep. 2020 à 12:57
-- Version du serveur : 10.4.14-MariaDB
-- Version de PHP : 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZER... |
-- Generated by Oracle SQL Developer Data Modeler 19.1.0.081.0911
-- at: 2020-01-06 21:59:33 ICT
-- site: Oracle Database 11g
-- type: Oracle Database 11g
DROP TABLE customers CASCADE CONSTRAINTS;
DROP TABLE employees CASCADE CONSTRAINTS;
DROP TABLE offices CASCADE CONSTRAINTS;
DROP TABLE ord... |
-- 2.2 NULLと演算を行っているので何も出力されない
SELECT *
FROM Shohin
WHERE shiire_tanka = NULL;
SELECT *
FROM Shohin
WHERE shiire_tanka <> NULL;
SELECT *
FROM Shohin
WHERE shohin_mei > NULL;
|
<reponame>BrunoCabelo/xPaper<gh_stars>0
insert into usuarios values
(0,"<EMAIL>","1234","<NAME>",2),
(0,"<EMAIL>","1234","jorge",0); |
-- name: CreateJob :one
INSERT INTO jobs (
name,
delivery_strategy,
attempts,
concurrency)
VALUES ($1, $2, $3, $4)
RETURNING *;
-- name: GetJob :one
SELECT * FROM jobs
WHERE name = $1;
-- name: GetAllJobs :many
SELECT * FROM jobs
WHERE name != 'meta.shutdown'
ORDER BY auto_id DESC;
-- name: DeleteAll... |
CREATE TABLE IF NOT EXISTS GroupsConnectedSystems (
GroupsConnectedSystems_ID INTEGER PRIMARY KEY,
Group_ID INTEGER NOT NULL,
ConnectedSystem_ID INTEGER NOT NULL,
FOREIGN KEY (Group_ID) REFERENCES Groups(Group_ID),
FOREIGN KEY (ConnectedSystem_ID) REFERENCES ConnectedSystems(ConnectedSystem_ID)
); |
prompt --application/pages/page_00000
begin
-- Manifest
-- PAGE: 00000
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2021.04.15'
,p_release=>'21.1.6'
,p_default_workspace_id=>9690978936188613
,p_default_application_id=>123
,p_default_id_offset=>0
,p_default_owner=>'ILA'
);
wwv_flow_api.... |
update facturas
set subtotalNeto = subtotalNeto /1000000, iva = iva/1000000, recargoTotal = recargoTotal / 1000000, total = total / 1000000, dicom = dicom / 1000000, subtotal = subtotal / 1000000 |
<filename>relacional/sqlserver/db/setup_inicial_exemplo.sql
-- ##############################################################
-- Coloque aqui os scripts do banco do financeiro
-- ##############################################################
if not exists(select 1
from sys.tables
where name = 'exemplo')
begin
cre... |
CREATE SEQUENCE if not exists WF_INSTANCE_ID;
|
<filename>build/loading/aux/ncbi/sql/gene2unigene-load.sql
BEGIN;
TRUNCATE ncbi.gene2unigene;
\copy ncbi.gene2unigene FROM PSTDIN
UPDATE origin SET last_updated = NOW() WHERE origin='NCBI gene2unigene';
COMMIT;
ANALYZE ncbi.gene2unigene;
SELECT COUNT(*) FROM ncbi.gene2unigene;
|
<reponame>TUIASI-AC-enaki/Shopping_Application
CREATE OR REPLACE PACKAGE AUTH_PKG IS
TYPE user_account IS RECORD (
user_id pbd_app_users.user_id%TYPE,
first_name pbd_app_users.first_name%TYPE,
last_name pbd_app_users.last_name%TYPE,
location_id pbd_app_users.location_id%TYPE,... |
ALTER TABLE mod_releases DROP COLUMN IF EXISTS created;
ALTER TABLE mod_releases DROP COLUMN IF EXISTS deleted;
ALTER TABLE mods DROP COLUMN IF EXISTS tags;
ALTER TABLE mods DROP COLUMN IF EXISTS parent;
ALTER TABLE mod_packages DROP COLUMN IF EXISTS knossos_vp;
ALTER TABLE mod_package_files DROP COLUMN IF EXISTS archi... |
<filename>ctakes-patch/ctakes-ytex/scripts/data/mssql/esld/postprocessing/create_view.sql
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF l... |
<reponame>Alasdair1907/thismagicalworld
alter table articles add column index_id bigint;
alter table photos add column index_id bigint;
alter table galleries add column index_id bigint;
update articles set index_id = i.id from posts_index i where i.post_id = articles.id and i.post_attribution = 2;
update photos set in... |
<reponame>nikhiltiwari911/web-blog<filename>database/assignment.sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 09, 2021 at 11:27 AM
-- Server version: 10.3.15-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT... |
CREATE TABLE applications (
id INTEGER PRIMARY KEY,
guid TEXT,
name TEXT,
description TEXT,
projectUrl TEXT
);
CREATE TABLE users (
id INTEGER PRIMARY KEY,
guid TEXT,
device_name TEXT,
system_name TEXT,
meta_data TEXT,
application_id TEXT,
... |
-- Requirement: Identify all the users who have never posted a photo.
SELECT
users.id,
username
FROM users
LEFT JOIN photos
ON users.id = photos.user_id
WHERE photos.id IS NULL; |
<gh_stars>0
CREATE PROCEDURE create_dispatch
@distributor_id INT,
@driver_id INT,
@vehicle_id INT,
@pickup_planned_date AS DATETIME = NULL,
@dispatch_id INT OUT
AS
SET XACT_ABORT ON
BEGIN
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
BEGIN TRANSACTION
/*CHECK IF vehicle EXISTS*/
IF((... |
/*
## Alright, now that you're warmed up let's get down to business!
## In this problem set we'll pretend the Chinook database is the data for your own personal music shop!
## We'll be marketing your shop and hosting Music Festival using answers we get from
## the data stored in your database.
## Let's get start... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 08, 2020 at 07:46 PM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
insert into todo_list(list_name) values ('Shopping');
insert into todo(todo_data, todo_status, fk_list_id) values ('Get Milk', true, 1); |
<gh_stars>0
-- examples on variables
do $$
declare
v_width integer;
v_height constant integer := 2;
v_area integer := 6;
begin
v_width := v_area / v_height;
raise notice 'v_area = %, v_width = %', v_area, v_width;
-- SQL Error [22005]: ERROR: variable "v_height" is declared CONSTANT
-- v_h... |
create table foo (id int); |
<reponame>titikkoma88/peminjaman<filename>db/peminjaman.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 29, 2019 at 12:17 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
STAR... |
DROP DATABASE IF EXISTS beerista_db;
CREATE DATABASE beerista_db;
USE beerista_db;
-- Table schema located in `~/models` |
"CUST_PANEL_PAGE_INVOICE_PDF_TBL_SUMMARY_OF_CHARGES":"Summary of Charges",
"CUST_PANEL_PAGE_INVOICE_PDF_TBL_CURRENT_CHARGES_DETAILS":"Current Charges Details",
"CUST_PANEL_PAGE_INVOICE_PDF_TBL_CURRENT_CHARGES":"Current Charges",
"CUST_PANEL_PAGE_INVOICE_PDF_TBL_TOTAL_USAGE_CHARGES":"Total Usage Charges",
"CUST_PANEL_PA... |
alter table egbpa_application add column previousownerdetails character varying(4000),add column landregistrationdetails character varying(4000); |
<filename>ResumeRandomizer/01_DB_Create.sql
USE [master]
IF db_id('ResumeRandomizer') IS NULl
CREATE DATABASE [ResumeRandomizer]
GO
USE [ResumeRandomizer]
GO
DROP TABLE IF EXISTS [ResumeProject];
DROP TABLE IF EXISTS [ResumeEducation];
DROP TABLE IF EXISTS [ResumeExperience];
DROP TABLE IF EXISTS [Resume];
DROP T... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.34 - MySQL Community Server (GPL)
-- Server OS: Linux
-- HeidiSQL Version: 11.3.0.6295
-- ------------------------------------------------------... |
<gh_stars>10-100
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date, ,>
-- Description: <Description, ,>
-- =============================================
CREATE FUNCTION [rep].[GetNumMonth]
(
@Month_Name nvarchar(256) -- заданное название месяца по-русски
)
RETUR... |
<filename>xo-opportunity-trader/src/main/resources/db/opportunity-trader/migrations/V1_34__StaticFunds.sql
CREATE TABLE static_wallet
(
id INT(11) PRIMARY KEY AUTO_INCREMENT NOT NULL,
client_name VARCHAR(64) NOT NULL,
currency VARCHAR(64) NOT NULL... |
-- fts3near.test
--
-- execsql {
-- SELECT docid FROM t1 WHERE content MATCH 'specification NEAR/18 attach'
-- }
SELECT docid FROM t1 WHERE content MATCH 'specification NEAR/18 attach' |
<filename>cias.sql
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 27, 2019 at 06:53 AM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
<filename>Stored Procedures/dbo.Interfaz_CteInsertar.sql
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- =============================================
-- Responsable: <NAME>
-- Ultimo Cambio: 11/01/2018
-- Descripción: Alta de Usuarios
-- =============================================
CREATE PROCEDURE [dbo].[Inter... |
INSERT INTO maurodatamapper.core.folder(id, version, date_created, last_updated, path, deleted, depth, readable_by_authenticated_users,
parent_folder_id, created_by, readable_by_everyone, label, description, class)
SELECT f.id,
f.version,
f.date_created,
f.la... |
@@create_types.sql
create table tab_nested_table_add_column
(
col1 number
);
|
ALTER TABLE clActionTable
MODIFY COLUMN build_id int(11) NULL;
INSERT INTO schemaVersionTable (schemaVersion, scriptName) VALUES
(63, '00063_alter_claction_table_allow_build_id_null.sql');
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 05, 2020 at 02:29 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.1.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
<reponame>SamujjalDas/bug-tracker-microservice
INSERT INTO users (username, password, enabled)
values ('user', '<PASSWORD>', true);
INSERT INTO users (username, password, enabled)
values ('admin', '<PASSWORD>', true);
INSERT INTO authorities (username, authority)
values ('user', 'ROLE_USER');
INSERT INTO authorities (u... |
CREATE TABLE board (
id integer PRIMARY KEY,
title text NULL,
description text NULL
); |
-- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.5.0.5332
-- --------------------------------------------------------
/*... |
/* ==================== T_OPERACIONES ==================== */
set define off
declare
type t_clob is table of clob index by binary_integer;
l_clob t_clob;
type t_varchar2 is table of varchar2(64) index by binary_integer;
l_varchar2 t_varchar2;
begin
null;
-- start generation of records
----... |
CREATE TABLE `Foo` (
`ID` bigint(20) NOT NULL AUTO_INCREMENT,
`Title` varchar(200),
`Desc` varchar(1024),
`CreatedBy` varchar(1024),
`UpdatedBy` varchar(1024),
`CreatedAt` timestamp NOT NULL,
`UpdatedAt` timestamp NOT NULL,
PRIMARY KEY (`ID`),
UNIQUE KEY `ID_UNIQUE` (`ID`)
); |
<reponame>huaminglin/docker-demo<filename>postgres-demo/postgres-transaction-demo/sql/phantom-read-2.sql
select pg_sleep(0.1); -- make sure this transaction starts after the first transaction.
begin;
select 'sql 2', xmin, xmax, txid_current(), * from t_isolation;
select 'sql 2: sleeping 1 seconds ...';
select pg_sleep(... |
<reponame>gregriss/employee-tracker
DROP DATABASE IF EXISTS company_db;
CREATE DATABASE company_db;
USE company_db;
CREATE TABLE departments(
id INT auto_increment NOT NULL,
name VARCHAR(30),
PRIMARY KEY(id)
);
CREATE TABLE roles(
id INT auto_increment NOT NULL,
title VARCHAR(30),
salary DEC... |
<gh_stars>0
drop table if exists users;
create table users (
uid integer primary key autoincrement,
username text not null unique,
password text not null,
storage real default 1048576 not null,
used_storage real default 0 not null
); |
USE SoftUni
SELECT TOP 5 EmployeeID, JobTitle, e.AddressID, AddressText
FROM Employees AS e
INNER JOIN Addresses AS a ON
e.AddressID = a.AddressID
ORDER BY e.AddressID |
<gh_stars>0
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Author: Korisnik
* Created: Apr 14, 2017
*/
-- --------------------------------------------------------
-- Host... |
<reponame>emull04/banksampah
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 06, 2020 at 07:45 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.2.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = ... |
--
-- Alter the table to have the real primary key
--
ALTER TABLE `calendarinstances` ADD `cal_type` TINYINT(2) NOT NULL DEFAULT '1' COMMENT '1 = normal, 2 = room, 3 = computer, 4 = video';
ALTER TABLE `user_usr` ADD `usr_CurrentPath` varchar(1500) NOT NULL default '/'; |
-- Your SQL goes here
CREATE TABLE IF NOT EXISTS bans (
id SERIAL PRIMARY KEY,
user_id TEXT NOT NULL,
guild_id TEXT NOT NULL,
unbanned BOOLEAN NOT NULL DEFAULT false,
start_time TIMESTAMP NOT NULL,
end_time TIMESTAMP NOT NULL
);
|
<gh_stars>10-100
MERGE INTO bucket(id, external_id, position, name, created_at, updated_at) values
(1, '3731c747-ea27-42e5-a52b-1dfbfa9617db', 200.987, 'SECOND-BUCKET', '2020-05-02 20:26:42.415491', '2020-05-02 20:26:42.415491'),
(2, '6d9db741-ef57-4d5a-ac0f-34f68fb0ab5e', 100.15, 'FIRST-BUCKET', '2020-06-18 20:26:42.4... |
CREATE TABLE IF NOT EXISTS zn_data.event_type (
et_name varchar(255) NOT NULL PRIMARY KEY CHECK (et_name <> ''),
et_event_type_object jsonb NOT NULL,
CHECK (et_event_type_object->>'name' = et_name)
);
CREATE INDEX ON zn_data.event_type USING gin (et_event_type_object);
|
USE wsp;
INSERT INTO user (fullName, email, userPassword, age ) VALUES ("<NAME>", "<EMAIL>", "password", 28);
INSERT INTO user (fullName, email, userPassword, age ) VALUES ("<NAME>", "<EMAIL>", "<PASSWORD>", 32);
INSERT INTO userData (work, sleep, play, loginDate, daysActive) VALUES ("2020-12-19 10:55:17", "2020-12-19 ... |
<gh_stars>0
-- 授权表
CREATE TABLE IF NOT EXISTS `authorization` (
id bigint(11) NOT NULL AUTO_INCREMENT primary key COMMENT 'ID',
creater_id bigint(11) NOT NULL default 0 COMMENT '创建人id',
updater_id bigint(11) NOT NULL default 0 COMMENT '更新人id',
state varchar(16) NOT NULL DEFAULT '' COMMENT 'DELETED,ENABLED,DISABLED',
... |
<reponame>aalvarado0995/backend<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 05-06-2017 a las 02:02:40
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00... |
create table guestbooks (
id bigint auto_increment primary key,
email varchar(255),
content varchar(255),
primary key (id)
); |
<filename>migrations/13_add_allocated_storage_per_project.down.sql
DROP TRIGGER IF EXISTS after_attachment_removed ON attachment;
DROP FUNCTION IF EXISTS decrease_allocated_size;
DROP TRIGGER IF EXISTS after_attachment_inserted ON attachment;
DROP FUNCTION IF EXISTS increment_allocated_size;
ALTER TABLE project
D... |
<filename>source/org.ohdsi.cdm.framework.etl/org.ohdsi.cdm.framework.etl.premier/ETL/PREMIER/Lookups/Procedure.sql<gh_stars>10-100
{base},
Standard as (
SELECT distinct SOURCE_CODE, TARGET_CONCEPT_ID, TARGET_DOMAIN_ID, SOURCE_VALID_START_DATE as VALID_START_DATE, SOURCE_VALID_END_DATE as VALID_END_DATE, SOURCE_VOCABUL... |
<filename>cloudfoundry/cloudfoundry_issues.sql
select
count(distinct id) as number_of_issues
from
gha_issues
where
created_at >= '{{from}}'
and created_at < '{{to}}'
and is_pull_request = false
and dup_user_login not in
(
'cf-buildpacks-eng',
'cm-release-bot',
'capi-bot',
'runtime-ci',
'cf-infra-bot',
'rout... |
<filename>LocalArtifacts/UpdateAFServersUser.sql
USE [PIFD]
GO
ALTER ROLE [db_AFServer] DROP MEMBER [AFServers]
GO
ALTER AUTHORIZATION ON SCHEMA::[AFServers] TO [AFQueryEngines]
GO
DROP USER [AFServers]
GO
CREATE USER [AFServers] FOR LOGIN $(domainAccount)
GO
ALTER ROLE [db_AFServer] ADD MEMBER [AFServers]
GO
ALTER AUT... |
INSERT INTO department (name)
VALUES
('Sales'),
('IT'),
('Legal'),
('Accounting');
INSERT INTO role (title, salary, department_id)
VALUES
('Salesperson', 150000, 1),
('Account Manager', 100000, 3),
('Software Engineer', 150000, 2),
('Lead Engineer', 200000, 2),
('Lawyer', 1500000, 3),
('Legal Team Counsel', 150000, 3... |
CREATE TABLE IF NOT EXISTS `public_age` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`start` INT(3) NOT NULL,
`end` INT(3) NOT NULL)
ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `address` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`address` VARCHAR(255) NOT NULL,
`complement` VARCHAR(255) NULL,
... |
<reponame>iafb/greatreadingadventure
--Create the Delete Proc
CREATE PROCEDURE [dbo].[app_SQChoices_Delete] @SQCID INT
AS
DECLARE @QID INT;
SELECT @QID = QID
FROM [SQChoices]
WHERE SQCID = @SQCID
DELETE
FROM [SQChoices]
WHERE SQCID = @SQCID
EXEC app_SQChoices_Reorder @QID
|
<filename>sample/sample-01/sql/create-database.sql
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
--SET client_encoding = 'LATIN1';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_m... |
prompt --application/shared_components/user_interface/templates/list
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(327283823596455573)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-BadgeList-item #A02#">',
' <span class="t-BadgeList-label">#TEXT#</span>',
' <span ... |
<reponame>sbenten/osm_routing_import
CREATE FUNCTION setpublictransportroutes() RETURNS void
LANGUAGE plpgsql
AS $$
/*
Reads NaPTAN and Traveline imported data and creates stops, services, routes and ways for a public transport network.
PARAMS
n/a
RETURNS void
*/
DECLARE
rec record;
from_route_id integer;
f... |
<filename>yiguo.sql
/*
Navicat MySQL Data Transfer
Source Server : yiguo
Source Server Version : 50714
Source Host : localhost:3306
Source Database : yiguo
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2018-02-08 11:20:52
*/
SET FOREIGN_KEY_C... |
<filename>finalemrdb.sql
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 03, 2015 at 01:28 PM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@... |
<filename>ExamPrep-22-October-2017/20.Categories Revision .sql
WITH CTE_WaitingStatus(CategoryName, NumberReports)
AS
(
SELECT
c.Name,
COUNT(r.StatusId) AS [Reports Number]
FROM Reports AS r
JOIN Status AS s
ON s.Id = r.StatusId
JOIN Categories AS c
ON c.Id = r.CategoryId
WHERE s.Label = 'waiting'
GROUP B... |
<reponame>clmb-live/scoreboard<gh_stars>1-10
ALTER TABLE `user`
ADD COLUMN `admin` TINYINT(1) NOT NULL DEFAULT 0 AFTER `password`; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.