sql stringlengths 6 1.05M |
|---|
/*
Navicat MySQL Data Transfer
Source Server : 192.168.138.159
Source Server Version : 50635
Source Host : 192.168.138.159:3306
Source Database : weimeijuhui201703db
Target Server Type : MYSQL
Target Server Version : 50635
File Encoding : 65001
Date: 2017-04-03 13:14:28
*/
SET FOR... |
/**
*agenda de contatos
* @autor <NAME>
*/
/* banco de dados */
-- verificar banco de dados dispomiveis
show databases;
-- criar um novo banco de dados
create database dbagenda;
-- selecionar o banco de dados
use dbagenda;
/* tabelas */
-- verificar tabelas do banco de dados
show tables ;
-- criar um nova tabela
cre... |
<filename>recipe1.3/data.sql
create table emp (
ename TEXT,
sal INT,
comm INT,
deptno INT
);
insert into emp (ename, sal, comm, deptno) values ('Eric', 100, 10, 1);
insert into emp (ename, sal, comm, deptno) values ('Fred', 110, 5, 1);
insert into emp (ename, sal, comm, deptno) values ('Bob', 200, NULL... |
<filename>t_log.sql
/*
Navicat Premium Data Transfer
Source Server : spring_tutorial
Source Server Type : MySQL
Source Server Version : 50723
Source Host : 172.16.17.32:3306
Source Schema : spring_tutorial
Target Server Type : MySQL
Target Server Version : 50723
File Encoding ... |
<gh_stars>0
BEGIN;
DROP VIEW IF EXISTS qidao.view_lp_pool_withdraw CASCADE;
CREATE VIEW qidao.view_lp_pool_withdraw AS (
with withdraws as (
/*select evt_block_time as block_time,
user as user_address,
contract_address as pool_contract_address,
pid as lp_id,
amount / 1e18 as amount,
... |
-- dodaj simc i ulic jeżeli zgadzają się z teryt - ŁÓDŹ
update prg.pa
set (
teryt_msc,
teryt_simc,
teryt_ulica,
teryt_ulic
) = (
initcap(prg.pa.msc),
prg.pa.simc,
trim(concat(cm.m, ' ', (u1.nazwa_2 || ' '), u1.nazwa_1)),
u1.sym_ul
)
from (
select woj, pow, sym_ul, nazwa_1, nazwa_2, c... |
<filename>protected/data/system_db.sql<gh_stars>0
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.6.35)
# Database: system_db
# Generation Time: 2018-02-03 08:26:15 +00... |
<reponame>StephenLGF/single_exam
INSERT INTO `cloudplateform_notification` (`user_id`, `message_id`) VALUES (1, 1), (1, 2), (1, 3), (1, 4);
|
<reponame>kay73/NGB
CREATE SEQUENCE IF NOT EXISTS CATGENOME.S_PATHWAY_ORGANISM START WITH 1 INCREMENT BY 1;
CREATE TABLE IF NOT EXISTS CATGENOME.PATHWAY_ORGANISM (
PATHWAY_ORGANISM_ID BIGINT NOT NULL PRIMARY KEY,
PATHWAY_ID BIGINT NOT NULL,
TAX_ID BIGINT NOT NULL,
CONSTRAI... |
-----------------
-- utility_a --
-----------------
DROP TABLE if exists osmaxx.utility_a;
CREATE TABLE osmaxx.utility_a(
osm_id bigint,
lastchange timestamp without time zone,
geomtype char(1),
geom geometry(MULTIPOLYGON,900913),
aggtype text,
type text,
name text,
name_en text,
name_fr text,
name_e... |
<reponame>MellieDee/employee-tracker<gh_stars>0
INSERT INTO department (dept_name)
VALUES
("R & D"),
("Marketing"),
("Purchasing");
INSERT INTO role (title, salary, department_id)
VALUES
("R & D - L1", "40000.00", "1"),
("Sales & Mar - L1", "45000", "2"),
("Purch - L1", "50000", "3");
INSERT INTO employees (first_nam... |
-- link: https://sqlzoo.net/wiki/SELECT_within_SELECT_Tutorial
-- 1. List each country name where the population is larger than that of 'Russia'.
SELECT name FROM world WHERE population > (SELECT population FROM world WHERE name='Russia');
-- 2. Show the countries in Europe with a per capita GDP greater than 'United... |
<filename>BCNFEXAMPLE.sql<gh_stars>1-10
-- NO REPEATING GROUP PER ROW
-- NO PARTIALLY DEPENDENT ATTRIBUTES
-- NO DEPENDENCIES EXCEPT ON THE KEY
-- NO MIXED ENTITIES
CREATE TABLE [customer] (
customerid INT,
firstname VARCHAR(100),
surname VARCHAR(100),
profession VARCHAR(100),
hangswith v... |
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
-- =============================================
-- Author: <NAME>
-- Create date: 2019-09-21
-- Description: Calculates a virtual project key for an issue
-- =============================================
CREATE FUNCTION [dbo].[fn_Jira_Virtual_Project_Key]
(
... |
DROP TRIGGER
IF EXISTS BIZ_PEODUCT_ADT_INS;
DROP TRIGGER
IF EXISTS BIZ_PEODUCT_ADT_DEL;
DROP TRIGGER
IF EXISTS BIZ_PEODUCT_ADT_UPD;
/**
*
* Add Audit Trail Triggers(insert)
*
**/
CREATE TRIGGER BIZ_PEODUCT_ADT_INS AFTER INSERT ON biz_product FOR EACH ROW
BEGIN
-- Insert record into audit table
INSERT INTO biz_prod... |
DROP TABLE IF EXISTS vetd.group_discounts; |
<reponame>Shuttl-Tech/antlr_psql<filename>src/test/resources/sql/select/e9d21cc4.sql
-- file:tstypes.sql ln:214 expect:true
SELECT ts_delete('base hidden rebel spaceship strike'::tsvector, ARRAY['spaceship','leya','rebel', NULL])
|
--
-- Stores text message to be verbosed at end of script.
--
DELIMITER $$
DROP procedure IF EXISTS _script_report $$
CREATE procedure _script_report(report_params TEXT CHARSET utf8)
DETERMINISTIC
MODIFIES SQL DATA
SQL SECURITY INVOKER
COMMENT ''
begin
declare report_query text charset utf8;
declare is_heade... |
<gh_stars>100-1000
-- original: boundary1.test
-- credit: http://www.sqlite.org/src/tree?ci=trunk&name=test
SELECT a FROM t1 WHERE rowid <= 36028797018963968 ORDER BY rowid DESC
;SELECT a FROM t1 WHERE rowid <= 36028797018963968 ORDER BY x
;SELECT * FROM t1 WHERE rowid=-2147483649
;SELECT rowid, a FROM t1 WHERE x='f... |
-- 2018-08-13T16:56:29.014
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsMandatory='Y',Updated=TO_TIMESTAMP('2018-08-13 16:56:29','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=556504
;
|
select * from user;
UPDATE blog SET
photo1='https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3200281056,3918403058&fm=26&gp=0.jpg',
photo2='https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=2052783361,1146297864&fm=26&gp=0.jpg',
photo3='https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=2949619... |
/*
Navicat Premium Data Transfer
Source Server : gokinsdb
Source Server Type : SQLite
Source Server Version : 3030001
Source Schema : main
Target Server Type : SQLite
Target Server Version : 3030001
File Encoding : 65001
Date: 30/10/2020 11:08:09
*/
PRAGMA foreign_keys = false... |
CREATE OR REPLACE VIEW v_table_schema
AS
SELECT
cols.table_name
, pc.table_comment
, cols.column_name
, cols.ordinal_position
, pa.column_comment
, cols.column_default
, cols.is_nullable
, cols.data_type
, CASE
WHEN cols.data_type::text = 'numeric'::text THEN cols.numeric_precision::integer
WH... |
/*
Query para publicar a tabela.
Esse é o lugar para:
- modificar nomes, ordem e tipos de colunas
- dar join com outras tabelas
- criar colunas extras (e.g. logs, proporções, etc.)
Qualquer coluna definida aqui deve também existir em `table_config.yaml`.
# Além disso, sinta-se à vontade para alterar alg... |
<filename>sayn/scaffolding/data/init_project/sql/f_fighter_results.sql
SELECT b.tournament_name
, b.battle_id
, b.arena_name
, b.fighter1_name AS fighter_name
, CASE WHEN b.fighter1_name = b.winner_name THEN 1 ELSE 0 END AS is_winner
FROM f_battles b
UNION
SELECT b.tournament_name
, b.batt... |
<reponame>iancardosozup/charlescd<gh_stars>100-1000
DROP TABLE IF EXISTS ACTION_CONFIGURATION CASCADE; |
<gh_stars>0
-- @Description Ensures that a serializable select before during a vacuum operation avoids the compaction.
--
DELETE FROM ao WHERE a < 128;
1: BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
1>: SELECT COUNT(*) FROM ao2;
2: VACUUM ao;
1<:
1: SELECT COUNT(*) FROM ao;
1: COMMIT;
3: INSERT INTO ao VALUES (0)... |
<reponame>matsluni/slick
CREATE TABLE `LongTextTest`( entry1 LONGTEXT NOT NULL , entry2 MEDIUMTEXT NOT NULL , entry3 TEXT NOT NULL , entry4 VARCHAR(255) NOT NULL );
CREATE TABLE DEFAULT_NUMERIC( d0 decimal(13,2) NOT NULL DEFAULT '0.00',d1 decimal(13) NOT NULL DEFAULT 0.00, d3 INT NOT NULL DEFAULT '0.00' );
CREATE TABLE... |
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50553
Source Host : localhost:3306
Source Schema : fb_ceshi1
Target Server Type : MySQL
Target Server Version : 50553
File Encoding : 65001
Date: 30/12/2018 ... |
<filename>queries/create_table.sql
CREATE TABLE public.nowinteract
(
date_time character(19),
site_name character varying(8),
posa_continent character varying(8),
user_location_country character varying(8),
user_location_region character varying(8),
user_location_city character varying(8),
orig_destination_dista... |
/* Use lag to reference rows behind */
select
department,
last_name,
salary,
lag(salary) over (partition by department order by salary desc)
from
staff
/* Use lead to reference rows ahead */
select
department,
last_name,
salary,
lead(salary) over (partition by department order by salary des... |
<gh_stars>0
IF EXISTS(SELECT TOP 1 1 FROM sys.tables WHERE name='availabletimeslot_activity' AND SCHEMA_NAME(schema_id)='dbo')
BEGIN
DROP TABLE dbo.[timeslot];
PRINT 'DROP TABLE dbo.[timeslot]'
END
IF EXISTS(SELECT TOP 1 1 FROM sys.tables WHERE name='reservation' AND SCHEMA_NAME(schema_id)='dbo')
BEGIN
DROP TAB... |
-- DROP TABLE IF EXISTS shopItems;
CREATE TABLE shopItems(
id SERIAL PRIMARY KEY,
title VARCHAR(200),
photo VARCHAR(300),
type VARCHAR(200),
price NUMERIC(5,2)
);
|
-- MySQL dump 10.13 Distrib 8.0.19, for macos10.15 (x86_64)
--
-- Host: localhost Database: survey
-- ------------------------------------------------------
-- Server version 8.0.19
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;... |
<reponame>rkemmere/structure_tweaks
DROP TABLE IF EXISTS `%TABLE_PREFIX%structure_tweaks`;
|
<filename>EntangloWebService/PostgresDbScripts/Reference Scripts/Test Functions/submittestentry.sql
-- Function: public.submittestentry(text, text, integer, integer, text, text, text[], boolean)
-- DROP FUNCTION public.submittestentry(text, text, integer, integer, text, text, text[], boolean);
CREATE OR REPLACE FUNC... |
<reponame>zenoman/suryantar
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.6-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 10.2.0.5599
-- --------------------... |
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE dbo.prc_Perf_Top_Disk_Intensive_Queries
@ROWCOUNT SMALLINT = 50
AS
BEGIN
/******************************************************************************
** Name: prc_Perf_Top_Disk_Intensive_Queries.sql
** Desc: This will get list of TO... |
<filename>migrations/0000018-create-audit.down.sql<gh_stars>1-10
DROP SCHEMA audit CASCADE; |
<reponame>camromere/cmrsql
/* OBJECTS CREATED */
DECLARE @dateAddedToGoBack int = 30
SELECT name, modify_date
FROM sys.objects
WHERE type IN ('P', 'V', 'U', 'PK', 'TR') --SQL_STORED_PROCEDURE, VIEW, USER_TABLE, PRIMARY_KEY_CONSTRAINT, SQL_TRIGGER
AND DATEDIFF(D,create_date, GETDATE()) < @dateAddedToGoBack
/... |
# CREATE AND USE DATABASE "covid_tracker". (FOR LOCAL USE UNCOMMENT BELOW TWO LINES)
CREATE DATABASE IF NOT EXISTS covid_tracker;
USE covid_tracker;
# USE DATABASE "CS_ID". (FOR REMOTE USE UNCOMMENT BELOW LINE)
# USE CS_ID;
# CREATES "mobile_device" TABLE.
CREATE TABLE IF NOT EXISTS mobile_device(
_id INT PRIMARY KE... |
<reponame>luke-h1/explore-education-statistics
IF NOT EXISTS
(
SELECT name FROM master.dbo.sysdatabases
WHERE name = N'content'
)
BEGIN
CREATE DATABASE [content]
SELECT 'content database has been created'
END;
IF NOT EXISTS
(
SELECT name FROM master.dbo.sysdatabases
WHERE name =... |
<reponame>xiaojianyu315/jsponge<filename>db/schema/seq.sql
##
CREATE TABLE sequence (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(100) NOT NULL COMMENT '序列名称',
value bigint(100) NOT NULL COMMENT '序列值',
gmt_modified datetime NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY name (name)
) ENGINE=InnoDB AUTO_INCREME... |
<gh_stars>0
SELECT sname
FROM sailor, reserve
WHERE sailor.sid = reserve.sid; |
<filename>escreening/src/main/sql/sprint_25/01_sprint25_clinical_reminders.sql
INSERT INTO
clinical_reminder_survey
(
clinical_reminder_id,
survey_id
)
VALUES
(
(select clinical_reminder_id from clinical_reminder where vista_ien = '568022'),
(select survey_id from survey where name = 'PCL-C')
);
INSERT INTO ... |
<reponame>Chirojeugd-Vlaanderen/gap<gh_stars>0
use gap
go
declare @werkjaar as integer; set @werkjaar=2012
declare @ctype as integer; set @ctype=3; -- e-mail
-- e-mailadressen in gap en niet in kipadmin
select x.adnummer, max(x.naam), max(x.voornaam), min(x.nummer), case when max(y.adnummer) is null then 'nee' el... |
-- Threads for ORACLE
-- by <NAME>
-- This file is distributed under Apache License 2.0 (01.2004).
-- http://www.apache.org/licenses/
-- create 11.11.2006
-- update 29.01.2016
--
-------------------------------------------------------------------------------
CREATE OR REPLACE TYPE THREADS.TNUMBERs IS TABLE of NUMBE... |
/********************************************************************
Current open clinic admits (CASES)
For SNPRC mobile app
srr 10.29.2019
srr 11.14.19 Added alias for species and added CaseId
********************************************************************/
SELECT c.Id, c.date AS AdmitDate, c.enddate AS Relea... |
/*
SQLyog Ultimate v11.24 (32 bit)
MySQL - 5.7.17-log : Database - token_demo
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY... |
CREATE TABLE llapi (
id serial8,
title text,
ts timestamp default now()
);
CREATE INDEX idxllapi ON llapi USING zombodb ((llapi.*));
SELECT zdb.llapi_direct_insert('idxllapi', '{"field":"this will ERROR"}'::json);
ALTER INDEX idxllapi SET (llapi=true);
INSERT INTO llapi (title) VALUES ('This will ERROR');... |
<reponame>kitdallege/walden
CREATE SCHEMA walden;
CREATE SCHEMA walden_history;
-- CREATE SCHEMA walden_taxonomy;
-- Walden
GRANT ALL ON SCHEMA walden TO walden;
ALTER DEFAULT PRIVILEGES IN SCHEMA walden
GRANT ALL ON TABLES TO walden;
ALTER DEFAULT PRIVILEGES IN SCHEMA walden
GRANT USAGE ON SEQUENCES TO walden... |
-- create class to test to_char on a used class name
create class func_04 ( a timestamp , b date, c time );
insert into func_04 values( '00:00:01 01/01/1971', '01/01/1970', '01:02:03');
insert into func_04 values( '03:14:07 01/01/2038', '01/01/2038', '01:02:03');
insert into func_04 values( '01:02:03 am 01/01/1980', '... |
-- @testpoint:opengauss关键字source(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists source;
CREATE TABLESPACE source RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace source;
--关键字带双引号,创建成功
drop tablespace if exists "source";
CREATE TABLESPACE "source" RELATIVE LOCATION 'hdfs_tablespace/hdfs... |
<gh_stars>10-100
DROP TABLE if exists `moocdb`.`longitudinal_features`;
CREATE TABLE `moocdb`.`longitudinal_features` (
`longitudinal_feature_id` INT(5) NOT NULL,
`longitudinal_feature_name` TINYTEXT NULL ,
`longitudinal_feature_description` TEXT NULL ,
PRIMARY KEY (`longitudinal_feature_id`) );
|
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.5.5-10.5.9-MariaDB)
# Database: laravel_surat
# Generation Time: 2021-05-28 06:22:25 +0000
# ***************************... |
<reponame>zs274/Employee-Tracker
USE employee_db;
INSERT INTO department (name)
VALUES ("Marketing");
INSERT INTO department (name)
VALUES ("Sales");
INSERT INTO department (name)
VALUES ("Finance");
INSERT INTO department (name)
VALUES ("Human Resources");
SELECT * FROM department;
------------------------------... |
<filename>orders.sql
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 20, 2021 at 10:04 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;
SET time_zone = "+00:00"... |
<reponame>ikemtz/mechanager
CREATE TABLE [dbo].[Transactions] (
[Id] UNIQUEIDENTIFIER NOT NULL,
[PartId] UNIQUEIDENTIFIER NOT NULL,
[VendorId] UNIQUEIDENTIFIER NULL,
[PartVendorId] UNIQUEIDENTIFIER NULL,
[Amount] DECIMAL (18) NOT NULL,
[StoreId] UNIQUEIDE... |
SET SEARCH_PATH TO parlgov;
drop table if exists q1 cascade;
-- You must not change this table definition.
create table q1(
century VARCHAR(2),
country VARCHAR(50),
left_right REAL,
state_market REAL,
liberty_authority REAL
);
-- You may find it convenient to do this for each of the views
-- that define your int... |
-- PostgreSQL Table Definition
DROP TABLE IF EXISTS prefectures;
CREATE TABLE prefectures(
pref_code INT,
pref_name VARCHAR(30),
PRIMARY KEY(pref_code)
);
DROP TABLE IF EXISTS cities;
CREATE TABLE cities(
city_id CHAR(5),
pref_code INT,
city_code INT,
sityo_name VARCHAR(60),
gst_name V... |
<reponame>DieegoSantos/ebr
# ************************************************************
# Sequel Pro SQL dump
# Versão 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.6.40)
# Base de Dados: portabilis
# Tempo de Geração: 2018-06-20 02:31:31 +0000
# ************... |
DROP TABLE tbl_disposisi;
CREATE TABLE `tbl_disposisi` (
`id_disposisi` int(10) NOT NULL AUTO_INCREMENT,
`tujuan` varchar(250) NOT NULL,
`isi_disposisi` mediumtext NOT NULL,
`sifat` varchar(100) NOT NULL,
`batas_waktu` date NOT NULL,
`catatan` varchar(250) NOT NULL,
`id_surat` int(10) NOT NULL,
`id_use... |
<filename>JobExecutionFramework/ConfigDB/etljob/Views/vw_ParameterForJobStep.sql
-- =============================================
-- Author: (C<NAME>; <NAME>)
-- Create date: 2015-02-25
-- Description: Lists Parameters belonging to JobStepID together with Design Defaults (from SSISDB)
-- Includes reference to conne... |
<reponame>arthurfporto/php-mysql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: 24-Ago-2018 às 12:37
-- Versão do servidor: 10.1.29-MariaDB
-- PHP Version: 7.2.0
--
-- Database: `aula`
--
CREATE DATABASE IF NOT EXISTS `aula` DEFAULT CHARACTER SET utf... |
<gh_stars>1-10
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
"MigrationId" character varying(150) NOT NULL,
"ProductVersion" character varying(32) NOT NULL,
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);
CREATE TABLE documents (
id uuid NOT NULL,
created_at timestamp wi... |
create or replace package mtag_apex_error_handler
as
function handle_error
(
p_error in apex_error.t_error
)
return apex_error.t_error_result
;
end mtag_apex_error_handler;
/
|
<filename>oracle11gHost/initdb.d/setup/fiddledata.sql
CREATE TABLESPACE FIDDLEDATA DATAFILE '/u01/app/oracle/oradata/XE/fiddledata.dbf'
SIZE 500M
AUTOEXTEND ON NEXT 100M
MAXSIZE 2G;
|
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5442570_sys_09911_C_BP_PrintFormat_C_DocType_ID_not_mandatory.sql<gh_stars>1000+
-- 15.03.2016 15:08
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET IsMandatory='N',Update... |
<reponame>cutepigdog/weiphp4
CREATE TABLE IF NOT EXISTS `wp_exam` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '主键',
`keyword` varchar(100) NOT NULL COMMENT '关键词',
`keyword_type` tinyint(2) NOT NULL COMMENT '关键词匹配类型',
`title` varchar(255) NOT NULL COMMENT '试卷标题',
`start_time` int(10) NULL COMMENT '考试... |
<gh_stars>0
VALUES LEAST(5, CAST(NULL AS INTEGER), 1) |
<gh_stars>1-10
-- All data from last 60min
SELECT * FROM cubesensors_data
WHERE MeasurementTime > DATEADD(minute, -61, GETDATE())
-- All data from last 60min
SELECT * FROM cubesensors_data
WHERE SensorId = '000D6F0004476483' AND MeasurementTime > DATEADD(minute, -61, GETDATE())
-- Select Averages from last 60min
SELE... |
<reponame>cuba-platform/cuba-thesis
-- $Id$
-- Description:
create index IDX_SEC_SCREEN_HIST_SUB_USER on SEC_SCREEN_HISTORY (SUBSTITUTED_USER_ID); |
<gh_stars>1-10
use [IBatisNet]
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[Nullable]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
BEGIN
drop table [dbo].[Nullable]
END
CREATE TABLE [dbo].[Nullable] (
[Id] [int] IDENTITY (1, 1) NOT NULL ,
[TestBool] [Bit] NULL ,
[TestByte] [tinyint] NULL... |
<gh_stars>1-10
-- UMS Sample Data
-- ------------------------------------------------------
USE ums;
--
-- Insert data for table role
--
INSERT INTO role
(id,
code,
name)
VALUES
('1',
'patient',
'Patient'),
('2',
'parents',
'Parents'),
('3',
'guardian',
'Guardian'),
('4',
'provider',
... |
<reponame>Inedo/Romp
UPDATE ScopedExecutionLogs
SET End_Date = @End_Date
WHERE Execution_Id = @Execution_Id AND Scope_Sequence = @Scope_Sequence; |
--get all the messages sent in a certain step on a certain day and link these to the convertsion events in a (gamestarted) in the following 7 days
--measure occurence per day for campaign
with in_campaign as (
select userID,
eventDate,
COALESCE(stepID,1) as stepID,
min(eventTimestamp) as stepTime,
count(userID) over ... |
<filename>Tellma.Database.Application/dbo/Tables/dbo.InvoiceLines.sql
CREATE TABLE [dbo].[InvoiceLines]
(
[Id] INT CONSTRAINT PK_Invoices PRIMARY KEY,
[InvoiceId] INT CONSTRAINT FK_InvoicesLines_Invoices FOREIGN KEY REFERENCES dbo.[Invoices]([Id]),
INDEX IX_InvoiceLines__InvoiceId ([InvoiceId]),
[Ite... |
CREATE TABLE steps (
id Serial PRIMARY KEY,
name VarChar NOT NULL,
description Text NULL,
processor Jsonb NOT NULL,
position Integer NOT NULL,
pipeline_id Integer REFERENCES pipelines ON DELETE CASCADE,
UNIQUE(position, pipeline_id)
);
CREATE INDEX ON steps (... |
<gh_stars>1-10
DO
$$
BEGIN
IF register_patch('AddBeamlineManagerToInstrumentsTable.sql', 'jekabskarklins', 'Add responsible person named Beamline manager for each instrument', '2021-04-28') THEN
ALTER TABLE instruments ADD COLUMN manager_user_id INTEGER NOT NULL REFERENCES users (user_id) DEFAULT 0;
ALTER T... |
<reponame>derUli/ulicms
SELECT
TABLE_NAME, table_rows, data_length, index_length,
round(((data_length + index_length) / 1024 / 1024),2) as size_in_mb
FROM information_schema.TABLES
WHERE TABLE_NAME in ('deruli2015_log', 'deruli2015_history', 'deruli2015_mails') and TABLE_TYPE='BASE TABLE' and data_length + inde... |
-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 17, 2020 at 05:24 PM
-- Server version: 5.6.49-cll-lve
-- 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 ... |
<gh_stars>0
## Creates a table with the respective columns that store the Big_IP VIP details
## To be run at a MySQL terminal or using a remote schema update script
CREATE TABLE `vip_status` (`F5_device_name` varchar(80) DEFAULT NULL,`vip_name` varchar(80) DEFAULT NULL,`vip_ipaddress` varchar(80) NOT NULL,`vip_partit... |
<filename>testdata/testdata.sql
INSERT INTO genity
( Title,id, Timestamp)
VALUES
('Uber', '967d5bb5-3a7a-4d5e-8a6c-febc8c5b3f13', '2019-10-01 15:36:38'
::timestamp),
('Twitter', '<PASSWORD>', '2019-10-02 11:16:12'::timestamp),
('Square', '2367710a-d4fb-49f5-8860-557b337386dd', '2019-10-05 05:21:11'::timestamp... |
<filename>dnt/sql/get-job-skilltree.prepared.sql
SELECT (j._JobNumber + t._AwakenForceLevel) as _JobIndex,
j._JobNumber,
-- j.ID as _JobID,
s.ID as _SkillID,
t._SubSkillTableID,
t._SkillConditionID,
s._NameID,
s._IconImageIndex,
s._NeedWeaponType1,
s._NeedWeaponType2,
s._MaxLevel,... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Gép: 127.0.0.1:3306
-- Létrehozás ideje: 2019. Ápr 27. 15:36
-- Kiszolgáló verziója: 5.7.24
-- PHP verzió: 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... |
<gh_stars>0
/*
??????????????????????????????????????????????????????????????????????
?|
?| Procedure Name: ag_test_run_del
?|
?| Description: Logically deletes records from the table test_run
?|
?| @Author: Auto Generated
?| @Createdate: 2/13/2018
?|
?| @Input Param: @test_run_id int = TestRunId
?| @test_plan_i... |
SELECT spectator
FROM Opinions
WHERE movie='Australia' AND stars=5
UNION
SELECT spectator
FROM Frequents
WHERE cinema='Hoyts';
|
truncate tmp_classificators;
truncate tmp_full_products;
truncate tmp_full_products_languages;
truncate tmp_products_categories;
truncate tmp_products_pictures;
|
<gh_stars>1-10
--[Sign][0][2] Signs 관련 저장 프로시저 생성
--[1] 입력 저장 프로시저
Create Proc dbo.WriteSigns
@UserId NVarChar(25),
@Password NVarChar(20)
As
Insert Into Signs Values(@UserId, @Password)
Go
--WriteSigns 'redplus', '1234'
--[2] 출력 저장 프로시저
--Create Proc dbo.ListSigns
--As
-- Select * From Signs Order By Id Desc
--... |
--
-- Add index for alias check #__content
--
ALTER TABLE `#__content` ADD INDEX `idx_alias` (`alias`(191));
|
<filename>db/gw-treasure-listruneprofessions.sql
/*
SQLyog Ultimate - MySQL GUI v8.2
MySQL - 5.5.52-MariaDB : Database - mauirixxx
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHEC... |
create table "RESTAPI_PERSON_DETAILS_PII"
(
"ADDITIONALNAME1" varchar,
"ADDITIONALNAME2" varchar,
"ADDRESSID" varchar,
"ADDRESSISONTAXBOUNDARY" boolean,
"ADDRESSLATITUDE" float,
"COBRAEXPORT" varchar,
"COBRAISACTIVE" ... |
<reponame>dsaborg/urbanhacker<gh_stars>0
# FeedSource as foreign key in Downloads
# --- !Ups
alter table downloads add column source_id bigint;
update downloads set source_id = sources.id from sources where downloads.url = sources.url;
alter table downloads alter column source_id set not null;
alter table downloads d... |
<filename>projects/OG-MasterDB/src/main/resources/db/migrate/sqlserver2008/sec/V_52__migrate_sec.sql
SET XACT_ABORT ON;
BEGIN TRAN;
-- update the version
UPDATE sec_schema_version SET version_value='52' WHERE version_key='schema_patch';
ALTER TABLE sec_bond ALTER COLUMN interestaccrual_date DATETIME2(6);
ALTE... |
--DROP TABLE CIB_TCOMPLEXENTITY_EAGER;
--DROP TABLE CIB_TCOMPLEXENTITY_LAZY;
--DROP TABLE CIB_COMPLEXTESTENTITY_CIB_TESTENTITY;
--DROP TABLE CIB_COMPLEXTESTENTITY;
--DROP TABLE cib_syntetic1entity;
--DROP TABLE cib_syntetic2entity;
--DROP TABLE TPSENTITY;
--DROP TABLE CIB_JMENTITY;
--DROP TABLE CIB_TCOMPLEXENTI... |
<filename>api/sqlback/20210329.sql<gh_stars>1-10
-- --------------------------------------------------------
-- 主机: 192.168.3.11
-- 服务器版本: 8.0.22 - MySQL Community Server - GPL
-- 服务器操作系统: Linux
-- HeidiSQL 版本: 9.3.0.4984
-- --------... |
--Under Single-DB mode
USE master;
GO
CREATE DATABASE db1;
GO
USE db1;
GO
CREATE schema test;
GO
SELECT nspname FROM pg_namespace WHERE nspname = 'test';
GO
CREATE table t1 ( a int, b int); -- should be created into dbo.t1
GO
INSERT INTO t1 VALUES ( 1, 1);
GO
SELECT * FROM t1;
GO
-- cross DB reference
USE master;
GO
SE... |
<filename>data-postgres/schemas/init.sql<gh_stars>1-10
CREATE TABLE IF NOT EXISTS settings(id serial NOT NULL,
key varchar(64) NOT NULL UNIQUE,
value text NOT NULL,
PRIMARY KEY (id));
INSERT INTO settings(key, ... |
<reponame>YodaCh96/sql
SELECT * FROM t_lager WHERE preis < 20;
SELECT * FROM t_ma WHERE ort = 'Leipzig';
SELECT * FROM t_ma WHERE ort <> 'Berlin';
|
DROP TABLE IF EXISTS users;
CREATE TABLE users
(
id BIGINT(20) NOT NULL COMMENT 'id',
name VARCHAR(30) NULL DEFAULT NULL COMMENT 'name',
age INT(11) NULL DEFAULT NULL COMMENT 'age',
PRIMARY KEY (id)
);
CREATE TABLE students
(
id BIGINT(20) NOT NULL COMMENT 'id',
user_id BIGINT(20... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.