sql stringlengths 6 1.05M |
|---|
-- Copyright (C) 2001-2004 <NAME> <<EMAIL>>
-- Copyright (C) 2003 <NAME> <<EMAIL>>
-- Copyright (C) 2004-2009 <NAME> <<EMAIL>>
-- Copyright (C) 2004 <NAME> <<EMAIL>>
-- Copyright (C) 2004 <NAME> <<EMAIL>>
-- Copyright (C) 2005-2009 <NAME> <<EMAIL>>
-- Copyright (C) 2007 <NAME> ... |
<gh_stars>0
-- /= = = = = = = = = = = = = = = = = = = = = = = = = =
-- for the test of Non PrimaryKey Insert
-- = = = = = = = = = =/
CREATE TABLE WHITE_NOT_PK (
NOT_PK_ID bigint NOT NULL,
NOT_PK_NAME varchar,
NOT_PK_INTEGER integer
);
-- /= = = = = = = = = = = = = = = = = = = = = = = = = =
-- f... |
select
sum(l_extendedprice) / 7.0 as avg_yearly
from
(
select
l_partkey, l_quantity, l_extendedprice
from
lineitem,
part
where
p_partkey = l_partkey
and p_brand = 'Brand#34'
and p_container = 'MED PACK'
)touter,
(
select
l_partkey as lp, 0.2 * avg(l_quantity) as lq
... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: db_mydatabase
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
SELECT
ROUND(AVG(salary), 2)
FROM
salaries
WHERE from_date > '1997-01-01';
|
<gh_stars>0
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
DROP TABLE IF EXISTS foo;
CREATE TABLE foo (a INT, b INT) WITH (appendonly=true, orientation=column);
INSERT INTO foo VALUES (0, 0);
INSERT INTO foo VALUES (1, 1);
|
<reponame>dstrack/APEX_API_Tracer
/*
Copyright 2021 <NAME>, Strack Software Development
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 requir... |
SELECT
sum(ws_net_paid) AS total_sum,
i_category,
i_class,
grouping(i_category) + grouping(i_class) AS lochierarchy,
rank()
OVER (
PARTITION BY grouping(i_category) + grouping(i_class),
CASE WHEN grouping(i_class) = 0
THEN i_category END
ORDER BY sum(ws_net_paid) DESC) AS rank_within_p... |
<reponame>NCIP/cabio<gh_stars>1-10
/*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 ZSTG_PIDNAME_NAMETYPE_LWR;
drop index ZSTG_PIDNAME_NAME_LWR;
drop index ZSTG_PIDNAME_PHYSICALEN;
drop index ZSTG_PI... |
--
-- Table structure for table `ims_motor_name_map`
--
DROP TABLE IF EXISTS `ims_motor_name_map`;
CREATE TABLE `ims_motor_name_map` (
`db_field_name` varchar(30) NOT NULL,
`alias` varchar(16) NOT NULL,
`tooltip` varchar(60),
`enum` varchar(120),
`col_order` int(11) UNIQUE,
`set_order` int(11),
`mutex_ma... |
INSERT INTO Movie (Title, MovieDescription, Genre, MovieLength, Actors, ImageURL, TrailerURL) VALUES ('The Two Popes', 'At a key turning point for the Catholic Church, Pope Benedict XVI forms a surprising friendship with the future Pope Francis. Inspired by true events.', 'Drama', 125.0, '<NAME>, <NAME>, <NAME>', 'http... |
<reponame>richardmyu/leetcode-practice
/*
177. 第N高的薪水
编写一个 SQL 查询,获取 Employee 表中第 n 高的薪水(Salary)。
+----+--------+
| Id | Salary |
+----+--------+
| 1 | 100 |
| 2 | 200 |
| 3 | 300 |
+----+--------+
例如上述 Employee 表,n = 2 时,应返回第二高的薪水 200。如果不存在第 n 高的薪水,那么查询应返回 null。
+------------------------+
| getNthHighes... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 13, 2019 at 06:54 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>surabhi-mahawar/sunbird-devops
ALTER TYPE programTargetType ADD VALUE 'questionSets';
|
CREATE TABLE system(
contact varchar(255) not null default ''
hostname varchar(255) not null default ''
location varchar(255) not null default ''
test varchar(255) not null default ''
);
|
<filename>r_contracts.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 28, 2021 at 10:26 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 7.4.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
<filename>5.2.3/Database/Constraints/AFW_37_LIEN_GADGT_PARMT_R_CK1.sql
SET DEFINE OFF;
ALTER TABLE AFW_37_LIEN_GADGT_PARMT_RACRC ADD (
CONSTRAINT AFW_37_LIEN_GADGT_PARMT_R_CK1
CHECK ((ref_gadgt_parmt_racrc is null and nom is not null and forml_don is not null)
or (ref_gadgt_parmt_racrc is not null and nom is null a... |
CREATE TABLE lastUpdate (provider TEXT, time NUMERIC)
SELECT * FROM tv_episodes WHERE showid = ? AND location != ''
select release_name from tv_episodes WHERE LENGTH(release_name);
CREATE TABLE [" + providerName + "] (name TEXT, season NUMERIC, episodes TEXT, indexerid NUMERIC, url TEXT, time NUMERIC, quality TEXT, rel... |
<reponame>tushartushar/dbSmellsData
SELECT * FROM users WHERE user_id=?
SELECT * FROM test3rf.error_test WHERE k=?
CREATE TABLE {0}.{1}( user TEXT, game TEXT, year INT, month INT, day INT, score INT, PRIMARY KEY (user, game, year, month, day) )
CREATE TABLE %s (' 'k1 int, ' 'k2 int, ' 'i int, ' 'PRIMARY KEY ((k1, k2)))... |
/*
Navicat MySQL Data Transfer
Source Server : MYSQL
Source Server Version : 50620
Source Host : localhost:3306
Source Database : fuzzytravel2
Target Server Type : MYSQL
Target Server Version : 50620
File Encoding : 65001
Date: 2015-02-19 16:18:44
*/
DROP DATABASE IF EXISTS `fuzzyt... |
--
-- Data in table emailBanlist
--
INSERT INTO `phpauth_emails_banned` (`id`, `domain`) VALUES
(1, '0-mail.com'),
(2, '001.igg.biz'),
(3, '0039.cf'),
(4, '0039.ga'),
(5, '0039.gq'),
(6, '0039.ml'),
(7, '00b2bcr51qv59xst2.cf'),
(8, '00b2bcr51qv59xst2.ga'),
(9, '00b2bcr51qv59xst2.gq'),
(10, '00b2bcr51qv59xst2.ml'),
(11... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.31.10
-- Generation Time: Jul 27, 2021 at 09:26 PM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 8.0.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
CREATE OR REPLACE FUNCTION ts.insertpublicationauthors(_publicationid integer, _authororder integer, _familyname character varying, _initials character varying DEFAULT NULL::character varying, _suffix character varying DEFAULT NULL::character varying, _contactid integer DEFAULT NULL::integer)
RETURNS integer
LANGUAGE... |
<filename>src/test/resources/cse.test_15.sql
-- cse.test
--
-- execsql {
-- SELECT CAST(b AS integer), typeof(b), CAST(b AS text), typeof(b) FROM t1
-- }
SELECT CAST(b AS integer), typeof(b), CAST(b AS text), typeof(b) FROM t1 |
<reponame>pshrabstein/mymove<filename>migrations/app/schema/20210504104241_add_counselor_remarks_to_mto_shipments.up.sql
ALTER TABLE mto_shipments
ADD COLUMN counselor_remarks text;
COMMENT ON COLUMN mto_shipments.counselor_remarks IS 'Remarks service counselor has on the MTO Shipment';
|
create table t1(
id serial primary key,
placebo varchar not null
);
---- create above / drop below ----
drop table t1;
|
INSERT INTO CUSTOM_ATTRIBUTE_DOCUMENT (ACTIVE_FLAG,CUSTOM_ATTRIBUTE_ID,DOCUMENT_TYPE_CODE,IS_REQUIRED,OBJ_ID,UPDATE_TIMESTAMP,UPDATE_USER,VER_NBR)
VALUES ('Y',1,'NGT','Y',SYS_GUID(),SYSDATE ,'admin',1)
/
INSERT INTO CUSTOM_ATTRIBUTE_DOCUMENT (ACTIVE_FLAG,CUSTOM_ATTRIBUTE_ID,DOCUMENT_TYPE_CODE,IS_REQUIRED,OBJ_ID,UPDAT... |
DROP TABLE IF EXISTS `product`;
CREATE TABLE `product` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`number` VARCHAR(32) DEFAULT NULL COMMENT '상품 번호',
`type` MEDIUMINT(10) DEFAULT NULL COMMENT '종류',
`name` VARCHAR(255) DEFAULT NULL COMMENT '클래스 및 키트명',
`price` INT(10) DEFAULT NULL COMMENT '판매 가격',
... |
<reponame>diegofigs/tutorme.io<filename>conf/evolutions/default/9.sql
# --- Add payments schema
# --- !Ups
CREATE TABLE payments (
id SERIAL NOT NULL,
fromId INTEGER NOT NULL REFERENCES users(id),
toId INTEGER NOT NULL REFERENCES users(id),
quantity DOUBLE PRECISION NOT NULL,
cardholder VARCHAR(255) NOT NUL... |
<filename>dba/postgres/updates/timescaledb/NET-266/Research/datm-raw-query-hour-slot.sql<gh_stars>0
--explain analyze
SELECT * FROM solardatm.find_datm_for_time_span(
'ade25d3b-faa1-4df8-8c99-bb24b58635ac'::uuid,
'2020-05-14 13:00:00+12'::timestamptz,
'2020-05-14 13:00:00+12'::timestamptz + INTERVAL '1 hour'
);
CR... |
<reponame>cb-deepak/pgcodekeeper
CREATE SEQUENCE public.testseq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
ALTER TABLE public.testseq OWNER TO fordfrog;
CREATE TABLE public.testtable (
field1 integer,
field2 integer,
field3 character varying(150) DEFAULT 'none'::chara... |
-- ===================================================================
-- create FDW objects
-- ===================================================================
CREATE EXTENSION postgres_fdw;
CREATE SERVER testserver1 FOREIGN DATA WRAPPER postgres_fdw;
DO $d$
BEGIN
EXECUTE $$CREATE SERVER loopback FORE... |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字Header(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists Header;
CREATE TABLESPACE Header RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace Header;
--关键字带双引号,创建成功
drop tablespace if exists "Header";
CREATE TABLESPACE "Header" RELATIVE... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 30, 2018 at 05:22 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>thunder-/paprika
CREATE INDEX sen_hashcode_idx ON users (hashcode); |
<reponame>LucasHe4rt/gym-track
CREATE DATABASE IF NOT EXISTS Gym-track COLLATE utf8_unicode_ci;
GRANT ALL ON `Gym-track`.* TO 'root'@'%';
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 06 Des 2021 pada 15.35
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<reponame>marceloqueiros/cbr-smartphone-cost-evaluation<gh_stars>0
SET IDENTITY_INSERT [dbo].[Estado] ON
INSERT INTO [dbo].[Estado] ([idEstado], [designação]) VALUES (1, N'Péssimo')
INSERT INTO [dbo].[Estado] ([idEstado], [designação]) VALUES (2, N'Mau')
INSERT INTO [dbo].[Estado] ([idEstado], [designação]) VALUES (... |
<filename>ezcrmserver.sql
-- --------------------------------------------------------
-- Host: localhost
-- Versión del servidor: 5.7.19 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 9.4.0.5125
-- ----------------------------------... |
<gh_stars>1-10
create sequence SEQ_SO_OPPGITT_OPPTJENING
increment by 50
START WITH 1000000 NO CYCLE;
create sequence SEQ_SO_OPPGITT_FRILANS
increment by 50
START WITH 1000000 NO CYCLE;
create sequence SEQ_SO_OPPGITT_FRILANSOPPDRAG
increment by 50
START WITH 1000000 NO CYCLE;
|
#!default_db:schema1
##dealline JSON FUNCTION
##case1::Full-text search functions
#CREATE TABLE articles (id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEYtitle VARCHAR(200) body TEXTFULLTEXT (title,body)) ENGINE=InnoDB;
#!multiline
#INSERT INTO articles (titlebody) VALUES
# ('MySQL Tutorial''DBMS stands for DataB... |
<filename>transform/snowflake-dbt/models/sources/greenhouse/greenhouse_openings_source.sql<gh_stars>1-10
WITH source as (
SELECT *
FROM {{ source('greenhouse', 'openings') }}
), renamed as (
SELECT
--keys
id::NUMBER AS job_opening_id,
job_id::NUMBER ... |
<reponame>jdkoren/sqlite-parser
-- randexpr1.test
--
-- db eval {SELECT -17+c-(abs(t1.a)/abs(t1.c))-case when t1.a<>c then case when exists(select 1 from t1 where 11 not between + -d and d and 13 not between 13 and 17 or not -f<=19 or (t1.a)<a or t1.a>(11)) and 11<t1.b then t1.e else coalesce((select case when t1.f ... |
-- Solution for: https://leetcode.com/problems/trips-and-users/ on mssql dbms platform
-- Create the table and insert the data
IF OBJECT_ID(N'dbo.Trips', N'U') IS NULL BEGIN
CREATE TABLE Trips (Id INT, Client_Id INT, Driver_Id INT, City_Id INT, [Status] VARCHAR(50), Request_at VARCHAR(50))
END
IF OBJECT_ID(N'dbo.Use... |
<reponame>scheltwort-it-services/common_schema<filename>tests/root/run/87/test.sql
SET @s := '{
set @y := 4;
exit;
set @y := 17;
}
';
call run(@s);
SELECT @y = 4;
|
-- 2022-02-27T23:39:09.748Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO C_AggregationItem (AD_Client_ID,AD_Column_ID,AD_Org_ID,C_Aggregation_ID,C_AggregationItem_ID,Created,CreatedBy,EntityType,IsActive,Type,Updated,UpdatedBy) VALUES (0,579362,0,540003,540054,TO_TIMESTAMP('2022-02-28 0... |
-- 2022-03-24T10:59:42.239Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsIdentifier='Y',Updated=TO_TIMESTAMP('2022-03-24 12:59:42','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=570588
;
-- 2022-03-24T10:59:43.779Z
-- I forgot to set the DICTIONARY_ID_COMMENTS Sys... |
<reponame>docquantum/airavata<gh_stars>10-100
/*
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apa... |
\set VERBOSITY terse
set client_min_messages to ERROR;
\i load_topology.sql
-- Save max node,edge and face ids
select 'node'::text as what, max(node_id) INTO city_data.limits FROM city_data.node;
INSERT INTO city_data.limits select 'edge'::text as what, max(edge_id) FROM city_data.edge;
INSERT INTO city_data.limits s... |
BEGIN;
DROP TABLE IF EXISTS links;
DROP TABLE IF EXISTS items;
DROP TABLE IF EXISTS rooms;
DROP TABLE IF EXISTS players;
COMMIT;
|
<gh_stars>0
SELECT number, word, region
FROM
OpenJson('[{
"region": "Wilts",
"sequence": [{
"number": 1,
"word": "Ain"
}, {
"number": 2,
"word": "Tain"
}]
}, {
"region": "Scots",
"sequence": [{
"number": 1,
"word": "Yan"
},... |
UPDATE database_instance SET master_port=22294 where port not in (22293, 22294);
-- topology:
--
-- 22293
-- + 22294
-- + 22295
-- + 22296
-- + 22297
--
|
-- migrate:up
ALTER TABLE devices ADD push_token varchar(255);
ALTER TABLE devices ADD app_version varchar(255);
-- migrate:down
ALTER TABLE devices DROP COLUMN push_token;
ALTER TABLE devices DROP COLUMN app_version;
|
<gh_stars>100-1000
select a,b,c from table1 intersect select a,b,c from table2 intersect all select a,b,c from table3 |
<gh_stars>1000+
--
-- This opens a test batch window to run
-- stats collection immediately.
-- Window is 20 minutes.
--
@drop_stats
@cadm
begin
begin
dbms_scheduler.drop_window('TEST_WINDOW',true);
exception when others then
if (sqlcode != -27476) then
raise;
end if;
end;
dbms_scheduler.cr... |
INSERT INTO `lh_chat_config` (`identifier`,`value`,`type`,`explain`,`hidden`) VALUES ('footprint_background','0','0','Footprint updates should be processed in the background. Make sure you are running workflow background cronjob.','0');
CREATE TABLE `lh_chat_online_user_footprint_update` (
`online_user_id` bigint(20... |
<filename>src/test/tinc/tincrepo/resource_management/memory_accounting/scenario/oom_test/sql/oom_simple.sql
-- @author ramans2
-- @created 2014-02-05 12:00:00
-- @modified 2014-02-05 12:00:00
-- @description Simple queries that do not OOM
select count(*) from partsupp;
select pg_sleep(60);
|
CREATE DATABASE IF NOT EXISTS `url`;
USE url;
-- Table structure for table `url_info`
CREATE TABLE `url_info` (
`long_url` VARCHAR(500) NOT NULL,
`short_url` VARCHAR(10) NOT NULL,
`hits` INT(11) DEFAULT '0' ,
`created` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ,
PRIMARY KEY (`short_url`)
) ENGINE ... |
CREATE DATABASE IF NOT EXISTS `world` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `world`;
-- MySQL dump 10.13 Distrib 5.5.24, for osx10.5 (i386)
--
-- Host: localhost Database: world_2
-- ------------------------------------------------------
-- Server version 5.5.25-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
USE AdventureWorks
GO
-- COUNT() , AVG, SUM(), MAX(), MIN()
SELECT FirstName, COUNT(*)
FROM Person.Person
GROUP BY FirstName
SELECTV CODIGOLOCAL, SUM(VENTA)
FROM TABLASVENTAS
GROUP BY CODIGOLOCAL
SELECT FirstName, LastName, COUNT(1)
FROM Person.Person
GROUP BY FirstName, LastName
SELECT C.CustomerID, C.PersonI... |
drop procedure if exists sp_tbl_PetBreedMaster;
create procedure sp_tbl_PetBreedMaster()
begin
declare currentSchema varchar(100);
select database() into currentSchema;
if not exists(
select 1
from information_schema.TABLES
WHERE TABLE_SCHEMA = currentSchema
... |
<reponame>valery1707/test-sorm
ALTER TABLE bro_conn ADD INDEX idx$bro_conn$created_at (created_at);
ALTER TABLE bro_conn ADD INDEX idx$bro_conn$created_by (created_by_id);
ALTER TABLE bro_files ADD INDEX idx$bro_files$created_at (created_at);
ALTER TABLE bro_files ADD INDEX idx$bro_files$created_by (created_by_id);
A... |
CREATE TABLE `%prefix%views` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`project_id` INT(11) UNSIGNED NULL DEFAULT NULL,
`post_id` INT(11) UNSIGNED NULL DEFAULT NULL,
`timestamp` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
; |
<gh_stars>0
create table KT_EMPLOYEES (
id INT,
first_name VARCHAR(50),
second_name VARCHAR(50),
last_name VARCHAR(50),
surname VARCHAR(50),
email VARCHAR(50),
gender VARCHAR(50),
department VARCHAR(50),
phone VARCHAR(50),
emp_category VARCHAR(3),
emp_level VARCHAR(2),
client_name VARCHAR(50),
street_addre... |
CREATE EXTERNAL TABLE IF NOT EXISTS usaspending.assistance_parquet (
award_id_fain string,
modification_number string,
award_id_uri string,
sai_number string,
federal_action_obligation double,
non_federal_funding_amount double,
total_funding_amount double,
face_value_of_loan double,
original_subs... |
insert into `user_site_page_content_item_image`(`id`,`site_id`,`page_id`,`content_id`,`version_id`,`expand`,`caption`) values
(1,1,1,4,5,1,'This is supposed to be a caption explaining the image'),
(2,2,2,12,19,1,'This is supposed to be a caption explaining the image'),
(3,3,3,22,12,0,'This is supposed to ... |
<gh_stars>1-10
CREATE TABLE [Data_Load].[Das_Commitments]
(
[Id] BIGINT NOT NULL PRIMARY KEY IDENTITY(1, 1),
[CommitmentID] BIGINT NOT NULL,
[PaymentStatus] VARCHAR(50),
[ApprenticeshipID] BIGINT,
[AgreementStatus] VARCHAR(50),
[ProviderID] VARCHAR(255),
[LearnerID... |
CREATE DATABASE mydb;
use mydb;
CREATE TABLE user (
id int unsigned not null auto_increment,
name varchar(100) not null,
email varchar(128) not null,
password char(128) not null,
created_at datetime not null default current_timestamp,
updated_at ... |
<filename>mysql/sql/initial.sql
-- MySQL dump 10.13 Distrib 8.0.17, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: boilerplate
-- ------------------------------------------------------
-- Server version 8.0.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RES... |
<gh_stars>1-10
delete from photo p where p.id = $1 returning p.id; |
-- Config data for Product Reviews
-- New tabs for reviews
INSERT INTO [dbo].[uCommerce_ProductReviewStatus] ([ProductReviewStatusId], [Name], [Deleted]) VALUES (1000, N'New', 0)
INSERT INTO [dbo].[uCommerce_ProductReviewStatus] ([ProductReviewStatusId], [Name], [Deleted]) VALUES (2000, N'Approved', 0)
INSERT INTO [dbo... |
<gh_stars>10-100
drop table if exists prng_new;
create table prng_new AS
SELECT
prng.id,
prng.geom,
liczba_adresow,
liczba_budynkow,
liczba_adresow+liczba_budynkow as count
FROM stg_prng_miejscowosci prng
LEFT JOIN lateral (
select count(*) liczba_adresow
from prg.delta a
left join exclu... |
SELECT
c.month,
contrib_type,
ROUND(CAST((type_count*100) as decimal)/total, 2) as percent_of_data,
type_count,
total
FROM (
SELECT z.month, contrib_type, count(*) as type_count
FROM (
SELECT
MIN(to_char(m.created_at, 'YYYY-MM')) AS month,
contrib_type
... |
-- Diagnostic
-- Microsoft.OneCore.NetworkingTriage
-- Microsoft.Windows.Networking.DHCP
-- Microsoft.Windows.Networking.DNS
-- Microsoft.Windows.Networking.NetworkSetupSvc
--
-- from C:\ProgramData\Microsoft\Diagnosis\EventTranscript\EventTranscript.db
-- For more info visit https://github.com/... |
<gh_stars>10-100
-- file:plpgsql.sql ln:2125 expect:false
EXCEPTION
WHEN OTHERS THEN
raise notice 'WRONG - exception % caught in outer block', sqlerrm
|
CREATE OR REPLACE PROCEDURE SP_CHECK_SERVER_NONCE
(
P_CONSUMER_KEY IN VARCHAR2,
P_TOKEN IN VARCHAR2,
P_TIMESTAMP IN NUMBER,
P_MAX_TIMESTAMP_SKEW IN NUMBER,
P_NONCE IN VARCHAR2,
P_RESULT ... |
<reponame>hbraha/ovirt-engine<filename>packaging/dbscripts/upgrade/04_03_0320_add_vdo_savings_to_brick_properties.sql<gh_stars>100-1000
SELECT fn_db_add_column('gluster_volume_brick_details', 'vdo_savings', 'integer default null');
|
<gh_stars>100-1000
select `custkey`, `orderstatus`
from `tpch`.`tiny`.`orders`
order by `totalprice` * 1.0625
fetch next 20 rows only |
-- -----------------------------------------------------
-- Table `hibernate_sequence`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS hibernate_sequence
(
`next_val` BIGINT NOT NULL
)
AUTO_INCREMENT = 1;
insert into hibernate_sequence (next_val)
values (1);
-- -------------... |
-- @testpoint:opengauss关键字Isolation非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists Isolation;
create sequence Isolation start 100 cache 50;
drop sequence Isolation;
--关键字带双引号-成功
drop sequence if exists "Isolation";
create sequence "Isolation" start 100 cache 50;
drop sequence "Isolation";
--关键字带单引号-合理报错
drop seque... |
<gh_stars>0
CREATE TABLE `devices` (
`id` int(11) NOT NULL,
`deviceName` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `files` (
`id` int(11) NOT NULL,
`fileName` text NOT NULL,
`MD5` text NOT NULL,
`downloadCount` int(11) DEFAULT 0,
`fileSize` text NOT NULL,
`deviceName` int(11) ... |
<gh_stars>0
--1
/* Show the lastName, party and votes for the constituency 'S14000024' in 2017. */
SELECT
lastName,
party,
votes
FROM
ge
WHERE
constituency = 'S14000024'
AND yr = 2017
ORDER BY
votes DESC;
--2
/* Show the party and RANK for constituency S14000024 in 2017. List the output by party */
SELEC... |
<reponame>akellan/thaitrip-gatsby
select * from wp_posts where post_type = 'attachment' |
-- reference definition of a saga data table. A specifically named table
-- will need to exist for each saga defined in code.
CREATE TABLE [PeachtreeBus].[SagaName_SagaData]
(
[Id] BIGINT NOT NULL IDENTITY PRIMARY KEY,
[SagaId] UNIQUEIDENTIFIER NOT NULL,
[Key] NVARCHAR(128) NOT NULL,
[Data] NVARCHAR(MAX) NOT NUL... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64)
--
-- Host: localhost Database: garbage
-- ------------------------------------------------------
-- Server version 5.7.17-0ubuntu0.16.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@... |
prompt --application/pages/page_00011
begin
wwv_flow_api.create_page(
p_id=>11
,p_user_interface_id=>wwv_flow_api.id(40708662826080105)
,p_name=>'Latest Test Results'
,p_step_title=>'Latest Test Results'
,p_autocomplete_on_off=>'OFF'
,p_page_template_options=>'#DEFAULT#'
,p_required_role=>wwv_flow_api.id(4071133561108... |
INSERT INTO `specialists` (`id`, `name`) VALUES
(1, 'unselected'),
(2, 'c.ahmed'),
(3, 'Elbanna'),
(4, 'ezzat'),
(5, 'hany'),
(6, 'omar'),
(7, 'nariman'),
(8, 'yara'),
(9, 'baher'); |
USE `Ratemanagement3`;
INSERT INTO `tblresourcecategories` (`ResourceCategoryName`, `CompanyID`) VALUES ('BillingDashboardSummaryWidgets.View', '1');
INSERT INTO `tblresourcecategories` (`ResourceCategoryName`, `CompanyID`) VALUES ('BillingDashboardMissingGatewayWidget.View', '1');
INSERT INTO `tblResourceCategories` ... |
SELECT t1.name, count(*)
FROM
site as s,
so_user as u1,
question as q1,
answer as a1,
tag as t1,
tag_question as tq1
WHERE
q1.owner_user_id = u1.id
AND a1.question_id = q1.id
AND a1.owner_user_id = u1.id
AND s.site_id = q1.site_id
AND s.site_id = a1.site_id
AND s.site_id = u1.site_id
AND s.site_id = tq1.site_id
AND s.s... |
<gh_stars>1-10
SET FOREIGN_KEY_CHECKS = 0;
DELETE FROM object WHERE object_id = 31;
SET FOREIGN_KEY_CHECKS = 1;
|
<gh_stars>1-10
CREATE DATABASE SoftUni
USE SoftUni
CREATE TABLE Towns(
Id INT PRIMARY KEY IDENTITY,
Name VARCHAR(50) NOT NULL,
)
CREATE TABLE Addresses(
Id INT PRIMARY KEY IDENTITY,
AddressText VARCHAR(50) NOT NULL,
TownId INT FOREIGN KEY REFERENCES Towns(Id),
)
CREATE TABLE Departments(
Id IN... |
DROP TABLE IF EXISTS admin CASCADE;
CREATE TABLE admin(
id SERIAL PRIMARY KEY,
admin_first VARCHAR(255) NOT NULL CHECK(admin_first != ''),
admin_last VARCHAR(255) NOT NULL CHECK(admin_last != ''),
admin_imgurl VARCHAR(300),
admin_bio VARCHAR(300),
admin_email VARCHAR NOT NULL UNIQUE,
admin_... |
<gh_stars>1-10
select country, continent
from first.countries_raw;
|
/**
* @version v1.7
*
* @schema c00511c7c1db65c0cfad04b4842afc57
*/
-- Add a table to contain the attachment file contents
DROP TABLE IF EXISTS `%TABLE_PREFIX%file`;
CREATE TABLE `%TABLE_PREFIX%file` (
`id` int(11) NOT NULL auto_increment,
`type` varchar(255) NOT NULL default '',
`size` varchar(25) NOT NULL ... |
<reponame>kubilaycaglayan/SQL-Zoo-Answers
--1
SELECT
matchid,
player
FROM goal
WHERE teamid = 'GER';
--2
SELECT id,stadium,team1,team2
FROM game
WHERE id = 1012;
--3
SELECT goal.player, goal.teamid, game.stadium, game.mdate
FROM game JOIN goal ON (id=matchid) WHERE goal.teamid = 'GER';
--4
SELECT
ga... |
<gh_stars>1-10
-- Your SQL goes here
CREATE TABLE contents(
file_hash CHAR(64) NOT NULL PRIMARY KEY,
url VARCHAR(255) NOT NULL,
content TEXT NOT NULL,
created_at timestamp DEFAULT now()
)
|
<gh_stars>10-100
DROP TABLE IF EXISTS book_to_book_store;
DROP TABLE IF EXISTS book_store;
DROP TABLE IF EXISTS book;
DROP TABLE IF EXISTS author;
CREATE TABLE author
(
id INT NOT NULL AUTO_INCREMENT,
first_name VARCHAR(50),
last_name VARCHAR(50) NOT NULL,
date_of_birth DATE,
... |
-- e_fkey.test
--
-- execsql {
-- DELETE FROM track WHERE trackartist = 2;
-- DELETE FROM artist WHERE artistid = 2;
-- }
DELETE FROM track WHERE trackartist = 2;
DELETE FROM artist WHERE artistid = 2; |
<reponame>Shuttl-Tech/antlr_psql
-- file:enum.sql ln:210 expect:true
SELECT enum_first(NULL::rainbow)
|
-- file:arrays.sql ln:449 expect:true
CREATE TEMP TABLE arraggtest ( f1 INT[], f2 TEXT[][], f3 FLOAT[])
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.