sql stringlengths 6 1.05M |
|---|
\echo Creating test schema: pgtokdb_test
SET client_min_messages = 'ERROR';
\pset pager
-- Create all test artifacts inside a temporary schema. It is easy to clean up
-- when we are done by doing a "cascade" drop
drop schema if exists pgtokdb_test cascade;
create schema pgtokdb_test;
set search_path to pgtokdb_test;... |
<filename>integration_tests/dbt_utils/macros/limit_zero.sql<gh_stars>1-10
{% macro presto__limit_zero() %}
{{ return('limit 0') }}
{% endmacro %}
|
<filename>api/db/migrations/carpool/20191119091826_create_carpool_identity_table.up.sql<gh_stars>10-100
-- Create the new table
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE IF NOT EXISTS carpool.identities
(
_id serial primary key,
uuid uuid NOT NULL DEFAULT uuid_generate_v4(),
created_at timestamp ... |
-- filter out bogus records
-- \? filters variants that have question marks in them
-- [ACGT][ACGT]> filters multinucleotide substitutions (which don't parse)
-- \d> filters records that don't have a reference nucleotide (insertion?)
create or replace view reece.snp_hgvs_filtered as
select * from reece.snp_hgvs
where ... |
SELECT S.Id
INTO @cloud_id
FROM SourceType S
WHERE S.Type = 'Cloud' LIMIT 1;
SELECT S.Id
INTO @ticket_id
FROM SourceType S
WHERE S.Type = 'TicketEngine' LIMIT 1;
INSERT INTO Job(Struct, SourceTypeIn, SourceTypeOut, Priority, CreatedBy) VALUES ('CloudDecommissionJob', @cloud_id, @ticket_id, 4, 'Ryan'); |
-- :name username_for_id
-- :result :affected
delete from users where user_id = :user_id
|
SELECT eprintid FROM caltechauthors
WHERE (CONCAT(lastmod_year, "-",
LPAD(IFNULL(lastmod_month, 1), 2, "0"), "-",
LPAD(IFNULL(lastmod_day, 1), 2,"0"), " ",
LPAD(IFNULL(lastmod_hour, 0), 2, "0"), ":",
LPAD(IFNULL(lastmod_minute, 0), 2, "0"), ":",
LPAD(IFNULL(lastmod_second, 0), 2, "0")) >= ?) AND
(CONCAT(lastmod_year, "... |
<filename>uts.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 10 Nov 2019 pada 22.47
-- Versi Server: 10.1.19-MariaDB
-- PHP Version: 7.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CH... |
<filename>db/seeds.sql
INSERT INTO department (name)
VALUES ('Intern'), ('Engineering'), ('Management'), ('Legal'),('Human Resources');
INSERT INTO role (title, salary, department_id)
VALUES ('Intern', 30000, 1),
('Lead Engineer', 150000, 2),
('Software Engineer', 120000, 2),
('Executive VP', 1... |
CREATE PROCEDURE [dbo].[usp_sqlwatch_internal_insert_header]
@snapshot_time_new datetime2(0) OUTPUT ,
@snapshot_type_id tinyint
as
begin
set xact_abort on;
set nocount on;
declare @snapshot_time datetime2(0),
@sql_instance varchar(32),
@lockresult int
/* We have to make sure we only access the header t... |
<reponame>BlackVVell/Elephant
CREATE TABLE test (id INTECER);
INSERT INTO test VALUES (1); |
<reponame>adrhee007/laravel-twilio-backend
/*
Navicat Premium Data Transfer
Source Server : MySQL
Source Server Type : MySQL
Source Server Version : 100406
Source Host : localhost:3306
Source Schema : sms_distributor
Target Server Type : MySQL
Target Server Version : 100406
Fi... |
-- Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved.
--
-- 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 Foundation; version 2 of the License.
--
-- This program is distributed ... |
create table products ("_job" integer, "name" varchar(32), "amount" integer, "price" decimal(22,4))
|
<filename>includes/database/upgrade/(db_name)/v.2.0.0_add_database.sql
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Feb 13, 2018 at 05:36 AM
-- Server version: 5.7.21-0ubuntu0.17.10.1
-- PHP Version: 7.1.14-1+ubuntu17.10.1+deb.sury.org+1
SET SQL_M... |
<filename>db_provision.sql
CREATE TABLE latest_time (
latest_time bigint PRIMARY KEY
);
CREATE UNIQUE INDEX lt_pkey ON latest_time(latest_time int8_ops);
-----------------------------------------------------------------------------------------------------------
CREATE TABLE start_up_message_received (
was_re... |
<filename>net.interlated.journaltracking/test.sql
SELECT
contact_a.id as contact_id,
contact_a.sort_name as sort_name,
contact_a.contact_type as contact_type,
activity.id as activity_id,
activity... |
-- this is sqlite DB view
drop view if exists ShipDto;
create view ShipDto
as
select
Id
, Name
from Ship |
<reponame>morten-egan/random_ninja
create or replace package body consumer_data_electronics
as
begin
dbms_application_info.set_client_info('consumer_data_electronics');
dbms_session.set_identifier('consumer_data_electronics');
-- init arrays
consumer_data.items('Electronics') := consumer_data.consum... |
SELECT * FROM backuppractice.country;
SELECT * FROM backuppractice.country
WHERE `Country Code`="AUS"
DELETE FROM backuppractice.country
WHERE `Country Code`="AUS";
SELECT * FROM backuppractice.country
WHERE `Country Code`="AUS";
|
<reponame>drsm/sqt
select
case when state != 0 then 'dummy' else 'database' end as node_type,
[name] "name",
[name] + isnull(' <i>(' +
case when state != 0 then state_desc COLLATE SQL_Latin1_General_CP1_CI_AS
when is_read_only = 1 then 'read only'
end
+ ')</i>', '') ui_name,
... |
<gh_stars>10-100
CREATE TABLE [dbo].[AspNetUserLogins]
(
[LoginProvider] NVARCHAR(450) NOT NULL,
[ProviderKey] NVARCHAR(450) NOT NULL,
[ProviderDisplayName] NVARCHAR(MAX) NULL,
[UserId] NVARCHAR(450) NOT NULL
)
GO
ALTER TABLE [dbo].[AspNetUserLogins]
ADD CONSTRAINT [PK_AspNetUserLogins] PRIMARY KEY ([LoginProvid... |
DROP FUNCTION IF EXISTS grest.block_txs (_block_hash text);
CREATE FUNCTION grest.block_txs (_block_hash text)
RETURNS TABLE (
TX_HASH text)
LANGUAGE PLPGSQL
AS $$
DECLARE
_BLOCK_ID integer DEFAULT NULL;
BEGIN
SELECT
B.ID
FROM
BLOCK B
WHERE
DECODE(_block_hash... |
<gh_stars>0
CREATE TABLE rooms (
id TEXT NOT NULL PRIMARY KEY,
max_occupancy INTEGER NOT NULL,
timezone TEXT
);
CREATE TABLE users (
id TEXT NOT NULL PRIMARY KEY,
display_name TEXT NOT NULL,
contact_info TEXT NOT NULL,
password_hash TEXT NOT NULL
);
CREATE TABLE occupancies (
id INTEGE... |
<filename>database/leaves_module.sql
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `leaves_module`
--
-- --------------------------------------------------------
--
-- Table structure for table `leaves`
--
CREATE TABLE `leaves` (
`id` int(10) UNSIGNED NOT NULL,
`user_id` int(... |
<filename>Config/Schema/sql/tags.sql
CREATE TABLE aib_tags (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
label VARCHAR(20) NOT NULL UNIQUE,
created DATETIME,
modified DATETIME
);
CREATE TABLE aib_tagged_items (
id INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
tag_id INT(11) NOT NULL,
ta... |
<reponame>AaronMorelli/ChiRho<gh_stars>0
/*
Copyright 2016 <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/licenses/LICENSE-2.0
Unless required b... |
<filename>springboot/src/main/script/user.sql
DROP TABLE IF EXISTS test.user;
create table test.user(
id bigint primary key auto_increment,
name varchar(30) COMMENT '姓名',
age int(3) COMMENT '年龄',
create_time TIMESTAMP default CURRENT_TIMESTAMP COMMENT '创建时间',
update_time TIMESTAMP default current_timestamp o... |
alter table sin add column if not exists last_income numeric not null default(0);
alter table sin add column if not exists last_outcome numeric not null default(0); |
ALTER TABLE @.statement_annotation_map
DROP FOREIGN KEY a_sa_fk
##
ALTER TABLE @.document_annotation_def_map
DROP FOREIGN KEY ad_dad_fk
##
ALTER TABLE @.annotation
DROP FOREIGN KEY ad_a_fk
##
ALTER TABLE @.annotation_definition
DROP FOREIGN KEY ad_adt_fk
##
ALTER TABLE @.statement
DROP FOREIGN KEY d... |
<gh_stars>1-10
-- Data Cleaning
-- Used dataset: https://www.kaggle.com/tmthyjames/nashville-housing-data
SELECT * FROM nashville_housing_data;
-- Populate Property Address data
SELECT
*
FROM
nashville_housing_data
-- WHERE propertyaddress IS NULL
ORDER BY
parcelid;
-- Self join
/*
join the same ex... |
<gh_stars>0
CREATE EXTENSION pg_stat_monitor;
SELECT pg_stat_monitor_reset();
CREATE TABLE t1 (a INTEGER);
CREATE TABLE t2 (b INTEGER);
INSERT INTO t1 VALUES(1);
SELECT a FROM t1;
UPDATE t1 SET a = 2;
DELETE FROM t1;
SELECT b FROM t2 FOR UPDATE;
TRUNCATE t1;
DROP TABLE t1;
DROP TABLE t2;
SELECT query, cmd_type, cmd_t... |
<gh_stars>0
CREATE OR REPLACE VIEW media_vw AS
SELECT m.id
,m.name
,lab_id
,lab.name as lab
,type_id
,ct.name as type
FROM media m
JOIN cv_term ct ON (m.type_id = ct.id)
JOIN cv_term lab ON (m.lab_id = lab.id)
;
|
<reponame>jguittard/phonebooklib<filename>data/sample/phonebooklib-tables.sql
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE "contact" (
id INTEGER NOT NULL PRIMARY KEY,
title VARCHAR(4) NULL,
firstname VARCHAR(255) NOT NULL,
lastname VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NULL,
... |
<reponame>Vinodhakumara/joindin-api<filename>db/patch56.sql
-- Enforce uniqueness on usernames
ALTER TABLE user ADD UNIQUE INDEX idx_username (username);
-- Increase patch count
INSERT INTO patch_history SET patch_number = 56;
|
create table t2 (c2 varchar);
|
<filename>hasura/migrations/1620859526467_alter_table_video_ImmediateSwitch_add_column_conferenceId/down.sql
alter table
"video"."ImmediateSwitch" drop column if exists "conferenceId"; |
<gh_stars>0
ALTER TABLE MEMBER ADD disability_funding nvarchar2(2); |
<gh_stars>0
DROP TABLE IF EXISTS `territory_spawnlist`;
CREATE TABLE `territory_spawnlist` (
`castleId` tinyint(1) unsigned NOT NULL DEFAULT '0',
`id` smallint(3) unsigned NOT NULL AUTO_INCREMENT,
`npcId` smallint(5) unsigned NOT NULL DEFAULT '0',
`x` mediumint(6) NOT NULL DEFAULT '0',
`y` mediumint(6) NOT NU... |
/*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50725
Source Host : localhost:3306
Source Schema : springbootv2pear
Target Server Type : MySQL
Target Server Version : 50725
File Encoding : 65001
Date:... |
DECLARE @capabilities AS TABLE
(
Id int NOT NULL PRIMARY KEY,
[Name] nvarchar(255) NOT NULL,
[Description] nvarchar(500) NOT NULL,
SourceUrl nvarchar(1000) NOT NULL,
IsFoundation bit DEFAULT 0 NOT NULL,
[Version] nvarchar(10) DEFAULT '1.0.1' NULL,
EffectiveDate date DEFAULT '2019-12-31' NOT... |
<filename>storage/database/countries/hk.sql
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: Quickadclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @O... |
-- SQLite
SELECT DISTINCT
n.name,
count(w.id)
from names n
inner join words w on w.listname_id = n.id
GROUP BY n.name; |
<gh_stars>0
INSERT INTO departments
(department_name)
VALUES
("Engineering"),
("Sales"),
("Finance"),
("Legal"),
("Marketing");
INSERT INTO roles
(title, salary, department_id)
VALUES
("Engineer", 90000, 1),
("Sales", 30000, 2),
("Finance", 80000, 3),
("Legal", 70000, 4),
... |
<reponame>pntone/apex-flowsforapex
/*
Contains all calls which do not differ between scratch or migrate.
Pretty much everything which has "create or replace" option
*/
PROMPT >> Installing Engine Objects
PROMPT >> =================
PROMPT >> Installing Package Specifications
@plsql/flow_types_pkg.pks
@pls... |
SELECT FirstName + ' ' + MiddleName + ' ' + LastName AS FullName FROM Employees
WHERE Salary IN (25000, 14000, 12500, 23600) |
-- Create a new table before replacing in order to avoid a long-held lock on
-- the table being replaced. The site should remain responsive while these
-- queries are run.
BEGIN;
CREATE TABLE man_index_new AS SELECT DISTINCT name, section FROM man;
CREATE INDEX ON man_index_new USING btree(lower(name) text_pattern_ops)... |
<filename>install/tables.sql
-- MySQL dump 10.13 Distrib 5.5.24, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: mrcore4
-- ------------------------------------------------------
-- Server version 5.5.24-8
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... |
DROP VIEW vx;
CREATE VIEW vx (x) AS
select 2;
|
<filename>vendor/update/063.sql
ALTER TABLE `bgpPeers` CHANGE `bgpPeerIdentifier` `bgpPeerIdentifier` VARCHAR(39) NOT NULL, CHANGE `bgpLocalAddr` `bgpPeerLocalAddr` VARCHAR(39) NOT NULL, CHANGE `bgpPeerRemoteAddr` `bgpPeerRemoteAddr` VARCHAR(39) NOT NULL;
UPDATE `bgpPeers` SET `bgpPeerRemoteAddr` = `bgpPeerIdentifier`;... |
<filename>data/open-source/extracted_sql/opendatatrentino_opendata-harvester.sql
SELECT count(*) FROM "{0}";
SELECT name FROM "sqlite_master" where type=\'table\';
SELECT * FROM "{0}" WHERE id=?;
CREATE TABLE IF NOT EXISTS "{0}" ( id VARCHAR(256) PRIMARY KEY, value TEXT )
CREATE TABLE IF NOT EXISTS "{0}" ( id VARCHAR(2... |
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) NULL, `description` varchar(255) DEFAULT (NULL) NULL, `homepage` varchar(255) DEFAULT (NULL) NULL, `added_manually... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 14, 2019 at 06:36 PM
-- Server version: 5.7.25-0ubuntu0.16.04.2
-- PHP Version: 7.0.33-0ubuntu0.16.04.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>karashiiro/Universalis
USE `dalamud`;
CREATE TABLE `users_sessions` (
`id` char(36) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '(DC2Type:guid)',
`user_id` char(36) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '(DC2Type:guid)',
`session` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`last_activ... |
<gh_stars>1-10
INSERT INTO tweb_apbd(`rangkuman`,`berkas_id`,`lembaga_id`, `lembaga_kode`,`pemda_kode`, `wilayah_kode`,`tahun`, `rekening_kode`,`rekening`, `uraian`, `nominal`,`nominal_sebelum`, `nominal_sesudah`, `nominal_perubahan`, `nominal_persen`, `keterangan`, `created_by`, `updated_by`) VALUES
('0','235','119',... |
/*
This view must be empty after calling [workflow].[usp_workflow], +
because all entries from workflow.Workflow_ProcedureDependency_T_NotInSortorder must be transferred to workflow.WorkflowStep_Sortorder.
If there are still entries here, then
* the content of [workflow].[Workflow_ProcedureDependency_T_bidirection... |
<reponame>inoyyth/dealer-honda
/*
SQLyog Ultimate v9.50
MySQL - 5.6.26 : Database - dealer_db
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET... |
-- set serveroutput on size 1000000 format wrapped
-- requires the utPLSQL system
--
-- modify this line to suit your needs
--
-- exec utplsql.setdir('/web/lars-dev2/packages/acs-kernel/sql');
-- exec utplsql.autocompile (false);
-- create or replace package ut#workflow_case
-- as
--
-- procedure setup;
--
-... |
<filename>sample-queries-tpcds/not_tested/query95.sql
SELECT count(distinct ws1.ws_order_number) as order_count,
sum(ws1.ws_ext_ship_cost) as total_shipping_cost,
sum(ws1.ws_net_profit) as total_net_profit
FROM web_sales ws1
JOIN customer_address ca ON (ws1.ws_ship_addr_sk = ca.ca_address_... |
-- Revert ggircs-portal:trigger_functions/protect_read_only_products from pg
begin;
drop function ggircs_portal_private.protect_read_only_products;
commit;
|
CREATE PROCEDURE [sp_del_AdminUnitType] (
@AdminUnitTypeID int
)
AS
DELETE FROM [dbo].[AdminUnitType]
WHERE
([AdminUnitTypeID] = @AdminUnitTypeID) |
<filename>jasperserver/scripts/upgrade/upgrade-postgresql-3.0.0-3.1.0-NO-CHG.sql
--
-- This file is intentionally empty.
--
-- There is no database schema difference between 3.0.x and 3.1.0
--
|
/* disable spring.jpa.hibernate.ddl-auto */
/*CREATE TABLE IF NOT EXISTS ... (
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(30),
last_name VARCHAR(30),
INDEX(last_name)
) engine=InnoDB;
*/ |
{% macro to_char(column, format) -%}
{{ return(adapter.dispatch('to_char', 'elementary')(column, format)) }}
{%- endmacro %}
{% macro default__to_char(column, format) %}
to_char({{ column }} {%- if format %}, '{{ format }}'){%- else %}){%- endif %}
{% endmacro %}
{% macro bigquery__to_char(column, format) %}
... |
create table t12 {
schema
{
int i
datetime dt dbstore="2019-13-30T25:59:59.987 US/Eastern"
}
}$$
insert into t12(i) values(2),(3)
select * from t12
|
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for sms_verif
-- ----------------------------
DROP TABLE IF EXISTS `sms_verif`;
CREATE TABLE `sms_verif` (
`key` bigint(20) NOT NULL COMMENT '内部主键,自增型',
`id` bigint(20) NOT NULL COMMENT '短息验证码信息ID ',
`receiver_no` char(11) NOT NULL COM... |
<gh_stars>0
\unset ON_ERROR_STOP
DROP INDEX edit_add_relationship_link_type;
DROP INDEX edit_edit_relationship_link_type_link;
DROP INDEX edit_edit_relationship_link_type_new;
DROP INDEX edit_edit_relationship_link_type_old;
|
<gh_stars>0
SELECT FirstName, LastName, JobTitle
FROM Employees
WHERE Salary BETWEEN '20000' and '30000' |
-- Multi-Table Query Practice
-- Display the ProductName and CategoryName for all products in the database. Shows 77 records.
select p.productname, c.categoryname
from product as p
join category as c on p.categoryid = c.id
-- Display the order Id and shipper CompanyName for all orders placed before August 9 2012. S... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 21-06-2019 a las 18:24:14
-- Versión del servidor: 5.6.21
-- Versión de PHP: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS permission (
id SERIAL NOT NULL,
role_id INTEGER NOT NULL,
permission_type PERMISSION_TYPE NOT NULL,
resource_type RESOURCE_TYPE NOT NULL,
enabled BOOLEAN NOT NULL DEFA... |
--------------------------------------------------------
-- DDL for Table GS_SPECIES
--------------------------------------------------------
CREATE TABLE "GROUNDFISH"."GS_SPECIES"
( "SPEC" NUMBER(4,0),
"COMM" VARCHAR2(38 BYTE),
"SCIEN" VARCHAR2(49 BYTE),
"FAO" VARCHAR2(3 BYTE)
) PCTFREE 10 PCTUSED 40 ... |
<reponame>JohnPKosh/azos<filename>src/providers/Azos.MySql/ConfForest/Queries/Tree/SaveNode.sql
insert into tbl_node
(
`GDID`,
`CREATE_UTC`
)
VALUES
(
@gdid,
@create_utc
)
|
<filename>dbschema.sql
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 06, 2019 at 09:36 PM
-- Server version: 5.7.25-0ubuntu0.18.04.2
-- PHP Version: 7.2.15-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
... |
-- データベース
CREATE DATABASE tradingbot;
-- テーブル
CREATE TABLE `bitflyer_btc_ohlc_1M` (
`Date` datetime(6) NOT NULL,
`Open` int unsigned NOT NULL,
`High` int unsigned NOT NULL,
`Low` int unsigned NOT NULL,
`Close` int unsigned NOT NULL,
`Volume` decimal(65, 30) unsigned NOT NULL,
PRIMARY KEY (`... |
<filename>migrations/mysql/20191217202658_init.up.sql
CREATE TABLE album
(
id VARCHAR(128) PRIMARY KEY,
name VARCHAR(128) NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL
);
|
<reponame>fatdba/oracle-script-lib
-- dba_feature_usage.sql
-- <NAME> - <EMAIL>
@clears
col detected_usages head 'DETECTED|USAGES' format 9999999
col name format a45
col feature_info format a40 wrapped
spool feature_usage_report.log
-- this is somewhat useless
--select output from table(DBMS_FEATURE_USAGE_REPORT.di... |
CREATE PROCEDURE [dbo].[dfc_GetApprenticeshipLocationsDetailsByApprenticeshipId]
(
@ApprenticeshipId int
)
AS
SELECT al.[ApprenticeshipLocationId]
,al.[ApprenticeshipId]
,al.[LocationId]
,al.[Radius]
,l.LocationName
,a.Postcode
,a.AddressLine1
,a.AddressLine2
,a.Town
,a.Longit... |
-- 2.4 複数条件の組み合わせ
SELECT shohin_mei, shohin_bunrui, (hanbai_tanka * 0.9 - shiire_tanka) AS rieki
FROM Shohin
WHERE ( shohin_bunrui = '事務用品'
OR shohin_bunrui = 'キッチン用品')
AND hanbai_tanka * 0.9 - shiire_tanka > 100;
|
<reponame>khandy21yo/aplus
DEFINE RECORD CDD$TOP.OE.OE_SHIPJOUR
DESCRIPTION IS /*Shipping Journal Header File*/.
OE_SHIPJOUR_CDD STRUCTURE.
/* Element = ORDNUM
Description = Order Number */
ORDNUM DATATYPE IS TEXT SIZE IS 10.
/* Element = DATE
... |
<reponame>haggarw3/sample-projects-for-students
# ************************************************************
# Sequel Pro SQL dump
# Version 5438
#
# https://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 8.0.15)
# Database: ironhack-final-project
# Generation Time: 2019-08-08 ... |
<gh_stars>1-10
WITH __cte_grouping_sets AS
(SELECT CAST(ad_id AS VARCHAR) AS ad_id, CAST(adgroup_id AS VARCHAR) AS adgroup_id, CAST(campaign_id AS VARCHAR) AS campaign_id, comparison_impressions_2b66864e9ec66eff, comparison_spend_5eb761e62a53b4c0, date, impressions, objective, spend
FROM (SELECT data_dataframe.ad_id ... |
<reponame>jerome-karabenli/automated-docker-deployement
-- Deploy ochalet:user_function to pg
BEGIN;
CREATE FUNCTION new_user(myRecord json) RETURNS int AS $$
INSERT INTO "user" ("firstname", "lastname", "email", "password")
VALUES (
myRecord->>'firstname',
myRecord->>'lastname',
myRecord->>'email',
myRecor... |
CREATE TABLE Codes(
Codee char(10) NOT NULL default "",
Message char(150),
PRIMARY KEY (Codee)
) ENGINE=MyISAM;
CREATE TABLE Basins (
Basin char(5) NOT NULL default "",
Basin2 char(20),
BasinName char(150),
PRIMARY KEY (Basin)
) ENGINE=MyISAM;
CREATE TABLE Definiclineascontorno (
... |
/* 2.6. Relationships */
-- Problem 2. Университетска база данни
/* DROP DATABASE IF EXISTS `sample262`; */
CREATE DATABASE IF NOT EXISTS `sample262`;
USE `sample262`;
CREATE TABLE IF NOT EXISTS `subjects`
(
`subject_id` INT NOT NULL PRIMARY KEY,
`name` VARCHAR(50)
);
CREATE TABLE IF NOT EXISTS `majors`
(
`majo... |
<gh_stars>100-1000
-- randexpr1.test
--
-- db eval {SELECT case ((abs(case when case -(select count(distinct case when t1.d in (select t1.b from t1 union select t1.b from t1) then b when f not in (t1.a,b,a) then c else 17 end) | cast(avg(d) AS integer) | min(b) from t1) | +b-e when t1.e then f else a end not between ... |
SELECT *, count(channel_id) AS count, MAX(comment_date) AS last_comment_on FROM channels
JOIN comments USING (channel_id)
WHERE video_id IN (
SELECT video_id FROM gitem_video
JOIN group_gitem USING (gitem_id)
WHERE group_id = ?
) GROUP BY channel_id
ORDER BY count DESC LIMIT ?; |
<reponame>CaptObvious/esx_pycad<filename>esx_pycad.sql<gh_stars>0
ALTER TABLE `essentialmode`.`users`
ADD COLUMN `online` TINYINT NULL DEFAULT 0;
|
/* This file was generated by ODB, object-relational mapping (ORM)
* compiler for C++.
*/
DROP TABLE IF EXISTS "Polarisation";
CREATE TABLE IF NOT EXISTS "schema_version" (
"name" TEXT NOT NULL PRIMARY KEY,
"version" INTEGER NOT NULL,
"migration" INTEGER NOT NULL);
DELETE FROM "schema_version"
WHERE "name"... |
-- Mystic Cogwheel
UPDATE `item_template` SET `FlagsExtra`=8192 WHERE (`entry`=68660);
UPDATE `item_template` SET `RequiredSkill`=202, `RequiredSkillRank`=525, `requiredspell`=0 WHERE (`entry`=68660);
UPDATE `item_template` SET `stat_value1`=0 WHERE (`entry`=68660);
UPDATE `item_template` SET `stat_type1`=0 WHERE (`ent... |
<filename>packages/intranet-workflow/sql/postgresql/workflow-timesheet_approval_wf-create.sql
/*
* Business Process Definition: Timesheet Approval (timesheet_approval_wf)
*
* Auto-generated by ACS Workflow Export, version 4.3
*
* Context: default
*/
/*
* Cases table
*/
create table timesheet_approval_workf_c... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 25, 2019 at 10:51 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.39
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
/*
Warnings:
- You are about to drop the `testing` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "testing";
-- CreateTable
CREATE TABLE "users" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"username" TEXT NOT NULL,
CONSTRAINT "users_pkey" PRI... |
<gh_stars>0
ALTER TABLE dbo.Workouts ADD "Description" VARCHAR(20)
|
<filename>sql/2019/01_JavaScript/01_24.sql<gh_stars>1-10
#standardSQL
# 01_24: % of sites that use dynamic imports.
SELECT
client,
COUNT(DISTINCT page) AS freq,
total,
ROUND(COUNT(DISTINCT page) * 100 / total, 2) AS pct
FROM
`httparchive.almanac.summary_response_bodies`
JOIN
(SELECT _TABLE_SUFFIX AS client,... |
<reponame>osm-codes/BR_IBGE_new<filename>src/step3-lib_BR.sql<gh_stars>1-10
-- a proposta é funcionar com PostgreSQL padrão, mas alguns testes e teorias podem ser testados com
-- o uso de inteiros sem sinal, https://github.com/petere/pguint
-- o tipo padrao por hora é o varbit.
DROP SCHEMA IF EXISTS osmcodes_br CASCA... |
<reponame>jtcohen6/dbt_zendesk_source
{% macro get_ticket_columns() %}
{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()},
{"name": "allow_channelback", "datatype": "boolean"},
{"name": "assignee_id", "datatype": dbt_utils.type_int()},
{"name": "brand_id", "datatype... |
ALTER TABLE "selfservice_errors" DROP COLUMN "_seen_at_tmp"; |
<gh_stars>0
-- Creating real and hypothetical tables"
-- ====================================="
-- Real tables
-- -----------
-- 1.1. Range partition
DROP TABLE IF EXISTS part_range;
CREATE TABLE part_range (id integer, val text) PARTITION BY RANGE (id);
CREATE TABLE part_range_1_10000 PARTITION OF part_range FOR VALU... |
<reponame>nurikk/gpdb
\c gptest;
-- start_ignore
DROP TABLE if exists sto_alt_co1;
-- end_ignore
CREATE TABLE sto_alt_co1(
text_col text default 'remove it',
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4 NOT NULL,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.