sql stringlengths 6 1.05M |
|---|
CREATE TABLE t(
name text,
value text
);
INSERT INTO t VALUES ('name1','value1'), ('name2','value2');
SELECT * FROM t
|
ALTER TABLE AM_API ADD API_UUID VARCHAR(255);
ALTER TABLE AM_API ADD STATUS VARCHAR(30);
ALTER TABLE AM_CERTIFICATE_METADATA ADD CERTIFICATE BLOB DEFAULT NULL;
CREATE TABLE IF NOT EXISTS AM_REVISION (
ID INTEGER NOT NULL,
API_UUID VARCHAR(256) NOT NULL,
REVISION_UUID VARCHAR(255) NOT NULL,
DESCRIPTION VARCHAR(... |
<filename>packaging/target/apache-hive-1.2.1-bin/apache-hive-1.2.1-bin/scripts/metastore/upgrade/oracle/upgrade-0.12.2-to-0.12.3.oracle.sql
CREATE INDEX "SDS_COL_LOCATION_IDX" ON "SDS" ("LOCATION");
ALTER TABLE "BUCKETING_COLS" DROP CONSTRAINT "BUCKETING_COLS_FK1";
ALTER TABLE "BUCKETING_COLS" ADD CONSTRAINT "BUC... |
DROP TABLE IF EXISTS `badge_message`;
--;;
|
whenever sqlerror exit sql.sqlcode
set verify off
BEGIN EXECUTE IMMEDIATE 'ALTER TABLE T_TAB_PRIVS_F ADD (TABLE_NAME_COMP VARCHAR2(128))'; EXCEPTION WHEN OTHERS THEN NULL; END;
/
DECLARE
VNAME VARCHAR2(128);
V_IS_11204 BOOLEAN;
FUNCTION fc_adapt_type (V_STR_IN IN VARCHAR2) RETURN VARCHAR2 IS
V_... |
insert into login(role, pw) values('ADMIN','interfaceAdmin');
insert into login(role, pw) values('USER','interfaceUser'); |
<gh_stars>10-100
/*********
CONCEPT LEVEL check:
PLAUSIBLE_GENDER - number of records of a given concept which occur in person with implausible gender for that concept
Parameters used in this template:
cdmDatabaseSchema = @cdmDatabaseSchema
cdmTableName = @cdmTableName
cdmFieldName = @cdmFieldName
conceptId = @concep... |
CREATE EXTENSION polar_px;
SELECT polar_px_workerid();
|
<reponame>rochakchauhan/commcare-hq<filename>custom/icds_reports/migrations/sql_templates/update_tables.sql
-- Remove not null constraint on aggregated columns (data is sometimes null)
ALTER TABLE agg_child_health ALTER COLUMN age_tranche DROP NOT NULL;
ALTER TABLE agg_child_health ALTER COLUMN disabled DROP NOT NULL;
... |
create schema astra;
set search_path to astra;
drop table if exists astra.ti cascade;
drop table if exists astra.parameter cascade;
drop table if exists astra.ti_parameter cascade;
drop table if exists astra.output_interface cascade;
/* Contributed methods */
drop table if exists astra.ferre cascade;
drop table if e... |
-- @testpoint: 插入非法字符
drop table if exists special_char_07;
CREATE TABLE special_char_07 (id "char");
insert into special_char_07 values ('@#%…(/&*……*');
select * from special_char_07;
drop table special_char_07; |
<reponame>sizzlorox/simple-express-service<gh_stars>0
-- Init
CREATE SCHEMA "service"; |
CREATE TABLE [dbo].[CardAttribute] (
[AttributeId] BIGINT NOT NULL,
[CardId] BIGINT NOT NULL,
CONSTRAINT [PK_CardAttributes] PRIMARY KEY CLUSTERED ([AttributeId] ASC, [CardId] ASC),
CONSTRAINT [FK_CardAttributes_Attributes] FOREIGN KEY ([AttributeId]) REFERENCES [dbo].[Attribute] ([Id]) NOT FOR RE... |
<filename>03082017.sql
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1_3306
Source Server Version : 50505
Source Host : 127.0.0.1:3306
Source Database : absen
Target Server Type : MYSQL
Target Server Version : 50505
File Encoding : 65001
Date: 2017-08-03 04:12:34
*/
SET F... |
-- Unidades de Masa
insert into Unidad values ('Lb')
insert into Unidad values ('gr')
insert into Unidad values ('Kg')
-- Unidades de Liquido
insert into Unidad values ('ml')
insert into Unidad values ('L')
-- Unidades Volumetricas
insert into Unidad values ('tsp')
insert into Unidad values ('Tbsp')
insert into Unida... |
Insert into eg_roleaction (roleid,actionid) values ((select id from eg_role where name='ULB Operator'),(select id from eg_action where name='Personal Register report'));
Insert into eg_roleaction (roleid,actionid) values ((select id from eg_role where name='BPA Approver'),(select id from eg_action where name='Personal... |
<filename>prisma/migrations/20211220214733_init/migration.sql
-- DropForeignKey
ALTER TABLE `sentences_comments` DROP FOREIGN KEY `sentences_comments_authorId_fkey`;
-- DropForeignKey
ALTER TABLE `sentences_comments` DROP FOREIGN KEY `sentences_comments_sentenceCommentId_fkey`;
-- DropForeignKey
ALTER TABLE `sentence... |
DROP TABLE IF EXISTS `ayitoj_contest`;
CREATE TABLE `ayitoj_contest` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL COMMENT '竞赛名称',
`password` varchar(512) NULL COMMENT '竞赛密码',
`status` int(5) NOT NULL DEFAULT 0 COMMENT '竞赛状态 0 禁用 1 启用',
`problem_list` varchar(1024) NOT NULL DEFAULT ''... |
<gh_stars>0
CREATE TABLE [dbo].[Roles] (
[RoleID] INT IDENTITY (1, 1) NOT NULL,
[Role] NVARCHAR (50) NOT NULL,
[Inactive] BIT NOT NULL
);
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 01, 2020 at 12:44 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 5.6.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>lgcarrier/AFW<gh_stars>1-10
SET DEFINE OFF;
CREATE UNIQUE INDEX AFW_01_ATRIB_MODL_COMNC_UK1 ON AFW_01_ATRIB_MODL_COMNC
(CODE, REF_MODL_COMNC)
LOGGING
/
|
------------------
-- tx start
do $$
begin
raise exception 'some exception';
end$$;
-- tx end
------------------ |
# https://leetcode.com/problems/game-play-analysis-i/
SELECT
a.player_id,
min(a.event_date) as 'first_login'
FROM
Activity a
GROUP BY a.player_id; |
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS = @@UNIQUE_CHECKS,
UNIQUE_CHECKS = 0;
SET @OLD_FOREIGN_KEY_CHECKS = @@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS = 0;
SET @OLD_SQL_MODE = @@SQL_MODE,
SQL_MODE = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO... |
/*
Distances Traveled
https://platform.stratascratch.com/coding/10324-distances-traveled?python=
Difficulty: Hard
Find the top 10 users that have traveled the greatest distance. Output their id, name and a total distance traveled.
Tables:
<lyft_rides_log>
id int
user_id int
distance int
... |
ALTER TABLE db_version CHANGE COLUMN required_10307_03_mangos_scripted_event_id required_10314_01_mangos_mangos_string bit;
DELETE FROM mangos_string WHERE entry IN (357,358,359,360,361,362,363,364,365,366,367,368,369,370,371,512,1105,1152);
INSERT INTO mangos_string VALUES
(357,'Areatrigger %u not has target coordin... |
<gh_stars>0
create or alter proc dbo.uspSaveSpreads @TVP dbo.SpreadType READONLY as
begin
set nocount on
MERGE dbo.Spread AS t
USING @TVP s
ON (t.LineId = s.LineId and t.Hdp = s.Hdp)
WHEN MATCHED THEN
UPDATE
SET t.AltLineId = s.AltLineId,
t.Home = s.Home... |
create table department (
id integer generated by default as identity,
name varchar(255) not null,
version integer not null);
create table address (
id integer generated by default as identity,
name varchar(255) not null,
version integer not null);
create table employee (
id integer generated by default as identity,
... |
<gh_stars>1-10
# Sample data for products schema
# --- !Ups
INSERT INTO products (sku, name, description)
VALUES ('bppen-red-na', 'Excella Pen', 'Ballpoint click pen with red body and black clicker, white Excella logo'),
('stynot-wht-std', 'Excella Sticky Notes', 'Standard-sized sticky notes with red and black... |
<filename>src/main/java/com/learn/java/leetcode/lc0177/test.sql
select getNthHighestSalary(20); |
<reponame>fekblom/critic
-- -*- mode: sql -*-
--
-- Copyright 2015 the Critic contributors, Opera Software ASA
--
-- 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.o... |
<filename>unittest/data/load/filter_user_script_for_mds/users.5.7.sql<gh_stars>100-1000
-- MySQLShell dump 1.0.0 Distrib Ver 8.0.22 for osx10.15 on x86_64 - for MySQL 8.0.22 (Source distribution), for osx10.15 (x86_64)
--
-- Host: localhost
-- ------------------------------------------------------
-- Server version 5.... |
<gh_stars>0
CREATE TABLE carteira (id INTEGER PRIMARY KEY, empresa varchar(100) NOT NULL, codigo varchar(10) NOT NULL, quantidade INTEGER NOT NULL );
INSERT INTO carteira (empresa, codigo, quantidade) VALUES ('Cemig', 'CMIG3F', '60');
INSERT INTO carteira (empresa, codigo, quantidade) VALUES ('Energias do Brasil', 'ENE... |
<filename>migrations/015-alter-outbound-dup.sql<gh_stars>1-10
START TRANSACTION;
ALTER TABLE `outbound` DROP COLUMN `user_agent`;
INSERT INTO schema_version(`migration_code`, `extra_notes`) VALUES (
'015', 'remove dup, user_agent can be found in http_user_agent');
COMMIT;
|
ALTER TABLE sites ADD support_groups VARCHAR(256);
|
-- @testpoint:opengauss关键字without(非保留),作为模式名
--关键字不带引号-成功
drop schema if exists without;
create schema without;
drop schema without;
--关键字带双引号-成功
drop schema if exists "without";
create schema "without";
drop schema "without";
--关键字带单引号-合理报错
drop schema if exists 'without';
create schema 'without';
--关键字带反引号-合理报错... |
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for s_debt_detail_log
-- ----------------------------
DROP TABLE IF EXISTS `s_debt_detail_log`;
CREATE TABLE `s_debt_detail_log` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`debt_id` int(10) unsigned NOT NULL ... |
<reponame>chulopapi/Employee-Tracker<filename>db/schema.sql
DROP DATABASE IF EXISTS employeeDB;
CREATE DATABASE employeeDB;
USE employeeDB;
CREATE TABLE department(
id INTEGER(11) AUTO_INCREMENT NOT NULL,
name VARCHAR(30),
PRIMARY KEY (id)
);
CREATE TABLE role(
id INTEGER(11) AUTO_INCREMENT NOT NULL,
... |
-- +migrate Up
ALTER TABLE `items_ancestors`
DROP PRIMARY KEY,
ADD PRIMARY KEY (`ancestor_item_id`, `child_item_id`),
DROP INDEX `ancestor_item_id_child_item_id`,
DROP COLUMN `id`,
ADD CONSTRAINT `fk_items_ancestors_ancestor_item_id_items_id` FOREIGN KEY (`ancestor_item_id`) REFERENCES `items`(`id`)... |
/*
This table stores the signals used in the public signal dashboard.
+------------------------+--------------+------+-----+------------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------------------+--------------+------+-----+------------+-----------... |
CREATE OR REPLACE PROCEDURE public.ingresar_libro_id(
id_libro integer,
titulo_libro character varying,
fecha_publicacion_libro date,
isbn_libro integer)
LANGUAGE plpgsql
AS $$
BEGIN
insert into libro(id, titulo, fecha_publicacion, isbn)
VALUES (id_libro, titulo_libro, fecha_publicacion_libro, isbn_libro);
EX... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 01, 2019 at 11:05 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
SELECT Username, SUBSTRING(Email,CHARINDEX('@',Email,1)+1,LEN(Email))
AS 'Email Provider'
FROM Users
ORDER BY [Email Provider], Username |
-- Update model to v1.2
-- Mon Oct 09 10:53:44 2018
-- Source-Model-Version: 1.1
-- Model: Pytatki Target-Version: 1.2
-- Author: <NAME>
USE pytatki;
ALTER TABLE note
ADD status_id INT NOT NULL DEFAULT 1;
ALTER TABLE note
ADD INDEX fk_note_status1_idx (status_id ASC),
ADD CONSTRAINT fk_note_status_id1 FOREIGN KEY... |
<filename>k8s_log.sql<gh_stars>1-10
INSERT INTO k8s.log (time, etype, event) VALUES ('Fri Apr 20 14:05:03 CST 2018', 'info', 'root Login from [::1]:57531');
INSERT INTO k8s.log (time, etype, event) VALUES ('Fri Apr 20 14:24:35 CST 2018', 'info', 'Delete pod course-55b97d78f4-v8v5f success');
INSERT INTO k8s.log (time,... |
-- Insert settings from config file into DB
INSERT IGNORE INTO
`settings`(
`community_rate`,
`team_rate`,
`project_rate`,
`curator_rate`,
`common_comment`,
`bot_holiday`,
`holiday_days`,
`daily_curation`,
`bot_account`
)
VALUES (
'COMMUNITY_RATE',
'TEAM_RATE',
'PROJECT_RA... |
-- 全列 / 投影查询
-- 1. 查询所有员工信息
SELECT * FROM emp;
-- 2. 查询每个员工的编号, 姓名, 职位
SELECT EMPNO, ENAME, JOB FROM emp;
-- 3. 查询所有部门信息
DESC dept;
SELECT DEPTNO, DNAME, LOC FROM dept;
-- 消除重复
-- DISTINCT关键字可以用于一列, 也可以用于多列
-- 1. 查询所有有有员工的部门编号
SELECT DEPTNO FROM emp;
SELECT DISTINCT DEPTNO FROM emp;
-- 2. 查询哪些部门和职位有员工
SELECT DEPTNO, J... |
ALTER SCHEMA schema1 RENAME TO schema2;
ALTER SCHEMA schema1 OWNER TO new_owner;
ALTER SCHEMA schema1 QUOTA 50 GB;
ALTER SCHEMA schema1 QUOTA UNLIMITED;
|
<filename>ifs-data-layer/ifs-data-service/src/main/resources/db/migration/V165_1_3__allow_international_address_to_be_updated_in_ps.sql
-- Make changes so that the international address can be changed in PS without affecting the original application
ALTER TABLE partner_organisation
ADD COLUMN international_address_id... |
<reponame>CSCfi/antero<gh_stars>1-10
IF NOT EXISTS (select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='dw' and TABLE_NAME='d_liikkuvuusohjelma') BEGIN
CREATE TABLE dw.d_liikkuvuusohjelma(
id int IDENTITY(1,1) NOT NULL,
loadtime datetime NOT NULL,
source varchar(100) NOT NULL,
username varchar(30) NOT ... |
CREATE VIEW acs2009_5yr.B07401 AS SELECT
geoid,
B07401001,
B07401002,
B07401003,
B07401004,
B07401005,
B07401006,
B07401007,
B07401008,
B07401009,
B07401010,
B07401011,
B07401012,
B07401013,
B07401014,
B07401015,
B07401016,
B07401017,
B07401018,
B07401019,
B07401020,
B07401021,
B07401022,
B07401023,
B07401024,
B0740102... |
<filename>app/lib/db_query/sql/development/topicStatsHistory/topicStatsC.sql
/*
There were issues moving this to topic stats because doing two
inner joins in a row doesn't look right and it's not natural to do count
of countries and towns separately when using distinct.
*/
/*
Join on Country table which necessarily f... |
-- Copyright (C) The Arvados Authors. All rights reserved.
--
-- SPDX-License-Identifier: AGPL-3.0
SET statement_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 xmloption = content;
SET clien... |
<filename>src/kexp/snowflake/sql/extract_shows.sql
copy into @owlmtn.stage.KEXP_PUBLIC/export/import_kexp_show
from (
select LOAD_ID,
FILENAME,
FILE_ROW_NUMBER,
SHOW_ID,
PROGRAM_ID,
PROGRAM_NAME,
PROGRAM_TAGS,
... |
<reponame>diegopablomansilla/ms14<filename>files/db/src_templates/AsientoContable_q1.sql
SELECT AsientoContable_0.id AS id_0
, AsientoContable_0.numero AS numero_1
, AsientoContable_0.fecha AS fecha_2
, AsientoContable_0.detalle AS detalle_3
, AsientoContable_0.ejercicioContable AS ejercicioContable_4
, Asiento... |
# --- !Ups
alter table basic_event drop constraint fk_basic_event_detectionMethod_2;
drop table if exists detection;
alter table basic_event DROP COLUMN detection_method_id;
alter table basic_event ADD COLUMN detection_type integer;
alter table basic_event ADD COLUMN simple_threshold double;
alter table basic_event A... |
-- 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'Converting namespace to v3 format on [edfi... |
-- liquibase formatted sql
-- changeset Lang:h-team-employee-1
-- 关联表:R_TEAM_EMPLOYEE
DROP TABLE IF EXISTS R_TEAM_EMPLOYEE;
CREATE TABLE IF NOT EXISTS R_TEAM_EMPLOYEE
(
`TEAM_ID` VARCHAR(36) COMMENT '「teamId」- 组的ID',
`EMPLOYEE_ID` VARCHAR(36) COMMENT '「employeeId」- 员工ID',
`COMMENT` TEXT COMMENT '「c... |
<gh_stars>1-10
SELECT
RCD.*
FROM
RULE_CONDITION_DEFINITION RCD
JOIN RULE_DEFINITION RUD ON (RCD.RUD_ID = RUD.ID)
JOIN WF_ACTIVITY_DEFINITION WAD ON (RUD.ITEM_ID = WAD.WFAD_ID)
WHERE
WAD.WFWD_ID = @WFWD_ID;
|
<gh_stars>1-10
CREATE TABLE messages (
id SERIAL PRIMARY KEY,
createAt TIMESTAMP,
contents TEXT
)
|
<reponame>SKalt/pg_sql_parser_tests
#include <stdio.h>
EXEC SQL BEGIN DECLARE SECTION;
char dbname[1024];
EXEC SQL END DECLARE SECTION;
int
main()
{
EXEC SQL CONNECT TO testdb1 AS con1 USER testuser;
EXEC SQL SELECT pg_catalog.set_config('search_path', '', false); EXEC SQL COMMIT;
EXEC SQL CONNECT TO ... |
/*
Navicat Premium Data Transfer
Source Server : myserver
Source Server Type : MySQL
Source Server Version : 50735
Source Host : 192.168.1.110:3306
Source Schema : food_menu
Target Server Type : MySQL
Target Server Version : 50735
File Encoding : 65001
Date: 04/01/20... |
DO
$$
BEGIN
IF register_patch('AddReviewerIdToReviewsTable.sql', 'jekabskarklins', 'Add technical reviewer id reviews table', '2021-05-04') THEN
ALTER TABLE technical_review ADD COLUMN reviewer_id INTEGER NOT NULL REFERENCES users (user_id) DEFAULT 0;
ALTER TABLE technical_review ALTER COLUMN reviewer_id DR... |
-- Now that remora is gone we can clean up all the old cruft
DROP TABLE IF EXISTS `addons_pledges`;
DROP TABLE IF EXISTS `cache`;
DROP TABLE IF EXISTS `collection_addon_recommendations`;
DROP TABLE IF EXISTS `facebook_data`;
DROP TABLE IF EXISTS `facebook_detected`;
DROP TABLE IF EXISTS `facebook_favorites`;
DROP TA... |
<reponame>jqueguiner/cds
-- +migrate Up
CREATE TABLE IF NOT EXISTS "workflow_run_secret" (
"id" VARCHAR(36) NOT NULL PRIMARY KEY,
"workflow_run_id" BIGINT NOT NULL,
"context" TEXT NOT NULL,
"type" VARCHAR(50) NOT NULL,
"name" TEXT NOT NULL,
"cypher_value" BYTEA,
"sig" BYTEA,
"signer" TEX... |
<gh_stars>0
/*
-- Query: Select * From jbselection where archived!=1 order by JbNumeric
LIMIT 0, 1000
-- Date: 2017-05-08 23:43
*/
INSERT INTO `jbselection` (`Id`,`JbLetter`,`JbNumber`,`JbNumeric`,`A1Song`,`A2Song`,`B1Song`,`B2Song`,`Artist1`,`Artist2`,`ImageStripName`,`MusicCategory`,`Archived`,`ImageStripTemplate`) ... |
<reponame>luqmansen/blogo
create table if not exists reacts
(
id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name varchar(30) not null,
thumbnail_url varchar(250) not null,
created_at timestamp default current_timestamp,
updated_at timestamp default current_timestamp... |
<gh_stars>0
cl scr
SET ECHO OFF
SET VERIFY ON
SET FEEDBACK ON
PROMPT " d.schwarz Axklen"
PROMPT " ·················································"
PROMPT " "
PROMPT " ███████╗███████╗██╗███████╗███╗ ███╗██╗██╗ ██╗"
PROMPT " ██╔════... |
DROP TABLE IF EXISTS books;
CREATE TABLE books (
id SERIAL PRIMARY KEY,
author VARCHAR(255),
title VARCHAR(255),
isbn VARCHAR(25),
image_url TEXT,
description TEXT,
bookshelf VARCHAR(255)
);
INSERT INTO book(id, author, title, isbn, image_url, description, bookshelf)
VALUES ('<NAME>', 'Dune', 'ISBN_13 9... |
<reponame>luist18/feup-bdad-proj<gh_stars>0
INSERT INTO inoculation (id, inoculation_number, date, vaccination_centre_id, vaccine_id, citizen_id) VALUES (1, 1, '2020-12-16', 75, 17, 713);
INSERT INTO inoculation (id, inoculation_number, date, vaccination_centre_id, vaccine_id, citizen_id) VALUES (2, 1, '2021-02-07', 72... |
ALTER TABLE "public"."producer" ADD COLUMN "fork_db_head_block_id" varchar NULL;
|
<filename>application/tb_login.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 23, 2020 at 12:58 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;... |
SELECT Username, Age
FROM Users
ORDER BY Age, Username DESC |
select 'true' from m_user where user_id = /* userId */'a'
|
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 25 Nov 2019 pada 07.21
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
INSERT INTO category (_id, title, left, right) VALUES (-1, '<SPLIT_CATEGORY>', 0, 0); |
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? |
<gh_stars>100-1000
SELECT col1
FROM {{ this }}
|
<reponame>git-hulk/memefish
create index foo_bar on foo (
bar desc,
baz asc,
)
|
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `version` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`number` varchar(20) NOT NULL,
`at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO `version` (`number`) VALUES ('0.18.1');
CREATE TABLE IF ... |
-- file:inet.sql ln:129 expect:true
SELECT ('fd00:a516:7c1b:17cd:6d81:2137:bd2a:2c5b'::inet + 257) - 257
|
-- file:foreign_data.sql ln:62 expect:true
ALTER FOREIGN DATA WRAPPER foo OPTIONS (DROP c)
|
DROP TABLE IF EXISTS `wikipedia`;
CREATE TABLE `wikipedia`
SELECT
/* Time Spec :-) */
CONVERT(DATE_FORMAT(`__time`, "%Y-%m-%d %H:%i:00"), DATETIME) AS "__time", /* Rollup queryGranularity: minute */
/* Dimensions */
`sometimeLater`,
`channel`,
`cityName`,
`comment`,
`commentLength`,
`commentLengthSt... |
BEGIN TRANSACTION;
WITH dups AS
(
SELECT id,
ROW_NUMBER() OVER(PARTITION BY name ORDER BY id ASC) rn
FROM profile
)
UPDATE profile
SET name = name || case when dups.rn = 1 then '' else (dups.rn-1)::text end
FROM dups
WHERE dups.id = profile.id;
END TRANSACTION;
|
-- 复合主键
DROP TABLE IF EXISTS `sample_order`;
CREATE TABLE `sample_order` (
`id` int(32) NOT NULL DEFAULT '0' COMMENT 'id',
`order_no` varchar(32) NOT NULL DEFAULT '' COMMENT '订单号',
`user_id` varchar(32) DEFAULT NULL COMMENT '用户ID',
`gmt_create` timestamp NULL DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`,`or... |
CREATE TABLE ${ohdsiSchema}.cohort_analysis_gen_info (
source_id int NOT NULL,
cohort_id int NOT NULL,
last_execution Timestamp(3),
execution_duration int,
fail_message varchar(2000),
PRIMARY KEY (source_id, cohort_id)
);
CREATE TABLE ${ohdsiSchema}.cohort_analysis_list_xref (
source_id int,
cohort_id int... |
<reponame>archzi/druid<filename>src/main/resources/tpcds/query91.sql
select
cc_call_center_id Call_Center,
cc_name Call_Center_Name,
cc_manager Manager,
sum(cr_net_loss) Returns_Loss
from
call_center,
catalog_returns,
date_dim,
customer,
customer_a... |
-- Distributed snapshot tests
-- Scenario1: Test to validate GetSnapshotData()'s computation of globalXmin using
-- distributed snapshot. It mainly uses a old read-only transaction to help
-- create situation where globalXmin can be lower than distributed oldestXmin
-- when calling DistributedLog_AdvanceOldestXmin().
... |
<filename>DETALYES/sql/supply_procurement_system-1.sql
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 24, 2017 at 11:09 AM
-- Server version: 5.6.17-log
-- PHP Version: 5.5.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4010... |
<reponame>mzabani/codd
ALTER DATABASE "codd-experiments" SET default_transaction_isolation TO 'serializable';
SET default_transaction_isolation TO 'serializable'; |
CREATE OR REPLACE PROCEDURE Phy_Loc1 AS
CURSOR PHYCUR IS
(SELECT ACC_START, ACC_END, B.ID, CHROMOSOME_ID
FROM NAUTIL<EMAIL>H.GOV A,
NUCLEIC_ACID_SEQUENCE B,
CHROMOSOME C
WHERE A.CHROMOSOME = C.CHROMOSOME_NUMBER
AND B.ACCESSION_NUMBER = A.ACCESSION_NUM);
V_COUNT NUMBER:=0;
... |
<gh_stars>0
/*
MySQL Backup
Source Server Version: 5.7.19
Source Database: prueba
Date: 18/10/2017 14:38:58
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----------------------------
-- Table structure for `empleador`
-- ----------------------------
DROP TABLE IF EXISTS `empleador`;
CREATE TABLE `empleador` (
`id` int(11) NOT N... |
<reponame>kepo123/BlizzCMS
/*
SQLyog Ultimate v11.11 (64 bit)
MySQL - 5.6.39-log : Database - blizzcms
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!4... |
DROP TABLE [portal].[IncidentHistory]; |
CREATE PROCEDURE [dbo].[app_SurveyQuestion_MoveUp] @QID INT
AS
DECLARE @CurrentRecordLocation INT,
@PreviousRecordID INT,
@SID INT
SELECT @CurrentRecordLocation = QNumber,
@SID = SID
FROM SurveyQuestion
WHERE QID = @QID
EXEC [dbo].[app_SurveyQuestion_Reorder] @SID
IF @CurrentRecordLocation > 1
BEGIN
SELECT @Pr... |
BEGIN;
CREATE TABLE decreto(
empleado int,
nro_decreto int,
fecha date NOT NULL,
nombre_cargo varchar(50) NOT NULL,
CONSTRAINT pk_decreto
PRIMARY KEY (empleado, nro_decreto),
CONSTRAINT fk_empleado
FOREIGN KEY (empleado)
REFERENCES empleado (documento)
);
COMMIT;
|
-- Script-chuleta para crear una base de datos y un usuario, y asignarle a éste todos los privilegios sobre dicha base de datos
-- futbol es el nombre que queremos darle a la base de datos
-- marta es el nombre que queremos darle al usuario
-- passworddemarta es la contraseña que queremos asignarle al usuario
CREA... |
<reponame>lovelysystems/apgdiff
REVOKE ALL ON SEQUENCE table1_id_seq FROM public;
GRANT SELECT, USAGE ON SEQUENCE table1_id_seq TO public;
REVOKE ALL ON TABLE table1 FROM public;
GRANT SELECT, UPDATE ON TABLE table1 TO public;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 21, 2020 at 06:29 AM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.1.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>ploidddddd/purplekeep
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 07, 2017 at 06:33 AM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.