sql stringlengths 6 1.05M |
|---|
<gh_stars>10-100
/*
* NOTES:
*
* If sell_amount=-1, it is a sell order, and
* - the fixed sell amount provided is output_amounts[0]
* - the minimum buy amount asked is buy_amount
*
* If buy_amount=-1, it is a buy order, and
* - the fixed buy amount provided is output_amounts[last]
* - the maximum sell ... |
db.Execute("INSERT INTO Data (Name) VALUES ('Smith')");
var id = db.GetLastInsertId(); |
ALTER TABLE sm_minute add calcVWC30_Avg real;
ALTER TABLE sm_minute add calcVWC30_Avg_qc real;
ALTER TABLE sm_minute add calcVWC30_Avg_f char(1);
ALTER TABLE sm_minute add calcVWC40_Avg real;
ALTER TABLE sm_minute add calcVWC40_Avg_qc real;
ALTER TABLE sm_minute add calcVWC40_Avg_f char(1);
ALTER TABLE sm_minute add ... |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
-- Ensure the created audit columns are not changed.
-- Ensure the updated timestamp is updated.
CREATE OR REPLACE FUNCTION updateAudit()
RETURNS TRIGGER AS $$
BEGIN
IF (TG_OP = 'UPDATE') THEN
NEW."createdOn" = OLD."createdOn";
NEW."createdById" = OLD."cr... |
DROP TABLE IF EXISTS user_authority;
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS authority;
DROP TABLE IF EXISTS oauth_access_token;
DROP TABLE IF EXISTS oauth_refresh_token;
DROP TABLE IF EXISTS oauth_client_details;
DROP TABLE IF EXISTS role;
DROP TABLE IF EXISTS user_role;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS... |
alter table widget add column version bigint not null; |
-- SELECT DropGeometryColumn('samplepgpoint', 'geom');
-- DROP TABLE samplepgpoint;
-- CREATE TABLE samplepgpoint
-- (
-- samplepgpoint_id int8 NOT NULL,
-- id int8 NOT NULL,
-- name varchar(255),
-- CONSTRAINT samplepgpoint_pkey PRIMARY KEY (samplepgpoint_id)
-- )
-- WITHOUT OIDS;
-- SELECT AddGeometryColumn(... |
#standardSQL
WITH
period AS (
SELECT *
FROM `githubarchive.month.201801` a # what period of time being queried
),
repo_stars AS (
SELECT repo.id, COUNT(DISTINCT actor.login) stars, APPROX_TOP_COUNT(repo.name, 1)[OFFSET(0)].value repo_name
FROM period
WHERE type='WatchEvent'
GROUP BY 1
HAVING stars > 0 # ... |
<reponame>angujo/ETL-CDMBuilder<gh_stars>10-100
{base},
Standard as (
SELECT distinct SOURCE_CODE, 1 as TARGET_CONCEPT_ID, TARGET_DOMAIN_ID, SOURCE_VALID_START_DATE, SOURCE_VALID_END_DATE
FROM Source_to_Standard
WHERE lower(SOURCE_VOCABULARY_ID) IN ('drg')
AND lower(TARGET_VOCABULARY_ID) IN ('drg')
AND (TARGET_STANDAR... |
-- Deploy merge_change
-- requires: changes
-- requires: changesets
-- This function records a merge SHA for the given change.
-- Returns the updated change record.
BEGIN;
DROP FUNCTION IF EXISTS merge_change(
p_change_id changes.id%TYPE,
p_merge_sha changes.merge_sha%TYPE,
p_approver changes.approved_by%TYPE
... |
ALTER TABLE `selfservice_settings_flows` ADD COLUMN `internal_context` JSON; |
<reponame>ualisonaguiar/ordem-servico-datainfo
update tb_ordem_servico set tp_situacao = 2 where nu_ordem_servico in (1181,
1182,
1183,
1187,
1188,
1189,
1191,
1192,
1171,
1179,
1193,
1195,
1196,
1197);
|
<reponame>EmmanuelRoss/CHMIX6_tutu_backend
INSERT INTO `databaseTutu`.`detalle_pedido` (`precio`, `cantidad`, `productos_idproductos`, `pedido_idpedido`) VALUES (699,1,1,1);
INSERT INTO `databaseTutu`.`detalle_pedido` (`precio`, `cantidad`, `productos_idproductos`, `pedido_idpedido`) VALUES (499,1,2,2);
INSERT INTO `da... |
<filename>BaseDatosSQL/create.sql<gh_stars>0
CREATE TABLE State(
stateId INT NOT NULL AUTO_INCREMENT,
name VARCHAR(40) NOT NULL,
PRIMARY KEY (stateId)
);
CREATE TABLE Grade(
gradeId INT NOT NULL AUTO_INCREMENT,
grade VARCHAR(40) NOT NULL,
PRIMARY KEY(gradeId)
);
CREATE TABLE Child(
CURP VARCHAR(18) NOT NULL,
... |
<reponame>hadistlm/KasmaranPHP
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 02 Apr 2017 pada 05.58
-- Versi Server: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... |
ALTER TABLE `settings` ADD `soft_delete` INT NOT NULL DEFAULT '0' AFTER `decimals_sep`; |
Use M_SSolve;
Select * from Comodos;
Select * from Objetos;
Select * from TipoServico;
Select * from Clientes;
Select * from Funcionarios;
Select * from Servicos;
Select * from ServicoFuncionario;
Select SF.*, S.*, F.*
from ServicoFuncionario SF
join Servicos S
ON SF.IdServico = S.IdServico
join Funcionarios F
ON SF.... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 20-03-2018 a las 03:00:31
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.4
-- Dumped by pg_dump version 13.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', fal... |
SELECT 02-02-2022 from casos_confirmados; |
<reponame>precog-iiitd/Signals_Matter_TheWebConf_2019
SELECT u.id, count(q.id) as num_questions from [bigquery-public-data:stackoverflow.posts_questions] q JOIN [bigquery-public-data:stackoverflow.users] u
on q.owner_user_id=u.id group by u.id;
|
CREATE TABLE [dbo].[sql_perf_mon_wait_stats]
(
[wait_type] nvarchar(60) not null,
[waiting_tasks_count] bigint not null,
[wait_time_ms] bigint not null,
[max_wait_time_ms] bigint not null,
[signal_wait_time_ms] bigint not null,
[snapshot_time] datetime not null,
[snapshot_type_id] tinyint not null default 1 ,
... |
<filename>migrations/2020-02-26-101456_remove_blocks_table/up.sql
ALTER TABLE transactions DROP CONSTRAINT transactions_block_num_fkey;
DROP TABLE blocks;
|
-- v_sa_virta_otp_opintopisteet_kuukausittain näkymä faktatauluun f_virta_otp_opintopisteet_kuukausittain
USE ANTERO
GO
IF NOT EXISTS ( SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'dw.v_sa_virta_otp_opintopisteet_kuukausittain') )
EXEC dbo.sp_executesql @statement = N'CREATE VIEW dw.v_sa_virta_otp_opintopi... |
<reponame>TrainingByPackt/MySQL
USE ms_access_migration;
DROP PROCEDURE IF EXISTS spCTSource_par;
DELIMITER //
CREATE PROCEDURE spCTSource_par
(
IN TableName VARCHAR(25),
IN TheSeries VARCHAR(25),
IN TheGroup VARCHAR(25),
IN TheCountry VARCHAR(100),
IN StartYear VARCHAR(20),
IN EndYear VARCHAR(20)
)
BEGIN
S... |
<gh_stars>10-100
-- file:identity.sql ln:62 expect:true
SELECT * FROM itest3
|
<gh_stars>10-100
-- file:jsonb.sql ln:293 expect:true
SELECT jsonb '{"a":null, "b":"qq"}' ?& ARRAY['a','a', 'b', 'b', 'b']
|
# Discounts
ALTER TABLE `ip_quotes`
ADD COLUMN `quote_discount_amount` DECIMAL(20, 2) NOT NULL DEFAULT 0
AFTER `quote_number`,
ADD COLUMN `quote_discount_percent` DECIMAL(20, 2) NOT NULL DEFAULT 0
AFTER `quote_discount_amount`;
ALTER TABLE `ip_quote_item_amounts`
ADD COLUMN `item_discount` DECIMAL(20, 2) NOT... |
DROP VIEW IF EXISTS C_Commission_Overview_V
;
CREATE OR REPLACE VIEW C_Commission_Overview_V AS
SELECT
-- Make sure that every view record has a unique and stable ID
CASE
WHEN ila_settlement.C_Invoice_Line_Alloc_ID IS NOT NULL THEN (ila_settlement.C_Invoice_Line_Alloc_ID * 10) + 1
WHEN ic_settl... |
insert into positions(person, organization, title, start_date, start_date_precision, end_date, end_date_precision, urls, notes, ai_safety_relation, subject, employment_type, cause_area) values
('<NAME>','Future of Humanity Institute','Senior Research Fellow',NULL,NULL,NULL,NULL,'https://intelligence.org/files/Softw... |
<filename>DatabaseUsage/Work 3/10.sql
/*
No results
All orders in send state (5)
*/
SELECT
FirstName,
LastName,
Phone
FROM Person.Contact as Contact
/* get first name, last name and phone of customer */
INNER JOIN Sales.SalesOrderHeader as SalesOrderHeader
ON Contact.ContactID = SalesOrderHeader.Cont... |
<filename>simple-auth-server/migrations/2018-10-09-101948_users/up.sql
-- Your SQL goes here
CREATE TABLE users (
email VARCHAR(100) NOT NULL UNIQUE PRIMARY KEY,
hash VARCHAR(122) NOT NULL, --argon hash
created_at TIMESTAMP NOT NULL
);
|
<reponame>shiliubei/spring_security<filename>src/main/resources/base.sql
INSERT INTO users VALUES (1, 'admin', <PASSWORD>');
INSERT INTO roles VALUES (1,'ROLE_ADMIN');
INSERT INTO roles VALUES (2,'ROLE_USER');
INSERT INTO user_roles VALUES (1, 1); |
UPDATE userroles SET name='Super-Admin', description='Can sign in as any user. In shared mode, manages corporate accounts' WHERE id=1;
UPDATE userroles SET name='Admin', description='Full access to the control panel' WHERE id=2;
UPDATE userroles SET name='User', description='Limited access to the control panel' WHERE i... |
<filename>EdFi.Ods.Utilities.Migration/Scripts/MsSql/02Upgrade/v24_to_v25/11 Create Constraints/42310 LimitedEnglishProficiencyType [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 Alliance licenses this file to you under the ... |
update web_page
set
type_edits = :typeEdits,
path_edits = :pathEdits,
title_edits = :titleEdits,
description_edits = :descriptionEdits,
content_edits = :contentEdits,
parameters_edits = :parametersEdits,
modify_date = now(),
web_page_template_id_edits = :webPageTemplateIdEdits
where web_page_id = :webPa... |
<reponame>KenWoo/Algorithm
select b.Id from Weather a, Weather b
where b.Recorddate = dateadd(day,1,a.recorddate)
and a.temperature < b.temperature |
<gh_stars>1-10
CREATE TABLE manager_address (
"name" STRING NULL,
address STRING NULL,
abi STRING NULL,
FAMILY "primary" ("name", address, abi, rowid)
);
|
-- Deploy ggircs-portal:table_emission_category_gas to pg
-- requires: schema_ggircs_portal
begin;
create table ggircs_portal.emission_category_gas (
id integer primary key generated always as identity,
emission_category_id integer references ggircs_portal.emission_category(id),
emission_category_description va... |
drop table Simples;
create table Simples
(
ID int4 not null,
Name varchar(64) NULL,
Address varchar(64) NULL,
Count int4 NULL,
Date timestamp NULL,
Pay numeric(18,2) NULL,
CONSTRAINT PK_Simples PRIMARY KEY (ID)
) WITHOUT OIDS;
ALTER TABLE Simples OWNER TO "IBatisNet"; |
<reponame>caixiazhao/hive-release-local<gh_stars>1-10
SELECT 'Upgrading MetaStore schema from 1.2.0 to 1.2.1000' AS MESSAGE;
:r 008-HIVE-12807.mssql.sql
:r 009-HIVE-12814.mssql.sql
:r 010-HIVE-12816.mssql.sql
:r 011-HIVE-12818.mssql.sql
:r 012-HIVE-12819.mssql.sql
:r 013-HIVE-12821.mssql.sql
:r 014-HIVE-12822.mssql.s... |
<filename>hasura/migrations/1630600475646_alter_table_public_zones_stats_alter_column_total_active_addresses_mainnet_rating_diff/up.sql
ALTER TABLE "public"."zones_stats" ALTER COLUMN "total_active_addresses_mainnet_rating_diff" DROP NOT NULL;
|
<reponame>decibel/pg_ndarray<gh_stars>1-10
\set ECHO none
\i test/pgxntool/setup.sql
CREATE TEMP TABLE test_cast(
input text
, test_type regtype
, element_out text
, array_out text
);
INSERT INTO test_cast VALUES
('{t,f,t}', 'boolean[]', 'True', '[ True False True]' )
, ('{1,2,3}', 'smallint[]', '1... |
<reponame>Zhaojia2019/cubrid-testcases
set timezone 'Asia/Seoul';
drop table if exists t1;
create table t1 (id int, dtltz DATETIME WITH LOCAL TIME ZONE);
INSERT INTO t1 VALUES(1, datetimeltz '2003-01-03 2:00:00 +9:00');
INSERT INTO t1 VALUES(2, datetimeltz '2003-01-02 2:00:00 +9:00');
INSERT INTO t1 VALUES(3, datetime... |
<gh_stars>100-1000
---RETURN---
SET CHECK_FUNCTION_BODIES TO ON;
--default return out arg. not supported in A db
CREATE OR REPLACE FUNCTION test_return( i in integer, j out integer)
RETURN integer
AS
BEGIN
j:=i+1;
RETURN;
END;
/
SELECT test_return(1);
declare
a int := 1;
b int;
begin
test_return(a, b);
en... |
<reponame>CesarFerGuz/plataforma
#Insertar usuarios
INSERT INTO table_ciudades VALUES(1,'<NAME>');
INSERT INTO table_ciudades VALUES(2,'<NAME>');
#Insertar campus
INSERT INTO table_campus VALUES('VEGA',1);
INSERT INTO table_campus VALUES('MARTINEZ',2);
#Insertar periodos
INSERT INTO table_periodos VALUES(1,STR_TO_DAT... |
<reponame>pedro-octavio/THEBooks<gh_stars>0
CREATE TABLE [BookCollection] (
[Id] VARCHAR(10) NOT NULL PRIMARY KEY,
[Name] VARCHAR(50) NOT NULL,
[ReleaseDate] DATE NOT NULL,
[Genre1Id] VARCHAR(10),
[Genre2Id] VARCHAR(10),
[Synopsis] VARCHAR(590) NOT NULL
)
|
<reponame>droideparanoico/albumcatalog<filename>src/main/resources/data.sql
create table if not exists artist(id bigint auto_increment primary key, name VARCHAR(250) NOT NULL, created_on DATE default CURRENT_TIMESTAMP );
create table if not exists album(id bigint auto_increment PRIMARY KEY, album_id bigint NOT NULL, na... |
DROP TABLE user_event;
DROP TABLE user_team;
DROP TABLE events;
DROP TABLE tasks;
DROP TABLE teams;
DROP TABLE users;
CREATE TABLE users(
user_id NUMBER(10) PRIMARY KEY,
name VARCHAR(20) NOT NULL UNIQUE,
password VARCHAR(20) NOT NULL,
email VARCHAR(30) CHECK ( REGEXP_LIKE(email, '.*@.*') )
);
CREATE TABLE teams(
team... |
CREATE FUNCTION carallowed(highway character varying, attrs public.hstore) RETURNS boolean
LANGUAGE plpgsql
AS $$
/*Common function for working out if a car is allowed on a stretch of the network
*/
DECLARE
highwayAllowed boolean := false;
carAttrAllowed boolean := false;
motorcarAttrAllowed boolean := false;
B... |
-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: cventa
-- ------------------------------------------------------
-- Server version 5.7.21-1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
<filename>notes.sql
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 26-Abr-2018 às 03:04
-- Versão do servidor: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... |
-- *********************************************
-- * SQL MySQL generation
-- *--------------------------------------------
-- * DB-MAIN version: 11.0.1
-- * Generator date: Dec 4 2018
-- * Generation date: Tue Nov 12 11:58:44 2019
-- * Schema: MLD
-- ***************... |
-- =============================================
-- Author: <NAME>
-- Project: Clinica
-- Create date: 10/10/2013
-- Description: Stored Procedure que atualiza um registro da tabela Logradouro
-- =============================================
IF EXISTS
(
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE
SPECI... |
prompt --application/shared_components/user_interface/lovs/lov_excel_sheets
begin
-- Manifest
-- LOV_EXCEL_SHEETS
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.10.01'
,p_release=>'20.2.0.00.20'
,p_default_workspace_id=>2601326064169245
,p_default_application_id=>138
,p_default_id_o... |
CREATE FUNCTION f_obj_execute_node_select(in_id_model bigint, in_id_object text, in_arr_val text, in_mode bigint) RETURNS bigint
LANGUAGE plpgsql SECURITY DEFINER
AS $$
DECLARE
v_ret bigint;
BEGIN
RETURN v_ret + 1;
END;
$$; |
-- file:plpgsql.sql ln:293 expect:false
if tg_op = ''DELETE'' then
dummy := tg_hub_adjustslots(old.name, old.nslots, 0)
|
<filename>sql/updates/0.14/8487_01_mangos_spell_bonus_data.sql
ALTER TABLE db_version CHANGE COLUMN required_8482_01_mangos_spell_elixir required_8487_01_mangos_spell_bonus_data bit;
DELETE FROM `spell_bonus_data` where entry in (20424, 20467, 42463, 53739, 31803, 53742, 31804, 53733, 31893, 32221, 32220, 31898, 53719... |
<reponame>hwxiasn/archetypes
insert into bank_type(name, code, qdd_code) values ('中国农业银行', 'ABC', '3');
insert into bank_type(name, code, qdd_code) values ('中国银行', 'BOC', '1');
insert into bank_type(name, code, qdd_code) values ('交通银行', 'COMM', '4');
insert into bank_type(name, code, qdd_code) values ('中国建设银行', 'CCB... |
<reponame>Amardeep11123/MyShop<filename>myshop.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 17, 2018 at 12:41 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.0.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;... |
-- MySQL Workbench Synchronization
-- Generated: 2016-07-01 09:33
-- Model: New Model
-- Version: 1.0
-- Project: Name of the project
-- Author: Fredy
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=... |
<filename>data.sql
INSERT INTO compose (compose_id, location, status) VALUES ('Fedora-Docker-25-20170724.0', 'http://kojipkgs.fedoraproject.org/compose/Fedora-Docker-25-20170724.0/compose', 'FINISHED');
INSERT INTO compose (compose_id, location, status) VALUES ('Fedora-Cloud-24-20170724.0', 'http://kojipkgs.fedoraproje... |
<reponame>zionyun/cubrid-testcases<filename>sql/_23_apricot_qa/_01_sql_extension3/_04_mutitable_update_delete/_02_multi_table_delete/_01_delete_from_syntax/cases/multi_delete_trigger_002.sql<gh_stars>1-10
--TEST: delete from 2 tables with trigger in autocommit off mode
--TEST: 1 trigger for each table
--TEST: trigger a... |
-- Your SQL goes here
CREATE TABLE messages (
id bigserial PRIMARY KEY,
message text NOT NULL
);
|
CREATE TABLE `location_on_satellite_header_data`
(
`Satellite` varchar(20) NOT NULL,
`LocationID` varchar(20) NOT NULL,
`LocationName` varchar(20) DEFAULT NULL,
`XCoordinateOfCenter` varchar(20) DEFAULT NULL,
`YCoordinateOfCenter` var... |
alter table obo_professional_info modify column prc_placeissued varchar(50) null;
|
<filename>samples/Solitons.Samples.Database/Scripts/PostDeployment/script000-postdeployment.sql
REFRESH MATERIALIZED VIEW CONCURRENTLY system.mvw_function; |
<reponame>iaueos/lang
-- Find Locked Object
SELECT L.request_session_id AS SPID,
DB_NAME(L.resource_database_id) AS DatabaseName,
O.Name AS LockedObjectName,
P.object_id AS LockedObjectId,
L.resource_type AS LockedResource,
L.request_mode AS LockType,
ST.text AS Sql... |
rem
rem Header: oe_drop.sql 09-jan-01
rem
rem Copyright (c) 2001, 2015, Oracle Corporation. All rights reserved.
rem
rem Permission is hereby granted, free of charge, to any person obtaining
rem a copy of this software and associated documentation files (the
rem "Software"), to deal in the Software without restrict... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 11, 2020 at 02:09 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 06, 2021 at 04:42 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<reponame>commular/commular-bb-generate
alter table TB_WORK_PACKAGES
add SCHEDULED_DATE timestamp null default null;
alter table TB_PUBLISHING_JOBS
add PUBLISH_REQUEST_ID bigint;
create index IDX_PJS_PR_ID ON TB_PUBLISHING_JOBS (PUBLISH_REQUEST_ID);
alter table TB_PUBLISHING_JOBS
add constraint FK_PJS_PRS... |
<gh_stars>0
/*
Warnings:
- You are about to drop the column `isRunning` on the `jobs` table. All the data in the column will be lost.
- You are about to drop the `servidores_emails` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE `dataemail` DROP FOREIGN... |
<filename>migrations/structures/2017/01/2017-01-31-090810-initial.sql
CREATE TABLE public.weather_stations_records (
id UUID PRIMARY KEY NOT NULL, -- (DC2Type:WeatherStationRecordId)
weather_station_id UUID NOT NULL, -- (DC2Type:WeatherStationId)
pressure_absolute INT NOT NULL,
pressure_relative INT NOT NULL
);
COM... |
<gh_stars>1-10
CREATE OR REPLACE VIEW VIEW_JC_LANC_INCL_DUPLIC AS
SELECT L.CODFILIAL,
L.RECNUM,
L.VPAGO,
(CASE
WHEN L.VPAGO < 0 THEN
NVL(L.VPAGO, 0) * -1
ELSE
L.VPAGO
END) AS VALOR, --TRANSFORMAR OS VALORES NEGATIVOS PARA ARQUIVO CONTABILIDADE
C.C... |
<reponame>conradoqg/cvmFundExploration
DROP MATERIALIZED VIEW running_days_with_indicators;
CREATE MATERIALIZED VIEW running_days_with_indicators AS
SELECT
running_days.DT_COMPTC,
fbcdata_sgs_1i.data as dolar_data, fbcdata_sgs_1i.valor as dolar_valor,
yahoo_data.date as bovespa_data, yahoo_data.close as bovespa_v... |
/**
* Create a select statement without using the BETWEEN keyword
*/
SELECT * FROM mydb.orders
WHERE
created_at >= '2015-09-08 14:48:00'
AND
created_at <= '2016-09-08 15:34:00';
/**
* Create a select statement using the BETWEEN keyword
*/
SELECT * FROM mydb.orders
WHERE created_at
BETWEEN
'2015-01-01 00:00:00'
AND... |
CREATE PROCEDURE [employer_financial].[GetPaymentFundsOut]
@AccountId bigint
AS
SELECT periodEnd.CalendarPeriodMonth AS CalendarPeriodMonth,
periodEnd.CalendarPeriodYear AS CalendarPeriodYear,
SUM(transactionLine.[Amount]) AS FundsOut
FROM [employer_financial].[TransactionLine] transactionLine
INNER JOIN [emp... |
<gh_stars>10-100
-- file:insert.sql ln:269 expect:true
alter table mlparted5 attach partition mlparted5a for values in ('a')
|
<filename>src/main/sql/schema.sql
-- 数据库初始化脚本
-- 创建数据库
CREATE DATABASE seckill;
-- 使用数据库
USE seckill;
-- 创建秒杀库存表
CREATE TABLE seckill(
`seckill_id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '商品库存id',
`name` VARCHAR(120) NOT NULL COMMENT '商品名称',
`number` INT NOT NULL COMMENT '库存数量',
`start_time` TIMESTAMP NOT NULL CO... |
<filename>Database/World/Setup/FullDB/disenchant_loot_template.sql<gh_stars>0
-- ----------------------------------------
-- -- CLEAR DOWN THE TABLE --
-- ----------------------------------------
TRUNCATE TABLE `disenchant_loot_template`;
-- ----------------------------------------
-- MySQL dump 10.1... |
--
-- acs-kernel/sql/community-core-create.sql
--
-- Abstractions fundamental to any online community (or information
-- system, in general), derived in large part from the ACS 3.x
-- community-core data model by <NAME> (<EMAIL>), from
-- the ACS 3.x user-groups data model by <NAME> (<EMAIL>)
-- from Chapter 3 (The Ent... |
CREATE TABLE posts (
id STRING(36),
message STRING(1024),
url STRING(2048),
created_at TIMESTAMP OPTIONS (allow_commit_timestamp=true),
updated_at TIMESTAMP OPTIONS (allow_commit_timestamp=true)
) PRIMARY KEY (id)
|
select count(1) from certificacion where nombre = :nombre and detalle = :detalle |
## 更新文件状态
#macro($updateFileStatus(id,status,updateAt))
UPDATE file SET status = :status,update_at = :updateAt WHERE id = :id
#end
## 更新文件状态
#macro($updateFilesStatus(ids,status,updateAt))
UPDATE file SET status = :status,update_at = :updateAt WHERE id IN :ids
#end
## 通过MD5值获取某个空间里面的文件
#macro($findByMd5(... |
<reponame>alttch/roboger
SELECT subscription.id AS id,
addr.id AS addr_id,
endpoint_id,
subscription.active AS active,
location,
tag,
sender,
level,
level_match
FROM subscription
JOIN endpoint ON endpoint.id=subscription.endpoint_id
JOIN addr ON addr.id=endpoint.a... |
/*
===========================================================================
TEMPORARY GRAPH LIST - CAN BE USED TO CLEAR DATABASE
===========================================================================
*/
CREATE TABLE DB.ODCLEANSTORE.TEMPORARY_GRAPHS
(
graphName NVARCHAR(255) NOT N... |
<reponame>jankytara2/dbt<filename>test/integration/069_build_test/tests-failing/model_0.sql
{{ config(materialized='table') }}
select * from {{ ref('countries') }} |
/* ##################################################
TEST DATASET: PHENOPACKETS
################################################## */
/*
An open dataset of 384 phenopackets acts as our test dataset. We must
first load up the dev database with these objects. First create a root
dataset DRS object, w... |
<gh_stars>1-10
INVALID TEST
-- Liquibase has a bug for this changeSet (records are inserted in cases where they should be updated)
-- https://github.com/liquibase/liquibase/issues/2023 |
CREATE DATABASE IF NOT EXISTS QUERY_NUMERIC_PARAMS_DB;
USE QUERY_NUMERIC_PARAMS_DB;
DROP TABLE IF EXISTS NumericTypes;
CREATE TABLE NumericTypes (
ID INT AUTO_INCREMENT,
INT_TYPE INT NOT NULL,
BIGINT_TYPE BIGINT NOT NULL,
SMALLINT_TYPE SMALLINT NOT NULL ,
TINYINT_TYPE TINYINT NOT NULL ,
BIT_TYPE BI... |
<filename>regress/sql/cypher_delete.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 licenses this file
* to you under the Apache Licen... |
<gh_stars>1-10
create or replace function static.objective_get_max_obj_index(p_quest_id static.quest.quest_id%TYPE)
returns numeric AS $$
declare
v_max_obj_index numeric;
begin
SELECT max(obj_index)
into v_max_obj_index
FROM static.objective
WHERE quest_id = p_quest_id;
return v_max_obj_index;
end; $$
langu... |
CREATE OR REPLACE VIEW cv_term_vw AS
SELECT cv.name AS cv
,cvt.id AS id
,cvt.name AS cv_term
,cvt.definition AS definition
,cvt.display_name AS display_name
,cvt.data_type AS data_type
,cvt.is_current AS is_current
,cvt.create_date AS create_... |
CREATE OR REPLACE FUNCTION cartodb.cdb_extension_reload() RETURNS void
AS $$
DECLARE
ver TEXT;
sql TEXT;
BEGIN
ver := split_part(cartodb.cdb_version(), ' ', 1);
sql := 'ALTER EXTENSION cartodb UPDATE TO ''' || ver || 'next''';
EXECUTE sql;
sql := 'ALTER EXTENSION cartodb UPDATE TO ''' || ver || '''';
EXEC... |
<reponame>rafaelssilva35/Escola
CREATE TABLE gestor
(
id_gestor serial NOT NULL PRIMARY KEY ,
codigo_imovel real,
tipo_eleito character varying(40),
cargo character varying(50),
situacao_cargo character varying(30),
matricula character varying(30),
nome character varying(100),
cpf character varying(15),... |
-- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64)
--
-- Host: localhost Database: laravel-shop
-- ------------------------------------------------------
-- Server version 5.7.22-0ubuntu18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 23, 2019 at 10:46 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
SELECT acc.location, count(*)
FROM
site as s,
so_user as u1,
question as q1,
answer as a1,
tag as t1,
tag_question as tq1,
badge as b,
account as acc
WHERE
s.site_id = q1.site_id
AND s.site_id = u1.site_id
AND s.site_id = a1.site_id
AND s.site_id = t1.site_id
AND s.site_id = tq1.site_id
AND s.site_id = b.site_id
AND q1... |
<reponame>teklynk/elements
-- MySQL dump 10.13 Distrib 5.7.33, for Linux (x86_64)
--
-- Host: localhost Database: elements
-- ------------------------------------------------------
-- Server version 5.7.33-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.