text stringlengths 1 1.05M |
|---|
-- shared.test
--
-- execsql {
-- SELECT 'test2.db:'||name FROM sqlite_master
-- UNION ALL
-- SELECT 'test.db:'||name FROM test.sqlite_master;
-- }
SELECT 'test2.db:'||name FROM sqlite_master
UNION ALL
SELECT 'test.db:'||name FROM test.sqlite_master; |
DROP TABLE "selfservice_registration_request_methods"; |
-- file:plpgsql.sql ln:88 expect:true
create index HSlot_hubname on HSlot using btree (hubname bpchar_ops)
|
-- drop/create database
DROP DATABASE IF EXISTS employee_tracker;
CREATE DATABASE employee_tracker;
USE employee_tracker;
-- drop tables
DROP TABLE IF EXISTS department;
DROP TABLE IF EXISTS roles;
DROP TABLE IF EXISTS employee;
CREATE TABLE department (
id INTEGER AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(... |
ALTER TABLE stipends RENAME COLUMN summer_guarantee TO summer_typical;
ALTER TABLE stipends ADD COLUMN verified_at timestamptz;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost_UR_dahua
Source Server Version : 50539
Source Host : localhost:3306
Source Database : springbootdb
Target Server Type : MYSQL
Target Server Version : 50539
File Encoding : 65001
Date: 2017-05-21 14:49:55
*/
SET FOREIGN_KEY_C... |
/*
* Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
*
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
*
* BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
*
* License for BK-BASE 蓝鲸基础平台:
* ----------------------------------------------... |
DROP TABLE IF EXISTS `users`;
create table `users` (
`id` int not null auto_increment,
`login` varchar(255) not null unique,
`password` char(60) not null,
PRIMARY KEY (`id`)
);
CREATE TABLE user_info
(
id int PRIMARY KEY AUTO_INCREMENT,
user_id int NOT NULL,
biography varchar(2048) NOT NULL DE... |
-- file:domain.sql ln:48 expect:false
notsoshorttext
\.
COPY basictest (testvarchar) FROM stdin
|
/*
Warnings:
- The primary key for the `Post` table will be changed. If it partially fails, the table could be left without primary key constraint.
- You are about to drop the column `excerpt` on the `Post` table. All the data in the column will be lost.
- Added the required column `commentCount` to the `Post`... |
DROP TABLE IF EXISTS tab ;
CREATE TABLE tab
(
date Date,
key UInt32,
testMap Nested(
k UInt16,
v UInt64)
)
ENGINE = SummingMergeTree(date, (date, key), 1);
INSERT INTO tab SELECT
today(),
number,
[toUInt16(number)],
[number]
FROM system.numbers
LIMIT 8190;
INSERT INTO tab ... |
-- phpMyAdmin SQL Dump
-- version 4.1.6
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 02, 2015 at 11:17 AM
-- Server version: 5.5.36
-- PHP Version: 5.4.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
CREATE TABLE [dbo].[ENCOUNTER] (
[e_id] INT NOT NULL,
[e_lid] INT NULL,
[e_desc] VARCHAR(MAX) NULL,
PRIMARY KEY CLUSTERED ([e_id] ASC),
CONSTRAINT [FK_ENCOUNTER_ToLocation] FOREIGN KEY ([e_lid]) REFERENCES [dbo].[LOCATION] ([l_id])
);
|
use LMPlatform
alter table ScheduleProtectionPracticals
add StartTime time null,
EndTime time null,
Building nvarchar(5) null,
Audience nvarchar(5) null |
SELECT LOWER(Accounts.Name) as UserName
FROM Accounts
LEFT OUTER JOIN OSAccounts
ON Accounts.Id = OSAccounts.AccountBase_id
WHERE Accounts.AccountType != 'Domain'
AND ({whereStmt})
AND OSAccounts.Enabled = {disabled}
GROUP BY UserName
ORDER BY UserName ASC |
select * from sys.sysschemas;
select * from sys.systables;
select * from sys.syscolumns;
--- 소유중인 테이블 목록보기
select a.* from sys.systables a, sys.sysschemas b
where 1=1
and b.schemaname = 'APP'
and a.schemaid = b.schemaid
;
-- 특정 테이블의 컬럼 정보 보기
select
a.tablename
,c.columnname
,c.columndatatype
... |
[sql]
select * from (select sum(v1) as v, sum(v2) from t0) a left semi join (select v1,v2 from t0 order by v3) b on a.v = b.v2;
[result]
RIGHT SEMI JOIN (join-predicate [7: v2 = 4: sum] post-join-predicate [null])
EXCHANGE SHUFFLE[7]
SCAN (columns[7: v2] predicate[null])
EXCHANGE SHUFFLE[4]
AGGR... |
DROP VIEW v_title CASCADE;
CREATE OR REPLACE VIEW v_title AS
SELECT x1 AS att0, x2 AS att1
FROM (
SELECT dra_0.value AS x1, dra_0.individual AS x2
FROM data_role_assertion dra_0
WHERE dra_0.data_role=177
) as innerRel
|
INSERT INTO portti_bundle (name, startup)
VALUES ('parcelinfo','{}');
UPDATE portti_bundle set startup = '{
"title" : "Parcel Info",
"bundleinstancename" : "parcelinfo",
"fi" : "Paikan info",
"sv" : "parcelinfo",
"en" : "parcelinfo",
"bundlename" : "parcelinfo"... |
-- --------------------------------------------------------
-- Host: localhost
-- Versión del servidor: 5.7.24 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 10.2.0.5599
-- --------------------------------------------------------
/... |
{% if target.type == 'bigquery' or target.type == 'snowflake' or target.type == 'redshift' %}
{% if var("product_warehouse_event_sources") %}
{% if 'segment_events_order_checkout' in var("product_warehouse_event_sources") %}
with source as (
select * from {{ source('segment', 'order_checkout') }}
),
renamed as... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 09, 2020 at 03:18 PM
-- Server version: 5.7.29-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Creato il: Gen 13, 2022 alle 11:28
-- Versione del server: 10.1.38-MariaDB
-- Versione PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
-- Exported from QuickDBD: https://www.quickdatabasediagrams.com/
-- Link to schema: https://app.quickdatabasediagrams.com/#/d/aXfzt9
-- NOTE! If you have used non-SQL datatypes in your design, you will have to change these here.
CREATE TABLE "departments" (
"dept_no" varchar NOT NULL,
"dept_name" varchar ... |
--
-- JBoss, Home of Professional Open Source.
-- Copyright 2014-2019 Red Hat, Inc., and individual contributors
-- as indicated by the @author tags.
--
-- 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 ... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 14 Jul 2021 pada 22.40
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
select
'UNDOSTAT' CNAME, to_char(systimestamp, 'yyyy-mm-dd"T"hh24:mi:ss.ff') CTIMESTAMP,
v$undostat.*
from
v$undostat
/
|
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2018-05-03 02:12:01
-- 服务器版本: 5.7.14-log
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... |
DROP TABLE IF NOT EXISTS latest_resources;
|
/****** Script for SelectTopNRows command from SSMS ******/
select * from HR.Employees
select * from Sales.Orders
select * from Sales.Customers
select * from Production.Products
select orderid, orderdate, custid, empid
from Sales.Orders
where EXISTS
(select MAX(orderdate)
from Sales.Orders)
select empid, Firstnam... |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... |
INSERT INTO [dbo].[Kooboo_CMS_Account_Users]
([Email]
,[UserName]
,[Password]
,[IsAdministrator]
,[UICulture]
,[PasswordSalt]
,[IsApproved]
,[IsLockedOut]
,[FailedPasswordAttemptCount]
,[UtcLastLockoutDate]
... |
/* Create the database */
CREATE DATABASE IF NOT EXISTS metro_bank;
/* Create Manager Model */
CREATE TABLE IF NOT EXISTS metro_bank.manager (
manager_id integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
manager_fname varchar(75) NOT NULL,
manager_lname varchar(75) NOT NULL,
manager_phone varchar(75) NOT NULL,
... |
SET IDENTITY_INSERT [dbo].[Employer] ON
DECLARE @employerId1 INT = 50000001
DECLARE @employerId2 INT = 50000002
DECLARE @edsurn1 INT = 21000002
DECLARE @edsurn2 INT = 21000003
MERGE INTO [dbo].[Employer] AS TARGET
USING (VALUES (
@employerId1, -- EmployerId
1, -- EmployerStatusTypeId: Activated
@edsurn1, -- Eds... |
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Aug 14, 2017 at 09:45 AM
-- Server version: 5.6.35
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... |
DROP TABLE IF EXISTS admin1_crosswalk_raw;
CREATE TABLE admin1_crosswalk_raw (
featurecla text,
scalerank text,
adm1_code text,
diss_me text,
iso_3166_2 text,
wikipedia text,
iso_a2 text,
adm0_sr text,
"name" text,
name_alt text,
name_local text,
"type" text,
type_en text,
code_local text,
code_hasc text,
note text,
ha... |
CREATE SEQUENCE imdb_ratings_id_seq;
CREATE TABLE IF NOT EXISTS imdb_ratings (
index INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('imdb_ratings_id_seq'::regclass),
show text NOT NULL UNIQUE,
title text,
link text,
rating double precision,
istv bool,
source text,
last_modified timestamp ... |
--
-- Copyright 2019 The Android Open Source Project
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- https://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applica... |
/* the Postgresql schema used by the Mina archive database */
/* there are a number of values represented by a Postgresql bigint here, which is a 64-bit signed value,
while in OCaml, the value is represented by a 64-bit unsigned value, so that overflow is
possible
while overflow is unlikely, because a bigint... |
/*
SQLyog Community v12.14 (64 bit)
MySQL - 5.6.26-log : Database - barle
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIG... |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 30, 2020 at 10:18 AM
-- Server version: 5.7.28-cll-lve
-- PHP Version: 7.3.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
DROP TABLE IF EXISTS `channel_list`;
CREATE TABLE `channel_list` (
`id` bigint(20) NOT NULL,
`channel_name` varchar(100) DEFAULT NULL COMMENT '渠道名称',
`channel_app_id` varchar(100) DEFAULT NULL COMMENT '渠道APPID',
`channel_app_secret` varchar(500) DEFAULT NULL COMMENT '渠道APPsecret',
`create_time` timestamp NOT... |
CREATE TABLE crew_member (
id SERIAL PRIMARY KEY,
full_name VARCHAR(100) NOT NULL,
date_of_birth TIMESTAMP
);
CREATE TABLE aircraft (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL
);
CREATE TABLE aircraft_crew (
id SERIAL PRIMARY KEY,
aircraft... |
-- Create a new carbon cap scenario 91 that updates the carbon cap for WECC and CA. The WECC cap is 80% of 1990 emissions by 2045 and subtracting out the cap for CA. The CA cap uses historical 2010 to 2018 actual emissions, and then reaches 0 by 2045 to meet SB100 goals
-- Text of the SB100 bill is here: https://leginf... |
-- cast.test
--
-- execsql {SELECT CAST(123.456 AS blob)}
SELECT CAST(123.456 AS blob) |
SELECT DISTINCT "testView"."in1","testView"."in2","testView"."name","testView"."out3" FROM "testView" WHERE ("testView"."type" = http://data.dydra.com/testView)
|
DROP TABLE IF EXISTS book_table;
CREATE TABLE book_table (
id SERIAL PRIMARY KEY,
title VARCHAR(255),
authors VARCHAR(255),
image_url VARCHAR(255),
descript TEXT,
bookshelf VARCHAR(255)
);
|
insert into sline_visa_city values('1','成都','1','1');
insert into sline_visa_city values('6','上海','2','1');
insert into sline_visa_city values('16','广州','9999','1');
|
SELECT 'Upgrading MetaStore schema from 3.2.0 to 4.0.0';
-- HIVE-19416
ALTER TABLE "TBLS" ADD "WRITE_ID" bigint;
ALTER TABLE "PARTITIONS" ADD "WRITE_ID" bigint;
-- These lines need to be last. Insert any changes above.
UPDATE "VERSION" SET "SCHEMA_VERSION"='4.0.0', "VERSION_COMMENT"='Hive release version 4.0.0' wher... |
-- vtab1.test
--
-- execsql {
-- SELECT name FROM sqlite_master ORDER BY 1
-- }
SELECT name FROM sqlite_master ORDER BY 1 |
ALTER TABLE "public"."installed_app_versions" ADD COLUMN "values_yaml" text; |
-- file:type_sanity.sql ln:406 expect:true
SELECT p1.rngtypid, p1.rngsubtype, o.opcmethod, o.opcname
FROM pg_range p1 JOIN pg_opclass o ON o.oid = p1.rngsubopc
WHERE o.opcmethod != 403 OR
((o.opcintype != p1.rngsubtype) AND NOT
(o.opcintype = 'pg_catalog.anyarray'::regtype AND
EXISTS(select 1 from pg_cat... |
CREATE TABLE IF NOT EXISTS poll_vote (
id SERIAL NOT NULL,
user_id SERIAL NOT NULL,
poll_id SERIAL NOT NULL,
poll_option_id SERIAL NOT NULL,
vote_time TIMESTAMP NOT NULL DEFAULT NOW(),
PRIMARY KEY (id),
CONSTRAINT fk_poll_vote_user
... |
-- 2019-04-09T13:46:04.058
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceO... |
# The archive snapshots used, in order:
# https://web.archive.org/web/20141129225218/https://centreforeffectivealtruism.org/team/
# https://web.archive.org/web/20160210140239/https://www.centreforeffectivealtruism.org/team/
# https://web.archive.org/web/20160627023803/https://www.centreforeffectivealtruism.org/team/
# ... |
CREATE TABLE [dbo].[Nota] (
[Alumno] VARCHAR (9) NOT NULL,
[CursoCod] VARCHAR (10) NOT NULL,
[CursoNombre] VARCHAR (50) NOT NULL,
[CodAsignatura] VARCHAR (9) NOT NULL,
[ConvocatoriaNum] INT NOT NULL,
[EvaluacionNum] INT NOT NULL,
[Valoracion... |
SELECT
c1.concept_id AS "conceptId",
c1.concept_name AS "conceptName",
num.stratum_2 AS "xCalendarMonth",
-- calendar year, note, there could be blanks
round(1000 * (1.0 *... |
-- All TAS values in File B (object class program activity) should exist in File A (appropriation)
SELECT op.row_number AS "source_row_number",
op.allocation_transfer_agency AS "source_value_allocation_transfer_agency",
op.agency_identifier AS "source_value_agency_identifier",
op.beginning_period_of_availa ... |
DROP TABLE `hackathon_participant`;
DROP TABLE `hackathon`; |
INSERT INTO eg_role(id,name,description,createddate,createdby,lastmodifiedby,lastmodifieddate,version,internal) VALUES (nextval('seq_eg_role'),'COLLECTION_APPROVER','Approver role for counter collection workflow', now(), (SELECT id FROM eg_user WHERE lower(username)='system'), (SELECT id FROM eg_user WHERE lower(userna... |
DROP SCHEMA online_store;
CREATE SCHEMA online_store;
USE online_store;
CREATE TABLE `brands` (
id INT PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(40) NOT NULL UNIQUE
);
CREATE TABLE `categories` (
id INT PRIMARY KEY AUTO_INCREMENT,
`name` VARCHAR(40) NOT NULL UNIQUE
);
CREATE TABLE `reviews` (
id INT PRIMA... |
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 10, 2017 at 09:43 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_C... |
{{
config(
sort='inferred_user_id',
dist='inferred_user_id',
unique_key='inferred_user_id'
)
}}
with purchases as (
select * from {{ var('snowplow:purchases') }}
),
event_to_user_map as (
select * from {{ ref('snowplow_event_to_user_map') }}
),
purchases_with_user_id as (
... |
CREATE DATABASE IF NOT EXISTS `beosbank-africa` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_bin */;
USE `beosbank-africa`;
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: 127.0.0.1 Database: beosbank-africa
-- ------------------------------------------------------
-- Server version 5.7... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 07, 2020 at 02:36 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
position post_id post_by post_text post_published comment_id comment_by is_reply comment_message comment_published comment_like_count
5_0 946969685378921_1132325063510048 a47ed49e2f4b4976b6552fe51d8d3b1c0998ba1a La Rete dei Si a Palestrina 2016-11-16T18:25:15+0000 1132325063510048_1132486263493928 e2420c1914fd3e92f445d... |
SELECT SUM(x.POPULATION) as totalP
FROM CITY x
INNER JOIN COUNTRY y ON x.COUNTRYCODE = y.code
WHERE y.CONTINENT = 'Asia' |
CREATE TABLE UTENTE_SEMPLICE (
EMAILS VARCHAR(30) PRIMARY KEY REFERENCES UTENTE(EMAIL) ON UPDATE CASCADE ON DELETE CASCADE
) ENGINE=INNODB; |
/* --- */
/* DDL */
/* --- */
/* ------------------ */
/* Def. base de datos */
/* ------------------ */
CREATE TABLE Roles(
id int PRIMARY KEY NOT NULL UNSIGNED AUTO_INCREMENT,
tipo varchar(20) NOT NULL DEFAULT 'ROLE_USER', -- ROLE_ADMIN, ROLE_USER
estado tinyint NOT NULL DEFAULT 1,
created timestamp DEFAULT ... |
-- #Table: Activity
-- #
-- #
-- #+--------------+---------+
-- #| Column Name | Type |
-- #+--------------+---------+
-- #| player_id | int |
-- #| device_id | int |
-- #| event_date | date |
-- #| games_played | int |
-- #+--------------+---------+
-- #(player_id, event_date) is the primar... |
-- 2018-11-05T15:04:43.978
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_JavaClass_Type SET Classname='org.adempiere.mm.attributes.spi.IAttributeValueHandler', InternalName='org.adempiere.mm.attributes.spi.IAttributeValueHandler', Name='Attribute Value Handler',Updated=TO_TIMESTAMP('2018-1... |
/*==============================================================*/
/* DBMS name: Microsoft SQL Server 2012 */
/* Created on: 1/13/2019 7:32:28 PM */
/*==============================================================*/
CREATE DATABASE Proceed
go
USE Proceed
go
/*=====... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 01-Mar-2016 às 22:39
-- Versão do servidor: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
/* name: GetUsers :many */
SELECT *
FROM users_func()
WHERE first_name != '';
|
CREATE TABLE captains_log (
id SERIAL PRIMARY KEY,
title VARCHAR(255) NOT NULL,
article TEXT NOT NULL
)
CREATE TABLE users (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
username VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL
);
CREATE TABLE "session" (
"sid" varchar NOT NULL COLLATE "def... |
-- @testpoint:文本搜索配置token_type测试
--创建文本搜索配置,解析器为默认pg_catalog.default
DROP TEXT SEARCH CONFIGURATION if exists english2 cascade;
CREATE TEXT SEARCH CONFIGURATION english2 (parser=default);
--创建simple字典
DROP TEXT SEARCH DICTIONARY IF EXISTS pg_dict cascade;
CREATE TEXT SEARCH DICTIONARY pg_dict (TEMPLATE = Simple);
--增加... |
WITH MainGuy AS (
SELECT id as character_id FROM starwars.characters WHERE name = 'Princess Leia'
)
DELETE FROM starwars.episode_appearance WHERE character_id = (SELECT character_id FROM MainGuy)
|
-- get all rows with a higher sales total than the item "grey hoodie"
SELECT items.id, items.name, items.price * COUNT(*) AS "sales total"
FROM items
JOIN sales_records
ON items.id = sales_records.item_id
GROUP BY items.id, items.name, items.price
HAVING (items.price * COUNT(*)) > (
SELECT items.price * COUNT(*)
FR... |
INSERT INTO "nodes" ("node") VALUES ('/users/subscribed@server1/posts');
INSERT INTO "nodes" ("node") VALUES ('/users/pending@server1/posts');
INSERT INTO "subscriptions" ("node", "user", "listener", "subscription", "updated")
VALUES ('/users/subscribed@server1/posts', 'user1@server1', 'user1@server1', 'subscribe... |
USE soft_uni;
SELECT first_name, last_name, job_title
FROM employees
WHERE salary BETWEEN 20000 AND 30000;
/*WHERE salary >= 20000 AND salary <= 30000; */ |
-- original: boundary3.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real)
WHERE t2.a=47
ORDER BY t1.rowid
;SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real)
WHERE t2.a=47
ORDER BY t1.rowid DESC
;SELECT t1.* F... |
SELECT track_id, track_name, track_details, track_band_id, track_tempo, track_duration, track_link, track_release_date,
band.band_name AS trackBandName
FROM track LEFT JOIN band ON track.track_band_id = band.band_id
WHERE track_band_id = :bandId |
with table_row_counts as (
select distinct count(*) as row_count, 2 as expected_count
from {{ source('test_normalization', '_airbyte_raw_nested_stream_with_complex_columns_resulting_into_long_names') }}
union all
select distinct count(*) as row_count, 2 as expected_count
from {{ ref('nested_stream_with_... |
-- TOP N
-- The TOP operator is applied
--
-- TOP now accepts a variable
DECLARE @rowCount int;
SET @rowCount = 3;
SELECT TOP(@rowCount)
DB.*
FROM
sys.databases DB;
|
CREATE TABLE migrations (
id integer PRIMARY KEY,
name varchar(255),
applied timestamp with time zone DEFAULT current_timestamp
);
|
SELECT name FROM sys.check_constraints
WHERE is_system_named = 1 AND type = 'C'
ORDER BY name
|
-- MUST BE RUN AFTER labels.sql
-- creates a materialized view diagnoses which looks like this:
/*
patientunitstayid | diagnosisstring
-------------------+---------------------------------------------------------------------------------------------------------... |
-- Copyright 2021 The Go Authors. All rights reserved.
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file.
BEGIN;
ALTER TABLE search_documents RENAME path_id TO package_path_id;
ALTER TABLE search_documents ADD COLUMN module_path_id INTEGER;
END;
|
DROP DATABASE IF EXISTS perishable_inventory_tracker;
CREATE DATABASE perishable_inventory_tracker; |
CREATE TABLE departments (
dept_no VARCHAR(4) NOT NULL,
dept_name VARCHAR(40) NOT NULL,
PRIMARY KEY (dept_no),
UNIQUE (dept_name)
);
SELECT * FROM departments;
CREATE TABLE employees (
emp_no INT NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR NOT NULL,
last_name VARCHAR NO... |
-- --------------------------------------------------------
--
-- Дамп данных таблицы `data_types`
--
INSERT INTO `data_types` (`name`, `slug`, `display_name_singular`, `display_name_plural`, `icon`, `model_name`, `policy_name`, `controller`, `description`, `generate_permissions`, `server_side`, `details`, `created_a... |
INSERT INTO cities ( 'name', 'latCity', 'longCity') VALUES ( 'Абаза', '52.6517296', '90.0885929'), ( 'Абакан', '53.7223661', '91.4437792'), ( 'Абдулино', '53.6778096', '53.6473115'), ( 'Абинск', '44.8679931', '38.1618437'), ( 'Агидель', '55.89976', '53.9221149'), ( 'Агрыз', '56.5232645', '52.994257'), ( 'Адыгейск', '4... |
/****** Object: StoredProcedure [dbo].[AlterEventLogEntryUser] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE dbo.AlterEventLogEntryUser
/****************************************************
**
** Desc: Updates the user associated with a given event log entry to be @NewUser
**
** ... |
CREATE TABLE ' . $name . ' (id int(11) AUTO_INCREMENT, bool tinyint(1), small_int tinyint(2), primary key(id), KEY `pointless_bool` ( `bool` ))
SELECT color, name FROM ' . $this->Dbo->fullTableName('apples') . ' ORDER BY id');
CREATE TABLE test_list (id VARCHAR(255))
SELECT * FROM ? WHERE ? = ? AND ? = ?';
CREATE TABLE... |
/* leave this
l:see LICENSE file
g:utility
v:131123\s.zaglio: adapted to new fn__script_sign
v:130923\s.zaglio: added help of fn__Script_sign
v:130730,130729\s.zaglio: test fn__script_sign
t:select dbo.fn__script_sign('fn__script_info_tags',null) -- 105529698.0000
t:select dbo.fn__script... |
## 查找会话
#macro($zyFindSession(userId,customerId))
SELECT * FROM yoomath_customer_service_session
WHERE user_id = :userId AND customer_service_id = :customerId
#end |
delete
from party_contact_mech_purpose;
delete
from shipment_item_delivery_plan;
delete
from delivery_trip_detail;
delete
from delivery_trip;
delete
from order_item;
delete
from shipment_item;
delete
from shipment;
delete
from product;
delete
from vehicle_location_priority;
delete
from facility;
delete
from p... |
:on error exit
use master;
go
if @@trancount > 0
rollback
go
if db_id('target') is not null
begin
alter database [target] set single_user with rollback immediate;
drop database [target];
end
go
create database [target];
go
use [target];
go
create queue [q];
go
create service [target_service] on queue [q] ([DEF... |
select STRAIGHT_JOIN * from table; |
DROP TABLE TASKANA_SCHEMA_VERSION;
DROP TABLE ATTACHMENT;
DROP TABLE TASK;
DROP TABLE WORKBASKET_ACCESS_LIST;
DROP TABLE WORKBASKET;
DROP TABLE DISTRIBUTION_TARGETS;
DROP TABLE CLASSIFICATION;
DROP TABLE OBJECT_REFERENCE;
DROP TABLE SCHEDULED_JOB;
DROP SEQUENCE SCHEDULED_JOB_SEQ;
COMMIT;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.