sql stringlengths 6 1.05M |
|---|
USE AkkaNetResults;
DELETE FROM dbo.MeterReadings;
USE AkkaPersistence;
DELETE FROM dbo.EventJournal;
DELETE FROM dbo.SnapshotStore; |
<reponame>svrakitin/x<filename>popx/stub/migrations/transactional/20200810141652000000_flow_type.sqlite3.up.sql
ALTER TABLE "selfservice_login_requests" ADD COLUMN "type" TEXT NOT NULL DEFAULT 'browser' |
<reponame>meroxa/debezium
CREATE TABLE `roles` (
`id` varchar(32) NOT NULL,
`name` varchar(100) NOT NULL,
`context` varchar(20) NOT NULL,
`organization_id` int(11) DEFAULT NULL,
`client_id` varchar(32) NOT NULL,
`scope_action_ids` text NOT NULL,
PRIMARY KEY (`id`),
FULLTEXT KEY `scope_action_ids_idx` (`scope_action_ids... |
-- Bridge stolen. Read full story for details:
-- http://www.post-gazette.com/pg/11280/1180364-455.stm
|
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: Oct 20, 2018 at 05:48 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... |
use test;
CREATE TABLE shirts (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
name NVARCHAR(100) NOT NULL,
price DECIMAL(13,2) NOT NULL,
color NVARCHAR(20) NOT NULL,
gender NVARCHAR(5) NOT NULL,
size NVARCHAR(5) NOT NULL,
image NVARCHAR(100) NOT NULL
);
LOAD DATA INFILE 'C:\ProgramData\MySQL\My... |
<gh_stars>0
DELETE FROM ConferenceRooms
WHERE RoomID = 400;
-- PostgreSQL and SQL Server commits automatically if there is no BEGIN TRANSACTION
-- Oracle needs to COMMIT;
SELECT * FROM ConferenceRooms;
|
CREATE DATABASE `mybatis_topic_chapter2`;
USE mybatis_topic_chapter2;
CREATE TABLE `user` (
`id` INT(11) AUTO_INCREMENT,
`username` varchar(50) NOT NULL,
`password` char(32) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8; |
<filename>CCIA.SQL/dbo/Tables/contact_to_org.sql
CREATE TABLE [dbo].[contact_to_org] (
[cont_org_id] INT IDENTITY (1, 1) NOT NULL,
[contact_id] INT NULL,
[org_id] NCHAR (10) NULL,
[comments] VARCHAR (50) NULL,
CONSTRAINT [PK_contact_to_org] PRIMARY KEY CLUSTERED ([cont_... |
<filename>1b-Create CTPOC.sql
/*
(1b)
CREATE THE DATABASE
*/
CREATE DATABASE [CTPOC] CONTAINMENT = NONE
ON PRIMARY
(
NAME = N'CTPOC',
FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL13.SHAULIS\MSSQL\DATA\CTPOC.mdf',
SIZE = 3072KB,
FILEGROWTH = 1024KB
)
... |
CREATE OR
ALTER PROCEDURE usp_EmployeesBySalaryLevel(@levelOfSalary NVARCHAR(MAX))
AS
SELECT e.FirstName,
e.LastName
FROM Employees AS e
WHERE dbo.ufn_GetSalaryLevel(e.Salary) = @levelOfSalary
GO
EXEC usp_EmployeesBySalaryLevel 'high' |
WITH RECURSIVE namespaces AS (
SELECT *
FROM {{ref('gitlab_dotcom_namespaces')}}
), gitlab_subscriptions AS (
SELECT *
FROM {{ref('gitlab_dotcom_gitlab_subscriptions')}}
WHERE is_currently_valid = TRUE
), plans AS (
SELECT *
FROM {{ref('gitlab_dotcom_plans')}}
), recursive_namespaces(n... |
ALTER TABLE ONLY testtable ALTER COLUMN field4 SET STATISTICS -1;
|
-- file:hs_primary_extremes.sql ln:26 expect:true
SELECT hs_subxids(257)
|
-- file:rolenames.sql ln:146 expect:true
ALTER ROLE ALL RESET application_name
|
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- ALTER TABLE "todoapp"."todos" ADD "stamp" date NOT NULL CONSTRAINT "default_sqlserverdb_todoapp_todos_stamp" DEFAULT 'GETDATE()' WITH VALUES;
|
<reponame>qlpqlp/DogeGarden<filename>dogegarden.sql
--
-- Table structure for table `banners`
--
CREATE TABLE `banners` (
`id` bigint(20) NOT NULL,
`lang` varchar(2) NOT NULL DEFAULT 'en',
`id_cat` bigint(20) DEFAULT NULL,
`id_prod` bigint(20) DEFAULT NULL,
`id_page` bigint(20) DEFAULT NULL,
`img` varchar(... |
<filename>MySQL data/ddl-datacenter.sql
CREATE SCHEMA IF NOT EXISTS `datacenter` DEFAULT CHARACTER SET utf8 ;
CREATE TABLE IF NOT EXISTS `datacenter`.`ciudad` (
`id` INT(6) NOT NULL,
`nombre` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = utf8;
CREATE TABLE IF NOT EXISTS `data... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50711
Source Host : localhost:3306
Source Database : mindao-crm
Target Server Type : MYSQL
Target Server Version : 50711
File Encoding : 65001
Date: 2017-08-17 10:58:44
*/
SET FOREIGN_KEY_CHECKS=... |
CREATE TABLE order_management_data.order_status_history_by_id (
order_id text,
status_timestamp timestamp,
order_status text,
PRIMARY KEY (order_id, status_timestamp)
) WITH CLUSTERING ORDER BY (status_timestamp DESC)
AND additional_write_policy = '99p'
AND bloom_filter_fp_chance = 0.01
AND... |
/*
SQLyog Community v12.04 (64 bit)
MySQL - 10.4.18-MariaDB : Database - basic
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KE... |
<reponame>SKalt/pg_sql_parser_tests
TupleTableSlot *
ExecForeignDelete(EState *estate,
ResultRelInfo *rinfo,
TupleTableSlot *slot,
TupleTableSlot *planSlot);
|
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:opengauss关键字nominvalue(非保留),作为模式名
--关键字不带引号-成功
drop schema if exists nominvalue;
create schema nominvalue;
drop schema nominvalue;
--关键字带双引号-成功
drop schema if exists "nominvalue";
create schema "nominvalue";
drop schema "nominvalue";
--关键字带单引号-合理报错
drop schem... |
<filename>tests/compound_example.sql<gh_stars>0
-- Here is an example of combining static and dynamic SQL queries that both make use of a predefined SQL block
CREATE PROCEDURE [dbo].[_compoundExample]
AS
DECLARE
@SQL nvarchar(max) = ''
SET @SQL = @SQL +
'SELECT
(''[SqlBlock_
MakeJsonIntArray(AU.I... |
<gh_stars>0
SET DEFINE ON
SET FEEDBACK OFF
SET VERIFY OFF
DEFINE schema_name=&1
DEFINE app_name=&2
variable l_return_code number;
DECLARE
v_app_name VARCHAR2(100);
BEGIN
SELECT DISTINCT installed_applications
INTO v_app_name
FROM &schema_name..application_manager_t
WHERE installed_applications ... |
<reponame>matcoco/blanc_manger_matcoco<filename>app_game/back/create_db.sql
CREATE DATABASE hackathon;
USE hackathon;
CREATE TABLE `gamecard` (
`id` INT NOT NULL AUTO_INCREMENT,
`text` TEXT NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE `playercard` (
`id` INT NOT NULL AUTO_INCREMENT,
`text` TEXT NOT ... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 22, 2018 at 09:33 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
alter table sak add column saksnummer bigint generated by default as identity (start with 2021) not null unique
|
-- MySQL dump 10.13 Distrib 5.5.54, for debian-linux-gnu (i686)
--
-- Host: localhost Database: lugares
-- ------------------------------------------------------
-- Server version 5.5.54-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHA... |
use employeetracker_db;
INSERT INTO department (name)
VALUES ('Sales'),
('Management'),
('IT'),
('Customer Services');
INSERT INTO role (title, salary, department_id)
VALUES ('Sales Lead', 100000, 1),
('Salesperson', 50000, 1),
('Lead Engineer', 150000, 2),
('Software Engineer', 10... |
--创建表值函数
CREATE FUNCTION [dbo].[FnTable]
(
@Id int
)
RETURNS @tb TABLE(Id int)
BEGIN
INSERT INTO @tb(Id) values(@Id);
RETURN;
END |
-- ======================================== 测试库(仅做测试使用) ====================================
-- 公告表 (演示点: 单表生成)
drop table if exists sys_notice;
CREATE TABLE `sys_notice` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '记录id [num no-add]',
`title` varchar(50) DEFAULT NULL COMMENT '公告标题 [text]',
`content` ... |
/* Replace with your SQL commands */
ALTER TABLE "dataset_row" DROP COLUMN "sentence";
ALTER TABLE "dataset_row" DROP COLUMN "language";
ALTER TABLE "contributions" DROP COLUMN "audio_path";
ALTER TABLE "contributions" DROP COLUMN "audio_duration"; |
CREATE TABLE [dbo].[PaymentMethod]
(
[Identifier] NCHAR(255) NOT NULL PRIMARY KEY,
[Description] NCHAR(255) NULL,
[Name] NCHAR(50) NOT NULL
)
|
<reponame>joe-toni/S12-HW-EMPLOYEE-TRACKER
INSERT INTO department(name)
VALUES
("administrative"),
("regulatory"),
("public relations"),
("maintenance"),
("educational");
INSERT INTO role(title, salary, department_id)
VALUES
("janitor", 18.50, 4),
("teacher", 17, 5),
("clerk", 18.50, 3... |
-- name: insert-notification<!
-- adds notifications to the queue
INSERT INTO signal.notifications (recipient,message_id)
VALUES (:recipient,:message_id);
-- name: unsent-notifications-list
-- notifications list
SELECT n.id,n.recipient,n.delivered,n.sent,m.type,m.info
FROM signal.notifications AS n JOIN signal.message... |
-- @testpoint:opengauss关键字binary_integer(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists binary_integer;
CREATE TABLESPACE binary_integer RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
--清理环境
drop tablespace binary_integer;
--关键字带双引号,创建成功
drop tablespace if exists "binary_integer";
CREATE TABLESPACE "bin... |
-- I want to know which movies are in since 2014
-- I want to see movies that are comedies and came out 2011 - 2014
-- I want to see all movies that are either horror or romance
-- I want to see the movies from most popular to least popular during 2011-2014
-- I want to see the top 10 most popular movie durin... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 22, 2017 at 07:31 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
<gh_stars>0
create sequence hibernate_sequence start 1 increment 1;
create table account
(
account_id int8 not null,
user_role varchar(25),
user_name varchar(25),
password varchar(25),
name varchar(25),
last_name varchar(25),
email varchar(25),
phone varchar(25),
position varc... |
--------------------------------------------------------
-- DDL for Materialized View ITIS_GS_TAXON
--------------------------------------------------------
CREATE MATERIALIZED VIEW "GROUNDFISH"."ITIS_GS_TAXON" ("ACCEPTED_SCIENT_NAME", "ACCEPTED_TSN", "ACCEPTED_RANK", "SUBSPECIES_", "SPECIES_", "SUBGENUS", "GENUS_"... |
create schema if not exists pinstagram;
create table if not exists account
(
account_id bigint auto_increment
primary key,
email varchar(255) null,
name varchar(255) null,
password varchar(255) null
);
|
CREATE OR REPLACE TRIGGER t_plsql_backup
BEFORE CREATE OR ALTER OR DROP
ON SCHEMA
DECLARE
/*
The MIT License (MIT)
Copyright (c) 2016 <NAME>
*/
oper VARCHAR2 (32000);
sql_text ora_name_list_t;
n NUMBER;
v_stmt CLOB;
BEGIN
DBMS_LOB.createtemporary ... |
<gh_stars>1-10
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.2
-- Dumped by pg_dump version 10.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
S... |
SELECT
p.PartNum AS Id
, p.PartDescription AS Description
, SUM(pb.OnhandQty) AS 'On Hand Qty'
-- Add all of the columns you wish to see here - they will be dynamically added to the view
FROM
Part p with(nolock)
LEFT OUTER JOIN PartBin pb with(nolock) ON
pb.Company = p.Company
GROUP BY
p.PartNum
, p.PartDesc... |
DEFINE RECORD CDD$TOP.AD.AD_JOURNAL
DESCRIPTION IS /*Depreciation Units Journal*/.
AD_JOURNAL_CDD STRUCTURE.
/* Element = DEP_OBJECT
Description = Depreciation object */
DEP_OBJECT DATATYPE IS TEXT SIZE IS 1.
/* Element = DATE
Description = Date *... |
<gh_stars>1-10
drop schema bethsaida cascade;
create schema bethsaida;
alter schema bethsaida owner to postgres;
create table flyway_schema_history
(
installed_rank integer not null
constraint flyway_schema_history_pk
primary key,
version varchar(50),
description varchar(200) not null... |
use dwp_assignment;
CREATE or replace VIEW profile_model_view AS
SELECT profile.identity,
profile.username,
profile.password,
profile_type.content AS profile_type
FROM profile
LEFT JOIN profile_type ON profile.profile_type = profile_type.identity;
CREATE or replace VIEW contact_... |
CREATE TABLE dbo.DefaultDeliveryDate
(
OrderId int NOT NULL,
CatalogueItemId nvarchar(14) NOT NULL,
DeliveryDate date NOT NULL,
CONSTRAINT PK_DefaultDeliveryDate PRIMARY KEY (OrderId, CatalogueItemId),
CONSTRAINT FK_DefaultDeliveryDate_Order FOREIGN KEY (OrderId) REFERENCES dbo.[Order] (Id) ON DELE... |
CREATE PROCEDURE [srv].[ExcelGetDelIndexOptimize]
as
begin
/*
возвращает неиспользуемые индексы
*/
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SELECT @@SERVERNAME as [ServerName]
,[DBName]
,[SchemaName]
,[ObjectName]
,[ObjectType]
,[ObjectTypeDesc]
,[IndexName]
,[I... |
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
--
-- Host: localhost Database: sql_dh
-- ------------------------------------------------------
-- Server version 5.7.27-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... |
<reponame>jakmeier/paddlers-browser-game<filename>migrations/2021-01-12-234000_watergate/down.sql<gh_stars>10-100
DELETE FROM pg_enum
WHERE pg_enum.enumtypid = 'building_type'::regtype::oid
AND pg_enum.enumlabel = 'watergate'; |
-- The Sentinel's Pawn
-- By mikadmin for arkania
-- Fix gameobject_involvedrelation
DELETE FROM `gameobject_involvedrelation` WHERE `quest` = 27797;
INSERT INTO `gameobject_involvedrelation` (`id`, `quest`) VALUES (206336, 27797);
DELETE FROM `gameobject_involvedrelation` WHERE `quest` = 27884;
INSERT INTO `gameobje... |
select index, `value` from dfs.`/drill/testdata/parquet_storage/drill4764/int_8` union
select index, `value` from dfs.`/drill/testdata/parquet_storage/drill4764/int_16` union
select index, `value` from dfs.`/drill/testdata/parquet_storage/drill4764/uint_8` union
select index, `value` from dfs.`/drill/testdata/parquet_s... |
-- 数据库初始化脚本
-- 创建数据库
CREATE DATABASE seckill_demo;
-- 使用数据库
use seckill_demo;
-- 启用timestamp默认值
-- set @@session.explicit_defaults_for_timestamp=on;
CREATE TABLE seckill(
`seckill_id` BIGINT NOT NUll AUTO_INCREMENT COMMENT '商品库存ID',
`name` VARCHAR(120) NOT NULL COMMENT '商品名称',
`number` int NOT NULL COMMENT '库存... |
<gh_stars>0
INSERT INTO AMPLIFICATORE (cod_amp, num_serie_amp, marca, prezzo_amp, potenza, tipo_amp, num_uscite) VALUES (69347, '475fsf831l', 'Fender', 1229.6, 2000, 'Transistor', 2);
INSERT INTO AMPLIFICATORE (cod_amp, num_serie_amp, marca, prezzo_amp, potenza, tipo_amp, num_uscite) VALUES (64854, '125rqr748b', 'Markb... |
<filename>postgresql/share/contrib/postgis-2.1/uninstall_rtpostgis.sql
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
--
-- PostGIS - Spatial Types for PostgreSQL
-- http://postgis.net
--
-- This is free software; you can redistribute and/or modify it under
-- the terms of the GNU General ... |
<gh_stars>1-10
/****** Object: View [dbo].[V_Dataset_Entry] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Dataset_Entry]
AS
SELECT T_Experiments.Experiment_Num,
Inst.IN_name AS DS_Instrument_Name,
DTN.DST_name AS DS_type_name,
DS.Dataset_Num,
DS.... |
<reponame>Zhaojia2019/cubrid-testcases<filename>sql/_17_sql_extension2/_02_full_test/_09_implicit_type_conversion/_02_comparison/cases/datetime_number_comparison.sql
--test implicit type conversion when comparing date/time with number type
create table datetime_number_comparison(
col1 datetime,
col2 timestamp,
col... |
<filename>doc/HouTu.sql
/*
Navicat Premium Data Transfer
Source Server : local
Source Server Type : MySQL
Source Server Version : 50723
Source Host : localhost:3306
Source Schema : HouTu
Target Server Type : MySQL
Target Server Version : 50723
File Encoding : 65001
D... |
<filename>ustora_shopping_mall.sql
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.17.32
-- Generation Time: Dec 26, 2021 at 02:35 PM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
-- phpMyAdmin SQL Dump
-- version 3.3.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Waktu pembuatan: 03. Oktober 2017 jam 12:37
-- Versi Server: 5.5.8
-- Versi PHP: 5.3.5
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_... |
SELECT * FROM
(
SELECT * FROM
(
-- filter service
SELECT `destination`.`destinationName`, `destination`.`city`, `destination`.`id_destination`, `roomtypedetail`.`id_room`, EmptyRoom, MIN(`roomtypedetail`.`price`) AS MinPrice
FROM
(
SELECT `roomtypedetail`.`id_dest`, `roomtypedetail`.`id_room`, (SUM(`quantu... |
<gh_stars>0
----------------------------------------------------------------------------------------------------------------
-- Table numbers
----------------------------------------------------------------------------------------------------------------
ORD 1
ORD_L 2
Addresses 3
Empleyees 4
Goods 5
Vhcl 6
T... |
<gh_stars>0
{% snapshot retail_customers_scd %}
{{
config(
target_database='Staging',
target_schema='dbo',
unique_key='customer_id',
strategy='timestamp',
updated_at='updated_at',
)
}}
-- Snapshot materialization defau... |
<gh_stars>0
create table tuser (
userid varchar(32) primary key,
name varchar(32),
email varchar(32),
login varchar(32),
password varchar(32)
);
create table taddress (
addressid varchar(32) primary key,
userid varchar(32) references tuser (userid),
street varchar(32),
number varchar(32),
complement varchar(... |
<filename>src/sql/init/PERSON.sql
SET FOREIGN_KEY_CHECKS=0;
CREATE TABLE `leaderboard`.`PERSON` (
`id` INTEGER UNSIGNED NOT NULL,
`identity_id` INTEGER UNSIGNED NOT NULL,
`email` VARCHAR(64) NOT NULL DEFAULT 'default',
`first_name` VARCHAR(32) NOT NULL DEFAULT 'default',
`last_name` VARCHAR(32) NOT NULL DE... |
--********************************************************************************************************************************************************************
INSERT [dbo].[Solution] ([Id], [OrganisationId], [Name], [Version], [PublishedStatusId], [AuthorityStatusId], [SupplierStatusId], [Summary],[OnCatalogueV... |
<reponame>BlackIIIFOX/GoblinSlayerSystemServer
-- Start transaction and plan the tests.
BEGIN;
SELECT plan(2);
-- Run the tests.
SELECT lives_ok(
'INSERT INTO users(username, password, name, address) VALUES (md5(RANDOM()::TEXT), md5(RANDOM()::TEXT), md5(RANDOM()::TEXT), md5(RANDOM()::TEXT))',
'New user ... |
# Runtime: 187 ms, faster than 92.63% of MySQL online submissions for Trips and Users.
# Memory Usage: 0B, less than 100.00% of MySQL online submissions for Trips and Users.
SELECT Request_at AS Day,
ROUND(SUM(CASE WHEN STATUS NOT IN ("completed") THEN 1 ELSE 0 END)/COUNT(Request_at),2) AS "Cancellation Rate"
F... |
<reponame>datoptim/DEMOS<filename>XACT_ABORT.sql
/*
For this Demo basically we use two tables: Countries and a Cities.
You can use the creation scripts uploaded at:
https://github.com/datoptim/BuildData/blob/master/CountryAndCity.sql
We'll see how XACT_ABORT works with two related tables.
You can visit www.datopt... |
create extension "zombodb";
create extension "uuid-ossp";
|
CREATE TABLE users (
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
username VARCHAR(255) UNIQUE NOT NULL,
password VARCHAR(255) NOT NULL
);
|
<reponame>aravi5/drill-test-framework<filename>framework/resources/Functional/limit0/aggregates/aggregation/count_distinct/data/scalar_d28.sql
select COUNT(DISTINCT d28) from alltypes;
|
<gh_stars>0
SELECT
CAST(c.created_at AS DATE) AS created_on
, SUM(o.quantity * i.price) AS total_revenue
FROM
{{ ref('orders') }} AS o
LEFT JOIN
{{ ref('customers') }} AS c
ON o.customer_id = c.customer_id
LEFT JOIN
{{ ref('items_snapshot') }} AS i
ON o.item_id = i.item_id
AND o.order_at... |
<gh_stars>0
{{
config(
materialized='incremental',
unique_key='manifest_model_id'
)
}}
with dbt_models as (
select * from {{ ref('stg_dbt__exposures') }}
),
dbt_models_incremental as (
select *
from dbt_models
{% if is_incremental() %}
-- this filter will only be applied on an... |
<reponame>mkubala/demo-akka-persistence-postgres
-- default schema
DROP TABLE IF EXISTS public.journal;
CREATE TABLE IF NOT EXISTS public.journal
(
ordering BIGSERIAL,
sequence_number BIGINT NOT NULL,
deleted BOOLEAN DEFAULT FALSE NOT NULL,
persistence_id TEXT ... |
CREATE OR REPLACE PROCEDURE chess.start_server()
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
BEGIN
UPDATE chess.messages SET request_id = 0, send_time = NULL;
END;
$BODY$;
|
<filename>migrations/1528395542_.up.sql
DELETE FROM repo WHERE uri = '' OR uri IS NULL;
ALTER TABLE repo
ALTER COLUMN uri SET NOT NULL,
ADD CONSTRAINT check_uri_nonempty CHECK (uri <> '');
|
<reponame>maysincerity/GradLab<filename>Database/Lab2/Lab2_7.sql
go
create trigger thumb_control
on thumb
after insert
as
if exists(select thumb.UID from THUMB,MBLOG where THUMB.BID = MBLOG.BID and THUMB.UID = MBLOG.UID)
begin
rollback transaction
end
go
insert into THUMB (uid,bid) values (1,1);
ALTER TRIG... |
<reponame>AlissonSchel/GitC<filename>C#/BibliotecaDB/QueryVendasDogs.sql
select
TipoDog,
(SUM(Vendas)) as Vendas,
Month(DataVenda) as 'Mês'
from VendasDogs
GROUP BY TipoDog, Month(DataVenda)
ORDER BY Vendas desc |
<filename>Data & Script/furniture_shop.sql<gh_stars>0
CREATE DATABASE FurnitureShop
GO
USE FurnitureShop
GO
CREATE TABLE [User] (
[Id] INT PRIMARY KEY IDENTITY(1, 1),
[RoleId] INT,
[Username] NVARCHAR(255),
[Password] VARCHAR(64),
[CreateAt] TIMESTAMP,
[Image] NVARCHAR(255),
[IsDeleted] BIT DEFAULT(0) N... |
<filename>Sql/SqlServer/dbo/Stored Procedures/GetComponentCategories.sql<gh_stars>0
-- =============================================
-- Author: <NAME>
-- Create date: 7/29/2015 7:30 PM
-- Description: Get a list of component categories
-- the user has access to for a given website
-- ================================... |
CREATE TABLE ratings (
id integer NOT NULL,
user_id integer,
movie_id integer,
rating integer,
rated_at timestamp,
PRIMARY KEY (id)
)
|
<reponame>kennethchoe/sql-crawler-sqls<filename>mssql-servers/3. Multiple Records.sql<gh_stars>1-10
-- query can return multiple records
select * from master.information_schema.tables |
<gh_stars>10-100
SELECT DISTINCT trips, count(*) as freq
from
(SELECT distinct userid, count(*) as trips
FROM dockless_trips
WHERE operatorclean = 'lime'
group by userid
order by count(*)) as user_count
group by trips; |
SELECT v, rolling_median_impute(v, 3) over() FROM (VALUES (1), (1.1), (0.9), (NULL), (0.95), (2.1), (1.95), (2.0), (2.05), (3.11), (2.99), (3.05), (3.0)) as t(v);
SELECT v, rolling_median_impute(v::double precision, 3) over() FROM (VALUES (NULL)) as t(v);
SELECT v, rolling_median_impute(v, 3) over() FROM (VALUES (1)... |
<reponame>ciaranodonnell/Beef
-- Migration Script
BEGIN TRANSACTION
ALTER TABLE [Ref].[Gender]
ADD TripCode NVARCHAR(50) NULL
COMMIT TRANSACTION |
-- Adminer 4.0.0-dev MySQL dump
SET NAMES utf8;
SET foreign_key_checks = 0;
SET time_zone = '+02:00';
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `adminnotification_inbox`;
CREATE TABLE `adminnotification_inbox` (
`notification_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Notification id',... |
-------------------
-- Add new response codes
-------------------
insert into t_transaction_results (result, proto_id)
values ('MAX_NFTS_IN_PRICE_REGIME_HAVE_BEEN_MINTED', 255),
('PAYER_ACCOUNT_DELETED', 256),
('CUSTOM_FEE_CHARGING_EXCEEDED_MAX_RECURSION_DEPTH', 257),
('CUSTOM_FEE_CHARGING_EXCEEDE... |
DROP TABLE IF EXISTS test_1;
CREATE TABLE test_1 (
i VARCHAR(5) NOT NULL PRIMARY KEY,
title VARCHAR(10),
i_test VARCHAR(20)
);
INSERT INTO test_1 (i, title, i_test) values (1, 1, 1);
MERGE INTO test_1 t1 USING ( SELECT '1' AS i, '123456789012345678901234567890' AS title,
'123456789012345678901234567890123456789012... |
/*
This script will create a database called ebirddb with a table called ebird.
It will import the standard eBird export format file, as specified by `ebird_export_path` below into
the new table. Then it will create some indexes and geo points. Customize to suit.
*/
-- Set the desired tablespace, if you want, to pu... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 19, 2020 at 09:48 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>0
CREATE VIEW [dal].[ClaimDiagnosis]
AS SELECT *, ClaimId AS ExternalClaimId FROM dbo.ClaimDiagnosis |
CREATE TABLE IF NOT EXISTS purchase(
id int auto_increment primary key,
seller int not null,
buyer int not null,
nfe varchar(255),
price decimal(10,2) not null,
created_at DATETIME not null,
FOREIGN KEY(seller) REFERENCES customer(id),
FOREIGN KEY(buyer) REFERENCES customer(id)
);
CREAT... |
PRAGMA foreign_keys = ON;
BEGIN TRANSACTION;
DROP TABLE IF EXISTS people_details;
DROP TABLE IF EXISTS transaction_contributions;
DROP TABLE IF EXISTS transaction_tags;
DROP TABLE IF EXISTS transactions_details;
DROP TABLE IF EXISTS transaction_sets;
CREATE TABLE "people_details" (
`id` INTEGER NOT NULL PRI... |
-- AlterTable
ALTER TABLE "Account" ADD COLUMN "createdAt" TIMESTAMPTZ(6) NOT NULL DEFAULT CURRENT_TIMESTAMP;
|
select st_distance_sphere(the_geom, st_setsrid(st_makepoint(-73.619101, 45.723795), 4326)) as dist, *
from streets where st_dwithin(the_geom, st_setsrid(st_makepoint(-73.619101, 45.723795), 4326), .001)
order by dist asc;
select count(*) from streets where name='Voie' and r_ac1='CA'; -- 12458
select count(*) fro... |
BEGIN;
CREATE TABLE migrations (
version text primary key,
date timestamptz not null,
sequence_id bigserial not null
);
CREATE TABLE jobs (
name text primary key,
src_table text not null,
src_sequence text not null,
last_processed_id bigint default 0
);
ALTER TABLE status_changes
RENA... |
<gh_stars>10-100
--
-- Copyright (c) Microsoft Corporation. All rights reserved.
-- Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
--
CREATE PROCEDURE MarkRejectedByMasterCard
@partnerCardId varchar(255),
@discountAmount int,
@dateCreditApproved date,
@pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.