sql stringlengths 6 1.05M |
|---|
-- database: presto; groups: orderby, distinct
select distinct brand from tpch.tiny.part where partkey < 15 order by 1 desc
|
<reponame>ujjwal1212/koolguruweb
INSERT INTO `koolguru_test`.`resource` (`id`, `resource_name`) VALUES (NULL, 'Blog\Controller\Blog');
INSERT INTO `koolguru_test`.`permission` (`id`, `permission_name`, `resource_id`) VALUES (NULL, 'index', '8');
INSERT INTO `koolguru_test`.`role_permission` (`id`, `role_id`, `permiss... |
<reponame>NCIP/caintegrator
update genomic_data_source_configuration set PLATFORM_VENDOR = "AFFYMETRIX"
where PLATFORM_VENDOR = "Affymetrix";
update genomic_data_source_configuration set PLATFORM_VENDOR = "AGILENT"
where PLATFORM_VENDOR = "Agilent";
ALTER TABLE genomic_data_source_configuration ADD COLUMN... |
BEGIN;
CREATE EXTENSION IF NOT EXISTS plpython3u;
CREATE OR REPLACE FUNCTION get_load_average(OUT load_1min float, OUT load_5min float, OUT load_15min float) AS
$$
from os import getloadavg
la = getloadavg()
return [la[0], la[1], la[2]]
$$ LANGUAGE plpython3u VOLATILE;
GRANT EXECUTE ON FUNCTION get_load_average() TO... |
<filename>etc/mysql/changes/schema-10-to-11.sql<gh_stars>10-100
INSERT IGNORE INTO RecordString3 (id, symbolId, value)
SELECT id, symbolId, CONVERT(LOWER(TRIM(CONVERT(value USING utf8))) USING binary) FROM RecordString2;
/*
DROP TABLE RecordString2;
*/
|
<gh_stars>0
CREATE OR ALTER TRIGGER TRG_AIU_FILE
ON [file]
AFTER INSERT, UPDATE
AS
BEGIN
--
UPDATE F
SET F.updated = SYSUTCDATETIME()
FROM INSERTED I
INNER JOIN [file] F ON F.id = I.id
--
END
|
<filename>sql/venueorder20190725.sql
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 80016
Source Host : localhost:3306
Source Database : venueorder
Target Server Type : MYSQL
Target Server Version : 80016
File Encoding : 65001
Date: 2019-07-30 13:35:31... |
DROP PROCEDURE IF EXISTS spVerificarDatosUsuario
GO
CREATE PROCEDURE spVerificarDatosUsuario
@correo VARCHAR(500),
@clave VARCHAR(160)
AS
BEGIN
SET NOCOUNT ON;
CREATE TABLE #UsuariosTemporal(
correo VARCHAR(max),
clave VARCHAR(max)
);
INSERT INTO #UsuariosTemporal
SELECT
correo,
CONVERT(VARCHAR(MAX... |
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Oracle user
-- APEX_050000 or as the owner ... |
<gh_stars>0
-- DropIndex
DROP INDEX "compliments_tag_id_key";
-- DropIndex
DROP INDEX "compliments_userReceiverId_key";
-- DropIndex
DROP INDEX "compliments_userSenderId_key";
|
INSERT INTO sushi (sushi_name) VALUES ("Lion Roll");
INSERT INTO sushi (sushi_name) VALUES ("Tiger Roll");
INSERT INTO sushi (sushi_name) VALUES ("Rainbow Roll"); |
<filename>Banco/modelofisicojaquetastcc.sql
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='TRADITIONAL,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `JaquetasTcc` DEFAULT CHARACTER SET utf8 COL... |
SET DEFINE OFF;
ALTER TABLE AFW_19_BOUTN ADD (
CONSTRAINT AFW_19_BOUTN_UK1
UNIQUE (REF_DISPN_FONCT, REF_LANG, ITEM_SUBST)
ENABLE VALIDATE)
/
|
<gh_stars>10-100
drop table if exists demo.org_kind cascade; |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 07-08-2019 a las 18:40:49
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<reponame>sogis/gretljobs<gh_stars>1-10
(SELECT
TRUE AS gefasst,
b.besitzer AS eigentuemer,
a.min_schuettung,
a.max_schuettung,
coalesce(a.schutzzone,FALSE) AS schutzzone,
CASE
WHEN a.nutzungsart_schutzzone = 3
THEN 'privat'
WHEN a.nutzungsart_schutzzone = 2
... |
DROP TABLE IF EXISTS P;
CREATE TABLE P (
PNO text,
PNAME text,
COLOR text,
WEIGHT integer,
CITY text
);
INSERT INTO P (PNO, PNAME, COLOR, WEIGHT, CITY) VALUES
("P1", "Nut", "Red", 12, "London"),
("P2", "Bolt", "Green", 17, "Paris"),
("P3", "Screw", "Blue", 17, "Rome"),
("P4", "Screw", "Red", 14, "London"),
(... |
<filename>legocms-parent/sql/init/dml/01.site_data.sql
/** =======站点数据====== */
INSERT INTO sys_site
(ID, VERSION, CODE, NAME, CREATE_TIME, PATH, DYNAMIC_PATH, ORGANIZATION_ID)
VALUES
(nextval('sys'), 1, 'test', '测试站点', '2020-06-05 07:25:32', '//127.0.0.1:8080/legocms/static', 'http://127.0.0.1:8080/legocms... |
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email TEXT NOT NULL,
password_digest TEXT NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL
);
ALTER TABLE users ADD UNIQUE (email);
CREATE TABLE articles (
id SERIAL PRIMARY KEY,
author_id INTEGER NOT NULL,
title TEXT NOT NULL,
body T... |
<reponame>Shuttl-Tech/antlr_psql
-- file:insert.sql ln:175 expect:true
create table part_gg2_2 partition of part_gg2 for values from (5) to (10)
|
<filename>src/test/resources/sql/select/12072f45.sql<gh_stars>10-100
-- file:create_index.sql ln:605 expect:true
SELECT * FROM array_index_op_test WHERE i && '{32,17}' ORDER BY seqno
|
-- Your SQL goes here
CREATE TABLE project_service.goal_versions (
id uuid DEFAULT public.uuid_generate_v4() NOT NULL PRIMARY KEY,
goal_id uuid NOT NULL,
data jsonb DEFAULT '{}'::jsonb NOT NULL,
created_at timestamp without time zone DEFAULT now() NOT NULL,
updated_at timestamp without time zone DE... |
<reponame>mortendaehli/PCKasse-sql-export<filename>db/articles.sql
USE PCKasse;
SELECT TOP(100)
art.ArticleID AS ID, -- POS ID
art.ArticleNo AS SKU,
art.Name AS Title,
art.SalesPrice,
art.PurchasePrice,
art.PriceUnit,
art.PriceUnitAmount,
uni.Name AS UnitName,
sup.Name AS SupplierN... |
/*Build and query a database of some common cities and counties in Minnesota
This file is the space where we build and test this concept with SQL hints in an IDE. When we're finished,
we dump the SQL into the readme for nicer formatting.
*/
/******BEGIN BUILD SCHEMA *********/
--create the county table
CREATE TABLE C... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 09, 2020 at 04:01 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
create table usuario (
id int(11) not null auto_increment,
nombre varchar(100) not null,
clave varchar(45) not null,
fecha_creacion datetime null,
primary key (id)
);
CREATE TABLE IF NOT EXISTS licitacion (
id INT NOT NULL AUTO_INCREMENT,
codigo VARCHAR(25) NOT NULL,
nombre VARCHAR(125) NOT NULL,
descripc... |
-- phpMyAdmin SQL Dump
-- version 4.2.12deb2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 24, 2015 at 03:17 PM
-- Server version: 10.0.20-MariaDB-0+deb8u1
-- PHP Version: 5.6.9-0+deb8u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLI... |
-- Fix til fejl introduceret ved migrering til 1.13.0.. (KIH-986)
update questionnaire_group2questionnaire_header
set standard_schedule_intro_period_weeks = null
where STANDARD_SCHEDULE_TIMES_OF_DAY is null
and STANDARD_SCHEDULE_WEEKDAYS is null
and STANDARD_SCHEDULE_WEEKDAYS_INTRO_PERIOD is null
and STANDARD_SCHEDULE_... |
<filename>packages/utility-scripts/query_implants.sql
SELECT
COUNT(*),
json_array_elements(implants) ->> 'id' AS id
FROM "sr2020-character"
GROUP BY
id
|
<reponame>Sanskar95/cms
--
-- Database: `sastix_cms`
--
-- --------------------------------------------------------
--
-- Table structure for table `resource`
--
DROP TABLE IF EXISTS `resource`;
CREATE TABLE IF NOT EXISTS `resource` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`author` varchar(255) NOT NULL,
`media... |
-- @testpoint:opengauss关键字formatter(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists formatter;
create database formatter;
drop database formatter;
--关键字带双引号-成功
drop database if exists "formatter";
create database "formatter";
drop database "formatter";
--关键字带单引号-合理报错
drop database if exists 'formatter';
create dat... |
CREATE TABLE NOTE (
NOTE_ID IDENTITY,
TITLE VARCHAR(40) NOT NULL,
NOTE VARCHAR(200) ,
CREATED DATETIME NOT NULL,
PRIMARY KEY (NOTE_ID)
);
INSERT INTO NOTE (TITLE , NOTE , CREATED) VALUES ('ももたろう' , 'だんごで どうぶつを つる', '2016-07-25 15:48:00.0');
INSERT INTO NOTE (TITLE , NOTE , CREATED)... |
<filename>sensasiq.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 12, 2019 at 06:30 AM
-- Server version: 10.3.15-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zo... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 01, 2020 at 02:22 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
/*
MIT License
Copyright (c) 2021 Algoritmed
cdret2gen v.1.0
Schema - gen of coding, decoding, regulation and expression, also translation & transcription.
Meta-content-relation DB schema.
Схема - ген кодування, декодування, регулювання та експресії, а також трансляція та транскрипція.
Мета-контентно-реляційна схем... |
INSERT INTO `s_order` (`id`, `ordernumber`, `userID`, `invoice_amount`, `invoice_amount_net`, `invoice_shipping`, `invoice_shipping_net`, `invoice_shipping_tax_rate`, `ordertime`, `status`, `cleared`, `paymentID`, `transactionID`, `comment`, `customercomment`, `internalcomment`, `net`, `taxfree`, `partnerID`, `temporar... |
<reponame>emilianolopezn/patronmvc2020
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Apr 24, 2020 at 08:24 PM
-- Server version: 5.7.23
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `misi... |
CREATE SCHEMA myschema;
DROP DATABASE IF EXISTS todos;
CREATE DATABASE todos;
CREATE TABLE IF NOT EXISTS "snapTodos"(
"id" int NOT NULL GENERATED ALWAYS AS IDENTITY,
"item" varchar(100) NOT NULL,
"completed" BOOL DEFAULT 'f'
);
-- ALTER TABLE public."snapTodos"
-- ADD COLUMN completed_at TIMESTAMP WITH TIME Z... |
<filename>database_backup/social_accounts.sql
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 23, 2016 at 08:12 PM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- phpMyAdmin SQL Dump
-- version 4.4.15.5
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1:3306
-- Время создания: Апр 29 2016 г., 18:01
-- Версия сервера: 5.5.48
-- Версия PHP: 5.3.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 3.4.10.1deb1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: 12/08/2015 às 16h55min
-- Versão do Servidor: 5.6.25
-- Versão do PHP: 5.5.27-1+deb.sury.org~precise+1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @O... |
CREATE PROCEDURE dbo.WebTheme_Get
(
@Id int = -1,
@TemplateId int = -2
)
AS
SET NOCOUNT ON
SELECT Id, Name, TemplateId, ParentId, [Identity], SkinId
FROM WebTheme
WHERE (@Id = -1 OR Id = @Id)
AND (@TemplateId=-2 OR TemplateId=@TemplateId)
ORDER BY [Name]
RETURN |
alter table avtale_innhold add column har_familietilknytning boolean;
alter table avtale_innhold add column familietilknytning_forklaring varchar;
|
<reponame>jdkoren/sqlite-parser
-- tkt3718.test
--
-- execsql {
-- DELETE FROM t2 WHERE a > 5;
-- BEGIN;
-- INSERT INTO t2 SELECT a+5, sql(a==3,
-- 'INSERT INTO t2 SELECT a+10, f2(b) FROM t1'
-- ) FROM t1;
-- }
DELETE FROM t2 WHERE a > 5;
BEGIN;
INSERT INTO t2 SELECT a+5, sql(a==3,
'INSERT INTO... |
<filename>AvailableSoftware/Database/SQL/software_platform/software_platform.sql
--
-- Table structure for table `software_platform`
--
CREATE TABLE `software_platform` (
`soft_plat_id` int NOT NULL,
`os_id` int NOT NULL,
`soft_id` int NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
... |
BEGIN;
CREATE OR REPLACE FUNCTION timecard__get(id int) RETURNS jcitems
LANGUAGE SQL AS
$$ SELECT * FROM jcitems WHERE id = $1; $$;
CREATE OR REPLACE FUNCTION timecard__save
(in_id int,
in_business_unit_id int,
in_parts_id int,
in_description text,
in_qty numeric,
in_allocated numeric,
in_sellprice NUMERI... |
<reponame>anubra266/codebase
--! Previous: sha1:bc8dcdf1ff7879bc5825faac8c639a7df627a1ed
--! Hash: sha1:bf1f38bd234d8294e7e74db54643bd609666912f
-- Enter migration here
DROP FUNCTION IF EXISTS create_relationship;
CREATE OR REPLACE FUNCTION create_relationship(relationship TEXT, from_id UUID, from_type TEXT, to_id UU... |
<gh_stars>0
#standardSQL
declare level_of_accuracy string default '';
set level_of_accuracy = 'relaxed';
create temporary function strMatchRate(str1 STRING, str2 string, type string, accuracy string) returns FLOAT64
language js as \"\"\"
return scoreMatchFor(str1, str2, type, accuracy)
\"\"\"
OPTIONS (
library=['gs://j... |
<gh_stars>1-10
select player_id, min(event_date) as first_login
from activity
group by player_id |
<gh_stars>1-10
update forms set version='0.13.5' where 1=1;
|
-- -------------------------------------------------------------------------------------------------
-- CREATE SCHEMAS
-- -------------------------------------------------------------------------------------------------
CREATE SCHEMA demo;
-- ---------------------------------------------------------------------------... |
<filename>src/main/resources/database/mysql/alter_14_2_x_to_14_2_16.sql
-- Forum
alter table o_message add column modification_date datetime;
|
/*
RETURN SourceConfig
ID VARCHAR(36) NOT
Address NVARCHAR(100) NOT
Source NVARCHAR(30) NOT
Port NVARCHAR(30) NOT
*/
DROP PROCEDURE IF EXISTS `GetSourceInsByJobID`;
CREATE PROCEDURE `GetSourceInsByJobID` (inJob INT... |
DROP TABLE IF EXISTS test;
DROP TABLE IF EXISTS test_view;
CREATE TABLE test(date Date, id Int8, name String, value Int64) ENGINE = MergeTree(date, (id, date), 8192);
CREATE VIEW test_view AS SELECT * FROM test;
SET enable_optimize_predicate_expression = 1;
-- Optimize predicate expression with view
EXPLAIN SYNTAX S... |
<gh_stars>100-1000
select
tests.server,set,script,scale,tests.test,clients,round(tps) as tps,
checkpoints_timed+checkpoints_req as chkpts,
buffers_checkpoint as buf_check,
buffers_clean as buf_clean,
buffers_backend as buf_backend,
buffers_alloc as buf_alloc,
buffers_backend_fsync as backend_sync,
max_... |
CREATE DATABASE `%s`
|
<gh_stars>0
create extension btree_gin;
-- should match SendMethod
CREATE TYPE SEND_METHODS AS ENUM ('email-mandrill', 'email-ses', 'email-test', 'sms-messagebird', 'sms-test');
-- { companies
CREATE TABLE companies (
id SERIAL PRIMARY KEY,
code VARCHAR(63) NOT NULL UNIQUE
);
-- } companies
CREATE TABLE message_... |
CREATE LOGIN [PythonScript]
WITH PASSWORD = N'|<PASSWORD>', SID = 0xF48D0C0F2F5FCF499FB860ACB99484EB, DEFAULT_LANGUAGE = [us_english];
|
CREATE DOMAIN authorC_ AS VARCHAR CHECK (VALUE ~'^[A-Z] {3} [0-9] {4}$');
CREATE TYPE Styles AS ENUM ('grecoRoman','neoClassic','Cubism');
CREATE TABLE atwork (
code int UNIQUE,
title text,
dated date,
style Styles,
author authorCode
);
CREATE TABLE author (
code authorC_,
name text,
nati... |
<gh_stars>0
CREATE FUNCTION dbo.udf_GetColonistsCount(@PlanetName VARCHAR(30))
RETURNS INT
BEGIN
DECLARE @ColonistsCount INT =
(SELECT COUNT(tc.ColonistId) AS Count
FROM Planets p
JOIN Spaceports s
ON s.PlanetId = p.Id
JOIN Journeys j
ON j.DestinationSpaceportId = s.Id
JOIN Tra... |
<filename>3. Subqueries/ships.sql
USE ships;
-- 1
SELECT DISTINCT(c.COUNTRY) FROM CLASSES AS c
WHERE c.NUMGUNS = (SELECT TOP 1 c1.NUMGUNS FROM CLASSES AS c1
ORDER BY c1.NUMGUNS DESC);
-- 2
SELECT DISTINCT(c.CLASS) FROM CLASSES AS c
JOIN SHIPS AS s
ON s.CLASS = c.CLASS
JOIN OUTCOMES AS o
ON o.SHIP = s.NA... |
<gh_stars>0
CREATE TABLE tblclientelembrete(
id bigint not null,
id_cliente bigint not null REFERENCES tblcliente(id),
id_tipo_lembrete bigint not null REFERENCES tbllembretetipo(id),
data_evento date not null,
observacoes varchar(255),
data_criacao timestamp(0) not null,
data_atualizacao ti... |
-- +goose Up
-- SQL in this section is executed when the migration is applied.
ALTER TABLE `standup` ADD `channel` VARCHAR (255) NOT NULL;
-- +goose Down
-- SQL in this section is executed when the migration is rolled back.
ALTER TABLE `standup` DROP `channel`; |
<filename>17_intro_bd/sql/script.sql<gh_stars>1-10
CREATE DATABASE `alunos`;
use alunos;
CREATE TABLE `dados`(
`id` INT AUTO_INCREMENT,
`nome` VARCHAR(45) NOT NULL,
`nota` DOUBLE NOT NULL
);
INSERT INTO `dados` values
(NULL, "<NAME>", 7.45),
(NULL, "<NAME>", 6),
(NULL, "<NAME>", 9.6),
(NULL, "<NAME>", 4.5),... |
<gh_stars>1-10
DROP TABLE IF EXISTS scores;
DROP TABLE IF EXISTS users;
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_... |
<filename>docker/db_setup/workflow.sql
\c postgres;
CREATE SCHEMA workflow;
|
ALTER TABLE `driver_info` CHANGE COLUMN `down_to_help_out` `notes_to_driver` text DEFAULT NULL;
ALTER TABLE `driver_info` ADD `down_to_help_out` INT(1) NOT NULL DEFAULT 0; |
--RASTEL CRON PROCESSOR v1.0 - 2022-01-02 - Geotemporal correlation procedure
DROP PROCEDURE IF EXISTS rastel_flag;
DELIMITER //
CREATE PROCEDURE rastel_flag(
IN time_resolution unsigned unsigned int,
IN close_contact_time_min unsigned int,
IN close_contact_time_max unsigned int,
IN infectious_period un... |
<filename>src/plsql/flow_plsql_runner_pkg.pkb
create or replace package body flow_plsql_runner_pkg
as
g_current_prcs_id flow_processes.prcs_id%type;
g_current_sbfl_id flow_subflows.sbfl_id%type;
procedure init_globals
(
pi_prcs_id in flow_processes.prcs_id%type
, pi_sbfl_id in flow_subflows.sbf... |
<reponame>Shuttl-Tech/antlr_psql
-- file:truncate.sql ln:63 expect:true
INSERT INTO truncate_a VALUES (1)
|
-- file:rowsecurity.sql ln:226 expect:true
SELECT * FROM category
|
<gh_stars>10-100
select sum(lo_extendedprice*lo_discount) from lineorder, dwdate where lo_orderdate = d_datekey and d_year = 1993 and lo_discount>=1 and lo_discount<=3 and lo_quantity < 25;
select sum(lo_extendedprice*lo_discount) from lineorder, dwdate where lo_orderdate = d_datekey and d_yearmonthnum = 199401 and lo... |
create table departments(
dept_no VARCHAR not NULL,
dept_name VARCHAR not NULL
);
select * from departments;
create table dept_emp(
emp_no INT not NULL,
dept_no VARCHAR not NULL
);
select * from dept_emp;
create table dept_manager(
dept_no VARCHAR not NULL,
emp_no INT not NULL
);
select * from dept_manager;
... |
START TRANSACTION;
INSERT INTO `fields` VALUES (NULL, 'btnAddCalendar', 'backend', 'Button / + Add calendar', 'script', '2016-12-09 06:23:06');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `multi_lang` VALUES (NULL, @id, 'pjField', '::LOCALE::', 'title', '+ Add calendar', 'script');
INSERT INTO `fields` VALUE... |
-- cleanup
DELETE FROM txt;
-- import
INSERT INTO txt VALUES ('initial_import', 'German', 'Dieses Element ist Teil der initial importierten Konfiguration.');
INSERT INTO txt VALUES ('initial_import', 'English', 'This entity is part of the initially imported configuration.');
-- languages
INSERT INTO txt VALUES ('... |
<reponame>NithinKuruba/wfs-war<filename>analytics.sql
ALTER USER `wfs` IDENTIFIED WITH mysql_native_password BY '<PASSWORD>';
CREATE TABLE `auditlog` (
`id` INT AUTO_INCREMENT PRIMARY KEY,
`url` TEXT NOT NULL
);
|
<filename>sql/m3n3/scm_how_to_direction.sql
CREATE TABLE scm_how_to_direction(
seq BIGINT AUTO_INCREMENT PRIMARY KEY,
/**
* type: org.kyojo.schemaorg.m3n3.core.Container$AdditionalType
* param: org.kyojo.schemaorg.m3n3.core.Clazz$URL
*/
additional_type VARCHAR(100) NULL,
/**
* type: org.kyojo.schemaorg.... |
<reponame>PInfo-2020/PInfo-2<filename>docker-compose/test-data/users.sql
--CREATE USER usr WITH PASSWORD '<PASSWORD>';
--drop table if exists AUser;
--drop sequence if exists USER_SEQ;
create sequence IF NOT EXISTS USER_SEQ start with 1 increment by 50;
CREATE TABLE IF NOT EXISTS AUser (
id bigint not null,
nam... |
<reponame>parshuramreddysudda/InterviewPreparation
select * from salesman
where NOT(city = "New York" or Grade > 100); |
select * from scada2
where temperaturef > 89
SELECT scada2.uuid, scada2.systemtime, scada2.temperaturef, scada2.pressure, scada2.humidity, scada2.lux, scada2.proximity,
scada2.oxidising,scada2.reducing , scada2.nh3, scada2.gasKO,energy2.`current`,
energy2.voltage,energy2.`power`,energy2.`total`,ene... |
<filename>agents/postgres/parser/testdata/query005.sql
select n1.name, n1.author_id, count_1, total_count
from (select id, name, author_id, count(1) as count_1
from names
group by id, name, author_id) n1
inner join (select id, author_id, count(1) as total_count
from names
group by id, au... |
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
DROP KEY `key_draft`;
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
ADD KEY `key_changeset` (changesetID);
ALTER TABLE {$NAMESPACE}_differential.differential_transaction_comment
ADD KEY `key_draft` (authorPHID, trans... |
<filename>doc/yii2_channel.sql<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : 192.168.127.12
Source Server Version : 50720
Source Host : 192.168.127.12:3306
Source Database : message_www
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date:... |
<gh_stars>10-100
select name, tbl_name from SQLITE_MASTER where type like 'view' order by name, tbl_name |
# tblFerroviaModeloVagao
#
# DESC: Tabela de armazenamento dos modelos dos vagões das ferrovias
# TODO: -
# NOTES: -
#
DROP TABLE IF EXISTS tblFerroviaModeloVagao;
CREATE TABLE tblFerroviaModeloVagao (
CodFerroviaModeloVagao INT(8) NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT 'Código de indexação',
ModeloSigo... |
<filename>hasura/migrations/1589487716879_alter_table_public_facility_add_column_facility_status/up.sql
ALTER TABLE "public"."facility" ADD COLUMN "facility_status" text NOT NULL;
|
<reponame>SQLAdrian/MadeiraToolbox<gh_stars>0
/*
Author: <NAME> (t: @EitanBlumin | b: https://eitanblumin.com)
Date Created: 2021-04-22
Description:
Multi-Line Table Function to generate periods for time series, based on a range and period type.
Supported period types:
MI - Minute
H - Hour
D - Day
W - Week
M - M... |
<filename>resources/migrations/20190819100206_add_status_field.sql
-- Task 2: A user is able to mark an item as done
ALTER TABLE `todos` ADD `status` enum('pending','done') NOT NULL DEFAULT 'pending';
|
<gh_stars>0
ALTER TABLE `plataforma`
CHANGE `memoria` `memoria` BIGINT;
-- -----------------------------------------------------
-- Table `trabalhobd`.`horas_jogadas`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `trabalhobd`.`horas_jogadas` (
`idjogo` INT NOT NULL,
`idpl... |
BEGIN TRANSACTION;
DROP TABLE IF EXISTS `players`;
CREATE TABLE IF NOT EXISTS `players` (
`ID` INTEGER NOT NULL,
`name` TEXT,
`score` INTEGER,
`games_played` INTEGER,
`provisional` INTEGER
);
DROP TABLE IF EXISTS `games`;
CREATE TABLE IF NOT EXISTS `games` (
`ID` INTEGER NOT NULL,
`WHITE` INTEGER,
`BLACK` INTEG... |
<reponame>OElabed/vagrant-development-tools
-- the password hash is generated by BCrypt Calculator Generator(https://www.dailycred.com/article/bcrypt-calculator)
INSERT INTO USER (ID, LOGIN, PASSWORD, FIRST_NAME, LAST_NAME, LOCKED, ENABLE, EXPIRE_DATE) VALUES (1, 'user', <PASSWORD>kw<PASSWORD>', 'Fan', 'Jin', 0, 1, TO... |
create table IF NOT EXISTS messaging
(
message_id INTEGER not null
primary key autoincrement,
sender TEXT,
recipient int,
message TEXT,
dateSubmitted DATETIME
); |
--
-- Dumping data for table `generos`
--
INSERT INTO `generos` (`id`, `name`, `description`) VALUES
(1, 'Femenino', NULL),
(2, 'No Sabe/no Informa/ No Aplica', NULL),
(3, 'Masculino', NULL),
(4, 'No Sabe / No Informa / No Aplica', NULL),
(5, 'Otro', NULL),
(6, 'Transgenerista', NULL);
|
<filename>BD/Error.sql
DELIMITER //
CREATE PROCEDURE `Error` (IN `mensaje` TEXT)
BEGIN
signal sqlstate '23000' set
mysql_errno = 1452,
message_text = mensaje;
END
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 30, 2020 at 05:44 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<filename>22-07-19 a 26-07-19/Sql/SQLQuery9-FoodTruck.sql
select 'MediaVenda' as 'MediaVenda',
SUM(Temp.Media) as 'Vendas',
Temp.MesVenda
from (select
DogCasa,
DogEgg,
DogSoya
(SUM(TotalVendas) / COUNT(*)) as 'Medias',
YEAR(DataVenda) as 'MesVenda'
from FoodTruckZezinho
group by TotalVendas,YEAR(Data... |
<filename>schema.sql
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Хост: db
-- Время создания: Май 16 2019 г., 14:46
-- Версия сервера: 8.0.13
-- Версия PHP: 7.2.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>HofmannZ/global-ai-hackathon--truth-coin<filename>src/query/bq_reddit.sql
SELECT
created_utc,
id,
parent_id,
body,
name,
author,
author_flair_text,
downs,
ups,
score,
controversiality,
gilded,
subreddit,
link_id
FROM
[fh-bigquery.reddit_comments.2014]
WHERE
subreddit IN ('Bitco... |
SELECT TOP(1) WITH TIES
cn.[Name] AS CountryName,
AVG(f.Rate) AS FeedbackRate
FROM Feedbacks AS f
JOIN Customers AS cu ON cu.Id = f.CustomerId
JOIN Countries AS cn ON cn.Id = cu.CountryId
GROUP BY cn.Name
ORDER BY AVG(f.Rate) DESC |
<gh_stars>1-10
SET search_path = "theta_plus";
----------- imm1985 ----------------
ALTER TABLE imm1985_all_merged_graclus
ADD COLUMN num_authors BIGINT,
ADD COLUMN max_author_count BIGINT;
UPDATE imm1985_all_merged_graclus
SET num_authors = authors.num_authors
FROM (SELECT elu.cluster_no, count(DISTINCT sa.auid) as ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.