sql stringlengths 6 1.05M |
|---|
<gh_stars>1-10
insert into t_role (id,name,code,`describe`) values('42ed144b-76ef-4634-ba6b-b6664105401d','美容','service','洗澡,修剪');
-- ----------------------------
-- Table data for t_role_menu
-- ----------------------------
-- 美容 --
insert into t_role_menu (id,menu_code,role_code) values(uuid(),'FM0320','nurse');
INS... |
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "public"."notebook_event" add column "structure" varchar
-- null;
-- Could not auto-generate a down migration.
-- Please write an appropriate down migration for the SQL below:
-- alter table "... |
BEGIN
FOR s IN (SELECT sequence_name FROM user_sequences) LOOP
EXECUTE IMMEDIATE ('DROP SEQUENCE ' || s.sequence_name);
END LOOP;
FOR c IN (SELECT table_name FROM user_tables where table_name not like 'DR$%' ) LOOP
EXECUTE IMMEDIATE ('DROP TABLE "' || c.table_name || '" CASCADE CONSTRAINTS');
END LOOP;
END; |
.@classpath mysql ../drivers/mysql-connector-java-8.0.25.jar
.open -u root mysql://localhost/?useUnicode=true&characterEncoding=utf-8&useSSL=false
|
<reponame>csamak/asterixdb
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2... |
DROP view if exists view_beban_penyusutan_pm_2020_r2_a1 CASCADE;
create view view_beban_penyusutan_pm_2020_r2_a1 as
select register,
nama_skpd,
id_skpd,
nama_lokasi_bidang,
id_lokasi_bidang,
nama_kabupaten,
id_kabupaten,
nama_provinsi,
id_provinsi,
id_mutasi_berkurang,
mutasi_berkurang,
keadaan_barang,
nama_barang,
... |
<reponame>Chronopolis-Digital-Preservation/chronopolis-core
-- just doing a naive update on the ace_token tables take a tremendous amount of time, likely
-- because of the indexes which need updated. to mitigate this we take a few extra steps:
-- 1: create a new table for ace_tokens (ace_token_migration)
-- 2: insert i... |
<reponame>apfrankowski/insights
DELIMITER $$
CREATE DEFINER=`symulator`@`%` PROCEDURE `InsightsIndicatorsUpdate`( IN in_id_szpital INT(10) unsigned, IN id_data_od int(7), IN id_data_do int(7) )
BEGIN
DROP TABLE IF EXISTS afr_osobodni_azl;
CALL PoliczOsobodniAZLPlanowe_AFR( in_id_szpital, id_data_od-100, id_data_do )... |
<reponame>martinligotnis/tech<filename>venden_techreport_19.02.2020.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 19, 2021 at 03:37 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSA... |
<reponame>vivivibo/pipeline
BEGIN;
select _v.unregister_patch( '003-msm-index' );
-- Bring our bugs back!
alter table http_control alter column msm_no drop not null;
alter table http_request alter column msm_no drop not null;
alter table http_verdict alter column msm_no drop not null;
alter table tcp alter column msm... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:opengauss关键字outer(保留),作为角色名
--关键字不带引号-合理报错
drop role if exists outer;
create role outer with password '<PASSWORD>' valid until '2020-12-31';
--关键字带双引号-成功
drop role if exists "outer";
create role "outer" with password '<PASSWORD>' valid until '2020-12-31';
--清理... |
<filename>StoredProcedureStatistics.sql
CREATE EVENT SESSION [StoredProcedureStatistics] ON SERVER
ADD EVENT sqlserver.rpc_completed(SET collect_statement=(1)
ACTION(package0.collect_system_time,sqlos.task_time,sqlserver.client_app_name,sqlserver.client_hostname,sqlserver.session_id)
WHERE ([sqlserver].[equ... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.3.16
-- Dumped by pg_dump version 9.6.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_mi... |
<gh_stars>0
CREATE PROCEDURE [dbo].[usp_sqlwatch_logger_xes_query_problems]
as
set nocount on
declare @snapshot_type_id tinyint = 31,
@snapshot_time datetime2(0),
@target_data_char nvarchar(max),
@target_data_xml xml
declare @execution_count bigint = 0,
@session_name nvarchar(64) = 'SQLWATCH_query_problems... |
INSERT INTO song (artist, album, title)
VALUES
('<NAME>', 'A Matter of Life and Death', 'For the Greater Good of God'),
('I<NAME>', 'Fear of the Dark', 'Fear of the Dark')
; |
begin;
select * from no_plan();
SELECT schema_privs_are(
'api', 'webuser', ARRAY['USAGE'],
'authenticated users should have usage privilege of the api schema'
);
-- switch to a anonymous application user
/*
* set local role anonymous;
* set request.jwt.claim.role = 'anonymous';
*
* select set_eq(
* ... |
SELECT steam_id_tbl.steam_id AS "steam_id",
player_name_tbl.name AS "name"
FROM steam_id_player_name_reference_tbl
INNER JOIN steam_id_tbl ON steam_id_tbl.id = steam_id_player_name_reference_tbl.steam_id_id
INNER JOIN player_name_tbl ON player_name_tbl.id = steam_id_player_name_reference_tbl.player_name_id |
<reponame>dlliwei/es-example1<filename>src/main/resources/sql.sql
CREATE DATABASE IF NOT EXISTS `news` DEFAULT CHARACTER SET utf8;
USE `news`;
DROP TABLE IF EXISTS `news`;
CREATE TABLE `table1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(100) DEFAULT NULL,
`content` mediumtext,
`url` varchar(100)... |
<filename>public/assets/migrations/2017_07_17_084200_create_clinic_appointment_table.sql
create table clinic_appointment select * from patient_appointment// |
<reponame>sxinger/grouse
/* cms_dx_by_enc_type -- CMS ETL Diagnosis report based on PCORNet CDM EDC Table IVA.
ref
Table IVA. Diagnosis Records Per Encounter and Per Patient, Overall and by Encounter Type
*/
select enc_type from pcornet_encounter where 'dep' = 'cms_enc_dstats.sql';
whenever sqlerror continue; drop ... |
-- Table: extra_fantasy.playerstats_fantasy_yearly
-- DROP TABLE extra_fantasy.playerstats_fantasy_yearly;
CREATE TABLE extra_fantasy.playerstats_fantasy_yearly
(
playerstats_fantasy_yearly_id serial NOT NULL,
nflcom_player_id character varying(10),
source character varying NOT NULL,
source_player_id characte... |
CREATE procedure [CommonModuleTests].[test log4.ExceptionHandler hides error after handling exception]
as
begin
exec tSQLt.FakeTable @TableName = 'log4Private.SqlException', @Identity = 1 ;
exec tSQLt.SpyProcedure 'log4Private.SessionInfoOutput', 'select 1 / 0 as [ForcedError] into #tmp;';
exec tSQLt.ExpectNoEx... |
<reponame>jermiy/services-core
-- Start transaction and plan the tests.
BEGIN;
SELECT plan(2);
-- throw error
PREPARE subject_force_any_of_roles AS select core.force_any_of_roles('{platform_user}');
set local role anonymous;
select throws_like(
'subject_force_any_of_roles',
'%insufficient_privilege',
'Shou... |
CREATE TABLE IF NOT EXISTS `practice_order_info` (
id bigint(20) primary key auto_increment,
status varchar(10) not null default 'CREATED',
create_time datetime(3) not null default current_timestamp(3)
) ENGINE=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4 COMMENT='order 延迟任务表'; |
ALTER TABLE SUBAWARD_FUNDING_SOURCE
ADD CONSTRAINT FK_SUBAWARD_FUNDING_SOURCE
FOREIGN KEY (SUBAWARD_ID) REFERENCES SUBAWARD (SUBAWARD_ID)
/
|
/*
Warnings:
- A unique constraint covering the columns `[meiId]` on the table `Usuario` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE `Usuario` ADD COLUMN `meiId` INTEGER NULL;
-- CreateTable
CREATE TABLE `Mei` (
`id` INTEGER NOT NULL AUTO_INCREMENT,
... |
<reponame>Angeldxy/g12goods<gh_stars>0
-- MySQL dump 10.13 Distrib 8.0.22, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: oomall_log
-- ------------------------------------------------------
-- Server version 8.0.22
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... |
SELECT * FROM contributions_small_count;
|
<reponame>goldmansachs/obevo-kata
CREATE FUNCTION func551() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE117);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE261);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE37... |
<reponame>goldmansachs/obevo-kata
CREATE FUNCTION func244() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE240);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE210);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE10... |
CALL zproc_validate_send_adminuser_otp('a'); |
create table Equipo(ci int(50) not null , nombre varchar(50))
INSERT INTO usuarios (ci,nombre) VALUES(12,'tomas')
SELECT * FROM usuarios |
DROP TABLE IF EXISTS requested_grants;
|
<filename>burgercode_fini.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: May 26, 2016 at 04:42 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... |
<reponame>WEBJU/fm
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 03, 2021 at 09:06 AM
-- Server version: 8.0.23
-- PHP Version: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER... |
<reponame>five3/python-sdet<filename>db.sql
/*
Navicat MySQL Data Transfer
Source Server : testqa
Source Server Version : 50725
Source Host : www.testqa.cn:3306
Source Database : sdet
Target Server Type : MYSQL
Target Server Version : 50725
File Encoding : 65001
Date: 2021-02-23 21... |
<gh_stars>0
--select * from users order by id desc;
--delete from users where id >= 3
/*
1. READ
A user
- has many texts (because texts has a reference to user.id, so we get a 1-to-many from users to texts)
- has many groups (because we have a many-to-many relating users and groups, thanks to the link table)
W... |
<filename>database/populate_extras.sql
use ALUC;
-- Administradores
INSERT INTO administrador (id) VALUES ('0105070353');
INSERT INTO administrador (id) VALUES ('1400967715');
-- Moderadores
INSERT INTO moderador (id, id_laboratorio) VALUES ('1400567572', '1');
INSERT INTO moderador (id, id_laboratorio) VALUES ('010... |
<reponame>s-a-zhd/Hospital-Management-Laravel
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 14, 2020 at 08:00 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;... |
select
ticker,
currency,
date,
avg(rate) open,
avg(high) high,
avg(low) low,
min(dw_created_at) dw_created_at
from
dw.:table
where
currency = upper(':ticker')
and date = ':date'
group by
1, 2, 3
;
|
CREATE OR REPLACE FUNCTION reverse_geocode(latitude DOUBLE PRECISION, longitude DOUBLE PRECISION, OUT country_iso VARCHAR, OUT country VARCHAR, OUT city VARCHAR, OUT street VARCHAR, OUT housenumber VARCHAR, OUT distance DOUBLE PRECISION) STABLE AS $$
DECLARE
MAX_HOUSENUMBER_DISTANCE CONSTANT SMALLINT := 50;
MAX_STREE... |
/*
Navicat Premium Data Transfer
Source Server : MySQL-本机-127.0.0.1
Source Server Type : MySQL
Source Server Version : 50717
Source Host : localhost:3306
Source Schema : lucky_log
Target Server Type : MySQL
Target Server Version : 50717
File Encoding : 65001
Date: 18... |
USE users;
INSERT INTO user (timestamp,id,uid,name,gender,email,phone,dept,grade,language,region,role,preferTags,obtainedCredits) VALUES
("1506328859005", "u5", "5", "user5", "male", "email5", "phone5", "dept16", "grade4", "zh", "Beijing", "role2", "tags11", "16"),
("1506328859006", "u6", "6", "user6", "female", "... |
--
-- pgwt.types
--
--------------------------------------------------------------------------------
CREATE TYPE pgwt.request_method AS ENUM (
'GET', 'POST', 'PATCH', 'PUT', 'DELETE', 'OPTIONS'
);
--------------------------------------------------------------------------------
|
<filename>scripts/List of computers that requested full zip.sql
--List of computers that requested full zip (thanks to Arjun2228)
-- https://www.symantec.com/connect/articles/handy-sql-queries-sepm-v14
-- symantec.com/connect/forums/sql-query-get-list-computers-requested-full-zip
USE [sem5]
SELECT SEM_COMPUTER.COMPUTE... |
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.OpenItems_Report_Details(IN AD_Org_ID numeric, IN C_BPartner_ID numeric, IN IsSOTrx character varying, IN DaysDue numeric, IN InvoiceCollectionType character varying, IN StartDate date, In EndDate date, IN Reference_Date date, IN PassForPayment character varyin... |
<filename>etc/schema/functions/eth_getBlockTransactionCountByNumber.sql
DROP FUNCTION IF EXISTS eth_getBlockTransactionCountByNumber(blockno) RESTRICT;
CREATE FUNCTION eth_getBlockTransactionCountByNumber(block_id blockno) RETURNS bigint AS $$
DECLARE
result bigint;
BEGIN
-- FIXME: return NULL for unknown blocks
... |
<filename>flyway/flywaymigrations/V0.0014__add_municipalities.sql
INSERT INTO digilog.municipality (name_de, url, state_id)
SELECT m.name as name_de, '' as url, state.id as state_id
FROM (
VALUES ('Kappel am Albis', 'Zürich'),
('Knonau', 'Zürich'),
('Maschwanden', 'Zürich'),
... |
/*
* Copyright 2020 johnny850807 (Waterball)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... |
/*
INSERT INTO authority (id,name) VALUES (NEXT VALUE FOR authority_seq,'Cadastro');
INSERT INTO role (id,name) VALUES (NEXT VALUE FOR role_seq,'ROLE_ADMIN');
INSERT INTO role (id,name) VALUES (NEXT VALUE FOR role_seq,'ROLE_DEFAULT');
INSERT INTO user (id,username,password, first_name,last_name,email,enabled,last_passw... |
<reponame>danilomendes12/Learn2Play
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table comentario (
id bigint auto_increment not null,
title varchar(255),
creator_id bigi... |
<filename>intents/data/spider_eval/spider/database/concert_singer/schema.sql
version https://git-lfs.github.com/spec/v1
oid sha256:0668dd3eb03d4122b0319ad87ad6c062a21b5a0a8e4383604377f17693844971
size 3021
|
<filename>migrations/frontend/1528395751_add_unique_constraint_to_external_service_repos.up.sql<gh_stars>1-10
BEGIN;
LOCK TABLE external_service_repos;
-- Drop trigger as we don't want it to fire
DROP TRIGGER IF EXISTS trig_soft_delete_orphan_repo_by_external_service_repo
ON external_service_repos;
WITH dups AS (SEL... |
-- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64)
--
-- Host: localhost Database: great_edu
-- ------------------------------------------------------
-- Server version 5.7.23-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... |
<gh_stars>100-1000
create table widetable (col1 float(10), col2 float) as select * from test |
<reponame>Energinet-DataHub/geh-metering-point<filename>source/Energinet.DataHub.MeteringPoints.ApplyDBMigrationsApp/Scripts/Model/202109270930 Add MessageHubMessages table.sql
CREATE TABLE [dbo].[MessageHubMessages]
(
[Id] UNIQUEIDENTIFIER NOT NULL,
[RecordId] INT IDENTITY(1,1) NOT NULL,
[Correlation] NVAR... |
<gh_stars>10-100
-- Now supports creating GIN, GiST, and other expression indexes on the destination table as they exist on the source table. Previously, all indexes were recreated as b-tree (if at all) no matter what kind of index they were on the source.
-- Above change led to major rewriting of the underlying code f... |
with `cross_items` as (select `i_item_sk` as `ss_item_sk`
from (select `iss`.`i_brand_id` as `brand_id`, `iss`.`i_class_id` as `class_id`, `iss`.`i_category_id` as `category_id`
from `store_sales`
where `ss_item_sk` = `iss`.`i_item_sk` and `ss_sold_date_sk` = `d1`.`d_date_sk` and `d1`.`d_year` between asymmetric 1999 a... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.3
-- Dumped by pg_dump version 12.3
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', '', fal... |
<filename>src/main/sql/upgrades/0.4.4-oracle.sql
-- Extend the length of the 'content_type' column:
alter table vortex_resource modify
(
content_type varchar2(128)
);
|
<filename>examples/write-1.sql
INSERT INTO test DEFAULT VALUES RETURNING id
|
--TEST: test with columns with a foreign key
create table var_samp_pk(
col1 date not null,
col2 time default '10:10:10',
col3 timestamp default SYS_TIMESTAMP primary key,
col4 datetime,
col5 int
);
--create a table with a column referncing a column in another table
create table var_samp_fk(
col1 bigint defaul... |
DROP TABLE "public"."RoomPersonRole";
|
<reponame>liveprojects-alex/gaddum_app
SELECT * FROM music_provider_settings
WHERE
[provider] = ?1
AND
[id] = ?2 |
EXEC [EST].[Proc_yjbb_Ins] @Code = N'603058',@CutoffDate = N'2017-09-30',@EPS = N'0.1379',@EPSDeduct = N'0',@Revenue = N'2.22亿',@RevenueYoy = N'-0.94',@RevenueQoq = N'22.37',@Profit = N'5812.24万',@ProfitYoy = N'-13.59',@ProfiltQoq = N'11.91',@NAVPerUnit = N'1.9434',@ROE = N'7.27',@CashPerUnit = N'0.1597',@GrossProfitRa... |
<reponame>nullivex/node-portal-skeleton
ALTER TABLE `Saleleap`.`disputes`
ADD COLUMN `SellerId` INT(11) NULL DEFAULT NULL AFTER `updatedAt`; |
<gh_stars>0
/*
Missing Index Details from SQLQuery6.sql - (local).FAAD2 (sa (51))
The Query Processor estimates that implementing the following index could improve the query cost by 53.7441%.
*/
USE [FAAD2]
GO
CREATE NONCLUSTERED INDEX IDX_crmOppStageHistory_01
ON [dbo].[crmOppStageHistory] ([OppID])
INCLUDE ([OppSta... |
INSERT INTO UserRoles( username ,password) VALUES('<PASSWORD>',5<PASSWORD>);
INSERT INTO UserRoles( username ,password) VALUES('<PASSWORD>',<PASSWORD>);
INSERT INTO UserRoles( username ,password) VALUES('Onke',2752);
|
-- after "FROM purchases" add code to get rows where the "category" column is "food"
-- or the "character_name" column name is "<NAME>"
SELECT *
FROM purchases
WHERE category="food"
OR character_name="<NAME>"; |
USE `autoclub`;
DROP procedure IF EXISTS `sp_ListTableData`;
DELIMITER $$
CREATE PROCEDURE `sp_ListTableData` (IN TableName VARCHAR(100))
BEGIN
SET @sql =CONCAT('SELECT * FROM ',TableName);
PREPARE statement FROM @sql;
EXECUTE statement;
DEALLOCATE PREPARE statement;
END$$
DELIMITER ;
|
<reponame>jdkoren/sqlite-parser
-- randexpr1.test
--
-- db eval {SELECT case +c-case (select case count(distinct 13) when min(19*e) then ~count(*) else ~min(case when not +13*(case when e*c>=e then e else f end)-a+c not in (b,t1.b,t1.e) then 19 else 17 end*a) end from t1) when 11 then 11 else c end+t1.c when t1.b then... |
<filename>docs/vuln_samples/sqlite-bad-ptr.sql
SELECT 0 UNION SELECT 0 ORDER BY 1 COLLATE"""""""";
|
use sakila;
select * from actor, film, customer;
Select * from film;
select distinct film language from language as alias;
select count * (type) store;
select count * (type) employees;
select * into employees from first names
|
/* 'name's are already unique, so it would allow 1 NULL value. */
ALTER TABLE secrets ALTER COLUMN name SET NOT NULL;
ALTER TABLE secrets ALTER COLUMN secret SET NOT NULL;
ALTER TABLE secrets ALTER COLUMN version SET NOT NULL;
ALTER TABLE secrets ALTER COLUMN metadata SET NOT NULL;
ALTER TABLE secrets ALTER COLUMN cre... |
<gh_stars>10-100
CREATE INDEX "identity_verifiable_addresses_nid_identity_id_idx" ON "identity_verifiable_addresses" (identity_id, nid); |
udf: e209
sql: |
CREATE TEMPORARY FUNCTION ... ;
unk: 7
|
/*
-- This shows the critical semantic difference between "now()" (transactional)
-- and "clock_timestamp()" (non-transactional).
do $body$
declare
t0 timestamptz;
t1 timestamptz;
diff interval;
d numeric;
begin
perform pg_sleep(1.0);
t0 := now();
t1 := clock_timestamp();
diff := (t1 - t0);... |
ALTER TABLE AllstarFull RENAME TO tmp_allstarfull;
ALTER TABLE tmp_allstarfull RENAME TO allstarfull;
ALTER TABLE FieldingOF RENAME TO tmp_fieldingof;
ALTER TABLE tmp_fieldingof RENAME TO fieldingof;
ALTER TABLE Salaries RENAME TO tmp_salaries;
ALTER TABLE tmp_salaries RENAME TO salaries;
ALTER TABLE Appearances RENAME... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 13, 2020 at 10:40 AM
-- Server version: 10.1.44-MariaDB-0ubuntu0.18.04.1
-- PHP Version: 7.2.26-1+ubuntu18.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTI... |
<filename>db_setup/func_calc_mph.sql
create or replace function cmn.calcMPH(dist_mi decimal, tm_sec decimal)
returns decimal
as $$
--calculate miles per hour based on the passed distance and time
SELECT
round(dist_mi / tm_sec*3600,2)
;
$$ LANGUAGE SQL
|
-- SELECT * result in a sequential scan
SELECT *
FROM title_basics;
-- Predicates involving an index can be more efficient (also pay attention to the width)
SELECT *
FROM title_basics
WHERE "tconst" = 368226;
-- Selecting fewer attributes reduces the width
SELECT "originalTitle", "runtimeMinutes"
FROM title_basics ... |
<gh_stars>0
-- @testpoint:opengauss关键字partial(非保留),作为视图名
--关键字partial作为视图名,不带引号,创建成功
CREATE or replace VIEW partial AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view partial;
--关键字partial作为视图名,加双引号,创建成功
CREATE or replace VIEW "partial" AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default... |
INSERT INTO shortstop_metric (
player_id,first_name,last_name,wRC,BB_percent,K_percent,barrel_p,hardhit_p,max_exit,avg_EV,zone_contact,chase,BABIP
)
VALUES
(1,'Bo','Bichette',122,0.06,0.20,0.10,0.48,116,91,0.89,0.43,0.339),
(2,'JP','Crawford',103,0.08,0.17,0.02,0.30,111,86,0.92,0.26,0.320),
(3,'Isiah','<NA... |
-- add columns for username and password;
ALTER TABLE oskari_maplayer ADD COLUMN username character varying(256);
ALTER TABLE oskari_maplayer ADD COLUMN password character varying(256);
|
ALTER TABLE `zt_story` CHANGE `stage` `stage` ENUM('','wait','planned','projected','developing','developed','testing','tested','verified','released','closed') CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'wait';
ALTER TABLE `zt_todo` ADD `config` varchar(255) NOT NULL;
ALTER TABLE `zt_todo` ADD `cycl... |
CREATE TABLE public.account
(
id BIGSERIAL PRIMARY KEY,
username VARCHAR NOT NULL UNIQUE,
password VARCHAR NOT NULL
);
-- Useless but who knows
ALTER SEQUENCE account_id_seq RESTART 100 INCREMENT BY 50;
|
<gh_stars>0
-- CreateTable
CREATE TABLE `Product` (
`id` VARCHAR(191) NOT NULL,
`created_at` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
`created_by` VARCHAR(191) NULL,
`updated_at` DATETIME(3) NOT NULL,
`updated_by` VARCHAR(191) NULL,
`name` VARCHAR(191) NOT NULL,
`image` VARCHAR(191... |
\unset ECHO
\i test/setup.sql
SELECT plan(372);
--SELECT * FROM no_plan();
SET client_min_messages = warning;
CREATE SCHEMA ha;
CREATE TABLE ha.sometab(id INT);
CREATE SEQUENCE ha.someseq;
CREATE SCHEMA "LOL";
CREATE TABLE "LOL"."ATable"("AColumn" INT);
CREATE SEQUENCE "LOL"."ASeq";
-- Include the new schemas in the ... |
drop table if exists reported_adjudications;
create table reported_adjudications
(
id serial primary key,
prisoner_number varchar(7) not null,
booking_id bigint not null,
report_number bigint not null,
agency_id ... |
<filename>sis-db.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 11, 2020 at 05:57 AM
-- Server version: 8.0.21
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
<gh_stars>10-100
select pl.parameter,pl.type,pl.level,bf.estimate
from bbref._parameter_levels pl
left outer join bbref._basic_factors bf
on (bf.factor,bf.level,bf.type)=(pl.parameter,pl.level,pl.type)
where pl.type='random'
order by parameter,level;
|
-- changes to CFMBB 1.20 from 1.1/1.11
alter table cfmbb_settings add defaultIndex varchar(35) not null default 'forums.cfm';
alter table cfmbb_settings add enableChat smallint not null default 1;
alter table cfmbb_settings add useCaptcha smallint not null default 1;
alter table cfmbb_threads add views integer not nul... |
<filename>airbyte-integrations/bases/base-normalization/integration_tests/normalization_test_output/mssql/test_nested_streams/first_output/airbyte_incremental/test_normalization/unnest_alias.sql
USE [test_normalization];
if object_id ('test_normalization."unnest_alias_temp_view"','V') is not null
... |
<gh_stars>1-10
-- Table structure for table 'digitemp_alarms'
--
-- Table is intended to keep track of current alarms
-- and alarm history
--
--
CREATE TABLE digitemp_alarms (
alarm_id int(11) NOT NULL auto_increment,
SerialNumber varchar(17) NOT NULL,
Fahrenheit decimal(4,2) NOT NULL,
time_raised datetime NO... |
# this file is a placeholder, please refer template file from ../mysql_init_temlate
CREATE DATABASE IF NOT EXISTS `${MYSQL_DATABASE}` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
|
SELECT f1.person2, f2.person2
FROM (
SELECT * FROM FriendshipSymmetric WHERE person1 = <id>
) f1
JOIN ON
(
SELECT * FROM FriendshipSymmetric WHERE person1 = <id>
) f2
EXCEPT
(
SELECT * FROM FriendshipSymmetric
)
WHERE f1.person2 != f2.person2
|
-- 2020-08-18T12:46:03.061Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Reference_ID,DefaultValue,FieldLength,Version,IsKey,IsParent,IsTranslated,IsIdentifier,SeqNo,AD_Client_ID,IsActive,Created,CreatedBy,IsUpdateable,DDL_NoForeignKey,IsSelectionColumn,IsSyncDatabase,IsAl... |
INSERT INTO groups (id, parent_id, name, affects_gross) VALUES (1, 0, 'Assets', 0);
INSERT INTO groups (id, parent_id, name, affects_gross) VALUES (2, 0, 'Liabilities and Owners Equity', 0);
INSERT INTO groups (id, parent_id, name, affects_gross) VALUES (3, 0, 'Incomes', 0);
INSERT INTO groups (id, parent_id, name, aff... |
<reponame>olesgedz/Piscine_PHP<gh_stars>0
SELECT first_name, last_name, DATE(birthdate) from user_card
WHERE YEAR(birthdate) = '1976' ORDER by last_name; |
<reponame>uudashr/go-jobexec<filename>internal/mysql/migrations/1513125523_execution_trackers_table.up.sql
CREATE TABLE execution_trackers (
id bigint(11) UNSIGNED NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
last_executor varchar(255),
next_execution_time timestamp(6),
created_time timestam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.