sql stringlengths 6 1.05M |
|---|
<filename>erd_schema_queries/2/Kamyab/create.sql
CREATE TABLE accounts
(
aid INT AUTO_INCREMENT
PRIMARY KEY,
atype VARCHAR(30) NULL,
abalance INT NULL,
cid INT NULL,
branch_id INT NULL
)
ENGINE = InnoDB;
CREATE INDEX accounts_customers_cid_fk
ON accounts (cid)... |
USE AdventureWorks2014;
GO
ALTER DATABASE AdventureWorks2014 SET QUERY_STORE = ON;
GO
CREATE PROC dbo.AddressByCity @City NVARCHAR(30)
AS
SELECT a.AddressID,
a.AddressLine1,
a.AddressLine2,
a.City,
sp.Name AS StateProvinceName,
a.PostalCode
... |
ALTER TABLE [dbo].[CONFLICT_CONFLICTS]
ADD CONSTRAINT [PK_Conflicts]
PRIMARY KEY (Id) |
<gh_stars>1-10
create table yatzy_template_score_card
(
seq_id number(2,0) not null
, input_field char(1) not null
, label_msg varchar2(30) not null
, card_section varchar2(30) not null
, constraint yatzy_template_score_card_pk primary key ( seq_id )
, constraint yatzy_template_score_card_uk1 unique ( label_msg )
, c... |
PAI -name ps_smart
-DinputTablePartitions="mall_id=m_768"
-DclassNum=79
-DinputTableName=user_shop_behavior_kv
-DmodelName=dropout_multi_model_m_768
-DlabelColName=label
-DfeatureColNames=kv
-DenableSparse=true
-Dobjective=multi:softprob
-DtreeCount=109
-DsampleRatio=0.6
-Df... |
<reponame>Shuttl-Tech/antlr_psql<gh_stars>10-100
-- file:groupingsets.sql ln:161 expect:true
select four, x || 'x'
from (select four, ten, 'foo'::text as x from tenk1) as t
group by grouping sets (four, x)
order by four
|
<reponame>Shuttl-Tech/antlr_psql
-- file:alter_generic.sql ln:235 expect:true
CREATE OPERATOR CLASS alt_opc2 FOR TYPE macaddr USING hash AS STORAGE macaddr
|
<gh_stars>10-100
CREATE TABLE routers (
router_id UUID PRIMARY KEY NOT NULL,
router_parent_core_id UUID NULL,
router_type VARCHAR(255),
router_vendor VARCHAR(255),
router_model VARCHAR(255),
router_ip_protocol VARCHAR(255),
router_ip_address VARCHAR(255),
location_id int NULL
);
CREATE ... |
<filename>astroll_install_package/ITA/ita-sqlscripts/ja_JP_oracle_ita_model-n2.sql<gh_stars>1-10
-- *****************************************************************************
-- *** ***** CreateParameterMenu Tables ***
-- **********************************************************... |
<reponame>189569400/ClickHouse<gh_stars>1-10
DROP TABLE IF EXISTS test.numbers_10k_log;
SET max_block_size = 1000;
CREATE TABLE test.numbers_10k_log ENGINE = Log AS SELECT number FROM system.numbers LIMIT 10000;
SET max_threads = 4;
SET max_rows_to_group_by = 3000, group_by_overflow_mode = 'any';
SELECT ignore(rand... |
CREATE TABLE IF NOT EXISTS ibc_channel
(
id SERIAL PRIMARY KEY,
client VARCHAR(128) NOT NULL,
dst_chain_name VARCHAR(256) NOT NULL,
src_port VARCHAR(128) NOT NULL,
src_channel VARCHAR(128) NOT NULL,
dst_port VARCHAR(128) NOT NULL,
dst_channel VARCHAR(128) NOT NULL,
status VARCHAR(64) NOT... |
<gh_stars>1000+
update ACT_GE_PROPERTY set VALUE_ = '6.4.0.0' where NAME_ = 'job.schema.version'; |
<reponame>khuddlefish/gpdb<gh_stars>1-10
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
CREATE ROLE resync_role1 with login;
CREATE ROLE resync_role2 with login;
CREATE ROLE resync_role3 with login;
DROP ROLE sync1_role6;
DROP ROLE ck_sync1_role5;
DROP ROLE ct_role3;
DROP ROLE resyn... |
<reponame>jazzlian/hobby<gh_stars>0
---------------------------
--PostgreSQL Connect by
---------------------------
with RECURSIVE re_emp (employee_id, first_name, last_name, manager_id, boss, chart)
as (
select a.employee_id, a.first_name, a.last_name, a.manager_id, a.last_name as boss, concat(',',a.last_name::te... |
<reponame>Zhaojia2019/cubrid-testcases
--[er]test abs function with bit type as its operand
select abs(b'0001000') from db_root order by 1; |
autocommit off;
alter class employee_c change query
select ssn, name, dept_no, salary, location
from employee_c;
rollback work;
rollback;
|
insert into foods (code, name, some_value, kcal, kj, water, dietary_fiber, carbohydrates, proteins, total_lipids, saturated_lipids, monosaturated_lipids, polysaturated_lipids, cholesterol, calcium, phosphorus, iron, magnesium, sodium, potassium, zinc, vitamin_a, ascorbic_acid, thiamin, rivoflavin, niacin, pyridoxine, f... |
insert into airq.filteritems
(${values:name})
values(${values:csv})
${returning:raw} |
<reponame>HalloSouf/SteamRobot
DROP TABLE IF EXISTS settings;
CREATE TABLE settings (
id int not null AUTO_INCREMENT,
guild_id varchar(20) not null,
setting varchar(10) not null,
value varchar(100) null,
created_at datetime not null,
updated_at datetime null,
primary key(id)
); |
<gh_stars>0
CREATE TABLE IF NOT EXISTS account (
aid BIGINT NOT NULL AUTO_INCREMENT,
email VARCHAR(30) NOT NULL ,
password VARCHAR(20) NOT NULL ,
PRIMARY KEY (aid,email)
);
CREATE TABLE IF NOT EXISTS customer (
aid BIGINT NOT NULL ,
cid BIGINT NOT NULL ,
cname VARCHAR(255) NOT NULL ,
ctype... |
INSERT INTO mems_data VALUES
('00', 'sauce'),
('01', 'soda'),
('02', 'sun'),
('03', 'sumo'),
('04', 'sierra'),
('05', 'seal'),
('06', 'sash'),
('07', 'sock'),
('08', 'safe'),
('09', 'soap'),
('0', 'sea'),
('1', 'tie'),
('2', 'noah'),
('3', 'ma'),
('4', 'ray'),
('5', 'law'),
('6', 'jaw'),
('7', 'key'),
('8', 'ufo'),
('9... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50726
Source Host : localhost:3306
Source Database : order_system
Target Server Type : MYSQL
Target Server Version : 50726
File Encoding : 65001
Date: 2019-11-08 17:33:24
*/
SET FOREIGN_KEY_CHECKS=0;
... |
/****************************************************************
RUN THIS SCRIPT IN SQLCMD MODE
****************************************************************/
--Configure transport security
:Connect SQL1
!!del c:\temp\be.cer
!!del c:\temp\be.pvk
USE master;
CREATE MASTER KEY
ENCRYPTION BY PASSWORD = '... |
<reponame>quassnoi/explain-extended-2017
WITH RECURSIVE
all_factors (initial, factor, final) AS
(
SELECT s, s, FALSE
FROM generate_series(2, 99 * 99) s
UNION ALL
SELECT initial, f, d IN (1, factor)
FROM (
SELECT initial, factor, d
FROM all_factors
CROSS JOIN
LATERAL
(
SELECT d
FROM generate_ser... |
<filename>mysql/proc/get_shards.sql
-- call account.get_shards (@err);
DROP PROCEDURE IF EXISTS account.get_shards;
DELIMITER $$
CREATE PROCEDURE account.get_shards (OUT error_code INT)
BEGIN
SET error_code=-1;
SELECT s.shard_id
,s.shard_index
,s.shard_name
,st.shard_type_name
,s.db_port
... |
-- CREATE or REPLACE FUNCTION s_get_config_item(p_item_name varchar, p_customer_id varchar, p_dflt varchar)
select s_get_config_item ( 'bob', '1', 'success-200' );
select 'success-201' from dual where exists ( select s_get_config_item ( 'from.address', '1', 'fail-201' ) )
|
<gh_stars>1-10
Use AdventureWorks;
GO
-- define Python script
DECLARE @pyscript NVARCHAR(MAX);
-- Let's name our parameters
SET @pyscript = N'
df = SqlInputData
PythonOutput = df';
DECLARE @sqlscript NVARCHAR(MAX);
SET @sqlscript = N'
SELECT t.Name AS Territories, CAST(h.Subtotal AS FLOAT) AS Sales... |
SELECT 1 AS id, 'Namespaced SQL file'::text AS name;
|
<reponame>jdkoren/sqlite-parser<gh_stars>100-1000
-- tkt3419.test
--
-- execsql {
-- select * FROM b, a, c WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id;
-- }
select * FROM b, a, c WHERE a.id=2 AND b.a_id = a.id AND b.id=c.b_id; |
-- auth.test
--
-- execsql {
-- DROP TABLE v1chng;
-- }
DROP TABLE v1chng; |
Declare @OutputDir varchar(max)= '##CreateMPPScriptsPath##'
Select '1' as Active, db_name() as DatabaseName, s.name as SchemaName,
@OutputDir + '\' + db_name() + '\SPs\' as OutputFolderPath,
s.name + '_'+ o.name as FileName,
s.name + '.'+ o.name as 'ObjectName', 'SP' as ObjectsToScript
from sys.objects o
inner joi... |
-- file:alter_table.sql ln:1840 expect:true
CREATE TABLE comment_test_child (
id text CONSTRAINT comment_test_child_fk REFERENCES comment_test)
|
<gh_stars>1-10
-- Verify perfume-catalog:01_init on pg
BEGIN;
-- XXX Add verifications here.
ROLLBACK;
|
<reponame>michaelmaguire/twosidedsearch<gh_stars>0
drop schema speedycrew cascade;
|
DROP VIEW utilizador_view;
DROP TABLE utilizador;
DROP TABLE tipo_utilizador;
|
CREATE TABLE IF NOT EXISTS `casa_services` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(64) NOT NULL,
`description` text,
`url` varchar(255) NOT NULL,
`userrole` varchar(64) NOT NULL,
`location` varchar(255) DEFAULT NULL,
`lecture` varchar(64) DEFAULT NULL,
`serviceID` varchar(64) NOT NULL,
... |
CREATE INDEX IF NOT EXISTS security_event_logs_name ON security_event_logs USING btree (name);
|
-- -----------------------------------------------------
-- Table `prod`.`data_licenses`
-- Keywords that describes a dataset.
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `prod`.`data_licenses` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`created_date` ... |
<reponame>ghJo-Gaia3D/mago3d<filename>doc/database/ddl/data_attribute.sql
-- FK, Index 는 별도 파일로 분리. 맨 마지막에 작업 예정
drop table if exists data_attribute cascade;
drop table if exists data_object_attribute cascade;
-- Data 기본정보
create table data_attribute (
data_attribute_id bigint,
data_id bigint,
attributes ... |
DECLARE @target TABLE
(
Id INT NOT NULL
PRIMARY KEY,
Name VARCHAR(100)
);
DECLARE @source TABLE
(
Id INT NOT NULL
PRIMARY KEY,
Name VARCHAR... |
<gh_stars>1-10
-- Optional-Regeln, Dunkle Zeiten Setting
INSERT INTO Regeln (Name, Typ, Beschreibung) VALUES ('TPKK', 'Optional', 'Kampf: Trefferpunkte und Körperkraft (TP/KK) (WdS 81f)');
INSERT INTO Regeln (Name, Typ, Beschreibung) VALUES ('NiedrigeLE', 'Optional', 'Kampf: Auswirkungen niedriger LE (WdS 57)');
IN... |
<filename>sample-rest-api-mysql/populate_db.sql
-- MySQL dump 10.14 Distrib 5.5.33a-MariaDB, for Win64 (x86)
--
-- Host: localhost Database: upout_test
-- ------------------------------------------------------
-- Server version 5.5.33a-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Dec 28, 2016 at 03:15 PM
-- Server version: 10.1.8-MariaDB
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
CREATE DATABASE 'frontstore' /*!40100 DEFAULT CHARACTER SET latin1 */;
CREATE TABLE 'users' (
'id' int(11) NOT NULL,
'name' varchar(45) NOT NULL,
'facebookid' varchar(150) DEFAULT NULL,
PRIMARY KEY ('id'),
UNIQUE KEY 'id_UNIQUE' ('id')
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE 'products' (
'id'... |
<reponame>ZombieFleshEaters/mtgdm<gh_stars>0
CREATE TABLE `comment` (
`CommentID` varchar(36) COLLATE utf8mb4_bin NOT NULL,
`ShowpieceID` varchar(36) COLLATE utf8mb4_bin NOT NULL,
`UserID` varchar(36) COLLATE utf8mb4_bin NOT NULL,
`Content` longtext COLLATE utf8mb4_bin NOT NULL,
`Created` datetime NOT NULL,
... |
<gh_stars>0
-- -- List the following details of each employee: employee number, last name, first name, sex, and salary.
select employees.emp_no, employees.last_name, employees.first_name, employees.sex, salaries.salary
from employees
inner join salaries on
salaries.emp_no=employees.emp_no;
-- -- List first name, las... |
<filename>bd/bdTest.sql
DROP DATABASE IF EXISTS intranet;
CREATE DATABASE IF NOT EXISTS intranet;
USE intranet;
create table login_attempts(
id int,
ip_address varchar(45),
login varchar(100),
time int
);
create table nacionalidad(
idNacionalidad int auto_increment primary key,
nombreNacionali... |
<gh_stars>0
-- Date su tabele PERSONS, EMPLOYEES i STUDENTS
create table persons(
ssn int not null primary key,
name varchar(20) not null
);
create table employees(
ssn int not null primary key,
company varchar(20) not null,
salary decimal(9, 2),
foreign key (ssn)
references persons(ssn)
... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.5 (Debian 10.5-2.pgdg90+1)
-- Dumped by pg_dump version 10.5
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_conf... |
<reponame>MoraHol/payment-system
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 01-03-2019 a las 05:36:58
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANS... |
<reponame>roddy/library-demo
INSERT INTO users(id, name, joined_on ) VALUES
( 1, '<NAME>', '2021-09-25 12:00:00' ),
( 2, '<NAME>', '2019-01-01 12:00:00' ),
( 3, '<NAME>', '2005-07-04 12:00:00' );
INSERT INTO books(id, title, author, description, year) VALUES
( 1, '<NAME>', '<NAME>', '<NAME> tells of th... |
<reponame>fendys01/Construction-Project<gh_stars>0
DROP INDEX token_user;
|
<gh_stars>0
-- SELECT *
-- FROM Students
-- WHERE
-- Email LIKE '%gmail%'
-- OR
-- Phone LIKE '%541%'
-- SELECT FirstName, LastName,
-- FriendID
-- FROM Students AS t1
-- INNER JOIN Students AS t2
-- ON t1.FriendID = t2.FriendID
SELECT*
FROM Books B
JOIN CollegeBooks cb
ON B.BookID = cb.BookID
JOIN Colleges... |
SET DEFINE OFF;
ALTER TABLE AFW_17_PROFL_COURL ADD (
CONSTRAINT AFW_17_PROFL_COURL_CK2
CHECK ((adres_suprt is not null and nom_suprt is not null and indic_ajout_suprt_cci is not null) or (adres_suprt is null and nom_suprt is null and indic_ajout_suprt_cci is null))
ENABLE VALIDATE)
/
|
CREATE TABLE tb_userdata (
id_userdata INT NOT NULL DEFAULT unique_rowid(),
sso_id STRING NOT NULL,
first_name STRING NULL,
last_name STRING NULL,
location STRING NULL,
email STRING NOT NULL,
picture STRING NULL,
CONSTRAINT tb_userdata_pk PRIMARY KEY (id_userdata DESC),
UNIQUE INDEX tb_userdata_un (email DESC)... |
CREATE TABLE IF NOT EXISTS weatherdates (
weatherDate VARCHAR(10) PRIMARY KEY,
temperatureAverage DECIMAL(8, 2),
windSpeedAverage DECIMAL(8, 2),
rainAndSnowAmount DECIMAL(8, 2),
snowDepth DECIMAL(8, 2),
temperatureMin DECIMAL(8, 2),
temperatureMax DECIMAL(8, 2),
createdAt TIMESTAMP DEFAU... |
-- Delete created files from c:\temp before running this script
USE [master];
GO
IF EXISTS (SELECT 1 FROM sys.databases WHERE [name] = 'EncryptionDemo')
DROP DATABASE [EncryptionDemo];
GO
IF EXISTS (SELECT 1 FROM sys.sql_logins WHERE [name] IN ('Dilbert', 'Wally'))
BEGIN
DROP LOGIN [Dilbert];
DROP LOG... |
<reponame>netology-group/event<filename>legacy_db_migration/primary.sql
begin;
create extension if not exists "uuid-ossp";
-- Connect to the legacy DB.
create extension if not exists "dblink";
create foreign data wrapper legacy_db_wrapper validator postgresql_fdw_validator;
create server legacy_db foreign data wrappe... |
-- file:temp.sql ln:146 expect:true
set search_path = public, pg_temp
|
<reponame>soitgoes/Mite<filename>ExampleMsBuildTask/scripts/2012-09-21T03-31-54Z.sql<gh_stars>1-10
/* up */
CREATE TABLE dbo.test
(
id int NOT NULL
) ON [PRIMARY]
GO
/* down */
drop table dbo.test |
<gh_stars>10-100
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE sp_NewIssuesToday
AS
BEGIN
-- Display new crashes added today
/* SELECT Followup,
BucketMap.BucketId AS Bucket,
COUNT (BucketMap.CrashId) AS Instances
FROM CrashInstances, BucketMap,... |
-- Generated by dbtvault.
WITH row_rank_1 AS (
SELECT PRODUCT_SUPPLIER_PK, PRODUCT_PK, SUPPLIER_PK, LOAD_DATE, RECORD_SOURCE,
ROW_NUMBER() OVER(
PARTITION BY PRODUCT_SUPPLIER_PK
ORDER BY LOAD_DATE ASC
) AS row_number
FROM DATAVAULTDEMO_DB.SS_STG.v_stg_product... |
<filename>server/src/domains/roles/roles.models.sql
CREATE TABLE IF NOT EXISTS role (
role_id serial PRIMARY KEY,
title VARCHAR(50) NOT NULL CHECK(title IN ('admin', 'customer', 'deliveryPerson', 'salesPerson')),
description TEXT NOT NULL
);
CREATE TABLE IF NOT EXISTS user_role (
user_id INT REFERENCES "user" (... |
<gh_stars>0
INSERT INTO global_sensor_events
SELECT scada.uuid, scada.systemtime, scada.temperaturef, scada.pressure, scada.humidity,scada.lux,scada.proximity, scada.oxidising, scada.reducing, scada.nh3,scada.gasko,scada.amplitude100,
scada.amplitude500, scada.amplitude1000, scada.lownoise, scada.midnoise, scada.h... |
create database request;
\connect request
SET client_encoding TO 'UTF8';
create table roles (
id serial primary key,
role varchar(2000) unique
);
create table rules (
id serial primary key,
rule varchar(2000) unique
);
create table roles_rules (
role_id int references roles(id),
rule_id int references rule... |
<filename>tests/queries/0_stateless/01085_window_view_attach.sql
-- Tags: no-parallel
SET allow_experimental_window_view = 1;
DROP DATABASE IF EXISTS test_01085;
CREATE DATABASE test_01085 ENGINE=Ordinary;
DROP TABLE IF EXISTS test_01085.mt;
DROP TABLE IF EXISTS test_01085.wv;
CREATE TABLE test_01085.mt(a Int32, ma... |
/****** Object: Table [dbo].[T_Mgrs] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_Mgrs](
[M_ID] [int] IDENTITY(300,1) NOT NULL,
[M_Name] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[M_TypeID] [int] NOT NULL,
[M_ParmValueChanged] [tinyint] NOT NULL,
[M_C... |
CREATE TABLE revisions (
id SERIAL PRIMARY KEY,
dataset_id INT NOT NULL,
version INT NOT NULL,
revision INT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
ALTER TABLE revisions
ADD CONSTRAINT public_dataset_versions_fk FOREIGN KEY (da... |
<gh_stars>1-10
--
-----------------------
-- production
-----------------------
CREATE USER linkbinder
IDENTIFIED BY linkbinder
DEFAULT TABLESPACE linkbinder
;
GRANT
CREATE session,
ALTER session,
SELECT any dictionary,
CREATE table,
CREATE view,
CREATE sequence,
CREATE any synonym,
CREATE procedur... |
CREATE TABLE ssh_secret (
public_key character varying(7000),
id bigint NOT NULL
);
ALTER TABLE ONLY ssh_secret
ADD CONSTRAINT ssh_secret_pkey PRIMARY KEY (id);
ALTER TABLE ONLY ssh_secret
ADD CONSTRAINT ssh_secret_fkey FOREIGN KEY (id) REFERENCES named_secret(id); |
--
-- Copyright 2002-2015 SCOOP Software GmbH
--
-- 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.apache.org/licenses/LICENSE-2.0
--
-- Unless required by appli... |
<gh_stars>1000+
SELECT "c".* FROM cats as c RIGHT JOIN dogs d on d.cat_id = cats.id; |
<filename>alone.sql
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 27, 2019 at 11:02 AM
-- Server version: 5.7.25-0ubuntu0.16.04.2
-- PHP Version: 7.2.16-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zo... |
<reponame>blackbeltandre/return<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.5deb2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: May 30, 2021 at 06:51 AM
-- Server version: 8.0.25-0ubuntu0.20.04.1
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
STAR... |
USE PeopleTracker
GO
/****** Object: Table dbo.Insurance Script Date: 6/1/2018 8:39:27 AM ******/
IF OBJECT_ID('dbo.Insurance', 'U') IS NOT NULL
BEGIN
ALTER TABLE dbo.Insurance DROP CONSTRAINT FK_Insurance_Address
ALTER TABLE dbo.Insurance DROP CONSTRAINT FK_Insurance_Phone
ALTER TABLE dbo.Insurance DROP CON... |
<filename>email.sql
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 17, 2020 at 01:57 PM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.2.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:0... |
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 20, 2018 at 07:35 PM
-- Server version: 5.7.24-0ubuntu0.16.04.1
-- PHP Version: 7.0.32-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SE... |
DROP DATABASE IF EXISTS employees_db;
CREATE DATABASE employees_db;
USE employees_db;
CREATE TABLE department (
id INT NOT NULL AUTO_INCREMENT,
dept_name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE role (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(30) NOT NULL,
salary DECIMAL(10,2) default... |
-- Run this on the MAster
CREATE LOGIN classLogin
WITH PASSWORD = '<PASSWORD>'
GO
|
--11. Vacation
CREATE FUNCTION udf_CalculateTickets
(@origin NVARCHAR(50), @destination NVARCHAR(50), @peopleCount INT)
RETURNS NVARCHAR(50)
AS
BEGIN
IF(@peopleCount IS NULL OR @peopleCount <= 0)
RETURN 'Invalid people count!'
DECLARE @flightId INT
SET @flightId = (SELECT TOP(1) Id FROM Flights WHERE Or... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2015-09-15 04:41:15
-- 服务器版本: 5.5.44-0ubuntu0.14.04.1
-- PHP 版本: 5.5.9-1ubuntu4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
<reponame>DannyPoizot/nestjs-testing<filename>prisma/migrations/20220303095300_init/migration.sql
-- CreateTable
CREATE TABLE "about" (
"id" SERIAL NOT NULL,
"title" TEXT NOT NULL,
"content" TEXT NOT NULL,
CONSTRAINT "about_pkey" PRIMARY KEY ("id")
);
|
DROP DATABASE IF EXISTS librarycurator_db;
CREATE DATABASE librarycurator_db; |
<reponame>lourencomcviana/log-schema<filename>script/view/v_priority.sql
create or replace view LOG_AUDIT.v_Priority as
select * from LOG_AUDIT.t_Priority;
|
<gh_stars>10-100
SELECT
D.Name AS Department,
E.Name AS Employee,
E.Salary AS Salary
FROM
Employee E,
Department D,
(SELECT
E2.DepartmentId,
IFNULL(MAX(E3.Salary), -1) AS 3rdMaxSalary
FROM (
SELECT
E0.DepartmentId,
MAX(Salary) AS 2ndMaxSalary
FROM (
SELECT MAX(Salary) AS ... |
-- Adminer 4.7.7 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET NAMES utf8mb4;
DROP TABLE IF EXISTS `log`;
CREATE TABLE `log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`inserted_at` datetime NOT NULL DEFAULT current_timestamp(),
`indoor_temp` float NOT NULL DEFAULT 0,
`ind... |
<gh_stars>1-10
CREATE TABLE T_TEMP (
ID VARCHAR(36),
CONTRACT_ID VARCHAR(36) NOT NULL,
ENDTIME DATETIME(3) NOT NULL, -- valid to, inclusive
VALUE DECIMAL(9,2) NOT NULL, -- value
PRIMARY KEY(ID)
)
;
|
<filename>db_archive/sql_archive/531__sa_create_table_sa_yo3b_julkaisut_keksintoilmoitukset.sql
IF NOT EXISTS (select * from INFORMATION_SCHEMA.TABLES where TABLE_SCHEMA='sa' and TABLE_NAME='sa_suorat_yo3b_julkaisut_keksintoilmoitukset') BEGIN
create table sa.sa_suorat_yo3b_julkaisut_keksintoilmoitukset
(
yliopisto ... |
CREATE DATABASE Test_OPENCorona;
GO
|
-- file:triggers.sql ln:1692 expect:true
drop trigger child2_insert_trig on child2
|
/*
Warnings:
- You are about to drop the column `accessToken` on the `Account` table. All the data in the column will be lost.
- You are about to drop the column `accessTokenExpires` on the `Account` table. All the data in the column will be lost.
- You are about to drop the column `providerId` on the `Account... |
<filename>DB/mssql/1-create_tables.sql
use Gallery;
go
create table Pictures (
ID T_PicturesID primary key not null,
Name varchar(100) not null,
Description varchar(100),
Width int not null constraint CheckWidth
check (Width > 0),
Height int not null,
constraint CheckHeight
check (Height > 0),
Rating int not null,
... |
use data_extracts;
drop procedure if exists buildDataset2ForELGH;
DELIMITER //
CREATE PROCEDURE buildDataset2ForELGH ()
BEGIN
drop table if exists dataset2;
create table dataset2 (
pseudo_id varchar(100) default NULL,
age_years int(11) default null,
SmokerCode varchar(30) null,
SmokerDate varchar(30) null,... |
<filename>sql/create_users_table.sql
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id text NOT NULL,
name text NOT NULL,
nb_event_added integer NOT NULL
);
|
ALTER TABLE recommendation ALTER COLUMN name DROP not null;
ALTER TABLE recommendation ALTER COLUMN movie_name SET not null;
|
<reponame>PeopleForBikes/pfb-network-connectivity
----------------------------------------
-- INPUTS
-- location: neighborhood
-- proj: :nb_output_srid psql var must be set before running this script,
-- :cluster_tolerance psql var must be set before running this script.
-- e.g. psql -v nb_output_srid=2163 -v clu... |
-- +migrate Up
CREATE TABLE IF NOT EXISTS `boundaries` (
`id` INTEGER UNSIGNED PRIMARY KEY AUTO_INCREMENT NOT NULL,
`type` VARCHAR(191) NOT NULL,
`stats_retention` INTEGER NOT NULL,
`subscribers_limit` INTEGER NOT NULL,
`campaigns_li... |
<reponame>UltimateSoftware/DOI
IF OBJECT_ID('[DOI].[spRefreshMetadata_2_Tables]') IS NOT NULL
DROP PROCEDURE [DOI].[spRefreshMetadata_2_Tables];
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [DOI].[spRefreshMetadata_2_Tables]
@DatabaseName NVARCHAR(128) = NULL
AS
EXEC DOI.spRefreshMe... |
<reponame>lintzc/GPDB
-- @author prabhd
-- @created 2013-02-01 12:00:00
-- @modified 2013-02-01 12:00:00
-- @tags cte HAWQ
-- @product_version gpdb: [4.3-],hawq: [1.1-]
-- @db_name world_db
-- @description test18: CTE with WINDOW function
WITH CTE(a,b) AS
(SELECT a,d FROM foo, bar WHERE foo.a = bar.d),
CTE1(e,f) A... |
DROP VIEW IF EXISTS view_beban_barang_rekap_kabupaten CASCADE;
CREATE VIEW view_beban_barang_rekap_kabupaten AS
;
GRANT ALL PRIVILEGES ON view_beban_barang_rekap_kabupaten TO lap_kabupaten;
REVOKE INSERT, UPDATE, DELETE ON view_beban_barang_rekap_kabupaten FROM lap_kabupaten;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.