sql stringlengths 6 1.05M |
|---|
CREATE TABLE [Stage].[Programs] (
[Id] [bigint] NOT NULL,
[GID] [uniqueidentifier] NOT NULL,
[ProductGID] [uniqueidentifier] NOT NULL,
[ProgramTypeGID] [uniqueidentifier] NOT NULL,
[CostValue] [decimal](18, 2) NOT NULL,
[InsuranceRate] [decimal](18, 10) NULL,
[Deleted] [bit] NOT NULL,
[CalculatedPaymen... |
<filename>Query/8-Stored Procedures/8.10 Functions.sql
-- 9.10 Functions
USE `sql_invoicing`;
DROP function IF EXISTS `get_risk_factor_for_clent`;
DELIMITER $$
USE `sql_invoicing`$$
CREATE FUNCTION get_risk_factor_for_clent ( client_id int)
RETURNS INTEGER
-- attributes
reads sql data
BEGIN
declare risk_factor decima... |
--Create the Select Proc
CREATE PROCEDURE [dbo].[app_CustomRegistrationFields_GetByID] @TenID INT
AS
SELECT *
FROM [CustomRegistrationFields]
WHERE TenID = @TenID
|
<reponame>ellmkay/apgdiff
DROP EXTENSION plpgsql CASCADE; |
<gh_stars>1-10
CREATE PROCEDURE `get_variations_for_type_id` (IN typeID INTEGER)
DETERMINISTIC
BEGIN
SELECT invTypes.typeID, invTypes.typeName
FROM invTypes
LEFT JOIN invMetaTypes ON invTypes.typeID = invMetaTypes.typeID
WHERE invMetaTypes.parentTypeID = typeID
OR invTypes.typeID = typeID;
END |
<filename>delete-platform-trigger.sql
IF OBJECT_ID('delete_platform', 'TR') IS NOT NULL DROP TRIGGER delete_platform
GO
CREATE TRIGGER delete_platform
ON platform
FOR DELETE
AS
DELETE
FROM track
WHERE platform_id IN (SELECT d.id FROM deleted AS d)
|
<reponame>reshmi-nair/sunbird-utils<filename>sunbird-cassandra-migration/cassandra-migration/src/main/resources/db/migration/cassandra/V1.100_cassandra.cql
ALTER TABLE sunbird.user ADD (managedBy text, accessCode text);
CREATE INDEX inx_u_managedBy ON sunbird.user(managedBy); |
<reponame>bjeanes/que-scheduler<gh_stars>10-100
ALTER TABLE que_scheduler_audit ALTER COLUMN scheduler_job_id TYPE bigint;
ALTER TABLE que_scheduler_audit_enqueued ALTER COLUMN scheduler_job_id TYPE bigint;
ALTER TABLE que_scheduler_audit_enqueued ADD COLUMN job_id bigint;
ALTER TABLE que_scheduler_audit_enqueued ADD ... |
<filename>src/test/resources/sql/fetch/953b080f.sql
-- file:plpgsql.sql ln:2077 expect:false
fetch c1 into n
|
<filename>admin/admin/1/employee.sql
CREATE TABLE IF NOT EXISTS `employee` (
`employee_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key',
`employee_name` varchar(255) NOT NULL COMMENT 'name of the employee',
`employee_salary` double NOT NULL COMMENT 'salary of the employee',
`employee_position` varchar(... |
<gh_stars>0
if not exists (select * from syscolumns where name='IsDeptPrice' and id=OBJECT_ID(N'[dbo].[tbGoods]'))
begin
alter table dbo.tbGoods add IsDeptPrice bit not null default(0)
end |
<filename>sql/dml-example.sql
-- first attempt at inserting data into tables
/**
INSERT INTO seller(
sellerEmail,
sellerHash,
sellerSalt
)
VALUES (
'<EMAIL>',
'aabbccddeeffgghhiijjkkllmmnnoopp',
'kjfklsjdfkjsadflkj'
);
INSERT INTO seller(
sellerEmail,
sellerHash,
sellerSalt
)
VALUES (
'<EMAIL>',
'bbccddeeff... |
drop table FtrNodes;
create table FtrNodes (
name varchar(40),
pNodeId int primary key
);
bulk insert FtrNodes
from 'C:\Users\ypershin\Downloads\ftr-source-sink-prompt-Feb16.csv'
with (
firstrow=3,
fieldterminator = ',',
rowterminator = '\n',
errorfile = 'C:\Users\ypershin\Downloads\errorFtrNodes.csv',
tabl... |
<reponame>scott-confluent/kafka-tutorials
SELECT * FROM critical_issues emit changes limit 1;
|
<filename>python/sql/Stored Procedures/dbo.sp_Community_ChangeHistory_l.sql
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [dbo].[sp_Community_ChangeHistory_l]
@NewerThan smalldatetime = NULL
AS BEGIN
SET NOCOUNT ON
SELECT *
FROM Community_ChangeHistory
WHERE @NewerThan IS NULL OR @NewerThan <=... |
<reponame>WizardXiao/tidb<gh_stars>100-1000
/*!40101 SET NAMES binary*/;
CREATE DATABASE `quo``te/database` /*!40100 DEFAULT CHARACTER SET latin1 */ /*!80016 DEFAULT ENCRYPTION='N' */;
|
CREATE TABLE {{name}} (
id SERIAL PRIMARY KEY{{#each fields}},
{{name}} {{sql}}{{#if not_null}} NOT NULL{{/if}}{{/each}}
);
|
<filename>t/pg-test-files/expected/alter_operator.sql<gh_stars>1000+
CREATE FUNCTION alter_op_test_fn (boolean, boolean)
RETURNS boolean
AS $$
SELECT
NULL::boolean;
$$
LANGUAGE sql
IMMUTABLE;
CREATE FUNCTION customcontsel (internal, oid, internal, integer)
RETURNS float8
AS 'contsel'
L... |
<filename>fixtures/doctests/queries/075/input.sql
WITH RECURSIVE included_parts(sub_part, part) AS (
SELECT sub_part, part FROM parts WHERE part = 'our_product'
UNION ALL
SELECT p.sub_part, p.part
FROM included_parts pr, parts p
WHERE p.part = pr.sub_part
)
DELETE FROM parts
WHERE part IN (SELECT pa... |
<gh_stars>1-10
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : CaretClassifier_svmRadial
-- Dataset : BinaryClass_10
-- Database : monetdb
-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
-- Model deploymen... |
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
create table t1( a char(1200), b varchar(1200), c nchar(1200), d NCHAR VARYING(1200), e BIT(1200), f BIT VARYING(1200), g int, h SMALLINT, i BIGINT, j NUMERIC, k FLOAT, l DOUBLE, m MONETARY, n DATE, o TIME, p TIMESTAMP, q DATETIME);
i... |
CREATE TABLE `tblVendorRateArchive` (
`VendorRateArchiveID` int(11) NOT NULL AUTO_INCREMENT,
`VendorRateID` int(11) NOT NULL,
`AccountId` int(11) NOT NULL,
`TrunkId` int(11) NOT NULL,
`RateId` int(11) NOT NULL,
`Rate` decimal(18,6) NOT NULL,
`EffectiveDate` datetime NOT NULL,
`CreatedDate` timestamp NOT... |
CREATE TABLE `db_log` (
`id` bigint unsigned NOT NULL AUTO_INCREMENT,
`biz_tag` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '业务标签',
`action_tag` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '操作标签',
`operator` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '操作人',
`track_key` var... |
-- Deploy fresh database tables
\i '/docker-entrypoint-initdb.d/tables/user_role.sql'
\i '/docker-entrypoint-initdb.d/tables/user_group.sql'
\i '/docker-entrypoint-initdb.d/tables/user_account.sql'
\i '/docker-entrypoint-initdb.d/tables/transaction_type.sql'
\i '/docker-entrypoint-initdb.d/tables/bank_account.sql'
\i ... |
<reponame>LostKobrakai/ProcessWire
--- WireDatabaseBackup {"time":"2014-08-27 12:18:44","user":"","dbName":"pw2_blank","description":"","tables":[],"excludeTables":["pages_drafts","pages_roles","permissions","roles","roles_permissions","users","users_roles","user","role","permission"],"excludeCreateTables":[],"excludeE... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.4
-- Dumped by pg_dump version 13.3
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_path', '', fal... |
UPDATE [Customers$] SET
LastContact = '{LastContact}'
WHERE
CustID = '{CustID}' |
/* Add Virgin Column to Mem Accounts
*
*/
BEGIN;
ALTER TABLE "mem_accounts"
ADD COLUMN "virgin" SMALLINT DEFAULT 1;
-- Delete accounts which have never received or sent funds
-- e.g. Created using /api/accounts/open
DELETE FROM "mem_accounts"
WHERE "publicKey" IS NULL
AND "balance" = 0 AND "u_balance" = 0;... |
DROP TABLE IF EXISTS outfits;
CREATE TABLE `outfits` (
`identifier` varchar(30) NOT NULL,
`skin` varchar(30) CHARACTER SET utf8 NOT NULL DEFAULT 'mp_m_freemode_01',
`face` int(11) NOT NULL DEFAULT '0',
`face_text` int(11) NOT NULL DEFAULT '0',
`hair` int(11) NOT NULL DEFAULT '0',
`hair_text` int(11... |
DELETE
FROM blocks
WHERE id IN (${ids:list})
|
<gh_stars>1-10
CREATE OR REPLACE VIEW VIEW_JC_PCFILIAL AS
SELECT CODIGO AS CODFILIAL,
(CASE
WHEN FANTASIA IS NULL THEN
'FILIAL 99'
ELSE
FANTASIA
END) AS FILIAIS,
(CASE
WHEN NOMEREMETENTE IS NULL THEN
'FILIAL 99'
ELSE
NOMERE... |
CREATE SCHEMA [sqlparse]
AUTHORIZATION [dbo];
GO
EXECUTE sp_addextendedproperty @name = N'RepoSchema_guid', @value = '2199d297-86a3-eb11-84fa-a81e8446d5b0', @level0type = N'SCHEMA', @level0name = N'sqlparse';
GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'contains objects arou... |
insert into user (name, email) values ('rain', '<EMAIL>'), ('snow', '<EMAIL>'), ('wind', '<EMAIL>'); |
CREATE TABLE IF NOT EXISTS alert_timeline (
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
event_type VARCHAR NOT NULL,
reported_at TIMESTAMPTZ,
event_info TEXT
) |
<reponame>kophjager007/PowerUpSQL
-- author: <NAME>, 2017
-- Description: Copy file contents to another file via local, unc, or webdav path
-- summary = file contains varchar data, field is an int, throws casting error on read, set error output to file, tada!
-- requires sysadmin or bulk insert privs
create table #err... |
<filename>example/sqlite3/migrations/i9ypiko0.create-countries-table.sql<gh_stars>10-100
-- up
CREATE TABLE countries (
id INTEGER PRIMARY KEY,
name TEXT NOT NULL
);
---
DROP TABLE countries;
-- down
|
CREATE TABLE [dbo].[AsignacionPerfilLista]
(
[IdAsignacion] [int] NOT NULL IDENTITY(1, 1),
[IdLista] [int] NOT NULL,
[IdPerfil] [int] NOT NULL,
[IsActivo] [bit] NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AsignacionPerfilLista] ADD CONSTRAINT [PK_AsignacionPerfilLista] PRIMARY KEY CLUSTERED ([IdAsignacion]) ON [PRIMARY]... |
-- Drop table if exists
DROP TABLE IF EXISTS titles CASCADE;
-- Create the titles table, with a primary id and a title
CREATE TABLE titles (
title_id VARCHAR,
title VARCHAR,
CONSTRAINT pk_titles PRIMARY KEY (title_id)
);
-- Drop table if exists
DROP TABLE IF EXISTS employees CASCADE;
-- Create an employees table,... |
If Not Exists(Select * from sys.columns where Name = N'FacilityID' AND Object_ID = Object_ID(N'lnk_GroupFeatures'))
BEGIN
ALTER TABLE lnk_GroupFeatures ADD FacilityID INT CONSTRAINT DF_DEFAULT_FacilityID DEFAULT 0 NOT NULL;
END
If Not Exists(Select * from sys.columns where Name = N'ModuleID' AND Object_ID = Object_ID... |
Create Procedure [Hrm].[EncryptEmployeesSsn]
@employeeId Uniqueidentifier
AS
Begin
Open Symmetric Key HRM_KEY_001
Decryption By Certificate HRM001
Update [Hrm].[Employees]
Set [Ssn] = ENCRYPTBYKEY(KEY_GUID('HRM_KEY_001'), [Ssn])
Where [EmployeeId] = @employeeId
End
Return 0
|
<gh_stars>0
create or replace package pkg_WebUtilityBase is
/* package: pkg_WebUtilityBase
Common internal constans and functions of module.
SVN root: Oracle/Module/WebUtility
*/
/* group: Functions */
/* pproc: setNextTestResponse
Sets test response data for next request (works onlys in test dat... |
drop table Permissions_Role if exists;
drop table Permissions if exists;
drop table Role if exists;
CREATE TABLE Permissions ( id BIGINT NOT NULL, action VARCHAR (255), userName VARCHAR (255), PRIMARY KEY (id));
CREATE TABLE Permissions_Role ( Permissions_id BIGINT NOT NULL, roles_id BIGINT NOT NULL );
CREATE TAB... |
<gh_stars>1-10
alter table DDCA_ATTACHEMENT add column CATEGORY_ID varchar(36) ;
|
<reponame>a12312347/zhaoping
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50505
Source Host : 127.0.0.1:3306
Source Database : zhaoping
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2019-06-03 15:01:45
*/
S... |
<filename>data/data.sql<gh_stars>1-10
INSERT INTO postboard (sys_name, show_name, icon)
VALUES
('relationship', '感情', 'https://d2lzngk4bddvz9.cloudfront.net/board/relationship.svg'),
('trending', '時事', 'https://d2lzngk4bddvz9.cloudfront.net/board/trending.svg'),
('talk', '閒聊', 'https://d2lzngk4bddvz9.cl... |
<reponame>GeorgeKirev/OpenOLAT
alter table o_goto_organizer alter column g_access_token type varchar(4000);
alter table o_goto_organizer alter column g_refresh_token type varchar(4000);
|
<gh_stars>1000+
TRUNCATE TABLE {$NAMESPACE}_phortune.phortune_charge;
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
DROP paymentProviderKey;
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
ADD merchantPHID VARBINARY(64) NOT NULL;
ALTER TABLE {$NAMESPACE}_phortune.phortune_charge
ADD providerPHID VARBINAR... |
<reponame>fossabot/DIRBS-Core-1
--
-- DIRBS SQL migration script (v64 -> v65)
--
-- Copyright (c) 2018-2019 Qualcomm Technologies, Inc.
--
-- All rights reserved.
--
-- Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the
-- limitations in the disclaimer below) ... |
<reponame>clouserw/olympia<filename>migrations/36-creatured-download-source.sql<gh_stars>1-10
INSERT INTO download_sources (name, type, created)
VALUES ('creatured', 'full', NOW());
|
-- views.sql
select *
from "user";
drop view user_view;
-- view для таблицы "user"
create or replace view user_view as
select id,
coalesce('@' || username_nm || ' ', '') || coalesce(first_nm || ' ', '') ||
coalesce("user".second_nm || ' ', '') as nm,
now() - create_dttm as autho... |
<gh_stars>0
INSERT INTO [dbo].[Table] ([Username], [DoctorName], [Phone], [Specification], [Password]) VALUES (N'<PASSWORD>', N'<PASSWORD>', N'0555555555', N'Debute', N'<PASSWORD>')
INSERT INTO [dbo].[Table] ([Username], [DoctorName], [Phone], [Specification], [Password]) VALUES (N'<PASSWORD>', N'<PASSWORD>', N'059878... |
CREATE TABLE `tblTags` (
`TagID` int(11) NOT NULL AUTO_INCREMENT,
`TagName` varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`CompanyID` int(11) DEFAULT NULL,
`TagType` int(11) DEFAULT NULL,
PRIMARY KEY (`TagID`)
) ENGINE=InnoDB DEFA... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 05, 2019 at 01:29 PM
-- Server version: 10.3.15-MariaDB
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 15, 2021 at 04:20 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<filename>DevTools/Modules/SimpleNoteService/Database/Scripts/InitialLoading/SimpleNoteService/Drop/FoldersUpdateValueType.sql
DROP TYPE [simple-note-service].[FoldersUpdateValue]; |
USE abundance_db;
INSERT INTO products (item_name, photo_url, category)
VALUES ('apple', 'apple.jpg', 'fruit'),
('avocado','avocado.jpg', 'fruit'),
('blackberry','blackberry.jpg', 'fruit'),
('blueberry','blueberry.jpg', 'fruit'),
('grape','grape.jpg', 'fruit'),
('lemon','lemon.jpg', 'fruit'),
('lime','lime... |
<filename>docs/DB/quan.sql<gh_stars>1-10
INSERT INTO `quan` (`q_id`, `q_ten`, `q_mota`, `t_id`, `created_at`, `updated_at`) VALUES
(1, '<NAME>', 'Quận', 1, NULL, NULL),
(2, '<NAME>', 'Quận', 1, NULL, NULL),
(3, '<NAME>', 'Quận', 1, NULL, NULL),
(4, '<NAME>', 'Quận', 1, NULL, NULL),
(5, '<NAME>', 'Quận', 1, NULL, NULL... |
<filename>sql/schema_voc/load_voc_tbls.sql
--Select database
USE @database;
GO
--Load cdm.drug_strength from csv
IF(OBJECT_ID('cdm.drug_strength') IS NOT NULL)
BEGIN
TRUNCATE TABLE cdm.drug_strength;
BULK INSERT cdm.drug_strength
FROM '@vocab_data_pathDRUG_STRENGTH.csv'
WITH (
FIRSTROW = 2,
... |
CREATE OR REPLACE PACKAGE #plg_short_name#_plg_pkg IS
--
-- Plug-in Execution Function
-- #param p_process
-- #param p_plugin
-- #return apex_plugin.t_process_exec_result
FUNCTION exec_#plg_short_name#(p_process IN apex_plugin.t_process,
p_plugin IN apex_plugin.t_plu... |
<gh_stars>1-10
CREATE PROCEDURE [dbo].[GetTablesNoteByIdWithOutput]
@Id int = 0,
@Note NVarChar(Max) Output
AS
Select @Note = Note From Tables Where Id = @Id
Go
|
-- UPDATE PLAN
-- 8 TABLES ARE BEING USED BY DBT
-- 4 NO_PII TABLES - CREATE THE INDIVIDUAL READ ROLES FOR THESE
-- 4 PII TABLE-- 4 VIEWS NEEDED
-- ADD THE read ROLES TO THE NO_PII GROUP ROLE
-- ADD THE NO_PII GROUP ROLE TO BOTH DBT ROLES
--RAW.STITCH_EXACT_TARGET.DATA_EXTENSION_CONTACT_KEY_LKU
--RAW.STITCH_EXACT_TAR... |
<reponame>marco-aurelioo/MindStruture
;
CREATE USER IF NOT EXISTS "SA" SALT 'e1409cab4e563c26' HASH 'fa5bd694e52fdb186ddc6807bb150d2842192fbd308e9595c6a62547e81d2de6' ADMIN;
CREATE SEQUENCE "PUBLIC"."SYSTEM_SEQUENCE_D4DAA309_A51A_4CD0_9B41_245BA705B596" START WITH 5 BELONGS_TO_TABLE;
CREATE MEMORY... |
<reponame>himanshugawari/Recipe
insert into category(description) values('American');
insert into category(description) values('Italian');
insert into category(description) values('Mexican');
insert into category(description) values('Fast Food');
insert into unit_of_measure(description) values('Teaspoon');
insert ... |
<filename>First Program.sql
#SELECT cast(123 AS DECIMAL(5,2))
#123.00 OUTPUT
#! SELECT CAST(12345.12 AS NUMERIC(10,5))
#SELECT cast(123 AS DECIMAL(5,3))
#99.999 OUTPUT
#SELECT CAST(1234 AS DECIMAL(5,3))
#99.999 OUTPUT
#SELECT CAST(123 AS DECIMAL(5,1))
#123.0 OUTPUT
#SELECT CAST(PI() AS FLOAT)
#3.1415927410125732 OU... |
<filename>genehancer/fill-2021/createDatabase-gh50.sql
create database gh50;
|
<gh_stars>100-1000
ALTER TABLE t1 ALTER COLUMN c SET DEFAULT 3 |
--
-- Modification table campagne
--
ALTER TABLE `campagne`
ADD COLUMN `dat_fin_candidat_camp` DATE NULL DEFAULT NULL COMMENT 'date de fin d\'ouverture aux candidats' AFTER `dat_fin_camp`; |
SELECT
YMD
,MAX(TOTAL) AS TOTAL
,MIN(BEFORE_TOTAL) AS BEFORE
FROM
(
SELECT
TO_CHAR(TIMESTAMPADD(
'MINUTE'
,?
,INSERT_DATETIME
), 'YYYYMMDD') AS YMD
... |
-- Convert schema '/Users/doug/perl/cpantesters/schema/share/CPAN-Testers-Schema-0.019-MySQL.sql' to 'CPAN::Testers::Schema v0.020':;
-- No differences found;
|
<gh_stars>0
ALTER TABLE `domain` ADD `domain_name` VARCHAR( 255 ) NULL AFTER `domain_id` ;
ALTER TABLE `domain` ADD `amazon_id` VARCHAR( 120 ) NULL ;
ALTER TABLE `domain` ADD `amazon_keyword` VARCHAR( 255 ) NULL ;
ALTER TABLE `domain` ADD `ebay_id` VARCHAR( 120 ) NULL ;
ALTER TABLE `domain` ADD `ebay_keyword` VAR... |
/*
Navicat MySQL Data Transfer
Source Server : Local
Source Server Version : 50505
Source Host : localhost:3306
Source Database : portal
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2017-05-31 14:43:27
*/
SET FOREIGN_KEY_CHECKS=0;
-- ------... |
<filename>openGaussBase/testcase/KEYWORDS/restrict/Opengauss_Function_Keyword_Restrict_Case0027.sql
-- @testpoint:opengauss关键字restrict非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists restrict;
create sequence restrict start 100 cache 50;
drop sequence restrict;
--关键字带双引号-成功
drop sequence if exists "restrict";
create... |
declare
x number(2);
begin
x:=:enter_value_frm_0-5;
if(x=0)then
dbms_output.put_line('value of x is (zero):'||x)
elsif(x=1) then
dbms_output.put_line('value of x is (one):'||x);
elsif(x=2) then
dbms_output.put_line('value of x is (two):'||x);
elsif(x=3) then
dbms_output.put_line('value ... |
<filename>server/init.sql
-- init
CREATE TABLE public.users (
"id" SERIAL PRIMARY KEY,
"fullname" TEXT NOT NULL,
"email" TEXT NOT NULL UNIQUE,
"password" TEXT NOT NULL,
"bio" TEXT
);
CREATE TABLE public.items (
"id" SERIAL PRIMARY KEY,
"title" TEXT NOT NULL,
"desc" TEXT NOT NULL,
"image_url" TEXT,
"... |
SELECT Passagem.Numero, Passagem.CodEscala, Escala.Partida, Escala.Destino, Escala.Preco
FROM Passagem
INNER JOIN Escala
ON Passagem.CodEscala = Escala.CodEscala
AND Partida IN ('Fortaleza','São Paulo')
AND Destino IN ('Frankfurt','Londres','Floripa');
SELECT *
FROM PacoteViagem
WHERE Preco BETWEEN 500.0 AND 2500.0... |
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_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row... |
SET TIMEZONE = 'Europe/Brussels';
-------------------------------------------------------------------------------------------------------------------
CREATE DOMAIN EmployeeTitle VARCHAR(255) CHECK (VALUE IN ('PhD', 'Professor'));
CREATE DOMAIN GuidanceType VARCHAR(255) NOT NULL CHECK (VALUE IN ('Promotor', 'Co-Promotor... |
prompt --application/pages/page_10010
begin
-- Manifest
-- PAGE: 10010
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.03.31'
,p_release=>'20.1.0.00.13'
,p_default_workspace_id=>1300871798938927
,p_default_application_id=>101
,p_default_id_offset=>0
,p_default_owner=>'FLOWSDEV'
);
ww... |
-- table_ddl.sql
@clears
col v_owner new_value v_owner noprint
col v_table_name new_value v_table_name noprint
prompt
prompt Table Owner:
prompt
set feed off term off
select upper('&1') v_owner from dual;
set feed on term on
prompt
prompt Table Name:
prompt
set feed off term off
select upper('&2') v_table_name f... |
{{
config(
alias='volume_day'
)
}}
SELECT
'ethereum' as blockchain,
date_trunc('day', block_time) AS day,
SUM(amount) AS volume,
token_symbol,
SUM(amount_usd) AS volume_usd
FROM
{{ ref('opensea_ethereum_trades') }}
GROUP BY 2,4
ORDER BY 2 |
<gh_stars>1-10
# --- Rename the table columns to work with Ebean
# --- !Ups
alter table users rename column firstName to first_name;
alter table users rename column lastName to last_name;
alter table users rename column passwordHash to password_hash;
alter table short_urls rename column shortCode to short_code;
alte... |
-- randexpr1.test
--
-- db eval {SELECT (abs(case when t1.d not in (t1.f,t1.d,(select abs(min(((select +count(*)*case max(t1.e-coalesce((select max(case t1.b when 13 then a else e end) from t1 where t1.b>b),19)+d)- -+count(*) when +cast(avg(d) AS integer) then max(c) else (cast(avg(c) AS integer)) end | count(*) from ... |
-- file:aggregates.sql ln:772 expect:true
create aggregate my_avg_init2(int4)
(
stype = avg_state,
sfunc = avg_transfn,
finalfunc = avg_finalfn,
initcond = '(4,0)'
)
|
<reponame>Shuttl-Tech/antlr_psql
-- file:foreign_key.sql ln:502 expect:true
CREATE TABLE PKTABLE (ptest1 int, ptest2 inet, ptest3 int, ptest4 inet, PRIMARY KEY(ptest1, ptest2), FOREIGN KEY(ptest3,
ptest4) REFERENCES pktable(ptest1, ptest2))
|
SET search_path = disclosure, pg_catalog;
--
-- Name: dsc_sched_a_aggregate_employer; Type: TABLE; Schema: disclosure; Owner: fec
--
CREATE TABLE dsc_sched_a_aggregate_employer (
cmte_id character varying(9),
cycle numeric,
employer character varying(38),
total numeric,
count bigint,
idx integ... |
<reponame>HighgoSoftware/orc_fdw<filename>sql/joins.sql<gh_stars>1-10
/*-------------------------------------------------------------------------
*
* select.sql
* Test select statements
*
* REQUIRES:
* ORC_FDW_DIR variable to be set in the shell which is initiating
* the regression.
*
* 2020, <... |
<reponame>vulcanize/new_oasis_watcher
CREATE TABLE oasis.log_take (
db_id SERIAL,
vulcanize_log_id INTEGER NOT NULL UNIQUE,
id INTEGER NOT NULL,
pair CHARACTER VARYING(66),
guy CHARACTER VARYING(66),
gem CHARACTER VARYING(66),
lot ... |
-- phpMyAdmin SQL Dump
-- version 4.3.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 21, 2015 at 12:49 AM
-- Server version: 5.5.41-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table category (
id bigint not null,
name varchar(255),
constraint pk_category primary key (id))
;
create table earn (
id ... |
-- Stored Procedures (Sprocs)
-- Validating Parameter Values
USE [A01-School]
GO
/* ********* SPROC Template ************
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_TYPE = N'PROCEDURE' AND ROUTINE_NAME = 'SprocName')
DROP PROCEDURE SprocName
GO
CREATE PROCEDURE SprocName
-- ... |
INSERT INTO person VALUES (1, 'eric', 18);
INSERT INTO person VALUES (2, 'woody', 18);
INSERT INTO person VALUES (3, 'william', 18);
INSERT INTO person VALUES (4, 'zeven', 18); |
<filename>design/data/corrosion_site.sql
INSERT INTO corrosion.site (id, title, vicetitle, description, vicedesc) VALUES (1, '国家科技基础条件平台', '国家材料环境腐蚀科学数据中心', 'National Material Environmental Corrosion Science Data Center', 'National Science & Technology Infrastructure'); |
<filename>src/main/resources/db/migration/mysql/V1__init_schema.sql
create database IF NOT EXISTS fileserver_boot;
/*==============================================================*/
/* Table: pub_user */
/*==============================================================*/
cr... |
set client_encoding = 'utf-8';
set client_min_messages = warning;
create extension if not exists pgtap;
reset client_min_messages;
begin;
select plan(13);
-- Test table exists in swrs_transform schema
select has_table(
'swrs_transform', 'implied_emission_factor',
'swrs.implied_emission_factor should exist as ... |
-- ALTER SCHEMA IF EXISTS globalsns RENAME TO globalsns_bk;
CREATE SCHEMA "globalsns-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" AUTHORIZATION "globalsns-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
set search_path to "globalsns-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
CREATE TABLE tenant_system_conf (
conf_key varchar(513) NOT N... |
ALTER TABLE mythgard.card_deck ENABLE ROW LEVEL SECURITY;
-- Admin users can make any changes and read all rows
CREATE POLICY card_deck_admin_all ON mythgard.card_deck TO admin USING (true) WITH CHECK (true);
-- Non-admins can read all rows
CREATE POLICY card_deck_all_view ON mythgard.card_deck FOR SELECT USING (true);... |
CREATE STREAM R(A int, B int)
FROM FILE 'examples/data/simple/r.dat' LINE DELIMITED
CSV ();
SELECT r1.A, SUM(1)
FROM R r1
WHERE EXISTS
( SELECT 1
FROM (SELECT SUM(r2.B) as B FROM R r2 WHERE r2.A = r1.B) n1
WHERE r1.A *3 < n1.B )
GROUP BY r1.A
|
-- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 15, 2015 at 07:44 PM
-- Server version: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
<filename>reference/Labellab-sql-script.sql
-- MySQL Script generated by MySQL Workbench
-- Mon Jun 8 20:03:57 2020
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0... |
ALTER TABLE `accounts` CHANGE `address_billing` `address_billing` VARCHAR( 1000 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `accounts` CHANGE `address_shipping` `address_shipping` VARCHAR( 1000 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL;
ALTER TABLE `contacts` CHANGE `address_1` `addr... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.