sql stringlengths 6 1.05M |
|---|
<reponame>croxis/allegiance2<gh_stars>0
# No stack trace on assertion
assert-abort #f
# File system should be case sensitive
vfs-case-sensitive #t
# Animations on the gpu
# hardware-animated-vertices #t
# Show error on dll loading
# show-dll-error-dialog #t
# Trying this for performance
# uniquify-matrix #f
# Gar... |
-- --------------------------------------------------------
-- Host: localhost
-- Versi server: 5.5.27 - MySQL Community Server (GPL)
-- OS Server: Win32
-- HeidiSQL Versi: 9.3.0.4984
-- --------------------------------------------------------
/*... |
--------------------------------------------------------------------------------
-- Initialization --------------------------------------------------------------
--------------------------------------------------------------------------------
----------------------------------------------------------------------------... |
<filename>storage/database/geonames/countries/sj.sql
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: laraclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 ... |
DROP TABLE IF EXISTS employees;
DROP TABLE IF EXISTS roles;
DROP TABLE IF EXISTS departments;
CREATE TABLE departments (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(45) NULL,
PRIMARY KEY (id)
);
CREATE TABLE roles (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(45) NULL,
salary DECIMAL(10.3) NULL,
depa... |
<reponame>huda-manarul/Smartcity-web
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 24, 2018 at 07:58 AM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time... |
<filename>C#/C# DB/DataBases Basics/09. EXAMS/20 Oct 2019/06. Reports & Categories.sql
SELECT r.[Description], c.[Name] AS [CategoryName]
FROM Reports AS r
JOIN Categories AS c
ON r.CategoryId = c.Id
ORDER BY [Description] ASC, [CategoryName] ASC
|
<reponame>ZiBuDo/WellsFargoAnalytics
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 27, 2016 at 05:32 PM
-- Server version: 5.5.52-0ubuntu0.14.04.1-log
-- PHP Version: 5.5.9-1ubuntu4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00... |
IF OBJECT_ID(N'[__EFMigrationsHistory]') IS NULL
BEGIN
CREATE TABLE [__EFMigrationsHistory] (
[MigrationId] nvarchar(150) NOT NULL,
[ProductVersion] nvarchar(32) NOT NULL,
CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId])
);
END;
GO
CREATE TABLE [Genres] (
[Id] int... |
<reponame>VinsonSun/CS323-Compilers<gh_stars>0
int test5() {
int a = 1.1;
float b = 2;
}
|
-- Code is reviewed and is in working condition
-- Exercise: Creating contained database users for Azure AD authentication.
-- Execute in toystore database
--Create a contained database user (SQL Authentication)
CREATE USER Mike WITH PASSWORD='<PASSWORD>'
GO
-- Make Mike toystore database ownner
ALTER ROLE d... |
SELECT --CASE
-- WHEN [N].Caption IS NULL THEN [E].ServerName
-- ELSE CONCAT('<a href="', [N].DetailsUrl, '">', [N].[Caption], '</a>')
-- END AS [Caption]
[N].Caption
, [E].ServerType
, [N].DetailsUrl AS [_LinkFor_Capt... |
<gh_stars>1-10
-- Data with Danny - 8 Week Challenge
-- Week 2
-- https://8weeksqlchallenge.com/case-study-2/
-- SQL Flavor: PostgreSQL
-- PART II. RUNNER AND CUSTOMER EXPERIENCE
--QUESTIONS
--1. How many runners signed up for each 1 week period? (i.e. week starts 2021-01-01)
--2. What was the average time in minute... |
<gh_stars>1-10
/************** Recuperar algunos registros (where) ************/
if object_id('usuarios') is not null
drop table usuarios;
create table usuarios (
nombre varchar(30),
clave varchar(10)
);
go
exec sp_columns usuarios;
insert into usuarios (nombre, clave)
values ('Marcelo','Boca');
insert in... |
<filename>sql/queries/ringsize_comparison.sql
\timing on
\set name ringsize_comparison
-- \set granularity day
-- quoted granularity
-- \set q_granularity '''' :granularity ''''
DROP TABLE IF EXISTS :name;
CREATE TABLE :name AS (
select ringsize,effective_ringsize as effective, count(*)
from txi
group by 1,2 order ... |
Select *
FROM stagingDistributionGroup
WHERE SourceOrganization IN (SELECT [Name]
FROM [configurationOrganization]
WHERE MigrationRole = 'Target') |
CREATE TABLE Broker (
id UUID PRIMARY KEY,
version INT NOT NULL,
created_at TIMESTAMP NOT NULL,
modified_at TIMESTAMP NOT NULL,
comment varchar(4096) NOT NULL,
company_name varchar(255) NOT NULL,
first_name varchar(255) NOT NULL,
last_name varchar(255) NOT NULL,
email ... |
-- temptable.test
--
-- execsql {INSERT INTO t1 VALUES(1,2,3);}
INSERT INTO t1 VALUES(1,2,3); |
CREATE TABLE IF NOT EXISTS membership.communication
(
id SERIAL PRIMARY KEY,
name text NOT NULL UNIQUE,
subject text NOT NULL,
frequency_throttle numeric NOT NULL CHECK (frequency_throttle >= 0),
template text NOT NULL
);
CREATE TABLE IF NOT EXISTS membership.communication_log
(
id BIGSERIAL PR... |
<filename>backend/de.metas.fresh/de.metas.fresh.base/src/main/sql/postgresql/system/75-de.metas.fresh.reports/5451545_sys_FRESH-668_update_docs_sales_inout_details_sum.sql
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_InOut_Details_Sum ( IN Record_ID numeric );
DROP TABLE IF EXISTS de_metas_endc... |
<reponame>Victor-Y-Fadeev/Learning
CREATE TABLE Chessmen (
cid INT PRIMARY KEY
, type CHAR(6) CHECK (type IN ('king', 'queen', 'rook', 'bishop', 'knight', 'pawn'))
, color CHAR(5) CHECK (color IN ('black', 'white')));
CREATE TABLE Chessboard (
x CHAR CHECK (x LIKE '[A-H]')
, y INT CHECK (y > 0 and y < 9)
, cid INT UNI... |
<filename>cnprc_ehr/resources/queries/study/CaseManagement.sql<gh_stars>0
/*
* Copyright (c) 2017-2018 LabKey Corporation
*
* 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:/... |
<reponame>TimNapierVST/dbtvault-dev
{{ dbtvault.alias(alias_config=var('alias_config'), prefix=var('prefix')) }} |
<gh_stars>0
INSERT INTO permissao values(1,'ROLE_CADASTRAR_CIDADE');
INSERT INTO permissao values(2,'ROLE_CADASTRAR_USUARIO');
INSERT INTO grupo_permissao (codigo_grupo, codigo_permissao) values(1,1);
INSERT INTO grupo_permissao (codigo_grupo, codigo_permissao) values(1,2);
INSERT INTO usuario_grupo(codigo_usuario, c... |
<reponame>MCZbase/DDL<gh_stars>1-10
CREATE TABLE "LEDGERSCANS_MASTER"
( "DEPARTMENT" VARCHAR2(255),
"COLLECTION" VARCHAR2(255),
"VOLUMENAME" VARCHAR2(255),
"VOLUMETYPE" VARCHAR2(255),
"VOLUMEPAGE" NUMBER(22,0),
"STARTNUM" NUMBER(22,0),
"ENDNUM" NUMBER(22,0),
"CATNUMS" VARCHAR2(4000),
"FILENAME" V... |
<reponame>utamori/pg_graphql<filename>test/sql/resolve_connection_last_before.sql
select jsonb_pretty(
gql.resolve($$
{
allAccounts(last: 2, before: "<KEY> {
edges {
node {
nodeId
id
}
}
}
}
$... |
-------------------------------------------------------------------------------
--
-- PLEASE NOTE
--
-- No warranty, no liability, no support.
--
-- This script is 100% at your own risk to use.
--
-------------------------------------------------------------------------------
set pages 0
set heading off
spool /tmp/xxx... |
<filename>.erda/migrations/ops/20210528-ops-base.sql<gh_stars>1000+
-- MIGRATION_BASE
CREATE TABLE `cloud_resource_routing`
(
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`resource_id` varchar(12... |
CREATE TABLE movies (
mid integer PRIMARY KEY,
title varchar(255) NOT NULL,
year integer NOT NULL,
rating real,
num_ratings integer
);
CREATE TABLE actors (
mid integer NOT NULL,
name varchar(255) NOT NULL,
cast_position integer NOT NULL,
FOREIGN KEY (mid) REFERENCES movies (mid) ON DELETE CASCADE
);... |
SELECT Id, NAME
FROM Cities
WHERE CountryCode = 'BG'
ORDER BY NAME |
<gh_stars>0
CREATE DATABASE IF NOT EXISTS `ezira`;
USE `ezira`;
DROP TABLE IF EXISTS `users`;
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` text NOT NULL,
`password` text NOT NULL,
`admin` tinyint(1) NOT NULL,
`banned` tinyint(1) NOT NULL,
`premium` tinyint(1) NOT N... |
--Select
-- Count(*)
--from
-- vImportBatchSummary
-- inner join Observation
-- on (Observation.ImportBatchID = vImportBatchSummary.ImportBatchID) and
-- (Observation.SensorID = vImportBatchSummary.SensorID) and
-- (Observation.PhenomenonOfferingID = vImportBatchSummary.PhenomenonOfferingID) and
-- (Obse... |
<reponame>shelkelly/Employee-Manager
-- Insert a set of records.
SELECT * FROM department;
SELECT * FROM role;
SELECT * FROM employee;
INSERT INTO department (name)
VALUES ('Management');
INSERT INTO role (title, salary, department_id)
VALUES ('Store Manager', '80000', '5');
INSERT INTO... |
<filename>php_ci.sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 16 Apr 2020 pada 14.44
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
<gh_stars>0
-- Inicio DDL
CREATE DATABASE T_People;
USE T_People;
CREATE TABLE Funcionarios
(
IdFuncionarios INT PRIMARY KEY IDENTITY
,Nome VARCHAR(250) NOT NULL
,Sobrenome VARCHAR(250) NOT NULL
);
-- Fim DDL |
<reponame>RollingSoftware/L2J_HighFive_Hardcore<gh_stars>0
UPDATE character_quests SET name='Q00235_MimirsElixir' WHERE name='235_MimirsElixir';
INSERT IGNORE INTO global_variables (`var`, `value`) VALUES ('nextTWStartDate', (SELECT `value` FROM quest_global_data WHERE var = "nextTWStartDate")); |
<filename>Backend/DB/makeDB.sql<gh_stars>0
-- sudo mysql -u root -p < makeDB.sql
CREATE DATABASE IF NOT EXISTS CDCP_DB;
USE CDCP_DB;
CREATE TABLE IF NOT EXISTS Users (id VARCHAR(36) PRIMARY KEY, nickname VARCHAR(25) UNIQUE, email VARCHAR(50), password VARCHAR(255), registrationDate DATETIME);
CREATE TABLE IF NOT EXI... |
use [corso_tsql-abletech]
declare @id int
, @nome varchar(50)
, @cognome varchar(50)
-- definizione di un cursore
declare cursore cursor for
SELECT
[id]
,[nome]
,[cognome]
FROM
[dbo].[persone]
open cursore
fetch next from cursore
into @id, @nome, @cognome
print @@fetch_status
while(@@fe... |
-- Revert primer_position_search
SET search_path TO viroserve;
BEGIN;
ALTER TABLE primer ADD COLUMN some_number INTEGER;
DROP FUNCTION refresh_primer_search();
DROP MATERIALIZED VIEW primer_search;
COMMIT;
|
<reponame>Fdisla1608/Free_Lancer<gh_stars>10-100
-- phpMyAdmin SQL Dump
-- version 3.3.7deb7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: May 08, 2012 at 07:14 PM
-- Server version: 5.1.61
-- PHP Version: 5.3.3-7+squeeze8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET... |
CREATE TABLE IF NOT EXISTS fileresources_video (
duration int -- (in seconds)
) INHERITS (fileresources);
|
<reponame>Zorin95670/octo-spy
-- Ensure repeatable migration is really repeated on every start
-- ${flyway:timestamp}
DROP VIEW IF EXISTS projects_view;
CREATE VIEW projects_view AS
SELECT
projects.pro_id AS "pro_id",
projects.name AS "name",
COALE... |
-- file:date.sql ln:268 expect:true
SELECT EXTRACT(CENTURY FROM INTERVAL '99 y')
|
-- file:privileges.sql ln:424 expect:true
GRANT SELECT(fy,oid) ON atestc TO regress_user2
|
<gh_stars>10-100
SELECT
tumor_pair_barcode,
tumor_barcode_a,
tumor_barcode_b,
ss.case_barcode,
idh_codel_subtype,
a1.prop_aneuploidy AS aneuploidy_a,
a2.prop_aneuploidy AS aneuploidy_b,
a1.aneuploidy_amp_score::integer AS aneuploidy_amp_score_a,
a2.aneuploidy_amp_score::integer AS aneuploidy_amp_score_b,
a1.a... |
-- 2010-09-22 <NAME> (Microsoft) <EMAIL> (http://aka.ms/sqlinsights)
--
-- 2013-12-03 Fixed divide by zero error
--
-- Recomends type of compression per object - all more trustworthy as instance uptime increases.
--
-- [Percent_Update]
-- The percentage of update operations on a specific table, index, or partition, rel... |
<reponame>manikanth/sql-server-samples
CREATE PROCEDURE [WebApi].[InsertSuppliersFromJson](@Suppliers NVARCHAR(MAX), @UserID int)
WITH EXECUTE AS OWNER
AS BEGIN
INSERT INTO Purchasing.Suppliers(SupplierName,SupplierCategoryID,PrimaryContactPersonID,AlternateContactPersonID,DeliveryMethodID,DeliveryCityID,PostalCityID... |
<gh_stars>1000+
-- 2018-06-28T17:10:56.022
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,IsActive,CreatedBy,PrintName,EntityType,ColumnName,AD_Element_ID,AD_Org_ID,Name,UpdatedBy,Created,Updated) VALUES (0,'Y',100,'Konst. Zusagbar (ATP) Wert','de.metas.vertical.p... |
create table milli_piyango_result (
oid varchar(16) primary key,
lottery_date date unique not null,
lottery_number int not null,
winner_city varchar(32) null,
lottery_type varchar(32) not null,
numbers varchar(32) not null,
numbers_ordered varchar(32) not null,
is_carried_over boolean no... |
<filename>inst/sql/PullUpConceptNames.sql
SELECT concept_name,
concept_id
FROM @cdmDatabaseSchema.concept
WHERE concept_id IN (@covariateIds)
|
CREATE TABLE "LTHUSER".oldnametable (test_id INTEGER NOT NULL, test_column VARCHAR(50) NOT NULL, CONSTRAINT PK_OLDNAMETABLE PRIMARY KEY (test_id))
RENAME "LTHUSER".oldnametable TO newnametable |
select count(1) from cliente where cedula = :cedula |
DROP FUNCTION IF EXISTS inventory.get_item_id_by_item_code(_item_code text);
CREATE FUNCTION inventory.get_item_id_by_item_code(_item_code text)
RETURNS integer
AS
$$
BEGIN
RETURN item_id
FROM inventory.items
WHERE inventory.items.item_code = _item_code
AND NOT inventory.items.deleted;
END
$$... |
DROP VIEW IF EXISTS finance.journal_verification_policy_scrud_view;
CREATE VIEW finance.journal_verification_policy_scrud_view
AS
SELECT
finance.journal_verification_policy.journal_verification_policy_id,
finance.journal_verification_policy.user_id,
account.get_name_by_user_id(finance.journal_verificatio... |
DROP TABLE IF EXISTS view_no_nulls;
DROP TABLE IF EXISTS view_no_nulls_set;
DROP TABLE IF EXISTS view_nulls_set;
DROP TABLE IF EXISTS view_nulls;
SET join_use_nulls = 0;
CREATE OR REPLACE VIEW view_no_nulls AS
SELECT * FROM ( SELECT number + 1 AS a, number + 11 AS b FROM numbers(2) ) AS t1
FULL JOIN ( SELECT number +... |
set xact_abort on
declare @HandleTransaction bit = 0
if (@@trancount = 0)
begin
set @HandleTransaction = 1
begin tran
end
update
MachineQueue
set
ManagedThreadId = ManagedThreadId
where
MachineName = @MachineName
and
QueueName = @QueueName
update
[dbo].[{0}]
set
UnacknowledgedHash = @... |
<reponame>dstrack/Schema_Data_Browser
/*
Copyright 2020 <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 re... |
<reponame>clouserw/olympia<filename>migrations/324-more-cascades-for-addons.sql
ALTER TABLE `addon_upsell` DROP FOREIGN KEY `free_id_refs_id_upsell`;
ALTER TABLE `addon_upsell` ADD CONSTRAINT `free_id_refs_id_upsell`
FOREIGN KEY (`free_id`) REFERENCES `addons` (`id`) ON DELETE CASCADE;
ALTER TABLE `addon_upsell` DR... |
--test floor function using numeric tpye as its operand
select floor(-5.5) from db_root;
select floor(0) from db_root;
select floor(5.222) from db_root;
|
<gh_stars>0
DROP DATABASE IF EXISTS tpn_db;
CREATE DATABASE tpn_db; |
<reponame>rchavezriosjr/SkyLineWebPage
CREATE TABLE [#__rsfirewall_ignored] (
[path] text NOT NULL,
[type] varchar(255) NOT NULL
); |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.3.11
-- Generation Time: Dec 14, 2019 at 05:41 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<filename>application/update.sql
ALTER TABLE `user_master` CHANGE `is_add` `is_add` ENUM('No','Yes') CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT 'Yes',
CHANGE `is_change` `is_change` ENUM('No','Yes') CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT 'Yes',
CHANGE `is_delete` `is_delete` ENUM('... |
<reponame>nicusX/event-sourcing-kafka-streams<gh_stars>0
CREATE DATABASE invoices;
CREATE USER 'mysqluser'@'%' IDENTIFIED BY 'secret';
GRANT ALL PRIVILEGES ON invoices.* TO 'mysqluser'@'%';
USE invoices;
CREATE TABLE `invoices` (
`id` VARCHAR(64) NOT NULL,
`version` INT UNSIGNED DEFAULT 0,
`created_at` TIMESTA... |
# Host: 192.168.0.31 (Version: 5.6.17)
# Date: 2017-05-04 13:41:37
# Generator: MySQL-Front 5.3 (Build 4.120)
/*!40101 SET NAMES utf8 */;
SET NAMES utf8;
CREATE DATABASE pscdb
use pscdb
#
# Structure for table "t_itf_adap_quest_scores"
#
CREATE TABLE `t_itf_adap_quest_scores` (
`stud_key` varc... |
CREATE TABLE bad_query AS;
|
<filename>cidb.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 11, 2015 at 06:53 PM
-- Server version: 5.6.14
-- PHP Version: 5.5.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
CREATE SERVICE [czAsyncExecService] ON QUEUE [dbo].[czAsyncExecQueue] ([DEFAULT]) |
<gh_stars>0
create or replace table {{ var.value.database }}.public.customer as
with
today
as
(
select max(o_orderdate) as dt
from {{ var.value.database }}.public.order_detail
),
lifetime
as
(
select
o_custkey,
min(o_orderdate) as first_purchas... |
-- MySQL Script generated by MySQL Workbench
-- Tue 29 Apr 2014 07:18:46 PM MST
-- Model: New Model Version: 1.0
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';
... |
<reponame>tiara05/PretestSEProclub<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 24, 2021 at 02:50 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+0... |
<reponame>tushartushar/dbSmellsData<filename>data/open-source/extracted_sql/adjust_pgbundle.sql
SELECT * FROM pg_available_extension_versions WHERE name ='#{name}' AND installed
SELECT * FROM pg_available_extension_versions WHERE name ='#{name}'
SELECT * FROM pg_available_extension_versions WHERE name ='#{name}' AND ve... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 26, 2018 at 12:14 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
-- Currently being addressed in https://github.com/jOOQ/jOOQ/issues/9132
-- Issue was closed
-- Workaround:
--
-- CREATE TABLE `example` (
-- `example_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
-- `index` int(10) unsigned NOT NULL,
-- PRIMARY KEY (`example_id`)
-- );
--
-- CREATE INDEX `index_idx` ON example (`in... |
<gh_stars>1-10
/*
1.
The first example shows the goal scored by a player with the last name 'Bender'. The * says to list all the columns in the table - a shorter way of saying matchid, teamid, player, gtime
Modify it to show the matchid and player name for all goals scored by Germany. To identify German players, check... |
-- +migrate Up
alter table device
add column mode char(1) not null default 'A';
alter table device
alter column mode drop default;
update device
set mode = 'B'
from
device_profile dp
where
device.device_profile_id = dp.device_profile_id
and dp.supports_class_b;
update device
set mode = 'C'
from
device_... |
<filename>Samples/SQLServer/Sport/Field/SportFieldNull.sql
USE SportFieldNull;
DROP TABLE Sport;
CREATE TABLE Sport
(
Id INTEGER NOT NULL,
Name NVARCHAR(50) NOT NULL,
Name_fi NVARCHAR(50),
Name_de NVARCHAR(50),
Name_fr NVARCHAR(50),
Name_ja NVARCHAR(50),
FieldPlayers INTEGER NOT NULL,
Goalie INTEGER ... |
-- shared.test
--
-- execsql {
-- DROP TRIGGER trig1;
-- }
DROP TRIGGER trig1; |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 22, 2020 at 04:53 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.14
CREATE DATABASE `customer-service-db` COLLATE utf8_bin;
Use customer-service-db;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET A... |
<gh_stars>100-1000
# OJ: https://leetcode.com/problems/triangle-judgement/
# Author: github.com/lzl124631x
SELECT
x, y, z,
CASE
WHEN x + y > z AND x + z > y AND y + z > x THEN 'Yes'
ELSE 'No'
END AS 'triangle'
FROM
triangle |
<reponame>mauirixxx/gwtt
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111... |
<gh_stars>1000+
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_Alternate_InOut_1_Aggregation_Description ( IN Record_ID numeric, IN AD_Language Character Varying (6) );
DROP TABLE IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_Alternate_InOut_1_Aggregation_Description;
CREATE TABLE de_m... |
<gh_stars>10-100
DELETE FROM `creature_loot_template` WHERE (`entry`=40372);
INSERT INTO `creature_loot_template` VALUES
(40372, 17058, 31, 8, 1, 1, 1),
(40372, 17057, 31, 7, 1, 1, 1),
(40372, 52340, 18, 3, 1, 1, 1),
(40372, 53010, 15, 2, 1, 1, 1),
(40372, 68198, 4, 2, 1, 1, 1),
(40372, 58262, 2, 6, 1, 1, 1),
(40372, 6... |
--4.1
select last_name as "Nazwisko", salary as "Pensja" from employees order by last_name asc
--4.2
select department_name as "Nazwa departamentu", department_id as "ID departamentu" from departments where department_id>200 order by department_name asc, department_id desc
--4.3
select count(employee_id), sum(salary) f... |
<filename>FUNCTIONS/System Information Functions/version().sql
SELECT version();
|
update pipeline_couplings set
deleted = true,
updated = now()
where
pipeline_coupling = $1
|
#standardSQL
# 02_02: % of sites that use @import and @supports.
SELECT
client,
SUM(IF(ENDS_WITH(feature, 'Import'), freq, 0)) AS freq_import,
SUM(IF(ENDS_WITH(feature, 'Supports'), freq, 0)) AS freq_supports,
total,
ROUND(SUM(IF(ENDS_WITH(feature, 'Import'), freq, 0)) * 100 / total, 2) AS pct_import,
ROUND... |
-------------------------------------------------------------------------------
--
-- PLEASE NOTE
--
-- No warranty, no liability, no support.
--
-- This script is 100% at your own risk to use.
--
-------------------------------------------------------------------------------
col text format a120
select line, text
fro... |
-- MySQL dump 10.13 Distrib 5.6.19, for osx10.7 (i386)
--
-- Host: 127.0.0.1 Database: igreeku
-- ------------------------------------------------------
-- Server version 5.6.26
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... |
SELECT pg_terminate_backend(pg_stat_activity.procpid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'wormmine';
|
-- PURGE DES DONNEES BRUTES: DEBUT;
TRUNCATE [PREFIXE]bati;
TRUNCATE [PREFIXE]fanr;
TRUNCATE [PREFIXE]lloc;
TRUNCATE [PREFIXE]nbat;
TRUNCATE [PREFIXE]pdll;
TRUNCATE [PREFIXE]prop;
-- PURGE DES DONNEES BRUTES: FIN;
|
create table ccol(a varchar(20), b as substring(a,1,3))
go
insert into ccol values('hello');
go
select * from ccol;
go
select substring('hello',1,3)
go
select substring(cast('hello' as sys.varchar(5)),1,3)
go
select substring(cast('hello' as sys.char(5)),1,3)
go
select substring(cast('hello' as sys.nvarchar(5)),1,3)
g... |
CREATE TABLE IF NOT EXISTS `kwc_articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` text COLLATE utf8_unicode_ci NOT NULL,
`teaser` text COLLATE utf8_unicode_ci NOT NULL,
`date` date NOT NULL,
`visible` tinyint(4) NOT NULL,
`is_top` tinyint(4) NOT NULL,
`read_required` tinyint(4) NOT NULL,
`vi_nr`... |
<reponame>Zhaojia2019/cubrid-testcases
-- create vclass for created hash partition table,insert data to this class,select data from these partition
create class hash_test(a int auto_increment, b int)
partition by hash(a)
partitions 4;
insert into hash_test(b) values(1);
insert into hash_test(b) values(2);
insert ... |
-- @testpoint: opengauss关键字general(非保留),作为存储过程名,部分测试点合理报错
--关键字不带引号-成功
drop procedure if exists general;
create procedure general(
section number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
select sum(salary), count(*) into salary_sum, staffs_count from staffs where section_id = section;
... |
<filename>db_scripts/jobs/jb_dashboard.sql<gh_stars>0
------------------------------------------------------
-- job: data dashboard
-- custom reporting dashboard definitions export
------------------------------------------------------
copy(select * from vw_dashboard_bills_billsbyauthorityandmonth) to 'c:\dbdata\dashb... |
<filename>flyway/src/main/resources/db/migration/v1/0_0_2/V1.0.2.3__Role.sql
CREATE TABLE role (
id bigint NOT NULL PRIMARY KEY,
role character varying(255) NOT NULL UNIQUE
);
CREATE SEQUENCE role_id_sequence
START WITH 3
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
COPY role (id, role)... |
CREATE TABLE IF NOT EXISTS `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(255) NOT NULL,
`user_email` varchar(255) NOT NULL,
`user_password` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
)
|
<reponame>Pamelapxaylink/postgresql-course<filename>207/n16e5.sql<gh_stars>0
--Do the following using the database wishlists:
--for anyone who has more than two lists, give them 1000 points and verify your changes with returning
-- i means inner select
SELECT
pid,
COUNT(lid)
FROM people NATURAL LEFT JOIN lists
GRO... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th10 21, 2018 lúc 02:27 PM
-- Phiên bản máy phục vụ: 10.1.26-MariaDB
-- Phiên bản PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.