sql stringlengths 6 1.05M |
|---|
<gh_stars>1000+
-- 2017-08-11T13:19:29.217
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET Name='Nr',Updated=TO_TIMESTAMP('2017-08-11 13:19:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=559407
;
-- 2017-08-11T13:20:20.328
-- I forgot to set the DICTIONARY_ID_COMMEN... |
<gh_stars>10-100
/*****************************************************************************************************
// Copyright (c) Microsoft Corporation and Avyan Consulting Corp. All rights reserved.
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associ... |
create view rental_titles as
with films_by_rental_id as (
select
rental_id,
title as film_title
from
rental r
inner join inventory i using
(inventory_id)
inner join film f using
(film_id)
)
select
rental_id,
film_title
from
films_by_rental_id;
|
drop table if exists raw_customers ;
create table raw_customers ( id int, first_name varchar(200), last_name varchar(200), email varchar(200) );
drop table if exists raw_orders;
create table raw_orders ( id int, user_id int, order_date DATE, status varchar(200) );
drop table if exists raw_payments;
create table raw_pay... |
-- the day i catch the dev that desided no to put autoindexes
-- on foreign keys in SQLite i hit him in the face
-- not hard
-- but with a lot of spite
PRAGMA foreign_keys = ON;
create table cores (
id int primary key not null,
name text not null
);
create index cn on cores (name);
create table vendors... |
CREATE TABLE "public"."mutex_lock"("id" serial NOT NULL, "key" text NOT NULL, "expiration" timestamptz, PRIMARY KEY ("id") , UNIQUE ("key"));
|
<filename>tests/unittests/format/json_2.sql
--------------------------------------------------------------------------
-- .format json test
--------------------------------------------------------------------------
.run ../common/postgresql_setup.sql
-- Test array
CREATE TABLE ArrTable (a INT, b INT[]);
INSERT INTO A... |
-- // CB-11572 datahub connected to the datalake without datalakeresource
-- Migration SQL that makes the change goes here.
ALTER TABLE stack ADD COLUMN IF NOT EXISTS datalakecrn varchar(512);
CREATE INDEX idx_stack_datalakecrn ON stack (datalakecrn);
UPDATE stack s
SET datalakecrn = dl.resourcecrn
FROM (
SELECT s... |
-- DropForeignKey
ALTER TABLE "OrganizationInvitation" DROP CONSTRAINT "OrganizationInvitation_organizationUserId_fkey";
-- DropForeignKey
ALTER TABLE "OrganizationUser" DROP CONSTRAINT "OrganizationUser_organizationId_fkey";
-- DropForeignKey
ALTER TABLE "OrganizationUser" DROP CONSTRAINT "OrganizationUser_roleId_fk... |
fastload table orders
o_orderkey 1
o_custkey 2
o_orderstatus 3
o_totalprice 4
o_orderdate 5
o_orderpriority 6
o_clerk 7
o_shippriority 8
o_comment 9
infile '/tmp/orders.tbl' date 'yyyy-mm-dd'
|
SET search_path = tasker, pg_catalog ;
CREATE OR REPLACE FUNCTION activity_user__upsert (
a_activity_id integer,
a_role_id integer,
a_username varchar,
a_session_username varchar )
RETURNS dml_ret
SECURITY DEFINER
-- Set a secure search_path
SET search_path = tasker, pg_catalog, pg_temp
LANGUAGE plpgsq... |
<reponame>liangzi4000/grab-share-info<filename>sql/yjbb/600577.sql
EXEC [EST].[Proc_yjbb_Ins] @Code = N'600577',@CutoffDate = N'2017-09-30',@EPS = N'0.134',@EPSDeduct = N'0',@Revenue = N'81.55亿',@RevenueYoy = N'38.27',@RevenueQoq = N'2.55',@Profit = N'2.62亿',@ProfitYoy = N'52.18',@ProfiltQoq = N'-17.78',@NAVPerUnit = N... |
<filename>SQL/3. Aggregation/2. Revising Aggregations - The Sum Function.sql
SELECT SUM(POPULATION)
FROM CITY
WHERE DISTRICT = 'California';
/* Query the total population of all cities in CITY where District is California. */ |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 14, 2018 at 07:05 AM
-- Server version: 5.6.39-cll-lve
-- PHP Version: 5.6.30
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone ... |
CREATE TABLE [Uran].[InsuranceObjects] (
[id] [bigint] NOT NULL,
[gid] [uniqueidentifier] NOT NULL ROWGUIDCOL,
[ObjectCategory] [nvarchar](50) NULL,
[InsuranceObjectTypeGID] [uniqueidentifier] NULL,
[Comment] [nvarchar](255) NULL,
[ObjectTypeGID] [uniqueidentifier] NULL,
[Deleted] [bit] NOT NULL,
[Insu... |
<filename>oursvib (1).sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 08, 2020 at 06:58 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET ti... |
<filename>Day2/test4.sql
-- 4、查询平均成绩小于60分的同学的学生编号和学生姓名和平均成绩
-- (包括有成绩的和无成绩的)
# My version:
SELECT student.s_id,student.s_name,t.s FROM student, (SELECT s_id, ROUND(AVG(s_score),1) as s FROM score
GROUP BY s_id) as t
WHERE student.s_id = t.s_id
AND t.s <60
UNION
SELECT student.s_id, student.s_name, 0 as s FROM student
... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 30, 2019 at 02:53 AM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
SELECT Temp.Id, Temp.Email, Temp.CountryCode, Temp.Trips FROM
(SELECT a.Id, a.Email, c.CountryCode, COUNT(t.Id) AS Trips,
ROW_NUMBER() OVER (PARTITION BY c.CountryCode ORDER BY COUNT(t.Id) DESC) AS [RowOrder]
FROM Accounts AS a
JOIN AccountsTrips AS act ON act.AccountId = a.Id
JOIN Trips AS t ON t.Id = act.TripId
J... |
<reponame>tushartushar/dbSmellsData<gh_stars>1-10
CREATE INDEX items_to_tsvector_idx2 ON items
CREATE INDEX index_items_on_label ON items
CREATE INDEX items_to_tsvector_idx6 ON items
CREATE INDEX index_items_on_price_paid ON items
CREATE INDEX items_to_tsvector_idx4 ON items
CREATE INDEX index_items_on_updated_at ... |
--
INSERT INTO `adm_grp_action_access`
(`controller_name`, `action_name`, `is_ajax`, `description`)
VALUES ('tv-channels', 'iptv-list-json', 1, 'List of tv-channels by page + filters'),
('video-club', 'video-schedule-list-json', ... |
<filename>SRV/SRV/SRV/inf/Views/vWaits.sql
CREATE view [inf].[vWaits] as
/*
2014-08-22 ГЕМ:
SQL Server отслеживает время, которое проходит между выходом потока из состояния «выполняется» и его возвращением в это состояние,
определяя его как «время ожидания» (wait time) и время, потраченное в состоянии «... |
<filename>src/main/resources/db/migration/schema/V2__addAuthorIdColumnToBooks.sql
ALTER TABLE books ADD COLUMN author_id bigint AFTER title; |
-- CreateTable
CREATE TABLE "Session" (
"id" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"expiresAt" TIMESTAMP(3) NOT NULL,
"userId" TEXT NOT NULL,
CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Session" ADD CONSTRAINT "Session_userId_... |
<filename>MySQL/customers-who-never-order.sql
# Time: O(n^2)
# Space: O(1)
#
# 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 | Jo... |
-- select5.test
--
-- execsql {
-- SELECT a FROM t2 WHERE a>2 GROUP BY a;
-- }
SELECT a FROM t2 WHERE a>2 GROUP BY a; |
<filename>tests/fixtures/bulk_tag_insert.sql<gh_stars>100-1000
INSERT INTO `character_tags`
(`character_id`, `tag`)
VALUES
(1, 'red'),
(1, 'plumber'),
(2, 'green'),
(2, 'plumber'),
(2, 'tall'),
(5, 'green'),
(5, 'evil'),
(8, 'ape'),
(9, 'lightning'),
(11, 'evil'),
(14... |
ALTER TABLE [dbo].[Cap]
ADD CONSTRAINT [FK_Cap_ProductType] FOREIGN KEY ([ProductTypeID]) REFERENCES [dbo].[ProductType] ([ProductTypeID]) ON DELETE NO ACTION ON UPDATE NO ACTION;
|
<reponame>dram/metasfresh
-- task 04167 Umlautsuche in Feld Wo (2013041610000054)
-- Function: x_bpartner_search_location(numeric)
--DROP FUNCTION IF EXISTS x_bpartner_search_location(numeric);
CREATE OR REPLACE FUNCTION x_bpartner_search_location(bp_id numeric)
RETURNS text AS
$BODY$
DECLARE
v_search_location t... |
-- 2019-12-04T16:08:44.625Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET AD_Element_ID=2317, CommitWarning=NULL, Description='Value of the Attribute', Help='Adempiere converts the (string) field values to the attribute data type. Booleans (Yes-No) may have the values "true" and "... |
--- Ensure default character set is UTF8
ALTER TABLE `prefix_config` DEFAULT CHARACTER SET utf8;
ALTER TABLE `prefix_entities` DEFAULT CHARACTER SET utf8;
ALTER TABLE `prefix_entity_subtypes` DEFAULT CHARACTER SET utf8;
ALTER TABLE `prefix_entity_relationships` DEFAULT CHARACTER SET utf8;
ALTER TABLE `prefix_access_co... |
<reponame>wujiabo/FSD-SBA
-- --------------------------------------------------------
-- 主机: localhost
-- 服务器版本: 8.0.13 - MySQL Community Server - GPL
-- 服务器操作系统: Win64
-- HeidiSQL 版本: 9.5.0.5196
-- ----------------------------------... |
<filename>microservicio/infraestructura/src/main/resources/sql/habitacion/eliminar.sql<gh_stars>0
DELETE FROM habitacion
WHERE id = :id |
-- DataSource
INSERT INTO datasource(id, ds_name, ds_alias, ds_owner_id, ds_desc, ds_filter_at_select, ds_type, ds_conn_type, ds_granularity, version, created_time, created_by, modified_time, modified_by) values('ds-37', 'sale_02', 'sale_02', '<EMAIL>', 'sale_02 data (2011~2014)', true, 'MASTER', 'ENGINE', 'DAY', 1.0, ... |
-- start_matchsubs
-- m/nodeDML.c:\d+/
-- s/nodeDML.c:\d+/nodeDML.c:XXX/
-- m/nodeModifyTable.c:\d+/
-- s/nodeModifyTable.c:\d+/nodeModifyTable.c:XXX/
-- end_matchsubs
create table bad_distribution1 (a int, b int) distributed by (a);
create table pbad_distribution1 (a int, b int) distributed by (a) PARTITION BY RANGE(... |
UPDATE `Contests` SET `score_mode` = 'partial' WHERE `partial_score` = 1;
UPDATE `Contests` SET `score_mode` = 'all_or_nothing' WHERE `partial_score` = 0; |
create class test_class (bigint_col bigint);
create index idx_bigint_col on test_class(bigint_col);
insert into test_class(bigint_col) values (-9223372036854775808);
insert into test_class(bigint_col) values (9223372036854775807);
insert into test_class(bigint_col) values (100);
insert into test_class(bigint_col) val... |
<filename>PeachtreeBus.Example.Database/PeachtreeBus.SampleQueue_PendingMessages.sql
-- A table for queue (pending) messages from the queue named SampleQueue
-- Messages in this table remain here temporarily after failure or completion before being moved,
-- but for the most part this table contains unprocessed messag... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 128.199.93.68 (MySQL 5.5.47-0ubuntu0.14.04.1)
# Database: perusahaan_db
# Generation Time: 2016-10-18 15:27:14 +0000
# ********************... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 03, 2017 at 04:55 PM
-- Server version: 5.7.20-0ubuntu0.17.04.1
-- PHP Version: 7.0.22-0ubuntu0.17.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
<reponame>Rizky-wp/project2
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 29, 2022 at 06:07 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 ... |
<filename>review.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 15, 2019 at 05:26 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
<reponame>akshaybarpute/old-bookStore
//Table: users
Create Table: CREATE TABLE `users` (
`id` char(36) NOT NULL,
`name` varchar(64) NOT NULL,
`socialid` char(70) DEFAULT NULL,
`registrationdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`lastlogindate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPD... |
CREATE TABLE users (
{descriptors}
); |
<gh_stars>0
create view dual as select 'X' AS dummy;
create table rss_source (
rss_source_id int identity(1,1) primary key not null,
source_name varchar(256) not null,
lowered_source_name varchar(256) not null,
language varchar(8) not null,
copyright nvarchar(max)... |
<reponame>grimrose/yokohama-groovy-spring-boot-gradle<gh_stars>0
CREATE TABLE users (
user_id BIGINT NOT NULL AUTO_INCREMENT,
user_name VARCHAR(50) NOT NULL,
user_address TEXT,
phone_number VARCHAR(50) NOT NULL,
email_address VARCHAR(100) NOT NULL,
other_user_det... |
<filename>src/test/resources/substr.test_2.sql
-- substr.test
--
-- db eval {
-- DELETE FROM t1;
-- INSERT INTO t1(t) VALUES(string)
-- }
DELETE FROM t1;
INSERT INTO t1(t) VALUES(string)
|
-- file:domain.sql ln:47 expect:true
COPY basictest (testvarchar) FROM stdin
|
<reponame>Skatterbrainz/SkatterTools<gh_stars>10-100
SELECT DISTINCT
dbo.v_R_System.Name0,
dbo.v_GS_ADD_REMOVE_PROGRAMS.DisplayName0 AS ProductName,
dbo.v_GS_ADD_REMOVE_PROGRAMS.Publisher0 AS Publisher,
dbo.v_GS_ADD_REMOVE_PROGRAMS.Version0 AS Version
FROM
dbo.v_GS_ADD_REMOVE_PROGRAMS INNE... |
<filename>ch07/readinglist-cli/schema.sql<gh_stars>10-100
create table Book (
id identity,
reader varchar(20) not null,
isbn varchar(10) not null,
title varchar(50) not null,
author varchar(50) not null,
description varchar(2000) not null
); |
-- creates all the tables and produces csv files
-- takes a while to run (about an hour)
-- change the paths to those in your local computer using find and replace for '/Users/emmarocheteau/PycharmProjects/TPC-LoS-prediction/MIMIC_data/'.
-- keep the file names the same
\i MIMIC_preprocessing/labels.sql
\i MIMIC_prep... |
SELECT ord.o_orderdate, ord.o_orderkey, ord.o_orderstatus, ord.o_totalprice FROM demo_local.orders_mergekey ord WHERE o_orderpriority in ('1-URGENT', '2-HIGH') AND o_orderdate >= '1992-01-01' AND o_orderdate < '1992-02-01' limit 100 ;
|
<reponame>WorldHealthOrganization/smart-immunizations<filename>input/cql/IMMZDT09.cql<gh_stars>1-10
/*
* Library: IMMZDT09 (IMMZ.DT.09.Rubella)
* Rule: If child or patient has not received the Rubella vaccination and is greater than or equal to 9 months
* Trigger: Patient has never received Rubella vaccination
*/
... |
-- Treatment buddy
IF not Exists(select * from LookupMaster where Name = 'SupportSystem')
insert into LookupMaster (Name,DisplayName,DeleteFlag)values('SupportSystem','SupportSystem','0')
GO
IF not exists(select * from LookupItem where Name = 'Treatment Buddy')
BEGIN
insert into LookupItem(Name,DisplayName,DeleteF... |
CREATE TABLE Comment_replies(
comment_id bigint NOT NULL,
content varchar(255),
like_flag Boolean,
created_at Datetime,
PRIMARY KEY(comment_id),
FOREIGN KEY(comment_id)
);
drop table if exists Comment_replies;
|
SELECT id, sitelinks.site, sitelinks.title, sitelinks.encoded
FROM js(
(
SELECT JSON_EXTRACT_SCALAR(item, '$.sitelinks.enwiki.title') title, item
FROM [fh-bigquery:wikidata.latest_raw]
WHERE JSON_EXTRACT_SCALAR(item, '$.claims.P31[0].mainsnak.datavalue.value.numeric-id')='146' #cats
AND LENGTH(item)>10
),
titl... |
-- SET FOREIGN_KEY_CHECKS=0;
-- drop table if exists `mst_orderintermtype`;
CREATE TABLE IF NOT EXISTS `mst_orderintermtype` (
`orderintermtype_id` varchar(10) NOT NULL ,
`orderintermtype_name` varchar(30) ,
`orderintermtype_descr` varchar(255) ,
`orderintermtype_isdp` tinyint(1) NOT NULL DEFAULT 0... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th9 06, 2021 lúc 08:16 PM
-- Phiên bản máy phục vụ: 10.4.17-MariaDB
-- Phiên bản PHP: 7.4.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 S... |
<filename>Esra.Db/dbo/Tables/EmployeeChanges.sql
CREATE TABLE [dbo].[EmployeeChanges] (
[EmployeeChangesID] INT IDENTITY (101, 1) NOT NULL,
[FkEmployee] CHAR (13) NOT NULL,
[TitleCode] CHAR (4) NOT NULL,
[UserID] INT NOT NULL,
[DateChanged] ... |
<filename>pv.sql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: May 17, 2018 at 08:37 AM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
USE [master]
GO
CREATE DATABASE [PatientDb]
ON PRIMARY
(
NAME = N'PatientDb',
FILENAME = N'[local path]\PatientDb.mdf' ,
SIZE = 8192KB ,
MAXSIZE = UNLIMITED,
FILEGROWTH = 65536KB
)
LOG ON
(
NAME = N'PatientDb_log',
FILENAME = N'[local path]\PatientDb.ldf' ,
SIZE = 8192KB , ... |
<filename>JobExecutionFramework/ConfigDB/etljob/Stored Procedures/prc_InitJobExecution.sql<gh_stars>1-10
-- =============================================
-- Author: (C<NAME>; <NAME>)
-- Create date: 2014-06-25
-- Description: Copies Entries from JobStep to JobStepEexcution ("queue")
-- and creates Entry in JobEx... |
select e from Person e where e.ssn.country = :country
select object(o) from " + op.getAggregateRoot().name + " o where
select planet from Planet planet where planet.diameter = (select min(planet.diameter) from Planet planet)
select name from PLANET where LENGTH(name) = (select MAX(LENGTH(name)) from PLANET)
CREATE TAB... |
SELECT proj.responsable, MAX(proj.idp) AS m
FROM "projets.csv" proj GROUP BY proj.responsable;
[normal]
responsable, m
4, 13
5, 9
8, 19
15, 18
26, 14
29, 3
38, 12
40, 17
44, 16
48, 7
68, 1
75, 20
79, 5
94, 4
96, 6
99, 8 |
--
-- create table sa.sa_hakuajat
--
USE [ANTERO]
GO
IF NOT EXISTS
(SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA='sa'
AND TABLE_NAME='sa_hakuajat')
BEGIN
CREATE TABLE [sa].[sa_hakuajat](
[hakuaikaId] [nvarchar](15) NULL,
[hakuOid] [nvarchar](100) NULL,
[alkuPvm] [datetime2](7) NULL,
[loppuPvm] ... |
<filename>src/test/resources/sql/create/d855543e.sql
-- file:alter_table.sql ln:1909 expect:true
CREATE UNLOGGED TABLE unlogged3(f1 SERIAL PRIMARY KEY, f2 INTEGER REFERENCES unlogged3)
|
<reponame>LiubovKvasova/media-content-analyzing-system
USE mcas;
INSERT INTO Service (id, name, description, uri, Service_id)
VALUES (1, 'Google', 'Google service', 'google.com', 1);
|
create database if not exists db_meta;
use db_meta;
create table if not exists pseudo_gtid_status (
anchor int unsigned not null,
originating_mysql_host varchar(128) charset ascii not null,
originating_mysql_port int unsigned not null,
originating_server_id int unsig... |
<reponame>Datasilk/Saber-Collector<filename>Sql/Schema/Stored Procedures/Words/Words_BulkAdd.sql
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND name = 'Words_BulkAdd')
DROP PROCEDURE [dbo].[Words_BulkAdd]
GO
CREATE PROCEDURE [dbo].[Words_BulkAdd]
@words nvarchar(MAX),
@subjectId int = 0,
@grammartype in... |
CREATE TABLE `transcript` (
`transcript_id` int(10) unsigned NOT NULL auto_increment,
`gene_id` int(10) unsigned NOT NULL default '0',
`analysis_id` INT(10) UNSIGNED NOT NULL,
`seq_region_id` int(10) unsigned NOT NULL default '0',
`seq_region_start` int(10) unsigned NOT NULL default '0',
`seq_region_end` in... |
COPY stns.TPC_COUNTRIES (PKEY, ALPHA ,FIPS, NAME, COUNTRY, LATITUDE, LONGITUDE) FROM stdin with delimiter as ',';
1,PR,72,Puerto Rico,PR,18.9,-65
2,BA,101,Bahamas,BA,24.5,-73.8
3,BE,102,Bermuda,BE,32,-63.7
4,BH,103,Belize,BH,17.1,-88.5
5,CO,104,Colombia,CO,8.9,-74.3
6,CS,105,Costa Rica,CS,9.9,-84
7,CU,106,Cuba,CU,22,-7... |
<filename>AutoRollbackIfError_SQLServer.sql<gh_stars>0
CREATE PROCEDURE [dbo].[UPDATE_REQUEST_STATUS]
@LOG_NUMBER int,
@REQUEST_ID uniqueidentifier,
@REQUEST_STATUS varchar(25)
AS
SET NOCOUNT ON
SET XACT_ABORT ON
DECLARE @REQUEST_NO int
SELECT @REQUEST_NO = REQUEST_NO
FROM dbo.[REQUESTS] (N... |
-- ----------------------------
-- Table structure for order_detail
-- ----------------------------
DROP TABLE IF EXISTS `order_detail`;
CREATE TABLE `order_detail` (
`detail_id` VARCHAR(32)
CHARACTER SET utf8
COLLATE utf8_general_ci NOT NULL,
`order_id` VARC... |
<reponame>dahuuhad/Stocks
insert OR REPLACE INTO stocks(signature, name, currency, dividend_per_year, dividend_forecast)
VALUES ('KOP', 'Kopparbergs', 'SEK', 1, 5.90),
('AAPL', 'Apple Inc', 'USD', 4, 0.57),
('BON', 'Bonheur', 'NOK', 1, 0.0),
('CAST', 'Castellum', 'SEK', 2, 3.05),
('C', 'Citigroup', 'USD', 4, 0.0),
('CL... |
<reponame>thehyve/ohdsi-etl-sweden-open
INSERT INTO person
( person_id, person_source_value, location_id, gender_concept_id, gender_source_value,
year_of_birth, race_concept_id, ethnicity_concept_id )
SELECT -- If record not in LISA, then use the lpnr from the registries.
CASE WHEN lisa.lpnr IS NULL
... |
ALTER TABLE table1 REPAIR PARTITION |
CREATE FUNCTION func715() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE181);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE493);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE38);val:=(SELECT COUNT(*)INTO MYCOUN... |
<reponame>boost-entropy-azure/steampipe-plugin-azure
select id, name, type
from azure.azure_policy_assignment
where name = '{{ output.resource_name.value }}'
|
create table animal(
idanimal bigint auto_increment,
nome varchar(100) not null,
raca varchar(100) not null,
idade int not null,
peso double not null,
dono varchar(100) not null,
primary key (idanimal)
);
create table cliente(
idcliente bigint auto_increment,
nome varchar(100) not n... |
INSERT INTO burgers (name) VALUES ("hamburger");
INSERT INTO burgers (name, devoured) VALUES ("cheeseburger", true);
INSERT INTO burgers (name) VALUES ("veggie burger");
|
<gh_stars>0
DROP DATABASE IF EXISTS shoe_db2;
CREATE DATABASE shoe_db2;
|
<reponame>mert-kurttutan/Database_management_small_project
-- Loads the data into the table
INSERT INTO Status
SELECT i.ItemID,
CASE
WHEN cTime.Time_t < i.Started THEN "notstarted"
-- Buy_Price could also be a null value
WHEN cTime.Time_t < i.Ends AND (i.Currently < i.Buy_Price or i.Buy_Price is NULL) TH... |
/* this is comment ;;; */
insert into tt values (2000);
/*
delete from tt;
*/
/* {{ down }}
delete from tt where id = 2000;
/**/
|
/****** Object: Schema [Purchasing] Script Date: 10/06/2020 18:14:16 ******/
CREATE SCHEMA [Purchasing] AUTHORIZATION [dbo]
GO
EXEC sys.sp_addextendedproperty @name=N'Description', @value=N'Details of suppliers and of purchasing of stock items' , @level0type=N'SCHEMA',@level0name=N'Purchasing' |
<reponame>LLCoolDave/TacticalRecords<gh_stars>1-10
-- AlterTable
ALTER TABLE `Run` ADD COLUMN `level` INTEGER NULL;
|
-- fts2p.test
--
-- execsql {
-- SELECT dump_doclist(t1, term) FROM t1 LIMIT 1;
-- }
SELECT dump_doclist(t1, term) FROM t1 LIMIT 1;
|
<reponame>scheltwort-it-services/common_schema
USE test_cs;
DROP TABLE IF EXISTS test_script_foreach;
CREATE TABLE test_script_foreach (id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY, name VARCHAR(10) CHARSET ascii);
INSERT INTO test_script_foreach VALUES (1, 'first');
INSERT INTO test_script_foreach VALUES (2, 'second');
... |
DROP FUNCTION loopring.fn_process_trade_block_v1;
DROP TYPE loopring.trade_struct;
CREATE TYPE loopring.trade_struct AS (block_timestamp timestamptz,
tokenA integer, fillA double precision,
tokenB integer, fillB double precision,
... |
create table ValidateValues(Value numeric primary key not null) without rowid;
insert into ValidateValues(Value) values('A'),('B'),('C');
.parameter set @value 'A'
select @value IN (select Value from ValidateValues); /* 1 */
.parameter set @value 'X'
select @value IN (select Value from ValidateValues); /* 0 */
|
update dbo.Voter set FirstName = dbo.MixedCase(FirstName),
MiddleName = dbo.MixedCase(MiddleName),
LastName = dbo.MixedCase(LastName),
NameSuffix = dbo.MixedCase(NameSuffix),
Nickname = dbo.MixedCase(NickName),
StreetName = dbo.MixedCase(StreetName),
ResidentialAddress = dbo.MixedCase(ResidentialAddress),
Reside... |
<filename>Projects/KnowDiabetes/Batched Procedures/Production Versions/knowDiabetesCreateReport.sql<gh_stars>0
USE data_extracts;
DROP PROCEDURE IF EXISTS knowDiabetesCreateReport;
DELIMITER //
CREATE PROCEDURE knowDiabetesCreateReport()
BEGIN
/*
This procedure loops down every organisation in our DB and figure... |
with orders as (
select * from {{ ref('int_orders') }}
)
select
order_id
, user_id
, promo_id
, created_at
, order_cost
, shipping_cost
, order_total
, shipping_service
, estimated_delivery_at
, delivered_at
, status
, address
, address_zipcode
, address_sta... |
['CUSTOMER_PK', 'ORDER_FK', 'BOOKING_FK'] |
<filename>adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.4__Add_Vnf_Operational_Env_Id_column.sql
use requestdb;
ALTER TABLE activate_operational_env_service_model_distribution_status ADD VNF_OPERATIONAL_ENV_ID varchar(45) NOT NULL;
|
<filename>PetaPoco.Tests.Integration/Scripts/PostgresBuildDatabase.sql
-- Need to drop functions first, because Postgres stores the table relations
DROP FUNCTION IF EXISTS SelectPeople();
DROP FUNCTION IF EXISTS SelectPeopleWithParam(age integer);
DROP FUNCTION IF EXISTS CountPeople();
DROP FUNCTION IF EXISTS CountPeo... |
select `orderkey`, `suppkey`, `extendedprice`, first_value(`extendedprice`) over (partition by `suppkey` order by `extendedprice` desc rows between unbounded_preceding and unbounded_following), last_value(`extendedprice`) over (partition by `suppkey` order by `extendedprice` desc rows between unbounded_preceding and un... |
<filename>software/cabio-database/scripts/plsql/packages/LOAD_DATA.pks
CREATE OR REPLACE PACKAGE Load_Data AS
PROCEDURE load_libraries;
PROCEDURE load_unigene;
FUNCTION get_chromosome(cytoloc_in VARCHAR2, taxon_id_in NUMBER) RETURN NUMBER;
FUNCTION get_taxon(taxon_abbr VARCHAR2, strain_name VARCHAR2) RETURN N... |
<filename>schema.sql<gh_stars>0
DROP TABLE IF EXISTS places;
CREATE TABLE places (
id SERIAL PRIMARY KEY,
name VARCHAR(255),
description TEXT,
temp VARCHAR(255),
sunrise VARCHAR(255),
sunset VARCHAR(255),
windspeed VARCHAR(255),
lat VARCHAR(255),
lon VARCHAR(255)
); |
CREATE TABLE "Arade_1"(
"col_00" varchar(3) NOT NULL,
"col_01" varchar(5) NOT NULL,
"col_02" timestamp NOT NULL,
"col_03" decimal(8, 4) NOT NULL,
"col_04" decimal(8, 6) NOT NULL,
"col_05" varchar(1),
"col_06" varchar(1),
"col_07" decimal(9, 6) NOT NULL,
"col_08" decimal(9, 6) NOT NULL,
"col_09" smallint NOT NULL,
"col_... |
<reponame>nikitakodkani/MySQL
/*
Write a query identifying the type of each record in the TRIANGLES table using
its three side lengths. Output one of the following statements for each record
in the table:
Cases:
Not A Triangle: The given values of A, B, and C don't form a triangle.
Equilateral: It's a triangle with ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.