sql stringlengths 6 1.05M |
|---|
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[GetWeekNumber]
(
@SelectedDate smalldatetime
)
RETURNS int
AS
BEGIN
DECLARE
@Week AS int,
@WeekStartDate AS smalldatetime,
@WeekEndDate AS smalldatetime,
@CurrentSeason AS int,
@LaborDay AS smalldatetime,
@Thanksgiving AS sma... |
CREATE GRAIN demo VERSION '1.0';
create materialized view OrderLine<caret>edQty as
select item_id, sum(qty) as qty from OrderLine group by item_id; |
<filename>transform/snowflake-dbt/models/sources/snowflake/snowflake_show_users_source.sql
WITH source AS (
SELECT *
FROM {{ source('snowflake','users') }}
), intermediate AS (
SELECT
name AS user_name,
created_on,
login_name,
display_nam... |
<filename>transform/snowflake-dbt/models/marts/exports/users_emails/paid_self_managed_customers.sql
WITH zuora_subscription_product_category AS (
-- Return all the subscription information
SELECT DISTINCT
mrr_month,
account_id,
account_number,
crm_id,
subscription_id,
product_category,
... |
-- Drops the task_saver_db if it already exists --
DROP DATABASE IF EXISTS empTracker_db;
-- Create the database task_saver_db and specified it for use.
CREATE DATABASE empTracker_db;
USE empTracker_db;
CREATE TABLE department (
dept_id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (dept_... |
-- importando caminhos dos pedidos para inserir na tabela
use tblai;
-- DROP TEMPORARY TABLE IF EXISTS tmp_import;
-- cria tabela vazia para receber os dados do csv
CREATE TEMPORARY TABLE tmp_import (
Codigo INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
Protocolo VARCHAR (200) NULL,
CodigoPedidoInteracao INTEGER NU... |
<reponame>VU-libtech/OLE-INST
TRUNCATE TABLE CA_FUND_GRP_T
/
|
<filename>caixa_registradora_ceub/Backup_Banco/caixa0513.sql
-- 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='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_... |
<reponame>AndriiMaliuta/cleanup-scripts
-- Jira Data Center Functionalities Loss Due to Cluster Wide Lock
-- https://confluence.atlassian.com/jirakb/jira-data-center-functionalities-loss-due-to-cluster-wide-lock-942860754.html
/*
This only affects Jira Data Center - the application is not responding
on any syst... |
<gh_stars>1-10
/*
Navicat Premium Data Transfer
Source Server : mysql5.7
Source Server Type : MySQL
Source Server Version : 50718
Source Host : localhost:3306
Source Schema : javamall
Target Server Type : MySQL
Target Server Version : 50718
File Encoding : 65001
Date... |
ALTER TABLE hydra_jwk DROP CONSTRAINT hydra_jwk_pkey;
ALTER TABLE hydra_jwk ADD pk SERIAL;
ALTER TABLE hydra_jwk ADD PRIMARY KEY (pk);
CREATE UNIQUE INDEX hydra_jwk_idx_id_uq ON hydra_jwk (sid, kid);
|
<reponame>databasic-net/Databasic.Tests.Databases
INSERT INTO `contacts` (`id_person`, `id_contact_category`, `value`) VALUES
(1, 1, '+12123171930'),
(1, 2, '+12126730523'),
(1, 3, '<EMAIL>'),
(1, 4, '<EMAIL>'),
(1, 6, 'samuel.jackson'),
(1, 8, 'samueljackson'),
(2, 1, '+12122683055'),
(2, 2, '+1212191797'),
(2, 3, '<E... |
<gh_stars>1-10
drop table if exists t1,t2,foo1,foo2;
CREATE TABLE t1(name VARCHAR(10), birthdate DATE);
INSERT INTO t1 VALUES
('Amie', date'1978-03-18'),
('Jane', date'1983-05-12'),
('Lora', date'1987-03-26'),
('James', date'1948-12-28'),
('Peter', date'1988-10-25'),
('Tom', date'1980-07-28'),
... |
<filename>openGaussBase/testcase/KEYWORDS/authid/Opengauss_Function_Keyword_Authid_Case0022.sql
-- @testpoint:opengauss关键字Authid(保留),作为用户组名
--关键字不带引号-合理报错
drop group if exists Authid;
create group Authid with password '<PASSWORD>';
--关键字带双引号-成功
drop group if exists "Authid";
create group "Authid" with password '<PA... |
-- @testpoint:opengauss关键字sys_refcursor(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists sys_refcursor;
CREATE TABLESPACE sys_refcursor RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace sys_refcursor;
--关键字带双引号,创建成功
drop tablespace if exists "sys_refcursor";
CREATE TABLESPACE "sys_refcurso... |
CREATE TABLE varselstatus (
id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
sykmelding_id uuid NOT NULL,
opprettet timestamptz NOT NULL,
mottaker_fnr VARCHAR(64) NOT NULL,
varselbestilling_id uuid ... |
<filename>MyMDb/MyMDb/DB Files/Create/06_CREATE TagLine.zip.sql
--Change script command to MyMDb database...
USE [MyMDb]
GO
--Remove Tagline and its assosicated objects...
IF EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_TagLine_MediaEntry]') AND parent_object_id = OBJECT_ID(N'[dbo].[T... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 21-08-2015 a las 04:53:26
-- Versión del servidor: 5.6.19-0ubuntu0.14.04.1
-- Versión de PHP: 5.6.10-1+deb.sury.org~trusty+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/... |
<filename>sql/by_outward_grouped.sql
SELECT * FROM layouts
GROUP BY outward
ORDER BY outward, same_finger_rp, jumps, score DESC;
|
-- Postgresql migration script : 1.2.0 to 1.3.0
BEGIN;
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET client_min_messages = warning;
SET default_with_oids = false;
-- Fix wrong tables
DROP TABLE IF EXISTS thread_member_history;
DROP TABLE IF EXISTS account_thread_member_history;
DROP TABLE IF EXISTS thre... |
Select Name as Customers
from Customers
where Id not in
(Select customerId from Orders) |
<reponame>a-dg/code-snippets<filename>snippets/get-post-ids-for-upcoming-events.sql
# Get posts of type 'event' that start in the future
SELECT p.ID
FROM wp_posts AS p
INNER JOIN wp_postmeta AS pm ON pm.post_id = p.ID
WHERE p.post_type = 'event'
AND p.post_status = 'publish'
AND pm.meta_key = 'event_date_start'
... |
<filename>ratings/RatingsFormulae.sql
-- DATES
CREATE OR REPLACE VIEW ratings_dates AS
SELECT
nct_id,
if(length(start_date) > 0,1,0) has_start_date,
if(length(completion_date) > 0,1,0) has_completion_date,
if(length(primary_completion_date) > 0,1,0) has_primary_completion_date,
if(length(completion_date_typ... |
<reponame>meowpub/meow
--
-- version: 1525550010
--
BEGIN;
DROP TABLE users;
COMMIT;
|
<reponame>Shuttl-Tech/antlr_psql<gh_stars>10-100
-- file:inet.sql ln:117 expect:true
DROP INDEX inet_idx3
|
<gh_stars>10-100
prompt Dropping package ExcelTable ...
drop package ExcelTable;
prompt Dropping type ExcelTableImpl ...
drop type ExcelTableImpl;
prompt Dropping package XUTL_FLATFILE ...
drop package xutl_flatfile;
prompt Dropping package XUTL_XLSB ...
drop package xutl_xlsb;
prompt Dropping package XUTL_XLS ...
... |
<filename>sql/schema.sql<gh_stars>0
CREATE DATABASE employees_db;
USE employees_db;
CREATE TABLE departments(
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(30) UNIQUE NOT NULL
);
CREATE TABLE roles (
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(30) UNIQUE NOT NULL,
salary DECIMAL NOT NULL,
departm... |
<gh_stars>10-100
create table gcmd_keyword (
identifier varchar not null primary key,
parent_identifier varchar constraint fk_parent
references gcmd_keyword(identifier)
deferrable initially deferred,
label varchar,
definition varchar
);
create table publication_gcmd_keyword_map (
pu... |
<reponame>iyank4/accident-prone-areas
-- MySQL dump 10.13 Distrib 5.7.17, for osx10.12 (x86_64)
--
-- Host: localhost Database: gen2017
-- ------------------------------------------------------
-- Server version 5.7.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SE... |
WITH map AS (
SELECT
id AS x_pos,
y_pos,
height AS height_self,
lag(height) OVER (PARTITION BY id ORDER BY y_pos) AS height_up,
lead(height) OVER (PARTITION BY id ORDER BY y_pos) AS height_down,
lag(height) OVER (PARTITION BY y_pos ORDER BY id) AS height_lef... |
<filename>dbinit.sql
SET sql_safe_updates = false;
DROP DATABASE IF EXISTS movr CASCADE;
CREATE DATABASE movr;
USE movr;
CREATE TABLE IF NOT EXISTS users (
id UUID NOT NULL DEFAULT gen_random_uuid(),
city STRING NOT NULL,
first_name STRING NULL,
last_name STRING NULL,
email STRING NULL,
... |
-- create gov users 1
INSERT INTO users ("id", "createdAt", "updatedAt", "type", "status", "name", "email", "avatarImageFile", "jobTitle", "idpUsername", "notificationsOn", "acceptedTermsAt", "deactivatedOn", "deactivatedBy", "capabilities", "idpId", "lastAcceptedTermsAt") VALUES('39b86e99-9a39-49ae-8962-c7d815e56125',... |
<gh_stars>1-10
create extension if not exists hstore;
alter table users add column extra hstore;
create index users_extra_idx on users using gin(extra);
|
SELECT * FROM github_log.events WHERE toYear(created_at)=2020
|
<reponame>sanders41/fides<filename>fidesctl/tests/data/example_sql/snowflake_example.sql
DROP TABLE IF EXISTS public.visit;
DROP TABLE IF EXISTS public.login;
CREATE TABLE public.visit ( email varchar(100), last_visit DATETIME);
CREATE TABLE public.login ( id INT, customer_id INT, time DATETIME);
INSERT INTO public.... |
<reponame>sambitesh/gpdb
BEGIN;
REINDEX INDEX cr_heap_reindex_gist_idx1;
COMMIT;
|
<filename>scripts/parser_test/parser_q42.sql
select ?x where
{?x <name> ?name . filter(ucase(?name) = "ALICE"@en)} |
-- @testpoint:opengauss关键字cube(非保留),作为用户名
--关键字cube作为用户名不带引号,创建成功
drop user if exists cube;
CREATE USER cube PASSWORD '<PASSWORD>';
drop user cube;
--关键字cube作为用户名加双引号,创建成功
drop user if exists "cube";
CREATE USER "cube" PASSWORD '<PASSWORD>';
drop user "cube";
--关键字cube作为用户名加单引号,合理报错
CREATE USER 'cube' PASSWORD '<P... |
USE [warehouse_management]
GO
-- Delete a personnel permission in the database
--EXEC [dbo].[uspDeletePersonnelPermission]
-- @username NVARCHAR(50), -- username of the personnel this permission will be revoked from
-- @action NVARCHAR(10), -- type of action the permission will be for (create/read/update/delete)
-- @o... |
<reponame>niravtasol/sendeddy
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 29, 2018 at 02:58 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone =... |
<reponame>Shashikant119/moneyview
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 06, 2020 at 08:20 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
DROP DATABASE IF EXISTS fav_dog_db;
CREATE DATABASE fav_dog_db; |
# Converted with pg2mysql-1.9
# Converted on Fri, 28 Jun 2019 23:49:20 -0400
# Lightbox Technologies Inc. http://www.lightbox.ca
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone="+00:00";
CREATE TABLE users (
id_user int(11) NOT NULL AUTO_INCREMENT,
user_name varchar(25) NOT NULL,
password text NOT NUL... |
CREATE TABLE "Stats" ("id" SERIAL PRIMARY KEY,
"created_at" TIMESTAMP NOT NULL,
"company_code" VARCHAR NOT NULL,
"action" VARCHAR NOT NULL,
"login" VARCHAR NOT NULL,
"ip_address" VARCHAR NOT NULL,
... |
<reponame>Wycers/Codelib<gh_stars>10-100
select * from cinema where description <> 'boring' and MOD(id, 2) = 1 order by rating desc; |
<reponame>agdespopoulos/cheesy-arena<filename>db/migrations/20140526225924_CreateRankings.sql
-- +goose Up
CREATE TABLE rankings (
teamid INTEGER PRIMARY KEY,
rank int,
qualificationscore int,
assistpoints int,
autopoints int,
trusscatchpoints int,
goalfoulpoints int,
random REAL,
wins int,
losses i... |
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5531790_sys_gh5570_BankStatement_DeleteOldCallouts.sql
-- 2019-09-24T13:07:53.753Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
DELETE FROM AD_ColumnCallout WHERE AD_ColumnCallout_ID=5002... |
<reponame>paullewallencom/apache-cassandra-978-1-7839-8920-1<gh_stars>0
CREATE KEYSPACE "my_status"
WITH REPLICATION = {
'class': 'SimpleStrategy',
'replication_factor': 1
};
|
<gh_stars>0
/*mayorean en caja y bancos 110*/
INSERT INTO cuentasSimples (nombre,tipo, monto, codigoCS, recibeSaldo, idMayor)
VALUES ("Activo", "Activo", 0,100,0, 0);
/*mayorean en caja y bancos 110*/
INSERT INTO cuentasSimples (nombre,tipo, monto, codigoCS, recibeSaldo, idMayor)
VALUES ("Caja y Bancos", "Activo", 0... |
/*iWeb在线课堂项目必须的数据结构*/
/*SQL语句不区分大小写,习惯上:关键字都大写,非关键字都小写*/
#删除数据库iweb,如果它存在的话
DROP DATABASE IF EXISTS iweb;
#重新创建数据库iweb
CREATE DATABASE iweb CHARSET=UTF8;
#进入数据库iweb
USE iweb;
#创建校区表
CREATE TABLE iweb_school(
sid INT PRIMARY KEY AUTO_INCREMENT, #校区编号
sname VARCHAR(32), #名称
pic VARCHAR(1... |
/* This is a bit of a hack. Don't use it as an example for future migration scripts.*/
SELECT 0 AS count
|
# return values 0=failed,1=success,2=success, undelegate was called
# TODO: test if unDelegate produces strength<>1 => means DB consistency error !!!
DELIMITER //
DROP PROCEDURE IF EXISTS unTakeCare //
CREATE PROCEDURE unTakeCare
(IN p_issue_id int,
IN p_user bigint,
OUT r_result int)
BEGIN
DECLARE v_user,v_dele... |
-- AlterTable
ALTER TABLE "State" ADD COLUMN "country_id" TEXT;
-- AddForeignKey
ALTER TABLE "State" ADD CONSTRAINT "State_country_id_fkey" FOREIGN KEY ("country_id") REFERENCES "Country"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
CREATE DATABASE IF NOT EXISTS `pms` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `pms`;
-- MySQL dump 10.13 Distrib 5.6.23, for Win64 (x86_64)
--
-- Host: localhost Database: pms
-- ------------------------------------------------------
-- Server version 5.6.24-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... |
<gh_stars>0
/****** Customers Table ******/
CREATE TABLE [dbo].[Customers](
[CustomerId] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [nvarchar](20) NOT NULL,
[LastName] [nvarchar](20) NOT NULL,
[PrefferedLocation] [int] NULL,
[Email] [nvarchar](100) NOT NULL,
CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED
(
[C... |
/* This file inserts example data into the RequestToPay schema. */
-- Sets the namespace for where we keep the tables
set search_path to "RequestToPay";
-- Entity
insert into "Entity"("EID", "Name", "BillingAddress", "Username", "Password", "PhoneNumber")
values (default, 'The North Pole', '20 Everywhere Ave.', 'sant... |
<reponame>DonaldLouch/website
/*
Warnings:
- Added the required column `avatar` to the `About` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `About` ADD COLUMN `avatar` VARCHAR(191) NOT NULL;
|
use master;
IF NOT EXISTS (SELECT * FROM sys.databases WHERE name = '{0}')
BEGIN
CREATE DATABASE {0};
print 'Database {0} created';
END
USE {0};
if exists (select * from sysobjects where name='MessageLog' and xtype='U')
begin
Drop TABLE MessageLog;
print 'Table MessageLog dropped';
END
CREATE TABLE Mes... |
<filename>egov/egov-tl/src/main/resources/db/migration/main/V20160209124233__tl_penaltyRates_DDL.sql<gh_stars>1-10
CREATE TABLE egtl_penaltyrates (
id bigint NOT NULL,
fromrange bigint NOT NULL,
torange bigint NOT NULL,
rate double precision NOT NULL DEFAULT 0,
licenseAppType bigint,
version big... |
<reponame>BearerPipelineTest/sqlc
CREATE TABLE users (
id integer NOT NULL PRIMARY KEY,
first_name varchar NOT NULL,
last_name varchar,
age integer NOT NULL
);
|
<filename>blog.sql<gh_stars>1-10
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 100410
Source Host : localhost:3306
Source Schema : blog
Target Server Type : MySQL
Target Server Version : 100410
File Encoding ... |
<reponame>alpo-p/marketplace<filename>schema.sql<gh_stars>1-10
CREATE TABLE categories (id SERIAL PRIMARY KEY, name TEXT);
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username TEXT,
password TEXT
);
CREATE TABLE items (
id SERIAL PRIMARY KEY,
category_id INTEGER REFERENCES categories,
name TEX... |
<filename>src/main/resources/db/migration/V1_56_1__remove_appointment_fields_from_action_plan.sql
create table action_plan_session (
id uuid not null,
session_number int not null,
action_plan_id uuid,
constraint fk_action_plan_session_action_plan foreign key (action_plan_id) references action_plan,
... |
<reponame>CSCfi/antero
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'sa.SA_SUORAT_AMK_TALOUS_4_tutkimusmenot') AND type in (N'U'))
BEGIN
CREATE TABLE sa.SA_SUORAT_AMK_TALOUS_4_tutkimusmenot(
TILIK int NULL,
OPM95OPA nvarchar(50) NULL,
TUTMENOT bigint NULL,
ULKOPTR bigint NULL,
AKATEMI... |
<reponame>georgidelchev/CSharp-Databases
-- Select all from towns
SELECT *
FROM Towns
-- Get Length of the names
SELECT LEN([Name]) AS NamesLength
FROM Towns
-- Get first letter of the names
SELECT LEFT([Name], 1) AS FirstLetter
FROM Towns
SELECT GETDATE() AS CurrentTime
-- Select all from towns with id... |
DROP TABLE IF EXISTS viewings;
|
ALTER TABLE collectionobjects_accessionattributes ALTER COLUMN flowersjan TYPE CHARACTER VARYING USING CAST(flowersjan AS CHARACTER);
ALTER TABLE collectionobjects_accessionattributes ALTER COLUMN flowersfeb TYPE CHARACTER VARYING USING CAST(flowersfeb AS CHARACTER);
ALTER TABLE collectionobjects_accessionattributes AL... |
-- All mods
INSERT INTO MODS(ID, NAME, TEMPLATE_TEXT, AFFIX_TYPE) VALUES(1, 'Maximum mana', '{} to maximum Mana', 0);
-- All mod tiers
INSERT INTO MOD_TIERS(ID, MOD, TIER, PERCENT, ILEVEL, MIN_RANGE, MAX_RANGE) VALUES(120001, 1, 12, 1.51, 1, 15, 19);
-- All mods available per item base
INSERT INTO MODS_BASES(MOD, ITE... |
insert into role(name) values('USER');
insert into role(name) values('MANDATOR');
insert into role(name) values('ADMIN');
insert into musictype(name) values('ROCK');
insert into musictype(name) values('RAP');
insert into musictype(name) values('CLASSIC');
insert into musictype(name) values('DRUM');
insert into musictyp... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50018
Source Host : localhost:3306
Source Database : micro-admin
Target Server Type : MYSQL
Target Server Version : 50018
File Encoding : 65001
Date: 2018-10-30 15:40:36
*/
SET FOREIGN_KEY_CHECKS=0;
... |
DROP TABLE IF EXISTS event;
CREATE TABLE event (
id int NOT NULL AUTO_INCREMENT,
title varchar(256) character set utf8 not null,
description varchar(10240) character set utf8 not null,
island char(1) not null,
content_source_id int,
url varchar(256),
start_datetime DATETIME not null,
en... |
<filename>packaging/dbscripts/upgrade/04_04_0040_added_host_count_threads_as_cores.sql
-- Added cluster count threads as cores
select fn_db_add_column('cluster_configuration', 'count_threads_as_cores', 'boolean'); |
-- Deploy delivery_role
BEGIN;
-- There is no IF NOT EXISTS clause for type creation. We could wrap
-- things in an anonymous DO block if you really wanted to...
CREATE TYPE delivery_role AS ENUM('admin',
'committer',
'reviewer',
... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.3.11
-- Generation Time: Oct 16, 2020 at 12:29 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
--Listing 2.21.sql
--Interner Prozeduraufruf mit Angabe des Schemas
DO BEGIN
CALL jbrandeis.statustexte(iv_sprache=>'DE',
et_result=> lt_statustexte) ;
END; |
# Script to Get Fragmentation Stats for All Dbs on Multiple Servers (in Parallel Jobs)
$dbServers = @('DbServer01','DbServer02','DbServer03');
$dbQuery = @"
select d.name
from sys.databases as d
where not(d.source_database_id IS NOT NULL or d.state_desc = 'OFFLINE' or d.database_id <= 4)
and d.compatibility_level = ... |
<gh_stars>0
drop database if exists test;
create database test;
use test;
create table difficult_levels(
difficult_level_id int NOT NULL AUTO_INCREMENT Primary key,
difficult_level_name varchar (30),
created_at datetime(6) DEFAULT CURRENT_TIMESTAMP(6),
updated_at datetime(6) DEFAULT CURRENT_TIMESTAMP(6) ON UP... |
--name: ConditionOccurrenceAchilles
--connection: Demo:test_queries:PostgresNetCDM
concept_hierarchy.concept_id AS conceptId,
COALESCE(concept_hierarchy.level4_concept_name, 'NA') || '||' ||
COALESCE(concept_hierarchy.level3_concept_name, 'NA') || '||' ||
COALESCE(concept_hierarchy.level2_concept_name, '... |
START TRANSACTION;
UPDATE tblVersion set major=4, minor=1, subminor=0;
COMMIT;
|
<gh_stars>0
create table if not exists konsistensavstemming
(
id varchar(30)
primary key,
opprettet timestamp with time zone
not null,
løpendeFraOgMed
timestamp with time zone,
opprettetTilOgMed
timestamp with time zone,
utbetalinger
json,
avstemmingXmlReq... |
<filename>migrations/20180809_user_kyc_skipped.sql
ALTER TABLE `users`
ADD COLUMN `kyc_skipped` TINYINT(1) NULL DEFAULT '0' AFTER `bounty_received_at`;
|
SELECT
ogc_fid AS gid,
zemes_h AS height,
st_asbinary(geom) AS geom
FROM
izolinijos
WHERE
geom && !BBOX!
|
<filename>migrations/2021-09-21-081512_skip_checks/down.sql
ALTER TABLE repository DROP COLUMN default_enable_qa;
ALTER TABLE repository DROP COLUMN default_enable_checks;
|
USE WideWorldImportersDW
GO
SET NOCOUNT ON;
DROP TABLE IF EXISTS dbo.FO_110;
DROP TABLE IF EXISTS dbo.FO_130;
GO
ALTER DATABASE WideWorldImportersDW SET COMPATIBILITY_LEVEL = 110
GO
GO
-- TURN ON QUERY PLAN
SELECT * INTO dbo.FO_110 FROM Fact.[Order]
ALTER DATABASE WideWorldImportersDW SET COMPATIBILITY_LEVEL = 130
GO
... |
<reponame>bitts/ConsultasTSQL-RMTotvs
/*
PLT019 - Função para limpar um número ClearNumber - cNumber
Create By Bitts
(13/11/2015)
UTILIZAÇÃO: SELECT dbo.cNumber(E.TELEFONE1) FROM PPESSOA
*/
CREATE FUNCTION [dbo].[cNumber](@Resultado VARCHAR(8000)) RETURNS VARCHAR(8000) AS
BEGIN
DECLARE @CharInvalido SMALLINT
S... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 12, 2019 at 02:28 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>DickBaker/practical-azure-sql-db-for-modern-developers
/*
Add a computed column as a named expression (drop existing if it already exists)
*/
ALTER TABLE Sales.[OrderLines]
DROP COLUMN IF EXISTS Profit;
GO
ALTER TABLE Sales.OrderLines
ADD Profit AS (Quantity*UnitPrice)*(1-TaxRate);
GO
/*
Add a computed ... |
DROP TABLE signum.`__EFMigrationsHistory`;
|
<filename>resources/db/patches/mysql/0429~releases.sql
# Fix category categoryid for 'Other' sub-category to match new table values category.
UPDATE releases SET categoryid = 1999 WHERE categoryid = 1090;
UPDATE releases SET categoryid = 2999 WHERE categoryid = 2020;
UPDATE releases SET categoryid = 3999 WHERE category... |
CREATE TABLE PROTOCOL_NOTEPAD
(PROTOCOL_NOTEPAD_ID NUMBER(12,0) NOT NULL ENABLE,
PROTOCOL_ID_FK NUMBER(12,0) NOT NULL,
PROTOCOL_NUMBER VARCHAR2(20) NOT NULL,
SEQUENCE_NUMBER NUMBER(4,0) NOT NULL ENABLE,
ENTRY_NUMBER NUMBER(4,0) NOT NULL,
COMMENTS CLOB,
RESTRICTED_VIEW CHAR(1) NOT NULL,
... |
--Signup-60
-- add the UUID columns
ALTER TABLE 'signup_meetings' ADD 'vevent_uuid' VARCHAR(255) NULL;
ALTER TABLE 'signup_ts' ADD 'vevent_uuid' VARCHAR(255) NULL; |
<filename>migrations/20200405140409_tLeague.up.sql
create table dbo.League
(
LeagueId int identity not null,
LeagueName varchar(120) not null,
SportId int not null,
CreatedAt datetimeoffset default s... |
-- phpMyAdmin SQL Dump
-- version 4.5.3.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2016-03-04 16:56:43
-- 服务器版本: 5.7.10
-- PHP Version: 7.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET ... |
<filename>SampleFormGenerator.Database/dbo/Tables/TblParameterTypes.sql
CREATE TABLE [dbo].[TblParameterTypes] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Title] NVARCHAR (100) NOT NULL,
[RegexValidator] NVARCHAR (500) NULL,
[RegexValidatorMessage] NVARCHA... |
<filename>src/main/resources/db/migration/V4__Add_screenshot_fields.sql
-- Add bug_id column
SELECT f_add_col('public.test_cases', 'screenshot_path', 'VARCHAR(255)');
SELECT f_add_col('public.test_cases', 'screenshot_url', 'VARCHAR(255)'); |
-- +migrate Up
ALTER TABLE hydra_oauth2_authentication_session ADD remember bool NOT NULL DEFAULT FALSE;
UPDATE hydra_oauth2_authentication_session SET remember=TRUE;
-- +migrate Down
ALTER TABLE hydra_oauth2_authentication_session DROP COLUMN remember;
|
-- insert indices for history cleanup - https://app.camunda.com/jira/browse/CAM-8184 --
create index ACT_IDX_HI_JOB_LOG_EX_STACK on ACT_HI_JOB_LOG(JOB_EXCEPTION_STACK_ID_);
create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_);
create index ACT_IDX_HI_DETAIL_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_);
cre... |
<reponame>ychung-mot/HMCR<gh_stars>1-10
/* ---------------------------------------------------------------------- */
/* Script generated with: DeZign for Databases 11.1.0 */
/* Target DBMS: MS SQL Server 2017 */
/* Project file: APP_HMR.dez ... |
<filename>scripts/db_init.sql
BEGIN;
-- Enables UUID data type
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Allows use of complex cryptographic hash algorithms like SHA256
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
-- Creates sha256() hashing function
CREATE OR REPLACE FUNCTION sha256(text) returns text AS $$
SEL... |
<filename>egov/egov-commons/src/main/resources/db/migration/main/V20200109113546__commons_industrial_sub_occupancy.sql
INSERT INTO egbpa_sub_occupancy(id, code, name, ordernumber, isactive, createdby, createddate, lastmodifieddate, lastmodifiedby, version, maxfar, occupancy, description,colorcode) VALUES
(nextval('s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.