sql stringlengths 6 1.05M |
|---|
--
CREATE USER quotatest_user NOLOGIN;
CREATE TABLE qt (t text);
ALTER TABLE qt OWNER TO quotatest_user;
INSERT INTO qt SELECT repeat('x', 100) FROM generate_series(1, 100000);
-- Wait a little, to make sure the background worker has picked up the new size.
select pg_sleep(5);
-- Display the table size.
select pg_... |
<gh_stars>0
ALTER TABLE `families` ADD `how_many_hours` INT(10) UNSIGNED NOT NULL AFTER `how_heared_about_us`, ADD `pay_rate` INT(10) UNSIGNED NOT NULL AFTER `how_many_hours`, ADD `housekeeping_or_cooking` VARCHAR(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL AFTER `pay_rate`;
ALTER TABLE `families` C... |
INSERT INTO department
(name)
VALUES
('Sales'),
('Marketing'),
('Finance'),
('Operations'),
('Engineering');
INSERT INTO role
(title, salary, department_id)
VALUES
('Sales Development Director', 100000, 1),
('Sales Development Rep', 55000, 1),
('Email Marketing Manager', 79000, ... |
<filename>initialization/3grantRightsToTables/grantRightsToRoles-expenses.sql
GRANT ALL ON expenses TO accountant;
GRANT SELECT, UPDATE, INSERT, DELETE ON expenses TO administrator;
GRANT SELECT ON expenses TO researcher;
|
<reponame>charlesroper/Recorder-6-SQL<gh_stars>0
use nbndata
go
select
ln.item_name,
min(l.spatial_ref) GridRef
from
location_name ln
inner join
location l on
ln.location_key = l.location_key
group by
item_name
order by
item_name |
<gh_stars>0
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 192.185.72.57 (MySQL 5.6.41-84.1)
# Database: arti17co_soen343
# Generation Time: 2018-11-10 21:46:58 +0000
# *****************... |
<reponame>kelleyb/RPI-Tours-Backend
INSERT INTO categories (name, description) VALUES ('General Tours', 'This section consists of four general tours that go around campus!');
INSERT INTO tours (name, description) VALUES ('Freshman Residence Halls', 'Hey! This is a tour of the freshman residence halls!');
INSERT INTO to... |
ALTER TABLE station ADD COLUMN hostProbationPeriodDays SMALLINT UNSIGNED NOT NULL DEFAULT 0, ADD COLUMN hostProbationWeightMultiplier FLOAT NOT NULL DEFAULT 1.0;
|
-- MySQL dump 10.13 Distrib 5.7.23, for Linux (x86_64)
--
-- Host: mysql Database: inventory
-- ------------------------------------------------------
-- Server version 5.7.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40... |
<filename>db/migrate/000164_order.sql
ALTER TABLE `order` ADD `delivery_service` TINYINT( 1 ) NOT NULL DEFAULT '0'; |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 23, 2017 at 06:44 PM
-- Server version: 5.7.19
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
<filename>src/test/resources/sql/create_trigger/56612a3b.sql
-- file:triggers.sql ln:1337 expect:true
create trigger trig_del_after after delete on parted_stmt_trig
for each statement execute procedure trigger_notice()
|
<filename>DB/postgresql/1-tables.sql
CREATE TABLE aluno (
id Serial,
numero BIGINT UNIQUE NOT NULL,
mail VARCHAR(512),
password VARCHAR(512) NOT NULL,
nome VARCHAR(512) NOT NULL,
sobre_mim VARCHAR(512),
login_time TIMESTAMP,
logged_in BOOL NOT NULL DEFAULT False,
PRIMARY K... |
<reponame>itrust-consulting/trespass-docker
#!/bin/bash
# Get the list of database to create from command line argument. If not, attribute default value
LIST_DBS=$1
LIST_DBS=${LIST_DBS:-FE,SC,REDMINE,ARGUESECURE,TRICKSERVICE}
# Declare array for each default database
declare -A CREATEDB
CREATEDB[FE]="CREATE DATABASE ... |
<filename>presto-product-tests/src/main/resources/sql-tests/testcases/functions/conditional-expressions/simple_case.sql
-- database: presto; groups: qe,conditional
select case when true then 33 end
|
<filename>Database/yii2-baseframe-11mar2016.sql
/*
SQLyog Ultimate v11.33 (64 bit)
MySQL - 5.6.25 : Database - yii2-baseframe
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UN... |
<filename>openGaussBase/testcase/SQL/INNERFUNC/numeric/Opengauss_Function_Innerfunc_Radians_Case0001.sql
-- @testpoint: radians函数入参为特殊值
select radians('Infinity');
select radians('-Infinity');
select radians(-12.98);
select radians(0); |
CREATE TABLE IF NOT EXISTS orders
(
id uuid NOT NULL,
user_id uuid NOT NULL,
ordered_at timestamp WITHOUT TIME ZONE NOT NULL DEFAULT now(),
CONSTRAINT orders_pkey
PRIMARY KEY (id)
)
|
<filename>04-cna-pas-springio-data/cna-pas-springio-data-migration-start/src/main/resources/db/migration/V2__insert_routes.sql
insert into route(id, flight_number, departure, destination) values(101, 'LH7902','MUC','IAH');
insert into route(id, flight_number, departure, destination) values(102, 'LH1602','MUC','IBZ');
i... |
CREATE TABLE IF NOT EXISTS servers(
serverid TEXT PRIMARY KEY,
transactionsid TEXT,
logid TEXT,
alertsid TEXT,
logembed TEXT
);
CREATE TABLE IF NOT EXISTS users(
serverid TEXT NOT NULL,
userid TEXT NOT NULL,
emoji TEXT NOT NULL,
status INTEGER NOT NULL,
FOREIGN KEY (serverid) RE... |
SELECT APP.USERS.ID as ID,
FNAME,
LNAME,
USER_NAME,
PENALTY,
APP.PERMISSIONS."NAME" as PERMISSION_NAME,
APP.PERMISSIONS.ID as PERMISSION_ID
FROM APP.USERS,APP.PERMISSIONS
WHERE APP.USERS.PREMISSION_ID = APP.PERMISSIONS.ID
AND APP.USERS.IS_DELETED = FALSE
And APP.USERS.ID = %... |
<reponame>ken5scal/oauth-az-backend
-- +migrate Up
CREATE TYPE client_status as ENUM('developing','published','suspended','deleted');
CREATE TYPE client_type as ENUM('confidential', 'public');
CREATE TABLE IF NOT EXISTS clients (
client_id VARCHAR(255) NOT NULL UNIQUE,
client_secret_hash VARCHAR(255) UNIQ... |
ALTER TABLE dbo.FactSalesQuota ADD CONSTRAINT [FK_FactSalesQuota_DateKey_DimDate] FOREIGN KEY ([DateKey]) REFERENCES DimDate([DateKey])... |
<gh_stars>0
CREATE OR ALTER VIEW [dbo].[PlayerSessions] AS
SELECT
[a].[playerId],
[a].[login],
[b].[logout],
DATEDIFF(second, [a].[login], [b].[logout]) AS [sessionTime]
FROM
(SELECT
ROW_NUMBER() OVER (PARTITION BY [playerId] ORDER BY id) AS [index],
... |
<filename>tools/sql/foreign_key_change.sql
-- This script is executed after the user_words table was split.
ALTER TABLE starred_words_association
DROP FOREIGN KEY starred_words_association_ibfk_2;
ALTER TABLE starred_words_association
ADD CONSTRAINT starred_wordsID
FOREIGN KEY (starred_word_id) REFERENCES user... |
<filename>src/LnskyDB.Demo/db_mysql.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 80018
Source Host : localhost:3306
Source Database : LnskyNS_Test
Target Server Type : MYSQL
Target Server Version : 80018
File Encoding : 65001
Date: 2019-12-06... |
ALTER TABLE "MLA"."XXMLA_XLAT_OFFENCE" ADD OFFENCE_ID VARCHAR2(50); |
<filename>sql/product.sql
use WebMarketDB;
create table if not exists product(
p_id varchar(10) not null,
p_name varchar(20),
p_unitPrice integer,
p_description TEXT,
p_category varchar(20),
p_manufacturer varchar(20),
p_unitsInStock long,
p_condition varchar(20),
p_fileName varchar(20),
primary key (p_id)
)... |
<reponame>andorei/atop-plsql
drop table at_svs_;
drop table at_cdc_;
|
-- triggerB.test
--
-- execsql {
-- CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
-- INSERT INTO t2 VALUES(1,2);
-- CREATE TABLE changes(x,y);
-- CREATE TRIGGER r1t2 AFTER UPDATE ON t2 BEGIN
-- INSERT INTO changes VALUES(new.a, new.b);
-- END;
-- }
CREATE TABLE t2(a INTEGER PRIMARY KEY, b);
INSE... |
INSERT INTO `image_space_type` VALUES ('2020-09-24 06:04:51.708064', '2020-09-24 06:04:51.708064', 1, '头像');
INSERT INTO `image_space_type` VALUES ('2020-09-24 06:10:36.509527', '2020-09-24 06:10:36.509527', 2, '思忆');
|
INSERT INTO `addon_account` (name, label, shared) VALUES
('society_dock','Marina',1)
;
INSERT INTO `addon_inventory` (name, label, shared) VALUES
('society_dock','Marina',1)
;
INSERT INTO `jobs` (name, label) VALUES
('dock','Marina')
;
INSERT INTO `job_grades` (job_name, grade, name, label, salary, skin_male, ... |
<gh_stars>1-10
CREATE TABLE `jobs` (
`name` varchar(64) NOT NULL,
`description` varchar(255) NOT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `logs` (
`name` varchar(64) NOT NULL,
`stamp` datetime NOT NULL,
`duration` bigint(20) NOT NULL,
PRIMARY KEY (`name`,`stamp`)
) ENGINE=In... |
<filename>db_spp.sql
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.31.10
-- Generation Time: Jul 14, 2020 at 10:06 AM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00... |
SELECT title FROM book WHERE id NOT IN ( SELECT book_id FROM checkout_item WHERE book_id IS NOT null ) UNION SELECT title FROM movie WHERE id NOT IN ( SELECT movie_id FROM checkout_item WHERE movie_id IS NOT null );
/* Answers:
1984
Catcher in the Rye
Crouching Tiger, Hidden Dragon
Domain Driven Design
Fellowship of ... |
<gh_stars>0
SELECT
f.folder_id,
f.name,
project_id,
p.folder_id,
p.name,
p.[description]
FROM
[catalog].projects p
INNER JOIN
[catalog].folders f ON p.folder_id = f.folder_id |
select loan.id "id", loan.publish_date "publishDate"
from bao_t_auto_publish_info a, bao_t_loan_info loan
inner join BAO_T_LOAN_DETAIL_INFO d
on d.loan_id = loan.id
inner join bao_t_audit_info au
on au.relate_primary = loan.id
where loan.loan_status = '待发布'
and loan.attachment_flag = '已完成'
and loan.N... |
<gh_stars>0
/*
Navicat Premium Data Transfer
Source Server : penta
Source Server Type : MySQL
Source Server Version : 50720
Source Host : 192.168.127.12
Source Database : penta
Target Server Type : MySQL
Target Server Version : 50720
File Encoding : utf-8
Date: 03/15/2... |
SELECT
repo_name repository_name,
name language_name
FROM
bigquery-public-data.github_repos.languages,
unnest(language) language_name |
<reponame>asimuzzaman/AllExpo
-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jun 06, 2020 at 11:28 PM
-- Server version: 10.2.32-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_z... |
alter table template drop constraint template_pipeline_id_fkey;
alter table test drop constraint test_template_id_fkey;
alter table run drop constraint run_test_id_fkey;
alter table run_result drop constraint run_result_run_id_fkey;
alter table run_result drop constraint run_result_result_id_fkey;
alter table template_... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 13, 2021 at 03:55 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>database/queries/PlayerGameStats.sql
--select TOP 100 * from GameStatistics
SELECT COUNT(DISTINCT(GameId))
FROM PlayerGameStatistics
SELECT COUNT(*)
FROM GameStatistics
select * from Game where Id = 1118
select * from GameStatistics where GameId = 1118
select * from PlayerGameStatistics where ... |
<reponame>hailongz/kk-wallet
#钱包
CREATE TABLE IF NOT EXISTS `wallet_1_wallet` (
id BIGINT NOT NULL #ID
,`value` BIGINT DEFAULT 0 #[字段] 余额(分)
,`inValue` BIGINT DEFAULT 0 #[字段] 累计收入(分)
,`outValue` BIGINT DEFAULT 0 #[字段] 累计支出(分)
,`iid` BIGINT DEFAULT 0 #[字段] 最后流水号
,`ctime` BIGINT DEFAULT 0 #[字段] 创建时间
,`mti... |
-- MySQL dump 10.17 Distrib 10.3.22-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: bookstore
-- ------------------------------------------------------
-- Server version 10.3.22-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER... |
create table pet
(
id integer not null,
pet_name varchar(255) not null,
animal varchar(255) not null,
primary key(id)
); |
CREATE PROCEDURE UpdateLocation
@Id int,
@Location nvarchar(20)
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
UPDATE [dbo].[Locations]
SET [Location] = @Location
WHERE Id = @Id
END
|
<filename>db-ayoantre.sql
/*
SQLyog Ultimate v10.42
MySQL - 5.5.5-10.1.33-MariaDB : Database - ayoantre
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*... |
WITH ws AS
(SELECT d_year AS ws_sold_year,
ws_item_sk,
ws_bill_customer_sk ws_customer_sk,
sum(ws_quantity) ws_qty,
sum(ws_wholesale_cost) ws_wc,
sum(ws_sales_price) ws_sp
FROM web_sales
LEFT JOIN web_returns ON wr_order_number=ws_order_number
AND ws_item_sk=... |
INSERT INTO types (id, name)
VALUES
(1, 'Equipment'),
(2, 'Cosmetic'),
(3, 'Consumable'),
(4, 'Misc');
INSERT INTO slots (id, name)
VALUES
(1, 'Head'),
(2, 'Body'),
(3, 'Main Hand'),
(4, 'Off Hand'),
(5, 'Mask'),
(6, 'Outfit'),
(7, 'Clothes Dye'),
(8, 'Hair Dye');
INSERT INTO items (name, description, level, slot, ty... |
<reponame>hemachandarv/short<filename>backend/app/adapter/sqldb/migration/25_add_type_to_feature_toggle_table.sql
-- +migrate Up
ALTER TABLE "feature_toggle"
ADD COLUMN "type" VARCHAR(50) DEFAULT 'manual' NOT NULL;
-- +migrate Down
ALTER TABLE "feature_toggle"
DROP COLUMN "type"; |
<filename>DBADashDB/Report/Stored Procedures/SlowQueriesDetail.sql
CREATE PROC [Report].[SlowQueriesDetail](
@FromDate DATETIME2(3)=NULL,
@ToDate DATETIME2(3)=NULL,
@ObjectName SYSNAME=NULL,
@ClientHostName NVARCHAR(128)=NULL,
@ConnectionID SYSNAME=NULL,
@ClientAppName SYSNAME=NULL,
@InstanceIDs VARCHAR(MAX)=N... |
DROP FUNCTION IF EXISTS X_MRP_ProductInfo_Detail_Insert_Fallback(date);
CREATE OR REPLACE FUNCTION X_MRP_ProductInfo_Detail_Insert_Fallback(IN DateOn date)
RETURNS VOID
AS
$BODY$
INSERT INTO X_MRP_ProductInfo_Detail_MV
SELECT *
FROM X_MRP_ProductInfo_Detail_Fallback_V($1, $1);
$BODY$
LANGUAGE sql STABLE;
COMME... |
drop table if exists public.customer_lifecycle;
create table public.customer_lifecycle (
customer_id int4 not null,
first_rental_date timestamp not null,
first_film_rented varchar(255) not null,
last_rental_date timestamp not null,
last_film_rented varchar(255) not null,
average_rental_interval interval not null... |
drop table if exists views;
drop table if exists anomalies;
drop table if exists trending;
create table views (
page_title varchar(512),
timestamp timestamp,
views int,
primary key (page_title, timestamp)
);
create table anomalies (
page_title varchar(512),
start_timestamp timestamp,
end_t... |
<filename>doc/sevenweb.sql<gh_stars>0
/*
Navicat Premium Data Transfer
Source Server : 本地
Source Server Type : MySQL
Source Server Version : 50723
Source Host : localhost:3306
Source Schema : sevenweb
Target Server Type : MySQL
Target Server Version : 50723
File Encoding ... |
<gh_stars>10-100
CREATE TABLE authorization_zone (
id bigserial NOT NULL primary key,
name varchar(255) NOT NULL,
description varchar(1024) NOT NULL,
subdomain varchar(255) NOT NULL
);
CREATE TABLE authorization_zone_client (
id bigserial NOT NULL primary key,
issuer_id integer NOT NULL,
client_id varcha... |
<gh_stars>1-10
create schema if not exist sandbox;
use sandbox;
create user 'pyspark_user' identified by '<PASSWORD>';
grant all privileges on sandbox.* to 'pyspark_user';
drop table if exists book_orders;
create table book_orders (
order_uuid varchar(100),
first_name varchar(100),
last_name varchar(100),
address var... |
<gh_stars>1-10
--+ holdcas on;
set system parameters 'dont_reuse_heap_file=yes';
create table t (i1 int, i2 int, i3 varchar(10));
insert into t values (null, null, null);
insert into t values (0, 0, '00'), (0, 1, '01'), (0, 2, '02'), (0, 3, '03'), (0, 4, '04');
insert into t values (1, 0, '10'), (1, 1, '11'), (1, 2, '1... |
<gh_stars>0
SELECT title FROM movies
JOIN stars ON movies.id = stars.movie_id
WHERE person_id = (SELECT id from people WHERE name = "<NAME>")
INTERSECT
SELECT title FROM movies
JOIN stars ON movies.id = stars.movie_id
AND person_id = (SELECT id from people WHERE name = "<NAME>"); |
<reponame>IngWilliamMendoza/SwAlcaldiaChameza
-- 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_DA... |
-- +migrate Up
ALTER TABLE clients ADD COLUMN name TEXT NOT NULL;
-- +migrate Down
ALTER TABLE clients DROP COLUMN name;
|
CREATE INDEX all_vs_all_nonpolymer_score ON all_vs_all_nonpolymer(irscore);
CREATE INDEX all_vs_all_dnarna_score ON all_vs_all_dnarna(irscore);
CREATE INDEX all_vs_all_ppi_score ON all_vs_all_ppi(irscore);
CREATE INDEX all_vs_all_nonpolymer_tani ON all_vs_all_nonpolymer(irscore,tanimoto);
CREATE INDEX all_vs_all_dnarn... |
<gh_stars>0
-- TRIGGER
-- Good for logging
-- Can use for create constraint but NOT RECOMMEND
-- Fun facts:
-- - user: return current user
-- - sysdate: return current system date (include time)
-- - dmp file can not import on Oracle Cloud
DESC scott_dept;
ALTER TABLE scott_dept ADD budget NUMBER(10);
-- s... |
<reponame>nileshmahale03/T-SQL
---------------------------------------------------------------------
-- Subqueries
-- SQL supports writing queries within queries, or nesting queries
-- When you use subqueries, you avoid the need for seperate steps in your solution that store intermediate query results in variables.
... |
CREATE OR REPLACE PROCEDURE DROP_INDEXES_ON_TOPIC_CHANGED(topic_name IN VARCHAR2)
IS
CURSOR cursor_indexes IS
SELECT UI.INDEX_NAME
FROM USER_INDEXES UI
WHERE UI.TABLE_NAME = UPPER(topic_name)
AND NOT EXISTS(SELECT 1
FROM USER_CONSTRAINTS
... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 12, 2020 at 12:40 PM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 09, 2019 at 12:13 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.2.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 15, 2022 at 04:47 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
SET DEFINE OFF;
CREATE UNIQUE INDEX AFW_19_BOUTN_UK1 ON AFW_19_BOUTN
(REF_DISPN_FONCT, REF_LANG, ITEM_SUBST)
LOGGING
/
|
CREATE TABLE [dbo].[dnn_EasyDNNNewsCategories] (
[EntryID] INT IDENTITY (1, 1) NOT NULL,
[ArticleID] INT NOT NULL,
[CategoryID] INT NOT NULL,
CONSTRAINT [PK_dnn_EasyDNNNewsCategories] PRIMARY KEY CLUSTERED ([EntryID] ASC),
CONSTRAINT [FK_dnn_EasyDNNNewsCategories_EasyDNNNews] FOREIGN KEY ([Arti... |
<reponame>eajahuanca/Inventario
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 21-12-2017 a las 22:58:23
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!... |
<reponame>Sleshwave/DiarMe
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 10, 2018 at 05:09 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 5.6.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "... |
--还原数据库
USE [master]
GO
ALTER DATABASE [数据库] SET OFFLINE WITH ROLLBACK IMMEDIATE;
GO
RESTORE DATABASE [数据库]
FROM DISK='E:\***.bak'
WITH
NOUNLOAD,
REPLACE,
STATS=10,
MOVE '***'
TO 'E:\***.mdf',
MOVE '***_log'
TO 'E:\***_log.ldf';
GO
ALTER DATABASE [数据库] SET ONLINE;
GO |
<reponame>sandroasp/BizTalk-Server-Resources
USE [msdb]
GO
/****** Object: Job [Force Full Backup BizTalk Server (BizTalkMgmtDb)] Script Date: 15-04-2014 22:12:17 ******/
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
/****** Object: JobCategory [Database Maintenance] Script Date: 15-04-2014 ... |
create table public.profiles (
id bigint generated by default as identity primary key,
email text not null,
first_name text
);
create or replace function public.handle_new_user()
returns trigger as $$
begin
insert into public.profiles (id, email, first_name)
values (
new.id,
new.email,
n... |
<gh_stars>100-1000
-- wherelimit.test
--
-- execsql {SELECT count(*) FROM t1 WHERE y=3}
SELECT count(*) FROM t1 WHERE y=3 |
<reponame>Shuttl-Tech/antlr_psql
-- file:xml.sql ln:85 expect:true
SELECT xmlpi(name foo)
|
-- file:union.sql ln:288 expect:true
INSERT INTO t2c VALUES ('vw'), ('cd'), ('mn'), ('ef')
|
<gh_stars>1000+
CREATE DATABASE Demo
GO
USE [Demo]
GO
CREATE TABLE [dbo].[Tenant](
[Id] [int] NOT NULL,
[Name] varchar(100) NOT NULL,
CONSTRAINT [PK_Tenant] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRI... |
DROP DATABASE IF EXISTS blogsite_db;
CREATE DATABASE blogsite_db; |
-- 2019-02-20T15:33:04.558
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Column SET DefaultValue='N',Updated=TO_TIMESTAMP('2019-02-20 15:33:04','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=50181
;
-- 2019-02-20T15:33:24.244
-- I forgot to set the DICTIONARY_ID_COMMENTS System... |
-- 2018-12-20T13:42:42.590
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_SysConfig (AD_Client_ID,AD_Org_ID,AD_SysConfig_ID,ConfigurationLevel,Created,CreatedBy,Description,EntityType,IsActive,Name,Updated,UpdatedBy,Value) VALUES (0,0,541252,'S',TO_TIMESTAMP('2018-12-20 13:42:42','YYYY... |
<filename>src/Database/Scripts/Generate Demo Data.sql
SET IDENTITY_INSERT [dbo].[Genders] ON
GO
INSERT [dbo].[Genders] ([Id], [Name]) VALUES (1, N'Male')
GO
INSERT [dbo].[Genders] ([Id], [Name]) VALUES (2, N'Female')
GO
INSERT [dbo].[Genders] ([Id], [Name]) VALUES (3, N'Unknown')
GO
SET IDENTITY_INSERT [dbo... |
create database umlClient;
create table role(
id serial primary key,
role_type varchar(2000)
);
create table comment(
id serial primary key,
comment_text varchar(2000)
);
create table attach(
id serial primary key,
attach varchar(200)
);
create table category(
id serial primary key,
category varchar(2000... |
create sequence hibernate_sequence start with 1 increment by 1;
create table user (id bigint not null, name varchar(255), primary key (id)); |
<filename>sources/Builders/org.ohdsi.cdm.builders.cprd_v5/CPRDV5/Lookups/HES_procedures_epi.sql<gh_stars>1-10
{Source_to_Standard}
SELECT distinct REPLACE(SOURCE_CODE, '.', ''), TARGET_CONCEPT_ID
FROM CTE_VOCAB_MAP
WHERE lower(SOURCE_VOCABULARY_ID) = 'opcs4' AND lower(TARGET_DOMAIN_ID) = 'procedure' AND (TARGET_INVALI... |
include: helpers/gp_management_utils_helpers.sql;
-- Given a segment running without a replication slot
0U: select * from pg_drop_replication_slot('some_replication_slot');
!\retcode rm -rf /tmp/some_isolation2_pg_basebackup;
-- When pg_basebackup runs with --slot and stream as xlog-method
select pg_basebackup(addres... |
/*
Navicat Premium Data Transfer
Source Server : 192.168.43.227-MYSQL
Source Server Type : MySQL
Source Server Version : 50561
Source Host : localhost:3306
Source Schema : blog
Target Server Type : MySQL
Target Server Version : 50561
File Encoding : 65001
Date: 10/04... |
SELECT
id, bit_length(name) AS name, birthday, bit_length(race) AS race
FROM demographics; |
<reponame>Vinodhakumara/joindin-api
# Add new cfp url to the events table
ALTER TABLE `events` ADD column `event_cfp_url` VARCHAR(200);
INSERT INTO patch_history SET patch_number = 18;
|
<reponame>Zhaojia2019/cubrid-testcases
drop if exists t;
create table t(i int primary key, name varchar(20),job varchar(20));
insert into t values(1,'Jone','teacher');
insert into t values(2,'Chandel','programmer');
insert into t values(3,'Jim',null);
insert into t select rownum+3,'person'||rownum,'unkown' from db_root... |
<reponame>Amnia-Oat/Tea
use db_table; #tea_DBを使用
#テーブルの作成
create table tea_type(
teaID int(1) not null,
name char(20),
feature text);
create table herb_type(
herbID int(2) not null,
name char(20),
feature text);
#テーブルにデータを挿入
insert into tea_type values
('1','テ・オ・レ','ミルクティーのために生まれたブレンド茶。ミルクをたっぷり入れて楽しみたい時に最適な、濃厚なコクとまろ... |
create table shinryou_attr (
shinryou_id int unsigned not null primary key,
tekiyou text,
foreign key fk_attr_shinryou_id (shinryou_id) references visit_shinryou(shinryou_id)
on delete cascade
); |
<gh_stars>0
/* SQL Program to retrieve the department numbers which have female average salary
greater than male average salary of the same department.*/
select dno as Dept_No /* Selecting department number */
from Employee as E1
where E1.gen = 'F' /* Selecting female employees */
group by dno
having avg(s... |
<reponame>hernan-alperin/segmenter
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.5.16
-- Dumped by pg_dump version 9.5.16
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', 'public' , fa... |
DELIMITER $
DROP TRIGGER IF EXISTS tri_oaappleave;
create trigger tri_oaappleave after insert
on oaappleave for each row
begin
set @minOrderNo = 1;
insert into oaappleavenode(Id,LeaveId,ProjectId,OrderNo,UserId,Kind) select UUID(),New.Id,New.ProjectId,OrderNo,UserId,Kind from bpmnode where ProcessId = New.ProcessId a... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 02-09-2016 a las 03:10:24
-- Versión del servidor: 10.1.13-MariaDB
-- Versión de PHP: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
<reponame>Molajo/Framework
INSERT INTO `molajo_extension_instances` (`extension_id`, `catalog_type_id`, `title`, `subtitle`, `namespace`, `path`, `alias`, `menu`, `page_type`, `content_text`, `protected`, `featured`, `stickied`, `status`, `author_id`, `start_publishing_datetime`, `stop_publishing_datetime`, `version`, ... |
-- Adds a foreign key from comments to threads to identify owning threads
alter table comment
add column thread_id uuid not null;
alter table comment
add constraint comment_thread_id_fk foreign key (thread_id)
references thread (idthread); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.