sql stringlengths 6 1.05M |
|---|
<reponame>Snowflake-Labs/sfguide-marketplace-provider
-- Copyright (c) 2021 Snowflake Inc. All rights reserved.
-- Create a smaller database to be shared with Marketplace or Data Exchange data consumers and replicated across multiple regions
-- Create tables to house the data to be shared with consumers
-- Set up a re... |
<gh_stars>10-100
UPDATE service_instance si
JOIN last_operation lo ON si.guid = lo.guid
SET si.deleted = TRUE
WHERE lo.operation = 'DEPROVISION' AND lo.status LIKE 'SUCC%' |
DROP TABLE {$NAMESPACE}_project.project_profile;
|
<filename>apgdiff.tests/src/main/resources/cz/startnet/utils/pgdiff/depcies/add_change_col_type_usr_t1_c1_new.sql
CREATE TABLE public.t1 (
c1 text
);
ALTER TABLE public.t1 OWNER TO botov_av; |
<filename>src/data/new/status.sql
INSERT INTO `taskforce`.`status` (`name`)
VALUES
("STATUS_NEW"),
("STATUS_EXECUTION"),
("STATUS_CANCELED"),
("STATUS_FAILED"),
("STATUS_DONE") |
<reponame>NCIP/cabio<filename>software/cabio-database/scripts/sql_loader/no_longer_used/indexes/go_closure.cols.sql
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
create index GO_CLOSUSURE_ANCESTOR on GO_CLOSURE(ANCEST... |
<reponame>opengauss-mirror/Yat
-- @testpoint:创建函数添加参数COST,估计函数的执行成本是0.0025
drop FUNCTION if EXISTS u_testfun1(c_int int);
CREATE FUNCTION u_testfun1(c_int int) RETURNS int AS $$
BEGIN
RETURN (c_int);
END;
$$ LANGUAGE plpgsql
STRICT
COST 0.0025;
/
drop FUNCTION u_testfun1; |
<filename>openGaussBase/testcase/KEYWORDS/Dbcompatibility/Opengauss_Function_Keyword_Dbcompatibility_Case0018.sql
-- @testpoint:opengauss关键字dbcompatibility(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists dbcompatibility;
create database dbcompatibility;
drop database dbcompatibility;
--关键字带双引号-成功
drop database if e... |
<filename>resources/addColumnUser.sql
ALTER TABLE user ADD img1 varchar(255) DEFAULT null;
ALTER TABLE user ADD img2 varchar(255) DEFAULT null; |
CREATE PROCEDURE usp_get_employees_from_town(town_name VARCHAR(255))
BEGIN
SELECT
first_name,
last_name
FROM `employees` AS e
JOIN `addresses` AS a
ON a.address_id = e.address_id
JOIN `towns` AS t
ON t.town_id = a.town_id AND t.name = town_name
ORDER BY first_name A... |
<gh_stars>0
/*
* ESPRJ-2854
*/
INSERT INTO `synapse`.`ebi_config` (`key`, `value`) VALUES ('System_Admin_URL', 'http://synapse-qa-admin.mnv-tech.com/'); |
<gh_stars>0
ALTER TABLE `messages` ADD `message` VARCHAR(255) NOT NULL AFTER `updated_at`, ADD `to_user` VARCHAR(255) NOT NULL AFTER `message`, ADD `send_at` VARCHAR(255) NOT NULL AFTER `to_user`;
|
CREATE DATABASE IF NOT EXISTS `cadastro` /*!40100 DEFAULT CHARACTER SET utf8 */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `cadastro`;
-- MySQL dump 10.13 Distrib 8.0.27, for Win64 (x86_64)
--
-- Host: localhost Database: cadastro
-- ------------------------------------------------------
-- Server version 8.0.27
/*!... |
<filename>app/model/schema.sql
CREATE TABLE `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(254) NOT NULL,
`slug` varchar(254) NOT NULL,
`text` text NOT NULL,
`published` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
CREATE TABLE `comments` (
`id` int(11) NOT NULL AUTO_INCREMEN... |
<filename>db/bgg (3).sql
-- phpMyAdmin SQL Dump
-- version 3.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 03, 2016 at 06:31 AM
-- Server version: 5.5.25a
-- PHP Version: 5.4.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
<filename>sql/latest_ran/insert.sql
INSERT INTO `latest_ran` (table_name, `date`) VALUES (?,?);
|
CREATE OR REPLACE FORCE VIEW "CARS"."FUEL_PRICES_BY_YEAR" ("YEAR", "AVG FUEL PRICE", "MEDIAN FUEL PRICE", "STDDEV FUEL PRICE") AS
SELECT
YEAR_COL,
ROUND(AVG(price),2) AS "AVG FUEL PRICE",
ROUND(MEDIAN(price),2) AS "MEDIAN FUEL PRICE",
ROUND(STDDEV(price),2) AS "STDDEV FUEL PRICE"
FROM CARS.FUEL
J... |
CREATE TABLE [claim] (
[claim_id] uniqueidentifier PRIMARY KEY NOT NULL DEFAULT (NEWID()),
[claim_number] int UNIQUE NOT NULL IDENTITY(1, 1),
[loss_date] date NOT NULL,
[report_date] date NOT NULL,
[close_date] date DEFAULT (NULL),
[reopen_date] date DEFAULT (NULL),
[reclose_date] date DEFAULT (NULL),
[... |
<reponame>commi235/oos-utils<gh_stars>100-1000
create or replace package oos_util_crypto
as
-- CONSTANTS
/**
* @constant gc_hash_md4
* @constant gc_hash_md5
* @constant gc_hash_sh1
* @constant gc_hash_sh224
* @constant gc_hash_sh256
* @constant gc_hash_sh384
* @constant gc_hash_sh512
* @cons... |
<filename>routines/time/start_of_month.sql
--
-- Returns first day of month of given datetime, as DATE object
--
-- Example:
--
-- SELECT start_of_month('2011-03-24 11:13:42');
-- Returns: '2011-03-01' (as DATE)
--
DELIMITER $$
DROP FUNCTION IF EXISTS start_of_month $$
CREATE FUNCTION start_of_month(dt DATETIME) RE... |
<filename>users_table.sql
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`user_id` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`email` varchar(100) NOT NULL,
`password` varchar(50) NOT NULL,
`date_time` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Indexes for table ... |
-- An additional query to be run when setting up our demo database. This will
-- drop the `forum_example_postgraphile` role which people know the password for
-- (because it’s in the tutorial!), and creates additional
-- `forum_example_postgraphile_demo` role which only has the permissions of an
-- anonymous user.
beg... |
<reponame>junsulee/todo-list<gh_stars>10-100
insert into role(id,name) values (1, 'USER');
insert into role(id,name) values (2, 'ACTUATOR');
insert into users(id, account_non_expired, account_non_locked, credentials_non_expired, email, enabled, name, password) values (1, TRUE, TRUE, TRUE, '<EMAIL>', TRUE, '<NAME>', 'p... |
<reponame>ryheena/tennis-crystal-ball
ALTER TABLE set_score ADD COLUMN w_tbs SMALLINT;
ALTER TABLE set_score ADD COLUMN l_tbs SMALLINT;
UPDATE set_score
SET w_tbs = CASE WHEN w_games = l_games + 1 AND l_games >= 6 THEN 1 ELSE NULL END,
l_tbs = CASE WHEN l_games = w_games + 1 AND w_games >= 6 THEN 1 ELSE NULL END;
... |
{{config(enabled = target.type == 'bigquery')}}
{% if var("product_warehouse_event_sources") %}
{% if 'segment_events_page' in var("product_warehouse_event_sources") %}
with source as (
select * from {{ var('stg_segment_events_segment_users_table') }}
),
renamed as (
select concat('stg_segment_events_id-prefi... |
<reponame>keitarobr/experion-engine-lattes<gh_stars>0
create table lattes
(
lattes_id varchar(100) not null
constraint lattes_pkey
primary key,
nome_completo varchar(200) not null,
nome_citacao varchar(2048) not null,
lattes_resumo text,
lattes_resumo_en text,
lattes_atualizacao date,
especialidade text
)
;... |
<filename>server/src/main/resources/org/cloudfoundry/identity/uaa/db/sqlserver/V2_0_0__Multitenancy.sql
--
-- Copyright (c) [2016] Cloud Foundry Foundation. All Rights Reserved.
--
-- This product is licensed to you under the Apache License, Version 2.0 (the "License").
-- You may not use this product except in complia... |
CREATE TABLE IF NOT EXISTS `wz_questactquestdata` (
`id` int(11) NOT NULL,
`quest` int(11) NOT NULL DEFAULT 0,
`state` tinyint(1) NOT NULL DEFAULT 2,
`uniqueid` int(11) NOT NULL DEFAULT 0
) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC;
--
-- wz quest act quest data data.
--
INSERT IGNORE INTO `wz_q... |
<gh_stars>1-10
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.1
-- Dumped by pg_dump version 13.1
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_catalog.set_config('search... |
<filename>scripts/plugins/storage/postgres/upgrade/15.sql
CREATE INDEX IF NOT EXISTS log_ix2 on fledge.log(ts);
CREATE INDEX IF NOT EXISTS tasks_ix1 on fledge.tasks(process_name, start_time);
|
/*
################################################################################
Migration script to create ANCESTRAL_GROUP and ANCESTRY_ANCESTRAL_GROUP tables
Designed for execution with Flyway database migrations tool; this should be
automatically run to completely generate the schema that is out-of-the-box
compa... |
<filename>fhir-bucket/src/main/resources/scratch/randomPatientIds.sql
-------------------------------------------------------------------------------
-- (C) Copyright IBM Corp. 2020
--
-- SPDX-License-Identifier: Apache-2.0
-------------------------------------------------------------------------------
SELECT lr.... |
DROP TABLE IF EXISTS stuff;
CREATE TABLE stuff
(
id INT UNSIGNED PRIMARY KEY,
label VARCHAR(250)
);
INSERT INTO stuff (id, label) VALUES (1, 'one');
INSERT INTO stuff (id, label) VALUES (2, 'two');
INSERT INTO stuff (id, label) VALUES (3, 'three');
INSERT INTO stuff (id, label) VALUES (4, 'four');
INSERT I... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint: 类型转换函数to_number,将字符串类型的值转换为指定格式的数字,入参为无效值时合理报错
-- 非数字类型 + 模式串
SELECT to_number('openguass', '99G999D9S');
-- 其它类型 + 模式串
SELECT to_number('0b101010', '99G999D9S');
-- 数字 + 错误格式
SELECT to_number('233', '8675645');
-- 非数字 + 错误格式
SELECT to_number('高斯', 'xxx');
... |
SELECT city.name,country.name,country.region
FROM cities AS city
INNER JOIN countries AS country
ON city.country_code = country.code;
SELECT CITY.NAME AS CITY, COUNTRY.NAME AS COUNTRY, COUNTRY.REGION
FROM CITIES AS CITY
INNER JOIN COUNTRIES AS COUNTRY
ON CITY.COUNTRY_CODE = COUNTRY.CODE;
SELECT C.CODE AS COUNTRY_CODE... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 05, 2017 at 09:15 AM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 20 Sep 2021 pada 04.30
-- Versi server: 8.0.11
-- Versi PHP: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_... |
<gh_stars>0
-- truncate all performance report tables
set foreign_key_checks = 0;
truncate table report_performance_display_hierarchy_platform;
truncate table report_performance_display_hierarchy_platform_account;
truncate table report_performance_display_hierarchy_platform_site;
truncate table report_performance_disp... |
CREATE USER 'whatup'@'%' IDENTIFIED BY '<PASSWORD>';
CREATE DATABASE IF NOT EXISTS `whatup`;
GRANT ALL PRIVILEGES ON `whatup`.* TO 'whatup'@'%';GRANT ALL PRIVILEGES ON `whatup\_%`.* TO 'whatup'@'%';
flush privileges;
|
CREATE USER MSPETSHOP4PROFILE PROFILE DEFAULT IDENTIFIED BY "<PASSWORD>" DEFAULT TABLESPACE USERS QUOTA UNLIMITED ON USERS;
GRANT CREATE SESSION TO MSPETSHOP4PROFILE;
CREATE TABLE MSPETSHOP4PROFILE.PROFILES (
UniqueId number NOT NULL,
UserName varchar2(256 byte) NOT NULL,
ApplicationName ... |
<gh_stars>1-10
CREATE TABLE [appointment].[AppointmentCarWashService] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[AppointmentId] INT NOT NULL,
[CarWashServiceId] INT NULL,
CONSTRAINT [PK_AppointmentCarWashService_Id] PRIMARY KEY CLUSTERED ([Id] ASC),
CONSTRAINT [FK_Appointment... |
REPLACE INTO `^cs_widgets` (`id`, `name`, `position`, `widget_order`, `param`) VALUES
(109, 'CS Tags', 'Right', 1, 'a:2:{s:9:"locations";a:26:{s:10:"show_title";b:1;s:2:"qa";b:0;s:4:"home";b:0;s:3:"ask";b:1;s:8:"question";b:1;s:9:"questions";b:1;s:8:"activity";b:1;s:10:"unanswered";b:1;s:3:"hot";b:1;s:4:"tags";b:1;s:3:... |
SELECT
[Name0] as ComputerName,
v_GS_SoftwareFile.ResourceID,
[FileID],
[FileName],
[FileDescription],
[FileVersion],
[FilePath],
[FileModifiedDate],
[FileSize],
[FileCount],
[ModifiedDate],
[CreationDate],
[ProductId]
FROM
v_GS_SoftwareFile INNER JOIN
v_R_System on v_GS_SoftwareFile.R... |
<gh_stars>1-10
-- youth at risk query
SELECT puma, SUM(PWGTP)
FROM pums_2017 p
WHERE (puma BETWEEN '11601' AND '11616')
AND (agep BETWEEN 16 AND 24)
-- AND (ESR = '4' OR ESR = '6')
AND ((WKL = '2' OR WKL = '3') OR (WKW >= '4'))
AND (SCH = '1')
GROUP BY puma
-- -- South King query
-- SELECT SUM(PWGTP)
-- FROM pums_... |
<filename>schema.sql
CREATE DATABASE IF NOT EXISTS `dmarc_reports`;
USE `dmarc_reports`;
CREATE USER IF NOT EXISTS 'dmarc'@'localhost' IDENTIFIED BY 'password';
GRANT INSERT ON dmarc_reports.* TO 'dmarc'@'localhost';
CREATE TABLE IF NOT EXISTS `report_metadata` (
`uid` varchar(36) NOT NULL,
`organization` varchar... |
<filename>edo/impl/src/main/config/sql/insert-reconsider-checklist.sql
INSERT INTO "EDO_CHECKLIST_SECTION_T"("CHECKLIST_SECTION_ID", "CHECKLIST_ID", "DESCRIPTION", "CREATE_DATE", "CREATED_BY", "LAST_UPDATE_DATE", "UPDATED_BY", "CHECKLIST_SECTION_NAME", "CHECKLIST_SECTION_ORDINAL")
VALUES(21, 1, 'Reconsideration items... |
<gh_stars>0
/*
If you use over() without partitions, then the RANGE argument works across the
whole dataset.
*/
/* Over() Row ranges */
SELECT
*,
AVG(salary) over() AS avg_sal
FROM
EmployeeSalary
SELECT
*,
AVG(salary) over(
ORDER BY
Salary
) AS avg_sal
FROM
Employee... |
CREATE TABLE weighings (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
product_batch_id INT UNSIGNED,
material_id INT UNSIGNED NOT NULL,
weight_id INT UNSIGNED NOT NULL,
amount DOUBLE CHECK (amount > 0),
weighed_by INT UNSIGNED,
weighed_at TIMESTAMP,
FOREIGN KEY (weighed_by) REFERENCES users(id),
FOREIGN ... |
insert into code_category_values_raw (code_category_id, concept_id)
SELECT distinct 49, c.id
FROM concept c
WHERE c.id in (
'SN_363812007',
'EMLOC_^ESCTMA829180',
'R3_2E22.',
'EMLOC_EMISNQBM1',
'EMLOC_^ESCTRE730096',
'EMLOC_^ESCTPO525640',
'EMLOC_^ESCTMA829181',
'R3_Ua17A',
'R2_2E25.',
'SN_170061009',... |
<filename>dionysus-webapp/src/main/resources/psychtest.sql
insert into psychtestsuites(id, title, description) values (1, '人格类', '人格类');
insert into psychtestsuites(id, title, description) values (2, '心理健康评定类', '心理健康评定类');
insert into psychtestsuites(id, title, description) values (3, '认知发展类', '认知发展类');
insert into psy... |
<reponame>nhsconnect/careconnect-reference-implementation
update observation set resource = null;
update patient set resource = null;
|
<filename>openGaussBase/testcase/KEYWORDS/pctfree/Opengauss_Function_Keyword_Pctfree_Case0024.sql
-- @testpoint: opengauss关键字pctfree(非保留),作为存储过程名,部分测试点合理报错
--关键字不带引号-成功
drop procedure if exists pctfree;
create procedure pctfree(
section number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
s... |
CREATE TABLE `Computer` (
`id` int PRIMARY KEY,
`sku` varchar(255) DEFAULT "-",
`name` varchar(255) DEFAULT "-",
`type` varchar(255) DEFAULT "-" COMMENT 'Laptop | Desktop | Notebook',
`brand` varchar(255) DEFAULT "-",
`model` varchar(255) DEFAULT "-",
`os` varchar(255) DEFAULT "-",
`warranty` boolean DE... |
INSERT INTO employee (first_name,last_name,role_id,manager_id)
VALUES ("Alex","Honnold",1,2);
INSERT INTO employee (first_name,last_name,role_id,manager_id)
VALUES ("Chris", "Sharma",2 ,3);
INSERT INTO employee (first_name,last_name,role_id,manager_id)
VALUES ("Alex", "Puccio",3 ,2);
INSERT INTO employee (first_name,la... |
<reponame>arianvaldivieso/pos<filename>application/migrations/init/database_12.3-12.4.sql
ALTER TABLE `phppos_receivings` ADD `deleted` INT( 1 ) NOT NULL DEFAULT '0', ADD INDEX ( `deleted` ); |
CREATE TABLE IF NOT EXISTS `YShip`.`TB_MEMBER` (
`PK_MEMBER_KEY` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`MEMBER_E_MAIL` VARCHAR(255) NOT NULL,
`MEMBER_ID` VARCHAR(45) NULL,
`MEMBER_PW` VARCHAR(45) NOT NULL,
`MEMBER_FIRST_NAME` VARCHAR(20) NOT NULL,
`MEMBER_LAST_NAME` VARCHAR(20) NOT NULL,
`MEMBER_FI... |
CREATE DATABASE empresaxyz;
use empresaxyz;
CREATE TABLE usuarios
(
)
CREATE TABLE personas
(
id_persona INT IDENTITY PRIMARY KEY ,
nombre VARCHAR (50) ,
apellido VARCHAR (50) ,
ci VARCHAR (25) NOT NULL ,
telefono VARCHAR (20),
usuario VARCHAR (25) ,
contrasena VARCHAR(25) ,
login INT
);
DROP TABLE personas
CR... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Oct 23, 2017 at 10:12 AM
-- Server version: 5.5.42
-- PHP Version: 5.6.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
<reponame>Aboidrees/CS50<gh_stars>0
select avg(ratings.rating) from movies join ratings on movies.id=ratings.movie_id where year=2012; |
<reponame>ibent95/svc-dynamic-form-symfony
-- MariaDB dump 10.17 Distrib 10.4.14-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: dynamic_form_app
-- ------------------------------------------------------
-- Server version 10.5.15-MariaDB-1:10.5.15+maria~focal
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... |
<filename>PostgreSQL Task 1/FillFactor/PgBenchUpdate.sql
UPDATE fillfactor50
SET string = string || string;
UPDATE fillfactor75
SET string = string || string;
UPDATE fillfactor90
SET string = string || string;
UPDATE fillfactor100
SET string = string || string;
TRUNCATE fillfactor50, fillfactor75, fillfactor90, fi... |
INSERT INTO advisements (id, professor_id, enrollment_id, main_advisor, created_at, updated_at) VALUES (1, 1, 1, t, '2018-03-27 03:19:41.410216', '2018-03-27 03:19:41.410216'); |
/****** Object: User Defined Function dbo.FullAllianceSectorName Script Date: 5/1/2004 6:12:42 PM ******/
CREATE FUNCTION dbo.FullAllianceSectorName
(
@AllianceID int
)
RETURNS nvarchar(96)
BEGIN
DECLARE @Name nvarchar(96)
SET @Name = (SELECT ' (' + CAST(Galaxy AS nvarchar(2)) + ':' + CAST(Sector AS ... |
ALTER TABLE users
DROP COLUMN team_id; |
SELECT col1, col2, ... | *
FROM tblname JOIN tblname USING(col)
WHERE col = val OR ... AND ... IN ... BETWEEN ... LIKE
ORDER BY col | ORDER BY col DESC | ORDER BY col1 ASC, col2 DESC
LIMIT 4;
SELECT * FROM tbl; -- default db
SELECT * FROM db.tbl; -- specific db
SELECT * FROM "order"; -- conflicting table name ... |
SELECT
'role member' node_type,
rp.[name] + ' <span class="light"><i>(' +
lower(rp.type_desc COLLATE SQL_Latin1_General_CP1_CI_AS)
+ ')</i></span>' ui_name,
rp.principal_id id,
case when rp.[type] in ('S', 'U') then '0' else '1' end + rp.[name] sort1,
rp.[na... |
<filename>src/test/resources/sql/select/40b06cce.sql<gh_stars>10-100
-- file:jsonb.sql ln:55 expect:true
SELECT 'true false'::jsonb
|
CREATE TRIGGER test_trigger BEFORE UPDATE ON posts
FOR EACH ROW BEGIN END
DROP TRIGGER lbcat.test_trigger |
<reponame>garygunarman/firanew<filename>admin/custom/_payment/_veritrans/_antikode/admin/_sql/tbl_veritrans.sql
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 27, 2015 at 06:47 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUT... |
#storeToDatabase
INSERT INTO {schema}.ip_address VALUES (null,?,?,IF(?=4,INET_ATON(?),INET6_ATON(?)));
|
<filename>html/mediawiki/maintenance/sqlite/archives/patch-rd_interwiki.sql
-- Add interwiki and fragment columns to redirect table
ALTER TABLE /*$wgDBprefix*/redirect ADD COLUMN rd_interwiki TEXT default NULL;
ALTER TABLE /*$wgDBprefix*/redirect ADD COLUMN rd_fragment TEXT default NULL;
|
drop table s_web_page;
create table s_web_page as
(select WP_WEB_PAGE_ID WPAG_WEB_PAGE_ID
,d1.d_date WPAG_CREATE_DATE
,d2.d_date WPAG_ACCESS_DATE
,WP_AUTOGEN_FLAG WPAG_AUTOGEN_FLAG
,WP_URL WPAG_URL
,WP_TYPE WPAG_TYPE
,WP_CHAR_COUNT WPAG_CHAR_COUNT
,WP_LINK_COUNT WPAG_LI... |
<gh_stars>10-100
ALTER TABLE party ALTER COLUMN phone_no DROP not null; |
<filename>src/backend/oraschema/oracle_proc.sql<gh_stars>0
/*
* Oracle Functions
*
* Copyright (c) 1996-2013, PostgreSQL Global Development Group
* Copyright (c) 2014-2016, ADB Development Group
*
* src/backend/oraschema/oracle_proc.sql
*/
/*
* Function: bitand
* Parameter Type: : (numeric, numeric)
*/
CREAT... |
BEGIN;
--
INSERT INTO seguridad_rol_credenciales (rol_id, credencial_id) VALUES
(
(SELECT id FROM seguridad_rol WHERE nombre = 'ReferenteInstitucional'),
(SELECT id FROM seguridad_credencial WHERE nombre = 'reg_extension_aulica_modificar')
);
-------------------------------------
INSERT INTO deltas_sql (numero, ap... |
-- @testpoint:opengauss关键字Initial(非保留),作为用户名
--关键字explain作为用户名不带引号,创建成功
drop user if exists Initial;
CREATE USER Initial PASSWORD '<PASSWORD>';
drop user Initial;
--关键字explain作为用户名加双引号,创建成功
drop user if exists "Initial";
CREATE USER "Initial" PASSWORD '<PASSWORD>';
drop user "Initial";
--关键字explain作为用户名加单引号,合理报错
C... |
<gh_stars>0
CREATE FUNCTION [dbo].[ufn_sqlwatch_split_string]
(
@input_string nvarchar(max),
@delimiter nvarchar(max) = ','
)
RETURNS @output TABLE
(
[value] nvarchar(max)
)
as
begin
declare @string nvarchar(max)
declare @cnt Int
if(@input_string is not null)
begin
set @cnt ... |
<reponame>mmanipradeep/tutorials
-- CREATE MONEY TRANSFER TABLE
DROP TABLE IF EXISTS money_transfers;
CREATE TABLE IF NOT EXISTS money_transfers
(
id INT PRIMARY KEY AUTO_INCREMENT NOT NULL,
sender_account_id VARCHAR(250) NOT NULL,
receiver_account_id VARCHAR(250) NOT NULL,
amoun... |
<filename>sql/stored_procedures/sp_file_update.sql
DELIMITER //
DROP PROCEDURE IF EXISTS sp_file_update //
CREATE PROCEDURE sp_file_update (
IN file_id BIGINT ( 20 ) UNSIGNED,
IN file_name VARCHAR ( 260 ),
IN folder_id BIGINT ( 20 ) UNSIGNED,
IN file_privacy BIGINT ( 20 ) UNSIGNED,
IN user_id... |
-- PROJECT: Customers and Products Analysis Using SQL
-- Data analysis has proven to be very effective in sales.
-- This is because we can extract key performance indicators (KPIs) to make smarter decisions.
-- This saves time, resources, and money.
-- Below are the questions we want to answer for this project.
... |
CREATE PROC usp_AssignProject(@EmployeeId INT, @ProjectId INT)
AS
BEGIN
BEGIN TRAN
INSERT INTO EmployeesProjects
VALUES (@EmployeeId, @ProjectId)
IF(SELECT COUNT(ProjectId)
FROM EmployeesProjects
WHERE EmployeeId = @EmployeeId) > 3
BEGIN
RAISERROR ('The employee has too many projects!',... |
<reponame>mswdwk/code_test_records
START GROUP_REPLICATION;
-----------
SELECT * FROM performance_schema.replication_group_members;
SHOW DATABASES LIKE 'test_db_1';
SHOW BINLOG EVENTS;
|
/*
SQLyog Community Edition- MySQL GUI v8.05
MySQL - 5.7.24 : Database - my-appointments
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*... |
<gh_stars>1-10
CREATE TABLE [dbo].[EVENT_SINK_JUNC]
(
EventSinkId int NOT NULL,
SessionConfigId int NOT NULL
);
|
<reponame>tsawler/courses
ALTER TABLE course_sections ADD COLUMN prof_name VARCHAR(512) default '';
ALTER TABLE course_sections ADD COLUMN prof_email VARCHAR(512) default '';
ALTER TABLE course_sections ADD COLUMN teams_link VARCHAR(1024) default '';
update course_sections c set prof_name = (select prof_name from cour... |
<filename>grants.sql
-- grants required for mailgun_pkg v0.7
undef myschema
accept myschema prompt 'Enter the schema in which you will install mailgun:'
grant create table to &&myschema;
grant create job to &&myschema;
grant create procedure to &&myschema;
grant create type to &&myschema;
grant execute on sys.dbms_a... |
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/begin/3139ba22.sql
-- file:plpgsql.sql ln:281 expect:false
begin
if tg_op = ''INSERT'' then
dummy := tg_hub_adjustslots(new.name, 0, new.nslots)
|
/*
Warnings:
- The primary key for the `Feed` table will be changed. If it partially fails, the table could be left without primary key constraint.
- The `id` column on the `Feed` table would be dropped and recreated. This will lead to data loss if there is data in the column.
- The primary key for the `FeedIt... |
SELECT
weekday,
yellow_pickups,
yellow_distance as yellow_total_miles,
AVG(humidity) as humidity_avg
FROM (
SELECT
g_col.*,
y_col.yellow_distance,
y_col.yellow_pickups
FROM (
SELECT
weekday,
sum(cast(trip_distance as BIGINT)) AS green_dista... |
alter table profile drop column picture_path; |
<filename>webserver/app-moe/sql/Archive/3.10.4/POCOR-4061/commit.sql
-- system_patches
INSERT INTO `system_patches` (`issue`, `created`) VALUES('POCOR-4061', NOW());
-- system_errors
ALTER TABLE `system_errors`
CHANGE COLUMN `code` `code` VARCHAR(10) NOT NULL ;
|
library ChlamydiaECR version '1.0'
using FHIR version '3.0.0'
include FHIRHelpers version '3.0.0' called FHIRHelpers
codesystem "SNOMED": 'http://snomed.info/sct'
codesystem "ICD9PROC": 'http://hl7.org/fhir/sid/icd-9-proc'
codesystem "LOINC": 'http://loinc.org'
codesystem "CPT": 'http://www.ama-assn.org/go/cpt'
codesys... |
-- Verify ggircs:swrs/public/table/organisation_bc_registry_id on pg
begin;
select pg_catalog.has_table_privilege('swrs.organisation_bc_registry_id', 'select');
rollback;
|
<gh_stars>1-10
-- --------------------------------------------------------
--
-- Tabelstructuur voor tabel `notes_note`
--
CREATE TABLE `notes_note` (
`id` int(11) NOT NULL,
`noteBookId` int(11) NOT NULL,
`createdBy` int(11) NOT NULL,
`modifiedBy` int(11) NOT NULL,
`name` varchar(100) NOT NULL,
`content` ... |
CREATE TABLE kratos_sequenceid(
k_id INT NOT NULL AUTO_INCREMENT COMMENT '主键',
k_type INT NOT NULL COMMENT '类型',
k_useData BIGINT NOT NULL COMMENT '申请占位数量',
PRIMARY KEY (k_id)
)ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_bin; |
<reponame>debrief/pepys-import
CREATE TABLE alembic_version
(
version_num VARCHAR(32) NOT NULL,
CONSTRAINT alembic_version_pkc PRIMARY KEY (version_num)
);
-- Running upgrade -> bcff0ccb4fbd
CREATE TABLE "Activations"
(
activation_id INTEGER NOT NULL,
name VARCHAR(150) NOT NULL,
sen... |
<gh_stars>10-100
alter default privileges in schema public grant select on tables to ${api-user};
grant select on all tables in schema public to ${api-user};
|
/* src/test/modules/test_async_ddl_lock_replay/test_async_ddl_lock_replay--1.0.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION test_async_ddl_lock_replay" to load this file. \quit
CREATE FUNCTION test_async_ddl_lock_replay()
RETURNS pg_catalog.void STRICT
... |
<reponame>TTGS/IT_script
case是SQL里的选择语句,对结果集的内容进行选择处理
注意:
1,先碰到的先显示
2,then后面的类型要统一
3,else 为null 是默认存在的。
4,case ... end 是整体编译的,所以有一点问题都会停止。
5,如果是用case 选择,那么运算方式计算会更灵活,应该可以使用更多运算符
6,when为真就会返回,所以请你把选择条件写闭合。
7,源和显示可以类型不同。
格式: 格式有两种,
1,源和条件只能是等值就返回真。
case 源
when 条件1 then 显示
[when 条件2 then 显示 ]
[else 显示 ]
end
2,运算条件只要... |
<reponame>opencit/dcg_security-mtwilson
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tbl_oem` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`NAME` varchar(100) DEFAULT NULL,
`DESCRIPTION` varchar(200) DEFAULT NULL,
PRIMARY KEY (`ID`),
UNI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.