sql stringlengths 6 1.05M |
|---|
ALTER TABLE `cache` CHANGE `cache_key` `cache_key` varchar(128) BINARY NOT NULL;
ALTER TABLE `cache_shared` CHANGE `cache_key` `cache_key` varchar(255) BINARY NOT NULL;
|
CREATE TABLE `alert_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL COMMENT '名称,如rule, recipient',
`format` int(4) COMMENT '报表格式,1/xml',
`version` int(4) COMMENT '报表配置版本号',
`content` longtext COMMENT '报表配置内容',
`creation_date` datetime NOT NULL COMMENT '创建时间',
`last_modif... |
library DiabetesEyeExam version '9.2.000'
using QDM version '5.5'
include MATGlobalCommonFunctions version '5.0.000' called Global
include Hospice version '2.2.000' called Hospice
include AdvancedIllnessandFrailtyExclusionECQM version '5.5.000' called FrailtyLTI
codesystem "LOINC": 'urn:oid:2.16.840.1.113883.6.1'
v... |
CREATE TABLE `user_virtual_address` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` int(10) NOT NULL DEFAULT '0' COMMENT '用户ID,1:手机,2:QQ,3:支付宝',
`type` VARCHAR (10) NOT NULL COMMENT '充值类型(支付宝:tb QQ:qb 话费:dh)',
`account` varchar(64) NOT NULL DEFAULT '' COMMENT '账号',
`name` varchar(64) NOT NULL DEFAU... |
create serial s1 cycle start with 1 maxvalue 100;
create serial s2 cache 100 increment by 10 start with -10 nominvalue;
create serial s3 nominvalue nocache nomaxvalue;
create serial s nominvalue nocache nomaxvalue minvalue 100;
create serial s cycle start with 1000 nomaxvalue nocycle nocache;
drop serial s1;
drop seri... |
<reponame>keroro520/ckb-analyzer
WITH peer_ip_version AS (
SELECT DISTINCT ON (network,
bucket,
ip)
time_bucket (INTERVAL '1 hour', time) AS bucket,
network,
ip,
version
FROM
peer
)
SELECT
p.bucket AS time,
p.version AS metric,
count(*) AS valu... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.0.10
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 25, 2016 at 12:20 AM
-- Server version: 5.5.52-0+deb8u1-log
-- PHP Version: 5.6.27-0+deb8u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... |
--
-- Dumping data for table `facility`
REPLACE INTO `facility` (`id`, `name`, `phone`, `fax`, `street`, `city`, `state`, `postal_code`, `country_code`, `federal_ein`, `website`, `email`, `service_location`, `billing_location`, `accepts_assignment`, `pos_code`, `x12_sender_id`, `attn`, `domain_identifier`, `facil... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 18, 2018 at 03:05 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>ViniciusAki/agenda<gh_stars>0
/**
* Projeto 1: Agenda de contatos
* @author Professor <NAME>
*/
-- Listar bancos disponíveis no servidor
show databases;
-- Criar um novo banco de dados
create database dbagenda;
-- Excluir um banco de dados
drop database teste;
-- Selecionar o banco de dados
use dbagenda;... |
CREATE TABLE "ConsignmentStatus"
(
"ConsignmentStatusId" uuid NOT NULL,
"ConsignmentId" uuid NOT NULL,
"StatusType" text NOT NULL,
"Value" text NOT NULL,
"CreatedDatetime" timestamp with time zone not null,
CONSTRAINT "ConsignmentStatus_pkey" PRIMARY KEY ("ConsignmentStatusId"),
CONSTRAINT "... |
<filename>src/db/sql/calification/add.sql
INSERT INTO
${ schema~ }.calification (
subject_id,
grade_id,
is_cummulative,
objective_id,
evaluation_number
)
VALUES
(
${subjectId},
${gradeId},
${isCummulative},
${objectiveId},
${ev... |
CREATE TABLE [dbo].[MOV_UserMovie] (
[ID] INT IDENTITY (1, 1) NOT NULL,
[UserID] INT NOT NULL,
[MovieID] INT NOT NULL,
[InsertDate] DATETIME NOT NULL,
[InsertUserID] INT NOT NULL,
[UpdateDate] DATETIME NOT NULL,
[UpdateUserID] INT NOT NULL,
... |
<reponame>etoronsaye/2019-06-c-sharp-labs
-- Exercise 1
-- 1.1
select CustomerID, CompanyName, Address + ', ' + City + ', ' + Country as Location from Customers where City in ('Paris','London')
-- 1.2
select * from Products where QuantityPerUnit LIKE '%bottle%'
-- 1.3
select p.ProductName, s.CompanyName, s.Country from... |
CREATE OR REPLACE PACKAGE pJogador IS
--
PROCEDURE inserir (pisNome jogador.nome%TYPE,
pidDataDeNascimento jogador.dt_nascimento%TYPE,
pinSalario jogador.salario%TYPE,
pinIdTime jogador.id_time%TYPE);
--
PROCEDURE ... |
<filename>Catbert3/Schema Objects/Schemas/dbo/Tables/UnitAssociations.table.sql
CREATE TABLE [dbo].[UnitAssociations] (
[UnitAssociationID] INT IDENTITY (1, 1) NOT NULL,
[UnitID] INT NOT NULL,
[UserID] INT NOT NULL,
[ApplicationID] INT NOT NULL,
[Inactive] BIT NOT... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 09, 2022 at 10:40 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.4.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
CREATE OR REPLACE FUNCTION ebeats() RETURNS text as $$
DECLARE
curtime timestamp := current_timestamp AT TIME ZONE 'UTC';
hours decimal;
minutes decimal;
seconds decimal;
bpday decimal := 1000;
bphour decimal := 24;
bpmin decimal := bphour * 60;
bpsec decimal := bpmin * 60;
BEGIN
SELECT EXTRACT(hour F... |
create extension plv8;
-- Roles
drop role if exists anonymous;
create role anonymous;
grant anonymous to current_user;
drop role if exists medium_user;
create role medium_user;
grant medium_user to current_user;
-- Auth
create function current_user_id() returns integer as $$
select nullif(current_setting('user.id'... |
-- 同一task_idが実行待ちになっているときに、同時に実行されないこと
INSERT INTO kr_task_stat(task_flow_id, task_exec_seq, depends_task_exec_seq, task_id, task_seq, exec_status, task_priority, parameters) VALUES ('test_flow_5_1', 1, -1, 'test_5', 1, 0, 0, '{}');
INSERT INTO kr_task_stat(task_flow_id, task_exec_seq, depends_task_exec_seq, task_id, t... |
use telemetry
DROP EXTERNAL STREAM DeviceDataTable
DROP EXTERNAL STREAM dashboardsOPCUAInputStream
DROP DATABASE SCOPED CREDENTIAL dashboardsSQLCredential
DROP EXTERNAL DATA SOURCE telemetryDbServer
DROP EXTERNAL DATA SOURCE dashboardsInput
DROP External file format dashboardsInputFileFormat
DROP MASTER KEY
EXEC sys.... |
<gh_stars>10-100
SELECT * FROM finalprojects.nba;
SELECT * FROM nba where screen_name like '%Motiversity_%';
select * from influenceofyoupost;
Select Avg(influenceoftweets) from influenceofyoupost;
create table influenceofyoupost (select screen_name, (0.3*favos +0.1*reweet+0.6*userfollower) As influenceoftweets fro... |
<reponame>tyrex-team/gmark
WITH RECURSIVE c0(src, trg) AS ((SELECT edge.src, edge.src FROM edge UNION SELECT edge.trg, edge.trg FROM edge UNION SELECT s0.src, s3.trg FROM edge s0, (SELECT trg as src, src as trg, label FROM edge) as s1, edge s2, (SELECT trg as src, src as trg, label FROM edge) as s3 WHERE s0.trg = s1.sr... |
<filename>Weather Observation Station 1.sql
/*
Enter your query here.
*/
SELECT CITY,
STATE
FROM STATION; |
/* Replace with your SQL commands */
SET search_path TO logs, public;
DROP TRIGGER mdt_calendars ON scheduler.calendars;
DROP TRIGGER mdt_subscriptions ON scheduler.subscriptions;
DROP TRIGGER mdt_working_hours ON scheduler.working_hours;
DROP TRIGGER mdt_events ON scheduler.events;
DROP TRIGGER mdt_attendees ON sche... |
<filename>src/test/resources/pagerfault.test_88.sql
-- pagerfault.test
--
-- execsql { INSERT INTO t2 VALUES(2) }
INSERT INTO t2 VALUES(2) |
DROP FUNCTION IF EXISTS report.fresh_pricelist_details_template_report(NUMERIC, NUMERIC, CHARACTER VARYING, NUMERIC);
CREATE OR REPLACE FUNCTION report.fresh_pricelist_details_template_report(IN p_c_bpartner_id NUMERIC, IN p_m_pricelist_version_id NUMERIC, IN p_ad_language CHARACTER VARYING,
... |
<filename>sql/n_coar.sql
/*
Script to normalize part of the coar database into the coar_n database.
*/
USE coar_n;
/*
=========================================
Some trick
=========================================
*/
SET foreign_key_checks = 0;
DROP TABLE if exists `tspatials`;
DROP TABLE if exists `tfiles`;
DROP TAB... |
CREATE EXTENSION "postgres-json-schema";
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "plpython3u";
CREATE SCHEMA reclada;
\i recladaobj_scheme.sql
\i schema_dev.sql
|
CREATE TABLE [dbo].[Status]
(
[STATUS_ID] [smallint] NOT NULL IDENTITY(1, 1),
[StatusCode] [varchar] (20) COLLATE Latin1_General_CI_AS NOT NULL,
[StatusName] [varchar] (50) COLLATE Latin1_General_CI_AS NULL,
[ShowByDefault] [bit] NOT NULL CONSTRAINT [DF_Status_ShowByDefault] DEFAULT ((1)),
[CanRank] [bit] NOT NULL CONS... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: May 07, 2020 at 12:57 PM
-- Server version: 10.4.12-MariaDB
-- PHP Version: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `linkis_configuration_config_key`;
CREATE TABLE `linkis_configuration_config_key`(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`key` varchar(50) DEFAULT NULL COMMENT 'Set key, e.g. spark.executor.instances',
`description` varchar(200) DEFAULT NULL,
`name` varchar(50)... |
{% macro test_equal_rowcount(model) %}
{% set compare_model = kwargs.get('compare_model', kwargs.get('arg')) %}
{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}
{%- if not execute -%}
{{ return('') }}
{% endif %}
with a as (
select count(*) as count... |
<gh_stars>1000+
ALTER TABLE "selfservice_login_request_methods" RENAME TO "selfservice_login_flow_methods";
ALTER TABLE "selfservice_login_requests" RENAME TO "selfservice_login_flows";
ALTER TABLE "selfservice_registration_request_methods" RENAME TO "selfservice_registration_flow_methods";
ALTER TABLE "selfservice_reg... |
<reponame>igstan/sql-utils<filename>pivot.sql
DELIMITER $$
DROP PROCEDURE IF EXISTS `PIVOT_REPORT` $$
CREATE PROCEDURE `PIVOT_REPORT`()
BEGIN
DECLARE col_number INT(2) DEFAULT 0;
DECLARE counter INT(2) DEFAULT 0;
DECLARE done INT(1) DEFAULT 0;
DECLARE last_pro... |
select interiors.id,characters.charactername,items.`index`,items.itemID from interiors
join items on interiors.id=items.owner
left join characters on interiors.owner=characters.id
where (items.itemID=61 or items.ItemID=85)
and characters.faction_id != 1
and characters.faction_id != 2
and characters.faction... |
UPDATE employees SET sales_count = sales_count + 1 WHERE id =
(SELECT sales_person FROM accounts WHERE name = '<NAME>');
|
<reponame>pytexas/pycon
CREATE TABLE "thumbnail_kvstore" (
"key" varchar(200) NOT NULL PRIMARY KEY,
"value" text NOT NULL
); |
<reponame>eugene-mindset/Poli-Interactive
-- <NAME>, aadon1 | <NAME>, easare3
-- Stored Procedure to get bills with most yes or no votes in senate
DELIMITER //
DROP PROCEDURE IF EXISTS TopBillsInSenate //
CREATE PROCEDURE TopBillsInSenate(IN topCount INT, IN votePosition VARCHAR(3))
BEGIN
SELECT bill_num, cong... |
--
-- Create Table
-- gzrerap.sql
--
-- AUDIT TRAIL: 8.9.3
-- 1. Create new table GZRERAP. ENB 11/15/2017
-- Created to store application names for which error logging is enabled.
-- This will allow for applications in GZRERRL not in this table to be an
-- implicit list of "unhandled" exception applications.
... |
\set ECHO none
SET search_path TO public, provsql;
CREATE TABLE vc_result AS
SELECT city, view_circuit(provenance(),'d') AS ok
FROM (
SELECT DISTINCT city
FROM personnel
EXCEPT
SELECT p1.city
FROM personnel p1,personnel p2
WHERE p1.id<p2.id AND p1.city=p2.city
GROUP BY p1.city
) t;
SELECT remove_provenan... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 24, 2021 at 08:14 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<filename>poc/install/pocCore/pocPocChown.sql
/*******************************************************************************
PoC Web-Application-Framwork
http://poc-online.net/
Copyright (c) 2013, PoC - <NAME>
Released under the MIT license
http://poc-online.net/license
-- pocPackage: pocCore
********************... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 30 Nov 2019 pada 16.34
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 25, 2016 at 12:00 PM
-- Server version: 5.6.24
-- PHP Version: 5.5.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
<reponame>thecrazzycourses/sql
DROP DATABASE customer_order;
CREATE DATABASE customer_order;
USE customer_order;
CREATE TABLE customers(
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(100),
last_name VARCHAR(100),
... |
<filename>db_backup/acl.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Apr 20, 2021 at 05:54 AM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... |
<reponame>devatsrs/neon.web
USE `StagingReport`;
ALTER TABLE `tblUsageSummaryDay`
ADD COLUMN `userfield` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `tblUsageSummaryDayLive`
ADD COLUMN `userfield` VARCHAR(255) NULL DEFAULT NULL;
ALTER TABLE `tblUsageSummaryHour`
ADD COLUMN `userfield` VARCHAR(255) NULL DEFAULT ... |
SELECT
id,
name,
description,
objective_id AS "objectiveId",
status
FROM ${ schema~ }.indicator
WHERE objective_id = ${objectiveId}
ORDER BY objective_id |
<reponame>lidelin/phalapi-demo
-- phpMyAdmin SQL Dump
-- version 4.4.15.7
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2017-04-05 11:04:17
-- 服务器版本: 5.6.31-log
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
<reponame>smnorris/fwakit
-- Return the elevation of a stream at a point
-- Point is defined by blue_line_key and downstream_route_measure
CREATE OR REPLACE FUNCTION fwa_elevation(
blkey integer,
measure double precision
)
RETURNS numeric AS $$
-- Extract the stream segment with the matching blue_line_key an... |
SELECT
Nickname,
Gender,
Age
FROM Users WHERE Age BETWEEN 22 AND 37 |
------------------
GEN_OBJ_FLD_1
------------------ |
-- Table: user
INSERT INTO user (username, password)
VALUES
('test', 'pbkdf2:sha256:50000$TCI4GzcX$0de171a4f4dac32e3364c7ddc7c14f3e2fa61f2d17574483f7ffbb431b4acb2f'),
('other', 'pbkdf2:sha256:50000$kJPKsz6N$d2d4784f1b030a9761f5ccaeeaca413f27f2ecb76d6168407af962ddce849f79');
-- Table: process
INSERT INTO process (na... |
ALTER TABLE egcl_collectionheader ADD COLUMN SOURCE character varying(20); |
SELECT CHECKSUM('hello') -- 533340124
, CHECKSUM('Hello') -- 533340124
, CHECKSUM('olleh') -- 1600790340
, CHECKSUM('hloel') -- 1606885152 |
<reponame>Ashiqur906/cinebaz-backend-laravel-main
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3307
-- Generation Time: Mar 29, 2021 at 02:16 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRA... |
<gh_stars>100-1000
/* Multiple indexes that have the same set of columns, same opclass, expression and predicate. */
SELECT pg_size_pretty(sum(pg_relation_size(idx))::bigint) as size,
(array_agg(idx))[1] as idx1, (array_agg(idx))[2] as idx2,
(array_agg(idx))[3] as idx3, (array_agg(idx))[4] as idx4
FROM (... |
call table_rotate('test_cs', 'test_table_rotate', 3);
call table_rotate('test_cs', 'test_table_rotate', 3);
call table_rotate('test_cs', 'test_table_rotate', 3);
SELECT
table_exists('test_cs', 'test_table_rotate__3')
and
not table_exists('test_cs', 'test_table_rotate__4')
;
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4499
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: localhost (MySQL 5.5.42)
# Database: tpadmin
# Generation Time: 2015-12-03 03:23:47 +0000
# **********************************************... |
--sqlplus -S setars/xxxx1@sed @query.sql && vi $c/temp/query.out
set termout off;
set linesize 2000;
set pagesize 9999;
spool u:/serevent.out;
-------------------------
select *
from
-------------------------
spool off;
quit;
|
<filename>sql_metadb/migration_tables/course_departments.sql
DROP TABLE IF EXISTS course_departments;
CREATE TABLE course_departments AS
SELECT
id::varchar(36),
jsonb_extract_path_text(jsonb, 'description')::varchar(65535) AS description,
jsonb_extract_path_text(jsonb, 'name')::varchar(65535) AS name,
... |
<reponame>FlashSheridan/daml<gh_stars>100-1000
-- Copyright (c) 2019 The DAML Authors. All rights reserved.
-- SPDX-License-Identifier: Apache-2.0
---------------------------------------------------------------------------------------------------
-- V7: Command deduplication
--
-- This schema version changes the uniqu... |
CREATE TABLE __INSERT_SCHEMA__.report_processing_codes (
code INT ,
abbreviation VARCHAR,
description VARCHAR,
PRIMARY KEY(code)
);
|
create or replace PROCEDURE TW_PC_VACACIONES
/******************************************************************************
CREATE BY <NAME>
Automatically available Auto Replace Keywords:
Object Name: TW_PC_VACACIONES
Sysdate: 25/04/2017
Procedimiento que muestra el Historial de las vac... |
CREATE TABLE PARTICIPANT_ANSWER
(
participant_id bigint NOT NULL,
question_id bigint NOT NULL,
answer_id bigint NOT NULL,
date_time timestamp with time zone NOT NULL,
PRIMARY KEY (participant_id, question_id, answer_id),
CONSTRA... |
<gh_stars>0
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.2
-- Dumped by pg_dump version 11.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;
SELECT pg_catalog.set_confi... |
<filename>openGaussBase/testcase/KEYWORDS/Exec/Opengauss_Function_Keyword_Exec_Case0021.sql
-- @testpoint: opengauss关键字exec(非保留),作为函数名,部分测试点合理报错
--关键字不带引号-成功
drop function if exists exec;
create function exec(i integer)
returns integer
as $$
begin
return i+1;
end;
$$ language plpgsql;
/
drop function if exists exe... |
<filename>common/src/main/resources/db/migration/V100__2020-04-15_add_submissiondeadline.sql
alter table submission add column explicitSubmissionDeadline timestamp(6);
|
<gh_stars>0
CREATE TABLE [dbo].[Users] (
[UserID] VARCHAR (100) NULL,
[CompanyID] INT NULL,
[Name] VARCHAR (250) NULL,
[Title] VARCHAR (250) NULL,
[Email] VARCHAR (250) NULL,
[Branches] VARCHAR (250) NULL,
[AccessFeatures] VARCH... |
/*markdown
## Transaction
*/
/*markdown
### Transaction that update some rows
*/
BEGIN TRANSACTION;
UPDATE shouhin_update
SET sale_price = sale_price - 1000
WHERE item_name = 'White shirt';
UPDATE shouhin_update
SET sale_price = sale_price + 1000
WHERE item_name = 'T-shirt';
COMMIT; |
<filename>SQL/SQL-Server/Triggers/classification-logon.sql
-- Trigger classification logon
-- These triggers are only fired during the user logon phase. Therefore after the user has logged on but prior to the session instance being setup
-- 1. Track database logins to enhance security
-- Save user details in the audit... |
SET DEFINE OFF;
ALTER TABLE AFW_12_ACTIO_AUDIT ADD (
CONSTRAINT AFW_12_ACTIO_AUDIT_FK2
FOREIGN KEY (REF_MESG)
REFERENCES AFW_01_MESG (SEQNC)
ENABLE VALIDATE)
/
|
/*
* a) Write a PL/SQL block to accept two Strings and check whether they are Equal or Not.
*/
SET SERVEROUTPUT ON;
SET VERIFY OFF;
DECLARE
str1 varchar2(20) := '&str1'; -- Declaring the Variable to store the 1st String and Taking the input also
str2 varchar2(20) := '&str2'; -- Declaring the Varia... |
<reponame>functorz-tech/zero-lib<filename>src/main/resources/sql/init.sql
create or replace function public.create_delete_trigger_if_not_exists(t_name text, tr_name text)
returns void as
$$
BEGIN
IF NOT EXISTS(SELECT * FROM information_schema.triggers
WHERE event_object_table = t_name AND trig... |
<reponame>UWIT-IAM/uw-redcap-client<filename>schema/verify/roles/enrollment-processor.sql
-- Verify seattleflu/schema:roles/enrollment-processor on pg
begin;
rollback;
|
<filename>Records/MISSING_DEFAULT_RECORDS_FOR_RECORD_FIELDS_IN_PROJECT.sql
/* MISSING DEFAULT RECORDS FOR RECORD FIELDS IN PROJECT */
SELECT B.RECNAME, B.DEFRECNAME
FROM PSPROJECTITEM A, PSRECFIELD B, PSRECDEFN E
WHERE A.OBJECTTYPE = 0
AND A.OBJECTVALUE1 = B.RECNAME
AND A.PROJECTNAME = 'CY2_AD_APPL_00... |
<gh_stars>1-10
-- PROJECT
-- select * from ifx_projects. project where projet_is_public = 1;
SELECT
'INSERT INTO project ( projet_id, projet_name, projet_projet_parent_id, projet_create_date, projet_actor_created_by, projet_actor_modified_by, projet_modified_date, projet_level, projet_is_public, projet_view_gro... |
SELECT
send_mail_queue_id
,from_address
,to_address
,cc_address
,bcc_address
,subject
,body
,sent_at
,created_by
,created_at
,updated_by
,updated_at
,deleted_by
,deleted_at
,version
FROM
send_mail_queue
WHERE
deleted_at IS NULL
AND sent_at IS NULL
ORDE... |
-- -----------------------------------------
-- init oracle hmily_transaction tables----
-- -----------------------------------------
DECLARE
NUM NUMBER;
BEGIN
-- -----------------------------------------
-- create table hmily_lock if not exist ----
-- -----------------------------------------
SEL... |
<reponame>alexavila150/luciddb<gh_stars>10-100
-- $Id$
-- Test script for application variables UDF/UDP
set schema 'udftest';
set path 'udftest';
-- use xmlattr format so we can distinguish nulls from blanks
!set outputformat xmlattr
-- for this test, enable code cache to make sure that changes
-- in variables do not... |
<reponame>bcgov/smtp-om-core
/*drop table OM.OM_GENERIC_TABLE_DETAILS cascade constraints;
drop index OM.GTDE_SEOF_RK_FK_IX;
drop index OM.GTDE_ORDE_RK_FK_IX;
drop index OM.GTDE_GTDE_FK_IX;
*/
--**************************************************************************************
--* SQL script to create OM.OM_GENERIC... |
select
index_name,
(
select listagg(column_name, ',') within group (order by column_position)
from {{ dba_ind_columns }} c where c.index_owner = i.owner and c.index_name = i.index_name
) columns,
uniqueness,
tablespace_name,
logging,
blevel,
leaf_blocks,
distinct_keys,
num_rows,
sample_size,
last_analyzed,
(
select... |
<filename>db/migrations/20191009173405_add_slugs/up.sql
CREATE TABLE slugs
(
id UUID PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
slug VARCHAR(255) NOT NULL,
main_table TEXT NOT NULL,
main_table_id uuid NOT NULL,
slug_type TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT now(),
update... |
grant all on schema public to v1_user;
grant all on all tables in schema public to v1_user;
grant all on all sequences in schema public to v1_user;
grant all on schema v2 to v2_user;
grant all on all tables in schema v2 to v2_user;
grant all on all sequences in schema v2 to v2_user;
grant all on schema public to col_o... |
INSERT INTO waffle_switch (name, active, note, created, modified)
VALUES ('fxa-auth', 0, 'Waffle switch for Firefox Accounts', NOW(), NOW());
|
<filename>openGaussBase/testcase/PROCEDURE/PROC_TRIGGER_CLOB/Opengauss_Function_Procedure_Trigger_Clob_Case0006.sql
-- @testpoint: 验证存储过程是否支持clob类型删除
--创建测试表
drop table if exists temp;
create table temp
(
name varchar2(200),
age number,
temp_clob clob
);
--创建存储过程
create or replace procedure proc_clob_... |
-- Creates a new participant
INSERT INTO Participant(firstname, lastname, affiliationid, gender, birthdate, active) VALUES
(
'Eliza',
'Checketts',
2,
'm',
'1997-12-01',
1
) |
-- Beispieldatensätze einfügen
-- tables have to be dropped bevore cleaning up
-- auto increment is messing up internal indexes
-- ===============================================================
-- alle Tabellen leeren
PROMPT " "
PROMPT "=> clearing all tables"
PROMPT "=========================================="
DELET... |
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 05, 2016 at 11:06 AM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
<filename>ig-ansible/rds_scripts/create_users_tbl.sql<gh_stars>0
create table users (username varchar(100) primary key, password varchar(100), full_name varchar(200), is_admin boolean);
insert into users values ('fred','foo','<NAME>', true);
insert into users values ('dalb','al','Dylan', true);
insert into users values... |
<gh_stars>1-10
--third time is a charm?
-- use the burger db!!!!!! duh. haha
-- insert into burgers, then input values
USE burger_db;
INSERT INTO burgers (name, devoured, createdAt, updatedAt)
VALUES ("bae burger", false, NOW (),NOW());
INSERT INTO burgers (name, devoured, createdAt, updatedAt)
VALUES ("juicy lucy"... |
CREATE FUNCTION udf_AverageSalaryByDepartment()
RETURNS TABLE
AS
RETURN
(
SELECT d.[Name] AS Department,
AVG(e.Salary) AS AverageSalary
FROM Departments AS d
JOIN Employees AS e ON d.DepartmentID = e.DepartmentID
GROUP BY d.DepartmentID,
d.[Name]
) |
<filename>oracle-scripts/Peru.sql<gh_stars>1-10
INSERT INTO WWS_COUNTRIES (ID, NAME, ISO3, ISO2, PHONECODE, CAPITAL, CURRENCY, CREATED_AT, UPDATED_AT, FLAG, WIKIDATAID) VALUES (173, 'Peru', 'PER', 'PE', '51', 'Lima', 'PEN', TO_TIMESTAMP('2018-07-20 16:41:03','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2019-08-02 21:38:23',... |
-- migrate:up
CREATE ROLE postgraphile;
-- migrate:down
DROP ROLE postgraphile; |
<filename>src/main/resources/mysql.sql
-- --------------------------------------------------------
-- 主机: 127.0.0.1
-- 服务器版本: 10.1.13-MariaDB - mariadb.org binary distribution
-- 服务器操作系统: Win32
-- HeidiSQL 版本: 9.3.0.4984
-- ---------... |
-- noinspection SqlNoDataSourceInspectionForFile
/* ETL
Prerequisites:
- Transactions and blocks table have been populated with
data using Ethereum ETL
- Star schema has been set up using star_schema.sql
*/
/* EXTRACTION */
/* Extraction Table Transactions */
BEGIN;
CREATE TABLE IF NOT ... |
update AD_SysConfig set Value='N', updated=now(), updatedby=0 where Name='org.adempiere.acct.Enabled';
update C_AcctProcessor set IsActive='N' where AD_Client_ID>=1000000;
|
CREATE TABLE `yy_jdxx` (
`Name` varchar(256),
`CardNo` varchar(256),
`Descriot` varchar(256),
`CtfTp` varchar(256),
`CtfId` varchar(256),
`Gender` varchar(256),
`Birthday` varchar(256),
`Address` varchar(256),
`Zip` varchar(256),
`Dirty` varchar(256),
`District1` varchar(256),
`District2` varcha... |
<reponame>TeachersPayTeachers/RecommendationsAI
with
pv as (
select *
from `tpt_raw.web_traffic_hit_level`
where hit_type = 'PAGE'
and user_id is not null
and item_id is not null
and page_path_level1 = 'Product'
and session_date >= date_sub(current_date('America/New_York'), interval 13 month)
{%- if dt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.