sql stringlengths 6 1.05M |
|---|
-- THIS SCRIPT IS AUTOMATICALLY GENERATED. DO NOT EDIT IT DIRECTLY.
DROP TABLE IF EXISTS icustay_times; CREATE TABLE icustay_times AS
-- create a table which has fuzzy boundaries on hospital admission
-- involves first creating a lag/lead version of disch/admit time
-- get first/last heart rate measurement during hosp... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.2
-- Dumped by pg_dump version 9.6.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min... |
-- Default Schema: playlist_middle must be created
CREATE TABLE playlists (
id VARCHAR(40) NOT NULL,
name VARCHAR(128) NOT NULL,
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (... |
{{
config(
materialized = 'table'
)
}}
with conversion_by_prod as (
select {{ dbt_utils.star(ref('conversion_by_prod_all') , except=['product_guid']) }}
from {{ ref('conversion_by_prod_all') }}
order by 1
)
select * from conversion_by_prod |
declare
logger lg_logger_t := lg_logger_t.GetLogger(
moduleName => 'Test'
, objectName => 'test-pass-clob'
);
s clob;
s2 clob;
txtObj txc_text_t;
str varchar2( 32767) := '!' || lpad( '!', 1000, '*');
strCount integer := 10; -- trunc(1024*1024/32767);
procedure TestSize ... |
<gh_stars>1-10
-- Copyright 2019 <NAME>
--
-- 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 ag... |
INSERT INTO config VALUES ('finess_dataset_url','https://www.data.gouv.fr/fr/datasets/r/9b81484a-0deb-42f7-a7c4-eb9869ea580a');
|
<reponame>VandanaShah-Cornell/folio-analytics<gh_stars>1-10
DROP TABLE IF EXISTS folio_reporting.item_electronic_access;
-- Create table for electronic access points for item records. This includes the name of the relationship and the id.
CREATE TABLE folio_reporting.item_electronic_access AS
SELECT
item.id AS ite... |
<reponame>alekitto/zombodb
CREATE TABLE subxact_test (
id SERIAL8 NOT NULL PRIMARY KEY,
start_date_text varchar(255),
end_date_text varchar(255),
duration varchar(255)
);
INSERT INTO subxact_test (start_date_text, end_date_text) VALUES ('1/1/1999', '12/31/1999');
INSERT INTO subxact_test (st... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint: opengauss关键字final(非保留),自定义数据类型名为final 合理报错
--关键字final作为数据类型不带引号,创建成功
drop type if exists public.final;
CREATE TYPE public.final AS (f1 int, f2 text);
select typname from pg_type where typname ='public.final';
drop type public.final;
--关键字final作为数据类型加双引号,创建成功
dro... |
-- ----------------------------
-- 1. User information table
-- ----------------------------
drop table if exists business_user;
create table business_user (
user_id bigint(20) not null auto_increment comment 'User ID',
login_name varchar(30) not null comment 'Login ac... |
<filename>ironalex/procedure.sql
create or replace procedure "impeachment_captain"("gid" uuid)
as
$$
begin
update "user"
set "role_id" = (select "id" from "role" where "role_name" = 'Студент')
where "id" = (select "user"."id"
from "user"
joi... |
USE db_contacts;
DELIMITER //
# 新增记录 存储过程
DROP PROCEDURE IF EXISTS procedure_emailInsert;
CREATE PROCEDURE procedure_emailInsert(emailAddress VARCHAR(45), contactID INT,
OUT insert_code BOOLEAN)
BEGIN
DECLARE old_count INT;
DECLARE new_count INT;
SET old_... |
CREATE TABLE [dbo].[EnNoteScale] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Scale] INT NULL,
[IdEnNote] INT NULL,
[StepNote] INT NULL,
CONSTRAINT [PK__EnNoteScale] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK__EnNoteScale_EnNotes] FOREIGN KEY ([IdEnNote]) REFERENCES [dbo].[EnNotes] ([Id... |
delete from eg_roleaction where actionid in (select id from eg_action where url like '/brs/%.do');
delete from eg_action where url like '/brs/%.do';
delete from eg_roleaction where actionid in (select id from eg_action where url like '/brs/dishonoredCheque%');
delete from eg_action where url like '/brs/dishonoredChe... |
<reponame>Bjornej/Bazooka
CREATE VIEW [rd].[Users] AS
SELECT [Id],
[Email],
[UserName] ,
Administrator,
ConfigurationManager
FROM [dbo].AspNetUsers
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 10, 2019 at 01:17 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- IFS-5874
DELETE fir FROM form_input_response AS fir
INNER JOIN form_input fi ON fi.id = fir.form_input_id
INNER JOIN question q ON q.id = fi.question_id
INNER JOIN section s ON s.id = q.section_id
WHERE s.section_type='PROJECT_COST_FINANCES' OR s.name IN ('Labour',
'Overhead costs',
'Materials',
'Capital usage',
'Su... |
SELECT
yyyymm Month,
site Site,
platform Platform,
channel Channel,
ifnull(sessions, 0) Sessions,
ifnull(pct_sessions, 0) PctSessions,
ifnull(goal_completions, 0) GoalCompletions,
ifnull(pct_goal_completions, 0) PctGoalCompletions,
ifnull(conversion_index, 0) ConversionIndex
FROM {{ ref('platform_index') }}
WHERE yy... |
<gh_stars>1-10
WITH source AS (
SELECT *
FROM {{ source('gitlab_dotcom', 'vulnerability_occurrences') }}
)
SELECT
created_at::TIMESTAMP AS vulnerability_created_at,
name::VARCHAR AS vulnerabili... |
<gh_stars>10-100
/*-----------------------------------------------------------------------
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
-----------------------------------------------------------------------*/
CREATE TABLE [dbo].[AzureStorageChangeFeed] (
[EventTime] ... |
<reponame>omegazip/dba_scripts
-- +----------------------------------------------------------------------------+
-- | <NAME> |
-- | <EMAIL> |
-- | www.idevelopment.info ... |
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5559620_sys_gh6683RenameHandlingUnitTyp.sql
-- 2020-05-19T06:59:39.592Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='HU Typ', PrintName='HU Typ',Updated=TO_T... |
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table user_master (
user_id varchar(255) not null,
user_name varchar(255),
password varchar(255),
regist_time ... |
<reponame>ihontarenko/WebAdmin
CREATE TABLE AUTHORITIES
(
USERNAME VARCHAR(250) NOT NULL,
AUTHORITY VARCHAR(32) NOT NULL,
FOREIGN KEY (USERNAME) REFERENCES USERS (USERNAME)
);
INSERT INTO AUTHORITIES
VALUES ('ADMIN', 'ROLE_USER');
INSERT INTO AUTHORITIES
VALUES ('ADMIN', 'ROLE_ADMIN');
INSERT INTO AUTHORIT... |
<filename>feature/feature/src/main/resources/dbscripts/oracle.sql
-- -----------------------------------------------------
-- Table `ac_controller_DEVICE`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS ac_controller_DEVICE (
ac_controller_DEVICE_ID VARCHAR(45) NOT NULL ,
DEVIC... |
-- Remove the ability to publish assessments and assessment items from the ADMIN group users. It's too
-- dangerous. Only the DEVELOPER group will have this ability.
delete from security_group_security_permission where security_permission_id = 'PUBLISH_ASSESSMENT' and security_group_id = (select g.security_group_id fr... |
USE ${DB};
INSERT INTO TABLE CUSTOMER VALUES ("1","DAVID","GA"),
("2","BETH","GA"),
("3","DANI","NY"),
("4","BURT","MD"),
("5","LORI","MD"),
("6","MARY","MA");
INS... |
<gh_stars>1-10
ALTER TABLE table_trigger_document
ADD COLUMN name VARCHAR(1024) DEFAULT '' NOT NULL AFTER id; |
-- phpMyAdmin SQL Dump
-- version 4.0.10.10
-- http://www.phpmyadmin.net
--
-- Version du serveur: 5.5.34-log
-- Version de PHP: 5.3.3
-- ESUP-Portail MONDOSSIERWEB - Copyright (c) 2016 ESUP-Portail consortium
-- Base de donnees: `mdw`
--
-- --------------------------------------------------------
INSERT INTO `PREF... |
<reponame>aridwiprayogo/marquez<filename>api/src/main/resources/marquez/db/migration/V24__alter_jobs.sql
ALTER TABLE jobs ADD current_job_context_uuid UUID;
ALTER TABLE jobs ADD current_location varchar;
ALTER TABLE jobs ADD current_inputs JSONB;
ALTER TABLE jobs ADD current_outputs JSONB;
UPDATE jobs SET
current_jo... |
--List(have NULL value) partition creating test with timestamp type and null value
create table list_test(id int,
test_time time,
test_date date,
test_timestamp timestamp, primary key(id,test_timestamp))
PARTITION BY LIST (test_timestamp) (
PARTITION p0 VALUES IN ('2006-01-01 09:00:00','2006-02-01 09:00:00'... |
<filename>src/SFA.DAS.ASK.Database/InsertPostcodetoRegions.sql
-- Add records to PostCodeRegions
DECLARE @rowCount int
SELECT @rowCount = COUNT(*) FROM PostcodeRegions
IF @rowCount = 0
BEGIN
INSERT INTO PostcodeRegions(PostcodePrefix,Region)
VALUES
('GY','Channel Islands'),
('JE','Channel Islands'),
('... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 20 Jun 2020 pada 05.12
-- Versi server: 10.1.36-MariaDB
-- Versi PHP: 5.6.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
SELECT lpad('sql', 15, '*');
SELECT rpad('sql', 15, '*');
SELECT lpad ('sql', id, '*')
FROM platzi.alumnos
WHERE id < 10;
SELECT rpad ('sql', id, '*')
FROM platzi.alumnos
WHERE id < 10;
SELECT lpad ('*', id, '*')
FROM platzi.alumnos
WHERE id < 10;
SELECT rpad ('*', id, '*')
FROM platzi.alumnos
WHERE id < 10;
SELE... |
<reponame>arclogicsoftware/K2
-- uninstall: drop view user_flash_message;
create or replace view user_flash_message as (
select * from flash_message
where (user_id=saas_auth_pkg.get_user_id_from_user_name(v('APP_USER'))
or session_id=v('APP_SESSION'))
and expires_at<=sysdate); |
<gh_stars>0
use ObservationsSACTN
Select Code SiteCode, Name SiteName from Site where Code <> Name
Select Code StationCode, Name StationName from Station where Code <> Name
Select
Station.Code StationCode, Station.Name StationName, Instrument.Code InstrumentCode, Instrument.Name InstrumentName, CharIndex(Station.Name... |
<reponame>datawaves-xyz/ethereum-etl-airflow<filename>dags/resources/stages/raw/sqls_spark/receipts.sql
CREATE TABLE IF NOT EXISTS `{{database_temp}}`.`{{table}}`
(
transaction_hash STRING,
transaction_index BIGINT,
block_hash STRING,
block_number BIGINT,
cumulative_gas_used BIG... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: Mar 31, 2022 at 02:33 PM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 8.1.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
<gh_stars>100-1000
-- table.test
--
-- execsql {
-- CREATE TABLE test1 (
-- one varchar(10),
-- two text
-- )
-- }
CREATE TABLE test1 (
one varchar(10),
two text
) |
CREATE TABLE Employee
(EmpID INT NOT NULL ,
EmpName VARCHAR(50) NOT NULL PRIMARY KEY,
JobTitle VARCHAR(50) NULL,
Department VARCHAR(50) NULL);
INSERT INTO Employee
(EmpID, EmpName, JobTitle, Department)
VALUES
(1, '<NAME>', 'LAB ASSISTANT', 'LAB'),
(2, '<NAME>', 'SENIOR ACCOUNTANT', 'AC... |
<filename>src/test/resources/sql/create_aggregate/d3622211.sql
-- file:create_aggregate.sql ln:147 expect:true
CREATE AGGREGATE myavg (numeric)
(
stype = internal,
sfunc = numeric_avg_accum,
serialfunc = numeric_avg_serialize,
deserialfunc = numeric_avg_deserialize,
combinefunc = int4larger
)
|
-- # Problem: https://www.hackerrank.com/challenges/japanese-cities-name/problem
-- # Score: 10
SELECT NAME
FROM CITY
WHERE COUNTRYCODE = 'JPN';
|
CREATE OR REPLACE FUNCTION GetChangedDomainIDs(
nameservername varchar,
out change_id bigint,
out change_domain_id varchar,
out change_changetime int
) RETURNS SETOF record AS $$
DECLARE r RECORD;
BEGIN
FOR r IN SELECT domainmetadata_change.id, domain_id, changetime FROM domainmetadata_change INNER JOIN nameserver... |
<filename>src/main/resources/db/migration/V2__sally.sql
CREATE TABLE SALLY
(
id INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL PRIMARY KEY,
name VARCHAR
);
CREATE TABLE HOWARD
(
id INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL PRIMARY KEY,
name VARCHAR
);
CREATE TABLE NANCY
(
name VARCHAR,... |
<gh_stars>0
INSERT INTO public.book_category (name,name_en) VALUES ('Друго','Other');
INSERT INTO public.language (id, name, name_en) VALUES ('BG', 'Български','Bulgarian');
INSERT INTO public.language (id, name, name_en) VALUES ('EN', 'Английски','English');
INSERT INTO public.language (id, name, name_en) VALUES ('R... |
<gh_stars>0
---------------------------------------------------------
-- Compute prevalence and incidence numerator/denominator
---------------------------------------------------------
-- Prevalence numerator - all exposures
SELECT
cy.calendar_year,
eoi1.ingredient,
CASE WHEN eoi1.ingredient < 9 THEN eoi1.ingred... |
use sakila;
select actor.actor_id, actor.first_name, actor.last_name, film.film_id, film.title from actor,film,film_actor where actor.actor_id=1 and actor.actor_id=film_actor.actor_id and film.film_id=film_actor.film_id;
|
<filename>models/tmp/stg_greenhouse__phone_number_tmp.sql
select * from {{ var('phone_number') }}
|
PRINT 'Creating/updating procedure prLedgerAssignMonthEnd...'
IF (EXISTS(SELECT * FROM sys.procedures WHERE name = 'prLedgerAssignMonthEnd'))
BEGIN
DROP PROCEDURE dbo.prLedgerAssignMonthEnd
END
GO
CREATE PROCEDURE dbo.prLedgerAssignMonthEnd
AS
BEGIN
-- =============================================
-- Author: ... |
{{
config(
materialized='table'
)
}}
SELECT
promo_id,
discout as discount,
status as promo_status
FROM {{ source('greenery', 'promos') }} |
SELECT 'abc', 'abc''s', e'abc', e'abc\'s', e'ab\nc', e'a\100z', e'\x40', e'\u2603', E'\U00010000'
|
-- Name: CancelQueryByPid
-- Schema: posda_backlog
-- Columns: ['pg_cancel_backend']
-- Args: ['pid']
-- Tags: ['AllCollections', 'postgres_stats', 'postgres_query_stats']
-- Description: Get a list of collections and sites
--
select
pg_cancel_backend(?) |
<gh_stars>100-1000
SELECT e.name AS employeeName,
e.projects[0].name AS firstProjectName
FROM hr.employeesNest AS e
|
--DROPING EXISTING PEPYS.STATES_FOR FUNCTION
DROP FUNCTION IF EXISTS PEPYS.STATES_FOR;
--CREATING PEPYS.STATES_FOR FUNCTION
CREATE FUNCTION PEPYS.STATES_FOR(
INP_START_TIME TEXT,
INP_END_TIME TEXT,
INP_LOCATION TEXT,
INP_SENSOR_ID TEXT[],
INP_SOURCE_ID TEXT[],
INP_PLATFORM_ID TEXT[],
INP_PA... |
<reponame>manishpg83/qrcode<filename>qrcode (4).sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 12, 2016 at 07:14 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
<reponame>musictopia2/Work-Tracker<gh_stars>0
CREATE PROCEDURE [dbo].[spWorkEntry_GetLatest]
@employerId uniqueidentifier
AS
BEGIN
SELECT TOP 1 *
FROM [WorkEntry]
WHERE [EmployerId] = @employerId
ORDER BY [StartTime] DESC
END
|
<gh_stars>0
-- =============================================
-- Author: dbo
-- Create date: 2020-10-14
-- Description: delete user by Id
-- =============================================
CREATE PROCEDURE [dbo].[spUsers_DeleteUser]
@UserId nvarchar(128)
AS
BEGIN
SET NOCOUNT ON;
DELETE FROM AssignedMedicines
... |
<reponame>wf539/LearningTree925SQLProgrammingLanguageIntro<filename>925_HOCD1_H1_708_G2/Course925Examples/c4-04.sql
SELECT FirstName || ' ' || LastName AS EmployeeName
FROM Employees;
-- In SQL Server, the concatenation operator is the + sign
SELECT FirstName + ' ' + LastName AS EmployeeName
FROM Employees;
|
<reponame>dooley-ch/mistral
-- *******************************************************************************************
-- ** File: data_04.sql
-- ** Created: 26-05-2022
-- **
-- ** History:
-- ** 26-05-2022: Initial version
-- **
-- ******************************************************************************... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 100129
Source Host : localhost:3306
Source Schema : db_simkeu
Target Server Type : MySQL
Target Server Version : 100129
File Encoding : 65001
Date: 21/01/202... |
-- Grant access to webuser
grant select on arc.answer_choices to webuser;
grant select, update on arc.progress to webuser;
grant select on arc.roles to webuser;
grant select on arc.scenarios to webuser;
grant select on arc.scenes to webuser;
grant select, usage on all sequences in schema arc to webuser;
-- get user i... |
<filename>server/src/main/resources/schema.sql
CREATE TABLE IF NOT EXISTS PROJECT (
seq INT PRIMARY KEY AUTO_INCREMENT,
url varchar(2000),
img varchar(2000) NOT NULL,
title varchar(1000) NOT NULL,
content varchar(4000) NOT NULL,
sdate varchar(20) NOT NULL,
edate ... |
CREATE TABLE `employee`
SELECT *
FROM `employees` AS es
WHERE es.`salary` > 30000;
DELETE FROM `employee`
WHERE `manager_id` = 42;
UPDATE `employee`
SET `salary` = `salary` + 5000
WHERE `department_id` = 1;
SELECT `department_id`, AVG(`salary`) AS 'manager_id'
FROM `employee`
GROUP BY `department_id`
ORDER BY `departme... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2021 at 03:46 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<filename>jcf-iam/jcf-iam-core/src/main/resources/META-INF/sql/view_resources_users.sql
-- 화면 - 사용자 매핑
create table JCFIAM_VIEW_RESOURCES_USERS
(
VIEW_RESOURCE_ID VARCHAR2(16) not null,
USER_ID VARCHAR2(16) not null,
PERMISSION_ID VARCHAR2(16) not null,
CREATE_DATE DATE,
CREATE_US... |
insert into children (id, fname, lname, birthday, sex, address, secret_token, mood, health, temperature, sleep, food, id_class) values (1, 'Kathryn', 'Adams', '2016-03-05', false, '1 Saint Paul Court', 'rzG8ZnNQ6nwy', 'bored', 'strong', 36.6, '1:55 PM', 'lunch', 8);
insert into children (id, fname, lname, birthday, sex... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jun 13, 2018 at 02:33 PM
-- Server version: 5.7.21
-- PHP Version: 5.6.35
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... |
<reponame>jackiep00/abstractions<filename>ethereum/gnosis_protocol_v2/insert_batches.sql
CREATE OR REPLACE FUNCTION gnosis_protocol_v2.insert_batches(start_ts timestamptz, end_ts timestamptz=now()) RETURNS integer
LANGUAGE plpgsql AS
$function$
DECLARE
r integer;
BEGIN;
WITH rows AS (
WITH batch_cou... |
<filename>9172016.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 17, 2016 at 08:24 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
-- CreateTable
CREATE TABLE "Poll" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"title" VARCHAR(255) NOT NULL,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Choice" (
"id" SERIAL NOT NULL,
"name" TE... |
<reponame>dididada002/cloud2020
/*公共表*/
CREATE TABLE `t_dict` (
`dict_id` BIGINT(20) NOT NULL COMMENT 'id',
`type` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '名称',
`code` VARCHAR(50) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '编码',
`value` VARCHAR(50) CHARACTER SET utf... |
/*
*/
set serveroutput on size unlimited echo off scan on verify off
define schema=&1
PROMPT Drop all packages in schema &schema:
PROMPT Packages count - before:
SELECT count(*) as cnt FROM dba_objects WHERE owner = upper('&schema') AND object_type = 'PACKAGE'
/
declare
l_SQL varchar2(32000);
begin
dbms_output.e... |
use test_db;
insert into members(username, email, password, fname, created_at, role) values ("thecoducer", "<EMAIL>", "<PASSWORD>", "<NAME>", "2020-05-11", "student");
select * from members;
insert into mem_status(mem_id, status, expire_on) values (1, "allowed", "2021-05-11");
insert into mem_status(mem_id, status, ... |
CREATE TABLE subdivision_BE (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_BE" ("id", "name", "level") VALUES (E'BE-VAN', E'Antuerpen - Antwerpen', E'province');
INSERT INTO "subdivision_BE" ("id", "name", "level") VALUES (E'BE-BRU', E'Bruxelas-Capita... |
IF (DB_ID(N'$(DatabaseName)') IS NULL)
BEGIN
PRINT N'Creating $(DatabaseName)...';
END
GO
IF (DB_ID(N'$(DatabaseName)') IS NULL)
BEGIN
CREATE DATABASE [$(DatabaseName)]; -- MODIFY THIS STATEMENT TO SPECIFY A COLLATION FOR YOUR DATABASE
END
|
<filename>db/migrations/2020-05-24-145849_drop-blocks-base32-cidv1/down.sql<gh_stars>1-10
-- This file should undo anything in `up.sql`
ALTER TABLE blocks ALTER COLUMN cidv1 DROP NOT NULL;
ALTER TABLE blocks ADD base32_cidv1 TEXT;
|
<filename>ORACLE_SQL/RHOMICOM_TABLES/9_HOSP/075_hosp.invstgtn.sql
/* Formatted on 10/6/2014 7:32:46 PM (QP5 v5.126.903.23003) */
CREATE TABLE HOSP.INVSTGTN (INVSTGTN_ID NUMBER NOT NULL,
CNSLTN_ID NUMBER,
CREATED_BY VARCHAR (21 BYTE),
... |
\copy init_cyclic_v1h from '/home/znmeb/Raw/transportation-2018/transit-operations-analytics-data/init_cyclic_v1h 1-30SEP2017.csv' with csv header
\copy init_cyclic_v1h from '/home/znmeb/Raw/transportation-2018/transit-operations-analytics-data/init_cyclic_v1h 1-31OCT2017.csv' with csv header
\copy init_cyclic_v1h from... |
<gh_stars>1-10
WITH sfdc_opportunity_xf AS (
SELECT
TO_NUMBER(amount, 38, 2) AS opportunity_amount,
close_date::DATE AS close_date,
invoice_number,
net_incremental_acv,
opportunity_id,
sales_type
FROM {{ ref('sfdc_opportunity_xf') }}
WHERE stage_name = 'Closed Wo... |
-- Drops the "name of database"_db if it exists currently --
DROP DATABASE IF EXISTS company_db;
-- Creates the "new name_db" database --
CREATE DATABASE company_db;
-- Makes it so all of the following code will affect "new name_db --
USE company_db;
-- Creates the table "department table" within Company_db --
CREATE... |
<filename>application/user/sql/install.sql<gh_stars>0
/*
sql安装文件
*/
DROP TABLE IF EXISTS `hisiphp_user`;
CREATE TABLE `hisiphp_user` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`group_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '会员分组ID',
`nick` varchar(50) NOT NULL DEFAULT '' COMMENT '昵称',
... |
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
INSERT INTO cfdi_reglas_tasa_cuota VALUES('Fijo','','0.000000','IVA','Tasa',1,'','2017-01-01','');
INSERT INTO cfdi_reglas_tasa_cuota VALUES('Fijo','','0.160000','IVA','Tasa',1,'','2017-01-01','');
INSERT INTO cfdi_reglas_tasa_cuota VALUES('Rango','0.000000','0.160000','IVA',... |
<gh_stars>0
------------------------------------------------------------------------------------------------------------------------
--- LIMITED USER FOR SAFE ---
------------------------------------------------------------------------------------------------------------------------
DO
$do$
BEGIN
IF EXISTS... |
<gh_stars>0
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. The ASF licenses this file to You
-- 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 a... |
/* ======================================================================== */
/* PeopleRelay: declare.sql Version: 0.4.3.6 */
/* */
/* Copyright 2017-2018 <NAME> & <NAME> */
/* ... |
DROP TABLE IF EXISTS test.nullable;
CREATE TABLE test.nullable (s String, ns Nullable(String), narr Array(Nullable(UInt64))) ENGINE = Log;
INSERT INTO test.nullable SELECT toString(number), number % 3 = 1 ? toString(number) : NULL, arrayMap(x -> x % 2 = 1 ? x : NULL, range(number)) FROM system.numbers LIMIT 10;
SELEC... |
-- distinct
select sum_distinct(number) from ( select number % 100 as number from numbers(100000));
select count_distinct(number) from ( select number % 100 as number from numbers(100000));
select sum_distinct(number) / count_distinct(number) = avg_distinct(number) from ( select number % 100 as number from numbers(100... |
SELECT
DISTINCT `a`.`owner_id` AS `user_id`
FROM
`Contests` AS `c`
INNER JOIN
`ACLs` AS `a` ON `c`.`acl_id` = `a`.`acl_id`
WHERE
`c`.`rerun_id` IS NULL; |
--10. GDPR Violation
SELECT t.Id,
(SELECT
CASE
WHEN a1.MiddleName IS NULL THEN (a1.FirstName + ' ' + a1.LastName)
ELSE (a1.FirstName + ' ' + a1.MiddleName + ' ' + a1.LastName)
END AS [FullName]
FROM Accounts AS a1
WHERE a1.Id = a.Id
) AS [FullName] ,
(SELECT [Name] FROM Cities WHERE Id = a... |
CREATE TABLE states
(
name VARCHAR(16),
PRIMARY KEY(name)
) |
<reponame>deregenboog/ecd
-- VISITS
DROP TABLE IF EXISTS `tmp_visits_veegploeg`;
CREATE TABLE `tmp_visits_veegploeg` AS
SELECT
`r`.`locatie_id`,
`r`.`klant_id`,
DATE(`r`.`binnen`) AS 'date',
`g`.`volledig` AS 'gender',
SUM(TIME_TO_SEC(TIMEDIFF(`buiten`, `binnen`))) AS 'durati... |
-- Mysql/MariaDB init script
-- Create database and user
-- CREATE DATABASE `taliesin`;
-- GRANT ALL PRIVILEGES ON taliesin.* TO 'taliesin'@'localhost' identified BY 'taliesin';
-- FLUSH PRIVILEGES;
-- USE `taliesin`;
DROP TABLE IF EXISTS `t_stream_element`;
DROP TABLE IF EXISTS `t_stream`;
DROP TABLE IF EXISTS `t_cat... |
-- file:copyselect.sql ln:89 expect:true
create table test3 (c int)
|
<filename>pkg/sql/sem/tree/testdata/pretty/4.sql
select
phone0_.id as id1_6_0_,
person1_.id as id1_4_1_,
phone0_.phone_number as phone_nu2_6_0_,
phone0_.person_id as person_i4_6_0_,
phone0_.phone_type as phone_ty3_6_0_,
addresses2_.Person_id as Person_i1_5_0__,
ad... |
-- *********************************************************************
-- Update Database Script
-- *********************************************************************
-- Change Log: org/kuali/ole/1.5.2/db.changelog-20140728.xml
-- *********************************************************************
-- Lock Datab... |
-- 19.01.2010 00:39:31 MEZ
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
ALTER TABLE ad_system ADD COLUMN siphost VARCHAR(32); ALTER TABLE ad_system ADD COLUMN sipuser VARCHAR(32); ALTER TABLE ad_system ADD COLUMN sippassword VARCHAR(32); ALTER TABLE ad_system ADD COLUMN sipcontext VARCHAR(32)
;
--... |
-- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Apr 07, 2016 at 10:43 PM
-- Server version: 5.5.42
-- PHP Version: 7.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
<reponame>kamilszymanski/flyway<filename>flyway-core/src/main/resources/com/googlecode/flyway/core/dbsupport/hsql/upgradeTo20FormatPart1.sql
--
-- Copyright (C) 2010-2013 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in complian... |
<gh_stars>10-100
ALTER TABLE user DROP COLUMN IF EXISTS location_public;
--;;
ALTER TABLE user DROP COLUMN IF EXISTS location_lng;
--;;
ALTER TABLE user DROP COLUMN IF EXISTS location_lat;
--;;
ALTER TABLE user_badge DROP COLUMN IF EXISTS location_lng;
--;;
ALTER TABLE user_badge DROP COLUMN IF EXISTS location_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.