sql stringlengths 6 1.05M |
|---|
CREATE PROCEDURE [dbo].[usp_add_datasource]
@DatasourceUser DatasourceUserTableType READONLY,
@DatasourceName NVARCHAR (300),
@DatasourceServerName NVARCHAR (300),
@DatabaseType VARCHAR (50),
@OrganizationId varchar(10),
@InitialCatalog VARCHAR (300),
@PersistSecurityInfo VARCHAR (50),
@DatabaseUserID VA... |
CREATE TABLE [dbo].[ErrorLogs] (
[ErrorId] INT IDENTITY (1, 1) NOT NULL,
[ErrorDate] DATETIME NOT NULL,
[ErrorMessage] NVARCHAR (MAX) NULL,
[CallStack] NVARCHAR (MAX) NULL,
[UserAgent] NVARCHAR (MAX) NULL,
[IPAddress] ... |
CREATE TABLE aircraftpatterns (
mode_s_hex TEXT,
pattern_centroid GEOGRAPHY(Point, 4326),
pattern_cent_long DOUBLE PRECISION,
pattern_cent_lat DOUBLE PRECISION,
report_epoch INTEGER,
reporter TEXT,
itinerary_id TEXT
);
ALTER TABLE air... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 26, 2020 at 10:40 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
ALTER TABLE users ALTER password VARCHAR (60) NOT NULL; |
<reponame>mantamusica/interfacesDesign<filename>script.sql
CREATE TABLE ALUMNO (
p_alumno NUMERIC(4) NOT NULL,
nombre VARCHAR(50) NOT NULL,
apellidos VARCHAR(50) NOT NULL,
dni VARCHAR(9) NOT NULL,
a_grupo NUMERIC(4) NOT NULL,
... |
<filename>sql/doc/Create_db_script.sql
/*
Creación base de datos proyecto1
Autor: <NAME>
Modificación: 01/04/2017
MariaDB(MySQL)
*/
CREATE DATABASE IF NOT EXISTS proyecto1;
DROP TABLE IF EXISTS
users,
sales,
products,
invoices,
customers;
/*
Tabla para el registro de usuarios que tendrán acceso a ... |
INSERT INTO PAGEOWNER Values(0,'USER TEST 1', 'public', 0);
INSERT INTO User Values(0, '<NAME>', (Values current date), '<EMAIL>', 'ALEXANDER');
INSERT INTO PAGEOWNER Values(1,'USER TEST 2', 'friends', 1);
INSERT INTO User Values(1, '<NAME>', (Values current date), '<EMAIL>', 'OLIVIA');
INSERT INTO PAGEOWNER Values(2... |
<gh_stars>1-10
DROP TABLE CONFIGURATION IF EXISTS;
CREATE TABLE CONFIGURATION(KEY VARCHAR(256) NOT NULL PRIMARY KEY,VALUE VARCHAR(256));
insert into CONFIGURATION (KEY,VALUE) VALUES ('First','1');
insert into CONFIGURATION (KEY,VALUE) VALUES ('Second','2');
insert into CONFIGURATION (KEY,VALUE) VALUES ('Third','3')... |
<reponame>V-Paranoiaque/vca<gh_stars>10-100
CREATE TABLE IF NOT EXISTS `request_topic` (
`request_topic_id` int(10) unsigned NOT NULL,
`request_topic_title` varchar(255) NOT NULL,
`request_topic_created` int(10) unsigned NOT NULL,
`request_topic_author` int(10) unsigned NOT NULL,
`request_topic_resolved` int(11... |
<filename>eliot/create.sql
-- mysql must be running
-- source filename
CREATE DATABASE ncaa_fb;
USE ncaa_fb;
CREATE TABLE player (
id tinyint auto_increment,
f_name varchar(20),
m_int varchar(1),
l_name varchar(20),
school_id tinyint,
dob date,
classification varchar(2),
PRIMARY KEY (id... |
<reponame>cumminsjp/Agema
-- =============================================
-- Author: <NAME> (<EMAIL>)
-- Create date: 2019-02-07
-- Description: Splits a string and returns a table. This
-- is a modified version of: https://sqlperformance.com/2012/07/t-sql-queries/split-strings
-- ===============================... |
drop database version99;
## base de donnee ::
create database version99 default character set utf8 collate utf8_general_ci;
use version99;
#End.
#------------------------------------------------------------
# Table: Encadrant
#------------------------------------------------------------
CREATE TABLE Encadrant(
... |
DROP TABLE IF EXISTS index_tx;
CREATE TABLE index_tx (
tx_index INTEGER UNSIGNED NOT NULL,
block_index INTEGER,
tx_hash_id INTEGER UNSIGNED NOT NULL,
type_id INTEGER UNSIGNED NOT NULL -- id of record in index_tx_types table
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE UNIQUE IND... |
<reponame>mennooo/sqlcl
create or replace package versioncontrol_pkg as
/****************************************************************************
* This package contains a few functions to check version numbers of database objects
*
*
v1.00 04-05-2017 MHO creation
***********************************************... |
# growthCondition.sql was originally generated by the autoSql program, which also
# generated growthCondition.c and growthCondition.h. This creates the database representation of
# an object which can be loaded and saved from RAM in a fairly
# automatic way.
#Conditions under which cells are grown
CREATE TABLE grow... |
INSERT INTO `person` (`id`, `address`, `first_name`, `gender`, `last_name`) VALUES
(1, '<NAME>', 'Toly', 'Male', 'tomado'),
(2, '<NAME>', 'Naio', 'Male', 'Caim'),
(7, 'Rua', 'Bili', 'Male', 'Flinston'); |
CREATE OR REPLACE PACKAGE BODY test_plscope_identifiers IS
PROCEDURE user_identifiers IS
l_actual sys_refcursor;
l_expected sys_refcursor;
BEGIN
-- populate actual
OPEN l_actual for
SELECT object_type, object_name, line, col, name, type, usage,
signature, usag... |
CREATE TABLE item
(
id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(64),
author VARCHAR(64),
unit_price NUMBER,
release DATE,
image VARCHAR(512)
);
|
<gh_stars>1-10
/*
Warnings:
- A unique constraint covering the columns `[companyName,href]` on the table `Job` will be added. If there are existing duplicate values, this will fail.
- Added the required column `href` to the `Job` table without a default value. This is not possible if the table is not empty.
*/
... |
drop table Event_Sequence_Event_List;
drop trigger Event_Sequence_Trigger;
drop sequence Event_Sequence_Sequence;
drop table Event_Sequence;
drop sequence Paleo_Event_Sequence;
drop trigger Paleo_Event_Trigger;
drop table Paleo_Event_References;
drop table Paleo_Event;
drop table Combined_Events_References;
drop sequen... |
-- Deploy smart_delete
BEGIN;
CREATE OR REPLACE FUNCTION mark_deleted(id file_data.data_id%TYPE)
RETURNS file_data.tombstoned_at%TYPE
AS $$
DECLARE
my_tombstone file_data.tombstoned_at%TYPE;
BEGIN
SELECT (now() at time zone 'utc') INTO my_tombstone;
UPDATE file_data SET tombstoned_at = my_tombstone WHERE dat... |
do $$declare
v_reward_id numeric;
begin
SELECT static.reward_insert('test4') into v_reward_id;
raise notice 'reward_id %',v_reward_id;
perform static.reward_delete('test4');
SELECT static.reward_insert('test4') into v_reward_id;
raise notice 'reward_id %',v_reward_id;
end$$;
|
-- creating admin
INSERT INTO user VALUES('1', 'admin', '$2y$10$NpW4tA8NVA68HDXO.p.lFutTbfD1G5Lw9GeR0S3sBuAY3TQ9t4FUO', 'Admin', 'Admin', 'it', null, '<EMAIL>', '1' ,'0');
-- adding all the permission to admin
INSERT INTO permission VALUES('1', '1', '1', '1', '1'); |
set cstore_insert_mode=main;
-- precision 18
drop table if exists t1, t2, t3, t4, t5;
create table t1(c1 dec(18,1), c2 dec(18,5), c3 dec(18,9), c4 dec(18,13)) tablespace hdfs_ts;
insert into t1 values( 99999999999999999.9, 9999999999999.99999, 999999999.999999999, 99999.9999999999999);
insert into t1 values( 9000... |
.mode columns
.headers on
.nullvalue NULL
-- How many health professionals and how much money (spent on health
-- professionals’ salaries) are every head of Unit responsible for?
SELECT head, Unit.name AS unitName, Unit.hospital AS hospitalName, SUM(baseSalary+extraSalary) AS totalPaid, COUNT(*) AS numberOfHealthPro... |
-- View tweets
SELECT
TOP 100 *
FROM
OPENROWSET(
BULK 'https://your-storage-account.dfs.core.windows.net/your-filesystem/tweetdata/*/*/*/*/*.parquet',
FORMAT='PARQUET'
) AS [result]
;
-- Total rows
SELECT COUNT(*) total_rows FROM
OPENROWSET(
BULK 'https://your-storage-account.df... |
<filename>proweb10a(Backup Database untuk pertemuan 6-7).sql
/*
SQLyog Ultimate v12.4.1 (64 bit)
MySQL - 5.5.32 : Database - proweb10a
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CH... |
<filename>account_data.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 27, 2021 at 02:46 PM
-- Server version: 5.7.24
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zo... |
CREATE FUNCTION New_Doc(DocTypeCode text, HospitalCode text, DocName text, UnitType text)
RETURNS integer
LANGUAGE sql
SET search_path TO ccms, public
AS $$
INSERT INTO Docs (DocTypeID, HospitalID, DocName, UnitTypeID) VALUES (DocType(DocTypeCode), Hospital(HospitalCode), DocName, UnitType(UnitType)) RETURNING DocID
$$... |
<reponame>EL-BID/nexso<filename>VS2013_PROJECT/DNN_DB/dbo/Stored Procedures/dnn_CoreMessaging_CheckReplyHasRecipients.sql<gh_stars>1-10
CREATE PROCEDURE [dbo].[dnn_CoreMessaging_CheckReplyHasRecipients]
@ConversationId Int, -- Not Null
@UserId Int -- Not Null
AS
BEGIN
SELECT COUNT(M.UserID)
FROM dbo.dnn_... |
SELECT * FROM `no_now` WHERE ID_Inst = ?;
|
DROP TABLE IF EXISTS country;
DROP TABLE IF EXISTS featured_songs;
DROP TABLE IF EXISTS song;
CREATE TABLE country (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
iso_code VARCHAR(2),
music_provider_id TEXT
);
CREATE TABLE featured_songs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
date TEXT,
... |
USE demo
EXEC sp_rename 'Person.PhoneNumber', 'NumberOfChildren', 'COLUMN'; |
<reponame>kineticadb/community-vaccines<filename>schemas/load_supply.sql
CREATE OR REPLACE MATERIALIZED EXTERNAL TABLE "DEMO_Vaccine_Distro"."vaccine_utilization_usa"
(
"State_Territory_Federal_Entity" VARCHAR (32),
"Total_Doses_Delivered" INTEGER,
"Doses_Delivered_per_100K" INTEGER,
"18plus_Doses_Delivered... |
<reponame>NowinskiK/ssdt-training
CREATE USER [UserWithPassword1]
WITH PASSWORD = <PASSWORD>'
GO
GRANT CONNECT TO [UserWithPassword1]
/*
Msg 33233, Level 16, State 1, Line 47
You can only create a user with a password in a contained database.
https://docs.microsoft.com/en-us/sql/relational-databases/databases/conta... |
CREATE TABLE `cart`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`product_id` int(11) DEFAULT NULL COMMENT '商品id',
`quantity` int(11) DEFAULT NULL COMMENT '数量',
`checked` int(11) DEFAULT NULL COMMENT '是否选择,1=已勾选,0=未勾选',
`create_time` datetime DEFAUL... |
ALTER TABLE methods ADD COLUMN typical_purposes text[] DEFAULT '{}';
|
<filename>DGMigrator/sql/renameTables.sql
IF EXISTS (SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[stagingDistributionGroupMember]') AND type in (N'U'))
EXEC sp_rename N'[dbo].[stagingDistributionGroupMember]','stagingDistributionGroupRole';
IF EXISTS (SELECT *
FROM sys.objects
WHERE object_id =... |
<gh_stars>1-10
/*
Total Order Per Status Per Service
https://platform.stratascratch.com/coding/2049-total-order-per-status-per-service?python=
Difficulty: Easy
Uber is interested in identifying gaps in their business. Calculate the count of orders for each status of each service. Your output should include the servi... |
DROP DATABASE IF EXISTS employeeTracker_db;
-- Create
CREATE DATABASE employeeTracker_db;
-- Use
USE employeeTracker_db;
-- Create Dept Table
CREATE TABLE department (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(50) NOT NULL,
PRIMARY KEY (id)
);
-- Create Role Table
CREATE TABLE roles (
id INT NOT N... |
DROP TABLE IF EXISTS auth; |
-- $Id$
-- Test queries for charReplace UDF
set schema 'udftest';
set path 'udftest';
values applib.char_replace('AA AA AA AA', 'A', 'B');
values applib.char_replace('bb bb bb bb', 'b', 'A');
values applib.char_replace('111111', 49, 51);
values applib.char_replace('//////', 47, 42);
values applib.char_replace('******... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
CREATE OR REPLACE VIEW analytics.StudentLocalEduc... |
ALTER TABLE "deployed_process_versions" RENAME TO "process_deployment_info";
ALTER TABLE "process_deployment_info" ADD "deployment_action" VARCHAR(256);
UPDATE "process_deployment_info" set "deployment_action" = 'DEPLOY';
ALTER TABLE "process_deployment_info" ALTER COLUMN "deployment_action" set not null;
ALTER TAB... |
<filename>pgauditlogtofile--1.2--1.3.sql<gh_stars>1-10
/* pgauditlogtofile/pgauditlogtofile--1.2--1.3.sql */
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
\echo Use "ALTER EXTENSION pgauditlogtofile UPDATE TO '1.3'" to load this file. \quit
|
seed_user=insert into users (login,id,password) values ('<PASSWORD>',1,'<PASSWORD>') |
-- CreateTable
CREATE TABLE "SubjectsOnCourses" (
"courseId" INTEGER NOT NULL,
"subjectId" INTEGER NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY ("courseId","subjectId")
);
-- AddForeignKey
ALTER TABLE "SubjectsOnCourses" ADD FOREIGN KEY ("courseId") REFERENCES "Co... |
--declare @ID_Table nvarchar(255) = 'EM_EmployeeWork'
--declare @Name nvarchar(255) = 'EM_EmployeeWork_NEW'
--declare @Command nvarchar(255) = 'CREATE'
--declare @CreateCommand bit = 0
----------
-- synchronizace kodu se SF: 28.7.2014
-- upraveno: 28.5.2015
declare @SQL varchar(max)
declare @IsVCID bit
-- informace o... |
CREATE TABLE public.all_town_point
(
town_pid character varying(15),
town_class character varying(1),
town_name character varying(50),
state_pid character varying(15),
state character varying(3),
lat numeric,
long numeric
)
WITH (
OIDS=FALSE
);
insert into all_town_point (town_pid, town_class, town_nam... |
-- MySQL dump 10.16 Distrib 10.1.32-MariaDB, for Win32 (AMD64)
--
-- Host: localhost Database: odms2
-- ------------------------------------------------------
-- Server version 10.1.32-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
select * from cinema where mod(id,2) = 1 and description != 'boring' order by rating desc |
/*DDL são comandos de definição "Data Definition Language": create database, create table... Defini um banco, defini uma tabela...*/
/*DML são comandos de manipulaçãp "Data Manipulation Language": insert into... Inseriu/manipulou dados...*/
create database cadastro
default character set utf8
default collate utf8_gener... |
<gh_stars>0
DROP MATERIALIZED VIEW IF EXISTS facilities_excel_export;
create materialized view facilities_excel_export as
SELECT facilities_facility.id,
facilities_facility.search,
facilities_facility.name,
facilities_facility.official_name AS officialnam... |
INSERT INTO `Setting` (`name`, `value`) VALUES
('default_url', ''),
('todo_pricing', 'yes'),
('todo_invoice', 'yes'),
('todo_email', 'yes'),
('todo_emailnotification', 'yes'),
('todo_googleads', 'yes'),
('todo_googlemaps', 'yes'),
('todo_googleanalytics', 'yes'),
('todo_headerlogo', 'yes'),
('todo_noimage', 'yes'),
('t... |
USE [master]
GO
CREATE DATABASE [DTP_KARD] ON PRIMARY
( NAME = N'DTP_KARD', FILENAME = N'F:\DTP_KARD.mdf' , SIZE = 3072KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'DTP_KARD_log', FILENAME = N'F:\DTP_KARD_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [DTP_KA... |
<reponame>huyinghuan/oauth<gh_stars>0
ALTER TABLE `open-auth`.`application`
ADD COLUMN `open` TINYINT NOT NULL DEFAULT 0 COMMENT '是否公开该应用到用户的可用应用列表' AFTER `mode`;
ADD COLUMN `icon` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '应用图标' AFTER `open`,
ADD COLUMN `home_page` VARCHAR(1000) NOT NULL DEFAULT '' COMMENT '应用首页' AFTE... |
<filename>fixtures/basic_expected/postgresql/postgresql_load.sql
\copy "main" from 'csv/main.csv' with CSV HEADER
\copy "developer" from 'csv/developer.csv' with CSV HEADER
\copy "platforms" from 'csv/platforms.csv' with CSV HEADER
|
<reponame>sumonhosen/restuarant
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 22, 2021 at 04:29 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
/*********************************************************************************************************************
**
** Procedure Name : h3giBackupTopUpLocations
** Author : <NAME>
** Date Created : 06/07/2006
**
****************************************************************... |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.3.11_腾讯云
Source Server Version : 50715
Source Host : 192.168.3.11:3306
Source Database : exam
Target Server Type : MYSQL
Target Server Version : 50715
File Encoding : 65001
Date: 2020-10-11 21:45:34
*/
SET FOREIGN_KEY_CHECKS=0... |
<reponame>latonaio/sap-outbound-delivery-sql
CREATE TABLE `sap_outbound_delivery_header_partner_data`
(
`SDDocument` varchar(10) NOT NULL,
`PartnerFunction` varchar(2) DEFAULT NULL,
`Customer` varchar(10) DEFAULT NULL,
`AddressID` varchar(10) DEFAULT NUL... |
/*
EXEC [admindb].dbo.[translate_memory_counters]
@SourceTable = N'FISSQL3_Consolidated',
@TargetTable = N'FISSQL3_Memory',
@OverwriteTarget = 1,
@PrintOnly = 0;
*/
USE [admindb];
GO
IF OBJECT_ID('dbo.translate_memory_counters','P') IS NOT NULL
DROP PROC dbo.[translate_memory_counters];
G... |
<reponame>DanielleM565/data-design
DROP TABLE IF EXISTS favorite;
DROP TABLE IF EXISTS product;
DROP TABLE IF EXISTS profile;
CREATE TABLE profile (
profileId INT UNSIGNED AUTO_INCREMENT NOT NULL,
profileEmail VARCHAR(128) UNIQUE NOT NULL,
profileActivationToken CHAR(32),
profileAtHandle VARCHAR(32) NOT NULL,
profileH... |
<filename>Database/buildRegisterRule.sql
USE dashboards;
DROP PROCEDURE IF EXISTS buildRegisterRule;
DELIMITER //
CREATE PROCEDURE buildRegisterRule(
IN p_query_id INT,
IN p_matching VARCHAR(600),
IN p_queryExpression VARCHAR(5000),
IN p_ruleTab VARCHAR(64)
)
BEGIN
DECLARE EXIT HANDLER ... |
---------------------------------------------------------------------
-- LAB 12
--
-- Exercise 2
---------------------------------------------------------------------
USE TSQL;
GO
---------------------------------------------------------------------
-- Task 1
--
-- Write a SELECT statement to retrieve the productid ... |
-- { echo }
explain syntax select negate(1), negate(-1), - -1, -(-1), (-1) in (-1);
explain syntax select negate(1.), negate(-1.), - -1., -(-1.), (-1.) in (-1.);
explain syntax select negate(-9223372036854775808), -(-9223372036854775808), - -9223372036854775808;
|
INSERT INTO persediaan (id_transaksi, id_barang, jumlah, harga) VALUES (89249,2525,5,0);
INSERT INTO persediaan (id_transaksi, id_barang, jumlah, harga) VALUES (89249,650,5,0);
INSERT INTO persediaan (id_transaksi, id_barang, jumlah, harga) VALUES (89249,13329,5,0);
INSERT INTO persediaan (id_transaksi, id_barang, juml... |
INSERT INTO "system"."Configuration"("key", "value", "updated_at", "created_at") VALUES (E'ALLOW_EMAILS_TO_DOMAINS', '["*"]', E'2021-07-31T23:32:29.336113+00:00', E'2021-07-31T23:32:29.336113+00:00');
|
CREATE TABLE JAVA_TIME (
DATE_COLUMN DATE,
TIME_COLUMN TIME,
TIMESTAMP_COLUMN TIMESTAMP
-- TIME_WITH_TIMEZONE_COLUMN TIME WITH TIMEZONE NOT NULL,
-- TIMESTAMP_WITH_TIMEZONE_COLUMN TIMESTAMP WITH TIMEZONE NOT NULL
); |
-- Your SQL goes here
CREATE TABLE user_groups (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL,
group_id UUID NOT NULL,
permission_id UUID NOT NULL,
created_at TIMESTAMP NOT NULL,
deleted_at TIMESTAMP
); |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 30, 2018 at 04:57 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
-- ***************************************************************************
-- File: 5_44.sql
--
-- Developed By TUSC
--
-- Disclaimer: Neither Osborne/McGraw-Hill, TUSC, nor the author warrant
-- that this source code is error-free. If any errors are
-- found in this source code, please repo... |
<reponame>oztasoi/bachelor-projects
create table album_artist_relation
(
id int auto_increment
primary key,
album_id int not null,
artist_id int not null
);
INSERT INTO DBtify.album_artist_relation (id, album_id, artist_id) VALUES (1, 14, 3);
INSERT INTO DBtify.album_artist_relation (id, al... |
use SQLWATCH;
CREATE SCHEMA [bkp] AUTHORIZATION [dbo];
CREATE SCHEMA [dbg] AUTHORIZATION [dbo];
select *
--into bkp.sqlwatch_config_action
from dbo.sqlwatch_config_action;
select *
from [dbo].[sqlwatch_meta_action_queue];
/*
update ca
set action_exec = 'exec msdb.dbo.sp_send_dbmail @recipients = ''<EMAIL>'', @subj... |
<filename>server/experimental/src/parser/test/test-parser.sql
select a1 from a;
select a1 + a2 from b;
select (a1 + b3) * x3 from q, z where q.a1 > z.b3 and a.a1 + b.x3 < 10;
select a1 + a2
from x, y
where x.a1 < y.a2;
select 10 + a1 from x where 10 > a2;
select b1 from a,b,c,c c1 where b.b2 = a.a2;
select b1 from a,b,... |
SELECT c.Name, COUNT(CityId) AS Hotels
FROM Hotels AS h
JOIN Cities AS c ON h.CityId = c.Id
GROUP BY c.Name
ORDER BY Hotels DESC, c.Name
|
-- IFS-3998 Insert scheduled job for DOI expiry.
insert into schedule_status (job_name, version) VALUES ('ASSESSOR_DOI_EXPIRY', now()); |
CREATE TABLE ENDERECO (
ID INT NOT NULL PRIMARY KEY,
ESTADO VARCHAR(120) NOT NULL,
CIDADE VARCHAR(120) NOT NULL,
BAIRRO VARCHAR(120) NOT NULL,
RUA VARCHAR(120) NOT NULL,
NUMERO_RUA VARCHAR(120) NOT NULL,
CEP VARCHAR(20) NOT NULL,
COMPLEMENTO VARCHAR(20),
DATA_CADASTRO TIMESTAMP NOT NULL... |
DROP DATABASE IF EXISTS PACKT_ONLINE_SHOP;
CREATE DATABASE IF NOT EXISTS PACKT_ONLINE_SHOP;
USE PACKT_ONLINE_SHOP;
CREATE TABLE Customers
(
CustomerID INT NOT NULL AUTO_INCREMENT,
FirstName CHAR(50) NULL,
MiddleName CHAR(50) NULL,
LastName CHAR(50) NULL,
Address CHAR(250) NULL,
Email CHAR(200) NULL,
P... |
WITH foo AS (
SELECT
*,
rank() OVER (PARTITION BY year,
state
ORDER BY candidate_votes DESC) AS rank
FROM
{{ ref('stg_us_senate_election_results') }}
),
foo2 AS (
SELECT
*,
rank = 1 AS winner
FROM
foo
)
select
year,
party,
count(*) as seats
from foo2
where winner = True
group by year, party
|
-- Create the schema that we'll use to populate data and watch the effect in the binlog
CREATE SCHEMA banking;
SET search_path TO banking;
-- enable PostGis
CREATE EXTENSION postgis;
-- Create and populate our products using a single insert with many rows
CREATE TABLE accounts (
id SERIAL NOT NULL PRIMARY KEY,
b... |
CREATE TABLE attachment (
resource_id INTEGER NOT NULL,
media_id INTEGER NOT NULL,
FOREIGN KEY(resource_id) REFERENCES resource(id)
ON UPDATE CASCADE
ON DELETE CASCADE,
FOREIGN KEY(media_id) REFERENCES media(id)
ON UPDATE CASCADE
ON DELETE CASCADE,
PRIMARY KEY(resource_id, media_id)
);
|
<gh_stars>1-10
drop database if exists near;
create database near;
use near;
-- the replication_meta table contains one row per range of blocks replicated to
-- this database. The block_height field refers to the highest block_height in
-- the range of replicated blocks.
CREATE TABLE replication_meta (
block_heig... |
{% macro get_new_alerts(days_back, results_sample_limit = 5) %}
-- depends_on: {{ ref('alerts') }}
{% set select_new_alerts_query %}
SELECT alert_id, model_unique_id, test_unique_id, detected_at, database_name, schema_name, table_name, column_name, alert_type, sub_type,
alert_description,... |
<filename>software/cabio-database/scripts/sql_loader/no_longer_used/indexes/zstg_rna_probesets.cols.sql
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
create index ZSTG_RNASETS_ANNOTATION on ZSTG_RNA_PROBESETS(A... |
INSERT INTO dbo.Disease
([Code], [Name], [Description], [Overview])
VALUES
( N'Q1416773', N'granuloma inguinale', N'sexually transmitted bacterial disease', N''),
( N'Q1417240', N'benign neoplasm', N'disease of cellular proliferation that results in abnormal growths in the body which lack the ability to metastasize', N... |
-- add indexes to speed up queries
CREATE INDEX events_url_index ON events (url);
CREATE INDEX events_extra_event_id ON events_extra (event_id);
PRAGMA user_version = 4; |
drop table if exists `barbecue`.`plans`;
create table `barbecue`.`plans` (
`id` bigint unsigned AUTO_INCREMENT NOT NULL PRIMARY KEY,
`userId` varchar(64) NOT NULL,
`name` varchar(128) NOT NULL,
`meatId` bigint unsigned NOT NULL,
`private` tinyint NOT NULL,
`created` datetime DEFAULT CURRENT_TIMESTAMP,
... |
ALTER TABLE [Admin].[Route]
ADD CONSTRAINT [FK_Route_ArrivalId]
FOREIGN KEY (ArrivalId)
REFERENCES [Admin].[Destination] (Id) |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 12, 2018 at 11:10 PM
-- Server version: 5.7.21-0ubuntu0.16.04.1
-- PHP Version: 7.2.1-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!401... |
# --- !Ups
CREATE EXTENSION IF NOT EXISTS hstore;
CREATE TABLE "persons" (
"id" BIGSERIAL PRIMARY KEY,
"name" VARCHAR NOT NULL,
"age" INT NOT NULL
);
CREATE TABLE "users" (
"id" UUID PRIMARY KEY,
"username" VARCHAR NOT NULL,
"email" VARCHAR NOT NULL UNIQUE,
"role" VARCHAR NOT NULL, -- could implement a... |
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.7.16-log
/*!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 ... |
-- Table: engangsbelopgrunnlag
-- DROP TABLE engangsbelopgrunnlag;
CREATE TABLE IF NOT EXISTS engangsbelopgrunnlag
(
engangsbelop_id integer NOT NULL,
grunnlag_id integer NOT NULL,
CONSTRAINT engangsbelopgrunnlag_pkey PRIMARY KEY (engangsbelop_id, grunnlag_id),
CONSTRAINT engangsbelopgrunnlag_id_fk FO... |
<reponame>dram/metasfresh
-- 2021-06-30T14:52:54.266Z
-- URL zum Konzept
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsNotifyUserAfterExecution,IsOneI... |
<gh_stars>1-10
DELETE FROM spell_proc_event WHERE entry IN (31571, 31572);
INSERT INTO spell_proc_event VALUES
(31571, 0x00, 3, 0x00000000, 0x00000000, 0x00000008, 0x00004000, 0x00000000, 0.000000, 0.000000, 0);
|
START TRANSACTION;
INSERT INTO `plugin_base_fields` VALUES (NULL, 'menuExport', 'backend', 'Menu Export', 'script', '2018-09-19 07:20:53');
SET @id := (SELECT LAST_INSERT_ID());
INSERT INTO `plugin_base_multi_lang` VALUES (NULL, @id, 'pjBaseField', '::LOCALE::', 'title', 'Export', 'script');
COMMIT; |
<reponame>nfmoore/Azure-Analytics-and-AI-Engagement
/* **DISCLAIMER**
By accessing this code, you acknowledge the code is made available for presentation and demonstration purposes only and that the code: (1) is not subject to SOC 1 and SOC 2 compliance audits; (2) is not designed or intended to be a substitute for the... |
# Write your MySQL query statement below
select email from Person p group by email having sum(1) >1;
|
<filename>src/resources/ComandoSql.sql
CREATE DATABASE PRODUTOBD;
CREATE TABLE PRODUTOBD.PRODUTO (
ID BIGINT NOT NULL AUTO_INCREMENT,
NOME VARCHAR(100) NOT NULL,
DESCRICAO VARCHAR(1000) NULL,
PRECO_COMPRA DECIMAL(9,2) NOT NULL,
PRECO_VENDA DECIMAL(9,2) NOT NULL,
QUANTIDADE ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.