sql stringlengths 6 1.05M |
|---|
<reponame>BLevyCS/h-mes-aps-integration
USE [PreactorProd]
GO
/****** Object: View [dbo].[View_OrderInfo] Script Date: 12/19/2017 11:42:54 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[View_OrderInfo] as
SELECT
-- Orders Fields
orders.pom_order_pk as OrderPrimaryKey,
orde... |
<filename>swan.sql
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 13, 2018 at 08:23 PM
-- Server version: 10.0.34-MariaDB-0ubuntu0.16.04.1
-- PHP Version: 7.0.30-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+0... |
<gh_stars>0
INSERT INTO Burgers (burger_name, devoured) VALUES ('Poutine on the Ritz Burger', false);
INSERT INTO Burgers (burger_name, devoured) VALUES ('Beets of Burden Burger', false);
INSERT INTO Burgers (burger_name, devoured) VALUES ('Run Gorgonzola Run Burger', false); |
INSERT INTO department (name)
VALUES ('IT'),
('Accounting'),
('Sales');
INSERT INTO role (title, salary, department_id)
VALUES ('Engineer', 1.3, 1),
('Intern', 3.4, 2),
('Designer', 2.2, 3);
INSERT INTO employee (first_name, last_name, role_id, manager_id)
VALUES ('Bob', 'Marley', 1... |
/*
This is version one of the family table. The family table is just a grouping of accounts.
*/
CREATE TABLE IF NOT EXISTS family
(
uuid UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
name VARCHAR(50),
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()... |
spool 20170801-practica-roles.log
PROMPT PRACTICA
HOST CLS
CONNECT system/root
--DROP ALL ROLES
DROP ROLE ROLE_CONNECT;
DROP ROLE EMP_BASIC;
DROP ROLE EMP_CHIEF;
DROP ROLE EMP_ADMIN;
DROP ROLE MAS_BASIC;
DROP ROLE MAS_CHIEF;
DROP ROLE MAS_ADMIN;
--DROP ALL USERS
DROP USER JOHN CASCADE;
DROP USER JIRA CASCADE;
... |
<gh_stars>1-10
select d from issue3
select id from mystuff where id in %s
SELECT * from dictcursor where name='bob'
select l from test_datatypes where i in %s order by i
select x from issue17
select t from issue15
CREATE TABLE dictcursor (name char(20), age int , DOB datetime)
create table test_dict (a text)
create tab... |
-- # Problem: https://www.hackerrank.com/challenges/print-prime-numbers/problem
-- # Score: 40
WITH cte(num) AS (
SELECT TOP 1000 (ones.n + 10*tens.n + 100*hundreds.n)
FROM (VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) ones(n),
(VALUES(0),(1),(2),(3),(4),(5),(6),(7),(8),(9)) tens(n),
(VALU... |
<filename>install/install_viz.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 17, 2017 at 08:17 PM
-- Server version: 5.7.9
-- PHP Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
<filename>src/test/resources/sql/explain/53e431ff.sql
-- file:union.sql ln:337 expect:true
explain (costs off)
SELECT * FROM
(SELECT 1 AS t, 2 AS x
UNION
SELECT 2 AS t, 4 AS x) ss
WHERE x < 4
ORDER BY x
|
<filename>src/php-partials/db-partials/db-query/tb_bikee_type.sql
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: fdb26.awardspace.net
-- Generation Time: 25-Nov-2021 às 22:56
-- Versão do servidor: 5.7.20-log
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zo... |
<filename>src/hg/lib/tableList.sql
# This table is used to create a cache for the "show tables" and "describe table" commands.
# The table structure is the table name plus all fields that are returned by the describe
# table command. As the field names are as similar as possbible to MySQL, they do not follow kent src s... |
<filename>internal/sqlupdate/testdata/20190828_001.sql<gh_stars>100-1000
-- 创建账户表
SET client_encoding = 'UTF8';
CREATE TABLE public.account (
id serial PRIMARY KEY NOT NULL,
user_id integer DEFAULT 0 NOT NULL,
account_level smallint DEFAULT 0 NOT NULL,
balance numeric(18,2) DEFAULT 0.00 NOT NULL,
... |
<filename>backend/de.metas.externalsystem/src/main/sql/postgresql/system/80-de.metas.externalsystem/5599620_sys_gh11547_process_disable_scheduler_external_sys_config.sql<gh_stars>1000+
-- 2021-07-25T11:11:53.315Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_M... |
<reponame>mrotteveel/fb-datagrip
-- Retrieves the roles
-- Suitable for Firebird 3.0 and higher
select
trim(trailing from ROLE_NAME) as ROLE_NAME,
COMMENTS
from (
select
RDB$ROLE_NAME as ROLE_NAME,
RDB$DESCRIPTION as COMMENTS
from RDB$ROLES
) roles
|
CREATE TABLE tournament_participant(
ID SERIAL PRIMARY KEY,
YEAR INTEGER NOT NULL,
TEAM_NAME VARCHAR(64) NOT NULL
);
CREATE INDEX on tournament_participant(YEAR, TEAM_NAME);
-- TODO: RI BETWEEN TEAM NAMES AND tournament_participant.TEAM_NAME
CREATE TABLE tournament_result(
-- ID INTEGER PRIMARY KEY NOT NULL AUT... |
------------------- A D M I N I S T R A R S I S T E M A M O D I F I C A C I O N U S U A R I O -------------------
--Lista de Horarios con id
CREATE OR REPLACE FUNCTION "PERMISOS".F_LISTA_HORARIOS_CON_ID()
RETURNS TABLE(ID_TIPO_HORARIO INTEGER, TIPO_HORARIO CHARACTER VARYING) AS $$
DECLARE
BEGIN
RETU... |
<reponame>zycgit/configuration
create table RSF_ServiceInfo (
si_serviceID BIGINT NOT NULL GENERATED BY DEFAULT AS IDENTITY,
si_appID BIGINT NOT NULL,
si_bindName VARCHAR(200) NOT NULL,
si_bindGroup VARCHAR(100) NOT NULL,
si_bindVersion VARCHAR(50) NOT NULL,
si_bindType VARCHAR(300) NOT NULL,
si_onwer V... |
<filename>crystal-ball/src/main/db/refresh-materialized-views.sql
REFRESH MATERIALIZED VIEW event_participation;
REFRESH MATERIALIZED VIEW player_tournament_event_result;
REFRESH MATERIALIZED VIEW player_titles;
REFRESH MATERIALIZED VIEW player_current_rank;
REFRESH MATERIALIZED VIEW player_best_rank;
REFRESH MATERIAL... |
<gh_stars>1-10
CREATE TEMPORARY TABLE reporting_gcpcostentrylineitem_daily_summary_{{uuid | sqlsafe}} AS (
WITH cte_array_agg_keys AS (
SELECT array_agg(key) as key_array
FROM {{schema | sqlsafe}}.reporting_gcpenabledtagkeys
),
cte_filtered_tags AS (
SELECT id,
jsonb_obje... |
CREATE OR REPLACE FUNCTION public."invitationSetConferenceId"()
RETURNS trigger
LANGUAGE 'plpgsql'
VOLATILE
COST 100
AS $BODY$
DECLARE
nid uuid;
BEGIN
NEW."conferenceId" := (SELECT "conferenceId" FROM "registrant"."Registrant" WHERE "registrant"."Registrant"."id" = NEW."registrantId");
RETURN ... |
<reponame>opengauss-mirror/Yat
-- @testpoint: 创建表空间,不设置表空间限额
DROP TABLESPACE IF EXISTS ds_location2;
CREATE TABLESPACE ds_location2 RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
ALTER TABLESPACE ds_location2 RESIZE MAXSIZE 'UNLIMITED';
DROP TABLESPACE IF EXISTS ds_location2; |
<reponame>tianmagongyue/serverForStarRain<filename>user.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50717
Source Host : localhost:3306
Source Database : mytest
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 6500... |
-- MySQL Script generated by MySQL Workbench
-- dom 23 dic 2018 17:52:33 CET
-- 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... |
SET FOREIGN_KEY_CHECKS=0;
START TRANSACTION;
INSERT INTO `share_access_level` (`smap_id`, `group_id`, `right_id`) VALUES
(80, 1, 3),
(330, 1, 3),
(80, 3, 1),
(330, 3, 1),
(80, 4, 1),
(330, 4, 1);
--
-- Dumping data for table `share_languages`
--
INSERT INTO `share_languages` (`lang_id`, `lang_locale`, `lang_abbr`, ... |
/*
Warnings:
- You are about to drop the `prisma` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "prisma";
-- CreateTable
CREATE TABLE "admin" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"email" TEXT NOT NULL,
"password" TEXT NOT NULL,
"r... |
<reponame>agriswold7/bamazon
-- deletes database if it alrady exists --
DROP DATABASE IF EXISTS bamazon_db;
-- Creates database --
CREATE DATABASE bamazon_db;
-- Selects this database to use --
USE bamazon_db;
-- Creates database table --
CREATE TABLE products (
item_id INT NOT NULL AUTO_INCREMENT,
produc... |
<gh_stars>0
drop view if exists teams_stats CASCADE ;
create view teams_stats (team_id, league_id, matchday, season_id, home_goals, away_goals, home_received_goals, away_received_goals, home_w, home_t, home_l, away_w, away_t, away_l)
as
select t.team_id , l.league_id , m.matchday , m.season ,
coales... |
<filename>data/tokenExpirationEvent.sql
SELECT imc.* FROM `institution_medical_centers` imc
INNER JOIN `institution` inst ON imc.institution_id = inst.id
WHERE inst.status = 9
AND imc.status != 2
UPDATE `institution_medical_centers` imc
INNER JOIN `institutions` inst ON imc.institution_id = inst.id
SET imc.status = 2... |
/*
Navicat Premium Data Transfer
Source Server : dev
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost
Source Database : pager_goods
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : utf-8
Date: 01/16/2019 11:01:49 ... |
Insert INTO word_data (word_id, word_surah, word_ayah, word_page, word_number_in_quran, word_number_in_surah, word_number_in_ayah, word_type, word_arabic, word_transliteration, word_translation) VALUES
(1999, 2, 109, 17, 1895, 1866, 2, 'word', 'كَثِيرٌ', 'kathirun', 'many'),
(2000, 2, 109, 17, 1896, 1867, 3, 'word', 'م... |
<gh_stars>0
--Definition einer Prozedur mit Standardwerten
CREATE PROCEDURE standardwerte (
IN iv_max_id INT DEFAULT 10,
it_table aufgaben DEFAULT aufgaben )
AS
BEGIN
SELECT id,
titel
FROM :it_table
WHERE id <= :iv_max_id;
END;
--Aufruf der Prozedur ohne Parameter
call standardwerte()... |
<gh_stars>0
/*
Deployment script for MefistoDB
This code was generated by a tool.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
... |
-- > [vForeignKeyCols] VIEW CREATION *********************************************************************************************************
DECLARE @comm_create_view_scripts varchar(max)
SET @view = N'vForeignKeyCols'
SET @comm_create_view_scripts =
N'
create view {schema}.{view} as
select SCHEMA_NAME(obj.schema_... |
<reponame>nabeelkhan/Oracle-DBA-Life
REM LogPkg1.sql
REM Chapter 11, Oracle9i PL/SQL Programming by <NAME>
REM This package is used to log connects and disconnects to the
REM database.
CREATE OR REPLACE PACKAGE LogPkg AS
PROCEDURE LogConnect(p_UserID IN VARCHAR2);
PROCEDURE LogDisconnect(p_UserID IN VARCHAR2);
END... |
DROP SCHEMA IF EXISTS Billing_Engine;
CREATE SCHEMA Billing_Engine;
USE Billing_Engine;
CREATE TABLE INVOICE (ID bigint GENERATED BY DEFAULT AS IDENTITY,
CLIENT varchar(100),
VAT_RATE bigint,
INVOICE_DATE date,
PRIMARY KEY (ID));
CREATE TABLE LINE_ITEMS (ID bigint GENERATED BY DEFAULT AS IDENTITY,
QUANTITY bigint, D... |
<filename>database/db.sql<gh_stars>1-10
CREATE TABLE `video_uploads` (
`postId` int(11) NOT NULL AUTO_INCREMENT,
`channelId` varchar(30) NOT NULL,
`videoId` varchar(255) NOT NULL,
`publishedAt` varchar(255) NOT NULL,
`live` varchar(30) NOT NULL,
`title` varchar(255),
KEY `videoId` (`videoId`),
KEY `title` (`liv... |
<reponame>vovik0134/apex-on-postgresql-sample
prompt --application/set_environment
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run ... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 25-10-2018 a las 18:31:33
-- Versión del servidor: 5.7.23
-- Versión de PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
<reponame>shiromi-basil/computer-consultancy-firm
-- Creating DATABASE
CREATE DATABASE IF NOT EXISTS computer_consultancy_firm;
-- Creating TABLES
CREATE TABLE IF NOT EXISTS computer_consultancy_firm.employee (
eID INT NOT NULL,
eFirstName VARCHAR(255) NOT NULL,
eLastName VARCHAR(255) NOT NULL,
eDOB DAT... |
<filename>DapperRepo.Web/App_Data/SqlScripts/Mssql-DapperRepositoryDb.sql
USE [DapperRepositoryDb]
GO
/****** Object: Table [dbo].[Customer] Script Date: 2020/2/27 11:04:49 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Customer](
[Id] [int] IDENTITY(1,1) NOT NULL,
[Username] [nva... |
<reponame>jdkoren/sqlite-parser
-- trigger9.test
--
-- execsql {
-- BEGIN;
-- CREATE TRIGGER trig1 BEFORE UPDATE ON t1 BEGIN
-- INSERT INTO t2 VALUES(old.rowid);
-- END;
-- UPDATE t1 SET y = '';
-- SELECT * FROM t2;
-- }
BEGIN;
CREATE TRIGGER trig1 BEFORE UPDATE ON t1 BEGIN
INSERT I... |
<gh_stars>100-1000
-- where4.test
--
-- execsql {
-- CREATE TABLE t4(x,y,z,PRIMARY KEY(x,y));
-- }
CREATE TABLE t4(x,y,z,PRIMARY KEY(x,y)); |
-- SQL code here --
SELECT setval('city_seq', (SELECT MAX(id) FROM city)); |
DROP TABLE ingress_services;
|
create table CONTENTREVIEW_SYNC_ITEM (
id number(19,0) not null,
siteId varchar2(255) not null,
dateQueued date not null,
lastTried date,
status number(10,0) not null,
messages clob,
primary key (id)
);
create sequence TII_ROSTER_SYNC_ITEM_ID_SEQ;
|
--
-- Copyright 2015 LinkedIn Corp. 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
--
-- Unless required by applicab... |
<filename>yoo-master-dc2492330d5d46b48f1ceca891e0f9f7e1593fee/module/yoomath/ym-task/src/main/java/tpl/sql/Student.sql
##分页获取学生
#macro($taskGetAllByPage())
SELECT id FROM student WHERE id < :next ORDER BY id DESC
#end
## 根据班级id查找班级所有学生
#macro($taskListAllStudents(classId))
select t.* from student t
inner join ... |
<filename>sitae/src/main/resources/bbdd.sql<gh_stars>1-10
REM SITAE CENTRO_PROCEDENCIA_PK
CREATE UNIQUE INDEX "SITAE"."CENTRO_PROCEDENCIA_PK" ON "SITAE"."CENTRO_PROCEDENCIA" ("ID_CENTRO")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 214748364... |
ALTER TABLE notification ADD automated BIT(1) DEFAULT FALSE;
ALTER TABLE notification MODIFY message VARCHAR(500) NOT NULL;
ALTER TABLE notification MODIFY title VARCHAR(150);
ALTER TABLE notification
MODIFY COLUMN automated BIT(1) DEFAULT FALSE AFTER sent_time;
ALTER TABLE notification_aud ADD automated BIT(1) DEF... |
ALTER TABLE `audit`
ADD FULLTEXT INDEX `idx_audit_req_param_fulltext` (`req_param` ASC) COMMENT '查询用户在uniauth产生的所有历史记录';
|
//// CHANGE name=change0
CREATE MEMORY TABLE TABLE297(ID INTEGER NOT NULL PRIMARY KEY,FIELD1 VARCHAR(30),USERTYPE4FIELD USERTYPE4,USERTYPE6FIELD USERTYPE6)
GO
|
## (C) Copyright IBM Corporation 2015.
##
## 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
##
## Unless required by applicable law or agreed t... |
<reponame>addstone/derby<gh_stars>100-1000
--
-- 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 Apach... |
select name, path, arn, groups, partition, title, akas, partition, account_id
from aws.aws_iam_user
where name = '{{resourceName}}'
|
INSERT INTO CUSTOMER (ID, FIRST_NAME, DATE_OF_BIRTH) values (1, 'Meredith', '1998-07-13');
INSERT INTO CUSTOMER (ID, FIRST_NAME, DATE_OF_BIRTH) values (2, 'Joan', '1982-10-29');
|
-- Convert schema 'upgrades/Tapper-Schema-TestrunDB-2.010027-MySQL.sql' to 'Tapper::Schema::TestrunDB v2.010029':;
BEGIN;
ALTER TABLE queue ADD COLUMN active integer(1) DEFAULT '0';
ALTER TABLE testrun_scheduling DROP COLUMN mergedqueue_seq,
ADD COLUMN prioqueue_seq integer(11),
... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64)
--
-- Host: localhost Database: twitter
-- ------------------------------------------------------
-- Server version 5.7.18-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@... |
<reponame>abdulazizpr/Job-Apply-With-Code-Igniter
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 08, 2017 at 07:42 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101... |
<filename>SQL Server 2016.sql
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80021
Source Host : localhost:3306
Source Schema : bsc
Target Server Type : SQL Server
Target Server Version : 13000000
File Encoding ... |
DELIMITER $$
CREATE PROCEDURE usp_get_employees_from_town(town_name VARCHAR(50))
BEGIN
SELECT e.`first_name`, e.`last_name`
FROM `employees` AS e
INNER JOIN `addresses` AS a ON a.`address_id` = e.`address_id`
INNER JOIN `towns` AS t ON t.`town_id` = a.`town_id`
WHERE t.`name` = `town_name`
ORDER ... |
<reponame>ronakal/StealthyCommerce
USE StealthyCommerceDB
GO
SET NUMERIC_ROUNDABORT OFF
GO
SET ANSI_PADDING, ANSI_WARNINGS, CONCAT_NULL_YIELDS_NULL, ARITHABORT, QUOTED_IDENTIFIER, ANSI_NULLS, NOCOUNT ON
GO
SET DATEFORMAT YMD
GO
SET XACT_ABORT ON
GO
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE
GO
BEGIN TRANSACTION
PRI... |
<reponame>longtime55/5on6.pl<filename>storage/database/geonames/countries/sl.sql
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: laraclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 16, 2021 at 12:11 PM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
/*
Welcome to your first dbt model!
Did you know that you can also configure models directly within SQL files?
This will override configurations stated in dbt_project.yml
Try changing "table" to "view" below
*/
{{ config(materialized='table') }}
with source_data as (
select * from {{ref('transfo... |
-- --------------------------------------------------------
-- Poslužitelj: 127.0.0.1
-- Server version: 10.1.28-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Verzija: 9.5.0.5196
-- ------------------------------------------------... |
create table codes
(
user_id bigint not null,
games mediumtext null,
nnid mediumtext null,
switch mediumtext null,
threeds mediumtext null,
wii mediumtext null,
psn mediumtext null,
constraint codes_user_id_uindex
unique (user_id)
);
alter table codes
add primary key (user_id); |
<reponame>SkillsFundingAgency/das-employer-levy
CREATE FUNCTION [CalculateSubmissionCutoffDate]
(
@payrollMonth INT,
@payrollYear NVARCHAR(10)
)
RETURNS DATE
AS
BEGIN
DECLARE @year INT
SET @year = 2000 + CAST(LEFT(@payrollYear, 2) AS INT)
RETURN DATEADD(month, 4, DATEFROMPARTS(@year, @payrollMonth, 20))
END
|
-- P29C. HOUSEHOLD TYPE BY RELATIONSHIP (AMERICAN INDIAN AND ALASKA NATIVE ALONE)
-- designed to work with the IRE Census bulk data exports
-- see http://census.ire.org/data/bulkdata.html
CREATE TABLE ire_p29c (
geoid VARCHAR(11) NOT NULL,
sumlev VARCHAR(3) NOT NULL,
state VARCHAR(2) NOT NULL,
county VARCHAR(3),... |
----CREATE LOGINS
---FIRST LOGIN FOR SYSADMIN called securitysuper
USE [master]
GO
CREATE LOGIN [securitysuper] WITH PASSWORD=N'<PASSWORD>', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
EXEC master..sp_addsrvrolemember @loginame = N'securitysuper', @rolename = N'sysadmin'
GO
---SEC... |
-- file:portals.sql ln:187 expect:true
FETCH 1 FROM foo24
|
SELECT
sql_add_next_partition
FROM
sql_range_partitions
WHERE
table_name='test_sql_range_partitions_minute_no_maxvalue'
;
|
SET NAMES utf8mb4;
USE job_manage;
DROP PROCEDURE IF EXISTS job_schema_update;
DELIMITER <JOB_UBF>
CREATE PROCEDURE job_schema_update()
BEGIN
DECLARE db VARCHAR(100);
SET AUTOCOMMIT = 0;
SELECT DATABASE() INTO db;
IF NOT EXISTS(SELECT 1
FROM information_schema.COLUMNS
... |
-- Setup up
CREATE DATABASE IF NOT EXISTS `zg6kbqpoxrbx4hox`;
USE `zg6kbqpoxrbx4hox`;
CREATE TABLE IF NOT EXISTS `SystemAdministrator` (
`ID` varchar(128) NOT NULL,
`password` varchar(128) NOT NULL,
PRIMARY KEY (`ID`)
);
INSERT INTO `SystemAdministrator` (`ID`, `password`) VALUES
('<PASSWORD>', '<PASSWORD>')... |
ALTER TABLE feeds DROP CONSTRAINT feeds_pkey;
ALTER TABLE enclosures DROP CONSTRAINT enclosures_pkey;
ALTER TABLE feeds_settings DROP CONSTRAINT feeds_settings_pkey;
ALTER TABLE mrss DROP CONSTRAINT mrss_pkey;
ALTER TABLE mrss_credits DROP CONSTRAINT mrss_credits_pkey;
ALTER TABLE mrss_thumbnails DROP CONSTRAINT mrss_t... |
insert into datum_converted_values (
json_data_id,
field_visit_identifier,
field_visit_time,
target_datum,
unit,
display_value,
partition_number
)
select
b.json_data_id,
jsonb_extract_path_text(b.reading, 'FieldVisitIdentifier') field_visit_identifier,
adjust_timestamp(jsonb_extract_path_text(b.read... |
-- update properties
update property set name=replace(name,'application.','platform.');
update property set name=replace(name,'.plugin.','.application.');
update property set name=replace(name,'.defaultPlugin','.defaultApplication'),value = 'appng-manager' where name like '%.defaultPlugin%';
update property set name=re... |
<filename>fbwiki/mediawiki/maintenance/sqlite/archives/patch-oldimage-drop-oi_user.sql
--
-- patch-oldimage-drop-oi_user.sql
--
-- T188327. Drop old xx_user and xx_user_text fields, and defaults from xx_actor fields.
BEGIN;
DROP TABLE IF EXISTS /*_*/oldimage_tmp;
CREATE TABLE /*_*/oldimage_tmp (
oi_name varchar(255... |
<filename>chapter_007/car_requests.sql
/*Вывести список всех машин и все привязанные к ним детали.*/
SELECT c.car_model, b.body_model, e.engine_model, t.transm_model FROM cars AS c
INNER JOIN car_body AS b ON c.body_id = b.body_id
INNER JOIN engine AS e ON c.engine_id = e.engine_id
INNER JOIN transmission AS t ON c.tra... |
DECLARE @auditGuid UNIQUEIDENTIFIER = '%s';
DECLARE @logFilePath NVARCHAR(1000);
SELECT
@logFilePath = log_file_path + N'*_' + CAST(@auditGuid AS NVARCHAR(1000)) + N'_*'
FROM sys.server_file_audits
SELECT TOP (1000) *
FROM master.sys.fn_get_audit_file(@logFilePath, NULL, NULL)
ORDER BY event_time DESC, seque... |
<reponame>575074803/tp5.1
-- -----------------------------
-- Table structure for `lk_ad`
-- -----------------------------
DROP TABLE IF EXISTS `lk_ad`;
CREATE TABLE `lk_ad` (
`cid` int(11) NOT NULL,
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`picurl` varchar(255) NOT NULL,
... |
-- <NAME>
-- AWS Professional Services
--
-- This function uses log_fdw to load all the available RDS / Aurora PostgreSQL DB log files as a table.
--
-- Usage:
-- 1) Create this function
-- 2) Run the following to load all the log files
-- SELECT public.load_postgres_log_files();
-- 3) Start ... |
<gh_stars>1-10
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE addresses(
lat REAL NOT NULL,
lon REAL NOT NULL,
number TEXT,
street TEXT NOT NULL,
unit TEXT,
city TEXT,
district TEXT,
... |
<filename>sql/_14_mysql_compatibility_2/_01_string_functions/cases/_019_elt.sql
--ELT (element index) function
-- NULL index argument
SELECT ELT(NULL, '34', 'gadf', 'gradfa',CURRENT_TIMESTAMP);
-- negative index argument
SELECT ELT(-234243, 1234, 443, '2342', '432gds');
-- index argument 0
SELECT ELT(0, 'ASdf', 'zio... |
<reponame>lxuds/jforum2.7
--
-- Table structure for table 'jforum_banlist'
--
CREATE SEQUENCE jforum_banlist_seq;
CREATE TABLE jforum_banlist (
banlist_id INT NOT NULL DEFAULT nextval('jforum_banlist_seq'),
user_id INT DEFAULT 0,
banlist_ip VARCHAR(50),
banlist_email VARCHAR(255),
PRIMARY KEY(banlist_id)
);
C... |
<filename>grassroot-webapp/src/main/resources/db/scripts/script_126_rollback.sql
alter table paid_account_billing drop column payment_desc; |
-- [er]create class with numberic using great length
create class t1 (
c4 NUMERIC(4,4)
);
insert into t1 VALUES (11111);
drop t1; |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: eshop
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
<reponame>Mingull/MingBot<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Gegenereerd op: 28 mrt 2021 om 23:10
-- Serverversie: 10.4.18-MariaDB
-- PHP-versie: 8.0.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... |
-- Pre-conditions:
-- The database (can be any name but use 'db_jawad' for naming consistency) has already been created within the server.
-- A user named 'user_jawad_flyway' has already been created and is set as the owner of the above database.
-- Note that the following create role script is for reference only. It ... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Anamakine: mysql
-- Üretim Zamanı: 06 Oca 2022, 20:15:46
-- Sunucu sürümü: 8.0.27
-- PHP Sürümü: 7.4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_... |
<reponame>mobwal/mobile-walker-cloud-edition-dev-db
CREATE FOREIGN TABLE core.sd_disk_use (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL,
f_org bigint NOT NULL,
f_service integer NOT NULL,
n_size bigint NOT NULL,
d_date_modify timestamp without time zone,
n_period date NOT NULL
)
SERVER master_db
OPTIONS (s... |
<filename>db/sql/6160__alter_proc_p_lataa_f_eter_indicators.sql<gh_stars>1-10
USE [ANTERO]
GO
/****** Object: StoredProcedure [dw].[p_lataa_f_eter_indicators] Script Date: 27.4.2022 11:07:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dw].[p_lataa_f_eter_indicators] AS
TRUNCATE T... |
<filename>data dumps/internal test/2018-02-27/LPR3_ACTIVE_UOFFICIELBOPAEL_ADRESSELINJER.sql
CREATE TABLE LPR3_ACTIVE.UOFFICIELBOPAEL_ADRESSELINJER
(
UOFFICIELBOPAEL_ID char(16) for bit data NOT NULL,
ADRESSELINJER varchar(255),
CONSTRAINT FK__UOFFICIELBOPAEL_ADRESSELINJER_UOFFICIELBOPAEL_ID FOREIGN KEY (UOF... |
IF OBJECT_ID('CustomerGrains', 'U') IS NOT NULL
DROP TABLE CustomerGrains
GO
IF OBJECT_ID('Upsert_CustomerGrains') IS NOT NULL
DROP PROCEDURE Upsert_CustomerGrains
GO
IF TYPE_ID ('GrainKeyListType') IS NOT NULL
DROP TYPE GrainKeyListType;
GO
IF TYPE_ID ('CustomerGrainsType') IS NOT NULL
DROP TYPE CustomerGrainsType;
G... |
IF OBJECT_ID(N'dbo.sp_kill_processes','P') IS NOT NULL
DROP PROCEDURE dbo.sp_kill_processes
GO
/*-------------------------------------------------------------------------------------------------
NAME: sp_kill_processes.sql
UPDATED BY: <NAME>
EMAIL: <EMAIL>
DESCRIPTION: Parameter driven KILL
------... |
CREATE TABLE IF NOT EXISTS `{{product_feature}}` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `position` int(10) unsigned NOT NULL, `img` varchar(255) NOT NULL, `name` varchar(255) NOT NULL, `notice` varchar(255) NOT NULL, PRIMARY KEY (`id`) )
CREATE TABLE `category` ( `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,... |
--liquibase formatted sql
--changeset uk.gov.pay:alter_table_gocardless_events_alter_column_details_description
ALTER TABLE gocardless_events ALTER COLUMN details_description SET DATA TYPE TEXT;
--rollback ALTER TABLE gocardless_events ALTER COLUMN details_description SET DATA TYPE VARCHAR(255);
--changeset uk.gov.pa... |
SELECT continent FROM world GROUP BY continent HAVING SUM(population) > 100000000 |
<gh_stars>10-100
SELECT
gid AS __id__,
ST_AsBinary(geom) AS __geometry__,
jsonb_build_object(
'source', 'osmdata.openstreetmap.de',
'area', way_area,
'min_zoom', mz_water_min_zoom
) AS __properties__
FROM (
SELECT
gid,
-- extract only polygons. we might get linestring and po... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.