sql stringlengths 6 1.05M |
|---|
<filename>assets/database/ezpet.sql
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 19, 2020 at 07:59 PM
-- 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_... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 18 Jul 2021 pada 15.44
-- Versi server: 10.1.34-MariaDB
-- Versi PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
<reponame>FireCARES/data
-- Materialized View: nist.ems_table_500
CREATE MATERIALIZED VIEW nist.ems_table_500
AS
WITH f AS (
SELECT date_part('year'::text, coded_ems.inc_date) AS year,
coded_ems.tr10_fid,
count(*) AS calls
FROM nist.coded_ems
WHERE date_part('year... |
-- Create a new stored procedure called 'SP_SelectAllAuthors' in schema 'dbo'
-- Drop the stored procedure if it already exists
IF EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'dbo'
AND SPECIFIC_NAME = N'SP_SelectAllAuthors'
)
DROP PROCEDURE dbo.SP_SelectAllAuthors
GO
-- Create the st... |
<filename>CurioExchange/CurioExchangeService/Sql/Data.sql
INSERT INTO dbo.Sets VALUES ('Red Heart', 47)
GO
INSERT INTO dbo.Pieces VALUES ('Red Heart Heart-shaped Box', 1, 120)
INSERT INTO dbo.Pieces VALUES ('Red Heart Scarlet Candy', 0, 120)
INSERT INTO dbo.Pieces VALUES ('Red Heart Bright Blue Candy', 0, 120)
INSERT... |
<reponame>longtime55/5on6.pl
-- 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 SET @OLD_CHARACTER_SET_R... |
<filename>enter_leaveTrigger.sql<gh_stars>0
--trigger for Monthly_ticket_record
drop trigger if exists enter_leave_point
create trigger enter_leave_point
on materialdb_Monthly_ticket_record
after insert, update
for each row
begin
declare enter char(7) -- inserted enter point ID
set enter = (select enter_point_id from... |
<filename>triage.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 03-11-2020 a las 22:35:00
-- Versión del servidor: 8.0.18
-- Versión de PHP: 7.4.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 29-Set-2021 às 01:00
-- Versão do servidor: 10.4.10-MariaDB
-- versão do PHP: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
<filename>ncaa_pbp/mapping/rosters_compute_levenshtein_distances.sql<gh_stars>10-100
-- Requires the PostgreSQL Levenshtein functionfound in the contributed
-- fuzzystrmatch module
-- To install:
-- apt-get install postgresql-contrib
-- CREATE EXTENSION fuzzystrmatch;
begin;
drop table if exists ncaa_pbp.lev_mapping... |
alter table "public"."users" drop column "is_denied" cascade;
|
<gh_stars>1-10
if not exists (select * from INFORMATION_SCHEMA.TABLES where TABLE_NAME = '$tablename$_CSTM' and TABLE_TYPE = 'BASE TABLE')
begin
print 'Create Table dbo.$tablename$_CSTM';
Create Table dbo.$tablename$_CSTM
( ID_C uniqueidentifier not null constraint PK_$tablename$... |
<gh_stars>10-100
-- file:updatable_views.sql ln:1240 expect:true
insert into uv_iocu_view (aa) values (1)
on conflict (aa) do update set cc = 'XXX'
|
CREATE TABLE list (id VARCHAR(10) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "list" ("id", "value") VALUES (E'ARM', E'Argentine Peso (1881–1970)');
INSERT INTO "list" ("id", "value") VALUES (E'ARL', E'Argentine Peso Ley (1970–1983)');
INSERT INTO "list" ("id", "value") VALUES (E'BOL', E'Bolivi... |
-- Repositories.{UserId}.db
create table EditingAmounts (
Id integer primary key,
CommitId integer,
LanguageId integer, -- Languages.db Languages.Id
Insertions integer,
Deletions integer,
foreign key CommitId reference Commits(Id)
);
|
<reponame>Farizal97/gaji_tokma
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 10 Des 2019 pada 15.29
-- Versi Server: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... |
delete
from alquiler
where id = :id |
<reponame>developersatyendra/jackhammer<filename>dump.sql
-- MySQL dump 10.13 Distrib 5.7.22, for osx10.12 (x86_64)
--
-- Host: localhost Database: jchauth
-- ------------------------------------------------------
-- Server version 5.7.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 S... |
set transaction read committed
begin
selectv * from t10 where id > 20 order by id
commit
|
-- migrate:up
alter table users drop column phone;
alter table users drop column email;
-- migrate:down
alter table users add email VARCHAR(255) after username;
alter table users add phone VARCHAR(50) after email;
|
metadata :name => "bolt_tasks",
:description => "Downloads and runs Puppet Tasks",
:author => "R.I.Pienaar <<EMAIL>>",
:license => "Apache-2.0",
:version => "0.19.0",
:url => "https://choria.io",
:timeout => 60
requires :mcollective => "2.11.0"
action "download", ... |
<filename>server/database/init.sql
-- @file
-- @brief Database schema script.
-- database/init.sql
--
-- FadZmaq Project
-- Professional Computing. Semester 2 2019
--
-- This script builds our database schema and uploads it with dummy values.
--
-- Copyright FadZmaq © 2019 All rights reserved.
-- @author <N... |
CREATE TABLE OrdenesDeCompra(
IdOrdenDeCompra INT IDENTITY(1,1),
FechaLiberacion DATE NOT NULL,
IdSolicitante INT NOT NULL,
IdEjecutor INT NOT NULL,
IdNodo INT NOT NULL,
IdResponsable INT NOT NULL,
IdPlanificaTarea INT NOT NULL,
Descripcion VARCHAR(1000) NOT NULL,
CONSTRAINT PK_OrdenesDeCompra ... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50527
Source Host : localhost
Source Database : ihasy
Target Server Type : MySQL
Target Server Version : 50527
File Encoding : utf-8
Date: 01/02/2013 18:26:36 ... |
<gh_stars>1-10
TRUNCATE `Documents`;
INSERT INTO Documents VALUES (1, 'The World of Null-A', 'Book', 55, null);
INSERT INTO Documents VALUES (2, 'Le Progres de Lyon', 'Newspaper', null , 'Lyon');
INSERT INTO Documents VALUES (3, 'Lord of the Rings', 'Book', 3587, null);
INSERT INTO Documents VALUES (4, 'Le Canard... |
<reponame>kamrul-suhel/rhino
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 13, 2019 at 05:09 PM
-- Server version: 5.7.25
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... |
<gh_stars>0
SELECT DISTINCT people.name
FROM people
INNER JOIN stars ON people.id=stars.person_id
INNER JOIN movies ON stars.movie_id=movies.id
WHERE movies.year=2004 ORDER BY people.birth ASC; |
<filename>migrations/20200704200254_create_nucypher_policies.down.sql
DROP TABLE IF EXISTS nucypher_policies;
|
<reponame>giggals/Software-University
SELECT ContinentCode , CurrencyCode ,COUNT(CurrencyCode)
FROM Countries AS c
|
<reponame>rgualp/AbucRemarketing2Bundle
/*
Inserting permissions for active-inactive rooms
Author: <NAME>
*/
insert into permission (perm_description, perm_category, perm_route)
values ("Activar-Desactivar habitaciones", "Propiedades", "mycp_active_room");
insert rolepermission (rp_role, rp_permission)
values ((sel... |
<gh_stars>0
-- SQL TEST
--EXCERISE 1
--1.1
--Write a query that lists all Customers in either Paris or London, include CustomerID, CompanyName and all address fields
SELECT CustomerID, CompanyName,
Address + ',' + City + ', ' + PostalCode + ', ' + Country AS "Address"
FROM Customers
WHERE City = 'Paris' OR City = 'L... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 08, 2021 at 07:13 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>Codewars/SQL/SQL Bug Fixing: Fix the JOIN.sql
SELECT
j.job_title,
ROUND(SUM(j.salary) / COUNT(p.name), 2) as average_salary,
COUNT(p.name) as total_people,
ROUND(SUM(j.salary), 2) as total_salary
FROM people p JOIN job j ON p.id = j.people_id
GROUP BY job_title, salary |
# add creationTime column to games
# --- !Ups
TRUNCATE TABLE games;
ALTER TABLE games
ADD COLUMN creationTime timestamp NOT NULL;
# --- !Downs
|
USE SoftUni
SELECT e.EmployeeID,
e.FirstName,
CASE
WHEN DATEPART(YEAR, StartDate) >= 2005 THEN NULL
ELSE p.[Name]
END AS ProjectName
FROM Employees AS e
JOIN EmployeesProjects AS ep ON e.EmployeeID = ep.EmployeeID
JOIN Projects AS p ON ep.ProjectID = p.ProjectID
WHERE e.EmployeeID = 24 |
DROP TABLE "standard_relational_model"."addresses";
|
<gh_stars>100-1000
-- enc3.test
--
-- execsql {
-- CREATE TABLE t1(x,y);
-- INSERT INTO t1 VALUES('abc''123',5);
-- SELECT * FROM t1
-- }
CREATE TABLE t1(x,y);
INSERT INTO t1 VALUES('abc''123',5);
SELECT * FROM t1 |
-- file:horology.sql ln:86 expect:true
SELECT timestamp without time zone 'Jan 1, 4713 BC' + interval '109203489 days' AS "Dec 31, 294276"
|
CREATE TABLE `roles` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB;
|
<filename>backend/de.metas.handlingunits.base/src/main/sql/postgresql/system/5468879_sys_gh518_add_toplevel_hu_validation_rule.sql<gh_stars>1000+
-- 2017-07-27T12:30:59.108
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,Crea... |
INSERT INTO burgers (burger_name) VALUES ('Bacon Double Cheeseburger');
INSERT INTO burgers (burger_name, devoured) VALUES ('Salmon Burger', true);
INSERT INTO burgers (burger_name) VALUES ('Chicken Burger'); |
ALTER TABLE attachments ADD COLUMN CategoryID int (11) NULL;
ALTER TABLE attachments ADD constraint Attachments_category FOREIGN KEY (CategoryID) references category(categoryid); |
select
sum(l_extendedprice * l_discount) as revenue
from
lineitem
where
l_shipdate >= date '1992-08-08'
and l_shipdate < date '1994-06-13'
and l_discount between 0.023363173007965088 and 0.050057864189147955
and l_quantity < 14.080395758152008;
|
// NOTE: This library must be DUPLICATED in the data.cql file as well!
library Common2
using Simple version '1.0.0'
parameter SomeNumber default 17
parameter AnotherNumber default 20
context Patient
define TheParameter:
SomeNumber
define function addToParameter(a Integer):
SomeNumber + a
define AnotherParameter... |
-- Role: "publicmapping"
-- DROP ROLE publicmapping;
CREATE ROLE publicmapping LOGIN
ENCRYPTED PASSWORD '<PASSWORD>'
NOSUPERUSER INHERIT CREATEDB NOCREATEROLE;
-- Database: publicmapping
-- DROP DATABASE publicmapping;
CREATE DATABASE publicmapping
WITH OWNER = publicmapping
CONNECTION L... |
<reponame>mmci2468/automate
-- Deploy stage_ordering
BEGIN;
-- We need to remove the existing ordering information, because it was
-- incorrect. Deleting is OK because no tables have any functional
-- dependencies on the contents of this table.
DELETE FROM stage_ordering;
INSERT INTO stage_ordering(sequence_number, ... |
CREATE TABLE horde_perms (
perm_id NUMBER(16) NOT NULL,
perm_name VARCHAR2(255) NOT NULL UNIQUE,
perm_parents VARCHAR2(255) NOT NULL,
perm_data CLOB,
PRIMARY KEY (perm_id)
);
|
ALTER TABLE "GroupAttendee" SET SCHEMA "permissions";
|
<filename>openGaussBase/testcase/SQL/DATATYPE/json/Opengauss_Function_Datatype_Json_Case0002.sql
-- @testpoint: 创建普通列存表,插入数据,合理报错
drop table if exists test_json_02;
create table test_json_02 (id json) with(orientation=column,compression=no);
|
-- @testpoint:openGauss保留关键字overlaps作为 用户名,
--不带引号,合理报错
CREATE USER overlaps PASSWORD '<PASSWORD>';
--加双引号,创建成功
drop user if exists "overlaps";
CREATE USER "overlaps" PASSWORD '<PASSWORD>';
--清理环境
drop user "overlaps";
--加单引号,合理报错
CREATE USER 'overlaps' PASSWORD '<PASSWORD>';
--加反引号,合理报错
CREATE USER... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 24, 2019 at 04:01 PM
-- Server version: 5.7.28-0ubuntu0.18.04.4
-- PHP Version: 7.2.24-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 ... |
SELECT
COALESCE(CITIES.NAME, 'ALL') AS CITY,
round(sum(NETTO_PRICE), 2) AS NETTO,
round(sum(BRUTTO_PRICE), 2) AS BRUTTO,
count(*) AS COUNT
FROM SALES
JOIN CINEMAS ON SALES.CINEMA_ID = CINEMAS.ID
JOIN CITIES ON CINEMAS.CITY_ID = CITIES.ID
GROUP BY ROLLUP (CITIES.NAME) |
<reponame>Snooking/RpgDatabase
use RPG
Select * FROM PrzedmiotyGracza ORDER BY Nick |
with j as (
select response_id, match_type, count(potential_identifier)
from unique_identifiers
where response_id = 313708
or response_id = 398877
or response_id = 402232
or response_id = 436829
or response_id = 481130
or response_id = 528861
or response_id = 552613
or response_id = 575004
or response_id = ... |
CREATE PROCEDURE [dbo].[dnn_SaveTabVersion]
@Id INT,
@TabId INT,
@TimeStamp DATETIME,
@Version INT,
@IsPublished BIT,
@CreatedByUserID [INT] = -1,
@LastModifiedByUserID [INT] = -1
AS
BEGIN
IF ISNULL(@Id, 0) = 0
BEGIN
INSERT INTO dbo.[dnn_TabVersions](
[TabI... |
<reponame>CFRealEstateServices/DomoETL
create view [dbo].[vw_GroupMembershipDeltas]
as
select
act.domain,
act.groupId as DOMOGroupId,
act.userId as DOMOUserId,
(case when g.domain is not null then 'none' else 'delete' end) as neededAction
from dbo.ActualDOMOGroupMembership act
left join dbo.GroupRecordMappings gm
... |
<gh_stars>1-10
INSERT INTO queries (id, name, sql, created_at, updated_at, description) VALUES (1, 'BuscarAluno', 'SELECT * FROM students
WHERE students.name LIKE :nome', '2018-02-20 23:54:47.042650', '2018-02-21 00:37:52.574731', null);
INSERT INTO queries (id, name, sql, created_at, updated_at, description) VALUES (2... |
<filename>source/maintenance-plan/stored-procedures/dbo.usp_mpAlterTableForeignKeys.sql
RAISERROR('Create procedure: [dbo].[usp_mpAlterTableForeignKeys]', 10, 1) WITH NOWAIT
GO
IF EXISTS (
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[usp_mpAlterTableForeignKeys]')
AND typ... |
alter table c_customer
add is_deleted boolean not null;
alter table c_customer
add create_ts timestamp not null;
alter table c_customer
add update_ts timestamp not null;
|
<reponame>rafaelluisdacostacoelho/itix
CREATE TABLE [Consultorio].[Consultas]
(
[Id] INT IDENTITY(1, 1) NOT NULL,
[DataInicial] DATETIME NOT NULL,
[DataFinal] DATETIME NOT NULL,
[Observacoes] VARCHAR(400) NULL,
[PacienteId] INT NOT NULL,
CONSTRAINT PK_Consultas PRIMARY KEY NONCLUSTERED (Id),
CON... |
<reponame>cuba-platform/cuba-thesis
--$Id$
-- Description: update screen permissions according to #1532
update sec_permission set target = substring(target from 3) where type = 10;
|
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.19 : Database - webpacs
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS... |
<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*/
ALTER TABLE SNP_REPORTER
DROP PRIMARY KEY CASCADE
/
DROP TABLE SNP_REPORTER CASCADE CONSTRAINTS PURGE
/
--
-- SNP_REPORTER (Table)
--
-- Dependencies: ... |
<filename>tests/Database/files/pgsql-nette_test4.sql
DROP SCHEMA IF EXISTS public CASCADE;
CREATE SCHEMA public;
CREATE TABLE simple_pk_autoincrement (
identifier1 serial NOT NULL,
note varchar(100),
PRIMARY KEY (identifier1)
);
CREATE TABLE simple_pk_no_autoincrement (
identifier1 int NOT NULL,
note varchar(100... |
<filename>functions/age_category_dyn.sql
CREATE OR REPLACE FUNCTION age_category_dyn (p_age text)
RETURNS text language 'plpgsql' AS
$body$
BEGIN
RETURN ($$CASE
WHEN $$||p_age ||$$ <= 2 THEN 'Infant'
WHEN $$||p_age ||$$<=12 THEN 'Child'
WHEN $$||p_age ||$$<65 THEN 'Adult'
ELSE 'Senior' END$$);
END; $body$... |
-- @testpoint: opengauss关键字destroy(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists destroy_test cascade;
create table destroy_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor destroy for select * from destroy_test order by 1;
close destroy;
end;
--关键字带双引号-成功
start transaction;
cursor "destroy" for sele... |
-- @testpoint:opengauss关键字nominvalue(非保留),自定义数据类型名为explain
--关键字explain作为数据类型不带引号,创建成功
drop type if exists nominvalue;
CREATE TYPE nominvalue AS (f1 int, f2 text);
select typname from pg_type where typname ='nominvalue';
drop type nominvalue;
--关键字explain作为数据类型加双引号,创建成功
drop type if exists "nominvalue";
CREATE TYPE ... |
<reponame>Nazimkhan1/User-Gallery-Management-In-Codeigniter-Mysql<filename>gallery_db.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 15, 2020 at 09:27 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_Z... |
DROP TABLE IF EXISTS apikeys CASCADE;
-- @table apikeys
-- @description stores apikeys for users
CREATE TABLE IF NOT EXISTS apikeys (
user_id UUID NOT NULL,
name VARCHAR NOT NULL,
apikey VARCHAR(32) NOT NULL PRIMARY KEY DEFAULT md5(random()::text),
secret VARCHAR(32) NOT NULL D... |
<gh_stars>0
-- ========== ========== ========== ========== ==========
-- Drop view `v_dist_fuel`
DROP VIEW IF EXISTS v_dist_fuel;
-- ========== ========== ========== ========== ==========
-- Create view `v_dist_fuel`
CREATE VIEW IF NOT EXISTS v_dist_fuel
AS
select
date(fuel_date) as "Date"
, odo_km as "Odometer"... |
/*
Recuerda que deshabilitar la opción "Enable foreign key checks" para evitar problemas a la hora de importar el script.
*/
DROP TABLE IF EXISTS `RolesUsuario`;
DROP TABLE IF EXISTS `Mensajes`;
DROP TABLE IF EXISTS `Roles`;
DROP TABLE IF EXISTS `Usuarios`;
CREATE TABLE IF NOT EXISTS `Roles` (
`id` int(11) NOT NUL... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 08, 2020 at 12:30 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.2.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
<filename>fdb-sql-layer-core/src/test/resources/com/foundationdb/sql/optimizer/rule/promote-outer/if-complete.sql
SELECT * FROM customers LEFT JOIN orders ON customers.cid = orders.cid
WHERE CASE WHEN name = 'Smith' THEN (order_date > '2010-01-01') ELSE (order_date > '2011-01-01') END
|
<reponame>jtsoya539/risk<filename>source/database/generate_docs.sql<gh_stars>0
/*
--------------------------------- MIT License ---------------------------------
Copyright (c) 2019 jtsoya539
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files... |
### Schema
CREATE DATABASE burger_db;
USE burger_db;
CREATE TABLE burgers
(
id int NOT NULL AUTO_INCREMENT,
burger_name varchar(255) NOT NULL,
devoured boolean NOT NULL,
PRIMARY KEY (id)
);
|
-- update.test
--
-- execsql {SELECT * FROM test1 WHERE f1==778 ORDER BY f1,f2}
SELECT * FROM test1 WHERE f1==778 ORDER BY f1,f2 |
--
-- Copyright (c) Microsoft Corporation. All rights reserved.
-- Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
--
---------------------------------------------------------------------------------------------------------------------------------
-- AddPartnerUse... |
-- @Title: 每个帖子的评论数 (Number of Comments per Post)
-- @Author: Singularity0909
-- @Date: 2020-10-28 00:12:27
-- @Runtime: 966 ms
-- @Memory: 0 B
select distinct t1.sub_id post_id, ifnull(count(distinct t2.sub_id), 0) number_of_comments
from Submissions t1 left join Submissions t2
on t1.sub_id = t2.parent_id
where t1.p... |
SELECT c.Name
FROM City AS c
JOIN Country AS ct ON ct.Code = c.CountryCode
WHERE ct.Continent = 'Africa' |
<reponame>criticaldatacourse/hst953-2018-team_h
---- This script combines the total volume of normal saline and the difference of hemoglobin between measurements
select hgb.subject_id, hgb.icustay_id, hgb.hadm_id, hgb.ICU_admitted, hgb.first_measurement,
hgb.last_measurement,
hgb.HEMOGLOBIN_1st,
hgb.hemoglobin_24,... |
<gh_stars>1-10
DROP DATABASE IF EXISTS monkey_db;
CREATE DATABASE monkey_db;
|
-- high water mark for sessions (since Oracle was started)
select sessions_max, sessions_warning, sessions_current, sessions_highwater from v$license
|
--
--
--
-- @author <NAME> (<EMAIL>)
-- @creation-date 2005-01-05
-- @arch-tag: d0ff33aa-5369-4926-973d-001db0e0c690
-- @cvs-id $Id: upgrade-5.1.0a13-5.1.0a14.sql,v 1.3 2015/12/04 14:02:55 cvs Exp $
--
-- Add root folders into dav_site_node_folder_map
insert into dav_site_node_folder_map (select sn.node_id, fs.fol... |
<gh_stars>0
select
'PQ_TQSTAT' CNAME, to_char(systimestamp, 'yyyy-mm-dd"T"hh24:mi:ss.ff') CTIMESTAMP,
v$pq_tqstat.*
from
v$pq_tqstat
/
|
<reponame>DIM-JACK/FYP<gh_stars>0
CREATE TRIGGER APPLICATION_DELETE BEFORE DELETE ON APPLICATION
FOR EACH ROW BEGIN
DELETE FROM APP_CACHE_VIEW WHERE APP_UID = OLD.APP_UID;
END |
# --- !Ups
create table user (
email varchar(255) not null,
name varchar(255),
password varchar(255),
constraint pk_user primary key (email)
);
create table project (
id bigint not null,
name ... |
<filename>eval_model.sql
SELECT
roc_auc,
# evaluating the auc value based on the scale at http://gim.unmc.edu/dxtests/roc3.htm
CASE WHEN roc_auc >.9 THEN 'excellent' WHEN roc_auc >.8 THEN 'good'
WHEN roc_auc >.7 THEN 'fair' WHEN roc_auc >.6 THEN 'poor' ELSE 'fail' END
AS modelquality
FROM ML.EVALUATE(MODEL `b... |
<gh_stars>100-1000
CREATE TABLE `article_history`(
`ah_id` BIGINT(20) NOT NULL AUTO_INCREMENT ,
`ah_version` VARCHAR(100) NOT NULL COMMENT '修改版本' ,
`ah_content` TEXT NOT NULL COMMENT '修改内容' ,
`ah_users_id` BIGINT(20) NOT NULL ,
`ah_article_id` BIGINT(20) NOT NULL ,
`create_time` TIMESTAMP NOT NULL DEFAULT C... |
-- @testpoint:opengauss关键字Key(非保留),作为用户名
--关键字explain作为用户名不带引号,创建成功
drop user if exists Key;
CREATE USER Key PASSWORD '<PASSWORD>';
drop user Key;
--关键字explain作为用户名加双引号,创建成功
drop user if exists "Key";
CREATE USER "Key" PASSWORD '<PASSWORD>';
drop user "Key";
--关键字explain作为用户名加单引号,合理报错
CREATE USER 'Key' PASSWORD '<... |
CREATE TABLE `tblVendorCSVMapping` (
`VendorCSVMappingId` int(11) NOT NULL AUTO_INCREMENT,
`VendorId` int(11) DEFAULT NULL,
`ExcelColumn` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`MapTo` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`VendorCSVMappingId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ... |
<reponame>robertomrosati/friuli-a-domicilio<filename>_public_scripts/FriuliDomicilio_insert_03_E_Cities_FVG.sql
insert into e_cities(e_cities_code, e_cities_code_local, e_cities_description, e_cities_visible, e_cities_e_provinces_id) values ('ITA103', 'A103', 'Aiello del Friuli', 1, (select e_provinces_id from e_provin... |
<reponame>dianeyeo/StrataScratch<gh_stars>0
/*
Find whether the number of seniors works at Meta/Facebook is higher than its number of USA based employees
https://platform.stratascratch.com/coding/10065-find-whether-the-number-of-seniors-works-at-facebook-is-higher-than-its-number-of-usa-based-employees?python=
Difficu... |
<reponame>TulevaEE/onboarding-service
ALTER TABLE mandate
ADD COLUMN address jsonb;
|
with x as (
select path_id, path, title from paths
where site_id = :site and
(lower(path) like lower(:search) {{:match_title or lower(title) like lower(:search)}})
)
select
path_id, path, title,
sum(total) as count
from hit_counts
join x using(path_id)
where site_id = :site
group by path_id, path, title
order by c... |
<filename>C#DBFundamentals/DB-Basics-MS-SQL-Server/02DataDefinitionAndDatatypes/DataDefinitionAndDatatypesExercises/23. Decrease Tax Rate.sql
USE Hotel
UPDATE Payments
SET TaxRate -= (TaxRate * 3) / 100
SELECT TaxRate FROM Payments |
<reponame>scala-steward/bitcoin-s
CREATE TABLE IF NOT EXISTS "txo_spending_info" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"tx_outpoint" VARCHAR(254) NOT NULL, "script_pub_key" VARCHAR(254) NOT NULL,"value" INTEGER NOT NULL,"hd_privkey_path" VARCHAR(254) NOT NULL,"redeem_script" VARCHAR(254),"script_witness" VAR... |
<filename>db/schema/02_todos.sql
DROP TABLE IF EXISTS todos CASCADE;
CREATE TABLE todos (
id SERIAL PRIMARY KEY NOT NULL,
memo VARCHAR(255) NOT NULL,
memo_type VARCHAR(255) NOT NULL,
timestamp VARCHAR(255) NOT NULL,
user_id int REFERENCES users(id)
);
|
create or replace view v_report_invoices_balance_daily as
select
ai.tenant_record_id
, ai.currency
, date_format(ai.created_date,'%Y-%m-%d') as day
, sum(ai.converted_balance) as count
from
analytics_invoices ai
where 1=1
and ai.report_group='default'
group by 1,2,3
;
|
<filename>misc/sql-scraps/create_pfsignalp.sql
-- -----------------------------------------------------------------------------
-- NAME: create_pfsignalpnn.sql
-- PURPOSE: sql statements to create pfsignalpnnnn and pfsignalpnnhmm tables
--
-- $Id: create_pfsignalpnn.sql,v 1.2 2003/10/17 21:04:27 cavs Exp $
-- ---------... |
-- drop and create
DROP EXTENSION IF EXISTS hstore CASCADE;
CREATE EXTENSION hstore; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.