sql stringlengths 6 1.05M |
|---|
-- misc2.test
--
-- execsql {
-- INSERT INTO t1 VALUES(4000000000,'a','b');
-- SELECT a FROM t1 WHERE a>1;
-- }
INSERT INTO t1 VALUES(4000000000,'a','b');
SELECT a FROM t1 WHERE a>1; |
<filename>src/test/resources/sql/create_function/62b684d8.sql
-- file:equivclass.sql ln:26 expect:true
create function int8alias2in(cstring) returns int8alias2
strict immutable language internal as 'int8in'
|
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/select/03ac1ef6.sql
-- file:opr_sanity.sql ln:705 expect:true
SELECT p1.oid, p1.oprname, p2.oid, p2.proname
FROM pg_operator AS p1, pg_proc AS p2
WHERE p1.oprrest = p2.oid AND
(p1.oprresult != 'bool'::regtype OR
p2.prorettype != 'float8'::regtype... |
DROP TABLE IF EXISTS order_shop_items;
DROP TABLE IF EXISTS orders;
DROP TABLE IF EXISTS shop_items;
CREATE TABLE shop_items (
shop_item_id INTEGER NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
description TEXT NOT NULL,
price NUMBER NOT NULL,
image_url TEXT NOT NULL
);
CREATE TABLE orders (
order_id INTEGER ... |
-- SQL ALTER statements for database migration
alter table games add column finished boolean;
alter table games add column winner int;
|
## 3. The With Clause ##
WITH playlist_info AS
(
SELECT
pl.playlist_id,
pl.name playlist_name,
tr.name track_name,
(tr.milliseconds/1000) length_seconds
FROM playlist pl
INNER JOIN playlist_track plt ON plt.playlist_id = pl.playlist_id
INNER JOIN track tr ON tr.t... |
<reponame>hxia/Achilles4Impala<filename>inst/sql/sql_server/export_v4/visit/sqlVisitTreemap.sql
select c1.concept_id,
c1.concept_name as concept_path,
ar1.count_value as num_persons,
1.0*ar1.count_value / denom.count_value as percent_persons,
1.0*ar2.count_value / ar1.count_value as records_per_person
from (sele... |
<filename>pesp-was8.5/db/npi-lookup-change.sql<gh_stars>1-10
ALTER TABLE ENTITY ADD ("NPI_LU_VERIFIED_IND" VARCHAR2(1 CHAR)); |
<reponame>go-squads/project-a3
CREATE TABLE namespace(
id serial PRIMARY KEY,
name varchar(255),
app_id FOREIGN KEY REFERENCES application (id),
active_version integer
latest_version integer
);
|
/****** Object: View [dbo].[V_Experiment_List_Report_2] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Experiment_List_Report_2]
AS
SELECT E.Exp_ID AS ID,
E.Experiment_Num AS Experiment,
U.Name_with_PRN AS Researcher,
dbo.T_Organisms.OG_name AS Organism,
... |
<reponame>syscrest/gdelt-on-scdf
drop table articles if exists;
create table articles (
url VARCHAR(4000) not null primary key,
title TEXT NOT NULL,
language VARCHAR(100) NOT NULL,
sourcecountry VARCHAR(100) NOT NULL,
domain VARCHAR(1000) NOT NULL,
seendate VARCHAR(20) NOT NULL,
content TEXT NOT NULL
); |
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 12, 2014 at 02:48 PM
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
<reponame>mmci2468/automate
-- Change the logic for how we detect conflicting rollout rows.
--
-- In our model, each rollout represents a code push to some set of nodes.
-- The most recent one is still ongoing or "current." A rollout that targets
-- the same set of nodes with the same code version as the current rollou... |
<reponame>jaimeirazabal1/rtf_con_kumbiaphp
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tiempo de generación: 23-11-2015 a las 17:06:32
-- Versión del servidor: 5.5.46-0ubuntu0.14.04.2
-- Versión de PHP: 5.5.9-1ubuntu4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";... |
CREATE TABLE comments (
id INTEGER PRIMARY KEY,
domain_id INTEGER NOT NULL,
name VARCHAR(255) NOT NULL,
type VARCHAR(10) NOT NULL,
modified_at INT NOT NULL,
account VARCHAR(40) DEFAULT NULL,
comment VARC... |
<reponame>Zhaojia2019/cubrid-testcases<gh_stars>1-10
--extended cases for CUBRIDSUS-7231
create table t (i int, j int, k int);
insert into t values (1, 1, 1);
insert into t values (1, 2, 2);
insert into t values (1, 3, 3);
insert into t values (2, 1, 1);
insert into t values (2, 2, 2);
insert into t values (3, 1, 1);... |
<filename>basededatos/Data.sql
-- Clientes
insert into clientes values (1,'Enrique','Perez','Fernandez','1990-12-12','PEFE901212hscnsn07','pfe98676');
insert into clientes values (2,'Juan','Sanchez','Chavez','1989-05-11','SACJ890511hscnsn01','scj98676');
insert into clientes values (3,'Cesar','lopez','Gonzales','1997-... |
<gh_stars>0
CREATE TABLE Employees(
Id INT PRIMARY KEY IDENTITY NOT NULL,
FirstName VARCHAR(50),
LastName VARCHAR(50),
Title VARCHAR(50),
Notes VARCHAR(MAX)
)
INSERT INTO Employees
VALUES
('Velizar', 'Velikov', 'Receptionist', 'Nice customer'),
('Ivan', 'Ivanov', 'Concierge', 'Nice one'),
('Elisaveta', 'Bagriana', 'C... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 07 Jan 2021 pada 17.10
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<filename>src/main/resources/database_import.sql<gh_stars>0
INSERT INTO public.product_category (id, name, category, create_time, update_time) VALUES (2147483645, 'Food', 1, '2018-03-10 00:26:05.000000', '2018-03-10 00:26:05');
INSERT INTO public.product_category (id, name, category, create_time, update_time) VALUES (2... |
<reponame>ricecake/janus
CREATE DATABASE janus_app;
\c janus_app
BEGIN;
CREATE EXTENSION citext;
CREATE TABLE identity (
code text NOT NULL PRIMARY KEY,
active boolean not null default true,
email citext unique not null,
preferred_name text not null,
given_name text,
family_name text
);
CREATE... |
create table community
(
id int auto_increment
primary key,
community_id int unsigned not null,
community_name varchar(128) not null,
introduction varchar(256) not null,
create_time timestamp default CURR... |
<reponame>jksch/postgres<filename>02_Interesting_concepts/01_How_to_shard/init-shard3.sql
CREATE TABLE names_shard_3 (id VARCHAR(36), name VARCHAR(100));
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Tempo de geração: 06/05/2020 às 23:44
-- Versão do servidor: 10.4.6-MariaDB
-- Versão do PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... |
insert into funcionario(
nomeFun , cpf , matricula, rg, funcao)
values ( 'roberto' , '99933312300', '123', '000158', 'entregador' ),
( '<NAME>' , '08432164500', '234', '003469', 'gerente' ),
( '<NAME>' , '13158463499', '567', '108647', 'gerente' ),
( '<NAME>' , '64479503155', '789', '852610', 'Carregador' ),
( '<N... |
<reponame>yukimura1227/trainings<gh_stars>0
CREATE TABLE IF NOT EXISTS `jupyter`.`anime_stock_prices` (
`Date` date NOT NULL,
`TOEI ANIMATION` float NOT NULL DEFAULT 0.0,
`IG Port` float NOT NULL DEFAULT 0.0,
INDEX (`Date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
-- write your queries here
-- Join the two tables so that every column and record appears, regardless of if there is not an owner_id.
select o.id as id, first_name, last_name, v.id as id, make, model, year, price, o.id as owner_id from owners as o left join vehicles as v
on v.owner_id = o.id
-- Count the number of c... |
CREATE TABLE IF NOT EXISTS
regions (
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
name VARCHAR(50) NOT NULL
);
CREATE INDEX idx_region on regions(name);
CREATE TABLE IF NOT EXISTS
cities(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
region_id INT,
name VARCHAR(50) NOT NULL,
FO... |
<gh_stars>0
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[TeleOrderPrdocuctExchange](
[TelOrdPrdExID] [int] IDENTITY(1,1) NOT NULL,
[OrdrID] [int] NOT NULL,
[ProdID] [int] NOT NULL,
[ExchangeWith] [varchar](150) NOT NULL,
[ExchangeQuantity] [int] NOT... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 13, 2021 at 09:13 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 27, 2015 at 11:04
-- Server version: 10.0.17-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=@@CHARACTER_SET_CL... |
<gh_stars>1-10
UPDATE error_notifications
SET service = 'bulk_scan_processor'
WHERE service IS NULL;
|
<gh_stars>1-10
#--SHOW TABLES;
#--SHOW DATABASES;
#--DROP DATABASE mydb;
#--1. Creating the Database
CREATE DATABASE mydb;
USE mydb;
#--2. Creating the table
CREATE TABLE Book (`ID` INT PRIMARY KEY AUTO_INCREMENT,
`Title` VARCHAR(100),
`Author` VARCHAR(40),
`Pages` INT,
`Price` FLOAT,
`GENRE`... |
# create databases
CREATE DATABASE IF NOT EXISTS `das_database`;
CREATE DATABASE IF NOT EXISTS `das_register`; |
<filename>src/test/resources/tkt3824.test_3.sql
-- tkt3824.test
--
-- db eval {
-- CREATE TABLE t3(x,y);
-- INSERT INTO t3 SELECT a, b FROM t1;
-- INSERT INTO t3 VALUES(234,567);
-- CREATE UNIQUE INDEX t3y ON t3(y);
-- DELETE FROM t3 WHERE y IS NULL;
-- SELECT * FROM t3;
-- }
CREATE TABLE t3(x,... |
-- file:alter_generic.sql ln:442 expect:true
CREATE STATISTICS alt_stat2 ON a, b FROM alt_regress_1
|
/* Index hit rate (effective databases are at 99% and up) */
SELECT relname,
CASE idx_scan
WHEN 0 THEN 'Insufficient data'
ELSE (100 * idx_scan / (seq_scan + idx_scan))::text
END percent_of_times_index_used,
n_live_tup rows_in_table
FROM
pg_stat_user_tables
ORDER BY
n_live_tup DESC;
|
CREATE TABLE RegisterToGrantBasicPass_tdc (
id int NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
email varchar(255) NOT NULL,
acceptedTerms int NOT NULL,
emailSendingStatus varchar(255) NOT NULL,
PRIMARY KEY (id)
);
|
DROP DATABASE IF EXISTS burgers_db;
CREATE DATABASE burgers_db;
USE burgers_db;
CREATE TABLE burgers(
id int NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
devoured BOOLEAN DEFAULT false,
PRIMARY KEY(id)
); |
<reponame>BuildingBridge/biznet
DROP TABLE IF EXISTS b_disk_storage;
DROP TABLE IF EXISTS b_disk_object;
DROP TABLE IF EXISTS b_disk_object_lock;
DROP TABLE IF EXISTS b_disk_object_ttl;
DROP TABLE IF EXISTS b_disk_object_path;
DROP TABLE IF EXISTS b_disk_version;
DROP TABLE IF EXISTS b_disk_right;
DROP TABLE IF EXISTS ... |
DROP database IF EXISTS `microlib`;
create database `microlib` default character set utf8mb4;
use microlib;
DROP TABLE IF EXISTS `t_author`;
CREATE TABLE `t_author` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`author_name` varchar(50) DEFAULT NULL,
`author_name_kana` varchar(50) DEFAULT NULL,
`birthday` date DEFAU... |
<gh_stars>0
{% macro right(string_text, length_expression) -%}
{{ adapter_macro('dbt_utils.right', string_text, length_expression) }}
{% endmacro %}
{% macro default__right(string_text, length_expression) %}
right(
{{ string_text }},
{{ length_expression }}
)
{%- endmacro -%}
{% macr... |
/*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50730
Source Host : localhost:3306
Source Schema : javaweb-blog
Target Server Type : MySQL
Target Server Version : 50730
File Encoding : 65001
Date: 16/... |
-- @Description Tests the behavior when the index of an ao table
-- has not been cleaned (e.g. because of a crash).
--
SET enable_seqscan=false;
DELETE FROM foo WHERE a < 16;
VACUUM foo;
SELECT * FROM foo WHERE b = 20;
SELECT * FROM foo WHERE b = 10;
INSERT INTO foo SELECT i as a, i as b, 'Good morning' as c FROM gen... |
<gh_stars>0
-- @testpoint:删除函数添加RESTRICT参数并且省略函数参数
drop FUNCTION if EXISTS u_testfun95(int) RESTRICT;
CREATE FUNCTION u_testfun95 ( INOUT c_int int) RETURNS int AS $$
BEGIN
RETURN (c_int);
END;
$$ LANGUAGE plpgsql;
/
--删除函数添加RESTRICT参数并且省略函数参数类型,合理报错
drop FUNCTION if EXISTS u_testfun9... |
--Schema Creation SQL:
-- Wyseman copy of function; Keep in sync with what is in bootstrap.sql
create schema if not exists wm;
grant usage on schema wm to public;
create or replace function wm.create_role(grp text, subs text[] default '{}') returns boolean language plpgsql as $$
declare
retval boolean default fa... |
<filename>PL$GEN_XML_BODY.sql
create or replace PACKAGE BODY PL$GEN_XML AS
/*
The MIT License (MIT)
Copyright (c) 2015 <NAME>
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, ... |
<gh_stars>0
INSERT INTO SEQUENCE (SEQ_NAME, SEQ_COUNT) VALUES ('SEQ_GEN', 0); |
-- Drop Schedules
USE [msdb]
GO
DECLARE @sID INT
SET @sID=(SELECT SCHEDULE_ID FROM sysschedules WHERE name=N'DataMaintenance_$(DB_DATA)');
IF @sID IS NOT NULL
BEGIN
EXEC dbo.sp_delete_schedule
@schedule_name =N'DataMaintenance_$(DB_DATA)';
END |
<gh_stars>0
create table public.Message
(
id bigserial not null constraint message_pkey primary key,
created timestamp not null default CURRENT_TIMESTAMP,
email varchar(100) not null,
name varchar(50) not null,
message varchar(1000) not null,
uid varchar (100) not null constraint uk_message_uid unique
);
|
CREATE TABLE files (
name varchar,
size int,
hash varchar,
payload text);
CREATE TABLE transfer_meter (
uploaded BIGINT,
downloaded BIGINT);
INSERT INTO transfer_meter
SELECT 0, 0
WHERE NOT EXISTS (SELECT * FROM transfer_meter);
-- Migration: Add synchronization fields
ALTER TABLE files ADD COLUMN bl... |
/*
* To run SWAP these quantities are needed:
* created_at
* user_id
* asset_id
* name (dr7objid)
* answer_id
* external_ref
*
* These values are found in 4 different tables in the GZ2 DB:
* annotations
* classifications
* asset_classifications
* assets
*
* Join all of thes... |
<gh_stars>0
use testing;
/*
Area code data from https://nationalnanpa.com/enas/geoAreaCodeNumberReport.do
Download: $nums = import-excel .\NpasInSvcByNumRpt.xlsx
Import into table: $nums | ConvertTo-DbaDataTable |Write-DbaDataTable -SqlInstance localhost\sql17 -database testing -schema dbo -Table AreaCodes -AutoCreateT... |
-- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jan 24, 2018 at 10:21 AM
-- Server version: 5.5.55-38.8-log
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
<reponame>NealAnalyticsLLC/ProjectRio<filename>Source/Apps/Partner/Released/NealAnalytics-SKUMax/Service/SQL/Phase2/vwProducts.sql<gh_stars>0
------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------... |
<gh_stars>0
CREATE TABLE [HangFire].[AggregatedCounter] (
[Key] NVARCHAR (100) NOT NULL,
[Value] BIGINT NOT NULL,
[ExpireAt] DATETIME NULL,
CONSTRAINT [PK_HangFire_CounterAggregated] PRIMARY KEY CLUSTERED ([Key] ASC)
);
GO
CREATE NONCLUSTERED INDEX [IX_HangFire_AggregatedCounter... |
/*
SQLyog Ultimate v11.11 (64 bit)
MySQL - 5.5.5-10.4.8-MariaDB : Database - kofi_abora
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_F... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 26, 2015 at 06:49 PM
-- Server version: 5.5.41-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.127.12
-- Tempo de geração: 01-Out-2020 às 05:03
-- Versão do servidor: 10.4.14-MariaDB
-- versão do PHP: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
<gh_stars>0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `db_Name`
--
-- --------------------------------------------------------
--
-- Table structure for table `DataCollection`
--
DROP TABLE IF EXISTS `DataCollection`;
CREATE TABLE IF NOT EXISTS `DataCollection` (
`id` int(1... |
<reponame>VerkhovtsovPavel/BSUIR_Labs
--Variant 2
CREATE PROCEDURE dbo.SubCategoriesByColor
@colors nvarchar(255)
AS
exec('SELECT [Name],'+
@colors+'
FROM
( SELECT PS.[Name], [Color], [Weight] FROM [Production].[ProductSubcategory] AS PS
INNER JOIN [Production].[Product] AS PP
ON PS.[ProductSubCate... |
--liquibase formatted sql
--changeset patcher-core:Page_182033F620954FD3B4052BE7CBFD4071 dbms:postgresql runOnChange:true splitStatements:false stripComments:false
select pkg_patcher.p_remove_page('182033F620954FD3B4052BE7CBFD4071');
INSERT INTO s_mt.t_page (ck_id, ck_parent, cr_type, cv_name, cn_order, cl_static, cv_... |
<gh_stars>1-10
SELECT DISTINCT
t_assessment_item.id,
t_assessment_item.uuid,
t_assessment_item.title,
t_assessment_item.creation_timestamp,
t_assessment_item.identifier,
t_statistic.how_solved
FROM
t_assessment_item,
t_statistic
WHERE
t_assessment_item.id = t_statistic.fk_t_assessment_i... |
#CRIANDO BANCO DE DADOS
CREATE DATABASE bd_vacina_sars_cov_2;
#USANDO O BANCO DE DADOS
USE bd_vacina_sars_cov_2; |
begin;
drop schema if exists euroleague cascade;
create schema euroleague;
commit;
|
PRINT N'Post deploy'
:r Script1.sql
|
-- database
-- 1.学生表
-- Student(s_id, s_name, s_birth, s_sex) --s_id 学生编号,s_name 学生姓名,s_birth 出生年月,s_sex 学生性别
-- 2.课程表
-- Course(c_id, c_name, t_id) --c_id --c_id 课程编号,c_name 课程名称,t_id 教师编号
-- 3.教师表
-- Teacher(t_id, t_name) --t_id 教师编号,t_name 教师姓名
-- 4.成绩表
-- Score(s_id, c_id, s_score) --s_id 学生编号,c_id 课程编号,s_score... |
<gh_stars>0
INSERT INTO COURSE(course_id, course_name) VALUES (1, 'Java');
INSERT INTO COURSE(course_id, course_name) VALUES (2, 'Maven');
INSERT INTO COURSE(course_id, course_name) VALUES (3, 'PHP');
INSERT INTO STUDENT (student_id, student_name, email, course_number, course_id, student_date) VALUES (1, 'Bob1', '<EMA... |
<gh_stars>0
#namespace("system-res")
#include("system/SysRes.sql")
#end
#namespace("system-role")
#include("system/SysRole.sql")
#end
#namespace("system-user")
#include("system/SysUser.sql")
#end |
-- MS SQL Server database script - upgrade to data model version 6
alter table extensioncodes add code_value nvarchar(10) not null default '0';
alter table extensioncodes drop constraint extensioncodesPK;
alter table extensioncodes add constraint extensioncodesPK primary key (field_name, code_value);
|
<gh_stars>1-10
select * from entrada where id = :id |
-- Ausrüstungstabellen geändert. Vererbungsschema angewandt.
CREATE TABLE [Ausrüstung] (
[AusrüstungGUID] uniqueidentifier NOT NULL DEFAULT newid(),
[Name] nvarchar(200) NOT NULL,
[Preis] float NOT NULL DEFAULT 0,
[Gewicht] int NOT NULL DEFAULT 0,
[Verbreitung] nvarchar(300),
[Literatur] nvarchar(300... |
<reponame>patrickfischer1/WebAPI
INSERT INTO ${ohdsiSchema}.sec_permission(id, value, description)
SELECT ${ohdsiSchema}.sec_permission_id_seq.nextval,
'user:import:*:test:get', 'Check LDAP/AD connection' FROM dual;
INSERT INTO ${ohdsiSchema}.sec_role_permission (id, role_id, permission_id)
SELECT ${ohdsiS... |
<gh_stars>0
CREATE PROCEDURE `qtopology_sp_add_worker_history`(p_name varchar(100))
begin
insert into qtopology_worker_history(ts, name, status, lstatus)
select NOW() as ts, name, status, lstatus
from qtopology_worker
where name = p_name;
end |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2+deb8u2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 09, 2017 at 09:13 AM
-- Server version: 10.0.28-MariaDB-0+deb8u1
-- PHP Version: 5.6.29-0+deb8u1
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 26, 2018 at 07:36 AM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.0.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>AtlanticR/bio.utilities
--------------------------------------------------------
-- DDL for Table SDCFDET_TMP
--------------------------------------------------------
CREATE TABLE "GROUNDFISH"."SDCFDET_TMP"
( "MISSION" VARCHAR2(10 BYTE),
"FSHNO" NUMBER(4,0),
"FLEN" NUMBER(4,0),
"FWT" NUMBER(6,0)... |
/*
Warnings:
- You are about to drop the column `reset_month` on the `Payment` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Payment" DROP COLUMN "reset_month";
|
CREATE TABLE "DataRuleDescriptions"
(
"DataRuleDescriptionsId" INTEGER NOT NULL UNIQUE,
"Schedule" TEXT,
"LineNumber" TEXT,
"RuleNumber" TEXT,
"RuleDescription" TEXT,
"ScheduleOrder" TEXT,
PRIMARY KEY("DataRuleDescriptionId" AUTOINCREMENT)
); |
<gh_stars>0
DROP DATABASE IF EXISTS bamazonDB;
CREATE DATABASE bamazonDB;
USE bamazonDB;
CREATE TABLE products (
item_id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(45) NULL,
department_name VARCHAR(45) NULL,
price DECIMAL(25, 2) NULL,
stock INT(45) NULL,
PRIMARY KEY (item_id)
);
INSERT INTO produ... |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WebSubscription]') AND type in (N'U'))
BEGIN
CREATE TABLE [dbo].[WebSubscription](
[SubscriptionId] [int] NOT NULL,
[ObjectId] [int] NOT NULL,
[RecordId] [int] NOT NULL,
[PartId] [int] NOT ... |
INSERT INTO WWS_COUNTRIES (ID, NAME, ISO3, ISO2, PHONECODE, CAPITAL, CURRENCY, CREATED_AT, UPDATED_AT, FLAG, WIKIDATAID) VALUES (58, 'Czech Republic', 'CZE', 'CZ', '420', 'Prague', 'CZK', TO_TIMESTAMP('2018-07-20 16:41:03','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2019-08-02 21:38:23','YYYY-MM-DD HH24:MI:SS'), 1, 'Q213')... |
CREATE TABLE ejp_name (
id INTEGER PRIMARY KEY,
first TEXT,
last TEXT
);
CREATE INDEX ejp_name_concat ON ejp_name (lower(first || ' ' || last)); |
ALTER TABLE public.search_servicearea
RENAME COLUMN service_area_type TO type;
ALTER TABLE ONLY public.search_servicearea
ADD CONSTRAINT con_catchment_type CHECK (type IN ('family', 'civil', 'other'));
UPDATE public.search_servicearea
SET type = 'family'
WHERE slug in ('probate', 'divorce', 'civil-partnership', 'fo... |
<filename>samples/features/security/always-encrypted-with-secure-enclaves/tsql-scripts/DropKeys.sql
USE [Clinic]
DROP COLUMN ENCRYPTION KEY [CEK1]
GO
USE [Clinic]
DROP COLUMN ENCRYPTION KEY [CEK2]
GO
DROP COLUMN MASTER KEY [CMK1]
GO |
CREATE PROCEDURE [NTangle].[spCustomerBatchExecute]
@MaxQuerySize BIGINT = 100, -- Maximum size of query to limit the number of changes to a manageable batch (performance vs failure trade-off).
@ContinueWithDataLoss BIT = 0 -- Ignores data loss and continues; versus throwing an error.
AS
BEGIN
/*
... |
<reponame>Shuttl-Tech/antlr_psql
-- file:tstypes.sql ln:142 expect:true
select to_tsvector('simple', 'x y q') @@ '(!x | y <-> z) <-> q' AS "true"
|
CREATE TYPE [dbo].[SlowQueriesStats] AS TABLE (
[Truncated] INT NULL,
[ProcessingTime] INT NULL,
[TotalEventsProcessed] INT NULL,
[EventCount] INT NULL,
[DroppedCount] INT NULL,
[MemoryUsed] INT NULL);
|
# Write your MySQL query statement below
SELECT s.machine_id, ROUND(AVG(e.timestamp-s.timestamp), 3) AS processing_time
FROM Activity s JOIN Activity e ON
s.machine_id = e.machine_id AND s.process_id = e.process_id AND
s.activity_type = 'start' AND e.activity_type = 'end'
GROUP BY s.machine_id;
|
drop table if exists `{dbprefix}ruler`;
create table if not exists `{dbprefix}ruler`(
`rulerid` int(11) unsigned not null auto_increment comment 'ID',
`rulername` varchar(50) not null default '' comment '管理员账号',
`passwd` varchar(50) not null default '' comment '密码',
`realname` varchar(10) not null default '' commen... |
<filename>example/tpcc/name/_mdb0._mtable2-schema.sql
/*from(br)*/CREATE TABLE `_mtable2` (
`_mcolaba57a` int(11) NOT NULL,
`_mcol16vnwya` int(11) NOT NULL,
`_mcol1xmdl54` int(11) NOT NULL,
`_mcol1heauqa` int(11) NOT NULL,
`_mcol161c474` int(11) NOT NULL,
`_mcolndqr09` datetime DEFAULT NULL,
`_mcol1oi5bpw... |
<reponame>JinXingYoung/harbor
/* Fix retention_policy create_time, update_time for pgx driver */
ALTER TABLE retention_policy ALTER COLUMN create_time TYPE TIMESTAMP WITHOUT TIME ZONE USING (current_date + create_time);
ALTER TABLE retention_policy ALTER COLUMN update_time TYPE TIMESTAMP WITHOUT TIME ZONE USING (curren... |
<reponame>unison/unison
\set ON_ERROR_STOP
BEGIN;
TRUNCATE ncbi.generif;
\copy ncbi.generif FROM PSTDIN WITH NULL AS '-'
UPDATE origin SET last_updated = NOW() WHERE origin='NCBI GeneRIF';
COMMIT;
ANALYZE ncbi.generif;
SELECT COUNT(*) FROM ncbi.generif;
|
CREATE DATABASE capsule;
CREATE USER 'usrcapsule'@'localhost' IDENTIFIED BY 'capsuleusr';
GRANT ALL PRIVILEGES ON capsule. * TO 'usrcapsule'@'localhost';
FLUSH PRIVILEGES;
USE capsule;
/*
CREATE TABLE IF NOT EXISTS user (
seq_user INT(6) AUTO_INCREMENT PRIMARY KEY
,nam_user VARCHAR(50) NOT NULL DEFAULT ''
,pwd_user ... |
<reponame>MCZbase/DDL
CREATE TABLE "LOAN_ITEM"
( "TRANSACTION_ID" NUMBER NOT NULL ENABLE,
"COLLECTION_OBJECT_ID" NUMBER NOT NULL ENABLE,
"RECONCILED_BY_PERSON_ID" NUMBER NOT NULL ENABLE,
"RECONCILED_DATE" DATE,
"ITEM_DESCR" VARCHAR2(127 CHAR) NOT NULL ENABLE,
"ITEM_INSTRUCTIONS" VARCHAR2(255 CHAR),
"... |
ALTER TABLE cohort_generation_info DROP CONSTRAINT FK_cgi_cd;
DROP TABLE cohort_generation_info;
CREATE TABLE cohort_generation_info (
id Number(10) NOT NULL,
source_id Number(10) NOT NULL,
start_time Timestamp(3) NULL,
execution_duration Number(10) NULL... |
SELECT
*
FROM
view_beban_barang4_awayan
UNION ALL
|
drop table if exists t1;
create table t1 (a int primary key, b int) partition by hash(a) partitions 2;
insert into t1 values(1,1),(2,2);
truncate t1;
drop table if exists t1;
|
CREATE TABLE restaurants (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
is closed BOOLEAN NOT NULL DEFAULT FALSE,
rating NUMERIC(2,1),
address VARCHAR(100) NOT NULL,
city VARCHAR(100) NOT NULL,
website_url VARCHAR(100),
open_date DATE
); |
<filename>src/spring/src/test/resources/db/migration/V1__init.sql
create schema if not exists "public";
create table shops (
shop_id int(5) not null,
shop_name varchar(255) not null
);
alter table shops add constraint shops_pk primary key(shop_id);
create table items (
shop_id int(5) not null,
item_id int(5) not ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.