sql stringlengths 6 1.05M |
|---|
<filename>src/test/resources/sql/drop_view/d915e4e4.sql<gh_stars>10-100
-- file:security_label.sql ln:41 expect:true
DROP VIEW seclabel_view1
|
<filename>SqlWatch.Monitor/Project.SqlWatch.Database/dbo/Tables/sqlwatch_config_check_template_action.sql
CREATE TABLE [dbo].[sqlwatch_config_check_template_action]
(
[check_name] [nvarchar](255) not null,
[action_id] smallint not null,
[action_every_failure] bit not null,
[action_recovery] bit not null,
[actio... |
/****** Object: View [dbo].[V_Analysis_Job] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Analysis_Job]
AS
SELECT AJ.AJ_jobID AS Job,
AnTool.AJT_toolName AS Tool,
DS.Dataset_Num AS Dataset,
DFP.Dataset_Folder_Path AS Dataset_Storage_Path,
DFP.Data... |
<filename>spring-boot-test-extend-samples/data-jdbc-spring-boot-test-sample/mybatis-plus-spring-boot-test-smaple/src/test/resources/schema.sql
DROP table if exists user;
CREATE TABLE `user` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM ;
|
/*
Navicat Premium Data Transfer
Source Server : loalhost
Source Server Type : MySQL
Source Server Version : 50731
Source Host : localhost:3306
Source Schema : global_server
Target Server Type : MySQL
Target Server Version : 50731
File Encoding : 65001
Date: 27/11/20... |
<reponame>FlukerGames/ever-wallet-api<filename>migrations/20220204093759_token_version.sql
DROP TYPE IF EXISTS twa_token_wallet_version;
CREATE TYPE twa_token_wallet_version as ENUM (
'OldTip3v4',
'Tip3'
);
ALTER TABLE token_owners ADD COLUMN version twa_token_wallet_version NOT NULL DEFAULT 'OldTip3v4';
|
<gh_stars>10-100
CREATE PROCEDURE tSQLt.Private_SetConfiguration
@Name NVARCHAR(100),
@Value SQL_VARIANT
AS
BEGIN
IF(EXISTS(SELECT 1 FROM tSQLt.Private_Configurations WITH(ROWLOCK,UPDLOCK) WHERE Name = @Name))
BEGIN
UPDATE tSQLt.Private_Configurations SET
Value = @Value
WHERE Name = @Name;
... |
CREATE FUNCTION func228() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE495);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE124);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE398);val:=(SELECT COUNT(*)INTO MYCOU... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
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_CONNECTION */;
/*!40101 SET N... |
-- data/update_data.sql
-- Copyright 2019 Evans Policy Analysis and Research Group (EPAR)
-- This project is licensed under the 3-Clause BSD License. Please see the
-- license.txt file for more information.
-------------------------------------------------------------------------------
-- ... |
=> SELECT format('create index on my_table(%I)', attname)
-> FROM pg_attribute
-> WHERE attrelid = 'my_table'::regclass AND attnum > 0
-> ORDER BY attnum
-> \gexec
CREATE INDEX
CREATE INDEX
CREATE INDEX
CREATE INDEX
|
-- login with vanillacqrs on database vanillacqrs
DROP OWNED BY vanillacqrs;
CREATE TABLE "$checkpoints" ( name TEXT PRIMARY KEY, value JSON );
CREATE TABLE "$versions" ( name TEXT PRIMARY KEY, version FLOAT(53) );
|
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 22, 2018 at 08:06 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
<gh_stars>0
USE [msdb]
GO
/****** Object: StoredProcedure [dbo].[sReplicaSyncStateMonitor] Script Date: 9/11/2018 11:24:21 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <<NAME>>
-- Create date: <9/11/18>
-- Description: <Checks AG ... |
-- /*******************************************************
-- *
-- * Drop civicrm_membershipperiod table
-- *
-- * Developed for interview purpose
-- *
-- * @author <NAME>
-- *
-- *******************************************************/
DROP TABLE IF EXISTS `civicrm_membershipperiod`; |
insert into inventory_item(id, quantity, product_code, create_time, last_update_time)
VALUES (1, 2, 'p1', now(), now()),
(2, 5, 'p2', now(), now()),
(3, 10, 'p3', now(), now())
on duplicate key update product_code=values(product_code); |
CREATE TABLE "SystemUserSet" ("optevia_Language_Id" UUID, "optevia_Language_LogicalName" TEXT, "optevia_Language_Name" TEXT, "optevia_Number" TEXT, "QueueId_Id" UUID, "QueueId_LogicalName" TEXT, "QueueId_Name" TEXT, "CreatedBy_Id" UUID, "CreatedBy_LogicalName" TEXT, "CreatedBy_Name" TEXT, "PreferredAddressCode_Value" I... |
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... |
drop type bitcoin_transaction cascade ;
drop type bitcoin_transaction_input ;
drop type bitcoin_transaction_input_outpoint ;
drop type bitcoin_transaction_output ;
drop type bitcoin_transaction_witness ;
create type bitcoin_transaction_input_outpoint as (
hash char(64),
index bigint
);
create type bitcoin_transacti... |
<filename>_database/queries.sql
--CREATE DATABASE PAAdminUsers;
--DROP TABLE paadminusers.users;
DROP TABLE users;
CREATE TABLE admin_users (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
username VARCHAR(100) NOT NULL UNIQUE,
email VARCHAR(100) NOT NULL UNIQUE,
password VARCHAR(200) NOT NULL,
phone... |
use VehicleDB;
INSERT INTO Vehicle (Vehicle_ID, Vehicle_type, Vehicle_colour, Vehicle_licence) VALUES
(12, '<NAME>', 'Blue', 'LB15AJL'),
(13, 'Ferrari 458', 'Red', 'MY64PRE'),
(14, 'Vauxhall Astra', 'Silver', 'FD65WPQ'),
(15, 'Honda Civic', 'Green', 'FJ17AUG'),
(16, 'Toyota Prius', 'Silver', 'FP16KKE'),
(17, 'Ford Mond... |
<gh_stars>1-10
use DevweekDemo
go
with cte as
(
select
[OrderDate],
[TerritoryID],
Quantity = sum([OrderQty]),
[LineTotal],
ProductSubcategoryName,
ProductCategoryName,
ProductName
from dbo.SalesOrderDetail
group by
[OrderDate],
[TerritoryID],
[OrderQty],
[LineTotal],
ProductSubcategoryNam... |
SELECT TOP 100
f.XFileName AS FileName
, f.XFileDesc AS Description
, LOWER(RIGHT(XFileName, 4)) AS FileExt
FROM
XFileAttch fa with(nolock)
INNER JOIN XFileRef f with(nolock) ON
f.Company = fa.Company
AND f.XFileRefNum = fa.XFileRefNum
WHERE
--fa.RelatedToSchemaName = 'Erp'
AND fa.RelatedToFile = 'Customer'
... |
<gh_stars>1-10
CREATE TABLE [dbo].[dnn_HtmlText] (
[ModuleID] INT NOT NULL,
[ItemID] INT IDENTITY (1, 1) NOT NULL,
[Content] NTEXT NULL,
[Version] INT NULL,
[StateID] INT NULL,
[IsPublished] BIT ... |
-- Procedure Registration_Del
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.Registration_Del
(
@Id int
)
AS
SET NOCOUNT ON
IF(@Id > 0)
DELETE FROM Registration
WHERE Id=@Id;
RETURN
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF
GO
|
<filename>src/test/resources/sqls/selectsqls.sql
SELECT table_name FROM information_schema.tables WHERE table_schema = 'wifdemo';
SELECT column_name FROM information_schema.columns WHERE table_name ='uaz_demonstration';
SELECT column_name FROM information_schema.columns WHERE table_name ='uaz_herveybay';
SELECT column... |
<filename>extension/tpcds/dsdgen/queries/62.sql
SELECT w_substr,
sm_type,
web_name,
sum(CASE
WHEN (ws_ship_date_sk - ws_sold_date_sk <= 30) THEN 1
ELSE 0
END) AS "30 days",
sum(CASE
WHEN (ws_ship_date_sk - ws_sold_date_sk > 30)
... |
<filename>cmqueries/cmdepsummary.sql
select distinct
SoftwareName,
CollectionName,
CollectionID,
case
when (featuretype = 1) then 'Application'
when (featuretype = 2) then 'Program'
when (featuretype = 3) then 'MobileProgram'
when (featuretype = 4) then 'Script'
w... |
USE [VipunenTK_DW]
GO
ALTER TABLE [dbo].[d_koulutuslaji] DROP CONSTRAINT IF EXISTS [DF__d_koulutuslaji__tietolahde]
GO
ALTER TABLE [dbo].[d_koulutuslaji] DROP CONSTRAINT IF EXISTS [DF__d_koulutuslaji__paattyy]
GO
ALTER TABLE [dbo].[d_koulutuslaji] DROP CONSTRAINT IF EXISTS [DF__d_koulutuslaji__alkaa]
GO
/****** Obj... |
<gh_stars>10-100
-- file:updatable_views.sql ln:846 expect:true
DROP FUNCTION rw_view1_trig_fn()
|
<gh_stars>0
UPDATE ?:company_descriptions SET terms = '<p>Please read the Simtech\'s Terms and Conditions (\"Terms\", \"Terms and Conditions\") carefully before purchasing products from the Vendor via the <a href=\"http://www.mywebsite.com\">http://www.mywebsite.com</a> website and the My Mobile App mobile application ... |
<gh_stars>0
-- User related tables changes needed after 2.1.0.004
ALTER TABLE SAKAI_USER ADD (EMAIL_LC VARCHAR2 (255));
UPDATE SAKAI_USER SET EMAIL_LC = LOWER(EMAIL);
DROP INDEX IE_SAKAI_USER_EMAIL;
CREATE INDEX IE_SAKAI_USER_EMAIL ON SAKAI_USER( EMAIL_LC ASC );
|
-- 1411 Number of persons by payer plan period start month
--HINT DISTRIBUTE_ON_KEY(stratum_1)
select 1411 as analysis_id,
DATEFROMPARTS(YEAR(payer_plan_period_start_date), MONTH(payer_plan_period_start_date), 1) as stratum_1,
cast(null as varchar(255)) as stratum_2, cast(null as varchar(255)) as stratum_3, cast(nu... |
REPLACE PROCEDURE dbt_test.dbt_drop_relation_if_exists(
IN relation_type VARCHAR(10),
IN full_name VARCHAR(256)
)
BEGIN
DECLARE sql_stmt VARCHAR(500) CHARACTER SET Unicode;
DECLARE msg VARCHAR(400) CHARACTER SET Unicode;
DECLARE exit HANDLER FOR SqlException
BEGIN
IF SqlCode = 3807 THEN SET msg = full... |
ALTER TABLE responsibility
DROP CONSTRAINT responsibility_project_id_fkey,
ADD FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE;
ALTER TABLE invitation
DROP CONSTRAINT invitation_project_id_fkey,
ADD FOREIGN KEY (project_id) REFERENCES project (id) ON DELETE CASCADE;
|
<reponame>Ycl24/admin
-- MySQL dump 10.13 Distrib 5.5.53, for Win32 (AMD64)
--
-- Host: localhost Database: box
-- ------------------------------------------------------
-- Server version 5.5.53
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... |
-- phpMyAdmin SQL Dump
-- http://www.phpmyadmin.net
--
-- 生成日期: 2016 年 11 月 17 日 21:54
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_CONN... |
<reponame>anrodigina/ClickHouse
CREATE TEMPORARY TABLE test (d DateTime) ENGINE = Memory;
SET date_time_input_format = 'best_effort';
INSERT INTO test VALUES ('2018-06-08T01:02:03.000Z');
SELECT toTimeZone(d, 'UTC') FROM test;
|
<reponame>mikesep/comdb2
select * from comdb2_users;
select * from comdb2_tables order by tablename;
-- create users
put password '<PASSWORD>' for 'root';
put password '<PASSWORD>' for 'foo';
-- set OP user
grant op to 'root'
set user 'root'
set password '<PASSWORD>'
-- turn on authentication
put authentication on
... |
<gh_stars>1000+
-- Tags: no-parallel
CREATE FUNCTION 01856_test_function_0 AS (a, b, c) -> a * b * c;
SELECT 01856_test_function_0(2, 3, 4);
SELECT isConstant(01856_test_function_0(1, 2, 3));
DROP FUNCTION 01856_test_function_0;
CREATE FUNCTION 01856_test_function_1 AS (a, b) -> a || b || c; --{serverError 47}
CREATE ... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
drop index PROTEINAIN_BIG_ID_LWR;
drop index PROTEINAIN_BIG_ID;
drop index SYS_C0021167_IDX;
drop index PROTEIN_MAIN_ACCESSION__LWR;
drop index PROTEIN_MAIN_DES... |
<gh_stars>1-10
SET NAMES utf8;
CREATE DATABASE `seata_storage` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE seata_storage;
DROP TABLE IF EXISTS `t_storage`;
CREATE TABLE `t_storage` (
`id` bigint(11) NOT NULL AUTO_INCREMENT,
`product_id` bigint(11) NULL DEFAULT NULL COMMENT '产品id',
`total` int(11) NULL DEFA... |
<filename>src/schema_generator.sql
-- make database
drop database restaurant_finder;
create database restaurant_finder;
show databases;
-- create table
use restaurant_finder;
create table restaurant(
restaurant_id int,
name varchar(256),
type varchar(256),
description varchar(8000),
time_monday_ope... |
<filename>php/database.sql
-- agent (avatar) information
CREATE TABLE IF NOT EXISTS agent (
id INTEGER NOT NULL AUTO_INCREMENT,
username VARCHAR(100),
displayname VARCHAR(100),
keyid VARCHAR(50),
role VARCHAR(50),
PRIMARY KEY(id),
UNIQUE INDEX(keyid),
UNIQUE INDEX(username)
) ENGINE=INNODB;
INSERT IGN... |
<reponame>ltian123/ajax<filename>database/create.sql
create table t_data(
spell varchar(10),
message varchar(100)
);
insert into t_data values('abc','aaa bbb ccc');
insert into t_data values('a','aaaaaaaaaaaaaaa');
insert into t_data values('asd','aaa ssss ddqwe');
insert into t_data values('qw','qqqqqqqqw');
inser... |
<reponame>doanngochoanghy/XSS
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 01, 2017 at 05:44 PM
-- Server version: 5.7.20-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "... |
--
-- Gets a game.
--
-- PARAMS:
-- id - The ID of the game.
--
-- RETURNS: The game, if found.
--
CREATE PROCEDURE [dbo].[GetGame]
@id INT
AS BEGIN
SET NOCOUNT ON;
SELECT Id, Name, Description, Price, Owned, Completed
FROM Games
WHERE Id = @id
END
|
<filename>sql/alter-table.sql<gh_stars>0
USE [Curso];
GO
ALTER TABLE [Aluno]
ADD [Documento] NVARCHAR(11);
GO
ALTER TABLE [Aluno]
DROP COLUMN [Documento];
GO
ALTER TABLE [Aluno]
ALTER COLUMN [Documento] CHAR(11);
GO
|
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 27, 2021 at 02:34 AM
-- Server version: 10.5.12-MariaDB-cll-lve
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
<reponame>georgeMatrix/nuestroNegocio
/*
Navicat MySQL Data Transfer
Source Server : localhost2018
Source Server Version : 100136
Source Host : localhost:3306
Source Database : nuestronegocio
Target Server Type : MYSQL
Target Server Version : 100136
File Encoding : 65001
Date: 2019... |
SELECT * FROM public.event_log ORDER BY id DESC LIMIT 250 |
SELECT * FROM pg_catalog.pg_extension WHERE extname = '#{name}';
|
<gh_stars>1-10
--liquibase formatted sql
--changeset artemov_i:MTClassList.sql dbms:postgresql runOnChange:true splitStatements:false stripComments:false
INSERT INTO s_mt.t_query (ck_id, cc_query, ck_provider, ck_user, ct_change, cr_type, cr_access, cn_action, cv_description) VALUES ('MTClassList', '/*MTClassList*/
sel... |
-- +migrate Up
CREATE TABLE dockmon_liveness_target (
service_name VARCHAR(250) PRIMARY KEY,
liveness_url VARCHAR(250),
liveness_interval INTEGER,
should_restart BOOLEAN,
fail_after INTEGER,
is_healty BOOLEAN,
number_of_restarts INTEGER,
consecutive_failed_health_checks INTEGER,
last_restarted TIMESTA... |
select username from users; |
<filename>employeesDB.sql
DROP DATABASE IF EXISTS employees_db;
CREATE DATABASE employees_db;
USE employees_db;
CREATE TABLE employee (
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NOT NULL,
role_id INT NOT NULL,
manager_id INT NULL,
PRIMARY KEY (id),
)... |
<reponame>arshiya2125/crowdsource-dataplatform<gh_stars>10-100
/* Replace with your SQL commands */
DROP MATERIALIZED VIEW IF EXISTS gender_group_contributions;
DROP MATERIALIZED VIEW IF EXISTS age_group_contributions;
DROP MATERIALIZED VIEW IF EXISTS language_group_contributions;
DROP MATERIALIZED VIEW IF EXISTS stat... |
<gh_stars>1-10
-- Add migration script here
CREATE TYPE USER_ROLE AS ENUM ('user', 'admin');
-- Create User Table
CREATE TABLE user_account (
id uuid NOT NULL PRIMARY KEY,
email TEXT NOT NULL UNIQUE,
password TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL,
updated_at TIMESTAMPTZ NOT NULL,
role... |
<reponame>rutschsr/Senior-Design-Project<filename>Sqlite/Search/Avg_Query_PC_local_to_PI_Peter_Jamieson_double_bmp.sql<gh_stars>1-10
-- For PC local to PI <NAME> double bmp
-- The average of the ping current values, this will be the second value displayed
SELECT avg(wattage) FROM PowerMeasurement
WHERE strftime('%H ... |
<gh_stars>1-10
/*
https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server
Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints.
The sum of the number of all objects in a database cannot exc... |
-- randexpr1.test
--
-- db eval {SELECT ~case 17 when t1.c then coalesce((select max((case when not exists(select 1 from t1 where 11<>coalesce((select d from t1 where not exists(select 1 from t1 where c*b in (t1.b*t1.d,t1.c,b) or c between d and a)),19)-t1.c*e) then coalesce((select f from t1 where 11 in (select c fro... |
<gh_stars>1-10
-- CreateTable
CREATE TABLE "User" (
"id" SERIAL NOT NULL,
"email" TEXT NOT NULL,
"firstname" TEXT,
"lastname" TEXT,
"languages_by_name" TEXT[],
"languages_by_id" INT[],
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Language" (
"id" SERIAL NOT NULL,
... |
SET @sName = 'bx_lucid';
-- MIXES
SET @iMixId = (SELECT `id` FROM `sys_options_mixes` WHERE `type`=@sName AND `name`='Light-Mix' LIMIT 1);
UPDATE `sys_options_mixes2options` SET `value`='1.0rem' WHERE `option`='bx_lucid_menu_account_font_size' AND `mix_id`=@iMixId;
UPDATE `sys_options_mixes2options` SET `valu... |
{#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2017, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#}
SELECT ct.conindid AS oid
FROM pg_constraint ct
WHERE contype='x' AND
ct.conname = {{ name|qtLiteral }}; |
-- ------------------------------------------------------------------
-- Title: Quick Sequential Organ Failure Assessment (qSOFA)
-- This query extracts the quick sequential organ failure assessment.
-- This score was a recent revision of SOFA, aiming to detect patients at risk of sepsis.
-- The score is calculated on ... |
<gh_stars>0
USE chiyo;
-- DROP VIEWS -------------------------------------------------
DROP VIEW IF EXISTS vusers;
-- DROP TABLES ------------------------------------------------
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS roles;
-- CREATE TABLES ----------------------------------------------
CREATE TABLE roles... |
<reponame>umpyre-code/beancounter
CREATE TABLE transactions (
id BIGSERIAL PRIMARY KEY,
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
client_id UUID,
tx_type TRANSACTION_TYPE NOT NULL,
tx_reason TRANSACTION_REASON NOT NULL,
amount_cents INTEGER NOT NULL)
|
create database digital_breakthrough;
create schema dwh;
create table dwh.dim_calendar (
date_id serial not null,
date_value date null,
day_num int4 null,
month_num int4 null,
year_num int4 null,
month_name varchar(20) null,
eff_dttm timestamptz null DEFAULT now(),
exp_dttm timestamptz null DEFAULT '2999-12-3... |
<reponame>zulus23/LogisticsService<gh_stars>0
SELECT p.dif_,p.datecreate_row,p.datePlan_Mnfg,p.DateActual_Ship,cust_name,
COUNT(p.id) OVER(PARTITION BY p.cust_name,p.dat_,p.dif_),
CAST(100.0* COUNT(p.id) OVER( PARTITION BY p.cust_name,p.dat_,p.dif_)/COUNT(p.id) OVER( PARTITION BY p.dat_,p.cust_num) AS NUMERIC(15,2... |
CREATE TABLE "CTAGENT_RELATIONSHIP"
( "AGENT_RELATIONSHIP" VARCHAR2(18 CHAR) NOT NULL ENABLE,
CONSTRAINT "PKEY_CTAGENT_RELATIONSHIP" PRIMARY KEY ("AGENT_RELATIONSHIP")
USING INDEX ENABLE
) |
BEGIN;
ALTER TABLE operations ALTER COLUMN external_id TYPE VARCHAR(10000);
COMMIT; |
<reponame>democracy-denmark/democracy-webside
CREATE TABLE `contact` (
`email` varchar(255) NOT NULL,
`sex` varchar(1) DEFAULT NULL,
`name_first` varchar(255) DEFAULT NULL,
`name_last` varchar(255) DEFAULT NULL,
`organization` varchar(255) DEFAULT NULL,
`updated_at` timestamp DEFAULT CURRENT_TIMESTAMP ON UP... |
-- Add up migration script here
CREATE TYPE user_role AS ENUM ('admin', 'assistant', 'teacher', 'reviewer');
CREATE TABLE roles (
id UUID DEFAULT uuid_generate_v4() PRIMARY KEY,
user_id UUID NOT NULL REFERENCES users,
organization_id UUID REFERENCES organizations,
course_id UUID REFERENCES courses,
role user_... |
<reponame>adrianmahjour/db2-samples
--********************************************************************/
-- */
-- IBM InfoSphere Replication Server */
-- Version 9.7FP2 for Linux, UNIX AND Windows ... |
-------------------------------------------------------------------------------
--
-- PLEASE NOTE
--
-- No warranty, no liability, no support.
--
-- This script is 100% at your own risk to use.
--
-------------------------------------------------------------------------------
SELECT substr(S.USERNAME,1,16) username,
... |
<filename>doc/activitidb.sql<gh_stars>100-1000
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50016
Source Host : localhost:3306
Source Database : activitidb0
Target Server Type : MYSQL
Target Server Version : 50016
File Encoding : 65001
... |
<filename>vendor/jamband/yii2-schemadump/tests/schemas/postgre.sql
-- for some primary keys and unique keys
DROP TABLE IF EXISTS "0010_pk_ai";
CREATE TABLE "0010_pk_ai" (
id serial not null primary key
);
DROP TABLE IF EXISTS "0020_pk_not_ai";
CREATE TABLE "0020_pk_not_ai" (
id integer not null primary key
);
D... |
--
-- errors
--
SET pg_similarity.cosine_threshold to 1.1;
SET pg_similarity.qgram_tokenizer to 'alnum';
--
-- valid values
--
SET pg_similarity.block_is_normalized to true;
SET pg_similarity.cosine_threshold = 0.72;
SET pg_similarity.dice_tokenizer to 'alnum';
SET pg_similarity.euclidean_is_normalized to false;
SET p... |
<reponame>awesome-archive/ZhihuSpider
/*
Navicat MySQL Data Transfer
Source Server : mysqlcas
Source Server Version : 50167
Source Host : localhost:3306
Source Database : seven
Target Server Type : MYSQL
Target Server Version : 50167
File Encoding : 65001
Date: 2016-12-29 09:43:25
... |
DECLARE
AVG_OF_INTERVAL_REQUESTS NUMBER;
AVG_OF_INTERVAL_REQUESTS_INTEGER NUMBER;
BEGIN
SELECT AVG(DIFFERENCE), FLOOR(AVG(DIFFERENCE))
INTO AVG_OF_INTERVAL_REQUESTS, AVG_OF_INTERVAL_REQUESTS_INTEGER
FROM
(
SELECT A.*
,LAG(REQUEST_DATE) OVER (ORDER BY REQUEST_... |
INSERT INTO `AddressPostCode` VALUES ('1','93095-5039', now()),
('2','75530-9268', now()),
('3','11849', now()),
('4','27282-2089', now()),
('5','89992', now()),
('6','04342', now()),
('7','81268-8906', now()),
('8','29566', now()),
('9','64139-6608', now()),
('10','89297', now()),
('11','53720-8902', now()),
('12','5... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2017-06-18 05:08:49
-- 服务器版本: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*... |
CREATE TABLE FAGSAK_RINASAK_KOBLING
(
rina_saksnummer VARCHAR(20) PRIMARY KEY,
gsak_saksnummer INTEGER NOT NULL,
buc_type VARCHAR(10) NOT NULL
);
CREATE INDEX gsak_saksnummer_idx ON FAGSAK_RINASAK_KOBLING(gsak_saksnummer); |
<filename>SQL/Exams practice/Databases MSSQL Server Exam - 16 Apr 2019/Destinations Info.sql
SELECT f.Destination,
COUNT(t.Id) AS FilesCount
FROM Flights f
LEFT JOIN Tickets t
ON t.FlightId = f.Id
GROUP BY f.Destination
ORDER BY FilesCount DESC, f.Destination |
<reponame>giovanibrioni/give-help<filename>scripts/db/createDB.sql
CREATE TABLE IF NOT EXISTS USERS (
UserID CHAR(128) PRIMARY KEY NOT NULL,
CreatedAt TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
LastUpdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
Name VARCHAR(512) NOT NULL,
Description TEXT DEFAULT NULL,
DeviceID VARC... |
--beginvalidatingquery
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[sp_DatabaseVersion]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
begin
declare @ver int
exec @ver=sp_DatabaseVersion
if (@ver >= 7027)
select 0, 'Already correct database ver... |
-- SQL tasks from sqlzoo.net
/*
***************************************************************
** **
***** ***** TUTORIAL - 0 ***** ***** **
** **
*******************************... |
-- https://www.hackerrank.com/challenges/asian-population/problem?isFullScreen=true
SELECT SUM(POPULATION) FROM CITY WHERE COUNTRYCODE IN (
SELECT CODE FROM COUNTRY WHERE CONTINENT = 'Asia'
)
|
<reponame>Mithras11/SoftUni-Software-Engineering<filename>C_Sharp/CSharp DataBases/MS_SQL/IndecesAggregateFunctions/IndecesAggregateFunctions.sql
SELECT COUNT(*) AS Count
FROM WizzardDeposits
-----
SELECT DepositGroup, MAX(MagicWandSize) AS LongestMagicWand
FROM WizzardDeposits
GROUP BY DepositGroup
-----
SELECT TO... |
<filename>src/cli/bundled/sql/Profile.sql<gh_stars>1-10
CREATE TABLE profile (
id String,
can_post Nullable(UInt8),
link Nullable(String),
name Nullable(String),
pic Nullable(String),
pic_large Nullable(String),
pic_small Nullable(String),
pic_square Nullable(String),
profile_type Nullable(String),
... |
<reponame>bhikkhu-kosalla-china/mint
-- Your SQL goes here
CREATE TABLE groups_users (
id SERIAL PRIMARY KEY,
group_id INTEGER NOT NULL,
user_id INTEGER NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE UNIQUE INDEX group_user_id ON groups_users (group_id,u... |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Хост: localhost:3306
-- Время создания: Июн 17 2021 г., 19:32
-- Версия сервера: 10.3.29-MariaDB-cll-lve
-- Версия PHP: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... |
<reponame>perevist/PZ_space_station_backend
DROP ALL OBJECTS;
-- create tables --
CREATE TABLE rooms (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(45),
floor INT NOT NULL,
number_of_worksites BIGINT NOT NULL,
dimension_x BIGINT NOT NULL,
dimension_y BIGINT NOT NULL
);
CREATE TABLE works... |
INSERT INTO `binary` VALUES
( 0, x'ee72ae0aef354c5d94ffe82f696af30d'),
( 1, x'2dad56480dbd4a00a1aed85a3fbc6c3d'),
( 2, x'a35b4b77c45349d79faa41041efad77b'),
( 3, x'950a780f93b840109a97a8c60304ef69'),
( 4, x'73da4e0f11714304b781c2339e5c3973'),
( 5, x'0a3c47cc54ea4ce3bb917006985bf31a'),
( 6, x'd03a918aa5454cfd8400cc37490... |
<reponame>olegshulyakov/sedc
CREATE TABLE SNAPSHOT_FXRATE (
SX_ID NUMERIC(18) NOT NULL DEFAULT nextval('S_SNAPSHOT_FXRATE_PK'),
SCEI_ID NUMERIC(18) NOT NULL,
SYM_ID NUMERIC(18) NOT NULL,
BUSINESS_DATE DATE NOT NULL,
ID VARCHAR(20) NOT NULL,
... |
<reponame>enroute-mobi/edwig
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied
ALTER TABLE referentials
ADD COLUMN tokens text;
-- +migrate Down
-- SQL section 'Down' is executed when this migration is rolled back
ALTER TABLE referentials
DROP COLUMN IF EXISTS tokens; |
select '{{ var("required") }}'::varchar as field
|
<reponame>pdv-ru/ClickHouse<gh_stars>1000+
drop table if exists X;
drop table if exists Y;
create table X (id Int32, x_name String) engine Memory;
create table Y (id Int32, y_name String) engine Memory;
insert into X (id, x_name) values (1, 'A'), (2, 'B'), (2, 'C'), (3, 'D'), (4, 'E'), (4, 'F'), (5, 'G'), (8, 'H'), (... |
<filename>src/test/tinc/tincrepo/query/cte/sql/cte_functest_43.sql
-- @author prabhd
-- @created 2013-02-01 12:00:00
-- @modified 2013-02-01 12:00:00
-- @tags cte
-- @product_version gpdb: [4.3-],hawq: [1.1-]
-- @db_name world_db
-- @description test23: CTE with Percentile function
WITH v AS (SELECT a, b FROM foo ... |
<gh_stars>0
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE public."user" (
id UUID NOT NULL CONSTRAINT user_pkey PRIMARY KEY DEFAULT uuid_generate_v4(),
time_created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
time_updated TIMESTAMP,
deleted BOOLEAN NOT NULL DEFAULT FALSE,
username VARC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.