sql stringlengths 6 1.05M |
|---|
CREATE proc [sys].[sp_MSforeachtable]
@command1 nvarchar(2000), @replacechar nchar(1) = N'?', @command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null, @whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null, @postcommand nvarchar(2000) = null
as
/* This proc returns one or more rows for each t... |
<filename>test_append/part/update_1.sql<gh_stars>1-10
INSERT INTO public.part VALUES (169440, 'dark violet beige lemon cyan', 'Manufacturer#5 ', 'Brand#51 ', 'SMALL BRUSHED TIN', 19, 'SM BAG ', 1509.44, 'e carefully ');
INSERT INTO public.part VALUES (133918, 'light sky ghost tomato rose', 'Manufacturer#4... |
<gh_stars>10-100
CREATE DATABASE TicketDB
GO
USE TicketDB
CREATE TABLE Tickets (Id INT, BarCode NVARCHAR(50))
GO
INSERT INTO Tickets VALUES (1, '1a18b11b-d55d-44fc-ac91-cda2ad5633ae');
INSERT INTO Tickets VALUES (2, '2b3e290c-b8db-41c2-b3f1-ed1528b16434');
INSERT INTO Tickets VALUES (3, '3cff2219-a40b-49ba-... |
-- fkey2.test
--
-- execsql { INSERT INTO t3 VALUES(1, NULL, 1) }
INSERT INTO t3 VALUES(1, NULL, 1) |
<filename>DBADashDB/dbo/Stored Procedures/Drivers_Get.sql
CREATE PROC dbo.Drivers_Get(
@InstanceIDs VARCHAR(MAX)=NULL,
@DriverSearch NVARCHAR(200)=NULL,
@Provider NVARCHAR(200)=NULL
)
AS
DECLARE @Instances TABLE(
InstanceID INT PRIMARY KEY
)
IF @InstanceIDs IS NULL
BEGIN
INSERT INTO @Instances
(
InstanceID
... |
<filename>docker-entrypoint-initdb.d/03-data.sql
INSERT INTO example_p (key, value, applies_to, effective_at)
VALUES ('A', 3, '2021-02-01', '2021-02-01');
-- An example of deciding a fact which takes effect in the future
INSERT INTO example_p (key, value, applies_to, effective_at)
VALUES ('B', 17, '2021-02-01', '2021-0... |
create or replace package pa_orcas_run_parameter is
function get_excludewheresequence return varchar2;
function get_excludewheretable return varchar2;
function get_excludewheremview return varchar2;
function get_dateformat return varchar2;
function is_logonly return number;
function is_dropmode return numbe... |
SET FOREIGN_KEY_CHECKS=0;
LOCK TABLES `systemsettings` WRITE;
INSERT INTO `systemsettings` VALUES
(1,2,'git user', 'token','2020-04-20 16:20:00');
UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS=1; |
INSERT INTO user (id, user_login, discord, instagram, linkedin, github, twitter, email, bio) VALUES (1, 'flaviojmendes', 'https://discord.com/invite/FP5UaAG', null, 'flaviojmendes', 'flaviojmendes', 'flaviojmendes', '<EMAIL>', 'Oi, eu sou o Flávio. Estou aqui pra desenvolver códigos e desenhar mamacos.');
INSERT INTO u... |
select cast(hr1.stratum_1 as int) as month_year,
hr1.count_value as count_value,
round(1.0*hr1.count_value / denom.count_value,5) as percent_value
from (select * from @ohdsi_database_schema.heracles_results where analysis_id = 110 and cohort_definition_id = @cohortDefinitionId) hr1,
(select count_value from @ohds... |
<reponame>rboixaderg/guillotina<gh_stars>100-1000
-- Create tables
CREATE TABLE IF NOT EXISTS objects (
zoid character varying(32) NOT NULL,
tid bigint NOT NULL,
state_size bigint NOT NULL,
part bigint NOT NULL,
resource boolean NOT NULL,
of character varying(32),
otid bigint,
parent_id... |
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type = 'P' AND object_id = object_id('dbo.Check_Blocking'))
EXEC ('CREATE PROCEDURE dbo.Check_Blocking AS SELECT ''This is a stub''')
GO
ALTER PROCEDURE dbo.Check_Blocking
@BlockingDurationThreshold smallint = 60,
@BlockedSessionThreshold smallint = NUL... |
spool resize_temp.log
set time on
set timing on
-- in order to distribute equally across for example, six mount points where dbf files are located
-- formula = (#Gig you want) * 1024 / 6
-- for example 100 * 1024 / 6 = 17067M
--
-- 13652M = about 80 Gig
-- 17067M = about 100 Gig
-- 20480M = about 120 Gig
alter datab... |
--pass out-of-range data of string type to the parameter
--1. [error] out-of-range argument: date type
select quarter(date'13/11/1989');
select quarter(date'05/33/1901');
select quarter(date'2/20/10000');
select quarter(date'0-1-1');
select quarter(date'1999-04-31');
select quarter(date'03-02-31');
--2. [err... |
<reponame>Clunker5/tregmine
-- MySQL dump 10.13 Distrib 5.5.34, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: tregmine
-- ------------------------------------------------------
-- Server version 5.5.34-0ubuntu0.13.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @... |
-- @testpoint:opengauss关键字prepare(非保留),创建一个预备语句,在EXECUTE语句中执行
--创建模式
DROP schema if exists tpcds;
CREATE schema tpcds;
CREATE TABLE tpcds.reason (
CD_DEMO_SK INTEGER NOT NULL,
CD_GENDER character(16),
CD_MARITAL_STATUS character(100)
)
;
--插入数据
INSERT INTO tpcds.reason VALUE... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jan 14, 2021 at 07:04 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
alter table fund alter column isactive type boolean
USING CASE WHEN isactive = 0 THEN FALSE
WHEN isactive = 1 THEN TRUE
ELSE NULL
END;
alter table fund alter column isnotleaf type boolean
USING CASE WHEN isnotleaf = 0 THEN FALSE
WHEN isnotleaf = 1 THEN TRUE
ELSE NULL
END;
alter... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 12, 2020 at 04:56 AM
-- 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... |
<reponame>charlesroper/Recorder-6-SQL<gh_stars>0
-- Make all SOS-supplied Red Kite records occurring in Jan-Feb confidential
-- Change Rollback Tran to Commit Tran to apply the update
USE NBNData
GO
BEGIN TRAN
UPDATE TXO
SET TXO.CONFIDENTIAL = 1,
TXO.COMMENT = CASE
WHEN CAST(TXO.CO... |
SELECT TOP(10) t.FirstName, t.LastName,
COUNT(st.StudentId) AS StudentsCount
FROM Teachers t
JOIN StudentsTeachers st
ON st.TeacherId = t.Id
GROUP BY FirstName, LastName
ORDER BY StudentsCount DESC, FirstName, LastName |
<filename>ftpserver.sql
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: localhost Database: ftpserver
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHA... |
<reponame>talho/rollcall
--BROWNSBORO
SELECT
"STUDENT_ATND_DETAIL"."ATND-DATE" AS 'ABSENCEDATE',
'107902'+"ENTITY"."ENTITY-ID" AS 'CAMPUSID',
"ENTITY"."ENTITY-NAME" AS 'SCHOOLNAME',
count("STUDENT_ATND_DETAIL"."STUDENT-ID") as 'ABSENT'
FROM "SKYWARD"."PUB"."STUDENT-ATND-DETAIL" "STUDENT_ATND_DETAIL"
INNER J... |
<reponame>umamerul/e-counseling<filename>e_counseling.sql
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 20, 2018 at 03:03 PM
-- Server version: 5.6.21
-- PHP Version: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4010... |
SELECT TOP(10) FirstName,
LastName,
DepartmentID
FROM Employees AS e
WHERE Salary > (SELECT AVG(Salary)
FROM Employees AS em
WHERE em.DepartmentID = e.DepartmentID
)
ORDER BY DepartmentID |
<filename>spec/sample/sample-008-raw.sql
SELECT *
FROM weather, cities
WHERE city = name; |
-- ? : The id of the account to delete
UPDATE report
SET deleted_at = DateTime('now')
WHERE filename = ?;
|
select
/*%expand*/*
from
t_user
where
USER_ID = /* userId */1
|
<reponame>RAJGUPTA28/Social-Media-Database-Project
insert into hashtag_follow (user_id,hashtag_id) values
(4,28),
(27,13),
(42,10),
(10,1),
(15,22),
(7,26),
(5,4),
(50,12),
(45,13),
(41,12),
(21,18),
(8,15),
(25,2),
(45,5),
(21,25),
(1,15),
(34,14),
(47,17),
(18,13),
(13,17),
(16,22),
(8,18),
(19,5),
(33,24),
(16,13)... |
<gh_stars>10-100
INSERT INTO `config` (`id_config`, `id_site`, `key`, `value`, `exposed`) VALUES (NULL, NULL, 'processor_payments', 'balanced', '0');
INSERT INTO `config` (`id_config`, `id_site`, `key`, `value`, `exposed`) VALUES (NULL, NULL, 'processor_payments_capture', '1', '0');
|
CREATE TABLE "public"."location_type"("value" text NOT NULL, "comment" text NOT NULL, PRIMARY KEY ("value") , UNIQUE ("value"));
|
-- Calculate the number of unit sales the company has done by using COUNT function
SELECT COUNT(*)
FROM sales;
-- Determine the total sales amount in dollars for each state, we can use the SUM aggregate function here
SELECT c.state, SUM(sales_amount) as total_sales_amount
FROM sales s
INNER JOIN customers c ON c.cus... |
-- (T218446) Make page.page_restrictions nullable in preparation for dropping it
BEGIN;
DROP TABLE IF EXISTS /*_*/page_tmp;
CREATE TABLE /*_*/page_tmp (
page_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
page_namespace int NOT NULL,
page_title varchar(255) binary NOT NULL,
page_restrictions tinyblob NU... |
/*
Navicat Premium Data Transfer
Source Server : blockchain-mysql
Source Server Type : MySQL
Source Server Version : 50728
Source Host : 192.168.1.100:3306
Source Schema : CAS
Target Server Type : MySQL
Target Server Version : 50728
File Encoding : 65001
Date: 15/12/... |
<filename>scripts/create-tasks.sql
CREATE DATABASE IF NOT EXISTS `todo_app`;
USE `todo_app`;
--
-- Table structure for table `task`
--
DROP TABLE IF EXISTS `task`;
CREATE TABLE `task` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`content` varchar(200) DEFAULT NULL,
`completed` BIT DEFAULT 0 NOT NULL,
PRIMARY KEY... |
ALTER TABLE `blgfxdrivers` ADD COLUMN `application_min` VARCHAR(255) NULL;
ALTER TABLE `blgfxdrivers` ADD COLUMN `application_max` VARCHAR(255) NULL;
|
-- --------------------------------------------------------
--
-- Structure for view `sys_auth`
--
DROP TABLE IF EXISTS `sys_auth`;
DROP VIEW IF EXISTS `sys_auth`;
CREATE OR REPLACE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `sys_auth` AS SELECT `sys_users`.`id` AS `id_user`, `sys_users`.`uname` AS `uname`, `dt_... |
/*
Warnings:
- Added the required column `date` to the `Work` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `Work` ADD COLUMN `date` INTEGER NOT NULL;
|
CREATE TABLE Product
(product_id CHAR(4) NOT NULL,
product_name VARCHAR(100) NOT NULL,
product_type VARCHAR(32) NOT NULL,
sale_price INTEGER ,
purchase_price INTEGER ,
regist_date DATE ,
PRIMARY KEY (product_id));
BEGIN TRANSACTION;
INSERT INTO Product VALUES ('0001', 'T恤衫', '衣服', ... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:3306
-- Tiempo de generación: 03-08-2020 a las 19:13:34
-- Versión del servidor: 5.7.24
-- Versión de PHP: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 S... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: barnyard_database
-- ------------------------------------------------------
-- Server version 8.0.11
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 22, 2021 at 01:10 PM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- +migrate Up
ALTER TABLE `answers` ADD INDEX `type_created_at_desc_item_id_participant_id_attempt_id_desc`
(`type`,`created_at` DESC,`item_id`,`participant_id`,`attempt_id` DESC);
-- +migrate Down
ALTER TABLE `answers` DROP INDEX `type_created_at_desc_item_id_participant_id_attempt_id_desc`;
|
<reponame>azizurcse/RESTful_Ecommerce_Upgrade_Api<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 14, 2018 at 06:40 AM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
STA... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 19, 2019 at 12:49 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.1.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 31, 2019 at 01:25 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>0
CREATE PROCEDURE [App].[Settle-Message]
@MessageId [dbo].[IdType]
,@AgentId [dbo].[KeyIdType]
,@SettleType [dbo].[ActivityTypeType]
,@ErrorMessage [dbo].[ErrorMessageType] = NULL
AS
BEGIN
SET NOCOUNT ON;
-- Settle types are for messages that have been locked by an agent
-- 'Pro... |
<filename>database/functions/add_userCommission.sql
DROP FUNCTION IF EXISTS add_userCommission;
DELIMITER $$
CREATE DEFINER=`root`@`localhost` FUNCTION `add_userCommission`(userId INT, amount FLOAT, _desc VARCHAR(45), r_userId INT, _depth VARCHAR(11)) RETURNS VARCHAR(11)
BEGIN
DECLARE _return VARCHAR(11);
DECLARE ... |
<filename>schema.sql
CREATE TABLE IF NOT EXISTS `done` (
-- Tasks done
`id` int(11) NOT NULL AUTO_INCREMENT,
-- ID for the done table
`jobid` int(11) NOT NULL,
-- ID of the job (from the queue table)
`name` varchar(255) NOT NULL,
-- Name identifying the job internally
`job_repeats` int(11) NOT N... |
CREATE TABLE [dbo].[IOTypes] (
[ID] BIGINT NOT NULL,
[IO] NVARCHAR (12) NULL,
[Title] NVARCHAR (128) NULL,
CONSTRAINT [PK_IO] PRIMARY KEY CLUSTERED ([ID] ASC)
);
|
<gh_stars>1-10
-- use this database
USE pugs4life_db;
-- create users
INSERT INTO users (username, password, email, name, image_link, phone_num, city, state, zipcode, active, createdAt, updatedAt) values ('ebuelow', '12345', '<EMAIL>', 'ellen', NULL, '7155675309', 'Saint Paul', 'MN', '53061', TRUE, CURRENT_TIMESTAMP, ... |
--DROP TABLE PRIETENI CASCADE CONSTRAINTS;
--DROP TABLE STUDENTI CASCADE CONSTRAINTS;
--CREATE TABLE studenti (
-- id INT NOT NULL PRIMARY KEY,
-- nr_matricol VARCHAR2(6) NOT NULL,
-- nume VARCHAR2(15) NOT NULL,
-- prenume VARCHAR2(30) NOT NULL,
-- an NUMBER(1),
-- grupa CHAR(2),
-- bursa NUMBER(6,2),
-- data_... |
--------------------------------------------------------
-- DDL for Table PORTER
--------------------------------------------------------
CREATE TABLE "G11_FLIGHT"."PORTER"
( "TOUR_ANNEE" NUMBER(4,0),
"ETAPE_NUM" NUMBER(2,0),
"MAILLOT_COULEUR" VARCHAR2(20 BYTE),
"PART_NUM" NUMBER(3,0),
CONSTRAINT "PK_P... |
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 03, 2020 at 04:17 PM
-- Server version: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
<reponame>omegazip/dba_scripts
connect SYSTEM/manager
define ORACLE_HOME = &1
define ORACLE_SID = &2
set echo on
spool spatial.log
@%ORACLE_HOME%\md\admin\mdinst.sql;
spool off
exit;
|
<filename>layouts/db/mysql/schema/2021-01-20_16-15-36_add_mailsmtpuser_passwd_constants.sql
BEGIN;
INSERT INTO `config` (`name`, `prefix`, `value`, `description`, `type`, `group`, `plugin`, `saved`, `editable`) VALUES
('MAILSMTPUSER', '', 'kvwmap', 'Nutzername für den Zugang zum SMTP-Server.\r\n', 'string', 'E-Ma... |
<reponame>patwolohan/Fodla<gh_stars>0
CREATE TABLE User
(
userID integer not null PRIMARY KEY AUTOINCREMENT,
userName varchar(100) not null,
userEmail varchar(100) not null,
userRole varchar(20) not null,
userToken varchar(100) not null,
userStatus integer not null,
userLastUpdate text not null
)... |
<gh_stars>0
{# if there are instances of delimiter_text within your measure, you cannot include a limit_num #}
{% macro trino__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}
{% if limit_num -%}
{% set ns = namespace() %}
{% set ns.delimiter_text_regex = delimiter_text|trim("'") %}
{% ... |
---------------------------------------------------------------------
-- Inside Microsoft SQL Server 2008: T-SQL Querying (MSPress, 2009)
-- Chapter 03 - Relational Model
-- Copyright <NAME>, 2009
-- All Rights Reserved
---------------------------------------------------------------------
-----------------------------... |
<filename>src/main/resources/db/migration/V1.2__Add_format_to_mastercode.sql
ALTER TABLE udccs.master_code ADD COLUMN format varchar(255); |
<reponame>EnsemblGenomes/personal-dbolser<filename>Plants/summarize_xrefs.sql
-- Summarize my XRefs:
SELECT
logic_name,
db_name,
ensembl_object_type,
COUNT(DISTINCT ensembl_id) AS objects,
COUNT(DISTINCT xref_id) AS xrefs,
COUNT(*) AS total
FROM
object_xref INNER JOIN xref USING (xref_id)
INNER JOIN
... |
DROP TABLE IF EXISTS `admin_pages`;
CREATE TABLE `admin_pages` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`path` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`icon` varchar(45) CHARACTER SET utf8mb4 COLLATE ... |
<filename>test/integration/008_schema_tests_test/local_utils/macros/get_namespace.sql
{% macro _get_utils_namespaces() %}
{% set override_namespaces = var('local_utils_dispatch_list', []) %}
{% do return(override_namespaces + ['local_utils']) %}
{% endmacro %}
|
<gh_stars>1-10
begin;
select plan(2);
select has_schema('cif');
select matches(obj_description('cif'::regnamespace, 'pg_namespace'), '.+', 'Schema cif has a description');
select finish();
rollback;
|
<filename>prisma/migrations/20210908205601_add_roles/migration.sql
/*
Warnings:
- You are about to drop the column `role` on the `OrganizationUser` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "OrganizationUser" DROP COLUMN "role",
ADD COLUMN "roleId" INTEGER;
-- CreateTable
C... |
<filename>sql/barang.sql
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 19 Nov 2016 pada 02.35
-- Versi Server: 10.1.13-MariaDB
-- PHP Version: 7.0.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<gh_stars>0
CREATE SCHEMA hardlimit_s;
SET search_path TO hardlimit_s;
SELECT diskquota.enable_hardlimit();
SELECT diskquota.set_schema_quota('hardlimit_s', '1 MB');
SELECT diskquota.wait_for_worker_new_epoch();
-- heap table
CREATE TABLE t1 AS SELECT generate_series(1,1000000); -- expect fail
SELECT diskquota.pause... |
<reponame>philpem/furdar
ALTER TABLE user_account_information ADD old_pasword_salt VARCHAR(255) NULL;
ALTER TABLE user_account_information ADD old_pasword_crypted VARCHAR(255) NULL; |
CREATE TABLE 'doors' (
'doorid' INTEGER PRIMARY KEY AUTOINCREMENT,
'name' TEXT
);
CREATE TABLE 'users' (
'userid' INTEGER PRIMARY KEY AUTOINCREMENT,
'card' TEXT UNIQUE,
'pin' TEXT,
'name' TEXT,
'expire_date' INTEGER
);
CREATE TABLE 'user_door' (
'userid' ... |
<filename>data/lubm/lubm_q1.sql
select distinct ?x where
{
?x <rdf:type> <ub:GraduateStudent>.
?y <rdf:type> <ub:University>.
?z <rdf:type> <ub:Department>.
?x <ub:memberOf> ?z.
?z <ub:subOrganizationOf> ?y.
?x <ub:undergraduateDegreeFrom> ?y.
}
|
BEGIN
SELECT name FROM Products ORDER BY price * quantity DESC, name ASC limit 1;
END
|
CREATE OR REPLACE VIEW wpaef_xtr_vw_normalized_relations AS
SELECT SQL_CACHE
m.post_id,
m.meta_id,
m.meta_key,
m.meta_value,
p.ID AS n_int_id,
p.post_title AS s_int_post_title,
p.post_type AS s_int_post_type,
x.ID AS n_ext_id,
x.post_title AS s_ext_post_title,
x.post... |
BEGIN;
ALTER TABLE games
ALTER COLUMN game_type TYPE text;
END; |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 08 Jan 2021 pada 09.23
-- Versi server: 10.1.37-MariaDB
-- Versi PHP: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
SELECT ROUND(ABS(p.a - p.c) + ABS(p.b - p.d), 4) FROM
(SELECT MIN(lat_n) AS a, MIN(long_w) AS b, MAX(lat_n) AS c, MAX(long_w) AS d FROM station) AS p |
<filename>Workshop/SQLQuery02.sql<gh_stars>0
-- 02. Insert into Cities all Cities from Employees, Suppliears and Customers tables
USE NORTHWND
INSERT INTO Cities
SELECT DISTINCT a.City FROM
(
SELECT DISTINCT City FROM Employees
UNION
SELECT DISTINCT City FROM Suppliers
UNION
SELECT DISTINCT City FROM Customers
U... |
<reponame>ajohnson96/2019-06-c-sharp-labs<filename>labs/SQL/SANRU SQL TEST.sql
--exercise 1
--1.1
select CustomerID, CompanyName, CONCAT(Address,',' ,PostalCode,',' ,Country)
AS 'Address field' from Customers
where City ='London' OR City='Paris'
--1.2
select * from Products
where QuantityPerUnit like ... |
DROP MATERIALIZED VIEW CLASSIFICA_CLIENTI;
DROP MATERIALIZED VIEW ANDAMENTO_PROMO;
DROP MATERIALIZED VIEW REPORT_VEICOLI; |
CREATE DATABASE camp;
use camp;
CREATE TABLE rooms(
id INT PRIMARY KEY,
occupation VARCHAR(20) not null,
beds_count int not null
);
CREATE TABLE vehicles(
id int primary key auto_increment not null,
driver_id int not null,
vehicle_type varchar(30) not null,
passengers int not null
);
CREATE TA... |
select `p`.`fuente` AS `fuente`,`p`.`organismo` AS `organismo`,`p`.`id_objeto` AS `id_objeto`,`o`.`descripcion` AS `descripcion`,
count(0) AS `cant`,sum(`p`.`importe`) AS `subtotal`
from (`preventivo` `p` join `objeto` `o` on((`p`.`id_objeto` = `o`.`id_objeto`)))
group by `p`.`fuente`,`p`.`organismo`,`p`.`id_objeto` |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 15, 2017 at 02:01 PM
-- Server version: 5.6.24
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
-- phpMyAdmin SQL Dump
-- version 3.4.11.1deb2+deb7u1
-- http://www.phpmyadmin.net
--
-- Client: localhost
-- Généré le: Mar 14 Juillet 2015 à 17:40
-- Version du serveur: 5.5.43
-- Version de PHP: 5.4.39-0+deb7u2
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
SET DEFINE OFF;
CREATE SYNONYM APEX_FLASH_CHART_5 FOR APEX_050000.WWV_FLOW_FLASH_CHARTS_5
/
|
IF EXISTS (
SELECT * FROM INFORMATION_SCHEMA.ROUTINES
WHERE SPECIFIC_SCHEMA = N'dbo'
AND SPECIFIC_NAME = N'ResultExists'
)
BEGIN
PRINT N'Dropping Procedure dbo.ResultExists'
DROP PROCEDURE dbo.ResultExists
END
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO
-- ResultExists 50, 1, 10... |
DELETE FROM sso.genders
WHERE name = 'male';
DELETE FROM sso.genders
WHERE name = 'female';
DELETE FROM sso.genders
WHERE name = 'others'; |
CREATE TABLE api_user (
id SERIAL PRIMARY KEY,
username VARCHAR (100) NOT NULL UNIQUE,
email VARCHAR (500) NOT NULL UNIQUE
)
|
<reponame>uetiko/Mexican-national-catalog-of-postal-codes
insert into settlement(id, name)
values(UUID_TO_BIN('0c0f916f-2372-407b-9153-4a40367ae714'), '15 de Mayo');
insert into settlement(id, name)
values(UUID_TO_BIN('fd69a834-1165-42f4-a3d0-e73e3eb495c1'),... |
-- Adminer 4.7.0 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` varchar(15) NOT NULL,
`username` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`role` tinyint(4) NOT NULL,
`access_level` tinyint(4) NOT... |
-- phpMyAdmin SQL Dump
-- version 4.0.10.6
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1:3306
-- Время создания: Окт 16 2015 г., 02:08
-- Версия сервера: 5.5.41-log
-- Версия PHP: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... |
<filename>src/SFA.DAS.AssessorService.Database/StoredProcedures/StaffReports_ByEpao.sql<gh_stars>1-10
CREATE PROCEDURE [dbo].[StaffReports_ByEpao]
AS
SELECT
org.[EndPointAssessorName] AS 'EPAO Name',
COUNT(*) AS 'Total',
SUM(CASE WHEN ce.[CertificateReferenceId] < 10000 THEN 1 ELSE 0 END) AS 'Manual Total'... |
-- phpMyAdmin SQL Dump
-- version 4.7.1
-- https://www.phpmyadmin.net/
--
-- Host: sql12.freesqldatabase.com
-- Generation Time: Apr 07, 2018 at 01:42 PM
-- Server version: 5.5.58-0ubuntu0.14.04.1
-- PHP Version: 7.0.28-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET... |
-- file:create_cast.sql ln:51 expect:true
$$
|
<gh_stars>10-100
-- file:updatable_views.sql ln:1118 expect:true
create table pt1 (b int not null, v varchar, a int not null) partition by range (b)
|
<gh_stars>100-1000
SET @sName = 'bx_decorous';
-- SETTINGS
INSERT INTO `sys_options_types`(`group`, `name`, `caption`, `icon`, `order`) VALUES
('templates', @sName, '_bx_decorous_stg_cpt_type', 'bx_decorous@modules/boonex/decorous/|std-icon.svg', 2);
SET @iTypeId = LAST_INSERT_ID();
-- SETTINGS: Decorous template S... |
<filename>Database/Assignment2P2_v1.1.sql<gh_stars>0
/* Insert data into table 'points' */
DELETE FROM points;
INSERT INTO public.points(grade, points)VALUES ('A+', 4);
INSERT INTO public.points(grade, points)VALUES ('A', 4);
INSERT INTO public.points(grade, points)VALUES ('A-', 3.7);
INSERT INTO public.points(gra... |
<reponame>Gigelf-evo-X/evo-X<filename>evo-X-Scriptdev2/sql/Updates/0.0.3/r1380_mangos.sql
UPDATE creature_template SET ScriptName='npc_maghar_captive' WHERE entry=18210;
|
-- phpMyAdmin SQL Dump
-- version 3.2.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 05, 2015 at 09:18 AM
-- Server version: 5.1.44
-- PHP Version: 5.3.1
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_S... |
<gh_stars>0
USE `nustour_db`;
CREATE TABLE IF NOT EXISTS `building` (
-- name type constraints
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(32) NOT NULL UNIQUE,
`location` VARCHAR(256) NOT NULL ,
`area` VARCHAR(12... |
<gh_stars>0
ALTER TABLE `maps`
CHANGE COLUMN `TopNeighbourId` `ClientTopNeighbourId` int(11) NULL DEFAULT NULL AFTER `SubAreaId`,
CHANGE COLUMN `BottomNeighbourId` `ClientBottomNeighbourId` int(11) NULL DEFAULT NULL AFTER `ClientTopNeighbourId`,
CHANGE COLUMN `LeftNeighbourId` `ClientLeftNeighbourId` int(11) NULL D... |
ALTER TABLE test_location DROP COLUMN all_assessments;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.