sql stringlengths 6 1.05M |
|---|
DROP TABLE buildStageTable;
CREATE TABLE buildStageTable (
id INT NOT NULL AUTO_INCREMENT,
build_id INT NOT NULL,
name VARCHAR(80) NOT NULL,
board VARCHAR(80),
-- This should match constants.BUILDER_ALL_STATUSES
status ENUM('fail', 'pass', 'inflight', 'missing', 'aborted', 'planned',
'skipped... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:opengauss关键字simple(非保留),作为外部数据源名
--关键字不带引号-成功
drop data source if exists simple;
create data source simple;
drop data source simple;
--关键字带双引号-成功
drop data source if exists "simple";
create data source "simple";
drop data source "simple";
--关键字带单引号-合理报错
drop d... |
CREATE DEFINER=`root`@`localhost` PROCEDURE `proc_payment_month`(IN `i_tenement_id` INT, IN `i_year_month` INT, IN `i_flat_id` INT, IN `i_user_id` INT)
LANGUAGE SQL
NOT DETERMINISTIC
CONTAINS SQL
SQL SECURITY DEFINER
COMMENT ''
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE v_flat_id INT;
DECLARE v_his_id INT;
... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 30, 2021 at 05:39 AM
-- Server version: 8.0.23-0ubuntu0.20.10.1
-- PHP Version: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... |
<filename>cmd/health-survey-backend/test_data/db.sql
INSERT INTO users (id, first_name, last_name, email, address) VALUES (1, 'John', 'Doe', '<EMAIL>', 'Dummy Value 1');
INSERT INTO users (id, first_name, last_name, email, address) VALUES (2, 'Ben', 'Smith', '<EMAIL>', 'Dummy Value 2');
INSERT INTO surveys (id, title,... |
<reponame>huudo/bds<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Jeu 24 Septembre 2015 à 10:31
-- Version du serveur : 5.6.17
-- Version de PHP : 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
<reponame>developersworkspace/WorldOfRations
DELIMITER //
CREATE PROCEDURE findFormulationById (
p_formulationId CHAR(36))
BEGIN
SELECT
`id` AS `id`,
`formulaId` AS `formulaId`,
`feasible` AS `feasible`,
`cost` AS `cost`,
`currencyCode` AS `currencyCode`,
`timestamp` AS `timestamp`
FROM worldofrations.formulations
W... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 08-Nov-2021 às 20:59
-- Versão do servidor: 10.4.21-MariaDB
-- versão do PHP: 8.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
#
# $Id$
#
# DO NOT USE THIS SCRIPT DIRECTLY - USE THE INSTALLER INSTEAD.
#
# All entries must be date stamped in the correct format.
#
# 20050316
# Remove config elements that are no longer used.
DELETE FROM `config` where `config_name` = 'cal_day_view_show_minical';
DELETE FROM `config` where `config_name` = 'show_a... |
<gh_stars>0
CREATE FUNCTION [dbo].[jogosConcurso] (@concurseID INT)
RETURNS TABLE
AS
RETURN
(
SELECT pl.Id, pl.Id as 'LotteryId', pl.Concurse, pes.Name as 'Name', pl.Game, pl.Hits, pl.Ticket_Amount as Ticket_Amount, pes.Id as 'PesId'
FROM PersonLottery pl
inner join Lottery lot on pl.LotteryId = lot.I... |
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50505
Source Host : localhost:3306
Source Database : ferco
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2016-07-22 17:21:35
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------... |
CREATE PROC usp_GetTownsStartingWith(@startingString NVARCHAR(MAX))
AS
SELECT t.[Name] AS [Town]
FROM Towns AS t
WHERE t.[Name] LIKE @startingString + '%'
GO
EXEC dbo.usp_GetTownsStartingWith 'Bell'
|
--
-- PostgreSQL database cluster dump
--
SET default_transaction_read_only = off;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
--
-- Drop databases
--
--
-- Drop roles
--
DROP ROLE postgres;
--
-- Roles
--
CREATE ROLE postgres;
ALTER ROLE postgres WITH SUPERUSER INHERIT CREATEROLE CR... |
<gh_stars>1-10
/*
Warnings:
- Added the required column `ownerId` to the `Hub` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Hub" ADD COLUMN "ownerId" INTEGER NOT NULL;
-- CreateTable
CREATE TABLE "Reservation" (
"id" SERIAL NOT NULL,
"ch... |
<reponame>nateraluis/bike-sharing
-- Database: bikes
-- DROP DATABASE bikes;
CREATE DATABASE bikes
WITH
OWNER = bike_admin
ENCODING = 'UTF8'
LC_COLLATE = 'C'
LC_CTYPE = 'C'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
-- Table: public."bikeLocations"
-- DROP TABLE public."bikeLoca... |
--List of all monitors in a critical state
SELECT
mv.DisplayName AS 'MonitorDisplayName',
mv.Name AS 'MonitorName',
bme.Path,
bme.DisplayName,
bme.FullName AS 'Target',
s.LastModified AS 'StateLastModified'
FROM State s
JOIN BaseManagedEntity bme WITH (NOLOCK) ON s.BaseManagedEntityId = bme.BaseManagedEntityId
JOIN M... |
-- CREATE TABLE HIERARCHY1 (NODE INTEGER, PARENT_NODE INTEGER);
-- INSERT INTO HIERARCHY1 VALUES (1,2);
-- INSERT INTO HIERARCHY1 VALUES (3,2);
-- INSERT INTO HIERARCHY1 VALUES (6,8);
-- INSERT INTO HIERARCHY1 VALUES (9,8);
-- INSERT INTO HIERARCHY1 VALUES (2,5);
-- INSERT INTO HIERARCHY1 VALUES (8,5);
-- INSERT INTO ... |
CREATE INDEX secretid_idx ON secrets_content (secretid);
ALTER TABLE secrets_content DROP INDEX secrets_content_secretid_version_idx;
ALTER TABLE secrets_content DROP COLUMN version;
|
SELECT
last_name as 'useCase' ,
JSON_QUERY((
SELECT AS param
FROM Article WHERE Hash=a.Hash)) as loginParams
from Article a
where last_name in ('Walshaw','McGachey')
FOR JSON PATH,Root('applicationLogin')
SELECT '['+STRING_AGG (
'{"inputType": "Id",'
+'"controllerNameOrId": "LoginViewModel_Surname",'
+'"control... |
-- Revert ggircs-portal:function_session from pg
begin;
drop function if exists ggircs_portal.session;
commit;
|
<gh_stars>100-1000
ALTER TABLE ACTIONS_CONFIGURATIONS RENAME COLUMN METRICS_GROUP_ACTION_ID TO METRIC_ACTION_ID;
ALTER TABLE ACTIONS_CONFIGURATIONS RENAME CONSTRAINT FK_METRIC_METRIC TO fk_metric_group_action_configuration; |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 19, 2019 at 12:11 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>sql/_27_banana_qa/issue_5765_timezone_support/_12_addtime/cases/017.sql
select addtime(datetime'2007-12-31 23:59:59',datetime'2007-12-31 23:59:59');
select addtime(datetime'2007-12-31 23:59:59',datetimetz'2007-12-31 23:59:59');
select addtime(datetime'2007-12-31 23:59:59',datetimetz'2007-12-31 23:59:59 +07:00... |
<filename>Consultas.sql<gh_stars>1-10
#1. ¿Cuántos empleados son?
SELECT count(*)
FROM EMPLEADOS;
#2. ¿Cuántos empleados por sede?
SELECT count(*)
FROM EMPLEADOS
WHERE SEDE = '2';
SELECT count(*)
FROM EMPLEADOS
WHERE SEDE = '1';
SELECT count(*)
FROM EMPLEADOS
WHERE SEDE = '4';
SELECT count(*)
FROM EMPLEAD... |
drop database if exists ecommerce_db;
create database if not exists ecommerce_db;
use ecommerce_db;
create table Category (
id int not null auto_increment,
category_name varchar(30),
primary key (id)
);
create table Product (
id int not null auto_increment,
product_name varchar(30),
price decimal(20... |
CREATE VIEW [dbo].[ViewMusicSchedulingData]
AS
SELECT dbo.ViewMusicMaxScheduledDate.MaxDate AS MaxMusicDate,
dbo.ViewMusicTracks_OnAir.*,
dbo.ViewArtistMaxScheduledDate.MaxDate AS MaxArtistDate
FROM dbo.ViewMusicTracks_OnAir LEFT OUTER JOIN
dbo.ViewArtistMaxScheduledDate ON
dbo.ViewMusicTracks_OnAi... |
<reponame>mariamkamel/bus-booking-system
-- MySQL Script generated by MySQL Workbench
-- Fri Jan 7 17:01:05 2022
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
S... |
<reponame>ro-msg-spring-training/online-shop-SavinaRuxandra
CREATE TABLE IF NOT EXISTS `customer` (
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
`first_name` varchar(100),
`last_name` varchar(100),
`username` varchar(100),
`password` varchar(100),
`email_address` varchar(100)
); |
<reponame>RyanLiu99/CodingTask
CREATE TABLE [dbo].[RunInstance] (
[run_instance_id] INT IDENTITY (1, 1) NOT NULL,
[setup_id] INT NOT NULL,
[run_start] DATETIME2 (7) NULL,
[run_end] DATETIME2 (7) NULL,
[path] NVARCHAR(500) NULL,
[note] NVARCH... |
<gh_stars>100-1000
-- phpMyAdmin SQL Dump
-- version 4.0.10.6
-- http://www.phpmyadmin.net
--
-- ホスト: localhost
-- 生成日時: 2014 年 12 月 03 日 15:53
-- サーバのバージョン: 5.1.73-log
-- PHP のバージョン: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... |
CREATE INDEX object_type_id_idx ON
SELECT * from resources where parent = 0 and name='FileA'
CREATE TABLE logging_event ( timestmp BIGINT NOT NULL, formatted_message TEXT NOT NULL, logger_name VARCHAR(254) NOT NULL, level_string VARCHAR(254) NOT NULL, thread_name VARCHAR(254), reference_flag SMALLINT, arg0 VARCHAR(254... |
/* ==Scripting Parameters==
Source Server Version : SQL Server 2016 (13.0.4001)
Source Database Engine Edition : Microsoft SQL Server Enterprise Edition
Source Database Engine Type : Standalone SQL Server
Target Server Version : SQL Server 2016
Target Database Engine Edition : Microsoft SQL Ser... |
<filename>MarketingDataCapture/MarketingDataCapture.Database/Stored Procedures/Create_Person.sql
-- ============================================================================
-- Author: <NAME>
-- Create Date: 2018-11-23
-- ============================================================================
CREATE PROC... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 18 Des 2018 pada 18.20
-- Versi server: 10.1.35-MariaDB
-- Versi PHP: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
--
-- view
--
create or replace view {SCHEMA}cube_snapchat_campaign as
with date_range as (
select decode(start_date_fixed, null, decode(start_date_offset, null, null, dateadd(day, start_date_offset, current_date)), start_date_fixed) as start_date,
decode(end_date_fixed, null, decode(end_date_offset, null, null, da... |
<filename>src/bin_tps_evaluation/sql/get_all_operations.sql
SELECT
*,
dst.address AS tx_dst_addr,
CASE WHEN dst.address < 't'
AND op_kind = 8 THEN
'contract'
WHEN op_kind = 9 THEN
'origination'
ELSE
'regular'
END AS transaction_kind
FROM ( SELECT DISTINCT ON (c.op... |
<reponame>barenMaulana/online-shop-laravel8
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 16, 2020 at 11:33 PM
-- 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:... |
if exists (select * from INFORMATION_SCHEMA.ROUTINES where ROUTINE_NAME = 'sp$tablename$_Update' and ROUTINE_TYPE = 'PROCEDURE')
Drop Procedure dbo.sp$tablename$_Update;
GO
Create Procedure dbo.sp$tablename$_Update
( @ID uniqueidentifier output
, @MODIFIED_USER_ID ... |
<filename>@api/db/migrations/committed/000202.sql
--! Previous: sha1:8411213d3222cedd79845f9345beb237685be712
--! Hash: sha1:f75281014b06a756e46901d8490e51ed8ba2ca65
--! split: 1-current.sql
-- Enter migration here
drop function app_public.current_user_member_organization_ids() cascade;
|
<reponame>aditya-a-patil/Crypto<filename>JMessage/Web Application/Source/db_init.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS messages (
id INTEGER NOT NULL,
dt TEXT NOT NULL,
message TEXT NOT NULL,
sender TEXT NOT NULL,
recipient TEXT NOT NULL,
readRcpt TEXT
);
|
<reponame>Vasliska1/spring-petclinic
DROP TABLE player IF EXISTS;
DROP TABLE game_result IF EXISTS;
CREATE TABLE player(
id INTEGER IDENTITY PRIMARY KEY,
nickname VARCHAR(30),
registration_date datetime
);
CREATE TABLE game_result(
id INTEGER IDENTI... |
<gh_stars>0
COPY stns.TCABKPT_OVL (PKEY, STATION_ID ,STATION_NUM, NAME, STATE, COUNTRY, LATITUDE, LONGITUDE, PRI ) FROM stdin with delimiter as ',';
1,MTH_RIO,100100,Mouth_of_the_Rio_Grande_River,TX,US,25.96,-97.15,10
2,PT_MANSF,100200,Port_Mansfield,TX,US,26.6,-97.29,10
3,BAFFN_BY,100300,Baffin_Bay,TX,US,27.29,-97.37,... |
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table address (
internal_id bigint not null,
full_street varchar(255),
county varchar(255),
country varchar(255)... |
<reponame>chiclaim/SwingEMS<filename>sql/staff_level.sql
/*
Navicat MySQL Data Transfer
Source Server : admin
Source Server Type : MySQL
Source Server Version : 80021
Source Host : localhost:3306
Source Schema : employee
Target Server Type : MySQL
Target Server Version : 80021
... |
<reponame>yuanweikang2020/canal
CREATE TABLE `tb_sxbbqclsgf` (
`col_avzjcdfkfv` year(4) NOT NULL DEFAULT '2019',
`col_kgfprqgdwt` mediumtext CHARACTER SET latin1,
CONSTRAINT PRIMARY KEY (`col_avzjcdfkfv`),
UNIQUE `col_kgfprqgdwt` (`col_kgfprqgdwt`(6))
) DEFAULT CHARSET=latin1;
CREATE TABLE `tb_uakpdqzysm` (
`... |
create table ODE_SCHEMA_VERSION(VERSION integer);
insert into ODE_SCHEMA_VERSION values (220);
DROP TABLE IF EXISTS ODE_JOB;
CREATE TABLE ODE_JOB (
jobid CHAR(64) NOT NULL DEFAULT '',
ts BIGINT NOT NULL DEFAULT 0,
nodeid varchar(64),
scheduled bit NOT NULL,
transacted bit NOT NULL,
instanceId BIGINT,... |
<gh_stars>1-10
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='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `mydb` ;
-- ------------... |
<reponame>Sandeepchau/MixErp22
IF OBJECT_ID('finance.is_new_day_started') IS NOT NULL
DROP FUNCTION finance.is_new_day_started;
GO
CREATE FUNCTION finance.is_new_day_started(@office_id integer)
RETURNS bit
AS
BEGIN
IF EXISTS
(
SELECT TOP 1 0 FROM finance.day_operation
WHERE fina... |
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
create table ct_airline_booking_vacuum_full_heap_1 (c1 int, c2 char(100)) distributed by (c1);
insert into ct_airline_booking_vacuum_full_heap_1 values (112232, 'xyz');
insert into ct_airline_booking_vacuum_full_heap_1 select generate_... |
ALTER TABLE statuses DROP COLUMN public;
|
<reponame>Zhaojia2019/cubrid-testcases
-- [er]create class and alter it to add -1 precision ncahr varying /float attribute
create class c_nv (it int);
alter class c_nv add attribute nv nchar varying(-1);
create class c_f (it int);
alter class c_f add attribute nf float(-1);
drop class c_nv;
drop class c_f;
|
CREATE TABLE newsletter_newsletter_topic (
newsletter_id integer NOT NULL,
newsletter_topic_id integer NOT NULL,
sort integer NOT NULL,
version integer DEFAULT 1,
created TIMESTAMP DEFAULT current_timestamp,
created_by integer DEFAULT 1,
last_modi... |
-- @testpoint: --array_to_json(anyarray [, pretty_bool])描述:返回JSON类型的数组。一个多维数组成为一个JSON数组的数组。--如果pretty_bool为true,将在一维元素之间添加换行符。返回类型:json
SELECT array_to_json('{{1,5},{99,100}}'::TINYINT[]);
SELECT array_to_json('{{1,5},{99,100}}'::SMALLINT[]);
SELECT array_to_json('{{1,5},{99,100}}'::INTEGER[]);
SELECT array_to_json('{... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 26, 2022 at 01:29 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.4.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
/*
* 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: luiz.barcellos
* Created: 05/12/2017
*/
SELECT b.CODIGO, b.DOC, b.DT_VENC, sum(c.VALOR) as valor
FROM REL_... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.30 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL Version: 9.3.0.4984
-- --------------------------------------------------------
/*... |
create table order_status
(
id number(3) primary key,
name varchar2(50) unique,
description varchar2(512)
);
alter table order_info
add order_status number;
alter table order_info
add constraint fk_order_info_order_status foreign key (order_status) references order_status (id);
al... |
<reponame>CAG9/SQL-Interview-Questions<gh_stars>0
SELECT *
FROM tutorial.billboard_top_100_year_end
WHERE "group" ILIKE 'DJ%';
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 13, 2021 at 10:43 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 8.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
<reponame>chrisputnam9/money
DROP TABLE IF EXISTS transaction_recurring_transaction;
DROP TABLE IF EXISTS transaction_recurring;
CREATE TABLE transaction_recurring (
id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
main_transaction_id int(11) NOT NULL,
date_start DATETIME NULL,
date_end DATETIME NULL,... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 22, 2019 at 05:33 AM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
INSERT INTO Usage_Data(total_ram, used_ram, free_ram, avalabile_space, usage_timestamp, username, operating_system, program_list, system_id)
VALUES (:total_ram, :used_ram, :free_ram, :avalabile_space, :usage_timestamp, :user, :operating_system, :program_list, :system_id);
|
SELECT DISTINCTROW
project.id AS project_id,
project.`name` AS project_name,
subproject.id AS subproject_id,
subproject.`name` AS subproject_name,
examresult.examId,
examresult.userId,
examresult.createDate,
examresult.bci_score AS bci,
examresultdetail.abId,
examresultdetail.score
FROM
project
INNER JOIN s... |
<gh_stars>1-10
-- MySQL dump 10.13 Distrib 5.5.43, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: Siek
-- ------------------------------------------------------
-- Server version 5.5.43-0+deb7u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESU... |
<reponame>axfelix/frdr_harvest
alter table repositories add column repo_oai_name TEXT;
|
CREATE OR REPLACE FUNCTION ti.getsitemetadata(_siteid integer)
RETURNS TABLE(siteid integer, sitename character varying, geog character varying, altitude double precision, area double precision, sitedescription character varying, notes character varying)
LANGUAGE sql
AS $function$
select st.siteid,
... |
<reponame>shekarkola/SQL-ToolBox
/*---------------------------------------------------------------------------------------------------------
Creating XE Events to Audit All UPDATE actions in selected database,
before creatign XE event, change the databas name at [sqlserver].[database_name]
--------------------... |
<filename>sql/procedures/Benchmarks.sql
-- Description: This file contains all benchmark stored procedures for the starexec database
-- The procedures are stored by which table they're related to and roughly alphabetic order. Please try to keep this organized!
-- Adds a benchmark into the system and associates it w... |
<filename>scripts/odbc/microsoft sql/content/database.sql
declare @result nvarchar(max);
select @result =
'<b> <u>' + db.name + '</u></b><br>' +
'<table>' +
'<tr><td><i>state:</i></td><td>' + (db.state_desc COLLATE SQL_Latin1_General_CP1_CI_AS) + '</td></tr>' +
'<tr><td><i>collation:</i></td><td>' + db.collation... |
<reponame>Ed-Fi-Alliance-OSS/Ed-Fi-MigrationUtility<filename>EdFi.Ods.Utilities.Migration/Scripts/MsSql/02Upgrade/v25_to_v31/11 Create Constraints/40270 ClassPeriodMeetingTime [PK, IX, D].sql<gh_stars>0
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi A... |
ALTER TABLE livro ADD CONSTRAINT UC_Person UNIQUE (titulo);
ALTER TABLE livro MODIFY resumo VARCHAR(500);
ALTER TABLE livro MODIFY sumario VARCHAR(500); |
## 查询归档的答案
#macro($find(answerId,content))
SELECT * FROM answer_archive WHERE answer_id = :answerId
#if(content)
AND content = :content
#end
#end
## 删除归档的答案
#macro($delete(answerId,content,result))
DELETE FROM answer_archive WHERE answer_id = :answerId
#if(content)
AND content = :content
#end
#if(result)... |
<filename>test/sql/reindex.sql<gh_stars>1-10
CREATE TABLE reindex_test(time timestamp, temp float);
CREATE UNIQUE INDEX reindex_test_time_unique_idx ON reindex_test(time);
-- create hypertable with three chunks
SELECT create_hypertable('reindex_test', 'time', chunk_time_interval => 2628000000000);
INSERT INTO reindex... |
<gh_stars>1-10
-- create database for the dynamic site
CREATE DATABASE IF NOT EXISTS db;
-- create a new user for the Web app
DELETE FROM mysql.user WHERE User = 'webuser';
CREATE USER 'webuser'@'%' IDENTIFIED BY 'vagrantrocks';
-- grant only the necessary privileges to our new user
GRANT SELECT, INSERT, UPDATE, DELE... |
select s2ToGeo(4573520603753570041);
select s2ToGeo(4573517609713934091);
|
<reponame>orange-cloudfoundry/notification-configurer
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE IF NOT EXISTS `clients` (
`primary` int(11) NOT NULL AUTO_INCREMENT,
`id` varchar(255) DEFAULT NULL,
`description` varchar(255) DEFAULT NULL,
`creat... |
--liquibase formatted sql
--changeset akif.khan:8 runOnChange:false
ALTER TABLE `Events`
DROP PRIMARY KEY,
ADD COLUMN `executionVersion` INT UNSIGNED NOT NULL DEFAULT 0,
ADD PRIMARY KEY(`stateMachineInstanceId`, `name`,`executionVersion`); |
<filename>agrirouter-middleware-application/src/main/resources/db/migration/V1.7__add_tenants_for_security.sql<gh_stars>1-10
create table if not exists tenant
(
id bigint auto_increment primary key,
version datetime(6) not null,
tenant_id varchar(255) not null unique,
name var... |
<filename>src/ratelimit-1.sql<gh_stars>0
CREATE OR REPLACE FUNCTION user_limit( _userid integer, _vault varchar, _requests integer ) RETURNS int AS $$
DECLARE
config user_limits_config%ROWTYPE;
limits user_limits%ROWTYPE;
allowed integer := _requests;
BEGIN
--
-- First get the rate limit configuration
--... |
<filename>src/SFA.DAS.DATA.MANAGEMENT/Tables/SaltKeyLog.sql
-- SaltKeyLog
Go
Create Table [AsData_PL].[SaltKeyLog](
SaltKeyID BigInt PRIMARY KEY,
SaltKey Varbinary(max) DEFAULT CRYPT_GEN_RANDOM(4096),
SourceType Varchar(50)
) ON [PRIMARY]
Go |
-- Companía: Scooters Anywhere
-- Project: Modelo Proyecto Final
-- Author: <NAME> y <NAME>
-- Fecha: 04 de Junio del 2020
SET SERVEROUTPUT ON
SET LINESIZE 200
WHENEVER SQLERROR EXIT ROLLBACK
DECLARE
V_STATUS_V NUMBER:=0;
V_STATUS_R NUMBER:=0;
V_STATUS_B NUMBER:=0;
BEGIN
--TRIGGER PARA VIAJE
INSER... |
source DDL.sql;
source iterate.sql;
source realProf.sql;
source realMod.sql;
source realSup.sql;
source realuser.sql;
source CS4344.sql;
source project.sql;
source participate.sql;
source enrolled.sql;
source admin.sql;
|
<filename>scripts/sql queries/students of professor.sql
/* Which students does Professor with given name have, in current semester?
Outputs the student's and the corresponding course's information. Duplicates of students means
the student takes multiple courses with the same professor.
*/
select c.CourseId, c... |
/******************************************************************************/
/*** Generated by IBExpert 2.5.0.22 07/03/2003 18:57:49 ***/
/******************************************************************************/
/*************************************************************************... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 26, 2020 at 02:21 PM
-- Server version: 10.1.37-MariaDB
-- 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... |
<gh_stars>0
CREATE TABLE [dbo].[Customers] (
[ID] INT IDENTITY (1, 1) NOT FOR REPLICATION NOT NULL,
[Name] CHAR (100) NOT NULL,
[Adress] CHAR (255) NULL,
[ZIP] CHAR (100) NULL,
[Phone] CHAR (100) NULL,
[Fax] ... |
-- Using IN & NOT IN
-- IN & NOT IN are used to check if a value matches or not matches in a list
-- returns true or false
-- syntax: value IN (value1, value2, .....), where value can be he column/field
-- syntax: value NOT IN (value1, value2, .....), where value can be he column/field
-- IN will return true if valu... |
<filename>application/basisdata/carfreeday.sql
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 16, 2017 at 08:22 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!401... |
WAITFOR DELAY '00:00:03'
CREATE LOGIN AppLogin WITH PASSWORD = '<PASSWORD>!'
GO
DROP USER IF EXISTS AppUser
CREATE USER AppUser FROM LOGIN AppLogin
GO
DROP ROLE IF EXISTS AppUserRole
CREATE ROLE AppUserRole
GO
GRANT SELECT, INSERT, UPDATE, DELETE, EXECUTE TO AppUserRole
EXEC sp_addrolemember N'AppUserRole', N'AppUs... |
ALTER TABLE media
DROP COLUMN user_id;
-- This file should undo anything in `up.sql`
|
/* $PostgreSQL: pgsql/contrib/dict_xsyn/uninstall_dict_xsyn.sql,v 1.3 2007/11/13 04:24:27 momjian Exp $ */
-- Adjust this setting to control where the objects get dropped.
SET search_path = public;
DROP TEXT SEARCH DICTIONARY xsyn;
DROP TEXT SEARCH TEMPLATE xsyn_template;
DROP FUNCTION dxsyn_init(internal);
DROP F... |
<gh_stars>1-10
#Attendance rate function
DROP FUNCTION IF EXISTS getStudentLectureAttendanceRate;
DELIMITER $$
CREATE FUNCTION getStudentLectureAttendanceRate(
arg_student_id INT,
arg_course_id INT
)
RETURNS INT
DETERMINISTIC
BEGIN
DECLARE studentLectureAttendanceRate INT;
DECLARE amountOfAttendances INT;
DECLA... |
ALTER TABLE EGDU_UPLOADREGISTRY ADD COLUMN REASON_FOR_FAILURE character varying; |
CREATE TABLE vendors
(
id int identity(1, 1),
vendor_name varchar(255) default('Undefined'),
constraint PK_vendors primary key (id)
)
CREATE TABLE products
(
id int identity(1, 1),
product_description varchar(4000) not null,
price float default(0),
rating varchar(255) default('0+'),
title varchar(255) default... |
<filename>src/test/resources/sql/drop_conversion/45e22710.sql
-- file:drop_if_exists.sql ln:119 expect:true
DROP CONVERSION test_conversion_exists
|
<gh_stars>0
UPDATE Character SET head_slot = NULL, chest_slot=NULL, hands_slot=NULL,
legs_slot=NULL, feet_slot=NULL, fingerl_slot=NULL, fingerr_slot=NULL, melee_slot=NULL,
primary_slot=NULL, secondary_slot=NULL, custom1_slot=NULL, custom2_slot=NULL
DELETE FROM CharacterITEM
DELETE FROM Character
DELETE FROM ITEM |
-- for each species scenario, merge all definite barriers into single table
-- (for visualization and for easier processing when dealing with observations upstream)
-- steelhead barriers (20% scenario)
DROP TABLE IF EXISTS bcfishpass.definitebarriers_steelhead;
CREATE TABLE bcfishpass.definitebarriers_steelhead... |
<gh_stars>1-10
ALTER TABLE GROUP_MEMBER ADD COLUMN MANAGER BOOLEAN DEFAULT FALSE;
CREATE TABLE SSH_KEY (
USER_NAME VARCHAR(100) NOT NULL,
SSH_KEY_ID INT AUTO_INCREMENT,
TITLE VARCHAR(100) NOT NULL,
PUBLIC_KEY TEXT NOT NULL
);
ALTER TABLE SSH_KEY ADD CONSTRAINT IDX_SSH_KEY_PK PRIMARY KEY (USER_NAME, SSH_KEY_ID... |
<filename>latchprof.sql
-- 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.
--------------------------------------------------------------------------------
--
-- File name: latchprof.sql ( Latch ... |
\set VERBOSITY terse
SET client_encoding = utf8;
--
-- test type modifier related rules
--
-- ERROR (typmod >= 1)
CREATE TABLE foo (a VARCHAR2(0));
-- ERROR (number of typmods = 1)
CREATE TABLE foo (a VARCHAR2(10, 1));
-- OK
CREATE TABLE foo (a VARCHAR(5000));
-- cleanup
DROP TABLE foo;
-- OK
CREATE TABLE foo (a ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.