sql stringlengths 6 1.05M |
|---|
INSERT INTO sso.permissions(resource_type, action_type)
VALUES
(2, 1),
(2, 2),
(2, 3),
(2, 4),
(3, 1),
(3, 2),
(3, 3),
(3, 4),
(4, 1),
(4, 2),
(4, 3),
(4, 4),
(5, 1),
(5, 2),
(5, 3),
(5, 4),
(6, 1),
(6, 2),
(6, 3),
(6, 4),
(7, 1),
(7, 2),
(7, 3),
(7, 4);
|
-- phpMyAdmin SQL Dump
-- version 2.11.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 10, 2013 at 10:49 AM
-- Server version: 5.1.57
-- PHP Version: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `a8399093_gps`
--
-- -------------------------------------------------------... |
SELECT
schema_name(t.schema_id) as schema_name
, t.name
, c.name as columnName
, y.name as Sys_DataType
, u.name as User_datatype
, Case when c.system_type_id <> c.user_type_id then 'User_Defined' else 'System' end
, c.Column_id
, c.Max_length
, c.precision
, c.Scale
, c.Collation_n... |
-- file:rowsecurity.sql ln:347 expect:true
ALTER TABLE part_document ENABLE ROW LEVEL SECURITY
|
INSERT INTO `qb_config` (`id`, `type`, `title`, `c_key`, `c_value`, `form_type`, `options`, `ifsys`, `htmlcode`, `c_descrip`, `list`, `sys_id`) VALUES(0, -1, 'SEO标题', 'mseo_title', '', 'text', '', 0, '', '', 100, 4);
INSERT INTO `qb_config` (`id`, `type`, `title`, `c_key`, `c_value`, `form_type`, `options`, `ifsys`, `... |
SELECT
sum(CASE substr(data, 1, 1)
WHEN 'f' THEN split_part(data, ' ', 2)::int
END) *
sum(CASE substr(data, 1, 1)
WHEN 'd' THEN split_part(data, ' ', 2)::int
WHEN 'u' THEN split_part(data, ' ', 2)::int * -1
END)
FROM aoc.day_02;
|
SELECT relname,
array_to_string(ARRAY[relacl], '|') AS permits
FROM pg_class
WHERE relkind = 'r'
AND position('|=' in array_to_string(ARRAY[relacl], '|')) = 0
ORDER BY 1; |
<reponame>lanily/springboot-learn<filename>springboot-parent/springboot-jersey/src/main/resources/schema.sql
CREATE TABLE EMPLOYEE
(ID INT auto_increment PRIMARY KEY,
NAME VARCHAR(100) DEFAULT '',
ADDRESS VARCHAR(255) DEFAULT '',
CREATED_ON DATETIME,
MODIFIED_ON DATETIME);
insert into EMPLOYEE values (DEFAULT... |
select
sum(l_extendedprice * l_discount) as revenue
from
lineitem
where
l_shipdate >= date '1992-11-20'
and l_shipdate < date '1994-09-25'
and l_discount between 0.01722577214241028 and 0.04392045736312866
and l_quantity < 14.080395758152008;
|
<gh_stars>100-1000
-- Definitions of Rucio database scheduler jobs
-- Authors: Rucio team and <NAME>
/*
Note:
the Rucio jobs have to run on the Rucio services defined on the DB cluster (in order to take advantage of the already cached data/index blocks on the relevant DB nodes). RUCIO_JOB_CLASS and RUCIO_JOB_CLASS_2... |
<gh_stars>1-10
#-- Copyright 2022 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
#--
#-- https://www.apache.org/licenses/LICENSE-2.0
#--
#-- Unless required by applica... |
CREATE TABLE `clue_bind_data` (
`assign_source` TINYINT NOT NULL DEFAULT '1' COMMENT '分配来源: 1:系统分配 2:人工分配 3:自主认领',
PRIMARY KEY (`id`),
KEY `idx_mobile` (`mobile`) COMMENT '支持mobile的模糊查询',
KEY `idx_name` (`name`) COMMENT '支持name模糊匹配'
) ENGINE=INNODB CHARSET=utf8mb4 collate = utf8mb4_bin COMMENT = 'ok';
|
ALTER TABLE group_profile DROP COLUMN description;
|
<gh_stars>0
CREATE TABLE IF NOT EXISTS offers (
id SERIAL PRIMARY KEY,
owner_id INTEGER,
title TEXT,
description TEXT,
creation_timestamp TIMESTAMP,
is_archived BOOLEAN
);
CREATE TABLE IF NOT EXISTS tags (
name TEXT PRIMARY KEY
);
CREATE TABLE IF NOT EXISTS offers_tags (
... |
<filename>src/test/resources/sql-schema.sql
use imstest;
select * from customers;
select * from items;
select * from order_items;
select * from orders;
CREATE TABLE customers(
c_id INT NOT NULL AUTO_INCREMENT,
firstname VARCHAR(40) DEFAULT NULL,
surname VARCHAR(40) DEFAULT NULL,
PRIMARY KEY (`c_id`)
);
... |
<gh_stars>0
CREATE TABLE `icons_info` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) COLLATE utf8mb4_spanish2_ci DEFAULT NULL,
`img` varchar(100) COLLATE utf8mb4_spanish2_ci DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
);
... |
<filename>db/update_table.sql
-- TODO update sql |
<filename>afu_gefahrenkartierung_pub_export_ai/pub/ik_sturz.sql
SELECT
t_ili_tid,
prozessa,
prozessq,
wkp,
int_stufe,
bemerkung,
gs_korr,
ngkid,
geometrie
FROM
afu_gefahrenkartierung.gefahrenkartirung_ik_sturz
WHERE
int_stufe != 'keine'
;
|
<reponame>Shuttl-Tech/antlr_psql
-- file:rules.sql ln:445 expect:true
insert into rtest_view1 values (8, 'item 8', 't')
|
<reponame>Shuttl-Tech/antlr_psql
-- file:rolenames.sql ln:268 expect:true
ALTER AGGREGATE testagg1(int2) OWNER TO CURRENT_USER
|
<gh_stars>1000+
PROMPT Creating User 'DOJO'
DROP USER dojo;
CREATE USER dojo IDENTIFIED BY pass
DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE temp;
GRANT RESOURCE TO dojo;
GRANT CONNECT TO dojo;
/
|
<reponame>aleal629/SpringBoot_GameStore_JDBC_REST_API_Application<filename>SpringBoot_GameStore_JDBC_REST_API_Application/GameStoreTax.sql
use game_store_test;
insert into sales_tax_rate (state, rate) values
('AL', .05),
('AK', .06),
('AZ', .04),
('AR', .06),
('CA', .06),
('CO', .04),
('CT', .03),
('DE', .05),
('FL',... |
<filename>layers/common/level.sql
CREATE OR REPLACE FUNCTION expand_levels(level text, repeat_on text)
RETURNS numeric[] as $$
select
array_cat(
string_to_array(level, ';'),
repeat_on_to_array(repeat_on)
)::numeric[];
$$ LANGUAGE SQL IMMUTABLE;
|
<reponame>asstitle/dxnet
/*
Navicat MySQL Data Transfer
Source Server : test
Source Server Version : 50553
Source Host : localhost:3306
Source Database : fastadmin
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2019-09-01 21:04:38
*/
SET FOREI... |
truncate account_holders;
\copy account_holders FROM 'data/accountholder.csv' DELIMITER ',' CSV
truncate bank_accounts;
\copy bank_accounts FROM 'data/bankaccounts.csv' DELIMITER ',' CSV
truncate bank_clients;
\copy bank_clients FROM 'data/bankclients.csv' DELIMITER ',' CSV
truncate bank_customers;
\copy bank_cus... |
<reponame>xiaxinyu/liquibase<gh_stars>0
SET MODE MySQL;
alter table `user` add column `address` VARCHAR(100) NOT NULL; |
#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
CREATE TABLE 'users' WITH DESCRIPTION 'example for maven archetype'
ROW KEY FORMAT HASH PREFIXED(2)
WITH LOCALITY GROUP default WITH DESCRIPTION 'main storage' (
MAXVERSIONS = 10,
TTL = FOREVER,
INMEMORY = false,
COMPRESSED WI... |
USE data_extracts;
DROP PROCEDURE IF EXISTS executeBartsPancreas9UrineBP2;
DELIMITER //
CREATE PROCEDURE executeBartsPancreas9UrineBP2()
BEGIN
-- All since 2002
CALL populateDatasetBP2(
'bp2_urinetestdataset',
'463%,466%,467%,468%,469%,46A%,46X%,46f%,46M1.-46MA.,46ML.,46MR.,46R1.,46R2.,46R5.,46T%,46g%,CTV3_Xa97... |
<reponame>dpocheng/MySQL-Practice-Projects
# Drop and Create database
DROP DATABASE IF EXISTS CS122a;
CREATE DATABASE CS122a;
USE CS122a;
# Dump of table Airplane
DROP TABLE IF EXISTS `Airplane`;
CREATE TABLE `Airplane` (
`registration_number` varchar(10) NOT NULL,
`model_number` varchar(10) DEFAULT NULL,
`pu... |
-- Database: ingres
-- Change Parameter: tableName=person
DROP TABLE person;
|
ALTER TABLE `#__imageshow_theme_profile` ADD `theme_style_name` CHAR(255) NOT NULL DEFAULT '' AFTER `theme_name`;
UPDATE `#__imageshow_theme_profile` SET `theme_style_name` = 'flash' WHERE `theme_name` = 'themeclassic' AND `theme_style_name` = ''; |
--
-- The contents of this file are subject to the license and copyright
-- detailed in the LICENSE and NOTICE files at the root of the source
-- tree and available online at
--
-- http://www.dspace.org/license/
--
-------------------------------------------------------------------------
-- DS-3431 Workflow system is ... |
<filename>openGaussBase/testcase/KEYWORDS/translate/Opengauss_Function_Keyword_Translate_Case0032.sql<gh_stars>0
-- @testpoint:opengauss关键字translate(非保留),作为用户名
--关键字explain作为用户名不带引号,创建成功
drop user if exists translate;
CREATE USER translate PASSWORD '<PASSWORD>';
drop user translate;
--关键字explain作为用户名加双引号,创建成功
drop u... |
/*
Popularity of Hack
https://platform.stratascratch.com/coding/10061-popularity-of-hack?python=
Difficulty: Easy
-- Facebook has developed a new programing language called Hack.To measure the popularity of Hack they ran a survey with their employees. The survey included data on previous programing familiarity as wel... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS users (
name text NOT NULL,
password text NOT NULL,
email_address text NOT NULL,
user_id uuid DEFAULT gen_random_uuid(),
date_joined bigint NOT NULL DEFAULT get_now(),
CONSTRAINT users_pk
PRIMARY KEY (user_id)
); |
set define off
set verify off
set feedback off
WHENEVER SQLERROR EXIT SQL.SQLCODE ROLLBACK
begin wwv_flow.g_import_in_progress := true; end;
/
-- AAAA PPPPP EEEEEE XX XX
-- AA AA PP PP EE XX XX
-- AA AA PP PP EE XX XX
-- AAAAAAAAAA PPPPP EEEE ... |
<reponame>2002-feb24-net/caleb-code
-- 1. which artists did not make any albums at all?
SELECT *
FROM Artist
WHERE ArtistId NOT IN(
SELECT ArtistId
FROM Album);
-- 2. which artists did not record any tracks of the Latin genre?
select Artist.Name as Artist
from Track
inner join Genre on Genre.GenreId = Track.GenreId... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 01, 2020 at 04:58 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 SET @OL... |
<reponame>James-McNeill/Medium<gh_stars>0
SELECT Department,
JobRole,
BusinessTravel,
CHARINDEX('sales', JobRole) as Expression1,
CHARINDEX('Exec', JobRole) as Expression2
FROM Medium.dbo.[HR-Employee-Attrition]
-- Look for the "sales" expression in the JobRole
WHERE CHARINDEX('sales', JobRole) > 0;
|
<filename>prisma/migrations/20210519184037_added_default_country/migration.sql<gh_stars>0
-- AlterTable
ALTER TABLE `Property` MODIFY `country` CHAR(50) NOT NULL DEFAULT 'Brazil';
|
-- phpMyAdmin SQL Dump
-- version 3.1.3.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 12, 2015 at 06:49 PM
-- Server version: 5.1.33
-- PHP Version: 5.2.9
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `db_bk`
--
-- --------------------------------------------------------
--
--... |
set autocommit=0;
DELETE FROM OSG_CN_DATA WHERE Month = 10 AND Year = 2010 ;
INSERT INTO OSG_CN_DATA VALUES ('NERSC-PDSF', 'alice', '/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=jporter/CN=482817/CN=<NAME>', '53947', '200294', '232341', '233017', '270299', '10', '2010', '2010-10-01', '2010-10-31', '1.16', '2010-11-11 00... |
CREATE TABLE SYS_ORG(
ID VARCHAR2(32) PRIMARY KEY ,
PARENT_ID VARCHAR2(32),
ORG_CODE VARCHAR2(64),
ORG_NUM VARCHAR2(64),
ORG_NAME VARCHAR2(128),
ORG_TYPE VARCHAR2(8),
USE_STATE INTEGER,
ORDER_NUM INTEGER,
CREATE_TIME DATE,
UPDATE_TIME DATE,
CREATE_BY VARCHAR2(128),
UPDATE_BY VARCHAR2(128),
DEL... |
-- file:numeric.sql ln:753 expect:true
SELECT '' AS to_char_1, to_char(val, '9G999G999G999G999G999')
FROM num_data
|
insert into dm_exec_sessions_time_dump
select
getdate() as collect_date
,database_id
,db_name(database_id) as database_name
,datediff(MILLISECOND, last_request_start_time, last_request_end_time) as elapsed_time_ms
,count(*) as cnt
from sys.dm_exec_sessions
where last_request_start_time is not null
and last_reque... |
<reponame>launchql/utils
-- Verify schemas/public/domains/attachment on pg
BEGIN;
SELECT verify_type ('public.attachment');
ROLLBACK;
|
<gh_stars>1-10
create database if not exists appointments;
create user if not exists 'admin';
grant all on appointments.* to 'admin'@'localhost' identified by 'admin';
|
CREATE TABLE `adminAccounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(255) COLLATE utf8_bin NOT NULL,
`password` varchar(255) COLLATE utf8_bin NOT NULL,
`fullName` varchar(255) COLLATE utf8_bin NOT NULL,
`email` varchar(255) COLLATE utf8_bin NOT NULL,
`permissionTitle` varchar(255) COLLATE... |
<filename>conf/evolutions/default/1.sql
# Users schema
# --- !Ups
CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT,
username varchar(50) NOT NULL,
PRIMARY KEY (id)
);
# --- !Downs
DROP TABLE users;
|
delimiter $$
CREATE TRIGGER h1n1_concern_trigger BEFORE INSERT ON H1N1 FOR EACH ROW
BEGIN
IF NEW.h1n1_concern >3 THEN
SIGNAL SQLSTATE '45000'
SET MESSAGE_TEXT ='ERROR: H1N1 CONCERN SHOULD BE A NUMERICAL VALUE BETWEEN 0 AND 3. PLEASE TRY AGAIN'
;END IF;
END $$
###RESPONSE
### 0 row(s) affected
INSERT INTO H1N1... |
##查询代打印列表
#macro($queryPrintList(startAt,endAt,status,accountName))
select * from fallible_question_print_order a
#if(accountName)
inner join user b on a.user_id = b.id
inner join account c on b.account_id = c.id
#end
where a.status in (1,2,3,4)
#if(startAt)
and a.pay_time >= :startAt
#end
#if(endAt)
and... |
<reponame>mvrabel/nifi-dwh-etl-template<filename>postgres/metabase/metabase_admin.sql<gh_stars>10-100
CREATE USER metabase_admin;
ALTER USER metabase_admin WITH NOSUPERUSER INHERIT NOCREATEROLE CREATEDB LOGIN NOREPLICATION NOBYPASSRLS ENCRYPTED PASSWORD '<PASSWORD>'; |
<reponame>p6/bizsensebms<filename>util/dev/scripts/Install/Demo/Data/Sql/lead.sql
INSERT INTO `lead` (`first_name`,`middle_name`,`last_name`,`company_name`,`address_line_1`,`address_line_2`,`city`,`state`,`country`,`created`,`lead_source_id`,`lead_status_id`,`assigned_to`,`branch_id`,`created_by`) VALUES ('Alika','Jana... |
<reponame>jpbertles/Mindosa.Nomad<filename>src/Mindosa.Nomad/Mindosa.Nomad.Core/EmbeddedScripts/MySql/CreateHistory.sql
CREATE TABLE `nomad_history` (
`migration_id` INT NOT NULL AUTO_INCREMENT,
`migration_version` VARCHAR(8000) NOT NULL,
`description` VARCHAR(8000) NOT NULL,
`status` VARCHAR(50) NOT NULL,
`... |
CREATE TABLE IF NOT EXISTS category (
id BIGSERIAL PRIMARY KEY UNIQUE,
name VARCHAR(255) UNIQUE
);
CREATE TABLE IF NOT EXISTS product (
id BIGSERIAL PRIMARY KEY UNIQUE,
category_id BIGINT REFERENCES category(id),
name VARCHAR(255) NOT NULL... |
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
#-----------------------------------------------------------------------------
#-- album
#-----------------------------------------------------------------------------
D... |
<filename>Estoque/Estoque no produto pai sem desmembrar para o filho.sql
WITH ESTOQUEPROD_PAI AS (
SELECT E.CODFILIAL AS CODFILIAL_PAI,
E.DTULTENT AS DTULTENT_PAI,
P.CODPRODMASTER AS COD_PAI,
P.DESCRICAO AS PRODUTO_PAI,
E.QTESTGER AS QTESTGER_PAI,
E.QTRESERV AS... |
-- Table: server.message_emotes
-- DROP TABLE server.message_emotes;
CREATE TABLE server.message_emojis
(
message_id bigint NOT NULL,
emoji_id bigint NOT NULL,
count integer NOT NULL,
edited_at timestamp without time zone,
CONSTRAINT message_emotes_fkey_emoji FOREIGN KEY (emoji_id)
REFEREN... |
<gh_stars>10-100
CREATE OR REPLACE VIEW "public"."offers" AS
SELECT t.artwork_id,
max(t.amount) AS amount,
t.psbt,
t.id
FROM (transactions t
JOIN artworks a ON ((t.artwork_id = a.id)))
WHERE (((t.created_at > a.transferred_at) OR (a.transferred_at IS NULL)) AND (t.type = 'bid'::text))
GROUP BY... |
-- file:create_view.sql ln:527 expect:true
select pg_get_viewdef('tt17v', true)
|
CREATE USER itms_user WITH ENCRYPTED PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE itms TO itms_user; |
<filename>src/main/resources/db/migration/V3__alter_row_info_wb_list.sql
ALTER TABLE af.wb_list_records
ADD COLUMN row_info text;
|
<gh_stars>100-1000
CREATE OR REPLACE FORCE EDITIONABLE VIEW VIEW_SYMBOL# ("A_ID", "STRING_FIELD") AS
SELECT A_ID, STRING_FIELD FROM TABLE_A WHERE A_ID = 3
GO |
select backup_plan_id, arn
from aws.aws_backup_plan
where backup_plan_id = '{{ output.id.value }}'; |
CREATE TABLE kbln (
id integer NOT NULL,
blank_series varchar(50) NOT NULL,
company_id varchar(8)) partition by
range ( id);
create table kbln_p0 partition of kbln for
values from ( minvalue) to ( 500000) partition by hash ( blank_series);
create table kbln_p0_1 partition of kbln_p0 for
values with ( ... |
<reponame>zionyun/cubrid-testcases<filename>sql/_31_cherry/issue_22162_more_json_functions/cases/cbrd_23356.sql<gh_stars>1-10
set names utf8 collate utf8_en_cs;
SELECT JSON_SEARCH('{"Name": "Bart", "Age": 10}', 'one', 'Bart') ;
set names iso88591;
commit;
|
-- @testpoint:给表添加多个字段,不带column
drop table if exists yy;
create table yy(id int);
alter table yy add ( age1 int,t_name char(20));
drop table yy; |
-- Test TD slot deadlock detecting logic.
-- Expected: UStore engine should not loop forever if there are two transactions
-- that wait for each other for free TD slot.
CREATE TABLE bmsql_district (
d_w_id integer not null,
d_id integer not null,
d_ytd decimal(12,2),
d_tax ... |
<reponame>open-game-backend/auth
CREATE TABLE auth_role (
name VARCHAR(100) NOT NULL,
PRIMARY KEY (name)
);
|
-- This file should undo anything in `up.sql`
DROP TABLE IF EXISTS notes;
DROP TABLE IF EXISTS tokens;
DROP TABLE IF EXISTS accounts;
DROP SEQUENCE IF EXISTS accounts_id_seq; |
CREATE TABLE IF NOT EXISTS coffee_machines
(
id INT AUTO_INCREMENT PRIMARY KEY,
make CHAR(16),
model CHAR(16),
price CHAR(16)
);
INSERT INTO coffee_machines(make , model , price )
VALUES ("Krups","<NAME>", 140.00),
("Gaggia","Cubika", 170.00),
("DeLonghi","Magnifica", 500.00),
("Magimix","Nespresso", 300.00),
... |
-- original: where9.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d,e,f,g);
INSERT INTO t1 VALUES(1,11,1001,1.001,100.1,'bcdefghij','yxwvuts');
INSERT INTO t1 VALUES(2,22,1001,2.002,100.1,'cdefghijk','yxwvuts');
INSERT INTO t1 VALUES(3,33,1001... |
ALTER TABLE
schemas_x_blocks
RENAME TO
block_schema_bridges;
ALTER TABLE
block_schema_bridges
ADD COLUMN position int4 NOT NULL;
ALTER TABLE
block_schema_bridges
ADD COLUMN created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL;
|
<reponame>marunowskia/AutoExperiment
SELECT GENERATE_SEED_EXPERIMENTS(GET_ACTIVE_EXPERIMENT_GROUP());
--
SELECT RECORD_EXPERIMENT_RESULT(1,-99999999,'1');
SELECT RECORD_EXPERIMENT_RESULT(2,-99999999,'2');
SELECT RECORD_EXPERIMENT_RESULT(3,-99999999,'3');
SELECT RECORD_EXPERIMENT_RESULT(5,-99999999,'4');
SELECT RECORD... |
<filename>spring-boot/zero-downtime/src/main/resources/db/migration/V002__add_address_columns.sql<gh_stars>1000+
alter table customer add column address_street varchar(100) null;
alter table customer add column address_street_number varchar(100) null;
|
-- SETUP TIMETRAVEL ROLE
USE ROLE SECURITYADMIN;
CREATE ROLE IF NOT EXISTS TIMETRAVEL_ROLE;
ALTER ROLE TIMETRAVEL_ROLE SET
COMMENT = $$Owns the TIMETRAVEL environment$$
;
GRANT ROLE TIMETRAVEL_ROLE TO USER <YOUR_USER>;
-- SETUP TIMETRAVEL WH & DB
USE ROLE SYSADMIN;
CREATE WAREHOUSE IF NOT EXISTS TIMETRAVEL_WH;
ALT... |
BEGIN;
CREATE TABLE IF NOT EXISTS images (
id SERIAL PRIMARY KEY,
title VARCHAR(40) NOT NULL,
author TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS parameters (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
pkey VARCHAR(255) NOT NULL,
max_value INTEGER REFERENCES images(id)... |
<filename>pgsmo/objects/view/materialized_view_templates/pg/9.3_plus/select.sql
{#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#}
select {% if data.columns and data.columns|length > 0 %} {% for c in data.co... |
<filename>core/proc/tbl_t_queue_members_log.sql
DROP TABLE IF EXISTS `t_queue_members_log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_queue_members_log` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Record ID',
`ts` timestamp NOT NU... |
<reponame>bgswilde/Node-Employee-Tracker<filename>db/seeds.sql
INSERT INTO departments (name)
VALUES
('Sales'),
('Engineering'),
('Human Resources'),
('Administration');
INSERT INTO roles (title, salary, department_id)
VALUES
('Sales Lead', 100000, 1),
('Salesperson', 70000, 1),
('Sales Int... |
<filename>itl_genDDL.sql
-- Purpose : generate DDL to change INITRANS for table & its indexes due to ITL waits / ITL deadlock / enq: TX - allocate ITL entry
-- Run from app schema
-- 29-Sep-2021
-- ------------------------------------------
select 'ALTER TABLE ' || table_name || ' INITRANS 50;' stmt_1
from user_table... |
<reponame>maketubo/liquibase
-- Database: sybase
-- Change Parameter: procedureName=new_customer
DROP PROCEDURE new_customer;
|
-- trivial
SELECT
categoricalInformationValue(x.1, x.2)
FROM (
SELECT
arrayJoin(arrayPopBack([(1, 0)])) as x
);
SELECT
categoricalInformationValue(x.1, x.2)
FROM (
SELECT
arrayJoin([(0, 0)]) as x
);
SELECT
categoricalInformationValue(x.1, x.2)
FROM (
SELECT
arrayJoin([... |
<gh_stars>1-10
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
CREATE DATABASE single;
-- Always pre-create the data node database 'dn1' so that we can dump
-- and restore it even on Ti... |
<filename>sql/bestprofit/small/bestprofit_reasonable.sql
select max(running_diff)
from (select t_price - min(t_price) over
(order by t_timestamp
rows unbounded preceding)
as running_diff
from tradessmall
where t_tid = 4 and t_tradedate = 2) as t1;
|
<reponame>bloomberg/cartodb-postgresql
---- Make sure 'cartodb' is in database search path
DO
$$
DECLARE
var_result text;
var_cur_search_path text;
BEGIN
SELECT reset_val INTO var_cur_search_path
FROM pg_settings WHERE name = 'search_path';
IF var_cur_search_path LIKE '%cartodb%' THEN
RAISE DEBUG '"carto... |
-- @testpoint: 与distinct函数结合使用
DROP TABLE IF EXISTS products;
CREATE TABLE products
( product_id INTEGER,
product_name VARCHAR2(60),
category VARCHAR2(60)
);
INSERT INTO products VALUES(1502, 'olympus camera', 'great openGauss');
INSERT INTO products VALUES(1601, 'lamaze', 'openGauss great');
INSERT INTO products... |
<reponame>zdergatchev/Database-Basic
USE table_relation_DB;
CREATE TABLE `teachers` (
`teacher_id` INT PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(50),
`manager_id` INT,
CONSTRAINT `fk_teacher_id`
FOREIGN KEY (`manager_id`) REFERENCES `teachers` (`teacher_id`)
);
INSERT INTO `teachers` (`teacher_id`, `name`)
VA... |
/*================================================================================*/
/* DDL SCRIPT */
/*================================================================================*/
/* Title : PhpPlaisiok: Request Logger for light websites and... |
<reponame>tushartushar/dbSmellsData<filename>data/open-source/extracted_sql/p6spy_p6spy.sql<gh_stars>1-10
update customers set name=xyz where id=1
select count(*) from prepstmt_test where
select count(*) from customers where id=1 and name='xyz'
insert into prepstmt_test values (?, ?)
insert into prepstmt_test values (... |
<reponame>MikeBeaton/SqlDataComparisonUtils
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*[[LICENSE]]*/
CREATE FUNCTION [internals].[SplitIds] (
@ids NVARCHAR(MAX),
@splitChar CHAR(1)
) RETURNS @idsTable TABLE (orderBy int not null, id int not null)
AS
BEGIN
DECLARE @index int
DECLARE @orderBy int = 0
DECLARE... |
<gh_stars>1-10
CREATE TABLE [BookMyTicket].[Cities] (
[ID] BIGINT IDENTITY (1, 1) NOT NULL,
[Name] VARCHAR (255) NULL,
PRIMARY KEY CLUSTERED ([ID] ASC)
);
|
USE AuditDemo;
GO
-- New members of privileged roles
CREATE TRIGGER trgPrivilegedRoleMemberAdded
ON ALL SERVER
FOR ADD_SERVER_ROLE_MEMBER
AS BEGIN
IF EVENTDATA().value('(/EVENT_INSTANCE/RoleName)[1]', 'nvarchar(max)') = 'sysadmin'
SELECT EVENTDATA();
END;
GO
CREATE LOGIN newUser WITH PASSWORD = '', ... |
<reponame>mihir-m-gandhi/Brainstorm-Online-Learning-System<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 02, 2018 at 07:22 PM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 5.6.37
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCO... |
CREATE TABLE subdivision_BZ (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_BZ" ("id", "name", "level") VALUES (E'BZ-BZ', E'Belize', E'district');
INSERT INTO "subdivision_BZ" ("id", "name", "level") VALUES (E'BZ-CY', E'Cayo', E'district');
INSERT INTO... |
/*
Navicat Premium Data Transfer
Source Server : 致优特
Source Server Type : MySQL
Source Server Version : 50635
Source Host : 172.16.58.3:3306
Source Schema : small
Target Server Type : MySQL
Target Server Version : 50635
File Encoding : 65001
Date: 23/03/2018 10:01:06... |
INSERT INTO RequiredReports
VALUES (NULL,
'eMASS-Importable POA&M',
'Excel',
'True',
'Vulnerability Management');
INSERT INTO RequiredReports
VALUES (NULL,
'Navy RAR',
'Excel',
'True',
'Vulnerability Management');
INSERT INTO RequiredReports
VALUES (NULL... |
-- collate4.test
--
-- execsql {
-- SELECT max('101', b) FROM collate4t1;
-- }
SELECT max('101', b) FROM collate4t1; |
<filename>youtube/SQL-SELECT-02-where-clause.sql
use tinyu
go
select * from students
where student_year_name = 'Freshman' --selection
-- names of all freshman
select student_firstname, student_lastname, student_year_name
from students
where student_year_name ='Freshman'
--- students who are not freshmen... |
create or replace view "AIRBYTE_DATABASE"._AIRBYTE_TEST_NORMALIZATION."UNNEST_ALIAS_CHILDREN_AB2" as (
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
select
_AIRBYTE_UNNEST_ALIAS_HASHID,
cast(AB_ID as
bigint
) as AB_ID,
cast(OWNER as
variant... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.