sql stringlengths 6 1.05M |
|---|
<reponame>elifesciences/elife-xpub
ALTER TABLE manuscript
ADD COLUMN meta JSONB,
DROP COLUMN "meta,title",
DROP COLUMN "meta,article_type",
DROP COLUMN "meta,article_ids",
DROP COLUMN "meta,abstract",
DROP COLUMN "meta,subjects",
DROP COLUMN "meta,publication_dates",
DROP COLUMN "meta,notes"; |
-- file:async.sql ln:19 expect:true
UNLISTEN *
|
with get_cpu_percentage as (
SELECT snap_id,dbid,userid,queryid,substring(query, 1, 50) AS short_query,
round(total_time::numeric, 2) AS total_time_ms,
calls,
round(mean_time::numeric, 2) AS mean_time_ms,
round((100 * total_time / sum(total_time::numeric) OVER (partition by snap_id))::numeric, 2) AS percentage_cpu
FROM... |
-- 2020-03-23T09:03:54.362Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET SeqNo=10,Updated=TO_TIMESTAMP('2020-03-23 11:03:54','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2901
;
-- 2020-03-23T09:17:24.333Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configu... |
<filename>testNewsCI(1).sql
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 26, 2017 at 07:47 AM
-- Server version: 5.5.46-0ubuntu0.14.04.2
-- PHP Version: 5.5.9-1ubuntu4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40... |
<filename>resources/migrations/20170617161200-create-songs-table.down.sql
DROP TABLE song;
|
INSERT INTO users(name, email) VALUES ('satya' , '<EMAIL>'); |
<reponame>YatoEbisu/Desafio-CasaDoCodigoAPI
create table "Paises"(
"Id" uuid Primary Key,
"Nome" varchar not null
);
create table "Estados"(
"Id" uuid Primary Key,
"Nome" varchar not null,
"PaisId" uuid not null,
foreign key ("PaisId") references "Paises" ("Id")
); |
<filename>CustomerOrdersEnrichment/dml.statements.sql
-- kubectl -n river exec deploy/ksqldbcli -it -- bash
-- ksql http://ksqldbserver-external.river.svc.cluster.local:8088
SET 'auto.offset.reset' = 'earliest';
-- Show a new KStream of enriched orders
SELECT o.order_id AS order_identifier, AS_VALUE(o.order_id) AS or... |
select min(cal_dt) as min_cal_dt
from test_kylin_fact |
<filename>restservice/src/main/resources/liquibase/data/005-insert_data_to_role.sql
--liquibase formatted sql
--changeset vaa25:5
INSERT INTO role (id, name) VALUES
(-1, 'guest'),
(-2, 'admin'),
(-3, 'subscriber');
--rollback DELETE FROM role;
|
with users as (
select inferred_user_id, page_views
from {{ref('snowplow_users')}}
)
,
sessions as (
select inferred_user_id, sum(page_views) as page_views
from {{ref('snowplow_sessions')}}
group by 1
)
,
calc as (
select inferred_user_id,
users.page_views as users_page_views,
session... |
<reponame>PrestoConFuoco1/News-Server
CREATE OR REPLACE VIEW news.get_posts AS
SELECT tp.post_id,
tp.title,
tp.creation_date AS post_creation_date,
tp.author_id,
a.description AS author_description,
u.user_id,
u.firstname AS user_firstname,
u.lastname AS user_lastname,
u.image AS user_... |
CREATE TABLE BUC_IDENTIFISERT
(
id serial NOT NULL PRIMARY KEY,
rina_saksnummer VARCHAR(20) NOT NULL,
folkeregisterident VARCHAR(20) NOT NULL
);
CREATE INDEX idx_buc_identifisert_rina_saksnummer ON BUC_IDENTIFISERT(rina_saksnummer);
|
CREATE TABLE bookings(
id BIGINT(21) UNSIGNED AUTO_INCREMENT,
user_id BIGINT(21) UNSIGNED,
route_id BIGINT(21) UNSIGNED,
created_at DATETIME,
PRIMARY KEY(id)
);
ALTER TABLE bookings ADD CONSTRAINT user_bookings FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE ON UPDATE CASCADE; |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: mysql-lo07.alwaysdata.net
-- Generation Time: Jun 08, 2019 at 05:56 PM
-- Server version: 10.2.22-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
<gh_stars>0
USE [blockex]
GO
/****** Object: View [dbo].[vwEthBlocks] Script Date: 29/12/2020 2:29:18 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create view [dbo].[vwEthBlocks] as
select
_id,
Blockchain,
Source,
EthBlocks.Hash EthBlocksHash,
ParentHash,
Number,
timestamp,
EthBlocks.Nonce EthBl... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 02, 2021 at 11:51 PM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 30, 2017 at 04:12 AM
-- Server version: 10.1.24-MariaDB
-- PHP Version: 7.0.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
<reponame>railtoolkit/OpenLinTim<filename>src/essentials/postgresql/import-od-before.sql
BEGIN;
SET SEARCH_PATH TO lintim,public;
CREATE TEMPORARY TABLE _tmp_od (LIKE od INCLUDING DEFAULTS) ON COMMIT DROP;
ALTER TABLE _tmp_od DROP COLUMN dataset;
\copy _tmp_od (left_stop, right_stop, customers) FROM STDIN WITH (FORM... |
<filename>src/delta/all/tables/alter_ComCell_Meeting.sql
if not exists ( select * from syscolumns where id = OBJECT_ID('COMCELL_MEETING') and name='WEEK' )
begin
print 'Adding column WEEK to COMCELL_MEETING'
ALTER TABLE COMCELL_MEETING ADD [WEEK] int NULL
end
GO |
<reponame>dvdvardanyan/SqlServerCheatSheet
use msdb
go
with JobInfo(ID, JobName, StartTime, Duration) as
(
select
Jobs.job_id as ID
,Jobs.name as JobName
, convert(datetime, convert(char(8), run_date) + ' ' + stuff(stuff((left('000000', 6 - len(run_time))+ convert(varchar(6), run_time)), 3, 0, ':'), 6, 0, ':')... |
<reponame>AviNissimHart/IMS-Starter
drop schema ims;
CREATE SCHEMA IF NOT EXISTS `ims`;
USE `ims` ;
drop table orderitems;
drop table orders;
drop table items;
drop table customers;
CREATE TABLE IF NOT EXISTS `ims`.`customers` (
`cid` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(40) NULL DEFAU... |
<filename>sqlapp-core-postgres/src/main/resources/com/sqlapp/data/db/dialect/postgres/metadata/foreignKeyConstraints.sql<gh_stars>1-10
SELECT DISTINCT
current_database() AS constraint_catalog
, nc.nspname AS constraint_schema
, c.conname AS constraint_name
, current_database() AS table_catalog
, pr.nspname AS... |
<reponame>mohamed-waleed-rady/elearning-php<filename>api/app/sql/control/tracking/truncate.sql
DELETE tracking FROM tracking
JOIN users ON users.id = tracking.id AND users.blocked = 0 AND users.deleted = 0;
DELETE logins FROM logins
JOIN users ON users.id = logins.id AND users.blocked = 0 AND users.deleted = 0; |
<reponame>thomas-nicholson/gym-club<filename>db/schema.sql
DROP DATABASE IF EXISTS gymclub_db;
CREATE DATABASE gymclub_db; |
CALL apoc.periodic.iterate(
"CALL apoc.load.json('file:///media/sdb/neo4j/import/papersgood.json') YIELD value
WITH value.good AS papers
UNWIND papers AS fine
RETURN fine",
"MATCH (ty:TYPE {type:'schema:Article'})
MATCH (tyt:TYPE {type: "TextualBody"})
MATCH (mv:MOTIVATION) WHERE mv.term="linking"
... |
<filename>source/sql/book_annotation_by_id.sql
SELECT json_build_object(
'book_id', book_annotation.book_id,
'title', book_annotation.title,
'body', book_annotation.body,
'file', book_annotation.file
)
FROM book_annotation
WHERE book_annotation.book_id = $1 |
<reponame>Neronity/job4j
CREATE DATABASE tracker;
CREATE TABLE roles(
role_id serial primary key,
role_desc character varying (100)
);
CREATE TABLE rules(
rule_id serial primary key,
rule_desc character varying (100)
);
CREATE TABLE rules_for_roles(
comb_id serial primary key,
role_id integer references Roles... |
SET ANSI_NULLS ON
SET QUOTED_IDENTIFIER ON
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Sigs] (
[SigAbbrID] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[Definition] [varchar](150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[category] [varchar](150) COLLATE SQL_Latin1_General_CP1_C... |
-- Shows average session length in minutes, sessionCount grouped by the session number
-- Get session data
-- Conditional change event pulls out the sessionid only when it has changed from the last occurance
WITH sessions AS (
SELECT
userid,
sessionid,
eventtimestamp,
eventname... |
<gh_stars>1-10
-- Add up migration script here
ALTER TABLE exercise_service_info
ADD COLUMN exercise_type_specific_user_interface_iframe VARCHAR(255) NOT NULL,
DROP COLUMN submission_iframe_path,
DROP COLUMN editor_iframe_path,
DROP COLUMN exercise_iframe_path;
|
<gh_stars>1-10
/*
Given two tables t1 and t2:
ID|SD |ED |X|
--|-------------------|-------------------|-|
1|2018-01-01 00:00:00|2018-01-05 00:00:00|1|
1|2018-01-05 00:00:01|5999-12-31 00:00:00|2|
ID|SD |ED |Y|
--|------------------... |
ALTER TABLE scheduler_operations
ADD COLUMN "retry_id" VARCHAR(255);
do $$
declare
tmp record;
begin
FOR tmp in (SELECT scheduling_id, correlation_id FROM scheduler_operations) LOOP
UPDATE scheduler_operations SET retry_id = CONCAT(scheduling_id, correlation_id)
where scheduling_id = tmp.... |
<reponame>miguel-osuna/Smartbrain-API
BEGIN TRANSACTION;
INSERT INTO users (name, email, age, occupation, entries, joined) values ('test', '<EMAIL>', 22, 'Student', 5, '2020-01-01');
INSERT INTO login (hash, email) values ('$2a$10$wFcjzlpahcY0M8vJ9y5zSe4/o48pA5Ap2L.U359PMHdl6oLFmo4.K', '<EMAIL>');
COMMIT; |
<gh_stars>0
/*
SQLyog Ultimate v11.11 (64 bit)
MySQL - 5.6.16 : Database - db_persalinan
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_... |
-- CreateTable
CREATE TABLE "Item" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL,
"price" TEXT NOT NULL,
"inCart" BOOLEAN NOT NULL
);
-- CreateTable
CREATE TABLE "Image" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"url" TEXT NOT NULL,
"itemId" INTEGER NOT NU... |
<gh_stars>0
create table m_book_stock(
book_stock_id integer(5) not null AUTO_INCREMENT,
isbn varchar(15) not null,
owner_emp_num integer(5) default 9999,
regist_emp_num integer(5),
update_emp_num integer(5),
regist_time date,
update_time date,
primary key (book_stock_id)
) CHARACTER SET utf8 ... |
DECLARE
PROCEDURE CLEAN_OBJECT(P_OBJECT_TYPE IN VARCHAR2) AS v_temp NUMBER;
BEGIN
FOR C_OBJECT IN (SELECT * FROM USER_OBJECTS WHERE OBJECT_TYPE=P_OBJECT_TYPE) LOOP
EXECUTE IMMEDIATE 'DROP '||C_OBJECT.OBJECT_TYPE||' "'||C_OBJECT.OBJECT_NAME||'"';
END LOOP;
END CLEAN_OBJECT;
BEGIN
FOR C IN (SELECT T... |
{ #{refcursor} = call get_user_by_id(#{java.util.UUID}) }
|
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `Users`;
DROP TABLE IF EXISTS `Chat`;
DROP TABLE IF EXISTS `Registercodes`;
SET FOREIGN_KEY_CHECKS = 1;
CREATE TABLE `Users` (
`userID` SMALLINT NOT NULL,
`username` VARCHAR(128) NOT NULL,
`password` CHAR(60) NOT NULL,
`email` VARCHAR(255),
`isAdmin`... |
CREATE TABLE [dbo].[RUNTIME_SESSION_RUNS]
(
Id int identity(1,1) NOT NULL,
ConfigurationId int NOT NULL,
LeftHighWaterMark nvarchar(128) NULL,
RightHighWaterMark nvarchar(128) NULL,
State int NULL,
IsPreview bit NOT NULL,
SessionGroupRunId int NOT NULL,
StartTime datetime NULL,
EndTime datetime NULL,
Confli... |
<filename>populateDB/initLocal.sql
drop database if exists forumexample;
create database forumexample;
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 21, 2021 at 10:50 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 8.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- update c_uom set x12de355='DA', isactive='Y' where c_uom_id=540023;
UPDATE c_uom
SET isactive='Y', updated=now(), updatedby=99
WHERE c_uom_id = 102
; |
<reponame>dram/metasfresh
update AD_UI_Section set Name='';
update AD_UI_Section_Trl set Name='';
|
CREATE TABLE taxa_taxon_list_attributes
(
id serial NOT NULL,
caption character varying(50), -- Display caption for the attribute.
data_type character(1), -- Data type for the attribute. Possible values are T (text), I (integer), F (float), D (date), V (vague date), L (item looked up from a termlist).
created... |
select * from hive_json where get_json_object(hive_json.json, '$.User.ShippingAddress.City') in ('Santa Clara', 'Durham');
|
<gh_stars>1-10
create database IF NOT EXISTS dashboard;
use dashboard;
DROP TABLE IF EXISTS `dash_application`;
create table dash_application (
dash_app_id VARCHAR(50) NOT NULL PRIMARY KEY,
dash_app_name VARCHAR(50) NOT NULL
) ENGINE=InnoDB;
LOCK TABLES `dash_application` WRITE;
INSERT INTO dash_appli... |
<reponame>towhidulmannanuae/frapid
DROP FUNCTION IF EXISTS core.get_office_code_by_office_id(_office_id integer);
CREATE FUNCTION core.get_office_code_by_office_id(_office_id integer)
RETURNS national character varying(12)
AS
$$
BEGIN
RETURN core.offices.office_code
FROM core.offices
WHERE core.offices.of... |
CREATE TYPE gender AS ENUM('M', 'F');
CREATE TABLE employees (
emp_no INT NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR(14) NOT NULL,
last_name VARCHAR(16) NOT NULL,
gender gender NULL,
hire_date DATE NOT NULL,
PRIMARY KEY... |
CREATE TABLE unique_messages (
id bigint NOT NULL PRIMARY KEY,
height bigint NOT NULL,
tx_idx integer NOT NULL,
gas_price numeric(78, 0),
gas_limit numeric(78, 0),
from_address character varying(41) NOT NULL,
to_address character va... |
OPTIMIZE TABLE datasources, groups, group_users,
locations, locations_datasources,
locations_users_tags, notes, projects_points, project_users,
tag_namespaces, tags, user_profiles, users, version;
|
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`role` varchar(255) NOT NULL DEFAULT '0',
`token_session` varchar(255) NOT NULL,
`date_register` datetime NOT NULL,
`password` varchar(255) NOT NULL,
`location` varchar(255) NOT NULL DEFAULT '0',
`first_name` var... |
-- inladen en samenvoegen
DROP TABLE IF EXISTS checks.levee
;
CREATE TABLE checks.levee AS
SELECT
wkb_geometry as geom
, ring_id as levee_ring_id
, max_wl as maximum_water_level
, objectid as levee_id
, height
, ST_Buffer(ST_LineInterpolatePoint(ST_LineSubstring(wkb_geometry, 0, 0.5),0.5),... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.17.32
-- Generation Time: Nov 23, 2021 at 10:19 AM
-- Server version: 10.4.21-MariaDB
-- PHP Version: 7.4.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
set role to identidad_owner;
set search_path = identidad, public;
/*
alter table personal add column foto text;
-- */
alter table variantes add column cuil text;
ALTER TABLE identidad.afectaciones DROP CONSTRAINT "afectaciones personal REL";
alter table personal drop constraint personal_pkey;
alter table personal r... |
#include "schema/public.sql"
#include "schema/common.sql"
#include "schema/field.sql"
#include "schema/type.sql"
#include "schema/backref.sql"
|
<gh_stars>1-10
UPDATE reservations
SET end_date = '2019-05-24'
WHERE reservations.end_date = '2019-07-05' and owner_id = 1 |
<filename>TESTDIR/mysql_test/shelf_test.sql
--
-- Create the table children
--
INSERT INTO daqui_shelves( name, nfloors, floor_depth, cleaned, building_time) VALUES("8322次卧书柜", 3, "1,1,1", 0, "20190127");
INSERT INTO daqui_shelves( name, nfloors, floor_depth, cleaned, building_time) VALUES("8322床头柜书柜", 1, "1", 0, "2019... |
USE `torque`;
SELECT Count(*)
INTO @exists
FROM information_schema.tables
WHERE table_schema = 'torque'
AND table_type = 'BASE TABLE'
AND table_name = 'torque_keys';
SET @query = If(@exists>0,
'RENAME TABLE torque_keys TO torque_keys_old',
'SELECT \'nothing to rename\' status');
PREPARE stmt FROM @q... |
<filename>src/test/resources/types.test_6.sql
-- types.test
--
-- execsql {
-- CREATE TABLE t1(a integer);
-- INSERT INTO t1 VALUES(0);
-- INSERT INTO t1 VALUES(120);
-- INSERT INTO t1 VALUES(-120);
-- }
CREATE TABLE t1(a integer);
INSERT INTO t1 VALUES(0);
INSERT INTO t1 VALUES(120);
INSERT INTO t1 VA... |
<filename>modules/boonex/wiki/updates/11.0.0_12.0.0/source/install/sql/enable.sql
-- Settings
SET @iTypeOrder = (SELECT MAX(`order`) FROM `sys_options_types` WHERE `group` = 'modules');
INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES
('modules', 'bx_wiki', '_bx_wiki', 'bx_wiki@mod... |
<reponame>luomoxu/build
CREATE TABLE `accessLogs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`log` text COLLATE utf8mb4_bin,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin; |
<reponame>dram/metasfresh
DROP FUNCTION IF EXISTS KPI_Printing_Performance_Shipment_Function (IN StartDate Date, IN EndDate Date);
CREATE OR REPLACE FUNCTION KPI_Printing_Performance_Shipment_Function (IN StartDate Date, IN EndDate Date)
RETURNS TABLE (
TimeAverage double precision
)
AS
$BODY$
SELECT
-- the di... |
<reponame>kef/hieos
-- Table: ip
-- DROP TABLE ip;
CREATE TABLE ip
(
ip character varying(100) NOT NULL,
company_name character varying(255) NOT NULL DEFAULT 'Unknown'::character varying,
email character varying,
CONSTRAINT ip_pkey PRIMARY KEY (ip)
)
WITH (OIDS=FALSE);
ALTER TABLE ip OWNER TO logs... |
<filename>2_chapter_003/db/scripts/update_002.sql
create table if not exists items(
id varchar,
name varchar(200),
description varchar(200),
create_date date
); |
--HINT DISTRIBUTE_ON_RANDOM
create table @synthea_schema.allergies (
start date,
stop date,
patient varchar(1000),
encounter varchar(1000),
code varchar(100),
description varchar(100)
);
--HINT DISTRIBUTE_ON_RANDOM
create table @synthea_schema.careplans (
id varchar(10... |
CREATE INDEX ON unregistered_phone_contacts(phone_number); |
CREATE TABLE TYPETEST (
TYPE1 BLOB,
TYPE2 CHAR(10 CHAR),
TYPE3 CLOB,
TYPE4 DATE,
TYPE5 LONG,
TYPE6 NCHAR(10),
TYPE7 NCLOB,
TYPE8 NUMBER(1,0),
TYPE9 NUMBER(4,0),
TYPE10 NUMBER(9,0),
TYPE11 NUMBER(18,0),
TYPE12 NUMBER(19,0),
TYPE13 NUMBER(18,1),
TYPE14 NVARCHAR2(10),
TYPE15 TIMESTAMP,
TYPE... |
CREATE FUNCTION [dbo].[fxn_SessionsStart] (@SessionId nvarchar(255))
RETURNS datetime
AS
BEGIN
DECLARE @SessionStart datetime
SET @SessionStart=(
SELECT TOP 1 dDateTime
FROM tblActivityLog SessionStart
WHERE (cSessionId = @SessionId)
ORDER BY dDateTime
)
RETURN @SessionStart
END
... |
-- Table: public.tags
--This table is to be used for the tags feature.
CREATE TABLE IF NOT EXISTS public.tags
(
id integer NOT NULL,
tag_name character varying(50) COLLATE pg_catalog."default",
tag_content character varying(3000) COLLATE pg_catalog."default",
creator_user_id bigint,
updater_user_id... |
create table wdl_hash (
location text not null,
hash bytea not null,
created_at timestamptz not null default current_timestamp,
primary key (location, hash)
);
create index hash_idx on wdl_hash (hash);
|
ALTER TABLE meetings ADD COLUMN closed BOOL NOT NULL default FALSE;
|
<reponame>thaihonglan/hai-nam-co-mieu<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 16, 2015 at 01:28 AM
-- Server version: 5.6.17-log
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1
-- Время создания: Ноя 12 2019 г., 13:01
-- Версия сервера: 10.1.37-MariaDB
-- Версия PHP: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
<filename>openGaussBase/testcase/KEYWORDS/analyze/Opengauss_Function_Keyword_Analyze_Case0028.sql
-- @testpoint: opengauss关键字Analyze(保留),作为同义词对象名,部分测试点合理报错
--前置条件
drop table if exists Analyze_test;
create table Analyze_test(id int,name varchar(10));
--关键字不带引号-失败
drop synonym if exists Analyze;
create synonym Analyze ... |
<reponame>opengauss-mirror/Yat
-- @testpoint: opengauss关键字wrapper(非保留),作为同义词对象名,部分测试点合理报错
--前置条件
drop table if exists explain_test;
create table explain_test(id int,name varchar(10));
--关键字不带引号-成功
drop synonym if exists wrapper;
create synonym wrapper for explain_test;
insert into wrapper values (1,'ada'),(2, 'bob')... |
-- \echo '-- DROP TABLE IF EXISTS yearly_issues_2020 ;'
SELECT 'create the yearly_issues_2020 table'
;
CREATE TABLE yearly_issues_2020 (
guid UUID NOT NULL DEFAULT gen_random_uuid()
, id bigint UNIQUE NOT NULL DEFAULT cast (to_char(current_timestamp, 'YYMMDDHH12MISS') as bigint)
,... |
-- phpMyAdmin SQL Dump
-- version 3.3.8
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mar 03 Mai 2011 à 15:52
-- Version du serveur: 6.0.0
-- Version de PHP: 5.2.9-2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARAC... |
drop schema ims;
CREATE SCHEMA IF NOT EXISTS `ims`;
use `ims`;
DROP TABLE order_items;
DROP TABLE orders;
DROP TABLE items;
DROP TABLE customers;
CREATE TABLE IF NOT EXISTS `ims`.`customers` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(64) DEFAULT NULL,
`surname` VARCHAR(64) DEFAULT NULL,
PRIMA... |
.mode columns
.headers on
.nullvalue NULL
SELECT VooID, sum(Peso) AS Peso
FROM Transporta, Bagagem
WHERE Transporta.BagagemID = Bagagem.BID
GROUP BY VooID |
<reponame>jgonte/DomainFramework
USE master
GO
IF EXISTS
(
SELECT NAME
FROM Sys.Databases
WHERE Name = N'SimpleEntityWithAutoGeneratedKey'
)
BEGIN
DROP DATABASE [SimpleEntityWithAutoGeneratedKey]
END
GO
CREATE DATABASE [SimpleEntityWithAutoGeneratedKey]
GO
USE [SimpleEntityWithAutoGeneratedKey]
GO
... |
/*
https://leetcode.com/problems/game-play-analysis-iv/
https://leetcode.com/submissions/detail/450987748/
GSN Games, Facebook
*/
/* Write your T-SQL query statement below */
SELECT
ROUND(1.0 * r1.np / r2.np, 2) as fraction
FROM
(
SELECT
COUNT(cc.np) as np
FROM
(
SELECT
DISTINCT... |
<reponame>mahlettaye/Data_warehouse_tech_stack
CREATE TABLE IF NOT EXISTS `dimStationSummaryAirflow`
(
`id` INT NOT NULL AUTO_INCREMENT,
`station_id` INT NOT NULL,
`flow_99` FLOAT DEFAULT NULL,
`flow_max` FLOAT DEFAULT NULL,
`flow_median` FLOAT DEFAULT NULL,
`flow_total` FLOAT DEFAULT NULL,
... |
<filename>scripts/planobase.sql
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Máquina: localhost
-- Data de Criação: 23-Out-2015 às 03:04
-- Versão do servidor: 5.6.12-log
-- versão do PHP: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
CREATE TABLE IF NOT EXISTS `groups` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`created` datetime DEFAULT NULL,
`modified` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
INSERT INTO `groups` (`id`, `name`, `created`, `modified`) V... |
<reponame>jdkoren/sqlite-parser
-- minmax2.test
--
-- execsql {SELECT max(a) FROM t2}
SELECT max(a) FROM t2 |
CREATE TABLE public.schedule_bench (
schedule_id int8 NOT NULL,
benchs_id int8 NOT NULL,
CONSTRAINT uk_s7ilv9x7vgfuemjjp9onfcoqw UNIQUE (benchs_id),
CONSTRAINT fk17i6qxxxhmby23v87jwnn5qow FOREIGN KEY (benchs_id) REFERENCES public.bench(id),
CONSTRAINT fkto374sl8n46pcy3v49mc9c538 FOREIGN KEY (schedule_id) REFERENCE... |
<gh_stars>0
# ************************************************************
# Sequel Pro SQL dump
# Version 4135
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.5.42)
# Database: tpadmin
# Generation Time: 2015-07-16 13:12:58 +0000
# *************************************... |
<filename>database/animalorder/ddl/Shipments.sql
drop table animalorder.`Shipments`;
create table animalorder.`Shipments`(
id int(11) not null,
order_id int(11) not null,
shipped boolean default false,
ship_date date,
PRIMARY KEY (id),
KEY `Shipment_Order_fk_1_idx` (order_id),
CONSTRAINT `Shipment_Order_fk_1` FO... |
USE bc_server_db;
CREATE TABLE server_chain
(
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
ctime TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
mtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
/* Serial Number */
client_id INT UNSIGNED NOT NULL,
/* The upper server */
upper_server VARCHAR(... |
CREATE TABLE [dbo].[TRunTimes]
(
--From MergedXSDs XSD
--From 'genericRailML' Namespace
[TRunTimesId] BIGINT NOT NULL,
[MinimalTime] NVARCHAR(MAX) NOT NULL,
[OperationalReserve] NVARCHAR(MAX) NOT NULL,
[AdditionalReserve]NVARCHAR(MAX) NOT NULL,
CONSTRAINT [PK_TRunTimesId] PRIMARY KEY CLUSTERED ([TRunTimesId... |
CREATE DATABASE `chat` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use chat;
CREATE TABLE users(
`u_id` int(10) not null auto_increment primary key COMMENT "user_id,用户ID,用户唯一标识符",
`nick` varchar(20) not null COMMENT "昵称/用户名",
`password` varchar(256) not null COMMENT "密码",
`head` text not null COMMEN... |
<gh_stars>10-100
/* move the path to the table instead of the server */
CREATE SERVER quasar_root FOREIGN DATA WRAPPER quasar_fdw
OPTIONS (server 'http://localhost:8080'
,path '/');
CREATE FOREIGN TABLE zips_root(city varchar, pop integer, state char(2))
SERVER quasar_root OPTIONS (table '... |
## 获取奖品
#macro($findPrizes(code,process,room,userType))
SELECT * FROM imperial_exam_activity_prizes
WHERE activity_code=:code
AND process = :process
#if(room)
AND room = :room
#end
AND user_type = :userType
AND num > cost
#end
## 更新奖品数量
#macro($updatePrizesCost(id))
UPDATE imperial_exam_activity_prize... |
<gh_stars>1-10
/*
Warnings:
- The primary key for the `Timer` table will be changed. If it partially fails, the table could be left without primary key constraint.
- Added the required column `id` to the `Timer` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTE... |
<gh_stars>1000+
ALTER TABLE subgraphs.subgraph_error DROP COLUMN deterministic;
|
<gh_stars>1-10
--+ holdcas on;
set names utf8;
CREATE TABLE test_ro (
id int NOT NULL,
name VARCHAR(30) collate utf8_ro_cs);
insert into test_ro values (1,'Încântat de cunoștință');
insert into test_ro values (2,'?Încântat de cunoștință');
insert into test_ro values (3,'Scuzați-mă!');
insert into tes... |
CREATE TABLE `tblTemplate` (
`TemplateID` int(11) NOT NULL AUTO_INCREMENT,
`CompanyID` int(11) DEFAULT NULL,
`Title` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`Description` varchar(200) COLLATE utf8_unicode_ci DEFAULT NULL,
`CreatedDate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`CreatedBy` varchar(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.