sql stringlengths 6 1.05M |
|---|
<gh_stars>0
-- Divide the first number by the second, or return 0 if the second number is 0
DELIMITER //
DROP FUNCTION IF EXISTS SafeDiv;
CREATE FUNCTION SafeDiv(a INT, b INT) RETURNS FLOAT DETERMINISTIC BEGIN IF b = 0 THEN RETURN 0;
END IF;
RETURN a / b;
END;
DELIMITER; //
|
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 22, 2021 at 07:56 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
SELECT
cnt.contactid,
cnt.contactname,
cnt.familyname,
cnt.givennames,
cst.contactstatus,
cnt.url,
cnt.address,
cnt.recdatecreated,
cnt.recdatemodified
FROM
ndb.contacts AS cnt INNER JOIN
ndb.contactstatuses AS cst ON cnt.contactstatusid = cst.contactstatusid
WHERE
(${lastname} IS NULL OR cnt... |
<filename>5.2.3/Database/Constraints/AFW_12_REGLE_APROB_FK4.sql
SET DEFINE OFF;
ALTER TABLE AFW_12_REGLE_APROB ADD (
CONSTRAINT AFW_12_REGLE_APROB_FK4
FOREIGN KEY (REF_ROLE_APROB)
REFERENCES AFW_12_ROLE_APROB (SEQNC)
ENABLE VALIDATE)
/
|
<filename>airbyte-integrations/bases/base-normalization/integration_tests/normalization_test_output/postgres/test_nested_streams/first_output/airbyte_incremental/test_normalization/nested_stream_with_c___long_names_partition.sql
create table "postgres".test_normalization."nested_stream_with_c___long_names_p... |
<reponame>Moresteck/go-radio
CREATE TABLE IF NOT EXISTS schedule (
date_at DATE NOT NULL PRIMARY KEY,
content TEXT NOT NULL,
submitted_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
|
<reponame>NikolayDobrinski/SoftUni
delete from clients AS c
where c.id not in (select co.client_id from courses AS co) and length(c.full_name) > 3; |
<gh_stars>0
ALTER TABLE CUSTOMER ADD
PRIMARY KEY PK_CUSTOMER
(
CUSTOMER_ID
);
|
<gh_stars>0
-- // CB-14617 remove idbroker for cluster templates
-- Migration SQL that makes the change goes here.
DELETE FROM idbroker WHERE cluster_id IN
(SELECT c.id FROM stack s JOIN cluster c ON s.id = c.stack_id WHERE s.type = 'TEMPLATE');
-- //@UNDO
-- SQL to undo the change goes here. |
USE [land_use_database]
GO
exec [dbo].[GenerateFeaturesML] @input_table = N'TrainData', @output_table = N'train_features';
exec [dbo].[GenerateFeaturesML] @input_table = N'ValData', @output_table = N'validation_features';
exec [dbo].[GenerateFeaturesML] @input_table = N'TestData', @output_table = N'test_features';
ex... |
<reponame>towczare/awesome-movies-api<filename>src/main/resources/db/migration/V21__add_new_table_actor_movie.sql
create table movie_actor
(
movie_id integer not null
references movie(id),
actor_id integer not null
references actor(actor_id),
constraint movie_actor_pkey
primary key (movie_id, actor_id)
... |
<reponame>JohnsonZZ/industry
-- phpMyAdmin SQL Dump
-- version 4.6.2
-- https://www.phpmyadmin.net/
--
-- Host: 10.249.50.199:10495
-- Generation Time: 2016-06-29 10:16:06
-- 服务器版本: 5.5.24-CDB-2.0.0-log
-- PHP Version: 5.6.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_... |
<reponame>patrickfischer1/WebAPI<gh_stars>10-100
ALTER TABLE ${ohdsiSchema}.sec_role ADD system_role BOOLEAN DEFAULT(FALSE) NOT NULL;
ALTER TABLE ${ohdsiSchema}.sec_role DROP CONSTRAINT sec_role_name_uq;
UPDATE ${ohdsiSchema}.sec_role SET system_role = TRUE
WHERE NOT EXISTS(SELECT * FROM ${ohdsiSchema}.sec_user WHE... |
<reponame>daramousk/kratos<filename>persistence/sql/migrations/sql/20210410175418000039_network.postgres.down.sql
ALTER TABLE "selfservice_settings_flows" DROP CONSTRAINT "selfservice_settings_flows_nid_fk_idx"; |
// double-slashed comment
INSERT into role_graphs (provider, graphml)
VALUES ('SKY', 'some text; some more text');
-- it's role_graphs_sql table
CREATE TABLE role_graphs_sql(
provider text, -- provider name
graphml text, ---graph markup language
settings text, /** xml markup language **/
PRIMARY KEY (prov... |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字except(保留),作为函数名
--关键字不带引号-失败
drop function if exists except;
create function except(i integer)
returns integer
as $$
begin
return i+1;
end;
$$ language plpgsql;
/
--关键字带双引号-成功
drop function if exists "except";
create function "except"(i integer)
returns i... |
<gh_stars>0
CREATE TABLE movies (title VARCHAR(200), year INTEGER);
CREATE TABLE actors (name VARCHAR(50));
INSERT INTO movies VALUES ("The Hangover", 2009);
INSERT INTO actors VALUES ("<NAME>");
SELECT * FROM movies;
SELECT * FROM actors;
|
create table addresses
(
id varchar(255) not null,
street varchar(255) not null,
number varchar(255) not null,
created_at datetime not null,
main tinyint not null,
deleted_at datetime
);
create table order_products
(
quantity float not null,
o... |
-- Spring Boot Data Initialization File.
-- Bootstrapping default categories
-- Food Related
insert into category(name) values('Food');
insert into category(name) values('Alcohol');
insert into category(name) values('Grocery');
-- Transport Related
insert into category(name) values('Fuel');
insert into category(name... |
CREATE TABLE reviews (
id BIGSERIAL NOT NULL PRIMARY KEY,
restaurant_id BIGINT NOT NULL REFERENCES restaurants(id),
name VARCHAR(50) NOT NULL,
review TEXT NOT NULL,
rating INT NOT NULL check(rating >= 1 and rating <=5)
); |
<reponame>ameet007/giveadinnerparty
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 18, 2017 at 02:43 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>Gourishanakr/kbvault<filename>KBVault.Web/Install/update-version-0.45-to-0.5.sql
USE [kbvault]
GO
ALTER TABLE dbo.Activities ALTER COLUMN Information nvarchar(500)USE [kbvault]
GO
|
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 04 Nov 2020 pada 09.40
-- Versi Server: 10.1.21-MariaDB
-- PHP Version: 7.1.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 11 Bulan Mei 2021 pada 04.56
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.3.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
CREATE DATABASE db_testes_php;
# DROP DATABASE db_testes_php;
USE db_testes_php;
CREATE TABLE tbl_usuario (
cod_usuario INT UNSIGNED UNIQUE NOT NULL AUTO_INCREMENT,
usuario VARCHAR(255) NOT NULL,
senha VARCHAR(255) NOT NULL
);
SELECT * FROM tbl_usuario; |
-- Accounts created, security related.
-- userName (email), the salt used, and the password hash
CREATE TABLE IF NOT EXISTS account (
accountId BIGINT NOT NULL AUTO_INCREMENT UNIQUE
, userName VARCHAR( 256) NOT NULL DEFAULT ''
, salt VARCHAR(1024) ... |
<reponame>cnnrmnn/godipper
ALTER TABLE orders
MODIFY COLUMN address_id SMALLINT UNSIGNED NULL;
|
CREATE TABLE "plugin_sms_credit" (
"id_user_credit" INTEGER PRIMARY KEY AUTOINCREMENT,
"id_user" INTEGER NOT NULL,
"id_template_credit" INTEGER NOT NULL,
"valid_start" DATETIME NOT NULL,
"valid_end" DATETIME NOT NULL
);
CREATE TABLE "plugin_sms_credit_template" (
"id_credit_template" INTEGER PRIMARY KEY AUTOI... |
<filename>tests/install_unit_tests.sql
prompt
prompt
prompt **************************************************************************
prompt Method4 Unit Tests Installer
prompt **************************************************************************
prompt
prompt Installing unit test package...
@@method4_test.pc... |
-- file:updatable_views.sql ln:1061 expect:true
SELECT * FROM vx1
|
<gh_stars>1-10
UPDATE `creature_template` SET `ScriptName`='boss_high_astromancer_solarian' WHERE `entry`=18805;
UPDATE `creature_template` SET `ScriptName`='mob_solarium_priest' WHERE `entry`=18806;
|
<filename>evo-X-Scriptdev2/sql/Updates/r1629_mangos.sql
UPDATE creature_template SET ScriptName='boss_gothik' WHERE entry=16060;
|
<reponame>Akylas/openmaptiles
-- etldoc: layer_building[shape=record fillcolor=lightpink, style="rounded,filled",
-- etldoc: label="layer_building | <z13> z13 | <z14_> z14+ " ] ;
CREATE INDEX IF NOT EXISTS osm_building_relation_building_idx ON osm_building_relation (building) WHERE building = '' AND ST_GeometryTyp... |
<reponame>EWEN14/cfa-vaadin<gh_stars>0
ALTER TABLE contrat
ADD date_mail_ou_rdv_signature_cua_avn_1 date;
ALTER TABLE contrat
DROP COLUMN date_mail_ou_rdv_siganture_conv_avn_1;
ALTER TABLE contrat
DROP COLUMN date_remise_originaux;
ALTER TABLE contrat
DROP COLUMN code_postal_representant;
ALTER TABL... |
WITH source_orders AS (
SELECT *
FROM {{ source('warehouse', 'orders') }}
),
renamed as (
SELECT order_id,
cust_id AS customer_id,
order_status,
order_purchase_timestamp::TIMESTAMP,
order_approved_at::TIMESTAMP,
order_delivered_carrier_date::TIMESTAMP,
order_d... |
<reponame>EMVignesh96/howzat-api
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE TABLE players (
player_uuid uuid DEFAULT uuid_generate_v4() PRIMARY KEY,
first_name VARCHAR(50),
last_name VARCHAR(50),
role VARCHAR(50),
matches INT,
runs INT,
strike_rate DECIMAL(5,2),
highest INT,
highest_not_out BOOLEAN... |
/* Entrypoint script for postgres container to set up databases and users for
docker-compose setup */
CREATE DATABASE metadata_db;
CREATE DATABASE fence_db;
CREATE DATABASE indexd_db;
CREATE DATABASE arborist_db;
CREATE USER fence_user;
ALTER USER fence_user WITH PASSWORD '<PASSWORD>';
ALTER USER fence_user WITH SUP... |
<reponame>SECURIoTESIGN/SAM-API<filename>database/database-core-modules.sql
--------------------------------------------------------
-- SAM database core modules
-- last update: 21/11/2021
--------------------------------------------------------
USE sam;
---
--- Data for table `type`
---
INSERT INTO `type` VALUES (1,'... |
<reponame>Kiandr/sql<filename>Db/CRUD/CreateTables.sql
create table Person(
Id integer,
FirstName varchar(30),
LastName varchar(10)
);
create table company_divisions (
department varchar(100),
company_division varchar(100),
primary key (department)
);
create table company_regions (
region_id int,
... |
<reponame>wangsikai/learn
##获取学生一段时间内作业列表,只查询已下发
#macro($findByUserId(userId,startDate,endDate))
select a.* from student_homework a
inner join homework b on a.homework_id = b.id
where a.issue_at >= :startDate and a.issue_at < :endDate and a.student_id = :userId
and a.issue_at is not null and a.right_rate is n... |
<reponame>FredHutch/HDC-DataEngineering-SQLSync
if object_id('dbo.GetColumnList') is not null
begin
exec ('drop function dbo.GetColumnList')
end
go
create function dbo.GetColumnList (@DatabaseName varchar(128), @SchemaName varchar(128), @TableName varchar(128), @ColumnsToIgnore xml, @ColumnList xml, @Alias varchar... |
CREATE PROCEDURE sp_GetProductGroups
@ProductId as int
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
-- Insert statements for procedure here
DECLARE @Results AS VARCHAR(2000)
SET @Results = ''
SELECT @Results = cast(nCatId as nva... |
<gh_stars>1-10
DROP INDEX cr_heap_bitmap_idx1;
|
<filename>sql/invite.sql
CREATE TABLE `invite` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` INT(10) UNSIGNED NOT NULL COMMENT '用户ID',
`invite_uid` INT(10) UNSIGNED NOT NULL COMMENT '被邀请用户ID',
`status` TINYINT(1) UNSIGNED NOT NULL COMMENT '状态,0=未参与购买,1=已参与购买',
`invite_time` INT(10) UNSIGNED NOT N... |
CREATE TABLE IF NOT EXISTS users (
username varchar(32) primary key,
password varchar(128) not null,
balance integer not null,
basepoint smallint not null,
created timestamp not null default CURRENT_TIMESTAMP);
CREATE TABLE IF NOT EXISTS categories (
id serial primary key,
... |
CREATE USER pacs WITH PASSWORD 'password';
CREATE DATABASE bahmni_pacs;
GRANT ALL PRIVILEGES ON database bahmni_pacs to pacs;
|
<reponame>Andrey-V-Georgiev/MySQL
# 02 INSERT
INSERT INTO products_stores (product_id, store_id)
(
select p.id, 1
from products p
left join products_stores ps on p.id <> ps.product_id
group by p.id
);
SELECT store_id, s.name, p.name, product_id FROM products_stores
JOIN products p ON p.id = products_stores.pro... |
<reponame>Romsik788/olimpiada<filename>food_ordering.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Окт 30 2021 г., 12:54
-- Версия сервера: 8.0.24
-- Версия PHP: 8.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET ti... |
SELECT enquiry_json, synced FROM enquiry WHERE created_by='%s' ORDER BY id LIMIT %d OFFSET %d
CREATE TABLE %Q.%s(%s)
CREATE TABLE %Q.sqlite_sequence(name,seq)
SELECT COUNT(1) FROM children WHERE child_owner = ?
SELECT criteria FROM enquiry WHERE id = ?
SELECT * FROM enquiry WHERE synced
CREATE TABLE %Q.'%q_content'(%s)... |
--Creates the cleaned items table
drop table if exists cleaned.items;
create table cleaned.items as (
select id_llamado,
lote_descripcion,
producto_nombre_catalogo,
precio_unitario_estimado,
presentacion
from raw.item_solicitado
);
--clean presentacion variable to group _NO_APLICA_ and NULL values together as _NO_A... |
<filename>finance/egov/egov-collection/src/main/resources/db/migration/main/V20160621220115__collection_coll_master_access_roleaction.sql<gh_stars>10-100
INSERT into eg_role values(nextval('seq_eg_role'),'Coll_Master Access','This role has access to create, view and modify all master screens',current_date,1,1,current_d... |
<reponame>Shuttl-Tech/antlr_psql
-- file:rules.sql ln:85 expect:true
create table rtest_t9 (a int4, b text)
|
<reponame>jean-philippe-bousselin/orca-api<filename>conf/db.sql
create table rcm.categories
(
id int auto_increment
primary key,
name varchar(30) not null
)
;
create table rcm.championships
(
id int auto_increment
primary key,
name varchar(250) not null,
description text null,
thumbnailUrl varchar(... |
<reponame>smith750/kc
TRUNCATE TABLE GROUP_TYPES DROP STORAGE
/
INSERT INTO GROUP_TYPES (GROUP_TYPE_CODE,GROUP_NAME,UPDATE_USER,UPDATE_TIMESTAMP,OBJ_ID,VER_NBR)
VALUES (1,'IRB','admin',SYSDATE,SYS_GUID(),1)
/
INSERT INTO GROUP_TYPES (GROUP_TYPE_CODE,GROUP_NAME,UPDATE_USER,UPDATE_TIMESTAMP,OBJ_ID,VER_NBR)
VALU... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.21 - MySQL Community Server (GPL)
-- Server OS: Win32
-- HeidiSQL Version: 9.3.0.4984
-- -------------------------------------------------------... |
DELETE FROM `wp_attribute` WHERE `model_name`='business_card';
DELETE FROM `wp_model` WHERE `name`='business_card' ORDER BY id DESC LIMIT 1;
DROP TABLE IF EXISTS `wp_business_card`;
DELETE FROM `wp_attribute` WHERE `model_name`='business_card_collect';
DELETE FROM `wp_model` WHERE `name`='business_card_collect'... |
<gh_stars>0
CREATE VIEW [dbo].[SharedIdentifierSourceSystem]
AS
SELECT parent.[SourceSystemId],
parent.[EntityTypeId],
child.[SourceSystemId] AS [SharedIdentifierSourceSystemId]
FROM [dbo].[SharedSourceSystemIdentifier] parent,
[dbo].[SharedSourceSystemIdentifier] child
WHERE parent.[EntityTypeId] = child.[En... |
<reponame>lbouma/Cyclopath
/* Copyright (c) 2006-2012 Regents of the University of Minnesota.
For licensing terms, see the file LICENSE. */
/* This script creates the Watch Region tables. */
BEGIN TRANSACTION;
SET CONSTRAINTS ALL DEFERRED;
/** Watch Region tables **/
CREATE TABLE watch_region_type (
code INT P... |
<reponame>elzes/cucumber-reports<filename>db/DBReporter/cukes.sql<gh_stars>10-100
CREATE SCHEMA [cukes]
|
<gh_stars>0
EXPLAIN (FORMAT YAML) SELECT * FROM foo WHERE i='4';
QUERY PLAN
-------------------------------
- Plan: +
Node Type: "Index Scan" +
Scan Direction: "Forward"+
Index Name: "fi" +
Relation Name: "foo" +
Alias: "foo" +
Start... |
create table setting_color(
id int not null AUTO_INCREMENT,
color_name varchar(255),
color_code varchar(255),
primary key (id)
);
create table setting_size(
id int not null AUTO_INCREMENT,
size_name varchar(255),
size_cde varchar(255),
primary key (id)
);
create table vendor(
id int not null AUTO_INCREMENT,
... |
<reponame>eyrdworkspace/digit-bpa
INSERT INTO eg_roleaction (actionid, roleid)
SELECT (select id from eg_action where name='GetAllBankName'), (select id from eg_role where name ='Collection Operator')
WHERE
NOT EXISTS (select actionid,roleid from eg_roleaction where actionid in (select id from eg_action where ... |
<reponame>TulevaEE/onboarding-service
ALTER TABLE index_values
ALTER COLUMN value TYPE NUMERIC(12, 5);
|
-- https://www.codewars.com/kata/5e5f09dc0a17be0023920f6f/train/sql
SELECT capital FROM countries WHERE continent IN('Africa', 'Afrika') AND country LIKE('E%')
ORDER BY capital ASC
LIMIT(3)
|
<reponame>jovanpop-msft/srb<filename>src/demo1.sql
--ALTER AUTHORIZATION ON DATABASE::<database name> TO [sa];
exec srb.create_service 'Sender';
exec srb.create_service 'Receiver';
exec srb.view_messages 'Sender';
exec srb.view_messages 'Receiver';
exec srb.send_message 'Sender', 'Receiver', 'Hello, this is my first... |
SELECT LOWER(Machines.Address) as MachineAddress, SshKeys.LastModifyDate,
COUNT(DISTINCT Machines.Address) as NumMachines,
MAX(Cast ((JulianDay(datetime('{scanDateTime}')) - JulianDay(SshKeys.LastModifyDate)) As Integer)) as MaxKeyAge
FROM Accounts
LEFT OUTER JOIN OSAccounts
ON Accounts.Id = OSAccounts.AccountBase... |
--==============================================================================
-- GPI - <NAME>
-- Desc: grants to an object in the database
--==============================================================================
--desc DBA_ROLE_PRIVS
--desc DBA_SYS_PRIVS
--desc DBA_TAB_PRIVS
--===============================... |
# --- !Ups
CREATE TABLE zookeepers (
name VARCHAR(10),
host VARCHAR(10),
port INT,
statusId LONG,
groupId LONG,
PRIMARY KEY (name)
);
CREATE TABLE `groups` (
`id` INT NOT NULL,
`name` VARCHAR(45) NULL,
PRIMARY KEY (`id`));
CREATE TABLE `status` (
`id` INT NOT NULL,
`name` VARCHAR(45) NOT ... |
DROP TABLE IF EXISTS `booking`;
CREATE TABLE IF NOT EXISTS `booking` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`bind` char(50) DEFAULT NULL,
`entry` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`author` char(50) DEFAULT 'APP',
`status` char(50) DEFAULT 'PENDING',
`suite` char(100) DEFAULT NULL,
`refid` char(... |
CREATE DATABASE IF NOT EXISTS COWE
DEFAULT CHARACTER SET utf8
DEFAULT COLLATE utf8_general_ci;
GRANT ALL PRIVILEGES ON COWE.* TO test@localhost IDENTIFIED BY 'test*';
USE COWE;
CREATE TABLE IF NOT EXISTS GET_USER (
ID_USER INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
FIRST_NAME VARCHAR(30),
LAST_NA... |
-- // CB-15814 Add option
-- Migration SQL that makes the change goes here.
ALTER TABLE environment_network ADD IF NOT EXISTS loadbalancercreation varchar(255) DEFAULT 'ENABLED' NOT NULL;
-- //@UNDO
-- SQL to undo the change goes here.
ALTER TABLE environment_network DROP COLUMN IF EXISTS loadbalancercreation;
|
/* An entry for every member in a domain. */
CREATE TABLE domainMembers (
/* Id of the domain. FK into domains. */
domainId BIGINT NOT NULL,
/* Id of the user member. FK into users. */
userId VARCHAR(32) NOT NULL,
/* Date this user was added. */
createdAt DATETIME NOT NULL,
/* User's role in this domain. */
... |
INSERT INTO residence.address
VALUES (?, ?, ?, ?, ?, ?); |
SELECT * FROM ITEM_CHOICES
WHERE DELETE_FLAG = 0
ORDER BY INSERT_DATETIME %s;
|
<filename>queries/mysql/ddl/nitro/nation.sql<gh_stars>1-10
CREATE TABLE nation (
n_nationkey INTEGER comment "<nitro>KEYSPN=256,NODES=4096</nitro>",
n_name CHAR(25),
n_regionkey INTEGER comment "<nitro>KEYSPN=256,NODES=4096</nitro>",
n_comment VARCHAR(152),
PRIMARY KEY (n_nationkey),
index i_n_regionkey (n_regio... |
# seller_bango is many-to-one and should not be unique.
ALTER TABLE seller_product_bango DROP FOREIGN KEY seller_bango_id_refs_id_bango;
ALTER TABLE seller_product_bango DROP INDEX seller_bango_id;
ALTER TABLE `seller_product_bango` ADD CONSTRAINT `seller_bango_id_refs_id_bango`
FOREIGN KEY (`seller_bango_id`) REFE... |
CREATE TABLE IF NOT EXISTS `cot_stats` (
`stat_name` varchar(32) collate utf8_unicode_ci NOT NULL default '',
`stat_value` int NOT NULL default '0',
PRIMARY KEY (`stat_name`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT IGNORE INTO `cot_stats` (`stat_name`, `stat_value`) VALUES
('total... |
<gh_stars>0
DROP DATABASE IF EXISTS employee_DB;
CREATE DATABASE employee_DB;
USE employee_DB;
CREATE TABLE department (
dId INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
dept_name VARCHAR(30)
);
CREATE TABLE roles (
rId INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(30),
salary DECIM... |
-- Test datas for Nodes label
-- ----------------------------------------------------------------------------
INSERT INTO "Nodes" ("id", "parent_id", "label") VALUES
(0, 0, 'Node0'),
(1, 0, 'Node1'),
(2, 0, 'Node2'),
(3, 2, 'Node3'),
(4, 3, 'Node4'),
(5, 3, 'Node5'),
(6, 2, 'Node6'),
(7, 0, 'Node7'),
(8, 7, 'Node8')... |
<reponame>memoriaal/eMem
DELIMITER ;;
CREATE OR REPLACE TRIGGER kirjesildid_AU AFTER UPDATE ON kirjesildid FOR EACH ROW
BEGIN
-- IF NEW.silt IS NOT NULL
-- THEN
-- INSERT IGNORE INTO z_queue (isikukood1, task, params, user)
-- VALUES (NEW.kirjekood, 'Update silt', NEW.silt, NEW.user);
-- END IF;
END;;
... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 28, 2019 at 09:56 PM
-- Server version: 4.8.4
-- PHP Version: 7.3.1
SET
SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET
time_zone = "+06:00";
--
-- Database: `bd_geocode`
--
-- ----------------... |
<reponame>nemmtor/engineering-thesis-api
-- DropIndex
DROP INDEX "sale_item_id_key";
-- AlterTable
ALTER TABLE "customer" ALTER COLUMN "email" DROP NOT NULL;
|
<gh_stars>0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- 数据库: ... |
#SELECT DATE_FORMAT(p.payday, '%d/%m/%Y'),p.number_of_transfer,c.system_cod_description,FORMAT(p.total_payment,2,'en_US')
#FROM payments p, system_codes c
#WHERE ( p.type_payment =c.idsystem_codes )
#AND( CAST(number_of_transfer AS INTEGER) >= :parm1
#AND CAST(number_of_transfer AS INTEGER) <= :parm2 )
#AND ( P.type... |
CREATE TABLE [dbo].[contact_address] (
[contadd_id] INT IDENTITY (1, 1) NOT NULL,
[contact_id] INT NOT NULL,
[address_id] INT NOT NULL,
[mailing] BIT CONSTRAINT [DF_Contact_Address_mailing] DEFAULT ((0)) NOT NULL,
[billing] BIT CONST... |
DROP DATABASE IF EXISTS burgers_db;
CREATE DATABASE burgers_db;
USE burgers_db;
CREATE TABLE burgers(
id INT NOT NULL AUTO_INCREMENT,
burger_name VARCHAR(100) NOT NULL,
devoured BOOLEAN DEFAULT false,
PRIMARY KEY (id)
); |
-- *************************************************************
-- This script creates a table in the ml_data database for the
-- AutoMPG dataset.
-- *************************************************************
-- Select the ml_data database
use ml_data;
-- Delete AutoMPG table if it already exists
DROP TABLE IF EX... |
-- file:regproc.sql ln:20 expect:true
SELECT to_regproc('now')
|
select u.id, i.id from users u inner join orders o on u.id = o.userid inner join items i on o.itemid = i.id group by o.userid
GROUP_CONCAT(o.id SEPARATOR ',') WITHIN GROUP (ORDER BY o.id ASC)
select o.userid o.itemid from orders o inner join items i on i.id = o.itemid group by o.userid having(count(o.itemid) > 0) ... |
USE [rebus_test]
GO
CREATE TABLE [dbo].[sagas](
[id] [uniqueidentifier] NOT NULL,
[revision] [int] NOT NULL,
[data] [nvarchar](max) NOT NULL,
CONSTRAINT [PK_sagas] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCK... |
<filename>graph_algorithms/sql/v4/neighbour_count.sql
CREATE OR REPLACE FUNCTION public.out_neighbour_count(
IN k_hop INTEGER,
IN result_table_name VARCHAR
) RETURNS INTEGER AS $$
DECLARE
num2update INTEGER;
current_hop INTEGER := 1;
BEGIN
CREATE TEMP TABLE out_neighbour_count_t with (appendoptimiz... |
<reponame>parbatpk/parbat
-- =============================================
-- Create basic stored procedure template
-- =============================================
-- Drop stored procedure if it already exists
IF EXISTS (
SELECT *
FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'dbo'
AND SP... |
<gh_stars>10-100
CREATE FUNCTION func831() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE365);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE175);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE305);val:=(SELECT C... |
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
CREATE EXTENSION IF NOT EXISTS "pgcrypto";
--
-- Legacy mocks imported from mongodb database
--
CREATE TABLE mocks_v2
(
id character varying NOT NULL,
content bytea,
status integer NOT NULL,
charset character varying NOT NULL,
content_type character var... |
-- This script lists all the cities of California that can be
-- found in the database hbtn_0d_usa.
SELECT id, name FROM cities WHERE state_id = 1;
|
<reponame>swordboy/neutron-portforward-service
use neutron;
DROP TABLE IF EXISTS `neutron`.`portforwards`;
CREATE TABLE `neutron`.`portforwards` (
`id` varchar(36) NOT NULL,
`name` varchar(100) DEFAULT NULL,
`router_id` varchar(36) DEFAULT NULL,
`router_gateway_ip` varchar(100) DEFAULT NULL,
`instance_id` var... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
alter table ZSTG_PID_INTERACTANTS disable constraint SYS_C0020975;
alter table ZSTG_PID_INTERACTANTS disable constraint SYS_C0020976;
alter table ZSTG_PID_INTERAC... |
<filename>software/cabio-database/scripts/sql_loader/no_longer_used/histopathology/context.sql
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
INSERT INTO context(CONTEXT_CODE, histology_code, tissue_code) VALUES(3001,9... |
<reponame>Zhaojia2019/cubrid-testcases
--TEST: delete from 2 tables with int type column for join condition
create table md_int1(id1 int primary key, col1 char(20));
insert into md_int1 values(1, 'aaa'), (2, 'bbb'), (3, 'ccc'), (4, 'ddd'), (5, 'eee'), (6, 'fff');
insert into md_int1 values(7, 'ggg'), (8, 'hhh'), (9,... |
<gh_stars>0
CREATE TABLE [dbo].[MembriiEchipei] (
[Id] INT NOT NULL,
[EchipaId] INT NOT NULL,
[PersoanaId] INT NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.