sql stringlengths 6 1.05M |
|---|
-- file:truncate.sql ln:70 expect:true
SELECT * FROM truncate_a
UNION ALL
SELECT * FROM trunc_c
UNION ALL
SELECT * FROM trunc_b
UNION ALL
SELECT * FROM trunc_d
|
<gh_stars>10-100
-- file:plpgsql.sql ln:4256 expect:true
$$ stable
|
/*
select "(" + Convert(varchar(3),isnull(N,0)) + "," + Convert(varchar(3),isnull(P,0)) + ")," from BST
You are given a table, BST, containing two columns: N and P, where N represents the value of a node in BST, and P is the parent of N.
Write a query to find the node type of BST ordered by the value of the node. Outp... |
\i structure/tables.sql
\i structure/functions.sql
\i structure/triggers.sql
\i structure/grants.sql
|
<filename>1.32.0/var/www/html/indicia/modules/indicia_setup/db/version_0_9_1/201512021339_licences_fk_views.sql
CREATE OR REPLACE VIEW list_groups AS
SELECT g.id,
g.title,
g.code,
g.group_type_id,
g.description,
g.from_date,
g.to_date,
g.private_records,
g.website_id,
g.filter_id,... |
<reponame>jxsdifen/AngularCart
/*
Navicat MySQL Data Transfer
Source Server : sky
Source Server Version : 50712
Source Host : localhost
Source Database : jdcart
Target Server Version : 50712
File Encoding : utf-8
Date: 10/09/2017 19:51:28 PM
*/
SET NAMES utf8;
SET FOREIGN_KEY... |
<filename>framework/resources/Functional/parquet_storage/parquet_generic/limit1.sql<gh_stars>0
select int_col from `parquet_storage/parquet_limit` limit 5;
|
# --- Created by Slick DDL
# To stop Slick DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table "knol" ("Fname" VARCHAR(254) NOT NULL,"Lname" VARCHAR(254) NOT NULL,"Email" VARCHAR(254) NOT NULL,"Mobile" VARCHAR(254) NOT NULL,"id" SERIAL NOT NULL PRIMARY KEY);
# --- !Downs
drop tabl... |
create table "tUser"
(
userid bigserial not null primary key,
name varchar(50),
pass varchar(50),
mail varchar(255)
);
insert into "tUser" (name, pass, mail)
values ('Petr', '123', '<EMAIL>');
insert into "tUser" (name, pass, mail)
values ('Basyl', 'ABC', '<EMAIL>');
insert into "tUser" (name, pass, ma... |
<filename>Sample_Bikes_Sales_content/HANA/index/DWC_DEMO/Ad/Addresses/create.sql
CREATE COLUMN TABLE "DWC_DEMO"."Addresses" ("ADDRESSID" NVARCHAR(10) NOT NULL , "STREET" NVARCHAR(60), "CITY" VARCHAR(40), "POSTALCODE" NVARCHAR(10), "BUILDING" NVARCHAR(10), "COUNTRY" NVARCHAR(3), "REGION" NVARCHAR(4), "ADDRESSTYPE" NVARC... |
-- Determine the number of words in a string. Words are allowed to
-- be seperated only by spaces, but multiple spaces between
-- words are allowed.
CREATE OR REPLACE FUNCTION count_words(VARCHAR) RETURNS INTEGER
AS $_$
DECLARE
tempString VARCHAR;
tempInt INTEGER;
count INTEGER := 1;
lastSpace BOOLEAN := FALSE... |
CREATE INDEX course_type_idx ON course (type);
CREATE INDEX aux_course_crn_idx ON aux (course_crn);
CREATE INDEX non_zero_aux_course_crn_idx ON aux (course_crn)
WHERE
course_crn != 0;
-- Holy bageebus this thing is fast
--
-- This view is actually being used in application logic,
-- most of the other views are j... |
<reponame>AsifZaman777/tour-guide-C-sharp
CREATE TABLE HISTORY_INFO (
Search_serial VARCHAR(20) NOT NULL,
Search_date DATE NOT NULL,
Search_spot VARCHAR(20) NOT NULL,
Draft_cost VARCHAR(20) NOT NULL,
User_id VARCHAR(20) NOT NULL
)
drop table HISTORY_INFO
INSERT INTO HISTORY_INFO (Search_serial,Search_date,Search_spot... |
<filename>backend/agricultura-familiar/src/main/resources/db/migration/V1.4.0__userAuth.sql
CREATE TABLE IF NOT EXISTS `user`(
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
email VARCHAR(100) NOT NULL UNIQUE,
`password` TEXT NOT NULL,
enabled BOOL NOT NULL
);
CREATE TABLE IF NOT EXISTS `role` (
id INTEGER NOT N... |
<reponame>jasarsoft/fit-src
USE AdventureWorks2014
SELECT ProductNumber, ListPrice
FROM Production.Product
WHERE ListPrice IN (52.64, 74.99, 147.14) |
<filename>db/seeds.sql
INSERT INTO burgers (burger_name, devoured) VALUES ('Cheese', true);
INSERT INTO burgers (burger_name, devoured) VALUES ('California', false);
INSERT INTO burgers (burger_name, devoured) VALUES ('Monster', true);
|
<reponame>GrupoRoma/gerencial_G3<filename>SQL_QUERYS/Projetos SQL/GERENCIAL_3/GERENCIAL 3.0/G3 - Veiculos Vendidos - SGA - AnaliseVendasEmail.sql
/**
* VEÍCULOS VENDIDOS - RATEIO LOGÍSTICA GERENCIAL 3.0
*/
SELECT codigoEmpresa = COALESCE( -- 1. Empresa da Proposta se o vendedor for de regional diferente (ex: FIAT ve... |
<reponame>JohnVanOrange/Core<gh_stars>0
CREATE TABLE IF NOT EXISTS `media` (
`uid` varchar(6) character set utf8 collate utf8_bin NOT NULL,
`file` varchar(255) collate utf8_unicode_ci NOT NULL,
`format` varchar(4) collate utf8_unicode_ci NOT NULL,
`hash` varchar(32) collate utf8_unicode_ci NOT NULL,
`width` s... |
CREATE TABLE `books` (
`id` int(11) unsigned NOT NULL ,
`publisher_id` int(11) NOT NULL,
`title` varchar(255) NOT NULL DEFAULT '',
`language_id` int(11) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURREN... |
<filename>site_members.sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 21, 2021 at 03:16 PM
-- Server version: 10.2.32-MariaDB-1:10.2.32+maria~bionic-log
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START T... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: Jan 23, 2019 at 04:23 AM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
<reponame>NeeteshMaurya/Blog<filename>DB backup/my_blog.sql
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 21, 2020 at 03:33 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
STAR... |
create or replace table bulk_data (
id number
, healthcare varchar
, email varchar
, btc varchar
, mandarin varchar
, uri varchar
, truthiness varchar
, quantity number
, mass float
, faked_at timestamp
);
create or replace table hey (
col1 number
, col2 number
, col... |
<reponame>timusumit/ynsite<filename>gallery_setup.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 20, 2018 at 11:42 AM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!... |
ALTER TABLE review
DROP COLUMN box_rating,
DROP COLUMN box_reusability_rating,
DROP COLUMN product_reusability_rating,
ADD COLUMN box_reusable INT NOT NULL,
ADD COLUMN box_recycable INT NOT NULL,
ADD COLUMN box_from_recycling INT NOT NULL,
ADD COLUMN product_reusable INT NOT NULL,
ADD CO... |
-------------------------------------------------------------------------------------------------------
-- <NAME> -- Maio de 2019 --------------------------------------------------------------
-------------------------------------------------------------------------------------------------------
SELECT *
FROM ... |
<filename>sql-core/updates/coreUpdate0001.sql
---------------------------------------------------------------------------------------------------------------------------------
--IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = 'zzp_service')
-- CREATE ROLE zzp_service
--GO
-----------------------... |
<filename>mysql/scripts/updateLastLoginTimestamp.sql
DELIMITER //
CREATE PROCEDURE updateLastLoginTimestamp (
p_username CHAR(128),
p_lastLoginTimestamp BIGINT
)
BEGIN
UPDATE worldofrations.users SET `lastLoginTimestamp` = lastLoginTimestamp
WHERE `username` = p_username;
END;
//
DELIMITER ; |
<reponame>tushartushar/dbSmellsData
CREATE TABLE `schema_migrations` (`filename` varchar(255) NOT NULL PRIMARY KEY)
CREATE TABLE `dependencies`(`id` integer DEFAULT (NULL) NOT NULL PRIMARY KEY, `name` varchar(255) DEFAULT (NULL) NOT NULL, `version` varchar(255) DEFAULT (NULL) NULL, `summary` varchar(255) DEFAULT (NULL)... |
<reponame>a11smiles/ica-wbs
/*
* @version=1.6RC1-4
*
* Stage RC2 for 1.6RC5 upgrade
*/
UPDATE `%TABLE_PREFIX%config`
SET `ostversion`='1.6 RC1-4';
|
<gh_stars>100-1000
CREATE TABLE account_setting_data_type (
data_type_id text PRIMARY KEY
);
INSERT INTO account_setting_data_type VALUES ('string');
CREATE TABLE account_setting (
account_setting_id text PRIMARY KEY,
constrained boolean NOT NULL,
data_type text NOT NULL REFERENCES account_setting_data_type(d... |
<gh_stars>1-10
CREATE TABLE [dbo].[AuthorContentItem]
(
[ContentItemID] [int] NOT NULL,
[UserID] [int] NOT NULL,
[ordering] [tinyint] NOT NULL CONSTRAINT [DF_AuthorContentItem_ordering] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[AuthorContentItem] ADD CONSTRAINT [PK_AuthorContentItem] PRIMARY KEY CLUSTERED ([C... |
<filename>ifs-data-layer/ifs-data-service/src/main/resources/db/migration/V146_11_1__Update_h2020_template_terms_to_latest.sql<gh_stars>10-100
-- IFS-6192 Update the H2020 template to the latest Innovate UK terms
UPDATE competition
SET terms_and_conditions_id = (SELECT id FROM terms_and_conditions WHERE name='Innovate... |
/*
Navicat Premium Data Transfer
Source Server : kominfo
Source Server Type : MySQL
Source Server Version : 100406
Source Host : localhost:3306
Source Schema : db_sipakbuta
Target Server Type : MySQL
Target Server Version : 100406
File Encoding : 65001
Date: 02/01/20... |
CREATE TABLE confirm_pending_setting (
id SERIAL PRIMARY KEY,
key_id TEXT NOT NULL,
timestamp TIMESTAMPTZ NOT NULL,
setting_change_id INT NOT NULL,
UNIQUE (key_id, setting_change_id),
CONSTRAINT setting_change_fk
FOREIGN KEY(setting_change_id)
R... |
IF EXISTS (SELECT * FROM sys.databases WHERE name = 'nhs_virtual_visit_dev')
BEGIN
DROP DATABASE nhs_virtual_visit_dev;
END;
CREATE DATABASE nhs_virtual_visit_dev;
GO
IF EXISTS (SELECT * FROM sys.databases WHERE name = 'nhs_virtual_visit_test')
BEGIN
DROP DATABASE nhs_virtual_visit_test;
END;
CREATE DATABA... |
show search_path;
set search_path to sqlalchemy_challenge;
CREATE TABLE stations (
station_id INT not null,
station_name varchar primary key,
latitude integer NOT NULL,
longitude integer NOT NULL,
elevation integer NOT NULL);
CREATE TABLE measurments (
station_id INT PRIMARY KEY,
station_date VARCHAR NOT NULL... |
-- Mar 9, 2016 9:30 AM
-- URL zum Konzept
UPDATE AD_Field SET DisplayLogic='@Type_Conditions@=''Subscr''|@Type_Conditions@=''QualityBsd''|@Type_Conditions@=''Procuremnt''',Updated=TO_TIMESTAMP('2016-03-09 09:30:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=550474
;
-- Mar 9, 2016 9:43 AM
-- URL zum Konz... |
BEGIN BATCH
INSERT INTO "user_status_updates"
("username", "id", "body")
VALUES
('dave', 16e2f240-2afa-11e4-8069-5f98e903bf02, 'dave update 4');
INSERT INTO "home_status_updates" (
"timeline_username",
"status_update_id",
"status_update_username",
"body"
) VALUES (
'alice',
16e2f240... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 04, 2019 at 02:07 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.0.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
USE HPI;
DELETE FROM hpi_ofheo_monthly;
LOAD DATA LOCAL INFILE 'csv/hpi_ofheo_monthly.tsv' INTO TABLE hpi_ofheo_monthly
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
IGNORE 0 LINES;
DELETE FROM hpi_state_monthly;
INSERT INTO hpi_state_monthly
(SELECT round(pb_date/100,0),region_code,round(hpi_index,2),round(hpa_yo... |
<filename>sql/groups.sql
CREATE TABLE IF NOT EXISTS `groups` (
`group_id` int(255) NOT NULL AUTO_INCREMENT,
`group_name` mediumtext NOT NULL,
`group_description` mediumtext NOT NULL,
`group_category` int(255) NOT NULL,
`group_tags` mediumtext NOT NULL,
`group_url` mediumtext NOT NULL,
`group_image`... |
<reponame>rjsimosa22/aventuras
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 24-07-2020 a las 00:26:51
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 7.0.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSAC... |
<reponame>pmohan2/Employee_DB_SQL
SELECT titles.emp_no, COUNT(titles.emp_no) AS cnt FROM titles
LEFT JOIN salaries ON titles.emp_no = salaries.emp_no AND titles.from_date = salaries.from_date
WHERE titles.emp_no IN (SELECT emp_no FROM titles GROUP BY emp_no HAVING COUNT(emp_no) > 1)
AND salaries.salary IS NULL GROUP ... |
--------------------------------------------------------
-- DDL for Table SDPRED
--------------------------------------------------------
CREATE TABLE "GROUNDFISH"."SDPRED"
( "SPEC" NUMBER(4,0),
"DESCRIPTION" VARCHAR2(30 BYTE)
) PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INI... |
-------------------------------------------------------------------------------
--
-- Script: shared_pool_summary.sql
-- Purpose: to get an overview of chunks in the shared pool
-- For: to 7.3
--
-- Copyright: (c) Ixora Pty Ltd
-- Author: <NAME>
--
-- Warning: This script queries x$ksmsp which causes it to ta... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 18, 2021 at 04:02 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<filename>sql/Provera_cena_broj_dedcimala.sql<gh_stars>0
select
sD.ROWID , --pjedmere.naziv(sd.proizvod) jm,pproizvod.naziv(sd.proizvod) ,
D.*,
SD.*
from stavka_dok sd , dokument d
Where sd.godina = d.godina and sd.vrsta_dok = d.vrsta_dok and sd.broj_dok = d.broj_dok
-----------------------------
-- ostali us... |
<reponame>Joey-Ramos/reading_nook<filename>db/schema.sql
DROP DATABASE IF EXISTS reading_nook_db;
CREATE DATABASE reading_nook_db; |
<reponame>wqcsimple/dzjs
-- phpMyAdmin SQL Dump
-- version 4.4.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2015-12-31 15:25:34
-- 服务器版本: 10.1.9-MariaDB-log
-- PHP Version: 5.4.45
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
---
name: del_alias
description: Delete Alias
returns: void
templates:
- user.userlogin
parameters:
-
name: p_localpart
type: email.t_localpart
-
name: p_domain
type: dns.t_hostname
-
name: p_mailbox_localpart
type: email.t_localpart
-
name: p_mailbox_domain
type: dns.t_hostname
---
UPDATE emai... |
<filename>5.2.3/Database/Constraints/AFW_12_INSTA_PROCS_APROB_UK1.sql
SET DEFINE OFF;
ALTER TABLE AFW_12_INSTA_PROCS_APROB ADD (
CONSTRAINT AFW_12_INSTA_PROCS_APROB_UK1
UNIQUE (REF_STRUC_APLIC, REF_SEQNC_STRUC_APLIC, REF_GROUP_STAT)
ENABLE VALIDATE)
/
|
CREATE TABLE users(
id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
ismanager TINYINT NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE task (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(255),
note LONGTEXT,
... |
-- Worst COVID19 Vaccine Manufacturers
SELECT
tV.VaccineType as `Vaccine Type`,
tV.Manufacturer,
SUM(DIED) as `Number of Deaths`
FROM tInjuryData D
INNER JOIN tVaccine tV on D.VAERS_ID = tV.VAERS_ID
WHERE D.DIED = 1
AND tV.VaccineType = 'COVID19'
GROUP BY tV.VaccineType, tV.Manufacturer
ORD... |
ALTER TABLE COI_DISC_DETAILS
ADD CONSTRAINT UQ_COI_DISC_DETAILS
UNIQUE (COI_DISCLOSURE_NUMBER, SEQUENCE_NUMBER, COI_DISC_DETAILS_NUMBER)
/
|
<filename>tests/queries/067-int8-lt-str-0.sql
select int8_1 from nulls where int8_1 < '-46'
-48
|
# Host: localhost (Version: 5.5.53)
# Date: 2018-09-11 10:44:38
# Generator: MySQL-Front 5.3 (Build 4.234)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "system_config"
#
DROP TABLE IF EXISTS `system_config`;
CREATE TABLE `system_config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAUL... |
<gh_stars>0
-- DSMDB_Patch3
-- CHANGE THE PATCH NUMBER TO THE NEXT NEW ONE AFTER THOSE STORED IN DSM REPO
USE data_sharing_manager;
DROP PROCEDURE IF EXISTS RunPatchIfNotRunAlready;
DELIMITER //
CREATE PROCEDURE RunPatchIfNotRunAlready()
BEGIN
-- (CHANGE THE PATCH NUMBER TO THE NEXT NEW ONE AFTER THOSE STORED IN... |
set colsep ','
set echo off
set feedback off
set pagesize 0
set trimspool on
set headsep off
set linesize 300
set sqlprompt ''
select RUNNUM,DATA_ID,COUNT(*) from CMS_LUMI_PROD.LUMISUMMARYV2 group by (RUNNUM,DATA_ID);
spool nlsperrun.dat
/
|
-- Copyright 2021 Google 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://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in ... |
<filename>coral-trino/src/test/resources/product_test_cases_expected/q11_expected.sql
select `ps_partkey`, sum(`ps_supplycost` * `ps_availqty`) as `value`
from `nation`
where `ps_suppkey` = `s_suppkey` and `s_nationkey` = `n_nationkey` and `n_name` = 'germany'
group by `ps_partkey`
having sum(`ps_supplycost` * `ps_avai... |
<reponame>sachintyagi/lokhit
update `employees` set `id`='1',`user_id`='sktyagi',`password`='<PASSWORD>',`first_name`='<NAME>',`last_name`='Tyagi',`employee_code`='10010001',`blood_group`='A+',`phone_no`='24242424234',`mobile_no`='24242424234',`father_name`='Na',`mother_name`='na',`email`='<EMAIL>',`spouse_name`='Na',`... |
<filename>openGaussBase/testcase/SQL/FULL_TEXT_SEARCH/text_match/Opengauss_Function_Text_Match_Case0008.sql
-- @testpoint: default_text_search_config参数测试(无效性)合理报错
--使用set命令设置default_text_search_config为不存在的文本搜索配置,合理报错
set default_text_search_config to sample;
set default_text_search_config to simples;
--参数中含有数字
set defa... |
<reponame>gdraa/db-sample-schemas
Rem
Rem $Header: rdbms/demo/schema/mksample.sql.sbs /main/12 2015/03/19 10:23:26 smtaylor Exp $
Rem
Rem mksample.sql
Rem
Rem Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
Rem
Rem Permission is hereby granted, free of charge, to any person obtaining
Rem... |
<filename>SQLite_queries.sql
/* Records for SQLite
Create the table: */
`
CREATE TABLE users (
entry_date varchar (20) NOT NULL,
user varchar (20) NOT NULL
);
`
/* Get the table data with auto increment id feature from SQLite: */
`
SELECT
rowid,
entry_date,
user
FROM
user... |
<reponame>jmcuy/twitter-clone
-- Count how many users the given user is following.
--
-- You have access to the following variables which can be used as placeholders
-- for actual values:
-- - email
--
-- Write your query below:
SELECT COUNT(DISTINCT FOLLOWING) from follows WHERE follower = '{{email}}'; |
<filename>src/main/resources/db/postgres_webdb.ddl
drop database if exists webdb;
create database webdb;
\connect webdb;
create schema webdb;
drop sequence if exists webdb.users_id_seq;
create sequence webdb.users_id_seq start with 1 increment by 1 ;
drop sequence if exists webdb.comments_id_seq;
create sequence webdb... |
--name: all-anchored
SELECT
id_control_unit_data,
ship_description,
type_acronym as ship_type,
ts_last_ship_activity AS anchoring_time,
ship_current_activities.description AS current_activity,
anchorage_points.description AS anchorage_point,
iso3,
gross_tonnage,
ships.length,
ships.width,
agencies.description as... |
SELECT MD5(REPLACE(CONCAT(phone_number, '42'), '7', '9')) AS 'ft5'
FROM distrib
WHERE id_distrib = 84; |
-- # Problem: Samantha was tasked with calculating the average monthly salaries for all employees in the
-- EMPLOYEES table, but did not realize her keyboard's 0 key was broken until after completing the calculation.
-- She wants your help finding the difference between her miscalculation (using salaries with any zero... |
<reponame>riseupz/tormor
CREATE TABLE employee(
name text NOT NULL,
CONSTRAINT employee_pk PRIMARY KEY(name));
INSERT INTO employee(name)
VALUES('Employee1');
INSERT INTO employee(name)
VALUES('Employee2');
INSERT INTO employee(name)
VALUES('Employee3'); |
--------------------------------------------------------
-- DDL for Trigger SOK_USER_TG
--------------------------------------------------------
CREATE OR REPLACE TRIGGER "SOK_USER_TG"
BEFORE INSERT OR UPDATE
ON SOK_USER
FOR EACH ROW
BEGIN
IF INSERTING
THEN
IF LENGTH(:NEW.user_firstname... |
/*%!-
[script]
- name: "test-two"
- description: "this is test2.sql"
[dev]
- table1: "A.C.Table1"
- table2: "A.C.Table2"
- ref1: REF("test-three")
- env: "dev"
-!%*/
select * from '{{.table1}}' union all '{{.table2}}' union all {{.ref1}}
{{if (eq .env "dev")}}
select top 10 * from dev
{{els... |
-- URL: https://www.hackerrank.com/challenges/harry-potter-and-wands/problem
select w.id, wp.age, w.coins_needed, w.power
from wands w
join wands_property wp on w.code = wp.code
where wp.is_evil != 1
and w.coins_needed = (select min(wands.coins_needed)
from wands
... |
-- Add migration script here
CREATE TABLE daemon_user_transaction (
user_id uuid NOT NULL
,ship_id VARCHAR(50) NOT NULL
,type VARCHAR(50) NOT NULL
,good_symbol VARCHAR(50) NOT NULL
,price_per_unit INT NOT NULL
,quantity INT NOT NULL
,total INT NOT NULL
,location_symbol VARCHAR(100) NOT ... |
DROP TABLE ServiceTemplate IF EXISTS;
CREATE TABLE ServiceTemplate (
id BIGINT IDENTITY PRIMARY KEY,
name VARCHAR(30)
); |
DROP TABLE "rating";
DROP TABLE "person";
DROP TABLE "resource";
|
DROP FUNCTION IF EXISTS spatial_filter_common_page(text[], character varying,
real, real, real, real, character varying, real, real);
--Returns the spatiotemporal attributes of solar events from multiple tables
-- that are filtered using a predicate and a spatial window (bounding box,
-- given with four coordinat... |
<reponame>yafimm/tubeswebpro
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 18, 2018 at 05:38 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = ... |
CREATE TABLE products (
id integer,
PRIMARY KEY (id)
);
CREATE TABLE sales (
id integer PRIMARY KEY
product_id REFERENCES products
);
CREATE TABLE sales_2019 (
id integer,
product_id integer,
FOREIGN KEY (product_id) REFERENCES products (id)
);
CREATE TABLE sales_2020 (
id integer,
product... |
<filename>docker/dev/init/db/docker-entrypoint-initdb.d/02_create_tables.sql<gh_stars>1-10
CREATE TABLE "remy-vallet_db_myerp".public.journal_comptable (
code VARCHAR(5) NOT NULL,
libelle VARCHAR(150) NOT NULL,
CONSTRAINT journal_comptable_pk PRIMARY KEY (code)
);
CREA... |
<gh_stars>1-10
-- NOTE: This set of instructions clears up a campaign and resets it to it's default status by removing all fullfillments, contributions, commitments and recovations.
-- NOTE: You need to change the campaign_id in all queries below to use it for the desired campaign.
-- Remove all recovations for this c... |
-- +migrate Up
-- +migrate StatementBegin
ALTER TABLE output
ADD INDEX Idx_ModifedSpentTxHash (modified_at ASC, is_spent ASC, transaction_hash ASC);
-- +migrate StatementEnd |
INSERT INTO roles (name) values ('ROLE_ADMIN');
INSERT INTO roles (name) values ('ROLE_USER'); |
<reponame>Shuttl-Tech/antlr_psql<gh_stars>10-100
-- file:rolenames.sql ln:47 expect:true
CREATE ROLE "user"
|
-- file:rules.sql ln:204 expect:true
insert into rtest_v1 (a) select a from rtest_t3
|
<reponame>Shuttl-Tech/antlr_psql
-- file:interval.sql ln:147 expect:true
SELECT justify_days(interval '6 months 36 days 5 hours 4 minutes 3 seconds') as "7 mons 6 days 5 hours 4 mins 3 seconds"
|
DROP DATABASE IF EXISTS playlist_DB;
CREATE DATABASE playlist_DB;
USE playlist_DB;
CREATE TABLE songs (
id INT NOT NULL AUTO_INCREMENT,
song VARCHAR(45) NULL,
artist VARCHAR(15) NULL,
genre VARCHAR(15) NULL,
PRIMARY KEY (id)
);
INSERT INTO songs (song, artist, genre)
VALUES ("Jolene", "<NAME>", "Country")... |
<filename>pocs/etl-smooks-tests/src/main/resources/db-create.sql
CREATE TABLE pessoas (id INTEGER, nome VARCHAR(50) ); |
<gh_stars>0
CREATE TABLE IF NOT EXISTS node_tree
(
id integer not null
constraint node_tree_pk primary key autoincrement,
type smallint default 0 not null,
parent_id integer default 0 not null,
name text not null,
create_time timestamp ... |
<gh_stars>0
create table registration_item (
id int primary key AUTO_INCREMENT,
user_id int not null,
provider_account_id int not null,
client_project_id int not null,
created timestamp not null default now(),
is_active enum ('Y','N') not null default 'y',
ended timestamp null ,
name varchar(200) not null,... |
USE wagstaff_INFOST_410;
/** List the book code and book title for each book. **/
SELECT BookCode, Title
FROM Book;
/** List complete Publisher table **/
SELECT *
FROM Publisher;
/** List the name for each publisher in Boston **/
SELECT PublisherName
FROM Publisher
WHERE City LIKE '%Boston%';
/** List the name of e... |
<reponame>mrkara/PRIVACYMAP<gh_stars>0
/*
Warnings:
- A unique constraint covering the columns `[stripeCustomerId]` on the table `ConsultancyFirm` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the columns `[stripeSubscriptionId]` on the table `ConsultancyFi... |
<reponame>ghxiao/clipper
DROP VIEW v_JournalArticle CASCADE;
CREATE OR REPLACE VIEW v_JournalArticle AS
SELECT innerRel.x1 AS att1
FROM (
SELECT ca_0.individual AS x1
FROM concept_assertion ca_0
WHERE ca_0.concept=49
) as innerRel
|
<reponame>tharangar/k8s-webserver
-- db_patches
INSERT INTO `db_patches` (`issue`, `created`) VALUES ('POCOR-3049', NOW());
-- security_functions
UPDATE `security_functions` SET `order` = `order`+1 WHERE `order` >= 5028 AND `order` <= 5042;
INSERT INTO `security_functions` (`id`, `name`, `controller`, `module`, `cate... |
Create Database BookManager
Go
Use BookManager
Go
--登录信息表
Create Table Sigin
(
ID int primary key identity(1,1),
Username varchar(20) not null,
[Password] varchar(32) not null,-- 读者随机 管理员需要md5加密 测试忽略
[Identity] int not null,-- 0读者 1图书管理员 2超级管理员
)
Go
--用户信息表
Create Table [User]
(
ID int primar... |
-- +migrate Up
-- SQL in section 'Up' is executed when this migration is applied
INSERT INTO GenesisAccounts(publicKey, accountHash, type, balance)
VALUES
('018afa98ca4be12d613617f7339a2d576950a2f9a92102ca4d6508ee31b54d2c02', '<KEY>', 'account', 9999995600000000000),
('0106ca7c39cd272dbf21a86eeb3b36b7c26e2e9b9... |
CREATE DATABASE IF NOT EXISTS `kardio_oss` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `kardio_oss`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win64 (x86_64)
--
-- Host: Database: kardio
-- ------------------------------------------------------
-- Server version 5.6.40-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
-- A query with limit while the table is locked from master
Drop table if exists query_lock;
Create table query_lock( i int, j int, k int) ;
Insert into query_lock select i, i % 2, i % 10 from generate_series(1, 100)i;
1:Begin;
2:Begin;
2:Alter table query_lock add column my_newcol int;
1&:Select i, count(*) over (par... |
<gh_stars>0
-- This query updates the 'P50 Phase Runtime' and 'P90 Phase Runtime' metrics in the cq_builder_metrics_week
-- table. It uses an interval of the last 8 days so that on Mondays, it will update stats for the full
-- previous week as well as stats for the current week.
-- This query is meant to be almost iden... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.