sql stringlengths 6 1.05M |
|---|
<gh_stars>1-10
-- Your SQL goes here
CREATE TABLE blocks (
hash varchar primary key,
height bigint not null,
parent_hash varchar,
connected boolean not null default false
);
|
<reponame>ubitquity/BlockSTRACT_Source
CREATE TABLE counties
(
id bigserial,
version bigint NOT NULL DEFAULT 0,
created_at timestamptz NOT NULL,
name character varying(255) UNIQUE NOT NULL,
CONSTRAINT pk_counties PRIMARY KEY (id)
);
INSERT INTO counties(created_at, name) VALUES(NOW(), 'Fulton');
INSERT ... |
create view customer_facts as
with cust_facts as (
select
distinct
customer_id,
rental_id,
rental_date,
amount,
count(*) over (partition by customer_id) as num_rentals,
row_number() over (partition by customer_id order by rental_date) as row_num
from
customer c
inner join rental using
(customer_id... |
<filename>erp_ejb/src_facturacion/com/bydan/erp/facturacion/resources/general/BuscarProductoFacturas_Postgres.sql<gh_stars>0
select
(select nombre from comisiones.vendedor where id=f.id_vendedor) as nombre_vendedor,
(select nombre_completo from cartera.cliente where id=f.id_cliente) as nombre_completo_cliente,
f... |
<reponame>timabe/samplitude
-- adapt this to your desired schema
-- this is based on the schema on
-- https://amplitude.zendesk.com/hc/en-us/articles/205406637-Export-API-Export-Your-App-s-Event-Data
DROP TABLE IF EXISTS events;
CREATE table events AS
SELECT
data->>'app' as app,
data->>'amplitude_id' as amplitude_id,... |
DROP TABLE IF EXISTS `user_auth_keys`;
CREATE TABLE `user_auth_keys` (
`user_id` int(10) unsigned NOT NULL,
`ssh_key` blob NOT NULL,
`key_bits` int(4) unsigned NOT NULL,
`fingerprint` blob NOT NULL,
`key_name` char(64) NOT NULL,
`key_protocol` char(16) NOT NULL,
UNIQUE KEY `fingerprint` (`fi... |
<gh_stars>0
-- @testpoint:opengauss关键字off非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists off;
create sequence off start 100 cache 50;
drop sequence off;
--关键字带双引号-成功
drop sequence if exists "off";
create sequence "off" start 100 cache 50;
drop sequence "off";
--关键字带单引号-合理报错
drop sequence if exists 'off';
create se... |
<reponame>mjl-/ding
select assert_schema_version(14);
insert into schema_upgrades (version) values (15);
alter table repo add home_disk_usage bigint not null default 0;
alter table build add home_disk_usage_delta bigint not null default 0;
-- Must recreate view after adding/removing columns.
drop view build_with_resu... |
--creating database;
CREATE DATABASE dbfoodfy;
--creating tables;
CREATE TABLE "recipes" (
"id" SERIAL PRIMARY KEY,
"title" text NOT NULL,
"chef_id" int NOT NULL,
"user_id" int NOT NULL,
"featured" boolean,
"homepage" boolean,
"ingredients" text[] NOT NULL,
"preparation" text[],
"information" text,
... |
<reponame>MaheshLakshman/laravel-loggin-resetpasswrd<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 19, 2018 at 01:52 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0... |
DROP DATABASE IF EXISTS `blog`;
CREATE DATABASE `blog` CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
DROP USER 'blog_user'@'localhost';
CREATE USER 'kadiy'@'localhost' IDENTIFIED BY 'kadiy';
GRANT ALL PRIVILEGES ON `ktoure_blog`.* TO 'kadiy'@'localhost';
USE `blog`;
CREATE TABLE `billets` (
`id` INT AUTO_INCREM... |
-- As an adiministrator, I review experiments that are in the 'initiated' status and moved them EITHER to 'cancelled' (NOT APPROVED) or 'in-progress' (APPROVED)
-- return the list of experiments that have been initiated and which agents they propose to work on
-- action: the adiministrator actor would update the statu... |
select carga, count(*) from cursos
group by carga # Faz um agrupamento de quantos cursos têm quantas horas de carga
order by carga;
select ano, count(*) from cursos
group by ano
having ano > 2015
order by count(*) desc;
select avg(carga) from cursos;
select carga, count(*) from cursos
where ano > 2013
group by c... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Apr 15, 2018 at 09:12 AM
-- Server version: 5.6.38-log
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>CSC-IT-Center-for-Science/antero<filename>db/sql/5964__create_v_varda_toimipaikat_toiminnallisetpainotukset.sql
USE [ANTERO]
GO
/****** Object: View [dw].[v_varda_toimipaikat_toiminnallisetpainotukset] Script Date: 1.3.2022 11.06.24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CR... |
<filename>concepts/cookbook/temp.sql
-- --------------------------------------------------------
-- Title: Retrieves the temperature of adult patients
-- Notes: this query does not specify a schema. To run it on your local
-- MIMIC schema, run the following command:
-- SET SEARCH_PATH TO mimiciii;
-- Where "mimiciii" ... |
--https://www.hackerrank.com/challenges/select-by-id
SELECT * FROM CITY WHERE ID = 1661 |
<gh_stars>1-10
--CREATE DATABASE WMS
--USE WMS
CREATE TABLE Clients
(
ClientId INT PRIMARY KEY IDENTITY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
Phone CHAR(12) NOT NULL
)
CREATE TABLE Mechanics
(
MechanicId INT IDENTITY PRIMARY KEY,
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) ... |
<reponame>infamousjoeg/DNAmicAnalysis<filename>data/sql/TotalMachinesCount.sql
SELECT DISTINCT Machines.Id
FROM Machines
WHERE ScanResult <> 'Failed' |
<filename>db-v2.sql
create table _yamanote_db_state (schemaVersion integer not null);
insert into
_yamanote_db_state (schemaVersion)
values
(2);
create table user (
id INTEGER PRIMARY KEY,
name text unique not null,
hashed text not null,
salt text not null,
iterations integer not null,
keylen integer no... |
<reponame>Erdigergeist/ADB
UPDATE `creature_template` SET `unit_flags` = '33554496' WHERE `entry` = '33134'; |
<filename>aspnet/web-forms/overview/data-access/working-with-binary-files/uploading-files-vb/samples/sample2.sql
SELECT CategoryID, CategoryName, Description,
(SELECT COUNT(*)
FROM Products p
WHERE p.CategoryID = c.CategoryID)
as NumberOfProducts
FROM Categories c |
USE data_extracts;
DROP PROCEDURE IF EXISTS populateCohortSnomeds;
DELIMITER //
CREATE PROCEDURE populateCohortSnomeds()
BEGIN
INSERT INTO snomed_codes (GROUP_ID, SNOMED_ID, DESCRIPTION)
VALUES
(1,237620003,'Abnormal metabolic state in diabetes mellitus (disorder)'),
(1,735200002,'Absence of lower limb due to diab... |
<filename>make/migrations/postgresql/0031_2.0.3_schema.up.sql
/*
Fixes https://github.com/goharbor/harbor/issues/12827
After user migrates Harbor from v2.0.2, user got 404 when to pull specific images, and no work after push the same images again.
Fix:
1, If the issue is caused by missing repository data, this fix c... |
create table t_task_instance_point
(
id BIGINT(19) auto_increment
primary key,
instance_id BIGINT(19) null comment '实例id',
point_type INT(10) default 1 null comment '1-默认,2-临时必到点',
point_id BIGINT(19) null comment '必到点id',
create_time BIGINT(19) not null,
... |
CREATE OR REPLACE VIEW v_whiteboard AS
select lot.code as code
, lot.code as parking_lot_id
, lot.name
, lot.staff_id
, lot.category_id
, CONCAT(lot.pref_name, lot.city_name, ifnull(lot.town_name, ''), ifnull(lot.aza_name, ''), ifnull(lot.other_name, '')) as address
, lot.lng
, lot.la... |
<reponame>Gaia3D/nipa
--
-- Type: TABLE;
-- Name: adm_li;
--
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 ... |
<reponame>makermary/dbt-labs-experimental-features
{{config(
materialized = 'materialized_view',
auto_refresh = false
)}}
select
gender,
count(*) as num
from {{ref('base_tbl')}}
group by 1
|
create table tab_new
(
col1 number(10)
)
partition by range (col1)
(
partition xy10 values less than (10),
partition xy20 values less than (20)
);
|
<gh_stars>100-1000
-- Deploy delivery:upsert_notification_config to pg
-- requires: notification_config, notification_config_constraints
-- This procedure could be replaced with a single UPSERT call when it
-- rolls around in PGSQL
-- (see http://www.craigkerstiens.com/2015/05/08/upsert-lands-in-postgres-9.5/)
BEGIN;... |
<gh_stars>100-1000
--pdw CDM Primary Key Constraints for OMOP Common Data Model 5.4
ALTER TABLE @cdmDatabaseSchema.PERSON ADD CONSTRAINT xpk_PERSON PRIMARY KEY NONCLUSTERED (person_id);
ALTER TABLE @cdmDatabaseSchema.OBSERVATION_PERIOD ADD CONSTRAINT xpk_OBSERVATION_PERIOD PRIMARY KEY NONCLUSTERED (observation_period... |
/*
Navicat MySQL Data Transfer
Source Server : local-mysql
Source Server Version : 50505
Source Host : localhost:3306
Source Database : ourschool
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2020-08-07 16:29:15
*/
SET FOREIGN_KEY_CHECKS=0;
... |
<filename>openGaussBase/testcase/SECURITY/ROWLEVEL/Opengauss_Function_Security_RowLevel_Case0016.sql
-- @testpoint: 系统管理员不受行访问控制影响,可以查看表的全量数据
--step1: 创建表、用户;expect:成功
DROP USER IF EXISTS u01_security_RowLwvel_0016 CASCADE;
DROP USER IF EXISTS u02_security_RowLwvel_0016 CASCADE;
DROP USER IF EXISTS u03_security_RowLwve... |
<filename>sql/unithis_DDL, DML.sql
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: unithis.chyx4vje9iws.ap-northeast-2.rds.amazonaws.com Database: unithis
-- ------------------------------------------------------
-- Server version 8.0.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
<gh_stars>0
USE ContosoUniversity22; --Database used for tests
GO
BEGIN TRANSACTION;
GO
CREATE TABLE [CourseInstructor] (
[CourseID] int NOT NULL,
[InstructorID] int NOT NULL,
CONSTRAINT [PK_CourseInstructor] PRIMARY KEY ([CourseID], [InstructorID]),
CONSTRAINT [FK_CourseInstructor_Course] FOREIGN KE... |
alter table sys_office change `DEPUTY_PERSON` `deputy_person` int(11); |
CREATE OR REPLACE FUNCTION sys_poe.fgrupos_edad_sexo(in_tipo bigint,
in_idestado bigint,
in_idestablecimiento bigint,
in_idservicio bigint,
in_cargo bigint)
RETURNS TABLE(nid bigint, nrango text, nsexo character (1), ncantidad bigint) AS
$BODY$
DECLARE
mr25 bigint;
mr2529 bigint;
mr3034 bigint;
m... |
<filename>db/no data db/tapper_db-1.sql
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 28, 2017 at 03:40 AM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 29-08-2017 a las 20:37:12
-- Versión del servidor: 5.6.24
-- Versión de PHP: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
-- name: CreateAccount :one
INSERT INTO cuenta (
propietario,
tope,
divisa
) VALUES (
$1, $2, $3
) RETURNING *;
-- name: GetAccount :one
SELECT * FROM cuenta
WHERE id = $1 LIMIT 1;
-- name: GetAccountForUpdate :one
SELECT * FROM cuenta
WHERE id = $1 LIMIT 1
FOR NO KEY UPDATE;
-- name: ListAccounts :many
SELE... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 16, 2019 at 01:22 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
create or replace view PromotionROIView as
select PromotionCode.promotion as promotion,
count(1) as num_orders,
sum(promotion_total) as promotion_total,
sum(total) as total
from PromotionCode
inner join Orders on Orders.promotion_code = PromotionCode.code
group by PromotionCode.promotion;
|
<filename>Lab7/6.sql
SELECT name from songs where artist_id IN (SELECT id from artists where name = '<NAME>'); |
// Web Annotation Example 1:
// https://www.w3.org/TR/annotation-model/#annotations
// {
// "@context": "http://www.w3.org/ns/anno.jsonld",
// "id": "http://example.org/anno1",
// "type": "Annotation",
// "body": "http://example.org/post1",
// "target": "http://example.com/page1"
// }
MERGE (ob:OBJECT {id: "http:... |
USE Shutterfly;
DROP TABLE IF EXISTS features_group_3;
CREATE TABLE IF NOT EXISTS features_group_3
SELECT
offset.index
,o3.category AS last_category
,o3.event1 AS last_event1
,o3.event2 AS last_event2
FROM
(SELECT
o1.index
,o1.custno
,MAX(o2.dt) AS last_dt
FROM Online AS o1
JOIN Online AS o2
ON o1.cu... |
--
-- Table structure for table `user`
--
CREATE TABLE `user` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`full_name` varchar(50) NOT NULL,
`email` varchar(50) NOT NULL,
`password` varchar(50) NOT NULL,
`date_of_birth` date NOT NULL,
`phone_number` int(11) NOT NULL,
`created_at` datetime DEFAULT CURRENT_TIM... |
<reponame>Shuttl-Tech/antlr_psql
-- file:insert.sql ln:66 expect:true
insert into inserttest (f4[1].if2[1], f4[1].if2[2]) values ('foo', 'bar'), ('baz', 'quux')
|
INSERT INTO tb_user (name, email, password) VALUES ('<NAME>', '<EMAIL>', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG');
INSERT INTO tb_user (name, email, password) VALUES ('<NAME>', '<EMAIL>', '$2a$10$eACCYoNOHEqXve8aIWT8Nu3PkMXWBaOxJ9aORUYzfMQCbVBIhZ8tG');
INSERT INTO tb_role (authority) VALUES ('VI... |
\set ECHO none
\ir sql/configs/griddb_parameters.conf
\set ECHO all
\i sql/13.4/ported_postgres_fdw.sql |
ALTER TABLE `mst_topic` ADD `classification` VARCHAR( 50 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL COMMENT 'Classification Code' AFTER `auth_list` ;
ALTER TABLE `biblio` ADD `sor` VARCHAR( 200 ) COLLATE utf8_unicode_ci NULL AFTER `title` ;
INSERT INTO `setting` (`setting_id`, `setting_name`, `setting_va... |
<gh_stars>1-10
BEGIN;
CREATE EXTENSION pgcrypto;
CREATE TABLE signatures(
Id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
LoginName varchar(250) NOT NULL UNIQUE,
Email varchar(250),
GivenName varchar(250),
SignedAt timestamp NOT NULL,
ClaVersion varchar(10)
);
COMMIT;
|
-- Insert the default roles for a document.
INSERT INTO document_role(role) VALUES
('reader'),
('writer'),
('owner');
|
select t.n_nationkey, t.name, t.n_regionkey, t.n_comment
from (
select n_nationkey, n_name as name, n_regionkey, n_comment
from nation n
join region r on (n.n_regionkey = r.r_regionkey)
) t
join supplier s on (s.s_nationkey = t.n_nationkey)
where t.name = 'MOROCCO';
|
<filename>modules/core/db/update/postgres/15/151106-extendScheduledTaskFields.sql
alter table SYS_SCHEDULED_TASK alter column PERMITTED_SERVERS type varchar(4096)^
alter table SYS_SCHEDULED_TASK alter column LAST_START_SERVER type varchar(512)^
alter table SYS_SCHEDULED_EXECUTION alter column SERVER type varchar(512)^
... |
INSERT INTO
Shippers (ShipperID, CompanyName, Phone)
VALUES
(nextval('TS_ShipperID'), :P2, :P3)
|
<reponame>dardaw/spedi
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Czas generowania: 20 Sty 2022, 12:12
-- Wersja serwera: 10.4.21-MariaDB
-- Wersja PHP: 7.4.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 18, 2021 at 04:16 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- @testpoint: Hash分区表结合列约束(default)默认值和数据类型不匹配 合理报错
--step1:创建hash分区表 expect:合理报错
drop table if exists partition_hash_tab;
create table partition_hash_tab
(id number(7) default 'aaa',
use_filename varchar2(20) ,
filename varchar2(255),
text ... |
-- @testpoint:openGauss保留关键字column作为 用户名,不带引号,合理报错
CREATE USER column PASSWORD '<PASSWORD>';
--openGauss保留关键字column作为 用户名,加双引号,创建成功
drop user if exists "column";
CREATE USER "column" PASSWORD '<PASSWORD>';
drop user "column";
--openGauss保留关键字column作为 用户名,加单引号,合理报错
CREATE USER 'column' PASSWORD '<PASSWORD>';
... |
<gh_stars>0
-- creates a database called mysqlReview
-- optionally we can delete the table and start over(we would put this before the create clause)
--makes all of the following code will affect the database
-- creates table called movies within the mysqlReview database
(
-- create a column called 'id', t... |
<reponame>svetlimladenov/Databases-Basics---MS-SQL-Server<filename>09.Exam Preparation/Exam Preparation 1/Exam Preparation 1/02. Insert.sql
INSERT INTO Clients(FirstName,LastName,Phone) VALUES
('Teri','Ennaco','570-889-5187'),
('Merlyn','Lawler','201-588-7810'),
('Georgene','Montezuma','925-615-5185'),
('Jettie','Mconn... |
select * from part;
select * from store;
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 16, 2018 at 03:21 PM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>Database/ssbeac.sql<gh_stars>0
CREATE TABLE `district` (
`id` INT(11) NOT NULL,
`label` VARCHAR(255) DEFAULT NULL,
`id_region` INT(11) DEFAULT NULL,
deleted int(1) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
--
-- Contenu de la table `district`
--
INSERT INTO `district` (`id`, `label`, `id_regio... |
-- employee_custom_fields --
ALTER TABLE `phppos_employees`
ADD `custom_field_1_value` VARCHAR(255) NULL DEFAULT NULL,
ADD INDEX (`custom_field_1_value`),
ADD `custom_field_2_value` VARCHAR(255) NULL DEFAULT NULL,
ADD INDEX (`custom_field_2_value`),
ADD `custom_field_3_value` VARCHAR(255) NULL DEFAULT NULL,
ADD... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 17 Bulan Mei 2021 pada 05.49
-- 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... |
<filename>hackerrank/sql/select-all-sql.sql
SELECT *
FROM city |
<reponame>afup/back-office
-- phpMyAdmin SQL Dump
-- version 3.5.0
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Sam 15 Février 2014 à 15:58
-- Version du serveur: 5.5.27-29.0
-- Version de PHP: 5.4.25-1~dotdeb.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
CREATE PROCEDURE [dbo].[dnn_AddFile]
@PortalId int,
@UniqueId uniqueidentifier,
@VersionGuid uniqueidentifier,
@FileName nvarchar(246),
@Extension nvarchar(100),
@Size int,
@Width int,
@Height int,
@ContentType nvarchar(200),
@Folder nvarchar(246),
@FolderID int,
@CreatedByUserID ... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 22, 2019 at 06:56 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<gh_stars>100-1000
--
--
DELIMITER $$
DROP function IF EXISTS _split_get_range_start_variables_names $$
CREATE function _split_get_range_start_variables_names()
returns TEXT CHARSET utf8
DETERMINISTIC
READS SQL DATA
SQL SECURITY INVOKER
COMMENT ''
BEGIN
declare return_value TEXT CHARSET utf8;
select
grou... |
CREATE INDEX IF NOT EXISTS ad_issue_created
ON public.ad_issue
USING btree
(created);
COMMENT ON INDEX public.ad_issue_created
IS 'Aims to improve the performance of selects with "where created between somedate and someotherdate".
Example:
select * from ad_issue where created between ''2017-11-21 09:00'' and ... |
<reponame>ytyaru/GitHub.Upload.ByPython.Add.Database.Create.refactoring.GitHubApi.201703280740<filename>database/src/license/create/Licenses.Insert.sql
-- https://developer.github.com/v3/licenses/#get-a-repositorys-license
-- ライセンスが設定されていない場合はNULL。
-- "license":null
-- ライセンスが規定以外の場合は`other`。
-- "license":{"key":"other"... |
-- Create employee table & insert a couple of records
-- specify the schema you will use for this example
-- © FormaServe Systems Ltd
--
CREATE TABLE HRDATA.EMPLOYEE (
EMID INTEGER GENERATED ALWAYS AS IDENTITY (
START WITH 1 INCREMENT BY 1
NO MINVALUE NO MAXVALUE
CYCLE NO ORDER
CACHE 20 )
,
EMSUR CHAR... |
INSERT INTO donation_center VALUES (nextval('donation_center_id_seq'),'ACTREC', 'Kharghar', '2740 5000', '2741 2919', '2740 5061', 'Tata Memorial Centre, Sector 22, Kharghar, Navi Mumbai', '410208', 'Maharashtra','SYSTEM','2015-04-02',NULL,NULL);
INSERT INTO donation_center VALUES (nextval('donation_center_id_seq'),'Ar... |
<gh_stars>0
# --- !Ups
create table usuario (
id bigint auto_increment not null,
nome varchar(255),
constraint pk_usuario primary key (id)
);
# --- !Downs
drop table if exists usuario; |
ALTER TABLE grupos_prioridades
CHANGE descricap descricao varchar(255); |
CREATE TABLE "STUDENT_STATUS_CODE"
( "STUDENT_STATUS_CODE" VARCHAR2(1 BYTE),
"LABEL" VARCHAR2(30 BYTE) NOT NULL ENABLE,
"DESCRIPTION" VARCHAR2(255 BYTE) NOT NULL ENABLE,
"DISPLAY_ORDER" NUMBER NOT NULL ENABLE,
"EFFECTIVE_DATE" DATE NOT NULL ENABLE,
"EXPIRY_DATE" DATE,
"CREATE_DATE" DATE D... |
<gh_stars>1-10
-- SET DATABASE TRANSACTION CONTROL MVCC;
drop table country if exists;
create table country (
id integer,
countryname varchar(32),
countrycode varchar(2)
);
insert into country (id, countryname, countrycode) values(1,'China','CN');
insert into country (id, countryname, countrycode) values(2,'Fr... |
--
-- Add in_maintenance column to device table
--
ALTER TABLE device ADD COLUMN in_maintenance boolean;
UPDATE device SET in_maintenance=FALSE;
ALTER TABLE device ALTER COLUMN in_maintenance SET NOT NULL; |
select name, tags, title, akas
from azure.azure_iothub
where name = 'dummy-{{ resourceName }}' and resource_group = '{{ resourceName }}'; |
DROP INDEX IF EXISTS "RoomPresence_roomId";
|
<filename>backend/electropDoc.sql<gh_stars>1-10
/*
SQLyog Community v12.4.1 (64 bit)
MySQL - 10.1.21-MariaDB : Database - electrop
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_C... |
SELECT
gh.game_id, gh.game_date, home.name, away.name
FROM game_header gh
JOIN team as home on gh.home_team_id = home.id
JOIN team as away on gh.away_team_id = away.id
WHERE
(home.id = 1610612744 or away.id = 1610612744) AND
(gh.game_date >= '2017-10-17') AND (gh.game_date < '2018-04-14')
ORDER BY gh.game... |
INSERT INTO burgers (burger_name, devoured) VALUES ('Turkey Burger', false);
INSERT INTO burgers (burger_name, devoured) VALUES ('Bacon Cheese Burger', false);
INSERT INTO burgers (burger_name, devoured) VALUES ('Chicken burger', false);
|
<gh_stars>0
-- Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘h’ and contains six alphabets.
select *
from workers
where first_name like '%h' and length(first_name) = 6; |
<filename>sql/schema/chii_rev_history.sql
-- phpMyAdmin SQL Dump
-- version 4.4.15.1
-- http://www.phpmyadmin.net
--
-- Host: 192.168.201.71
-- Generation Time: Dec 17, 2021 at 05:52 AM
-- Server version: 5.7.33-0ubuntu0.16.04.1-log
-- PHP Version: 5.5.9-1ubuntu4.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zon... |
CREATE TABLE empty_table (
);
ALTER TABLE empty_table OWNER TO fordfrog;
|
<reponame>MSDN-WhiteKnight/Traducir-Lab<gh_stars>0
USE [master]
GO
/****** Object: Database [Traducir] Script Date: 16.06.2020 11:27:01 ******/
CREATE DATABASE [Traducir]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'Traducir', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA\Tr... |
<gh_stars>0
DROP TABLE IF EXISTS `sesi_sambangan`;
CREATE TABLE `sesi_sambangan` (
`id` int NOT NULL AUTO_INCREMENT,
`user_id` int DEFAULT NULL,
`nama_santri` varchar(200) NOT NULL,
`nama_walisantri` varchar(200) NOT NULL,
`kelas_santri` varchar(200) NOT NULL,
`status` char(1) NOT NULL,
`sesi` varchar(255... |
INSERT INTO `court_representative` VALUES (1,'რიაბოვი');
INSERT INTO `court_representative` VALUES (2,'გოგლიძე');
INSERT INTO `court_representative` VALUES (3,'ტალახაძე');
INSERT INTO `court_representative` VALUES (4,'წერეთელი');
INSERT INTO `court_representative` VALUES (5,'მოროზოვი');
INSERT INTO `court_representativ... |
<gh_stars>0
-- CreateEnum
CREATE TYPE "MembershipRole" AS ENUM ('ADMIN', 'MANAGER', 'USER');
-- CreateEnum
CREATE TYPE "GlobalRole" AS ENUM ('SUPERADMIN', 'CUSTOMER');
-- CreateTable
CREATE TABLE "Organization" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT... |
<gh_stars>1-10
SET DEFINE OFF;
CREATE SYNONYM APEX_FLOW_USER_INTERFACES FOR APEX_050000.WWV_FLOW_USER_INTERFACES
/
|
SET DEFINE OFF;
create or replace package afw_12_asn_item_pkg
as
end afw_12_asn_item_pkg;
/
|
<filename>auditing/sql/AUDIT_MAINTENANCE_BODY_PKG.sql
create or replace package body DBAUDIT_LOGIK.audit_maintenance_pkg as
/* ---------------------------------------------------------------------------
PACKAGE: audit_maintenance_pkg
CREATED: 2019-08-29, <NAME>, EpicoTech
DESCRIPTION: Package ... |
INSERT INTO EG_ACTION (id,name,url,queryparams,parentmodule,ordernumber,displayname,enabled,contextroot,version,createdby,createddate,lastmodifiedby,lastmodifieddate,application)
VALUES (nextval('SEQ_EG_ACTION'),'ActiveAgencyAjaxDropdown','/agency/active-agencies',null,(select id from eg_module where name='ADTAX-COMMO... |
<gh_stars>1-10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!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 */... |
<gh_stars>10-100
-- file:jsonb.sql ln:224 expect:true
SELECT '{"a":"c"}'::jsonb <@ '{"a":"b", "b":1, "c":null}'
|
<gh_stars>1-10
DROP FUNCTION if exists report.textsnippet(IN p_ad_boilerplate_id numeric);
CREATE OR REPLACE FUNCTION report.textsnippet(IN p_ad_boilerplate_id numeric)
RETURNS text AS
$BODY$
DECLARE
p_textsnippet_name text;
BEGIN
select textsnippet into p_textsnippet_name from ad_boilerplate where ad_boi... |
<filename>backend/de.metas.handlingunits.base/src/main/sql/postgresql/system/5501800_sys_gh4567_Update_MovingQuarantineHUs_Process_Name.sql
-- 2018-09-18T17:52:03.026
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Name='Lagerbewegung (inkl. Quarantäne)',Updated=TO_TIMESTAMP('201... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.