sql stringlengths 6 1.05M |
|---|
--
---- test partition for (null)
--
-- 1. test ordinary
-- 1.1 range partitioned table
-- 1.2 interval partitioned table
-- 2. test data column of partition key value
-- 2.1 text
-- 2.2 timestamp
-- 3. MAXVALUE
-- 3.1 MAXVALUE is first column
-- 3.2 MAXVALUE is second column
CREATE schema FVT_C... |
<reponame>charanhu1/DLithe_DotnetFSD_JanFeb2022-1<filename>Charana_H_U/Back_End/SQL/TASK_2_DLithe_BC_NFS_T_Task34_SQLSERVER/SQLQuery4.sql
--STORED PROCEDURE
--INSIDE PROGRAMABILITY FOLDER
use DLithe;
--STORED PREOCEDURE
CREATE PROCEDURE PROC_DT2
AS
BEGIN
SELECT * FROM DLITHE_TRAINEES WHERE TID<100;
END
INSERT INTO D... |
CREATE TABLE [dbo].[sqlwatch_logger_dm_exec_requests_stats]
(
[type] bit not null, -- 1 user, 0 system
snapshot_time datetime2(0) not null,
snapshot_type_id tinyint not null,
sql_instance varchar(32) not null,
background real not null,
running real not null,
runnable real not null,
sleeping real not null,
sus... |
<reponame>programayaprende/LiteMES
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MariaDB
Source Server Version : 100414
Source Host : localhost:3306
Source Schema : litemes
Target Server Type : MariaDB
Target Server Version : 100414
File Encod... |
REM INSERTING into SYS.CLI_INST$
SET DEFINE OFF;
|
<reponame>BytelogicTech/paymentportal<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 09, 2022 at 10:15 AM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 8.1.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = ... |
DO $$
BEGIN
BEGIN
UPDATE cd_profiles SET private = true WHERE private IS NULL;
END;
BEGIN
ALTER TABLE cd_profiles ALTER COLUMN private SET NOT NULL;
END;
END;
$$
|
<reponame>ivanvalmorbida/Soteriasoft
-- --------------------------------------------------------
--
-- Estrutura da tabela `tb_atividade_economica_setor`
--
CREATE TABLE `tb_atividade_economica_setor` (
`codigo` int(11) NOT NULL,
`setor` varchar(15) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Extra... |
-- all auto brand year info is from wikipedia.com
INSERT Makes (Name, YearStarted, YearEnded) VALUES
('<NAME> ', 1913, null),
('Acura ', 1986, null),
('<NAME> ', 1970, null),
('<NAME> ', 1910, null),
('Audi ', 1989, null),
('Bentley ', 1919, null),
('BMW ', 1916, null),
('Bugatti ', 1909, null),
('Buick ', 1899, null... |
-- randexpr1.test
--
-- db eval {SELECT +case when case when ~t1.b<=case when ~17*19 | 11*11*f between t1.c and b then t1.a when e in (t1.a,t1.e,e) then t1.c else 19 end-t1.c-17+a then (t1.d) when 13 not between 13 and 19 then c else c end=(f) or d<t1.f then -t1.f else t1.d end FROM t1 WHERE 19*++t1.e=coalesce((selec... |
<reponame>AwadYoo/hotelbook-JavaWeb<gh_stars>100-1000
-- 建立hotelbook数据库
CREATE SCHEMA `hotelbook` DEFAULT CHARACTER SET utf8 ;
-- 建立登录表
CREATE TABLE `hotelbook`.`login` (
`loginId` INT NOT NULL AUTO_INCREMENT COMMENT '登录内部标示,主键、自动增长。',
`loginName` VARCHAR(45) NOT NULL COMMENT '登录用户名,前台唯一性的标识。不能重复。',
`loginPwd... |
<reponame>ONRR/cloud-repo
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.6 (Debian 12.6-1.pgdg100+1)
-- Dumped by pg_dump version 12.6 (Debian 12.6-1.pgdg100+1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standar... |
<gh_stars>0
INSERT INTO customer (id,first_name,last_name,date_of_birth,email,phone)
VALUES
(1,'Kelsey','Price','Dec 31, 1969','<EMAIL>','(367) 871-6294'),
(2,'Roth','Saunders','Dec 31, 1969','<EMAIL>','(856) 576-8455'),
(3,'Ingrid','Olsen','Dec 31, 1969','<EMAIL>','(292) 619-9663'),
(4,'Donna','Sharp','Dec 31, 1969'... |
<filename>db/migrations/000001_create_blocks_table.down.sql
DROP TABLE IF EXISTS "blocks"; |
--------------------------------------------------------------------------
-- test PostgreSQL various array data types
--------------------------------------------------------------------------
.run ../common/postgresql_setup.sql
SET TIME ZONE '-04:00';
.debug resultset on
.debug preparedstatement on
CREATE TABLE NumT... |
/* Drop old columns of pubSubNode */
ALTER TABLE pubsubNode DROP COLUMN contacts;
ALTER TABLE pubsubNode DROP COLUMN rosterGroups;
ALTER TABLE pubsubNode DROP COLUMN replyRooms;
ALTER TABLE pubsubNode DROP COLUMN replyTo;
ALTER TABLE pubsubNode DROP COLUMN associationTrusted;
/* Add new pubsub tables */
CREATE TABLE ... |
alter table ACT_RU_TASK add column IS_COUNT_ENABLED_ smallint check(IS_COUNT_ENABLED_ in (1,0));
alter table ACT_RU_TASK add column VAR_COUNT_ integer;
alter table ACT_RU_TASK add column ID_LINK_COUNT_ integer;
update ACT_GE_PROPERTY set VALUE_ = '6.0.0.5' where NAME_ = 'schema.version';
|
use demo;
create table ORDERS (
id MEDIUMINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
customer_id INT,
order_total_usd DECIMAL(11,2),
make VARCHAR(50),
model VARCHAR(50),
delivery_city VARCHAR(50),
delivery_company VARCHAR(50),
delivery_address VARCHAR(50),
CREATE_TS TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UPDATE_T... |
<reponame>taromaru04/sistemaPos
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 29-02-2020 a las 19:45:55
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSAC... |
-- MySQL dump 10.13 Distrib 5.5.52, for debian-linux-gnu (x86_64)
--
-- Host: 127.0.0.1 Database: cms-core
-- ------------------------------------------------------
-- Server version 5.5.52-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@... |
CREATE TABLE events
(
aggregate_type text NOT NULL,
aggregate_id text NOT NULL,
sequence bigint CHECK (sequence >= 0) NOT NULL,
payload jsonb NOT NULL,
metadata jsonb NOT NULL,
time... |
<reponame>kev93/xceed-test
INSERT INTO xceed.player_registration (team_registration_id, player_id, created_at, updated_at) VALUES (1, 1, '2017-04-27 18:22:22', '2017-04-27 18:22:22');
INSERT INTO xceed.player_registration (team_registration_id, player_id, created_at, updated_at) VALUES (5, 1, '2017-04-27 18:22:22', '20... |
CREATE USER ozon_root WITH password '<PASSWORD>';
DROP DATABASE IF EXISTS ozon_auth_db;
CREATE DATABASE ozon_auth_db
WITH OWNER ozon_root
ENCODING 'utf8';
GRANT ALL PRIVILEGES ON database ozon_auth_db TO ozon_root;
\connect ozon_auth_db;
DROP TABLE IF EXISTS auth_users CASCADE;
CREATE TABLE auth_users (
... |
<reponame>marcelojoras/Gestao-Salas
SELECT e.first_name, e.last_name, dp.dept_name, max(de.to_date - de.from_date) as dias_trabalhados
FROM employees e
INNER JOIN dept_emp de ON e.emp_no = de.emp_no
INNER JOIN departments dp ON de.dept_no = dp.dept_no
LIMIT 10; |
<reponame>drobbe/angelEmail<filename>prisma/migrations/20220217194218_test/migration.sql
/*
Warnings:
- Added the required column `base64Image` to the `Template` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `template` ADD COLUMN `base64Image` VARCHAR(... |
<reponame>arshadShahoriar/APWT-laravel-sec--A<filename>shopmanagement.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 19, 2020 at 10:59 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRAN... |
<reponame>hashito/docker
create database jaywalking;
use jaywalking
create table users (id int not null auto_increment,name varchar(10),primary key (id));
insert into users(name)values("test1");
insert into users(name)values("test2");
insert into users(name)values("test3");
insert into users(name)values("test4");
inse... |
<reponame>z3ugma/mimic-ccda
INSERT INTO fhir.patients
(
ID,
BIRTHDATE,
DEATHDATE,
SSN,
DRIVERS,
PASSPORT,
PREFIX,
FIRST,
LAST,
SUFFIX,
MAIDEN,
MARITAL,
RACE,
ETHNICITY,
GENDER,
BIRTHPLACE,
ADDRESS,
CITY,
STATE,
ZIP
)
WITH
patients AS (
... |
-- Add down migration script here
DROP TABLE IF EXISTS public.users; |
<reponame>Shuttl-Tech/antlr_psql
-- file:join.sql ln:36 expect:true
INSERT INTO J2_TBL VALUES (0, NULL)
|
<reponame>darmie/pgsql-parser
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT SELECT ON TABLES TO your_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT ALL ON TABLES TO your_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema_name GRANT ALL ON SEQUENCES TO your_user;
ALTER DEFAULT PRIVILEGES IN SCHEMA schema... |
<filename>LeetCode/others/615_Average_Salary_Departments_VS_Company.sql
WITH full_table AS
(SELECT
s.*
,e.department_id
FROM salary AS s
JOIN employee AS e
ON s.employee_id = e.employee_id)
,department_monthly AS
(SELECT
department_id
,pay_date
,AVG(amount) AS dept_avg
FROM full_table
GROUP BY department... |
SELECT 'a';
|
<filename>src/MailCheck.Dkim.Migration/Scripts/2018-12-13-1628-update-dkim-history-table.sql
ALTER TABLE `dkim_entity_history`
RENAME TO `dkim_entity_history_old` ;
CREATE TABLE `dkim_entity_history` (
`id` varchar(255) NOT NULL,
`state` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1; |
CREATE TABLE `standing` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`uuid` varchar(36) COLLATE utf8_unicode_ci DEFAULT NULL,
`group_id` int(11) DEFAULT NULL,
`team_id` int(11) DEFAULT NULL,
`games` int(11) DEFAULT NULL,
`wins` int(11) DEFAULT NULL,
`draws` int(11) DEFAULT NULL,
`loses` int(11) DEFAULT NULL,... |
ALTER TABLE posts ALTER COLUMN inserted_date SET NOT NULL |
<reponame>digital-guard/preserv
-- INGEST STEP1
-- Inicialização do Módulo Ingest dos prjetos Digital-Guard.
--
CREATE EXTENSION IF NOT EXISTS postgis;
CREATE EXTENSION IF NOT EXISTS adminpack;
CREATE EXTENSION IF NOT EXISTS file_fdw;
CREATE SERVER IF NOT EXISTS files FOREIGN DATA WRAPPER file_fdw;
-- old CREATE ... |
create temp table prev as
select distinct user_id
from
gha_pull_requests
where
created_at >= date '{{from}}' - '3 months'::interval
and created_at < '{{from}}'
;
create temp table prev_cnt as
select user_id, count(distinct id) as cnt
from
gha_pull_requests
where
created_at < '{{from}}'
group by
user_id
;
... |
{{
config(
sort='inferred_user_id',
dist='inferred_user_id',
unique_key='inferred_user_id'
)
}}
{% set timezone = var('snowplow:timezone', 'UTC') %}
with initiate_checkout as (
select * from {{ var('snowplow:initiate_checkout') }}
),
event_to_user_map as (
select * from {{ ... |
-------------------------------------------------------------------------------
-- sendsms config
-------------------------------------------------------------------------------
CREATE TABLE SENDSMS_CONFIG(
ID BIGINT,
NAME VARCHAR(50),
HOST VARCHAR(200),
USERNAME VARCHAR(200),
PASSWORD V... |
-- This script represents the latest schema.
create table currency (
currency_id smallint auto_increment not null,
currency_name varchar(50),
rounding_amount decimal(6,3),
currency_code varchar(3),
primary key(currency_id)
)
engine=innodb character set utf8;
create table lookup_entity (
entity_id smallint... |
-- 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 hold_mode head HOLD_MODE for a10
col req_mode head REQ_MODE for a10
col object_owner head OBJECT_OWNER for a15
col namespace for a20 word_wrap... |
CREATE INDEX IF NOT EXISTS idx_posts_root_id ON posts(rootid);
DROP INDEX IF EXISTS idx_posts_root_id_delete_at;
ALTER TABLE posts ADD COLUMN IF NOT EXISTS parentid varchar(26);
ALTER TABLE posts ALTER COLUMN props TYPE varchar(8000);
ALTER TABLE posts ALTER COLUMN fileids TYPE varchar(300);
|
CREATE TABLE BPM_TASK_DEF(
ID BIGINT NOT NULL,
TASK_DEFINITION_KEY VARCHAR(200),
ASSIGNEE VARCHAR(200),
CANDIDATE VARCHAR(200),
PROCESS_ID BIGINT,
CONSTRAINT PK_BPM_TASK_DEF PRIMARY KEY(ID),
CONSTRAINT FK_BPM_TASK_DEF_ID FOREIGN KEY(PROCESS_ID) REFERENCES BPM_PROCESS(ID)
) ENGINE=INNODB C... |
<filename>mojaloop-technical-overview/central-ledger/assets/database/central-ledger-ddl-MySQLWorkbench.sql
-- MySQL dump 10.13 Distrib 8.0.18, for macos10.14 (x86_64)
--
-- Host: localhost Database: central_ledger
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_... |
<reponame>devnw/aegis
/*
RETURN QueryData SINGLE
Length INT NOT
*/
DROP PROCEDURE IF EXISTS `GetJobConfigLength`;
CREATE PROCEDURE `GetJobConfigLength` (_configID VARCHAR(36), _jobID INT, _dataInSourceConfigID VARCHAR(36), _dataOutSourceConfigID VARCHAR(36),
... |
<gh_stars>10-100
-- test add and drop columns
USE `common_1`;
CREATE TABLE `add_and_drop_columns`
(
`id` int(11) NOT NULL PRIMARY KEY
);
insert into `add_and_drop_columns` (id)
values (1);
alter table `add_and_drop_columns`
add col1 int null,
add col2 int null,
add col3 int null;
insert into `add_an... |
-- Add repository groups
with repo_latest as (
select sub.repo_id,
sub.repo_name
from (
select repo_id,
dup_repo_name as repo_name,
row_number() over (partition by repo_id order by created_at desc, id desc) as row_num
from
gha_events
) sub
where
sub.row_num = 1
)
update
gha_r... |
DROP VIEW IF EXISTS view_aset_tetap_usul_hapus_l2_awayan;
CREATE VIEW view_aset_tetap_usul_hapus_l2_awayan AS
SELECT
*
FROM
view_aset_tetap_usul_hapus_l2
WHERE
1 = 1 AND
id_skpd = 34;
GRANT ALL PRIVILEGES ON view_aset_tetap_usul_hapus_l2_awayan TO lap_awayan;
REVOKE INSERT, UPDATE, DELETE ON view_aset_tetap_usul_... |
autocommit off;
insert into joe.kitsch_v (atom_c, attr_1, attr_6, set_attr_1, set_attr_6)
values ('12345', '10', 10, {'10'}, {10});
rollback work;
rollback;
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 07, 2021 at 09:50 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
drop index ZSTG_RNASETS_GENECHIP_A;
drop index ZSTG_RNASETS_SPECIES_SC;
drop index ZSTG_RNASETS_SEQUENCE_T;
drop index ZSTG_RNASETS_SEQUENCE_S;
drop index ZSTG_... |
create class test_class (date_col date, time_col time, timestamp_col timestamp, datetime_col datetimetz, datetime_col1 datetimetz);
insert into test_class values (DATE '01/01/1901', TIME '09:00:00', TIMESTAMP '01/01/1901 00:00:00', datetimetz '1970-01-01 00:00:00.000', datetimetz '1970-01-01 00:00:00.999');
insert int... |
--
-- The contents of this file are subject to the license and copyright
-- detailed in the LICENSE and NOTICE files at the root of the source
-- tree and available online at
--
-- http://www.dspace.org/license/
--
-- ===============================================================
-- WARNING WARNING WARNING WARNING WA... |
<filename>conf/evolutions/default/3.sql
-- Tokens
-- !Ups
create table token
(
token_value varchar(200) not null,
issued timestamp with time zone not null,
valid_until timestamp with time zone not null,
user_id int not null,
constraint pk_token primary key (token_value)
);
alter table to... |
CREATE TABLE Product (
name varchar(50) PRIMARY KEY,
description varchar(50) NOT NULL,
price integer NOT NULL,
username varchar(50) NOT NULL
);
CREATE TABLE User (
user_name varchar(50) NOT NULL,
login varchar(50) PRIMARY KEY,
password varchar(50) NOT NULL
);
CREATE TABLE Rati... |
<filename>migrations/default/1646425161821_alter_table_public_issues_drop_column_board_id/up.sql<gh_stars>0
alter table "public"."issues" drop column "board_id" cascade;
|
\ir to_ts.sql
\ir log.sql
\ir logger.sql
\ir acq.sql
|
CREATE TABLE `tags` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(200) NOT NULL,
`description` TEXT,
`parent_id` INT,
PRIMARY KEY (`id`),
UNIQUE KEY `tags_name_uc` (`name`)
);
|
<filename>infrastructure/repositories/database/postgres/migrations/2018-02-23-1_create_users_table.down.sql
DROP TABLE "users"; |
<filename>egov/egov-commons/src/main/resources/db/migration/main/V20170103185251__commons_educational_qualification_DML.sql
delete from eg_feature_role where feature in(select id from eg_feature where name in('Create Council Qualification','Update Council Qualification','View Council Qualification'));
delete from eg_... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 19, 2020 at 12:43 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<reponame>tsunchung/er-diagram-generator
CREATE TABLE Country
(
Name VARCHAR(35) NOT NULL UNIQUE,
Code VARCHAR(4) CONSTRAINT CountryKey PRIMARY KEY,
Capital VARCHAR(35),
Province VARCHAR(35),
Area NUMERIC CONSTRAINT CountryArea CHECK (Area >= 0),
Population NUMERIC CONSTRAINT CountryPop CHECK (Population >= 0)
... |
SELECT s.Name,
s.Manufacturer
FROM Spaceships s
LEFT JOIN Journeys j ON s.Id=j.SpaceshipId
LEFT JOIN TravelCards tc ON j.Id=tc.JourneyId
LEFT JOIN Colonists c ON c.Id=tc.ColonistId
WHERE DATEDIFF(YEAR,c.BirthDate,'01/01/2019')<30 AND tc.JobDuringJourney='Pilot'
ORDER BY s.Name
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.11 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL Version: 10.3.0.5771
-- --------------------------------------------------------
/... |
<filename>extension/tpcds/dsdgen/queries/46.sql
SELECT c_last_name,
c_first_name,
ca_city,
bought_city,
ss_ticket_number,
amt,
profit
FROM
(SELECT ss_ticket_number,
ss_customer_sk,
ca_city bought_city,
sum(ss_coupon_amt) amt,
sum(ss_ne... |
<filename>airbyte-integrations/bases/base-normalization/integration_tests/normalization_test_output/mysql/test_nested_streams/second_output/airbyte_ctes/test_normalization/nested_stream_with_co_3double_array_data_ab3.sql
create view _airbyte_test_normalization.`nested_stream_with_co_3double_array_data_ab3__dbt_tmp` ... |
<gh_stars>1-10
DO
$$
BEGIN
IF NOT EXISTS(
SELECT
FROM pg_user
WHERE usename = 'cool_user')
THEN
CREATE USER cool_user
WITH PASSWORD '<PASSWORD>';
END IF;
CREATE SCHEMA IF NOT EXISTS cool_schema;
ALTER SCHEMA cool_schema
OWNER TO cool_user;
GRANT ALL PRIVILEGES ON SCHEMA cool_sche... |
-- randexpr1.test
--
-- db eval {SELECT case (select ( - - -(+max(c))+min(e)-(count(*))+cast(avg(t1.e) AS integer)-min(t1.a)*(cast(avg(11) AS integer))) from t1) when t1.d then t1.c else case (select max(a) from t1) when -t1.b then case when not 17<>case when t1.e<=t1.d or ((t1.e))=t1.e then t1.f when e>=t1.b then 11... |
GO
USE [SoftUni]
GO
INSERT INTO [Towns]
VALUES (
'Sofia'
) , (
'Plovdiv'
) , (
'Varna'
) , (
'Burgas'
)
GO
INSERT INTO [Departments]
VALUES (
'Engineering'
) , (
'Sales'
) , (
'Marketing'
) , (
'Software Development'
) , (
'Quality Assurance'
)
GO
INSERT INTO [Employees]
VALUES (
... |
<filename>src/main/sql/coding.sql
-- username=coding, password=<PASSWORD>
-- mysql is used
CREATE DATABASE if NOT EXISTS `coding` DEFAULT CHARACTER SET = utf8mb4;
CREATE TABLE `bid` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`source_id` varchar(255),
`source` varchar(255),
`bid` decimal(8,5),
`updated_at` t... |
<filename>application/weixin/install.sql<gh_stars>0
CREATE TABLE IF NOT EXISTS `wp_custom_menu` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`pid` int(10) NULL COMMENT '一级菜单',
`title` varchar(50) NOT NULL COMMENT '菜单名',
`from_type` char(50) NULL COMMENT '菜单内容',
`type` varchar(30) NULL COMM... |
<filename>snprc_ehr/resources/queries/study/CulturePivot.sql<gh_stars>1-10
/*
* Copyright (c) 2019 LabKey Corporation
*
* 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... |
<reponame>TheMolkaPL/odengymnasiet.se<filename>src/main/resources/schema.sql
CREATE TABLE IF NOT EXISTS `articles` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`object_id` char(24) NOT NULL,
`updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`title` varchar(32) NOT NULL,
`path` ... |
CREATE OR REPLACE TRIGGER "MEDIA_RELATIONS_CHK" before insert OR UPDATE ON media_relations
for each row
declare
numrows number := 0;
tabl VARCHAR2(38);
colName VARCHAR2(38);
BEGIN
-- makes sure that the string after the last space in media_relationship resolves to a valid table name
... |
<filename>mysql-db-script.sql<gh_stars>1-10
-- auto-generated definition
create table sys_export_conf
(
id varchar(32) not null
primary key,
column_conf_json varchar(1024) null comment '数据、列关系配置json',
bean_id varchar(64) null comment 'spring bean id',
method_name ... |
CREATE INDEX idx_first_name ON public.authors(first_name)
CREATE INDEX idx_last_name ON public.authors(last_name) |
<filename>components/config-mgmt-service/backend/postgres/schema/sql/05_policy_rev.up.sql
CREATE TABLE IF NOT EXISTS policy_rev (
id TEXT PRIMARY KEY,
policy_name TEXT NOT NULL
);
CREATE INDEX IF NOT EXISTS policy_rev_id ON policy_rev (id);
CREATE TABLE IF NOT E... |
<gh_stars>1000+
-- using the most lately added client as a foreign key
INSERT INTO hydra_oauth2_consent_request (challenge, verifier, client_id, subject, request_url, skip, requested_scope, csrf, authenticated_at, requested_at, oidc_context)
SELECT 'challenge-0001', 'verifier-0001', hydra_client.id, 'subject-0001', 'ht... |
<reponame>sridhargoudrangu/gpdb
-- @Description UAOCS MVCC readcommit and insert + vacuum
-- Transaction 2 of 2 (vacuum)
--
select pg_sleep(3);
insert into sto_uaocs_mvcc_status (workload, script) values('readcommit_concurr_ins_vacuum', 't2_insert_tuples');
select count(*) as only_visi_rows from sto_uaocs_mvcc_vac... |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字remote非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists remote;
create sequence remote start 100 cache 50;
drop sequence remote;
--关键字带双引号-成功
drop sequence if exists "remote";
create sequence "remote" start 100 cache 50;
drop sequence "remote";
--关键字带单引号-合理报错
... |
<reponame>phouthasak/BasketBallCheckinApp<filename>src/main/resources/db/migration/V6__CREATE_NON_PLAYER_CHECKIN_TABLE.sql
DROP TABLE IF EXISTS NON_PLAYER_CHECKIN;
CREATE TABLE NON_PLAYER_CHECKIN (
checkIn_id INT(10) auto_increment primary key,
event_id INT(10) not null,
sponsor_id INT(10) not null,
first_name VARCHAR(... |
Select p.*
From [UserProfile] p
Where p.[userName] = @0 |
-- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Jun 15, 2017 at 08:38 AM
-- Server version: 5.6.35-cll-lve
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
<filename>migrations/000001_init_schema.up.sql
CREATE SEQUENCE global_id_sequence CYCLE;
CREATE OR REPLACE FUNCTION id_generator(OUT result bigint) AS $$
DECLARE
our_epoch bigint := 1314220021721;
seq_id bigint;
now_millis bigint;
-- the id of this DB shard, must be set for each
-- schema shard you... |
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (1, 'Clarence', 'Ho');
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (2, 'Scott', 'Tiger');
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (3, 'John', 'Smith');
INSERT INTO Person (AddressId, Firstname, Lastname) VALUES (4, 'Peter', 'Ja... |
CREATE TABLE IF NOT EXISTS `TaskRecords` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`userId` int(11) NOT NULL,
`title` varchar(128) NOT NULL,
`skip` BOOLEAN,
`completed` BOOLEAN,
`createdAt` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_... |
SELECT s.FirstName,
s.LastName,
COUNT(st.TeacherId) AS [TeachersCount]
FROM Students AS s
JOIN StudentsTeachers AS st ON st.StudentId = s.Id
GROUP BY s.FirstName,
s.LastName |
-- file:tsearch.sql ln:171 expect:true
SELECT to_tsquery('english', '(a <-> 1) <-> 2')
|
---------------------
-- home_security --
---------------------
CREATE KEYSPACE home_security WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
USE home_security;
CREATE TABLE home (
home_id text PRIMARY KEY,
address text,
alt_phone text,
city text,
contact_name text,
... |
<filename>base-datos/db/VIEWS_SQL/con_dialogue_view.sql
CREATE VIEW con_dialogue AS
SELECT
d.file_id,
d.date,
c.macro,
region.iso as region_iso,
region.name as region_name,
region.numero as region_number,
comuna.name as comuna_name
FROM
comuna,
region,
person as p,
contribution as c,
person_contrib... |
select directories from `table_stats/spark_generated/.stats.drill`;
|
<reponame>serhat-dirik/location-service-fuse
DROP TABLE IF EXISTS locations;
CREATE TABLE locations (
id integer NOT NULL,
name varchar(255) NOT NULL,
lat varchar(30) NOT NULL,
lng varchar(30) NOT NULL,
location_type varchar(255) NOT NULL,
status varchar(1) NOT NULL
);
INSERT INTO locations (id,name,lat,... |
USE CommentBot
GO
DROP TABLE IF EXISTS dbo.Subreddits
GO
CREATE TABLE dbo.Subreddits (
Subreddit_ID NVARCHAR(128) PRIMARY KEY CLUSTERED NOT NULL,
Subreddit_Short_URL NVARCHAR(256) NOT NULL,
Subreddit_Full_URL AS CONCAT('https://www.reddit.com', Subreddit_Short_URL),
Last_Update_Us... |
<reponame>eluinstra/ebms-core
--
-- Copyright 2011 Clockwork
--
-- 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 requi... |
<filename>posda/posdatools/queries/sql/LastNPhiScans.sql
-- Name: LastNPhiScans
-- Schema: posda_phi_simple
-- Columns: ['id', 'start_time', 'end_time', 'duration', 'description', 'to_scan', 'scanned']
-- Args: ['n']
-- Tags: ['tag_usage', 'simple_phi', 'phi_status']
-- Description: Status of PHI scans
--
select
ph... |
<reponame>goldmansachs/obevo-kata
CREATE PROCEDURE SP480(OUT MYCOUNT INTEGER) SPECIFIC SP480_42153 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE90;SELECT COUNT(*)INTO MYCOUNT FROM TABLE62;SELECT COUNT(*)INTO MYCOUNT FROM TABLE445;... |
<filename>Master/Appleseed/WebSites/Appleseed/Setup/Scripts/1.4.0.1803.sql<gh_stars>10-100
if exists (select * from dbo.sysobjects where id = object_id(N'[rb_MoveModuleToNewTab]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [rb_MoveModuleToNewTab]
GO
if exists (select * from dbo.sysobjects where id = ob... |
<reponame>jiandiao/flowable-engine
update ACT_GE_PROPERTY set VALUE_ = '6.5.1.4' where NAME_ = 'entitylink.schema.version';
|
<reponame>pdv-ru/ClickHouse
drop table if exists t;
create table t (a Int, b Int) engine = MergeTree order by (a, b) settings index_granularity = 400;
insert into t select 0, 0 from numbers(50);
insert into t select 0, 1 from numbers(350);
insert into t select 1, 2 from numbers(400);
insert into t select 2, 2 from... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.