sql stringlengths 6 1.05M |
|---|
<gh_stars>10-100
-- file:inherit.sql ln:233 expect:true
insert into c1 values(123456789, 'hi', 42)
|
-- file:insert_conflict.sql ln:221 expect:true
insert into insertconflicttest values (23, 'Blackberry') on conflict (key) where fruit like '%berry' or fruit = 'consequential' do nothing
|
<filename>app/lib/db_query/sql/places/towns.sql
/**
* Countries
*/
SELECT
Place.name,
Town.id
FROM Place
INNER JOIN Town ON Place.id = Town.id
ORDER BY name
|
select name,population,area
from world
where population>25000000
or area>3000000; |
create view "postgres"._airbyte_test_normalization."nested_stream_with_c___names_partition_data_ab2__dbt_tmp" as (
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
select
_airbyte_partition_hashid,
cast(currency as
varchar
) as currency,
_airbyte_emi... |
<filename>Database/Procedures/2020_12_16_015_SP_GetCountry.sql
USE [Hotels_DB]
GO
/****** Object: StoredProcedure [dbo].[GetCountry] Script Date: 16.12.2020 16:59:59 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <... |
<gh_stars>1000+
-- 2018-06-11T13:39:24.032
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET SpanX=2,Updated=TO_TIMESTAMP('2018-06-11 13:39:24','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=561301
;
|
<gh_stars>1-10
CREATE TABLE users (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
username VARCHAR( 32 ) NOT NULL,
password VARCHAR( 32 ) NOT NULL,
email VARCHAR( 100 ) NOT NULL,
online INT( 20 ) NOT NULL,
active INT( 1 ) NOT NULL,
created_at timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE = InnoDB CHARACTER... |
--заданные таблицы
CREATE TABLE company
(
id integer NOT NULL,
name character varying,
CONSTRAINT company_pkey PRIMARY KEY (id)
);
CREATE TABLE person
(
id integer NOT NULL,
name character varying,
company_id integer,
CONSTRAINT person_pkey PRIMARY KEY (id)
);
--решения задач
--1) Retrieve in a single query:
-- names ... |
<filename>test/ut3_user/expectations/test_expectation_anydata.pks
create or replace package test_expectation_anydata is
--%suite(equal on anydata)
--%suitepath(utplsql.test_user.expectations)
--%aftereach
procedure cleanup;
--%test(Gives failure when comparing NULL objects of different type)
procedure fa... |
DROP TABLE IF EXISTS test_tb;
CREATE TABLE test_tb (a UInt64, s String) ENGINE = MergeTree() ORDER BY a;
DROP VIEW IF EXISTS test_view_tb;
CREATE MATERIALIZED VIEW test_view_tb ENGINE = MergeTree() ORDER BY a AS SELECT * FROM test_tb;
INSERT INTO test_tb VALUES (1, '1'), (2, '2'), (3, '3');
SELECT count(_part) FROM ... |
/*
View for displaying users and groups.
example:
select * from admin.v_users_groups;
+------------+-------------+--------------+
| group_name | user_name | is_superuser |
+------------+-------------+--------------+
| group_a | user_a | true |
+------------+-------------+--------------+
*/
CR... |
DROP TABLE cars CASCADE;
DROP TABLE company CASCADE;
DROP TABLE emaillog CASCADE;
DROP TABLE emaillog_project CASCADE;
DROP TABLE emaillog_realizator CASCADE;
DROP TABLE notify CASCADE;
DROP TABLE parts CASCADE;
DROP TABLE privatedrive CASCADE;
DROP TABLE project CASCADE;
DROP TABLE roles CASCADE;
DROP TABLE task_histo... |
-- Add this procedure to Oracle server to kill sessions during tests.
CREATE OR REPLACE PROCEDURE sys.kill_dev_session(p_sid NUMBER, p_serial NUMBER)
AS
v_user VARCHAR2(30);
BEGIN
SELECT MAX(username)
INTO v_user
FROM v$session
WHERE sid = p_sid
AND serial# = p_serial;
IF v_user NOT IN ('... |
<gh_stars>1000+
CREATE TABLE public.experiment_snapshots (
id SERIAL,
experiment_id integer NOT NULL UNIQUE,
content jsonb NOT NULL,
version integer NOT NULL,
created_at timestamp with time zone NOT NULL DEFAULT NOW(),
updated_at timestamp with time zone NOT NULL DEFAULT NOW(),
CONSTRAINT f... |
create schema if not exists flybase;
grant usage on schema flybase to PUBLIC;
/**
Function to fetch a current entry from the synonym table using the
specified FlyBase ID and the type (symbol, fullname, etc.).
Returns a single value or null.
*/
create or replace function flybase.current_synonym(id text, synonym_type te... |
<reponame>NCIP/cabio<filename>software/cabio-database/scripts/sql_loader/no_longer_used/indexes/gene_function_association.cols.sql
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
create index GENE_FUNTION_DISCRIM... |
<reponame>CBIIT/rembrandt<gh_stars>1-10
/*L
Copyright (c) 2006 SAIC, SAIC-F.
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/rembrandt/LICENSE.txt for details.
L*/
ALTER TABLE principal ADD (first_name VARCHAR2(40) NULL);
ALTER TABLE principal ADD (last_name VARCHAR2(40) NULL... |
<gh_stars>10-100
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : KerasRegressor_LSTM
-- Dataset : RandomReg_100
-- Database : sqlite
-- This SQL code can contain one or more statements, to be executed in the order they appear in this file.
-- Model deployment code... |
<reponame>Meits/crlar<filename>laravel_mod(3).sql
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Ноя 19 2019 г., 23:46
-- Версия сервера: 5.7.20
-- Версия PHP: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET ... |
<reponame>Shahrullo/HackerRank_SQL_Challenge
SELECT ROUND(LONG_W, 4)
FROM STATION
WHERE LAT_N IN (SELECT MIN(LAT_N)
FROM STATION
WHERE LAT_N > 38.7780); |
-- Adminer 4.6.2 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `contributions`;
CREATE TABLE `contributions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`tranaction_id` int(11) NOT NULL,
`member_id` bigint(20) NOT NUL... |
-- name: CreateItem :one
INSERT INTO items (order_id, quantity, name, user_id, user_name)
VALUES ($1, $2, $3, $4, $5)
RETURNING *;
-- name: GetItemsByOrderID :many
SELECT * FROM items
WHERE order_id = $1;
-- name: GetItem :one
SELECT * FROM items
WHERE order_id = $1
AND user_id = $2
AND LOWER(name) = LOWER($3);
-- n... |
<filename>admin_v6.sql
/*
Navicat Premium Data Transfer
Source Server : local.server.cuci.cc
Source Server Type : MySQL
Source Server Version : 50562
Source Host : server.cuci.cc:3306
Source Schema : admin_v6
Target Server Type : MySQL
Target Server Version : 50562
File Encodi... |
BEGIN
OR_DB_SCHEMA.any_random_prc( 'Any_Condition', '20250720', '20250731');
END;
-- Procedure: A Procedure is a Named PL/SQL Block performing one or more actions associated to business logic.
-- It is also called Stored procedure
-- It accept the parameters
-- It is Explicitely called by using Executives.
-- It ma... |
/**
* @author <NAME> - 04.09.2021
*/
SELECT DISTINCT city FROM station
WHERE city LIKE 'a%' OR city LIKE 'e%' OR city LIKE 'i%' OR city LIKE 'o%' OR city LIKE 'u%';
|
<filename>course-service/src/main/resources/db/data/1.1/Course.sql
create table public.Course
(
id bigserial primary key,
name varchar(255) not null,
created timestamp default CURRENT_TIMESTAMP,
external_id varchar(50) not null unique,
author ... |
-- Örnek 1
SELECT title, description FROM film;
-- Örnek 2
SELECT * FROM film
WHERE length > 60 AND length < 70;
-- Örnek 3
SELECT * FROM film
WHERE rental_rate = 0.99 AND replacement_cost = 12.99 OR replacement_cost = 28.99;
-- Örnek 4
SELECT last_name FROM customer
WHERE first_name = 'Mary'
-- Örnek 5
SELECT * FR... |
<gh_stars>1-10
SELECT SUM(c_acctbal), c_name
FROM customer, orders
WHERE c_custkey = o_custkey
GROUP BY c_name
|
<reponame>Bagus06/miss<filename>db/database.sql
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40... |
<filename>migrations/postgresql/00006_usa_address.sql
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE usaAddresses (
id BIGSERIAL NOT NULL PRIMARY KEY,
street VARCHAR(255) NOT NULL DEFAULT '',
city VARCHAR(255) NOT NULL DEFAULT '',
state VARCHAR(255) NOT NULL... |
<gh_stars>100-1000
-- lock3.test
--
-- execsql {BEGIN DEFERRED TRANSACTION}
BEGIN DEFERRED TRANSACTION |
<reponame>Shuttl-Tech/antlr_psql
-- file:float8.sql ln:174 expect:true
SELECT x,
sind(x),
sind(x) IN (-1,-0.5,0,0.5,1) AS sind_exact
FROM (VALUES (0), (30), (90), (150), (180),
(210), (270), (330), (360)) AS t(x)
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 19 Lut 2018, 10:39
-- Wersja serwera: 10.1.28-MariaDB
-- Wersja PHP: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
-- Copyright 2004-2019 H2 Group. Multiple-Licensed under the MPL 2.0,
-- and the EPL 1.0 (http://h2database.com/html/license.html).
-- Initial Developer: H2 Group
--
create alias "SYSDATE" for "java.lang.Integer.parseInt(java.lang.String)";
> exception FUNCTION_ALIAS_ALREADY_EXISTS_1
create alias "MIN" for "java.lang... |
DELETE FROM DGB_DOCUMENTS WHERE DOC_FILE_PATH = ? |
{{ dbt_utils.generate_series(upper_bound=1000) }}
|
<filename>macros/get_lifetime_post_metrics_total_columns.sql<gh_stars>1-10
{% macro get_lifetime_post_metrics_total_columns() %}
{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()},
{"name": "date", "datatype": dbt_utils.type_timestamp()},
{"name": "post_activity", "data... |
<filename>models/double_entry_transactions/int_quickbooks__invoice_double_entry.sql
/*
Table that creates a debit record to accounts receivable and a credit record to a specified revenue account indicated on the invoice line.
*/
--To disable this model, set the using_invoice variable within your dbt_project.yml file t... |
-- AlterTable
ALTER TABLE "Request" ADD COLUMN "pets" BOOLEAN NOT NULL DEFAULT false;
|
<gh_stars>0
-- Enable Database Mail for this instance
EXECUTE sp_configure 'show advanced', 1;
RECONFIGURE;
EXECUTE sp_configure 'Database Mail XPs',1;
RECONFIGURE;
GO
-- Create a Database Mail account
EXECUTE msdb.dbo.sysmail_add_account_sp
@account_name = 'Primary Account',
@de... |
SELECT
*
FROM
view_persediaan_barang4_dispu
UNION ALL
|
<filename>Cs50/pset7/pset7.sql<gh_stars>0
-- MySQL dump 10.14 Distrib 5.5.32-MariaDB, for Linux (i686)
--
-- Host: localhost Database: pset7
-- ------------------------------------------------------
-- Server version 5.5.32-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD... |
CREATE TABLE `modalidade` (
`id` BIGINT(20) NOT NULL,
`descricao` VARCHAR(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `local` (
`id` BIGINT(20) NOT NULL,
`descricao` VARCHAR(40) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `pais` (
`id` BIGINT(20) N... |
<gh_stars>0
-- CreateTable
CREATE TABLE "roles" (
"id" TEXT NOT NULL PRIMARY KEY,
"name" TEXT NOT NULL,
"description" TEXT NOT NULL
);
-- CreateTable
CREATE TABLE "users_roles" (
"userId" TEXT NOT NULL,
"roleId" TEXT NOT NULL,
"assignedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMA... |
<gh_stars>0
/*
Warnings:
- Added the required column `protocolType` to the `Order` table without a default value. This is not possible if the table is not empty.
- Added the required column `userType` to the `Order` table without a default value. This is not possible if the table is not empty.
*/
-- CreateEnum
... |
USE statdashdb;
INSERT INTO Users (id, firstName, lastName, email, gamerTag, platform, activisionId, username, password, createdAt, updatedAt)
VALUES ('10', 'Jen', 'Jayme', '<EMAIL>', 'GeneralJayme', 'Steam - (steam)', '', 'Jen', 'password', '2020-08-28 04:56:40', '2020-08-28 04:56:40');
INSERT INTO Users (id, firstN... |
-- Query the list of CITY names from STATION that do not
-- end with vowels. Your result cannot contain duplicates.
select distinct city
from STATION
where city like '%[^aeiuo]'; |
drop table if exists itineraries;
drop table if exists carts;
drop table if exists flights;
drop table if exists hotels;
drop table if exists cars;
drop table if exists airports;
|
ALTER TABLE [Session] ALTER COLUMN MachineId int NULL
GO
ALTER TABLE [Session] ALTER COLUMN ApplicationUserId int NULL
GO |
ALTER TABLE UnsignedTransactions
ADD [CreationTime] [datetime] NULL , [HasTimedout] [bit] NULL , [TransactionIdWhichMadeThisTransactionInvalid] [bigint] NULL
ALTER TABLE [dbo].[UnsignedTransactions] WITH CHECK ADD CONSTRAINT [FK_UnsignedTransactions_UnsignedTransactions] FOREIGN KEY([TransactionIdWhichMadeThisTransa... |
prompt --application/set_environment
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... |
<reponame>Nasfame/Assignments-Masai
select name from city where country_id = (select id from countries where name="US"); |
INSERT INTO chain.transaction_trace
(block_num, transaction_ordinal, failed_dtrx_trace, id, status, cpu_usage_us, net_usage_words, elapsed, net_usage, scheduled, account_ram_delta_present, account_ram_delta_account, account_ram_delta_delta, "except", error_code, partial_present, partial_expiration, partial_ref_block_... |
SELECT
COALESCE(SUM("value"), 0)
FROM tx_out AS tx_outer
WHERE NOT EXISTS (
SELECT 1
FROM tx_out
INNER JOIN
tx_in ON tx_out.tx_id = tx_in.tx_out_id AND
tx_out.index = tx_in.tx_out_index
WHERE
tx_outer.id = tx_out.id
) AND
tx_outer.address = ANY($1); |
<filename>src/test/resources/randexpr1.test_880.sql
-- randexpr1.test
--
-- db eval {SELECT case when case when d*c not in (13,a,d) then (t1.b-f)+coalesce((select max((select count(distinct 13)-case max(11) when count(*) then count(*) else min(t1.b) end*min(17)+(min(t1.c)) from t1)) from t1 where not exists(select 1 f... |
DELETE FROM dbo.MyTable;
DELETE FROM dbo.MyTable
WHERE ID = 100; |
# expData.sql was originally generated by the autoSql program, which also
# generated expData.c and expData.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#Expression data (no mapping, just spots)
CREATE TABLE expData (
name varchar... |
DROP TABLE emprunt;
DROP TABLE auteur_de;
DROP TABLE auteur;
DROP TABLE usager;
DROP TABLE livre;
CREATE TABLE usager (
nom VARCHAR(90) NOT NULL,
prenom VARCHAR(90) NOT NULL,
adresse VARCHAR(300) NOT NULL,
cp VARCHAR(5) NOT NULL,
ville VARCHAR(60) NOT NULL,
email VARCHAR(60) NOT NULL,
code_... |
<reponame>lenamh00/corona<filename>patient_doctor(2).sql
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: 25 أغسطس 2021 الساعة 07:46
-- إصدار الخادم: 10.4.14-MariaDB
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SE... |
<gh_stars>1-10
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' ... |
INSERT INTO `category` (`displayname`) VALUES ("Politics"), ("Haking"), ("Cars"), ("Raid");
INSERT INTO `thread` (`threadname`, `categoryid`) VALUES ("Trump", 1), ("Obama", 1), ("Red-team", 2), ("Blue team", 2);
INSERT INTO `usergroups` VALUES (1000, "admin"), (6969, "user");
INSERT INTO `user` VALUES (1,'starlord','pb... |
<reponame>MD-4-GCP/GCS-HANA-Blob-Loader<filename>sqldefinition/SQL_DEFINITION_V1.sql
DROP TABLE LDS.DOCS;
CREATE COLUMN TABLE LDS.DOCS (
ID NVARCHAR(100) PRIMARY KEY,
NAME NVARCHAR(1000),
LASTMODIFIED BIGINT,
TYPE NVARCHAR(1000),
STATUS NVARCHAR(100),
CUSTOMER NVARCHAR(100),
CONTENT BLOB... |
<filename>Code/Data_Migration/src/sql/calculation.sql
/** Scenario 1 calculations **/
INSERT INTO opm.calculation(id, deleted, begin_date, end_date, retirement_type_id, period_type_id, appointment_type_id, service_type_id, amount, pay_type_id, calculation_version_id, conner_case, interest_accrual_date) VALUES(1, false,... |
--
-- $Id: bab1cdf19823524b01d3cda73f7c87502f766607 $
--
DROP TABLE IF EXISTS `grid_applications`;
DROP TABLE IF EXISTS `grid_apps`;
DROP TABLE IF EXISTS `grid_apps_error_codes`;
DROP TABLE IF EXISTS `grid_arrays`;
DROP TABLE IF EXISTS `grid_arrays_finished`;
DROP TABLE IF EXISTS `grid_clusters`;
DROP TABLE IF EXISTS `... |
<filename>tests/queries/0_stateless/00756_power_alias.sql
SELECT pow(3, 2), POW(3, 2), power(3, 2), POWER(3, 2);
|
<reponame>bseries/billing_estimate
ALTER TABLE billing_estimates CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE billing_estimates DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER TABLE billing_estimate_positions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER ... |
SELECT * FROM TAGS
WHERE
TAG_ID = ?
AND DELETE_FLAG = 0;
;
|
DROP TABLE IF EXISTS `cms_ma_type`;
CREATE TABLE `cms_ma_type` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pid` int(11) NOT NULL DEFAULT '0',
`type_name` varchar(32) NOT NULL COMMENT '分类名称',
`money_usd` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '套餐固定金额usd',
`money_rm` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COM... |
<gh_stars>0
SELECT u.Username,
AVG(f.Size) AS Size
FROM Users u
JOIN Commits c
ON u.Id = c.ContributorId
JOIN Files f
ON f.CommitId = c.Id
GROUP BY u.Username
ORDER BY Size DESC, u.Username
|
/* Database schema to keep the structure of entire database. */
CREATE TABLE animals (
id BIGSERIAL NOT NULL PRIMARY KEY,
name VARCHAR(100),
date_of_birth DATE,
escape_attempts INTEGER,
neutered BOOLEAN,
weight_kg DECIMAL
);
/*Created new tables*/
CREATE TABLE species (
id INTEGER GENERATED ALWAYS AS IDE... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.7.16, for Linux (x86_64)
--
-- Host: localhost Database: dblmjfb
-- ------------------------------------------------------
-- Server version 5.7.16-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@... |
CREATE VIEW ADDRESS_COMBINED_VIEW
AS
SELECT
AD.ADDRESS_DETAIL_PID as ADDRESS_DETAIL_PID,
AD.STREET_LOCALITY_PID as STREET_LOCALITY_PID,
AD.LOCALITY_PID as LOCALITY_PID,
AD.BUILDING_NAME as BUILDING_NAME,
IFNULL(AD.LOT_NUMBER_PREFIX, '')||IFNULL(AD.LOT_NUMBER, '')||IFNULL(AD.LOT_NUMBER_SUFFIX, '') as LOT_NUMBER,
FTA... |
<gh_stars>1-10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--... |
CREATE TABLE list (id VARCHAR(10) NOT NULL, value VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "list" ("id", "value") VALUES (E'AF', E'Afganistan');
INSERT INTO "list" ("id", "value") VALUES (E'AX', E'Ahvenamaa');
INSERT INTO "list" ("id", "value") VALUES (E'AL', E'Albaania');
INSERT INTO "list" ("id", "value")... |
CREATE TABLE `fi_imports` (
`import_id` int(11) NOT NULL AUTO_INCREMENT,
`import_date` datetime NOT NULL,
PRIMARY KEY (`import_id`)
) ENGINE = MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `fi_import_details` (
`import_detail_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`import_id` INT NOT NULL ,
`import_lang_key` ... |
CREATE NONCLUSTERED INDEX [IX_Price_CompanyId]
ON [dbo].[Price] ([CompanyId]);
CREATE NONCLUSTERED INDEX [IX_Price_Date]
ON [dbo].[Price] ([Date]); |
<filename>transform/snowflake-dbt/models/sources/sfdc/sfdc_event_source.sql<gh_stars>1-10
WITH source AS (
SELECT *
FROM {{ source('salesforce', 'event') }}
), renamed AS (
SELECT
id AS event_id,
--keys
accountid::VARCHAR ... |
<filename>SQLServer/2005/GrowthWareDB/Schema Objects/Schemas/dbo/Tables/Keys/PK_ZFC_PERMISSIONS.pkey.sql
ALTER TABLE [dbo].[ZFC_PERMISSIONS]
ADD CONSTRAINT [PK_ZFC_PERMISSIONS] PRIMARY KEY CLUSTERED ([NVP_SEQ_DET_ID] ASC) WITH (ALLOW_PAGE_LOCKS = ON, ALLOW_ROW_LOCKS = ON, PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF, STA... |
-- 角色表添加字段,用于自定义数据权限
ALTER TABLE sys_role ADD COLUMN `scope_resources` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '数据范围资源,当数据范围类型为自定义时使用' AFTER `scope_type`;
-- 用户表添加组织机构索引
ALTER TABLE `sys_user` ADD INDEX `idx_organizaiton_id`(`organization_id`);
-- 用户的组织机构不选默认为空,而不是 0
AL... |
<reponame>Deathnerd/grocy
ALTER TABLE quantity_units
ADD plural_forms TEXT;
|
# Time: O(m + n)
# Space: O(m)
SELECT DISTINCT page_id AS recommended_page
FROM likes l2
WHERE NOT EXISTS (SELECT *
FROM likes l1
WHERE l1.user_id = 1
AND l1.page_id = l2.page_id)
AND user_id IN (SELECT user2_id AS friend_id
... |
/*
Find The Subtasks That Did Not Execute Problem
Description
LeetCode Problem 1767.
Table: Tasks
+----------------+---------+
| Column Name | Type |
+----------------+---------+
| task_id | int |
| subtasks_count | int |
+----------------+---------+
task_id is the primary key for this table.
E... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
PRINT N'Creating primary key [ParentLanguageUse_PK... |
--USERS
INSERT INTO USER (USERNAME, PASSWORD, ENABLED) VALUES ('<EMAIL>','<PASSWORD>',TRUE);
INSERT INTO USER (USERNAME, PASSWORD, ENABLED) VALUES ('<EMAIL>','<PASSWORD>',TRUE);
--AUTHORITIES
INSERT INTO AUTHORITIES (USERNAME,AUTHORITY) VALUES ('<EMAIL>','ROLE_ADMIN');
INSERT INTO AUTHORITIES (USERNAME,AUTHORITY) VALU... |
<filename>db/patches/0.7.3/09.sql<gh_stars>0
-- Update TAXON_UNIT_DISPLAY enumeration constant on translation table, discriminator column.
ALTER TABLE `atlas`.`translation`
CHANGE COLUMN `discriminator` `discriminator` ENUM('OBJECT_DISPLAY', 'OBJECT_ALIASES', 'OBJECT_DEFINITION', 'OBJECT_DESCRIPTION', 'OBJECT_SAMPLE_... |
<reponame>kexinrong/macrobase
# This file contains a list of strings that are NOT valid SQL queries.
# Each line contains a single SQL query.
# Each line starts with a '!' char to indicate that parsing should fail.
!SELECT * FROM DIFF t1, t2 ON *;
!SELECT * FROM DIFF t1, t2, t3 ON * COMPARE BY a;
!SELECT * FROM DIFF t1... |
<filename>cookbook/sql-dump/query.sql
SELECT *
FROM my_numbers |
CREATE TABLE teams
( id UUID PRIMARY KEY
, name VARCHAR(64) NOT NULL UNIQUE
);
CREATE TABLE users
( id SERIAL PRIMARY KEY
, name VARCHAR(64) NOT NULL UNIQUE
, email VARCHAR(128) NOT NULL UNIQUE
, teamId UUID REFERENCES teams(id)
);
CREATE TABLE auths
( id UUID PRIMARY KEY
, userId INTEGER NOT... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.1.9
-- Dumped by pg_dump version 9.1.9
-- Started on 2013-05-24 12:44:24 CEST
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
--
--... |
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 19-Dez-2016 às 22:42
-- Versão do servidor: 5.7.9
-- PHP Version: 5.6.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
<reponame>JosueRuiz3/SistemaUniversidad.BackEnd
--PROCEDIMIENTO ALMACENADO INSERTAR CURSOS CON PROFESOR
CREATE PROCEDURE SP_CursosConProfesores_Insertar
@CodigoCurso VARCHAR(10),
@CedulaProfesor VARCHAR(15),
@NumeroCiclo VARCHAR(15),
@CreadoPor VARCHAR(50)
AS
BEGIN
INSERT INTO CursosConProfesores(CodigoCurso, C... |
SELECT *
FROM [Person].[Person]
WHERE [Person].[FirstName] LIKE '%Mary%' |
<reponame>tiki/blockchain
/*
* Copyright (c) TIKI Inc.
* MIT license. See LICENSE file in root directory.
*/
-- -----------------------------------------------------------------------
-- BLOCKCHAIN
-- -----------------------------------------------------------------------
CREATE DATABASE blockchain; |
<filename>service/src/main/resources/db/migration/V1.53__Remove_Not_Null_Claim.sql
ALTER TABLE legacy_beacon_claim_event ALTER COLUMN account_holder_id DROP NOT NULL; |
<gh_stars>0
commit;
select * from Flights; |
CREATE DATABASE "project-collab-db";
CREATE USER "project-collab-admin" WITH ENCRYPTED PASSWORD '<PASSWORD>';
GRANT ALL PRIVILEGES ON DATABASE "project-collab-db" TO "project-collab-admin";
CREATE DATABASE "project-collab-test-db";
CREATE user root;
GRANT ALL PRIVILEGES ON DATABASE "project-collab-test-db" TO ... |
<filename>database/ujikom.sql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 03 Jun 2018 pada 05.13
-- Versi Server: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+... |
<reponame>mazaosoko/hackerrank
SELECT *
FROM city
WHERE countrycode='USA' AND population > 100000;
|
insert into usuario(id,email,senha,numero) values (123,burela,senha,456); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.