sql stringlengths 6 1.05M |
|---|
TRUNCATE TABLE CA_ICR_TYPE_T
/
INSERT INTO CA_ICR_TYPE_T (ACCT_ICR_TYP_CD,OBJ_ID,VER_NBR,ACCT_ICR_TYP_DESC,ACCT_ICR_TYP_ACTV_IND)
VALUES ('10','0C4EE51FDFEA2018E043814FD8812018',1.0,'NO INDIRECT COST','Y')
/
INSERT INTO CA_ICR_TYPE_T (ACCT_ICR_TYP_CD,OBJ_ID,VER_NBR,ACCT_ICR_TYP_DESC,ACCT_ICR_TYP_ACTV_IND)
VALUES ('... |
DROP DATABASE IF EXISTS project_2_local;
CREATE DATABASE project_2_local;
DROP DATABASE IF EXISTS project_2_test;
CREATE DATABASE project_2_test; |
<filename>src/main/resources/migrations/postgres/V5__Create_Initial_Client.sql
insert into clients (id, name, client_id, client_secret, version, created, updated)
values (1, 'Default client', '8f4ebf06-5982-11e8-9c2d-fa7ae01bbebc', '$2a$10$m2XBU1sJoP4V/doceVk6N.nXaICYxu54jDwx7rtRc1wp44Rf.EnP6', 0, NOW(), NOW());
-... |
CREATE TABLE IF NOT EXISTS `wp_shop_reward` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`title` varchar(100) NULL COMMENT '活动名称',
`start_time` int(10) NULL COMMENT '开始时间',
`end_time` int(10) NULL COMMENT '过期时间',
`is_mult` tinyint(2) NULL DEFAULT 0 COMMENT '多级优惠',
`is_all_goods` tinyint(2) NUL... |
<gh_stars>0
CREATE TABLE orders (
id serial,
name VARCHAR(50),
description VARCHAR(50),
created timestamp,
PRIMARY KEY (id)
); |
<reponame>alexavila150/luciddb
set schema 's';
analyze table EMP estimate statistics for all columns SAMPLE 100 PERCENT;
analyze table PRODUCTS estimate statistics for all columns SAMPLE 100 PERCENT;
analyze table SALES estimate statistics for all columns SAMPLE 100 PERCENT;
analyze table CUSTOMERS estimate statistics... |
--
-- Created by SQL::Translator::Producer::PostgreSQL
-- Created on Fri Jun 21 09:41:15 2019
--
--
-- Table: division
--
DROP TABLE division CASCADE;
CREATE TABLE division (
division_id bigserial NOT NULL,
division character varying(256) NOT NULL,
PRIMARY KEY (division_id),
CONSTRAINT division_uniq UNIQUE (d... |
SELECT
cast(ar1.stratum_1 AS INT) AS intervalIndex,
ar1.count_value AS countValue,
round(1.0 * ar1.count_value / denom.count_value, 5) AS percentValue
FROM @results_database_schema.ACHILLES_analysis aa1
INNER JOIN @results_database_schema.ACHILLES_resul... |
<filename>colusage.sql
-- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
col colusage_owner head OWNER for a25 wrap
col colusage_table_name head TABLE_NAME for a25 wrap
col colusage_column_na... |
-- Changes to optimize write performance
-- Drop foreign keys in t_transactions and t_entities
-- Drop foreign keys referencing t_transactions(consensus_timestamp) in t_cryptotransferlists, t_file_data,
-- t_livehashes and t_contract_result.
-- Drop trigger in topic_message and associated function
-- Drop unused inde... |
<filename>api/src/main/resources/db/migration/V1.0.1__PEN_REQUEST_API.sql
CREATE TABLE PEN_RETRIEVAL_REQUEST_EVENT
(
EVENT_ID RAW(16) NOT NULL,
EVENT_PAYLOAD VARCHAR(4000) NOT NULL,
EVENT_STATUS VARCHAR2(50) NOT NULL,
EVENT_T... |
<filename>openGaussBase/testcase/KEYWORDS/prefix/Opengauss_Function_Keyword_Prefix_Case0033.sql
-- @testpoint:opengauss关键字prefix(非保留),作为视图名
--关键字prefix作为视图名,不带引号,创建成功
CREATE or replace VIEW prefix AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view prefix;
--关键字prefix作为视图名,加双引号,创建成功
CREATE or re... |
USE sql_store;
-- like
SELECT *
FROM customers
WHERE last_name LIKE '%field%';
-- regexp
SELECT *
FROM customers
WHERE last_name REGEXP 'field';
SELECT *
FROM customers
WHERE last_name REGEXP '^field';
SELECT *
FROM customers
WHERE last_name REGEXP 'field$';
SELECT *
FROM customers
WHERE last_name REGEXP 'field|... |
CREATE DATABASE pbspeed;
CREATE DATABASE pbspeed_test;
CREATE EXTENSION pgcrypto;
CREATE TABLE logs (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id integer,
space_id integer,
action varchar(40),
browser_type varchar(40),
browser_version varchar(40),
create... |
<reponame>bjrnfrdnnd/dg-bondora
select EXTRACT("second" from (datetime_celery- "ListedOnDate")) as timediff_total, EXTRACT("second" from (datetime_flask- "ListedOnDate")) as timediff_flask, EXTRACT("second" from (datetime_celery- datetime_flask)) as timediff_celery_flask, * from "WhSecondMarketPublished";
SELECT
m... |
<gh_stars>0
DROP TABLE IF EXISTS `employee`;
CREATE TABLE `employee` (
`employeeId` int(11) NOT NULL,
`employeeFirstName` varchar(50) NOT NULL,
`employeeLastName` varchar(50) NOT NULL,
`employeeEmail` varchar(50) NOT NULL,
`employeeSalary` int(15) DEFAULT NULL,
PRIMARY KEY (`employeeId`)
) ENGINE=InnoDB DE... |
-- MySQL dump 10.13 Distrib 5.7.9, for linux-glibc2.5 (x86_64)
--
-- Host: localhost Database: mysqlfunctions
-- ------------------------------------------------------
-- Server version 5.5.47-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS... |
<reponame>EL-BID/nexso
CREATE PROCEDURE [dbo].[dnn_UpdateLanguagePack]
@LanguagePackID int,
@PackageID int,
@LanguageID int,
@DependentPackageID int,
@LastModifiedByUserID int
AS
UPDATE dbo.dnn_LanguagePacks
SET
PackageID = @PackageID,
LanguageID = @LanguageID,
DependentPackageID = @De... |
SELECT
TL.resource_type,
TL.resource_database_id,
TL.resource_associated_entity_id,
TL.request_mode,
TL.request_session_id,
WT.blocking_session_id,
O.name AS [object name],
O.type_desc AS [object descr],
P.partition_id AS [partition id],
P.rows AS [partition/page rows]... |
<filename>sql/updates/world/already_applied/12_04_25_new_conditions_columns.sql
-- add column SourceId
ALTER TABLE `conditions` ADD COLUMN `SourceId` INT(10) NOT NULL DEFAULT '0' AFTER SourceEntry;
ALTER TABLE `conditions` DROP PRIMARY KEY,
ADD PRIMARY KEY (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `... |
DROP TRIGGER IF EXISTS trigger_flag ON osm_housenumber_point;
DROP TRIGGER IF EXISTS trigger_store ON osm_housenumber_point;
DROP TRIGGER IF EXISTS trigger_refresh ON housenumber.updates;
CREATE SCHEMA IF NOT EXISTS housenumber;
CREATE TABLE IF NOT EXISTS housenumber.osm_ids
(
osm_id bigint
);
-- etldoc: osm_hou... |
CREATE TABLE client_data (
client_id INT64,
client_name STRING(50),
client_company STRING(50),
description STRING(100),
) PRIMARY KEY(client_id)
|
<filename>migrations/000004_create_channels_tables.up.sql
CREATE TABLE channels
(
id VARCHAR(20) PRIMARY KEY,
name VARCHAR(32) NOT NULL,
owner VARCHAR(20) NOT NULL REFERENCES users (id) ON DELETE CASCADE,
parent VARCHAR(20) REFERENCES channels (id) ON DELETE CASCADE
);
CREATE TABLE invites
(
... |
SELECT fn_db_add_column('vds_dynamic', 'backup_enabled', 'BOOLEAN NOT NULL DEFAULT FALSE');
|
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
CREATE TABLE sync2_heap_table_unique_index(
text_col text,
bigint_col bigint,
char_vary_col character varying(30),
numeric_col numeric,
int_col int4,
float_col float4,
int_array_col int[],
drop_col numeric,
before_rename_col int4,
change... |
DROP TABLE statistics;
|
--+ holdcas on;
set system parameters 'compat_mode=mysql';
create table t1 (id int auto_increment, a1 int);
PREPARE STMT from 'insert into t1(a1) values (?)'
EXECUTE stmt using 1
EXECUTE stmt USING 2
EXECUTE STMT USING 3
execute STMT Using 4
execute STMT UsinG 5
execute STMT UsinG 6
exeCUte STMT ... |
<gh_stars>0
CREATE TABLE [acc].[Balance]
(
[BalanceId] VARCHAR(10) NOT NULL PRIMARY KEY CLUSTERED ([BalanceId]),
[BalanceName] NVARCHAR(128) NOT NULL,
[ParentId] VARCHAR(10) NULL,
)
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 14, 2019 at 10:03 PM
-- Server version: 10.1.24-MariaDB
-- PHP Version: 7.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40... |
SELECT f_e.location as location, AVG(f_h.popularity) as avg_popularity
FROM facebook_employees f_e
LEFT JOIN facebook_hack_survey f_h
ON f_e.id = f_h.employee_id
GROUP BY f_e.location
|
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY,
email VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
assets REAL DEFAULT 0.0,
first_name VARCHAR(60),
last_name VARCHAR(60),
UNIQUE(email)
);
CREATE TABLE IF NOT EXISTS items (
id INTEGER PRIMARY KEY,
name VARCHAR(6... |
<gh_stars>0
DROP TABLE IF EXISTS `user`;
DROP TABLE IF EXISTS `user_data`;
DROP TABLE IF EXISTS `role`;
DROP TABLE IF EXISTS `order`;
DROP TABLE IF EXISTS `product_type`;
DROP TABLE IF EXISTS `product`;
DROP TABLE IF EXISTS `serialnumber`;
DROP TABLE IF EXISTS `fiddly_gps`;
DROP TABLE IF EXISTS `fiddly_gps_data`;
DROP ... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 28, 2018 at 09:22 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>andisaputro/Rest-API-codeigniter-JWT<filename>ci_jwt.sql
/*
SQLyog Community v13.0.1 (64 bit)
MySQL - 10.1.21-MariaDB : Database - ci_jwt
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE... |
<filename>src/main/resources/db/migration/V2__photo_schema.sql
CREATE TABLE `photos` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(120) NOT NULL,
`path` varchar(100) NOT NULL,
`host` varchar(60) NOT NULL,
`url` varchar(280),
`created_at` timestamp DEFAULT CURRENT_TIMESTAMP,
`updated_at` timest... |
PARAMETERS FiscalYearArgs Text ( 255 ), RcCodeArgs Text ( 255 ), FundCodeArgs Text ( 255 );
SELECT DISTINCTROW Purchases.RpioCode AS RPIO, Purchases.BFY, Purchases.AhCode AS [AH Code], Purchases.AhName AS [AH Name], Purchases.FundCode AS FundCode, Purchases.FundName AS FundName, Purchases.AccountCode AS AccountCode, Pu... |
<filename>Demofiles/Mod06/Demo/Demo/21 - Demonstration B.sql
-- Demonstration B
-- Step 1:
-- Switch the query window to use your copy of the AdventureWorksLT database
-- Step 2: Use collation in a query
SELECT CustomerId, LastName
FROM SalesLT.Customer
WHERE LastName COLLATE Latin1_General_CS_AS = N'Miller';
-- St... |
<reponame>SiriusKoan/flask_net
DROP TABLE IF EXISTS posts;
CREATE TABLE posts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
time TEXT NOT NULL,
name TEXT NOT NULL,
content TEXT NOT NULL
);
|
/*
+----------------------------+
|NORDIC HEADER ERROR POLICIES|
+----------------------------+
This file contains the sql commands for creating the correct policies for nordic_header_error table.
*/
/*
ADMIN POLICIES
--------------
*/
--Admin policy. Allow admins to access all operations freely.
CREATE POLICY admin... |
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET client_min_messages = warning;
SET row_security = off;
--
-- N... |
<reponame>CSCfi/antero
USE [VipunenTK_DW]
GO
/****** Object: StoredProcedure [dbo].[p_lataa_f_3_1a] Script Date: 7.8.2018 13:49:12 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[p_lataa_f_3_1a] AS
truncate table [VipunenTK].[dbo].[f_3_1a_Oppisopimus_paaasiallinen_toiminta]
in... |
<reponame>aliostad/deep-learning-lang-detection
-- 6.1.3 (A) --
SELECT model, speed, hd_size
FROM PC
WHERE (price < 1000)
-- 6.1.3 (B) --
SELECT model, speed AS gigahertz, hd_size AS gigabytes
FROM PC
WHERE (price < 1000)
-- 6.1.3 (C) --
SELECT model
FROM Printer
-- 6.1.3 (D) --
SELECT model, ram, screen_size
FROM ... |
<gh_stars>0
CREATE TABLE t_user
(
user_id BIGINT(20) PRIMARY KEY COMMENT '主键ID',
name VARCHAR(30) NULL DEFAULT NULL COMMENT '姓名',
age INT(11) NULL DEFAULT NULL COMMENT '年龄',
email VARCHAR(50) NULL DEFAULT NULL COMMENT '邮箱'
);
create table t_order0
(
order_id BIGINT(20) not null primary key,
user_id BIGINT(20) ... |
<reponame>datasynctools/data-sync-tools
--For Queuing, how to mark changes to previously queued records
update sync_peer_state set ChangedByClient = '1' where
EntityId in (
select EntityId from sync_peer_state where
ChangedByClient = '0'
and
NodeId = '*node-spoke1'
and
RecordId in (
SELECT Recor... |
# Calculate the frequency of mutations in 5kb windows on BRCA1 for each sample in the
# multi sample variants table.
SELECT
call.call_set_name,
reference_name,
window,
window * 5000 AS window_start,
((window * 5000) + 4999) AS window_end,
MIN(start) AS min_variant_position,
MAX(start) AS max_variant_position,
COUNT(ca... |
-- Copyright 2018 The LUCI Authors.
--
-- 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 by applicable law or agreed... |
<gh_stars>1-10
CREATE SEQUENCE public.consumption_stats_id_seq
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
CREATE TABLE public.consumption_stats
(
"id" bigint PRIMARY KEY DEFAULT nextval('consumption_stats_id_seq'::regclass),
"ref_date" timestamp NOT NULL,
"utility" integer NO... |
-- security_functions
UPDATE `security_functions` SET `_execute` = 'Assessments.excel|ClassStudents.excel' WHERE `id` = 1015;
-- system_patches
DELETE FROM `system_patches` WHERE `issue` = 'POCOR-4013';
|
<reponame>zhenghua75/DXInfo<filename>DXInfo.Models/SqlServerScript/OrderPackagesHis.sql<gh_stars>1-10
IF not EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[OrderPackagesHis]') AND type in (N'U'))
begin
CREATE TABLE [dbo].[OrderPackagesHis](
[Id] [uniqueidentifier] NOT NULL DEFAULT (newsequenti... |
PROC $sc_$cpu_hk_gencmds
;*******************************************************************************
; Test Name: hk_gencmds
; Test Level: Build Verification
; Test Type: Functional
;
; Test Description
; The purpose of this test is to verify that Housekeeping (HK) general
; commands function ... |
--
-- 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 ... |
<filename>init/migrations/1565976629_removing_scanid_from_scansummary.down.sql
SET SQL_SAFE_UPDATES = 0;
ALTER TABLE ScanSummary DROP PRIMARY KEY;
ALTER TABLE ScanSummary ADD COLUMN ScanIdentifier INT NOT NULL AFTER OrgID;
UPDATE ScanSummary S SET S.ScanIdentifier = S.SourceKey WHERE S.SourceKey NOT LIKE 'scan%';
UPDA... |
library Retrieve
using FHIR version '4.0.0'
define InInitialPopulation:
true
|
ALTER TABLE ONLY "public"."VideoRenderJob" ALTER COLUMN "jobStatusName" SET DEFAULT ''IN_PROGRESS'::text';
|
<gh_stars>0
-- Generated by Craft v2.3.2627 on Jan 30, 2015 1:14:46 AM.
--
-- Disable foreign key checks and autocommit.
--
SET FOREIGN_KEY_CHECKS = 0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
SET NAMES utf8;
DROP TABLE IF EXISTS `craft_assetfiles`;
--
-- Schema for table `craft_assetfiles`
--
... |
<filename>sql/softwareengineering.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 10, 2018 at 08:57 AM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACT... |
<reponame>spritedreams/Postgresql-Basics<filename>Queries/find_functions.sql<gh_stars>0
--list our custom functions and views
SELECT n.nspname as "Schema",
p.proname as "Name",
pg_catalog.pg_get_function_result(p.oid) as "Result data type",
pg_catalog.pg_get_function_arguments(p.oid) as "Argument data t... |
<reponame>karpikpl/DbEx
CREATE TABLE [Test].[Gender] (
[GenderId] INT NOT NULL IDENTITY(1, 1) PRIMARY KEY,
[Code] NVARCHAR (50) NOT NULL UNIQUE,
[Text] VARCHAR (256) NOT NULL
) |
-- MySQL dump 10.13 Distrib 8.0.25, for Win64 (x86_64)
--
-- Host: localhost Database: itsupportmanualguide
-- ------------------------------------------------------
-- Server version 8.0.25
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RE... |
<gh_stars>0
CREATE TABLE AirAndRadiationAuthority
(
AirAndRadiationAuthorityId int NOT NULL,
PrcId int NOT NULL,
BudgetLevel nvarchar(255) NULL,
RPIO nvarchar(255) NULL,
BFY nvarchar(255) NULL,
FundCode nvarchar(255) NULL,
AhCode nvarchar(255) NULL,
OrgCode nvarchar(255) NULL,
AccountCode nvarchar(255) NULL,
... |
<reponame>conansix/web-auth
SET UNIQUE_CHECKS = 0;
DELETE FROM auth_user;
DELETE FROM auth_group;
DELETE FROM auth_authority;
DELETE FROM auth_resource;
DELETE FROM auth_user_group;
DELETE FROM auth_group_authority;
DELETE FROM auth_authority_resource;
INSERT INTO auth.auth_user (user_id, username, password, enabled)... |
alter table SMARDES_TODOLISTINSTANCE_CONTEXT
drop constraint FK_TODOLIST_CONTEXT_INSTANCE;
alter table SMARDES_TODOLISTSTEP
drop constraint FK_TODOLIST_STEP_INSTANCE;
drop table SMARDES_LASTEND if exists;
drop table SMARDES_RESOURCE if exists;
drop table SMARDES_TODOLISTINSTANCE... |
<filename>schema/v7.sql<gh_stars>1-10
SET DATABASE TO Goliath;
ALTER TABLE IF EXISTS Feed ADD COLUMN link STRING;
UPDATE Feed SET link = url; |
/*
Navicat Premium Data Transfer
Source Server : ztgz.amsure.cn
Source Server Type : MySQL
Source Server Version : 50732
Source Host : ztgz.amsure.cn:33060
Source Schema : campus_organization
Target Server Type : MySQL
Target Server Version : 50732
File Encoding : 6500... |
CREATE TABLE IF NOT EXISTS `items` (
`object_id` int(11) NOT NULL,
`owner_id` int(11) NOT NULL,
`item_id` int(7) NOT NULL,
`count` bigint(20) NOT NULL,
`enchant_level` int(11) NOT NULL,
`loc` varchar(32) NOT NULL,
`loc_data` int(11) NOT NULL,
`life_time` int(11) NOT NULL,
`augmentation_id` int(11) N... |
/******************************************************************************
* This script should run against 'SitecoreCommerce9_SharedEnvironments' to
* populate the [dbo].[Mappings] table after upgrading the schema from
* Sitecore XC 9.0.3 to 9.1.0.
*****************************************************************... |
CREATE TABLE subdivision_GM (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_GM" ("id", "name", "level") VALUES ('GM-B', 'Banjul', 'city');
INSERT INTO "subdivision_GM" ("id", "name", "level") VALUES ('GM-L', 'Lower River Division', 'division');
INSERT ... |
<gh_stars>10-100
SELECT "YaleLanguages_2"."Patron Group" AS "Patron Group" FROM "YaleLanguages_2" GROUP BY "YaleLanguages_2"."Patron Group" ORDER BY "Patron Group" ASC ;
|
<filename>src/test/resources/sql/create_view/aa068938.sql<gh_stars>10-100
-- file:subselect.sql ln:200 expect:false
CREATE VIEW orders_view AS
SELECT *,
(SELECT CASE
WHEN ord.approver_ref=1 THEN ' END) AS "Approved",
(SELECT CASE
WHEN ord.ordercanceled
THEN 'Canceled'
ELSE
(SELECT CASE
WHEN ord.po_ref=1
THE... |
CREATE PARTITION SCHEME [PS_RunningQueries]
AS PARTITION [PF_RunningQueries]
ALL TO ([PRIMARY]) |
<filename>Builder/Database/QuestifyDatabaseSchema/dbo/Tables/CustomBankPropertyValue.sql
CREATE TABLE [dbo].[CustomBankPropertyValue] (
[resourceId] UNIQUEIDENTIFIER NOT NULL,
[customBankPropertyId] UNIQUEIDENTIFIER NOT NULL,
[displayValue] NVARCHAR(255) NULL,
CONSTRAINT [PK_CustomBankProper... |
-- 22.11.2016 15:59
-- URL zum Konzept
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsReport,IsServerProcess,IsUseBPartnerLanguage,LockWaitTim... |
/*
* The Flyway tool applies this migration to create the database.
*
* Follow this style guide https://about.gitlab.com/handbook/business-ops/data-team/platform/sql-style-guide/
*
* Copy a version of this comment into the next migration
*/
/*
* Adds new columns to the lookup_table_version table.
*
* 1) 'tabl... |
create table marcas (
id_marca int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
descripcion varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
create table colores (
id_color int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
descripcion varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET... |
<filename>sql/02_10_2021.sql
-- 177. Nth Highest Salary [Medium]
-- https://leetcode.com/problems/nth-highest-salary/
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
RETURN (
# Write your MySQL query statement below.
select Salary
from (
select Salary
,dens... |
-- 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 [AssessmentFamilyCont... |
<filename>test/sql/updates/post.repair.sql
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
\c single
-- Re-add the dropped foreign key constraint that was dropped for
-- repair testing... |
SELECT *
FROM wnprc_compliance.personsList persons
WHERE persons.isArchived IS FALSE |
<reponame>Maks-Drzezdzon/Working-With-Data-L-O
drop table bank;
CREATE TABLE BANK
(
age NUMBER,
job_type VARCHAR(255),
marital VARCHAR(255),
education VARCHAR(255),
credit_default VARCHAR(255),
balance NUMBER,
housing VARCHAR(255),
loan VARCHAR(255),
contact VARCHAR(255),
cday V... |
CREATE SCHEMA IF NOT EXISTS trust;
CREATE EXTENSION IF NOT EXISTS citext;
CREATE DOMAIN trust.email AS citext CHECK ( value ~ '^[a-zA-Z0-9.!#$%&''*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$' );
CREATE DOMAIN trust.phone_number AS citext CHECK (va... |
<filename>backend/api/migrations/20210726220456_user-image-library-default-uploaded-at.sql
alter table user_image_library
alter column created_at set default now();
|
<reponame>psbarros/IcompSGEI
--
-- INSTRUÇÕES ABAIXO. IMPORTAR NA TABELA J17_USER DO BANCO.
--
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 29-Nov-2016 às 15:33
-- Versão do servidor: 5.5.53-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.20
/*SET SQ... |
CREATE TABLE IF NOT EXISTS POSTS(
post_id int(20) PRIMARY KEY,
post_url varchar(200) NOT NULL,
post_date date,
);
CREATE TABLE IF NOT EXISTS CONDITIONS(
cond_id integer PRIMARY KEY,
cond_name text NOT NULL,
cond_image text,
cond_desc varchar(200),
cond_unique text
);
CREATE TABLE IF N... |
<reponame>frzhen/hibernate-dao<gh_stars>0
drop table if exists book cascade;
drop table if exists author;
create table book
(
id bigint not null auto_increment primary key,
isbn varchar(255),
publisher varchar(255),
title varchar(255),
author_id BIGINT
) engine = InnoDB;
create tab... |
<reponame>neilfr/potassium-tracker
INSERT INTO `foodnames` (`FoodID`, `FoodCode`, `FoodGroupID`, `FoodDescription`)
VALUES
(2,2,22,'Cheese souffle'),
(4,4,22,'Chop suey, with meat, canned'),
(5,5,22,'Chinese dish, chow mein, chicken'),
(6,6,18,'Corn fritter'),
(7,7,22,'Beef pot roast, with browned potatoes, peas a... |
/*
* <NAME>
* \i 'C:/Users/Joey/Documents/Database/Hw2/HW2.sql';
*/
-- #2 create countries table
CREATE TABLE Countries (
name VARCHAR(20) PRIMARY KEY,
latitude VARCHAR(8),
longitude VARCHAR(8),
area INT,
population INT,
gdp_billion REAL,
gdpYear INT
);
--4a create borders table
CREATE TABLE... |
<reponame>taligsikdako/LoginSystem
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 06, 2019 at 08:29 AM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 5.6.36
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET tim... |
<filename>users.sql
drop database dav_nest;
create database dav_nest;
use dav_nest;
CREATE TABLE users (
id INT auto_increment PRIMARY KEY,
username VARCHAR(50) NOT NULL,
created_at TIMESTAMP default NOW(),
updated_at TIMESTAMP default NOW() ON UPDATE NOW()
);
CREATE TABLE photos (
id INT auto_inc... |
<reponame>jjainga/Employee-management-system
DROP DATABASE IF EXISTS employees_db;
CREATE DATABASE employees_db;
USE employees_db;
-- Create Table for departments --
CREATE TABLE department(
department_id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(30)
);
-- Create table for roles --
CREATE TABLE roles... |
<reponame>navikt/familie-ba-sak<filename>src/main/resources/db/migration/V57__bostedsadresse.sql<gh_stars>1-10
CREATE TABLE PO_BOSTEDSADRESSE
(
id bigint primary key,
type varchar(20) NOT NULL,
bostedskommune varc... |
set nocount on;
GO
if not exists(select * from DETAILVIEWS_FIELDS where DETAIL_NAME = 'ACLRoles.DetailView' and DELETED = 0) begin -- then
print 'DETAILVIEWS_FIELDS ACLRoles.DetailView';
exec dbo.spDETAILVIEWS_InsertOnly 'ACLRoles.DetailView', 'ACLRoles', 'vwACL_ROLES_Edit', '15%', '35%', null;
exec ... |
alter table code_class add column `access` mediumtext;
|
ALTER TABLE [dbo].[ProductType]
ADD CONSTRAINT [CHK_ProductType_NoEmptyStrings] CHECK ([ProductTypeName]<>'' AND [Description]<>'');
|
CREATE TABLE k_microsites
(
gu_microsite CHAR(32) NOT NULL ,
dt_created DATETIME DEFAULT CURRENT_TIMESTAMP,
tp_microsite SMALLINT DEFAULT 1,
nm_microsite VARCHAR(128) NOT NULL ,
path_metadata VARCHAR(254) NOT NULL ,
id_app INTEGER NULL ,
gu_workarea CHAR(32) NU... |
<gh_stars>0
# access_type_classifier schema
# --- !Ups
DROP TABLE IF EXISTS user_credentials CASCADE;
CREATE TABLE user_credentials (
id serial not null primary key,
external_id character varying(255) NOT NULL,
system character varying(50) NOT NULL,
user_id integer NOT NULL,
foreign key (user... |
<filename>exploring-open-data-with-bigquery/queries-standardsql.sql
-- Copyright 2017, Google, Inc.
-- 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/lice... |
INSERT IGNORE INTO answers
(
`post_id`,
`user_id`,
`lastopt`,
`createdate`,
`date_modified`
)
SELECT
polldetails.post_id,
polldetails.user_id,
polldetails.opt,
polldetails.insertdate,
polldetails.date_modified
FROM
polldetails; |
-- Created by <NAME>
-- Last modification date: 2021-05-08 18:55:03.182
-- tables
-- Table: tie_breaker
DROP TABLE IF EXISTS `tie_breaker`;
CREATE TABLE tie_breaker (
match_id integer NOT NULL,
set_number integer NOT NULL,
first_registration_tie_breaker integer NOT NULL,
sec_registration_tie_breaker inte... |
<reponame>timt-unity3d/endly
DROP TABLE IF EXISTS dummy_type;
CREATE TABLE dummy_type (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) DEFAULT NULL,
modified TIMESTAMP DEFAULT current_timestamp,
UNIQUE(name)
);
DROP TABLE IF EXISTS dummy;
CREATE TABLE dummy (
id INT AUTO_INCREME... |
-- https://stackoverflow.com/questions/53416531/clickhouse-moving-average
DROP TABLE IF EXISTS bm;
CREATE TABLE bm (amount float, business_dttm DateTime) engine Log;
INSERT INTO bm VALUES (0.3,'2018-11-19 13:00:00'), (0.3,'2018-11-19 13:05:00'), (0.4,'2018-11-19 13:10:00'), (0.5,'2018-11-19 13:15:00'), (0.6,'2018-11... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.