sql stringlengths 6 1.05M |
|---|
<reponame>jcespinoza/EventoArteHNServices<filename>ProCultura.Data/Scripts/EventMessages.sql<gh_stars>1-10
BEGIN TRAN
INSERT
Localization.Dictionary
VALUES
('message_DuplicateResource', 'en', 'This resource already exists'),
('message_EventNotFound', 'en', 'The event could not be found'),
('message_EventAlreadyExi... |
CREATE TABLE stations (
id TEXT PRIMARY KEY,
name TEXT,
country TEXT,
icao TEXT,
coordinate POINT,
elevation REAL
);
CREATE TABLE cities (
id BIGINT PRIMARY KEY,
station_id TEXT,
name TEXT NOT NULL,
country TEXT NO... |
/*-------------------------------------------------------------------------------------------------
NAME: DatabaseOwnershipChange.sql
MODIFIED BY: <NAME>
EMAIL: <EMAIL>
DESCRIPTION: Use this script to change the database ownership to sa.
-----------------------------------------------------------------... |
-- fts1a.test
--
-- execsql {SELECT rowid FROM t1 WHERE content MATCH 'two OR three OR four one'}
SELECT rowid FROM t1 WHERE content MATCH 'two OR three OR four one' |
-- file:btree_index.sql ln:18 expect:true
SELECT b.*
FROM bt_name_heap b
WHERE b.seqno < '1'::name
|
<reponame>Shuttl-Tech/antlr_psql
-- file:alter_table.sql ln:2228 expect:true
CREATE TABLE part_7_a_null (
c int,
d int,
e int,
LIKE list_parted2, CONSTRAINT check_b CHECK (b IS NULL OR b = 'a'),
CONSTRAINT check_a CHECK (a IS NOT NULL AND a = 7)
)
|
--======================================
-- Drop Trigger Template
--======================================
USE <database_name, sysname, AdventureWorks>
GO
IF OBJECT_ID ('<schema_name, sysname, Sales>.<trigger_name, sysname, uStore>','TR') IS NOT NULL
DROP TRIGGER <schema_name, sysname, Sales>.<trigger_name, sysname,... |
<reponame>PayGreen/module-magento-2<filename>bundles/PGPayment/_resources/sql/button/upgrades/012-rename-columns.sql<gh_stars>1-10
ALTER TABLE `%{database.entities.button.table}`
CHANGE `nbPayment` `paymentNumber` INT(5) UNSIGNED NOT NULL DEFAULT 1,
CHANGE `perCentPayment` `firstPaymentPart` INT(5) UNSIGNED DEF... |
with tasks as (
select
task.*, cycle.apply_start_date,
(
select row_to_json (muser)
from (
select
id, name, username, government_uri,
coalesce(given_name, (string_to_array(trim(name), ' '))[array_lower(string_to_array(trim(name), ' '), 1)]) as given_name,
coalesce(last_name, (string_to... |
<filename>slimrepo-core/src/test/resources/sql/upgrade-field-deleted.sql
DROP TABLE IF EXISTS `UserEntity_Backup`
{Params: []}
CREATE TABLE `UserEntity_Backup` AS SELECT * FROM `UserEntity`
{Params: []}
DROP TABLE IF EXISTS `UserEntity`
{Params: []}
CREATE TABLE IF NOT EXISTS `UserEntity` (
`userId` TEXT PRIMARY KE... |
<filename>macros/schema_tests/at_least_one.sql
{% macro test_at_least_one(model, arg) %}
select count(*)
from (
select
count({{ arg }})
from {{ model }}
having count({{ arg }}) = 0
) validation_errors
{% endmacro %}
|
<reponame>viswaratha12/dbwarden<filename>DMS5/AddMissingPredefinedJobs.sql
/****** Object: StoredProcedure [dbo].[AddMissingPredefinedJobs] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE Procedure [dbo].[AddMissingPredefinedJobs]
/****************************************************
**
** D... |
<gh_stars>100-1000
ALTER TABLE `acc_gl_journal_entry`
ADD COLUMN `organization_running_balance` DECIMAL(19,6) NOT NULL DEFAULT '0.000000' AFTER `office_running_balance`;
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES ('accounting', 'UPDATERUNNINGBALANCE_JOURN... |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 01, 2016 at 12:19 PM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
-- 4000 records for each i: 0,1,2,3,4.
create table mille as select 0 as i from table({1,2,3,4,5,6,7,8,9,0}) t1, table({1,2,3,4,5,6,7,8,9,0}) t2, table({1,2,3,4,5,6,7,8,9,0}) t3, table({0,1,2,3}) t4;
create table t (i int not null, j int, k int, l int)... |
CREATE TABLE `game_deployments` (
`gamespace_id` int(11) NOT NULL,
`game_name` varchar(64) NOT NULL DEFAULT '',
`game_version` varchar(64) NOT NULL DEFAULT '',
`current_deployment` int(11) NOT NULL,
`deployment_enabled` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`gamespace_id`,`game_name`,`game_version`)... |
CREATE TABLE `Posts` (
`PostID` varchar(32) NOT NULL,
`UserID` varchar(32) DEFAULT NULL,
`CreatedDate` datetime DEFAULT NULL,
`Validated` tinyint(1) DEFAULT,
`SQLKey` varchar(32) NOT NULL,
`RestaurantID` varchar(32) DEFAULT NULL,
PRIMARY KEY (`PostID`),
UNIQUE KEY `SQLKey` (`SQLKey`),
... |
<filename>Consultas 16.sql
USE sucos_vendas;
SELECT * FROM tabela_de_produtos WHERE NOT SABOR = 'manga'
AND NOT (TAMANHO = '470 ml');
SELECT * FROM tabela_de_produtos WHERE SABOR IN ('Laranja', 'Manga');
SELECT * FROM tabela_de_clientes WHERE CIDADE IN ('Rio de Janeiro', 'São Paulo')
AND (IDADE >= 20 AND IDADE < 30)... |
<filename>sql_01_07 select order by.sql
/*
SQL for Data Professionals: Lunchbreak Lessons
SELECT [ORDER BY]
asc = ascending. Default
desc = descending
Sample Database: Sakila - https://dev.mysql.com/doc/sakila/en/
*/
SELECT
last_name
FROM
actor
-- ORDER BY last_name;
-- ORDER BY last_name desc;
-- ORDER BY ... |
<filename>db/schema.sql<gh_stars>0
DROP DATABASE IF EXISTS movie_theatre_db;
CREATE DATABASE movie_theatre_db;
|
<gh_stars>0
IF OBJECT_ID('Report.GetSFAProgrammeFunding') IS NOT NULL
BEGIN
DROP FUNCTION [Report].[GetSFAProgrammeFunding]
END
GO
CREATE FUNCTION [Report].[GetSFAProgrammeFunding] ()
RETURNS TABLE
AS
RETURN
(
SELECT FundLine, SUM(Total6Months) as Total6Months, SUM(TotalYear) as TotalYear,
(CASE FundLine
... |
--SELECT MAX("MLB_56"."AVG") AS "TEMP(attr:AVG:qk)(3030839854)(0)", MIN("MLB_56"."AVG") AS "TEMP(attr:AVG:qk)(3417196579)(0)", MAX("MLB_56"."BABIP") AS "TEMP(attr:BABIP:qk)(4285141330)(0)", MIN("MLB_56"."BABIP") AS "TEMP(attr:BABIP:qk)(611967120)(0)", MIN("MLB_56"."BB.") AS "TEMP(attr:BB.:qk)(143670063)(0)", ... |
CREATE TABLE responses (
id SERIAL,
userid INTEGER NOT NULL,
inputid INTEGER NOT NULL,
sentence VARCHAR(255) NOT NULL,
route VARCHAR(255) NOT NULL,
stateid INTEGER,
feedbackid INTEGER,
createdat TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (id)
);
ALTER TABLE messages RENAME TO inputs;
ALTER TABLE... |
<filename>sandbox/sets_adyacentes.sql<gh_stars>1-10
CREATE OR REPLACE FUNCTION array_sort (ANYARRAY)
RETURNS ANYARRAY LANGUAGE SQL
AS $$
SELECT ARRAY(SELECT unnest($1) ORDER BY 1)
$$;
--https://stackoverflow.com/questions/2913368/sorting-array-elements
drop function sets_de_adys(text, text);
create or replace function... |
DROP view vw_posts_with_user;
CREATE VIEW vw_posts_with_user as
select
posts.*, profiles.username, profiles.avatar, profiles.displayname
from
posts posts
join profiles profiles on posts.user_id = profiles.id
select * from vw_posts_with_user; |
-- This is the Oracle Sakai 2.6.x -> 2.7.0 conversion script
-- --------------------------------------------------------------------------------------------------------------------------------------
--
-- use this to convert a Sakai database from 2.6.x to 2.7.0. Run this before you run your first app server.
-- auto.... |
-- Deploy postgraphile_organizations:organization_invitations to pg
-- requires: organizations
-- requires: postgraphile_user_system:users
-- requires: postgraphile_schemas:schemas
-- requires: postgraphile_extensions:uuid-ossp
-- requires: postgraphile_extensions:citext
BEGIN;
SET search_path TO app_public,public;
... |
<reponame>openhousedev/OpenHouse.Core.Web<gh_stars>0
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS propertyNote;
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE `propertyNote` (
`propertyNoteId` INT NOT NULL AUTO_INCREMENT,
`noteId` INT NOT NULL,
`propertyId` INT NOT NULL,
PRIMARY KEY(`propertyNoteId`),
FOREIGN KEY(`... |
//DROP TABLE item;
CREATE TABLE IF NOT EXISTS item (
id NVARCHAR2(20) NOT NULL PRIMARY KEY,
name NVARCHAR2(100) NOT NULL,
price INT NOT NULL,
description NVARCHAR2(1024)
);
//DROP TABLE items;
CREATE TABLE IF NOT EXISTS items (
uid NVARCHAR2(256) NOT NULL,
item_id NVARC... |
/* ======================================================================== */
/* PeopleRelay: flags.sql Version: 0.4.3.6 */
/* */
/* Copyright 2017-2018 <NAME> & <NAME> */
/* ... |
/********************************************************************************
component-centric-snapshot-description-without-language-refset.sql
Assertion:
Active descriptions should be acceptable at least in one dialect.
********************************************************************************/
inse... |
<filename>lib/jdomodels/src/main/resources/schema/JsonSchema-ddl.sql
CREATE TABLE IF NOT EXISTS `JSON_SCHEMA` (
`SCHEMA_ID` BIGINT NOT NULL,
`ORGANIZATION_ID` BIGINT NOT NULL,
`SCHEMA_NAME` VARCHAR(250) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`CREATED_BY` BIGINT NOT NULL,
`CREATED_ON` TIMESTAMP... |
select * from {{ ref('people') }}
|
ALTER TABLE "udadefinition" ADD COLUMN "encrypted" BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE "udadefinitionhistory" ADD COLUMN "encrypted" BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE "udadefinition" ADD COLUMN "controllerid" character varying(255) DEFAULT NULL;
ALTER TABLE "udadefinitionhistory" ADD COLUMN "controll... |
CREATE STAGE IF NOT EXISTS test_desc_stage url='s3://load/files/' credentials=(access_key_id='1a2b3c' secret_access_key='4x5y6z') file_format=(FORMAT=CSV compression=GZIP record_delimiter=',');
desc stage test_desc_stage;
|
<reponame>snowplow-incubator/snowplow-dbt-utils
{% macro combine_column_versions(relation, column_prefix, required_fields=[], nested_level=none, level_filter='equalto', relation_alias=none, include_field_alias=true, array_index=0, max_nested_level=15) %}
{# Create field_alias if not supplied i.e. is not tuple #}
... |
ALTER TABLE behavior_group_action
ADD COLUMN position INTEGER NOT NULL DEFAULT 0; -- The default value is required to migrate existing actions.
ALTER TABLE behavior_group_action
ALTER COLUMN position DROP DEFAULT; -- Migration done, we can drop the default value.
|
SELECT
age,
COUNT(age) as people_count
FROM people
GROUP BY age
|
create table if not exists t_user (
user_id bigint primary key,
nickname text not null,
pwd_hash text not null,
add_date timestamptz not null default now(),
upd_date timestamptz not null default now()
);
create table if not exists t_user_session (
user_id bigint primary key,
next_token text... |
<reponame>thecrazzycourses/sql
DROP DATABASE IF EXISTS instagram;
CREATE DATABASE instagram;
USE instagram;
-- Users
DROP TABLE IF EXISTS users;
CREATE TABLE users
(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT NOW()
);
INSERT INTO us... |
/*
Æwiczenie 1
--1
Dla ka¿dego zamówienia podaj ³¹czn¹ liczbê zamówionych jednostek
oraz nazwê klienta.
use Northwind;
select od.OrderID, sum(od.quantity) as 'Quantity', o.CustomerID
from [Order Details] od
inner join Orders o
on o.OrderID = od.OrderID
inner join Customers c
on c.CustomerID = o.CustomerID
where o... |
<reponame>orbs-network/token-bi<filename>database/rewards/get_rewards_for_delegator.sql
USE `orbs_token`;
DROP procedure IF EXISTS `get_rewards_for_delegator`;
DELIMITER $$
USE `orbs_token`$$
CREATE DEFINER=`orbs`@`%` PROCEDURE `get_rewards_for_delegator`(IN election_num_start INTEGER, IN election_num_end INTEGER, IN ... |
ALTER TABLE round RENAME TO match_round;
ALTER TABLE match_round RENAME CONSTRAINT round_pkey TO match_round_pkey;
ALTER TABLE match_round RENAME CONSTRAINT round_match_map_id_fkey TO match_round_match_map_id_fkey;
ALTER SEQUENCE round_id_seq RENAME TO match_round_id_seq;
ALTER TABLE match_round ALTER COLUMN id SET DEF... |
<filename>Database/db.sql
create database doeki;
CREATE TABLE usuarios (
id_usuario INT PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(50) NOT NULL,
email VARCHAR(50) UNIQUE NOT NULL,
senha VARCHAR(50) NOT NULL,
situacoe_id int(11) NOT NULL DEFAULT '0',
niveis_acesso_id int(11) NOT NULL DEFAULT 2,
... |
<reponame>irfanltf/absen<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 20, 2021 at 07:27 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET ti... |
-- Create user roles
CREATE TYPE Role AS ENUM('USER', 'JUDGE', 'ADMIN');
-- Create settings enum
CREATE TYPE SettingType as ENUM('COMPETITION_LEVEL', 'DANCE_SIZE', 'STYLE');
-- Create award status enum
CREATE TYPE AwardPerformanceStatus as ENUM('NOMINEE', 'FINALIST');
-- Create award type enum
CREATE TYPE AwardType ... |
<filename>source/TSQLLint.Tests/FunctionalTests/TestFiles/with-errors.sql
SELECT * FROM BAR |
-- Must be valid 3-digit object class as defined in OMB Circular A-11 Section 83.6, or a 4-digit code which includes a
-- 1-digit prefix that distinguishes direct, reimbursable, and allocation obligations. Do not include decimal points
-- when reporting in the Schema.
SELECT
af.row_number,
af.object_class
FROM ... |
<reponame>aravi5/drill-test-framework
CREATE TEMPORARY TABLE dfs.tmp.temp_tbl10f PARTITION BY ( col_intrvl_yr )
AS
SELECT col_int, col_chr, col_vrchr1, col_vrchr2, col_dt, col_tim, col_tmstmp , col_flt, col_intrvl_yr, col_intrvl_day, col_bln
FROM typeall_l;
SELECT
DISTINCT col_chr,
MIN(col_tim) min_ti... |
<filename>generated-sources/mysql-schema/mojang-api/mysql_schema.sql
/* SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; */
/* SET AUTOCOMMIT = 0; */
/* START TRANSACTION; */
/* SET time_zone = "+00:00"; */
-- --------------------------------------------------------
--
-- Table structure for table `ChangeSkinRequest` generate... |
CREATE DATABASE IF NOT EXISTS `jbf` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `jbf`;
-- MySQL dump 10.13 Distrib 5.5.44, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: jbf
-- ------------------------------------------------------
-- Server version 5.5.44-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACT... |
<reponame>elebere/teamspeakfiles
CREATE TABLE custom_fields (
server_id integer unsigned,
client_id integer unsigned,
ident varchar(100) NOT NULL,
value varchar(255)
);
CREATE INDEX index_custom_fields_serverid ON custom_fields (server_id);
CREATE INDEX index_custom_fields_client_id ON custom_fields (client_i... |
<reponame>Marcel-Jansen/open-smart-grid-platform
DROP TABLE firmware_history;
ALTER TABLE firmware DROP COLUMN device_model;
ALTER TABLE firmware DROP COLUMN installation_file;
ALTER TABLE firmware ADD COLUMN installation_date timestamp without time zone;
ALTER TABLE firmware ADD COLUMN installed_by character varyi... |
<reponame>dengyuli910904/bestshop<gh_stars>100-1000
### v1.0.8 ###
# 订单商品记录表:库存计算方式
ALTER TABLE `yoshop_order_goods`
ADD COLUMN `deduct_stock_type` tinyint(3) UNSIGNED NOT NULL DEFAULT '20' AFTER `image_id`;
|
<gh_stars>1000+
-- test table data size
create table temp (col uint8);
insert into temp values(1);
select data_size, data_compressed_size from system.tables where name = 'temp';
drop table temp;
|
SELECT c.`id`, c.`title`, m.`id`
FROM `chats` AS c
INNER JOIN `messages` AS m
ON c.`id` = m.`chat_id`
WHERE m.`sent_on` < '2012-03-26' AND c.`title` LIKE '%x'
ORDER BY c.`id`, m.`id`; |
-- XI)
-- Contrainte : Jointure externe
-- Sélectionne les produits qui ne sont pas commandés
-- Remarque : Sélectionne aussi les produits qui sont dans des commandes annulées et sous requête peut être évitée par une jointure.
SELECT REQ.id_produit, REQ.nom
FROM (
SELECT PR.id_produit, PR.nom, CO.id_commande
FR... |
SELECT * FROM
(VALUES (2), (3), (5), (7), (11), (13), (17), (19),
(23), (29), (31), (37), (41), (43), (47), (53), (59),
(61), (67), (71), (73), (79), (83), (89), (97))
AS num (prime);
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1
-- Létrehozás ideje: 2022. Már 22. 16:04
-- Kiszolgáló verziója: 10.4.22-MariaDB
-- PHP verzió: 8.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
ALTER TABLE TROLFNC ADD (
CONSTRAINT RFNCROL01
FOREIGN KEY (CODFNC)
REFERENCES TFNC (CODFNC),
CONSTRAINT RROLROL01
FOREIGN KEY (CODROL)
REFERENCES TROL (CODROL));
|
-- MySQL dump 10.13 Distrib 8.0.24, for macos11 (x86_64)
--
-- Host: localhost Database: salary
-- ------------------------------------------------------
-- Server version 5.7.34
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
-- Database generated with pgModeler (PostgreSQL Database Modeler).
-- pgModeler version: 0.9.4
-- PostgreSQL version: 13.0
-- Project Site: pgmodeler.io
-- Model Author: ---
-- Database creation must be performed outside a multi lined SQL file.
-- These commands were put in this file only as a convenience.
--
-- ob... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.14-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 11.3.0.6295
-- -----------------------------------------------... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 01, 2018 at 08:34 AM
-- Server version: 10.1.8-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_CLI... |
-- Select database
USE bookstore;
-- Show tables
SELECT 'Employee Table' AS '';
SELECT * FROM Employee;
SELECT 'Student Table' AS '';
SELECT * FROM Student;
SELECT 'Department Table' AS '';
SELECT * FROM Department;
SELECT 'Permission Table' AS '';
SELECT * FROM Permission;
SELECT 'Product Table' AS '';
SELECT *... |
DROP PROCEDURE IF EXISTS get_tag_node_count;
DELIMITER ;;
CREATE DEFINER=web@localhost PROCEDURE get_tag_node_count(IN $tids VARCHAR(20000))
COMMENT 'get node count for a list of given tags'
BEGIN
IF LOCATE(',', $tids) = 0 THEN
SELECT COUNT(*) FROM nodes WHERE tid = CAST($tids AS UNSIGNED INTEGER);
... |
INSERT INTO `formularios` (`id`,`nombre`,`numero`,`descripcion`,`encabezado`,`formulario_id`) VALUES (1,'Diagnóstico',1,'<p>Realiza el siguiente test gratuito que te indicará en qué parte del proceso para escoger carrera te encuentras y qué recomendaciones te sugerimos para escoger la carrera más acorde a tu perfil red... |
prompt .. Recompiling &&_USER schema object bodies with debug
DECLARE
BEGIN
FOR compile_statement IN (SELECT REPLACE(CASE type
WHEN 'PACKAGE BODY' THEN
'ALTER PACKAGE #objectName# COMPILE DEBUG BODY'
... |
<reponame>llitfkitfk/bk-job<filename>support-files/sql/job-manage/0013_job_manage_20210120-1000_V3.1.4.3_mysql.sql
USE `job_manage`;
alter table `job_manage`.`global_setting` add primary key (`key`); |
-- conflict.test
--
-- execsql {SELECT a FROM t1 ORDER BY b}
SELECT a FROM t1 ORDER BY b |
<gh_stars>0
INSERT INTO base(
service,
departement,
agent_demandeur,
agent_beneficiaire,
budget_annuel,
budget_actuel,
date_de_demande,
nature,
sous_nature,
evolution,
quantite,
phasage,
libelle_commande,
motivation_demande... |
<gh_stars>0
-- scalar aggregate in not exists returns NULL value
-- with correlation to outer table
select
*
from
t1
where
not exists
(
select
max(a2)+100
from
t2
where
a2 > 10000
)
order by
1
;
|
CREATE TABLE api_tokens (
id SERIAL PRIMARY KEY,
product VARCHAR NOT NULL UNIQUE,
company_id VARCHAR NOT NULL UNIQUE,
token_type VARCHAR NOT NULL,
access_token VARCHAR NOT NULL,
expires_in INTEGER DEFAULT 0 NOT NULL,
refresh_token VARCHAR NOT NULL,
refresh_token_expires_in INTEGER DEFAUL... |
ALTER PROCEDURE [alert].[template.fetch] -- returns a template for specific channel and language
@channel nvarchar(255), -- the channel
@name nvarchar(200), -- the template name/key,
@languageCode varchar(2) -- the language
AS
BEGIN TRY
SELECT 'templates' resultSetName;
SELECT
i.itemName AS ... |
<gh_stars>1-10
CREATE TABLE user (
id INTEGER AUTO_INCREMENT NOT NULL,
username VARCHAR(64) NOT NULL,
sex VARCHAR(64) NOT NULL,
birthday TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
address VARCHAR(255),
PRIMARY KEY (id)
);
CREATE TABLE admin (
adminId INTEGER AUTO_INCREME... |
<filename>SQL/Aggregation/Top Earners/mysql.sql
select (select max(months * salary) from employee) max_earnings, count(name)
from employee
where months * salary = (select max(months * salary) from employee)
-- alternative
select (salary * months) earnings, count(*) from employee group by 1 order by earnings desc limit... |
<gh_stars>10-100
/*
Copyright 2021 Snowplow Analytics Ltd. All rights reserved.
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
Unl... |
<filename>tests/migration_tests/database/postgres/pepys_0.0.17_dump.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.2
-- Dumped by pg_dump version 12.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conf... |
<filename>dbscripts/Alter_B_CUSTOMER_LIMIT_SUB_Load_them_data_TotalLimit.sql
USE [bisolutions_vvcb]
GO
/****** Object: StoredProcedure [dbo].[B_CUSTOMER_LIMIT_SUB_Load_them_data_TotalLimit] Script Date: 12/5/2014 11:18:52 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo]... |
<reponame>PEDSnet/pedsnetcdms
-- running migrations for 'I2B2 CDM';
GO
CREATE TABLE alembic_version (
version_num VARCHAR(32) NOT NULL
);
GO
-- Running upgrade -> 1a2b15a3ecfc
CREATE TABLE observation_fact (
provider_id VARCHAR(50) NOT NULL,
nval_num NUMERIC(18, 5) NULL,
confidence_num NUMERIC(1... |
<reponame>camara94/sql_serveur_2012
BACKUP DATABASE
$(basededonnees) TO DISK='$(linkpath)' MIRROR TO unitefull
WITH INIT, FORMAT, CHECKSUM, COMPRESSION |
<gh_stars>0
SELECT avg(r.rating)
FROM movies m
inner join ratings r
on m.id = r.movie_id
WHERE m.year == 2012 |
<reponame>jishisv/sipernes<filename>src/Minsal/Sipernes/ReportesBundle/Resources/views/rpt_consultas/consulta_rpt_34.sql
SELECT
ctl_establecimiento.nombre,
enf_clase.nombre_clase,
enf_dominio.nombre_dominio,
enf_ctl_diagnostico.nombre_diagnostico,
count( enf_ctl_diagnostico.id) Cantidad
FROM
... |
<filename>database/bdd.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : lun. 31 mai 2021 à 17:49
-- Version du serveur : 10.1.38-MariaDB
-- Version de PHP : 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_z... |
<reponame>nearform/concorda-api
CREATE TABLE IF NOT EXISTS sys_entity
(
id character varying NOT NULL,
base character varying,
name character varying,
fields character varying,
"zone" character varying,
seneca json,
CONSTRAINT pk_sys_entity_id PRIMARY KEY (id)
)
WITH (
OIDS=FALSE
);
CREATE TABLE IF NO... |
CREATE INDEX business_ix_id ON business(business_id);
CREATE INDEX business_ix_postal_code ON business(postal_code);
CREATE INDEX inspection_ix_business_id_date ON inspection(business_id, date);
CREATE INDEX inspection_ix_date ON inspection(date);
CREATE INDEX violation_ix_business_id_date ON violation(business_id, dat... |
<reponame>tushartushar/dbSmellsData<gh_stars>1-10
SELECT column_name FROM information_schema.columns WHERE table_name='{table}' and column_name='{column}';
select pg_schema from organization;
select schema_name from information_schema.schemata where schema_name like 'bbl_%%';
select 1 from information_schema.tables whe... |
/*
This table is required by the dbo.sp_SQLPasswordAudit stored procedure
https://github.com/TheVladdestVlad/SQLPasswordAudit
*/
CREATE TABLE [dbo].[Passwords](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Pass] [nvarchar](128) NULL,
[SourceList] [nvarchar](128) NULL,
PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PA... |
-- CreateEnum
CREATE TYPE "RoleEnum" AS ENUM ('NOTARY');
-- AlterTable
ALTER TABLE "User" ADD COLUMN "roles" "RoleEnum"[],
ADD COLUMN "sessionAuthString" TEXT;
-- CreateTable
CREATE TABLE "UserSession" (
"id" SERIAL NOT NULL,
"userId" INTEGER NOT NULL,
"token" TEXT NOT NULL,
"createdAt" TIMEST... |
<reponame>templatetools/trace
INSERT INTO t_user_dict_detail (id, dict_type_id, dict_detail_code, value_name_cn, value_name_en, sort, comments, create_user_id, create_date, update_user_id, update_date, status) VALUES ('402881ce588b1fd201589a5ff3de018d', 'f5ca1dcb-41e4-4553-b41e-f3eeda6d56f5', 'DM0000000079', 'ml', null... |
-- Use below commands to bring up the Agent.
EXEC SP_CONFIGURE 'Agent XPs'
EXEC SP_CONFIGURE 'show advanced options',1
GO
RECONFIGURE
GO
EXEC SP_CONFIGURE 'show advanced options'
EXEC SP_CONFIGURE 'Agent XPs',1
GO
RECONFIGURE
-- Sometime the SQL Server Agent doesnt start so restarting SQL server does the trick.
... |
INSERT INTO USERS (ID, EMAIL, FIRST_NAME, LAST_NAME, PASSWORD)
VALUES (1, '<EMAIL>', 'User_First', 'User_Last', '{noop}password'),
(2, '<EMAIL>', 'Admin_First', 'Admin_Last', '{noop}admin');
INSERT INTO USER_ROLE (ROLE, USER_ID)
VALUES ('USER', 1),
('ADMIN', 2),
('USER', 2);
INSERT INTO RESTAURAN... |
CREATE PROCEDURE [dbo].[pe_NL_DisbMap_Create_GP]
AS
DECLARE @Org int
DECLARE @Server varchar(50)
DECLARE @DB varchar(50)
DECLARE @SQL varchar(8000)
DECLARE csr_Org CURSOR DYNAMIC
FOR SELECT Orgs.PracID, Orgs.NLServer, Orgs.NLDatabase
FROM tblTranNominalOrgs Orgs
WHERE Orgs.NLTransfer = 1
OPEN csr_Org
FETCH csr_... |
<filename>java/ve-voto-eletronico/src/main/resources/db/migration/V0001__create_table_usuario.sql<gh_stars>1-10
CREATE TABLE `usuario` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`nome` varchar(255) NOT NULL ,
`cpf` varchar(11) NOT NULL ,
`senha` varchar(255) NOT NULL ,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAU... |
CREATE TABLE [dbo].[article] (
[articleId] UNIQUEIDENTIFIER CONSTRAINT [DF_article_articleId] DEFAULT (newid()) NOT NULL,
[createtime] DATETIME2 (7) CONSTRAINT [DF_article_createtime] DEFAULT (getdate()) NOT NULL,
[articleTitle] NVARCHAR (999) NULL,
[articleHtmlContent... |
<gh_stars>0
CREATE DATABASE IF NOT EXISTS `algernon_cloud` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `algernon_cloud`;
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: 192.168.127.12 Database: algernon_cloud
-- ------------------------------------------------------
-- Server version 5.6... |
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 Oracle user
-- APEX_050100 or as the owner ... |
<reponame>taidoandn/real-estate
INSERT INTO "blogs"("id", "title", "slug", "content", "image", "author", "created_at", "updated_at") VALUES (1, 'Nhà đầu tư \"mắc cạn\", chuyên gia khuyên không nên tin lời \"đường mật\"', 'nha-dau-tu-mac-can-chuyen-gia-khuyen-khong-nen-tin-loi-duong-mat', '<p><strong>Nhà đầu tư &... |
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 10, 2018 at 07:17 AM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
<reponame>kamentr/API_Restaurant<gh_stars>1-10
insert into product_ingredient (id, description, code, name, locked, ingredient_id, product_id) values (1, 9, 3, 'Soup1', 1, 9, 4);
insert into product_ingredient (id, description, code, name, locked, ingredient_id, product_id) values (2, 3, 1, 'Soup2', 1, 6, 6);
insert ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.