sql stringlengths 6 1.05M |
|---|
<filename>database.sql<gh_stars>0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE DATABASE serieQuiz;
CREATE TABLE `questions` (
`id` int(11) NOT NULL,
`text` varchar(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
INSERT INT... |
DROP DATABASE IF EXISTS g4pmwpgb7l9wck1s;
CREATE DATABASE g4pmwpgb7l9wck1s;
INSERT INTO g4pmwpgb7l9wck1s;
USE g4pmwpgb7l9wck1s;
CREATE TABLE users
(
userId INT PRIMARY KEY AUTO_INCREMENT,
userName VARCHAR (30) NOT NULL,
email(30)NOT NULL,
messages(230) NULL,
friends(30) NULL
);
CREATE TABLE p... |
<reponame>kulauk/Oracle
GRANT EXECUTE ON pkg_utils TO qct_tester_dulu;
GRANT EXECUTE ON pkg_util_dynsql TO qct_tester_dulu;
GRANT EXECUTE ON pkg_error_manager TO qct_tester_dulu;
GRANT EXECUTE ON varchar_250_nt TO qct_tester_dulu;
GRANT EXECUTE ON number_nt TO qct_tester_dulu; |
CREATE DATABASE IF NOT EXISTS `pathfinder` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `pathfinder`;
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: 127.0.0.1 Database: pathfinder
-- ------------------------------------------------------
-- Server version 5.7.21
/*!40101 SET @OLD_CHARACTER... |
<filename>sql/Indexes.sql
DEF title = 'Indexes (dba_indexes)';
DEF filename = 'Indexes.html';
DEF nextpage = 'FunctionIndexes.html';
DEF prevpage = 'PctFree.html';
@@00_begin.sql
@@sql/sub/Indexes.sql
@@00_end.sql
--*************************************************************************************... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 07, 2021 at 03:26 PM
-- Server version: 10.4.16-MariaDB
-- PHP Version: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<reponame>yuweijun/spring-boot-examples
--liquibase formatted sql
--changeset yuweijun:1 date:2016-01-08
DROP TABLE IF EXISTS `people`;
CREATE TABLE `people` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`full_name` varchar(255) NOT NULL,
`job_title` varchar(255) DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_IN... |
-- DDL script for base table:
-- Field - Immunology
-- Seed Year - 1989
SET search_path = theta_plus;
--
-- Get all immunology articles published in the year 1989
DROP TABLE IF EXISTS theta_plus.imm1989;
CREATE TABLE theta_plus.imm1989
TABLESPACE theta_plus_tbs AS
SELECT sp.scp FROM public.scopus_publications sp
INN... |
<reponame>web3brothers/aleo-network-info
ALTER TABLE nodes_statistics ADD node_type VARCHAR(30);
ALTER TABLE nodes_statistics DROP COLUMN boot_node; |
<reponame>cincuranet/FirebirdDbComparer<gh_stars>10-100
create table detail (id int primary key, fk int); |
/***************************************************************************************************
Get the value of the environment variable
@param name
Name of the variable to get the value for
@returns
Returns environment variable value
*******************************************************************... |
/*
Script for checking big values on Monte's install
*/
/** account, mtu, start time, end time, threshold
call cleanEnergyData(234, 1248452, (1434412440-300), (1438190580 + 3600), 1000);
*/
select mtu_id, timestamp, CONVERT_TZ(FROM_UNIXTIME(timestamp),'SYSTEM', 'US/Eastern'), Hex(mtu_id), energyDifference, ene... |
Solution to [Draw The Triangle 1](https://www.hackerrank.com/challenges/draw-the-triangle-1) |
<gh_stars>1-10
DROP DATABASE IF EXISTS anotherTopSongsDB;
CREATE database anotherTopSongsDB;
USE anotherTopSongsDB;
CREATE TABLE topalbum (
artist_id INT AUTO_INCREMENT NOT NULL,
artist_name VARCHAR(100) NULL,
album_name VARCHAR(100) NULL,
year INT NULL,
raw_total DECIMAL(10,4) NULL,
raw_usa DECIMAL(10,4)... |
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
<gh_stars>1-10
use mysql;
SELECT 'Creating cdc user...' AS ' ';
CREATE USER 'cdc_user'@'localhost' IDENTIFIED BY 'cdc_passwd';
CREATE USER 'cdc_user'@'%' IDENTIFIED BY 'cdc_passwd';
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'cdc_user'@'%';
GRANT ALL PRIVILEGES ON securities_... |
SET allow_experimental_live_view = 1;
DROP TABLE IF EXISTS test.mt;
CREATE TABLE test.mt (a Int32) Engine=MergeTree order by tuple();
CREATE LIVE VIEW test.lv AS SELECT * FROM test.mt;
DROP TABLE test.lv;
DROP TABLE test.mt;
|
\set ON_ERROR_STOP 1
BEGIN;
-- Generate new tables
------------------------
-- artist
CREATE TABLE artist2013 AS
SELECT artist.id, artist.gid, name.name AS name, sort_name.name AS sort_name,
begin_date_year, begin_date_month, begin_date_day,
end_date_year, end_date_month, end_date_day,
typ... |
<filename>sql/001_base_schema.sql
-- MySQL dump 10.17 Distrib 10.3.13-MariaDB, for osx10.14 (x86_64)
--
-- Host: localhost Database: eqft_char_xfer
-- ------------------------------------------------------
-- Server version 10.3.13-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 ... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Generation Time: Apr 07, 2021 at 03:59 PM
-- Server version: 5.6.48-88.0
-- PHP Version: 7.2.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
DROP DATABASE IF EXISTS checkout;
CREATE DATABASE checkout;
USE checkout;
CREATE TABLE purchases
(
purchase_id INT NOT NULL
AUTO_INCREMENT,
name VARCHAR
(100),
email VARCHAR
(100),
password VARCHAR
(100),
address_1 VARCHAR
(150),
address_2 VARCHAR
(150),
city VARCHAR
(50),
state VARCHAR
... |
<filename>charter_new (1).sql
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 21, 2018 at 03:57 PM
-- Server version: 5.6.14
-- PHP Version: 5.5.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<gh_stars>0
CREATE TABLE auth_code (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL,
code VARCHAR NOT NULL UNIQUE,
created_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(user_id) REFERENCES user(id)
); |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 09-10-2018 a las 22:44:29
-- Versión del servidor: 10.1.29-MariaDB
-- Versión de PHP: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
CREATE TABLE IF NOT EXISTS survey (
id bigserial PRIMARY KEY,
active BOOLEAN NOT NULL DEFAULT 't',
start_date TIMESTAMP NOT NULL,
expires TIMESTAMP NOT NULL,
created_on timestamptz NOT NULL DEFAULT now()
);
CREATE TYPE question_type as ENUM (
'Checkbox',
'LinearScale',
'MultiChoice',
... |
<filename>Project/Submission 3/src/Queries/int2.sql
.mode columns
.headers on
.nullvalue NULL
SELECT email, username,count(Distinct idEstiloMusical) AS nrEstilosFavoritos
FROM FavoritoMusica NATURAL JOIN Utilizador NATURAL JOIN MusicaEstilo
GROUP BY idUtilizador;
|
/* all indexes and index columns */
SELECT C.INDEX_NAME,
I.UNIQUENESS,
C.COLUMN_NAME
FROM USER_INDEXES I,
USER_IND_COLUMNS C
WHERE I.INDEX_NAME = C.INDEX_NAME
AND I.TABLE_NAME = UPPER(:TABLE_NAME)
ORDER BY C.INDEX_NAME,
C.COLUMN_POSITION;
/* show indexes */
SELECT table_owner,
table_name,
owner AS index_... |
CREATE TABLE voters_2012 (
voter_id varchar,
voter_name varchar,
voter_name_searchable varchar,
poll_category varchar,
voter_role varchar,
voter_title varchar,
voter_nationality ... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.1
-- Dumped by pg_dump version 11.1
-- Started on 2018-11-09 12:41:32
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalo... |
SELECT
e.EmployeeID,
e.FirstName,
CASE
WHEN p.StartDate >= '20050101' THEN NULL
ELSE p.Name
END AS ProjectName
FROM Employees AS e
INNER JOIN EmployeesProjects AS ep
ON ep.EmployeeID = e.EmployeeID
INNER JOIN Projects AS p
ON p.ProjectID = ep.ProjectID
WHERE ep.EmployeeID = 24
|
-- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 10.1.13-MariaDB - mariadb.org binary distribution
-- 服务器操作系统: Win64
-- HeidiSQL 版本: 9.1.0.4867
-- ------------------------------------------------... |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50554
Source Host : localhost:3306
Source Database : 5704
Target Server Type : MYSQL
Target Server Version : 50554
File Encoding : 65001
Date: 2017-03-15 22:05:04
*/
USE 5704;
SET FORE... |
<filename>resources/dbschema.sql
-- Sample DB Schema for JdbcIdGenerator
-- MySQL sample: must use an table engine with transaction support (e.g. InnoDB)
-- table name: use any name you may like
-- column names: default values are `id_name` and `id_value`
CREATE TABLE ddth_id (
id_name VARCHAR(... |
<filename>StoredProcedures/dbo.jc_Purge_AutomatedPurgeProcessWrapper.sql
SET QUOTED_IDENTIFIER ON --Quoted elements must use ' and not "
GO
CREATE OR ALTER PROCEDURE dbo.jc_Purge_AutomatedPurgeProcessWrapper
@OverrideTimeConstraint BIT = 0 --If 1, then run purge now
, @BatchId INT = NULL --Pass in if just a specifi... |
<filename>Database1/Security/sales.sql
CREATE SCHEMA [sales]
AUTHORIZATION [dbo];
|
create table if not exists stock(
id serial primary key,
stock_code text not null unique,
stock_name text not null unique,
stock_exchange text not null,
broker text not null,
created_at timestamp not null default current_timestamp,
modified_at timestamp not null default current_timestamp,
... |
-- MOBILIDADE
CREATE TABLE Notificacao
(
id_notificacao BIGINT PRIMARY KEY IDENTITY(1,1),
id_utilizador BIGINT NOT NULL,
descricao NVARCHAR(255) NOT NULL
)
GO
ALTER TABLE Notificacao
ADD CONSTRAINT fk_N_Utilizador
FOREIGN KEY(id_utilizador)
REFERENCES Utilizador(id_utilizador) |
--liquibase formatted sql
--changeset usr:issue180
DROP TRIGGER IF EXISTS tr_fact_insert on fact;
DROP TRIGGER IF EXISTS tr_deferred_fact_insert on fact;
CREATE CONSTRAINT TRIGGER tr_deferred_fact_insert AFTER INSERT ON fact DEFERRABLE INITIALLY DEFERRED FOR EACH ROW EXECUTE PROCEDURE notifyFactInsert();
|
-- Revert cif:util_functions/read_only_user_policies from pg
begin;
drop function cif_private.read_only_user_policies(text, text);
commit;
|
CREATE TABLE special_posts (
id SERIAL PRIMARY KEY,
user_id INTEGER NOT NULL,
title VARCHAR NOT NULL
);
CREATE TABLE special_comments (
id SERIAL PRIMARY KEY,
special_post_id INTEGER NOT NULL
);
|
CREATE DATABASE IF NOT EXISTS `ezegarraDB` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `ezegarraDB`;
-- MySQL dump 10.13 Distrib 5.6.13, for Win32 (x86)
--
-- Host: mysql.cs.pitt.edu Database: ezegarraDB
-- ------------------------------------------------------
-- Server version 5.0.45-community-log
/*!40101 SE... |
CREATE table alltypes(
int_col INTEGER,
float_col FLOAT,
double_col DOUBLE,
smallint_col SMALLINT,
date_col DATE,
time_col TIME,
timestamp_col TIMESTAMP,
datetime_col DATETIME,
monetary_col MONETARY,
numeric_col NUMERIC(12,4),
char_col char(255),
varchar_col varchar(255),
nchar_col nchar(255),
varnchar_col nchar varyin... |
create table if not exists users
(
id serial
constraint users_pkey
primary key,
first_name varchar(50),
last_name varchar(50),
login varchar(50),
password_hash varchar(255)
);
alter table users owner to postgres;
create table if not exists auth
(
id serial
constraint auth_pkey
... |
INSERT INTO countries VALUES
(1, 'q', 10),
(2, 'w', 20)
;
INSERT INTO secret_agencies VALUES (1, 'A', 1);
INSERT INTO missions VALUES
(1, 'aaa', '', '', 10, 1, true),
(2, 'bbb', '', '', 10, 1, true),
(3, 'ccc', '', '', 8, 1, true),
(4, 'ddd', '', '', 8, 1, true)
;
INSERT INTO legs VALUES
... |
---
--
--
use DATABASE UDACITY_PRJ2;
use SCHEMA WEATHER;
--
-- Define CSV File Format
--
create or replace file format p2_csv_format
type = csv
FIELD_DELIMITER = ','
RECORD_DELIMITER = '\n'
skip_header = 1
null_if = ('NULL', 'null')
empty_field_as_null = true
compression = gzip
error_on_column_count_mi... |
<reponame>jchen9314/ae-bootcamp-project<filename>ae-bootcamp/models/warehouse/fact_sales.sql
{{config(
partition_by={
'field':'order_date',
'date_type':'date'
}
)}}
with source as (
select
od.order_id,
od.product_id,
o.customer_id,
o.employee_id,
o.sh... |
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 10.3.16-MariaDB - mariadb.org binary distribution
-- Операционная система: Win64
-- HeidiSQL Версия: 11.0.0.5919
-- ------------------------------------------... |
<reponame>jomofrodo/covid.vue<filename>www/WEB-INF/templates/Data/sql/JH/TimeSeries/CreateCombinedRecs.sql<gh_stars>0
-- jh_global_timeseries CREATE combined records
INSERT INTO combined
(
sourcecode,
state,
country,
date,
confirmed
)
SELECT DISTINCT
'JH_GLOBAL_CONF' as sourcecode,
state,
country,
date,
CASE
WHEN ... |
<filename>console/asset/data/nw_role.sql
/* 初始化角色 */
INSERT INTO `nw_role` (
`id`, /* ID */
`user_id`, /* 用户 ID */
`name`, /* 角色名 */
`max_hp`, /* 最大生命值 */
`max_mp`, /* 最大魔法值 */
`hp`, /* 生命值 */
`mp`, /* 魔法值 */
`money` /* 钱 */
) VALUES
(1, 1, '测试员', 100.0, 100.0, 100.0, 100.0, 99999999... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 23 Okt 2020 pada 08.55
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
SET DEFINE OFF;
CREATE UNIQUE INDEX AFW_14_FORMT_UK1 ON AFW_14_FORMT
(REF_PRODT, DEFNT)
LOGGING
/
|
CREATE PROCEDURE dbo.DropDatabase
(
@DatabaseName NVARCHAR(128),
@DatabaseOwner NVARCHAR(128)
)
WITH EXECUTE AS OWNER
AS
SET NOCOUNT ON
BEGIN TRY
IF EXISTS (SELECT 1 FROM dbo.RestrictedDatabases WHERE DatabaseName = @DatabaseName)
RAISERROR('You are restricted from accessing this database.',11,0);
IF NOT E... |
<reponame>artofimagination/mysql-user-db-go-interface
-- +migrate Up
CREATE TABLE IF NOT EXISTS features(
id serial PRIMARY KEY,
name varchar(128) UNIQUE NOT NULL,
config json,
created_at DATETIME NOT NULL DEFAULT NOW(),
updated_at DATETIME NOT NULL DEFAULT NOW()
);
INSERT INTO features (name, config) v... |
CREATE TABLE NOTIFICATION_USER_GROUPS(
USER_GROUP_ID INT PRIMARY KEY auto_increment,
USER_GROUP VARCHAR(50) UNIQUE,
USER_GROUP_QUERY VARCHAR(1000) NOT NULL,
STATUS VARCHAR(20) NOT NULL DEFAULT 'Active',
CREATED_BY VARCHAR(50),
... |
/* 13. Планински вериги */
USE geography;
SELECT c.country_code, c.country_name, m.mountain_range
FROM countries AS c
INNER JOIN mountains_countries AS mc ON mc.country_code = c.country_code
INNER JOIN mountains AS m ON m.id = mc.mountain_id
WHERE c.country_code IN ("US","RU","BG")
ORDER BY c.country_code, m.mountain... |
-- file:cluster.sql ln:175 expect:true
UPDATE clustertest SET key = 35 WHERE key = 40
|
DROP INDEX IF EXISTS timestamp_idx; |
<filename>custom/script_SoportePP/Mantenimientos Preventivos/ejecutados/ppga_sv_b2.sql
ALTER INDEX PPGA.PK_ACTABOPRE REBUILD PARTITION ACTABOPRE_P00;
ALTER INDEX PPGA.PK_ACTABOPRE REBUILD PARTITION ACTABOPRE_P01;
ALTER INDEX PPGA.PK_ACTABOPRE REBUILD PARTITION ACTABOPRE_P02;
ALTER INDEX PPGA.PK_ACTABOPRE REBUILD PARTIT... |
<filename>data/results/cdc_armc_inserts.sql
/* document type is: cdc-armc */
/* reading input file 'data/armc_prepared.csv': */
INSERT INTO cdc_armc_by_age (p999,p3,p01,p1,p99,p5,p90,p25,age,m,p95,l,p10,s,p75,p97,sex,p50) VALUES (16.812,11.663,10.579,11.257,15.946,11.882,14.807,12.809,91,13.4779,15.197,0.3933,12.224,0.... |
-- phpMyAdmin SQL Dump
-- version phpStudy 2014
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 服务器版本: 5.5.53
-- PHP 版本: 5.4.45
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS = @@CHARACTE... |
<reponame>yeastrc/proxl-web-app
USE proxl ;
-- This will create an initial user in the "" database
-- The initial user will have user id "initial_proxl_user"
-- The initial user will have password "<PASSWORD>"
-- This is required to have an 'id' of 1. There is hard coding in the app for this id of 1.
-- If ... |
<reponame>angujo/ETL-CDMBuilder
SELECT distinct [SOURCE_CODE], [TARGET_CONCEPT_ID]
FROM [SOURCE_TO_CONCEPT_MAP]
where source_vocabulary_id in (208, 210)
|
<reponame>zesk/zesk<filename>modules/content/classes/Class/Content/Article.sql
-- Database: mysql
CREATE TABLE `{table}`(
`id` integer unsigned NOT NULL auto_increment,
`slug` varchar(128) NOT NULL,
`parent` integer unsigned NULL,
`headline` varchar(128) NOT NULL,
`title` varchar(128) NOT NULL,
`byline` varchar(1... |
-- @testpoint: 创建列存表,开启事务声明游标,不支持反向抓取数据,参数为backward,合理报错;
--前置条件
drop table if exists cur_test_187;
create table cur_test_187(c_id int,c_num int,c_name varchar(10),c_city varchar(10),c_add varchar(20)) with (orientation=column);
insert into cur_test_187 values(1,18,'Allen','Beijing','AAAAABAAAAA'),(2,368,'Bob','Shangh... |
CREATE TABLE bookings (
id SERIAL PRIMARY KEY,
price smallint,
max smallint,
minstay smallint,
stars numeric(4,2),
numratings smallint,
"1" boolean,
"2" boolean,
"3" boolean,
"4" boolean,
"5" boolean,
"6" boolean,
"7" boolean,
"8" boolean,
"9" boolean,
"10... |
<reponame>US-EPA-CAMD/easey-db-scripts
-- PROCEDURE: camdecmpswks.delete_workspace_monitor_plan_old(text)
-- DROP PROCEDURE camdecmpswks.delete_workspace_monitor_plan_old(text);
CREATE OR REPLACE PROCEDURE camdecmpswks.delete_workspace_monitor_plan_old(
monplanid text)
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
unitIds ... |
<filename>src/main/resources/db/migration/V05__adicinar_conta_proposta.sql
ALTER TABLE proposta
ADD id_conta BIGINT(20);
ALTER TABLE proposta
ADD CONSTRAINT `FK4cm1kg523jlopyexjbmi6y54j` FOREIGN KEY (id_conta) REFERENCES conta(id);
|
\c smdb
SELECT * FROM movie;
SELECT * FROM actor;
SELECT * FROM writer;
SELECT * FROM cinematographer;
SELECT * FROM director;
SELECT * FROM genre;
SELECT * FROM movie_genres;
SELECT * FROM directs;
SELECT * FROM music_director;
SELECT * FROM producer;
SELECT * FROM produces;
SELECT * FROM rating;
SELECT * FROM songs;... |
CREATE OR REPLACE VIEW fact_loader.queue_deps_all_with_retrieval AS
SELECT
qtd.*,
krs.filter_scope,
krs.level,
krs.return_columns, --we need not get the type separately. It must match queue_of_base_table_key_type
krs.is_fact_key,
krs.join_to_relation,
qtk.queue_table_relid AS join_to_relation_que... |
<filename>project-all-for-one/desafio12.sql
SELECT submitted_date FROM purchase_orders WHERE CAST(submitted_date AS DATE) = '2006-04-26';
|
<filename>src/test/resources/sql/insert/19983f57.sql
-- file:triggers.sql ln:1279 expect:true
insert into upsert values(4, 'green') on conflict (key) do update set color = 'updated ' || upsert.color
|
CREATE PROCEDURE [dbo].[BugNet_IssueWorkReport_GetIssueWorkReportsByIssueId]
@IssueId INT
AS
SELECT
IssueWorkReportId,
BugNet_IssueWorkReports.IssueId,
WorkDate,
Duration,
BugNet_IssueWorkReports.IssueCommentId,
BugNet_IssueWorkReports.UserId CreatorUserId,
U.UserName CreatorUserName,
IsNull... |
--1
CREATE OR REPLACE FUNCTION student_capacity() RETURNS TRIGGER AS $student_capacity$
DECLARE
total_credits integer default 0;
discipline_credits integer default 0;
BEGIN
SELECT DISCIPLINA.ncred from disciplina into discipline_credits where disciplina.sigla = new.sigla;
select sum(disciplina.ncred) from discipl... |
CREATE TABLE USER (
ID BIGINT PRIMARY KEY AUTO_INCREMENT,
NAME VARCHAR(100),
TEL VARCHAR(20) UNIQUE,
AVATAR_URL VARCHAR(1024),
ADDRESS VARCHAR(1024),
CREATED_AT TIMESTAMP NOT NULL DEFAULT ... |
<reponame>shakilbd009/go-greenlight-api
CREATE TABLE IF NOT EXISTS users (
id bigserial PRIMARY KEY,
created_at timestamp(0) with time zone NOT NULL DEFAULT NOW(), name text NOT NULL,
email citext UNIQUE NOT NULL,
password_hash bytea NOT NULL,
activated bool NOT NULL,
version integer NOT NULL DEFAULT 1
); |
<gh_stars>0
ALTER TABLE NOMINAL_ROLL_SAGA
DROP CONSTRAINT NOMINAL_ROLL_STUDENT_ID_SAGA_NAME_UK;
ALTER TABLE NOMINAL_ROLL_SAGA
ADD CONSTRAINT PROCESSING_YEAR_NOMINAL_ROLL_STUDENT_ID_SAGA_NAME_UK UNIQUE (PROCESSING_YEAR, NOMINAL_ROLL_STUDENT_ID, SAGA_NAME);
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.5.40-0ubuntu0.12.04.1)
# Database: foos
# Generation Time: 2014-11-21 04:47:02 +0000
# ***********************************... |
<reponame>LanceByun/DQUEEN_OMOP_CDM_Version
-- Temporal
insert into @resultSchema.dq_check_result
select
'C198' as check_id
,13 as stratum1
,'condition_occurrence' as stratum2
,visit_concept_id as stratum3
,day_diff as stratum4
,'Disease period of patients once diagnosis by visit type' as stratum5
,count(*) as count_v... |
<filename>prisma/migrations/20220210161240_rename_newtab_to_scheduledsurface/migration.sql
/*
Warnings:
- You are about to drop the column `newTabGuid` on the `ScheduledItem` table. All the data in the column will be lost.
- A unique constraint covering the columns `[approvedItemId,scheduledSurfaceGuid,scheduled... |
<reponame>gmidorii/go-twowaysql
CREATE TABLE persons (
employee_no INT PRIMARY KEY,
dept_no INT,
first_name VARCHAR(100),
last_name VARCHAR(100),
email VARCHAR(100)
);
INSERT INTO persons(employee_no, dept_no, first_name, last_name, email) VALUES
(1, 10, 'Evan', 'MacMans', '<EMAIL>'),
(2, 11, 'Malvin... |
<gh_stars>1000+
create or replace function graphql.arg_index(arg_name text, variable_definitions jsonb)
returns int
immutable
strict
language sql
as $$
select
ar.idx
from
jsonb_array_elements(variable_definitions) with ordinality ar(elem, idx)
where
graphql.name_liter... |
UPDATE waffle_flag_mkt set name = 'override-app-purchase', note = 'ON: allow app purchase to specific people when the setting PURCHASE_LIMITED is True' where name = 'allow-paid-app-search';
|
<filename>Databases/mysql_course/triggers.sql
DELIMITER $ $ CREATE TRIGGER must_be_adult BEFORE
INSERT
ON people FOR EACH ROW BEGIN IF NEW.age < 18 THEN SIGNAL SQLSTATE '45000'
SET
MESSAGE_TEXT = 'Must be an adult!';
END IF;
END;
$ $ DELIMITER;
DELIMITER $ $ CREATE TRIGGER example_cannot_follow_self BEFORE
... |
SET AUTOCOMMIT = 0;
START TRANSACTION;
INSERT INTO `test_table`.`testschema` (`Level`, `Exp`, `DeckMaxCost`, `MaxSoul`, `SoulRecovery`, `DeckSlot`) VALUES (`1`, `50`, `30`, `20`, `1.5`, `2`);
INSERT INTO `test_table`.`testschema` (`Level`, `Exp`, `DeckMaxCost`, `MaxSoul`, `SoulRecovery`, `DeckSlot`) VALUES (`2`, `60`... |
<gh_stars>0
USE employeedb;
INSERT INTO departments (name)
VALUES ("Engineering"), ("Finance"), ("Legal"), ("Sales");
INSERT INTO roles (title, salary, department_id)
VALUES ('Sofware Engineer', 150000, 1), ('Lead Sofware Engineer', 185000, 1), ('Lawyer', 200000, 3), ('Salesperson', 80000, 4), ('Acountant', 100000, 2... |
-- Adminer 4.7.7 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `book`;
CREATE TABLE `book` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`category_id` int(11) NOT NULL,
`name` varchar(255) COLLATE utf8m... |
<filename>dlh_e-arsip-laravel.sql
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 18, 2022 at 09:54 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Jul 13, 2018 at 11:37 PM
-- Server version: 5.6.34-log
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- ModelID Fix For NPC: 21749
-- Also Remove Dwarf ModelID From ModelID of 21749
DELETE FROM `creature_model_info` WHERE `modelid` IN (20447, 20448, 20449, 20450, 18790);
INSERT INTO `creature_model_info` (`modelid`, `bounding_radius`, `combat_reach`, `gender`, `modelid_other_gender`) VALUES
(20447, 0.372, 1.5, 0, 2044... |
<gh_stars>1-10
print 'TERMINOLOGY ModuleBuilder en-us';
GO
set nocount on;
GO
exec dbo.spTERMINOLOGY_InsertOnly N'LBL_SELECT_TEMPLATE_LABEL' , N'en-US', N'ModuleBuilder', null, null, N'Select from Template';
GO
set nocount off;
GO
/* -- #if Oracle
COMMIT WORK;
END;
/
-- #endif Oracle */
/* -... |
\set ON_ERROR_STOP true
CREATE TABLE dec03 (
rownum bigint GENERATED ALWAYS AS IDENTITY,
input text
);
/* Import the input file. We're using perl to remove the final newline. */
\COPY dec03 (input) FROM PROGRAM 'perl -pe ''chomp if eof'' input.dat'
VACUUM ANALYZE dec03;
\timing on
/* Part One */
WITH
input... |
<gh_stars>1-10
SELECT run_num AS R, Lumi_section_num AS L, file_id AS pfid FROM {{.Owner}}.file_lumis fl
WHERE fl.file_id IN (SELECT file_id FROM {{.Owner}}.files f
WHERE F.DATASET_ID IN (SELECT parent_dataset_id FROM {{.Owner}}.dataset_parents dp
INNER JOIN {{.Owner}}.datasets d on d.dataset_id... |
-- 21.10.2016 18:36
-- URL zum Konzept
UPDATE AD_Column SET AD_Element_ID=543198, AD_Reference_ID=11, AD_Table_ID=762, ColumnName='DLM_Level', DDL_NoForeignKey='Y', Description=NULL, Help=NULL, IsActive='Y', Name='DLM_Level',Updated=TO_TIMESTAMP('2016-10-21 18:36:22','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Co... |
CREATE TABLE `de_preparation` (
`search` VARCHAR(5) NOT NULL ,
`replace` VARCHAR(5) NOT NULL
) ENGINE = InnoDB;
INSERT INTO `de_preparation` VALUES
("AE", "Ä"),
("OE", "Ö"),
("ß", "S"),
("ST", "SCHT"),
("SCH", "1"),
("IE", "3"),
("EI", "4"),
("EU", "OI"),
("CK", "K"),
("ÄU", "OI"),
("OI", "2"),
("Ö", ... |
/************************************************************************
@file ConceptPrevalence.sql
Copyright 2018 Observational Health Data Sciences and Informatics
This file is part of CohortMethod
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wi... |
<reponame>Blank-Xu/leetcode-mysql
# https://leetcode.com/problems/combine-two-tables/
# Table: Person
#
# +-------------+---------+
# | Column Name | Type |
# +-------------+---------+
# | PersonId | int |
# | FirstName | varchar |
# | LastName | varchar |
# +-------------+---------+
# PersonId is the p... |
-- Creation Date: 2022-03-05
-- Description: remove token entity
drop table tokens;
|
<gh_stars>0
CREATE TABLE "FINANCE"."HFD"."ARRANGEMENTS"
(
"HFDID" INT,
"PAYMENTSTATUS" VARCHAR,
"DETAILSTATUS" VARCHAR,
"EMAIL" VARCHAR,
"PHONE" VARCHAR,
"DATEARRANGMENTMADE" DATETIME,
"_ETL_FILENAME" VARCHAR,
"_SF_INSERTEDDATETIME" DATETIME
); |
CREATE TABLE user_category (
categoryName VARCHAR(80) PRIMARY KEY
);
CREATE TABLE users (
id SERIAL PRIMARY KEY,
first_name VARCHAR(80) NOT NULL,
last_name VARCHAR(80) NOT NULL,
email VARCHAR(255),
contact VARCHAR(80) NOT NULL,
home_locationX FLOAT,
home_locationY FLOA... |
-- placeholder non-restricted values pass
select set_config('response.headers', '[{"Cache-Control": "public"}, {"Cache-Control": "max-age=259200"}]', true);
-- placeholder restricted values fail on a set_config
select set_config('response.headers', '[{"Content-Type": "application/vnd.my.malicious.type"}, {"Cache-Contr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.