sql stringlengths 6 1.05M |
|---|
CREATE TABLE zitadel.projections.org_domains (
creation_date TIMESTAMPTZ,
change_date TIMESTAMPTZ,
sequence BIGINT,
domain TEXT,
org_id TEXT,
is_verified BOOLEAN,
is_primary BOOLEAN,
validation_type SMALLINT,
PRIMARY KEY (org_id, domain)
); |
//// CHANGE name=change0
CREATE MEMORY TABLE TABLE453(ID INTEGER NOT NULL PRIMARY KEY,FIELD1 VARCHAR(30),USERTYPE1FIELD USERTYPE1,USERTYPE6FIELD USERTYPE6)
GO
|
REVOKE SELECT ON [dbo].[table1] FROM [test_user]
GO |
<reponame>fdw1466/APIJSON-Demo
-- SQLINES DEMO *** Distrib 5.7.17, for macos10.12 (x86_64)
--
-- SQLINES DEMO *** Database: sys
-- SQLINES DEMO *** -------------------------------------
-- SQLINES DEMO *** 7.33-log
/* SQLINES DEMO *** ARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/* SQLINES DEMO *** ARACTER_SET_RE... |
-- start_ignore
CREATE EXTENSION IF NOT EXISTS gp_inject_fault;
-- end_ignore
DROP TABLE IF EXISTS public.spi64bittest;
-- use a sequence as primary key, so we can update the data later on
CREATE TABLE public.spi64bittest (id BIGSERIAL PRIMARY KEY, data BIGINT);
-- general test case first, user test case afterwards
... |
/* gpcontrib/gp_exttable_fdw/gp_exttable_fdw--1.0.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION gp_exttable_fdw" to load this file. \quit
CREATE FUNCTION gp_exttable_fdw_handler()
RETURNS fdw_handler
AS 'MODULE_PATHNAME'
LANGUAGE C STRICT;
CREATE FUNCTI... |
INSERT INTO persediaan (id_transaksi, id_barang, jumlah, harga) VALUES (829,29,10,7000);
INSERT INTO persediaan (id_transaksi, id_barang, jumlah, harga) VALUES (829,2936,15,22000);
INSERT INTO persediaan (id_transaksi, id_barang, jumlah, harga) VALUES (829,3257,4,6900);
INSERT INTO persediaan (id_transaksi, id_barang, ... |
<gh_stars>0
CREATE SCHEMA IF NOT EXISTS dawa_replication;
CREATE TABLE dawa_replication.transactions(
txid integer PRIMARY KEY,
ts timestamptz);
CREATE TABLE dawa_replication.source_transactions(
source_txid integer,
local_txid integer NOT NULL,
entity text NOT NULL,
type text NOT NULL,
PRIMARY KEY (sourc... |
-- postgres backend notes
-- all tables handled by the SQL, generated by PostgresQueryGenerator
-- have the following definition
create table if not exists mytable (data jsonb unique not null);
-- let's add some test data
insert into mytable values (
'{
"x": 0,
"y": 1,
"z": null,
... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Dec 31, 2019 at 03:45 AM
-- Server version: 5.7.23
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `ecommerceDB`
--
-- -----------------------... |
<filename>egov/egov-bpa/src/main/resources/db/migration/main/V20170403175010__bpa_fiedchanges.sql
INSERT INTO eg_module(id, name, enabled, contextroot, parentmodule, displayname, ordernumber)
VALUES (nextval('SEQ_EG_MODULE'), 'BPA', true, 'bpa', null, 'Building Plan Approval',(select max(ordernumber)+1
from eg_mod... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 22 Apr 2019 pada 08.29
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
<reponame>maxg/omnivore
INSERT INTO keys VALUES ('test.alpha');
INSERT INTO active_rules VALUES ('test.a*', t_plus('1 hour'));
SELECT active INTO STRICT result FROM keys WHERE key = 'test.alpha';
PERFORM assert(NOT result.active);
UPDATE active_rules SET after = t_minus('1 hour');
SELECT active INTO STRICT result F... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 03, 2020 at 06:56 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
/*
<<property_start>>Description
* extracts properties from sql_modules_definition
* properties can be added (normally in comments) following this syntax
** use one line to mark the starting point for parsing: `\<<property_start>>abcde` markes the property_name `abcde`
** use one line to mark the end point: `\<<pro... |
CREATE TABLE {provider_prefix}_la_cdr_all_with_ant_zone_by_uid_od_sum
(origin string,destination string,tcount double, tusercount double)
PARTITIONED BY (pdt string) ROW FORMAT DELIMITED FIELDS TERMINATED BY '\t'
COLLECTION ITEMS TERMINATED BY ',' MAP KEYS TERMINATED BY '!'
LINES TERMINATED BY '\n' STORED AS SEQUENCEFI... |
<gh_stars>10-100
-- @formatter:off
drop function if exists public.deps_restore_dependencies(
p_view_schema name,
p_view_name name,
p_options jsonb
);
drop function if exists public.deps_save_and_drop_dependencies(
p_view_schema name,
p_view_name name,
p_options jsonb
);
drop table if exists public.deps_sa... |
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/create_table/511ed817.sql
-- file:privileges.sql ln:558 expect:true
CREATE TABLE test10b (a int[], b testtype1[])
|
-- Для указания конкретного флага используйте DBCC TRACESTATUS(<НомерФлага>), например DBCC TRACESTATUS(1118)
DBCC TRACESTATUS() |
-- +goose NO TRANSACTION
-- +goose Up
DROP INDEX IF EXISTS owners_owner_name_idx;
-- +goose Down
CREATE UNIQUE INDEX CONCURRENTLY ON owners(owner_name); |
<filename>data_analysis.sql<gh_stars>0
--List the following details of each employee: employee number, last name, first name, sex, and salary.
SELECT Employees.emp_no, Employees.last_name, Employees.first_name, Employees.gender,
Salaries.salary
FROM Employees
INNER JOIN Salaries ON
Employees.emp_no = Salaries.emp_no;
... |
-- 19.04.2016 18:38
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,543074,0,'Event_UUID',TO_TIMESTAMP('2016-04-19 18:38:59','YYYY-MM-DD HH24:MI:SS'... |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SE... |
<filename>macros/get_ad_group_history_columns.sql
{% macro get_ad_group_history_columns() %}
{% set columns = [
{"name": "_fivetran_synced", "datatype": dbt_utils.type_timestamp()},
{"name": "automated_keywords_opt_in", "datatype": "boolean"},
{"name": "campaign_id", "datatype": dbt_utils.type_int()},
... |
<reponame>h4ck3rm1k3/S2RDF
SELECT tab0.v1 AS v1 , tab7.v0 AS v0 , tab6.v7 AS v7 , tab4.v5 AS v5 , tab5.v6 AS v6 , tab3.v4 AS v4 , tab2.v3 AS v3 , tab1.v2 AS v2
FROM (SELECT sub AS v0
FROM wsdbm__hasGenre$$8$$
WHERE obj = 'wsdbm:SubGenre74'
) tab7
JOIN (SELECT obj AS v1 , sub AS v0
FROM foaf__homepa... |
--- Output Tables
drop table SCHEMA_OUT;
create COLUMN table SCHEMA_OUT like "SAP_PA_APL"."sap.pa.apl.base::BASE.T.TABLE_TYPE";
drop table OP_LOG;
create COLUMN table OP_LOG like "SAP_PA_APL"."sap.pa.apl.base::BASE.T.OPERATION_LOG";
drop table APPLY_OUT;
drop table APPLY_LOG;
create column table APPLY_LOG like "SAP_... |
alter table crates rename to crates_old;
create table crates (
id integer primary key,
name varchar(255) not null unique,
canon_name varchar(255) not null unique, -- <- NEW FIELD
description varchar(4096),
created_at varchar(25) not null,
updated_at varchar(25) not null,
downloads bigint not... |
<gh_stars>1-10
USE DRM;
INSERT INTO Class (Name) VALUES ('Warrior');
INSERT INTO Class (Name) VALUES ('Mage');
INSERT INTO Class (Name) VALUES ('Druid');
INSERT INTO Class (Name) VALUES ('Death Knight');
INSERT INTO Class (Name) VALUES ('Paladin');
INSERT INTO Class (Name) VALUES ('Warlock');
INSERT INTO Class (Name) ... |
SELECT [Name] AS [Game],
CASE
WHEN DATEPART(HOUR,[Start]) BETWEEN 0 AND 11
THEN 'Morning'
WHEN DATEPART(HOUR,[Start]) BETWEEN 12 AND 17
THEN 'Afternoon'
WHEN DATEPART(HOUR,[Start]) BETWEEN 18 AND 23
THEN 'Evening'
END
AS [Part of the Day],
CASE
WHEN Duration <= 3
THEN 'Extra Short'
WHEN Duration BETWEEN 4 A... |
<reponame>phpfreak6/recibos<filename>queries.sql
/* DATE 17-06-2021 <EMAIL> */
ALTER TABLE `orders` ADD `tracking_number` VARCHAR(255) NULL DEFAULT NULL AFTER `client`;
ALTER TABLE `orders` ADD `tracking_number_date` DATE NULL DEFAULT NULL AFTER `tracking_number`;
/* DATE 18-06-2021 <EMAIL> */
CREATE TABLE `client_i... |
SELECT "MLB_66"."event" AS "event" FROM "MLB_66" GROUP BY 1 ORDER BY "event" ASC;
|
SELECT COUNT(*) AS Count
FROM Colonists AS c
JOIN TravelCards AS tc ON tc.ColonistId = c.Id
JOIN Journeys AS j ON j.Id = tc.JourneyId
WHERE j.Purpose = 'Technical' |
<gh_stars>0
alter table source_file add payload_cid varchar(100) not null default '';
alter table source_file modify file_size bigint;
alter table source_file modify create_at bigint;
alter table event_lock_payment add vrf_rand varchar(100) not null default '';
alter table block_scan_record modify update_at bigi... |
/*****************************************
Какие индексы текущей БД занимают память в буфере?
*******************************************/
select
(CAST (count(*) AS BIGINT) * 8) as cached_Kb,
obj.name as objectname,
ind.name as indexname,
obj.index_id as indexid,
bd.page_typ... |
DELIMITER ;;
CREATE OR REPLACE DEFINER=`queue`@`localhost` PROCEDURE set_sex_from_connection(IN _id INT(11) UNSIGNED, IN _user VARCHAR(50))
BEGIN
DECLARE msg VARCHAR(200);
SELECT s.isikukood1, k1.sugu, s.isikukood2, k2.sugu,
sl1.seoseliik, sl1.sugu, sl2.seoseliik, sl2.sugu,
sl1.sugu_1, s... |
<gh_stars>0
create table "EF_TEST"."CustomDashboards"
(
"DashboardID" number(10, 0) not null,
"Name" nvarchar2(200) null,
"DateCreated" date not null,
"CreatedBy" number(10, 0) not null,
"IsPublic" number(1, 0) not null,
constraint "PK_CustomDashboards" primary key ("DashboardID")
)
/
creat... |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1
Source Server Version : 50553
Source Host : localhost:3306
Source Database : gdan
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2018-09-06 10:09:38
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
DROP SCHEMA test_config8 CASCADE;
CREATE SCHEMA test_config8;
SET search_path TO test_config8;
CREATE TABLE documents (
name text,
document jsonb
);
CREATE OR REPLACE FUNCTION parse_reference(jref jsonb)
RETURNS text LANGUAGE sql AS $$
SELECT CAST (
(SELECT jref ->> '$ref')
AS text
... |
ALTER TABLE _selectedhierarchy
ADD COLUMN m_position VARCHAR(50) DEFAULT NULL AFTER position |
<filename>sql-files/upgrades/upgrade_svn15818_log.sql<gh_stars>0
-- Adds 'I' to `type` in `zenylog`
ALTER TABLE `zenylog` MODIFY `type` ENUM('M','T','V','S','N','A','E','B','I') NOT NULL DEFAULT 'S';
|
CREATE TABLE [dbo].[ChangeRequests] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Name] VARCHAR (200) NOT NULL,
[Description] VARCHAR (MAX) NULL,
[AffectedRole] VARCHAR (MAX) NULL,
[TimeToDevelop] VARCHAR (50) NOT NULL,
[RequestedBy] VARCHAR (100) NOT NULL,
[Requ... |
INSERT INTO WWS_COUNTRIES (ID, NAME, ISO3, ISO2, PHONECODE, CAPITAL, CURRENCY, CREATED_AT, UPDATED_AT, FLAG, WIKIDATAID) VALUES (143, 'Micronesia', 'FSM', 'FM', '691', 'Palikir', 'USD', TO_TIMESTAMP('2018-07-20 16:41:03','YYYY-MM-DD HH24:MI:SS'), TO_TIMESTAMP('2019-08-02 21:38:23','YYYY-MM-DD HH24:MI:SS'), 1, 'Q702');
... |
<gh_stars>1-10
CREATE TABLE MD_CHARTER_NAMES (
name_status_id NUMERIC,
status TEXT,
name_type_id NUMERIC,
name_description TEXT
); |
<filename>scaffold.sql
CREATE TABLE members (
members_id serial NOT NULL,
members_name varchar(255) NOT NULL,
members_descript varchar(255) NOT NULL,
last_message_id int NOT NULL
);
INSERT INTO members (members_id,members_name,members_descript,last_message_id) VALUES
(1,'<@U0V1ZHGJ3>','<NAME>, CODE 2040 Safety... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Nov 10, 2021 at 10:34 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>QuadmanSWE/sqlserver-pipeline-framework<gh_stars>1-10
----------------------------------------------------------------------
CREATE FUNCTION tSQLt.Private_GetLastTestNameIfNotProvided(@TestName NVARCHAR(MAX))
RETURNS NVARCHAR(MAX)
AS
BEGIN
IF(LTRIM(ISNULL(@TestName,'')) = '')
BEGIN
SELECT @TestName ... |
<gh_stars>100-1000
-- misc2.test
--
-- execsql {
-- CREATE TABLE t1229(x);
-- CREATE TRIGGER r1229 BEFORE INSERT ON t1229 BEGIN
-- INSERT INTO t1229 SELECT y FROM (SELECT new.x y);
-- END;
-- INSERT INTO t1229 VALUES(1);
-- }
CREATE TABLE t1229(x);
CREATE TRIGGER r1229 BEFORE INSERT ON ... |
CREATE TABLE history_items (
id INTEGER PRIMARY KEY AUTOINCREMENT,
url TEXT NOT NULL UNIQUE,
domain_expansion TEXT NULL,
visit_count INTEGER NOT NULL,
daily_visit_counts BLOB NOT NULL,
weekly_visit_counts BLOB NULL,
autocomplete_triggers BLOB NULL,
should_recompute_derived_visit_counts I... |
<gh_stars>0
CREATE TABLE restaurants (
id serial PRIMARY KEY,
name varchar,
cuisine_id int,
price varchar
);
CREATE TABLE cuisine (
cuisine_id serial PRIMARY KEY,
type varchar
);
|
<gh_stars>1-10
#############################
Expected output for 'h5stat -T h5stat_filters.h5'
#############################
Filename: h5stat_filters.h5
Dataset datatype information:
# of unique datatypes used by datasets: 2
Dataset datatype #0:
Count (total/named) = (14/0)
Size (desc./elmt) = (14/4)
Dataset dat... |
-- 13.07.2016 18:03
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Message (AD_Client_ID,AD_Message_ID,AD_Org_ID,Created,CreatedBy,EntityType,IsActive,MsgText,MsgType,Updated,UpdatedBy,Value) VALUES (0,543914,0,TO_TIMESTAMP('2016-07-13 18:03:33','YYYY-MM-DD HH24:MI:SS'),100,'D','Y','No... |
<filename>fixtures/postgres/init.sql
CREATE TABLE test (
created_at TIMESTAMP
);
INSERT INTO test (created_at) VALUES (NOW()); |
CREATE TABLE app_versions (
id text primary key,
account_id text,
created_at timestamptz DEFAULT current_timestamp,
updated_at timestamptz DEFAULT NULL,
name text DEFAULT NULL,
description text DEFAULT NULL,
chart_version_id text REFERENCES chart_versions(id) ON DELETE CASCADE,
application_id text REFE... |
<gh_stars>1-10
-- -----------------------------------------------------
-- Table app_user trigger
-- -----------------------------------------------------
CREATE OR REPLACE FUNCTION opm.app_user_func() RETURNS TRIGGER AS $$$$
BEGIN
IF (TG_OP = 'UPDATE') OR (TG_OP = 'INSERT') THEN
INSERT INTO opm.... |
<gh_stars>1-10
insert into sym_node (node_id,node_group_id,external_id,sync_enabled,sync_url,schema_version,symmetric_version,database_type,database_version,heartbeat_time,timezone_offset,batch_to_send_count,batch_in_error_count,created_at_node_id)
values ('003','store','003',1,null,null,null,null,null,current_timest... |
<gh_stars>1-10
-- Name: GetSliceRenderedCounts
-- Schema: posda_files
-- Columns: ['roi_num', 'num_slices']
-- Args: ['structure_set_file_id']
-- Tags: ['StructContourToSlice']
-- Description: Get count of rendered slices for an roi in a structure set
--
select
distinct roi_num, count(distinct image_file_id) as nu... |
<filename>dbicdh/SQLite/upgrade/70-71/001-auto.sql
-- Convert schema '/home/marco/amw/AmuseWikiFarm/dbicdh/_source/deploy/70/001-auto.yml' to '/home/marco/amw/AmuseWikiFarm/dbicdh/_source/deploy/71/001-auto.yml':;
;
BEGIN;
;
CREATE TABLE "mirror_info" (
"mirror_info_id" INTEGER PRIMARY KEY NOT NULL,
"title_id" in... |
-- 1 up
create table if not exists posts (
id serial primary key,
title text,
body text
);
-- 1 down
drop table if exists posts;
|
<filename>openGaussBase/testcase/KEYWORDS/Current_Path/Opengauss_Function_Keyword_Current_Path_Case0032.sql
-- @testpoint:opengauss关键字current_path(非保留),作为用户名
--关键字current_path作为用户名不带引号,创建成功
drop user if exists current_path;
CREATE USER current_path PASSWORD '<PASSWORD>';
drop user current_path;
--关键字current_path作为用户... |
<gh_stars>0
-- @testpoint: upsert子查询表权限验证,没有权限,合理报错
--创建子查询表,插入数据
drop table if exists t_dml_upsert_sub0124;
create table t_dml_upsert_sub0124 (a int,b text);
insert into t_dml_upsert_sub0124 values(generate_series(1,10),'name'||generate_series(1,10));
--创建普通用户并切换至该用户
drop user if exists u_dml_upsert0124 cascade;
crea... |
ALTER TABLE borrowers ADD COLUMN sycamoreid text;
|
<filename>MyDemos/SQL Intro Demos/DemmoSecond.sql
use TelerikAcademy
--SELECT e.EmployeeID, e.LastName,e.DepartmentID,
-- d.DepartmentID,d.Name AS DepartmentName
--FROM Employees e
-- INNER JOIN Departments d
-- ON e.DepartmentID = d.DepartmentID
--SELECT *
-- FROM Employees e
-- INNER JOIN Employees m
-- ON e.Ma... |
CREATE PROCEDURE GetLocations
@Id nvarchar (6) = '',
@Name nvarchar(50) = ''
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
SELECT * FROM [dbo].[Locations]
WHERE CAST(Id as CHAR) L... |
CREATE TABLE [hou].[Vacation]
(
[VacationID] INT NOT NULL IDENTITY(1, 1),
[UserID] INT NOT NULL,
[Start] DATE NOT NULL,
[End] DATE NOT NULL,
[Note] VARCHAR(1024) NULL,
CONSTRAINT PK_Vacation_VacationID PRIMARY KEY CLUSTERED ([VacationID] ASC),
CONSTRAINT FK_Vacation_User_UserID FOREIGN KEY ([Us... |
/*
Post-Deployment Script Template
--------------------------------------------------------------------------------------
This file contains SQL statements that will be appended to the build script.
Use SQLCMD syntax to include a file in the post-deployment script.
Example: :r .\myfile.sql
... |
<reponame>jdkoren/sqlite-parser
-- in4.test
--
-- execsql { SELECT b FROM t2 WHERE a IN (2, -1) }
SELECT b FROM t2 WHERE a IN (2, -1) |
<filename>services/v2/db/upgrades/0.32.sql<gh_stars>1-10
ALTER TABLE `colors` ADD `name` varchar(255) DEFAULT '' AFTER `colors_id`;
|
<filename>postgres-uuid-hge/migrations/1_init.up.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.4 (Ubuntu 10.4-2.pgdg14.04+1)
-- Dumped by pg_dump version 10.4
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET stan... |
<filename>samples/demos/SQLDW/free-trial-lab/join-query.sql
-- Join Date table and Trip table
SELECT TOP (1000000) dt.[DayOfWeek]
,tr.[MedallionID]
,tr.[HackneyLicenseID]
,tr.[PickupTimeID]
,tr.[DropoffTimeID]
,tr.[PickupGeographyID]
,tr.[DropoffGeographyID]
,tr.[Pick... |
<gh_stars>10-100
-- AlterTable
ALTER TABLE "CachedProfile" ADD COLUMN "appealId" TEXT;
|
<reponame>smith750/kc<filename>coeus-db/coeus-db-sql/src/main/resources/org/kuali/coeus/coeus-sql/views/OSP$COMM_SCHEDULE.sql
-- View for Coeus compatibility
CREATE OR REPLACE VIEW OSP$COMM_SCHEDULE AS SELECT
COMM_SCHEDULE.SCHEDULE_ID,
COMMITTEE.COMMITTEE_ID,
COMM_SCHEDULE.SCHEDULED_DATE,
COMM_SCHE... |
<gh_stars>1-10
drop table if exists students;
drop table if exists invitations;
drop index if exists invitations_by_inviter;
drop index if exists invitations_by_invitee;
create table students (
id serial primary key,
name varchar(64),
uni varchar(7) unique,
confirmed boolean default false
);
create t... |
SELECT
DepositGroup,
MagicWandCreator,
MIN(DepositCharge) AS MinDepositCharge
FROM WizzardDeposits
GROUP BY DepositGroup, MagicWandCreator; |
<gh_stars>1-10
-- Name: CompleteImportEvent
-- Schema: posda_files
-- Columns: []
-- Args: ['import_event_id']
-- Tags: ['nifti']
-- Description: Close an import_event
--
update import_event
set import_close_time = now()
where
import_event_id = ?
|
<reponame>axhertz/SimplicityDoneRight<gh_stars>1-10
select count(*) from
movie_keyword AS mk
join keyword AS k on (k.keyword IN ('murder', 'murder-in-title', 'blood', 'violence') AND k.id = mk.keyword_id)
join title AS t on (t.production_year > 2005 AND t.id = mk.movie_id)
join kind_type AS kt on (kt.kind IN ('movie... |
DROP TABLE IF EXISTS mover_tracks;
DROP TABLE IF EXISTS mover_tasks_log;
|
ALTER TABLE installation_statistics
ALTER COLUMN ip DROP NOT NULL;
|
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spLabBatch_SelectDetail]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [dbo].[spLabBatch_SelectDetail]
GO
create proc [dbo].[spLabBatch_SelectDetail]
@idfBatchTest ... |
-- START create table test_hierarchy_doc
-- DROP TABLE IF EXISTS test_hierarchy_doc ;
SELECT 'create the "test_hierarchy_doc" table' as "---"
;
-- src: http://mikehillyer.com/articles/managing-hierarchical-data-in-mysql/
CREATE TABLE test_hierarchy_doc (
guid UUID NOT NULL DEFAULT gen_rANDom_uuid(... |
DO $$
BEGIN
PERFORM rebuild_benchmarks();
END$$
|
DECLARE
num number ;
iter number ;
fact number ;
BEGIN
num := &num ;
iter := 1 ;
fact := 1 ;
WHILE iter > num
fact := fact * iter ;
iter := iter + 1 ;
END LOOP ;
dbms_output.put_line('Factorial of '||num||' is :: ' ||fact);
END ;
/ |
<filename>storage/database/geonames/countries/et.sql
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: laraclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 ... |
-- disable all constraints
DECLARE @tname VARCHAR(128),
@tschema VARCHAR(128);
DECLARE tables CURSOR FOR
SELECT TABLE_SCHEMA, TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES;
OPEN tables
FETCH NEXT FROM tables
INTO @tschema, @tname
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT 'Disabling constraints for table: [' + @tsc... |
CREATE TABLE IF NOT EXISTS bjora.users (
id BIGINT NOT NULL PRIMARY KEY,
username TEXT NOT NULL,
email TEXT NOT NULL,
password TEXT NOT NULL,
gender TEXT NOT NULL,
address TEXT NOT NULL,
birthday TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
created_by TEXT NOT NULL D... |
<filename>prisma/migrations/20220128131504_init/migration.sql
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"name" TEXT NOT NULL,
"roleId" TEXT NOT NULL,
CONSTRAINT "User_pkey" PRIMARY KEY ("id")
);
-- CreateTable
CREATE TABLE "Role" (
"id" TEXT NOT NULL,
... |
SELECT
Title, Name
FROM
ACTOR NATURAL JOIN MOVIE NATURAL JOIN MOVIE_ACTOR
WHERE
Title LIKE '%Superman%';
|
insert into users (
id, -- UUID
name, -- text
password, -- text
employee_id) -- int
values (#{getId},
#{getName},
#{getPassword},
#{getEmployeeId})
returning id,
name,
password,
employee_id
|
# Write your MySQL query statement below
SELECT CLASS
FROM courses
GROUP BY CLASS
HAVING COUNT(DISTINCT student) >= 5; |
<reponame>tushartushar/dbSmellsData<gh_stars>1-10
CREATE TABLE hole (g geometry)
CREATE TABLE shells (g geometry)
|
INSERT INTO sampledb.collect_method (created_at, updated_at, name, description)
VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Visual', 'Metodo de interpretacao visual'),
(CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'In Loco', 'Metodo de interpretacao in Loco'),
(CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'Misto', '... |
<gh_stars>1-10
select School_Name,Tution_Per_Year,Student_Size
from us_universities
where School_Name = (Select Graduate_School_Name from top_engineering_school where Graduate_School_Name like 'Northeastern%'); |
BEGIN;
DROP TABLE IF EXISTS measurements;
CREATE TABLE measurements (
sensor_id INTEGER PRIMARY KEY,
floats FLOAT[],
ints INT[]
);
CREATE INDEX idx_measurements_sensor_id ON measurements (sensor_id);
INSERT INTO measurements
VALUES
(1, NULL, NULL),
(2, ARRAY[NULL, NULL, NULL]::float[], ARRAY[NULL, NULL, NULL]:... |
<gh_stars>1-10
IF NOT EXISTS (SELECT 1 FROM sys.tables WHERE name = '{{TableName}}' AND type = 'U')
BEGIN
CREATE TABLE [{{TableName}}] (
[TableName] nvarchar(100) NOT NULL,
[LastId] {{DataType}} NOT NULL,
CONSTRAINT [PK_{{TableName}}] PRIMARY KEY CLUSTERED ([TableName] ASC) WITH (
PAD_INDEX = OFF,
STATISTICS_... |
-- file:foreign_key.sql ln:411 expect:true
DELETE FROM PKTABLE where ptest1=2 and ptest2=3 and ptest3=4
|
-- file:with.sql ln:982 expect:true
WITH rcte AS ( SELECT max(id) AS maxid FROM parent )
DELETE FROM parent USING rcte WHERE id = maxid
|
<reponame>dram/metasfresh
-- 2019-10-15T09:42:50.446Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Window SET InternalName='M_HU_PI_Version',Updated=TO_TIMESTAMP('2019-10-15 11:42:50','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Window_ID=540344
;
-- 2019-10-15T09:42:59.660Z
-- I for... |
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5501610_sys_gh4601-app_add_template_sysconfig_records.sql
-- 2018-09-17T12:03:58.651
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_SysConfig (AD_Client_ID,Created,CreatedBy,I... |
ALTER TABLE `quest_template` ADD COLUMN `Repeatable` tinyint(1) unsigned NOT NULL default '0';
UPDATE `quest_template` SET `Repeatable`='1' WHERE `SpecialFlags`&'32'='32'; |
<filename>packages/acs-subsite/sql/postgresql/user-sc-create.sql
--
-- A service contract for allowing packages to be notified of changes in user information
--
-- The operations defined here are
-- UserData.UserNew
-- UserData.UserApprove
-- UserData.UserDeapprove
-- UserData.UserDelete
-- UserDat... |
ALTER TABLE events ADD COLUMN result VARCHAR(1) DEFAULT NULL;
ALTER TABLE bet_items MODIFY money DECIMAL(8,2) DEFAULT NULL;
ALTER TABLE bet_items MODIFY ev FLOAT(10,2) DEFAULT NULL;
ALTER TABLE bet_items ADD COLUMN income FLOAT(15,2) DEFAULT NULL;
ALTER TABLE bets MODIFY ev FLOAT(10,2) DEFAULT NULL;
ALTER TABLE bets MO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.