sql stringlengths 6 1.05M |
|---|
-- script: OmsInternal/install-version-operation.sql
-- Проверяет возможность выполнения либо сохраняет информацию о действии по
-- установке модуля.
-- При этом вызываются соответствующие функции пакета pkg_ModuleInstall (модуль
-- Oracle/Module/ModuleInfo, checkInstallVersion для проверки,
-- createInstallResult... |
<reponame>schwarrior/schwarriors-code-toolbox
use SampleDb;
go
sp_changedbowner 'Domain\User'
--sp_changedbowner 'sa'
go |
<gh_stars>0
create table Review (id identity,
movieTitle varchar not null,
author varchar not null,
text varchar not null,
netflixId varchar not null,
submitted timestamp not null,
primary key (id),
foreign key (author) references Account(username));
|
<reponame>paullewallencom/oracle-jdeveloper-978-1-8496-8476-7
CREATE OR REPLACE PACKAGE test_pkg
AS
/******************************************************************************
NAME: TEST_PKG
PURPOSE:
REVISIONS:
Ver Date Author Description
--------- -------... |
<gh_stars>1-10
/****** Object: View [dbo].[V_Sample_Submission_Detail_Report] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Sample_Submission_Detail_Report]
AS
SELECT SS.ID,
C.Campaign_Num AS Campaign,
U.Name_with_PRN AS [Received By],
SS.Description,
... |
select
-- Required Columns
account_id as resource,
case
when mfa = 'NONE' then 'alarm'
else 'ok'
end as status,
case
when mfa = 'NONE' then 'MFA not enabled for all users in account.'
else 'MFA enabled for all users in account.'
end as reason,
-- Additional Dimensions
account_id
from
i... |
<reponame>goldmansachs/obevo-kata
CREATE FUNCTION func545() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE359);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE271);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE34... |
<filename>openGaussBase/testcase/KEYWORDS/like/Opengauss_Function_Keyword_Like_Case0029.sql
-- @testpoint: openGauss保留关键字like作为作为表空间名,合理报错
--不带引号,合理报错
drop tablespace if exists like;
CREATE TABLESPACE like RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
--加双引号,创建成功
drop tablespace if exists "like";
CREATE TABLE... |
CREATE VIEW `E304` AS
SELECT DATE_FORMAT(
MAKEDATE(
YEAR(
NOW()
),
jour_in
),
'%d/%m'
)
AS date,
niv_lib AS 'niveau',
COUNT(*) AS 'affluence'
FROM NIVEAU, ENTREE
WHERE ENTREE.niv_id = NIVEAU... |
<reponame>joshuanatan/leiter-crm<filename>queries/view_transaction_oc.sql
create view transaction_oc as
select
no_invoice as no_refrence,
'CUSTOMER' as peruntukan_tagihan,
id_refrensi as id_submit_invoice, /*id submit invoice*/
id_pembayaran,
subject_pembayaran,
tgl_bayar,
pembayaran_customer.attachment as attachment... |
<filename>db.sql
-- --------------------------------------------------------
-- Host: localhost
-- Server versie: 5.7.24 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Versie: 10.2.0.5599
-- ------------------------------------------... |
CREATE PROCEDURE [dbo].[SelectLocationsByParent] @parentLocation int
AS
BEGIN
select LocationName, id,contactId
from Location
where ParentLocation=@parentLocation
and LocationType>'A'
END |
EXEC [EST].[Proc_yjbb_Ins] @Code = N'600900',@CutoffDate = N'2017-03-31',@EPS = N'0.1231',@EPSDeduct = N'0',@Revenue = N'78.55亿',@RevenueYoy = N'0.26',@RevenueQoq = N'-32.80',@Profit = N'27.08亿',@ProfitYoy = N'23.48',@ProfiltQoq = N'-39.04',@NAVPerUnit = N'5.9640',@ROE = N'2.09',@CashPerUnit = N'0.2607',@GrossProfitRat... |
INSERT INTO professor (matricula_professor, data_admissao, matricula_pessoa) VALUES
(0, '2014-06-03', 22),
(1, '2014-01-14', 19),
(2, '1975-09-28', 5),
(3, '1980-12-14', 48),
(4, '2018-07-11', 45),
(5, '2002-02-24', 14),
(6, '2013-05-30', 171),
(7, '1980-06-05', 41),
(8, '1996-07-28', 49),
(9, '2001-08-29', 10),
(10, ... |
<reponame>mobius29/COSE371<gh_stars>0
DROP TABLE categories;
CREATE TABLE categories (
id SERIAL PRIMARY KEY,
category_name VARCHAR(20) NOT NULL UNIQUE,
info TEXT NOT NULL,
user_id INT NOT NULL REFERENCES users(id) ON DELETE CASCADE
); |
-- MySQL dump 10.16 Distrib 10.2.9-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: inspina
-- ------------------------------------------------------
-- Server version 10.2.9-MariaDB-10.2.9+maria~jessie
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARAC... |
CREATE VIEW [App].[View-Stage]
AS
SELECT x.[StageId]
,x.[Stage]
,x.[OrderNumber]
FROM [AppDbo].[Stage] x;
|
<gh_stars>0
SELECT CAST('{}' AS TEXT ARRAY);
SELECT CAST('{}' AS TEXT ARRAY[2]);
SELECT CAST('{}' AS TEXT[]);
SELECT CAST('{}' AS TEXT[3][4][]);
|
<filename>docker-entrypoint-initdb.d/school_metric_data.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.5 (Debian 10.5-2.pgdg90+1)
-- Dumped by pg_dump version 11.5 (Ubuntu 11.5-1.pgdg18.04+1)
-- Started on 2019-08-14 17:08:11 IST
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_... |
INSERT INTO table2tags (
table_id,
tag_id,
table_name)
VALUES
(
table_id,
tag_id,
'table_name' /* trail, park, destination */
); |
SELECT MIN(sal)
FROM emp
; |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: user_service_db
-- Generation Time: Feb 25, 2022 at 04:29 AM
-- Server version: 8.0.27
-- PHP Version: 7.4.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
{%- set functionName = 'packageInfo' -%}
IF OBJECT_ID('[{{schemaName}}].[{{functionName}}]', 'FN') IS NOT NULL DROP FUNCTION [{{schemaName}}].[{{functionName}}]
GO
CREATE FUNCTION [{{schemaName}}].[{{functionName}}] () RETURNS nvarchar(max) AS
BEGIN
DECLARE @result nvarchar(max) = N'{}'
DECLARE @package nvarchar(m... |
<gh_stars>0
create table test (id int, text0 varchar(255), text1 varchar(255), flag tinyint(1), point int, inserted_at datetime, created_at datetime, updated_at datetime) CHARSET=utf8mb4;
|
ALTER TABLE ATRIBUTO_VALOR
ADD CONSTRAINT ESPRANGO
FOREIGN KEY (ATRIBUTO)
REFERENCES ATRIBUTO
ON DELETE CASCADE
go
ALTER TABLE AUDITORIA_DE_PROC
ADD CONSTRAINT AUDPUSR
FOREIGN KEY (USUARIO)
... |
<reponame>Foxpips/LayeredArchitecture<filename>Miscellaneous/StoredProcedures/Backup_2015 March 24/h3giDeleteLock.sql
/****** Object: Stored Procedure dbo.h3giDeleteLock Script Date: 23/06/2005 13:35:10 ******/
/***********************************************************************************************... |
/*
Navicat Premium Data Transfer
Source Server : homestead
Source Server Type : MySQL
Source Server Version : 50722
Source Host : 192.168.10.10:3306
Source Schema : mq
Target Server Type : MySQL
Target Server Version : 50722
File Encoding : 65001
Date: 21/09/2018 01:... |
<reponame>Seifayachi001/PayScale-API
CREATE TABLE users (
is SERIAL NOT NULL PRIMARY KEY,
first_name TEXT NOT NULL,
last_name TEXT NOT NULL,
email TEXT NOT NULL,
created_at TIMESTAMP NOT NULL,
); |
<reponame>aszego/WhatTheHack
--Database script to turn on/off Result Set caching
--Run script on master database
--Performance results will improve after the data is cached on the second execution of the report.
--Record response times in Performance Analyzer in Power BI report since it will be simple to rerun and capt... |
// library MATGlobalCommonFunctions version '0.0.999'
library MATGlobalCommonFunctions version '1.0.000' // this best lib ever
/*
using QDM version '5.2'
*/
// using QDM version '5.2'
using QDM version '5.4' // I like five four
include MATGlobalCommonFunctions version '4.0.000' called Global
include SupplementalDat... |
<reponame>rorygibson/OpenACalendar-Web-Core
CREATE TABLE import_url_information (
id SERIAL NOT NULL,
site_id INTEGER NOT NULL,
slug INTEGER NOT NULL,
group_id INTEGER NULL,
title VARCHAR(255),
url VARCHAR(255),
enabled boolean default '1' NOT NULL,
expired_at timestamp without time zone NULL,
created_at time... |
use project;
drop table if exists userregs;
use project;
drop table if exists userregs;
create table userregs(
id int(10) primary key auto_increment,
first_name varchar(50),
last_name varchar(50),
organization varchar(50),
street varchar(30),
city varchar(30),
email varchar(50),
phone varchar(15),
pas... |
<gh_stars>0
-- Cria Esquema
DROP SCHEMA IF EXISTS scm CASCADE;
CREATE SCHEMA scm;
SET search_path TO scm;
-- Domínios
-- -- Tipo de Pessoa
CREATE DOMAIN tipo_pes as CHAR(1)
CHECK (VALUE IN ('P', 'M'));
-- Tabelas
CREATE TABLE equipe (
idequ SERIAL PRIMARY KEY,
nomeequ TEXT UNIQUE NOT NULL,
paisequ TEX... |
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 11, 2016 at 01:26 PM
-- Server version: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
DECLARE @BudgetLineID int = 75;
DECLARE @BudgetCategoryID int = 8;
DECLARE @BudgetLineName varchar(255) = 'Wish List';
DECLARE @BankAccountID int = 1;
DECLARE @IsAccrued bit = 0;
BEGIN TRANSACTION
SET IDENTITY_INSERT dbo.BudgetLines ON;
INSERT INTO dbo.BudgetLines(BudgetLineId, BudgetCategoryId, BudgetLineName,
Bu... |
<reponame>nacosseruib/shop-online<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jan 28, 2021 at 11:17 AM
-- Server version: 8.0.21
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00"... |
<gh_stars>0
CREATE PROCEDURE [dbo].[Students_Insert]
@FirstName NVARCHAR(50),
@MiddleName NVARCHAR(10) = NULL,
@LastName NVARCHAR(50),
@DOB DATE,
@ModifiedBy NVARCHAR(128),
@Id INT OUTPUT
AS
/*
DECLARE
@_id INT,
@_firstName NVARCHAR(50) = 'Test01',
@_middleName NVARCHAR(50) = 'T',
@_lastName NVARCHAR(50) = ... |
-
-- CREATE FUNCTION string_generator(int DEFAULT 20,int DEFAULT 10) RETURNS text AS $FUNCTION$
-- SELECT array_to_string( array_agg(
-- substring(md5(random()::text),1,$1)||chr( 9824 + (random()*10)::int )
-- ), ' ' ) as s
-- FROM generate_series(1, $2) i(x);
-- $FUNCTION$ LANGUAGE SQL IMMUTABLE;
... |
-- MySQL dump 10.13 Distrib 5.6.23, for Win64 (x86_64)
--
-- Host: errorage.com Database: errorage_ZaznajSpoznaj
-- ------------------------------------------------------
-- Server version 5.1.59-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACT... |
<reponame>quake0day/Dodrio
drop table if exists entries;
create table entries (
id integer primary key autoincrement,
type integer not null,
title text not null,
author text not null,
confname text not null,
urlpaper text,
urlslides text,
urlcite text,
cite integer not null,
place integer not null,
... |
<gh_stars>1-10
--
-- Table structure for table `events`
--
CREATE TABLE IF NOT EXISTS `events` (
`id` int(1) NOT NULL AUTO_INCREMENT,
`starts_on` date DEFAULT NULL,
`ends_on` date DEFAULT NULL,
`starts_at` datetime DEFAULT NULL,
`ends_at` datetime DEFAULT NULL,
`frequency` enum('once','daily','weekly','mon... |
<gh_stars>1-10
DROP DATABASE IF EXISTS techbolg_db;
CREATE DATABASE techbolg_db; |
/*[[Show ash cost for a specific SQL for multiple executions. usage: @@NAME {<sql_id|plan_hash_value> [sql_exec_id|PHV] [YYMMDDHH24MI] [YYMMDDHH24MI]} [-d|-g] [-o] [-all]
Options:
-o : Show top objects (defaults to show top events)
-d : Only query dba_hist_active_sess_history (defaults to query both... |
<reponame>tangxingchu/yidpu
CREATE DATABASE IF NOT EXISTS `weichu_youdianpu_db` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `weichu_youdianpu_db`;
-- MySQL dump 10.13 Distrib 5.7.17, for macos10.12 (x86_64)
--
-- Host: 127.0.0.1 Database: weichu_youdianpu_db
-- -----------------------------------------------------... |
<reponame>alexgalkin/odin
INSERT INTO odin.migration VALUES('opts/installation-id', '004-merge-account-function.blue.sql');
CREATE FUNCTION odin."merge_account_opts/installation-id"(merge_from TEXT, merge_to TEXT)
RETURNS VOID AS
$body$
BEGIN
END;
$body$
LANGUAGE plpgsql SECURITY DEFINER SET search_path = odin;
|
<gh_stars>0
select * from "GeoDiscoveries" where (category = '*' or category in (${category}))
and ("timeOfDay" = '*' or "timeOfDay" = ${timeOfDay})
and (season = '*' or season = ${season})
and (weather = '*' or weather = ${weather})
and (temp is null or temp = ${temp})
and (country is null or country = ${country})
and... |
ASSETS SQL 0;
ASSETS SQL 1;
ASSETS SQL 2;
|
create table sql_server_sample.test (
id integer not null identity (1, 1),
primary key (id)
) |
<filename>coral-trino/src/test/resources/product_test_cases_expected/var_popDistinct_expected.sql
select var_pop(distinct `c_bigint`), var_pop(distinct `c_double`)
from `datatype` |
-- Creates cartodb.cdb_analysis_catalog without installing the cartodb extension
CREATE SCHEMA IF NOT EXISTS cartodb;
drop table if exists cartodb.cdb_analysis_catalog;
create table cartodb.cdb_analysis_catalog (
-- useful for multi account deployments
username text,
-- md5 hex hash
node_id char(40) CON... |
<filename>SQL/Misc/AllSqlServersOnNetwork.sql
/* allow xp_cmdshell
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE
go
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE
go
*/
exEC master..XP_CMDShell 'OSQL -L'
|
/* contrib/xlogminer/xlogminer--1.0.sql */
CREATE OR REPLACE FUNCTION pg_minerwal(starttime text, endtime text, startxid int, endxid int, tempresult bool, reloid Oid)
RETURNS text AS
'MODULE_PATHNAME','pg_minerXlog'
LANGUAGE C CALLED ON NULL INPUT;
CREATE OR REPLACE FUNCTION walminer_temp_table_check()
RETURNS void A... |
<reponame>WalterCuadros/tecnimastercol
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 16-05-2020 a las 16:40:27
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START... |
SELECT TOP(1) AVG(Salary) AS [MinAverageSalary]
FROM Employees
GROUP BY DepartmentID
ORDER BY MinAverageSalary |
SELECT CONCAT(s.FirstName, ' ' + s.MiddleName, ' ', s.LastName) AS [Full Name]
FROM Students AS s
LEFT JOIN StudentsSubjects AS ss ON ss.StudentId = s.Id
WHERE ss.SubjectId IS NULL
ORDER BY [Full Name] |
insert into currency_exchange
(id, currency_from, currency_to, conversion_multiplier, environment)
values(1000,'USD','TRY',8.5,'');
insert into currency_exchange
(id, currency_from, currency_to, conversion_multiplier, environment)
values(1001,'EUR','TRY',10.5,'');
insert into currency_exchange
(id, currency_from, curre... |
<reponame>evc54/post-nuxt
-- -----------------------------------------------------------------------
-- authentication and authorization schema
-- -----------------------------------------------------------------------
CREATE SCHEMA auth;
--
-- schema access rules
--
GRANT USAGE ON SCHEMA auth TO anonymous;
GRANT USA... |
<filename>SSRS/RAM_Trends_percentage.sql
USE [DBA_Report_Code]
GO
/****** Object: StoredProcedure [dbo].[Usp_RAM_Trends] Script Date: 23/12/2019 14:01:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
alter procedure [dbo].[Usp_RAM_Trends_percentage]
(@Server varchar(100))
as
begin
declare @param1 varcha... |
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `fights_log`;
DROP TABLE IF EXISTS `fights`;
DROP TABLE IF EXISTS `characters`;
DROP TABLE IF EXISTS `monsters`;
DROP TABLE IF EXISTS `users`;
CREATE TABLE `characters` (
`id` int(11) ... |
<filename>db/dump_i2748386_wp1.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50617
Source Host : localhost:3306
Source Database : db_watch
Target Server Type : MYSQL
Target Server Version : 50617
File Encoding : 65001
Date: 2017-04-29 11:03:04... |
<gh_stars>0
DROP DATABASE IF EXISTS test_01083;
CREATE DATABASE test_01083;
USE test_01083;
CREATE TABLE file (n Int8) ENGINE = File(upper('tsv') || 'WithNames' || 'AndTypes');
CREATE TABLE buffer (n Int8) ENGINE = Buffer(currentDatabase(), file, 16, 10, 200, 10000, 1000000, 10000000, 1000000000);
CREATE TABLE merge (... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
DROP TABLE AR_ENTREZ_GENE CASCADE CONSTRAINTS PURGE
/
--
-- AR_ENTREZ_GENE (Table)
--
CREATE TABLE AR_ENTREZ_GENE ( PROBE_SET_ID VARCHAR2(100 BYTE) NOT NULL, ENTREZ_GEN... |
/*L
Copyright SAIC
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/cabio/LICENSE.txt for details.
L*/
DROP TABLE CONCEPT CASCADE CONSTRAINTS PURGE
/
--
-- CONCEPT (Table)
--
CREATE TABLE CONCEPT ( CONCEPT_ID NUMBER NOT NULL, CONCEPT_TYPE_ID NUMBER NOT NULL, CONCEPT_NAME... |
CREATE TABLE db_sequence (
seq_name varchar(100) NOT NULL default '',
nextid int(10) unsigned NOT NULL default '0',
PRIMARY KEY (seq_name)
);
CREATE TABLE atk_searchcriteria
(
nodetype VARCHAR(100) NOT NULL,
name VARCHAR(100) NOT NULL,
criteria TEXT NOT NULL,
handlertype VARCHAR(100) NOT NULL,
PRIMAR... |
<gh_stars>0
use Crj2OTSNvh;
CREATE TABLE IF NOT EXISTS Department(
ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
Name text NOT NULL
);
CREATE TABLE IF NOT EXISTS User(
ID int auto_increment PRIMARY KEY,
FullName varchar(255),
Email varchar(255) not null UNIQUE,
Password varchar(255) not null,
... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 11 Des 2021 pada 06.04
-- Versi server: 10.4.18-MariaDB
-- Versi PHP: 7.3.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<gh_stars>0
START TRANSACTION;
CREATE TABLE cluster_ingress_class
(
id uuid NOT NULL,
cluster uuid NOT NULL,
ingress_class uuid NOT NULL,
created_by uuid NOT NULL,
created_on timestamp with time zone NOT NULL,
deleted_on timestamp with time zone,
deleted_by uuid,
CONSTRAINT cluster_ingress_class_pkey ... |
create database QLNS
go
use QLNS
set dateformat DMY
go
create table CHITIETHOADON
(
MAHOADON char(7) not null,
MASACH char(7),
SOLUONG int,
GIATIEN int,
THANHTIEN int
)
go
select * from CHITIETHOADON
create table HOADON
(
MAHOADON char(7) primary key not null,
TENKHACHHANG nvarchar(50),
... |
<gh_stars>0
-- ***************************************************************************
-- File: 13_9.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,... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#raanswer
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.23-0ubuntu0.18.04.1)
# Database: ve_test
# Generation Time: 2018-12-08 02:09:58 +0000
# **********************... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th8 13, 2017 lúc 06:41 SA
-- Phiên bản máy phục vụ: 10.1.21-MariaDB
-- Phiên bản PHP: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50626
Source Host : localhost:3306
Source Schema : amolana
Target Server Type : MySQL
Target Server Version : 50626
File Encoding : 65001
Date: 06/08/2019 17... |
DELIMITER $$$
CREATE PROCEDURE `usp_get_towns_starting_with`(`input` VARCHAR(10))
BEGIN
SELECT
`name`
FROM
`towns`
WHERE
`name` LIKE CONCAT(`input`, '%')
ORDER BY `name`;
END; $$$
DELIMITER ;
CALL `usp_get_towns_starting_with`('b'); |
EXEC sp_configure filestream_access_level, 2
RECONFIGURE
|
<filename>src/main/resources/import.sql<gh_stars>0
-- task table
insert into task(id, src, algo, status, description) values (1, 'file:///etc/hosts/file1', 'md5', 'NEW', null)
insert into task(id, src, algo, status, description) values (2, 'file:///etc/hosts/file2', 'sha-1', 'NEW', null)
insert into task(id, src, algo,... |
CREATE TABLE requests
(
request_id INT IDENTITY(1,1) NOT NULL,
user_id INT NOT NULL,
info VARCHAR(512),
PRIMARY KEY(request_id),
FOREIGN KEY(user_id) REFERENCES users(user_id)
) |
<reponame>wwtg99/oauth_server
DROP VIEW IF EXISTS public.view_user_role, public.view_users, public.view_user_log, public.view_app_tokens CASCADE;
DROP FUNCTION IF EXISTS public.get_department_id(TEXT) CASCADE;
DROP FUNCTION IF EXISTS public.get_role_id(TEXT) CASCADE;
DROP FUNCTION IF EXISTS public.get_user_id(TEXT) CAS... |
--------------------------------------------------------------------------------
--Example #29: Compute the percent rank on height
--------------------------------------------------------------------------------
select c.*
, rank() over (order by c.height) rank_height
, round(percent_rank() over (order by c.h... |
<filename>toko_online.sql
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 04 Apr 2020 pada 07.06
-- Versi server: 10.4.8-MariaDB
-- Versi PHP: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... |
CREATE OR REPLACE PROCEDURE "CONVERTBLOB"
(
PIO_BLOB IN OUT NOCOPY BLOB
, P_PARAM IN VARCHAR2
, p_blob_csid number default NLS_CHARSET_ID('UTF8')
, P_APP_USER IN VARCHAR2 default V('APP_USER')
, P_RUN_IN_BACKGROUND IN NUMBER default 0
)
AS
-- Interactive Prints using the following MIT License:
--
-- ... |
--DROP PROC uspSelSendEmailToMember
CREATE PROC uspSelSendEmailToMember
@MemberID NVARCHAR(MAX)
AS
--set, lock option check
select EmailAddress from Members with(nolock) where MemberID like @MemberID
and HideYN like 'N' and DeleteYN like 'N'
GO
/*
----------------------------------------------------------------------... |
<filename>andelisa 20211203 1306.sql
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.5.5-10.4.18-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @... |
WITH RECURSIVE c0(src, trg) AS ((SELECT s0.src, s2.trg FROM edge s0, (SELECT trg as src, src as trg, label FROM edge) as s1, (SELECT trg as src, src as trg, label FROM edge) as s2 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s0.label = 0 AND s1.label = 29 AND s2.label = 68 UNION SELECT s0.src, s3.trg FROM edge s0, (... |
<reponame>enriquecatala/mssql-server-samplesdb
-- Restoring databases
--
RESTORE DATABASE [Pubs] FROM DISK = N'/var/opt/mssql/backup/Pubs.bak' WITH
FILE = 1, MOVE N'pubs' TO N'/var/opt/mssql/data/Pubs.mdf',
MOVE N'pubs_log' TO N'/var/opt/mssql/data/Pubs_log.ldf',
REPLACE, NOUNLOAD, STATS = 5;
-- Northw... |
<reponame>jmarca/postgraphile_user_system
-- Deploy postgraphile_user_system:register_user to pg
-- requires: users
-- requires: user_emails
-- requires: user_authentications
-- requires: user_secrets
-- requires: user_email_secrets
-- requires: user_authentication_secrets
-- requires: unregistered_email_resets
BEGIN;... |
drop table if exists layer1;
create table layer1(id int, name varchar);
insert into layer1 values(1,'A'),(2,'B');
drop table if exists layer2;
create table layer2(id int, count_ int, name varchar);
insert into layer2 values(10,2,'x'),(20,4,'y');
-- //@DELIMITER |
create or replace function test(layer_name anyelement... |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2017-07-15 18:41:44
-- 服务器版本: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET ... |
INSERT INTO solarnode.ocpp_auth
(created, idtag, parent_idtag, auth_status, expires)
VALUES (?,?,?,?,?)
|
CREATE OR REPLACE FUNCTION core.tf_t_organization_t()
RETURNS INTEGER AS $$
/*
=============================================================================================================
DESCRIPTION: Insert data from core organization_i input table into core 'today' table organization_t
AUTHO... |
<gh_stars>1-10
select engine, engine_version, db_instance_type, db_instance_id
from alicloud_rds_instance
where db_instance_id = '{{ output.db_instance_id.value }}'; |
<gh_stars>100-1000
CREATE SCHEMA IF NOT EXISTS `ds_jdbc_0`;
CREATE SCHEMA IF NOT EXISTS `ds_jdbc_1`;
|
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字method(非保留),作为视图名
--关键字explain作为视图名,不带引号,创建成功
CREATE or replace VIEW method AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view method;
--关键字explain作为视图名,加双引号,创建成功
CREATE or replace VIEW "method" AS
SELECT * FROM pg_tablespace WHERE spcnam... |
<filename>SQL/The Report.sql
SELECT s.name, g.grade, s.marks
FROM students s JOIN grades g
ON s.marks BETWEEN g.min_mark AND g.max_mark
WHERE g.grade >= 8
ORDER BY g.grade DESC, s.name ASC;
SELECT NULL, g.grade, s.marks
FROM students s JOIN grades g
ON s.marks BETWEEN g.min_mark AND g.max_mark
WHERE g.grade < 8
ORDER ... |
<reponame>geophile/sql-layer<filename>fdb-sql-layer-core/src/test/resources/com/foundationdb/sql/optimizer/enum-dphyp/semi-left-left.sql<gh_stars>0
-- This was inspired by reverse-and-cleanup-ins/map-join-project-outer, but that one has a right join;
-- one of the rules (I think OuterJoinPromoter) turns all right joins... |
<reponame>infira/poesis
CREATE TABLE `all_fields` (
`ID` INT(11) NOT NULL,
`nullField` DATETIME DEFAULT NULL,
`varchar` VARCHAR(25) COLLATE utf8mb4_unicode_ci DEFAULT '',
`varchar2` VARCHAR(125) COLLATE utf8mb4_unicode_ci NOT NU... |
<reponame>treebat1/SQL
exec MSDB.dbo.sp_resync_targetserver 'COLO1-VM-ARC3'
exec MSDB.dbo.sp_resync_targetserver 'COLO1-VM-ARC1'
exec MSDB.dbo.sp_resync_targetserver 'COLO1-VM-ARC4' |
DROP TABLE IF EXISTS VejstykkerPostnumreMat CASCADE;
CREATE TABLE VejstykkerPostnumreMat(
navngivenvej_id uuid,
navngivenvejkommunedel_id uuid,
postnummer_id uuid,
kommunekode INTEGER,
vejkode INTEGER,
postnr INTEGER,
tekst text
);
CREATE UNIQUE INDEX ON VejstykkerPostnumreMat(postnr, kommunekode, vejkod... |
# add column
ALTER TABLE `stations` ADD COLUMN `isOnline` INT(11) NULL DEFAULT 0 AFTER `status`;
# drop table
DROP TABLE `station_server`;
|
<reponame>jamesxuhaozhe/LeetCode-Java-Kotlin
SELECT DISTINCT
author_id AS id
FROM
Views
WHERE
author_id = viewer_id
ORDER BY
author_id;
select distinct author_id as id from Views where author_id = viewer_id order by id asc; |
-- AS es una palabra clave en SQL que le permite cambiar el nombre de una columna o tabla con un alias.
SELECT name AS 'Binge'
FROM movies; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.