sql stringlengths 6 1.05M |
|---|
<reponame>KevinMarete/adtv4
update users set ccc_store_sp = 2 WHERE ccc_store_sp = '0'//
|
<gh_stars>0
CREATE PROCEDURE [dbo].[refuel_transactions_upd]
(
@tt refuel_transactions_tt READONLY
,@user_id int
)
AS
-- Update Process
UPDATE a
SET
doc_no = b. doc_no
,doc_date = b.doc_date
,vehicle_id = b.vehicle_id
,driver_id = b.driver_id
,pao_id = b.pao_id
... |
<filename>sql/bd_casadosanjos.sql
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 19-Out-2017 às 02:03
-- Versão do servidor: 5.7.14
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SE... |
<reponame>galetedanilo/learn
INSERT INTO tb_user (name, email, password) VALUES ('<NAME>', '<EMAIL>', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG');
INSERT INTO tb_user (name, email, password) VALUES ('<NAME>', '<EMAIL>', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG');
INSERT INTO tb_... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 19, 2019 at 09:06 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
<filename>migrations/2018-05-16-025352_users/up.sql
CREATE TABLE users (
id SERIAL PRIMARY KEY,
email VARCHAR(255) NOT NULL
CONSTRAINT uq_users_email UNIQUE,
password VARCHAR(60) NOT NULL,
date_created TIMESTAMP WITH TIME ZONE NOT NULL
CONSTRAINT df_users_date_created DEFAULT (now() AT T... |
USE [Hotels_DB]
GO
/****** Object: StoredProcedure [dbo].[UpdateHotel] Script Date: 16.12.2020 17:38:10 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- ============... |
<filename>src/test/resources/tkt-d11f09d36e.test_3.sql
-- tkt-d11f09d36e.test
--
-- execsql {
-- BEGIN;
-- UPDATE t1 set x = x+10000;
-- ROLLBACK;
-- }
BEGIN;
UPDATE t1 set x = x+10000;
ROLLBACK; |
<reponame>jdkoren/sqlite-parser<gh_stars>100-1000
-- randexpr1.test
--
-- db eval {SELECT (select (cast(avg(b) AS integer) | count(distinct case when coalesce((select 13 from t1 where (+(abs(e)/abs(t1.b))) in ( -b, -(a),13)),t1.e)>=b then 11 else - -19 end-17+19) | abs(~case count(distinct t1.b) when +min(e) then +ab... |
-- in4.test
--
-- execsql { SELECT * FROM t3 WHERE x IN () OR x = 10 }
SELECT * FROM t3 WHERE x IN () OR x = 10 |
<gh_stars>10-100
-- file:timestamptz.sql ln:409 expect:true
SELECT '2011-03-26 22:59:59 UTC'::timestamptz
|
-------------------------------------------
-- *** Batch-Mode Adaptive Join Demo *** --
-------------------------------------------
ALTER DATABASE SCOPED CONFIGURATION CLEAR PROCEDURE_CACHE;
GO
ALTER DATABASE [WideWorldImportersDW] SET COMPATIBILITY_LEVEL = 140;
GO
USE [WideworldImportersDW]
GO
-- Show live query st... |
-- 2018-01-03T11:53:06.379
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsActive='N', AD_Process_ID=NULL,Updated=TO_TIMESTAMP('2018-01-03 11:53:06','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=12113
;
-- 2018-01-03T11:53:40.218
-- I forgot to set the DICTIONARY_ID... |
<gh_stars>0
-- Function: public.updateorder(integer)
-- DROP FUNCTION public.updateorder(integer);
CREATE OR REPLACE FUNCTION public.updateorder(auftragid integer)
RETURNS integer AS
$BODY$
DECLARE
vehicleID int;
choosenVehicleID int;
currentVehiclePosition Point;
currentOrderSource Point;
currentOrderTarget Poin... |
/*
Navicat MySQL Data Transfer
Source Server : wujiajun
Source Server Version : 50717
Source Host : 10.10.10.12:3306
Source Database : happy
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2017-06-17 02:24:06
*/
SET FOREIGN_KEY_CHECKS=0;
-- --... |
{{
config({
"materialized": "view"
})
}}
select
--ids
fp.rxno ,
fp.refill_id ,
dd.drug_id,
dp.practice_id,
dp.organization_id,
fp.patient_id,
fp.account_id ,
fqh.tracking_number,
--dates
fp.dispense_date,
fqh.created_date,
fqh.checkout_date,
fp.delivery_date,
--fill specific
fp.fill_number ,
... |
<reponame>leongold/ovirt-engine
SELECT fn_db_create_constraint('async_tasks', 'fk_async_tasks_command_entities_command_id', 'FOREIGN KEY (command_id) REFERENCES command_entities(command_id) ON DELETE CASCADE');
SELECT fn_db_create_constraint('async_tasks', 'fk_async_tasks_command_entities_root_command_id', 'FOREIGN KEY... |
ALTER TABLE dbo.dashboard_dataset ADD create_time DATETIME2 DEFAULT GETDATE();
ALTER TABLE dbo.dashboard_dataset ADD update_time DATETIME2 DEFAULT GETDATE();
ALTER TABLE dbo.dashboard_datasource ADD create_time DATETIME2 DEFAULT GETDATE();
ALTER TABLE dbo.dashboard_datasource ADD update_time DATETIME2 DEFAULT ... |
SET @second_import=(SELECT id FROM entity WHERE title='Overtreatment' AND id != 235606);
UPDATE collection_story SET collection=235606 WHERE collection=@second_import;
UPDATE importRecord SET targetId=235606 WHERE targetId=@second_import;
DELETE FROM collection WHERE id=@second_import;
DELETE FROM entity WHERE id=@seco... |
delete from process where process_id >=402 and process_id<=420;
delete from process where process_id = 401;
delete from process where process_id = 421;
insert into process values (421, 'Enqueuing process', current_timestamp, 'Semantic', 1,2, null ,1, 0,null, '422');
insert into process values (401, 'Parent process', c... |
-- migrate:up
create table users (
username varchar(255) PRIMARY KEY,
password varchar(255) NOT NULL,
email varchar(255) NOT NULL UNIQUE
);
insert into users (username, password, email) values ('dario', 'FGU2OHgynOZU4s8vcK4hSNutW8ik3e8OKOYwomY2tMI=', '<EMAIL>');
insert into users (username, password, email) valu... |
<filename>src/Frapid.Web/Areas/MixERP.Inventory/db/SQL Server/2.x/2.0/src/03.menus/menus.sql<gh_stars>1-10
DELETE FROM auth.menu_access_policy
WHERE menu_id IN
(
SELECT menu_id FROM core.menus
WHERE app_name = 'MixERP.Inventory'
);
DELETE FROM auth.group_menu_access_policy
WHERE menu_id IN
(
SEL... |
<gh_stars>1-10
#standardSQL
# Distribution of response body size by redirected third parties
# HTTP status codes documentation: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status
WITH requests AS (
SELECT
_TABLE_SUFFIX AS client,
pageid AS page,
url,
status,
respBodySize AS body_size
FROM... |
<filename>server/src/main/resources/db/bootstrap/V16__test_case_priortiess.sql<gh_stars>1-10
DROP TABLE IF EXISTS `test_case_priorities`;
CREATE TABLE `test_case_priorities`
(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`display_name` VARCHAR(250) DEFAULT NULL,
`name` VARCHAR(250) DEFAULT NUL... |
set pagesize 50000 linesize 140
spool 070509_translationStart.sql
-- forward strand
select 'update dots.TranslatedAaFeature set translation_start = ' ||
to_char(ef.coding_start - el.start_min + 1) ||
' where na_feature_id = ' ||
to_char(t.na_feature_id) ||
' and translation_start is null;'... |
<gh_stars>10-100
CREATE STREAM blocks (
"slot" INT,
"skipped" BOOLEAN,
"error" VARCHAR
)
WITH (kafka_topic='json.solana.blocks', value_format='json', partitions=1);
CREATE STREAM slots (
"key" INT KEY,
"slot" INT
)
WITH (kafka_topic='json.solana.slots', value_format='json', partitions=8);
SET 'cache.max.byt... |
create table user_pdf_library
(
-- ID of PDF
id uuid primary key default uuid_generate_v1mc() not null,
-- Uploader of PDF
user_id uuid references "user"(id) on delete cascade,
created_at timestamptz default now() not null,
updated_at... |
<gh_stars>1-10
-- [er]create table using fk REFERENCES pk of another table and then dorp the referenced table
CREATE TABLE album(
id CHAR(10) PRIMARY KEY,
title VARCHAR(100),
artist VARCHAR(100)
);
CREATE TABLE track(
album CHAR(10),
dsk INTEGER,
posn INTEGER,
song VARCHAR(255),
FOREIGN KEY (album) R... |
<reponame>Johnshandsable/to-do-list
-- Delete table
DROP TABLE "to_do_list" IF EXISTS;
-- Create table
CREATE TABLE "to_do_list" (
"id" SERIAL PRIMARY KEY,
"task" VARCHAR(1024) NOT NULL,
"complete" BOOLEAN DEFAULT FALSE
);
--- For Testing Purposes
INSERT INTO "to_do_list"
("task")
VALUES
('Clean House'),
(... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 27 Jan 2020 pada 20.33
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
insert into burgers
(burger_name, devoured)
values
('Smokehouse', false),
('Parisian', false),
('Old-fashioned', false),
('Californian', false),
('Spicy Jalapeño', false);
|
CREATE PROCEDURE [dbo].[RetrieveProductOptions]
AS
BEGIN
SELECT *
FROM [dbo].[ProductOption]
RETURN 0
END
GO
|
<reponame>sdoubleday/DarlingData
SET ANSI_NULLS ON;
SET ANSI_PADDING ON;
SET ANSI_WARNINGS ON;
SET ARITHABORT ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET QUOTED_IDENTIFIER ON;
SET STATISTICS TIME, IO OFF;
GO
/*
██╗ ██╗██╗ ██╗███╗ ███╗ █████╗ ███╗ ██╗
██║ ██║██║ ██║████╗ ████║██╔══██╗████╗ ██║
██████... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50553
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2020-08-14 10:44:43
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
alter table "public"."translations" rename column "project_language_id" to "branch_language_id";
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 21 Agu 2021 pada 11.30
-- Versi server: 10.4.20-MariaDB
-- Versi PHP: 7.3.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<reponame>ShruKin/Database-Management-Systems-Lab<filename>WEEK-4/1.sql
CREATE TABLE WORKERS
(
WORKER_ID VARCHAR2(5),
FIRST_NAME VARCHAR2(15),
LAST_NAME VARCHAR2(15),
SALARY NUMBER(7,0),
DEPARTMENT VARCHAR2(20)
) |
-- Creating Database --
create database SEA;
-- Using/naviagte to Sea database --
use SEA;
-- Creating Student Table --
create table Student (
reg_id char(12) primary key,
name varchar(50) not null,
dob date not null,
email_id varchar(30) not null,
dir varchar(50) not null,
marks integer not null
);
-- Crea... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: playgroundapr8
-- ------------------------------------------------------
-- Server version 5.7.21-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RES... |
--transfer $100 from account 1 to account 5
BEGIN TRY
BEGIN TRAN;
UPDATE accounts SET current_balance = current_balance - 100 WHERE account_id = 1;
INSERT INTO transactions VALUES (1, -100, GETDATE());
UPDATE accounts SET current_balance = current_balance + 100 WHERE account_id = 5;
INSERT INTO tra... |
create function ufn_CalculateFutureValue(@sum money, @interestRate float, @years int)
returns float
as
begin
declare @result float;
set @result = @sum * (POWER(1 + @interestRate, @years))
return @result;
end
go
|
/*
* Comandos SQL/T-SQL
*/
/*
* (SQL) USE: Utilizado quando você está trabalhando com scripts e precisar rodá-lo
* em vários databases.
*/
USE master;
USE eBook;
/*
* db_name(): Retorna o nome do database que está sendo utilizado
*/
SELECT db_name();
/*
* (SSMS) GO: indica o fim de execução de um bloco ... |
<reponame>javal1983/silex-scrapbook<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 29, 2016 at 09:31 AM
-- Server version: 10.0.22-MariaDB
-- PHP Version: 7.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Databa... |
SET DEFINE OFF;
ALTER TABLE AFW_12_SCENR_NOTFC_ACTIO ADD (
CONSTRAINT AFW_12_SCENR_NOTFC_ACTIO_FK3
FOREIGN KEY (REF_STAT)
REFERENCES AFW_12_STAT (SEQNC)
ON DELETE CASCADE
ENABLE VALIDATE)
/
|
-- Verify piws:009 on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;
|
<gh_stars>1-10
create database event;
use event;
CREATE TABLE user (
user_id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
home_phone VARCHAR(15),
mobile_phone VARCHAR(15),
email VARCHAR(100) NOT NULL UNIQUE,
user_status VARCHAR(12) NOT NULL,
congr... |
# Runtime: 721 ms, faster than 87.92% of MySQL online submissions for Delete Duplicate Emails.
# Memory Usage: 0B, less than 100.00% of MySQL online submissions for Delete Duplicate Emails.
DELETE
FROM Person
WHERE Id NOT IN
(
SELECT FirstEntries.Id FROM ( # Avoid the error message "Can't specify target table for... |
CREATE TABLE [dbo].[Users]
(
[userId] INT NOT NULL PRIMARY KEY,
[usertype] TINYINT NULL,
[name] NVARCHAR(64) NOT NULL,
[email] NVARCHAR(64) NOT NULL,
[password] NVARCHAR(255) NOT NULL DEFAULT '',
[photo] BIT NOT NULL DEFAULT 0,
[active] BIT NOT NULL DEFAULT 1,
[datecreated] DATETIME ... |
SELECT C.CODREDE,
C.CODCLI,
C.CLIENTE,
C.FANTASIA,
C.CGCENT,
REGEXP_REPLACE(C.CGCENT, '([0-9]{2})([0-9]{3})([0-9]{3})([0-9]{4})', '\1.\2.\3/\4-') AS FORMAT_CGCENT,
C.ENDERENT END_FATURA,
C.MUNICENT MUNICIPIO_FATURA,
C.BAIRROENT BAIRRO_FATURA,
C.CEPENT CEP_F... |
<gh_stars>10-100
CREATE OR REPLACE FUNCTION
f_fake_small_files( max int DEFAULT 10,
pk OUT int,
file_name OUT text,
file_type OUT text )
RETURNS SETOF record
AS
$code$
BEGIN
IF max <= 0 THEN
RAISE EXCEPTION 'Specify a positive limit for tup... |
<filename>prisma/migrations/20220217183710_/migration.sql<gh_stars>10-100
-- AlterTable
ALTER TABLE "Movies" ADD COLUMN "insertedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
|
<gh_stars>100-1000
/*************************************************************
Extended Query Tag Data Table for VR Types mapping to String
Note: Watermark is primarily used while re-indexing to determine which TagValue is latest.
For example, with multiple instances in a series, while indexing ... |
<gh_stars>1000+
create or replace view "AIRBYTE_DATABASE"._AIRBYTE_TEST_NORMALIZATION."CONFLICT_STREAM_ARRAY_AB1" as (
-- SQL model to parse JSON blob stored in a single column and extract into separated field columns as described by the JSON Schema
select
to_varchar(get_path(parse_json(_airbyte_data), '"... |
<reponame>aravi5/drill-test-framework<filename>framework/resources/Functional/subqueries/not_in/s5_c_boolean.sql
select count(*) from j1 where c_boolean not in ( select c_boolean from j6) ;
|
ALTER TABLE nw.terminal ADD terminal_provider_ref_id INT;
|
<gh_stars>1-10
DROP DATABASE IF EXISTS database_for_dict;
CREATE DATABASE database_for_dict;
DROP TABLE IF EXISTS database_for_dict.dict_source;
CREATE TABLE database_for_dict.dict_source (id UInt64, parent_id UInt64, value String) ENGINE = Memory;
INSERT INTO database_for_dict.dict_source VALUES (1, 0, 'hello'), (2, ... |
-- PROCEDURE: public.Proc1_$%{}[]()&*^!@"'`\/#(integer)
-- DROP PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(integer);
CREATE OR REPLACE PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(
i1 integer)
LANGUAGE 'plpgsql'
AS $BODY$begin
select 1;
end;$BODY$;
COMMENT ON PROCEDURE public."Proc1_$%{}[]()&*^!@""'`\/#"(intege... |
CREATE TABLE IF NOT EXISTS `imap_detail` (
`id` int(11) NOT NULL,
`mail` varchar(150) NOT NULL,
`imapPath` varchar(150) NOT NULL,
`serverEncoding` varchar(150) NOT NULL,
`attachmentsDir` varchar(25) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `imap_detail`
--... |
<gh_stars>1-10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
CREATE SCHEMA... |
<reponame>NCIP/cabio
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
DROP TABLE SNP2UNIQ CASCADE CONSTRAINTS PURGE
/
--
-- SNP2UNIQ (Table)
--
CREATE TABLE SNP2UNIQ ( SNP_ID NUMBER(38) NOT NULL, ACCESSION VARCHAR2(20... |
--[er]type of vclass's column with mismatched column type
create class xoo ( id int auto_increment , title varchar(100));
create unique index uni_id on xoo (id);
insert into xoo(title) values ('aaa');
insert into xoo(title) values ('bbb');
insert into xoo(title) values ('ccc');
create vclass vxoo (
id string,
titl... |
<filename>src/main/resources/db/migration/V02__create.sql<gh_stars>0
DROP TABLE FEED;
CREATE TABLE FEED
(
sekvens_id SERIAL PRIMARY KEY,
type VARCHAR NOT NULL,
stonad VARCHAR NOT NULL,
fnr VARCHAR NOT NULL,
startdato ... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 06-04-2021 a las 20:21:43
-- Versión del servidor: 10.4.17-MariaDB
-- Versión de PHP: 8.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
<reponame>azizmap/Medgency
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 24, 2020 at 09:39 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+... |
-- name: create_table#
-- Create a new table
CREATE TABLE zappa (
musician_id serial,
first_name text NOT NULL,
last_name text NOT NULL,
instrument text NOT NULL,
active daterange NOT NULL,
UNIQUE (first_name, last_name, instrument, active)
);
CREATE INDEX first_name_id ON zappa (first_name);
... |
<filename>db3.sql
CREATE DATABASE IF NOT EXISTS `cdg_pos` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `cdg_pos`;
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: cdg_pos
-- ------------------------------------------------------
-- Server version 5.7.18-log
/*!40101 SET @OLD_C... |
ALTER TABLE `CubeCart_alt_shipping_prices` CHANGE `low` `low` DECIMAL(16,3) NOT NULL DEFAULT '0.000'; #EOQ
ALTER TABLE `CubeCart_alt_shipping_prices` CHANGE `high` `high` DECIMAL(16,3) NOT NULL DEFAULT '0.000'; #EOQ
|
<reponame>DimitarIvanov8/software-university
--01. Find Names of All Employees by First Name
USE SoftUni
SELECT FirstName, LastName FROM Employees
WHERE FirstName LIKE 'SA%'
--02.
SELECT FirstName, LastName FROM Employees
WHERE LastName LIKE '%ei%'
--03.
SELECT FirstName FROM Employees
WHERE (HireDate>=1995 OR H... |
-- MySQL Workbench Forward Engineering
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='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... |
<reponame>datagrok-ai/packages
--name: latest_scenario_results
--connection: System:TestTrack
--input: string date = today {pattern: datetime}
select ts.*, ta.date, ta1.result, ta1.env
from test_scenario ts
left join
(
select scenario_id, max(date) as date
from test_activity
where @date(date)
group by scenario_... |
<reponame>LogiksPlugins/Logiks-Core<gh_stars>1-10
CREATE TABLE `lgks_log_activity` (
`id` int(10) unsigned not null auto_increment,
`date` date not null,
`time` time,
`site` varchar(255) default 'default',
`user` varchar(255),
`priority` int(10) unsigned default '4',
`category` varchar(155),
`mo... |
--create extension fuzzystrmatch;
drop table if exists analytical_table;
create temp table analytical_table as
select distinct
t.tconst,
t.primarytitle,
t.startyear,
t.runtimeminutes,
case
when position('Action' in t.genres) is null then 0
when position('Action' in t.genres) = 0 then 0
else 1
end... |
SELECT
(
SELECT
UTC_TIMESTAMP() AS `now`
) AS `__aliased--test` |
CREATE UNIQUE INDEX deleted_not_null_idx ON professional_user (EMAIL_ADDRESS, DELETED)
WHERE DELETED IS NOT NULL;
CREATE UNIQUE INDEX deleted_null_idx ON professional_user (EMAIL_ADDRESS)
WHERE DELETED IS NULL; |
<gh_stars>1-10
USE [my_exchange];
GO
IF OBJECT_ID('tr_after_insert_Reference81', 'TR') IS NOT NULL DROP TRIGGER [dbo].[tr_after_insert_Reference81];
GO
CREATE TRIGGER [dbo].[tr_after_insert_Reference81] ON [dbo].[_Reference81]
AFTER INSERT
AS
DECLARE @dialog_handle AS UNIQUEIDENTIFIER;
SELECT @dialog_handle = [con... |
USE hackthis;
-- CATEGORIES
INSERT INTO `articles_categories` (`category_id`, `parent_id`, `title`, `slug`) VALUES
(1, NULL, 'Hacking', 'hacking'),
(2, 1, 'Website Security', 'hacking/web-security'),
(3, 1, 'Application Security', 'hacking/app-security'),
(4, 1, 'Network Security', 'hacking/network-security'),
(5, NUL... |
<gh_stars>1-10
/*
Warnings:
- Added the required column `type` to the `File` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `File` ADD COLUMN `type` VARCHAR(6) NOT NULL;
|
-- file:polymorphism.sql ln:617 expect:true
drop function dfunc(anyelement)
|
CREATE TABLE IF NOT EXISTS app.ssl_modes (
_id SERIAL PRIMARY KEY,
ssl_mode VARCHAR(255) UNIQUE NOT NULL
);
INSERT INTO app.ssl_modes (ssl_mode) VALUES ('Allow');
INSERT INTO app.ssl_modes (ssl_mode) VALUES ('Prefer');
INSERT INTO app.ssl_modes (ssl_mode) VALUES ('Require');
INSERT INTO app.ssl_modes (ssl_m... |
<filename>contrib/views/denorm.sql
DROP VIEW IF EXISTS omop.measurement_denorm;
CREATE OR REPLACE VIEW omop.measurement_denorm AS
SELECT measurement.measurement_id,
measurement.person_id,
measurement.measurement_concept_id,
cpt_meas.concept_name AS measurement_concept_name,
cpt_meas.concept_code AS mea... |
CREATE TABLE result ({{ rownum }} {{ rownum * 7 }}); |
INSERT INTO burgers (burger_name, devoured) VALUES ('Salmon Burger', FALSE);
INSERT INTO burgers (burger_name, devoured) VALUES ('Black Bean Burger', FALSE);
INSERT INTO burgers (burger_name, devoured) VALUES ('Shroom Burger', FALSE); |
<filename>Blizzlike/ArcEmu/SQL/Events/Noblegarden/Noblegarden_Spawn.sql
/* Brightly Colored Egg */
DELETE FROM `gameobject_names` WHERE `entry` = 113768;
INSERT INTO `gameobject_names` (`entry`, `type`, `DisplayID`, `name`, `Category`, `UnkStr`, `Size`, `spellfocus`, `sound1`, `sound2`, `sound3`, `sound4`, `sound5`, `s... |
<gh_stars>0
# --- First database schema
# --- !Ups
set ignorecase true;
-- CREATE TABLE employee (
-- id BIGINT NOT NULL AUTO_INCREMENT,
-- name VARCHAR(255) NOT NULL,
-- address VARCHAR(1000) NOT NULL,
-- designation VARCHAR(255) NO... |
-- phpMyAdmin SQL Dump
-- version 3.5.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Oct 19, 2013 at 07:26 PM
-- Server version: 5.5.29
-- PHP Version: 5.4.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*... |
USE dashboards;
DROP FUNCTION IF EXISTS getAgeDateRangeString;
DELIMITER //
CREATE FUNCTION getAgeDateRangeString(
p_from VARCHAR(30),
p_to VARCHAR(30),
p_dateFrom VARCHAR(20),
p_dateTo VARCHAR(20),
p_periodValue VARCHAR(20),
p_periodType VARCHAR(20),
p_type INT) -- 1 = age, 2 ... |
<filename>tests/queries/0_stateless/02292_h3_unidirectional_funcs.sql
-- Tags: no-fasttest
SELECT h3GetDestinationIndexFromUnidirectionalEdge(1248204388774707197);
SELECT h3GetDestinationIndexFromUnidirectionalEdge(599686042433355773);
SELECT h3GetDestinationIndexFromUnidirectionalEdge(stringToH3('85283473ffffff'));
... |
DROP TABLE IF EXISTS `orders`;
CREATE TABLE `orders` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`order_ext_id` varchar(255) DEFAULT NULL,
`customer_id` varchar(255) DEFAULT NULL,
`amount` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
);
DROP TABLE IF EXISTS `order_items`;
CREATE TABLE `order_items` (
`... |
-- Enables parameterization of user creation code in terms of username
-- and credential. When concatenating it is key to use quote_ident and
-- quote_literal to avoid inject from user provided values.
CREATE OR REPLACE FUNCTION alter_ol_user(id text, cred text)
RETURNS boolean AS $$
declare t_is_role boolean;
BEGIN
... |
/* Copyright (c) 2006-2012 Regents of the University of Minnesota.
For licensing terms, see the file LICENSE. */
/* This script moves comments stored in byway_segment.comments to annotations
and removes the comments column. */
begin transaction;
set constraints all deferred;
set transaction isolation level seri... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Хост: localhost
-- Время создания: Май 23 2019 г., 04:01
-- Версия сервера: 10.1.38-MariaDB
-- Версия PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
select DISTINCT
sys.User_Name0 as 'Username*',
'' as 'Password',
vru.givenName0 as 'First Name*',
vru.sn0 as 'Last Name*',
'YourGroupID' as 'GroupID*', -- Your Group ID here
'Directory' as 'Security Type*',
vru.Mail0 as 'Email Address*',
'' as 'User Role',
'' as 'User Message Type',
'YourGroupID' as 'Device Group... |
DROP TABLE IF EXISTS bike_ingest;
CREATE TABLE bike_ingest(
biketrip_id BIGSERIAL,
trip_duration INTEGER,
start_time TIMESTAMP,
stop_time TIMESTAMP,
start_station_id INTEGER,
start_station_name VARCHAR(60),
start_station_latitude REAL,
start_station_longitude REAL,
end_station_id INT... |
<filename>sql/_01_object/_03_virtual_class/_001_basic/cases/1072.sql
-- [er]create a vclass and using column naming as '<'
create vclass DML_0001 (
int<col1 integer,
int_col2 integer
) ;
drop vclass DML_0001;
|
<filename>closedaydata/OLD/IAT2205191135.sql
INSERT INTO pos_itemtemp VALUES("IATT190000048","193038","191001","192006","36000","1","36000","0","36000","1","1","1","IAT2205191135","NHO2018000007","PAID","Tidak pakai daun bawang","ORIGINAL"),
("IATT190000048","193052","191002","192010","20000","1","20000","0","20000","1... |
<filename>sql/CMECredit.sql
create table CMECredit (
id serial,
enabled boolean not null default true,
hours numeric(5, 2) not null,
objectives text,
planning_committee_no_disclosures text,
support_staff_no_disclosures text,
review_date timestamp,
quiz integer references Inquisition(id) on delete set null,
e... |
create table t_dict
(
id number,
name varchar2(255) not null,
description varchar2(255) default 'No description',
constraint pk_t_dict primary key (id)
);
comment on table t_dict is 'Dictionary table';
comment on column t_dict.id is 'Unique id';
comment on column t_dict.name is 'Record name'... |
EXEC [EST].[Proc_yjbb_Ins] @Code = N'603339',@CutoffDate = N'2017-09-30',@EPS = N'0.56',@EPSDeduct = N'0',@Revenue = N'6.93亿',@RevenueYoy = N'47.23',@RevenueQoq = N'7.93',@Profit = N'1.16亿',@ProfitYoy = N'41.51',@ProfiltQoq = N'63.01',@NAVPerUnit = N'6.6821',@ROE = N'8.46',@CashPerUnit = N'1.0857',@GrossProfitRate = N'... |
DROP TABLE movies_categories;
DROP TABLE IF EXISTS categories;
DROP TABLE IF EXISTS movies;
CREATE TABLE categories (
id SERIAL PRIMARY KEY,
tmdb_id INT NOT NULL,
name VARCHAR (20) NOT NULL
);
CREATE TABLE movies (
id SERIAL PRIMARY KEY,
title VARCHAR (50) NOT NULL,
trailer_url TEXT NOT NULL,
... |
CREATE TABLE [dbo].[PermissionRole]
(
[Id] UNIQUEIDENTIFIER NOT NULL PRIMARY KEY DEFAULT (newid()),
[RoleId] UNIQUEIDENTIFIER NOT NULL,
[PermissionId] UNIQUEIDENTIFIER NOT NULL,
CONSTRAINT [FK_PermissionRole_Role] FOREIGN KEY ([RoleId]) REFERENCES [dbo].[Role] ([Id]),
CONSTRAINT [FK_PermissionRole_Pe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.