sql stringlengths 6 1.05M |
|---|
<filename>ifs-data-layer/ifs-data-service/src/main/resources/db/migration/V132_2_1__Set_collaboration_level.sql
-- IFS-4221 Migrate all open competitions to have collaboration level SINGLE_OR_COLLABORATIVE
UPDATE competition
SET collaboration_level = 'SINGLE_OR_COLLABORATIVE'
WHERE collaboration_level != 'SINGLE_OR_COL... |
<reponame>by-implication/Open-Reconstruction
# --- !Ups
ALTER TABLE reqs
ADD COLUMN requirement_ids int[] NOT NULL DEFAULT '{}';
ALTER TABLE requirements
ADD COLUMN requirement_deprecated boolean NOT NULL DEFAULT false;
UPDATE reqs req SET requirement_ids = (
SELECT array_agg(requirement_id)
FROM requirements, g... |
/*
* Simple sort
*/
[sql]
select v1 from t0 order by v1
[result]
logical sort (col)
logical project (col)
logical project (col,col,col)
logical project (col,col,col)
logical scan
[end]
[sql]
select v1,v2 from t0 order by v3
[result]
logical project (col,col)
logical sort (c... |
<gh_stars>0
--NFL Tables are separated into 3 tables
--1 Stadium data
--2 game data
--4 team data
--------------------------------------------------------------------------------------------Exploratory Data Analysis
SELECT * FROM stadiums
SELECT * FROM games
SELECT * FROM teams
SELECT [stadium_nam... |
<filename>sample-queries-tpcds/not_tested/query71.sql
select i_brand_id brand_id, i_brand brand,t_hour,t_minute,
sum(ext_price) ext_price
from item JOIN (select ws_ext_sales_price as ext_price,
ws_sold_date_sk as sold_date_sk,
ws_item_sk as sold_item_sk,
... |
CREATE TABLE [dbo].[Tech]
(
[Active] bit not null DEFAULT 1,
[Address] NVARCHAR (255) NULL,
[Address2] NVARCHAR (255) NULL,
[City] NVARCHAR (50) NULL,
[State] NCHAR (2) CONSTRAINT [DF__TECH__State] DEFAULT ('GA') NULL,
[ZipCode] ... |
<filename>src/main/resources/doc/sys_user.sql
/*
Navicat Premium Data Transfer
Source Server : mysql-localhost
Source Server Type : MySQL
Source Server Version : 50616
Source Host : localhost
Source Database : mybatis-plus
Target Server Type : MySQL
Target Server Version : 50616
... |
insert into TIPOUSUARIO(tipo)VALUES('Academico');
insert into TIPOUSUARIO(tipo)VALUES('Profesor');
insert into TIPOUSUARIO(tipo)VALUES('Estudiante');
insert into NPUERTAS(puertas)VALUES(2);
insert into NPUERTAS(puertas)VALUES(3);
insert into NPUERTAS(puertas)VALUES(4);
insert into NPUERTAS(puertas)VALUES(5)... |
IF (NOT EXISTS (SELECT * FROM sys.schemas WHERE name = 'ParentPortal'))
BEGIN
EXEC ('CREATE SCHEMA [ParentPortal] AUTHORIZATION [dbo]')
END
/****** Object: Table [ParentPortal].[AlertLog] Script Date: 11/28/2018 5:36:13 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [ParentPortal].[... |
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `t_wxcms_account`
-- ----------------------------
DROP TABLE IF EXISTS `t_wxcms_account`;
CREATE TABLE `t_wxcms_account` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) DEFAULT NULL,
`account` varchar(100) NOT NULL,
`a... |
-- SQBM Set query 4 without order by
set schema 's';
SELECT KSEQ, K500K FROM BENCH1M
WHERE
K2 = 1
AND K100 > 80
AND K10K BETWEEN 2000 AND 3000
;
SELECT KSEQ, K500K FROM BENCH1M
WHERE
K100 > 80
AND K10K BETWEEN 2000 AND 3000
AND K5 = 3
;
SELECT KSEQ, K500K FROM BENCH1M
WHERE
K10K BET... |
--1076. Project Employees II
--
--Table: Project
--
--+-------------+---------+
--| Column Name | Type |
--+-------------+---------+
--| project_id | int |
--| employee_id | int |
--+-------------+---------+
--(project_id, employee_id) is the primary key of this table.
--employee_id is a foreign key to Empl... |
alter table TAB_NEW_PK add constraint TAB_NEW_PK primary key (ID);
alter table TAB_WRONG_PK_NAME drop primary key;
alter table TAB_WRONG_PK_NAME add constraint WRONG_PK_NAME primary key (ID);
alter table TAB_WRONG_PK_REVERSE drop primary key;
alter table TAB_WRONG_PK_REVERSE add constraint TAB_WRONG_PK_REVERSE primary ... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.6
-- Dumped by pg_dump version 10.6
--
-- Data for Name: roles; Type: TABLE DATA; Schema: public; Owner: engine
--
INSERT INTO roles (id, name, description, is_readonly, role_type, allows_viewing_children, app_mode) VALUES ('00000000-0000-0000-000... |
<reponame>jewish-interactive/ji-cloud<filename>backend/api/migrations/20220604010018_add-badge-user-indices.sql
alter table user_profile
add column last_synced_at timestamp with time zone;
alter table badge
add column last_synced_at timestamp with time zone;
insert into algolia_index_settings(index_name)
v... |
-- Pass topic ids on the command line as a list using -v, mind the single and double quotes!
-- command for getting the recommended services for all the topics in Things to do right away
-- psql -d pathways_local -F $'\t' -A -f utility/dump_content_for_per_topic_service_review.sql \
-- -v task_ids="('contact-workers-... |
<reponame>davidhuser/dhis2-core
insert into userroleauthorities (userroleid, authority)
select userroleid, 'F_ORGANISATIONUNIT_MOVE'
from userroleauthorities a
where a.authority = 'F_ORGANISATIONUNIT_ADD' and not exists
(select 1
from userroleauthorities b
where a.userroleid = b.userroleid and b.authority =... |
-- @testpoint:opengauss关键字class(非保留),作为函数名
--关键字不带引号-成功
drop function if exists class;
create function class(i integer)
returns integer
as $$
begin
return i+1;
end;
$$ language plpgsql;
/
--清理环境
drop function class;
--关键字带双引号-成功
drop function if exists "class";
create function "class"(i integer)
returns integer
a... |
-- @testpoint: 插入非法空值,合理报错
drop table if exists serial_12;
create table serial_12 (id int,name serial);
insert into serial_12 values (1,' ');
drop table serial_12; |
<filename>Estados/CriarTabelaEstados.sql
-- Comentários no arquivo de Dados
-- Criando a tabela Estado
create table estados ( -- Definir as colunas e as regras relacionadas as colunas
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
nome VARCHAR(45) NOT NULL,
sigla VARCHAR(2) NOT NULL,
regiao ENUM('Norte', 'N... |
SELECT "Provider_2"."nppes_provider_city" AS "nppes_provider_city" FROM "Provider_2" WHERE (("Provider_2"."nppes_provider_state" = 'WA') AND ("Provider_2"."provider_type" = 'Nephrology')) GROUP BY 1;
|
CREATE PROCEDURE dotnetnuke_dukes.[dnn_EngageEmployment_spGetLocations]
@portalId int,
@jobGroupId int
AS
SELECT DISTINCT LocationId, LocationName, StateId, StateName, StateAbbreviation
FROM dnn_EngageEmployment_vwLocations
WHERE PortalId = @portalId
AND (@jobGroupId IS NULL OR JobGroupId = @jobGroupId)
... |
<gh_stars>0
INSERT INTO `tbl_mastergame_tag` (`Name`, `ReadableName`, `ShortName`, `TagType`, `HasCustomCode`, `Description`, `Examples`, `BadgeColor`) VALUES ('VirtualReality', 'Virtual Reality', 'VR', 'Other', b'0', 'A game designed for a VR platform.', '["Superhot VR", "Lone Echo 2", "Resident Evil 4 VR"]', '1C1E20'... |
<reponame>Bidulman/bidoyon-plus
UPDATE users SET permission=? WHERE id=?; |
<reponame>PierreLetter/sqlwatch
CREATE VIEW [dbo].[vw_sqlwatch_report_fact_disk_utilisation_database] with schemabinding
AS
SELECT d.[sqlwatch_database_id]
,d.[database_size_bytes]
,d.[unallocated_space_bytes]
,d.[reserved_bytes]
,d.[data_bytes]
,d.[index_size_bytes]
,d.[unused_by... |
<filename>NoteBookApp/Server/Infrastructure/DbCreate.sql
CREATE TABLE ApplicationUser
(
ApplicationUser_Key nvarchar(32) NOT NULL Primary key,
AvatarFile bigint null,
constraint FK_ApplicationUser_AspNetUsers foreign key (ApplicationUser_Key) references AspNetUsers,
)
CREATE TABLE Note
(
Id uniqueidentifier N... |
--github.com/imsunnyjha
select doctor,professor,singer,actor
from (select * from (select Name, occupation, (ROW_NUMBER() OVER (PARTITION BY occupation ORDER BY name))
as row_num from occupations
order by name asc) pivot
( min(name) for occupation i... |
--
-- Table structure for table `packagist_history`
--
CREATE TABLE `packagist_history` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`package_id` int(11) NOT NULL,
`downloads` int(11) NOT NULL,
`stars` int(11) NOT NULL,
`new_downloads` int(11) DEFAULT NULL,
`new_stars` int(11) DEFAULT NULL,
`date` datetime NO... |
<reponame>emmaus-5v/webshop-5vc-onno-tom
--
-- create tables
--
DROP TABLE IF EXISTS products;
CREATE TABLE products (
id INTEGER PRIMARY KEY ,
code VARCHAR(15),
name VARCHAR(255),
description TEXT,
price NUMERIC(10, 300),
broek_id INTEGER,
shirt_id INTEGER,
truien_id INTEGER,
sokken_id INTEGER,
b... |
<reponame>Kineolyan/election
DROP INDEX IF EXISTS voting_tokens_electionid_idx;
DROP INDEX IF EXISTS voting_tokens_token_idx;
DROP INDEX IF EXISTS voting_tokens_used_idx;
DROP TABLE IF EXISTS voting_tokens;
|
<gh_stars>1-10
/****** Object: User Defined Function dbo.PublicThreadPosts Script Date: 5/1/2004 6:12:46 PM ******/
CREATE FUNCTION dbo.PublicThreadPosts
(
@ThreadID int
)
RETURNS int
BEGIN
RETURN(SELECT COUNT(*) FROM PublicForumsPosts WHERE ThreadID = @ThreadID)
END
|
create database if not exists tennis;
use tennis;
create table if not exists club (PID int(4), Name varchar(30), Age int(2), Titles int(2), Sex char(1));
#select * from club; |
-- Host: corendon Database: corendonlostluggage
-- Author: <NAME> & IS103-3
-- ------------------------------------------------------
-- Server version 5.7.20-log
--
-- Create the DB
--
CREATE DATABASE IF NOT EXISTS `corendonlostluggage` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `corendonlostluggage`;
/*!4010... |
-- MySQL dump 10.13 Distrib 8.0.24, for Linux (x86_64)
--
-- Host: localhost Database: vk
-- ------------------------------------------------------
-- Server version 8.0.24
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101... |
-- file:foreign_data.sql ln:399 expect:true
SELECT * FROM information_schema.role_usage_grants WHERE object_type LIKE 'FOREIGN%' AND object_name IN ('s6', 'foo') ORDER BY 1, 2, 3, 4, 5
|
<filename>src/test/resources/sql/select/13e6368e.sql<gh_stars>10-100
-- file:tsdicts.sql ln:46 expect:true
SELECT ts_lexize('hunspell', 'footklubber')
|
<reponame>howijd/guild-operators
CREATE FUNCTION grest.pool_history (_pool_bech32 text, _epoch_no uinteger DEFAULT NULL)
RETURNS TABLE (
epoch_no bigint,
active_stake text,
active_stake_pct numeric,
saturation_pct numeric,
block_cnt bigint,
delegator_cnt bigint,
margin double precision,
... |
CREATE DATABASE processEngine;
GO
ALTER DATABASE processEngine SET ALLOW_SNAPSHOT_ISOLATION ON;
ALTER DATABASE processEngine SET READ_COMMITTED_SNAPSHOT ON;
EXEC sp_configure 'CONTAINED DATABASE AUTHENTICATION', 1
GO
RECONFIGURE
GO
ALTER DATABASE processEngine SET CONTAINMENT = PARTIAL;
GO
USE processEngine;
GO
CRE... |
<filename>tests-e2e/db-setup/mattermost.sql
--
-- Just add the system admin.
--
COPY public.users (id, createat, updateat, deleteat, username, password, authdata, authservice, email, emailverified, nickname, firstname, lastname, "position", roles, allowmarketing, props, notifyprops, lastpasswordupdate, lastpictureupda... |
[openid]
IF = "SELECT 1 FROM information_schema.columns WHERE TABLE_SCHEMA = '__DATABASE__' AND table_name='__PREFIX__xshop_vendor' AND COLUMN_NAME='openid';length:0"
THEN = "ALTER TABLE `__PREFIX__xshop_vendor` ADD openid varchar(45) default '' COMMENT '';"
[nickname]
IF = "SELECT 1 FROM information_schema.columns WHE... |
CREATE SCHEMA IF NOT EXISTS subscriptions;
CREATE TABLE IF NOT EXISTS subscriptions.subscription
(
id SERIAL NOT NULL,
subscription_id character varying(128) COLLATE pg_catalog."default" NOT NULL,
trigger character varying(1023) COLLATE pg_catalog."default",
initial_record_time timestamp without time ... |
<reponame>p431i7o/online-home-control<filename>webserver/db/1.sql
create database home;
grant all on home.* to home@localhost identified by 'homepass';
|
<reponame>spdfire/teddix
DROP DATABASE IF EXISTS teddix;
CREATE DATABASE teddix;
USE teddix;
CREATE TABLE server (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(50),
created DATETIME,
hostname VARCHAR(250),
ipv4 VARCHAR(250),
ipv6 VARCHAR(250),
resolving VARCHAR(25),
active VARCHAR(25),
PRIMARY K... |
<gh_stars>10-100
/* count_distinct for int and bigint */
CREATE OR REPLACE FUNCTION count_distinct_append(internal, anyelement)
RETURNS internal
AS 'count_distinct', 'count_distinct_append'
LANGUAGE C IMMUTABLE;
CREATE OR REPLACE FUNCTION count_distinct_elements_append(internal, anyarray)
RETURNS inte... |
<gh_stars>0
create procedure cms_AddUser
@s_UserID varchar(50),
@s_Pwd varchar(50)
as
declare @iAffectedRows int;
set @iAffectedRows = 0
if (not exists (select 1 from dbo.CMS_User where UserID = @s_UserID))
begin
insert into dbo.CMS_User (UserID, Pwd)
select @s_UserID, @s_Pwd;
set @iAffectedRows = @@r... |
<gh_stars>0
/**
* This script drops the database and the user from a previous install.
*
* Only run this script for a reinstall.
*
* Change the database name and the user name to your choice of names
* before running this script.
*/
DROP DATABASE IF EXISTS `lilidb`;
DROP USER 'liliuser'@'localhos... |
CREATE DATABASE crud_php_mysql;
USE crud_php_mysql;
CREATE TABLE `veiculos` (
`cod_veiculo` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`placa` VARCHAR(10) NOT NULL,
`marca` VARCHAR(30) NOT NULL,
`modelo` VARCHAR(30) NOT NULL,
`ano_fabricacao` YEAR NOT NULL,
PRIMARY KEY (`cod_veiculo`) USING BTREE,
UNIQUE INDEX ... |
-- 1: selected>Just Me
-- 2: Specific User(s)
-- 3: All Friends
-- 4: Friends of Friends
-- 5: Only Friends on Connectify
-- 6: Public
-- UNLISTED OPTION
-- posts: posts satisfying 1, 3, 4, 6
WITH posts AS
(SELECT id FROM API_post WHERE author_id in
-- >>>>>>>>>> gets ids matching #4: friend of friends <... |
drop table if exists MB_ATTR_VALUE;
/*==============================================================*/
/* Table: MB_ATTR_VALUE */
/*==============================================================*/
create table MB_ATTR_VALUE
(
ATTR_KEY varchar(30) not null comment '参数KEY值 取值... |
DROP TABLE public.roles; |
SELECT COUNT(NAME) FROM CITY WHERE POPULATION > 100000;
|
<reponame>ianfrantz/Docker-with-Databases<gh_stars>1-10
/* Current Resource Governor Configuration */
SELECT * FROM sys.dm_resource_governor_configuration;
/* Create two resource pools */
CREATE RESOURCE POOL Pool1
WITH (CAP_CPU_PERCENT = 100, MAX_CPU_PERCENT = 90);
CREATE RESOURCE POOL Pool2
WITH (CAP_CPU_PERCENT = 1... |
-- Query the sum of Northern Latitudes (LAT_N) from STATION having values greater than 38.7880 and less than 137.2345.
-- Truncate your answer to decimal places.
SELECT ROUND(SUM(LAT_N), 4) FROM STATION WHERE LAT_N BETWEEN 38.788 and 137.2345; |
SET NOCOUNT ON;
SET ANSI_NULLS ON;
SET QUOTED_IDENTIFIER ON;
/************************************
Begin sp_doc tests
*************************************/
--Clean Class
EXEC [tSQLt].[DropClass] 'sp_doc';
GO
EXEC [tSQLT].[NewTestClass] 'sp_doc';
GO
/*
======================
Test Prep
======================
*/
/*
... |
PRAGMA foreign_keys= off;
BEGIN TRANSACTION;
UPDATE schema_information SET value = "8" WHERE key = "version";
INSERT OR IGNORE INTO normalization (normalization_name, normalization_id)
VALUES ('peer_rotation_more_than_average', 'Z2z0wVCm6Ai1p7OG4MfN'),
('peer_rotation_more_than_most', 'hVEmlU6bL4l3DNeOhdM3'),... |
/* ================================================
* Oracle XFiles Demonstration.
*
* Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"... |
DELIMITER /
UPDATE WATERMARK SET GROUP_NAME = 'IRB' WHERE STATUS_CODE = '-1' AND WATERMARK_TEXT = 'INVALID'
/
UPDATE WATERMARK SET GROUP_NAME = 'IRB' WHERE STATUS_CODE = '100' AND WATERMARK_TEXT = 'Pending/In Progress'
/
UPDATE WATERMARK SET GROUP_NAME = 'IRB' WHERE STATUS_CODE = '101' AND WATERMARK_TEXT = 'Submitted T... |
alter table wallet
add column if not exists wallet_type integer not null; |
<gh_stars>0
-- create database tracker;
begin;
-- drop table if exists roles, users, rules, rule_to_role, item_status, item_category, items, item_comments, attachments;
create table if not exists roles
(
id serial primary key not null,
name varchar(30) not null
);
create table if not exists users
(... |
ALTER TABLE person
ADD COLUMN DT_Criacao datetime,
ADD COLUMN DT_Edicao datetime |
WITH parameters AS (
SELECT
'2020-01-01'::date AS start_date,
'2030-01-01'::date AS end_date
)
SELECT
nrs.rs_requester,
count(*) AS reqs_under_48
FROM
reshare_derived.req_stats nrs,
reshare_derived.req_stats nrs2
WHERE
nrs.rs_req_id = nrs2.rs_req_id
AND (nrs.rs_to_status = 'R... |
select noteevents.HADM_ID, dianoses_top20_icd.SUBJECT_ID, noteevents.CHARTDATE, noteevents.TEXT, dianoses_top20_icd.ICD9_CODES
from noteevents
JOIN
(select HADM_ID, max(SUBJECT_ID) SUBJECT_ID, string_agg(ICD9_CODE, ' ') ICD9_CODES
from diagnoses_icd
where ICD9_CODE IN ( select ICD9_CODE from (select ICD9_CODE... |
--liquibase formatted sql
--changeset jinghua.zhan:4
--validCheckSum: 8:97cac1c285cb21b6124ef3b208809f30
--labels: update index
--tag: 1.0.0
ALTER TABLE `connection_info`
DROP INDEX `unique_cname`,
ADD INDEX `unique_cname_uname`(`name`, `user`) USING HASH;
--rollback ALTER TABLE `connection_info` DROP INDEX `unique... |
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE TABLE [dbo].[tbl](
[c1] [int] NOT NULL,
[c2] [int] NOT NULL,
[c3] [varchar] (100) COLLATE Cyrillic_General_CI_AS NULL,
[c6] [int] NOT NULL CONSTRAINT [DF__tbl__c6__2739D489] DEFAULT ((555777)),
[c5] [int] NOT NULL CONSTRAINT [DF__tbl__c5__2645B... |
<reponame>hebcal/hebcal-web
CREATE TABLE yahrzeit (
id varchar(26) NOT NULL,
created datetime NOT NULL,
updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ip varchar(16) DEFAULT NULL,
downloaded tinyint(1) NOT NULL DEFAULT '0',
contents JSON NOT NULL,
PRIMARY KEY (id)
) ENGI... |
CREATE OR REPLACE FUNCTION testfunc(integer) RETURNS integer AS $PROC$
....
$PROC$ LANGUAGE plpgsql;
|
-- company
select to_char(reversion_revision.date_created, 'YYYY-MM'), username, count(*)
from users_user
join reversion_revision on users_user.id=user_id
join reversion_version on reversion_revision.id = reversion_version.revision_id
where reversion_version.content_type_id=16
group by to_char(reversion_revision.date_c... |
-- SQUser extended by mail attribute
ALTER TABLE SQUser ADD COLUMN last_tavern_visit TIMESTAMP;
|
-- @testpoint: opengauss关键字over非保留),作为索引名,部分测试点合理报错
--前置条件,创建一个表
drop table if exists explain_test;
create table explain_test(id int,name varchar(10));
--关键字不带引号-成功
drop index if exists over;
create index over on explain_test(id);
drop index over;
--关键字带双引号-成功
drop index if exists "over";
create index "over" on expl... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 08, 2016 at 10:58 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 5.5.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
<filename>db/schema.sql
CREATE EXTENSION citext;
CREATE TABLE alerts (
id BIGSERIAL PRIMARY KEY,
subject TEXT NOT NULL,
status smallint NOT NULL,
sent_at TIMESTAMP DEFAULT NULL,
user_id BIGINT NOT NULL REFERENCES users(id) ON DELETE CASCADE,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL
);... |
DROP TABLE IF EXISTS `Events`;
|
<filename>keuangandb.sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 17 Jul 2020 pada 05.06
-- Versi server: 10.3.15-MariaDB
-- Versi PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
-- !Ups
CREATE TABLE genres (
value varchar(50) PRIMARY KEY
);
CREATE TABLE films (
id SERIAL PRIMARY KEY,
name VARCHAR(200) NOT NULL,
description VARCHAR(500) NOT NULL,
duration INTEGER NULL,
uploadDate TIMESTAMP NOT NULL,
views BIGINT NOT NULL,
availa... |
SET SESSION sql_mode="NO_AUTO_CREATE_USER";
ALTER TABLE `phppos_sales` ADD `deleted` INT( 1 ) NOT NULL DEFAULT '0';
ALTER TABLE `phppos_items` ADD INDEX ( `name` );
ALTER TABLE `phppos_items` ADD INDEX ( `category` );
ALTER TABLE `phppos_items` ADD INDEX ( `deleted` );
ALTER TABLE `phppos_customers` ADD INDEX... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 11 Sep 2019 pada 16.45
-- Versi Server: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
CREATE TABLE "Target" (
"litattr1" INT,
-- PRIMARY KEY("PK"),
"key1attr1" CHAR(4),
"key1attr2" CHAR(4),
"key2attr1" CHAR(4),
"key2attr2" CHAR(4),
UNIQUE ("key1attr1", "key1attr2"),
UNIQUE ("key2attr2", "key2attr1")
);
CREATE TABLE "Source" (
"ID" INT PRIMARY KEY,
"attrA" CHAR(4),
"attrB" CHAR(4),
FOREIGN K... |
-- MySQL dump 10.15 Distrib 10.0.35-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: exomehg19plus
-- ------------------------------------------------------
-- Server version 10.0.35-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARA... |
DROP DATABASE IF EXISTS new_personnel;
CREATE DATABASE new_personnel;
USE new_personnel;
CREATE TABLE DEPT(
DEPTNO INT(2) NOT NULL,
DNAME VARCHAR(14),
LOC VARCHAR(14));
CREATE TABLE EMP(
EMPNO INT(4) NOT NULL,
ENAME VARCHAR(10),
JOB VARCHAR(25),
HIREDATE DATE,
MGR INT(4),
SAL FLOAT(7,2),
COMM FLOAT(7,2),
DEP... |
<gh_stars>10-100
-- file:equivclass.sql ln:251 expect:true
reset session authorization
|
-- file:rangetypes.sql ln:325 expect:true
insert into test_range_excl
values(int4range(123, 123, '[]'), int4range(1, 1, '[]'), '[2010-01-02 10:00, 2010-01-02 11:00)')
|
<reponame>masaki-hirose/SQLServer-Info<gh_stars>10-100
set transaction isolation level read uncommitted
--サーバーで使用しているメモリの詳細な内訳
insert into dm_os_memory_clerks_dump
select
getdate() as collect_date
,type
,name
,sum(pages_kb) as sum_pages_kb
,sum(awe_allocated_kb) as sum_awe_allocated_kb
from sys.dm_os_memory_cler... |
CREATE TABLE locks (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
lock_key varchar(255) UNIQUE,
token varchar(255),
expireAt TIMESTAMP,
PRIMARY KEY(`id`)
); |
SELECT DISTINCT
tt.list_uid AS scheme_id,
tt.the_te_uid AS topconcept_id,
tt.term AS preflabel
FROM rc_thesaurus_uses tu
INNER JOIN
rc_thesaurus_terms tt
ON tu.list_uid = tt.list_uid
AND tu.the_te_uid = tt.the_te_uid
WHERE tu.the_t_u_uid = tu.top_term_u_uid
AND tt.status = 'Y'
AND tu.list_uid IN ('2')
ORDER BY pr... |
<filename>join_split/examples/joins.sql
-- inner join - joining only common columns
select u.first_name, a.street, c.name as city_name from users as u
inner join address as a on a.id=u.address_id
inner join city as c on c.id=a.city_id
where u.id=1 or u.id=2
order by u.id desc;
-- left join - merging all the common ... |
<reponame>deinspanjer/docker-go-migrate<gh_stars>0
SELECT 'Removing pgcrypto extension from template1 database...';
DROP EXTENSION IF EXISTS pgcrypto;
|
-- As sqlite does not support the DROP FOREIGN KEY, we need to create
-- the table, and move all the data to it.
CREATE TABLE snapshots_v6 (
created_at DATETIME,
updated_at DATETIME,
deleted_at DATETIME,
deleted BOOLEAN,
id VARCHAR(36) NOT NULL,
volume_id VARCHAR(36) NOT NULL,
user_id VARCH... |
<gh_stars>1-10
CREATE INDEX "IX_FLAT_CONTINENT_OCEAN_UP" ON "FLAT" (UPPER("CONTINENT_OCEAN"))
|
CREATE INDEX packages_parent_id_idx ON packages(parent_id);
|
CREATE TABLE `user_blogs` (
`user_id` INT(11) NOT NULL DEFAULT '0',
`blog_id` INT(11) NOT NULL DEFAULT '0',
PRIMARY KEY(`user_id`,`blog_id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT 'user_blogs';
|
-- @testpoint: opengauss关键字standalone(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists explain_test cascade;
create table explain_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor standalone for select * from explain_test order by 1;
close standalone;
end;
--关键字带双引号-成功
start transaction;
cursor "standalo... |
<reponame>BartiDev/BartiCinemaApp
CREATE FUNCTION [Movie].[ufn_GetMoviesByScreeningDate]
(
@startTime DATETIME2,
@endTime DATETIME2,
@cinemaId INT
)
RETURNS TABLE
AS
RETURN
(
SELECT TOP 10 m.Id
, m.Title
, m.Director
, m.Genres
, m.ReleaseDate
, m.Description
, m.Certificate
, m.ImdbRating
... |
<reponame>DiogoSBorges/ewave-favo-de-mel-senior<filename>Database/scripts/DML.setup.sql
USE [FavoDeMel];
INSERT INTO dbo.[ComandaSituacao] ([Id], [Nome]) VALUES
(1, 'Aberta'),
(2, 'Fechada')
GO
DECLARE @ComandaCount INT = 0;
WHILE @ComandaCount < 50
BEGIN
SET @ComandaCount = @ComandaCount + 1;
INSER... |
<filename>DB/parches/default_ids.sql
/**
* Author: gonzalo
* Created: 23-03-2016
* Description: parche Sql para agregar default a id de tablas
*/
alter table usuario alter column id set default nextval('usuario_id_seq'::regclass);
alter table contacto alter column id set default nextval('contacto_id_seq'::regcl... |
<reponame>DercioBobo/CVS
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.11-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 11.0.0.5919
-- ----------------------... |
<filename>exports/contao_4-3/theme2go_expression_database_4-3.sql
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CO... |
<reponame>NaveenChander/goKube<filename>db/unittest/playGround.sql
SELECT
*
FROM
Customer.Customer |
<gh_stars>0
-- Kontsioti, Maskell, Dutta & Pirmohamed, A reference set of clinically relevant adverse drug-drug interactions (2021)
set search_path = drug_interaction_compendia;
drop table if exists common_with_mapped_eventnames
;
create table common_with_mapped_eventnames as
select distinct
a.ordered_drug_list
... |
<reponame>bpbpublications/Hands-on-Data-Virtualization-with-Polybase
-- Create database scoped credential
-- IMPORTANT!!! Use your own username and secure password
CREATE DATABASE SCOPED CREDENTIAL [SapCredential] WITH
IDENTITY = 'SYSTEM',
SECRET = <PASSWORD>'
-- Create external data source
-- IMPORTANT!!! ... |
<gh_stars>0
CREATE SCHEMA IF NOT EXISTS users |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.