text stringlengths 1 1.05M |
|---|
SET ANSI_NULLS ON;
SET ANSI_PADDING ON;
SET ANSI_WARNINGS ON;
SET ARITHABORT ON;
SET CONCAT_NULL_YIELDS_NULL ON;
SET QUOTED_IDENTIFIER ON;
SET STATISTICS IO OFF;
SET STATISTICS TIME OFF;
GO
IF OBJECT_ID('dbo.sp_AllNightLog') IS NULL
EXEC ('CREATE PROCEDURE dbo.sp_AllNightLog AS RETURN 0;')
GO
ALTER ... |
DO
$$
BEGIN
IF NOT EXISTS (
SELECT 1
FROM protocol_info
WHERE protocol = 'SMR'
AND protocol_version = '5.1') THEN
INSERT INTO protocol_info(
creation_time,
modification_time,
version,
protocol,
protocol_version,
outgoing_protocol_requests_queue,
incoming_protocol_res... |
ALTER TABLE `Buff` ADD `EffectType` bigint(11) DEFAULT '0' COMMENT '??????(????) ??,??(???,??)';
ALTER TABLE `Buff` ADD `EffectValueType` bigint(11) DEFAULT '0' COMMENT '????? ??? ???--?????????,???????';
ALTER TABLE `Buff` ADD `EffectValueReferType` bigint(11) DEFAULT '0' COMMENT '???????';
ALTER TABLE `Buff` ADD ... |
create table notification_email_hold (
reply_id integer
constraint notification_email_hold_pk primary key
constraint notif_email_hold_reply_id_fk
references notification_replies(reply_id),
to_addr clob,
headers clob,
body clob
);
|
CREATE PROCEDURE [spGetNextModelId]
AS
BEGIN
BEGIN TRY
DECLARE @ObjectName NVARCHAR(200) = OBJECT_NAME(@@PROCID),
@Category NVARCHAR(20),
@Title NVARCHAR(50),
@MessageContent NVARCHAR(1500),
@ModelId int
SELECT @ModelId = MAX([ModelId]) FROM [Model]
SET @ModelId = ISNULL(@ModelId, 0)
... |
DROP PROCEDURE IF EXISTS `proc_get_partner_justification`;
DELIMITER //
CREATE PROCEDURE `proc_get_partner_justification`
(IN P_id INT(11), IN filter_year INT(11), IN from_month INT(11), IN to_year INT(11), IN to_month INT(11))
BEGIN
SET @QUERY = "SELECT
`vj`.`name`,
... |
UPDATE Q
SET Q.hpa_yoy = M.hpa_yoy
FROM hpi_ofheo_hist AS Q
INNER JOIN hpi_ofheo_monthly AS M
ON Q.region_code=M.region_code
AND Q.pb_date=M.pb_date
WHERE Q.pb_date < 20130701
|
-- 注意!!!注意将下面两个 CREATE TABLE 定义中的 hostname 参数,修改为你自己的主机 IP 地址。
-- 也就是用 ifconfig 查询得到的 en0 或 eth0 地址。
-- 使用 Table/SQL API 方式实现 Flink CDC,需要用到 Flink SQL Client 客户端工具。
-- 在 Flink SQL Client 里执行以下 SQL。
-- 创建源数据库
CREATE TABLE sourceTable (
id INT,
name STRING,
counts INT,
description STRING
) WITH (
'connector' =... |
ALTER TABLE task_activity DROP CONSTRAINT task_activity_task_id_fkey;
ALTER TABLE task_activity
ADD CONSTRAINT task_activity_task_id_fkey
FOREIGN KEY (task_id)
REFERENCES task(task_id)
ON DELETE CASCADE;
ALTER TABLE task_comment DROP CONSTRAINT task_comment_task_id_fkey;
ALTER TABLE task_comment
ADD CONSTRAI... |
INSERT INTO [appleseed].[dbo].[rb_Modules]
([TabID]
,[ModuleDefID]
,[ModuleOrder]
,[PaneName]
,[ModuleTitle]
,[AuthorizedEditRoles]
,[AuthorizedViewRoles]
,[AuthorizedAddRoles]
,[AuthorizedDeleteRoles]
,[Autho... |
SELECT
state_name
FROM bigquery-public-data.utility_us.us_states_area
WHERE
ST_Contains(
state_geom,
ST_GeogPoint(-122.33, 47.61));
-- (-122.33, 47.61)state_namestate_geom FROM bigquery-public-data us_states_areautility_us.utility_us us_states_area;
zless college_scorecard.csv.gz
bq --location=US mk ... |
insert Fabricante(ID,codigo,nome) VALUES (1,12345678,'Brastemp');
insert Fabricante(ID,codigo,nome) VALUES (2,987654321,'Honda');
insert Fabricante(ID,codigo,nome) VALUES (3,989554321,'Nissan');
|
SELECT AVG(amount) AS Media_pagamentos FROM sakila.payment; |
CREATE OR REPLACE PROCEDURE SP_COUNT_CONSUMER_ACCESS_TOKEN
(
P_CONSUMER_KEY IN VARCHAR2,
P_COUNT OUT NUMBER,
P_RESULT OUT NUMBER
)
AS
-- PROCEDURE TO Count the consumer access tokens for the given consumer.
BEGIN
P_RESULT := 0;
SELECT COUNT(OST_ID) INTO P_COUNT
F... |
create table testxyz.employee(
Id bigint identity(1,1) not null,
firstname nvarchar(500) not null,
lastname nvarchar(500) not null,
primary key(id)
)
distkey(id)
compound sortkey(firstname, lastname);
|
-- Load some numbers
CREATE TABLE numbers(i INTEGER);
INSERT INTO numbers VALUES(1);
INSERT INTO numbers SELECT i + (SELECT MAX(i) FROM numbers) FROM numbers;
INSERT INTO numbers SELECT i + (SELECT MAX(i) FROM numbers) FROM numbers;
INSERT INTO numbers SELECT i + (SELECT MAX(i) FROM numbers) FROM numbers;
INSERT INTO n... |
ALTER TABLE character_db_version CHANGE COLUMN required_10568_01_characters_character_tutorial required_10655_01_characters_character_queststatus_monthly bit;
DROP TABLE IF EXISTS character_queststatus_monthly;
CREATE TABLE character_queststatus_monthly (
guid int(11) unsigned NOT NULL default '0' COMMENT 'Global Un... |
/*Table: Employees
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| employee_id | int |
| name | varchar |
+-------------+---------+
employee_id is the primary key for this table.
Each row of this table indicates the name of the employee whose ID is employee_id.
Table: Salar... |
CREATE TABLE `virtual_users` (
`id` int(11) NOT NULL auto_increment,
`domain_id` int(11) NOT NULL,
`password` varchar(32) NOT NULL,
`email` varchar(100) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `email` (`email`),
FOREIGN KEY (domain_id) REFERENCES virtual_domains(id) ON DELETE CASCADE
) ENGINE=InnoDB DEFA... |
begin;
alter table users add lastlogin timestamp;
end; |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Tempo de geração: 08/05/2019 às 20:47
-- Versão do servidor: 5.7.26-0ubuntu0.18.04.1
-- Versão do PHP: 7.2.17-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
/****** Object: View [dbo].[ValidLearners] Script Date: 12/09/2016 09:23:09 ******/
IF EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[ValidLearners]'))
DROP VIEW [dbo].[ValidLearners]
GO
/****** Object: StoredProcedure [dbo].[TransformInputToValid_TrailblazerApprenticeshipFinancialRecord] ... |
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2022] EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may ob... |
DELIMITER //
CREATE TRIGGER so_before_update BEFORE UPDATE ON so
FOR EACH ROW
BEGIN
IF NEW.so_ps_score < 0 THEN
SET NEW.so_ps_score = 0;
ELSEIF NEW.so_ps_score > 100 THEN
SET NEW.so_ps_score = 100;
END IF;
IF NEW.so_ks_score < 0 THEN
SET NEW.so_ks_score = 0;
ELSEIF NE... |
DELIMITER /
CREATE TABLE SEQ_IACUC_UNIT_CORRESPONDENT_ID (
id bigint(19) not null auto_increment, primary key (id)
) ENGINE MyISAM
/
ALTER TABLE SEQ_IACUC_UNIT_CORRESPONDENT_ID auto_increment = 1
/
DELIMITER ;
|
INSERT INTO `reports` (`uuid`, `name`, `type`, `tabledefid`, `displayorder`, `roleid`, `reportfile`, `description`, `createdby`, `creationdate`, `modifiedby`, `modifieddate`) VALUES ('rpt:e3ef15d4-1bf5-36a1-cc05-ee44025ad619', 'Totals - Custom', 'report', 'tbld:62fe599d-c18f-3674-9e54-b62c2d6b1883', '50', 'role:259ead9... |
-- Create geoms of watersheds upstream of pts
-- Write to a new table to keep the geoms on hand, they take several hours to generate
-- Do not generate watersheds for points on order 8 streams or greater
DROP TABLE IF EXISTS temp.fiss_density_watersheds;
CREATE TABLE temp.fiss_density_watersheds
(
fiss_density_wat... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : mar. 21 août 2018 à 23:47
-- Version du serveur : 10.1.34-MariaDB
-- Version de PHP : 7.1.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4010... |
-- Timestamp: 2011-09-22 15:32:02.024
-- Source database is: /home/carl/Work/repos/hive1/metastore/scripts/upgrade/derby/mdb
-- Connection URL is: jdbc:derby:/home/carl/Work/repos/hive1/metastore/scripts/upgrade/derby/mdb
-- Specified schema is: APP
-- appendLogs: false
-- ---------------------------------------------... |
-- COLAB-951
ALTER TABLE `xcolab_Contest` ADD UNIQUE `unique_index_contest_name_year`(`ContestUrlName`, `ContestYear`);
|
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
DROP VIEW IF EXISTS analytics.asmt_StudentAssessme... |
/* This builds out our DB schema and then pops in 20 sample match rows to work with */
CREATE TABLE `matches` (
`matchId` int(11) unsigned NOT NULL AUTO_INCREMENT,
`riotMatchId` int(11) unsigned NOT NULL DEFAULT '0',
`sumGuessed` int(11) unsigned NOT NULL DEFAULT '0',
`sumCorrect` int(11) unsigned NOT NULL DEFA... |
ALTER TABLE `#__aimysitemap`
MODIFY `url`
varbinary(767) NOT NULL;
ALTER TABLE `#__aimysitemap_crawl`
MODIFY `url`
varbinary(767) NOT NULL;
|
--
-- CzechIdM 8 Flyway script
-- BCV solutions s.r.o.
--
-- Email template sender
ALTER TABLE idm_notification_template ADD COLUMN sender character varying(255);
ALTER TABLE idm_notification_template_a ADD COLUMN sender character varying(255);
ALTER TABLE idm_notification_template_a ADD COLUMN sender_m boolean;
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 03 Feb 2022 pada 14.46
-- Versi server: 10.4.20-MariaDB
-- Versi PHP: 7.3.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
DROP TABLE IF EXISTS `bb_oper_logs`;
CREATE TABLE bb_oper_logs (
id bigint(11) unsigned NOT NULL AUTO_INCREMENT,
emp_id varchar(32) NOT NULL,
emp_name varchar(128) NOT NULL,
controller varchar(64) NOT NULL,
operation varchar(64) NOT NULL,
ip varchar(24) ... |
CREATE TABLE country (id VARCHAR(2) NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;
INSERT INTO `country` (`id`, `name`) VALUES ('AF', 'Afghanistan');
INSERT INTO `country` (`id`, `name`) VALUES ('AL', 'Albanien');
INSERT INTO `country` (`id`, `... |
DELIMITER //
DROP FUNCTION IF EXISTS loop_100;
CREATE FUNCTION loop_100()
RETURNS INTEGER
BEGIN
DECLARE result INTEGER DEFAULT 0;
loop_100: LOOP
SET result=result + 1;
IF result=100 THEN LEAVE loop_100;
END IF;
END LOOP loop_100;
RETURN result;
END//
DELIMITER ;
|
----------------------------
-- Copyright (C) 2021 CARTO
----------------------------
CREATE OR REPLACE FUNCTION `@@BQ_PREFIX@@transformations.__CENTERMEDIAN`
(geojson STRING)
RETURNS STRING
DETERMINISTIC
LANGUAGE js
OPTIONS (library=["@@BQ_LIBRARY_BUCKET@@"])
AS """
if (!geojson) {
return null;
}
... |
drop index ACT_IDX_BYTEAR_DEPL;
drop index ACT_IDX_EXE_PROCINST;
drop index ACT_IDX_EXE_PARENT;
drop index ACT_IDX_EXE_SUPER;
drop index ACT_IDX_TSKASS_TASK;
drop index ACT_IDX_TASK_EXEC;
drop index ACT_IDX_TASK_PROCINST;
drop index ACT_IDX_TASK_PROCDEF;
drop index ACT_IDX_VAR_EXE;
drop index ACT_IDX_VAR_PROCINST;
drop... |
-- create user table
CREATE TABLE IF NOT EXISTS `mokumoku`.`users` (
`id` VARCHAR(64) NOT NULL,
`name` VARCHAR(128) NOT NULL DEFAULT 'email user',
`img_url` TEXT NOT NULL DEFAULT 'https://via.placeholder.com/128x128?text=User+Image',
`score` INT NOT NULL DEFAULT '0',
`total_distance` INT NOT NULL DEFAULT '0' COMM... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50553
Source Host : localhost:3306
Source Database : dp_blog
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-04-06 01:42:41
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... |
select *
from {{ var('account') }} |
--
-- Copyright 2010-2015 Boxfuse GmbH
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or ... |
{#
These macros control how incremental models are updated in Airbyte's normalization step
- get_max_normalized_cursor retrieve the value of the last normalized data
- incremental_clause controls the predicate to filter on new data to process incrementally
#}
{% macro incremental_clause(col_emitted_at) -%... |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.1.200
Source Server Version : 50520
Source Host : 192.168.1.200:3306
Source Database : onethink_v01
Target Server Type : MYSQL
Target Server Version : 50520
File Encoding : 65001
Date: 2013-09-18 23:19:34
*/
SET... |
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: Quickadclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RES... |
--
-- Copyright (c) Microsoft Corporation. All rights reserved.
-- Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
--
CREATE TABLE [dbo].[MerchantSubscriptionsHistory](
[HistoryDate] [datetime] NOT NULL CONSTRAINT [DF_MerchantSubscriptionsHistory_HistoryDate] DE... |
-- noinspection SqlDialectInspectionForFile
-- noinspection SqlNoDataSourceInspectionForFile
USE app;
DROP FUNCTION IF EXISTS rand_range;
DELIMITER //
CREATE FUNCTION rand_range (max BIGINT, min BIGINT)
RETURNS DOUBLE DETERMINISTIC
RETURN FLOOR(RAND() * ((max - min) + 1)) + min;
//
DELIMITER ;
DROP FUNCTION IF EXISTS... |
CREATE TABLE [dbo].[country] (
[id] INT IDENTITY (1, 1) NOT NULL,
[name] VARCHAR (100) NULL,
[order] INT DEFAULT ((0)) NOT NULL,
[currency_id] INT DEFAULT ((1)) NOT NULL,
PRIMARY KEY CLUSTERED ([id] ASC),
CONSTRAINT [fk_country_currency] FOREI... |
-- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64)
--
-- Host: localhost Database: pisosenm_inmobiliaria_dos
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.38-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULT... |
-- file:type_sanity.sql ln:155 expect:true
SELECT p1.oid, p1.typname, p2.oid, p2.proname
FROM pg_type AS p1, pg_proc AS p2
WHERE p1.typoutput = p2.oid AND p2.provolatile NOT IN ('i', 's')
|
with recursive oc(level, empno, ename, job, mgr) as
(select 1, empno, ename, job, mgr
from emp where mgr is null
union all
select level+1, s.empno, s.ename, s.job, s.mgr
from oc join emp s on oc.empno = s.mgr)
select * from oc;
|
-- Table: testflowseq
-- DROP TABLE testflowseq;
CREATE TABLE testflowseq
(
testflowseq_id serial NOT NULL,
testflowseq_name text not null,
testflowseq_description text not null,
testflowseq_flow_id integer not null default 1,
testflowseq_test_seq integer[][],
testflowseq_created_timestamp timestamp with... |
CREATE DATABASE libreplan;
CREATE USER libreplan WITH PASSWORD 'libreplan';
GRANT ALL PRIVILEGES ON DATABASE libreplan TO libreplan;
|
-------------------------------------------------------------
------------------------ Setup Demo -------------------------
-------------------------------------------------------------
--// Create a schema for our Row Level Security Objects to reside in.
CREATE SCHEMA security;
GO
--// When using applications we wil... |
-- Creates new rows containing data in all named columns --
INSERT INTO department (name)
VALUES ("warehouse");
INSERT INTO department (name)
VALUES ("Sales");
INSERT INTO department (name)
VALUES ("Marketing Department");
INSERT INTO roles (title, salary, department_id)
VALUES ("forklift driver", 40000, 1);
INSERT... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 22 Agu 2019 pada 21.43
-- Versi server: 10.3.16-MariaDB
-- Versi PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
INSERT INTO `command` ( `name` , `security` , `help` )
VALUES (
'tele', '1', 'Syntax: .tele $location\n\nTeleport the gm to the provided location. You can look up these locations using .lookuptele'
); |
SET join_use_nulls = 1;
SELECT number FROM system.numbers SEMI LEFT JOIN (SELECT number, ['test'] FROM system.numbers LIMIT 1) js2 USING (number) LIMIT 1;
SELECT number FROM system.numbers ANY LEFT JOIN (SELECT number, ['test'] FROM system.numbers LIMIT 1) js2 USING (number) LIMIT 1;
|
select * from a,b
where a.x >= b.y |
INSERT INTO burgers (burger_name)
VALUES ('Bacon Cheeseburger'),
('Juicy Lucy'),
('Beyond Burger');
INSERT INTO burgers (burger_name, devoured)
VALUES ('Hamburger', 1); |
CREATE PROCEDURE [workers].[DumpDataAndWait322]
(
@SecondWait TINYINT = 0
)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @Delay VARCHAR(8)
SELECT
@Delay = '00:00:0' + LEFT(ABS(CAST(CAST(NEWID() AS VARBINARY(192)) AS INT)),1)
INSERT INTO [dbo].[DataDump]
(
[SomeValue]
)
SELECT TOP 1
[stopword]
FROM
sys... |
--+ holdcas on;
--Create trigger with 'insert' event and retrieve the priority from virtual class db_trigger
create class test_class(col1 integer, col2 varchar(20));
create class op_record(operator varchar(20),
op_action varchar(50),
op_time timestamp default '2008-05-27... |
CREATE TABLE IDN_BASE_TABLE (
PRODUCT_NAME VARCHAR2 (20),
PRIMARY KEY (PRODUCT_NAME))
/
INSERT INTO IDN_BASE_TABLE values ('WSO2 Identity Server')
/
CREATE TABLE IDN_OAUTH_CONSUMER_APPS (
ID INTEGER,
CONSUMER_KEY VARCHAR2 (255),
CONSUMER_SECRET VARCHAR2 (2048)... |
CREATE TABLE IF NOT EXISTS carts
(
id text NOT NULL,
counter integer,
weight integer,
discount integer,
taxes integer,
subtotal integer,
total integer,
CONSTRAINT carts_pkey PRIMARY KEY (id)
); |
CREATE OR REPLACE FUNCTION sref_system_to_srid(sref_system character varying)
RETURNS integer AS
$BODY$
BEGIN
RETURN CASE lower(sref_system)
WHEN 'osgb' THEN 27700
WHEN 'osie' THEN 29901
WHEN 'lugr' THEN 2169
WHEN 'mtbqqq' THEN 4314
WHEN 'guernsey' THEN 310... |
prompt --application/shared_components/security/app_access_control/contributor
begin
-- Manifest
-- ACL ROLE: Contributor
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2021.04.15'
,p_release=>'21.1.7'
,p_default_workspace_id=>9690978936188613
,p_default_application_id=>116
,p_default_id... |
CREATE TABLE IF NOT EXISTS transactions (
blk_lvl UInt64,
blk_hash FixedString(64),
tx_time DateTime,
tx_hash FixedString(64),
tx_amount UInt64,
tx_escrow_amount UInt64,
tx_escrow_reclaim_amount UInt64,
tx_type LowCardinality(String),
tx_status UInt8,
tx_error String,
tx_se... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 31, 2019 at 09:03 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.2.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... |
CREATE TABLE foo (id serial not null, bar_id int references bar(id));
CREATE TABLE bar (id serial not null);
-- name: RightJoin :many
SELECT f.id, f.bar_id, b.id
FROM foo f
RIGHT JOIN bar b ON b.id = f.bar_id
WHERE f.id = $1; |
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `os_user`;
CREATE TABLE `os_user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_name` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '用户名',
`password` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '密码',
`login_times` int(11) NOT NULL DEFAULT ... |
ALTER SYSTEM set autovacuum = off;
SELECT pg_reload_conf();
SELECT pg_stat_reset();
DROP TABLE IF EXISTS t;
DROP TABLE IF EXISTS tt;
DROP TABLE IF EXISTS ttt;
DROP TABLE IF EXISTS tttt;
DROP TABLE IF EXISTS ttttt;
DROP TABLE IF EXISTS tttttt;
DROP TABLE IF EXISTS ttttttt;
CREATE TABLE t AS
SELECT
i, ... |
Insert INTO Courses ([title],[description])
Values ('C++','C++')
Insert INTO Courses ([title],[description])
Values ('Math','Math')
Insert INTO Courses ([title],[description])
Values ('Physic','Physic')
Insert Into Students([name],[surname],[SSN])
Values ('Hrant','Arakelyan','AP1231345')
Insert Into Students... |
set head on
set colsep ";"
set feedback on
set line 1000
set pagesize 10000
set echo on
set trimspool on
spool c:\Script1.spl
SELECT * FROM FBTB_DATES ;
SELECT * FROM STTM_DATES ;
SELECT * FROM STTM_AEOD_DATES ;
SELECT * FROM ACTB_DAILY_LOG where trn_dt=to_date('26-Oct-2012','dd-mm-yyyy') ;
SELECT trn_dt,... |
DROP TABLE IF EXISTS #login_event
GO
CREATE TABLE #login_event(
timestamp_utc datetime2(3) NOT NULL,
object_name nvarchar(120),
module_guid uniqueidentifier,
package_guid uniqueidentifier,
event_data xml,
database_name varchar(50) NOT NULL,
file_name nvarchar(520),
file_offset bigint NOT NULL
)
ALTER TABLE #lo... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 179.188.16.14
-- Generation Time: 04-Maio-2018 às 12:22
-- Versão do servidor: 5.6.35-81.0-log
-- PHP Version: 5.6.30-0+deb8u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Mar 18 Juillet 2017 à 15:36
-- Version du serveur : 5.7.18-0ubuntu0.16.04.1
-- Version de PHP : 7.0.18-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
--
-- Copyright © 2016-2021 The Thingsboard Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicabl... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
DROP PUBLIC SYNONYM ZSTG_GENE_AGENT_CGID
/
--
-- ZSTG_GENE_AGENT_CGID (Synonym)
--
-- Dependencies:
-- ZSTG_GENE_AGENT_CGID (Table)
--
CREATE PUBLIC SYNONYM ZSTG_GE... |
-- +----------------------------------------------------------------------------+
-- | Jeffrey M. Hunter |
-- | jhunter@idevelopment.info |
-- | www.idevelopment.info ... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 11 Des 2020 pada 08.32
-- Versi server: 10.4.14-MariaDB
-- Versi PHP: 7.3.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
{% macro split_part(string_text, delimiter_text, part_number) %}
{{ return(adapter.dispatch('split_part', 'dbt_utils_justos') (string_text, delimiter_text, part_number)) }}
{% endmacro %}
{% macro default__split_part(string_text, delimiter_text, part_number) %}
split_part(
{{ string_text }},
{{... |
CREATE OR REPLACE PACKAGE BODY SOK_ROLE_UTIL
AS
/* FUNCTION role_name_exists
** Check if current role_name already exists, e.g. does not exist
** return true if the role already exists, else return false;
*/
FUNCTION role_name_exists(
val_role_name IN SOK_ROLE_LU.role_name%TYPE)
RETURN BOOLEAN
IS... |
-- timestamptz check
CREATE TABLE timestamptztmp (a timestamptz);
\copy timestamptztmp from 'data/timestamptz.data'
SET enable_seqscan=on;
SELECT count(*) FROM timestamptztmp WHERE a < '2018-12-18 10:59:54 GMT+3';
SELECT count(*) FROM timestamptztmp WHERE a <= '2018-12-18 10:59:54 GMT+3';
SELECT count(*) FROM ti... |
.load unit.dylib
select assert_equal("foo", "foo"); |
USE [VipunenTK]
GO
/****** Object: View [dbo].[v_f_tab_lukio_ja_ammatillinen_2_3_h] Script Date: 10.8.2021 16:10:03 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER VIEW [dbo].[v_f_tab_lukio_ja_ammatillinen_2_3_h] AS
SELECT
[Tilastovuosi] = f.tilastointivuosi
,[Ikäryhmä] = d1.ika5v
,[Ko... |
Rem
Rem $Header: rdbms/demo/schema/order_entry/xdbUtilities.sql /main/2 2011/03/02 22:41:26 bhammers Exp $
Rem
Rem xdbUtilities.sql
Rem
Rem Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
Rem
Rem Permission is hereby granted, free of charge, to any person obtaining
Rem a copy of this sof... |
insert into movie(id, title, release_date, run_length) values (1, 'The Godfather', '1972-03-24', 175);
insert into movie(id, title, release_date, run_length) values (2, 'Toy Story', '1995-11-22', 81);
insert into movie(id, title, release_date, run_length) values (3, 'Gone With the Wind', '1940-01-17', 238);
insert into... |
INSERT INTO zoo (zooid, zooname)
VALUES (1, "Gladys Porter Zoo"),
(2, "Point Defiance Zoo"),
(3, "San Diego Zoo"),
(4, "San Antonio Zoo"),
(5, "Smithsonian National Zoo");
INSERT INTO telephone(phoneid, phonetype, phonenumber, zooid)
... |
DROP TABLE IF EXISTS followers |
-- MySQL dump 10.13 Distrib 8.0.19, for Linux (x86_64)
--
-- Host: localhost Database: covid_dev
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_Alternate_InOut_2_Aggregation_Details ( IN Record_ID numeric, IN AD_Language Character Varying (6) );
DROP TABLE IF EXISTS de_metas_endcustomer_fresh_reports.Docs_Sales_Alternate_InOut_2_Aggregation_Details;
CREATE TABLE de_metas_endcustomer_fresh_... |
CREATE TABLE emailAddresses (
id TEXT NOT NULL PRIMARY KEY ASC UNIQUE,
insertedAt TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
modifiedAt TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
version INTEGER NOT NULL DEFAULT 0
);
CREATE TABLE emailReports (
id TEXT NOT NULL PRIMARY KEY ASC UNIQUE,
description TEXT NOT NULL... |
USE [VipunenTK]
GO
/****** Object: View [dbo].[v_f_tab_opettajat_7_3] Script Date: 30.1.2020 17:31:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER view [dbo].[v_f_tab_opettajat_7_3] as
Select
[Tilastovuosi] = f.tilastointivuosi
,[Oppilaitoksen opetuskieli] = d1.ope... |
--
-- Dumping data for table `test_data`
--
LOCK TABLES `test_data` WRITE;
/*!40000 ALTER TABLE `test_data` DISABLE KEYS */;
INSERT INTO `test_data` (`id`, `version_id`, `test_data`, `test_data_name`, `copied_from`, `passwords`, `created_date`, `updated_date`) VALUES (21,39,'[{\"name\":\"Los Angeles\",\"description\":\... |
INSERT INTO users VALUES(10000000,'2021-06-09 19:53:50.874076',false,'ownertest@example.com',true,false,'test','test',false,'123','2021-06-09 19:53:50.874076');
INSERT INTO addresses VALUES (10000000, 'test','test','test','test','test','test','test');
INSERT INTO cooperations VALUES (10000000,'test','test','test','2021... |
DROP TABLE IF
EXISTS @cohortDatabaseSchema.@regimenStatsTable;
CREATE table @cohortDatabaseSchema.@regimenStatsTable (
cohort_definition_id int,
person_id bigint,
Line_of_therapy int,
regimen text,
regimen_start_date date,
regimen_e... |
/* Board_Table 생성 */
create table board(
num int not null auto_increment,
id varchar(20)not null,
name varchar(20)not null,
subject varchar(100)not null,
content text not null,
regist_day varchar(30)not null,
hit int,
ip varchar(30),
primary key(num)
)default charset=UTF8;
/* Table 내용 조회 */
select*from board
/* Table ... |
-- begin BEAUTYSHOP_SUB_CATEGORY
alter table BEAUTYSHOP_SUB_CATEGORY add constraint FK_BEAUTYSHOP_SUB_CATEGORY_CATEGORY foreign key (CATEGORY_ID) references BEAUTYSHOP_CATEGORY(ID)^
create index IDX_BEAUTYSHOP_SUB_CATEGORY_CATEGORY on BEAUTYSHOP_SUB_CATEGORY (CATEGORY_ID)^
-- end BEAUTYSHOP_SUB_CATEGORY
-- begin BEAUTY... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.