sql stringlengths 6 1.05M |
|---|
-- 2017-05-30T11:12:26.138
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('esr_importline','ALTER TABLE public.ESR_ImportLine ADD COLUMN ESRFullReferenceNumber VARCHAR(30)')
;
|
<filename>docker-postgres/seed.sql
CREATE TABLE comments (
id integer NOT NULL,
username character varying(200) NOT NULL,
email character varying(200),
content text NOT NULL,
date timestamp without time zone DEFAULT now() NOT NULL
);
CREATE SEQUENCE comments_id_seq
START WITH 1
INCREMENT BY... |
CREATE SCHEMA IF NOT EXISTS stats;
ALTER VIEW count_mimetypes SET SCHEMA stats;
CREATE VIEW items_per_collection AS
SELECT
collections.title,
COUNT(items_in_collections.collection_id) AS n_items,
collections.id
FROM
collections
LEFT JOIN items_in_collections ON collections.id = items_in_collections.collecti... |
CREATE PROCEDURE [dbo].[RET_ESPACIOS_DISPONIBLES_PR]
@P_TERMINAL_ID nvarchar(50)
AS
SELECT
(
(select ESPACIOS_PARQUEO FROM TBL_TERMINAL
WHERE TERMINAL_ID = @P_TERMINAL_ID
) -
(select count(REGISTRO_PARQUEO_ID) as PARQUEADOS FROM TBL_REGISTROPARQUEO
WHERE TERMINAL_ID = @P_TERMINAL_ID AND HORA_FIN IS NULL
)
... |
-- 2606 - Categories
-- URL - https://www.urionlinejudge.com.br/judge/en/problems/view/2606
SELECT products.id, products.name
FROM products
JOIN categories
ON products.id_categories = categories.id
WHERE categories.name LIKE 'super%';
|
<reponame>vladkorsik/vocab_covid<gh_stars>100-1000
CREATE TABLE FRANCE
(
PRODUCT_DESC VARCHAR (250),
FORM_DESC VARCHAR (250),
DOSAGE VARCHAR (100),
DOSAGE_ADD VARCHAR (100),
VOLUME VARCHAR (100),
PACKSIZE VARCHAR (100),
CLAATC VARCHAR (100),
... |
-- $Id: dumpcat.sql 7049 2010-09-14 16:43:13Z rdempsey $
select
`schema`, tablename, columnname colname, objectid, dictobjectid dict,
datatype,
scale, prec, columnlength collen, columnposition pos, compressiontype ct
from
syscolumn
order by
`schema`, tablename, pos;
|
<gh_stars>1-10
CREATE TABLE `таблица_со_странным_названием` (a UInt64, b UInt64) ENGINE = Log;
INSERT INTO `таблица_со_странным_названием` VALUES (1, 1);
SELECT * FROM `таблица_со_странным_названием`;
DROP TABLE `таблица_со_странным_названием`;
CREATE DATABASE testlazy ENGINE = Lazy(1);
CREATE TABLE testlazy.`таблица_... |
alter table codebase drop column if exists jira_issue_metadata_payload; |
<gh_stars>10-100
CREATE TABLE view_proposal_validators (
id BIGSERIAL,
consensus_node_address VARCHAR NOT NULL,
operator_address VARCHAR NOT NULL,
initial_delegator_address VARCHAR NOT NULL,
tendermint_pubkey VARCHAR NOT NULL,
tendermint_address VARCHAR NOT NULL,
moniker VARCHAR NOT NULL,
... |
INSERT INTO dbblog.category (id, name, type, `rank`, parent_id) VALUES (1, '漫谈', 0, 0, -1);
INSERT INTO dbblog.category (id, name, type, `rank`, parent_id) VALUES (2, '本站相关', 0, 1, 1);
INSERT INTO dbblog.category (id, name, type, `rank`, parent_id) VALUES (3, '关于', 0, 2, 2);
INSERT INTO dbblog.category (id, name, type,... |
ALTER TABLE articles ADD COLUMN comments_enabled BOOLEAN NOT NULL DEFAULT true;
|
<reponame>andrescanalla/Heroku-tienda
CREATE TABLE IF NOT EXISTS `calendar` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL,
`startdate` varchar(48) NOT NULL,
`enddate` varchar(48) NOT NULL,
`allDay` varchar(5) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `id` (`id`)
) ENGINE=InnoDB DEFA... |
<filename>docker/mysql/work/rdbms1_query.sql
select w.desc,m.name,w.price from work1 as w join master1 as m on w.w2id=m.id;
|
SELECT CONCAT(c.FirstName, ' ', c.LastName) AS [Client],
DATEDIFF(DAY, j.IssueDate, '04-24-2017') AS [Days going],
[Status]
FROM Clients AS c
JOIN Jobs AS j
ON j.ClientId = c.ClientId
WHERE j.[Status] != 'Finished'
ORDER BY [Days going] DESC,
c.ClientId
|
<filename>ivy.sql
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th10 05, 2018 lúc 06:12 AM
-- Phiên bản máy phục vụ: 10.1.34-MariaDB
-- Phiên bản PHP: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zon... |
/************************************************************************************************************
** DT228/DT282 Year 2 Databases I CA Part III Week 11 Questions **
** This will be marked out of 100 but will constitue 30% of the marks allocated to this part of... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: db_pada_girl
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.38-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER... |
-- --------------------------------------------------------
-- Host: localhost
-- Server version: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.5.0.5332
-- --------------------------------------------------------
/*... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: Nov 02, 2020 at 10:41 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
-- AlterTable
ALTER TABLE "Post" ADD COLUMN "privacy" "PrivacyOption";
|
<gh_stars>0
ALTER TABLE vedtak
ADD COLUMN månedsinntekt DECIMAL;
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 05, 2020 at 10:24 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>bluexlab/snowflake-soda
CREATE TABLE dummy2_1 (
name TEXT NOT NULL
);
CREATE TABLE dummy2_2 (
name TEXT NOT NULL
);
|
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 03, 2016 at 07:29 AM
-- Server version: 10.1.10-MariaDB
-- PHP Version: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<reponame>ins0m/DAVID
SELECT
subject,
p.annotation as "task",
"start", "cross", "end", duration,
direction, start_lane, end_lane
FROM "2009-onrd-pta".lanechanges l LEFT OUTER JOIN "2009-onrd-pta".protocol_subject p ON (
l.subject = p.subject_id AND
l.start BETWEEN p.start_timestamp AND p.end_timestamp A... |
<gh_stars>1-10
/*********************************************************************************************************************
**
** Procedure Name : h3giNewsRemove
** Author : <NAME>
** Date Created :
** Version : 1.0.0
**
************************************************... |
-- number of containers
SELECT count(*)
FROM containers
WHERE virtual_lesson_id != 0 AND content_type_id = 4;
-- number of files (including SHA1 duplicates)
SELECT count(*)
FROM virtual_lessons v
INNER JOIN containers c ON v.id = c.virtual_lesson_id AND c.content_type_id = 4
INNER JOIN containers_file_assets cfa O... |
<reponame>venkatramanm/humbhionline
CREATE INDEX ix_facilities_alternate_phone_number ON facilities(alternate_phone_number);
|
<filename>src/test/resources/e_fkey.test_70.sql
-- e_fkey.test
--
-- execsql {
-- CREATE TABLE artist(
-- artistid INTEGER PRIMARY KEY,
-- artistname TEXT
-- );
-- CREATE TABLE track(
-- trackid INTEGER,
-- trackname TEXT,
-- trackartist INTEGER REFERENCES artist(a... |
CREATE TABLE foo (bar text);
-- name: InsertFoo :exec
INSERT INTO foo (bar)
SELECT 1, $1, $2;
|
<reponame>aravi5/drill-test-framework<filename>framework/resources/Functional/limit0/aggregates/aggregation/count_distinct/plan/with_group_by_order_by_count_distinct_c_integer.sql
explain plan for select * from ( select c_integer, COUNT(DISTINCT c_integer) from alltypes_v group by c_integer order by c_integer, COUNT(DI... |
<filename>Integrator.Web/Integrator.Database/dbo/Tables/UserJobSkills.sql
CREATE TABLE [dbo].[UserJobSkills] (
[UserJobSkillID] INT IDENTITY (1, 1) NOT NULL,
[UserJobID] INT NOT NULL,
[CoreKbSkillID] INT NOT NULL,
[UserJobSkillLevel] INT NOT NULL,
CONSTRAINT [PK_UserJobSkills] PRIMAR... |
CREATE TABLE app_props
(
attribute VARCHAR(255),
value VARCHAR(255),
UNIQUE KEY (attribute)
);
INSERT INTO app_props (attribute, value) VALUES ('active_set', 'b'); |
-- 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 this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you may... |
CREATE TABLE phrases (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
type VARCHAR(100) NOT NULL,
phrase VARCHAR(150) NOT NULL
); |
<reponame>UAMS-DBMI/PosdaTools<gh_stars>1-10
-- Name: PosdaImagesByCollectionSitePlus
-- Schema: posda_files
-- Columns: ['patient_id', 'sop_instance_uid', 'study_instance_uid', 'series_instance_uid', 'digest']
-- Args: ['collection', 'site']
-- Tags: ['posda_files']
-- Description: List of all Files Images By Collecti... |
-- Revert ltree_del_item
BEGIN;
DROP FUNCTION goiardi.delete_search_item(col text, item text, m_organization_id int);
COMMIT;
|
-- start query 1 in stream 0 using template ../query_templates_qualified/query9.tpl
select case when (select count(*)
from store_sales
where ss_quantity between 1 and 20) > 74129
then (select avg(ss_ext_discount_amt)
from store_sales
... |
<gh_stars>100-1000
select sum(distinct l_orderkey), l_linenumber, count(distinct l_orderkey), count(*) from lineitem group by l_linenumber; |
<filename>src/main/resources/ddl/results/heracles_heel_results.sql
IF OBJECT_ID('@results_schema.HERACLES_HEEL_results', 'U') IS NULL
CREATE TABLE @results_schema.HERACLES_HEEL_results
(
cohort_definition_id int,
analysis_id INT,
HERACLES_HEEL_warning VARCHAR(255)
);
|
ALTER TABLE {$NAMESPACE}_repository.repository_pushlog
ADD devicePHID VARBINARY(64);
|
CREATE FOREIGN DATA WRAPPER postgres VALIDATOR dblink.postgres;
CREATE SERVER server_postgres6789012345678901234567890123456789012345678901234567890 FOREIGN DATA WRAPPER postgres OPTIONS (dbname 'contrib_regression');
CREATE USER MAPPING FOR CURRENT_USER SERVER server_postgres6789012345678901234567890123456789012345678... |
-- todo: Check the Sources list for Customer
INSERT INTO public.sources(id, name) VALUES
(1,'EMA - What''s New'),
(2,'EMA - PRAC minitues'),
(3,'EMBASE');
INSERT INTO public.operations(
id, name)
VALUES (1, 'Add Drug'),
(2, 'Edit Drug List'),
(3, 'Edit Search Setup'),
(4, 'Label Search Result'),
(5, 'XML Import... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 04, 2018 at 04:43 PM
-- Server version: 10.1.37-MariaDB-1
-- PHP Version: 7.2.9-1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
<gh_stars>0
USE TestesClinicos;
DROP ROLE IF EXISTS Medico;
DROP ROLE IF EXISTS Administrador;
DROP ROLE IF EXISTS Funcionario;
DROP ROLE IF EXISTS Atleta;
DROP ROLE IF EXISTS Clube;
CREATE ROLE Medico;
CREATE ROLE Administrador;
CREATE ROLE Funcionario;
CREATE ROLE Atleta;
CREATE ROLE Clube;
### Administrador
GRANT... |
USE SampleDB
GO
IF OBJECT_ID('CustomerProducts', 'U') IS NOT NULL
DROP TABLE CustomerProducts
GO
CREATE TABLE CustomerProducts(
CustomerFinancialProductId bigint IDENTITY(1,1) primary key NOT NULL,
CustomerId bigint NOT NULL,
FinancialProductId bigint NOT NULL,
AmountToCollect money NOT NULL,
Frequency smallint NOT N... |
<reponame>ezinelony/url-shortener<filename>config/migrations/schema.sql
CREATE TABLE IF NOT EXISTS shortened_urls_tbl (
id VARCHAR (250) PRIMARY KEY,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,
shortened_url VARCHAR(25) UNIQUE,
device_type_redirects_json json1... |
SELECT cd.atm_card_no,cd.fcc_acc_no,cu.first_name||' '||cu.last_name Customer_name
FROM swtm_card_details cd,sttm_cust_personal cu
WHERE substr(cd.atm_acc_no,9,6) = cu.customer_no
and trunc(cd.maker_dt_stamp) ='15/10/2015'
order by cd.atm_card_no
|
<reponame>itsmechezel/todo-oop
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 21, 2017 at 09:08 PM
-- Server version: 5.7.19-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = ... |
<reponame>pBouillon/Telecom_PPII
CREATE TABLE AIRWAY
(
id NUMBER NOT NULL,
codeshare CHAR(1),
CONSTRAINT PK_AIRWAY PRIMARY KEY (id)
) |
# Function AVG() to get average value
SELECT AVG(prod_price) AS avg_price
FROM products;
SELECT AVG(prod_price) AS avg_price
FROM products
WHERE vend_id = 1003;
# Function COUNT() to get number of column
SELECT COUNT(*) AS num_cust
FROM customers;
SELECT COUNT(cust_email) AS num_cust
FROM customers;
# Function MAX(... |
<reponame>viveknathani/sidekick
CREATE DATABASE SIDEKICK_USERS;
USE SIDEKICK_USERS;
CREATE TABLE users(
user_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
user_email VARCHAR(255),
user_password VARCHAR(255)
);
|
DROP TABLE IF EXISTS artist;
CREATE TABLE artist (
id int not null,
name text,
real_name text,
profile text,
data_quality text,
name_variations text[],
urls text[],
aliases text[],
members text[]
);
|
<gh_stars>100-1000
/*!
* DisplayMonkey source file
* http://displaymonkey.org
*
* Copyright (c) 2016 Fuel9 LLC and contributors
*
* Released under the MIT license:
* http://opensource.org/licenses/MIT
*/
use DisplayMonkey -- TODO: change if DisplayMonkey database name is different
GO
-- changes for v1.3.3
-- tracing ... |
SELECT url, last_update FROM feeds WHERE feed_id = ?
|
truncate federal_revenue_by_company;
\copy federal_revenue_by_company (calendar_year,corporate_name,revenue_agency_type,commodity,raw_revenue) FROM 'static/csv/federal_revenue_by_company_CY2013-CY2019.csv' DELIMITER ',' CSV HEADER;
\echo 'Formated negative values'
update federal_revenue_by_company set raw_revenue=REPL... |
<reponame>smith750/kc<gh_stars>0
INSERT INTO KRCR_PARM_T (NMSPC_CD, CMPNT_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, VAL, PARM_DESC_TXT, EVAL_OPRTR_CD, APPL_ID)
VALUES ('KC-IACUC', 'Document', 'IACUC_ALL_COMM_REVIEWERS_DEFAULT_ASSIGNED', SYS_GUID(), 1, 'CONFG', '3', 'Determines the default of an IACUC committee member.... |
<gh_stars>1-10
TRUNCATE TABLE CA_OBJ_TYPE_T DROP STORAGE
/
INSERT INTO CA_OBJ_TYPE_T (FIN_OBJ_TYP_CD,OBJ_ID,VER_NBR,FIN_OBJ_TYP_NM,FIN_OBJTYP_DBCR_CD,FIN_OBJ_TYP_ICR_CD,FUND_BALANCE_CD,FIN_REPORT_SORT_CD,ACCTG_CTGRY_CD,ROW_ACTV_IND)
VALUES ('AS','014F3DAF6EDBA448E043814FD28EA448',1.0,'ASSET','D','N','N','C1','AS','Y'... |
CREATE TABLE IF NOT EXISTS `user2`
(
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键',
`username` varchar(20) NOT NULL UNIQUE COMMENT '用户名',
`password` varchar(50) NOT NULL COMMENT '密码',
`age` int(2) NOT NULL COMMENT '年龄',
`gender` varchar(10) NOT NULL COMMENT '... |
SELECT cast(123.456 as DECIMAL(2, 2)); |
<reponame>icraftsoftware/Be.Stateless.BizTalk.Factory.Artifacts.Deployment
/*
Copyright © 2012 - 2021 <NAME>
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/licen... |
<gh_stars>100-1000
CALL _prom_catalog.execute_everywhere('create_schemas', $ee$ DO $$ BEGIN
CREATE SCHEMA IF NOT EXISTS _prom_catalog; -- this will be limited to metric and probably renamed in future
GRANT USAGE ON SCHEMA _prom_catalog TO prom_reader;
CREATE SCHEMA IF NOT EXISTS prom_api; -- public functio... |
<gh_stars>10-100
-- { echo }
select toDateTime64(toDateTime(1), 2);
select toDateTime64(toDate(1), 2);
select toDateTime64(toDateTime(1), 2, 'GMT');
select toDateTime64(toDate(1), 2, 'GMT');
|
select name, arn, inline_policies, attached_policy_arns, permissions_boundary_arn, permissions_boundary_type, mfa_enabled, tags_src
from aws.aws_iam_user
where name = '{{ resourceName }}'
|
<reponame>Roche/the-ambassador
DROP INDEX IF EXISTS project_name_gin_idx;
ALTER TABLE project DROP COLUMN IF EXISTS excerpt;
DROP EXTENSION IF EXISTS pg_trgm CASCADE;
ALTER TABLE project
ADD COLUMN textsearch tsvector
GENERATED ALWAYS AS (
setweight(to_tsvector('${language}', coalesce(name,... |
<reponame>pdv-ru/ClickHouse
set optimize_on_insert = 0;
drop table if exists tab_00577;
create table tab_00577 (date Date, version UInt64, val UInt64) engine = ReplacingMergeTree(version) partition by date order by date settings enable_vertical_merge_algorithm = 1, vertical_merge_algorithm_min_rows_to_activate = 1, ve... |
<gh_stars>1000+
-- Tags: zookeeper
DROP TABLE IF EXISTS table_for_alter;
SET replication_alter_partitions_sync = 2;
CREATE TABLE table_for_alter
(
`d` Date,
`a` String,
`b` UInt8,
`x` String,
`y` Int8,
`version` UInt64,
`sign` Int8 DEFAULT 1
)
ENGINE = ReplicatedVersionedCollapsingMergeTr... |
insert into authors(user_id,description) values (1,'Film critic');
insert into authors(user_id,description) values (2,'Musical critic');
insert into authors(user_id,description) values (5,'Sports journalist'); |
--[er]Test data type of timestamptz using error syntax
create table xx ( tt timestamptz ) ;
insert into xx values (timestamptz'23:59:59 PM 12/31/2022 ) ;
drop table xx;
|
<filename>sql/_23_apricot_qa/_02_performance/_02_function_based_index/cases/function_based_index_Create_006.sql
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
create table t1 (FirstName varchar(20),LastName varchar(20),Age int,gender char (1));
--TEST Create failed
CREATE INDEX my_idx ON t1 ( TRIM(F... |
/*
IF EXISTS (SELECT name FROM sysobjects WHERE (name = 'DataExplorerNodeEvaluation_PopulationMembership_Execute' AND type = 'P'))
DROP PROCEDURE dal.DataExplorerNodeEvaluation_PopulationMembership_Execute
GO
*/
CREATE PROCEDURE [dal].[DataExplorerNodeEvaluation_PopulationMembership_Execute]
/* STORED PR... |
<filename>SchoolDatabase/SchoolDatabase/dbo/Tables/CourseInstructor.sql
CREATE TABLE [dbo].[CourseInstructor] (
[CourseID] INT NOT NULL,
[PersonID] INT NOT NULL,
CONSTRAINT [PK_CourseInstructor] PRIMARY KEY CLUSTERED ([CourseID] ASC, [PersonID] ASC),
CONSTRAINT [FK_CourseInstructor_Course] FOREIGN KEY ... |
CREATE VIEW [dbo].[ViewEventLogs]
AS
SELECT [EventLogID],
[Object],
[Description],
[Status],
[Started],
[Finished]
FROM [dbo].[EventLog]; |
<reponame>firminoneto11/grocery-store-system
-- By default, in the sqlite database, the trigger is triggered for each row affected
CREATE TRIGGER update_product_date_on_sale_save
AFTER UPDATE ON PRODUCTS
WHEN old.amount_in_stock <> new.amount_in_stock
BEGIN
UPDATE PRODUCTS SET updated_at = datetime... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 02, 2020 at 02:46 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
DROP TABLE active_subscriptions;
|
DROP TABLE IF EXISTS book;
CREATE TABLE book(
id SERIAL PRIMARY KEY,
author VARCHAR(255),
title VARCHAR(255),
isbn VARCHAR(255),
image_url VARCHAR(255),
descriptions TEXT
);
INSERT INTO book (author,title, isbn, image_url,descriptions)
VALUES (
'<NAME>',
'Miracles of Christmas',
'ISBN_13 ... |
<reponame>UKGANG/IST-659
IF NOT EXISTS(SELECT TOP 1 1 FROM sys.tables WHERE name='timeslot' AND SCHEMA_NAME(schema_id)='dbo')
BEGIN
CREATE TABLE dbo.timeslot
(
timeslot_id BIGINT NOT NULL IDENTITY,
reservation_id BIGINT NOT NULL,
start_datetime DATETIME NOT NULL,
en... |
<filename>test.sql
select * from whitespace
|
COPY feature FROM '/ftyp/data/chado.feature.tsv';
CREATE TABLE ftyp_hidden.gene_location
(
feature_id integer NOT NULL,
has_location boolean DEFAULT FALSE
);
COPY ftyp_hidden.gene_location FROM '/ftyp/data/chado.gene_location.tsv';
CREATE TABLE ftyp_hidden.gene_summary
(
feature_id integer NOT NULL,
... |
<filename>oracle/sys/mutex.sql
/*[[
Show mutex sleep info. Usage: @@NAME [<sid>] [<inst_id>]
Refer to Doc ID 1298015.1/1298471.1/1310764.1
Mainly used to diagnostic below events:
=======================================
* cursor: mutex X
* cursor: mutex S
* cursor: pin ... |
<gh_stars>1-10
/*
Warnings:
- Made the column `userId` on table `Playlist` required. This step will fail if there are existing NULL values in that column.
- Added the required column `duration` to the `Song` table without a default value. This is not possible if the table is not empty.
- Added the required col... |
create table if not exists PRODUCT (
PRODUCT_ID NUMERIC(10, 0),
PRODUCT_NAME VARCHAR(100),
PRODUCT_KANA_NAME VARCHAR(100),
JAN_CODE CHAR(13),
PRODUCT_DESCRIPTION VARCHAR(100),
INS_DATETIME TIMESTAMP,
UPD_DATETIME TIMESTAMP,
VERSION_NO NUMERIC(10, 0),
constraint PK_PRODUCT primary key (PRODUCT_ID)
)
;
... |
-- 2018-11-08T18:05:25.967
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ SELECT public.db_alter_table('AD_Element_Link','ALTER TABLE public.AD_Element_Link ADD COLUMN AD_Tab_ID NUMERIC(10)')
;
-- 2018-11-08T18:05:25.999
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
AL... |
insert into agency (
id
, pvpallowed
, comments
, email
, fulladdress
, name
, onrequestallowed
, onelineperbooking
, shuttletransfersinowninvoice
, status
, telephone
, thridpartyallowed
, cancellationrules_id
, company_id
, currency_isocode
, financialagent_id
, group_id
, handlingfee_id
, market_id
, markup_id
) sel... |
<gh_stars>0
--
-- Copyright (C) 2005-2013 MaNGOS <http://getmangos.com/>
-- Copyright (C) 2009-2013 MaNGOSZero <https://github.com/mangoszero>
--
-- This program is free software; you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Fou... |
{% macro create_external_table(source_node) %}
{{ adapter.dispatch('create_external_table',
packages = dbt_external_tables._get_dbt_external_tables_namespaces())
(source_node) }}
{% endmacro %}
{% macro default__create_external_table(source_node) %}
{{ exceptions.raise_compiler_error("Externa... |
<gh_stars>0
INSERT INTO scxa_cell_group(id, experiment_accession, variable, value) VALUES (1, 'E-CURD-4', '14', '1');
INSERT INTO scxa_cell_group(id, experiment_accession, variable, value) VALUES (2, 'E-CURD-4', '14', '10');
INSERT INTO scxa_cell_group(id, experiment_accession, variable, value) VALUES (3, 'E-CURD-4', '... |
select int8_1 from nulls where int8_1 >= '49'
50
49
|
<gh_stars>1-10
/*
183. Customers Who Never Order
Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything.
Table: Customers.
+----+-------+
| Id | Name |
+----+-------+
| 1 | Joe |
| 2 | Henry |
| 3 | Sam |
| 4 | M... |
{% macro bool_or(expression) -%}
{{ return(adapter.dispatch('bool_or', 'dbt_utils') (expression)) }}
{% endmacro %}
{% macro default__bool_or(expression) -%}
bool_or({{ expression }})
{%- endmacro %}
{% macro snowflake__bool_or(expression) -%}
boolor_agg({{ expression }})
{%- endmacr... |
select int8_1 from nulls1 where int8_1 = 30
30
|
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE TABLE [dbo].[testtable](
[field1] [int] NULL,
[field2] [int] NULL,
[field3] [int] NOT NULL CONSTRAINT [cd] DEFAULT (7),
[field4] [float] NULL
) ON [PRIMARY]
GO |
-- This migration was merged into the master branch but could not be deployed to production
-- because production gh_login isn't actually unique. Later, this migration was commented out
-- so that it will be a no-op on production, and a new migration was added to correct the database
-- of anyone who ran this migration... |
create table request_log (
id serial primary key,
server_timestamp timestamp not null,
child_timestamp timestamp not null,
url text not null,
child_uuid text not null,
response_code integer not null,
category_group_id integer
);
create index request_log_server_timestamp_idx on request_log (server_timestamp);
cr... |
<filename>common/models/sql/localhost.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 02, 2016 at 09:25 AM
-- Server version: 5.5.49-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time... |
-- phpMyAdmin SQL Dump
-- version 4.5.5.1
-- http://www.phpmyadmin.net
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th12 09, 2016 lúc 04:07 SA
-- Phiên bản máy phục vụ: 5.7.11
-- Phiên bản PHP: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTE... |
<reponame>OJT-USeP/Pizza_Melet
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 27, 2016 at 10:23 AM
-- 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_CL... |
ALTER SEQUENCE office_climate.user_user_id_seq RESTART WITH 1;
ALTER SEQUENCE office_climate.place_place_id_seq RESTART WITH 1;
ALTER SEQUENCE office_climate.temperature_report_temperature_report_id_seq RESTART WITH 1;
delete from office_climate.temperature_report;
delete from office_climate.user;
delete from office_c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.