sql stringlengths 6 1.05M |
|---|
do $$
begin
-- IMPORTANT: THIS SCRIPT RUNS **ALWAYS** AT STARTUP
-- DO NOT PLACE ANYTHING IN HERE THAT IF RAN
-- MULTIPLE TIMES WOULD CREATE SIDE EFFECTS OR
-- DUPLCIATE ROWS, EVERYTHING MUST CHECK IF IT
-- ALREADY EXISTS!
create extension if not exists pgcryp... |
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE general_params ( "name" text, "value" text );
INSERT INTO "general_params" VALUES('list_report_data_table','V_Experiment_List_Report_2');
INSERT INTO "general_params" VALUES('list_report_data_sort_dir','DESC');
INSERT INTO "general_params" VALUES('detail_re... |
--
-- Insert data into table `#__content_types` for UCM functions
--
INSERT INTO `#__content_types` (`type_title`, `type_alias`, `table`, `rules`, `field_mappings`, `router`, `content_history_options`) VALUES
('Weblink', 'com_weblinks.weblink', '{"special":{"dbtable":"#__weblinks","key":"id","type":"Weblink","prefix":... |
-- Sanity checks
CREATE VIEW cqanalyze0 AS SELECT substring(url, 1, 2) FROM analyze_cont_stream;
CREATE VIEW cqanalyze1 AS SELECT CASE WHEN x = '1' THEN 1 END FROM analyze_cont_stream;
CREATE VIEW cqanalyze2 AS SELECT a FROM analyze_cont_stream GROUP BY a;
CREATE VIEW cqanalyze3 AS SELECT a FROM analyze_cont_stream WHE... |
/*
This migration adds the table for episodes to store before sending to the server.
Current DAO implementation for 30s episodes uses the same schema and table name, so we reproduce the schema
from the server.
*/
BEGIN IMMEDIATE;
CREATE TABLE IF NOT EXISTS "episodes_30s"
(
timeslot INTEGER NOT NULL,
... |
CREATE PROC UserViewByID
@UserID int
AS
SELECT *
FROM UserRegistration
WHERE UserID = @UserID |
<reponame>VenelinKadankov/CS-DB-MSSQL<gh_stars>0
CREATE OR ALTER TRIGGER tr_BuyItemHigherLevelRestricted
ON UserGameItems INSTEAD OF INSERT
AS
DECLARE @ItemId INT = (SELECT ItemId FROM inserted)
DECLARE @UserGameId INT = (SELECT UserGameId FROM inserted)
DECLARE @ItemMinLevel INT = (SELECT MinLevel FROM Items WHERE... |
<filename>Mercury.Database/Mercury.Database.Environment/Schema Objects/Schemas/dbo/Tables/MemberCaseAudit.table.sql
-- DBO.[MEMBERCASEAUDIT] (BEGIN)
/*
IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_NAME = 'MemberCaseAudit') AND (TABLE_SCHEMA = 'dbo'))
DROP TABLE dbo.[MemberCaseAudit]
GO... |
<gh_stars>0
CREATE DATABASE IF NOT EXISTS burger_db;
USE burger_db;
CREATE TABLE burgers(
id int NOT NULL AUTO_INCREMENT,
burger_name varchar(255) NOT NULL,
devoured bool default false,
date TIMESTAMP default current_timestamp,
PRIMARY KEY (id)
);
|
<reponame>jspilinek/oracleperf
SELECT GROUP#, THREAD#, SEQUENCE#, BYTES/1048576 AS MB,
BLOCKSIZE, MEMBERS, ARCHIVED, STATUS,
FIRST_CHANGE#, TO_CHAR(FIRST_TIME, 'YYYY-MM-DD HH24:MI:SS') AS FIRST_TIME,
CASE STATUS WHEN 'CURRENT' THEN NULL ELSE NEXT_CHANGE# END AS NEXT_CHANGE#,
TO_CHAR(NEXT_TIME, 'YYYY-MM-... |
<reponame>pblin/re-datamarket-mvp<gh_stars>0
-- Drop database rebloc_data
CREATE DATABASE rebloc_data
WITH
OWNER = reblocadmin
ENCODING = 'UTF8'
LC_COLLATE = 'English_United States.1252'
LC_CTYPE = 'English_United States.1252'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
GRANT ALL ON D... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 04, 2019 at 03:11 AM
-- Server version: 5.7.24-0ubuntu0.16.04.1
-- PHP Version: 5.6.38-3+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!... |
CREATE TABLE [dbo].[Equipment] (
[Id] INT NOT NULL,
[Name] VARCHAR (50) NOT NULL,
[Description] VARCHAR (MAX) NOT NULL,
[Weight] INT NOT NULL,
[DamageLow] INT NULL,
[DamageHigh] INT NULL,
[ArmorBonus] INT NULL,
... |
DROP DATABASE IF EXISTS "messages";
CREATE DATABASE "messages";
\c "messages"
CREATE TABLE posts
(
id SERIAL PRIMARY KEY,
text TEXT NOT NULL,
created timestamp
with time zone NOT NULL default CURRENT_DATE
);
INSERT INTO posts
(text)
VALUES
('Everyone loves posting first. I win!'),
('Oh well... |
<reponame>DataHandwerk/DataHandwerk-toolkit-mssql
CREATE View property.RepoObjectColumnProperty_InheritanceType_InheritanceDefinition
As
Select
--
roc.RepoObjectColumn_guid
, pn.property_name
, rocp.property_value
, Inheritance_StringAggSeparatorSql = Coalesce (
... |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SPC_COM_DENOUNCE]') AND type IN (N'P', N'PC'))
/****** Object: StoredProcedure [dbo].[SPC_M001L_FND1] Script Date: 2017/11/23 16:46:46 ******/
DROP PROCEDURE [dbo].[SPC_COM_DENOUNCE]
GO
/****** Object: StoredProcedure [dbo].[SPC_M001L... |
<reponame>jocelinoFG017/ControlEstoque
Drop Schema estoque;
CREATE database IF NOT EXISTS estoque;
use estoque;
SET FOREIGN_KEY_CHECKS=0;
-- Tabela Produtos
CREATE TABLE IF NOT EXISTS produto (
idProduto smallINT(11) NOT NULL auto_increment,
nome VARCHAR(45) NOT NULL,
descricao VARCHAR(70) NOT NULL,
valor IN... |
/*
--RUN ONCE ONLY!!!
CREATE SCHEMA acs2010_spt;
*/
SET search_path = acs2010_spt, public;
SET client_encoding = 'LATIN1';
--CREATE TABLE TO HOLD FIELD DEFINITIONS FOR geoheader
CREATE TABLE geoheader_schema (
line_number serial,
Name varchar,
Descr varchar,
Field_Size int,
Starting_Position int,
sumlevels va... |
DROP TABLE sessions;
|
<filename>src/test/resources/sql/insert/734d8abc.sql<gh_stars>10-100
-- file:macaddr8.sql ln:46 expect:true
INSERT INTO macaddr8_data VALUES (10, '08:00:2b:01:02:04')
|
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied
create table workflow_step_member
(
id uuid primary key default uuid_generate_v4(),
idworkflowstep uuid not null references workflow_step(id),
iduser uuid null references users(id),
idgroup uuid null references groups(id)
);
-- +migr... |
-- 2020-06-26T12:37:41.980Z
-- URL zum Konzept
UPDATE AD_Element_Trl SET IsTranslated='Y', Name='Verändert Kosten', PrintName='Verändert Kosten',Updated=TO_TIMESTAMP('2020-06-26 15:37:41','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=543853 AND AD_Language='de_CH'
;
-- 2020-06-26T12:37:42.188Z
-- URL zum ... |
select * from City where Name = 'Morn';
select * from City where Name >= 'Morn' and Name <= 'Tbessa';
create index name_idx on City (Name);
select * from City where Name = 'Morn';
select * from City where Name >= 'Morn' and Name <= 'Tbessa';
insert into City values (101,'<NAME>','ARG','Mendoza',206998);
insert ... |
INSERT INTO admin.Admins (email, member_admin, member_list, siteselection, hugo_admin, raami_admin, admin_admin)
VALUES ('<EMAIL>', true, true, false, true, true, true),
('<EMAIL>', true, false, false, false, false, false),
('<EMAIL>', false, true, true, false, false, false),
('... |
<filename>PartXI/lesson1/sql/schema.sql<gh_stars>10-100
CREATE DATABASE STORAGE;
CREATE TABLE IF NOT EXISTS USERS (
user_id serial PRIMARY KEY NOT NULL,
name VARCHAR (150)
);
|
<filename>models/mixpanel__sessions.sql<gh_stars>1-10
{{
config(
materialized='incremental',
unique_key='session_id',
partition_by={
"field": "session_started_on_day",
"data_type": "date"
}
)
}}
-- need to grab all events for relevant users
with events as... |
DROP TABLE IF EXISTS persistent_logins CASCADE;
CREATE TABLE persistent_logins (
username VARCHAR(50),
series VARCHAR(64) PRIMARY KEY,
token VARCHAR(64) NOT NULL,
last_used TIMESTAMP NOT NULL,
FOREIGN KEY (username) REFERENCES users (username)
);
|
-- MariaDB dump 10.17 Distrib 10.4.10-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: nycflights
-- ------------------------------------------------------
-- Server version 10.4.10-MariaDB-1:10.4.10+maria~bionic
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @... |
INSERT INTO estados VALUES
(11,'RO','Rondônia',-10.83,-63.34),
(12,'AC','Acre',-8.77,-70.55),
(13,'AM','Amazonas',-3.47,-65.1),
(14,'RR','Roraima',1.99,-61.33),
(15,'PA','Pará',-3.79,-52.48),
(16,'AP','Amapá',1.41,-51.77),
(17,'TO','Tocantins',-9.46,-48.26),
(21,'MA','Maranhão',-5.42,-45.44),
(22,'PI','Piauí',-6.6,-42.... |
<reponame>Shubhamdutta2000/semester-4-works<filename>FINAL_Practical/DBMS/sqlCodes/student.sql<gh_stars>0
CREATE DATABASE Stud;
use Stud;
CREATE TABLE Student (
s_no int,
s_name varchar(255) ,
dept_no int,
s_dob varchar(255)
);
ALTER TABLE Student ADD s_yr int;
ALTER TABLE Student ADD s_roll int;
INS... |
<filename>misc/schema/iot.sql<gh_stars>0
-- MySQL Script generated by MySQL Workbench
-- su 31. tammikuuta 2021 17.14.32
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHEC... |
-- ------------------------------------------------------------------------------------------
-- Copyright AspDotNetStorefront.com. All Rights Reserved.
-- http://www.aspdotnetstorefront.com
-- For details on this license please visit our homepage at the URL above.
-- THE ABOVE NOTICE MUST REMAIN INTACT.
-- ----------... |
<reponame>juniorb2ss/checkin-website<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 30-Jun-2018 às 05:52
-- Versão do servidor: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACT... |
drop table if exists loader_redbull;
create table loader_redbull (
one integer(4),
position integer(4),
name varchar(1024) default '',
team varchar(1024) default '',
category varchar(40) default '',
country varchar(40) default '',
plate varchar(10) default '',
time varchar(20) default '',
city varchar(255) default ''... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 28, 2018 at 01:21 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 31, 2018 at 12:13 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.1.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
DROP TABLE IF EXISTS exports.properties;
CREATE TABLE exports.properties as
SELECT
id,
address_street,
street_index,
google_index,
address_suburb,
address_state,
address_postcode,
description_type,
description_beds,
description_bath,
description_car,
people_id,
optio... |
SELECT tb_produtos.*, UN.Codigo AS CodigoUnidadeApresentacao, UN.Descricao AS DescricaoUnidadeApresentacao, Grupo.Descricao AS DescricaoGrupo, SubGrupo.Descricao AS DescricaoSubGrupo, Setor.Descricao AS DescricaoSetor, Fornecedor.Descricao AS DescricaoFornecedor, Tipo.Descricao AS DescricaoTipo, CST.Codigo AS Codigo_CS... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 04, 2019 at 12:50 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
DROP TABLE IF EXISTS my_table;
CREATE TABLE IF NOT EXISTS my_table(
`id` bigint primary key auto_increment not null,
`name` varchar(150),
`age` int,
`enum1` varchar(100),
`enum2` int,
`data` longtext,
`dval` double,
`longDate` bigint,
`stringDate` varchar(100),
`date` dateti... |
create table alumno(
id_alumno int not null auto_increment primary key,
nombre varchar(40),
apellido varchar(50),
email varchar(35)
);
insert into alumno(nombre, apellido, email) values ('Guido', 'Torres', '<EMAIL>');
create table cuadernos(
id_cuaderno int primary key not null auto_increment,
t... |
<reponame>dasong2410/MysqlNotes<filename>mssql/MaintenanceSolution/Jobs/sp_purge_jobhistory.sql<gh_stars>0
USE [msdb]
GO
/****** Object: Job [sp_purge_jobhistory] Script Date: 9/1/2020 2:21:36 PM ******/
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
/****** Object: JobCategory [Database Mainten... |
DROP PROCEDURE procedure_name;
DROP PROC procedure_name;
DROP PROCEDURE IF EXISTS procedure_name;
DROP PROCEDURE procedure_name1, procedure_name2;
|
drop view "public"."evic_by_date";
|
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- create trigger update_bid after insert on transactions for each row execute procedure trigger_update_bid();
|
SET @sName = 'bx_accounts';
-- FORMS
DELETE FROM `sys_form_displays` WHERE `display_name`='bx_accounts_account_create';
INSERT INTO `sys_form_displays` (`display_name`, `module`, `object`, `title`, `view_mode`) VALUES
('bx_accounts_account_create', @sName, 'bx_accounts_account', '_sys_form_display_account_creat... |
select
type || ' ' || name as resource,
case
when (arguments -> 'node_config' ->> 'image_type') = 'COS_CONTAINERD' then 'ok' else 'alarm'
end as status,
name || case
when (arguments -> 'node_config') is null then ' ''node_config'' is not defined'
when coalesce(trim((arguments -> 'node_config' ->> 'i... |
<gh_stars>0
select count(distinct(state_id_born)) from president
where birth_year < 1900 |
<reponame>volodinaa87/Testing
--------------------------------------------------------------------------------------------------------------------
----------------------------------------------PL/SQL RECORDS--------------------------------------------------------
------------------------------------------------------... |
<filename>schema_to_neato/test/install_tables.sql
create table erd_parent (
id number primary key,
txt varchar2(10)
);
create table erd_child_1 (
id number primary key,
id_p references erd_parent,
txt varchar2(10)
);
create table erd_child_2 (
id number primary key,
id_p references erd_parent,
txt ... |
<gh_stars>1-10
create table cd_pipeline_third_party_service
(
cd_pipeline_id integer not null
constraint cd_pipeline_fk
references cd_pipeline
on delete cascade,
third_party_service_id integer not null
constraint third_party_service_fk
references third... |
select name, arn, id, scope, region
from aws.aws_wafv2_rule_group
where akas::text = '["{{output.resource_aka_regional.value}}"]'; |
<reponame>muntaza/catatan_openaset_balangan
CREATE OR REPLACE VIEW view_atl_kabupaten AS
SELECT
atl.id_sub_skpd,
sub_skpd.nama_sub_skpd,
sub_skpd.id_skpd,
skpd.nama_skpd,
skpd.id_lokasi_bidang,
lokasi_bidang.nama_lokasi_bidang,
lokasi_bidang.id_kabupaten,
kabupaten.nama_kabupaten,
kabupaten.id_provinsi,
provinsi.... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Сен 13 2019 г., 11:13
-- Версия сервера: 10.3.13-MariaDB
-- Версия PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- 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='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema aia
-- --... |
-- @testpoint:opengauss关键字numstr非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists numstr;
create sequence numstr start 100 cache 50;
drop sequence numstr;
--关键字带双引号-成功
drop sequence if exists "numstr";
create sequence "numstr" start 100 cache 50;
drop sequence "numstr";
--关键字带单引号-合理报错
drop sequence if exists 'numstr... |
<gh_stars>100-1000
set current_schema=vector_engine;
set enable_vector_engine=on;
set enable_nestloop=off;
explain (costs off) select
o_orderpriority,
count(*) as order_count
from
orders
where
o_orderdate >= '1993-07-01'::date
and o_orderdate < '1993-07-01'::date + interval '3 month'
and exists (
select
*
... |
<gh_stars>0
-- Select 1
SELECT 1
|
<reponame>94694/Attachment-2019
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 16, 2017 at 10:40 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
SELECT tb_trabalha_em.NUMERO_PROJETO FROM tb_funcionario
INNER JOIN tb_trabalha_em ON tb_funcionario.CPF = tb_trabalha_em.CPF_FUNCIONARIO
WHERE tb_funcionario.ULTIMO_NOME = 'Souza'
UNION
SELECT tb_projeto.NUMERO_PROJETO FROM tb_funcionario
INNER JOIN tb_departamento ON tb_funcionario.CPF = tb_departamento.CPF_GERENTE
... |
<filename>db/DATA_JOBS_PROGRESS_TOTAL.sql<gh_stars>0
select sum(duration) as total_hrs, sum(total) as total_rev from enteries
join jobs on enteries.job_id = jobs.job_id
where enteries.user_id= $1
and jobs.completed = false |
<reponame>pradika-putra/acengtravel
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 30 Apr 2018 pada 02.37
-- Versi Server: 10.1.8-MariaDB
-- PHP Version: 5.5.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... |
-- Drop triggers
DROP TRIGGER calculate_area_trash_point_counts ON public.trash_point_activity;
DROP FUNCTION public.area_trash_point_count();
-- Create triggers
CREATE OR REPLACE FUNCTION public.area_trash_point_count()
RETURNS trigger AS
$BODY$DECLARE
counts RECORD;
area_info RECORD;
what RECORD;
BEGIN
SET searc... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 13, 2018 at 10:07 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40... |
<reponame>IvkaIvanova/Databases-SQL
SELECT TownID, Name FROM Towns
WHERE Name LIKE 'B%' or Name LIKE 'M%' or Name LIKE 'K%'or Name LIKE 'E%'
ORDER BY Name
|
CREATE TABLE IF NOT EXISTS `roles` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(100) NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `users` (
`id` INT NOT NULL AUTO_INCREMENT,
`username` VARCHAR(45) NULL,
`email` VARCHAR(150) NULL,
`password` VARCHAR(45) NULL,
`role_id` INT... |
<reponame>Maycon-crz/teste_bludata_maycon<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.17.32
-- Generation Time: 29-Nov-2021 às 12:37
-- Versão do servidor: 10.1.38-MariaDB
-- versão do PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
ST... |
/*DROP DATABASE IOU_DB;
CREATE DATABASE IOU_DB;*/
USE IOU_DB;
CREATE TABLE USERNAME(
UserName varChar(25) PRIMARY KEY,
FirstName varchar(15),
LastName varchar(20),
Email varchar(320),
Password varchar(30),
LoggedIn boolean
);
CREATE TABLE EVENT_TABLE (
UserName varchar(25),
FOREIGN KEY... |
-- View: gv_samples
DROP VIEW gv_samples;
CREATE OR REPLACE VIEW gv_samples AS
SELECT s.id, s.date_start, s.date_end, s.date_type, s.entered_sref, s.entered_sref_system, s.location_name, s.deleted, su.title, l.name as "location"
FROM samples s
LEFT JOIN surveys su ON s.survey_id = su.id
LEFT JOIN locations ... |
insert into member2 values(member2_seq.NEXTVAL, 'KIM');
insert into phone values(member2_seq.NEXTVAL,1,'010-9874-6789'); |
delete from persons where id = -1; |
<reponame>DForshner/MSSQLExperiments<filename>DropCreateStoredProcedure.sql
USE [MyCatalog]
GO
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = '[MyStoredProcedure]')
BEGIN
DROP PROCEDURE [MyStoredProcedure]
END
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ==================================... |
<filename>metastore/scripts/upgrade/mysql/009-HIVE-2215.mysql.sql
-- Table `PARTITION_EVENTS` for classes [org.apache.hadoop.hive.metastore.model.MPartitionEvent]
SELECT '< HIVE-2215 Add api for marking querying set of partitions for events >' AS ' ';
DELIMITER $$
DROP PROCEDURE IF EXISTS PARTITION_EVENTS_TABLE $$
C... |
PARAMETERS
(
dateParm TIMESTAMP DEFAULT null
)
SELECT
d.id as id,
d.gender as gender,
d.id.MostRecentWeight.MostRecentWeight as weight,
d.species.arc_species_code as species,
CASE
WHEN h.cage is null THEN h.room
WHEN isnumeric(h.cage) = 1 THEN (h.room || '-' || cast(cast(h.cage a... |
<gh_stars>1-10
-- Verify ggircs-portal:computed_columns/application_current_user_can_edit on pg
begin;
select ggircs_portal_private.verify_function_not_present('ggircs_portal.application_current_user_can_edit');
rollback;
|
<reponame>Glairly/introduction_to_tensorflow<filename>courses/data-to-insights/demos/wikipedia-10-billion.sql
/*
Demo: Query 10 billion rows of Wikipedia data in BigQuery
1. Open BigQuery: https://console.cloud.google.com/bigquery
2. Copy and Paste the below query
*/
SELECT
language,
title,
SUM(vi... |
<filename>sources/Framework/org.ohdsi.cdm.framework.common2/Core/Transformation/CPRD/Lookups/Specialty.sql
SELECT distinct SOURCE_CODE, TARGET_CONCEPT_ID, 'None' as Domain, NULL AS valid_start_date, NULL AS valid_end_date
FROM {sc}.SOURCE_TO_CONCEPT_MAP
where lower(source_vocabulary_id) in ('jnj_cprd_prov_spec', 'jnj_... |
<reponame>FlashSheridan/daml
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
-- contains all events for all transactions
create table participant_events
(
event_id varchar primary key not null,
event_offset bigint not null,
contract_id varchar not null,
... |
<filename>jeff-farm-ws/src/main/sql/functions/can-delete/can_delete_hive.sql
DROP FUNCTION IF EXISTS can_delete_hive;
CREATE FUNCTION can_delete_hive
( IN user_id INT
, IN id INT
, OUT can_delete BOOLEAN
)
AS
$body$
BEGIN
SELECT permission_check_hive(set_user_id(can_delete_hive.user_id), can_delete_hive... |
SELECT SOBRENOME, CARGO FROM empr
INNER JOIN dept on empr.DEPT = dept.DCODIGO
WHERE dept.DNOME LIKE '%PLAN%'; |
<filename>config/db/tables/see_shiftmaster.sql
CREATE TABLE public.see_shiftmaster (
id numeric(10) NOT NULL DEFAULT nextval('see_vrshiftmaster_seq'::regclass),
clientassetid numeric(10) NOT NULL,
shiftname varchar(100) NOT NULL,
created_date timestamp NOT NULL,
created_by varchar(100) NULL,
lineid varchar NOT NU... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 24, 2020 at 11:47 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
"MigrationId" character varying(150) NOT NULL,
"ProductVersion" character varying(32) NOT NULL,
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);
START TRANSACTION;
CREATE TABLE "Users" (
"Id" INTEGER NOT NULL,
"UserName" TEXT... |
<reponame>canvs/shoooop
INSERT INTO `#__album_class` (`aclass_id`, `aclass_name`, `store_id`, `aclass_des`, `aclass_sort`, `aclass_cover`, `upload_time`, `is_default`) VALUES(1, '默认相册', 1, '', 255, '', 1387942806, 1);
INSERT INTO `#__album_pic` (`apic_id`, `apic_name`, `apic_tag`, `aclass_id`, `apic_cover`, `apic_si... |
<reponame>oktan-real/LoginFull
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 16 Feb 2020 pada 06.15
-- Versi server: 10.1.36-MariaDB
-- Versi PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+0... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 30 Okt 2020 pada 11.39
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<gh_stars>0
-- Verify rasalibrary.auth:20223101_init_user on pg
BEGIN;
DO
$$
<<if_auth_schema_exist_test>>
BEGIN
IF NOT EXISTS(SELECT 1 FROM information_schema.schemata WHERE schema_name = 'auth') THEN
RAISE EXCEPTION 'schema auth not found';
END IF;
END if_auth_schema_exist_te... |
<gh_stars>1-10
/*
Database: WideWorldImportersDW
View: BI.dimPaymentMethod
*/
CREATE OR ALTER VIEW BI.dimPaymentMethod
AS
SELECT [Payment Method Key]
,[WWI Payment Method ID]
,[Payment Method]
,[Valid From]
,[Valid To]
FROM WideWorldImportersDW.Dimension.[Payment Method] |
CREATE TEMPORARY TABLE "cars" (
id serial PRIMARY KEY,
make varchar(255) NOT NULL,
description TEXT NOT NULL,
family_friendly BOOLEAN NOT NULL,
recalled_at timestamp,
created_at timestamp,
updated_at timestamp
); |
<filename>migrations/app/schema/20200812180333_add_contract_code_param_to_dpk.up.sql
INSERT INTO service_params(id, service_id, service_item_param_key_id, created_at, updated_at)
VALUES ('0a0f32dc-2629-4abc-a2a7-764fea0f1ac7', (SELECT id from re_services WHERE code = 'DPK'), (SELECT id FROM service_item_param_keys WHER... |
<filename>migrations/000019_make_reports_table.up.sql
CREATE TABLE `Report` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`channel_id` VARCHAR(64) NOT NULL,
`channel_name` VARCHAR(64) NOT NULL,
`channel_type` VARCHAR(64) NOT NULL,
`reporter_id` VARCHAR(64) NOT NULL,
`reporter_name` VARCHAR(64) N... |
<gh_stars>0
create extension pg_trgm;
create schema goodschema;
create schema badschema;
CREATE TYPE shipping_status AS ENUM ('not shipped', 'shipped');
CREATE TYPE unwanted_enum AS ENUM ('unwanted', 'not wanted');
CREATE TYPE unused_enum AS ENUM ('a', 'b');
CREATE TYPE usage_dropped_enum AS ENUM ('x', 'y');
CREA... |
/* Script to update ICD9 to SNOMED mapping
* using Dima's corrections
* execute in dev
*/
-- Load manual icd9_to_concept_map
-- drop table icd9_to_concept_map;
create table icd9_to_concept_map as
select * from source_to_concept_map where 1=0;
/* Use SQLLDR to load the file icd9_to_concept_map
* the control file is ic... |
/*How many payment transactions where greater than $5*/
SELECT COUNT(amount) FROM payment
WHERE amount>5.00;
/*How many actors have a first name that starts with the letter P?*/
SELECT COUNT(*) FROM actor
WHERE first_name LIKE 'P%';
/*How many unique districts are our customers from?*/
SELECT DISTINCT COUNT(... |
<filename>ssg.sql
CREATE TABLE type (id integer unsigned not null auto_increment primary key,
name varchar(50) not null,
class varchar(50) not null,
stem varchar(50),
CONSTRAINT UNIQUE (name));
CREATE TABLE inheritage (id in... |
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS statics;
DROP TABLE IF EXISTS routes;
DROP TABLE IF EXISTS pages;
|
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: zeedocold
-- ------------------------------------------------------
-- Server version 5.7.14-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
select
*
from
COMTNAUTHORROLERELATE /* 권한롤관계 */;
select
*
from
COMTNROLEINFO A
left outer join (
select
AUTHOR_CODE ,
ROLE_CODE,
CREAT_DT
from
COMTNAUTHORROLERELATE
where
AUTHOR_CODE = 'ROLE_ANONYMOUS') B on
A.ROLE_CODE = B.ROLE_CODE ;
|
drop table if exists `sys_dept`;
create table `sys_dept`(
`id` int(11) not null auto_increment comment '部门ID',
`name` varchar(20) not null default '' comment '部门名称',
`parent_id` int(11) not null default '0' comment '上级部门id',
`level` varchar(200) not null default '' comment '部门层级',
`seq` int(11) not null defau... |
<filename>scripts/schema/ccpv2/201-apb-81-sys_id-popul8-c.sql
/* Copyright (c) 2006-2013 Regents of the University of Minnesota
For licensing terms, see the file LICENSE. */
/* This script configures the system_id column in the route_feedback,
route_step, and track_point tables. */
/* Run this script once agai... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.