sql stringlengths 6 1.05M |
|---|
<reponame>B2M-Software/SMG2.0<filename>sqltools.lib/migration/db/Django.sql
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Erstellungszeit: 19. Mrz 2015 um 12:59
-- Server Version: 5.6.16
-- PHP-Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00... |
drop database if exists abdevfr_theTwins;
create database abdevfr_theTwins;
use abdevfr_theTwins;
CREATE TABLE IF NOT EXISTS `userTwins` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`pseudo` varchar(30),
`password` varchar(30) NOT NULL,
CONSTRAINT PKuser PRIMARY KEY (id)
);
CREATE TABLE IF NOT EX... |
--liquibase formatted sql
--changeset llefevre:11 dbms:oracle
create table always_on (
id number generated as identity (cache 100) primary key, -- auto generated identifier
row_created_on TIMESTAMP(6) default systimestamp,
data VARCHAR2(100) not null
);
--rollback drop table always_on purge;
|
CREATE TABLE github_repositories (
gh_group TEXT,
gh_name TEXT,
PRIMARY KEY (gh_group, gh_name)
);
CREATE TABLE github_repository_tags (
gh_group TEXT,
gh_name TEXT,
tag_name TEXT,
FOREIGN KEY (gh_group, gh_name) REFERENCES github_repositories(gh_group, gh_name),
PRIMARY KEY (gh_group, gh_name, tag_nam... |
<reponame>AndresG1995/ExamenNTP<filename>BaseDeDatos/examen.sql
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 04-12-2016 a las 21:22:41
-- Versión del servidor: 5.6.24
-- Versión de PHP: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zo... |
-- Meta Model
CREATE TABLE IF NOT EXISTS meta_model (
scope_id INT NOT NULL,
measure_id INT NOT NULL,
lr_r2 NUMERIC,
gpr_cv NUMERIC,
rmse NUMERIC,
FOREIGN KEY (scope_id) REFERENCES ema_scope(scope_id) ON DELETE CASCADE,
FOREIGN KEY (measure_id) REFERENCES ema_measure ... |
INSERT INTO data_duplicate(data_duplicate_id, reference_offender_no, duplicate_offender_no, detection_date_time, method, confidence) VALUES (1, 'A1234AA', 'B4321BB', to_timestamp('2020-01-01 01:02:03', 'YYYY-MM-DD HH:MI:SS'), 'ANALYTICAL_PLATFORM', 98.76);
|
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 04, 2020 at 11:08 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- Create a table emp (eid, ename,esal,edoj)
-- Using PL/SQL Cursor display the seniority of all the employees, for eg. if the doj is after 2010
-- it will display the employee is JUNIOR, if the doj is before 2010 it will display THE EMPLOYEE
-- IS SENIOR
set serveroutput on
set verify off
declare
e_name emp.emp_... |
drop table if exists stoppbehandling; |
<gh_stars>0
CREATE TABLE [dbo].[MessageType]
(
MessageTypeID uniqueidentifier primary key,
MessageTypeName nvarchar(100) not null,
Deleted bit,
DeletedBy uniqueidentifier,
DeletedOn datetime
)
|
/*
When it comes to joining tax information about parcels, here are the considerations
that need to be made:
1. One strap account can only be associated with one parcel number
2. One strap account can only have one assessed value
3. One parcel number can have multiple strap accounts
4. One parcel can have multi... |
<reponame>Juraji/reactive-albums
create sequence hibernate_sequence start with 1 increment by 1;
create sequence domain_event_entry_sequence start with 1 increment by 1;
create table AssociationValueEntry
(
id bigint not null,
associationKey varchar(255) not null,
associationValue var... |
<gh_stars>0
CREATE TABLE url (
id CHAR(6) PRIMARY KEY,
url VARCHAR NOT NULL,
email VARCHAR(255) NOT NULL,
visit INTEGER NOT NULL DEFAULT 0,
is_del BOOLEAN NOT NULL DEFAULT FALSE,
UNIQUE(url)
);
|
<reponame>emilia98/SoftUni-CSharp-Db<filename>DB-Basics-MSSQL-Server/Exercises/10.Table Relations - Exe/Self-Referencing.sql
/* Problem 4. Self-Referencing */
USE "TableRelationsDB";
CREATE TABLE Teachers(
TeacherID INT IDENTITY(101, 1) PRIMARY KEY,
[Name] NVARCHAR(100) NOT NULL,
ManagerID INT
);
INSERT INTO Tea... |
<reponame>spanol/projeto-codelab
/*
Warnings:
- You are about to drop the column `GameId` on the `game` table. All the data in the column will be lost.
- You are about to drop the column `GenreId` on the `genre` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE `game` DROP FOREIGN... |
CREATE TABLE [dbo].[RegistrationParticipations] (
[id] INT IDENTITY (1, 1) NOT NULL,
[RegistrationId] INT NOT NULL,
[MajorCode] VARCHAR (4) NOT NULL,
[CeremonyId] INT NOT NULL,
[NumberTickets] ... |
<reponame>stashapp/stash-app
ALTER TABLE "edits"
ADD COLUMN "closed_at" timestamp;
ALTER TABLE "edits"
ALTER COLUMN "updated_at" DROP NOT NULL;
UPDATE "edits"
SET "closed_at" = "updated_at"
WHERE "updated_at" > "created_at"
AND "status" != 'PENDING';
UPDATE "edits"
SET "updated_at" = NULL;
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 15, 2019 at 03:01 PM
-- Server version: 10.3.16-MariaDB
-- 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 @O... |
-- MySQL Script generated by MySQL Workbench
-- mar 10 mar 2020 23:18:04 CET
-- Model: New Model Version: 1.0
-- 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... |
<gh_stars>1-10
ALTER TABLE feedback
ADD response_id uuid NOT NULL REFERENCES response (id); |
-- Constrained to single row, see https://stackoverflow.com/questions/3967372/sql-server-how-to-constrain-a-table-to-contain-a-single-row
CREATE TABLE [dbo].[JobProgress]
(
Lock char(1) NOT NULL DEFAULT 'X',
[AddEpa_LastSubmissionEventId] [bigint] NULL,
[IntTest_SchemaVersion] [int] NULL, -- if we support addin... |
-- auth schema
CREATE SCHEMA IF NOT EXISTS auth;
-- storage schema
CREATE SCHEMA IF NOT EXISTS storage;
-- public
-- pgcrypt & citext is required to be installed in the
-- `public` schema because of Hasura
-- https://github.com/hasura/graphql-engine/issues/3657
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA publ... |
<gh_stars>100-1000
CREATE DATABASE IF NOT EXISTS test_db; |
<filename>sql/updates/0.10/5172_mangos_mangos_string.sql
DELETE FROM `mangos_string` WHERE `entry` in (101,152,160,168,288,290,423,524,539,542);
INSERT INTO `mangos_string` VALUES
(101,'Map: %u (%s) Zone: %u (%s) Area: %u (%s)\nX: %f Y: %f Z: %f Orientation: %f\ngrid[%u,%u]cell[%u,%u] InstanceID: %u\n ZoneX: %f ZoneY: ... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 26, 2020 at 06:04 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- begin BACKMON_BACKUP_TARGET
alter table BACKMON_BACKUP_TARGET add constraint FK_BACKMON_BACKUP_TARGET_ON_BACKUP_SPHERE foreign key (BACKUP_SPHERE_ID) references BACKMON_BACKUP_SPHERE(ID)^
alter table BACKMON_BACKUP_TARGET add constraint FK_BACKMON_BACKUP_TARGET_ON_FILE_DATA_FETCHER foreign key (FILE_DATA_FETCHER_ID)... |
<reponame>VEuPathDB/service-dataset-access
INSERT INTO
studyaccess.end_user_history (
end_user_id -- 1, int64
, user_id -- 2, int64
, dataset_presenter_id -- 3, string
, restriction_level_id -- 4, int32
, approval_status_id -- 5, int32
, start_date -- 6, date
, ... |
CREATE INDEX IF NOT EXISTS REDIRECT_IDX_SRC_ID ON REDIRECT(LANG_ID, SRC_PAGE_ID);
CREATE INDEX IF NOT EXISTS REDIRECT_IDX_DEST_ID ON REDIRECT(LANG_ID, DEST_PAGE_ID)
|
/*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_MAP
DROP PRIMARY KEY CASCADE
/
DROP TABLE ZSTG_MAP CASCADE CONSTRAINTS PURGE
/
--
-- ZSTG_MAP (Table)
--
CREATE TABLE ZSTG_MAP ( MAP_ID NUMBER NOT NUL... |
USE burgers_db;
INSERT INTO burgers (burger_name) VALUES ("<NAME>");
INSERT INTO burgers (burger_name) VALUES ("Bacon Double Fish Burger");
INSERT INTO burgers (burger_name) VALUES ("To<NAME>ger");
|
CREATE TABLE projects (
id UUID PRIMARY KEY NOT NULL,
name VARCHAR NOT NULL,
archived BOOLEAN NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
)
|
<reponame>HossamAmeen/uac-animal
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Dec 29, 2019 at 02:41 PM
-- Server version: 5.6.44-cll-lve
-- PHP Version: 7.2.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time... |
<reponame>EcomDev/async-mysql-batcher
CREATE TABLE `product` (
`product_id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`sku` VARCHAR(255) NOT NULL,
`type` VARCHAR(255) NOT NULL,
`created_at` DATETIME NOT NULL,
PRIMARY KEY (`product_id`),
UNIQUE KEY `sku` (`sku`)
) ENGINE=InnoDB;
CREATE TABLE `produc... |
SELECT
CONCAT(first_name, ' ', last_name) AS name,
started_on,
COUNT(ec.client_id) AS count_of_clients
FROM employees AS e
JOIN employees_clients AS ec ON e.id = ec.employee_id
GROUP BY name
ORDER BY count_of_clients DESC, e.id ASC
LIMIT 5;
|
SELECT airport_id, airport_name, COUNT(ticket_id) AS `passengers`
FROM airports AS a
INNER JOIN flights AS f ON f.origin_airport_id = a.airport_id
INNER JOIN tickets AS t ON t.flight_id = f.flight_id
WHERE f.`status` = 'Departing'
GROUP BY airport_id, airport_name
ORDER BY airport_id ASC; |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 19, 2019 at 05:43 AM
-- Server version: 10.1.40-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<filename>src/AccountsBiller/bin/triggers.sql
CREATE TRIGGER Accounts.PreventBillingTypeItemsDuplicates
ON Accounts.BillingTypeItems
INSTEAD OF INSERT
AS
BEGIN
SET NOCOUNT ON;
IF NOT EXISTS (SELECT 1 FROM inserted AS i
INNER JOIN Accounts.BillingTypeItems AS t
ON i.BillingType = t.BillingType
AND i.... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Waktu pembuatan: 16 Feb 2022 pada 10.39
-- Versi server: 5.7.33
-- Versi PHP: 7.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... |
<filename>struktur_u4960381_silsilah2.sql<gh_stars>0
/*
Navicat Premium Data Transfer
Source Server : silisilah
Source Server Type : MySQL
Source Server Version : 100327
Source Host : 192.168.127.12:3306
Source Schema : u4960381_silsilah2
Target Server Type : MySQL
Ta... |
--EC
SELECT * FROM EC.INCOME_LOG
WHERE YEAR_INC = 2019
AND MONTH_INC > 1;
SELECT * FROM EC.EXPENSES_LOG
WHERE YEAR_EXP = 2019
AND MONTH_EXP > 1;
--CEZ
SELECT * FROM UTILITIES.CEZ
WHERE TIME_STAMP > TO_DATE('2019-01-1', 'YYYY-MM-DD');
--FINANCE
SELECT * FROM FINANCE.CC_CREDIT_CARD
WHERE "date_time" > TO_DATE('2019-05... |
<gh_stars>0
/*
https://leetcode.com/problems/shortest-distance-in-a-plane/
https://leetcode.com/submissions/detail/452414846/
Microsoft
*/
/* Write your T-SQL query statement below */
SELECT
TOP 1 ROUND(SQRT((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)), 2) shortest
FROM
(
SELECT
x, y,
... |
<filename>resources/sql/queries.sql
-- :name create-user! :! :n
-- :doc creates a new user record
INSERT INTO users
(id, first_name, last_name, email, pass)
VALUES (:id, :first_name, :last_name, :email, :pass)
-- :name update-user! :! :n
-- :doc update an existing user record
UPDATE users
SET first_name = :first_name,... |
<gh_stars>1-10
-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (x86_64)
--
-- Host: 0.0.0.0 Database: c9
-- ------------------------------------------------------
-- Server version 5.5.46-0ubuntu0.14.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RES... |
<reponame>UWIT-IAM/uw-redcap-client
-- Deploy seattleflu/schema:warehouse/sample/timestamp to pg
-- requires: warehouse/sample
begin;
alter table warehouse.sample
add column created timestamp with time zone,
add column modified timestamp with time zone;
alter table warehouse.sample
alter column created s... |
WITH vinculos_acre as ( # definindo um nome de variável vinculos_acre
SELECT id_municipio, ano, count(*) numero_de_vinculos # selecionando as colunas municipio, ano, e número de vinculos
FROM `basedosdados.br_me_rais.microdados_vinculos` # indicando a origem dos dados
WH... |
CREATE OR REPLACE FUNCTION save_car_and_person(p_first_name varchar(50),
p_last_name varchar(50),
p_car_make varchar(50),
p_car_model varchar(50))
RETURNS void AS
$$
BEGIN
-- ... |
/*
CONVENTION:
- This sproc uses the 'determine calling context' convention - i.e., it's an admindb sproc, but it can be called from other databases
and will 'use' the context of the calling database if/when called from another db.
i.e., it pseudo-behaves like an sp_sproc...
TODO:
- REFACTOR: proba... |
-- Copyright (C) 2018, Baking Bits Studios - All Rights Reserved
CREATE TABLE users (
id bigserial primary key,
is_admin bool NOT NULL default false,
is_banned bool NOT NULL default false,
username varchar(30) UNIQUE NOT NULL,
email varchar(30) UNIQUE NOT NULL,
bio varchar(200) NOT NULL default... |
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table commentaires (
comment_id number(10) not null,
comments varchar2(255),
user_id number(10),
previous_comment_id ... |
<reponame>IvoSestren/strn-ec<gh_stars>0
CREATE TABLE ordermessage (
id CHAVE NOT NULL,
date_add TIMESTAMP WITH TIME ZONE NOT NULL,
CONSTRAINT pk_ordermessage PRIMARY KEY (id)
); |
create database sample;
create table rules (
id_rule serial not null primary key,
name_rule varchar(45) not null
);
create table roles_rules (
id_role int not null,
id_rule int not null,
constraint role_rules_pkey primary key(id_role, id_rule)
);
create table roles (
id_role serial not null primary key,
name_... |
<filename>junior_001/src/main/java/ru/job4j/sql/join.sql
DROP TABLE IF EXISTS
colors,
bodyTypes,
engineTypes,
transmissionTypes,
carBodies,
carEngines,
transmission,
producers,
models,
stock;
CREATE TABLE bodyTypes
(
id SERIAL PRIMARY KEY,
name VARCHAR(2000)
);
CREATE... |
<reponame>aspitsyn/sql-scripts
set timing on
set pagesize 50000;
set linesize 8000;
set serverout off;
alter session set "STATISTICS_LEVEL" = 'ALL';
alter session set current_schema = HR;
alter session set cursor_sharing = 'EXACT';
alter session set events '10046 trace name context forever, level 8';
--alter session se... |
insert into @results_database_schema.cc_results (
type,
fa_type,
covariate_id,
covariate_name,
analysis_id,
analysis_name,
concept_id,
count_value,
avg_value,
cohort_definition_id,
strata_id,
strata_name,
cc_generation_id)
select 'PREVALENCE' as type,
... |
<reponame>Agirish/drill-maprdb-tests<gh_stars>0
select max(L_LINENUMBER) from lineitem;
|
<reponame>angujo/ETL-CDMBuilder
SELECT DISTINCT {0} cast(patient_sk AS BIGINT) AS person_id, patient_sk
FROM {sc}.hf_d_patient
order by 1 |
<gh_stars>0
-- @testpoint: 自定义函数同义词在存储过程中调用
-- @modify at: 2020-11-25
--创建自定义函数
drop function if exists SYN_FUN_001(ARRAY_C integer[]) cascade;
create function SYN_FUN_001(ARRAY_C integer[]) return integer[]
as
ARRAY_A integer[];
begin
ARRAY_A:=ARRAY_C;
return ARRAY_A;
end;
/
--创建自定义函数的同义词
drop synonym if exists SYN... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 02, 2020 at 02:34 PM
-- Server version: 10.5.6-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_CLIENT... |
<reponame>gordonduan18/robin_stocks
-- For creating table of users
CREATE TABLE users (
username varchar(255) UNIQUE,
token_type varchar(255),
access_token varchar(1000),
refresh_token varchar(255),
device_token varchar(255)
); |
ALTER TABLE `users` ADD `last_login` TIMESTAMP NULL ;
ALTER TABLE `sessions` ADD `last_access` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL ; |
<filename>src/Test/IntegrationTests/setup.sql<gh_stars>0
create table memos(
id INT unsigned NOT NULL AUTO_INCREMENT,
title VARCHAR(150) NOT NULL,
content VARCHAR(3000) NOT NULL,
version INT unsigned NOT NULL,
deleted BOOL DEFAULT 0,
created DATE NOT NULL,
mo... |
<filename>ci4.sql
/*
SQLyog Ultimate v12.5.1 (64 bit)
MySQL - 8.0.21-0ubuntu0.20.04.4 : Database - ci4
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OL... |
<reponame>FlameNutrition/flame-coach-service<gh_stars>0
insert into DailyTask(id, uuid, name, description, ticked, date, clientFk, createdByFk)
values (1, '7b7ccce3-33a7-4f08-be12-d96773886023', 'Water', 'Drink water', 0, '2021-01-30', 1, 1);
|
-- 1
USE `soft_uni`;
SELECT e.employee_id, CONCAT_WS(' ', e.first_name, e.last_name) AS 'full_name', d.department_id, d.name AS 'department_name'
FROM `employees` AS e
JOIN `departments` AS d
ON e.employee_id = d.manager_id
ORDER BY e.employee_id
LIMIT 5;
-- 2
SELECT t.town_id, t.name AS 'town_name', a.address_... |
prompt --application/shared_components/user_interface/templates/list/badge_list
begin
wwv_flow_api.create_list_template(
p_id=>wwv_flow_api.id(25850733102742701514)
,p_list_template_current=>wwv_flow_string.join(wwv_flow_t_varchar2(
'<li class="t-BadgeList-item #A02#">',
' <a class="t-BadgeList-wrap u-color #A04#" hr... |
<gh_stars>0
USE master
GO
IF EXISTS
(
SELECT NAME
FROM Sys.Databases
WHERE Name = N'CountryWithCapitalCity'
)
BEGIN
DROP DATABASE [CountryWithCapitalCity]
END
GO
CREATE DATABASE [CountryWithCapitalCity]
GO
USE [CountryWithCapitalCity]
GO
CREATE SCHEMA [CountryBoundedContext];
GO
CREATE TABLE [Coun... |
<reponame>NeSh74/MS-SQL-September-2021<filename>06. Indices-and-Data-Aggregation/06. Indices-and-Data-Aggregation-Exercises/Solutions/11. Average Interest.sql
--USE [Gringotts]
--SELECT * FROM [WizzardDeposits]
SELECT
[DepositGroup],
[IsDepositExpired],
AVG([DepositInterest]) AS [AverageInterest]
FR... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 21, 2018 at 12:16 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
--
-- Database: `o... |
<gh_stars>0
CREATE TABLE "links" (
"link_id" TEXT NOT NULL,
"link_category" TEXT NOT NULL,
"link_name" TEXT NOT NULL,
"link_url" BLOB NOT NULL,
PRIMARY KEY("link_id")
) WITHOUT ROWID |
<filename>server/midlib/SessionRedis/s_change_password.sql
-- "Copyright (C) <NAME>, 2009-2017."
drop FUNCTION s_change_password ( p_password varchar, p_again varchar, p_old_password varchar, p_auth_token varchar, p_ip_addr varchar, p_url varchar );
CREATE or REPLACE FUNCTION s_change_password ( p_password var... |
# a
select
title
from
course
where
dept_name = 'Comp. Sci.'
and credits = 3;
# b
select
distinct takes.ID
from
takes,
instructor,
teaches
where
instructor.name = 'Einstein'
and instructor.ID = teaches.ID
and teaches.course_id = takes.course_id;
# c
select
max(salary) as max_salary
from
instruc... |
INSERT INTO task (title) VALUES ('Bring an umbrella');
INSERT INTO task (title) VALUES ('Buy spring water');
INSERT INTO task (title) VALUES ('Go to the gym');
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.2
-- Dumped by pg_dump version 12.2
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', fal... |
<gh_stars>1-10
CREATE PROCEDURE Website.SearchForSuppliers
@SearchText nvarchar(1000),
@MaximumRowsToReturn int
WITH EXECUTE AS OWNER
AS
BEGIN
SELECT TOP(@MaximumRowsToReturn)
s.SupplierID,
s.SupplierName,
c.CityName,
s.PhoneNumber,
s.FaxNumber ,
p... |
/*
Import flat file into table `dbo.Input`
ALTER TABLE dbo.Input ADD input_id bigint IDENTITY(1, 1) PRIMARY KEY
*/
DROP TABLE IF EXISTS #Results;
CREATE TABLE #Results (
input_id bigint NOT NULL,
number bigint NOT NULL,
prev int NOT NULL,
hit bit NOT NULL
);
DECLARE @prev int = 1;
DECLARE @stop bigint... |
-- <ChangeSet id="create countries" delimiter=";" />
CREATE TABLE COUNTRIES
(
COUNTRY_ID CHAR(2 BYTE) NOT NULL,
COUNTRY_NAME VARCHAR2(40 BYTE),
REGION_ID NUMBER
) LOGGING;
CREATE UNIQUE INDEX COUNTRY_C_ID_PKX ON COUNTRIES
(
COUNTRY_ID ASC
);
ALTER TABLE COUNTRIES
ADD CONSTRAINT COUNTRY_C_ID_PK PRIMARY K... |
ALTER TABLE [dbo].[CONFLICT_CONFLICT_TYPES]
ADD CONSTRAINT [PK_CoflictTypes]
PRIMARY KEY (Id) |
ALTER TABLE uCommerce_OrderStatus
ADD AllowOrderEdit BIT NOT NULL
CONSTRAINT uCommerce_OrderStatus_AllowOrderEdit DEFAULT 0 |
<filename>src/test/resources/join.test_24.sql<gh_stars>100-1000
-- join.test
--
-- execsql {
-- UPDATE t6 SET a='xyz';
-- SELECT * FROM t6 NATURAL JOIN t5;
-- }
UPDATE t6 SET a='xyz';
SELECT * FROM t6 NATURAL JOIN t5; |
-- file:create_operator.sql ln:81 expect:true
SET ROLE regress_rol_op1
|
<reponame>LaudateCorpus1/oracle-timesten-samples<filename>quickstart/classic/sample_code/plsql/cursor_loop_types2.sql
--
-- Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
--
-- Licensed under the Universal Permissive License v 1.0 as shown
-- at http://oss.oracle.com/licenses/upl
--
Rem
R... |
<reponame>marcoromagnolo/j7ORM
--Drop Tables
DROP TABLE IF EXISTS test_brand;
DROP TABLE IF EXISTS test_category;
DROP TABLE IF EXISTS test_product_category;
DROP TABLE IF EXISTS test_product;
|
<reponame>lwlflz/workspace<filename>build-cloud/build-cloud-admin/sql/build_cloud-20180318.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50709
Source Host : localhost:3306
Source Database : build_cloud
Target Server Type : MYSQL
Target Server Version :... |
<filename>tests/input/alias/pass_constants.ddl
test_true = true;
test_false = false;
|
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 10.1.19-MariaDB : Database - db_test
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=... |
DROP TABLE IF EXISTS analytics_significant_calls_procedures;
CREATE TABLE analytics_significant_calls_procedures (
id INT(10) PRIMARY KEY NOT NULL,
significant_calls BIGINT(21) NOT NULL,
phenotyping_center VARCHAR(255),
procedure_stable_id VARCHAR(40),
procedure_name ... |
-- 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.
-- This file contains utilities for time conversion.
CREATE OR REPLACE FUNCTION _timescaledb_internal.to_unix_microseconds(ts TIMESTAMPTZ... |
<reponame>h4ck3rm1k3/S2RDF
SELECT tab0.v1 AS v1 , tab4.v5 AS v5 , tab3.v4 AS v4 , tab2.v3 AS v3 , tab1.v2 AS v2
FROM (SELECT obj AS v1
FROM sorg__contactPoint$$1$$
WHERE sub = 'wsdbm:Retailer184'
) tab0
JOIN (SELECT sub AS v1 , obj AS v2
FROM wsdbm__follows$$2$$
) tab1
ON(tab0.v1=tab1.v1)
JOIN... |
{% materialization view, adapter='snowflake' -%}
{{ return(create_or_replace_view()) }}
{%- endmaterialization %}
|
<reponame>cb-deepak/pgcodekeeper
SET search_path = pg_catalog;
ALTER TABLE public.cities
DETACH PARTITION public.cities_ab;
ALTER TABLE public.cities_ab OF public.comp;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50717
Source Host : localhost:3306
Source Database : mq_fail_message_node_01
Target Server Type : MYSQL
Target Server Version : 50717
File Encoding : 65001
Date: 2019-10-15 15:16:19
*/
SET FOREIGN_KEY... |
ALTER TABLE update_info ADD job_config_version bigint;
ALTER TABLE update_info ADD job_config_prev_version bigint;
ALTER TABLE update_info ADD update_state text;
ALTER TABLE update_info ADD update_options blob;
ALTER TABLE update_info DROP prev_version;
ALTER TABLE update_info DROP job_config;
ALTER TABLE update_info D... |
<filename>test/fixtures.sql
-- Anything that needs to be executed prior to every test goes here
create extension supa_audit cascade version '0.2.3';
|
<filename>testdata/collate.sql<gh_stars>100-1000
select 'Foo' collate "C", 'Bar' collate "en_US"
|
<filename>news.sql
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 2017-07-20 14:59:57
-- 服务器版本: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... |
<filename>datamodel/schema/tables/checkinstall_vars.sql<gh_stars>0
CREATE TABLE checkinstall_vars
(
checkinstall_var_id INTEGER NOT NULL
CONSTRAINT checkinstall_vars_pk
PRIMARY KEY ASC AUTOINCREMENT,
patch_version_id ... |
-- unfortunately SQLite doesn't allow to modify a column definition
-- re-build tracks table from scratch to make url case insensitive
DROP TABLE IF EXISTS tracks;
CREATE TABLE tracks (
id INTEGER PRIMARY KEY AUTOINCREMENT,
url text NOT NULL COLLATE NOCASE, -- bug 17457: url needs to be case insensitive, or some impo... |
#
# netware_mysql.sql
#
# This SQL file will create the tables for MySQL. Use it like
#
# ~/frommel$ mysql -u root -p netware < netware_mysql.sql
#
# This, of course, assumes database 'netware' has already been created.
#
DROP TABLE IF EXISTS object;
DROP TABLE IF EXISTS prop;
DROP TABLE IF EXISTS value;
CREATE TABLE ... |
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES (NULL, 'allow_username_spaces', 'yes');
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES (NULL, 'use_playlist', 'yes');
INSERT INTO `{tbl_prefix}config` (`configid`, `name`, `value`) VALUES (NULL, 'comments_captcha', 'all');
INSE... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.