sql stringlengths 6 1.05M |
|---|
<filename>db/migrations/28_remove_v2.sql<gh_stars>10-100
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied
DROP TABLE v2_templates;
DROP TABLE campaigns;
ALTER TABLE `messages` DROP COLUMN `campaign_id`;
DROP TABLE unsubscribers;
DROP TABLE campaign_types;
DROP TABLE senders;
-- +migrate... |
<filename>_includes/tutorials/anomaly-detection/ksql/code/src/statements.sql
CREATE TABLE suspicious_names (CREATED_DATE VARCHAR,
COMPANY_NAME VARCHAR PRIMARY KEY,
COMPANY_ID INT)
WITH (kafka_topic='suspicious_names',
partitions=1,
va... |
<filename>persistence/sql/migrations/sql/20210410175418000042_network.sqlite3.down.sql
INSERT INTO "_selfservice_registration_flows_tmp" (id, request_url, issued_at, expires_at, active_method, csrf_token, created_at, updated_at, type, ui) SELECT id, request_url, issued_at, expires_at, active_method, csrf_token, created... |
<filename>sql1_persediaan/daftar_penerimaan_barang_sql/daftar_penerimaan_tebingtinggi.sql
DROP VIEW IF EXISTS view_daftar_penerimaan_tebingtinggi;
CREATE VIEW view_daftar_penerimaan_tebingtinggi AS
SELECT
*
FROM
view_daftar_penerimaan_kabupaten
WHERE
1 = 1 AND
id_skpd = 38;
GRANT ALL PRIVILEGES ON view_daftar_pen... |
-- @testpoint: 聚集函数var_samp,与group by、having联合使用
drop table if exists t_nvl_rca_tab;
create table t_nvl_rca_tab(col_1 int,col_2 int);
insert into t_nvl_rca_tab values (253,333);
insert into t_nvl_rca_tab values (254,111);
insert into t_nvl_rca_tab values (255,987);
select distinct var_samp(col_2),grouping(col_1) from t... |
//==============================================================================
// file: abstract/Agent_w.cql
// modified: 2018-04-30
// dependencies:
// none
// external parameters:
// model_ID, used to identify model created nodes belong to
// description:
// Create nodes representing the agents in the ... |
UPDATE mdl_user SET username=concat(id,'<EMAIL>'), password='<PASSWORD>', firstname="firstname", lastname='lastname', email='<EMAIL>', icq='', skype='', yahoo='', aim='', msn='', phone1='', phone2='', institution='', address='', city='', lastip='' WHERE id NOT IN (1, 2) |
CREATE TABLE IF NOT EXISTS `coporation`
(
`id` INT NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
)
ENGINE = InnoDB; |
<filename>GestHopital/GestHopital/xSQLxTables/Tables.sql
DROP TABLE [patient_wpf];
DROP TABLE [rdv_wpf];
DROP TABLE [medecin_wpf];
CREATE TABLE [patient_wpf] (
[id] INT IDENTITY (1, 1) NOT NULL,
[code_patient] VARCHAR (50) NOT NULL,
[nom_patient]VARCHAR (50) NOT NULL,
[adresse_patien... |
<reponame>UPTechMX/UPT-Calculus-Modules<gh_stars>0
CREATE OR REPLACE FUNCTION urbper_indicator_energy_transport_t (scenario_par integer DEFAULT 0)
RETURNS boolean
LANGUAGE plpgsql
AS $$
DECLARE
status boolean = TRUE;
tot_pop float;
e_g float;
e_d float;
BEGIN
SELECT
value INTO tot_pop
FROM
res... |
<gh_stars>1-10
CREATE VIEW [etljob].[vw_Layer]
AS
SELECT [LayerID]
,[Layer]
,[PackagePrefix]
FROM [etljob].[Layer]
|
<gh_stars>1-10
SELECT * FROM " + table + whereClause);
SELECT * FROM " + table + sqlWhere;
|
<reponame>uk-gov-mirror/hmcts.probate-back-office
INSERT INTO GRANT_APPLICATIONS_FLAT(
ID,
PROBATE_NUMBER,
PROBATE_VERSION,
DECEASED_ID,
DECEASED_FORENAMES,
DECEASED_SURNAME,
DATE_OF_BIRTH,
DATE_OF_DEATH1,
DATE_OF_DEATH2,
DECEASED_ADDRESS,
DECEASED_TEXT,
ALIAS_NAMES,
GRANT_APPLICATION_TEXT,
APPLICATION_EVENT_TEXT,
OATH... |
<reponame>chawlajay/Hostel-Management-System
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 03, 2020 at 10:13 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
... |
<gh_stars>10-100
set IDENTITY_INSERT Int32Samples on
INSERT INTO Int32Samples
(Id)
VALUES
(1),
(2),
(3),
(4),
(5),
(6),
(7),
(8),
(9),
(10),
(11),
(12),
(13),
(14),
(15),
(16),
(17),
(18),
(19),
(20),
(21),
(22),
(23),
(24),
(25),
(26),
(27),
(28),
(29),
(30),
(31),
(32),
(33),
(34),
(35),
(36),
(37),
(38),
(39),
(40... |
<filename>api/migrations/sqls/20160615094935-add-spreadsheet-in-organization-down.sql
ALTER TABLE organization DROP COLUMN spreadsheetId;
|
<reponame>jdkoren/sqlite-parser
-- randexpr1.test
--
-- db eval {SELECT case ~11-13 when 11-d-case when t1.f*+a-t1.a-t1.f=t1.a then a when t1.f between 19-t1.a+coalesce((select a from t1 where e in (select case -max(t1.c) when count(*) then max(t1.d) else -(cast(avg((t1.e)) AS integer)) end from t1 union select (max... |
<gh_stars>1000+
ALTER TABLE public.subject
ADD COLUMN IF NOT EXISTS user_role character varying(100) COLLATE pg_catalog."default" DEFAULT 'UNDEFINED',
ADD COLUMN IF NOT EXISTS terms_accepted_at timestamp without time zone,
ADD COLUMN IF NOT EXISTS has_newsletters BOOLEAN NOT NULL DEFAULT FALSE;
U... |
<filename>backend/de.metas.fresh/de.metas.fresh.base/src/main/sql/postgresql/system/70-de.metas.fresh/5535440_sys_gh3160_LinkM_CustomsTariff_to_M_Product.sql
-- 2019-10-31T08:41:24.475Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Or... |
-- +++
-- parent: 1000000027
-- +++
BEGIN;
--
-- Public
-- Change comment
COMMENT ON COLUMN lsif_data_docs_search_current_public.dump_id IS 'The associated dump identifier.';
-- Create new created_at column to decide a leader
ALTER TABLE lsif_data_docs_search_current_public ADD COLUMN IF NOT EXISTS created_at TIMES... |
<filename>db2te/tutorials/tutorials/pureXML/BasicsOfXQuery/SQL/05_CaseSensitivity.sql
XQUERY
let $a := 5
return $A |
<reponame>hangqiu/pixie<gh_stars>1000+
ALTER TABLE users
DROP CONSTRAINT auth_provider_id_unique;
|
CREATE FUNCTION func537() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE486);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE424);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE97);val:=(SELECT COUNT(*)INTO MYCOUN... |
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS Enrollment(
ID_fa integer NOT NULL,
ID_professional integer NOT NULL,
status text NOT NULL,
timeEn datetime NOT NULL,
category text NOT NULL,
CONSTRAINT PK_Enrollment PRIMARY KEY ( ID_fa, ID_professional ),
CONSTRAINT... |
alter table `moves` add column `Proposer` bigint; |
CREATE TABLE topic
(
id int(7) NOT NULL AUTO_INCREMENT ,
title varchar(25) NOT NULL UNIQUE,
PRIMARY KEY (id)
);
CREATE TABLE user
(
email varchar(45) NOT NULL UNIQUE,
id int(7) NOT NULL AUTO_INCREMENT ,
password varchar(100) NOT NULL ,
created datetime DEFAULT CURRENT_TIMESTAMP ,
... |
<gh_stars>10-100
ALTER TABLE "public"."YouTubeUpload" DROP COLUMN "videoPrivacyStatus";
|
-- @testpoint: 插入正浮点数
drop table if exists float4_01;
create table float4_01 (name float4);
insert into float4_01 values (120.123);
insert into float4_01 values (99999.99999);
insert into float4_01 values (0.0001);
select * from float4_01;
drop table float4_01; |
select Request_at as 'Day', convert(count(if(Status != 'completed',true,null))/count(*),decimal(10,2)) as 'Cancellation Rate'
from Trips
where Request_at between '2013-10-01' and '2013-10-03'
and Client_id in (
select Users_Id from Users where Banned = 'No' and Role = 'client'
... |
<reponame>seydanurdemir/University-Notes-And-Assignments
-- ----------------------------------------------------------------------------
-- MySQL Workbench Migration
-- Migrated Schemata: paymentplandb
-- Source Schemata: paymentplandb
-- Created: Sun May 30 03:56:12 2021
-- Workbench Version: 8.0.25
-- ---------------... |
DROP TABLE IMAGES;
CREATE TABLE IMAGES (
ID SERIAL PRIMARY KEY,
imgname text,
img bytea
);
DROP TABLE COMMODITY;
CREATE TABLE COMMODITY (
ID SERIAL PRIMARY KEY,
name CHAR(50) not null UNIQUE,
department CHAR(50) not null,
type CHAR(50) not null,
price decimal(7,2) not null,
special_pri... |
Insert into eg_action(id,name,url,parentmodule,ordernumber,displayname,enabled,contextroot,application) values(nextval('SEQ_EG_ACTION'),'BankEntriesNotInBankBookNewForm','/payment/bankEntriesNotInBankBook-newform.action',(select id from eg_module where name='BRS' ),1,'Bank Statement Entries - Not In Bank Book',true,'EG... |
ALTER TABLE auth_users
DROP COLUMN IF EXISTS name,
DROP COLUMN IF EXISTS github_id
;
|
INSERT INTO
archfolio.comments(user_id, post_id, content)
VALUES
(
:user_id,
:post_id,
:content
)
RETURNING
*
|
<filename>admin/movies.sql<gh_stars>0
--
-- Database: `testing`
--
-- --------------------------------------------------------
--
-- Table structure for table `sample_data`
--
CREATE TABLE `sample_data` (
`id` int(10) NOT NULL,
`first_name` varchar(255) NOT NULL,
`last_name` varchar(255) NOT NULL,
`age` int(... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 08, 2019 at 01:45 PM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... |
<filename>_Datenbank/0_metadaten.sql<gh_stars>0
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.5
-- Dumped by pg_dump version 11.1
-- Started on 2019-05-24 08:48:21
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET st... |
UPDATE [dbo].[Employees] SET [Salary] = [Salary] + 50000
WHERE [FirstName] = N'Jay' AND [LastName] = N'Adams';
|
<gh_stars>1-10
-- Script ID : TC_29.0 --
use gmfsp_db;
SELECT `date`,
instrumentid,
strategycode,
cashonhand,
portfoliovalue
FROM dbo_statisticalreturns
WHERE cashonhand > portfoliovalue
;
|
USE demo
DECLARE @Person AS TABLE (ID INT, FName NVARCHAR(100), LNAME NVARCHAR(100))
INSERT INTO @Person(ID, FName, LNAME)
SELECT 1,'Bob','Wakefield'
SELECT *
FROM @Person |
<gh_stars>10-100
CREATE TABLE quote (
id integer GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
author TEXT NOT NULL,
content TEXT NOT NULL
);
|
<reponame>hanafi88/Perpustakaan
CREATE DATABASE [MasterPerpustakaan]
GO
USE [MasterPerpustakaan]
GO
/****** Object: Table [dbo].[Buku] Script Date: 5/6/2021 9:29:06 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Buku](
[Id] [int] IDENTITY(1,1) NOT NULL,
[NIB] [n... |
use damit
----------
if object_id ( 'damit.ShowJobStepSSISParams' , 'v' ) is null
exec ( 'create view damit.ShowJobStepSSISParams as select ObjectNotCreated= 1/0' )
go
alter view damit.ShowJobStepSSISParams as
with cte as
( select
job_id
,step_id
,Value= substring ( command , patindex ( '%/SET%;%/%' , command ) ... |
CREATE PROC usp_GetTownsStartingWith(@str VARCHAR(50)) AS
BEGIN
SELECT
t.[Name] AS Town
FROM Towns t
WHERE LEFT(t.[Name], LEN(@str)) = @str;
END; |
declare
procedure test_str(str varchar2, expected boolean) is
begin
if &tq84_prefix.string_op.is_number(str) != expected then
dbms_output.put_line('Wrong expectation for >' || str || '<');
end if;
end test_str;
begin
-- numbers
test_str( '42' , true);
test_str( '42.42' , true);
tes... |
<reponame>tingpohuang/PupGo_backend
create table pet_connection(
id1 VARCHAR(36) NOT NULL DEFAULT 'default' ,
id2 VARCHAR(36) NOT NULL DEFAULT 'default',
FOREIGN KEY(id1) REFERENCES pet(id) ON DELETE CASCADE,
FOREIGN KEY(id2) REFERENCES pet(id) ON DELETE CASCADE,
CONSTRAINT PK_pet_connection PRIMARY KEY (id1,... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 08 Nov 2020 pada 13.51
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 17-11-2017 a las 16:45:29
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
--USUÁRIOS
INSERT INTO users (name, git_hub_user, email, pass) VALUES
('<NAME>', 'arthur9010', '<EMAIL>', '<PASSWORD>');
INSERT INTO users (name, git_hub_user, email, pass) VALUES
('<NAME>', 'zabelha', '<EMAIL>', '<PASSWORD>');
INSERT INTO users (name, git_hub_user, email, pass) VALUES
('<NAME>', 'FagnerRumen... |
<reponame>ylizma/BookExchange<filename>public/data/villes.sql
INSERT INTO `villes` (`id`, `name`, `region`) VALUES
(1, '<NAME>', 1),
(2, '<NAME>', 1),
(3, 'Bouskoura', 1),
(4, 'Casablanca', 1),
(5, 'Médiouna', 1),
(6, 'Mohammédia', 1),
(7, '<NAME>', 1),
(8, '<NAME>', 2),
(9, 'Bejaâd', 2),
(10, '<NAME>', 2),
(11, 'Bensl... |
-- Store some flowpath diagnostics
ALTER TABLE flowpaths ADD bulk_slope real;
ALTER TABLE flowpaths ADD max_slope real;
|
<gh_stars>1-10
-- =============================================
-- Author: (Ceteris AG; <NAME>)
-- Create date: 2014-07-30
-- Description: Gets Failed Packages for Job with executionID @JobExecutionID
-- =============================================
CREATE PROC [etljob].[prc_FailedPackages] @JobExecutionID AS INT
... |
CREATE TABLE patronuses
(
patronus_id serial PRIMARY KEY,
patronus_name VARCHAR(35)
);
CREATE TABLE people
(
person_id SERIAL PRIMARY KEY,
first_name VARCHAR(20),
last_name VARCHAR(20),
patronus_id integer REFERENCES patronuses(patronus_id)
);
INSERT INTO patronuses (patronus_name)
VALUES ('Penguin');
INSERT... |
DROP INDEX `account_unique_index_passport` ON `acmedcare_account`;
DROP INDEX `account_query_index_status` ON `acmedcare_account`;
DROP TABLE `acmedcare_account`;
CREATE TABLE `acmedcare_account` (
`pkid` bigint(32) NOT NULL COMMENT '代理主键',
`passport` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT N... |
DROP TABLE IF EXISTS acs2013_5yr.tmp_seq0001;
DROP TABLE IF EXISTS acs2013_5yr.tmp_seq0001_moe;
DROP TABLE IF EXISTS acs2013_5yr.tmp_seq0002;
DROP TABLE IF EXISTS acs2013_5yr.tmp_seq0002_moe;
DROP TABLE IF EXISTS acs2013_5yr.tmp_seq0003;
DROP TABLE IF EXISTS acs2013_5yr.tmp_seq0003_moe;
DROP TABLE IF EXISTS acs2013_5yr... |
<reponame>jdkoren/sqlite-parser<gh_stars>100-1000
-- pagesize.test
--
-- execsql {
-- BEGIN;
-- DELETE FROM t1 WHERE rowid%5!=0;
-- SELECT count(*) FROM t1;
-- }
BEGIN;
DELETE FROM t1 WHERE rowid%5!=0;
SELECT count(*) FROM t1; |
begin;
drop table if exists renewals_temp;
create table renewals_temp (
entry_id uuid,
volume int,
part text,
number int,
page int,
author text,
title text,
oreg text,
odat date,
id text,
rdat date,
claimants text,
new_matter te... |
DROP DATABASE IF EXISTS eweblog_db;
CREATE DATABASE eweblog_db; |
<gh_stars>0
drop view if exists valid_members;
drop database if exists web_sja;
create database if not exists web_sja;
use web_sja;
/* Fixed Enums Definitions */
create table sja_gender (
GENDER_NAME varchar(11) not null,
constraint PK_GENDER_NAME primary key (GENDER_NAME)
);
create table sja_fa_leve... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 21, 2020 at 03:39 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.1.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
CREATE TABLE organisms(
organism_id integer PRIMARY KEY,
scientific_name text NOT NULL UNIQUE CHECK ( scientific_name <> '')
);
CREATE TABLE organism_names(
organism_id integer NOT NULL REFERENCES organisms ON DELETE CASCADE,
name text NOT NULL CHECK (name <> ''),
unique_name text CHECK (unique_name <> ''),
nam... |
-- V0.2__create_users_table.sql
CREATE TABLE devoxx_tia.users (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
uuid BINARY(16) UNIQUE,
name VARCHAR(25),
password VARCHAR(64)
); |
<gh_stars>1-10
BEGIN;
DROP INDEX IF EXISTS build_resource_config_version_inputs_version_md5_idx;
DROP INDEX build_resource_config_version_inputs_resource_id_idx;
DROP INDEX build_resource_config_version_inputs_build_id_idx;
CREATE INDEX build_inputs_resource_versions_idx ON build_resource_config_version_inputs... |
<filename>src/test/regress/sql/ora_alias.sql<gh_stars>100-1000
--
-- table aliasname for grammar = oracle
-- Solution bug: http://192.168.11.45:8000/issues/24013
--
set grammar to oracle;
-- create test table
create table t (id int,name varchar(22), rate int check(rate is not null));
-- scene 1: 插入表名,字段为表别名.列名
insert... |
<gh_stars>10-100
drop database if exists youpassbutter;
create database youpassbutter;
\connect youpassbutter;
create table author (
id serial primary key,
first_name varchar (255) not null,
last_name varchar (255) not null,
middle_name varchar (255),
unique (first_name, middle_name, last_name)
);
create table g... |
<gh_stars>0
-- @testpoint:opengauss关键字whenever(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists whenever;
CREATE TABLESPACE whenever RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace whenever;
--关键字带双引号,创建成功
drop tablespace if exists "whenever";
CREATE TABLESPACE "whenever" RELATIVE LOCATI... |
<reponame>rad-a/burger_picker<filename>db/seeds.sql
INSERT INTO burgers
(burger_name, devoured)
VALUES
("Veggie Shack", true),
("'Shroom Burger", false),
("Texas Burger", true),
("Kimchi Tofu Burger")
|
begin;
--
create table if not exists dormouse."Year"
( "id" serial primary key
, "name" text not null
, "dateCreated" date not null
, "dateModified" date not null
);
--
create table if not exists dormouse."User"
( "id" serial primary key
, "jmbag" ... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 01-Mar-2021 às 02:31
-- Versão do servidor: 10.4.17-MariaDB
-- versão do PHP: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
{{ config(materialized='table') }}
with
suppliers as (
select
supplier_id
, company_name
, country
from {{ ref('stg_suppliers') }}
)
,
categories as (
select
category_id
, category_name
, description
... |
/*
SQLyog Community v10.51
MySQL - 5.5.5-10.1.9-MariaDB-log : Database - sim_gothy
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREI... |
<gh_stars>0
SET client_min_messages TO warning;
CREATE EXTENSION IF NOT EXISTS pgtap;
RESET client_min_messages;
BEGIN;
SELECT no_plan();
-- SELECT plan(1);
SELECT pass('Test recent_post_fn!');
SELECT has_function( 'forum_example','users_latest_post',ARRAY['forum_example.users'],'has users_latest_post function' );
... |
<reponame>zsvoboda/gooddata-dremio-demo
-- DROP EXTENSION foreign_table_exposer;
CREATE EXTENSION foreign_table_exposer;
-- DROP EXTENSION multicorn;
CREATE EXTENSION multicorn;
-- DROP SERVER multicorn_gooddata;
CREATE SERVER multicorn_gooddata FOREIGN DATA WRAPPER multicorn
OPTIONS (
wrapper 'gooddata_fdw.Good... |
-- --------------------------------------------------------
--
-- Structure for view `sys_roles_select`
--
DROP TABLE IF EXISTS `sys_roles_select`;
DROP VIEW IF EXISTS `sys_roles_select`;
CREATE OR REPLACE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `sys_roles_select` AS SELECT `sys_roles`.`id` AS `id_grup`, `sys... |
<filename>Portal/WebSystem/WCMS.Framework.SqlDabase/dbo/Tables/GenericListField.sql<gh_stars>1-10
CREATE TABLE [dbo].[GenericListField] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[RowId] INT NOT NULL,
[ColumnId] INT NOT NULL,
[Answer] NVARCHAR (MAX) COLLATE Latin1_... |
-- Converter API (https://github.com/Stormiix/converter-api)
-- Copyright (c) Stormix (https://www.stormix.co/)
-- Licensed under the MIT License (https://opensource.org/licenses/MIT)
--
-- Table structure for table `api_keys`
--
CREATE TABLE `api_keys` (
`id` int(11) NOT NULL,
`api_key` varchar(300) NOT NULL,
... |
<reponame>MusikAnimal/plagiabot
-- creates table for storing suspected edits
create table copyright_diffs(id int(10) unsigned not null auto_increment primary key, project varchar(20) not null, lang varbinary(20) not null, diff int(10) unsigned not null, diff_timestamp binary(14) not null, page_title varbinary(255) not ... |
# OPTIONS FROM VERSION 1.4.7-1.4.9.x
INSERT INTO `oc_option` (`option_id`, `type`, `sort_order`)
SELECT `product_option_id`, "select", `sort_order` FROM `oc_product_option`;
INSERT INTO `oc_option_description` (`option_id`, `language_id`, `name`)
SELECT `product_option_id`, `language_id`, `name` FROM `oc_product_opti... |
<filename>auth-service/src/main/resources/db/migration/V1.1__Add_roles_table.sql
/**
* Created by IntelliJ IDEA.
*
* User: @Fube
* Date: 21/09/21
* Ticket: feat(AUTH-CPC-59)
*
*/
CREATE TABLE auth.roles(
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(2048) NOT NULL UNIQUE,
parent_id int NUL... |
-- minmax.test
--
-- execsql {SELECT max(a) FROM t2}
SELECT max(a) FROM t2 |
<reponame>potatoqualitee/docker
Declare @server_group_id int
EXEC msdb.dbo.sp_sysmanagement_add_shared_server_group @parent_id=1, @name=N'Production', @description=N'', @server_type=0, @server_group_id=@server_group_id OUTPUT
Select @server_group_id
go
Declare @server_id int
EXEC msdb.dbo.sp_sysmanagement_add_shared_r... |
create or replace function pgq.drop_queue(x_queue_name text)
returns integer as $$
-- ----------------------------------------------------------------------
-- Function: pgq.drop_queue(1)
--
-- Drop queue and all associated tables.
-- No consumers must be listening on the queue.
--
-- --------------------------... |
<reponame>vestige06/shark_weight_electron
--
-- 由SQLiteStudio v3.3.0 产生的文件 周一 6月 28 13:06:47 2021
--
-- 文本编码:System
--
PRAGMA foreign_keys = off;
BEGIN TRANSACTION;
-- 表:Car
CREATE TABLE Car (AutoNo INTEGER PRIMARY KEY AUTOINCREMENT UNIQUE NOT NULL, PlateNo VARCHAR UNIQUE NOT NULL, VehicleWeight VARCHAR, CarOwner INTE... |
<reponame>DataDrivenDecisionMaking/dataRepository<gh_stars>0
select count(*) from HEALTH_PLAN_NEW;;
select * from team1.hidata;
select count(*) from team1.hidata;
select plan_id from team1.hidata;
Create table team1.hidata_new(
PLAN_ID VARCHAR(25),
PLAN_MARKETING_NAME VARCHAR(100),
STATE_CODE VARCHAR(25),
COUNT... |
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[GenerateRandomStudents]
@LowerBound int,
@UpperBound int
AS
BEGIN
-- SET NOCOUNT ON added to prevent e... |
Use Sample
--CTE (Common Table Expression)
CREATE TABLE tblDepartment
(
DeptId int Primary Key,
DeptName nvarchar(20)
)
Insert into tblDepartment values (1,'IT')
Insert into tblDepartment values (2,'Payroll')
Insert into tblDepartment values (3,'HR')
Insert into tblDepartment values (4,'Admin')
With ... |
with insertu as
(insert into users
(
id, first_name, last_name, phone, user_type, active, profile_image_url,
account_kit_access_token, account_kit_user_id, account_kit_access_token_expires_at,
accepted_terms, created_by_user
)
values
(
default, :firstName, :lastName, :phone, ... |
<gh_stars>0
ALTER SERVICE CLASS SYSDEFAULTSUBCLASS UNDER SYSDEFAULTUSERCLASS
COLLECT AGGREGATE ACTIVITY DATA NONE;
DROP VIEW HISTOGRAMS;
DROP VIEW HISTOGRAMTIMES;
DROP VIEW HISTOGRAMSERVICECLASSES;
DROP VIEW HISTOGRAMTYPES;
SET EVENT MONITOR DB2STATISTICS STATE 0;
DELETE FROM HISTOGRAMBIN_DB2STATISTICS;
D... |
DELIMITER $$
alter table Plugin
add versionLevel varchar(15) null $$
create table PluginData
(
name varchar(100) not null,
itemId int not null,
`data` blob not null,
`key` varbinary(2000) not null,
constraint `PRIMARY`
primary key (name, itemId),
constraint fk_PluginData... |
<gh_stars>0
DROP TABLE IF EXISTS empty_lengthy;
CREATE EXTERNAL TABLE empty_lengthy (
int_col INT,
varchar_col STRING
)
ROW FORMAT DELIMITED FIELDS TERMINATED BY "|"
STORED AS TEXTFILE LOCATION "/drill/testdata/partition_pruning/hive/empty_lengthy_partitions";
DROP TABLE IF EXISTS empty_lengthy1;
CREATE EXT... |
-- Create schema, tables, indexes, and constraints used for wnprc_compliance module here
-- All SQL VIEW definitions should be created in wnprc_compliance-create.sql and dropped in wnprc_compliance-drop.sql
DROP SCHEMA IF EXISTS wnprc_compliance CASCADE;
CREATE SCHEMA wnprc_compliance;
DROP TABLE IF EXISTS wnprc_compl... |
metadata :name => "process_summary",
:description => "Process specific aggregate function",
:author => "<NAME> <<EMAIL>>",
:license => "Apache-2.0",
:version => "4.0.2",
:url => "https://github.com/choria-plugins/process-agent",
... |
<filename>sql/worker.sql
CREATE SCHEMA db_worker;
CREATE TABLE db_worker.cpu(_time timestamptz, _tags jsonb, _fields jsonb);
CREATE TABLE db_worker.disk(_time timestamptz, host text, device text, _tags jsonb, _fields jsonb);
CREATE TABLE db_worker.system(_time timestamp, host text, uptime int, _tags jsonb, _fields json... |
CREATE EXTENSION tsm_system_rows;
CREATE TABLE test_tablesample (id int, name text) WITH (fillfactor=10); -- force smaller pages so we don't have to load too much data to get multiple pages
INSERT INTO test_tablesample SELECT i, repeat(i::text, 1000) FROM generate_series(0, 30) s(i) ORDER BY i;
ANALYZE test_tablesamp... |
--
-- DATABASE CREATION
--
DROP DATABASE IF EXISTS phploversblog;
CREATE DATABASE phploversblog;
USE phploversblog;
--
-- TABLE CREATION
--
CREATE TABLE `posts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category` int(11) NOT NULL,
`title` varchar(255) NULL,
`body` text NULL,
`author` varchar(25... |
<filename>src/main/resources/Procedures.sql
/*
* 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: Utilizador
* Created: 10/dez/2019
*/
-- ##Clients table
create or repl... |
<gh_stars>0
-- BAD:
select *
from sales
where id = 10000
or id = 10001
or id = 10002
or id = 10003;
-- GOOD:
select *
from sales
where id in (10000, 10001, 10002, 100003);
---------------------- NOTE -----------------------------
-- I tried hard to reproduce an evil or, but failed so far.
-- I've seen them ... |
INSERT INTO pos_itemtemp VALUES("IPVT190000037","193022","191001","192003","30000","1","30000","0","30000","1","1","1","IPV3005191046","NHO2018000008","PAID","","193022"),
("IPVT190000037","193054","191002","192010","20000","1","20000","0","20000","1","1","1","IPV3005191046","NHO2018000008","PAID","tanpa es
\n","19305... |
-- 1. List the films where the yr is 1962 [Show id, title]
SELECT id, title
FROM movie
WHERE yr=1962;
-- 2. Give year of 'Citizen Kane'.
SELECT yr FROM movie
WHERE title = 'Citizen Kane';
-- 3. List all of the Star Trek movies, include the id, title and yr (all of these movies include the words Star Trek in... |
<filename>migrations/2018-07-08-073859_add_num_checkins_last_checkin/up.sql
ALTER TABLE devices
ADD COLUMN num_checkins INTEGER NOT NULL DEFAULT 1;
ALTER TABLE devices
ADD COLUMN last_checkin BIGINT NOT NULL DEFAULT 0; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.