sql stringlengths 6 1.05M |
|---|
<reponame>Iftahh/sagefy<filename>postgres/migrations/20190905163017_no_tags_on_create_update.sql
-- migrate:up
drop function if exists sg_public.create_card(language character varying, name text, tags text[], subject_id uuid, kind sg_public.card_kind, data jsonb);
CREATE or replace FUNCTION sg_public.create_card(lan... |
<gh_stars>1000+
SET any_join_distinct_right_table_keys = 1;
SET joined_subquery_requires_alias = 0;
DROP TABLE IF EXISTS local_statements;
DROP TABLE IF EXISTS statements;
CREATE TABLE local_statements ( statementId String, eventDate Date, eventHour DateTime, eventTime DateTime, verb String, objectId String, onCourse... |
<reponame>Starlink/hdf5
h5watch error: unable to open file "../WATCH.h5/DSET_CMPD"
|
<gh_stars>1-10
BEGIN;
CREATE FUNCTION extract_schema_test(nsp regnamespace)
RETURNS SETOF text
LANGUAGE 'plpgsql' AS
$FUNCBODY$
DECLARE
rec RECORD;
rec2 RECORD;
sql TEXT;
BEGIN
sql := format(E'SELECT has_schema(%L::name);\n', nsp);
RETURN NEXT sql;
FOR rec IN
select oid, relname from pg... |
INSERT INTO Common_Password values
('password'),
('12345678'),
('qwerty'),
('123456789'),
('12345'),
('1234'),
('111111'),
('1234567'),
('dragon'),
('123123'),
('baseball'),
('abc123'),
('football'),
('monkey'),
('letmein'),
('696969'),
('shadow'),
('master'),
('666666'),
('qwertyuiop'),
('123321'),
('mustang'),
('1234... |
<filename>dbv-1/data/schema/tblRateSheetArchive.sql
CREATE TABLE `tblRateSheetArchive` (
`RateSheetID` int(11) NOT NULL AUTO_INCREMENT,
`CustomerID` int(11) NOT NULL,
`RateSheet` longblob,
`DateGenerated` datetime NOT NULL,
`FileName` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`Level` varchar(10) COLLATE... |
<gh_stars>0
CREATE TABLE company (
id bigint(20) NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
business_registration_number VARCHAR(10),
status VARCHAR(20) NOT NULL COMMENT 'NORMAL|UNDER_REVIEW',
grade VARCHAR(20) NOT NULL DEFAULT 'BRONZE' COMMENT 'BRONZE|SILVER|GOLD|PLATINUM|DIAMOND',
PR... |
<reponame>davidcruy/temp-file-storage<filename>src/TempFileStorage.SqlServer/install.sql<gh_stars>0
CREATE TABLE [TempFileStorage] (
[Key] nvarchar(10) NOT NULL,
[Filename] nvarchar(max) NOT NULL,
[Filesize] bigint NOT NULL,
[CacheTimeout] datetime2 NOT NULL,
[Content] varbinary(max) NOT NULL,
CONSTR... |
create table tutoriale(Id_tutorial Numeric(2) NOT NULL, Titlu Varchar(200), Image Varchar(200), Teach MEDIUMTEXT NOT NULL, Use MEDIUMTEXT NOT NULL, Level MEDIUMTEXT NOT NULL, Type Varchar(200));
alter table tutoriale add constraint tutoriale_id_pk PRIMARY KEY(Id_tutorial);
insert into tutoriale values('1','3D Printing ... |
CREATE TABLE IF NOT EXISTS intervolga_migrato_log(
ID INT(11) NOT NULL AUTO_INCREMENT,
MIGRATION_DATETIME datetime,
TIMESTAMP_X timestamp not null default current_timestamp,
MODULE_NAME VARCHAR(200),
ENTITY_NAME VARCHAR(200),
DATA_XML_ID VARCHAR(200),
DATA_ID_NUM INT(11),
DATA_ID_STR VARCHAR(200),
DATA_ID_COMP... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 03, 2019 at 03:24 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
<filename>data/shapefile_schema/ne_10m_admin_0_boundary_lines_land.sql
CREATE TABLE "ne_10m_admin_0_boundary_lines_land" (
gid serial,
"fid_ne_10m" int4,
"scalerank" numeric,
"featurecla" varchar(32),
"note_" varchar(32),
"name" varchar(100),
"comment" varchar(100),
"adm0_usa" int2,
"adm0_left" varch... |
<reponame>hhudson/2122
create or replace package blog_mailchimp_pkg as
--create a new mailing list
function create_list (p_list_name in varchar2, --- the name you want to give your new mailing list
p_permission_reminder in varchar2) --- a sentence to remind your recipients how they got ... |
<gh_stars>1-10
create or replace function logout() returns void as $$
begin
perform response.delete_cookie('SESSIONID');
end
$$ security definer language plpgsql;
-- by default all functions are accessible to the public, we need to remove that and define our specific access rules
revoke all privileges on function ... |
<gh_stars>1-10
-- FUNCTION: public.notify_insert_event()
-- DROP FUNCTION public.notify_insert_event();
CREATE FUNCTION public.notify_insert_event()
RETURNS trigger
LANGUAGE 'plpgsql'
COST 100
VOLATILE LEAKPROOF
AS $BODY$DECLARE
record RECORD;
payload JSON;
BEGIN
IF (TG_OP = 'DELETE') T... |
-- AlterTable
ALTER TABLE "Reservation" ADD COLUMN "isApproved" BOOLEAN NOT NULL DEFAULT false;
|
CREATE SCHEMA IF NOT EXISTS ®istry;
COMMENT ON SCHEMA ®istry IS 'Sqitch database deployment metadata v1.0.';
CREATE TABLE ®istry.releases (
version FLOAT PRIMARY KEY,
installed_at TIMESTAMP_TZ NOT NULL DEFAULT current_timestamp,
installer_name TEXT NOT NULL,
i... |
<filename>benchmarks/tpcds/queries/queries_300/76.sql
-- RNGSEED: 1
-- EXPLAIN (FORMAT JSON)
select channel, col_name, d_year, d_qoy, i_category, COUNT(*) sales_cnt, SUM(ext_sales_price) sales_amt FROM (
SELECT 'store' as channel, 'ss_cdemo_sk' col_name, d_year, d_qoy, i_category, ss_ext_sales_price ext_sales... |
use payroll
execute p_add_time_entry @employee_id=39, @entry_date='2020-02-24 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=12, @entry_date='2020-02-24 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=28, @entry_date='2020-02-24 00:00:00', @hours_worked=4
execute p_add_time_entry @e... |
<reponame>tgq52298/test<gh_stars>0
DROP TABLE IF EXISTS `qb_chatmod`;
CREATE TABLE IF NOT EXISTS `qb_chatmod` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uid` int(7) NOT NULL COMMENT '用户UID',
`aid` int(7) NOT NULL COMMENT '圈子id',
`type` tinyint(1) NOT NULL COMMENT '0都可以使用,1只能群聊使用,2只能私聊使用',
`name` varchar(5... |
select /*%expand*/* from primary_message
where id = /*id*/0
|
create table model
(
id varchar(255) not null,
created_by varchar(255),
creation_date timestamp,
last_modified_by varchar(255),
last_modified_date timestamp,
name ... |
/*
Navicat Premium Data Transfer
Source Server : staging
Source Server Type : MySQL
Source Server Version : 50729
Source Host : 192.168.208.253:3306
Source Schema : flow
Target Server Type : MySQL
Target Server Version : 50729
File Encoding : 65001
Date: 26/10/2021 1... |
<reponame>Warglaive/Database-Basics-MS-SQL-May-2018<filename>DATA AGGREGATION/DATA AGGREGATION/18. 3rd Highest Salary.sql
SELECT DISTINCT DepartmentID, Salary FROM(
SELECT DepartmentID, Salary, DENSE_RANK() OVER (PARTITION BY DepartmentId ORDER BY Salary DESC)
AS [Salary Rank]
FROM Employees) AS e
WHERE [Salary Rank... |
USE omts;
CREATE TABLE app_user(
user_id INT NOT NULL AUTO_INCREMENT,
email VARCHAR(256) NOT NULL UNIQUE,
phone_number VARCHAR(15) NOT NULL,
first_name VARCHAR(25) NOT NULL,
middle_name VARCHAR(25),
last_name VARCHAR(25) NOT NULL,
street_number INT NOT NULL,
street_name VARCHA... |
#macro($getSchoolByCode(code))
SELECT * FROM school WHERE code = :code
#end
#macro($getSchoolByCodes(codes))
SELECT * FROM school WHERE code IN :codes
#end
#macro($findAllSchool(status))
select * from school where 1=1
#if(status)
and status=:status
#end
order by code
#end
#macro($getSchoolByDistrictC... |
-- import_mapping
DELETE FROM `import_mapping` WHERE `model` = 'Institution.InstitutionTextbooks';
DELETE FROM `security_functions` WHERE `id` IN (1052);
-- db_patches
DELETE FROM `db_patches` WHERE `issue`='POCOR-3601';
|
<filename>src/Frapid.Web/Areas/MixERP.Sales/db/PostgreSQL/2.x/2.0/src/01.types-domains-tables-and-constraints/tables-and-constraints.sql
DROP SCHEMA IF EXISTS sales CASCADE;
CREATE SCHEMA sales;
CREATE TABLE sales.gift_cards
(
gift_card_id SERIAL PRIMARY KEY,
gift_card_numbe... |
/*
Navicat Premium Data Transfer
Source Server : ucloud
Source Server Type : MySQL
Source Server Version : 50650
Source Host : mysql.ljryh.com:63306
Source Schema : demo
Target Server Type : MySQL
Target Server Version : 50650
File Encoding : 65001
Date: 19/01/2021 1... |
CREATE PROCEDURE SP623(OUT MYCOUNT INTEGER) SPECIFIC SP623_76497 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE488;SELECT COUNT(*)INTO MYCOUNT FROM TABLE394;SELECT COUNT(*)INTO MYCOUNT FROM TABLE415;SELECT COUNT(*)INTO MYCOUNT FROM... |
-- 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 Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
ALTER PROCEDURE [dbo].[GetMappingProjectSummary]
... |
<gh_stars>1-10
Create table test_while_ct(i int, t text); |
<reponame>tapper/Tapper-Schema<gh_stars>0
-- Convert schema '/home/mhentsc3/perl510/lib/site_perl/5.10.0/auto/Tapper/Schema/Tapper-Schema-TestrunDB-3.000001-MySQL.sql' to 'Tapper::Schema::TestrunDB v3.000001':;
BEGIN;
ALTER TABLE message CHANGE COLUMN message message text,
CHANGE COLUMN type type ... |
<filename>database.sql
CREATE TABLE food (
id SERIAL PRIMARY KEY,
name VARCHAR(100),
deliciousness_rating INT NOT NULL,
is_hot BOOLEAN NOT NULL
);
INSERT INTO food (name, deliciousness_rating, is_hot)
VALUES ('Pizza', 75, TRUE),
('Carbonara', 93, TRUE),
('Chocolate', 99, FALSE);
SELECT * FROM food; |
<filename>Q101-200/Q197.sql
select w2.ID as ID
from Weather w1,
Weather w2
where datediff(w1.recordDate, w2.recordDate) = -1
and w1.Temperature < w2.Temperature
; |
<filename>countries_tr.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS `countries_tr` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`iso` char(2) NOT NULL,
`name` varchar(80) NOT NULL,
`nicename` varchar(80) NOT NULL,
`iso3` char(3) DEFAULT NULL,
`numcode` smallint(6) DEFAULT NULL,
`phonecode` int(5) NOT NULL,
PRIM... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 11, 2020 at 09:07 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
/*
SQLyog Ultimate v11.33 (64 bit)
MySQL - 10.1.16-MariaDB : Database - travel_agent
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FORE... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SE... |
CREATE TABLE IF NOT EXISTS `heroes` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(10) UNSIGNED NOT NULL,
`hero_type_id` int(10) UNSIGNED NOT NULL,
`name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (`id`),
UNIQ... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 02 Mar 2021 pada 15.51
-- Versi server: 10.4.14-MariaDB
-- Versi PHP: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Erstellungszeit: 11. Dez 2019 um 17:48
-- Server-Version: 10.1.43-MariaDB-1~xenial
-- PHP-Version: 7.2.25-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET t... |
--
-- Upgrade to database version 009: more meta data on series table
-- Created: Thu May 7 13:26:47 2015
--
BEGIN;
ALTER TABLE series
ADD COLUMN delta_id integer,
ADD COLUMN is_delta boolean NOT NULL DEFAULT FALSE,
ADD COLUMN is_adjusted boolean NOT NULL DEFAULT FALSE;
ALTER TABLE series
ADD CONST... |
<gh_stars>1-10
-- change 'name_of_data_collector' to TEXT type
update attributes_attribute set result_type = 'Text' where key='name_of_data_collector';
delete from attributes_attributeoption where attribute_id = (select id from attributes_attribute where key = 'name_of_data_collector');
|
<filename>third_party/ldbc/queries/sf10/q08.sql<gh_stars>1-10
/* interactive-complex-1 */
select id,
p_lastname,
min(dist) as dist,
p_birthday,
p_creationdate,
p_gender,
p_browserused,
p_locationip,
p1.pl_name
from (
select k_person2id as id, 1 as dist
... |
USE [ANTERO]
GO
/****** Object: StoredProcedure [dw].[p_lataa_amos_opiskelijavuodet_koko] Script Date: 25.10.2019 11:10:43 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dw].[p_lataa_amos_opiskelijavuodet_koko] AS
EXEC Koski_SA.dbo.p_lataa_opiskelijavuodet_valitaulu
EXEC Koski_SA.d... |
-- file:stats.sql ln:97 expect:true
UPDATE trunc_stats_test1 SET id = id + 10 WHERE id IN (1, 2)
|
/*
* Library: IMMZDT06 (IMMZ.DT.06.Pneumococcal)
* Rule: If child or person has not been vaccinated, give Pneumococcal vaccine minimum age 6 weeks old
* Trigger: Patient has never received PCV vaccination
*/
library IMMZDT06
// Start Skeleton CQL
using FHIR version '4.0.1'
include FHIRHelpers version '4.0.1'
inclu... |
<filename>mysql/create-table/hash_tags.sql<gh_stars>0
CREATE TABLE `hash_tags` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`hash_tag` varchar(255) NOT NULL,
`created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`type` varchar(255) DEFAULT NULL,
`p... |
select
ps.logins AS logins,
ps.users AS users,
p.type AS period_type,
p.period AS period,
p.year AS year,
p.from AS period_from,
i.entityid AS idp_entityid,
i.environment AS idp_env
from statsview_periodstats_idptotal ps
inner join statsview_period p on p.id = ps.period_id
inner join statsview_idp i on i.id = ps.idp_id... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: db
-- Creato il: Feb 23, 2021 alle 18:36
-- Versione del server: 5.7.33
-- Versione PHP: 7.4.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
<gh_stars>0
SELECT name, image, uuid, stakeholders, created
FROM changesets
WHERE uuid=$1
|
<filename>test/corpus/dropAggregate.cql
================================================================================
DROP AGGREGATE IF EXISTS aggregate;
================================================================================
DROP AGGREGATE IF EXISTS aggregate;
----------------------------------------------... |
<reponame>gridgentoo/drill-test-framework
select * from dfs.drillTestDir.`parquet_storage/DRILL_6259/DRILL_6259_test_data` t where t.complex_field.nested_field = 111; |
<gh_stars>0
-- Move audit data from active logs to archive log files.
CALL SYSPROC.AUDIT_ARCHIVE(NULL, NULL);
-- Extract audit data from archived log files to ASCII delimited files.
CALL SYSPROC.AUDIT_DELIM_EXTRACT ('',NULL,NULL,'db2audit.db.SECURITY.log.%.20%',' ');
-- Import extracted data from ASCII delimite... |
CREATE TABLE phabricator_repository.repository_shortcut (
id int unsigned not null auto_increment primary key,
name varchar(255) not null,
href varchar(255) not null,
description varchar(255) not null,
sequence int unsigned not null
);
|
-- phpMyAdmin SQL Dump
-- version 3.5.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 07, 2013 at 11:29 PM
-- Server version: 5.1.68-cll
-- PHP Version: 5.2.6
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
2531,10,0
3976,5,0
7903,4,0
2622,2,0
2626,2,0
3941,2,0
629,10,0
660,10,0
665,10,0
683,5,0
609,2,0
652,10,0
11601,10,0
|
--Create BeneficialUse Table
Create Table Cvs.BeneficialUses(
Name nvarchar(100) Not Null,
Term nvarchar(250) NULL,
Definition nvarchar(4000) Null,
State nvarchar(250) Null,
SourceVocabularyURI nvarchar(250) Null,
USGSCategory nvarchar(250) Null,
NAICSCode nvarchar(250) Null,
Primary Key (Name)
);
INSERT INTO Cvs.Bene... |
/*
IF EXISTS (SELECT name FROM sysobjects WHERE (name = 'MemberCase_AddProblemStatement' AND type = 'P'))
DROP PROCEDURE dbo.MemberCase_AddProblemStatement
GO
*/
CREATE PROCEDURE dbo.MemberCase_AddProblemStatement
/* STORED PROCEDURE - INPUTS (BEGIN) */
@memberCaseId BIGINT,
@pro... |
DROP TABLE IF EXISTS refresh_jobs;
create table refresh_jobs(
job_id bigint not null,
role_category text not null,
jurisdiction text not null,
status text not null,
comments text,
user_ids _text NULL,
log text,
linked_job_id bigint,
created timestamp,
constraint refresh_jobs_pkey PRIMARY KEY (job_id)
);
INS... |
<filename>0x0E-SQL_more_queries/hbtn_0d_tvshows_rate.sql
-- MySQL dump 10.13 Distrib 5.7.8-rc, for Linux (x86_64)
--
-- Host: localhost Database: hbtn_0d_tvshows_rate
-- ------------------------------------------------------
-- Server version 5.7.8-rc
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mer 12 Septembre 2018 à 16:30
-- Version du serveur : 5.7.23-0ubuntu0.16.04.1
-- Version de PHP : 7.0.30-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/... |
<reponame>hrr40-sdc2/description
CREATE TABLE homes
(
id SERIAL PRIMARY KEY,
title VARCHAR(256),
is_entire_place VARCHAR(10),
location VARCHAR(256),
super_host_name VARCHAR(20),
super_host_photo VARCHAR(128),
rating... |
-- MySQL Script generated by MySQL Workbench
-- mié 01 jun 2016 18:42:18 VET
-- 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;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE... |
<filename>alternativeQueries/PrintPrimeNumbers.sql<gh_stars>0
SELECT LISTAGG(x.l, '&') WITHIN GROUP (ORDER BY x.l) gr
FROM (SELECT 1 g
, seq.l
, CASE
WHEN seq.l = 1 THEN NULL
WHEN seq.l IN (2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31) THEN 0
WHEN MOD(seq.l, 2) = 0 T... |
CREATE TABLE utB (
B_DATETIME datetime NOT NULL ,
B_Q_ID int NOT NULL ,
B_V_ID int NOT NULL ,
B_VOL tinyint UNSIGNED NOT NULL
);
CREATE TABLE utQ (
Q_ID int NOT NULL ,
Q_NAME varchar (35) NOT NULL
);
CREATE TABLE utV (
V_ID int NOT NULL ,
V_NAME varchar (35) NOT NULL ,
V_COLOR char (1) NOT NULL
);
... |
INSERT INTO Commands
(
Name,
Author,
Cooldown,
Aliases,
Date,
Description,
Code
)
VALUES
(
"update",
"trefis",
5000,
"update",
"11/22/2020, 12:58:41 AM",
"Updating all info about commands from sql files in repo to database. ",
"async function update(database) {
try {
con... |
<gh_stars>0
create database online_registration;
use online_registration;
create table citizens(
id integer not null primary key auto_increment,
last_name varchar(255),
first_name varchar(255),
middle_name varchar(255),
address varchar(255),
phone varchar(255),
email varchar(255)
);
create table users(... |
/*************
* tau09_persona
**************/
insert into tau09_persona(id_persona, nb_persona, tx_primer_ap, tx_segundo_ap, by_foto)
values(nextval('tau09_persona_seq'), '<NAME>', 'Mera', 'Torres', NULL);
insert into tau09_persona(id_persona, nb_persona, tx_primer_ap, tx_segundo_ap, by_foto)
values(nextval('tau09... |
INSERT INTO tweb_apbd(`rangkuman`,`berkas_id`,`lembaga_id`, `lembaga_kode`,`pemda_kode`, `wilayah_kode`,`tahun`, `rekening_kode`,`rekening`, `uraian`, `nominal`,`nominal_sebelum`, `nominal_sesudah`, `nominal_perubahan`, `nominal_persen`, `keterangan`, `created_by`, `updated_by`) VALUES
('0','159','77','1.21.01','1.21'... |
<filename>benchmarks/bench_002/bench_002_pearson_fix.sql
-- This query generated by script/generate_corr_queries.py and should probably not be
-- modified manually. Instead, make changes to that script and rerun it.
WITH
raw_effect_sizes AS (
SELECT
state_user_v_peer_open,
business_type,
C... |
<gh_stars>1-10
--Get all customers with addresses (RIGHT JOIN)
SELECT firstName, lastName, Addresses.city
FROM Customers
RIGHT JOIN Addresses
ON addressID = Addresses.id
WHERE Addresses.city = 'city3'
ORDER BY lastName;
--Get all customers with addresses (LEFT JOIN)
SELECT firstName, lastName, Addresses.city
FROM Cus... |
USE NPPES
DROP TABLE [dbo].[txcodes];
GO
CREATE TABLE [dbo].txcodes (
Code NCHAR(10),
Grouping NVARCHAR(80),
Classification NVARCHAR(110),
Specialization NVARCHAR(80),
Definition NVARCHAR(MAX)
);
GO
CREATE INDEX txcodes_idx on [dbo].[txcodes](Code);
GO
|
-- SHORTKEY
-- by <NAME> (andyet.com); turbo (github.com/turbo)
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
DO $$ BEGIN
CREATE DOMAIN SHORTKEY as varchar(11);
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
CREATE OR REPLACE FUNCTION shortkey_generate()
RETURNS TRIGGER AS $$
DECLARE
gkey TEXT;
key SHORTKEY;... |
CREATE TABLE `<<__prefix__>>player_achievement` (
`id` BIGINT NOT NULL AUTO_INCREMENT ,
`playerId` BIGINT NOT NULL ,
`dataId` VARCHAR(50) NOT NULL ,
`progress` INT NOT NULL ,
`earned` BOOLEAN NOT NULL ,
`createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`updatedAt` DATETIME on update CURRENT_... |
<reponame>jdkoren/sqlite-parser<filename>src/test/resources/view.test_22.sql
-- view.test
--
-- execsql {
-- SELECT min(x), min(a), min(b), min(c), min(a+b+c) FROM v2;
-- }
SELECT min(x), min(a), min(b), min(c), min(a+b+c) FROM v2; |
<filename>src/smif/data_layer/database/migrations/down-specifications.sql
DROP TABLE IF EXISTS specifications; |
<filename>schema/generate/67-schema_update_69.sql
BEGIN;
DROP TABLE IF EXISTS "augur_data"."unresolved_commit_emails";
CREATE TABLE "augur_data"."unresolved_commit_emails" (
"email_unresolved_id" serial8,
"email" varchar COLLATE "pg_catalog"."default" NOT NULL,
"name" varchar COLLATE "pg_catalog"."default",
"t... |
DROP FUNCTION IF EXISTS de_metas_fresh_kpi.KPI_Sales_Price_Range (IN startdate DATE, IN enddate DATE);
CREATE OR REPLACE FUNCTION de_metas_fresh_kpi.KPI_Sales_Price_Range (IN startdate DATE, IN enddate DATE)
RETURNS TABLE
(
max_product_value character varying,
max_product_name character varying,
max_price numeric,
... |
-- era constructor
WITH cteSource (@eraGroup, start_date, end_date, groupid) AS
(
SELECT
@eraGroup
, start_date
, end_date
, dense_rank() over(order by @eraGroup) as groupid
FROM #collapse_input so
)
,
----------------------------------------------------------------------------------------------------------... |
{% macro get_product_event_type_counts (event_type) %}
SELECT product_id
,SUM(case WHEN event_type='{{ event_type }}' THEN 1 else 0 end) AS {{ event_type }}
FROM {{ ref ('fct_events') }}
WHERE product_id is not null
GROUP BY 1
{% endmacro %} |
ALTER TABLE dbo.TEST_TBL2
ADD
FOREIGN KEY (
TEST_TBL1_ID
) REFERENCES dbo.TEST_TBL1 (
TEST_TBL1_ID
)
|
<gh_stars>1-10
-->-->-- src/Frapid.Web/Areas/MixERP.Finance/db/SQL Server/2.x/2.0/src/02.functions-and-logic/logic/finance.get_net_profit.sql --<--<--
IF OBJECT_ID('finance.get_net_profit') IS NOT NULL
DROP FUNCTION finance.get_net_profit;
GO
CREATE FUNCTION finance.get_net_profit
(
@date_from ... |
<gh_stars>10-100
-- 2032 care_site based entropy
--INSERT INTO @results_schema.heracles_results (cohort_definition_id,
--analysis_id,
--stratum_1,
--stratum_2,
--stratum_3,
--stratum_4)
SELECT @cohort_definition_id AS cohort_definition_id,
2032 AS analysis_id,
entropyT.care_site_id as strat... |
-- MySQL dump 10.16 Distrib 10.1.26-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: admin_dev
-- ------------------------------------------------------
-- Server version 10.1.26-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... |
<filename>distro/sql/upgrade/all/flowable.mysql.upgradestep.6.1.2.to.6.2.0.all.sql
insert into ACT_GE_PROPERTY values ('common.schema.version', '6.2.0.0', 1);
insert into ACT_GE_PROPERTY values ('identitylink.schema.version', '6.2.0.0', 1);
alter table ACT_RU_TASK add column SCOPE_ID_ varchar(255);
alter table ACT_RU_T... |
<gh_stars>1-10
DROP VIEW IF EXISTS view_daftar_pengadaan_dppkad;
CREATE VIEW view_daftar_pengadaan_dppkad AS
SELECT
*
FROM
view_daftar_pengadaan_p_kabupaten
WHERE
1 = 1 AND
id_skpd = 19;
GRANT ALL PRIVILEGES ON view_daftar_pengadaan_dppkad TO lap_dppkad;
REVOKE INSERT, UPDATE, DELETE ON view_daftar_pengadaan_dppk... |
<reponame>russell-todd-sorensen/wtk
-- =========================================
-- Create table cor_user_types
-- =========================================
CREATE TABLE cordb.cor_user_types
(
type_id int
CONSTRAINT cor_ust_type_id_pk PRIMARY KEY
CONSTRAINT cor_ust_type_id_nn NOT NULL,
type_name varchar(128)
C... |
create proc dbo.sCreateRequest
(
@FktStaticStatusRequest int,
@FktProject int,
@DataEntity nvarchar(255),
@UidNode nvarchar(255),
@Author nvarchar(255),
@Date datetime,
@Id int out
)
as
begin
set transaction isolation level serializable;
begin tran;
insert into... |
<reponame>gogiyura/shop-app
show databases;
use shop;
drop table if exists users;
create table users(
id int not null auto_increment;
name varchar(20);
email varchar(64) unique ;
password varchar(32);
phoneNumber VARCHAR(13);
role enum ("user", "admin");
blocked;
) |
<gh_stars>0
-- This query works, but we can save a lot of code using LEAD and LAG functions
SELECT
t.EmployeeName
, t.ShiftName
, t.ShiftDate
, (
SELECT TOP 1
ShiftDate
FROM EmployeeShift AS tlead
WHERE
tlead.EmployeeName = t.EmployeeName
AND t.ShiftName = tlead.ShiftName
AND tlead.ShiftDate > t.Sh... |
-- phpMyAdmin SQL Dump
-- version 4.4.13.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 07, 2016 at 05:44 PM
-- Server version: 5.6.28-0ubuntu0.15.10.1
-- PHP Version: 5.6.11-1ubuntu3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... |
<gh_stars>0
create table
test_normalization.`conflict_stream_array_conflict_stream_array__dbt_tmp`
as (
-- Final base SQL model
select
_airbyte_conflict_stream_array_hashid,
conflict_stream_name,
_airbyte_emitted_at,
_airbyte_conflict_stream_array_2_hashid
from _airbyte_test_normalizatio... |
INSERT IGNORE INTO `#__rsfirewall_feeds` (`id`, `url`, `limit`, `ordering`, `published`) VALUES
(1, 'http://feeds.joomla.org/JoomlaSecurityNews', 5, 1, 0); |
<reponame>dorvax/TSQL_RFM
USE BOOKING_EXPORT
GO
/* BORRA LAS TABLAS */
IF OBJECT_ID('tempdb..#R') IS NOT NULL
DROP TABLE #R
IF OBJECT_ID('tempdb..#F') IS NOT NULL
DROP TABLE #F
IF OBJECT_ID('tempdb..#M') IS NOT NULL
DROP TABLE #M
IF OBJECT_ID('MATRIX') IS NOT NULL
DROP TABLE MATRIX
IF OB... |
INSERT INTO pos_itemtemp VALUES("IBIPT190000096","193022","191001","192003","30000","1","30000","0","30000","1","1","1","IBIP1106190853","NHO2018000009","PAID","","193022"),
("IBIPT190000096","193055","191002","192010","17000","1","17000","0","17000","1","1","1","IBIP1106190853","NHO2018000009","PAID","hot","193055"),
... |
CREATE TABLE [dbo].[TimeRecords] (
[ID] INT NOT NULL,
[Salary] FLOAT NOT NULL
);
|
create table allocations (
id bigint(20) not null auto_increment,
project_id bigint(20),
user_id bigint(20),
first_day datetime,
last_day datetime,
primary key (id)
)
engine = innodb
default charset = utf8;
|
<reponame>jyogu-i/spring-boot-rest-example
SELECT english_id,english FROM public."English"; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.