sql stringlengths 6 1.05M |
|---|
<filename>leetcode-subscription/sql/P1549.sql
/*
https://leetcode.com/problems/the-most-recent-orders-for-each-product/
https://leetcode.com/submissions/detail/452452600/
*/
/* Write your T-SQL query statement below */
SELECT
p.product_name,
p.product_id,
o.order_id,
o.order_date
FROM
Products ... |
<filename>logged.sql
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 31, 2021 at 07:49 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
<gh_stars>0
-- register bundle '[bundleId]'
INSERT INTO portti_bundle (name, startup)
VALUES ('[bundleId]','{
"title": "[optional name for bundle]",
"bundleinstancename": "[bundleId]",
"bundlename": "[bundleId]",
"metadata": {
"Import-Bundle": {
"[bundleId]": {
... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 08-07-2021 a las 04:26:17
-- Versión del servidor: 10.4.19-MariaDB
-- Versión de PHP: 7.4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>5.2.3/Database/Constraints/AFW_23_RECHR_FK1.sql
SET DEFINE OFF;
ALTER TABLE AFW_23_RECHR ADD (
CONSTRAINT AFW_23_RECHR_FK1
FOREIGN KEY (REF_UTILS)
REFERENCES AFW_12_UTILS (SEQNC)
ENABLE VALIDATE)
/
|
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 02, 2019 at 08:07 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
<reponame>dimMaryanto93/springboot2-webflux-r2dbc-example
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
create table examples
(
id character varying(64) not null primary key default uuid_generate_v4(),
name character varying(100),
age integer defa... |
<gh_stars>1-10
SELECT *
FROM Persons
ORDER BY Id; |
<reponame>davidames/SQLPerfMonDW<filename>SQLPerfMonDB/dw/dataQueries/udf_PerfMonPerMinuteByKey.sql
CREATE FUNCTION [dbo].[udf_PerfMonPerMinuteByKey]
(
@daysOld int,
@MachineId smallint,
@CounterId smallint,
@CounterInstanceId smallint = null
)
RETURNS TABLE AS RETURN
(
SELECT d.DateToTheMinute, d.DateToTh... |
<reponame>code-debug228/deleter-v2<filename>src/cql/tables/hashes.cql
CREATE TABLE IF NOT EXISTS ?.hashes (
id text PRIMARY KEY,
token_type text,
access_token text,
refresh_token text,
expires_timestamp timestamp
);
|
# Using the drshah schema
use drshah;
# Creating the MobileDevice Table
CREATE TABLE MobileDevice (
MobileDeviceHash VARCHAR(100) PRIMARY KEY
);
# Creating the TestResult Table
CREATE TABLE TestResult (
TestHash VARCHAR(100) PRIMARY KEY,
Test_Date DATE,
Test_Result BOOLEAN
);
# Creating the MobileDevice_TestResu... |
<reponame>Shuttl-Tech/antlr_psql
-- file:privileges.sql ln:533 expect:true
ALTER TYPE test8a ALTER ATTRIBUTE b TYPE testdomain1
|
<filename>app/ThirdParty/php-sql-parser/tests/expected/creator/left.sql
SELECT * FROM (t1 LEFT JOIN t2 ON t1.a = t2.a) LEFT JOIN t3 ON t2.b = t3.b OR t2.b IS NULL |
CREATE TABLE [dbo].[trnTable]
(
[Id] INT NOT NULL PRIMARY KEY,
[Name] NVARCHAR(50) NULL,
[Flg] BIT NULL,
[AmountOfMoney] MONEY NULL,
[InsertDate] DATETIME NOT NULL,
[UpdateDate] DATETIME NULL,
)
|
<gh_stars>0
# --- Created by Slick DDL
# To stop Slick DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table "CAT" ("name" VARCHAR NOT NULL PRIMARY KEY,"color" VARCHAR NOT NULL);
create table "TranslateFile" ("inPath" VARCHAR NOT NULL,"translatedText" VARCHAR NOT NULL,"editMode" VARCH... |
<filename>javarch-persistence/src/test/resources/sqls/HibernateBaseRepository.sql
DELETE FROM BLOG;
DELETE FROM USER;
-- 150 +/- SELECT COUNT(*) FROM PUBLIC.USUARIO;
INSERT INTO USER(IDUSER,DATA_CRIACAO,DATA_ATUALIZACAO,ACTIVE, EMAIL, NOMEUSUARIO, SENHA) VALUES
(1, CURRENT_DATE(),NULL,TRUE,'<EMAIL>', STRINGDECODE('Nome... |
<filename>xml-UI/sample/conf-auth/management.sql<gh_stars>1-10
CREATE TABLE terminalinfo
(
terminalno varchar(16) NOT NULL PRIMARY KEY, --终端号
terminalip varchar(16), --ip
terminalstatus integer, --终端状态
terminalid varchar(16), --认证信息
terminaladdr varchar(128), --终端地址
terminal... |
# --- First database schema
# --- !Ups
create sequence s_bar_id;
create table bar (
id bigint DEFAULT nextval('s_bar_id'),
name varchar(128)
);
# --- !Downs
drop table bar;
drop sequence s_bar_id; |
<filename>examples/simple/template.sql<gh_stars>1-10
USE employee_db;
BEGIN
DELETE FROM `employee_list` WHERE `id` = $id AND file_number <= $file_number;
$data
COMMIT;
|
alter table "source_collector"."source_notes" rename column "source_id" to "SourceId";
|
<reponame>desarrollo-bexandy-rodriguez/ares-app-zf2
CREATE VIEW `vista_disponibilidad_almacen` AS
SELECT
`disponibilidad_x_almacen`.`id`,
`disponibilidad_x_almacen`.`almacen` AS `idalmacen`,
`almacen`.`nombre`,
`almacen`.`idtipoalmacen`,
`tipo_almacen`.`nombre` AS `tipoalmacen`,
`disponibilidad_x_almacen`.`... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 22 Mar 2017 pada 14.31
-- Versi Server: 10.1.9-MariaDB
-- PHP Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
-- @testpoint: List分区表结合表约束check,list分区表结合列约束check,部分测试点合理报错
--step1:创建list分区表,结合表约束;expect:成功
drop table if exists t_partition_list_0069_01;
create table t_partition_list_0069_01
(id int,
age int,
number int,
text VARCHAR2(2000),
check(age>0 and number>0))
parti... |
# namedSessionDb.sql was originally generated by the autoSql program, which also
# generated namedSessionDb.c and namedSessionDb.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#Named user sessions.
CREATE TABLE namedSessionDb (
user... |
<reponame>kasteion/database-learning-route
--find the path to tempdb
sp_helpdb tempdb
-- name filename
--tempdev C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\tempdb.mdf
--templog C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\templog.ldf
--To change the tempdb locati... |
/*
Navicat MySQL Data Transfer
Source Server : MySQL
Source Server Version : 100136
Source Host : localhost:3306
Source Database : dbsysadmin
Target Server Type : MYSQL
Target Server Version : 100136
File Encoding : 65001
Date: 2018-11-04 16:20:52
*/
SET FOREIGN_KEY_CHECKS=0;
-- ... |
<reponame>wangyu-geek/xss
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50553
Source Host : localhost:3306
Source Database : article
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-11-08 19:27:06
*/
SET FOREI... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS users (
id INT PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
token VARCHAR(2048) NOT NULL,
created_at DATETIME NOT NULL DEFAULT NOW()
); |
<reponame>nerocui/youchatt2.0
INSERT INTO requests(id, from_user_id, to_user_id)
VALUES($1, $2, $3)
RETURNING *
|
<reponame>NeotomaDB/Neotoma_SQL
CREATE OR REPLACE FUNCTION ti.getspecimenisotopedataset(_datasetid integer)
RETURNS TABLE (
specimenid integer,
analysisunit character varying,
depth text,
thickness text,
taxon character varying,
element text,
variable character varying,
units character varying,
value ... |
insert overwrite table query17
select i_item_id
, i_item_desc
, s_state
, count(ss_quantity) as store_sales_quantitycount
, avg(ss_quantity) as store_sales_quantityave
, stddev_samp(ss_quantity) ... |
<filename>documents/musterloesung-db-2012-09-24/d2c2.1.sql
SELECT f1.person2, f2.person2
FROM (
SELECT * FROM FriendshipSymmetric WHERE person1 = 4
) f1
JOIN
(
SELECT * FROM FriendshipSymmetric WHERE person1 = 4
) f2 ON f1.person1 = f2.person1
WHERE f1.person2 != f2.person2
AND NOT EXISTS
... |
<reponame>gaybro8777/usaspending-api
select
toptier_code,
abbreviation,
name,
mission,
website,
justification,
icon_filename
from (
-- CGAC agencies
select
cgac_agency_code as toptier_code,
max(agency_abbreviation) as abbreviation,
max(agency_name) as name,
... |
DROP PROCEDURE processNewOrder;
DROP PROCEDURE validateOrderIsNotExpired;
DROP PROCEDURE validateOrder;
DROP PROCEDURE fillOrder;
DROP PROCEDURE addOrderToPendingTable;
DROP PROCEDURE cancelOrder;
DROP PROCEDURE validateThatOrderExistsInPendingTable;
DROP PROCEDURE insertCancelledOrderInClosedOrdersTables;
... |
<gh_stars>0
-- Get a list of countries
CREATE OR REPLACE FUNCTION countries_active() RETURNS table (
country VARCHAR(2)
) AS $$
BEGIN
RETURN QUERY SELECT ac.country FROM active_countries ac;
END;
$$ LANGUAGE plpgsql; |
create table test_table (
val string
);
insert into test_table (val) VALUES ('1');
refresh table test_table;
|
-- MySQL dump 10.13 Distrib 5.6.33, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: openmrs
-- ------------------------------------------------------
-- Server version 5.6.33-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@C... |
<reponame>viswaratha12/dbwarden<filename>DMS5/DecodeBase64.sql<gh_stars>1-10
/****** Object: UserDefinedFunction [dbo].[DecodeBase64] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.DecodeBase64
/****************************************************
**
** Desc:
** Decodes the g... |
<reponame>basked/basked.pr
INSERT INTO basked_db.sk_test (id, name, descr, created_at, updated_at, id_bas) VALUES (1, '<?php
use Illuminate\\Support\\Facades\\Schema;
use Illuminate\\Database\\Schema\\Blueprint;
use Illuminate\\Database\\Migrations\\Migration;
class CreateSkTestTable extends Migration
{
/**
... |
<filename>Database_Basics_MySQL_Retake_Exam_31_March_2020/Table_Design_01.sql<gh_stars>0
CREATE TABLE `addresses` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`address` VARCHAR(30) NOT NULL,
`town` VARCHAR(30) NOT NULL,
`country` VARCHAR(30) NOT NULL,
`user_id` INT NOT NULL
);
CREATE TABLE `comments` (
... |
/* It is assumed user is familiar with execution of PostgreSQL scripts using psql */
DROP TABLE accesstokens;
DROP TABLE refreshtokens;
DROP TABLE authclients;
DROP TABLE authusers;
|
<gh_stars>0
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='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema contaumssg2
-- ----------------------... |
<reponame>imajaydwivedi/Problem-Task---SQL-Server-Slowness<gh_stars>0
CREATE EVENT SESSION [resource_consumption] ON SERVER
ADD EVENT sqlserver.rpc_completed(SET collect_statement=(0)
ACTION(sqlos.scheduler_id,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_name,sqlserve... |
<filename>03_a_time_interval.sql
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [A_TIME_INTERVAL](
[interval_id] [smallint] NOT NULL,
[time_start] [nvarchar](5) NOT NULL,
[time_end] [nvarchar](5) NULL,
[time_start_datetime] [datetime] NULL,
[time_end_datetime] [datetime] NULL,
[time_hour] [nvarchar... |
<reponame>softask-app/softask-ddl
/*--------------------------------------------------------*\
| App Users |
\*--------------------------------------------------------*/
CREATE TABLE IF NOT EXISTS users.user
(
-- Sequential user id
user_id BIGSERIAL PRIMARY KEY,
... |
CREATE TABLE [CLIENTES]
( [CPF] [VARCHAR] (11),
[NOME] [VARCHAR] (100),
[ENDERECO 1] [VARCHAR] (150),
[ENDERECO 2] [VARCHAR] (150),
[BAIRRO] [VARCHAR] (50),
[CIDADE] [VARCHAR] (50),
[ESTADO] [VARCHAR] (2),
[CEP] [VARCHAR] (8),
[DATA DE NASCIMENTO] [DATE],
[IDADE] [SMALLINT],
[SEXO] [VARCHAR] (1),
[LIMITE DE CREDITO] [... |
<gh_stars>0
CREATE SCHEMA [Whitespace_removal] |
-- -> Delete and Create Database if necessary
-- DROP DATABASE IF EXISTS foodfydb;
-- CREATE DATABASE foodfydb;
CREATE TABLE "chefs" (
"id" SERIAL PRIMARY KEY,
"file_id" int,
"name" text,
"created_at" timestamp DEFAULT (now())
);
CREATE TABLE "recipes" (
"id" SERIAL PRIMARY KEY,
"chef_id" int,
"title" t... |
-- +micrate Up
-- SQL in section 'Up' is executed when this migration is applied
ALTER TABLE users ADD COLUMN role VARCHAR DEFAULT 'user';
UPDATE users SET role='admin' WHERE login='veelenga';
-- +micrate Down
-- SQL section 'Down' is executed when this migration is rolled back
ALTER TABLE users DROP COLUMN role;
|
<gh_stars>10-100
-- Deploy seattleflu/schema:warehouse/sample/triggers/update-modified-timestamp to pg
-- requires: warehouse/sample
-- requires: functions/update-modified-timestamp
begin;
create trigger update_modified_timestamp
before update on warehouse.sample
for each row
execute procedure warehou... |
-- file:regex.sql ln:77 expect:true
explain (costs off) select * from pg_proc where proname ~ '^(abc)$'
|
<gh_stars>100-1000
-- https://github.com/procrastinate-org/procrastinate/pull/471
DROP FUNCTION IF EXISTS procrastinate_defer_periodic_job(character varying, character varying, character varying, character varying, bigint);
ALTER TABLE procrastinate_periodic_defers
DROP COLUMN "queue_name";
|
<reponame>PacktPublishing/Designing-Hexagonal-Architecture-with-Java
INSERT INTO location(location_id, address, city, state, zipcode, country, latitude, longitude)
VALUES(1, '<NAME>', 'Tully', 'NY', '13159', 'United States', '42.797310', '-76.130750');
INSERT INTO location(location_id, address, city, state, zipcode, c... |
DROP TABLE IF EXISTS `multi_user`;
CREATE TABLE `multi_user`(
`id` bigint(64) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`age` int(30) DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
AUTO_INCREMENT = 1
CHARACTER SET = utf8
COLLATE = utf8_general_ci;
|
DELIMITER $$
DROP FUNCTION IF EXISTS `ttab`.`fScriptScrubColumnType` $$
CREATE FUNCTION `ttab`.`fScriptScrubColumnType`(column_type_ VARCHAR(255)) RETURNS VARCHAR(255) CHARSET utf8
DETERMINISTIC
BEGIN
IF LOCATE('VARCHAR',column_type_) > 0 THEN
RETURN CONCAT(' (',REPLACE(REPLACE(REPLACE(column_type_,')'... |
<gh_stars>0
# Identify genomes whose concordance with genotyping data is below a defined cutoff.
SELECT
sample_id,
concordance,
FROM (
SELECT
sample_id,
calls_in_common,
identical_calls,
(identical_calls/calls_in_common) AS concordance
FROM (
SELECT
sample_id,
COUNT(seq_genot... |
CREATE TABLE items (
id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(30) NOT NULL,
description VARCHAR(600) NOT NULL,
create_date TIMESTAMP NOT NULL DEFAULT NOW()
); |
/*
Navicat MariaDB Data Transfer
Source Server : huabei3-1-mariadb-star
Source Server Version : 50560
Source Host : localhost:3306
Source Database : star
Target Server Type : MariaDB
Target Server Version : 50560
File Encoding : 65001
Date: 2019-05-19 12:36:20
*/
SET FOREIGN_KEY_C... |
-- auto-generated definition
create table tasks
(
task_id char(32) not null comment '任务id为任务url的md5值'
primary key,
task_url varchar(500) null comment '任务url',
task_cell int unsigned default '3600' null comment '任务时间间隔',
exec_t... |
<reponame>RyanJarv/steampipe-plugin-gcp
select name, title, akas, kind, guest_cpus, memory_mb, image_space_gb, maximum_persistent_disks, maximum_persistent_disks_size_gb, is_shared_cpu
from gcp.gcp_compute_machine_type
where name = '{{ output.machine_type.value }}'; |
/* contrib/citext/citext--1.1--1.2.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION citext UPDATE TO '1.2'" to load this file. \quit
ALTER FUNCTION citextin(cstring) PARALLEL SAFE;
ALTER FUNCTION citextout(citext) PARALLEL SAFE;
ALTER FUNCTION citextrecv(inte... |
<reponame>yacon/koala-framework<filename>Kwc/Newsletter/Update/35007.sql
ALTER TABLE `kwc_newsletter` ADD `mails_per_minute` VARCHAR( 255 ) NOT NULL ,
ADD `start_date` DATETIME NULL;
ALTER TABLE `kwc_newsletter` CHANGE `status` `status` ENUM( 'start', 'startLater', 'pause', 'stop', 'sending', 'finished' ) C... |
/*
SUBCONSULTAS:
- Son consultas que se ejecutan dentro de otras.
- Consiste en utilizar los resultados de la subconsulta para operar en la
consulta principal.
- Jugando con las claves ajenas / foraneas.
*/
#Sacar users con posts#
-- IN, existe, clausula que puede devolver varios resultados y no uno.
-- = Si sol... |
<reponame>mdmsua/Ausgaben.Database
create function rls.UserPredicate
(
@User nvarchar(128)
)
returns table with schemabinding
as
return select 1 as fn_securitypredicate_result
where cast(session_context(N'User') as nvarchar(128)) = @User |
-- MIT License
--
-- (C) Copyright [2019-2021] Hewlett Packard Enterprise Development LP
--
-- Permission is hereby granted, free of charge, to any person obtaining a
-- copy of this software and associated documentation files (the "Software"),
-- to deal in the Software without restriction, including without limitatio... |
<reponame>jkpvino/events<gh_stars>0
CREATE TABLE IF NOT EXISTS `users` (
`id` INT NOT NULL AUTO_INCREMENT,
`email` VARCHAR(255) NULL ,
`phone_no` VARCHAR(255) NULL ,
`password` VARCHAR(255) NOT NULL ,
`facebook` VARCHAR(255) NULL ,
`google` VARCHAR(255) NULL ,
`country_code` VARCHAR(255) NULL,
`status` ... |
CREATE TABLE EncryptedCards (
CardKeyHash bytea not null,
CardNumberReference uuid not null,
CardData bytea not null,
Datestamp timestamptz not null default now(),
PRIMARY KEY (CardKeyHash),
FOREIGN KEY (CardNumberReference) REFERENCES CardNumberReferences(CardNumberReference)
);
|
<reponame>zonafets/TSQL-Utils
/* leave this
l:see LICENSE file
g:utility
v:091018\s.zaglio: test for bcp form of sp__copy
*/
CREATE proc sp__copy_test_bcp @dbg bit=0
as
begin
set nocount on
declare @r int
if dbo.fn__exists('bcp_test',null)=1 drop table bcp_test
declare @t sysname select @t='a11_um'
-- sp_... |
create schema if not exists orzzone collate utf8mb4_general_ci;
create table if not exists sessions
(
session_id varchar(128) collate utf8mb4_bin not null
primary key,
expires int(11) unsigned not null,
data text collate utf8mb4_bin null
)
charset=latin1;
create table if not exists wp_commentmeta
(
meta_id bigi... |
select 'executing drop user scott' as log from dual;
drop user 'scott'@'%';
-- Creates the user
select 'executing create user scott' as log from dual;
create user 'scott'@'%' identified by 'scott@<PASSWORD>';
-- Gives all the privileges to the new user
select 'executing grant privilege' as log from dual;
grant all on... |
<reponame>devopsmanojn/laraclassified<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.26, for osx10.10 (x86_64)
--
-- Host: 127.0.0.1 Database: laraclassified
-- ------------------------------------------------------
-- Server version 5.7.26
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET... |
<reponame>dev1dev2dev3/importExcel
create view commentaire_vue as
select commentaire.id, concat(concat(utilisateur.nom, ' '), utilisateur.prenom) as utilisateur,
commentaire.contribution, commentaire.contenu, commentaire.daty from commentaire join utilisateur on commentaire.utilisateur = utilisateur.id; |
<gh_stars>0
--- db_schema database has old transactions at time of booking in this script.
--- This script deletes the old data.
--- THIS SCRIPT SHOULD ALWAYS BE CALLED MANUALLY BY A RESPONSIBLE PARTY, AND NEVER AT A LIVE SITE !!!!
TRUNCATE lysglb.ldgr_movement CASCADE;
TRUNCATE lysglb.deboop CASCADE;
TRUNCATE lys... |
<filename>Commands_4_JOIN.sql
# Selecionando a tabela a ser trabalhada
use cadastro;
# Verificando o tipo dos campos e o tamanho
describe gafanhotos;
# Inserindo uma coluna a tabela gafanhotos
alter table gafanhotos add column cursopreferido int;
# Alterando o tipo do campo criado como chave estrangeira
alter table ... |
SET search_path TO final;
DROP FUNCTION IF EXISTS get_group_visibile_models(BIGINT);
DROP FUNCTION IF EXISTS get_all_visibile_models(BIGINT);
DROP FUNCTION IF EXISTS get_user_hash(BIGINT);
DROP FUNCTION IF EXISTS get_thumbnail_information(BIGINT);
DROP FUNCTION IF EXISTS get_members_of_group(BIGINT);
DROP FUNCTION IF ... |
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"email" TEXT,
"password" TEXT,
"createdAt" TIMESTAMP(3),
"updatedAt" TIMESTAMP(3),
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Post" (
"id" SERIAL NOT NULL,
"title" TEXT,
"body" TEXT NOT NULL,
"authorId" INTEGER,... |
SET DEFINE OFF;
ALTER TABLE AFW_13_ETAPE_TUTRL ADD (
CONSTRAINT AFW_13_ETAPE_TUTRL_FK6
FOREIGN KEY (REF_PAGE)
REFERENCES AFW_13_PAGE (SEQNC)
ON DELETE CASCADE
ENABLE VALIDATE)
/
|
create table test_normalization.nested_stream_with_complex_columns_resulting_into_long_names_partition_double_array_data__dbt_tmp
as
with dbt__cte__nested_stream_with_complex_columns_resulting_into_long_names_partition_double_array_data_ab1__ as (
-- SQL model to parse JSON blob stored in a single colum... |
<reponame>Shuttl-Tech/antlr_psql
-- file:plpgsql.sql ln:3806 expect:false
exception
WHEN OTHERS THEN
i := (SELECT 1::integer)
|
# DDL
# USE powerwall
CREATE DATABASE powerwall
CREATE RETENTION POLICY raw ON powerwall duration 3d replication 1
ALTER RETENTION POLICY autogen ON powerwall duration 0s
CREATE RETENTION POLICY strings ON powerwall duration 0s replication 1
CREATE RETENTION POLICY pwtemps ON powerwall duration 0s replication 1
CREATE ... |
BEGIN;
CREATE TABLE IF NOT EXISTS posts (
id UUID PRIMARY KEY,
slug TEXT UNIQUE NOT NULL,
title TEXT NOT NULL,
body TEXT NOT NULL,
author TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE NOT NULL,
updated_at TIMESTAMP WITH TIME ZONE NOT NULL
);
COMMIT;
|
<reponame>scossin/Achilles
-- 1300 Number of persons with at least one visit detail, by visit_detail_concept_id
-- restricted to visits overlapping with observation period
--HINT DISTRIBUTE_ON_KEY(stratum_1)
SELECT
1300 AS analysis_id,
CAST(vd.visit_detail_concept_id AS VARCHAR(255)) AS stratum_1,
CAST(NULL AS VAR... |
CREATE TABLE ENVIRONMENT (
id int not null auto_increment,
name text not null,
state text,
environment_type text,
primary key (id)
);
CREATE TABLE ENVIRONMENT_VIRTUAL_BOX (
environment_id int not null,
snapshot text,
priority int default 1,
primary key (environment_id),
constr... |
<reponame>yczhang1017/ldbc_snb_bi
SELECT tagName AS 'tag:STRING'
FROM (
SELECT
tagName,
frequency AS freq,
abs(frequency - (SELECT percentile_disc(0.88) WITHIN GROUP (ORDER BY frequency) FROM tagNumMessages)) AS diff
FROM tagNumMessages
ORDER BY diff, tagName
LIMIT 400
)
ORDER BY... |
<reponame>brunexmg/saude<filename>src/main/resources/db/migration/V09__add_user_admin.sql
insert into usuario values('<EMAIL>','$2<PASSWORD>',3); |
<reponame>duo8668/ConfOrg<filename>team/sqlscripts/thomas/invoice.sql
CREATE TABLE `invoice` (
`invoice_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`conf_id` int(11) NOT NULL,
`descrption` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL,
`amount` int(3) NOT NULL,
`price` float NOT NUL... |
<reponame>apid/apidApigeeSync
-- Copyright 2017 Google Inc.
--
-- 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 ... |
<reponame>machine-intelligence/arbital-open-source
/* This table contains an entry for every change that a page undergoes. */
CREATE TABLE changeLogs (
/* Unique update id. PK. */
id BIGINT NOT NULL AUTO_INCREMENT,
/* Likeable id for this changelog. Partial FK into likes.
Note that this is not set until the fi... |
/*
* (C) Copyright 2018 CEFRIEL (http://www.cefriel.com/).
*
* 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 ... |
<reponame>pomadchin/raster-foundry
CREATE TYPE public.annotation_project_type AS ENUM (
'DETECTION',
'CLASSIFICATION',
'SEGMENTATION'
);
CREATE TYPE public.tile_layer_type AS ENUM (
'TMS',
'MVT'
);
CREATE TABLE public.annotation_projects (
id uuid primary key,
created_at timestamp without ... |
<reponame>Sitra-Isaacus/VSSHP-Kettle-ETL
-- Table: stage_labdw.labdw_transform
-- DROP TABLE stage_labdw.labdw_transform;
CREATE TABLE stage_labdw.labdw_transform
(
testid text,
testp text,
test text,
testt text,
urgency text,
sampleid text,
cost double precision,
fee double precision,
outcomet tex... |
<filename>atc/db/migration/migrations/1529692120_add_cache_index_to_pipelines.up.sql
ALTER TABLE pipelines ADD COLUMN cache_index integer NOT NULL DEFAULT 1;
ALTER TABLE versioned_resources DROP COLUMN modified_time;
ALTER TABLE build_inputs DROP COLUMN modified_time;
ALTER TABLE build_outputs DROP COLUMN modified_tim... |
EXEC SQL CONNECT TO "connectdb" AS main;
EXEC SQL CONNECT TO "connectdb" AS second;
EXEC SQL CONNECT TO "unix:postgresql://172.16.17.32/connectdb" AS main USER connectuser;
EXEC SQL CONNECT TO "unix:postgresql://localhost/connectdb" AS main USER connectuser;
EXEC SQL CONNECT TO 'connectdb' AS main;
EXEC SQL CONNECT TO ... |
<filename>software/cabio-database/scripts/plsql/plsql_prc/HOMOLOGOUS_ASSOCIATION_LD.prc
CREATE OR REPLACE procedure HOMOLOGOUS_ASSOCIATION_LD as
CURSOR HOMOLASSOCCUR IS
(SELECT ROWNUM,
PERCENT_ALIGNMENT,
GENE_ID,
RELATED_GENE
FROM GENE_HOMOLOGUE);
aID number:=0;
BEGIN
EXECU... |
ALTER TABLE `versions` ADD COLUMN `channel` INT NULL;
|
ALTER TABLE `instances` DROP `deleted_at`;
|
<reponame>imajaydwivedi/Problem-Task---SQL-Server-Slowness
use DBA
GO
IF OBJECT_ID('dbo.usp_replication_agent_checkup') IS NULL
EXECUTE ('create procedure dbo.usp_replication_agent_checkup as select 1 as dummy')
GO
ALTER procedure dbo.usp_replication_agent_checkup
@heartbeat_interval int = 10 -- minutes
,@... |
begin tran
insert into THUMB (UID, BID) values (1, 7);
insert into THUMB (UID, BID) values (1, 1);
if(@@ERROR >0)
begin rollback tran end
else
begin commit tran end |
CREATE TABLE potter_api(
id SERIAL PRIMARY KEY NOT NULL,
name VARCHAR(255),
patronus VARCHAR(255),
alive VARCHAR(255)
) |
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
CREATE PROCEDURE [dbo].[spFeedback_AddNew]
@Id nvarchar(128)
,@Titel nvarchar(128)
,@Name nvarchar(256)
,@Email nvarchar(256)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.