sql stringlengths 6 1.05M |
|---|
<reponame>huq-industries/carto-spatial-extension
----------------------------
-- Copyright (C) 2021 CARTO
----------------------------
CREATE OR REPLACE FUNCTION @@RS_PREFIX@@placekey.H3_ASPLACEKEY
(h3_index VARCHAR(15))
RETURNS VARCHAR
IMMUTABLE
AS $$
from @@RS_PREFIX@@placekeyLib import h3_to_placekey, h3_is_v... |
<gh_stars>0
-- @testpoint:opengauss关键字specifictype(非保留),作为视图名
--关键字explain作为视图名,不带引号,创建成功
CREATE or replace VIEW specifictype AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view specifictype;
--关键字explain作为视图名,加双引号,创建成功
CREATE or replace VIEW "specifictype" AS
SELECT * FROM pg_tablespace WHERE s... |
select * from salesorder;
select * from salesitem;
#select * from product;
#select * from category;
select * from ruser;
|
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 23, 2016 at 10:48 AM
-- Server version: 10.0.17-MariaDB
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2021-08-06 17:04:24
-- 伺服器版本: 10.4.14-MariaDB
-- PHP 版本: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
CREATE TABLE green(
GREEN_ID SERIAL NOT NULL PRIMARY KEY,
PLACE VARCHAR(255),
WATER_DAY_MM INTEGER
);
DROP Table "green" |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 18 Des 2021 pada 17.17
-- Versi server: 10.4.18-MariaDB
-- Versi PHP: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<reponame>jarman75/net.core
DECLARE @RC int
DECLARE @CupsCode nvarchar(25) = 'ES0021000001643784DV'
DECLARE @FechaInicio datetime = '01-10-2019'
DECLARE @FechaFin datetime = '30-10-2019'
-- TODO: Set parameter values here.
EXECUTE @RC = [dbo].[usp_DatosCalculoElectrico]
@CupsCode
,@FechaInicio
,@FechaFin
GO |
<reponame>devopsmanojn/laraclassified
-- MySQL dump 10.13 Distrib 5.7.26, for osx10.10 (x86_64)
--
-- Host: 127.0.0.1 Database: laraclassified
-- ------------------------------------------------------
-- Server version 5.7.26
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARA... |
create table B (
id int null
); |
SELECT
id,
name,
description,
price,
comment,
created_at,
updated_at
FROM
products
WHERE
id = $1
|
<reponame>SkillsFundingAgency/DC-JobQueueManager
DECLARE @CollectionNameNCS1819 NVARCHAR(100) = 'NCS1819';
SET NOCOUNT ON;
--DECLARE @MinsToRemove_NCS1819 INT = 715;
DECLARE @DataTable_NCS1819 TABLE ([CollectionId] INT NOT NULL, [PeriodNumber] INT NOT NULL, [StartDateTimeUTC] DATETIME NOT NULL, [EndDateTimeUTC] DATETI... |
CREATE MATERIALIZED VIEW mv_profit_balances_by_month AS (
WITH
player_max_date_by_month AS (
SELECT
f_player_id,
MAX(f_date) AS f_date
FROM
v_profit_balances
GROUP BY
f_player_id,
DATE_TRUNC('month', f_date) :: DATE
),
last_val... |
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET search_path = public, pg_catalog;
ALTER TABLE IF EXISTS ONLY public.births_at_health_facili... |
<reponame>semrekkers/mailrelay
-- This is an example schema.
-- You can change the id types, indices or add columns as long as you keep these columns the same:
-- domains.name
-- users.email
-- users.password_hash
-- users.send_only
-- users.active
-- aliases.source
-- aliases.destination
--
-- Or you know what ... |
# https://leetcode.com/problems/customer-who-visited-but-did-not-make-any-transactions/
SELECT
customer_id, count(*) as count_no_trans
FROM Visits v
WHERE visit_id NOT IN (SELECT DISTINCT visit_id FROM Transactions)
GROUP BY customer_id
; |
exec sp_MSforeachtable @command1="ALTER TABLE ? NOCHECK CONSTRAINT ALL"
Go |
<filename>Install audit trail script for SQL Server Database.sql
-- The MIT License (MIT)
--
-- Copyright (c) 2015 <NAME>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restr... |
<reponame>rstojnic/arxiv-browse
INSERT INTO `arXiv_stats_monthly_submissions` VALUES ('1991-07-01',2,-2),('1991-08-01',28,-1),('1991-09-01',58,0),('1991-10-01',76,0),('1991-11-01',64,0),('1991-12-01',78,0),('1992-01-01',193,-105),('1992-02-01',134,-10),('1992-03-01',120,-3),('1992-04-01',225,-41),('1992-05-01',237,-11)... |
<filename>modules/boonex/decorous/updates/11.0.3_12.0.0/install/sql/install.sql
SET @sName = 'bx_decorous';
-- SETTINGS
UPDATE `sys_options` SET `value`='rgba(245, 245, 245, 1)' WHERE `name`=CONCAT(@sName, '_general_item_bg_color_hover');
UPDATE `sys_options` SET `value`='rgba(230, 247, 255, 1)' WHERE `name`=CON... |
IF EXISTS (select * from dbo.sysobjects where id = object_id(N'ufnGetConnectionTypeInNetworkOfIdent')
AND OBJECTPROPERTY(id, N'IsScalarFunction') = 1)
DROP FUNCTION ufnGetConnectionTypeInNetworkOfIdent
GO
/* ufnGetConnectionTypeInNetworkOfIdent
*
* Desc
*
*/
CREATE FUNCTION ufnGetConnectionTypeInNetworkOfIdent()
... |
-- SET ATTR_DATA_ID = 1400 WHERE ATTR_DATA_ID = 10000;
UPDATE KRIM_ROLE_MBR_ATTR_DATA_T SET ATTR_DATA_ID = KRIM_ATTR_DATA_ID_BS_S.NEXTVAL WHERE ATTR_DATA_ID = (SELECT ATTR_DATA_ID FROM KRIM_ROLE_MBR_ATTR_DATA_T WHERE ROLE_MBR_ID = (SELECT ROLE_MBR_ID FROM KRIM_ROLE_MBR_T WHERE ROLE_ID = (SELECT ROLE_ID FROM KRIM_ROLE_T... |
<filename>ole-app/ole-db/ole-sql/ole-ls-sql/src/main/resources/sql/oracle/OLE_CODE_T.sql
TRUNCATE TABLE OLE_CODE_T DROP STORAGE
/
INSERT INTO OLE_CODE_T (CD_ID,INPUT_VAL,ITM_STAT_CD,ITM_TYP,OBJ_ID,PROFILE_ID,ROW_ACT_IND,VER_NBR)
VALUES ('2','NCCP','BOOK','Circulating','01ea3339-4a85-4acf-8745-4bbcb0757da4','MY-TEST-I... |
<gh_stars>100-1000
UPDATE CloudFormationStackResourceRefVO AS t1, ApplianceVmVO AS t2 SET t1.reserve=true WHERE t1.resourceUuid=t2.uuid AND t2.applianceVmType IN ('vpcvrouter','vrouter'); |
<filename>Hands-on lab/environment-setup/automation/sql/00_master_setup.sql
create login [asa.sql.workload01] with password = <PASSWORD>#'
create login [asa.sql.workload02] with password = <PASSWORD>#' |
IMPORT FROM CSV FILE '../core/demo/sample.csv' INTO sample;
SELECT * FROM
DIFF
(SELECT * FROM sample WHERE usage > 1000.0) outliers,
(SELECT * FROM sample WHERE usage < 1000.0) inliers
ON
location, version
COMPARE BY
risk_ratio(COUNT(*));
SELECT * FROM
DIFF
(SELECT * FROM sample WHERE usag... |
CREATE TABLE datamodel.join_dataclass_to_extended_data_class (
dataclass_id UUID NOT NULL,
extended_dataclass_id UUID NOT NULL
);
ALTER TABLE datamodel.join_dataclass_to_extended_data_class
ADD CONSTRAINT FKaph92y3qdyublukjj8mbsivo3 FOREIGN KEY (extended_dataclass_id) REFERENCES datamodel.data_cla... |
<reponame>Constructor0987/MeisterGeister
-- Erstellt neue Tabelle Trageort für Inventar, verbunden mit Held_Ausrüstung 1:1 und setzt neuen PK für Held_Ausrüstung
CREATE TABLE Trageort (
[TrageortGUID] uniqueidentifier NOT NULL DEFAULT newid(),
[Name] nvarchar(100) NOT NULL,
[TragkraftFaktor] float NOT NULL DE... |
<reponame>gorapiotr/butterfly<filename>baza_sql/zad6.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Czas generowania: 12 Sty 2018, 18:37
-- Wersja serwera: 10.1.24-MariaDB-cll-lve
-- Wersja PHP: 5.6.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMI... |
-- @testpoint:opengauss关键字Asc(保留),作为数据库名
--关键字不带引号-失败
create database Asc;
--关键字带双引号-成功
create database "Asc";
drop database if exists "Asc";
--关键字带单引号-合理报错
create database 'Asc';
--关键字带反引号-合理报错
drop database if exists `Asc`;
create database `Asc`;
|
/*
select concat(LIVROS.nomeLivro, '- Exemplar') as 'Livros', concat(CATEGORIA.nomeCategoria, ' - Categoria') as 'Categorias', concat(AUTORES.nomeAutor, ' - Autores') as 'Autores',
concat(EDITORA.nomeEditora, ' - Editora') as 'Editoras' from LIVROS inner join CATEGORIA inner join AUTORES inner join EDITORA
... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 10, 2020 at 10:03 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 23, 2017 at 12:33 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... |
<reponame>adminiitbact/cov2-graphql
alter table "public"."facility" add foreign key ("region") references "public"."region"("id") on update cascade on delete cascade;
|
<reponame>N-vdL/CMPG311_Sasol_Database
INSERT ALL
INTO DEPARTMENT VALUES (1, 'Sales', '<NAME>', '+27598613436')
INTO DEPARTMENT VALUES (2, 'Finance', '<NAME>', '+27999930412')
INTO DEPARTMENT VALUES (3, 'Research and Development', '<NAME>', '+27948304134')
INTO DEPARTMENT VALUES (4, 'Manufacturing', '<NAME>', '+2732953... |
<reponame>udinesia325/ci4-restful<gh_stars>0
-- MariaDB dump 10.19 Distrib 10.6.4-MariaDB, for Android (aarch64)
--
-- Host: localhost Database: bani_yas
-- ------------------------------------------------------
-- Server version 10.6.4-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... |
-- MySQL Script generated by MySQL Workbench
-- Sat Sep 29 09:31:07 2018
-- 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;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ON... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jul 24, 2020 at 10:04 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.4.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... |
<filename>db/tsb.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 07, 2019 at 04:44 PM
-- Server version: 5.7.26
-- PHP Version: 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
-- MySQL dump 10.16 Distrib 10.1.21-MariaDB, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: 127.0.0.1
-- ------------------------------------------------------
-- Server version 5.7.16-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@C... |
<reponame>budismartcloud/eefish-web
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 13, 2017 at 09:09 AM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_... |
<filename>db_DataHandwerk/configT/Views/SsasDmvTableImport_ImportSql.sql
/*
<<property_start>>Description
obsolet
* we could truncate once and import all
* or we could use the [isCurrentImport] and loop through aktive databasename and import them one by one
todo:
* ExecPersistSql only, if persistence exists
<<prop... |
<reponame>iizotov/arc-starter
SELECT
SUM(error) = 0 AS valid
,TO_JSON(
NAMED_STRUCT(
'count', COUNT(error),
'errors', SUM(error)
)
) AS message
FROM (
SELECT
CASE
WHEN SIZE(_errors) > 0 THEN 1
ELSE 0
END AS error
FROM ${inputView}
) input_table |
INSERT INTO users (username, password) VALUES ('coolkid', '<PASSWORD>');
INSERT INTO collections (name, CollectionId, UserId) VALUES ('pets', 1, 1);
INSERT INTO users (username, password) VALUES ('coolkid', '<PASSWORD>');
INSERT INTO collections (name, CollectionId, UserId) VALUES ('pets', 2, 2);
//Grassland 1
INSE... |
<reponame>Abdelrahman19999/Fantasy-Premier-League-Platform<gh_stars>0
PRAGMA foreign_keys = off;
BEGIN TRANSACTION;
-- Table: Clubs
CREATE TABLE Clubs (ID INTEGER PRIMARY KEY NOT NULL UNIQUE, Name VARCHAR UNIQUE NOT NULL);
-- Table: Players
CREATE TABLE Players (ID INTEGER PRIMARY KEY NOT NULL UNIQUE, Name VARCHAR (3... |
create or replace package body ut is
/*
utPLSQL - Version 3
Copyright 2016 - 2017 utPLSQL 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
http://www.apache.org/licenses/L... |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50553
Source Host : 127.0.0.1:3306
Source Database : web
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2019-04-17 09:20:47
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... |
<gh_stars>0
CREATE TABLE `seckill_goods`(
`seckill_id` BIGINT(20) NOT NULL COMMENT '商品库存id',
`goods_name` VARCHAR(120) NOT NULL COMMENT '商品名称',
`inventory` INT(11) NOT NULL COMMENT '库存数量',
`start_time` DATETIME NOT NULL COMMENT '开始时间',
`end_time` DATETIME NOT NULL COMMENT '结束时间',
`create_time` DATETIME NOT NULL C... |
<gh_stars>1-10
SOF-HHN Sat, 06 Aug Tue, 09 Aug
HHN-SOF Tue, 05 Jul
// one way data
SELECT
Airline,
AirportCode_LeavingFrom,
AirportCode_GoingTo,
OutboundTrip,
DepartureDatetime,
ArrivalDatetime,
Prices_BasicFare_Discount,
SearchDatetime,
Search_ID
FROM
TravelDataResult TDR, Tra... |
<filename>salz-db/docker-entrypoint-initdb.d/4-getframes.sql
CREATE OR REPLACE FUNCTION get_latest_turnid()
RETURNS INTEGER
AS $$
DECLARE
maxturn INTEGER;
BEGIN
SELECT max(Game.turnid)
INTO maxturn
FROM Game;
RETURN maxturn;
END; $$
LANGUAGE 'plpgsql';
CREATE OR REPLACE FUNCTION get_playerframes(startFrame INTE... |
-- H2
CREATE TABLE Orders (
ID IDENTITY PRIMARY KEY,
NAME VARCHAR(30) NULL,
PAID BIT NULL,
EXTRA_COLUMN_NOT_MAPPED VARCHAR(30) NULL,
Customer_ID VARCHAR(10) NULL,
Created DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL
)
-- SQLite
CREATE TABLE Orders (
ID INTEGER NOT NULL PRIMARY KEY AUTOINCREM... |
-- @testpoint:opengauss关键字join(保留),作为用户组名
--关键字不带引号-合理报错
drop group if exists join;
create group join with password '<PASSWORD>';
--关键字带双引号-成功
drop group if exists "join";
create group "join" with password '<PASSWORD>';
--清理环境
drop group "join";
--关键字带单引号-合理报错
drop group if exists 'join';
create group 'join' with... |
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS pg_trgm;
CREATE EXTENSION IF NOT EXISTS hstore;
|
--
-- Table structure for table `flows`
--
CREATE TABLE `flows` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`project_id` int(11) NOT NULL,
`flow` mediumtext COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` ti... |
<filename>WEEK-8/10.sql
insert into department
values('Systems', 'US', 11);
insert into department
values('Designing', 'Chennai', 12); |
<reponame>austin-dudzik/nova
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: Apr 17, 2022 at 12:05 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
--
--... |
<filename>public_html/SampleCreateEdit/queries/SELECT_CART.sql<gh_stars>0
SELECT * FROM Cart WHERE `userID` = :id;
|
<reponame>navikt/melosys-eessi
CREATE TABLE sed_mottatt
(
id serial NOT NULL PRIMARY KEY,
sed_hendelse jsonb NOT NULL,
sed_kontekst jsonb NOT NULL,
versjon integer NOT NULL,
mottatt_dato timestamp,
endret_dato timestamp,
feilede_forsok integer not null default 0,
feilet boolean DEFAULT f... |
<gh_stars>0
ALTER TABLE "public"."patient" ALTER COLUMN "district" DROP NOT NULL;
|
<reponame>peknight/security<gh_stars>1-10
create table if not exists world
(
world_id bigint auto_increment comment '主键'
primary key,
name varchar(255) null comment '世界名称',
parent_world_id bigint null comment '父世界ID',
creator_id bigint null comment '创造者ID',
remark varchar(255) null comment '备注信息',
create_by big... |
<reponame>Torrespain/bamazon<filename>bamazon.sql
DROP DATABASE IF EXISTS bamazon_DB;
CREATE DATABASE bamazon_DB;
USE bamazon_DB;
CREATE TABLE products (
id INTEGER AUTO_INCREMENT NOT NULL,
product_name VARCHAR(50) NULL,
department_name VARCHAR(50) NULL,
price INTEGER(10) NULL,
stock_quantity INTEGER(10) NULL,
... |
DROP TABLE stories;
|
<filename>utils/baza-date/inserare_conturi_conectate.sql<gh_stars>1-10
insert into conturi_conectate VALUES('apXgsMmhEpCR4FKYxeSiOOZrmz1ZjH','gigipopescu',SYSDATE());
insert into conturi_conectate VALUES('umotYctZsZdQNlwQFsFgRpO1EkWJLS','flaviapopa',SYSDATE());
insert into conturi_conectate VALUES('onahfiTRDJKFJfgaNj... |
/*
------------------------------------------------
Copyright © 2008-2020 <NAME>
Last updated : 31 may 2020
module version : 7664
*/
------------------------------------------------
begin
set nocount on;
if not exists(select * from a2sys.Versions where Module = N'std:admin')
insert into a2sys.Versions (Module, [Ve... |
DROP SEQUENCE "collect"."data_id_seq" RESTRICT
GO
DROP SEQUENCE "collect"."record_id_seq" RESTRICT
GO
DROP SEQUENCE "collect"."schema_definition_id_seq" RESTRICT
GO
DROP SEQUENCE "collect"."survey_id_seq" RESTRICT
GO
DROP SEQUENCE "collect"."taxonomy_id_seq" RESTRICT
GO
DROP SEQUENCE "collect"."taxo... |
<gh_stars>10-100
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[SQLCop].[test Page life expectancy]') AND type in (N'P', N'PC'))
DROP PROCEDURE [SQLCop].[test Page life expectancy]
GO
CREATE PROCEDURE [SQLCop].[test Page life expectancy]
AS
BEGIN
-- Written by <NAME>
-- February 25, 2012
-- ht... |
-- original: in.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
BEGIN;
CREATE TABLE t1(a int, b int)
;COMMIT;
SELECT count(*) FROM t1
;SELECT a FROM t1 WHERE b BETWEEN 10 AND 50 ORDER BY a
;SELECT a FROM t1 WHERE b NOT BETWEEN 10 AND 50 ORDER BY a
;SELECT a FROM t1 WHERE b BETWEEN a AND a*5... |
<reponame>Tovli/MadeiraToolbox
;with ind as (
select
a.object_id
, a.index_id
, CAST(col_list.list as varchar(max)) as list
from
(select distinct object_id, index_id from sys.index_columns) a
CROSS APPLY
(select top 100 percent cast(column_id as varchar(16)) + ',' as [text()]
from sys.index_columns b
... |
<filename>conf/db/upgrade/beforeValidate.sql
-- Update `schema_version' since we've changed SQL to match the expectation
-- of the newer version MariaDB.
--
-- WARNING: `schema_version' table doesn't exist on a clean environment, thus
-- after 'flyway clean' we prepared an empty table after 'flyway baseline'.
DELIMITER... |
<gh_stars>0
CREATE TABLE media (
id serial PRIMARY KEY,
owner text NOT NULL,
path text UNIQUE,
hash text UNIQUE,
date_taken timestamp,
mime_type text NOT NULL,
width int NOT NULL,
height int NOT NULL,
lat float,
long float,
metadata jsonb
);
CREATE TABLE album_contents (
... |
<reponame>atka66/dongon<gh_stars>0
CREATE TABLE users (
id BIGSERIAL NOT NULL,
email varchar(255) NOT NULL,
"password" varchar(255) NOT NULL,
username varchar(255) NOT NULL,
CONSTRAINT uk_email UNIQUE (email),
CONSTRAINT uk_username UNIQUE (username),
CONSTRAINT users_pkey PRIMARY KEY (id)
)... |
<filename>AccountsDatabase/Tables/AccountFriends.sql<gh_stars>0
CREATE TABLE [dbo].[AccountFriends]
(
[Id] INT NOT NULL IDENTITY PRIMARY KEY,
[AccountId] INT NOT NULL,
[FriendAccountId] INT NOT NULL,
[GroupId] INT NULL,
CONSTRAINT [FK_AccountFriends_ToAccounts] FOREIGN KEY ([AccountId]) REFEREN... |
CREATE INDEX CONCURRENTLY osm_ways_gin ON osm_ways USING gin (nodes);
CREATE INDEX CONCURRENTLY osm_relations_gin ON osm_relations USING gin (member_refs);
|
SELECT screen_name, content, favorite_count, retweet_count, created
FROM twitter_data
ORDER BY favorite_count DESC, retweet_count DESC
SELECT extract(year from created) as year, screen_name, length(content) as tweet_length
FROM twitter_data
GROUP BY 1,3 |
<reponame>kao-lab/omop_distro<gh_stars>1-10
CREATE TABLE IF NOT EXISTS results.cohort
(COHORT_DEFINITION_ID int NOT NULL,
SUBJECT_ID bigint NOT NULL,
cohort_start_date date NOT NULL,
cohort_end_date date NOT NULL
);
CREATE TABLE IF NOT EXISTS results.cohort_censor_stats (cohort_definition_id int NOT NULL,
lost... |
-- Name: GetScanEventId
-- Schema: posda_phi
-- Columns: ['id']
-- Args: []
-- Tags: ['UsedInPhiSeriesScan', 'NotInteractive']
-- Description: List of values seen in scan by VR (with count of elements)
select currval('series_scan_series_scan_id_seq') as id
|
<reponame>qiuwenhuifx/PolarDB-for-PostgreSQL
/*--EXPLAIN_QUERY_BEGIN*/
set enable_partitionwise_join =1;
--range
drop table t1 cascade;
CREATE TABLE t1 (c1 int, c2 int, c3 varchar) PARTITION BY RANGE(c1);
CREATE TABLE t1_p3 PARTITION OF t1 FOR VALUES FROM (500) TO (600);
CREATE TABLE t1_p1 PARTITION OF t1 FOR VALUES F... |
BEGIN;
--
-- Create a function to purge from varnish cache
-- By default this adds the object to a local queue,
-- but this function can be replaced with a void one
-- when running a development version.
--
CREATE SCHEMA IF NOT EXISTS varnishqueue;
CREATE TABLE IF NOT EXISTS varnishqueue.queue (id bigserial primary k... |
--
-- Script was generated by Devart dbForge Studio for MySQL, Version 192.168.3.11
-- Product home page: http://www.devart.com/dbforge/mysql/studio
-- Script date 4/26/2019 2:13:02 PM
-- Server version: 5.7.21
-- Client version: 4.1
--
--
-- Definition for database thrivedb
--
CREATE DATABASE IF NOT EXISTS thrivedb
... |
<gh_stars>1-10
--test TIMESTAMP(L)TZ columns, with values clause and for update clause
set system parameters 'tz_leap_second_support=yes';
drop table if exists tz_test;
set timezone 'Asia/Seoul';
create table tz_test(id int primary key auto_increment, col1 timestamp with local time zone default timestampltz'2014-09-... |
IF OBJECT_ID('[HumanResources].[uspUpdateEmployeeLogin]') IS NOT NULL
DROP PROCEDURE [HumanResources].[uspUpdateEmployeeLogin];
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [HumanResources].[uspUpdateEmployeeLogin]
@BusinessEntityID [int],
@OrganizationNode [hierarchyid],
@LoginI... |
<reponame>SDC-Sedeco/QA-Service
CREATE TABLE IF NOT EXISTS answers (
id SERIAL PRIMARY KEY,
question_id INT NOT NULL,
body VARCHAR(1000) NOT NULL,
date BIGINT NOT NULL,
answerer_name VARCHAR(60) NOT NULL,
answerer_email VARCHAR(60) NOT NULL,
reported BOOLEAN DEFAULT 'f',
helpful INT DEFAULT 0
);
|
<gh_stars>0
ALTER TABLE users ADD COLUMN IF NOT EXISTS provider VARCHAR(7) DEFAULT 'cognito'
|
/*
SQLyog Ultimate v12.08 (64 bit)
MySQL - 10.4.22-MariaDB : Database - vlcaim2
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_K... |
<filename>JSPFinalPractice/problem2B.sql
SELECT s.title
FROM suggested s
WHERE s.user IN (
SELECT u.id
FROM user u
WHERE u.name = ?
)
ORDER BY s.likes
LIMIT 10;
|
CREATE OR REPLACE FUNCTION build_adjacency(
)
RETURNS TABLE(out_min_nodeforarc_count integer, out_max_nodeforarc_count integer)
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
v_fnode integer;
v_tnode integer;
v_rec record;
c_arcs NO SCROLL CURSOR FOR select arcid, bidir_adjacency as bda
from arc
where reject_mo... |
CREATE DATABASE election;
\connect election;
CREATE SCHEMA federal;
CREATE TABLE federal.federal_raw (
election_date varchar(128),
state varchar(128),
office varchar(128),
district varchar(128),
candidate varchar(128),
party varchar(128),
votes varchar(128)
);
CR... |
--Create tables.
use quickout;
create table cart (
id varchar(255) not null,
create_date datetime,
last_udpated datetime,
account_code varchar(255) not null,
status integer not null,
primary key (id)
);
create table cart_details (
id bigint not null auto_increment,
create_date datetime,
last_udpa... |
create table "comma-align-nulls" (
"text-field" character varying(15),
"int-field" integer,
"numerico-el-1" numeric(8,6),
"todosnulos" integer,
"numerico-el-2" numeric(6,2)
);
insert into "comma-align-nulls" ("text-field", "int-field", "numerico-el-1", "todosnulos", "numerico-el-2") values
('hello' , ... |
SELECT * FROM foo WHERE bar GROUP BY baz;
SELECT foo FROM bar WHERE foo = ANY(
SELECT d FROM jsontest LIMIT 1
select * from a; select * from ;
create table schema1.c (w text)
create table test(a boolean)
SELECT unnest FROM unnest(...);
select * from binarydata
create table numbertest(a numeric)
select * from a;
create ... |
SELECT * FROM users WHERE id=1
SELECT * FROM unnest(current_schemas(false))
SELECT * FROM appendages WHERE user_id=10000000000001
|
<reponame>rae912/crocodile
CREATE TABLE IF NOT EXISTS `crocodile_host` (
`id` CHAR(18) NOT NULL COMMENT "主机ID",
`addr` VARCHAR(20) NOT NULL COMMENT "Host地址",
`hostname` VARCHAR(100) NOT NULL COMMENT "主机名",
`runningTasks` TEXT COMMENT "运行的任务",
`weight` INT NOT NULL DEFAULT 100 COM... |
<reponame>navikt/polly<filename>apps/backend/polly-app/src/main/resources/db/migration/V1.2__process_legal_bases.sql
ALTER TABLE PROCESS
ADD COLUMN LEGAL_BASES JSONB;
UPDATE PROCESS
SET LEGAL_BASES = '[]'::JSONB
WHERE LEGAL_BASES IS NULL;
ALTER TABLE PROCESS
ALTER COLUMN LEGAL_BASES SET NOT NULL;
|
-- file:misc_sanity.sql ln:54 expect:false
begin
for relnm, reloid, shared in
select relname, oid, relisshared from pg_class
where relhasoids and oid < 16384 order by 1
loop
execute 'select min(oid) from ' || relnm into lowoid
|
<gh_stars>0
ALTER TABLE WEB_PAGE_HISTORY
ALTER COLUMN WEB_SITE_ID SET NOT NULL;
-- Drop the constraints so we will be able to delete from WEB_PAGE_TEMPLATE
ALTER TABLE WEB_PAGE_TEMPLATE_HISTORY
DROP CONSTRAINT WEB_PAGE_TEMPLATE_HISTORY__WEB_PAGE_TEMPLATE_FK;
-- Drop the constraints so we will be able to delete from W... |
<reponame>gerald0529/bafc
DROP TABLE IF EXISTS `thinkcms_third`;{}
CREATE TABLE `thinkcms_third` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_uid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '用户表关联外键',
`openid` varchar(100) NOT NULL DEFAULT '' COMMENT '开放id',
`type` varchar(45) NOT NULL DEFAULT '' C... |
<gh_stars>0
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.7.14 : Database - web_pedido
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOR... |
<filename>sql/ttt.sql
-- 查询每个电池,最近的10个订单
SELECT *
FROM (
SELECT battery_sn AS `电池sn`, order_number AS `订单号`, user_id AS `用户id`, start_time AS `借用时间`, return_time AS `归还时间`
, pay_time AS `支付时间`, return_time - start_time AS `借用时长`, return_store_id AS `归还门店id`, return_store_name AS `归还门店名称`
, row_number() OVER (PARTI... |
<reponame>wJHui/bolg<gh_stars>0
DROP TABLE IF EXISTS `yzn_category`;
DROP TABLE IF EXISTS `yzn_model`;
DROP TABLE IF EXISTS `yzn_model_field`; |
CREATE TABLE [Identity].[AspNetRoles] (
[Id] NVARCHAR (128) CONSTRAINT [DF_AspNetRoles_Id] DEFAULT ('') NOT NULL,
[Name] NVARCHAR (256) CONSTRAINT [DF_AspNetRoles_Name] DEFAULT ('') NOT NULL,
[CreatedDate] DATETIME CONSTRAINT [DF_AspNetRoles_CreatedDate] DEFAULT (getutcdate()) NOT NULL,
[ModifiedD... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.