sql stringlengths 6 1.05M |
|---|
<gh_stars>1-10
-- Create a view
CREATE VIEW SalesLT.vCustomerAddress
AS
SELECT C.CustomerID, FirstName, LastName, AddressLine1, City, StateProvince
FROM
SalesLT.Customer C JOIN SalesLT.CustomerAddress CA
ON C.CustomerID=CA.CustomerID
JOIN SalesLT.Address A
ON CA.AddressID=A.AddressID
-- Query the view
SELECT Customer... |
alter table "public"."assets" drop constraint "assets_parentId_fkey",
add constraint "assets_parentId_fkey"
foreign key ("parentId")
references "public"."assets"
("id") on update no action on delete cascade;
|
SELECT
INFORMATION_SCHEMA.COLUMNS.TABLE_NAME,
INFORMATION_SCHEMA.COLUMNS.ORDINAL_POSITION,
INFORMATION_SCHEMA.COLUMNS.COLUMN_NAME,
INFORMATION_SCHEMA.COLUMNS.DATA_TYPE,
INFORMATION_SCHEMA.COLUMNS.CHARACTER_MAXIMUM_LENGTH,
INFORMATION_SCHEMA.COLUMNS.NUMERIC_PRECISION,
INFORMATION_SCHEM... |
<filename>SQL/MicrosoftSqlServer/update-table-1.sql
IF EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'icUrlTracker') AND NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'icUrlTracker' AND COLUMN_NAME = 'ForceRedirect')
BEGIN
ALTER TABLE [icUrlTracker] ADD ForceRedirect ... |
<reponame>Zyres/AE_OneDB
/*
SQLyog Professional v13.1.7 (64 bit)
MySQL - 8.0.21 : Database - asc_world_new
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/... |
ALTER TABLE `users` CHANGE `iNotify` `sNotify` ENUM( 'Never', 'Answers', 'Concerned' ) NOT NULL DEFAULT 'Answers';
ALTER TABLE `history_users` CHANGE `iNotify` `sNotify` ENUM( 'Never', 'Answers', 'Concerned' ) NOT NULL DEFAULT 'Answers';
|
INSERT INTO memo (id, title, description, done, updated) VALUES
(1, 'memo shopping', 'memo1 description', false, '2018-01-04 12:01:00'),
(2, 'memo job', 'memo2 description', false, '2018-01-04 13:02:10'),
(3, 'memo private', 'memo3 description', false, '2018-01-04 14:03:21'),
(4, 'memo job', 'memo4 description'... |
-- file:domain.sql ln:185 expect:true
insert into nulltest values ('a', 'b', 'c', 'd', 'a')
|
-- Adminer 4.8.1 MySQL 5.5.5-10.5.11-MariaDB dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
SET NAMES utf8mb4;
INSERT IGNORE INTO `tier` (`id`, `priority`, `concurrency`, `quota`, `notes`, `patreon_id`) VALUES
(0, 0, 1, 1000, 'public', 0),
(1, 2, 1,... |
<reponame>bduggan/gcis
alter table file alter column image drop not null;
create table publication_file_map (
publication integer references publication(id),
file integer references file(identifier),
primary key (publication,file)
);
|
USE Orders
--Problem-18
SELECT ProductName, OrderDate, DATEADD(DAY, 3, OrderDate) AS [Pay Due], DATEADD(MONTH, 1, OrderDate) AS [Delivery Due]
FROM Orders
--Problem-19
CREATE TABLE People
(
Id INT PRIMARY KEY IDENTITY,
[Name] NVARCHAR(50) NOT NULL,
Birthdate SMALLDATETIME NOT NULL
)
INSERT INTO People([Name], Bi... |
<filename>test.sql
Select * From TABLE1 t Where a > 100 AND b between 12 AND 45; |
<NAME>
Reposnsable: Carmen
|
DROP TABLE IF EXISTS `pre__lfriendlink_cate`;
CREATE TABLE `pre__lfriendlink_cate` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '分类ID',
`name` varchar(100) NOT NULL DEFAULT '' COMMENT '分类标识',
`title` varchar(200) NOT NULL DEFAULT '' COMMENT '分类名称',
`description` char(100) DEFAULT '' COMMENT '分类描述',
... |
-- phpMyAdmin SQL Dump
-- version 4.4.15.5
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: May 10, 2017 at 08:37 PM
-- Server version: 5.5.49-log
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_... |
<gh_stars>0
-- first create a VIEW on information_schema.columns, so we can select which tables are journalled.
CREATE OR REPLACE VIEW journal_columns AS
SELECT * FROM information_schema.COLUMNS
WHERE (TABLE_SCHEMA = 'program' AND TABLE_NAME IN ('program','agent'))
-- OR (TABLE_SCHEMA = 'claim' AND TABLE_NAME IN ('in... |
<filename>sql/show_user_privs.sql
set pagesize 0
select
lpad(' ', 2*level) || granted_role "User, his roles and privileges"
from
(
/* THE USERS */
select
null grantee,
username granted_role
from
dba_users
where
username like upper('%&enter_username%')
/* THE ROLES TO R... |
INSERT [dbo].[Localization_Culture] ([Id], [Name], IsDefault) VALUES ('tr-TR', N'Turkish', 0)
GO
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Register', N'Kayıt olmak')
INSERT [dbo].[Localization_Resource] ([CultureId], [Key], [Value]) VALUES ('tr-TR', N'Hello {0}!', N'Merhaba... |
<filename>sql/ddl_internal.sql
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
--documentation of these function located in chunk_index.h
CREATE OR REPLACE FUNCTION _timescaledb_interna... |
<reponame>folio-org/mod-marccat
Insert into AMICUS.IDX_LIST (IDX_LIST_KEY_NBR,IDX_LIST_TYP_CDE,CHUI_ORDR_SEQ_NBR,CHUI_SCN_ORDR_SEQ_NBR,ATRBT_CMPNS_NBR,ATRBT_TRNTN_NBR,ATRBT_STRCT_NBR,ATRBT_PSTN_NBR,ATRBT_RLTN_NBR,ATRBT_USE_NBR,IDX_LIST_ABRVT_FR_CDE,IDX_LIST_ABRVT_CDE,IDX_SRT_MAIN_TYP_CDE,IDX_SRT_FORM_SUB_TYP_CDE,IDX_SR... |
alter table "public"."persons_units"
add constraint "persons_units_person_id_fkey"
foreign key ("person_id")
references "public"."persons"
("id") on update no action on delete no action;
|
<reponame>mapofzones/database-hasura<filename>hasura/migrations/1613137073198_alter_table_public_zones_stats_add_column_ibc_tx_failed_diff/down.sql
ALTER TABLE "public"."zones_stats" DROP COLUMN "ibc_tx_failed_diff";
|
<reponame>goldmansachs/obevo-kata<filename>kata-files/lesson2/hsql/expected/MYLARGESCHEMA/sp/SP45.sql
CREATE PROCEDURE SP45(OUT MYCOUNT INTEGER) SPECIFIC SP45_75897 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE107;SELECT COUNT(*)I... |
<reponame>sibasish-palo/emodb
USE ${keyspace};
-- Use LZ4Compressor for maximum read performance.
-- Wish we could lower gc_grace_seconds to 5 minutes to reduce tombstones to improve read performance.
-- See proof at com.bazaarvoice.emodb.sor.core.CompactorTest.testTombstonesDoNotMatter for more details.
-- For now, w... |
<reponame>amishakov/livehelperchat<gh_stars>1000+
ALTER TABLE `lh_abstract_subject` ADD `internal` tinyint(1) NOT NULL DEFAULT '0', COMMENT='';
ALTER TABLE `lh_abstract_subject` ADD `internal_type` varchar(20) NOT NULL, COMMENT='';
ALTER TABLE `lh_abstract_subject` ADD INDEX `internal` (`internal`);
ALTER TABLE `lh_abs... |
ALTER TABLE `sys_user` ADD `last_login_ip` VARCHAR(50) NULL AFTER `lost_password_reqtime`;
ALTER TABLE `sys_user` ADD `last_login_at` BIGINT(20) NULL AFTER `last_login_ip`;
-- DNS-Status (2 lines)
ALTER TABLE `dns_soa` ADD COLUMN `status` enum('OK','ERROR','PENDING') NOT NULL DEFAULT 'OK' AFTER `active`;
ALTER TABLE `d... |
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
ALTER TABLE `TracK`
ADD CO... |
<gh_stars>10-100
-- This file tests patterns that are more complex or differ from
-- the SQL tested in the basic-template.sql file
-- Required preprocessor macros (with example values):
-- {@insertvals = "_id, _value[decimal], _value[decimal], _value[float]"}
-- {@aftermath = " _math _value[int:1,3]"}
-- {@agg = "_num... |
<reponame>opengauss-mirror/Yat
-- @testpoint:创建函数,参数模式放在参数名前面,函数创建成功
drop FUNCTION if exists func_add_sqlf;
CREATE FUNCTION func_add_sqlf(INOUT integer, IN integer) RETURNS integer
AS 'select $1 + $2;'
LANGUAGE sql
RETURNS NULL ON NULL INPUT;
/
call func_add_sqlf(999,1);
drop FUNCTION func_add_... |
<filename>dump_apiproject.sql
-- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 10.4.13-MariaDB - mariadb.org binary distribution
-- OS do Servidor: Win64
-- HeidiSQL Versão: 11.0.0.5919
-- -----------------... |
<reponame>bachhumanna/dmd<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 11, 2019 at 06:06 PM
-- Server version: 5.7.26-0ubuntu0.16.04.1
-- PHP Version: 7.2.19-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_Z... |
<filename>db/schema.sql
DROP DATABASE IF EXISTS safechat;
CREATE DATABASE safechat;
USE safechat;
CREATE TABLE messages(
id INT AUTO_INCREMENT NOT NULL,
username VARCHAR(30) NOT NULL,
message VARCHAR(500) NOT NULL,
PRIMARY KEY(id)
);
INSERT INTO messages(username,message) VALUES("chatbot", "Welcome to SafeCha... |
<reponame>Noman5237/BentBase
create user developer identified by developer;
grant all privileges to developer; |
<reponame>crazcalm/job_search_lib
BEGIN TRANSACTION;
DROP TABLE IF EXISTS "companies";
CREATE TABLE IF NOT EXISTS "companies" (
"id" INTEGER PRIMARY KEY AUTOINCREMENT,
"name" TEXT NOT NULL UNIQUE,
"address" TEXT,
"website" TEXT,
"phone" TEXT,
"created_date" TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
"last_updated"... |
<reponame>taiprogramer/learn-oracle-sql<gh_stars>0
/* Relax with simple quotes */
/* "Do everything that makes sense." - taiprogramer */
/* "Good designer helps to prevent people from doing stupid things.
People make mistakes, computer don't." - taiprogramer */
/* .begin table gioi_tinh */
/* Create sequence for a... |
<reponame>smitmartijn/slack-2-gmail
--
-- DATABASES EXTENSIONS
--
CREATE EXTENSION pgcrypto;
CREATE EXTENSION hstore;
--
-- updated_at columd update
--
CREATE OR REPLACE FUNCTION updated_at_column()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ language 'plpgsql';
--
-- ... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 07, 2020 at 08:32 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
IF NOT EXISTS(SELECT [column_id] FROM sys.columns WHERE [name] = 'TransactionTypesFlag' AND [object_id] = OBJECT_ID('DataLock.PriceEpisodePeriodMatch'))
BEGIN
ALTER TABLE [DataLock].[PriceEpisodePeriodMatch]
ADD [TransactionTypesFlag] int NULL
END
GO
|
<filename>ci3.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 19, 2021 at 06:10 PM
-- Server version: 10.3.25-MariaDB-0+deb10u1
-- PHP Version: 7.3.19-1~deb10u1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
... |
-- Deploy schemas/uuids/procedures/trigger_set_uuid_seed to pg
-- requires: schemas/uuids/schema
-- requires: schemas/uuids/procedures/pseudo_order_seed_uuid
BEGIN;
-- https://dba.stackexchange.com/questions/61271/how-to-access-new-or-old-field-given-only-the-fields-name
-- https://dba.stackexchange.com/questions/82... |
ALTER TABLE `best`
ADD COLUMN `type` ENUM('image', 'video', 'lien', 'autre') NULL DEFAULT 'image' AFTER `id_utilisateur_fk`;
ALTER TABLE `best`
CHANGE COLUMN `type` `type` ENUM('photo', 'image', 'video', 'lien', 'autre') NULL DEFAULT 'photo' ;
update best
set type='photo'
where type = 'image' and id_best < 99... |
<reponame>davidanthonyn/sharedgame<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 10, 2022 at 08:44 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+... |
<reponame>hubmapconsortium/uuid-api
-- MySQL dump 10.14 Distrib 5.5.60-MariaDB, for Linux (x86_64)
--
-- Host: hubmap-db.cluster-cylxi65xrqts.us-east-1.rds.amazonaws.com Database: hm_uuid
-- ------------------------------------------------------
-- Server version 5.6.10
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... |
<gh_stars>0
/*
Author: <NAME>
Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA.
*/
SELECT *
FROM CITY
WHERE POPULATION > 100000 AND COUNTRYCODE = "USA"
/*
3878 Scottsdale USA Arizona 202705
3965 Corona USA California 1249... |
-- +goose Up
CREATE TABLE user_message (
id int NOT NULL AUTO_INCREMENT PRIMARY KEY,
dialog_id int NOT NULL,
sender_user_id int NOT NULL,
receiver_user_id int NOT NULL,
sent_at date NOT NULL,
body text NOT NULL,
is_read tinyint NOT NULL
);
-- +goose Down
DROP TABLE user_message;
|
<reponame>jdkoren/sqlite-parser<gh_stars>100-1000
-- randexpr1.test
--
-- db eval {SELECT d+coalesce((select max(coalesce((select f from t1 where coalesce((select 17 & t1.b from t1 where 11 not in ((t1.e),+a-f,t1.c & b+17*t1.e-c)), -c) in (select -count(distinct e)-+max(t1.b) from t1 union select count(distinct c)+ca... |
<filename>modules/boonex/files/updates/9.0.0_9.0.1/install/sql/install.sql<gh_stars>100-1000
-- FORMS
UPDATE `sys_form_inputs` SET `editable`='1' WHERE `object` IN ('bx_files', 'bx_files_upload') AND `name`='allow_view_to';
-- COMMENTS
UPDATE `sys_objects_cmts` SET `Module`='bx_files' WHERE `Name`='bx_files'; |
<filename>src/Cofoundry.Domain/Install/Db/Triggers/Cofoundry.DocumentAsset_CascadeDelete.sql
create trigger Cofoundry.DocumentAsset_CascadeDelete
on Cofoundry.DocumentAsset
instead of delete
AS
begin
set nocount on;
if not exists (select * from deleted) return
-- Dependencies
delete Cofoundry.DocumentA... |
BEGIN;
CREATE TYPE setting AS (
setting_key text,
value text
);
CREATE OR REPLACE FUNCTION setting_get(in_setting_key text)
returns setting language sql as
$$
SELECT $1, '0.1.1'::text;
$$;
COMMIT;
|
/*
# FinSim
# Copyright 2018 <NAME>. All Rights Reserved.
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT NOT LIMITED T... |
--Total number of providers
SELECT count(distinct provider_id) as Total_number_of_providers FROM CDMPv1.dbo.PROVIDER |
<filename>dbt/include/athena/macros/materializations/models/table/create_table_as.sql<gh_stars>0
{% macro athena__create_table_as(temporary, relation, sql) -%}
{%- set s3_data_dir = adapter.s3_table_location(relation.schema, relation.identifier) -%}
{%- set partitioned_by = config.get('partitioned_by', default=none... |
create table human (
userid bigint generated by default as identity (start with 1) not null,
first_name varchar(255),
last_name varchar(255),
gender varchar(255),
age integer not null,
constraint ... |
DROP TABLE IF EXISTS task;
DROP TABLE IF EXISTS devicelist;
CREATE TABLE IF NOT EXISTS task(
task_name TEXT NOT NULL,
ipaddr TEXT NOT NULL,
serial TEXT NOT NULL,
iftype TEXT NOT NULL,
switchname TEXT NOT NULL,
port TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS devicelist(
ipaddr TEXT NOT NUL... |
select SPACEID,PERMTYPE,PERMUSERNAME FROM SPACEPERMISSIONS WHERE PERMUSERNAME IS NOT NULL GROUP BY SPACEID,PERMTYPE,PERMUSERNAME ORDER BY SPACEID DESC
select user_key,username from user_mapping where user_key IN (select PERMUSERNAME from SPACEPERMISSIONS WHERE PERMUSERNAME IS NOT NULL)ORDER BY user_key ASC |
-- database: presto; groups: stats, tpcds; tables: lineitem
-- delimiter: |; ignoreOrder: true; types: VARCHAR|DOUBLE|DOUBLE|DOUBLE|DOUBLE|VARCHAR|VARCHAR
--! name: show stats for lineitem
SHOW STATS FOR lineitem
--!
l_orderkey|null|1500000.00000000000|0.00000000000|null|1|6000000|
l_partkey|null|200000.00000000000|0.0... |
<filename>delivery-wecube-for-stand-alone/application-for-alicloud/wecube/database/auth-server/01.auth.schema.sql
/*
Navicat MariaDB Data Transfer
Source Server : smoke1
Source Server Version : 100109
Source Host : tdsql-66a3mko1.sql.tencentcdb.com:75
Source Database : smoke2_auth_server
Targe... |
<reponame>Adron/terrazura<gh_stars>10-100
create table region1.region1sales
(
identifier varchar(16) not null,
sale money not null,
dtmark datetime default SYSUTCDATETIME() not null,
shipped bit default 0 not null,
city nvarchar(100)
)
|
<reponame>Zhaojia2019/cubrid-testcases
--Alter table to drop columns of enum type;
--+ holdcas on;
drop table if exists t1;
create table t1(e1 enum('a', 'b') collate utf8_en_cs, i int, e2 enum('Yes', 'No', 'Cancel') collate utf8_en_ci, e3 enum('Luni', 'Marti', 'Miercuri', 'Joi', 'Vineri', 'Sambata', 'Duminica') coll... |
SELECT * FROM city
WHERE ID = 1661; |
-- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Creato il: Set 05, 2016 alle 20:43
-- Versione del server: 5.5.42
-- Versione PHP: 7.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
<reponame>MHSComputerScienceClub/FBLA_MobileApp_2016<filename>Backend/dbscripts/initall.sql
#Init all
SOURCE initdatabase.sql;
SOURCE initusers.sql;
SOURCE inittables.sql;
|
<gh_stars>0
select nome
from Animais
inner join Exames on Animais.COD_AN = Exames.COD_AN
group by nome
having sum(custo) == (
select max(soma_custos)
from (
select sum(custo) soma_custos
from Exames
inner join Animais on Exames.COD_AN = Animais.COD... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS "User" (
"id" SERIAL PRIMARY KEY NOT NULL,
"email" varchar NOT NULL,
"password" varchar NOT NULL,
"active" bool NOT NULL DEFAULT true,
"bad_attempts" INT NOT NULL DEFAULT 0,
"created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()
);
CREATE TABLE IF NO... |
<reponame>amalanuradha-cmd/test<filename>Dump20200809.sql
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: localhost Database: atlas
-- ------------------------------------------------------
-- Server version 8.0.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @O... |
/*
* This is a mysql script to create necessary tables.
*/
-- Create WOWCharacter table
CREATE TABLE IF NOT EXISTS `wowcharacter` (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(100),
realm VARCHAR(100),
class VARCHAR(100),
);
-- Create Item table
CREATE TABLE IF... |
/*
SQLyog Ultimate v8.5
MySQL - 5.6.16 : Database - deftsoft
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS... |
<filename>res/~database/IssueWeightTable.sql
CREATE TABLE IF NOT EXISTS `issue_weights` (
`scale` ENUM ('tiny', 'small', 'medium', 'large', 'massive') NOT NULL,
`contribution` TINYINT NOT NULL,
PRIMARY KEY (`scale`)
) ENGINE = InnoDB
DEFAULT CHARSET = utf8mb4
COLLATE utf8mb4_general_ci
|
<filename>Positive_Sentiment_Summary.sql
Select Scored_Tweets.Candidate,
Format(dbo.Significant_Digits(Followers*[% Active Tweeters]/100*[% NonZero Tweets]/100*[Tweets Per Scored Tweeter]*[% Very Positive Tweets]/100,1),'N0') As [Total Very Positivity],
Format(Followers,'N0') As Followers,
dbo.Significant_Digits_Str... |
<reponame>psrc/psrc<filename>vendor/rails/activerecord/test/fixtures/db_definitions/openbase2.sql
CREATE TABLE courses (
id integer UNIQUE INDEX DEFAULT _rowid,
name text
)
go
CREATE PRIMARY KEY courses (id)
go |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 24, 2020 at 03:36 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<filename>db/schema.sql
DROP DATABASE IF EXISTS your_space_db;
CREATE DATABASE your_space_db; |
<filename>database/seeders/sepomex/nuevo_leon.sql
insert into aptoclickv2.catalogo_sepomex (colonia, municipio, estado, cp) values ('Monterrey Centro','Monterrey','Nuevo León','64000');
insert into aptoclickv2.catalogo_sepomex (colonia, municipio, estado, cp) values ('La Finca','Monterrey','Nuevo León','64000');
insert... |
USE [test_normalization];
execute('create view _airbyte_test_normalization."nested_stream_with_co__ion_double_array_data_ab3__dbt_tmp" as
-- SQL model to build a hash column based on the values of this record
select
convert(varchar(32), HashBytes(''md5'', coalesce(cast(
concat(concat(coales... |
<reponame>IASA-GR/appdb-core
/*
Copyright (C) 2015 IASA - Institute of Accelerating Systems and Applications (http://www.iasa.gr)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.ap... |
# Host: 172.16.58.3 (Version: 5.5.40-log)
# Date: 2018-09-03 10:23:44
# Generator: MySQL-Front 5.3 (Build 4.234)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "onethink_action"
#
DROP TABLE IF EXISTS `onethink_action`;
CREATE TABLE `onethink_action` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT ... |
<filename>environment/mysql/OC70/create_db.sql
-- OwnCloud 7.0.0 database setup
-- MySQL dump 10.13 Distrib 5.5.38, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: oc_testing
-- ------------------------------------------------------
-- Server version 5.5.38-0ubuntu0.12.04.1-log
/*!40101 SET @OLD_CHAR... |
<filename>jun/chapter_008/src/main/java/ru/job4j/sql/join/select.sql
-- Вывести все машины
SELECT c.name AS name, b.name AS body, e.name AS engine, t.name AS transmission
FROM car AS c INNER JOIN car_body AS b ON c.body_id = b.id
INNER JOIN engine AS e ON c.engine_id = e.id
INNER JOIN transmission AS t ON c.transmissio... |
create function TableValuedFunctionWithUnusedTableVariable()
returns @X table ( a int )
as
begin
declare @A table (a int) --- @A is unused. This should be flagged as a problem
insert into @x values(1)
return
end |
DROP INDEX IF EXISTS build_resource_config_version_inputs_version_md5_idx;
DROP INDEX build_resource_config_version_inputs_resource_id_idx;
DROP INDEX build_resource_config_version_inputs_build_id_idx;
CREATE INDEX build_inputs_resource_versions_idx ON build_resource_config_version_inputs (resource_id, version_md5);
... |
<gh_stars>0
USE taskforce
CREATE TABLE specializations (
PRIMARY KEY (id),
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR (50) NOT NULL,
created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
... |
<gh_stars>1-10
INSERT INTO `mq_ecms_school` (`id`, `classid`, `ttid`, `onclick`, `plnum`, `totaldown`, `newspath`, `filename`, `userid`, `username`, `firsttitle`, `isgood`, `ispic`, `istop`, `isqf`, `ismember`, `isurl`, `truetime`, `lastdotime`, `havehtml`, `groupid`, `userfen`, `titlefont`, `titleurl`, `stb`, `fstb`, ... |
DROP TABLE IF EXISTS transactions;
DROP TABLE IF EXISTS transfers;
DROP TABLE IF EXISTS accounts;
|
<reponame>DFE-Digital/login.dfe.organisations
IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'user_organisation' AND COLUMN_NAME = 'status')
BEGIN
ALTER TABLE user_organisation ADD [status] smallint DEFAULT 0 NOT NULL
EXEC('update user_organisation set [status] = 1')
... |
alter table "public"."socle_container" drop constraint "socle_container_container_id_fkey";
|
CREATE TABLE direction (
recipe_id int,
step INT,
instruction text,
primary key (recipe_id, step),
FOREIGN KEY (recipe_id) REFERENCES recipe(recipe_id)
); |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- ホスト: localhost:3306
-- 生成日時: 2020 年 3 月 19 日 10:50
-- サーバのバージョン: 5.7.26
-- PHP のバージョン: 7.2.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- データベース: `minaso`
--
-- -------------------------------------... |
<gh_stars>0
create or replace package flow_globals
as
process_id flow_processes.prcs_id%type;
subflow_id flow_subflows.sbfl_id%type;
step_key flow_subflows.sbfl_step_key%type;
function business_ref
return flow_process_variables.prov_var_vc2%type;
procedure set_context
( pi_prcs_id in flow_processes.... |
---
--- Version information storage
---
CREATE EXTENSION postgis;
CREATE TABLE iem_version(
name varchar(50) UNIQUE,
version int);
insert into iem_version values ('schema', 1); |
-- MySQL dump 10.19 Distrib 10.3.34-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: bpdb
-- ------------------------------------------------------
-- Server version 10.3.34-MariaDB-0ubuntu0.20.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... |
<filename>functions-triggers-users/functions-triggers-users.sql
-- (a) Criar um procedimento armazenado (Stored Procedure)
/* Dado o nome de determinado fornecedor, determinar a quantidade de produtos
que aquele fornecedor fornece.
*/
CREATE FUNCTION qtd_produtos_que_determinado_fornecedor_fornece(nome_forn VARCHAR(4... |
<gh_stars>0
CREATE SCHEMA waith;
USE waith;
CREATE TABLE produto(
id INT PRIMARY KEY AUTO_INCREMENT,
nome TEXT NOT NULL,
ingredientes TEXT,
valor DECIMAL(6,2),
FULLTEXT (nome)
);
CREATE TABLE numero(
id INT PRIMARY KEY AUTO_INCREMENT,
total DECIMAL(10,2)
);
CREATE TABLE pedido(
id INT PRIMAR... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 22, 2020 at 04:48 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
INSERT INTO admin.persons (PersonID, LastName, FirstName,City)
VALUES (1,"Zober","Matthias","Leipzig"); |
SELECT `model`,`price`, CONCAT(`carCode`,' - ',`manufc`) AS `Manufracture` FROM `cars`
WHERE CONCAT(`carCode`,' - ',`manufc`) = 'HND - Honda';
SELECT `model`,`price`, CONCAT(`carCode`,' - ',`manufc`) AS `Manufracture` FROM `cars`
ORDER BY 3; |
<filename>src/main/resources/update_database_0.3.0.sql
create table if not exists gameinformations (
gameinformations_id INTEGER GENERATED BY DEFAULT AS IDENTITY(START WITH 1, INCREMENT BY 1) PRIMARY KEY,
gameinformations_platformShortName varchar(255),
gameinformations_gameCode varchar(255),
gameinformations_name ... |
-- trigger1.test
--
-- db eval {
-- CREATE TABLE t16(a,b,c);
-- CREATE INDEX t16a ON t16(a);
-- CREATE INDEX t16b ON t16(b);
-- }
CREATE TABLE t16(a,b,c);
CREATE INDEX t16a ON t16(a);
CREATE INDEX t16b ON t16(b); |
-- 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_posts', '_bx_posts', 'bx_posts@modules/boonex/posts/|std-mi.png', IF(ISNULL(@iTypeOrder), 1, @iTypeOrder + 1));
S... |
-- Setup
DECLARE @DeployEmail NVARCHAR(255) = N'$(DeployEmail)';-- N'<EMAIL>';
DECLARE @ShortCompanyName NVARCHAR(255) = N'$(ShortCompanyName)';
DECLARE @ShortCompanyName2 NVARCHAR(255) = N'$(ShortCompanyName2)';
DECLARE @ShortCompanyName3 NVARCHAR(255) = N'$(ShortCompanyName3)';
DECLARE @PrimaryLanguageI... |
use datasynthesis;
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE TABLE refdata_status;
TRUNCATE TABLE refdata_timezones;
TRUNCATE TABLE refdata_usstates;
TRUNCATE TABLE refdata_organization;
TRUNCATE TABLE refdata_vendor;
TRUNCATE TABLE refdata_application;
TRUNCATE TABLE refdata_industrystd;
TRUNCATE TABLE refdata_codeset;
TRU... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.