text stringlengths 1 1.05M |
|---|
-- This DDL (SQL) script initializes a database for the XBRL Abstract Model using Postgres
-- (c) Copyright 2013 Mark V Systems Limited, California US, All rights reserved.
-- Mark V copyright applies to this software, which is licensed according to the terms of Arelle(r).
SET statement_timeout = 0;
SET client_enc... |
-- Copyright 2018 Tanel Poder. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
SET LINES 999 PAGES 5000 TRIMSPOOL ON TRIMOUT ON VERIFY OFF
COL sql_plan_step FOR A50 WORD_WRAP
SELECT * FROM (
SELECT
a.session... |
SET SQL_MODE = '';
USE clinical_merge_v5_240919;
SET @start_of_covid_in_nyc = '2020-03-10';
SET @outcome_date = '2020-08-01';
-- Cleaned blood types table
DROP TABLE IF EXISTS user_mnz2108.abo_types;
CREATE TABLE user_mnz2108.abo_types AS
SELECT DISTINCT pat_mrn_id,
CASE
WHEN... |
WITH fachbereich AS (
SELECT
string_agg(geotope_fachbereich.fachbereichsname, ', ' ORDER BY fachbereichsname ASC) AS fachbereiche,
geotope_quelle.t_id
FROM
afu_geotope.geotope_quelle_fachbereich
LEFT JOIN afu_geotope.geotope_quelle
ON geotope_quelle.t_id = geotope_qu... |
SELECT tU.user_id as col0,
tU.user_name as "Username",
tU.full_name as "Full Name",
tU.email as "Email",
tU.department as "Department",
tU.office as "Office",
tU.card_number as "Primary Card Number",
tU.notes as "Notes",
tU.total_pages as "Total Printed Pages",
tU.total_jobs as "Jobs",
tU... |
--[er]test ceil function without any operand
select ceil() from db_root order by 1; |
use payroll
execute p_add_time_entry @employee_id=36, @entry_date='2018-01-26 00:00:00', @hours_worked=4
execute p_add_time_entry @employee_id=50, @entry_date='2018-01-26 00:00:00', @hours_worked=5
execute p_add_time_entry @employee_id=12, @entry_date='2018-01-26 00:00:00', @hours_worked=5
execute p_add_time_entry @e... |
alter table IMPORTDATA_IMPORT_LOG add constraint FK_IMPORTDATA_IMPORT_LOG_FILE foreign key (FILE_ID) references SYS_FILE(ID);
create index IDX_IMPORTDATA_IMPORT_LOG_FILE on IMPORTDATA_IMPORT_LOG (FILE_ID);
|
SET NAMES utf8;
DROP TABLE IF EXISTS `sphinx`.`sphinxtest`;
CREATE TABLE `sphinx`.`sphinxtest` (
`id` BIGINT UNSIGNED NOT NULL auto_increment,
`field1` TEXT,
`field2` TEXT,
`attr1` INT NOT NULL,
`lat` FLOAT NOT NULL,
`long` FLOAT NOT NULL,
`stringattr` VARCHAR(100),
PRIMARY KEY (`id`)) DEFAULT CHARSET=utf... |
CREATE EXTENSION IF NOT EXISTS anon CASCADE;
-- TEST 1 : partial
SELECT anon.partial('abcdefgh',1,'xxxxxx',1) = 'axxxxxxh';
SELECT anon.partial(NULL,1,'xxxxxx',1) IS NULL;
SELECT anon.partial('1234567890',3,'*',3) = '123*890';
SELECT anon.partial('dnfjdnvljdnvjsdn',1,'ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ',0) = ... |
--
-- Database: 'webixdocs'
--
-- --------------------------------------------------------
--
-- Table structure for table 'films'
--
DROP TABLE IF EXISTS films;
CREATE TABLE IF NOT EXISTS films (
id int(11) NOT NULL AUTO_INCREMENT,
title varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
`year` varchar(255) COLLAT... |
--
-- @lc app=leetcode.cn id=176 lang=mysql
--
-- [176] 第二高的薪水
--
-- @lc code=start
# Write your MySQL query statement below
SELECT
(SELECT DISTINCT
Salary
FROM
Employee
ORDER BY Salary DESC
LIMIT 1 OFFSET 1) AS SecondHighestSalary
;
-- @lc code=end
... |
ALTER TABLE `blocks` ADD UNIQUE (`blockchain_id`, `block_hash`);
ALTER TABLE `address_keys` CHANGE `save_method` `save_method` ENUM('db','wallet.dat','fake') CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT 'db';
ALTER TABLE `blockchains` ADD `creator_id` INT NULL DEFAULT NULL AFTER `blockchain_id`;
ALTE... |
DROP TABLE IF EXISTS dependent;
DROP TABLE IF EXISTS employee;
CREATE TABLE IF NOT EXISTS employee(id int PRIMARY KEY ,name varchar(20),experience double);
CREATE TABLE IF NOT EXISTS dependent(emp_id int ,name varchar(20),relation varchar(20),age int , FOREIGN KEY(emp_id) REFERENCES employee(id));
|
CREATE TABLE "CF_LOG"
( "LOG_ID" NUMBER NOT NULL ENABLE,
"USERNAME" VARCHAR2(255 CHAR),
"TEMPLATE" VARCHAR2(255 CHAR),
"ACCESS_DATE" DATE,
"QUERY_STRING" VARCHAR2(4000 CHAR),
"REPORTED_COUNT" NUMBER,
"REFERRING_URL" VARCHAR2(4000 CHAR)
) |
library OpioidCDS_REC_03 version '0.1.0'
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0' called FHIRHelpers
include OpioidCDS_Common version '0.1.0' called Common
include OpioidCDS_Common_Config version '0.1.0' called Config
include OpioidCDS_OpioidReviewUseful version '0.1.0' called OpioidReviewUseful... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50505
Source Host : localhost:3306
Source Database : db_master
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2018-02-07 22:49:30
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
INSERT IGNORE INTO detailCount (date, province_name, current_confirmed_count, confirmed_count, dead_count, cured_count) VALUES
('2022-05-08', '台湾', 342622, 357271, 907, 13742),
('2022-05-08', '香港', 261404, 331231, 9344, 60483),
('2022-05-08', '上海市', 6564, 60585, 543, 53478),
('2022-05-08', '浙江省', 720, 3127, 1, 2406),
(... |
CREATE USER 'akm'@'%' IDENTIFIED BY '50%_fuzzy_MySQL';
GRANT ALL PRIVILEGES ON *.* TO 'akm'@'%';
CREATE DATABASE akm_travlendar;
GRANT ALL PRIVILEGES ON akm_travlendar.* TO 'akm'@'%';
|
CREATE OR REPLACE PROCEDURE greet2(names IN VARCHAR2 )
IS
BEGIN
dbms_output.put_line('how are you, ' || names || '?');
END;
/
CREATE OR REPLACE PROCEDURE bye
IS
BEGIN
dbms_output.put_line('ok bye!');
END;
/
CREATE OR REPLACE PROCEDURE greet(names IN VARCHAR2)
IS
BEGIN
dbms_output.put_line('hello, ' |... |
DELETE FROM `sys_objects_actions` WHERE `Type` = 'bx_sounds' AND `Caption` = '{downloadCpt}';
INSERT INTO `sys_objects_actions` (`Type`, `Caption`, `Icon`, `Url`, `Script`, `Eval`, `Order`) VALUES
('bx_sounds', '{downloadCpt}', 'download-alt', '{moduleUrl}get_file/{ID}', '', '', 8);
UPDATE `sys_objects_actions` SET ... |
\set ON_ERROR_STOP 1
BEGIN;
DROP TABLE recording_puid;
DROP TABLE puid;
DROP TABLE clientversion;
COMMIT;
|
CREATE PROCEDURE [dbo].[dnn_GetContentWorkflowUsage]
@WorkflowId INT,
@PageIndex INT,
@PageSize INT
AS
DECLARE @StartIndex INT = ((@PageIndex - 1) * @PageSize) + 1
DECLARE @EndIndex INT = (@PageIndex * @PageSize)
;WITH ContenResourcesSet AS
(
SELECT wu.*, ROW_NUMBER() OVER (Order BY wu.ContentType, wu.Co... |
DROP TABLE labels;
DROP TABLE task_labels;
DROP TABLE todo_labels; |
CREATE TABLE country (id VARCHAR(2) NOT NULL, name VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "country" ("id", "name") VALUES ('UG', 'אוגנדה');
INSERT INTO "country" ("id", "name") VALUES ('UZ', 'אוזבקיסטן');
INSERT INTO "country" ("id", "name") VALUES ('AT', 'אוסטריה');
INSERT INTO "country" ("id", "name") V... |
/*********
CONCEPT LEVEL check:
PLAUSIBLE_VALUE_LOW - find any MEASUREMENT records that have VALUE_AS_NUMBER with non-null value < plausible low value
Parameters used in this template:
cdmDatabaseSchema = @cdmDatabaseSchema
cdmTableName = @cdmTableName
cdmFieldName = @cdmFieldName
conceptId = @conceptId
unitConceptId ... |
CREATE DATABASE 2rh;
USE 2rh;
SET GLOBAL event_scheduler = ON;
DELIMITER ||
CREATE TABLE User (
id INT UNSIGNED AUTO_INCREMENT, -- [0, 42 9496 7295]
username VARCHAR(20) NOT NULL,
email VARCHAR(30) NOT NULL,
token CHAR(64) NOT NULL,
salt CHAR(16) ... |
-- @testpoint:openGauss关键字Isnull(非保留),作为列名带双引号,使用时不带,插入成功
drop table if exists explain_test;
create table explain_test(
c_id int, c_int int, c_integer integer, c_bool int, c_boolean int, c_bigint integer,
c_real real, c_double real,
c_decimal decimal(38), c_number number(38), c_numeric numeric(38),
c_char char... |
def Main = Choose1 { x = Match1 'a'; y = Match1 'a' }
|
BEGIN;
-- delete invalid users
DELETE FROM `user` where sex is NULL or account_active is NULL;
-- sqlite doesn't support delete left join
-- delete comments without existing user
DELETE FROM comment WHERE id in
(SELECT t1.id FROM comment t1
LEFT JOIN complaint t2 ON t1.complaint_id = t2.id
WHERE t2.id IS NULL);
--... |
#standardSQL
# 13_09e: Requests and weight of all content on ecom pages by type
SELECT
percentile,
client,
type,
APPROX_QUANTILES(requests, 1000)[OFFSET(percentile * 10)] AS requests,
ROUND(APPROX_QUANTILES(bytes, 1000)[OFFSET(percentile * 10)] / 1024, 2) AS kbytes
FROM (
SELECT
client,
type,
CO... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 30, 2017 at 11:51 AM
-- Server version: 10.1.21-MariaDB
-- 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_SE... |
create table if not exists achievement_type
(
id bigint auto_increment comment '自增主键'
primary key,
type_name varchar(50) default '' null comment '荣誉类型,比如论文,专利等'
)
comment '荣誉类型';
create table if not exists article
(
id bigint auto_increment comment '自增主键'
primary key,
... |
INSERT INTO `stamp_sub_rela` VALUES (NULL, 1, 40, '工艺品');
INSERT INTO `stamp_sub_rela` VALUES (NULL, 1, 24, '陶瓷玻璃');
INSERT INTO `stamp_sub_rela` VALUES (NULL, 2, 28, '花卉');
INSERT INTO `stamp_sub_rela` VALUES (NULL, 3, 13, '其他人物');
INSERT INTO `stamp_sub_rela` VALUES (NULL, 4, 25, '飞机');
INSERT INTO `stamp_sub_rela` V... |
SELECT acc.location, count(*)
FROM
site as s,
so_user as u1,
question as q1,
answer as a1,
tag as t1,
tag_question as tq1,
badge as b,
account as acc
WHERE
s.site_id = q1.site_id
AND s.site_id = u1.site_id
AND s.site_id = a1.site_id
AND s.site_id = t1.site_id
AND s.site_id = tq1.site_id
AND s.site_id = b.site_id
AND q1... |
INSERT INTO users
VALUES (1,'Cody','Borer','thackett@example.net',79245225558,'4e08c409d21b7f231b5ebfcd754a44781330ce1a'),
(2,'Waylon','Schmeler','bauer@example.org',79473108801,'cdc1a89c44ec8558f088a993a0f8bad89074c583'),
(3,'Tatyana','Blick','qmertz@example.com',79460406501,'ee7d593ea9954f90... |
-- @testpoint:数据类型转换 CLOB 转换为 VARCHAR2
drop table if exists FVT_PROC_SCALAR_TYPE_table_002;
CREATE TABLE FVT_PROC_SCALAR_TYPE_table_002(
T1 INT,
T2 INTEGER NOT NULL,
T3 INT,
T4 NUMBER DEFAULT 0.2332,
T5 NUMBER(12,2),
T6 NUMBER(12,6),
T7 BINARY_DOUBLE,
T8 DECIMAL,
T9 DECIMAL(8,2),
T10 DECIMAL(8,4),
... |
CREATE VIEW [Product].[Summaries]
AS
SELECT P.[ProductId], P.[Name], P.[Description], P.[Price], AVG(CAST(R.[Rating] as decimal(3,2))) AS Rating
FROM [Product].[Details] P
LEFT JOIN [Product].[Reviews] R ON P.[ProductId] = R.[ProductId]
GROUP BY P.[ProductId], P.[Name], P.[Description], P.[Price] |
WITH sq AS (
SELECT
patient_id,
REPLACE(dia_ppal, '.', '') AS dia_ppal
FROM
covidhm_dsl_v3.diagnosis_hosp_adm ),
destin_discharge AS (
SELECT
patient_id,
-- We are translating discharge destinations
CASE WHEN destin_discharge = 'Domicilio' THEN 'Home'
WHEN destin_discharge = 'Fallecimiento' THEN 'Expired'
... |
DROP TABLE IF EXISTS books;
CREATE TABLE books (
ID SERIAL PRIMARY KEY,
author VARCHAR(100),
title VARCHAR(255),
isbn VARCHAR(100),
image_url VARCHAR(255),
description TEXT
);
|
ALTER TABLE github_users
ALTER COLUMN access_token DROP NOT NULL;
|
-- TRUNCATE message_transport_types;
INSERT INTO message_transport_types
(message_transport_type)
values
('email'),
('print'),
('sms'),
('phone');
|
SELECT CAST("Medicare2_2"."npi" AS SIGNED) AS "npi", "Medicare2_2"."nppes_credentials" AS "nppes_credentials", "Medicare2_2"."nppes_provider_city" AS "nppes_provider_city", "Medicare2_2"."nppes_provider_first_name" AS "nppes_provider_first_name", "Medicare2_2"."nppes_provider_last_org_name" AS "nppes_provider_l... |
CREATE TABLE IF NOT EXISTS `ftn_reg_tipo_usuario` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identificador único',
`Nombre` varchar(50) DEFAULT "" COMMENT 'Nombre del usuario',
`Descripcion` varchar(255) DEFAULT "" COMMENT 'Descripción corta del tipo de usuario',
`IdActivo` BOOL DEFAULT true ... |
SELECT owner AS Schema, object_type AS Type, status AS Status, count(*) AS Count FROM dba_objects WHERE status != 'VALID' GROUP BY owner, object_type, status ORDER BY owner, object_type, status |
#standardSQL
CREATE TEMPORARY FUNCTION getColorFunctions(css STRING)
RETURNS ARRAY<STRING> LANGUAGE js AS '''
try {
function compute(ast) {
let usage = {
hex: {
"3": 0, "4": 0,
"6": 0, "8": 0
},
functions: {},
keywords: {},
system: {},
currentcolor: 0,
tra... |
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : CaretClassifier_svmPoly_pca
-- Dataset : BinaryClass_100
-- Database : mssql
-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
-- Model deployment code
WITH [... |
insert into event_map(event_up_name, event_down_name) values('DWH_STOPPED', 'DWH_STARTED');
insert into event_map(event_up_name, event_down_name) values('DWH_ERROR', 'UNASSIGNED');
|
COMMENT ON DATABASE comments IS 'comments database';
COMMENT ON SCHEMA public IS 'public schema';
CREATE OR REPLACE PROCEDURAL LANGUAGE plpgsql;
ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;
SET search_path = public, pg_catalog;
CREATE FUNCTION test_fnc(arg character varying) RETURNS boolean
LANGUAGE ... |
INSERT INTO `guns`.`sys_menu` (`id`, `code`, `pcode`, `pcodes`, `name`, `icon`, `url`, `num`, `levels`, `ismenu`, `tips`, `status`, `isopen`) VALUES ('983193645928677378', 'dishMenu', '0', '[0],', '评价管理', '', '/dishMenu', '99', '1', '1', NULL, '1', '0');
INSERT INTO `guns`.`sys_menu` (`id`, `code`, `pcode`, `pcodes`, `... |
INSERT INTO wager (
id,
betId,
userId,
choice,
amount,
createdTimestamp,
deleted
) VALUES (
1,
1,
'216381744641736704',
'Autoattacks',
50,
1569256127,
0
);
INSERT INTO wager (
id,
betId,
userId,
choice,
amount,
createdTimestamp,
deleted
) VALUES (
2,
1,
'265697283792830465',
'Matieu',
300,
1569256895,
0
);
INSERT I... |
CREATE TABLE [dbo].[sqlwatch_config_check]
(
[check_id] bigint identity (1,1) not null,
[check_name] nvarchar(255) not null,
[check_description] nvarchar(2048) null,
[check_query] nvarchar(max) not null, --the sql query to execute to check for value, the return should be a one row one value which will be compared ... |
/* ****************************************************
SQL Server Samples
(C) 2008 - 2021 Pavel Pawlowski
Feedback: mailto:pavel.pawlowski@hotmail.cz
Description:
Samples of Day of week calculations
**************************************************** */
/* Selecting First Day of a Week based on date */
DECLAR... |
DROP DATABASE IF EXISTS employee_trackerDB;
CREATE database employee_trackerDB;
USE employee_trackerDB;
CREATE TABLE department (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30) UNIQUE NOT NULL
);
CREATE TABLE title_role (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(30) UNIQUE NOT ... |
SET SCHEMA DM_PAL;
DROP TABLE #PAL_PARAMETER_TBL;
CREATE LOCAL TEMPORARY COLUMN TABLE
#PAL_PARAMETER_TBL
("PARAM_NAME" VARCHAR(256), "INT_VALUE" INTEGER, "DOUBLE_VALUE" DOUBLE, "STRING_VALUE" VARCHAR(1000));
INSERT INTO #PAL_PARAMETER_TBL VALUES ('ALG', 6, NULL, NULL);
INSERT INTO #PAL_PARAMETER_TBL VALUES ... |
# Descripción: Ejercicio práctico 2.3 (o Implementación de ejercicio conceptual 2.3)
# Autor: Gustavo Vladimir Diaz
# Fecha: 05/09/2020
# Enunciado:
# Ejecute en su motor de base de datos la sentencia desarrollada para el ejercicio conceptual 2.3
#
# Objetivo de ejercicio: Implementación de selección de datos a obser... |
SELECT COUNT(*)
FROM
tag as t,
site as s,
question as q,
tag_question as tq
WHERE
t.site_id = s.site_id
AND q.site_id = s.site_id
AND tq.site_id = s.site_id
AND tq.question_id = q.id
AND tq.tag_id = t.id
AND (s.site_name in ('chemistry'))
AND (t.name in ('acid-base','inorganic-chemistry','organic-chemistry','physical-c... |
select value from {{ v$osstat }} where stat_name = 'NUM_CPUS'
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1:3306
-- Généré le : mer. 11 sep. 2019 à 20:13
-- Version du serveur : 5.7.26
-- Version de PHP : 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
BEGIN TRANSACTION;
DELETE FROM HerramientasxRelevamiento;
DELETE FROM OperariosxRelevamiento;
DELETE FROM Planificaciones;
DELETE FROM Tareas;
DELETE FROM OrdenesDeCompra;
DELETE FROM RelevamientosxSecciones;
DELETE FROM Respuesta;
DELETE FROM NodosFirmantesRelevamiento;
DELETE FROM Relevamientos;
COMMIT TRANSACTION... |
/*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50714
Source Host : localhost:3306
Source Schema : hunsha
Target Server Type : MySQL
Target Server Version : 50714
File Encoding : 65001
Date: 10/10/201... |
create table orcas_orderentry_meta.categories
(
ctgr_id number(15) not null,
version number(15) default "0" not null,
name varchar2(30) not null,
description varchar2(1000) not null,
constraint ctgr_pk primary key (ctgr_id),
con... |
drop schema ims;
CREATE SCHEMA IF NOT EXISTS `ims`;
USE `ims` ;
DROP TABLE IF EXISTS `customers`;
CREATE TABLE IF NOT EXISTS `ims`.`customers` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(40) NULL DEFAULT NULL,
`surname` VARCHAR(40) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
);
DROP TABLE IF... |
CREATE TABLE [dbo].[TeamUnits]
(
[TeamId] INT NOT NULL,
[UnitId] INT NOT NULL,
[Position] TINYINT NOT NULL,
[Flags] INT NULL,
[Support] BIT NOT NULL CONSTRAINT [DF_dbo.TeamUnits_Support] DEFAULT 0,
[Sub] BIT NOT NULL CONSTRAINT [DF_dbo.TeamUnits_Sub] DEFAULT 0,
CONSTRAINT [PK_dbo.TeamUnits]... |
-- CreateTable
CREATE TABLE "messages" (
"id" TEXT NOT NULL PRIMARY KEY,
"text" TEXT NOT NULL,
"created_at" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"user_id" TEXT NOT NULL,
CONSTRAINT "messages_user_id_fkey" FOREIGN KEY ("user_id") REFERENCES "users" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
... |
IF object_id(N'[dbo].[FK_dbo.Notes_dbo.Flights_Flight_FlightId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[Notes] DROP CONSTRAINT [FK_dbo.Notes_dbo.Flights_Flight_FlightId]
IF object_id(N'[dbo].[FK_dbo.PilotLogEntries_dbo.Pilots_Pilot_PilotId]', N'F') IS NOT NULL
ALTER TABLE [dbo].[PilotLogEntries] DROP CONSTRAINT... |
-- initial definition was not range partitioned, so we have to a convoluted
-- dance
ALTER TABLE alldata RENAME to alldata_old;
ALTER TABLE alldata_1minute RENAME to alldata_1minute_old;
CREATE TABLE alldata(
station character varying(4),
valid timestamp with time zone,
tmpf real, ... |
CREATE PROCEDURE dbo.aspnet_Membership_GetNumberOfUsersOnline
@ApplicationName nvarchar(256),
@MinutesSinceLastInActive int,
@CurrentTimeUtc datetime
AS
BEGIN
DECLARE @LoweredApplicationName nvarchar(256)
SET @LoweredApplicationName = LOWER(@ApplicationName)
DECLARE @DateA... |
CREATE TABLE IF NOT EXISTS sm_cookies
(
id serial,
name varchar(30) NOT NULL UNIQUE,
description varchar(255),
access INTEGER,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS sm_cookie_cache
(
player varchar(65) NOT NULL,
cookie_id int NOT NULL,
value varchar(100),
timestamp int NOT NULL,
PRIMARY KEY (player,... |
set max_parallel_workers_per_gather to 0;
set work_mem to 1000000;
set decision_method to dp;
set enable_nestloop to off;
set enable_indexscan to off;
set enable_mergejoin to off;
set enable_incremental to on;
set tpch_updates to 'part,lineitem';
set iqp_query to 'q14';
set gen_mem_info to off;
set memory_budget to... |
-- =============================================
-- Create basic stored procedure template
-- =============================================
-- Drop stored procedure if it already exists
IF EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'dbo'
AND SPECIFIC_NAME = N'spFindModu... |
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2020] 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 obt... |
CREATE TABLE IF NOT EXISTS personal (
Documento VARCHAR(16) NOT NULL,
Nombre_Completo VARCHAR(96) NOT NULL,
Correo VARCHAR(128) NOT NULL,
PRIMARY KEY (Documento));
CREATE TABLE IF NOT EXISTS estado_vehiculo(
ID_Estado_Vehiculo SERIAL NOT NULL,
Descripcion VARCHAR(128) NOT NULL,
PRIMARY KEY (ID_Estado_Veh... |
--[er]test updating timestamp type list partition using three partitions and invalid value not exist in partitions
create table list_test(id int,
test_time time,
test_date date,
test_timestamp timestamp, primary key(id,test_timestamp))
PARTITION BY LIST (test_timestamp) (
PARTITION p0 VALUES ... |
USE ROLE SYSADMIN;
CREATE WAREHOUSE ETL_WH
WAREHOUSE_SIZE = XSMALL
MAX_CLUSTER_COUNT = 3
MIN_CLUSTER_COUNT = 1
SCALING_POLICY = ECONOMY
AUTO_SUSPEND = 60 -- suspend after 1 minute (60 seconds) of inactivity
AUTO_RESUME = TRUE
INITIALLY_SUSPENDED = TRUE
COMMENT = 'Virtual Warehouse for ETL workloads. Auto scales betwee... |
INSERT INTO national_job_profile_factors (id, name)
VALUES (1, 'Communication & Relationship Skills');
INSERT INTO national_job_profile_factors (id, name)
VALUES (2, 'Knowledge, Training & Experience');
INSERT INTO national_job_profile_factors (id, name)
VALUES (3, 'Analytical & Judgement Skills');
INSERT I... |
use superstore;
-- FOR EASY JOINING OF COLUMNS FROM DIFFERENT TABLE, I LISTED ALL THE COLUMN FROM EACH TABLE BELOW
-- select * from customers; -- index_id, customer_id, customer_name, segment, state, postal_code, region
-- select * from orders; -- index_id, order_id, order_date, ship_date, ship_mode
-- select * fro... |
-- MySQL dump 10.13 Distrib 5.6.36, for Linux (x86_64)
--
-- Host: localhost Database: blog
-- ------------------------------------------------------
-- Server version 5.6.36-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
--build core beer tables and load data
--drop schema if exists beer cascade;
create schema if not exists beer;
drop table if exists beer.drinkers cascade;
create table if not exists beer.drinkers
(
id integer
,user_id char(32)
,first_name varchar(32)
,last_name varchar(32)
,company varchar(64)
,school varchar(12... |
CREATE TABLE D9.nested_table2 (f1 int, nf1 record (f1 int4, f3 double), nf2 record (f1 int4, nf1 record (f1 int4, f2 text), nf2 record (f1 int4, f2 text), f2 double), f2 text); |
-- CreateTable
CREATE TABLE "MovieDirector" (
"id" SERIAL NOT NULL,
"people_id" INTEGER NOT NULL,
"movie_id" INTEGER NOT NULL,
PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "MovieWriter" (
"id" SERIAL NOT NULL,
"people_id" INTEGER NOT NULL,
"movie_id" INTEGER NOT NULL,
PRIMARY KEY... |
CREATE OR REPLACE VIEW
query_report_data_vw
AS
SELECT
`p`.`name` AS `plate`,
`pw`.`id` AS `well_id`,
`pw`.`well` ... |
-- Add restrictions on maximum repository length and names
ALTER TABLE splitgraph_meta.images
ALTER COLUMN repository SET DATA TYPE varchar(64);
ALTER TABLE splitgraph_meta.images
ALTER COLUMN namespace SET DATA TYPE varchar(64);
ALTER TABLE splitgraph_meta.images
ADD CONSTRAINT images_repository CHECK (rep... |
-- @testpoint: range_range二级分区表:create if not exists不同名/不同schema
--test1: 不同名
--step1: 创建普通表; expect:成功
drop table if exists t_subpartition_0259;
create table if not exists t_subpartition_0259
(
col_1 int ,
col_2 int not null ,
col_3 varchar2 ( 30 ) not null ,
col_4 int generated always as(2*col_2) ... |
-- @testpoint:openGauss关键字exists(非保留),作为列名带反引号(合理报错)
drop table if exists exists_test;
create table exists_test(
c_id int, c_int int, c_integer integer, c_bool int, c_boolean int, c_bigint integer,
c_real real, c_double real,
c_decimal decimal(38), c_number number(38), c_numeric numeric(38),
c_char char(50) defau... |
create table LIBRARY_COUNTRY (
ID varchar(36) not null,
CREATE_TS time,
CREATED_BY varchar(50),
NAME varchar(100) not null,
primary key (ID)
)^
alter table LIBRARY_TOWN add column COUNTRY_ID varchar(36) ^
alter table LIBRARY_TOWN add constraint FK_LIBRARY_TOWN_COUNTRY_ID foreign key (COUNTRY_ID) references L... |
select
g.goods_id as id,
g.goods_id,
g.title,
g.cat_id,
g.brand_id,
g.price,
g.is_del,
g.is_open
FROM
goods as g
where g.gmt_modified > date_add(:sql_last_value, INTERVAL 8 HOUR)
order by g.goods_id |
/******************************************/
/* 数据库全名 = nacos_config */
/* 表名称 = config_info */
/******************************************/
CREATE TABLE `config_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`data_id` varchar(255) NOT NULL COMMENT 'data_id',
`group_id` varchar(255) DEFAULT... |
SELECT app.id as id,app.Name as name,app.Pkname as pkname,app.LastUpdateTime as lastUpdateTime FROM App app
WHERE
app.pkname in (:ids)
AND app.VersionCode = (SELECT ap.VersionCode FROM App ap WHERE ap.Pkname = app.Pkname ORDER BY ap.VersionCode DESC limit 1) |
SELECT *
FROM course_names;
SELECT department, COUNT(id) AS number_courses
FROM course_names
GROUP BY department;
-- SELECT department, SUM(total_enrolled) AS sum_enrolled
-- FROM course_names
-- GROUP BY department;
|
CREATE TABLE "COLL_OBJ_OTHER_ID_NUM"
( "COLLECTION_OBJECT_ID" NUMBER NOT NULL ENABLE,
"OTHER_ID_TYPE" VARCHAR2(75 CHAR) NOT NULL ENABLE,
"OTHER_ID_PREFIX" VARCHAR2(100 CHAR),
"OTHER_ID_NUMBER" NUMBER,
"OTHER_ID_SUFFIX" VARCHAR2(60 CHAR),
"DISPLAY_VALUE" VARCHAR2(255 CHAR),
"COLL_OBJ_OTHER_ID_NUM_ID" ... |
-- !migrate up
CREATE TABLE commandresults (
id BIGSERIAL PRIMARY KEY,
output TEXT NOT NULL,
status INTEGER NOT NULL,
repository_id BIGINT REFERENCES repositories(id),
created_at timestamp without time zone,
updated_at timestamp without time zone
);
-- !migrate down
DROP TABLE commandresults;
|
USE `ayr`;
DROP procedure IF EXISTS `SP_CANCELA_ENTREGADO`;
DELIMITER $$
USE `ayr`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `SP_CANCELA_ENTREGADO`(IN ID_Entrega_APP INT)
BEGIN
UPDATE trabajos T,
( SELECT Trabajo_ID TID
FROM EntregasDetalle
JOIN entregas on entregas.ID = entregasdetalle.Entrega_ID
... |
SELECT MAX(MagicWandSize) AS LongestMagicWand
FROM WizzardDeposits
|
-- 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 may not... |
CREATE TABLE public."User"(
user_id serial PRIMARY KEY,
phone VARCHAR (50) NOT NULL,
password VARCHAR (50) NOT NULL,
username VARCHAR (100),
address VARCHAR (100),
status VARCHAR (100),
);
CREATE TABLE public."Driver"(
driver_id serial PRIMARY KEY,
phone VARCHAR (50) NOT NULL,
password VARCHAR (50) NOT NULL,
... |
create table ACT_RU_VARIABLE (
ID_ varchar(64) not null,
REV_ integer,
TYPE_ varchar(191) not null,
NAME_ varchar(191) not null,
EXECUTION_ID_ varchar(64),
PROC_INST_ID_ varchar(64),
TASK_ID_ varchar(64),
SCOPE_ID_ varchar(191),
SUB_SCOPE_ID_ varchar(191),
SCOPE_TYPE_ v... |
DROP database IF EXISTS `flarum`;
create database `flarum` default character set utf8mb4 collate utf8mb4_bin;
GRANT ALL PRIVILEGES ON flarum.* to 'flarum'@'%';
|
ALTER TABLE `ObservationForum` ADD INDEX `createdAt` (`createdAt`)
ALTER TABLE `Observation` ADD INDEX `createdAt` (`createdAt`);
ALTER TABLE `Determination` ADD INDEX `createdAt` (`createdAt`);
ALTER TABLE `ObservationImages` ADD INDEX `createdAt` (`createdAt`);
|
-- Table creation script
CREATE TABLE dbo.CountryMaster(
CountryId INT NOT NULL IDENTITY(1,1), -- Automatically generated Id
CountryCode NVARCHAR(10) NOT NULL PRIMARY KEY, -- ISO3166 Code
CountryName NVARCHAR(255) NOT NULL, -- Short name
OfficialName NV... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.