sql stringlengths 6 1.05M |
|---|
-- This file should undo anything in `up.sql`
ALTER TABLE user_lists
DROP CONSTRAINT user_lists_list_id_fkey,
ADD CONSTRAINT user_lists_list_id_fkey
FOREIGN KEY (list_id)
REFERENCES lists(list_id);
|
SELECT
i.repository_id,
r.name,
COUNT(i.repository_id) AS 'issues'
FROM repositories AS r
JOIN issues AS i
ON r.id = i.repository_id
GROUP BY i.repository_id
ORDER BY
issues DESC,
i.repository_id ASC
LIMIT 5; |
<reponame>navt/landing-frame<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- База данных: `page_gen`
--
-- --------------------------------------------------------
--
-- Структура таблицы `blocks`
--
... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jul 08, 2019 at 08:08 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.2.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
INSERT INTO "channel"("i_d", "lock", "name" ,"active","creator_id", "created_at" )
VALUES (1, 'f', 'ปลีก','t', 1, '2018-03-12 08:34:14.362534+07');
|
<gh_stars>1-10
CREATE OR REPLACE VIEW BOLIB.PERSONL2 (
-- SQL1506 30 Key or attribute for PERSONL2 in BOLIB ignored.
PERSONID ,
FIRSTNAME ,
LASTNAME ,
AGE )
AS
SELECT
PERSONID ,
FIRSTNAME ,
LASTNAME ,
AGE
FROM BOLIB.PERSON
RCDFMT PERSONFMT ;
LABEL ON TABLE BOLIB.... |
CREATE TABLE IF NOT EXISTS role
(
ID INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
ROLE_NAME VARCHAR(20)
);
CREATE TABLE IF NOT EXISTS user
(
ID INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, -- KEY
USERNAME VARCHAR(15) UNIQUE, ... |
<reponame>betagouv/signalement-api
INSERT INTO USERS VALUES ('e6de6b48-1c53-4d3e-a7ff-dd9b643073cf', NULL, '$2a$10$z5OdWpY05I9tvCJt0EplWOqLWLi6TFCyzZA4DoVlvCWbjmgCsQzwC', 'Test', 'Admin', 'Admin', '<EMAIL>');
INSERT INTO USERS VALUES ('2678bc13-988a-40ff-8e25-5223750c5e00', NULL, '$2a$10$z5OdWpY05I9tvCJt0EplWOqLWLi6TFC... |
<reponame>AxelTerizaki/karaokemugen-app
ALTER TABLE playlist ADD COLUMN flag_autosortbylike BOOLEAN; |
<reponame>ashishtheapexian/Apex_Profiler
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script connected to SQL*Plus as the Or... |
<gh_stars>1-10
-- AlterTable
ALTER TABLE `users` ADD COLUMN `is_admin` BOOLEAN NOT NULL DEFAULT false;
|
/*
Script that deletes metadata older than a given date.
Note that anchor identities will remain in order to
indicate that they have once been assigned and to
avoid any possible future reuse. Any rows in attributes
or ties referencing these will be deleted, so pruning
old values will result in both storage an... |
<filename>back/product-service/database/create_homepage_products.sql<gh_stars>1-10
INSERT INTO
products (name, category, price, stock, description)
VALUES
('guitar_tshirt', 'homepage', 1, 0, 'guitar_tshirt'),
('afro_tshirt', 'homepage', 2, 1, 'afro_tshirt'),
('colorful_shirt', 'homepage', 3, 2, 'colorful_shirt'),
... |
-- file:domain.sql ln:52 expect:false
short
\.
select * from basictest
|
<filename>backend/app/adapter/sqldb/migration/21_create_google_sso_table.sql
-- +migrate Up
CREATE TABLE google_sso
(
google_user_id CHARACTER VARYING(254) NOT NULL UNIQUE,
short_user_id CHARACTER VARYING(5) NOT NULL UNIQUE,
FOREIGN KEY (short_user_id) REFERENCES "user"(id)
ON UPDATE CASCADE
... |
DROP TABLE IF EXISTS segments; |
-- [data_testing].[GenerateTestSetupScript]
--
-- Returns the setup script for a given test for all assignments.
--
--
--
--
-- EXEC [data_testing].[GenerateTestSetupScript]
--
--------------------------------------------------------------------------------
-- Change History
----------------------------------------... |
/*
Navicat MySQL Data Transfer
Source Server : myself
Source Server Version : 50553
Source Host : localhost:3306
Source Database : tcyyv5
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2017-11-24 16:09:02
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... |
/*
Navicat MySQL Data Transfer
Source Server : www.zhongguoshebaodaili
Source Server Version : 50148
Source Host : qdm178515225.my3w.com:3306
Source Database : qdm178515225_db
Target Server Type : MYSQL
Target Server Version : 50148
File Encoding : 65001
Date: 2017-12-0... |
ALTER TYPE af.list_type ADD VALUE 'grey'; |
<reponame>bobheadlabs/sourcegraph<gh_stars>1-10
ALTER TABLE IF EXISTS users ADD COLUMN IF NOT EXISTS searchable BOOLEAN NOT NULL DEFAULT TRUE;
|
DROP DATABASE IF EXISTS ss;
CREATE DATABASE ss;
USE ss;
CREATE TABLE t1(a INT);
SHOW FIELDS FROM t1;
DROP DATABASE IF EXISTS ss;
|
<reponame>kltm/go-site<filename>scripts/legacy-sql/migrate/changes-2007-10-08.sql
--- @@ homolset
--- A collection of genes or gene products from a common evolutionary lineage.
--- The purpose of this table is to group homologous sets of gene products
--- to query for shared and divergent biological function.
--- The... |
create table achievements_hunt.game_stats
(
id serial primary key,
platform_id integer not null,
game_id integer not null,
ext_id varchar(1024) not null,
name varchar(1024) not null,
dt_create timestamp with time zone default current_timestamp not null,
dt_u... |
<reponame>dmsardhty/SQL-Hackerrank<filename>SQL Files/Hackerrank SQL Answers/Olliviander's Inventory.sql
/*
<NAME> and his friends are at Ollivander's with Ron, finally replacing Charlie's old broken wand.
Hermione decides the best way to choose is by determining the minimum number of gold galleons needed to buy each n... |
SELECT EmployeeID, FirstName, LastName, CurrentSalary
FROM Employees
WHERE CurrentSalary > 3000
AND DivisionID = 2;
|
-- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 30, 2019 at 02:01 AM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.1.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
USE [Tokenisation]
GO
--Create new table - APIAuth
CREATE TABLE [Tokenisation].[dbo].[APIAUTH](
[ID] [int] NOT NULL IDENTITY(1,1),
[SYSTEMNAME] [varchar](10) NOT NULL,
[BUSINESSENTITY] [varchar](10) NOT NULL,
[DOMAIN] [varchar](10) NOT NULL,
[APINAME] [varchar](10) NOT NULL
CONSTRAINT [pk_APIAUTHorization] PRIMA... |
<filename>Demos/Mod04_Demos/01 - Union.sql
-- Setup
CREATE OR ALTER VIEW [SalesLT].[Customers]
AS
select distinct firstname,lastname
from saleslt.customer
where lastname >='m'
or customerid=3;
GO
CREATE OR ALTER VIEW [SalesLT].[Employees]
as
select distinct firstname,lastname
from saleslt.customer
where lastname <='m'... |
-- Variables
DECLARE @status INT
DECLARE @deleted INT
DECLARE @mex_id INT
-- Initialise output
SET @deleted = 0
-- Select business rule ID
SELECT @mex_id = max(mex_id)
FROM t_mex_type
WHERE mex_type = #{mex_type}
AND version_id = #{version_id}
-- Check that business rule exists
IF @mex_id IS NOT ... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 22 Feb 2022 pada 15.36
-- Versi server: 10.4.17-MariaDB
-- Versi PHP: 8.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
--Architecture information
--(-1)DBMS: Sql server 2012.
--(-2)Edition: Express Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1)
--(-3)Version: 11.0.2100.60 (X64)
--(-4)Operative system: Microsoft windows 7 professional (x64)
--This code creates the Phonebook database.
--IMPORTANT: read informati... |
ALTER TABLE `[prefix]groups_permissions` DROP INDEX `id`;
ALTER TABLE `[prefix]groups_permissions` DROP INDEX `permission`;
ALTER TABLE `[prefix]groups_permissions` ADD PRIMARY KEY ( `id` , `permission` ) ;
ALTER TABLE `[prefix]users_permissions` DROP INDEX `id`;
ALTER TABLE `[prefix]users_permissions` DROP INDEX `perm... |
drop table if exists `user`;
create table `user`
(
`id` int(11) auto_increment not null,
`nickname` varchar(30) unique not null,
`password` varchar(100) default null,
primary key (`id`)
) engine = InnoDB
default charset = utf8mb4
default collate = utf8mb4_general_ci;
|
<gh_stars>1-10
/* pg_fact_loader--1.5--1.6.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pg_fact_loader" to load this file. \quit
DROP VIEW fact_loader.queue_deps_all_with_retrieval;
DROP VIEW fact_loader.queue_deps_all;
DROP VIEW fact_loader.prioritized... |
delete from ARTICLE;
insert into ARTICLE(summary,
country,
author,
link,
language,
media,
title,
mediaContent,
cleanUrl,
rights,
... |
<filename>migrations/20220206222117_users_generate_new_id.down.sql
-- There is no down query for this step |
<reponame>Azure-Samples/millionsongdataset-sql
/*
Importing and using the Million Song Dataset (https://labrosa.ee.columbia.edu/millionsong/) in Azure SQL DB / SQL Server
Citation:
<NAME>, <NAME>, <NAME>, and <NAME>.
The Million Song Dataset. In Proceedings of the 12th International Society
for Music Information Retr... |
<reponame>dimitarminchev/ITCareer
SELECT deposit_group, SUM(`wizzard_deposits`.deposit_amount) AS `total_sum`
FROM gringotts.wizzard_deposits
GROUP BY deposit_group
ORDER BY total_sum; |
-- file:privileges.sql ln:1100 expect:true
DROP TABLE atestc
|
<filename>labels/ethereum/nft_users.sql
SELECT
buyer AS address,
LOWER(platform) || ' user' AS label,
'dapp usage' AS type,
'masquot' AS author
FROM nft.trades
WHERE
block_time >= '{{timestamp}}'
UNION
SELECT
seller AS address,
LOWER(platform) || ' user' AS label,
'dapp usage' AS type,
... |
<gh_stars>1000+
PRINT 'Inserting Application.Cities P'
GO
BEGIN TRANSACTION
DECLARE @CurrentDateTime datetime2(7) = '20130101'
DECLARE @EndOfTime datetime2(7) = '99991231 23:59:59.9999999'
INSERT [Application].Cities (CityID, CityName, StateProvinceID, [Location], LatestRecordedPopulation, LastEditedBy, ValidFrom,... |
<reponame>Dominick159/EING
CREATE VIEW vw_personas_lista AS
SELECT p.id, p.codigo, p.nombres, p.apellidos, p.dni, p.celular, p.correo, s.sexo, b.beca, c.carrera FROM tbpersonas AS p
INNER JOIN tbsexo AS s INNER JOIN tbbeca AS b INNER JOIN tbcarreras AS c ON p.idsexo = s.id AND p.idbeca = b.id AND p.idcarrera = c.id
O... |
<gh_stars>0
select c_integer, COUNT(DISTINCT c_integer) from alltypes group by c_integer order by c_integer, COUNT(DISTINCT c_integer) desc;
|
/*
-- Query: select * from podonet.Paciente
LIMIT 0, 1000
-- Date: 2015-01-25 12:44
*/
INSERT INTO `Paciente` (`idPaciente`,`Codigo`,`Nombre`,`Apellidos`) VALUES (1,'123','Paciente1','SusApellidos');
INSERT INTO `Paciente` (`idPaciente`,`Codigo`,`Nombre`,`Apellidos`) VALUES (2,'234','Paciente2','SasApellidos');
INSERT... |
INSERT INTO BEER (BEERNAME, BEERSTYLE, UPC, PRICE, MIN_ON_HAND, ID, CREATED_DATE, LAST_MODIFIED_DATE, VERSION)
values
('BEER1','ALE', 0612389, 123.123, 12321, 1001, current_date, current_date, '1'); |
-- Verify auth-c-and-e:table/discharge on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;
|
--
-- functions, miscellaneous
--
set schema 's';
select EMP.EMPNO, EMP.LNAME, DEPT.DNAME
from EMP, DEPT
where EMP.DEPTNO + 10 = DEPT.DEPTNO - 10
order by EMPNO;
select EMP.EMPNO, EMP.LNAME, DEPT.DNAME
from EMP, DEPT
where substring(EMP.LNAME,2,1)=substring(DEPT.DNAME,2,1)
order by EMPNO, DNAME;
-- one side functi... |
<reponame>share-research/pace-admin<filename>hasura/migrations/default/1590777431524_alter_table_public_publications_add_column_abstract/down.sql
ALTER TABLE "public"."publications" DROP COLUMN "abstract"; |
-- 用户表
-- 相关信息:https://cloud.baidu.com/doc/DORIS/s/rkmealnj7
CREATE TABLE `t_user`(
`user_id` largeint(40) NOT NULL COMMENT "用户id",
`user_name` varchar(50) NOT NULL COMMENT "用户昵称",
`city` varchar(20) NULL COMMENT "用户所在城市",
`age` smallint(6) NULL COMMENT "用户年龄",
`sex` ... |
DO
$$
BEGIN
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE TABLE_SCHEMA = current_schema AND TABLE_NAME = 'firmware_file' AND COLUMN_NAME = 'image_identifier')
THEN
ALTER TABLE firmware_file ADD COLUMN image_identifier bytea;
END IF;
COMMENT ON COLUMN firmware_file.i... |
<filename>gcp-test/tests/gcp_sql_database_instance/test-hydrate-query.sql<gh_stars>1-10
select name, jsonb_array_elements(instance_users) -> 'host' as host_name
from gcp.gcp_sql_database_instance
where name = '{{ resourceName }}'; |
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 24, 2016 at 12:52 PM
-- Server version: 5.6.14
-- PHP Version: 5.5.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
HDF5 "file_space.h5" {
SUPER_BLOCK {
SUPERBLOCK_VERSION 2
FREELIST_VERSION 0
SYMBOLTABLE_VERSION 0
OBJECTHEADER_VERSION 0
OFFSET_SIZE 8
LENGTH_SIZE 8
BTREE_RANK 16
BTREE_LEAF 4
ISTORE_K 32
FILE_SPACE_STRATEGY H5F_FSPACE_STRATEGY_NONE
FREE_SPACE_PERSIST FALSE
FREE_SPACE_SECTION_THRESH... |
<filename>sql/99_data.sql
INSERT INTO logs.config(id, key, type_id, data) VALUES
(1, md5(random()::text), 1, jsonb_build_object(
'channels', 4
, 'skip', '\.(js|gif|png|css|ico|jpg|eot)$'
, 'format', '$remote_addr $user1 $user2 [$time_local] "$request" "$status" $size "$referer" "$user_agent" "$t_size" $fr... |
DROP PROCEDURE IF EXISTS dbo.sp_select_report_lines
GO
CREATE PROCEDURE sp_select_report_lines @Id int
AS
BEGIN
SELECT * FROM report_lines WHERE id = @Id
END
GO
DROP PROCEDURE IF EXISTS dbo.sp_selectlist_report_lines
GO
CREATE PROCEDURE sp_selectlist_report_lines
AS
BEGIN
SELECT * ... |
<reponame>blukitas/SQL-pills
-- Cast unix timestamp
Select
dateadd(S, 708998400, '1970-01-01')
--dateadd(S, [unixtime], '1970-01-01')
-- Only date
SELECT CONVERT(date, getdate()) |
<reponame>altyntsev/alt_proc
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.5
-- Dumped by pg_dump version 10.5
-- Started on 2018-11-13 18:23:30
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_s... |
-- Query all fields for employees whose name started with J (ordered by age)
SELECT
*
FROM
employee
WHERE
name LIKE 'J%'
ORDER BY
age; |
--Run second
BEGIN TRAN
UPDATE ##Music
SET Digits = N'555-1212'
WHERE MusicID = 1
--Run Forth
UPDATE ##People
SET Digits = N'555-9999'
WHERE PersonId = 1
ROLLBACK... |
<filename>Database1/dbo/Functions/salesorderwithoutip.sql
create function salesorderwithoutip()
Returns table
As
Return(Select [order_id],[order_status],[staff_id],[shipped_date] from [sales].[orders]) |
<gh_stars>1-10
INSERT INTO Ward VALUES
('W003','Accident Ward','1'),
('W001','Meternity Ward','2'),
('W004','General Ward','2'),
('W002','Psychiatric Ward','3'); |
CREATE TABLE [dbo].[StationCustomerCargo] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[CargoId] INT NOT NULL,
[PackageUnitId] INT CONSTRAINT [DF_StationCustomerCargo_PackageUnitId] DEFAULT((0)) NOT NULL,
[StationCustomerId] INT NOT NULL,... |
<filename>sql/files/glms/V002__Restore_realm.sql
DROP TABLE IF EXISTS glms.realm;
CREATE table glms.realm (
id uuid PRIMARY KEY,
created_on TIMESTAMPTZ NOT NULL DEFAULT NOW(),
data jsonb NOT NULL
);
INSERT INTO glms.realm(id, created_on, data)
VALUES (uuid_generate_v4(), NOW(), '{"name" : "default"}'... |
<filename>install.sql<gh_stars>1-10
CREATE TABLE IF NOT EXISTS `%TABLE_PREFIX%sprog_wildcard` (
`pid` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id` int(10) unsigned NOT NULL,
`clang_id` int(10) unsigned NOT NULL,
`wildcard` varchar(255) DEFAULT NULL,
`replace` text,
`createuser` varchar(255) NO... |
-- Type used by utils.getnagpra(cocid varchar) to contain PAHMA NAGPRA Repatriation Compliance data
-- for the pahmapahmaRepatriationNAGPRAdenorm.jrxml report.
-- Must be created before function utils.getnagpra(cocid varchar).
-- DROP TYPE nagpratype CASCADE;
CREATE TYPE nagpratype AS (
cocsid varchar,
coid v... |
update water.pending_import set status=0;
|
<filename>Database/SQL/TEST_PROJECT_PROCEDURE.sql
USE Taskboard;
DECLARE
@userId INT,
@mail NVARCHAR(256) = '<EMAIL>',
@pwd NVARCHAR(256) = '<PASSWORD>'
BEGIN
SET NOCOUNT ON;
SET STATISTICS TIME ON
EXEC [User.Register]
@email = @mail,
@password = <PASSWORD>,
@name = 'd';
EXEC [User.Login]
@email = @m... |
<filename>SQL/Page 2.66 of chapter-2.sql
use mansi
create table Applicant(ApplicantName varchar(20), Matriculation varchar(10), HigherSecondary varchar(10), Graduation varchar(10))
insert into Applicant values('Anderson', 'A', 'A', 'B')
insert into Applicant values('Samuel', 'A', 'B', 'A')
insert into Applicant values... |
create view top3 as
select path, count(*) as num from log join articles
on position(articles.slug in log.path)>0
group by path order by num desc limit 3;
create view viewsum as
select path , count(*) as num from log
group by path order by num desc;
create view author_views as
select author , sum(num) as s from viewsu... |
BEGIN;
ALTER TABLE storage.targets DROP COLUMN ip_address_id;
ALTER TABLE storage.workflows DROP COLUMN ip_address_arity;
COMMIT;
|
/*L
Copyright SAIC, Ellumen and RSNA (CTP)
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/national-biomedical-image-archive/LICENSE.txt for details.
L*/
create temporary table image_temp
select image_pk_id
from general_image
where visibility='2' and project!='RIDER Pilot... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th5 05, 2020 lúc 06:15 AM
-- Phiên bản máy phục vụ: 10.4.8-MariaDB
-- Phiên bản PHP: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 19, 2020 at 09:24 PM
-- 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... |
<gh_stars>0
CREATE TYPE direction AS ENUM ('left', 'none', 'right');
CREATE TYPE team AS ENUM ('zucc', 'user');
CREATE TABLE teamAssign (
userID TEXT,
team team,
alive BOOLEAN
);
CREATE TABLE input (
userID TEXT,
direction direction,
inputTime TIMESTAMP
);
CREATE INDEX ON teamAssign(userID);
... |
CREATE TABLE users (
id VARCHAR NOT NULL PRIMARY KEY,
email VARCHAR NOT NULL UNIQUE,
username VARCHAR NOT NULL UNIQUE,
password VARCHAR NOT NULL,
display_name VARCHAR NOT NULL,
created_at TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT (CURRENT_TIMESTAMP AT TIME ZONE 'utc')
);
|
/*USE <db_name>*/ --Set db name before running using drop-down above or this USE statement
USE sandbox;
SET NOCOUNT ON;
DECLARE @file_name sysname,
@file_size_MB int,
@file_growth int,
@shrink_command nvarchar(max),
@alter_command nvarchar(max)
SET @file_size_MB = 118*1024;
SELECT @file_name = name
FROM sys.database... |
SELECT * FROM `user_memos` WHERE memo_time = ?;
|
<filename>SQL-Script-2.0.0/script/uspComSelMemberGameInfoes.sql
--DROP PROC uspComSelMemberGameInfoes
CREATE PROC uspComSelMemberGameInfoes
@MemberID NVARCHAR(MAX)
AS
select MemberID, Level, Exps, Points, UserSTAT1, UserSTAT2, UserSTAT3, UserSTAT4, UserSTAT5, UserSTAT6, UserSTAT7, UserSTAT8, UserSTAT9, UserSTAT10, sCo... |
-- Dumping data for table `cause`
INSERT INTO `cause`
VALUES (12,'All'),
(13,'Animals'),
(14,'Arts & Culture'),
(15,'Disaster Relief'),
(16,'Education'),
(17,'Environment'),
(18,'International'),
(19,'Justice & Legal'),
(20,'LGBT'),
(21,'Politics'),
... |
CREATE OR REPLACE FUNCTION fetchq_test.metric_get_01(
OUT passed BOOLEAN
) AS $$
DECLARE
VAR_r RECORD;
BEGIN
-- initialize test
PERFORM fetchq.queue_create('foo');
-- test set counters
PERFORM fetchq.metric_set('a', 'b', 4);
PERFORM fetchq.metric_set('a', 'b', 5);
PERFORM fetchq.met... |
<reponame>productivity-tools/taskany
-- AlterTable
ALTER TABLE "issues" ALTER COLUMN "description" DROP NOT NULL;
|
select p.id_paciente, count(*) as qtd_exames, count(distinct e.de_exame) as qtd_tipo_exame
from exames e join pacientes p
ON (p.id_paciente = e.id_paciente)
WHERE UPPER(cd_municipio) LIKE 'SAO PAULO'
GROUP BY ROLLUP (p.id_paciente)
ORDER BY tipo_exames_amount DESC;
|
<reponame>chengwenxin/sqlite-parser
-- original: tkt-c48d99d690.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
CREATE TABLE t1(a, b);
CREATE TABLE t2(a, b);
INSERT INTO t1 VALUES('one' , 1);
INSERT INTO t1 VALUES('two' , 5);
INSERT INTO t1 VALUES('two' , 2);
INSERT INTO t1 V... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 21, 2017 at 10:45 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<gh_stars>0
DELETE FROM public.institution;
DELETE FROM public.institution_collection_person;
DELETE FROM public.collection_person;
DELETE FROM public.address;
|
<filename>apps/dolibarr/htdocs/install/mysql/tables/llx_holiday.sql<gh_stars>0
-- ===================================================================
-- Copyright (C) 2012 <NAME> <<EMAIL>>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public Li... |
<reponame>michaelhuettermann/sandbox<gh_stars>10-100
INSERT INTO PERSON (NAME) VALUES ('<NAME>');
INSERT INTO PERSON (NAME) VALUES ('<NAME>');
INSERT INTO PERSON (NAME) VALUES ('<NAME>');
|
<gh_stars>1-10
-- set schema
SET search_path TO ${POSTGRES_SCHEMA};
-- SHERIFF_RANK_CODE
INSERT INTO sheriff_rank_code (
sheriff_rank_code, description, effective_date, expiry_date, created_by, updated_by, created_dtm, updated_dtm, revision_count)
VALUES ('CHIEFSHERIFF', 'Chief Sheriff', to_date('2018-01-01','yyyy-M... |
-- Revert ggircs-portal:tables/review_step_001 from pg
begin;
update ggircs_portal.review_step set step_name='other' where step_name='application';
commit;
|
<gh_stars>1-10
-- =============================================
-- Author: <NAME>
-- Create date: 2019-11-12
-- Updates:
--
-- Description: Generic error handling called by RDBMS enforced audit field triggers and concurency control number checking.
-- =============================================
USE HMR_DEV; -- ... |
CREATE TABLE `siscol_option_bac` (
`cod_opt_bac` VARCHAR(50) NOT NULL COMMENT 'Code option bac',
`lib_opt_bac` VARCHAR(500) NOT NULL COMMENT 'Libelle long option bac',
`lic_opt_bac` VARCHAR(200) NOT NULL COMMENT 'Libelle court option bac',
`daa_deb_val_opt_bac` VARCHAR(4) NULL DEFAULT NULL COMMENT 'Date de debut de... |
<reponame>Caprowni/concourse
ALTER TABLE pipelines
ADD COLUMN paused_by text,
ADD COLUMN paused_at timestamptz;
|
<filename>fixtures/doctests/plpgsql/019/input.sql
CREATE FUNCTION merge_fields(t_row table1) RETURNS text AS $$
DECLARE
t2_row table2%ROWTYPE;
BEGIN
SELECT * INTO t2_row FROM table2 WHERE ... ;
RETURN t_row.f1 || t2_row.f3 || t_row.f5 || t2_row.f7;
END;
$$ LANGUAGE plpgsql;
SELECT merge_fields(t.*) FROM ta... |
<filename>br_bestride.sql
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 30-Maio-2017 às 17:17
-- Versão do servidor: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER... |
-- @testpoint:opengauss关键字Large(非保留),自定义数据类型名为explain
--关键字explain作为数据类型不带引号,创建成功
drop type if exists Large;
CREATE TYPE Large AS (f1 int, f2 text);
select typname from pg_type where typname ='Large';
drop type Large;
--关键字explain作为数据类型加双引号,创建成功
drop type if exists "Large";
CREATE TYPE "Large" AS (f1 int, f2 text);
... |
USE WideWorldImporters
GO
-- Let's create an empty copy of the OrderLines table
SELECT * INTO dbo.OrderLinesCopy FROM Sales.OrderLines WHERE 1 = 2;
-- Table is empty
SELECT * FROM dbo.OrderLinesCopy
-- A simple example of how to use the MERGE statement
MERGE INTO dbo.OrderLinesCopy AS tgt
USING Sales.OrderLines AS ... |
-- Author: <NAME>
-- Date: 9/10/2020
CREATE TABLE `enum` (
`id` CHAR(32),
`name` JSON,
`parent` VARCHAR(50),
`description` JSON
) |
<reponame>johnbeynon/stash-api
--
-- 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;
--
-- Name: plpgsql; Type: EXTENSION; Schema: -; Owner: -
--
CREA... |
/* Database schema and initializations */
drop table comments cascade constraints;
drop table likes cascade constraints;
drop table viewed cascade constraints;
drop table buyer cascade constraints;
drop table acc_user cascade constraints;
drop table house cascade constraints;
drop table seller cascade constraints;
/*... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.