sql
stringlengths
6
1.05M
<filename>test/fixtures/mysql-pk-complex-all.sql create table `mysql-pk-complex-all` ( `'text'field` varchar(5), ```int``field` integer, `"num"1` numeric(8,6), primary key (`'text'field`, ```int``field`, `"num"1`) ); insert into `mysql-pk-complex-all` (`'text'field`, ```int``field`, `"num"1`) values ('hello', 1, ...
Insert into eg_action (id,name,url,queryparams,parentmodule,ordernumber,displayname,enabled,contextroot,version,createdby,createddate,lastmodifiedby,lastmodifieddate,application) values (nextval('SEQ_EG_ACTION'),'SearchChequesOfRemittance','/payment/chequeAssignment-searchChequesOfRemittance.action',null,(select id fro...
<reponame>anthonymbowman/index-coop-analytics --https://dune.xyz/queries/90330 drop table if exists dune_user_generated.holders_ever_had_250dpi; create table dune_user_generated.holders_ever_had_250dpi as select holder, min(days) as days from dune_user_generated.dpi_balance_by_day where dpi_balance >= 250 gro...
<gh_stars>100-1000 -- -- PostgreSQL database dump -- -- Dumped from database version 12.2 -- Dumped by pg_dump version 12.2 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('se...
<gh_stars>10-100 -- file:alter_table.sql ln:1743 expect:true CREATE TYPE tt_t0 AS (z inet, x int, y numeric(8,2))
<gh_stars>100-1000 SELECT * FROM t1 ORDER BY c2 - c1 ASC
DROP VIEW IF EXISTS M_Packageable_V; CREATE OR REPLACE VIEW M_Packageable_V AS SELECT p.* -- note: keep in sync with de.metas.inoutcandidate.api.Packageable.getQtyPickedOrDelivered() , p.QtyDelivered + p.QtyPickedNotDelivered + p.QtyPickedPlanned as QtyPickedOrDelivered FROM ( SELECT -- -- BPartner p.C_BPar...
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5527550_sys_gh5041_payment_reservation_window.sql -- 2019-07-18T07:19:57.467Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Window (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Win...
-- 2019-05-28T13:08:43.616 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_TreeNodeMM SET Parent_ID=1000098, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=541134 AND AD_Tree_ID=10 ; -- 2019-05-28T13:08:43.627 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD...
insert into donations(donor, donee, amount, donation_date, donation_date_precision, donation_date_basis, url, notes) values ('<NAME>','Donor lottery',10.0,'2018-12-07','day','transaction','https://app.effectivealtruism.org/lotteries/63715163508812','January 2019 $100k lottery, Block 1, [0–109,951,161]. See https://...
<gh_stars>1-10 /* Copyright (C) 2015 IASA - Institute of Accelerating Systems and Applications (http://www.iasa.gr) 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/licen...
-- -- 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 License, Version 2.0 (the -- "License"); you ma...
<gh_stars>0 insert into burger (burger_name, devoured) values ('Big Mac', true); insert into burger (burger_name, devoured) values ('Whopper', false); insert into burger (burger_name, devoured) values ('Whataburger', true);
-- Drop TABLE drop table ATBMHTTT_LAB02.Employee_1412105 cascade constraints PURGE; drop table ATBMHTTT_LAB02.Branch_1412105 cascade constraints PURGE; drop table ATBMHTTT_LAB02.Department_1412105 cascade constraints PURGE; drop table ATBMHTTT_LAB02.Projects_1412105 cascade constraints PURGE; drop table ATBMHTTT_LAB02....
--Merge employees and titles and retrieve list of retirees by title SELECT e.emp_no, e.first_name, e.last_name, ti.title, ti.from_date, ti.to_date INTO retirees_by_title FROM titles as ti LEFT JOIN employees AS e ON (ti.emp_no = e.emp_no) WHERE (e.birth_date BETWEEN '1952-01-01' AND '1955-12-31') ORDER BY emp_no; --R...
<gh_stars>1-10 DROP TABLE PARENT_GRADE;
<filename>sql/2020/05_Media/meta_open_video_types.sql #standardSQL # meta open graph video types # returns all the data we need from _almanac CREATE TEMPORARY FUNCTION get_meta_og_video_types(almanac_string STRING) RETURNS STRUCT< video_types ARRAY<STRING> > LANGUAGE js AS ''' var result = {}; try { var almanac ...
<gh_stars>1-10 DROP SCHEMA IF EXISTS SANDBOX_POC1.EMPLOYEES;
select -- Required Columns 'acs:ram::' || a.account_id as resource, case when require_numbers then 'ok' else 'alarm' end as status, case when minimum_password_length is null then 'No password policy set.' when require_numbers then 'Number required.' else 'Number not required.' end as rea...
<filename>db/base_nueva_prod/estructura/db_captacion.sql<gh_stars>0 -- -- Base de datos: `db_captacion` -- DROP SCHEMA IF EXISTS `db_captacion` ; CREATE SCHEMA IF NOT EXISTS `db_captacion` DEFAULT CHARACTER SET utf8 ; USE `db_captacion` ; -- GRANT ALL PRIVILEGES ON `db_captacion`.* TO 'uteg'@'localhost' IDENTIFIED BY ...
<gh_stars>1-10 drop table if exists c; drop table if exists b; drop table if exists a; create table a (a int primary key); create table b (a int, b int primary key, constraint foreign key (a) references a(a) on delete cascade) partition by range (b) ( partition before_2 values less than (2), partition before_4...
<filename>sehat_i.sql /* SQLyog Ultimate v12.4.3 (64 bit) MySQL - 10.4.19-MariaDB : Database - sehat_i ********************************************************************* */ /*!40101 SET NAMES utf8 */; /*!40101 SET SQL_MODE=''*/; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OL...
USE `sss`; SELECT REVERSE(s.`name`) AS `reversed_name`, CONCAT_WS('-', UPPER(t.`name`), a.`name`) AS `full_address`, COUNT(e.`id`) AS `employees_count` FROM `stores` AS s JOIN `addresses` AS a ON s.`address_id` = a.`id` JOIN `towns` AS t ON a.`town_id` = t.`id` JOIN ...
CREATE TABLE user_contact ( id BIGSERIAL NOT NULL, user_id INTEGER NOT NULL, contact_type_id SMALLINT NOT NULL, contact_name VARCHAR(512), ord_num SMALLINT NOT NULL DEFAULT 1 ); CREATE INDEX user_contact_combo on user_contact(user_id, contact_type_id); ALTER TABLE user_contact ADD CONSTRAINT user_contact_pkey PR...
<filename>sql7.sql select rating, count(*) from film group by rating; select replacement_cost,count(*) from film roup by replacement_cost having count(*)>50 ; select store_id, count(customer_id) from customer group by store_id; select country_id, count(*) from city group by country_id order by count(*) desc limit 1;
<reponame>chehsunliu/zcvf --liquibase formatted sql --changeset chehsunliu:1 context:author-test INSERT INTO author (email, username, password) VALUES ('<EMAIL>', 'admin', '$2a$12$GgM8F35mtz2CG7x9Vr2ip.Wc/PUP.4cLy/tBeKkczovJCtcGwR62C'), ('<EMAIL>', 'a1', '$2a$12$cZbB0Zb9BQCAUjJQpmrXjOktCq5/.p2j6...
CREATE USER 'notification'@'%' IDENTIFIED BY '<PASSWORD>'; CREATE DATABASE IF NOT EXISTS `notification`; GRANT ALL PRIVILEGES ON `notification`.* TO 'notification'@'%';GRANT ALL PRIVILEGES ON `notification\_%`.* TO 'notification'@'%'; flush privileges;
<gh_stars>0 alter table eg_collectionindex add column arrearcess double precision; alter table eg_collectionindex add column currentcess double precision; alter table eg_collectionindex add column installmentfromdate date; alter table eg_collectionindex add column installmenttodate date; alter table eg_collectionin...
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; DROP TABLE IF EXISTS `car`; CREATE TABLE IF NOT EXISTS `car` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `model` VARCHAR(50) NOT NULL, `brand` VARCHAR(50) NO...
INSERT INTO trips (user, miles, tips, description, createdAt, updatedAt) VALUES ("Dan", 50, 100, "Pizza Hut", "2018/04/20", "2018/04/20"); INSERT INTO trips (user, miles, tips, description, createdAt, updatedAt) VALUES ("Jim", 75, 1000, "Dominos", "2018/04/20", "2018/04/20"); INSERT INTO trips (user, miles, tips, descr...
SELECT d.subject_id AS `subject`, p.block, p.task, d.unique_unix_timestamp AS `timestamp`, d.`Driver's longitudinal velocity (miles/hour)` AS `velocity` FROM daq d INNER JOIN protocol_nback p ON ( d.subject_id = p.subject_id AND d.unique_unix_timestamp BETWEEN p.start_timestamp AND ...
<reponame>BrenPatF/timer_set_oracle<filename>install_prereq/app/install_app_all.sql @c_trapit_syns lib @install_col_group
<filename>src/main/sql/V3__postsoftag_view.sql create view postsoftag as select t.tag_id tag, array_agg(t.post_id) posts from taginpost t group by tag;
<reponame>mrlmaia/pwfinal<filename>bd/script.sql drop schema if exists `trabalhoFinalPW`; CREATE SCHEMA IF NOT EXISTS `trabalhoFinalPW` DEFAULT CHARACTER SET utf8 ; USE `trabalhoFinalPW` ; drop table if exists TbIngrediente; CREATE TABLE if not exists TbIngrediente ( id INT NOT NULL AUTO_INCREMENT, nome VARCHAR(45...
<reponame>balazskrizsan/stack-judge-java -- requires: preset_add_10_groups.sql INSERT INTO "review" (id, group_id, visibility, rate, review, created_at, created_by) VALUES (103001, 101001, 0, 2, 'long review test 1', '2021-01-16 01:50:01', 123), (103002, 101001, 0, 2, 'long review test 2', '2021-01-17 01:50:01',...
-- file:create_view.sql ln:358 expect:true select pg_get_viewdef('v2', true)
<filename>src/test/resources/sql/create_type/ff77bfe1.sql -- file:plpgsql.sql ln:3008 expect:true create type record_type as (x text, y int, z boolean)
### Schema DROP DATABASE IF EXISTS boiga_db; CREATE DATABASE boiga_db; USE boiga_db; CREATE TABLE boigas ( id iNT NOT NULL AUTO_INCREMENT, burger_name VARCHAR(255) NOT NULL, devoured BOOLEAN NOT NULL, PRIMARY KEY (id) );
<filename>kpi-dashboard/setup.sql<gh_stars>0 CREATE OR REPLACE STREAM purchases ( sku VARCHAR KEY, name VARCHAR, description VARCHAR, price DECIMAL(10,2) ) WITH ( KAFKA_TOPIC = 'purchases', VALUE_FORMAT = 'AVRO', VALUE_AVRO_SCHEMA_FULL_NAME='io.confluent.developer.dashboard.Purchase', PARTITIONS = 3 );
<gh_stars>0 create table cpt_descriptions as with short_desc as ( select code, str as short_desc from mrconso where SAB = 'CPT' and tty='AB' ), consumer_desc as ( select code, str as consumer_desc from mrconso where SAB = 'CPT' and tty='ETCF' ), clinician_desc as ( select code, str as clinician_desc from mrconso wh...
SELECT 'Length of observation' AS "seriesName", cast(ar1.stratum_1 AS INT) * 30 AS "xLengthOfObservation", round(1.0 * sum(ar2.count_value) / denom.count_value, 5) AS "yPercentPersons" FROM (SELECT * FROM @results_database_schema.ACHILLES_results WHE...
<filename>dbt-greenery/models/data_marts/product/facts/facts_products_promos.sql {{ config( materialized='table' ) }} with facts_products_promos as ( SELECT sum_product_price, sum_product_quantity, sum_promo_discount_percentages FROM {{ref('int_products_promos')}} ) SELECT * FROM facts_...
<reponame>peilii/benchbase<gh_stars>0 -- Epinions DDL for Oracle DDL -- Drop all tables BEGIN EXECUTE IMMEDIATE 'DROP TABLE "review"'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE; END IF; END;; BEGIN EXECUTE IMMEDIATE 'DROP TABLE "review_rating"'; EXCEPTION WHEN OTHERS THEN IF SQLCODE != -942 THEN RAISE;...
<filename>conf/evolutions/default/5.sql # --- !Ups CREATE TABLE locations ( location_id serial PRIMARY KEY, location_name text NOT NULL, location_areas text[] NOT NULL, location_lat numeric(10,7) NOT NULL, location_lng numeric(10,7) NOT NULL );; INSERT INTO locations (location_id, location_name, location_areas...
<gh_stars>1-10 CREATE TABLE FLOWABLE.ACT_CO_DATABASECHANGELOGLOCK (ID INTEGER NOT NULL, LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255), CONSTRAINT PK_ACT_CO_DATABASECHANGELOGLOC PRIMARY KEY (ID)); DELETE FROM FLOWABLE.ACT_CO_DATABASECHANGELOGLOCK; INSERT INTO FLOWABLE.ACT_CO_DATABASECHANGEL...
-- unionall select count(ORDER_ID) as ORDER_ID from TEST_KYLIN_FACT as TEST_A where ORDER_ID <> 1 union all select count(ORDER_ID) as ORDER_ID from TEST_KYLIN_FACT as TEST_B
<reponame>pvanheus/irida -- user account required for integration tests INSERT INTO user (`createdDate`, `modifiedDate`, `email`, `firstName`, `lastName`, `locale`, `password`, `phoneNumber`, `username`, `enabled`, `system_role`, `credentialsNonExpired`) VALUES (now(), now() , '<EMAIL>', 'Franklin', 'Bristow', 'en', '$...
-- Simple twitter-like appliction -- -- Supports: -- Users (author table) -- Tweets (tweet table) -- @user references (mention table) -- Hashtags (hashtag table); -- Followers (follow table). -- -- Some notes about this schema: -- Tweets have ascending auto-increment ids -- timestamp(2) on...
-- liquibase formatted sql logicalFilePath:dict/ServiceType -- changeset SYS:20210406-0 INSERT INTO "sys_dict"("data_dict_id", "dict_code", "dict_name", "dict_value", "dict_class", "seq", "pid", "dict_desc", "status", "created_time", "created_by", "updated_time", "updated_by", "tenant_id", "visibility", "catalog_id", ...
<filename>sql/create_scripts/table_articles.sql -- CREATE TABLE IF NOT EXISTS "dbo"."Articles" ( "ArticleID" VARCHAR(36) NOT NULL, "CategoryID" VARCHAR(36), "UserID" VARCHAR(36) NOT NULL, "PublishedDate" TIMESTAMP, "LastEditionDate" TIMESTAMP DEFAULT current_timestamp, "Title" VARCHAR(255) NOT NULL, "C...
CREATE SCHEMA IF NOT EXISTS MEDICAL_DATA; CREATE TABLE IF NOT EXISTS MEDICAL_DATA.doctor ( id INTEGER IDENTITY, first_name VARCHAR(100) NOT NULL, last_name VARCHAR(100) NOT NULL, city VARCHAR(100) NOT NULL, zip VARCHAR(100) NOT NULL, profession VARCHAR(100) NOT NULL );
<filename>update/1.0.1/update.sql CREATE TABLE `translations` ( `key` varchar(255) NOT NULL default '', `language` varchar(2) character set utf8 collate utf8_bin default NULL, `text` text, KEY `language` (`language`), KEY `key` (`key`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO `users_permis...
<filename>migrations/2022-03-27-142355_submissions/up.sql CREATE TABLE submissions( submission_id VARCHAR NOT NULL PRIMARY KEY, assignment_id VARCHAR NOT NULL, user_id VARCHAR NOT NULL, submitted_date DATE, submitted_time TIME, on_time BOOLEAN, marks_allotted INT, submitted BOOLEAN NOT N...
<reponame>DimitarIvanov8/software-university<filename>DB_Basics_MS_SQL_Server/Functions and Procedures/Functions and Procedures - All Exercises.sql --==================== -- For Exercises 1 - 8 -- USE SoftUni --==================== --1. Employees with Salary Above 35000 CREATE PROC dbo.usp_GetEmployeesSalaryAbove35000...
/* Author: <NAME> Github: https://github.com/fukakai Portfolio: http://romain.dalichamp.fr Contact: <EMAIL> */ select CITY from STATION where REGEXP_LIKE (CITY, '^[^AEIOU](.+)$') group by CITY;
<gh_stars>0 DELETE FROM purchases WHERE item_id=4; DELETE FROM items WHERE id=4;
SET NAMES utf8; DROP TABLE IF EXISTS "countries"; CREATE TABLE "countries" ( "id" int(11) NOT NULL, "name" varchar(75) NOT NULL DEFAULT "", "alpha_2" char(2) NOT NULL DEFAULT "", "alpha_3" char(3) NOT NULL DEFAULT "", PRIMARY KEY ("id") ) ENGINE=MyISAM DEFAULT CHARSET=utf8; INSERT INTO "countries" ("id", "...
-- ****************** PostgreSQL ******************; -- ************************************************; -- ************************************** "privileges" CREATE TABLE "privileges" ( "id" serial PRIMARY KEY , "name" varchar(255) NOT NULL , "created_at" timestamp with time zone NOT NULL D...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Dec 21, 2016 at 04:52 PM -- Server version: 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_CLIENT=@@CHARACTER_SET_CL...
--USE [SoftUni] --GO CREATE PROCEDURE usp_GetEmployeesSalaryAbove35000 AS BEGIN SELECT [FirstName] AS [First Name], [LastName] AS [Last Name] FROM [Employees] WHERE [Salary] > 35000 END --GO --EXEC usp_GetEmployeesSalaryAbove35000
-- MySQL dump 10.16 Distrib 10.1.34-MariaDB, for Win32 (AMD64) -- -- Host: localhost Database: lcddbd -- ------------------------------------------------------ -- Server version 10.1.34-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC...
/* Navicat MySQL Data Transfer Source Server : localhost Source Server Version : 50505 Source Host : localhost:3306 Source Database : zhoufei Target Server Type : MYSQL Target Server Version : 50505 File Encoding : 65001 Date: 2016-06-26 19:23:55 */ SET FOREIGN_KEY_CHECKS=0; -- -...
-- MySQL dump 10.13 Distrib 5.5.38, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: seats -- ------------------------------------------------------ -- Server version 5.5.38-0ubuntu0.14.04.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHA...
<gh_stars>1-10 --liquibase formatted sql --see http://www.liquibase.org/ --changeset <EMAIL>:1 --preconditions onFail:HALT onError:HALT --precondition-sql-check expectedResult:0 SELECT COUNT(*) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'country_subdivision' -- Country subdivision -- http://schema.org/Country ...
create procedure h3giGetMobileSalesAssociatedName @mobileSalesAssociatesNameId int as begin /* h3giGetMobileSalesAssociatedName gets a single h3giMobileSalesAssociatedName using the id */ select [mobileSalesAssociatesNameId], [employeeFirstName], [employeeSurname], [payrollNumber], [b4nRe...
<filename>data/imdb/movies/director_check.sql select distinct c.artist -- count(*) from staging.context as c join director_context as d on c.release_group = d.release_group and c.artist_id = d.artist_id -- where d.release_group is null ;
<filename>src/main/resources/db/migration/V13__Update_Medical_Exam.sql alter table medical_examination drop constraint if exists medical_examination_fk1; alter table medical_examination drop constraint if exists medical_examination_fk2; alter table medical_examination drop column if exists main_disease_id; alter ...
-- pagerfault.test -- -- execsql { -- BEGIN; -- INSERT INTO t1 VALUES(1,2); -- INSERT INTO t2 VALUES(3,4); -- COMMIT; -- } BEGIN; INSERT INTO t1 VALUES(1,2); INSERT INTO t2 VALUES(3,4); COMMIT;
-- file:create_function_3.sql ln:139 expect:true CREATE FUNCTION functest_IS_1(a int, b int default 1, c text default 'foo') RETURNS int LANGUAGE SQL AS 'SELECT $1 + $2'
-- file:strings.sql ln:563 expect:true SELECT encode(overlay(E'Th\\000omas'::bytea placing E'\\002\\003'::bytea from 8),'escape')
<gh_stars>100-1000 -- TABLES CREATE TABLE IF NOT EXISTS `bx_posts_reports` ( `object_id` int(11) NOT NULL default '0', `count` int(11) NOT NULL default '0', UNIQUE KEY `object_id` (`object_id`) ) ENGINE=MYISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `bx_posts_reports_track` ( `id` int(11) NOT NULL AUT...
use master go if exists(select name from sysdatabases where name='ws5') drop Database ws5 go Create Database ws5 go use ws5 go create table Khoa( makhoa varchar(20) primary key, tenkhoa nvarchar(40), socbgd int) create table Lop( malop int identity(1,1) primary key, tenlop nvarchar(30), makhoa varchar(20) foreign key...
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5577380_sys_tune_ad_changelog.sql drop view if exists ad_changelog_counts_v; create view ad_changelog_counts_v as select l.ad_table_id, t.tablename, l.ad_column_id, c.columnname, count(l.ad_changelog_id) as co...
INSERT INTO offer ( offer_id, merchant_id, description, offering_id, price, currency_code, active_start_date, active_end_date, status_code ) VALUES ( 'repository-test-offer-id-1001', 'repository-test-merchant-id-1', 'Interesting offer 1001', 'offering-id-1', 12.34, 'GBP', '2018-01-01', '2018-01-31 23:59:5...
CREATE TABLE `todo_users` ( `user_id` INT NOT NULL AUTO_INCREMENT , `username` VARCHAR(80) NOT NULL , `password` VARCHAR(32) NOT NULL , PRIMARY KEY (`user_id`)) ENGINE = InnoDB;
<gh_stars>0 #standardSQL # 07_16: Percentiles of time to interactive #This metric comes from Lighthouse SELECT percentile, ROUND(APPROX_QUANTILES(tti, 1000)[OFFSET(percentile * 10)] / 1000, 2) AS tti FROM ( SELECT CAST(IFNULL(JSON_EXTRACT(report, '$.audits.consistently-interactive.numericValue'), JSON_EXTRACT...
<reponame>schioler/timeregistration create or replace view vw_user_registration as select u.id as user_id, u.login as user_login, item.id as item_id, item.project_name as item_project_name, item.item_name as item_item_name, cc.client_name, cc.client_code, cc.client_code_name, pc.provider_name, pc.provider_cod...
<reponame>robjlong/data-check -- [data_testing].[DeleteQueryAssignment] -- -- -- -- -- -- -- EXEC [data_testing].[DeleteQueryAssignment] -- -------------------------------------------------------------------------------- -- Change History ----------------------------------------------------------------------------...
/* ================================================================ * This script adds custom campuses to the base Rock install so other fields can use the name and shortcodes as lookup values. Rock v8.7 * ================================================================ */ DECLARE @True bit = 1 DECLARE @False bit ...
<reponame>geotim90/Nevini CREATE TABLE osu_user ( user_id INT NOT NULL, mode INT NOT NULL, user_name VARCHAR(256) NOT NULL, join_date BIGINT NOT NULL, count300 INT NOT NULL, count100 INT ...
<gh_stars>1-10 --To disable this model, set the using_refund_receipt variable within your dbt_project.yml file to False. {{ config(enabled=var('using_refund_receipt', True)) }} with refund_receipts as ( select * from {{ref('stg_quickbooks__refund_receipt')}} ), refund_receipt_lines as ( select * from ...
<gh_stars>1000+ # Rename jiveUser to ofUser ALTER TABLE jiveUser DROP INDEX jiveUser_cDate_idx; RENAME TABLE jiveUser TO ofUser; ALTER TABLE ofUser ADD INDEX ofUser_cDate_idx (creationDate); # Rename jiveUserProp to ofUserProp RENAME TABLE jiveUserProp TO ofUserProp; # Rename jiveUserFlag to ofUserFlag ALTER TABLE ji...
\d cr_heap_ctas select count(*) from cr_heap_ctas; drop table cr_heap_ctas; drop table cr_seed_table;
DROP VIEW IF EXISTS view_penyusutan_jij_2017_a1 CASCADE; CREATE VIEW view_penyusutan_jij_2017_a1 AS SELECT * FROM (SELECT jalan_irigasi_jaringan.id_sub_skpd, sub_skpd.nama_sub_skpd, sub_skpd.id_skpd, skpd.nama_skpd, skpd.id_lokasi_bidang, lokasi_bidang.nama_lokasi_bidang, lokasi_bidang.id_kabupaten, kabupaten....
<reponame>banjocat/calorie-find CREATE EXTENSION pg_trgm; SELECT set_limit(1.0);
<filename>frontend/database/schema.sql /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; /*!40103 SET TIME_ZONE='+00:00' */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=...
ALTER TABLE codes DROP CONSTRAINT codes_max_uses_check, ADD COLUMN discount_as_percentage BIGINT NULL, ADD CONSTRAINT discount_absolute_xor_percentage CHECK(code_type <> 'Discount' OR ((discount_as_percentage IS NOT NULL AND discount_in_cents IS NULL) OR (discount_as_percentage IS NULL AND discount_in_cents IS NO...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Aug 10, 2020 at 11:58 AM -- Server version: 5.7.29 -- PHP Version: 7.3.17 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@...
alter table SmallGroup modify SET_ID null; alter table SmallGroupEvent modify GROUP_ID null;
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE FUNCTION [dbo].[get_products_names](@name NVARCHAR(32)) RETURNS TABLE AS RETURN SELECT product_id, name FROM products WHERE name LIKE ('%' +@name + '%') AND archived = 0 GO
<reponame>sinotopia/sinotopia -- -- Copyright 2010-2016 the original author or authors. -- -- 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/licen...
DROP TABLE IF EXISTS `ledger_transactiontype`; DROP TABLE IF EXISTS `ledger_settings`; DROP TABLE IF EXISTS `ledger_ledger`; DROP TABLE IF EXISTS `ledger_banknamelookup`; DROP TABLE IF EXISTS `ledger_entity`; DROP TABLE IF EXISTS `ledger_category`; DROP TABLE IF EXISTS `auth_user`; DROP TABLE IF EXISTS `sync_hosts`; DR...
<gh_stars>0 CREATE TABLE IF NOT EXISTS guilds( gid bigint, -- guild id prefix varchar(15), -- prefix in that server replies bool, -- whether or not the should reply to "emeralds" and "villager bot" difficulty varchar(15), -- difficulty for mob spawns and other things lang varchar(5), -- la...
<reponame>GilTeixeira/feup-bdad .mode columns .headers on .nullvalue NULL SELECT SeccaoID AS Seccao, SUM(Salario) AS Despesa FROM ( SELECT SeccaoID, Salario FROM Trabalha INNER JOIN Funcionario ON FuncionarioID = PFID) GROUP BY SeccaoID
<gh_stars>0 INSERT INTO PURCHASE_ORDER (ID, USER_CODE, DESCRIPTION) VALUES (hibernate_sequence.nextval, '1001', 'Playstation 4 Game Controller'); INSERT INTO PURCHASE_ORDER (ID, USER_CODE, DESCRIPTION) VALUES (hibernate_sequence.nextval, '1002', 'iPhone 13');
<filename>scripts/sysdba/i/disable_triggers.sql /* */ set serveroutput on size unlimited echo off ACCEPT owner PROMPT "Owner: " ACCEPT table_name DEFAULT '.*' PROMPT "Table name (All if not specified): " PROMPT PROMPT Disabled triggers (before) SELECT t.owner, t.table_name, t.trigger_name FROM dba_triggers t WHERE re...
ALTER TABLE `XXX_plugin_leadtracker` ADD `leadtracker_form_id` INT( 11 ) NOT NULL; ##b_dump## CREATE TABLE IF NOT EXISTS `XXX_plugin_leadtracker_lookup_form_uid_leadid` ( `leadtracker_uid_id` int(11) NOT NULL AUTO_INCREMENT, `leadtracker_uid` varchar(255) NOT NULL, `leadtracker_form_id` int(11) DEFAULT NULL, `...
<filename>airbyte-integrations/bases/base-normalization/integration_tests/normalization_test_output/snowflake/test_primary_key_streams/models/generated/airbyte_tables/TEST_NORMALIZATION/NESTED_STREAM_WITH_COMPLEX_COLUMNS_RESULTING_INTO_LONG_NAMES_PARTITION_E78_DOUBLE_ARRAY_DATA_1B9.sql {{ config(alias="NESTED_STREAM_WI...
<filename>usaspending_api/recipient/management/sql/recipient_lookup/000_temp_relations.sql DO $$ BEGIN RAISE NOTICE '000 Creating temporary table and materialized view'; END $$; DROP TABLE IF EXISTS public.temporary_restock_recipient_lookup; DROP MATERIALIZED VIEW IF EXISTS public.temporary_transaction_recipients_vie...
<filename>Database/World/Setup/FullDB/gossip_texts.sql -- ---------------------------------------- -- -- CLEAR DOWN THE TABLE -- -- ---------------------------------------- TRUNCATE TABLE `gossip_texts`; -- ---------------------------------------- -- MySQL dump 10.13 Distrib 5.5.37, for Win32 (x86) ...