sql stringlengths 6 1.05M |
|---|
DROP DATABASE IF EXISTS `test002`;
CREATE DATABASE `test002`;
USE `test002`;
DROP TABLE IF EXISTS `test201`;
CREATE TABLE `test201` (
`col` text COLLATE utf8mb4_unicode_ci
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
INSERT INTO `test201` VALUES ('áéíóú');
INSERT INTO `test201` VALUES ('🎲');... |
<filename>backend-knowledge-base/3.mybatis-plus/mybatis-plus.sql<gh_stars>0
/*
Navicat Premium Data Transfer
Source Server : 本地
Source Server Type : MySQL
Source Server Version : 50730
Source Host : localhost:3306
Source Schema : mybatis-plus
Target Server Type : MySQL
Target S... |
-- MySQL dump 10.16 Distrib 10.1.24-MariaDB, for Linux (x86_64)
--
-- Host: h2627939.stratoserver.net Database: healthcare
-- ------------------------------------------------------
-- Server version 10.1.24-MariaDB-1~xenial
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACT... |
<gh_stars>1-10
-- {"id":100,"name":"lb james阿道夫","money":293.899778,"dateone":"2020-07-30 10:08:22","age":"33","datethree":"2020-07-30 10:08:22.123","datesix":"2020-07-30 10:08:22.123456","datenigth":"2020-07-30 10:08:22.123456789","dtdate":"2020-07-30","dttime":"10:08:22"}
CREATE TABLE source
(
id INT,
... |
use openbaton;
CREATE TABLE IF NOT EXISTS base_user_roles (
base_user_id varchar(255),
roles_id VARCHAR(255),
primary key (base_user_id , roles_id));
DROP PROCEDURE IF EXISTS ReeBAR;
DELIMITER ;;
CREATE PROCEDURE ReeBAR()
BEGIN
DECLARE done INT DEFAULT FALSE;
DECLARE usr_id VARCHAR(255);
DECLARE rl_id ... |
DROP TABLE IF EXISTS skip_idx_comp_parts;
CREATE TABLE skip_idx_comp_parts (a Int, b Int, index b_idx b TYPE minmax GRANULARITY 4)
ENGINE = MergeTree ORDER BY a
SETTINGS index_granularity=256, merge_max_block_size=100;
SYSTEM STOP MERGES;
INSERT INTO skip_idx_comp_parts SELECT number, number FROM numbers(200)... |
<filename>obevo-db-impls/obevo-db-db2/src/test/resources/platforms/db2/step1/DEPLOY_TRACKER/table/TABLE_B.ddl
CREATE TABLE TABLE_B (
B_ID INT NOT NULL,
B_FIELD INT NULL,
CONSTRAINT PK PRIMARY KEY (B_ID)
) IN ${defaultTablespace}
CREATE INDEX TABLE_B_IND1 ON TABLE_B(B_FIELD)
GO
|
<reponame>shahin/gpdb
-- @gucs gp_create_table_random_default_distribution=off
select * from aoschema1.ao_table3;
select * from coschema1.co_table3;
|
create table run (
id text primary key not null,
cwd text,
description text, -- command line or other descriptive argument data
start_time int, -- timestamps as time.time() values
end_time int,
-- error handling
error_message text,
traceback text,
-- performance data
stats te... |
<gh_stars>0
650,5,0
3976,1,0
2620,5,0
601,2,0
502,5,0
13290,3,0
|
COMMENT ON CAST (text AS int4) IS 'Allow casts from text to int4';
|
EXEC sys.sp_configure N'remote access', N'1'
GO
RECONFIGURE WITH OVERRIDE
GO
|
<reponame>binderclip/code-snippets-mysql
SELECT 'David!' LIKE 'David_';
-- 1
SELECT 'David!' LIKE 'David__';
-- 0
SELECT 'David!' LIKE '%Dav%';
-- 1
SELECT 'David!' LIKE 'av%';
-- 0
SELECT * FROM foo5 WHERE g LIKE 'b%';
SELECT * FROM foo5 WHERE g LIKE '%b';
SELECT * FROM foo5 WHERE g LIKE '%b%';
SELECT * FROM foo5 WH... |
Select sd.godina, sd.vrsta_Dok, sd.broj_dok
, sum(sd.z_troskovi) z_tro_st
, round(sum( round(kolicina*(cena1),4)
-
round(kolicina*cena*(1-rabat/100),4)
)
,2 ) z_tro_pr
, (Select sum(z.IZNOS_TROSKA)
From ZAVISNI_TROSKOVI_stavk... |
<filename>database/sql/rekruitmen (1).sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 02, 2016 at 06:54 AM
-- Server version: 10.1.8-MariaDB
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
-- Find names of all employees who have sold over 50,000
SELECT employee.first_name, employee.last_name
FROM employee
WHERE employee.emp_id IN (SELECT works_with.emp_id
FROM works_with
WHERE works_with.total_sales > 50000);
-- Find all clients who are handles by the... |
/*
Warnings:
- You are about to drop the `character_habilities` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `character_inventory` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `character_weapons` tab... |
/* leave this
l:see LICENSE file
g:utility
v:130901.1000\s.zaglio:added begin/end params to grp setup
v:130802.1804,130730,130725,130724\s.zaglio:collection of scripts
*/
CREATE proc sp__script_templates
@opt sysname = null,
@dbg int=0
as
begin try
set nocount on
declare @proc sysname, @ret i... |
<reponame>wedanaadi/siperang<filename>siperang.sql
/*
SQLyog Ultimate
MySQL - 10.1.34-MariaDB : Database - siperang
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!... |
<gh_stars>0
SELECT SUM(a.bytes)/1048576 "Undo (MB)", TABLESPACE_NAME
FROM v$datafile a,
v$tablespace b,
dba_tablespaces c
WHERE c.contents = 'UNDO'
AND c.status = 'ONLINE'
AND b.name = c.tablespace_name
AND a.ts# = b.ts#
group by TABLESPACE_NAME;
|
USE [ANTERO]
GO
/****** Object: StoredProcedure [sa].[p_lataa_virta_opettajakelpoisuus] Script Date: 26.4.2022 9:34:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [sa].[p_lataa_virta_opettajakelpoisuus] AS
DROP TABLE IF EXISTS sa.virta_opettajakelpoisuus
--;WITH pat as (
select
... |
<gh_stars>1-10
CREATE TABLE dbo.Measurement
(
MeasurementId INT NOT NULL IDENTITY, /* Run */
JobSiteId INT NOT NULL,
Joint INT,
PipeLength FLOAT,
ThreadLength FLOAT,
ItemDescription NVARCHAR(MAX),
TopThread NVARCHAR(MAX),
IsDamaged BIT,
CONSTRAINT MeasurementKey PRIMARY KEY (MeasurementId),
CONSTRAINT Measur... |
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`auth` varchar(100) NOT NULL DEFAULT '0',
`username` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`password` varchar(255) NOT NULL DEFAULT '',
`avatar` varchar(255) DEFAULT 'defau... |
<reponame>ducdhm/niit-doc<gh_stars>1-10
use Retail2002_commerce
go
drop table tbProduct
go
drop procedure sp_tbProduct_Add
go
/* Create table */
create table tbProduct (
proCode nvarchar(6)not null,
proCodeDescription varchar(128)not null,
proName varchar(200)not null,
proDescription varchar(2000)not null,
proPric... |
<filename>egov/egov-ptis/src/main/resources/db/migration/main/V20170912150933__ptis_roleActionMappingForWardByBlock.sql
INSERT into EG_ACTION (ID,NAME,URL,QUERYPARAMS,PARENTMODULE,ORDERNUMBER,DISPLAYNAME,ENABLED,CONTEXTROOT,VERSION,CREATEDBY,CREATEDDATE,LASTMODIFIEDBY,LASTMODIFIEDDATE,APPLICATION) values (NEXTVAL('SEQ_... |
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2019-04-24 19:51:33
-- 服务器版本: 5.7.21
-- PHP Version: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
/*
Navicat MySQL Data Transfer
Source Server : local
Source Server Version : 50714
Source Host : localhost:3306
Source Database : 1_one_db
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2018-04-20 13:31:21
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
<reponame>CSCfi/antero<gh_stars>1-10
USE [ANTERO]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TABLE [sa].[sa_oiva_maaraykset_pdi] ALTER COLUMN [id] [varchar] (40) NULL
ALTER TABLE [sa].[sa_oiva_maaraykset_pdi] ALTER COLUMN [lupaId] [varchar] (40) NULL
|
<filename>2020-08-26-RedgateStreamed-SQLServerDevOpsGettingStarted/db/Schema-Model/dbo/Tables/Customers.sql
CREATE TABLE [dbo].[Customers]
(
[ID] [int] NOT NULL IDENTITY(1, 1),
[FullName] [varchar] (150) NOT NULL,
[Street] [varchar] (100) NOT NULL,
[City] [varchar] (100) NOT NULL,
[State] [varchar] (2) NOT NULL,
[Zip] ... |
<reponame>Special-K-s-Flightsim-Bots/DCSServerBot
INSERT INTO plugins (plugin, version) VALUES ('help', 'v1.0') ON CONFLICT (plugin) DO NOTHING;
|
delete from ad_tab where ad_table_id = get_table_id('AD_JAXRS_Endpoint');
delete from ad_table_process where ad_table_id = get_table_id('AD_JAXRS_Endpoint');
delete from ad_table where ad_table_id = get_table_id('AD_JAXRS_Endpoint');
drop table ad_jaxrs_endpoint;
drop SEQUENCE ad_jaxrs_endpoint_seq;
delete from ad_ja... |
<filename>docs/2014/snippets/tsql/SQL15/tsql/databaseddl/transact-sql/filefunctionsandsprocs.sql
-- File function examples
--<snippetFileFunction1>
USE AdventureWorks2012;
GO
SELECT FILEGROUPPROPERTY('PRIMARY', 'IsDefault') AS 'Default Filegroup';
GO
--</snippetFileFunction1>
--<snippetFileFunction2>
USE Adve... |
--all the selects below should return null
select distinct crs.vocabulary_id_1, crs.vocabulary_id_2 from concept_relationship_stage crs
left join vocabulary v1 on v1.vocabulary_id=crs.vocabulary_id_1 and v1.latest_update is not null
left join vocabulary v2 on v2.vocabulary_id=crs.vocabulary_id_2 and v2.latest_update ... |
<filename>priv/rewards.sql
-- :reward_block_range
with max as (
select height from blocks where timestamp <= $1 order by height desc limit 1
),
min as (
select height from blocks where timestamp >= $2 order by height limit 1
)
select (select height from max) as max, (select height from min) as min
-- :reward_... |
CREATE VIEW IF NOT EXISTS view_desktop_results AS
SELECT m.map_unit_id,
m.map_unit_name,
m.meadow,
(CASE WHEN m.conifer_phase IS NULL THEN 'None' END) AS conifer_phase,
m.indirect_benefits_area,
m.map_unit_area,
m.no_transects,
m.spring_hs... |
SET REFERENTIAL_INTEGRITY FALSE;
INSERT INTO AUTH_USER( ID, NAME, STATUS, TYPE, TEL, EMAIL, SEX, BIRTHDAY, FAMILY_ADDR, WORK_ADDR, WORK_TEL, DESCRIPTION, UPDATE_TIME, CREATE_TIME ) VALUES
('xKQJKJBWR7ziMpyBFFd','管理员','Y','S','13800138000','<EMAIL>','M','1970-01-01 00:00:00','','','','','1970-01-01 00:00:00','1970-01-... |
<filename>tb_tickets.sql
CREATE TABLE `tb_tickets` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`stub` char(1) NOT NULL DEFAULT '',
`last_id` bigint(20) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE KEY `stub` (`stub`)
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
INSERT INTO `tb_ti... |
<filename>lab302-batch-job-test/src/script/oracle/dml/schema-insert-oracle.sql
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100050);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100050);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'custo... |
-------------------------------------------------------------------------------
-- disk space
-------------------------------------------------------------------------------
CREATE TABLE DISK_SPACE(
ID BIGINT NOT NULL,
CATALOG VARCHAR(50),
TYPE VARCHAR(50),
NAME VARCHAR(200),
DESCRIPTIO... |
<filename>sql/nodeutil.sql
/* ======================================================================== */
/* PeopleRelay: nodeutil.sql Version: 0.4.3.6 */
/* */
/* Copyright 2017-2018 <NAME> & <NAME> ... |
-- Name: FileNameReportByImportEventWithMrData
-- Schema: posda_files
-- Columns: ['file_id', 'patient_id', 'study_instance_uid', 'study_date', 'study_description', 'series_instance_uid', 'modality', 'series_date', 'series_description', 'dicom_file_type', 'file_name', 'mr_scanning_seq', 'mr_scanning_var', 'mr_scan_opti... |
CREATE TABLE `{$NAMESPACE}_harbormaster`.`lisk_counter` (
counterName VARCHAR(64) COLLATE utf8_bin PRIMARY KEY,
counterValue BIGINT UNSIGNED NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 27, 2016 at 01:30 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
<reponame>dsmalik/FunnelWeb
insert into $schema$.[Setting]([Name], [DisplayName], [Value], [Description]) values ('spam-blacklist', 'Spam Blacklist', 'casino', 'Comments with these words (case-insensitive) will automatically be marked as spam, in addition to Akismet.');
|
-- @ building peptide to protein relations ...
OPTIMIZE TABLE peptide;
OPTIMIZE TABLE protein;
-- @ : using all proteins ...
-- unfiltered peptides to proteins relation
DROP TABLE IF EXISTS pep2pro;
CREATE TEMPORARY TABLE pep2pro
SELECT
pe.`index` as pep_index, w.sample_index, pe.`workflow_index`,
pe.`sequence`, ... |
CREATE TABLE users_products (
user_id INTEGER NOT NULL,
product_id INTEGER NOT NULL,
wishlist bool NOT NULL DEFAULT false,
comment varchar NULL,
PRIMARY KEY (user_id, product_id),
FOREIGN KEY (user_id) REFERENCES users(user_id) ON DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY (product_id) REFERENCES prod... |
<filename>sql/seed_data_fixture.sql
INSERT INTO public."User"
("name", email, "passwordHash", "role", "createdAt", "updatedAt")
VALUES('<NAME>', '<EMAIL>', 'j19w3kq8f94qj74a7bvzw9nc', 'SUPERADMIN'::"UserRole", CURRENT_TIMESTAMP, CURRENT_TIMESTAMP);
INSERT INTO public."User"
("name", email, "passwordHash", "role", "cre... |
<filename>app/gateways/db/postgres/migrations/000001_create_accounts_table.up.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS "accounts" (
"id" uuid PRIMARY KEY,
"name" varchar NOT NULL,
"cpf" varchar NOT NULL,
"secret" varchar NOT NULL,
"balance" bigint NOT NULL,
"created_at" timestamptz NOT NULL
); |
grant create table to Contabilidad; /* Le damos permisos a todos los de ese grupo/rol*/
grant select on pepe:notas to Juan; /* El operador de ámbito ":" indica quién es el propietario del objeto
/*permisos de sistema == permisos de instrucciones*/
grant create table to contar as Usuarioqueejecutalaorden with grant opti... |
----------13-12-2016------------------------------------------------------
ALTER TABLE `taken_leave` ADD `days` INT(255) NOT NULL AFTER `till_when`;
--create table 'notice_board'|sunny|29 jul 16
CREATE TABLE IF NOT EXISTS `passing_year` (
`id` int(11) NOT NULL,
`passing_year` mediumint(255) NOT NULL
)
INSERT INTO `... |
use ztepsicc_jarvis;
go
create table dbo.Devices (
Id int identity(1, 1)
constraint PK_Device_Id primary key
, DeviceExtId nvarchar(30) not null
, Name nvarchar(30) not null
, Host nvarchar(30) not null
, Description ntext
, Active bit not null default 0
);
go
exec sys.sp_addextendedproperty @name=N'MS_Descriptio... |
/* leave this
l:see LICENSE file
g: script,utility
v:110326\s.zaglio: added parameters clear
v:110305\s.zaglio: done first version
r:100127\s.zaglio: create a vb function to call a sp
t:sp__util_sp2dotnet 'sp__util_sp2dotnet',@opt='class'
*/
CREATE proc [dbo].[sp__util_sp2dotnet]
@obj sysn... |
CREATE DEFINER=`homestead`@`%` PROCEDURE `sp_getUser`(
in _emailUser VARCHAR(30),
in _passwordUser VARCHAR(150)
)
BEGIN
DECLARE _idUser INT DEFAULT 0;
BEGIN
SET _idUser := (select s.fkIdUser from tblSesion s WHERE s.name = _emailUser AND s.password = _<PASSWORD>);
END ;
BEGIN
I... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.20-log - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------... |
-- doc
CREATE TABLE IF NOT EXISTS `zt_doc` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`company` smallint(5) unsigned NOT NULL,
`product` mediumint(8) unsigned NOT NULL,
`project` mediumint(8) unsigned NOT NULL,
`lib` varchar(30) NOT NULL,
`module` varchar(30) NOT NULL,
`title` varchar(120) NOT ... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3307
-- Generation Time: Oct 19, 2019 at 12:06 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
<filename>migrations/20210327132800_update_item_values.down.sql
ALTER TABLE item_values
DROP COLUMN description;
ALTER TABLE item_values
DROP COLUMN image_url;
|
-- misc4.test
--
-- execsql {
-- CREATE TABLE t1(x);
-- INSERT INTO t1 VALUES(1);
-- }
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(1); |
-- randexpr1.test
--
-- db eval {SELECT e | t1.e*case d when t1.e then a else case when t1.a<= -~+e then b else 17-t1.e end*c*f+case when case when +c in (select +min(11) from t1 union select cast(avg(f) AS integer) from t1) and b between c and t1.f then 11+t1.a when f>=c then d else t1.c end<t1.c and t1.d between t1.... |
<filename>Chapter12/tagext/tagext--1.0.sql
CREATE OR REPLACE FUNCTION tag_path( tag_to_search text )
RETURNS TEXT
AS $CODE$
DECLARE
tag_path text;
current_parent_pk int;
BEGIN
tag_path = tag_to_search;
SELECT parent
INTO current_parent_pk
FROM tags
WHERE tag = tag_to_search;
-- here we must loop... |
<reponame>overachiever-productions/s4<filename>S4 Diagnostics/Security/list_role_members.sql
/*
TODO: this needs the 'execute in calling-context' convention
as in ... it needs to do MORE than just run this query against roles in the admindb...
it can/should be able to run against ... other dbs and their rol... |
alter table entries
add column properties json;
|
<reponame>CoveHealth/adwords
{% macro stitch_adwords_accounts() %}
{{ adapter.dispatch('stitch_adwords_accounts', 'adwords')() }}
{% endmacro %}
{% macro default__stitch_adwords_accounts() %}
with accounts_source as (
select * from {{ var('accounts_table') }}
),
accounts_renamed as (
select
... |
<gh_stars>0
DELIMITER $$
DROP PROCEDURE IF EXISTS `jj`.`entry_view_latest_rss` $$
CREATE PROCEDURE `jj`.`entry_view_latest_rss`()
BEGIN
SELECT
us.id AS id,
us.username,
eh.date AS date,
eh.subject AS subject,
eh.music,
eh.body,
mood.title AS mood... |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50525
Source Host : localhost:3306
Source Database : basic
Target Server Type : MYSQL
Target Server Version : 50525
File Encoding : 65001
Date: 2016-07-24 23:11:37
*/
SET FO... |
<filename>fixtures/doctests/textsearch/028/input.sql<gh_stars>0
supernovae stars : sn
crab nebulae : crab
|
SELECT id, name, description, ST_Transform(extent, {{ srid }}) as geometry
FROM app_users_resources
WHERE id::text = '{{ resource_id }}'
|
<reponame>328nt/GEM
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th9 03, 2019 lúc 05:37 AM
-- Phiên bản máy phục vụ: 10.3.15-MariaDB
-- Phiên bản PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_... |
-- https://leetcode.com/problems/department-highest-salary
select department.name as department, employee.name as employee, employee.salary
from employee join department on employee.departmentid = department.id
where (departmentid, salary) in (select departmentid, max(salary) from employee group by departmentid)
|
-- MySQL dump 10.13 Distrib 8.0.19, for Win64 (x86_64)
--
-- Host: 172.16.31.10 Database: S2C
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!4... |
<reponame>SimeonGerginov/Database-Management-Systems
USE Flights
GO
CREATE TABLE Airlines (
code char(2) PRIMARY KEY,
name varchar(20) NOT NULL
);
GO
CREATE UNIQUE INDEX Index_Airlines_Name
ON Airlines(name);
GO |
SELECT * FROM Accounts WHERE account_number LIKE CONCAT('%', :search, '%');
|
INSERT INTO Towns (Id,Name)
VALUES (1,'Sofia'),
(2,'Plovdiv'),
(3,'Varna')
INSERT INTO Minions(ID,Name,Age,TownId)
VALUES
(1,'Kevin',22,1),
(2,'Bob',15,3),
(3,'Steward',NULL,2)
|
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND SCHEMA_NAME([schema_id]) = 'EPONS' AND QUOTENAME(name) = '[UpdateFacilityAvatar]')
DROP PROCEDURE [EPONS].[UpdateFacilityAvatar]
GO
CREATE PROCEDURE [EPONS].[UpdateFacilityAvatar]
@facilityId UNIQUEIDENTIFIER,
@bytes IMAGE
AS
UPDATE [Facility].[Details]
SET ... |
<filename>5.2.3/Database/Indexes/AFW_25_PUBLC_PK.sql
SET DEFINE OFF;
CREATE UNIQUE INDEX AFW_25_PUBLC_PK ON AFW_25_PUBLC
(SEQNC)
LOGGING
/
|
create or replace table `agency_data_pipeline`.`fb_ads_stats`
as (
with cost as (
select
date, account, ad_id, campaign,
cost, impressions, clicks, null as conversions
from `adp-apprenticeship`.`agency_data_pipeline`.`fb_ads_insights`
),
conversions as (
select
date, ac... |
<filename>src/References/WideWorldImportersDW/Integration/Tables/StockItem_Staging.sql<gh_stars>1-10
CREATE TABLE [Integration].[StockItem_Staging] (
[Stock Item Staging Key] INT IDENTITY (1, 1) NOT NULL,
[WWI Stock Item ID] INT NOT NULL,
[Stock Item] NVARCHAR... |
<gh_stars>1000+
create or replace view `dataline-integration-testing`._airbyte_test_normalization.`unnest_alias_ab3`
OPTIONS()
as
-- SQL model to build a hash column based on the values of this record
select
to_hex(md5(cast(concat(coalesce(cast(id as
string
), ''), '-', coalesce(cast(array_to_string(c... |
--
-- packages/acs-mail/sql/acs-mail-queue-create.sql
--
-- @author <NAME> <<EMAIL>>
-- @creation-date 2001-01-08
-- @cvs-id $Id: acs-mail-queue-create.sql,v 1.1.1.1 2005/04/18 19:26:06 cvs Exp $
--
begin
acs_object_type.create_type (
supertype => 'acs_mail_link',
object_type => 'acs_mail_queue_mes... |
<filename>conf/evolutions/default/9.sql
# ---
# --- !Ups
alter table user_metadata add constraint user_metadata_pk primary key(user_metadata_id);
create unique index user_metadata_store_user_id on user_metadata(store_user_id);
# --- !Downs
alter table user_metadata drop constraint user_metadata_pk;
drop index use... |
{{ config(materialized='source') }}
{% set source_name %}
{{ mz_generate_name('inventory_customers') }}
{% endset %}
CREATE SOURCE {{ source_name }}
FROM KAFKA BROKER 'redpanda:9092' TOPIC 'dbserver1.inventory.customers'
FORMAT AVRO USING CONFLUENT SCHEMA REGISTRY 'http://redpanda:8081'
ENVELOPE DEBEZIUM; |
<gh_stars>1-10
-- -----------------------------------------------------------------------------
-- Pifuxel Migrate v2-v3
--
-- mysql -h $HOST -u $USER --password $DB < migrate-002-003.sql
ALTER TABLE Accounts ADD password_hash BLOB;
ALTER TABLE Accounts MODIFY key_exponent BLOB;
ALTER TABLE Accounts MODIFY key_modu... |
CREATE OR REPLACE FORCE EDITIONABLE VIEW "RDS_FTA"."FTA_RANGE_USAGE" ("FOREST_FILE_ID", "CALENDAR_YEAR", "AUTHORIZED_USE", "NON_USE_NONBILLABLE", "NON_USE_BILLABLE", "TEMP_INCREASE", "TOTAL_ANNUAL_USE") AS
SELECT
PFU.FOREST_FILE_ID
, RPV.CALENDAR_YEAR
, RPV.AUTHORIZED_USE
, RPV.NON_USE_NONBIL... |
-- Tags: no-tsan, no-asan, no-ubsan, no-msan, no-debug, no-cpu-aarch64
-- This file contains tests for the event_time_microseconds field for various tables.
-- Note: Only event_time_microseconds for asynchronous_metric_log table is tested via
-- an integration test as those metrics take 60s by default to be updated.
-... |
library CqlIntervalOperatorsTest version '1.4.0'
using QUICK version '3.3.0'
context Patient
define "After": Tuple{
"TestAfterNull": Tuple{
skipped: 'Converts null to Interval[null,null] instead of Interval(null,null)'
/*
expression: (null as Integer) after Interval[1, 10],
output: null
*/ },
... |
<gh_stars>100-1000
-- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
set define off
set pause on
prompt
prompt
prompt **************************************************************************
p... |
<reponame>turbot/steampipe-mod-kubernetes-compliance<filename>query/cronjob/cronjob_default_namesapce_used.sql
select
-- Required Columns
uid as resource,
case
when namespace = 'default' then 'alarm'
else 'ok'
end as status,
case
when namespace = 'default' then name || ' uses default namespace.'
... |
#standardSQL
# https://towardsdatascience.com/python-pypi-stats-in-bigquery-reclustered-d80e583e1bfe
# arbitrary algorithm
SELECT project, SUM(c) total
FROM (
SELECT project, c, month
FROM (
SELECT *
, (months[OFFSET(month_presence-1)]-months[OFFSET(0)])/months[OFFSET(month_presence-1)] growth
FROM (... |
-- @author prabhd
-- @created 2012-12-05 12:00:00
-- @modified 2012-12-05 12:00:00
-- @tags dml
-- @db_name dmldb
-- @description test: Boundary test for cidr
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
DROP TABLE IF EXISTS dml_cidr;
CREATE TABLE dml_cidr (a cidr) distributed by... |
SELECT event_id,
dateOf(created_at) AS creation_date,
blobAsText(content) AS content
FROM timeline;
SELECT COUNT(*)
FROM system.IndexInfo;
SELECT lastname
FROM cycling.cyclist_name
LIMIT 50000;
SELECT id, lastname, teams
FROM cycling.cyclist_career_teams
WHERE id=5b6962dd-3f90-4c93-8f61-eabfa4a803e2;
... |
<gh_stars>0
CREATE TABLE message_template (
mt_id serial PRIMARY KEY,
mt_body text,
mt_name text,
mt_type text
);
CREATE TABLE sent_message (
mt_id int4,
list_id int4,
status text,
send_datetime timestamp default now()
);
CREATE TABLE outbox (
mt_id int4,
list_id int4,
send_datetime timestamp defau... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Máy chủ: localhost:3306
-- Thời gian đã tạo: Th3 19, 2020 lúc 05:09 PM
-- Phiên bản máy phục vụ: 10.2.31-MariaDB-log-cll-lve
-- Phiên bản PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zon... |
<filename>EMS.sql
CREATE DATABASE EMS;
USE ems;
CREATE TABLE employee
(
user_type VARCHAR(255) default 'NORMAL USER',
emp_id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
emp_firstname VARCHAR(255) NOT NULL,
emp_lastname VARCHAR(255) NOT NULL,
mobile_num VARCHAR(10) NOT NULL,
dat... |
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 15, 2016 at 03:03 AM
-- Server version: 5.6.20
-- PHP Version: 5.5.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
--- This file has been generated by scripts/build_db.py. DO NOT EDIT !
INSERT INTO "vertical_datum" VALUES('EPSG','1027','EGM2008 geoid',NULL,NULL,'EPSG','1262',0);
INSERT INTO "vertical_datum" VALUES('EPSG','1028','Fao 1979',NULL,NULL,'EPSG','3625',0);
INSERT INTO "vertical_datum" VALUES('EPSG','1030','N2000',NULL,NU... |
COPY temp ({}) FROM STDIN WITH CSV HEADER;
WITH temp AS (
SELECT DISTINCT ON
(temp.start_date, temp.trip, temp.stop) *
FROM temp
WHERE temp.header_timestamp <= temp.arrival
OR temp.header_timestamp <= temp.departure
ORDER BY temp.start_date, temp.trip, temp.stop, temp.stop_number,
temp.header_timestamp D... |
-- :name upsert-custom-map :! :n
-- :doc Upsert a custom map
INSERT INTO custom_map(
analysis_id,
file_name,
file_url
)
VALUES (
:analysis-id,
:file-name,
:file-url
)
ON DUPLICATE KEY UPDATE
file_name = IF(:file-name IS NOT NULL, :file-name, file_name),
file_url = IF(:file-url IS NOT NULL, :file-ur... |
select OWNER,
TABLE_NAME
from (
select OWNER,
TABLE_NAME
from dba_tables
minus
select TABLE_OWNER,
TABLE_NAME
from dba_indexes
) orasnap_noindex
where OW... |
CREATE VIEW vwUsers AS
SELECT p.nIdPersona as eIdPer,r.nIdRPT as eIdUsr,
p.txtNombre as nombre, p.txtApellidos as apellidos,
p.txtRFC as RFC, t.nIdTipoP as eTipo, t.txtTipo tipo
FROM relusuario r
inner join catpersonas p
ON r.fk_eIdPersona = p.nIdPersona
INNER JOIN cattipopersona t
ON r.fk_eIdTipoP = t.nIdTipoP... |
CREATE PROCEDURE [dbo].[dnn_GetSkinControl]
@SkinControlID int
AS
SELECT *
FROM dbo.dnn_SkinControls
WHERE SkinControlID = @SkinControlID
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.