sql stringlengths 6 1.05M |
|---|
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS builds CASCADE;
DROP TABLE IF EXISTS processors CASCADE;
DROP TABLE IF EXISTS memory CASCADE;
DROP TABLE IF EXISTS hds CASCADE;
DROP TABLE IF EXISTS gpus CASCADE;
DROP TABLE IF EXISTS motherboards CASCADE;
DROP TABLE IF EXISTS psus CASCADE;
DROP TABLE IF EXISTS c... |
<reponame>sdoubleday/misc-scripts<filename>SQLQuery_Utility_SizeOfTablesIncludingIndexes.sql
/*
For size of tables plus indecies on disk
http://stackoverflow.com/questions/7892334/get-size-of-all-tables-in-database*/
Declare @myTables TABLE (blah varchar(1000))
INSERT INTO @myTables VALUES
('ListTargetTablesHere')... |
<filename>conf/eu-conf-scripts/src/main/resources/migrations/service/1.0.2/1.0.2.6__insert_table_geo_group.sql
-- Middle East
INSERT INTO R_GEO_GROUP (NAME, R_REGION)
VALUES ('ASIA', 'Nedj');
INSERT INTO R_GEO_GROUP (NAME, R_REGION)
VALUES ('ASIA', 'Oman');
INSERT INTO R_GEO_GROUP (NAME, R_REGION)
VALUES ('ASIA', 'Aden... |
<gh_stars>1-10
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1)
-- Dumped by pg_dump version 10.12
-- Started on 2020-03-15 16:35:38
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET s... |
alter table repositories add column repo_registry_uri TEXT;
|
<reponame>paper-eth-data-analysis/eth-data-analysis-anon
/* SQL Statements to create the Star Schema for the Data Warehouse. It will only
get filled after the ETL process.
*/
/* Transaction Dimension */
BEGIN;
CREATE TABLE IF NOT EXISTS d_transaction (
transaction_id BIGSERIAL NOT NULL
CONSTRAI... |
<reponame>peterM/Ubiquiti-Unifi-Data-Exporter
USE [master]
GO
CREATE DATABASE [Ubiquiti-Unifi-Backup]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'Ubiquiti-Unifi-Backup', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\Ubiquiti-Unifi-Backup.mdf' , SIZE = 4375040KB , MAXSIZE = UNLIMITE... |
<filename>backend/de.metas.swat/de.metas.swat.base/src/main/sql/postgresql/system/47-de.metas.invoicecandidate/5602330_sys_gh11640_C_Invoice_Candidate_Recompte_AsyncBatch.sql
-- 2021-08-30T06:17:40.469Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD... |
<gh_stars>0
INSERT INTO KIM_ROLE_TYPE_T(ROLE_TYPE_CODE, DESCRIPTION)
VALUES('A', 'AWARD');
COMMIT;
INSERT INTO KIM_ROLES_T(ID, NAME, DESCRIPTION, ROLE_TYPE_CODE, DESCEND_FLAG)
VALUES(15, 'Award Creator', 'Award Creator','A', 'Y');
INSERT INTO KIM_ROLES_T(ID,NAME, DESCRIPTION, ROLE_TYPE_CODE, DESCEND_FLAG)
VALUES(16, ... |
select prof.name as name, cat.name as category, tag.name as tag from prof_cat_tag_lnk lnk
join profile prof on prof.profile_id = lnk.profile_id
left join category cat on cat.category_id = lnk.category_id
left join tag on tag.tag_id = lnk.tag_id; |
--provider--
CREATE TABLE nw.withdrawal_provider(
id BIGSERIAL NOT NULL,
version_id BIGINT NOT NULL,
withdrawal_provider_ref_id INT NOT NULL,
name CHARACTER VARYING NOT NULL,
description CHARACTER VARYING,
proxy... |
-- 业务请求流水记录表
CREATE TABLE `busi_request` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`busi_type` varchar(10) NOT NULL COMMENT '业务类型:10-流程部署,20-流程开启',
`source` tinyint(4) NOT NULL COMMENT '请求来源',
`client_req_no` varchar(30) NOT NULL COMMENT '请求流水号',
`status` tinyint(4) NOT NULL COMMENT '请求状态:0-初始化,... |
-- This code will check for all sections configured for a given column (parameter 1) and load them.
DEF moat369_cur_col_id = '&1.'
UNDEF 1
DEF moat369_sections_file = '&&moat369_sw_folder./00_sections.csv'
-- The variable below will be changed to YES if the code ever enter in 9a
DEF moat369_column_print = 'NO'
@@&&... |
CREATE TABLE all_monetary_01 ( id int, m monetary);
INSERT INTO all_monetary_01 (id, m) VALUES (1, \TL10.15);
INSERT INTO all_monetary_01 (id, m) VALUES (2, \KHR10.15);
INSERT INTO all_monetary_01 (id, m) VALUES (3, \IRP10.15);
INSERT INTO all_monetary_01 (id, m) VALUES (4, \RBL10.15);
INSERT INTO all_monetary_01 (id, ... |
<filename>dummy/db/structure.sql
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = off;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_t... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 27, 2019 at 04:20 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>GUSAR1T0/VXDS-DEV-TOOLS<gh_stars>0
DELETE FROM [enum].[PermissionGroup]
WHERE [Name] = N'Simple Note Service Access & Management'; |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[SQLCop].[test Database and Log files on the same disk]') AND type in (N'P', N'PC'))
DROP PROCEDURE [SQLCop].[test Database and Log files on the same disk]
GO
create procedure [SQLCop].[test Database and Log files on the same disk]
as
begin
-- Wri... |
<gh_stars>0
SELECT
`obelisk`.`id` AS `#`,
`ruin_type`.`name` AS `Type`,
`obelisk_group`.`name` AS `Group`,
`obelisk`.`number` AS `Number`,
`ruin_site`.`id` AS `GS#`,
`system`.`name` AS `System`,
`body`.`name` AS `Body`,
(SELECT COUNT(*) FROM `obelisk`
INNER JOIN `ruinsite_activeobelisks` ON `ruinsite_activeob... |
<filename>GRA.Database/dbo/Stored Procedures/app_LibraryCrosswalk_GetByID.sql
CREATE PROCEDURE [dbo].[app_LibraryCrosswalk_GetByID] @ID INT
AS
SELECT *
FROM [LibraryCrosswalk]
WHERE ID = @ID
|
<reponame>yudi10/api
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 12, 2021 at 12:49 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>enriqueescobar-askida/SqlServerProfiler<filename>Sql/DB-Procedure_listIO.sql
SELECT
SYSP.name AS [StoreProcName]
, PSTA.total_physical_reads AS [TotalPhysicalReads]
, PSTA.total_elapsed_time AS [TotalElapse... |
<reponame>imajaydwivedi/Problem-Task---SQL-Server-Slowness
use Quiz
go
create table dbo.Users
( userid int identity(1,1),
regtime datetime,
username varchar(50),
email varchar(50),
userpass varchar(50)
);
create table dbo.QuestionTechnology
( technologyid INT IDENTITY(1,1),
category char(20),
subcategory varcha... |
<gh_stars>0
-- location_variation_prices --
ALTER TABLE phppos_location_item_variations ADD COLUMN `unit_price` decimal(23,10) DEFAULT NULL,
ADD COLUMN `cost_price` decimal(23,10) DEFAULT NULL; |
TRUNCATE TABLE requests CASCADE
|
/* Initialize the database */
/* Total distance travelled as a school */
CREATE TABLE IF NOT EXISTS total (
distance REAL
);
/* Info stored for each user:
id: used to identify each submission of walk
email: ensure user is part of WRDSB
username: student's name
wrdsbusername: email without the @<EM... |
drop table if exists linux_command_monitor_info;
/*==============================================================*/
/* Table: linux_command_monitor_info */
/*==============================================================*/
create table linux_command_monitor_info
(
oid big... |
<filename>data/open-source/extracted_sql/scooterw_ffi-ogr.sql
select * from table_name where id = '49649d69-25a5-4dde-926d-b43a88c47d17'
|
<reponame>parbhatia/ptr-app-demo
select a.id, a.value from $2~ a where person_id = $1 order by id; |
<reponame>nikbearbrown/INFO_6210<gh_stars>10-100
use final6210;
create or replace VIEW player_poply AS
select ScreenName, Favorited, Players
from nba1nf
where not Players= 'others';
select *from player_poply
order by Favorited desc;
create or replace VIEW pop_users AS
select TwitterID, Favorited
from nba1nf
where ... |
--liquibase formatted sql
--changeset uk.gov.pay:alter_column_service_name_length_on_products
ALTER TABLE products ALTER COLUMN service_name TYPE VARCHAR(50);
--rollback ALTER TABLE products ALTER COLUMN service_name TYPE VARCHAR(255);
|
<reponame>Kahiko/Growthware
CREATE PROCEDURE [ZFP_GET_NVP]
@P_NVP_SEQ_ID int,
@P_ACCT_SEQ_ID int,
@P_SE_SEQ_ID int,
@P_ErrorCode int OUTPUT
AS
IF @P_NVP_SEQ_ID > -1
BEGIN
SELECT
*
FROM
ZFC_NVP
WHERE
ZFC_NVP.NVP_SEQ_ID = @P_NVP_SEQ_ID
END
ELSE
BEGIN
IF @P_ACCT_SEQ_ID > -1
BEGIN -... |
<reponame>Shuttl-Tech/antlr_psql
-- file:json.sql ln:122 expect:true
select to_json(date '2014-05-28')
|
update "AccountDevices"
set "verifyCode" = null,
"isVerified" = true,
"verifiedAt" = CURRENT_TIMESTAMP,
"updatedAt" = CURRENT_TIMESTAMP
where "verifyCode" = ${verifyCode}
returning "isVerified";
|
/*
Warnings:
- You are about to drop the column `followId` on the `Inbox` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Inbox" DROP COLUMN "followId";
|
SELECT dann.mp_claim_id, dann.mp_data_index, dann.ev_supports, dbody.data_type, df.data_field_type, df.value_as_string
FROM ohdsi.mp_data_annotation dann
JOIN ohdsi.oa_data_body dbody ON dann.has_body = dbody.id
JOIN ohdsi.data_field df ON dbody.id = df.data_body_id
WHERE dann.mp_claim_id = '@claimId';
|
DROP TABLE IF EXISTS banner_spec_topic;
DROP TABLE IF EXISTS banner_quote_request;
DROP TABLE IF EXISTS banner_offer;
DROP TABLE IF EXISTS banner_order;
DROP TABLE IF EXISTS banner_spec;
CREATE TABLE banner_spec (
object_id UUID PRIMARY KEY NOT NULL,
reference VARCHAR(255) NOT NULL,
status VARCHAR(20) NOT NULL,
... |
<reponame>babelfish-for-postgresql/babelfish_extensions
USE db_babel_3121;
go
select * from babel_3121_t;
go
select attname, array_to_string(attoptions,',') attoptions from pg_class C, pg_attribute A where C.oid = A.attrelid and C.relname like 'babel_3121_t' and A.attnum > 0 and attisdropped = 'f' order by attname;
g... |
-- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.5.0.5196
-- --------------------------------------------------------
/*... |
-- @testpoint: 根据用户名创建模式,合理报错
--1.create user:success
create user user_schema with password "<PASSWORD>";
--2.create schema with exists user:success
CREATE SCHEMA schema_1 AUTHORIZATION user_schema;
--3.create schema with user which is not exists:fail
CREATE SCHEMA test AUTHORIZATION user_schema1;
CREATE SCHEMA AUTHORI... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 12, 2021 at 08:28 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- Query the NAME
-- field for all American cities in the CITY table
-- with populations larger than 120000. The CountryCode for America is USA.
-- The CITY table is described as
-- follows:
-- CITY
-- FIELD TYPE
-- ID NUMBER
-- NAME VARCHAR2(17)
-- COUNTRYCODE VARCHAR2(3)
... |
<reponame>disik69/dev-it
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Апр 13 2015 г., 15:31
-- Версия сервера: 5.5.38-0ubuntu0.14.04.1
-- Версия PHP: 5.5.9-1ubuntu4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @... |
<reponame>alloucha/Evorganiz
CREATE TABLE `Buffet` (
`idEvent` int(11) NOT NULL,
`idMeal` int(11) NOT NULL,
`pricePerPersonn` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
-- --------------------------------------------------------
--
-- Structure de la table `Contact`
--
CREATE TABLE `Contact`... |
-- MySQL dump 10.16 Distrib 10.1.38-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: apt_rural
-- ------------------------------------------------------
-- Server version 10.1.38-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... |
#start the database in-secure
#mysqld --initialize-insecure
CREATE DATABASE PROJECTMANAGER;
drop table tasks;
drop table parent_tasks;
drop table projects;
drop table users;
CREATE TABLE users (
employee_id VARCHAR(6) NOT NULL,
first_name VARCHAR(50) NULL DEFAULT NULL,
last_name VARCHAR(50) NULL DEFAULT NULL,
st... |
-- # Запросы
-- ## Вставка данных
-- ### Добавляем новый заказ и его товары
start transaction;
insert into orders (status) value (1);
select @o := last_insert_id();
insert into order_items (order_id, device_id) values (@o, 2), (@o, 4), (@o, 7);
commit;
-- ## Обновление данных
-- ### Изменяем статус заказа
update or... |
<reponame>cleuillet/DbModelGenerator<filename>DbModelGenerator.Test/Fixtures/script.sql
CREATE TABLE brand
(
id SERIAL NOT NULL,
name VARCHAR(50) NOT NULL,
logo VARCHAR(200),
archived BOOLEAN DEFAULT '0',
color VARCHAR(100) NOT NULL,
external_id VARCHAR(500... |
create table "Transactions"
(
"OrganizationId" uuid not null,
"AccountId" int not null,
"TransactionId" bigserial,
"TransactionDate" timestamp not null,
"Description" varchar(250),
"Amount" numeric(14,2) not null,
"CreatedOn" timestamp not null default now(),
primary key ("OrganizationId", "AccountId", ... |
<gh_stars>1-10
DROP DATABASE DESKLIT;
create DATABASE DESKLIT;
USE DESKLIT;
CREATE TABLE USER(
ID int NOT NULL AUTO_INCREMENT,
EMAIL varchar(255) NOT NULL,
PASSWORD varchar(255) NOT NULL,
ROLE varchar(255) NOT NULL,
PRIMARY KEY (ID),
UNIQUE KEY unique_email (EMAIL)
);
CREATE TABLE CLIENT(
... |
<filename>src/test/resources/sql/alter_table/999d14a0.sql
-- file:foreign_key.sql ln:764 expect:true
ALTER TABLE fktable ADD CONSTRAINT fk_1_2
FOREIGN KEY (x1) REFERENCES pktable(id2)
|
<filename>src/test/resources/sql/select/dbd2f3ec.sql
-- file:rowsecurity.sql ln:866 expect:true
SELECT * FROM z1 WHERE f_leak(b)
|
CREATE OR REPLACE FUNCTION pgl_ddl_deploy.exclude_regex()
RETURNS text
LANGUAGE sql
IMMUTABLE
AS $function$
SELECT '^(pg_catalog|information_schema|pg_temp.*|pg_toast.*|pgl_ddl_deploy|pglogical|pglogical_ticker|repack)$'::TEXT;
$function$
; |
INSERT INTO RightsOfRoles (descriptionOfRight, adding, removing, commenting, updating)
VALUES ('all rights',true,true,true,true),
('client rights',true,false,true,true);
INSERT INTO Role (typeOfRole)
VALUES
('admin'),
('customer');
INSERT INTO RightsRoleConnect (id_role_Role,id_right_RightsOfRoles)
VALUES ((SELECT ... |
update wpq7_options set option_value = 'http://localhost/ecordel' where option_id = 1;
update wpq7_options set option_value = 'http://localhost/ecordel' where option_id = 2;
-- admin
update wpq7_users SET user_pass='<PASSWORD>';
|
<gh_stars>1-10
ALTER TABLE /*_*/querycache_info DROP KEY /*i*/qci_type, ADD PRIMARY KEY (qci_type);
|
<reponame>sl45sms/carbon-identity-framework
CREATE OR REPLACE PROCEDURE TOKEN_CLEANUP_SP
BEGIN
DECLARE batchSize INTEGER;
DECLARE cursorLimit INTEGER;
DECLARE backupTables INTEGER;
DECLARE sleepTime FLOAT;
DECLARE safePeriod INTEGER;
DECLARE rowCount INTEGER;
DECLARE enableLog BOOLEAN;
DECLARE logLevel VARCHAR(10);
D... |
<reponame>dmankins/Vertica-Extension-Packages
---------------
-- Example of using ngram functions
---------------
CREATE TABLE sentences (sentence varchar(300));
COPY sentences FROM stdin;
SingleWord
This is an input text file
So possibly is equated with possible
This is the final data line
Well maybe not!
The quick ... |
--/*
\connect sduser_db
\set ON_ERROR_STOP on
--*/
-- fncanuserchangetlws says if the user can change this tlws
create or replace function fncanuserchangetlws(
p_sduserid bigint, p_tlws_ownerid bigint, p_tlanguage_ownerid bigint)
returns int
language plpgsql immutable as $$
declare tlws_ownerid bigint;
begin
... |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_N... |
-------------------------------
-- Auxiliar database DATA Model
-------------------------------
CREATE TABLE IF NOT EXISTS image_t
(
-- Observer metadata
observer TEXT, -- Observer full name (family name + surname)
obs_family_name TEXT, -- Observer family name (used o... |
IF NOT EXISTS(SELECT 1 FROM sys.tables WHERE object_id = OBJECT_ID(N'dbo.TabDetails'))
BEGIN
CREATE TABLE dbo.TabDetails
(
Id UNIQUEIDENTIFIER NOT NULL PRIMARY KEY,
[Data] NVARCHAR(MAX) NOT NULL
)
END
GO |
---------------------------------------------------------------------
-- OUTER APPLY
-- 1. Apply right Table Expression to Left Table Rows
-- 2. Add OUTER Rows
---------------------------------------------------------------------
USE TSQLV4
SELECT * FROM Sales.Customers --91
SELECT * FROM Sales.Orders --830
--In... |
<gh_stars>0
CREATE TABLE camddmw.fuel_year_dim
(
fuel_yr_dim numeric(10,0) NOT NULL,
unit_id numeric(12,0) NOT NULL,
op_year numeric(4,0) NOT NULL,
fuel_code character varying(10) COLLATE pg_catalog."default",
fuel_type_description character varying(35) COLLATE pg_catalog."default",
indicator ch... |
<filename>gimnasio.sql
#DROP DATABASE gimnasio;
#CREATE DATABASE gimnasio;
CREATE TABLE gimnasio (
idgimnasio smallint(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
nombre varchar(45) NOT NULL,
dinero float(8,2) NOT NULL
);
INSERT INTO gimnasio (nombre, dinero) VALUES
('Cazadores', 1200.00);
CREATE TABLE membresia ... |
<reponame>brydavis/flow<filename>sql/h2.sql<gh_stars>0
insert into Persons(Id,FirstName,LastName,Birthdate,SSN,Street,City,Zip,State,Race,Latino,Gender,Veteran,MaritialStatus,DisabilityStatus,EducationLevel,EmploymentStatus)
values
('7572AB5C-D4B7-5A8D-226D-77F9E60AAA04','Alexandra','Estrada','1942-09-20','081-48-4868... |
SET DEFINE OFF;
ALTER TABLE AFW_36_TYPE_DON ADD (
CONSTRAINT AFW_36_TYPE_DON_PK
PRIMARY KEY
(SEQNC)
ENABLE VALIDATE)
/
|
-- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64)
--
-- Host: localhost Database: wordpress
-- ------------------------------------------------------
-- Server version 5.7.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULT... |
<reponame>DoctorDib/BikeTheft<filename>api/database/functions/update_vehicle_stat.sql
BEGIN
UPDATE motorwatch.vehicles SET (status) = (api_parameters->>'status')::number
WHERE (api_parameters->>'vehicle_id')::BIGINT = post_id;
RETURNING vehicle_id INTO var_vehicle;
RETURN json_build_object('vehicle', vehicle_id);
... |
CREATE TABLE `AdsSites` (
`ID` INT NOT NULL,
`SiteID` INT NULL,
`Link` VARCHAR(50) NULL,
`AdsSite` VARCHAR(50) NULL,
`WhenAdd` DATETIME NULL
);
CREATE TABLE `AudienceInterestsCategories` (
`ID` INT NOT NULL,
`SiteID` INT NULL,
`Link` VARCHAR(50) NULL,
`Category` VARCHAR(150) NULL
);
CREATE TABLE `Contacts` ... |
<reponame>graindb/graindb-demonstration
/* interactive-complex-2 */
select p_personid, p_firstname, p_lastname, m_messageid, COALESCE(m_ps_imagefile, m_content, ''), m_creationdate
from person, message, knows
where
p_personid = m_creatorid and
m_creationdate <= '2011-07-24 08:00:00' and
k_person1id = 153931... |
<gh_stars>10-100
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER view [dbo].[VRfidData_With_equipSite]
as
SELECT e.ID as equipID,e.FK_MonitoredSite,S.UnicIdentifier,m.Name as site_name,M.Category as site_type,e.StartDate as StartDate,e3.StartDate EndDate,rfid.*
from [ecoReleve_Sensor].[dbo].[T_rfid] rfid... |
BEGIN;
SELECT plan(5);
-- check if table is present
SELECT has_table('community_service'::name, 'addresses'::name);
-- check primary key
SELECT has_pk('community_service', 'addresses', 'should have primary key');
-- check foreign keys
SELECT fk_ok(
'community_service', 'addresses'... |
CREATE PROCEDURE [dbo].[MetadataTagging_GetById]
@Id INT
AS
BEGIN
SELECT [MetadataType], [Recipe], [Ingredient]
FROM [MetadataTagging]
WHERE [Id] = @Id
END
|
-- DECLARE @name as nvarchar(226) = 'LRS.DBO.GPSLRSStatwide'
SELECT [Documentation]
FROM [dbo].[GDB_ITEMS]
WHERE [Name] LIKE @name |
BEGIN;
-- Ireland
UPDATE dim_calendar
SET hol_ie = FALSE
;
-- 1 January
-- New Year's Day Lá Caille or Lá Bliana Nua
UPDATE dim_calendar
SET hol_ie = TRUE
WHERE EXTRACT( DAY FROM calendar_date) = 1
AND EXTRACT( MONTH FROM calendar_date) = 1
;
-- 17 March
-- Saint Patrick's Day <NAME>
-- N... |
DROP TABLE IF EXISTS lineitem_text_partitioned_hive_string;
CREATE EXTERNAL TABLE IF NOT EXISTS lineitem_text_partitioned_hive_string (
l_orderkey INT,
l_partkey INT,
l_suppkey INT,
l_linenumber INT,
l_quantity DOUBLE,
l_extendedprice DOUBLE,
l_discount DOUBLE,
l_tax DOUBLE,
l_return... |
// 使用 explain() 和 hint()
/**
{
"plannerVersion": 1,
"namespace": "test.users",
"indexFilterSet": "false",
"parsedQuery": {
"age": {
"$eq": 42
}
},
"winningPlan": {
"stage": "LIMIT",
"limitAmount": 1,
"inputStage": {
"stage": "COLLSCAN",
"filter": {
"age": {
... |
create table edu_subject
(
id bigint(19) auto_increment
primary key,
parent_id bigint(19) null,
title varchar(64) not null,
sort smallint null,
deleted tinyint(1) null,
create_user_id bigint(19) null,
update_user_id bigint(19) null,
... |
delimiter $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `GetVariantNumber`(argProductID int, argOptionsID int)
BEGIN
select a.i, a.OptionsID
from
(select OptionsID, @s:=@s+1 as i
from optionsreceivingproduct,
(SELECT @s:= 0) AS s
where ToId = argProductID
group by OptionsID) as a
where OptionsID = ... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Oct 27, 2020 at 03:18 PM
-- Server version: 5.7.31-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
GO
CREATE TABLE [DOI].[SysIndexPhysicalStats]
(
[database_id] [smallint] NOT NULL,
[object_id] [int] NOT NULL,
[index_id] [int] NOT NULL,
[partition_number] [int] NOT NULL,
[index_type_desc] [nvarchar] (120) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[alloc_unit_type_desc] [nvarchar] (120) COLLATE SQL_Latin1_General_... |
/*
Navicat Premium Data Transfer
Source Server : 192.168.127.12
Source Server Type : MySQL
Source Server Version : 50726
Source Host : 192.168.127.12:3306
Source Schema : wechat_mall
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date:... |
--
-- Test cube datatype
--
--
-- first, define the datatype. Turn off echoing so that expected file
-- does not depend on contents of cube.sql.
--
\set ECHO none
\i cube.sql
\set ECHO all
--
-- testing the input and output functions
--
-- Any number (a one-dimensional point)
SELECT '1'::cube AS cube;
SELECT '-1':... |
-- @testpoint:opengauss关键字standalone(非保留),作为外部数据源名
--关键字不带引号-成功
drop data source if exists standalone;
create data source standalone;
drop data source standalone;
--关键字带双引号-成功
drop data source if exists "standalone";
create data source "standalone";
drop data source "standalone";
--关键字带单引号-合理报错
drop data source if ... |
CREATE TABLE `budget_bd`.`papel` (
`id` bigint NOT NULL,
`nome` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
-- papel
INSERT INTO `budget_bd`.`papel` (id, nome) VALUES (1, 'ROLE_ADM');
INSERT INTO `budget_bd`.`papel` (id, nome) VALUES (2, 'ROLE_GER... |
<gh_stars>0
/*
* fakeTwitter Table creation script.
*/
/* SET foreign_key_checks=0; */
USE fakeTwitter;
CREATE TABLE IF NOT EXISTS users (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
firstName VARCHAR(30) NOT NULL,
lastName VARCHAR(30) NOT NULL,
username VARCHAR(20) NOT NULL,
createdOn ... |
<filename>modules/sql/Label_getShorttitles.sql<gh_stars>0
SELECT DISTINCT shortTitle FROM datasets
WHERE shortTitle IS NOT NULL |
DELETE FROM bookmarks
WHERE id IN (SELECT id
FROM (SELECT id,
ROW_NUMBER() OVER (partition BY podcast_id, user_id ORDER BY id DESC) AS rnum
FROM bookmarks) t
WHERE t.rnum > 1);
CREATE UNIQUE INDEX bookmarks_unique_idx ON bookmarks (podcast_i... |
-- file:updatable_views.sql ln:579 expect:true
INSERT INTO rw_view3 VALUES (null, null, null, null)
|
-- stl_scan table
CREATE TABLE stl_scan AS SELECT a.n FROM generate_series(1, 30) as a(n);
|
<filename>indexes.sql
select decode(col.column_position,1,col.index_name,''), col.column_name, comm.comments
from dba_ind_columns col, dba_col_comments comm
where col.table_owner = 'OWNER' and col.table_name = 'TABLE_NAME'
and comm.owner (+) = col.table_owner and comm.table_name (+) = col.table_name and comm.column_... |
-- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost Database: memorial
-- ------------------------------------------------------
-- Server version 5.7.29-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_S... |
INSERT INTO department (name)
VALUES (
'Human Resources'
),
(
'Finance'
);
INSERT INTO role (title, salary, department_id)
VALUES (
'Cashier', 75000, 2
),
(
'Human Resources Coordinator', 100000, 1
),
(
'Accountant', 80000, 2
);
INSERT INTO em... |
/**
* PostgreSQL's Public schema, common Library (pubLib)
* Module: general. (simple aliases and basic functions)
*
* Complementing https://www.postgresql.org/docs/current/functions-array.html
*/
-- -- -- -- -- -- -- -- -- -- --
-- Helper functions: avoid.
CREATE or replace FUNCTION iIF(
condition boolean, ... |
CREATE USER IF NOT EXISTS AcmeDemoAdmin;
|
CREATE OR REPLACE FUNCTION test_comments_table()
RETURNS SETOF TEXT
LANGUAGE plpgsql
AS $$
BEGIN
RETURN QUERY SELECT has_table('comments');
-- Columns
RETURN QUERY SELECT columns_are('comments', ARRAY['id',
'patchset_id',
... |
ALTER TABLE `kwf_pages_history` DROP FOREIGN KEY `kwf_pages_history_ibfk_1` ;
ALTER TABLE `kwf_pages_history` DROP FOREIGN KEY `kwf_pages_history_ibfk_2` ;
|
<reponame>Zhaojia2019/cubrid-testcases<filename>sql/_13_issues/_15_1h/cases/bug_bts_14840.sql
AUtocommit off;
drop table if exists t;
create table t(id int primary key,col varchar(10)) partition by range(id)(partition p1 values less than (100),partition p2 values less than (500));
INSERT INTO t SELECT rownum,rownum||'a... |
drop if exists t1,t2;
create table t1 (a int, b varchar(32));
insert into t1 values(1,'ccc');
insert into t1 values(3,'eee');
create table t2 (c int);
insert into t2 values(3);
--Expect return error: CUBRID allow only UNION ALL in recursive CTE
insert into t2 (
with recursive subquery_t1 as(select a from t1 where... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.