sql stringlengths 6 1.05M |
|---|
BEGIN
FOR i IN 1..1000 LOOP
INSERT INTO MSG_DATA (
MSG_ID, MSG_STATUS, VENDOR_ID
) VALUES (
i, 1, 2
);
END LOOP;
COMMIT;
END;
|
select dnumber, count(*)
from dept_locations
group by dnumber
order by count(*) desc
select dname, count(*)
from employee e, department d
where d.dnumber = e.dno
group by dname
having count(*) >= 7
order by dname asc
select d.dependent_name
from dependent d
where d.essn in (
select w.essn
from works_on w, em... |
CREATE TABLE olisuite.t_crtgc_mtrl
(
tbl_seq_nbr bigint NOT NULL,
tbl_vlu_cde character(1) NOT NULL,
tbl_vlu_obslt_ind character(1) NOT NULL,
short_string_text character varying(60) NOT NULL,
string_text character varying(192) NOT NULL,
langid character(3) NOT NULL,
CONSTRAINT t_crtgc_mtrl... |
create table sites
(
id bigint not null,
bpn varchar(255) not null,
created_at timestamp not null,
updated_at timestamp not null,
uuid uuid not null,
name varchar(255) not null,
partner_id bigint not null,
primary key (id)
);
alter ta... |
<reponame>vir37/him
-- phpMyAdmin SQL Dump
-- version 4.2.10.1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Июл 25 2017 г., 22:58
-- Версия сервера: 5.6.21-log
-- Версия PHP: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... |
DROP INDEX uidx_stored_messages_body_hash;
ALTER TABLE stored_messages
DROP COLUMN body_hash; |
<filename>openGaussBase/testcase/KEYWORDS/variadic/Opengauss_Function_Keyword_Variadic_Case0029.sql
-- @testpoint:openGauss保留关键字variadic作为作为表空间名,
--不带引号,合理报错
drop tablespace if exists variadic;
CREATE TABLESPACE variadic RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
--加双引号,创建成功
drop tablespace if exists "var... |
<reponame>nazrinputra/akif
/*
-- Query: SELECT * FROM heroku_672fc5591fe1e7e.packages
LIMIT 0, 50
-- Date: 2022-03-12 13:08
*/
INSERT INTO `packages` (`id`,`slug`,`name`,`price`,`frequency`,`duration`,`description`,`promotion`,`created_at`,`updated_at`,`deleted_at`) VALUES (4,'sanitising-nano-mist-odor-eliminator','SA... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS gnosis_protocol_v2.batches
(
block_time timestamptz NOT NULL,
num_trades int8 NOT NULL,
dex_swaps int8 NOT NULL,
batch_value numeric,
gas_per_trade numeric,
solver_address bytea NOT NULL,
solver_name text,
... |
<filename>DB/SPs/c_voteEntity.sql
DELIMITER $$
DROP PROCEDURE IF EXISTS `c_voteEntity`$$
CREATE DEFINER=`root`@`localhost` PROCEDURE `c_voteEntity`(
in _id int,
in _direction int, # 1 for up, -1 for down.
in _by int # Defaults to 1 - should be a positive int >= 1.
)
BEGIN
# Upvote or down... |
USE mountain_project -- Initialise the DB to use
-- [INSPECTION] Check null in the initial raw data
SELECT
COUNT(*)-COUNT(Length) AS null_Length
,COUNT(*)-COUNT(Area_Latitude) AS null_Latitude
,COUNT(*)-COUNT(Area_Longitude) AS null_Longitude
,COUNT(*)-COUNT(Route) AS null_Route
--,COUNT(*)-COUNT(Route_Typ... |
<gh_stars>0
/*done 14/08/2019*/
alter table price_request_item
drop column date_request_item_add,
drop column id_user_edit,
drop column date_request_item_edit,
drop column id_user_delete,
drop column date_request_item_delete;
create view detail_quotation as
select
quotation.id_submit_quotation,
quotation.id_qu... |
-- 2020-05-26 11:08:23 : remove-colum
ALTER TABLE "CapabilityMember"
DROP CONSTRAINT "FK_CapabilityMember_CapabilityId_CapabilitySlackChannelId";
ALTER TABLE "CapabilityMember"
DROP COLUMN "CapabilitySlackChannelId";
|
<gh_stars>1-10
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 100419
Source Host : localhost:3306
Source Schema : si_kemah
Target Server Type : MySQL
Target Server Version : 100419
File Encoding : 65001
D... |
<reponame>praveenkandasamy/T-SQL_MicrosoftLearning-QueryingT-SQL-f581358
/****** Script for SelectTopNRows command from SSMS ******/
SELECT *
FROM [SalesLT].[Product]
SELECT productnumber
FROM [SalesLT].[Product]
WHERE ProductNumber LIKE 'FR%';
|
CREATE TABLE "public"."tags"("artwork_id" uuid NOT NULL, "tag" text NOT NULL, PRIMARY KEY ("tag") , FOREIGN KEY ("artwork_id") REFERENCES "public"."artworks"("id") ON UPDATE restrict ON DELETE cascade, UNIQUE ("tag"));
|
-- original: exec.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
CREATE TABLE t1(a,b);
INSERT INTO t1 VALUES(1,2);
SELECT * FROM t1
;CREATE TABLE t2(x, y); |
<gh_stars>10-100
-- Midas Server. Copyright Kitware SAS. Licensed under the Apache License 2.0.
select 'Starting migration ', CURTIME() as '';
CREATE TABLE IF NOT EXISTS `tracker_submission2item` (
`submission_id` bigint(20) NOT NULL,
`item_id` bigint(20) NOT NULL,
`label` varchar(255) NOT NULL,
`trendgroup_id... |
UPDATE
studyaccess.staff
SET
is_owner = ?
WHERE
staff_id = ?
|
CREATE TABLE lc_member (
id bigint(20) NOT NULL COMMENT '主键id',
mobile varchar(20) DEFAULT NULL COMMENT '手机号',
id_card_no varchar(25) DEFAULT NULL COMMENT '身份证号',
real_name varchar(50) DEFAULT NULL COMMENT '真实姓名',
is_real int(1) NOT NULL COMMENT '是否实名:0-否,1-是',
is_del int(1) NOT NULL COMMENT '是否删除: 0-否,1-是... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 08, 2021 at 09:34 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
CREATE DATABASE IF NOT EXISTS `Catering` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `Catering`;
-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (i686)
--
-- Host: localhost Database: Catering
-- ------------------------------------------------------
-- Server version 5.6.28
/*!40101 SET @OLD_CHARACTER... |
--
-- Copyright 2016-2021 Micro Focus or one of its affiliates.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required... |
-- [er]create serial using INCREMENT BY and MINVALUE wrong order
create serial ser1
MINVALUE 222
INCREMENT BY -2;
select * from db_serial WHERE name='ser1';
drop serial ser1;
|
--+ holdcas on;
set names utf8;
--test
select repeat('Ğülen',0);
--test
select repeat('Ğü',-1);
--test
select repeat('Ğu',32000000);
--test
select repeat('Ğu',16000000);
set names iso88591;
commit;
--+ holdcas off;
|
-- @testpoint: 一维数组时,array和element的类型不一致,但存在隐式数据类型转换,部分合理报错
--数值型
select array_remove(array[1,2,2,3], '2');
select array_remove(array[1.223,2,3.145], '3.145');
select array_remove(array[1.223,2,3.145], '3.1450');
select array_remove(array[0.3,2,3.145], '0.3');
select array_remove(array[-1.2,2,3.145], '-1.2');
select a... |
create table mtt_story(
id int(8) not null primary key auto_increment,
content text not null
);
create table mtt_user
(
id int(8) not null primary key auto_increment,
name varchar(64) not null,
avatar_url varchar(128) not null
);
create table mtt_userrefstory
(
id int(8) not null primary key auto_increment,
us... |
BEGIN;
ALTER TABLE guilds ADD COLUMN embed_twitter_videos boolean DEFAULT 'false' NOT NULL;
COMMIT; |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 10, 2017 at 05:42 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
USE `RMCDR3`;
ALTER TABLE `tblUsageDetailFailedCall`
ADD COLUMN `disposition` VARCHAR(50) NULL DEFAULT NULL;
ALTER TABLE `tblUsageDetails`
ADD COLUMN `disposition` VARCHAR(50) NULL DEFAULT NULL;
DROP PROCEDURE IF EXISTS `prc_unsetCDRUsageAccount`;
DELIMITER |
CREATE PROCEDURE `prc_unsetCDRUsageAccount`(
IN `p_Comp... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Apr 30, 2019 at 03:16 PM
-- Server version: 5.7.24
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
CREATE PROCEDURE [dbo].[pStationsNear]
@latitude float,
@longitude float,
@size int = 5000
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT TOP( @size) station.*, j.Occupied, dbo.[GetDista... |
--USE WorkOrders
--drop table if exists [Parts];
--drop table if exists [Orders];
--drop table if exists [Customers];
--drop table if exists [Customer];
SET IDENTITY_INSERT Orders On;
insert into Orders (OrderId, CustomerId, RepairDate, TechName, LicencePlate, VehicleYear, VehicleMake, VehicleModel, Mileage, Lube,... |
<filename>perpustakaan4.sql
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 23, 2020 at 08:55 AM
-- Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zon... |
--
-- Copyright (c) Microsoft Corporation. All rights reserved.
-- Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
--
CREATE PROCEDURE [dbo].[GetEmailJobs] @Take int = 50
,@FromPartitionId int = null
,@FromUserId uniqueidentifier = ... |
CREATE TABLE egeis_employeeDocuments (
id BIGINT NOT NULL,
employeeId BIGINT NOT NULL,
document CHARACTER VARYING(1000) NOT NULL,
referenceType CHARACTER VARYING(25),
referenceId BIGINT,
tenantId CHARACTER VARYING(250) NOT NULL,
CONSTRAINT pk_egeis_employeeDocuments PRIMARY KEY (Id),
CONSTRAINT uk_egeis_employ... |
<gh_stars>1-10
select * from ChoosenMeals
delete from ChoosenMeals
select * from Menu
delete from Menu
select * from Eatery
delete from Eatery
select * from Meal
delete from Meal
select * from MyUser
delete from MyUser
where login != 'puma'
|
<gh_stars>100-1000
SET @sName = 'bx_stripe_connect';
-- LOGS
DELETE FROM `sys_objects_logs` WHERE `object`='bx_stripe_connect';
INSERT INTO `sys_objects_logs` (`object`, `module`, `logs_storage`, `title`, `active`, `class_name`, `class_file`) VALUES
('bx_stripe_connect', 'bx_stripe_connect', 'Auto', '_bx_stripe... |
<filename>db/migrations/20200929221041_add-kv-table.up.sql
CREATE TABLE "kv" (
"key" text NOT NULL,
"value" jsonb NOT NULL,
PRIMARY KEY ("key")
); |
<reponame>dram/metasfresh
DROP VIEW IF EXISTS db_columns_fk$new
;
CREATE OR REPLACE VIEW db_columns_fk$new AS
SELECT v.TableName
, v.ColumnName
, v.table_ref AS Ref_TableName
, v.TableName_EntityType
, v.ColumnName_EntityType
, v.AD_Reference_ID
, v.AD_Reference_Name... |
select define_function_args('category__change_parent','category_id,tree_id,parent_id');
select define_function_args('category__del','category_id');
select define_function_args('category__edit','category_id,locale,name,description,modifying_date,modifying_user,modifying_ip');
select define_function_args('category__name... |
<gh_stars>0
-- create user anonymous
INSERT INTO t_user (uuid, datecreated, lastmodified, email, firstname, lastname, login, password, enabled) VALUES
('<PASSWORD>-<PASSWORD>-<PASSWORD>-8<PASSWORD>-ff5432c95514', '2015-01-02 15:33:45.154024', '2015-01-02 15:33:45.154024',
'<EMAIL>', 'anonymous', 'anonymous', 'anon... |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : MySQL
Source Server Version : 50722
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50722
File Encoding : 65001
Date: 2018-11-30 19:35:09
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
<reponame>hjsuh18/timescaledb
CREATE OR REPLACE FUNCTION _timescaledb_internal.dimension_calculate_default_range_open(
dimension_value BIGINT,
interval_length BIGINT,
OUT range_start BIGINT,
OUT range_end BIGINT)
AS '@MODULE_PATHNAME@', 'dimension_calculate_open_range_defau... |
<reponame>ThomasObenaus/goms<gh_stars>1-10
create table public.company (id SERIAL PRIMARY KEY,name varchar(300),duns varchar(27),spin bigint,city varchar(200),country varchar(90),type varchar(255) DEFAULT 'REGULAR');
create table public.iam_user (id SERIAL PRIMARY KEY,iam_id varchar(50),email varchar(200),name varchar(... |
<filename>src/FunnelWeb/DatabaseDeployer/Scripts/Script0027_sqlce.sql
--Adding in a few other revision fields into entry table
alter table $schema$.[Entry] add
[LastRevised] datetime null,
[LatestRevisionFormat] nvarchar(20) null,
[TagsCommaSeparated] nvarchar(255) null
go
--sqlce doesnt need data migration... |
DELIMITER //
CREATE OR REPLACE PROCEDURE create_game_member (
IN gameID_in int,
IN playerID_in int,
IN teamID_in int,
IN number_in int,
IN goals_in int,
IN cleanSheet_in int,
IN yellowCards_in int,
IN redCards_in int
)
BEGIN
... |
<reponame>wantox86/translateidbot<filename>script/bot.sql
-- MySQL dump 10.13 Distrib 5.6.26, for Win64 (x86_64)
--
-- Host: localhost Database: mydownloader
-- ------------------------------------------------------
-- Server version 5.6.26
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... |
-- Calculate revenue
SELECT SUM (meal_price * order_quantity) AS revenue
FROM meals
JOIN orders
ON meals.meal_id = orders.meal_id
-- Keep only the records of customer ID 15
WHERE user_id = '15';
SELECT DATE_TRUNC('week', order_date) :: DATE AS delivr_week,
-- Calculate revenue
SUM(meal_price * ord... |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 02-11-2020 a las 20:39:34
-- Versión del servidor: 5.7.32
-- Versión de PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jul 17, 2019 at 01:50 AM
-- Server version: 5.6.44-cll-lve
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
<reponame>christophanneser/Bao-for-Presto
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 = tq... |
select ClienteAnimal.cod_cadastro,cliente.nomeCliente,tipo.nome_tipo_animal,pesoAnimal,corAnimal
from tb_clienteanimal ClienteAnimal
inner join tb_cliente cliente on cliente.CodCliente = ClienteAnimal.cod_cliente
inner join tb_tipo_animal tipo on tipo.cod_tipo_animal = ClienteAnimal.cod_tipo_animal order by cliente.nom... |
INSERT INTO [Towns] ([Id], [Name]) VALUES
(1, 'Sofia'),
(2, 'Plovdiv'),
(3, 'Varna')
INSERT INTO [Minions] ([Id], [Name], [Age], [TownId]) VALUES
(1, 'Kevin', 22, 1),
(2, 'Bob', 15, 3),
(3, 'Steward', NULL, 2) |
<filename>sql/removing-records-using-paging.sql
use [dbName]
/* Removing data from large table in MSSQL using batch */
CREATE TABLE [Logs] (
[LogId] INTEGER NOT NULL IDENTITY(1, 1),
[Text] VARCHAR(MAX) NULL,
[Severity] VARCHAR(7) NULL,
[Created] DATETIME,
PRIMARY KEY ([LogId])
);
GO
INSERT INTO... |
-- 2020-11-16T09:01:56.772Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Val_Rule (AD_Client_ID,AD_Org_ID,AD_Val_Rule_ID,Code,Created,CreatedBy,Description,EntityType,IsActive,Name,Type,Updated,UpdatedBy) VALUES (0,0,540524,'1=1
and exists
( select 1 from ( select plv.M_PriceList... |
--
-- Copyright (C) 1998-2011 enStratusNetworks LLC
--
-- ====================================================================
-- 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://ww... |
<gh_stars>1-10
alter table idea add user_id INT; |
<reponame>nmbazima/SQL-Scripts<gh_stars>1-10
---------------------------------------------------------------------
-- LAB 04
--
-- Exercise 3
---------------------------------------------------------------------
USE TSQL;
GO
---------------------------------------------------------------------
-- Task 1
-------------... |
CREATE OR REPLACE FUNCTION core.tf_i_src_ocean_trg_c_revenue_type_i()
RETURNS INTEGER AS $$
/*
=============================================================================================================
DESCRIPTION: Insert data from stage 'ocean_*' tables into core input table revenue_type_i
A... |
<reponame>m-lab/prometheus-support<filename>config/federation/bigquery/bq_ndt_geohash_client.sql
#standardSQL
CREATE TEMP FUNCTION EncodeGeoHASH(latitude FLOAT64, longitude FLOAT64, hashLength INT64)
RETURNS STRING
LANGUAGE js AS """
/**
* Function sources derived from node-geohash library:
* https://github.com/sunn... |
-- // CB-3210 refactor telemetry models (v2)
-- Migration SQL that makes the change goes here.\
UPDATE
component SET attributes = jsonb_set(attributes::jsonb,
'{fluentAttributes}' , '{}' )::text
WHERE componenttype = 'TELEMETRY' AND attributes is not null AND attributes::text <> 'null';
UPDATE
... |
<gh_stars>0
-- Simple scalar/primitive values contain only the identical value:
SELECT '"foo"'::jsonb @> '"foo"'::jsonb;
-- The array on the right side is contained within the one on the left:
SELECT '[1, 2, 3]'::jsonb @> '[1, 3]'::jsonb;
-- Order of array elements is not significant, so this is also true:
SELECT '[1... |
<filename>results.sql
-- MySQL dump 10.13 Distrib 8.0.20, for macos10.15 (x86_64)
--
-- Host: localhost Database: job_hacks
-- ------------------------------------------------------
-- Server version 8.0.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@... |
SELECT 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
A... |
DECLARE @FY1M AS INT = 7;
WITH
-- --------------------------------------------------------------
ONES AS ( SELECT * FROM (VALUES (0), (1), (2), (3), (4),(5), (6), (7), (8), (9)) AS numbers(X))
-- --------------------------------------------------------------
,CALENDAR_YEARS AS (
SELECT fourdigits.num AS CY
FROM (SE... |
<filename>tpflow.sql
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1_3306
Source Server Version : 50553
Source Host : 127.0.0.1:3306
Source Database : tpflow
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-07-19 10:39:14
*/
SET FO... |
CREATE TABLE usuario(
nome VARCHAR(250),
cadEmail VARCHAR(250),
permissao VARCHAR(50),
empresa VARCHAR(150),
cadSenha VARCHAR(400),
ID INT PRIMARY KEY AUTO_INCREMENT
)ENGINE=MyISAM DEFAULT CHARSET=utf8;
SELECT * FROM usuario;
DROP TABLE usuario;
CREATE TABLE email(
nome VARCHAR(250),
telefone VARCHAR(80),
email VA... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 08, 2020 at 11:11 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
<reponame>baajarmeh/lara-films<filename>db/film-rest-dump.sql
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: lara-films
-- ------------------------------------------------------
-- Server version 8.0.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!401... |
<reponame>kieranhogan13/SQL<gh_stars>0
DROP TABLE Purchase CASCADE CONSTRAINTS PURGE;
DROP TABLE Customer CASCADE CONSTRAINTS PURGE;
DROP TABLE Flight_Package CASCADE CONSTRAINTS PURGE;
DROP TABLE Flight CASCADE CONSTRAINTS PURGE;
DROP TABLE Hotel_Package CASCADE CONSTRAINTS PURGE;
DROP TABLE Hotel CASCADE CONSTR... |
-- <Dolibase dictionary table example>
-- Copyright (C) <2018> <AXeL>
CREATE TABLE llx_books_dict(
rowid INTEGER AUTO_INCREMENT PRIMARY KEY,
label VARCHAR(255) NOT NULL,
active INTEGER DEFAULT 1
);
|
<filename>src/test/resources/count.test_6.sql
-- count.test
--
-- execsql {
-- INSERT INTO t1 SELECT * FROM t1; -- 512
-- INSERT INTO t1 SELECT * FROM t1; -- 1024
-- INSERT INTO t1 SELECT * FROM t1; -- 2048
-- INSERT INTO t1 SELECT * FROM t1; -- 4096
-- ... |
<reponame>pavithrakamath/vendingmachine
DROP TABLE IF EXISTS VENDING_MACHINE;
CREATE TABLE VENDING_MACHINE(
id varchar(250) PRIMARY KEY,
five_rupee_count int,
ten_rupee_count int,
twenty_rupee_count int
);
CREATE TABLE ITEM(
id varchar(250) PRIMARY KEY,
name varchar(250),
price int
);
CREATE TABLE SLOT(... |
<reponame>Voltariuss/Sn0wYzZ<gh_stars>0
CREATE TABLE IF NOT EXISTS Point
(
userId VARCHAR(255) PRIMARY KEY NOT NULL,
number INT DEFAULT 0
);
ALTER TABLE Point ADD CHECK (number >= 0);
|
CREATE TABLE jansClnt_Interleave (
doc_id STRING(64) NOT NULL,
objectClass STRING(48),
dn STRING(128),
) PRIMARY KEY(doc_id);
CREATE TABLE jansClnt_Interleave_jansRedirectURI (
doc_id STRING(64) NOT NULL,
dict_doc_id INT64 NOT NULL,
jansRedirectURI STRING(MAX),
) PRIMARY KEY(doc_id, dict_doc_id),
INTERLE... |
<reponame>EIDSS/EIDSS-Legacy<filename>EIDSS v6.1/eidss.avr.service.db/dbo/Stored Procedures/spAsViewCachePostHeader.proc.sql
-- =============================================
-- Author: <NAME>.
-- Create date: 25.06.2013
-- Description: insert binary header of View cache record
-- ===============================... |
ALTER TABLE `submission`
DROP FOREIGN KEY `fk_submission_2`;
ALTER TABLE `submission`
ADD CONSTRAINT `fk_submission_2`
FOREIGN KEY (`post_id`)
REFERENCES `post` (`id`)
ON DELETE SET NULL
ON UPDATE NO ACTION;
|
drop table if exists tbl_account;
create table tbl_account(
id number(12) primary key not null ,
name varchar not null,
age int(2) not null ,
sex char(2) not null ,
password varchar(80) not null ,
role varchar(10) not null
); |
/*{**************************************************************************
PROGRAMA LEOPARD DATABSE FIREBIRD - VERSAO 2.5.XX
ANALISTA: <NAME>.
DATA.: 08/07/2021
OBJETIVO: CALCULA E EXTRAI INFORMAÇÕES PARAO LIVRO DE MOVIMENTAÇÕES DE CAIXA
SOBRE.:
********... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 23, 2019 at 05:13 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
/*
SQLyog Community v13.1.6 (64 bit)
MySQL - 10.5.8-MariaDB-1:10.5.8+maria~focal : Database - adnc_maint_dev
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 S... |
UPDATE `#__updates` SET `detailsurl` = replace(`detailsurl`, 'http://www.en.joomgallery.net/','https://www.joomgalleryfriends.net/') where `detailsurl` like '%www.en.joomgallery.net/%';
UPDATE `#__updates` SET `detailsurl` = replace(`detailsurl`, 'http://www.joomgallery.net/','https://www.joomgalleryfriends.net/') wher... |
-- CreateTable
CREATE TABLE "AutomationRecordHistory" (
"id" SERIAL NOT NULL,
"automationRecordId" INTEGER,
"success" BOOLEAN NOT NULL DEFAULT false,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT "AutomationRecordHistory_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER... |
INSERT INTO students (first_name, last_name)
VALUES
('Yassir', 'Aguila'),
('Wilfredo', 'Aguila')
;
INSERT INTO classes (code, title, description)
VALUES
('RED-514-V2-P1', 'Network Security', 'Provide to student the ability to manage networks in terms of information security.'),
... |
/*
Ciclos
------
MySQL provee sentencias de bucle que permiten ejecutar un bloque de código SQL de forma
repetitiva basándose en una condición. Existen tres tipos: WHILE, REPEAT y LOOP.
La sintaxis de WHILE es la siguiente:
WHILE expresion DO
sentencias;
END WHILE
La sintaxis de REPEAT es la siguiente:
REPEAT
s... |
-- Select the Inspection Details for a Given Id
SELECT i.inspection_visit_id, i.license_id, i.inspection_number,
i.visit_number, i.inspection_class, i.inspection_type,
i.inspection_disposition, i.inspection_date, i.total_violations,
i.high_priority_violations, i.intermediate_violations,
i.ba... |
<reponame>grazies/Phoenix
CREATE TABLE [dbo].[Groups] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[GroupName] VARCHAR (100) NOT NULL,
[GroupDescription] VARCHAR (MAX) NULL,
[Config] VARCHAR (MAX) NULL,
[TagData] VARCHAR (MAX) NULL,
[TagId] I... |
CREATE TABLE IF NOT EXISTS `quotes`(
id INT PRIMARY KEY AUTO_INCREMENT,
quote_name VARCHAR(255) NOT NULL,
created_by VARCHAR(30) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
ON UPDATE CURRENT_TIMESTAMP
); |
create or replace function get_cards_contains(input varchar)
returns setof cards
language plpgsql
as $$
begin
return query
select * from cards
where
name ~~* input or
realname ~~* input
order by name;
end
$$; |
INSERT INTO group_assignable_role (role_id, group_id, automatic)
select role_id, group_id, 1 from groups, roles
where group_code like 'PECS_%'
and group_name not like 'PECS Court%'
and role_code = 'PECS_PER_AUTHOR'
|
<filename>sql/export_urls_for_researchers.sql
-- need to replace version with null for researcher version
create or replace view all_locations as (
select all_locations.*
from pub c
cross join lateral
jsonb_to_recordset(locations) as all_locations(doi text, url text, is_best bool, license text, updated time... |
pragma foreign_keys = ON;
create table P(A integer primary key);
create table C(A integer references P(A));
begin;
pragma defer_foreign_keys = ON;
insert into C values(0); -- 外部キー制約違反(親がない)
select * from C;
commit;
|
<filename>Tests/AnnotationHostPlatformTests.class.sql
EXEC tSQLt.NewTestClass 'AnnotationHostPlatformTests';
GO
CREATE FUNCTION AnnotationHostPlatformTests.[SomePlatform]()
RETURNS TABLE
AS
RETURN SELECT NULL AS ProductVersion, NULL AS Edition, 'SomePlatform' AS HostPlatform;
GO
CREATE FUNCTION AnnotationHostPlatformTe... |
<filename>src/main/resources/db/migration/V3__Create_question_table.sql
CREATE TABLE question
(
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(50),
description TEXT,
gmt_create BIGINT,
gmt_modified BIGINT,
creator INT,
comment_count INT DEFAULT 0,
view_count INT DEFAULT 0,
like_cou... |
INSERT INTO permission (id, version, auth_key, auth_uris, entity, http_method, creator_id, modifier_id)
VALUES (1,0,'Index RolePermission','/v[\\d]+/role-permission','RolePermission','GET',1, 1);
INSERT INTO permission (id, version, auth_key, auth_uris, entity, http_method, creator_id, modifier_id)
VALUES (2,0,'Create ... |
-- Revert ggircs-portal:policies/ciip_user_policies from pg
begin;
drop policy ciip_administrator_select_ciip_user on ggircs_portal.ciip_user;
drop policy ciip_administrator_insert_ciip_user on ggircs_portal.ciip_user;
drop policy ciip_administrator_update_ciip_user on ggircs_portal.ciip_user;
drop policy ciip_analy... |
CREATE TABLE placex (
place_id BIGINT NOT NULL,
parent_place_id BIGINT,
linked_place_id BIGINT,
importance FLOAT,
indexed_date TIMESTAMP,
geometry_sector INTEGER,
rank_address SMALLINT,
rank_search SMALLINT,
partition SMALLINT,
indexed_status SMALLINT,
osm_id int8 NOT NULL,
osm_type char(1) NOT ... |
DELETE FROM public.order;
|
<gh_stars>1000+
SELECT tbl_name
FROM sqlite_master
WHERE type='table'
AND tbl_name <> 'sqlite_sequence'
~:[~*~;AND (~{~a~^~&~10t or ~})~]
~:[~*~;AND (~{~a~^~&~10t and ~})~]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.