sql stringlengths 6 1.05M |
|---|
<filename>db_eprekursor.sql
-- MySQL dump 10.13 Distrib 5.7.20, for Linux (x86_64)
--
-- Host: localhost Database: db_eprekursor
-- ------------------------------------------------------
-- Server version 5.7.20-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CH... |
CREATE TABLE [dbo].[Employee] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[ScheduleId] INT NOT NULL,
[RoleId] INT NOT NULL,
[BranchId] INT NOT NULL,
[StartDate] DATE NOT NULL,
CONSTRAINT [Pk_Employee] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [fkEmployee_Branch_Id] FOREIGN KE... |
<reponame>BartoszKoscielniak/Crypto-Exchange-Website
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.31.10
-- Generation Time: Jun 10, 2021 at 12:39 PM
-- Server version: 8.0.23
-- PHP Version: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "... |
ALTER TABLE Vendors ADD vend_phone CHAR(20);
ALTER TABLE Vendors MODIFY vend_phone CHAR(40);
ALTER TABLE Vendors DROP COLUMN vend_phone;
-- index
ALTER TABLE Customers ADD PRIMARY KEY (cust_id);
ALTER TABLE foo_index ADD INDEX `idx_b_a` (`b`, `a`);
ALTER TABLE foo_index ADD INDEX `idx_b` (`b`);
ALTER TABLE foo_index ... |
<gh_stars>0
SELECT SUM([Difference]) FROM (SELECT FirstName AS [Host Wizard],
DepositAmount AS [Host Wizard Deposit],
LEAD(FirstName) OVER(ORDER BY Id) AS [Guest Wizard],
LEAD(DepositAmount) OVER(ORDER BY Id) AS [Guest Wizard Deposit],
DepositAmount - LEAD(DepositAmount) OVER(ORDER BY Id) AS [Differe... |
<filename>Snakes and Ladder/Procedure 8. List All Online Players with High Score.sql
USE SnakesAndLadder;
drop procedure if exists ListAllOnlinePlayers;
DELIMITER //
Create procedure ListAllOnlinePlayers (pStatus varchar(10))
BEGIN
START TRANSACTION;
Select AccountStatus from Account
where AccountStatus = pStatus;
... |
<reponame>j-sieben/UTL_FTP
declare
l_is_installed pls_integer;
begin
select count(*)
into l_is_installed
from dba_objects
where owner = '&INSTALL_USER.'
and object_type in ('PACKAGE', 'SYNONYM')
and object_name in ('PIT', 'PIT_ADMIN');
if l_is_installed = 0 then
raise_application_er... |
<filename>schema/autoresponders.sql
DROP TABLE IF EXISTS `autoresponders`;
CREATE TABLE IF NOT EXISTS `autoresponders` (
`autoresponder_id` int(11) NOT NULL auto_increment,
`autoresponder_name` varchar(20) default NULL,
`autoresponder_subject` varchar(200) default NULL,
`autoresponder_message` text,
`autoresp... |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <NAME>
-- Create date: 10/07/2019
-- Description: Hard deletes all data associated with all soft deleted matrixes
-- exec Data_Matrix_DeleteEntities
-- =============================================
CREATE
OR... |
use drshah;
# Dropping the tables
DROP TABLE IF EXISTS Contact;
DROP TABLE IF EXISTS MobileDevice_TestResult;
DROP TABLE IF EXISTS MobileDevice;
DROP TABLE IF EXISTS TestResult; |
<reponame>drsm/sqt<gh_stars>10-100
-- source: http://2smart4school.com/understand-use-and-modify-the-stored-procedure-sp_spaceused/
with i as
(
-- XML Indexes or Fulltext Indexes which use internal tables tied user table
select
it.parent_id [object_id],
sum(reserved_page_count) reservedpages,
sum(used_page_cou... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.1.63-community - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL version: 7.0.0.4053
-- Date/time: 2012-10-14 17:59:16
... |
CREATE TABLE REDUSERT_VENTEPERIODE(sykmelding_id VARCHAR PRIMARY KEY);
|
<reponame>dram/metasfresh
-- 2020-11-26T12:05:08.316Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,I... |
<filename>Task/Rot-13/SQL/rot-13-2.sql<gh_stars>1-10
with cte(num) as
(
select 1
union all
select num+1
from cte
)
select cast((
select char(ascii(chr) +
case
when ascii(chr) between ascii('a') and ascii('m') or
ascii(chr) between ascii('A') and ascii('M') then 13
when ascii(chr) between ascii('n'... |
<filename>toko_buku.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 18 Sep 2017 pada 13.41
-- Versi Server: 10.1.19-MariaDB
-- PHP Version: 7.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
# Host: localhost (Version: 5.7.10-log)
# Date: 2016-01-05 13:07:03
# Generator: MySQL-Front 5.3 (Build 4.271)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "author"
#
DROP TABLE IF EXISTS `author`;
CREATE TABLE `author` (
`name` varchar(10) NOT NULL DEFAULT '',
`workplace` varchar(30) DEFAULT NULL,
PR... |
select count(*) from adnetwork_task.youtube_crawler
select * from adnetwork_task.youtube_crawler
where Label != 2477
LIMIT 10 |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50722
Source Host : localhost:3306
Source Database : sky_admin_sys
Target Server Type : MYSQL
Target Server Version : 50722
File Encoding : 65001
Date: 2021-02-05 17:20:09
*/
SET FOREIGN_KEY_CHEC... |
CREATE DATABASE air_traffic;
\c air_traffic
CREATE TABLE Tickets (
TicketID SERIAL PRIMARY KEY,
customer INT NOT NULL,
seat INT NOT NULL,
departure TIMESTAMP NOT NULL,
arrival TIMESTAMP NOT NULL,
airline INT NOT NULL,
from_city INT NOT NULL,
from_country INT NOT NULL,
... |
create temp table prs as
select pr.created_at, pr.merged_at
from
gha_pull_requests pr
where
pr.merged_at is not null
and pr.created_at >= '{{from}}'
and pr.created_at < '{{to}}'
and pr.event_id = (
select i.event_id from gha_pull_requests i where i.id = pr.id order by i.updated_at desc limit 1
);
creat... |
<gh_stars>0
-- Update an organism record.
--
-- Expected inputs:
-- 1. int32 Organism ID
-- 2. string New template string
-- 3. int64 New gene counter starting value
-- 4. int64 New transcript counter starting value
WITH
row_id AS (SELECT ?::BIGINT AS val)
, template AS (SELECT ?::VARCHAR AS val)
, g... |
<reponame>llsand/orcas
create global temporary table tab_delete_rows
(
id number(15) not null,
)
on commit delete rows;
create global temporary table tab_preserve_rows
(
id number(15) not null,
)
on commit preserve rows;
create table tab_permanent
(
id number(15) not null
);
create table tab_mod_parallel
(
i... |
show tables from ks_unsharded;
select * from t1;
insert into t1 (id,intval,floatval) values (1,2,3.14);
update t1 set intval = 10;
update t1 set floatval = 9.99;
delete from t1 where id = 100;
insert into t1 (id,intval,floatval) values (1,2,3.14) on duplicate key update intval=3, floatval=3.14;
select ID from t1;
|
INSERT INTO ops (op) VALUES ('beforeEach 00_dummy_before_each.sql');
|
<reponame>xzilla/pg_jobmon
-- Fixed bug in check_job_status result when all jobs were ok
CREATE OR REPLACE FUNCTION check_job_status(p_history interval, OUT alert_code integer, OUT alert_text text)
LANGUAGE plpgsql
AS $$
DECLARE
v_jobs RECORD;
v_job_errors RECORD;
v_count int = 1;
v_trouble te... |
-- start_matchsubs
-- m/nodeModifyTable.c:\d+/
-- s/nodeModifyTable.c:\d+/nodeModifyTable.c:XXX/
-- end_matchsubs
-- start_ignore
drop table tab1;
drop table tab2;
drop table tab3;
-- end_ignore
-- We do some check to verify the tuple to delete|update
-- is from the segment it scans out. This case is to test
-- such ... |
/* sysviews_settings.sql
**
** Create, populate, update the sysviews_settings table which holds configurable
** sysviews default settings.
**
** Revision History:
** . 2020.06.15 - Yellowbrick Technical Support
** . 2020.04.25 - Yellowbrick Technical Support
**
*/
CREATE TABLE IF NOT EXISTS sysviews_sett... |
SELECT title FROM people
JOIN stars ON stars.person_id = people.id
JOIN movies ON movies.id = stars.movie_id
JOIN ratings ON ratings.movie_id = movies.id
WHERE name = "<NAME>"
ORDER BY rating DESC LIMIT 5; |
-- 1) Recupere o nome e o salário de todos os empregados.
select enome,salario from empregado
-- 2) Recupere o nome e o salário de todos os empregados do sexo feminino.
select enome,salario from empregado where sexo = 'F'
-- 3) Recupere o nome e o salário de todos os empregados do sexo feminino e que ganham salário m... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Waktu pembuatan: 10 Nov 2021 pada 10.21
-- Versi server: 5.7.31
-- Versi PHP: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... |
<filename>SustainappBatch/src/main/resources/db/migration/V1/V1.10__sustainapp_mail_user.sql
ALTER TABLE PROFILE
DROP COLUMN MAIL;
ALTER TABLE USER_ACCOUNT
ADD MAIL VARCHAR(250) NOT NULL; |
<filename>www/html/app/addons/affiliate/database/demo.sql
REPLACE INTO ?:affiliate_plans (plan_id, payout_types, commissions, min_payment, product_ids, category_ids, promotion_ids, cookie_expiration, method_based_selling_price, use_coupon_commission, status) VALUES (11, 'a:6:{s:12:"init_balance";a:2:{s:5:"value";d:1;s:... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 25, 2020 at 02:12 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:00";
/*!40101 SET @OLD_CHARACT... |
<filename>suministroscomixmul.sql
-- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 13-03-2020 a las 15:05:45
-- Versión del servidor: 5.5.20
-- Versión de PHP: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET... |
<reponame>fajarsid/web-limoesoeka
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.31.10
-- Generation Time: Dec 21, 2021 at 10:50 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
CREATE OR REPLACE PACKAGE om_tapigen AUTHID CURRENT_USER IS
c_generator CONSTANT VARCHAR2(10 CHAR) := 'OM_TAPIGEN';
c_generator_version CONSTANT VARCHAR2(10 CHAR) := '0.6.0';
/**
Oracle PL/SQL Table API Generator
=================================
_This table API generator needs an Oracle DB version 12.1... |
--
-- QuartzDesk: object names converted to upper-case (Quartz API uses upper-case table names).
--
-- DROP TABLE QRTZ_FIRED_TRIGGERS;
-- DROP TABLE QRTZ_PAUSED_TRIGGER_GRPS;
-- DROP TABLE QRTZ_SCHEDULER_STATE;
-- DROP TABLE QRTZ_LOCKS;
-- DROP TABLE QRTZ_SIMPLE_TRIGGERS;
-- DROP TABLE QRTZ_SIMPROP_TRIGGERS;
-- DROP T... |
<gh_stars>1-10
CREATE TABLE apps_db.stations(
station_id varchar(255),
name varchar(255),
region_id varchar(10),
capacity integer
);
|
/* Formatted on 10/6/2014 8:19:28 PM (QP5 v5.126.903.23003) */
-- TABLE: INV.INV_SHELF
-- DROP TABLE INV.INV_SHELF;
CREATE TABLE INV.INV_SHELF (SHELF_ID NUMBER,
STORE_ID NUMBER,
CREATED_BY NUMBER,
CREATION_... |
# --- !Ups
CREATE TABLE HQ_USER (
USER_ID VARCHAR(50) PRIMARY KEY,
NICKNAME VARCHAR(100) NOT NULL,
EMAIL VARCHAR(100) NOT NULL,
AVATAR_URL VARCHAR(200) NULL,
ACTIVATED BOOLEAN NOT NULL
);
CREATE TABLE AUTH_TOKEN (
ID VARCHAR(50) PRIMARY KEY,
USER_ID VARCHAR(50) NOT NULL REFERENCES HQ_... |
<reponame>oehrlis/ordba
----------------------------------------------------------------------------
-- Trivadis AG, Infrastructure Managed Services
-- Saegereistrasse 29, 8152 Glattbrugg, Switzerland
----------------------------------------------------------------------------
-- Name......: tvd_hr_cre.sql
-- Autho... |
SELECT DISTINCT result FROM (SELECT toStartOfFifteenMinutes(toDateTime(toStartOfFifteenMinutes(toDateTime(1000.0001220703125) + (number * 65536))) + (number * 9223372036854775807)) AS result FROM system.numbers LIMIT 1048576) ORDER BY result DESC NULLS FIRST FORMAT Null;
SELECT round(round(round(round(round(100)), roun... |
<reponame>pdv-ru/ClickHouse<filename>tests/queries/0_stateless/01866_datetime64_cmp_with_constant.sql<gh_stars>1000+
CREATE TABLE dt64test
(
`dt64_column` DateTime64(3),
`dt_column` DateTime DEFAULT toDateTime(dt64_column)
)
ENGINE = MergeTree
PARTITION BY toYYYYMM(dt64_column)
ORDER BY dt64_column;
INSERT INT... |
/*
Navicat Premium Data Transfer
Source Server : 172.16.16.219_测试
Source Server Type : SQL Server
Source Server Version : 15002000
Source Host : 172.16.16.219:1433
Source Catalog : MeiamSystem
Source Schema : dbo
Target Server Type : SQL Server
Target Server Version : 1... |
<reponame>AnuragAnalog/365-data-science
DELIMITER $$
CREATE TRIGGER trig_hire_date
BEFORE INSERT ON employees
FOR EACH ROW
BEGIN
IF NEW.hire_date > date_format(sysdate(), '%y-%m-%d') THEN
SET NEW.hire_date = date_format(sysdate(), '%y-%m-%d');
END IF;
... |
<gh_stars>10-100
/*
Copyright 2021 Snowplow Analytics Ltd. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unl... |
<reponame>cae-development/microservice-JustTest
--
-- Database Schema: test
-- Automatically generated sql script for the service JustTest, created by the CAE.
-- --------------------------------------------------------
--
-- Table structure for table test.
--
CREATE TABLE test.test (
test int ,
CONSTRAINT test_PK... |
<filename>src/dbdiff/templates/diff_column_hier.sql
SELECT {{ join_cols }},
{{ column }}
FROM {{ schema }}.{{ table }}
WHERE {{ first_join_col }} IN (SELECT {{ first_join_col }} FROM {{ diff_schema }}.{{ diff_table }} WHERE column_name = '{{ column }}' GROUP BY {{ first_join_co... |
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 20, 2018 at 06:08 AM
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
ssssselect * from fu |
CREATE TABLE Recharges
(
Id INT IDENTITY(1,1) PRIMARY KEY,
UserId INT FOREIGN KEY REFERENCES Users(Id),
Value DECIMAL(18,2) NOT NULL,
Bond DECIMAL (18,2)NOT NULL,
TotalRecharge DECIMAL (18,2) NOT NULL,
DateRecharge DATETIME NOT NULL,
ApplyPromo BIT NOT NULL DEFAULT 0
) |
<filename>droptable.sql
drop TABLE `blog`;
drop table `comments`;
drop table `contactus`;
drop table `failed_jobs`;
drop table `image_uploads`;
drop table `migrations`;
drop table `password_resets`;
drop table `products`;
drop table `posts`;
drop table `product_images`;
drop table `products_category`;
drop table `sess... |
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: localhost Database: amcm_db
-- ------------------------------------------------------
-- Server version 8.0.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... |
<gh_stars>0
DROP SEQUENCE IF EXISTS airline_company_id_seq CASCADE;
DROP TABLE IF EXISTS airline_company CASCADE; |
<gh_stars>0
/*
Navicat Premium Data Transfer
Source Server : mysql
Source Server Type : MySQL
Source Server Version : 50549
Source Host : localhost:3306
Source Schema : website
Target Server Type : MySQL
Target Server Version : 50549
File Encoding : 65001
Date: 10/11... |
<filename>recipe_db.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 26, 2018 at 12:01 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_... |
-- 001 Cantidad de vuelos
SELECT COUNT(*) FROM VUELO;
-- 002 Cantidad de vuelos por trayecto
SELECT COUNT(*) FROM VUELO GROUP BY fk_trayecto;
-- 003 Cantidad de trayectos
SELECT COUNT(*) FROM TRAYECTO;
-- 004 Cantidad de trayectos con vuelos
SELECT COUNT(*) FROM ( SELECT COUNT(*) FROM VUELO GROUP BY fk_trayec... |
PRAGMA foreign_keys = ON;
create table GAME(
game_id integer primary key,
bgg_game_id integer not null,
name text not null);
create table PLAYER(
player_id integer primary key,
name text not null);
create table COLLECTION(
player_id integer not null,
game_id integer not null,
rating integer,
foreign key (pl... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 08, 2021 at 07:43 AM
-- Server version: 10.5.10-MariaDB
-- PHP Version: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 28, 2015 at 11:40 PM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
create or replace function parse_html_table_akita
return t_table pipelined
as
l_html clob;
l_start number;
l_end number;
l_row t_table_row;
c_record sys_refcursor;
l_data varchar2(200);
begin
-- 取り込むデータの部分を切り出す。
l_html := get_content_as_clob('秋田県','AL32UTF8');
l_start := instr(l_h... |
<reponame>khanakat/ToDo-php<filename>database/database.sql
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`email` varc... |
<filename>conf/evolutions/default/58.sql
-- !Ups
ALTER TABLE companies ALTER COLUMN address_old_version DROP NOT NULL;
-- !Downs
|
<filename>oracle/show/itvtest.sql
itv start 5 Checking Active sessions in interval mode, type 'Ctrl + C' to abort
set VERIFY on
ora actives
pro
PRO Determine if need to abort(20%) ...
var next_action varchar2
set VERIFY off
begin
if dbms_random.value(0,10)>8 then
:next_action := 'off';
else
:ne... |
<reponame>StatisticsNZ/population-explorer
/*
Adds months as NEET per year to the fact table.
Aggregates IDI_Sandpit.intermediate.monthly_activity table (activity per snz_uid per year-month) to NEET months per year.
See int-tables/32_neet (intermediate table code) for more information.
<NAME> 8 December 2017
*/
I... |
<gh_stars>1-10
{{
config(
materialized='ephemeral',
tags=['unit_test', 'test1']
)
}}
SELECT * FROM {{ ref('test1_input') }}
WHERE batch <= {{ var('batch', 100) }}
-- {{ ref('test1_expect') }}
|
-- randexpr1.test
--
-- db eval {SELECT coalesce((select 19 from t1 where a<=case (abs(e)/abs(case b+f when b then t1.e else e end)) when + -t1.b+coalesce((select max(t1.f) from t1 where (19<=+e) and (c*b)>= -t1.e and (c>=c)),11+(e)+a)-t1.b then 17 else 17 end-t1.e),a) FROM t1 WHERE +d*t1.f+c+t1.c*13<>t1.e}
SELECT coa... |
-- randexpr1.test
--
-- db eval {SELECT t1.b-~case when +a in (select ~min(11) from t1 union select -count(*)+count(distinct ~coalesce((select coalesce((select t1.b-19+c from t1 where a<>13 or 13 in (t1.b,d,t1.e)),11) from t1 where 19 in (19,e,17)),e)) from t1) then (select -min(19)+cast(avg(t1.d) AS integer) from t... |
/*Dynamic Data Masking Demo/Test Script*/
--Create a demo/test data table with columns of different data types
CREATE TABLE Employee_Financial (
Emp_ID INT IDENTITY(1, 1) PRIMARY KEY
,Emp_First_Name NVARCHAR(10) NOT NULL
,Emp_Last_Name NVARCHAR(10) NOT NULL
,Emp_Date_Of_Birth DATETIME NULL
,Emp_Salary INT NULL
,Emp_Em... |
CREATE TABLE t1 (x INT);
EXPLAIN SELECT * FROM t1;
-- msg: CREATE TABLE 1
-- EXPLAIN: TABLE T1 (X INTEGER)
CREATE TABLE t1 (x INT);
explain SELECT * FROM t1;
-- msg: CREATE TABLE 1
-- EXPLAIN: TABLE T1 (X INTEGER)
CREATE TABLE t1 (x INT);
EXPLAIN SELECT * FROM t1 WHERE x > 100;
-- msg: CREATE TABLE 1
-- EXPLAIN: TABL... |
<reponame>lotosbin/prestashop-docker-compose<gh_stars>10-100
/* PHP */
/* PHP:attribute_group_clean_combinations() */;
/* STRUCTURE */
SET NAMES 'utf8';
ALTER TABLE PREFIX_order_detail
ADD product_quantity_discount DECIMAL(13,6) NOT NULL DEFAULT 0 AFTER product_price;
ALTER TABLE PREFIX_country
ADD deleted TINYINT(... |
<filename>Snippets/19/1 update.sql
-- SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
-- SET NOCOUNT ON;
-- SET ANSI_NULLS ON;
-- SET QUOTED_IDENTIFIER ON;
USE AP;
UPDATE AP..InvoiceCopy
SET CreditTotal = CreditTotal + 100
FROM
(SELECT
TOP 10
InvoiceID
FROM
AP..InvoiceCopy
WHERE InvoiceTotal - PaymentTotal... |
delimiter /
TRUNCATE TABLE BATCH_CORRESPONDENCE_DETAIL
/
INSERT INTO SEQ_BATCH_CORRESPONDENCE VALUES (null)
/
INSERT INTO BATCH_CORRESPONDENCE_DETAIL (BATCH_CORRESPONDENCE_DETAIL_ID,BATCH_CORRESPONDENCE_TYPE_CODE,PROTO_CORRESP_TYPE_CODE,DAYS_TO_EVENT,UPDATE_USER,UPDATE_TIMESTAMP,OBJ_ID,VER_NBR)
VALUES ((SELECT MAX... |
<reponame>kruthikagowda/IT-PROJECT-
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 15, 2018 at 08:53 PM
-- Server version: 5.7.22-0ubuntu0.16.04.1
-- PHP Version: 7.0.28-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zo... |
<reponame>lzrlizhirong/jui-springboot-manager
#
# Structure for table "rc_data_dictionary"
#
CREATE TABLE `rc_data_dictionary` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`status_id` char(1) NOT NULL DEFAULT '1' COMMENT '状态',
`create_time` datetime NOT NULL COMMENT '创建时间',
`update_time` datetime ... |
<reponame>jesse108/infectionMap<filename>doc/DB.sql
create table if not exists `user`(
`id` bigint(20) not null primary key auto_increment,
`username` varchar(32) NOT NULL comment '用户名',
`pwd` varchar(124) not null comment '密码',
`email` varchar(64),
`sex` tinyint(1) not null default 0 comment '0:未知 1:男 2:女',
`mob... |
// # Introduction
// This CDS logic is based on the Pooled Cohort Equations for Estimation of 10-Year Risk for Hard ASCVD, featured by
// CMS's Million Hearts (c) Model Longitudinal ASCVD Risk Assessment Tool for Baseline 10-Year ASCVD Risk. In the
// process of authoring the logic, certain assumptions were made and de... |
<filename>oauth2-server/src/sql/sqlschema.sql
drop table if exists sys_oauth2_client;
drop table if exists sys_oauth2_user;
create table sys_oauth2_user (
id bigint auto_increment,
username varchar(100),
password varchar(100),
salt varchar(100),
constraint pk_sys_oauth2_user primary key(id)
) charset=utf8 EN... |
CREATE PROCEDURE [svc].[usp_EmailQueue_Update]
@Id UNIQUEIDENTIFIER
,@IsCancelled BIT
,@SendAtUtc DATETIMEOFFSET (7)
,@DeliveredUtc DATETIMEOFFSET (7)
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
BEGIN TRANSACTION;
UPDATE [dbo].[tbl_EmailQueue]
SET
... |
<reponame>doug-dianomic/fledge<gh_stars>10-100
ALTER TABLE fledge.tasks ADD COLUMN schedule_name character varying(255);
DROP INDEX IF EXISTS fledge.tasks_ix1;
CREATE INDEX tasks_ix1
ON fledge.tasks(schedule_name, start_time); |
<reponame>deart2k/gpdb
-- this SQL suites only test planners unique rowid path
-- set fault inject at the start of the file and reset
-- it when finish. This SQL tests planner but let's also
-- run the queries under ORCA (means without set optimizer = off here).
create extension if not exists gp_inject_fault;
select gp... |
<gh_stars>0
-- SET FOREIGN_KEY_CHECKS=0;
-- drop table if exists `trn_request`;
-- drop table if exists `trn_requestitem`;
-- drop table if exists `trn_requestappr`;
CREATE TABLE `trn_request` (
`request_id` varchar(30) NOT NULL ,
`inquiry_id` varchar(14) ,
`request_isunref` tinyint(1) NOT NULL DEFAU... |
-- using plpgsql for the example so we don't have to require additional extensions
-- but pgspjs supports any of the function
-- language supported by PostgreSQL, especially plv8 (Javascript)
CREATE OR REPLACE FUNCTION example1_test_function()
RETURNS text
AS
$$
DECLARE
strresult text;
BEGIN
SELECT 'Hello world' I... |
USE [QuartzSample]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/****** Tabella che rappresenta le schedulazioni batch di processi per i vari server ******/
CREATE TABLE [dbo].[SCHEDULAZIONI_SERVIZI](
[ID_REGOLA] [varchar](30) NOT NULL,
[ESPRESSIONE_CRON] [varchar](1000) NOT NULL,
[NOME_BATCH] [varchar](100... |
-- Table definitions for the tournament project.
--
-- Put your SQL 'create table' statements in this file; also 'create view'
-- statements if you choose to use it.
--
-- You can write comments in this file by starting them with two dashes, like
-- these lines here.
CREATE DATABASE tournament;
\c tournament;
CREATE TA... |
/*
Find the difference between the total number of CITY entries in the table and the number of distinct CITY entries in the table.
The STATION table is described as follows:
where LAT_N is the northern latitude and LONG_W is the western longitude.
For example, if there are three records in the table with CITY values '... |
USE sucos;
INSERT INTO tabela_de_vendedores (
MATRICULA, NOME, PERCENTUAL_COMISSAO) VALUES ("00235", "<NAME>", 0.8);
INSERT INTO tabela_de_vendedores (
MATRICULA, NOME, PERCENTUAL_COMISSAO) VALUES ("00236", "<NAME>", 0.8);
SELECT * FROM tabela_de_vendedores; |
prompt --application/shared_components/navigation/lists/desktop_navigation_menu
begin
-- Manifest
-- LIST: Desktop Navigation Menu
-- 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=>116577013837797376
,p_default_application_id=>... |
<reponame>postgresqlacademy/pwaf
--
DO
$body$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM pg_tables WHERE schemaname='pwaf_app_dba' and tablename='gui_views_layout_block_override'
) THEN
CREATE TABLE pwaf_app_dba.gui_views_layout_block_override
(
CONSTRAINT view_layout_block_override_pkey PRIMARY KEY (id ),
CONS... |
SELECT * FROM domainobject WHERE unixtime='".$ts->getTimestamp()."'
SELECT * FROM table WHERE column='test'
SELECT * FROM user INNER JOIN `mytable` using(tableid) WHERE (userid='55')
SELECT name,value,active FROM user');
SELECT llamas FROM animals';
SELECT id FROM sequences WHERE name=? FOR UPDATE
SELECT firstname FROM... |
<gh_stars>1-10
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SPC_P004_LST1]') AND type IN (N'P', N'PC'))
/****** Object: StoredProcedure [dbo].[SPC_M001L_FND1] Script Date: 2017/11/23 16:46:46 ******/
DROP PROCEDURE [dbo].[SPC_P004_LST1]
GO
/****** Object: StoredProcedure [dbo].[... |
<filename>transform/snowflake-dbt/models/sources/greenhouse/greenhouse_application_custom_fields_source.sql
WITH source as (
SELECT *
FROM {{ source('greenhouse', 'application_custom_fields') }}
), renamed as (
SELECT
--keys
application_id::NUMBER AS application_id,
... |
{{
config(
enabled=true
)
}}
SELECT
1 2 3
|
SET search_path to :schema, public;
-- :schema.routes
ALTER TABLE :schema.routes
DROP CONSTRAINT routes_fkey CASCADE;
ALTER TABLE :schema.routes
DROP CONSTRAINT route_types_fkey CASCADE;
-- :schema.fare_attributes
ALTER TABLE :schema.fare_attributes
DROP CONSTRAINT fare_attributes_fkey CASCADE;
-- :sch... |
-- file:prepared_xacts.sql ln:150 expect:true
SELECT * FROM pxtest3
|
<gh_stars>0
CREATE TABLE doctors (
id INT PRIMARY KEY NOT NULL,
speciality TEXT,
taking_patients BOOLEAN
);
CREATE TABLE patients (
id INT NOT NULL,
doctor_id INT NOT NULL,
health_status TEXT,
PRIMARY KEY (id, doctor_id),
FOREIGN KEY (doctor_id) REFERENCES doctors (id)
);
INSERT INTO doctors(id, speci... |
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL
)
|
<filename>inst/sql/sql_server/analyses/501.sql
-- 501 Number of records of death, by cause_concept_id
--HINT DISTRIBUTE_ON_KEY(stratum_1)
select 501 as analysis_id,
CAST(d1.cause_concept_id AS VARCHAR(255)) as stratum_1,
cast(null as varchar(255)) as stratum_2, cast(null as varchar(255)) as stratum_3, cast(null as ... |
/*
Warnings:
- You are about to drop the column `semesterId` on the `FinishedCourses` table. All the data in the column will be lost.
- You are about to drop the `_SemesterToStudent` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "FinishedCourses" DROP ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.