sql stringlengths 6 1.05M |
|---|
<reponame>OpenTouryoProject/OpenTouryo
INSERT INTO
TestTable(
_bit
)
values(
@bit
)
/*PARAM* bit, boolean, false *PARAM*/ |
<reponame>IsaacSchemm/GrantManager
USE [grantapp]
GO
/****** Object: Table [dbo].[changelog] Script Date: 12/07/2013 21:01:52 ******/
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[changelog]') AND type in (N'U'))
DROP TABLE [dbo].[changelog]
GO
USE [grantapp]
GO
/****** Object: Tabl... |
<reponame>johatfie/Books_I_Have_Read
insert into author (first_name, last_name) values ('Aaron', 'Allston');
insert into author (first_name, last_name) values ('Alastair', 'Reynolds');
insert into author (first_name, last_name) values ('<NAME>.', 'Steele');
insert into author (first_name, last_name) values ('Andre', 'N... |
-- Show how Hyrum Reservoir node instance has seven different implementations
-- where ObjectTypeCV and InstanceNameCV make all of them related.
SELECT DISTINCT ResourceTypeAcronym,MasterNetworkName, ScenarioName,ObjectTypeCV,ObjectType,InstanceNameCV,InstanceName
FROM ResourceTypes
Left JOIN "ObjectTypes"
ON "Obj... |
<filename>openGaussBase/testcase/KEYWORDS/recursive/Opengauss_Function_Keyword_Recursive_Case0031.sql
-- @testpoint:opengauss关键字recursive(非保留),作为字段数据类型(合理报错)
--前置条件
drop table if exists recursive_test cascade;
--关键字不带引号-合理报错
create table recursive_test(id int,name recursive);
--关键字带双引号-合理报错
create table recursive_t... |
/* Lists all constraints which are based on column CUST_UID.
This helps findout any referential constraints pointing to
this column. You can also give constraint_type = R. So it
lists only Referential constraints for that column.
In order to disable a primary constraint first you have to
disable a... |
CREATE TABLE [dbo].[specimen] (
[specimen_id] INT NOT NULL,
[person_id] INT NOT NULL,
[specimen_concept_id] INT NOT NULL,
[specimen_type_concept_id] INT NOT NULL,
[specimen_date] DATE NOT NUL... |
<filename>employeeSchema.sql
DROP DATABASE IF EXISTS employee_db;
CREATE DATABASE employee_db;
USE employee_db;
CREATE TABLE department (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(30) NULL,
PRIMARY KEY (id)
);
CREATE TABLE roles (
id INT AUTO_INCREMENT NOT NULL,
title VARCHAR(30) NULL,
salary DECIMAL(10,2) NULL,
d... |
<reponame>christophanneser/Bao-for-Presto<filename>queries/stackoverflow/q15/f741ef8be7e36b3df4e6b7b6d22b6db9148376fc.sql
SELECT b1.name,
count(*)
FROM site AS s,
so_user AS u1,
tag AS t1,
tag_question AS tq1,
question AS q1,
badge AS b1,
account AS acc
WHERE s.site_id = u1.site_id
... |
-- MySQL dump 10.13 Distrib 8.0.15, for osx10.14 (x86_64)
--
-- Host: localhost Database: koa_todo
-- ------------------------------------------------------
-- Server version 8.0.15
USE koa_todo;
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... |
SELECT title, rating FROM movies JOIN ratings ON movies.id = ratings.movie_id WHERE year = 2010 AND rating not NULL ORDER BY rating DESC, title; |
<reponame>rommelomr/invjanluis
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 05-08-2018 a las 16:10:08
-- Versión del servidor: 10.1.30-MariaDB
-- Versión de PHP: 7.2.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACT... |
<filename>sql/social_network (1).sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 08, 2019 at 09:07 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.2.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET tim... |
<filename>backend/src/main/resources/db/migration/V3__Create_blog_table.sql
CREATE TABLE blog (
id VARCHAR(50) PRIMARY KEY,
title VARCHAR(50) NOT NULL,
url VARCHAR(200) NOT NULL,
content VARCHAR(10000) NOT NULL,
indexedAt datetime NOT NULL
)
ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
<gh_stars>1-10
DROP PROCEDURE IF EXISTS enrollProcedure;
DELIMITER $$
CREATE PROCEDURE enrollProcedure (IN id int(11), IN c char(20), IN s char(2), IN y int(11), IN d date, OUT status_code tinyint(1))
BEGIN
DECLARE pre_c char(8);
DECLARE pre_req tinyint(1) DEFAULT 1;
DECLARE done tinyint(1) DEFAULT 0;
DECL... |
# https://leetcode.com/problems/movie-rating/
-- # of movies per user_id -> return highest one | order by user_id
-- for each movie - avg(rating) -> return highest one
-- union 1 and 2
WITH CTE AS (SELECT u.name as results
FROM Movie_Rating m LEFT JOIN Users u USING(user_id)
GROUP BY m.user... |
<reponame>michal0janczyk/udacity_data_architect
-- psql -f /home/workspace/scratchpad.sql
------------------------------------------------------------------------------------------------------------------------
-- clean up
drop table if exists salary cascade;
drop table if exists employee_history cascade;
drop table if... |
<reponame>hyee/dbcli
/*[[Show cell alerts]]*/
select BEGIN_TIME,SEQ_NO SEQ,SEVERITY,
(SELECT extractvalue(xmltype(c.confval), '/cli-output/context/@cell')
FROM v$cell_config c
WHERE c.CELLNAME = a.CELL_NAME
AND rownum < 2) cell,
... |
<reponame>mmckechney/SqlBuildManager<gh_stars>1-10
IF NOT EXISTS(SELECT 1 FROM INFORMATION_SCHEMA.Tables WHERE TABLE_NAME = 'AuditTransactionMaster' AND TABLE_SCHEMA = 'dbo' AND TABLE_TYPE = 'BASE TABLE')
BEGIN
CREATE TABLE dbo.AuditTransactionMaster(
TransId uniqueidentifier NOT NULL ,
TableName [varchar](128) NO... |
alter session set "_oracle_script"=true;
DROP USER oe cascade;
CREATE USER oe IDENTIFIED BY "Welcome1#" ;
GRANT DBA TO oe ;
|
DROP DATABASE IF EXISTS yam;
CREATE DATABASE IF NOT EXISTS yam;
USE yam;
DROP TABLE IF EXISTS words;
CREATE TABLE IF NOT EXISTS words(
id INT NOT NULL AUTO_INCREMENT,
word VARCHAR (50) NOT NULL ,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id),
UNIQUE KEY (word)
... |
<gh_stars>0
-- Databricks notebook source
-- MAGIC %md
-- MAGIC # COVID-19 Event Phenotypes: codelists
-- MAGIC
-- MAGIC **Description**
-- MAGIC
-- MAGIC This notebook runs a list of `SQL` queries to extract the different codelists used in the `CCU013: COVID-19 event phenotypes` work.
-- MAGIC
-- MAGIC The codeli... |
<filename>public/model_config/DMS_DB_Sql/cbdms/analysis_job_processor_group.sql
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE general_params ( "name" text, "value" text );
INSERT INTO "general_params" VALUES('list_report_data_table','V_Analysis_Job_Processor_Group_List_Report');
INSERT INTO "general_par... |
-- name: add-user!
INSERT INTO Users(Username, Email, Password) VALUES (:username, :email, :password) ;
-- name: update-user-email!
UPDATE Users SET Email = :email WHERE Username = :username ;
-- name: update-user-password!
UPDATE Users SET Password = :password WHERE Username = :username ;
-- name: get-user
SELECT U... |
-- シーケンス
-- MySQLはシーケンスなし
-- シノニム
-- MySQLにはシノニムなし
-- プロシージャ
CREATE PROCEDURE PROC_SELECT_TEST_TBL1(IN AA INT, OUT BB INT) BEGIN SELECT TEST_TBL1_ID INTO BB FROM TEST_TBL1 WHERE TEST_TBL1_ID = AA; END;
-- ファンクション
CREATE FUNCTION set_plus2() RETURNS INT DETERMINISTIC BEGIN RETURN (f + 2); END;
-- トリガ
CR... |
create index IX_A4F585D on staff_mgmt_Department (id_); |
CREATE FUNCTION func800() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE54);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE469);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE248);val:=(SELECT COUNT(*)INTO MYCOUN... |
-- Submissions
ALTER TABLE `Submissions`
MODIFY COLUMN `language` enum('c','c11-gcc','c11-clang','cpp','cpp11','cpp11-gcc','cpp11-clang','cpp17-gcc','cpp17-clang','java','py','py2','py3','rb','pl','cs','pas','kp','kj','cat','hs','lua') NOT NULL;
-- Users
ALTER TABLE `Users`
MODIFY COLUMN `preferred_language` enum(... |
<gh_stars>0
-- @testpoint: reset_unique_sql(text, text, bigint),入参为无效值(为空、特殊字符、多参、少参、null)时,合理报错
----step1:入参为空; expect:合理报错
select reset_unique_sql();
----step2:入参为特殊字符; expect:合理报
select reset_unique_sql('#','@','1');
----step3:多参; expect:合理报错
select reset_unique_sql('global','all',2,1);
----step4:少参; expect:合理报错... |
/*
Navicat MySQL Data Transfer
Source Server : MySQL_Local
Source Server Version : 50733
Source Host : 127.0.0.1:3306
Source Database : laravel
Target Server Type : MYSQL
Target Server Version : 50733
File Encoding : 65001
Date: 2022-03-23 12:03:47
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
<filename>image.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 12, 2017 at 07:06 AM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 5.6.24
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- <Migration ID="491adc2b-d447-43fd-9022-792cd9e6fca8" />
GO
/**************************************************************************
** CREATED BY: <NAME>
** CREATED DATE: 2017.08.03
** CREATION: Create installments table
**************************************************************************/
CREATE TAB... |
CREATE DATABASE IF NOT EXISTS campaign CHARACTER SET utf8mb4; |
SELECT TOP 5
MC.CountryName,
CR.MaxMountainHeight AS HighestPeakElevation,
MC.MaxRiverLength AS LongestRiverLength
FROM (
SELECT
cou.CountryName,
MAX(r.Length) AS MaxRiverLength
FROM Countries AS cou
LEFT JOIN CountriesRivers AS cr ON cr.CountryCode = cou.CountryCode
LEFT JOIN Rivers AS r ON r.Id = cr.Rive... |
<filename>db.sql<gh_stars>0
SELECT name FROM pg_available_extensions;
SELECT extname, extversion FROM pg_extension;
CREATE EXTENSION IF NOT EXISTS timescaledb;
CREATE TABLE test (
date TIMESTAMP,
b DOUBLE PRECISION,
c TEXT
);
SELECT create_hypertable('test', 'date');
INSERT INTO test (date, b, c)
... |
<filename>lucidstar.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 11, 2019 at 10:00 AM
-- Server version: 5.7.24
-- PHP Version: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone ... |
<filename>database/createTables.sql<gh_stars>0
-- ****************** SqlDBM: MySQL ******************;
-- ***************************************************;
-- ************************************** `users`
CREATE TABLE `users`
(
`username` varchar(45) NOT NULL ,
`userpassword` varchar(45) NOT NULL ,
PRIMAR... |
<reponame>aliciavega731/employee-tracker
use employees;
INSERT INTO department
(name)
VALUES
('Sales'),
('Engineering'),
('Finance'),
('Legal');
INSERT INTO role
(title, salary, department_id)
VALUES
('Sales Lead', 50000, 1),
('Salesperson', 40000, 1),
('Lead Engineer', 150000, 2),
('Software En... |
CREATE TABLE [dbo].[Loguser] (
[ID] UNIQUEIDENTIFIER CONSTRAINT [DF_Loguser_ID] DEFAULT (newid()) NOT NULL,
[User_ID] UNIQUEIDENTIFIER NOT NULL,
[Usertype] SMALLINT NULL,
[Log_Content] NVARCHAR (200) NULL,
[Committime] DATETIME CONSTRAINT [DF_Loguser_Committime] D... |
<filename>CCF/earth/bundles/pages/database/pages/init_1406558070.sql
# ---> up
CREATE TABLE IF NOT EXISTS `earth_pages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`type` tinyint(1) NOT NULL,
`status` tinyint(1) NOT NULL,
`hidden` tinyint(1) NOT NULL,
`sequence` int(11) NOT NULL,
`parent_id` int(11) NOT NULL,
... |
-- for create the database with encoding = utf8 ------------> create database bloodi character set utf8 COLLATE utf8_general_ci;
-- use as it's option for sql in command line --default-character-set=utf8
-- Dumping data for table `system_organization`
--
INSERT INTO `system_organization`
VALUES (1,1,null,nu... |
<reponame>takintsft/fusioninvoice
ALTER TABLE `fi_invoice_tax_rates` ADD `include_item_tax` INT( 1 ) NOT NULL DEFAULT '0'; |
<gh_stars>100-1000
CREATE TABLE [dbo].[Account] (
[Id] [int] NOT NULL
IDENTITY (1,1),
[CompanyId] [int] NULL,
[AccountClassId] [int] NOT NULL,
[ParentAccountId] [int] NULL,
[DrOrCrSide] [int] NOT NULL,
[AccountCode] [nvarchar](50) NOT NULL,
[AccountName] [nvarchar](200) NOT NULL,
[Descript... |
<filename>ratpack/src/main/resources/User.sql
DROP TABLE IF EXISTS USER;
CREATE TABLE USER (
ID BIGINT AUTO_INCREMENT PRIMARY KEY,
TITLE VARCHAR(255),
NAME VARCHAR(255),
COUNTRY VARCHAR(255)
);
INSERT INTO USER VALUES(1,'Mr','<NAME>', 'USA');
INSERT INTO USER VALUES(2,'Miss','<NAME>', 'FRANCE'); |
<reponame>wjriebel/SQL-Challenge<filename>SQL-Homework.sql
select * from titles
select * from salaries
select * from employees
delete from titles |
<reponame>dram/metasfresh<gh_stars>1000+
-- 2017-05-15T16:08:36.605
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_UI_Section (AD_Client_ID,AD_Org_ID,AD_Tab_ID,AD_UI_Section_ID,Created,CreatedBy,IsActive,Name,SeqNo,Updated,UpdatedBy) VALUES (0,0,53055,540188,TO_TIMESTAMP('2017-05-15 16... |
<filename>coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/RELEASE-SCRIPTS/KC-RELEASE-3_2-SCRIPT/mysql/tables/KC_TBL_BUDGET_PERSONNEL_DETAILS.sql
DELIMITER /
ALTER TABLE BUDGET_PERSONNEL_DETAILS ADD SUBMIT_COST_SHARING CHAR(1)
/
DELIMITER ;
|
<filename>db/scms-2018-6-22.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50717
Source Host : localhost:3306
Source Database : scms
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2018-06-22 12:11:11
*/
SE... |
<gh_stars>0
-- 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 [Behavior... |
<filename>api/sql/schema/380$transfer.alterTable.sql
---transfer.split/columns
IF NOT EXISTS( SELECT 1 FROM sys.columns WHERE Name = N'debitActorId' AND OBJECT_ID = OBJECT_ID(N'transfer.split') )
BEGIN
ALTER TABLE [transfer].[split] ADD debitActorId BIGINT
END
IF NOT EXISTS( SELECT 1 FROM sys.columns WHERE Name = ... |
USE dwes;
INSERT INTO tienda (cod, nombre, tlf) VALUES
(1, 'CENTRAL', '600100100'),
(2, 'SUCURSAL1', '600100200'),
(3, 'SUCURSAL2', NULL);
INSERT INTO familia (cod, nombre) VALUES
('CAMARA', 'Cámaras digitales'),
('CONSOL', 'Consolas'),
('EBOOK', 'Libros electrónicos'),
('IMPRES', 'Impresoras'),
('MEMFLA', 'M... |
<reponame>nathnael/cats
CREATE PROCEDURE [sp_del_FDP] (
@FDPID int
)
AS
DELETE FROM [dbo].[FDP]
WHERE
([FDPID] = @FDPID) |
<filename>packages/hasura/migrations/default/1615554274662_set_fk_public_authorization_codes_client_id/down.sql
alter table "public"."authorization_codes" drop constraint "authorization_codes_client_id_fkey",
add constraint "authorization_codes_client_id_foreign"
foreign key ("client_id")
... |
<reponame>zwChan/Clinical-Text-Mining<gh_stars>10-100
update ret.content_tag_ytex_T047_unique as t
inner join
(select r.CUI1,r.CUI2,GROUP_CONCAT(DISTINCT REL,' ',RELA SEPARATOR ',') as rel_all from umls.MRREL as r
inner join ret.content_tag_ytex_T047_unique as ret
on (r.CUI1=ret.cui COLLATE utf8_unicod... |
CREATE TABLE "DTREADOUTMAPPING" ( "IOV_VALUE_ID" NUMBER(10), "CELL_MAP_VERSION" VARCHAR2(4000) NOT NULL, "ROB_MAP_VERSION" VARCHAR2(4000) NOT NULL, CONSTRAINT "DTREADOUTMAPPING_PK" PRIMARY KEY ( "IOV_VALUE_ID" ) );
CREATE TABLE "DTREADOUTCONNECTION" ( "CONNECTION_ID" NUMBER(10) NOT NULL, "IOV_VALUE_ID" NUMBER(10) NOT ... |
<filename>dev/kyuubi-tpcds/src/main/resources/tpcds_2_4/q30.sql<gh_stars>100-1000
--
-- Licensed to the Apache Software Foundation (ASF) under one or more
-- contributor license agreements. See the NOTICE file distributed with
-- this work for additional information regarding copyright ownership.
-- The ASF licenses t... |
<filename>zlt-demo/txlcn-demo/txlcn-demo.sql
--
-- Current Database: `txlcn-demo`
--
CREATE DATABASE `txlcn-demo` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE `txlcn-demo`;
--
-- Table structure for table `t_demo`
--
DROP TABLE IF EXISTS `t_demo`;
CREATE TABLE `t_demo` (
`id` bigint(20) NOT NULL ... |
<gh_stars>1-10
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
ALTER TABLE ZSTG_GENE_DISEASEONTO_CGID
DROP PRIMARY KEY CASCADE
/
DROP TABLE ZSTG_GENE_DISEASEONTO_CGID CASCADE CONSTRAINTS PURGE
/
--
-- ZSTG_GENE_DISEAS... |
/* https://www.hackerrank.com/challenges/what-type-of-triangle/problem
Enter your query here.
Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error.
*/
SELECT CASE
WHEN ((A+B<=C)OR(B+C<=A)OR(A+C<=B)) THEN 'Not A Triangle'
WHEN ((A=B)AND(B=C)) THEN 'Eq... |
--
-- 1.0 Setup. Delete tables after every build iteration.
--
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS artist, artwork, artwork_artist, artwork_attribution, artist_role,
artwork_type, classification, city, country, department, region, repository;
SET FOREIGN_KEY_CHECKS=1;
--
-- 2.0 ENTITIES... |
--
-- Dumping data for table `categories`
--
LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
INSERT INTO `categories` VALUES (1,'Dublin','Millenium Collection','2016-11-27 14:33:57','2016-11-28 23:36:28'),(5,'Crepe','Millenium Collection','2016-11-28 23:37:19','2016-11-28 23:37:19'... |
drop table nation;
drop table region;
drop table part;
drop table supplier;
drop table partsupp;
drop table customer;
drop table orders;
drop table lineitem;
CREATE TABLE nation
(
N_NATIONKEY NUMBER NOT NULL,
N_NAME CHAR(25) NOT NULL,
N_REGIONKEY NUMBER NOT NULL,
N_COMMENT VARCHAR(152... |
<reponame>thluiz/sam-apinode
CREATE TABLE [dbo].[domain] (
[id] INT IDENTITY (1, 1) NOT NULL,
[name] VARCHAR (100) NULL,
[traditional] BIT DEFAULT ((0)) NOT NULL,
[abrev] VARCHAR (10) NOT NULL,
[order] INT DEFAULT ((10))... |
-- ***************************************************************************
-- File: 12_12.sql
--
-- Developed By TUSC
--
-- Disclaimer: Neither Osborne/McGraw-Hill, TUSC, nor the author warrant
-- that this source code is error-free. If any errors are
-- found in this source code, please rep... |
-- --------------------------------------------------------
-- 主机: 192.168.1.135
-- 服务器版本: 10.3.25-MariaDB-0ubuntu1 - Ubuntu 20.10
-- 服务器操作系统: debian-linux-gnu
-- HeidiSQL 版本: 11.1.0.6116
-- ------------------------------------------... |
--
-- Dumping data for table `provinces`
--
INSERT INTO `provinces` (`id`, `name`, `created_at`, `updated_at`) VALUES
(1, "ACEH", "2019-02-24 17:19:10", "2019-02-24 17:19:10"),
(2, "<NAME>", "2019-02-24 17:19:11", "2019-02-24 17:19:11"),
(3, "<NAME>", "2019-02-24 17:19:11", "2019-02-24 17:19:11"),
(4, "RIAU", "2019-02... |
-- pageropt.test
--
-- execsql {
-- PRAGMA auto_vacuum = OFF;
-- PRAGMA page_size = 1024;
-- }
PRAGMA auto_vacuum = OFF;
PRAGMA page_size = 1024; |
create view _airbyte_test_normalization.`unnest_alias_children_ab2__dbt_tmp` as (
-- SQL model to cast each column to its adequate SQL type converted from the JSON schema type
select
_airbyte_unnest_alias_hashid,
cast(ab_id as
signed
) as ab_id,
cast(`owner` as json) as `owner`,
_airbyte_em... |
<gh_stars>100-1000
-- 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
--
SELECT (10, 20, 30)[1];
>> 10
SELECT (10, 20, 30)[3];
>> 30
SELECT (10, 20, 30)[0];
>> null
SELECT (10, 20, 30)[4];
>> null
SELECT... |
CREATE TABLE b_a_c002_approval_for_all_event (
pk_id bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键id',
block_height bigint(20) NOT NULL COMMENT '交易所在块高',
_contract_address varchar(255) NOT NULL,
_owner varchar(255) NOT NULL,
_operator varchar(255) NOT NULL,
_approved varchar(8) NOT NULL,
KEY `_owner` (`_own... |
DROP TABLE IF EXISTS `users`;
CREATE TABLE users(
id SERIAL,
email varchar(20) NOT NULL,
password varchar(20) NOT NULL,
enabled boolean NOT NULL DEFAULT FALSE,
primary key(email)
);
INSERT INTO users(email,password,enab... |
--inherit from a table including columns with default value of UNIX_TIMESTAMP
create table c41(id int primary key auto_increment, col1 timestamp not null default UNIX_TIMESTAMP());
--TEST: inherit from a table including a column with default value of UNIX_TIMESTAMP
create table sub1_c41 under c41;
--TEST: check th... |
<reponame>geophile/sql-layer
SELECT * FROM customers INNER JOIN orders ON customers.cid = orders.cid
|
<filename>Database/Schema Objects/Schemas/dbo/Programmability/Functions/udf_GetUnassociatedTotalsTable.function.sql<gh_stars>0
-- =============================================
-- Author: <NAME>
-- Create date: January 12, 2012
-- Description: Given an admin unit, return the appropriate table values
-- Usage:
-- sele... |
INSERT INTO CATEGORY ( CATEGORY) VALUES ('Food');
INSERT INTO CATEGORY ( CATEGORY) VALUES ('Toys');
INSERT INTO CATEGORY ( CATEGORY) VALUES ('Tools');
INSERT INTO CATEGORY ( CATEGORY) VALUES ('Alcohol');
INSERT INTO CATEGORY ( CATEGORY) VALUES ('Drugs');
|
-- phpMyAdmin SQL Dump
-- version 4.6.6deb4+deb9u2
-- https://www.phpmyadmin.net/
--
-- Client : localhost:3306
-- Généré le : Lun 11 Janvier 2021 à 19:19
-- Version du serveur : 10.1.47-MariaDB-0+deb9u1
-- Version de PHP : 7.0.33-0+deb9u10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!401... |
/*
LeetCode 1158. Market Analysis I
https://leetcode.com/problems/market-analysis-i/
*/
SELECT
user_id AS buyer_id,
join_date,
COALESCE(orders_in_2019, 0) AS 'orders_in_2019'
FROM Users
LEFT JOIN (
SELECT buyer_id, COUNT(*) 'orders_in_2019'
FROM Orders
WHERE YEAR(order_date) = ... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 04 Jul 2020 pada 07.45
-- Versi server: 10.4.6-MariaDB
-- Versi PHP: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<gh_stars>1-10
SELECT *
FROM city; |
CREATE TABLE AirCarrier (
idAirCarrier integer NOT NULL PRIMARY KEY ,
name text NOT NULL ,
workers integer NOT NULL
);
INSERT INTO AirCarrier VALUES (1, 'Aeroflot', 250), (2, 'EmiratesAer', 500), (3, 'JangoAer',200);
CREATE TABLE Plane (
idPlane integer NOT NULL PRIMARY KEY,
Stamp VARCHAR(10) NOT N... |
<gh_stars>10-100
ALTER TABLE `site`
ADD `techPoC` VARCHAR(55) NOT NULL AFTER `phoneNumberPoC`,
ADD `phoneTechPoC` VARCHAR(10) NOT NULL AFTER `techPoC`,
ADD `employesNumber` INT(11) NOT NULL AFTER `phoneTechPoC`,
ADD `organization` VARCHAR(4) NOT NULL AFTER `employesNumber`;
INSERT INTO `site` ... |
<reponame>dram/metasfresh
-- 2020-03-31T09:42:25.029Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Element_Trl SET Name='External issue details', PrintName='External issue details',Updated=TO_TIMESTAMP('2020-03-31 12:42:25','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Element_ID=577612... |
<filename>SQL/Page 5.8 of chapter-5.sql<gh_stars>0
use mansi
select CountryId, CountryLocation.ToString() as Location from CountryLocation |
<reponame>DenisPonizovkin/job4j
-- Create scheme. 1. UML системы [#62660]
\i create_database.sql
\i create_tables.sql
\i fill_db.sql
|
<gh_stars>0
/* create table: user */
CREATE TABLE [user](
[id] [uniqueidentifier] NOT NULL,
[name] [nvarchar](255) NOT NULL,
[birthday] [datetime] NOT NULL,
[gender] [bit] NOT NULL,
[picture] varbinary(4000) NOT NULL,
CONSTRAINT [PK_user] PRIMARY KEY([id]))
/* create table: user_info */
CREATE TABLE [user_info... |
<reponame>IvanPavlovets/ipavlovets
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 references company(id),
CONSTRAINT person_pkey PRIMARY KEY (id)
);
inser... |
<reponame>pribtech/nodete<filename>db2te/tutorials/tutorials/pureXML/SampleXMLQueries/SQL/09_Query.sql<gh_stars>0
SELECT xmlquery('$i/customerinfo/name' passing c.info AS "i")
FROM ?SCHEMA?.xmlcustomer c
WHERE xmlexists('$i/customerinfo[phone = "905-555-7258" and phone/@type = "work"]' passing c.info AS "i") ;
|
-- MySQL Workbench Forward Engineering
-- -----------------------------------------------------
-- Schema supportiety
-- -----------------------------------------------------
-- DROP SCHEMA IF EXISTS `supportiety` ; <- this does not work with flyway because of the table locks and the schema-table
-- ---------------... |
<gh_stars>10-100
ALTER TABLE "postgres-default-string$dev"."User" ALTER COLUMN "name" SET DEFAULT 'gnarley';
ALTER TABLE "postgres-default-string$dev"."User" ALTER COLUMN "nickName" SET DEFAULT 'mcblabber'; |
SELECT count() FROM (SELECT dummy, sum(dummy) GROUP BY dummy WITH TOTALS);
SELECT * FROM (SELECT dummy, sum(dummy) GROUP BY dummy WITH TOTALS);
|
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 3.3.8
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- G�n�r� le : Sam 25 Juin 2011 � 10:09
-- Version du serveur: 6.0.0
-- Version de PHP: 5.2.9-2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... |
# --- !Ups
CREATE TABLE PUSH_REGISTRATION (
"USERCODE" NVARCHAR2(100) NOT NULL,
"PLATFORM" NCHAR(1) NOT NULL,
"TOKEN" NVARCHAR2(4000) NOT NULL,
"CREATED_AT" TIMESTAMP NOT NULL
);
CREATE INDEX PUSH_REG_USERCODE_INDEX ON PUSH_REGISTRATION (USERCODE);
# --- !Downs
DROP INDEX PUSH_REG_USERCODE_INDEX;
DROP TABLE ... |
<filename>fullDB/achievement_reward.sql
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'... |
USE `classicmodels`;
CREATE TABLE sales SELECT productLine,
YEAR(orderDate) orderYear,
SUM(quantityOrdered * priceEach) orderValue FROM
orderdetails
INNER JOIN
orders USING (ordernumber)
INNER JOIN
products USING (productcode)
GROUP BY productLine , YEAR(orderdate);
-- --------------... |
<filename>logical_operation/not_equal.sql<gh_stars>0
# != means not equal, so if we combine it with WHERE it will resulting with data that not equal to something
SELECT title FROM books WHERE released_year = 2017; # all data that have a released_year of 2007
SELECT title FROM books WHERE released_year != 2017; # all... |
<filename>SearchString/SQL search a string in all database.sql
BEGIN
-- SCRIPT VARIABLES DECLARATION
DECLARE @rowcountmax BIGINT
DECLARE @rowcountmin INT
DECLARE @string2search VARCHAR(20)
DECLARE @tableid VARCHAR(500)
DECLARE @tablename VARCHAR(500)
DECLARE @columname VARCHAR(500)
DECLARE @schemaname VARCHAR(... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 23, 2019 at 09:21 AM
-- Server version: 5.6.21
-- PHP Version: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS stretch_templates (
id SERIAL PRIMARY KEY,
title TEXT,
author VARCHAR(256),
date_created TEXT,
template_body TEXT,
label_1 TEXT,
label_2 TEXT,
label_3 TEXT,
label_4 TEXT,
label_5 TEXT,
label_6 TEXT,
label_7 TEXT,
label_8 TEXT,
label_9 TEXT,
label_1... |
CREATE VIEW my_view (mycol, my_other_col)
AS
select * from mytable
|
<reponame>BashPrime/metroid-prime-randomizer-website
INSERT INTO games (id, name, abbreviation) VALUES (1, 'Metroid Prime', 'prime');
INSERT INTO games (id, name, abbreviation) VALUES (2, 'Metroid Prime 2: Echoes', 'echoes');
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.