sql stringlengths 6 1.05M |
|---|
CREATE TABLE IF NOT EXISTS ocha.organizations (
`id` INT,
`nombre` VARCHAR(108) CHARACTER SET 'utf8' COLLATE 'utf8_spanish2_ci',
`sigla` VARCHAR(27) CHARACTER SET 'utf8' COLLATE 'utf8_spanish2_ci',
`sede` VARCHAR(5) CHARACTER SET 'utf8' COLLATE 'utf8_spanish2_ci',
`direccion` VARCHAR(76) CHARACTER S... |
<reponame>chrudosvorlicek/ci-pasport
\c pasport
DROP SCHEMA IF EXISTS tiger CASCADE;
DROP SCHEMA IF EXISTS tiger_data CASCADE;
|
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 01, 2021 at 04:01 PM
-- Server version: 5.7.33
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
CREATE TABLE [dbo].[articles]
(
[id] int IDENTITY(1,1),
[name] nvarchar(128) NOT NULL,
[table_name] nvarchar(128) NOT NULL
); |
CREATE TABLE IF NOT EXISTS `soc_activity_type` (
`activity_type_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`activity` varchar(100) NOT NULL COMMENT 'like, comment, review',
`title` varchar(100) NOT NULL,
`identifier` varchar(100) NOT NULL,
`value` tinyint(3) unsigned NOT NULL DEFAULT '0',
`created_at` t... |
<reponame>hoangphuong020193/library<gh_stars>0
CREATE TABLE Title(
Id int IDENTITY(1,1) PRIMARY KEY NOT NULL,
Name nchar(100) NOT NULL,
ShortName nchar(50) NULL,
Enabled bit DEFAULT 1); |
<filename>deployment/redeploy_sample_data.sql
BEGIN EXECUTE IMMEDIATE 'DROP TABLE employees'; EXCEPTION WHEN OTHERS THEN NULL; END;
/
BEGIN EXECUTE IMMEDIATE 'DROP TABLE likes'; EXCEPTION WHEN OTHERS THEN NULL; END;
/
BEGIN EXECUTE IMMEDIATE 'DROP SEQUENCE like_seq'; EXCEPTION WHEN OTHERS THEN NULL; END;
/
BEGIN EXECUT... |
<gh_stars>1-10
-- ---
-- Globals
-- ---
-- SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- SET FOREIGN_KEY_CHECKS=0;
-- ---
-- Table 'TICKET'
--
-- ---
DROP TABLE IF EXISTS `TICKET`;
CREATE TABLE `TICKET` (
`id` INTEGER NULL AUTO_INCREMENT DEFAULT NULL,
`booking_id` INTEGER NOT NULL,
`ticket_type` varchar(11) N... |
<reponame>Zenika/Zenika-Resume
alter table resume
drop column full_text_search_vector;
alter table resume
add column full_text_search_vector tsvector
generated always as (
setweight(to_tsvector('simple', metadata), 'A')
|| setweight(to_tsvector_multilang(content), 'C')
... |
CREATE DATABASE IF NOT EXISTS coaching;
USE coaching;
DROP TABLE IF EXISTS wfanswers, videolist, wfteamlist, workflow, teamlist, video, role, person, team, sport;
CREATE TABLE sport
(
id INT AUTO_INCREMENT PRIMARY KEY,
sportname VARCHAR(25) NOT NULL
);
CREATE TABLE team
(
id INT AUTO_INCREMENT PRIMARY KEY,
s... |
DROP TABLE IF EXISTS review;
DROP TABLE IF EXISTS shipment;
DROP TABLE IF EXISTS productinventory;
DROP TABLE IF EXISTS warehouse;
DROP TABLE IF EXISTS orderproduct;
DROP TABLE IF EXISTS incart;
DROP TABLE IF EXISTS product;
DROP TABLE IF EXISTS category;
DROP TABLE IF EXISTS ordersummary;
DROP TABLE IF EXISTS paymentm... |
<reponame>Foxpips/LayeredArchitecture
CREATE PROCEDURE dbo.h3giDepositGet
@orderRef int
AS
begin
SELECT
od.depositId,
od.orderRef,
od.depositAmount,
od.depositPaid,
odr.depositDate paymentDate,
od.paymentMethod,
dbo.getDepositRef... |
<gh_stars>1-10
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SPC_G001_LST2]') AND type IN (N'P', N'PC'))
/****** Object: StoredProcedure [dbo].[SPC_M001L_FND1] Script Date: 2017/11/23 16:46:46 ******/
DROP PROCEDURE [dbo].[SPC_G001_LST2]
GO
/****** Object: StoredProcedure [dbo].[... |
<reponame>Shuttl-Tech/antlr_psql
-- file:event_trigger.sql ln:148 expect:true
CREATE TABLE schema_one.table_three(a int)
|
<gh_stars>10-100
/*
The following sample query analyzes campaign activity over the past 30 days. #In this query, replace [CAMPAIGN_LIST] with a comma separated list of all # the DoubleClick campaigns of interest within the scope of the query.
The table name construct should look like this "match_table_campaigns_{{GOOG... |
# proto.sql
DROP TABLE IF EXISTS tbl_name;
#@ _CREATE_TABLE_
CREATE TABLE tbl_name
(
);
#@ _CREATE_TABLE_
SELECT * FROM tbl_name;
|
<filename>prisma/migrations/20210412021453_changed/migration.sql
-- AlterTable
ALTER TABLE "ProductContent" ALTER COLUMN "updatedAt" DROP DEFAULT;
-- AlterTable
ALTER TABLE "ProductMetafield" ALTER COLUMN "updatedAt" DROP DEFAULT;
-- AlterTable
ALTER TABLE "Variant" ALTER COLUMN "updatedAt" DROP DEFAULT;
-- AlterTab... |
<filename>_includes/tutorials/ddos/confluent/code/tutorial-steps/dev/source.sql<gh_stars>0
-- Example
CREATE SOURCE CONNECTOR IF NOT EXISTS network_traffic_source WITH (
'connector.class' = 'RabbitMQSource',
'name' = 'network_traffic_source',
'kafka.api.key' = '<my-kafka-api-key>',
'kafka.api... |
<reponame>gome-zhaojiuyang/lemon_oa
INSERT INTO WHITELIST_PACKAGE(ID,NAME,USER_ID) VALUES(1,'internal',1);
INSERT INTO WHITELIST_SERVICE(ID,NAME,DESCRIPTION,PACKAGE_ID,USER_ID) VALUES(1,'audit','审计日志',1,1);
INSERT INTO WHITELIST_SERVICE(ID,NAME,DESCRIPTION,PACKAGE_ID,USER_ID) VALUES(2,'dict','数据字典',1,1);
INSER... |
<filename>plugins/bigquery/dbt/include/bigquery/macros/materializations/merge.sql<gh_stars>1-10
{% macro bigquery__get_merge_sql(target, source, unique_key, dest_columns) %}
{{ common_get_merge_sql(target, source, unique_key, dest_columns) }}
{% endmacro %}
|
select
l_orderkey as gkey,
count(1) as unique_key
from
lineitem
group by
lineitem.l_orderkey
order by
gkey; |
<filename>src/test/resources/bvt/parser/antlr_grammers_v4_plsql/examples/union02.sql
select distinct job_id from hr.jobs
union all
select distinct job_id from hr.job_history
|
--
-- expression evaluated tests that don't fit into a more specific file
--
--
-- Tests for SQLVAlueFunction
--
-- current_date (always matches because of transactional behaviour)
SELECT
date(now())::text = current_date::text;
-- current_time / localtime
SELECT
now()::timetz::text = current_time::text;
SEL... |
<gh_stars>1-10
CREATE table alltypes(
int_col INTEGER,
float_col FLOAT,
double_col DOUBLE,
smallint_col SMALLINT,
date_col DATE,
time_col TIME,
timestamp_col TIMESTAMP,
datetime_col DATETIME,
monetary_col MONETARY,
numeric_col NUMERIC(12,4),
char_col char(255),
varchar_col varchar(255),
nchar_col nchar(255),
varnchar_c... |
INSERT INTO burgers (burger_name)
VALUES ("Chicken Burger"),
("Big Kahuna Burger"),
("Reindeer Goat Cheese Burger"),
("In and Out Burger"),
("Lentil, Chickpea, Tofu and Grass Burger"),
("Beef Burger"),
("Unicorn Burger");
|
<filename>db/0-schema.sql
CREATE TABLE "users" (
"_id" INTEGER NOT NULL UNIQUE,
"username" TEXT NOT NULL UNIQUE,
"password" TEXT NOT NULL,
"date_created" TEXT NOT NULL DEFAULT current_timestamp,
"date_last_login" TEXT DEFAULT current_timestamp,
"api_token" TEXT,
"is_superuser" INTEGER NOT NULL DEFAULT 0,
... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 15, 2018 at 03:19 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
select distinct ep.subject_id, ep.hadm_id, ep.stay_id
, ep.intime, ep.outtime
, inputevents.starttime, inputevents.endtime
, inputevents.amount, inputevents.amountuom
, inputevents.rate, inputevents.rateuom
, d_items.label, d_items.itemid
from eligible_patients ep
LEFT JOIN `physionet-data.mimic_icu... |
CREATE PROCEDURE [dbo].[usp_sqlwatch_internal_add_table]
as
create table ##98308FFC2C634BF98B347EECB98E3490 (
[TABLE_CATALOG] [nvarchar](128) NOT NULL,
[TABLE_SCHEMA] [sysname] NOT NULL,
[TABLE_NAME] [sysname] NOT NULL,
[TABLE_TYPE] [varchar](10) NULL,
constraint PK_TMP_98308FFC2C634BF98B347EECB98E3490 primary k... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.11-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 10.3.0.5896
-- -----------------------------------------------... |
/****** Object: StoredProcedure [dbo].[GetSupplierProductList] ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GetSupplierProductList]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[GetSupplierProductList]
GO
CREATE PROCEDURE [dbo].[GetSupplierProductList]
@Supplier... |
-- Расчетные меры и элементы
SELECT
[MEMBER_UNIQUE_NAME] AS [CALCULATED_MEASURE],
[MEMBER_CAPTION] AS [CAPTION],
[EXPRESSION]
FROM $system.MDSCHEMA_MEMBERS
WHERE CUBE_NAME = '<<NAME>>' -- Измените отбор здесь
AND [MEMBER_TYPE] = 4 -- MDMEMBER_TYPE_FORMULA |
CREATE PROC dbo.SystemTags_Upd(
@InstanceID INT
)
AS
DECLARE @Tags TABLE(
TagID INT NULL,
TagName NVARCHAR(50) NOT NULL,
TagValue NVARCHAR(128) NOT NULL
);
WITH T AS (
SELECT CAST(v.SQLVersionName AS NVARCHAR(128)) AS [Version],
CAST(I.Edition AS NVARCHAR(128)) AS Edition,
CAST(v.SQLVersionName + ' ' + I.... |
CREATE OR REPLACE FUNCTION "de.metas.fresh".X_MRP_ProductInfo_Detail_MV_Refresh(
IN DateAt date,
IN M_Product_ID numeric,
IN M_AttributesetInstance_ID numeric)
RETURNS void AS
$BODY$
-- Delete existing records from X_MRP_ProductInfo_Detail_MV.
-- They will be recreated if there is anything to be recre... |
<reponame>Half-Quarter/afl-fast-test
create table t0(t);insert into t0
select strftime();
|
CREATE database otus;
CREATE database otus_test;
|
<reponame>Drakula35332458/dolphin.pro<gh_stars>100-1000
-- ====================== can NOT be applied twice ======================
ALTER TABLE `bx_shoutbox_messages` ADD `HandlerID` int(11) NOT NULL AFTER `ID`;
ALTER TABLE `bx_shoutbox_messages` ADD INDEX (`HandlerID`);
-- ================ can be safely appl... |
-- 6.4.4
create or replace table group.weather as
select * from json_weather_data_view
where date_trunc('month',observation_time) = '2018-01-01'
limit 20;
-- 3.1.4
create or replace table trips
(tripduration integer,
starttime timestamp,
stoptime timestamp,
start_station_id integer,
start_station_name strin... |
<filename>migrations/20220406024939_create_table_provinces.up.sql
DROP TABLE IF EXISTS provinces;
CREATE TABLE IF NOT EXISTS provinces
(
id char(2) not null,
name varchar(255) not null,
primary key (id)
);
|
INSERT INTO `dps_dlv_datacenter` (`AGGREGATE_ID`, `AGGREGATE_NAME`, `ZONE`, `DESCRIPTION`, `DISPLAY_ORDER`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `TENANT_ID`)
VALUES ('1', 'dev1', 'dev1', '开发1区', '1', 'sysadmin', now(), 'anymous', now(), 'sysadmin');
INSERT INTO `dps_dlv_datacenter` (`AGGREGATE... |
<filename>sql/integration_insert.sql<gh_stars>0
insert into integrations
( server_id,
integration_id,
integration_type,
integration_user_info )
values
( :server_id:,
:integration_id:,
:integration_type:,
:integration_user_info: ); |
INSERT INTO T_STUDENT (NAME, AGE, BIRTHDAY, CREATE_TIME) VALUES ('qin', 23, curdate(), sysdate()),
('shao', 24, curdate(), sysdate()),
('bin', 25, curdate(), sysdate()); |
select l_orderkey from lineitem where l_orderkey != 1; |
library CqlConditionalOperatorsTest version '1.4.0'
using QUICK version '3.3.0'
context Patient
define "if-then-else": Tuple{
"IfTrue1": Tuple{
expression: if 10 > 5 then 5 else 10,
output: 5
},
"IfFalse1": Tuple{
expression: if 10 = 5 then 10 + 5 else 10 - 5,
output: 5
},
"IfNull1": Tuple{
... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2018-08-17 10:25:24
-- 服务器版本: 5.7.15
-- PHP Version: 7.2.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `eacoophp`
--
-- ------------------------------... |
----------------------------------------------------------------
-- [image_group_storage_domain_map] Table
--
Create or replace FUNCTION Insertimage_storage_domain_map(v_image_id UUID,
v_storage_domain_id UUID,
v_quota_id UUID,
v_disk_profile_id UUID)
RETURNS VOID
AS $procedure$
BEGIN
INSERT INTO i... |
<reponame>blinkops/blink-aws-query
select
service_name,
arn,
cluster_arn,
task_definition,
desired_count,
enable_ecs_managed_tags,
enable_execute_command,
placement_constraints,
placement_strategy
from
aws.aws_ecs_service
where
arn = '{{ output.resource_aka.value }}'; |
<filename>datascience-ksql-realtimepredictions/ksql-queries2.sql<gh_stars>1-10
SET 'auto.offset.reset' = 'earliest';
CREATE STREAM transactions_fraud_predictions_raw
WITH (KAFKA_TOPIC='transactions_fraud_predictions_raw', value_format='AVRO')
AS SELECT transaction_id,
predictFraud(
purchase_date,
card_id,
... |
<gh_stars>1-10
# ************************************************************
# Base de données: tub
# Table: join_line_stop
# ************************************************************
LOCK TABLES `join_line_stop` WRITE;
INSERT INTO `join_line_stop` (`id`, `line_id`, `stop_id`, `way`, `order`, `next_stop_id`)
VALU... |
INSERT INTO user (username, password)
VALUES
('test', 'pbkdf2:sha256:50000$TCI4GzcX$0de171a4f4dac32e3364c7ddc7c14f3e2fa61f2d17574483f7ffbb431b4acb2f'),
('other', 'pbkdf2:sha256:50000$kJPKsz6N$d2d4784f1b030a9761f5ccaeeaca413f27f2ecb76d6168407af962ddce849f79');
INSERT INTO post (title, body, author_id, created)
VALU... |
-- @testpoint:opengauss关键字Inline(非保留),作为用户组名
--关键字不带引号-成功
drop group if exists Inline;
create group Inline with password '<PASSWORD>';
drop group Inline;
--关键字带双引号-成功
drop group if exists "Inline";
create group "Inline" with password '<PASSWORD>';
drop group "Inline";
--关键字带单引号-合理报错
drop group if exists 'Inline';
... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 11 Sep 2021 pada 11.29
-- Versi server: 10.4.18-MariaDB
-- Versi PHP: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 06 Mar 2018 pada 12.06
-- Versi Server: 10.1.29-MariaDB
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 14, 2020 at 02:15 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
SELECT *
FROM rewyndapp_tweet t
WHERE t.episode_id = 1 AND t.is_retweet IS FALSE AND t.favorites > 3
ORDER BY 8 DESC, 7 DESC
|
CREATE OR REPLACE PACKAGE abf_cmn IS
/*****************************************************************************
-- Package Name : abf_cmn
-- Meaning : ABFの共通モジュールパッケージ
-- Creation Date : 2018-08-01
-- Created by TFURUKAW
*****************************************************************************/
--
-- 共通変数
g... |
DROP FUNCTION IF EXISTS throw_error;
/* FUNC: throw_error */
DELIMITER //
CREATE FUNCTION throw_error()
RETURNS INT DETERMINISTIC
BEGIN
DECLARE result INT DEFAULT 0;
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT = 'Unauthorized access';
RETURN (0);
END //
DELIMITER ;
DROP FUNCTION IF EXISTS auth_READ_Lecturer_age;
/* FUNC:... |
/**************************************/
/***Finalmente è il turno dei negozi***/
/**************************************/
/*Insert 5: e_shops */
/*shop 1*/
insert into e_shops(e_shops_name, e_shops_name_long, e_shops_description, e_shops_description_long, e_shops_email, e_shops_telephone_number, e_shops_tel... |
<reponame>CSC-IT-Center-for-Science/antero<filename>db_archive/sql_archive/4953__create_table_sa_amos_opiskelijapalaute_vahvistetut_2020_2021.sql
USE [ANTERO]
GO
/****** Object: Table [sa].[sa_amos_opiskelijapalaute_vastaajamäärä_vahvistettu_2020_2021] Script Date: 28.10.2021 17:35:33 ******/
SET ANSI_NULLS ON
GO
S... |
<filename>db/seeds.sql
USE burgers_db;
-- insert records into burgers table
INSERT INTO burgers (burger_name)
VALUES ("California Burger");
INSERT INTO burgers (burger_name)
VALUES ("Vegan Burger");
INSERT INTO burgers (burger_name)
VALUES ("Southwest Burger");
--check the records
SELECT * FROM burgers;
|
<filename>src/SFA.DAS.AssessorService.Database/PostDeploymentScripts/LookupData/SynchronizeLookupData.sql
/*
Insert, Update or Remove all default lookup data
NOTES:
Foreach type of <LookupData> there is a seperate <LookuData>Delete.sql script which should be used to manually remove
<LookupData> dependencies befo... |
<reponame>smith750/kc
delimiter /
INSERT INTO KRIM_ROLE_ID_BS_S VALUES (null)
/
INSERT INTO KRIM_ROLE_T (ROLE_ID,KIM_TYP_ID,NMSPC_CD,ROLE_NM,DESC_TXT,ACTV_IND,LAST_UPDT_DT,OBJ_ID,VER_NBR)
VALUES ((SELECT MAX(ID) FROM KRIM_ROLE_ID_BS_S),(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NMSPC_CD = 'KUALI' AND NM = 'Default')... |
SET DEFINE OFF;
Insert into MDM_OWNER.REF_RELATIONSHIP_STATUS
(ID_PK, VERSION, CREATED_TS, UPDATED_TS, UPDATED_BY_USER, UPDATED_BY_TXN_ID, CONFIG_LANGUAGE_CODE_KEY, KEY, VALUE)
Values
('1', 0, TO_TIMESTAMP('7/5/2017 11:22:35.075000 AM','fmMMfm/fmDDfm/YYYY fmHH12fm:MI:SS.FF AM'), TO_TIMESTAMP('7/5/2017 11:22:35.0... |
<reponame>testxiaoming001/zhtong<gh_stars>0
-- 7-22 修改后台密码为 <PASSWORD>
UPDATE `cm_admin` SET `password` = '<PASSWORD>' WHERE `cm_admin`.`username` = 'admin';
-- 7-4 后台域名白名单
INSERT INTO `cm_config` (`id`, `name`, `title`, `type`, `sort`, `group`, `value`, `extra`, `describe`, `status`, `create_time`, `update_time`... |
---
--- Replace t_cryptotransferlists.account_id with realm_num and entity_num
---
-- drop previous indexes
drop index if exists
idx__t_cryptotransferlists__account_and_consensus;
drop index if exists
idx__t_cryptotransferlists__consensus_and_account;
-- add realm_num and entity_num
alter table t_cryptotrans... |
<filename>examples/postgres/advanced-blog-cli/migrations/2017-12-20-163829_create_posts/up.sql
CREATE TABLE posts (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL REFERENCES users (id),
title TEXT NOT NULL,
body TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NO... |
<filename>sql/functions/show_partitions.sql
/*
* Function to list all child partitions in a set.
* Will list all child tables in any inheritance set,
* not just those managed by pg_partman.
*/
CREATE FUNCTION show_partitions (p_parent_table text) RETURNS SETOF text
LANGUAGE plpgsql STABLE SECURITY DEFINER
... |
CREATE FUNCTION multiout_simple(OUT i integer, OUT j integer) AS $$
return (1, 2)
$$ LANGUAGE plpythonu;
SELECT multiout_simple();
SELECT * FROM multiout_simple();
SELECT i, j + 2 FROM multiout_simple();
SELECT (multiout_simple()).j + 3;
CREATE FUNCTION multiout_simple_setof(n integer = 1, OUT integer, OUT integer) R... |
<reponame>rorhug/pg_chameleon
CREATE USER usr_test ;
SET PASSWORD FOR usr_test =PASSWORD('<PASSWORD>');
GRANT ALL ON sakila.* TO 'usr_test';
GRANT RELOAD ON *.* to 'usr_test';
GRANT REPLICATION CLIENT ON *.* to 'usr_test';
GRANT REPLICATION SLAVE ON *.* to 'usr_test';
FLUSH PRIVILEGES;
|
<reponame>JaneliaSciComp/DatabaseScripts
-- MySQL dump 10.9
--
-- Host: db-dev Database: webhelpdesk
-- ------------------------------------------------------
-- Server version 5.0.45-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... |
<reponame>m-macnair/GSA3<filename>etc/schema/okazu_tag_imply.sql
CREATE TABLE `okazu_tag_imply` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`parent_def_id` int(4) unsigned NOT NULL,
`child_def_id` int(4) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `post_id` (`parent_def_id`),
KEY `tag_def_id` (`child_de... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.3
-- Dumped by pg_dump version 11.0
-- Started on 2019-09-15 15:53:42
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_catalo... |
<reponame>volosgoto/yiidip
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Хост: localhost:3306
-- Время создания: Мар 19 2018 г., 12:53
-- Версия сервера: 5.7.21-0ubuntu0.17.10.1
-- Версия PHP: 7.1.12-2+ubuntu17.10.1+deb.sury.org+2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone... |
<filename>data/patch/20181114-1620-alter-table_ct_reception.sql<gh_stars>0
ALTER TABLE ct_reception ADD ct_genre_id INT DEFAULT NULL;
ALTER TABLE ct_reception ADD CONSTRAINT FK_942215A2D74CE6E6 FOREIGN KEY (ct_genre_id) REFERENCES ct_genre (id);
CREATE INDEX IDX_942215A2D74CE6E6 ON ct_reception (ct_genre_id);
|
<reponame>caidwang/myShoppingManagement
create database if NOT exists SMS;
use SMS;
drop view if exists SALELIST;
drop table if exists GSALES;
drop table if exists GOODS;
drop table if exists SALESMAN;
create table GOODS
(
GID INT(10) NOT NULL auto_increment,
GNAME varchar(20) NOT NULL unique,
... |
<reponame>sadik-s/HackerRank
/*******************************************************************************************
Problem Link: https://www.hackerrank.com/challenges/japanese-cities-name/problem
Platform: MySql
********************************************************************************************/
SELE... |
<gh_stars>1-10
DROP TABLE IF EXISTS Followings, Reports, Posts, Admins, Users;
CREATE TABLE IF NOT EXISTS `Admins` (
`id` INTEGER NOT NULL auto_increment ,
`name` VARCHAR(150),
`email` VARCHAR(150) UNIQUE,
`password` VARCHAR(5000),
`createdAt` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` D... |
<gh_stars>1-10
CREATE FUNCTION udf_CheckForVehicle(@townName NVARCHAR(50), @seatsNumber INT)
RETURNS NVARCHAR(MAX)
AS
BEGIN
DECLARE @result NVARCHAR(MAX) = (SELECT TOP 1 o.Name + ' - ' + m2.Model
FROM Towns AS t
JOIN Offices o
... |
CREATE DATABASE ecommerceapp_db;
USE ecommerceapp_db;
|
<gh_stars>1-10
CREATE OR REPLACE FUNCTION ti.getisopretreatmenttypes()
RETURNS TABLE(isopretreatmenttypeid integer, isopretreatmenttype character varying, isopretreatmentqualifier character varying)
LANGUAGE sql
AS $function$
SELECT isopretreatmenttypeid,
isopretreatmenttype,
isopretrea... |
{%
set properties = {
"id": "id",
"type": "post_type",
"channel_id": "episode_id"
}
%}
select
{% for prop, col in properties.items() %}
{% if not loop.first %} , {% endif %}
{{prop}} as {{ col}}
{% endfor %}
from {{ ref("snowplow_events_dev") }} |
--Hospital Capacity By State (Plus Suspected COVID Cases)
--Note that column names DO NOT match source data. The following substitutions
--were made when loading the data into postgresql so the column names would fit:
--colName = colName.replace("-", "N").replace("+", "P");
--colName = colName.replace("patients_", "")... |
<gh_stars>1-10
DROP TABLE IF EXISTS dw.f_amk_talous_1_tuloslaskelma |
<reponame>surajpotnuru/sqllineage<filename>sqllineage/data/tpcds/query02.sql
with wscs as
(select sold_date_sk
, sales_price
from (select ws_sold_date_sk sold_date_sk
, ws_ext_sales_price sales_price
from web_sales
union all
... |
-- 2017-04-13T13:56:08.411
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,544300,0,TO_TIMESTAMP('2017-04-13 13:56:08','YYYY-MM-DD HH24:MI:SS'),0,'U','Y... |
CREATE TABLE runno_fileno_sitemask (
runno INTEGER,
fileno INTEGER,
sitemask INTEGER NOT NULL,
streamtype VARCHAR(32) NOT NULL,
officially_tagged BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (runno, fileno)
);
CREATE INDEX idx_rfs ON runno_fileno_sitemask (sitemask, streamtype, runno, fileno);
CREATE INDEX ... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 19, 2018 at 03:50 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 5.6.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
ALTER TABLE shared.appointment
ADD COLUMN contact jsonb; |
-- update VMs from old engine version that used
-- empty string to represent 'default' time_zome
update vm_static
set time_zone = NULL
where time_zone = '';
|
CREATE TABLE IF NOT EXISTS product (
id CHAR(16)
); |
CREATE TABLE IF NOT EXISTS block_sequences
(
id BIGSERIAL NOT NULL,
height DECIMAL(65, 0) NOT NULL,
time TIMESTAMP WITH TIME ZONE NOT NULL,
tx_count DOUBLE PRECISION,
size DOUBLE PRECISION,
gas_used DECIMA... |
/*! SET storage_engine=INNODB */;
DROP TABLE IF EXISTS bus_ext_events;
CREATE TABLE bus_ext_events (
record_id int(11) unsigned NOT NULL AUTO_INCREMENT,
class_name varchar(128) NOT NULL,
event_json varchar(2048) NOT NULL,
user_token char(36),
created_date datetime NOT NULL,
creating_owner char(... |
-- Adds the preferences to the preferences table.
INSERT INTO preference(p_key, p_value) VALUES
('document_directory', '/opt/ohmage/userdata/documents'),
('image_directory', '/opt/ohmage/userdata/images'),
('max_files_per_dir', '1000'),
('document_depth', '5'),
('visualization_server_address', ... |
<reponame>gisaia/ARLAS-server<filename>arlas-core/src/main/resources/io/arlas/server/impl/jdbi/dao/CollectionReferenceDao/delete.sql
DELETE FROM collection_reference WHERE arlas_index = ? AND collection_name = ?; |
DROP TABLE IF EXISTS attes_example_books;
--
-- The table 'attes_example_books' records information about books.
--
-- i_id : The ID of the book, serves as a primary key.
-- s_title : The title of the book.
-- i_author_id : The ID of the author.
-- s_language : The language of the original ... |
create table display_selection (
id integer PRIMARY KEY,
user_string varchar(40) NOT NULL,
display integer NOT NULL,
target_id integer not null,
created date,
D0_id integer NOT NULL, D0_is_selected varchar(10) NOT NULL,
D1_id integer NOT NULL, D1_is_selected varchar(10) NOT... |
<reponame>thunder-/paprika
CREATE INDEX usr_username_idx ON users (username);
CREATE INDEX usr_hashcode_idx ON users (hashcode); |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 21, 2018 at 10:15 PM
-- Server version: 5.7.24-0ubuntu0.16.04.1
-- PHP Version: 7.0.32-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>MySQL Dump/pix_craft.sql
-- Auto Backup for MySQL Professional Edition 3.0
--
-- Host: localhost
--
-- MySQL Server Version: 5.1.32-community
--
-- 2016-01-28 09:44:14
--
-- ------------------------------------------------------
SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARAC... |
DROP PROCEDURE IF EXISTS `usp_get_holders_with_balance_higher_than`;
DELIMITER $$
CREATE PROCEDURE `usp_get_holders_with_balance_higher_than`(IN `num` DECIMAL(19,4))
BEGIN
SELECT ah.`first_name`, ah.`last_name`
FROM `account_holders` AS ah
INNER JOIN `accounts` AS a ON ah.`id` = a.`account_holder_id`
GROUP BY a.`acc... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.