sql stringlengths 6 1.05M |
|---|
-- :name create-tables :! :n
CREATE TABLE IF NOT EXISTS authors (
id serial PRIMARY KEY,
name VARCHAR(120),
email VARCHAR(120) UNIQUE,
nickname VARCHAR(80) NOT NULL,
biography text,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS books (
id serial PRIMARY KEY,
titl... |
<reponame>stbraun/picdb<gh_stars>0
delete from tags where identifier like 'UT_%';
delete from pictures where identifier like 'UT_%';
delete from groups where identifier like 'UT_%'; |
-- postprocessor bundle is not currently linked to any view but inserted with code;
-- if a defined parameter is given, so this sql is a bit different from the usual bundle sqls;
INSERT INTO portti_bundle (name, startup)
VALUES ('postprocessor','{}');
UPDATE portti_bundle set startup = '{
"title": "Post... |
/*
Enter your query here.
*/
SELECT M.hacker_id, M.name, M.cnt
FROM (SELECT Hackers.hacker_id,
Hackers.name,
count(Hackers.hacker_id) as cnt,
(SELECT count(hacker_id) as maximum
FROM Challenges
GROUP BY hacker_id
ORDER BY maximum DESC
LIMIT 1) as maximum2
FRO... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 04, 2020 at 02:41 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>SQL To .Net/Prototype/GenClass2.sql
IF OBJECT_ID('tempdb..##GenTemp', 'U') IS NOT NULL
DROP TABLE ##GenTemp
--select * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'S_Address'
SELECT COLUMN_NAME AS Name,
DATA_TYPE AS DBType,
IS_NULLABLE AS [Null],
CAST(CHARACTER_MAXIMUM_LENGTH as varchar) ... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: 03 Jun 2020 pada 15.09
-- Versi Server: 5.7.30-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
DROP TABLE IF EXISTS `test_020`; |
--------------------------------------------------------------------------------
-- Membership Database Schema
-- https://github.com/membership/membership.db
--
-- Copyright © 2016 Membership Database contributors.
--
-- This source code is licensed under the MIT license found in the
-- LICENSE.txt file in the root dir... |
<reponame>stark3998/Web-Dev-Projects
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 15, 2018 at 07:07 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time... |
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Statement1",
"Effect": "Deny",
"Action": [
"ec2:PurchaseReservedInstancesOffering",
"savingsplans:CreateSavingsPlan",
"rds:PurchaseReservedDBInstancesOffering",
"elasticache:PurchaseReservedCacheNodesOffering",
"dynamodb:PurchaseReserv... |
create view revenue as
select l_suppkey supplier_no,
sum(l_extendedprice * (1 - l_discount)) total_revenue
from lineitem
where l_shipdate >= '1996-01-01'
and l_shipdate < '1996-04-01'
group by l_suppkey;
select s_suppkey,
s_name,
s_address,
s_phone,
to... |
/* Tables for FRTHR_FQE Schema */
--------------------------------------------------------
-- DDL for Table APP_LOG
--------------------------------------------------------
CREATE TABLE FRTHR_FQE.APP_LOG
(
APP_LOG_ID NUMBER,
APP_MODULE VARCHAR2(255),
APP_MSG_CD VARCHAR2(255),
APP_LOG_MSG CLOB,
APP_LOG_... |
<reponame>tec-csf/tc3041-t1-primavera-2020-equipo4
DELETE FROM votacion_federal WHERE mesa_id = 'A' AND partido_siglas = 'NA' AND fecha = '2019-06-01'
DELETE FROM votacion_federal WHERE mesa_id = 'B' AND partido_siglas = 'NA' AND fecha = '2019-06-01'
DELETE FROM votacion_federal WHERE mesa_id = 'C' AND partido_siglas =... |
CLUSTER westcon.nsw_electoral_bdys_2013 USING nsw_electoral_bdys_2013_geom_idx;
ANALYSE westcon.nsw_electoral_bdys_2013;
--Create web friendly State Electorate Boundary table
DROP TABLE IF EXISTS westcon.nsw_electoral_bdys_2013_web;
CREATE TABLE westcon.nsw_electoral_bdys_2013_web
(
id integer not null,
"name" c... |
<reponame>primesoftpro/exhibition-db<filename>db/patches/030.sql
SET FOREIGN_KEY_CHECKS=0;
ALTER TABLE business_sections ADD personid INT AFTER organizationid;
ALTER TABLE business_sections ADD FOREIGN KEY (personid) REFERENCES persons(id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE business_events ADD personid ... |
{{
config(
materialized='table'
)
}}
select
count(orders.order_id),
address.state,
address.country,
orders.status
FROM
{{ref('stg_addresses')}} address
left join {{ref('stg_orders')}} orders on orders.address_id=address.address_id and orders.status not in ('delivered') and orders.status is not null
g... |
<filename>sql/update_recommendation_details.sql
update recommendations set
details = $2,
updated = now()
where
recommendation::varchar(1024) = $1::varchar(1024)
and deleted = false
returning * |
<reponame>NobiGo/coral<gh_stars>100-1000
-- $ID$
-- TPC-H/TPC-R Product Type Profit Measure Query (Q9)
-- Functional Query Definition
-- Approved February 1998
select
nation,
o_year,
sum(amount) as sum_profit
from
(
select
n_name as nation,
extract(year from o_orderdate) as o_year,
l_extendedprice * (1... |
------------------------------
-- Archivo de base de datos --
------------------------------
-- DROP TABLE IF EXISTS usuarios CASCADE;
-- CREATE TABLE usuarios
-- (
-- id bigserial PRIMARY KEY
-- , nombre varchar(255) NOT NULL
-- , username varchar(60) NOT NULL UNI... |
<filename>db/src/main/resources/sql/4_add_comments.sql
-- SCHEMA
COMMENT ON SCHEMA extraction IS 'Keep all time values in UTC';
-- TABLES
|
-- Verify oparadis:init on pg
BEGIN;
SELECT * FROM CUSTOMER WHERE false;
SELECT * FROM CONNECTION WHERE false;
SELECT * FROM ANIMAL WHERE false;
SELECT * FROM HOUSE WHERE false;
SELECT * FROM PHOTO WHERE false;
SELECT * FROM ABSENTEE WHERE false;
SELECT * FROM ROLE WHERE false;
SELECT * FROM HOUSE_TYPE WHERE false;
... |
<reponame>csphile/DBMS-cmu
select artist.name, new_table.c from artist
inner join ( select artist,
count(distinct artist_alias.name) as c from artist_alias group by artist
) as new_table
on artist.id = new_table.artist
inner join area
on area.id = artist.area
where area == 221 and begin_date_year > 1950
order ... |
<filename>src/main/resources/db/h2/schema.sql
/*
* Copyright (c) 2020 GeekXYZ.
* All rights reserved.
*/
drop all objects delete files;
create table tb_user (
id bigint not null auto_increment,
deleted_at datetime,
identifier varchar(50),
verified boolean not null default false,
last_login datet... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2020 at 03:08 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<reponame>iltonbarbosa/cursoCodeIgniterPortalDeNoticias
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: 03-Abr-2020 às 16:58
-- Versão do servidor: 5.7.24
-- versão do PHP: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRA... |
<reponame>anoopmd/node-ws-boilerplate
--
-- Table structure for table `reminder`
--
CREATE TABLE `reminder` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`description` varchar(2047) COLLATE utf8_unicode_ci DEFAULT NULL,
`datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`is_done` tinyint(1) NOT NULL D... |
<reponame>RosenBobchev/CSharp-DB-Fundamentals<gh_stars>1-10
SELECT * FROM Payments
UPDATE Payments
SET TaxRate /= 1.3
SELECT TaxRate FROM Payments |
<gh_stars>1-10
update eg_action set url='/report/notice/search', displayname = 'Search Notice' where url='/report/generateBill/search' and displayname = 'Search Bill(WC)' and contextroot='wtms'
|
CREATE TABLE IF NOT EXISTS queries (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
query TEXT NOT NULL,
interval TIMESTAMP NOT NULL DEFAULT now()
); |
--bigquery allows for named params like @param or ordered params in ?
select "1" from x where y = @z_test1;
select datetime_trunc(@z2, week);
select datetime_trunc(@_ab, week);
select datetime_trunc(@a, week);
select parse_date("%Y%m", year); -- this should parse year as an identifier
select "1" from x where y = ?;
sel... |
SELECT ROUND(SUM(LAT_N),4) from STATION WHERE LAT_N > 38.7880 AND LAT_N < 137.2345 ;
|
SELECT TOP 1 AVG(Salary)
FROM Employees
GROUP BY DepartmentID
ORDER BY AVG(Salary) |
CREATE VIEW dbo.table_partition_boundary
AS
Select t.name,rng.boundary_id, rng.value,prt.rows
from sys.partitions prt inner join sys.tables t
on prt.object_id = t.object_id
INNER JOIN sys.indexes idx ON prt.[object_id] = idx.[object_id]
AND prt.[index_id] = idx.[index_id]
INNER JOIN sys.da... |
--/
CREATE OR REPLACE PYTHON3 SCALAR SCRIPT EXA_TOOLBOX.check_tcp_listener_connection(host VARCHAR(200), port INT) RETURNS VARCHAR(20) AS
#--In order for this script to work you need to run a TCP listener on the specified host and port
#--e.g. nc -lkp 3000
#--if everything is working the logging message will be displa... |
-- file:rangefuncs.sql ln:44 expect:true
create temporary view vw_ord as select * from rows from(unnest(array[10,20],array['foo','bar']), generate_series(1,2)) as z(a,b,c)
|
-- file:rangetypes.sql ln:217 expect:true
create index test_range_gist_idx on test_range_gist using gist (ir)
|
-- file:enum.sql ln:242 expect:true
DROP FUNCTION echo_me(rainbow)
|
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 06, 2015 at 09:56 PM
-- Server version: 5.6.24-log
-- 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_CLIEN... |
DROP TABLE IF EXISTS `vote`;
CREATE TABLE `vote` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`game_id` INT(11) DEFAULT NULL,
`jam_id` INT(11) DEFAULT NULL,
`user_id` INT(11) DEFAULT NULL,
`voted_at` DATETIME DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `game_id` (`game_id`),
KEY `jam_id` (`jam_id`)... |
UPDATE `tblconfiguration` SET `value` = '3.2.2' WHERE `setting`= 'Version';
|
CREATE OR REPLACE VIEW de_metas_invoicecandidate.c_invoice_candidate_wrong_qtytoinvoice_v AS
SELECT
ic.C_Invoice_candidate_ID,
ic.Processed_Calc,
ic.Processed_Override,
ic.QTyToInvoice_Override,
ic.QtyToInvoice,
ic.PriceActual,
ic.NetAmtToInvoice,
ic.Updated,
ic.UpdatedBy
FROM C_Invoice_candidate ic
WHER... |
<reponame>godely/reduphp<filename>vendor/oauth-php/oauth-php/library/store/oracle/OracleDB/3_Procedures/SP_ADD_CONSUMER_REQUEST_TOKEN.prc
CREATE OR REPLACE PROCEDURE SP_ADD_CONSUMER_REQUEST_TOKEN
(
P_TOKEN_TTL IN NUMBER, -- IN SECOND
P_CONSUMER_KEY IN VARCHAR2,
P_TOK... |
select cedula,nombre,direccion,telefono,ciudad
from cliente |
<gh_stars>0
-- 09/10/2014
ALTER TABLE `orders` CHANGE `total` `total` DECIMAL(5,2); |
<gh_stars>0
DROP TABLE IF EXISTS diamonds;
CREATE TABLE diamonds (
carat REAL,
cut NVARCHAR(MAX),
color NVARCHAR(MAX),
clarity NVARCHAR(MAX),
depth REAL,
"table" REAL,
price BIGINT,
x REAL,
y REAL,
z REAL
)
DROP TABLE IF EXISTS batting;
CREATE TABLE batting (
"playerID" NV... |
UPDATE labels SET field_name = 'Removable' WHERE module = 'WorkflowSteps' AND module_name = 'Workflow -> Steps' AND field_name = 'Deletable';
-- db_patches
DELETE FROM `db_patches` WHERE `issue` = 'POCOR-2208'; |
-- +migrate Up
CREATE TABLE persons (
id VARCHAR(32) NOT NULL PRIMARY KEY,
principal VARCHAR(150) NOT NULL,
meta JSON NOT NULL,
UNIQUE (principal)
);
-- +migrate Down
DROP TABLE persons;
|
<gh_stars>10-100
INSERT INTO now_application_document_type
(now_application_document_type_code, description, active_ind, now_application_document_sub_type_code, create_user, update_user)
VALUES
('LMA', 'Location Map', true, 'MDO', 'system-mds', 'system-mds'),
('LTM', 'Land Title/Licence of Ocupation Map', true,... |
<filename>docs/demos/dellstore2/create_databases.sql
CREATE DATABASE store;
CREATE DATABASE store_anonymized;
|
<gh_stars>1-10
create table t ( a int);
insert into t values (1);
insert into t values (2);
insert into t values (0);
insert into t values (null);
create index i_t_a on t(a);
--result is not correct.
select /*+ recompile */ a from t where a<=>null or a is not null order by 1;
drop table t;
|
<filename>openGaussBase/testcase/KEYWORDS/mode/Opengauss_Function_Keyword_Mode_Case0023.sql
-- @testpoint: opengauss关键字mode非保留),作为索引名,部分测试点合理报错
--前置条件,创建一个表
drop table if exists explain_test;
create table explain_test(id int,name varchar(10));
--关键字不带引号-成功
drop index if exists mode;
create index mode on explain_test(... |
<filename>SQL/seeds.sql
-- Insert into 'deptTbl'
INSERT INTO deptTbl (dept_name)
VALUES
("Human Resources"),
("Sales"),
("Customer Service"),
("Marketing"),
("Engineering"),
("Operations");
-- Insert into 'roleTbl'
INSERT INTO roleTbl (title, salary, dept_ID, is_Manager)
VALUES
(... |
<reponame>smp-org/smp
IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Messages' AND COLUMN_NAME = 'ConversationId' AND TABLE_SCHEMA = 'DBO')
BEGIN
ALTER TABLE Messages ADD ConversationId UNIQUEIDENTIFIER NOT NULL;
ALTER TABLE Messages ADD CONSTRAINT FK_Messages_ConversationId_Conversations... |
<reponame>brlcad/rseg105
CREATE TABLE CATEGORY (
ID INT NOT NULL AUTO_INCREMENT,
NAME VARCHAR(100),
PRIMARY KEY (ID)
);
CREATE TABLE BOOK (
ID INT NOT NULL AUTO_INCREMENT,
CATEGORY_ID INT(11),
ISBN VARCHAR(14),
TITLE VARCHAR(500),
PRICE DECIMAL(5,2),
PRIMARY KEY (ID)
);
|
<gh_stars>0
-- create a view that displays the users from the Users table that have been in the system today.
CREATE VIEW [UsersLoggedInToday] AS
SELECT Username FROM Users
WHERE LastLogin = CAST(CURRENT_TIMESTAMP AS DATE) |
<reponame>rajeshhazari/transcribedb<filename>scripts/sql/10-create-role.sql
-- Run these commands to create the default database.
-- Note: CREATE DATABASE needs to be executed individually.
DO
$do$
BEGIN
IF NOT EXISTS (
SELECT -- SELECT list can stay empty for this
FROM pg_catal... |
<filename>SQL/Guia_1_Tablas.sql
create table Club
(
Club_Id int not null,
Nombre varchar(15),
Socios int,
constraint PK_Club primary key(Club_Id)
);
insert into Club (Club_Id,Nombre,Socios) values (1,'Boca Juniors',40000);
insert into Club (Club_Id,Nombre,Socios) values (2,'River Plate',30000);
insert ... |
<reponame>binhhv/job
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 20, 2015 at 04:21 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... |
USE [dfc-coursedirectory]
GO
/****** Object: Table [dbo].[CourseInstanceVenue] Script Date: 04/02/2019 14:05:43 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[CourseInstanceVenue](
[CourseInstanceId] [int] NOT NULL,
[VenueId] [int] NOT NULL,
CONSTRAINT [PK_CourseInstanceVenue] PR... |
<reponame>moshiurcse12/E-Tender<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 17, 2018 at 09:01 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SE... |
--
-- Step 3 of the UTF-8 Multibyte (utf8mb4) conversion for MySQL
--
-- Convert the tables for action logs and the privacy suite which have been
-- forgotten to be added to the utf8mb4 conversion before.
--
-- This file here will be processed with reporting exceptions, in opposite
-- to the file for step 1.
--
--
-- ... |
CREATE OR REPLACE FUNCTION ti.getcontactstatusestable()
RETURNS TABLE(contactstatusid integer, contactstatus character varying, statusdescription character varying)
LANGUAGE sql
AS $function$
SELECT contactstatusid, contactstatus, statusdescription
FROM ndb.contactstatuses
$function$
|
<reponame>ryanmaclean/treasure-boxes
SELECT
time -- access_timeの日付
, td_client_id
, td_global_id
, min_access_time
, max_access_time
, MIN(time) OVER(PARTITION BY td_client_id) AS cid_mintime
, ROW_NUMBER() OVER(PARTITION BY time ORDER BY min_access_time) AS cid_num
, MIN(time) OVER(PARTITION BY td_glob... |
-- NYC Taxi Ride Case Study!!
-- Apply your new skills in temporal EDA, user-defined functions, and stored procedures to solve a business case problem. Analyze the New York City taxi ride dataset to identify average fare per distance, ride count, and total ride time for each borough on each day of the week. And which ... |
-- file:rowtypes.sql ln:137 expect:true
explain (costs off)
select * from int8_tbl i8
where i8 in (row(123,456)::int8_tbl, '(4567890123456789,123)')
|
-- file:union.sql ln:35 expect:true
SELECT 1.1 AS three UNION SELECT 2 UNION SELECT 3 ORDER BY 1
|
<filename>api/sql/startData.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 20, 2016 at 02:32 PM
-- Server version: 10.0.17-MariaDB
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Databas... |
CREATE TABLE backup.m_attributevalue_2019_05_31 AS
SELECT * FROM m_attributevalue;
UPDATE m_attributevalue SET isactive=c_country.isactive,name=c_country.name,updated=now(),updatedby=99
FROM c_country
WHERE
m_attribute_id::text=(SELECT value FROM ad_Sysconfig WHERE name='de.metas.swat.CountryAttribute')
AND c_country... |
<gh_stars>0
-- Retrieve the name and count of the Badge awarded
-- the second-most number of times
-- 1.1 marks: <10 operators
-- 1.0 marks: <12 operators
-- 0.9 marks: <15 operators
-- 0.8 marks: correct answer
-- Replace this comment line with the actual query
|
CREATE TABLE [dbo].[MarkupTemplates]
(
[Id] INT CONSTRAINT [PK_MarkupTemplates] PRIMARY KEY IDENTITY,
[Name] NVARCHAR (255) NOT NULL CONSTRAINT [UQ_MarkupTemplates__Name] UNIQUE,
[Name2] NVARCHAR (255),
[Name3] NVARCHAR (255),
[Code] NVARCHAR (50),
[Description] NVARCHAR (1024),
[Descriptio... |
<reponame>Brest-Java-Course-2021-2/Vitali-Nestsiaruk-Store
DROP TABLE IF EXISTS order_product;
DROP TABLE IF EXISTS product;
CREATE TABLE order_product(
order_id INT NOT NULL AUTO_INCREMENT,
shipper VARCHAR(255) NOT NULL,
-- date Date NOT NULL,
CONSTRAINT order_product_pk PRIMARY KEY (order_id)
);
CRE... |
--20120214
CREATE TABLE `eip_t_timeline` (
`timeline_id` int(11) NOT NULL AUTO_INCREMENT,
`parent_id` int(11) NOT NULL DEFAULT 0,
`owner_id` int(11),
`note` text,
`create_date` datetime DEFAULT NULL,
`update_date` datetime DEFAULT NULL,
PRIMARY KEY(`timeline_id`)
) ENGINE=InnoDB DEFAULT CH... |
<reponame>ctwardy/jacobs-vault<gh_stars>1-10
SELECT vesseltype, n,
CASE WHEN vesseltype in ('0', '20', '21', '22', '23', '24', '30', '31', '32', '33', '34', '35', '36', '37', '40', '41', '42', '43', '44', '49', '50', '51', '52', '53', '54', '55', '56', '57', '58', '59', '60', '61', '62', '63', '64', '69', '70', '7... |
<filename>dbms/tests/queries/0_stateless/00614_shard_same_header_for_local_and_remote_node_in_distributed_query.sql<gh_stars>1-10
create database if not exists test;
drop table if exists test.tab;
create table test.tab (date Date, time DateTime, data String) ENGINE = MergeTree(date, (time, data), 8192);
insert into te... |
FLUSH PRIVILEGES;
ALTER USER "root"@"localhost" IDENTIFIED BY "password";
Create database sms;
Use sms;
Create table smsQ(
id int AUTO_INCREMENT,
phone varchar(10) not null,
body varchar(140) not null,
sentflag tinyint(1) default 0,
ts TIMESTAMP not null DEFAULT CURRENT_TIMESTAMP,
Primary Key(i... |
select
name,
type
from
azure.azure_redis_cache
where
name = '{{ resourceName }}'; |
CREATE SCHEMA template;
|
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: localhost Database: cyberlife
-- ------------------------------------------------------
-- Server version 8.0.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
USE Geography
GO
SELECT TOP(5) CountryName,
Elevation AS [HighestPeakElevation],
[Length] AS [LongestRiverLength]
FROM (
SELECT CountryName,
Elevation,
[Length],
DENSE_RANK() OVER(PARTITION BY CountryName ORDER BY Elevation DESC, [Length] DESC) AS [Rank]
FROM (
SELECT c.CountryNa... |
<reponame>ahmedanjumfahad/classExercises
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 21, 2015 at 08:36 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_CHARA... |
<gh_stars>0
CREATE PROCEDURE [dbo].[spAddressType_GetAll]
AS
begin
set nocount on
select Id, [Name]
from dbo.AddressType
order by [Name];
end
go
|
SELECT * FROM Movies AS m
JOIN MovieSupplier AS ms ON ms.movieid = m.movieid
JOIN Suppliers AS s ON ms.supplierid = s.supplierid
WHERE m.moviename = 'Almost Angels 1962' AND ms.price = (
SELECT MIN(price) FROM MovieSupplier AS ms
JOIN Movies m ON m.movieid = ms.movieid
WHERE m.moviename = 'Almost Angels 196... |
<filename>sunbird-cassandra-migration/cassandra-migration/src/main/resources/db/migration/cassandra/V1.119_cassandra.cql
ALTER TABLE sunbird.organisation ADD isTenant boolean;
ALTER TABLE sunbird.organisation ADD orgLocation text;
ALTER TABLE sunbird.organisation DROP parentorgid;
ALTER TABLE sunbird.organisation DROP ... |
-- INSERT contractor search action into EG_ACTION ---
Insert into EG_ACTION (ID,NAME,URL,QUERYPARAMS,PARENTMODULE,ORDERNUMBER,DISPLAYNAME,ENABLED,CONTEXTROOT,VERSION,CREATEDBY,CREATEDDATE,LASTMODIFIEDBY,LASTMODIFIEDDATE,APPLICATION) values (NEXTVAL('SEQ_EG_ACTION'),'WorksSearchContractor','/masters/contractor-searchCo... |
SELECT
i.id AS importer_id
, i.name AS importer_name
, i.description AS importer_description
, i.project_id AS project_id
, i.source_id AS source_id
, i.source AS importer_source
, i.source_system AS importer_source_system
, i.parser_name AS importer_parser_name
, i.registered_date AS importer_da... |
<reponame>posicks/bitcoin-verde<filename>src/main/resources/sql/spv/init_metadata_sqlite.sql<gh_stars>1-10
CREATE TABLE IF NOT EXISTS "metadata" (
"id" INTEGER NOT NULL,
"version" INTEGER NOT NULL DEFAULT 1 UNIQUE,
"timestamp" INTEGER NOT NULL,
PRIMARY KEY ("id")
); |
<reponame>okard/wp_afmng<filename>sql/afmngdb.sql
CREATE TABLE wp_afmng_anime (
project_id mediumint(9) NOT NULL AUTO_INCREMENT,
anime_name tinytext NOT NULL,
completed BOOLEAN default 0 NOT NULL,
licensed BOOLEAN default 0 NOT NULL,
PRIMARY KEY (project_id)
);
CREATE TABLE wp_afmng_episode... |
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/select/0f25f9a9.sql
-- file:triggers.sql ln:582 expect:true
SELECT description FROM serializable_update_tab WHERE id = 1
|
create table OR_PROPERTIES (PROPERTY_ID integer not null, PROPERTY_KEY varchar(255) not null unique, PROPERTY_VALUE varchar(255), primary key (PROPERTY_ID))
create table OR_TAGS (TAG_ID integer not null, TAGGED_OBJECT_ID integer not null, TAGGED_OBJECT_CLASS varchar(255) not null, TAG_VALUE varchar(255) not null, TAG_... |
/****** Object: StoredProcedure [dbo].[AddUpdateReferenceCompound] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE Procedure dbo.AddUpdateReferenceCompound
/****************************************************
**
** Desc: Adds new or updates existing reference compound in database
**
** Retur... |
<filename>OracleDatabases/SQL_DATA/SCHOOLFEES.sql
REM INSERTING into SCHOOLFEES
Insert into SCHOOLFEES (ID,MATRI,PREINSCRIPTION,TRANCHE1,TRANCHE2,IDSTUDENT,ID_OPTION,MATRICULE,CIVILITY,NAME,SURNAME,PHONE,EMAIL,LOGIN) values (6 '10B868' '0' '0' '0' 2 1 '10B868' 'Mr' ' <NAME> ' ' Justin' 23771368099 '<EMAIL>' 'j');
... |
ALTER TABLE
`ko`.`ko_cluster`
ADD
COLUMN `node_name_rule` VARCHAR(255) NULL
AFTER
`name`;
UPDATE
`ko`.`ko_cluster`
SET
`node_name_rule` = "default"
WHERE
`source` = "local"
OR `source` = "ko-external"; |
<gh_stars>100-1000
UPDATE t SET f = f + 1, g = 2 WHERE x > 10
|
# --- !Ups
DROP TABLE IF EXISTS task_board;
DROP TABLE IF EXISTS task_comment;
DROP TABLE IF EXISTS card;
DROP TABLE IF EXISTS card_assignee;
DROP TABLE IF EXISTS card_label;
DROP TABLE IF EXISTS checklist;
DROP SEQUENCE IF EXISTS task_board_seq;
DROP SEQUENCE IF EXISTS task_comment_seq;
DROP SEQUENCE IF EXISTS card_... |
create trigger [a_trigger]
on a_table
for delete, insert, update
as
begin
set nocount on
select 999;
begin
select 8;
end
end
|
<filename>DUMP MYSQL/yii2advanced_Comment.sql
-- MySQL dump 10.13 Distrib 8.0.17, for macos10.14 (x86_64)
--
-- Host: localhost Database: yii2advanced
-- ------------------------------------------------------
-- Server version 5.7.25
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @O... |
<gh_stars>0
/*
SQLyog Ultimate v11.5 (64 bit)
MySQL - 5.6.21
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
create table `cities` (
`id` smallint (5),
`name` varchar (600),
`community_id` int (11)
);
insert into `cities` (`id`, `name`, `community_id`) values('... |
-- This test case is currently only run with rudimentary validation of result counts,
-- so there's no point getting very fancy about returning expressions, etc. Keep it simple.
INSERT INTO P1 VALUES (0, 108, -19560, -3316354045336055422)
INSERT INTO P1 VALUES (1, 108, -19560, -3316354045336055422)
INSERT INTO R1 VALUE... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-05-2018 a las 02:27:32
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.