sql stringlengths 6 1.05M |
|---|
--CREATE <lang> SCALAR SCRIPT
--base_pi()
--RETURNS DOUBLE AS
-- pi
CREATE python SCALAR SCRIPT
basic_emit_several_groups(a INTEGER, b INTEGER)
EMITS (i INTEGER, j VARCHAR(40)) AS
def run(ctx):
for n in range(ctx.a):
for i in range(ctx.b):
ctx.emit(i, repr((exa.meta.vm_id, exa.meta.node_count... |
/*
Difficulty: Easy
https://www.hackerrank.com/challenges/revising-aggregations-sum/problem
Query the total population of all cities in CITY where District is California.
The CITY table is described as follows:
+-------------+--------------+
| Field | Type |
+-------------+--------------+
| ID ... |
-- AlterTable
ALTER TABLE "User" ADD COLUMN "policyId" INTEGER;
-- CreateTable
CREATE TABLE "Policy" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"name" TEXT NOT NULL,
"description" TEXT NOT NULL,
CONSTRAINT "Policy... |
<filename>SQL-Server/Thousands-Separator/Thousands-Separator.sql
SELECT FORMAT(1000,'#,0');
|
/*
Undocumented DBCC commands for SQL Server
Here is the unique collection of undocumened DBCC commands for Microsoft SQL Server.
Disclaimer: The information is provided for information sharing only, with no rights.
*/
DBCC activecursors [(spid)]
DBCC addextendedproc (function_name, dll_name)
DBCC addinstance (object... |
-- file:json.sql ln:353 expect:true
select '42'::json #> array['f2']
|
--DROP TABLE p902_activity_chart;
--CREATE GLOBAL TEMPORARY TABLE p902_activity_chart (
CREATE TABLE p902_activity_chart (
user_id VARCHAR2(30) NOT NULL,
bucket_id NUMBER(4) NOT NULL,
--
chart_label VARCHAR2(400),
count_pages NUMBER,
count_forms ... |
<reponame>sy3kic/nZEDb
ALTER TABLE users ADD COLUMN queuetype TINYINT(1) NOT NULL DEFAULT 0;
/* Add a column to pick between Sab and NZBGet. */
ALTER TABLE users ADD COLUMN nzbgeturl VARCHAR(255) NULL DEFAULT NULL;
/* Add a column for the NZBGet URL. */
ALTER TABLE users ADD COLUMN nzbgetapikey VARCHAR(255) NULL DEFA... |
ALTER TABLE c_invoice
DROP CONSTRAINT IF EXISTS aduser_cinvoice;
ALTER TABLE c_invoice
ADD CONSTRAINT aduser_cinvoice
FOREIGN KEY (c_bpartner_id, ad_user_id)
REFERENCES ad_user (c_bpartner_id, ad_user_id)
DEFERRABLE INITIALLY DEFERRED;
|
ALTER TABLE character_db_version CHANGE COLUMN required_9632_01_characters_characters required_9634_01_characters_corpse bit;
ALTER TABLE corpse
DROP COLUMN data,
DROP COLUMN zone;
|
DECLARE @itemNameTranslationTT core.itemNameTranslationTT
DECLARE @meta core.metaDataTT
DECLARE @enLanguageId [TINYINT] = (SELECT languageId FROM [core].[language] WHERE iso2Code = 'en');
DECLARE @frLanguageId [TINYINT] = (SELECT languageId FROM [core].[language] WHERE iso2Code = 'fr');
MERGE INTO [core].[itemType] AS... |
<gh_stars>0
------------------------------------------------------------------------------------------
---------------------------------- Compression Advisor -----------------------------------
-- Author: gvenzl (c) 2016 (v)1.0.1
-- This package provides an easy to use interface for Oracle Compression Advisor (DBMS_COM... |
create table tab_new_uk
(
id1 number(15) not null,
id2 number(20) not null,
constraint tab_new_uk unique (id1,id2),
);
create table tab_wrong_uk_name
(
id number(15) not null,
constraint tab_wrong_uk_name unique (id),
);
create table tab_wrong_uk_columns
(
id1 number(15) not null,
id2 number(15) not nul... |
CREATE TABLE EVENT (
`event_id` int NOT NULL AUTO_INCREMENT,
`event_type` varchar(50) NOT NULL,
`server_id` varchar(50),
`event_user` varchar(50),
`event_time` timestamp NOT NULL,
PRIMARY KEY (eventId));
CREATE TABLE EVENT_PROP (
`event_prop_id` int NOT NULL AUTO_INCREMENT,
`event_id` i... |
<filename>conf/evolutions/default/1.sql
# schema
# --- !Ups
CREATE TABLE "user" (
id BIGSERIAL,
first_name VARCHAR(50),
middle_name VARCHAR(50),
last_name VARCHAR(50),
date_of_birth DATE,
username VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
last_login TIMESTAMP DEFAULT NULL,
active BOOLEAN NOT NULL D... |
/*
* Copyright © 2019 Lisk Foundation
*
* See the LICENSE file at the top-level directory of this distribution
* for licensing information.
*
* Unless otherwise agreed in a custom licensing agreement with the Lisk Foundation,
* no part of this software, including this file, may be copied, modified,
* propagated... |
<reponame>baok1592/qy_base
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- 主机: 127.0.0.1
-- 生成日期: 2019-12-10 09:16:54
-- 服务器版本: 10.1.37-MariaDB
-- PHP 版本: 7.3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
SET send_logs_level = 'none';
SET allow_ddl = 0;
CREATE DATABASE some_db; -- { serverError 392 }
CREATE TABLE some_table(a Int32) ENGINE = Memory; -- { serverError 392}
ALTER TABLE some_table DELETE WHERE 1; -- { serverError 392}
RENAME TABLE some_table TO some_table1; -- { serverError 392}
SET allow_ddl = 1; -- { se... |
with ips as
(select
sc.servicecommunication_pk
,ld.name "Listening Device"
,ld.device_pk
,ld.name as "Listening Device Name"
,ld.serial_no as "Listening Serial Number"
,ld.uuid as "Listening Device UUID"
... |
--tests last_day using to_date, to_char
select to_date(to_char(last_day(date'2/1/2008'))) from db_root;
|
<gh_stars>0
-- @testpoint: opengauss关键字size(非保留),作为函数名,部分测试点合理报错
--关键字不带引号-成功
drop function if exists size;
create function size(i integer)
returns integer
as $$
begin
return i+1;
end;
$$ language plpgsql;
/
drop function if exists size;
--关键字带双引号-成功
drop function if exists "size";
create function "size"(i integer... |
<reponame>MiguelEquisDe/mipj<filename>academia.sql
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-03-2022 a las 23:25:15
-- Versión del servidor: 10.4.22-MariaDB
-- Versión de PHP: 8.1.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACT... |
CREATE TABLE IF NOT EXISTS `ftn_reg_tipo_usuario` (
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Identificador único',
`Nombre` varchar(50) DEFAULT "" COMMENT 'Nombre del usuario',
`Descripcion` varchar(255) DEFAULT "" COMMENT 'Descripción corta del tipo de usuario',
`IdActivo` BOOL DEFAULT true ... |
INSERT INTO department (name) VALUES ("Sales");
INSERT INTO department (name) VALUES ("Marketing");
INSERT INTO department (name) VALUES ("Customer Service");
INSERT INTO role (title, salary, department_id) VALUES ("Sales Manager", 60000, 1);
INSERT INTO role (title, salary, department_id) VALUES ("Sales Agent", 5500... |
<filename>src/sql/StoredProcedures/SystemUser_GetById.sql<gh_stars>0
IF EXISTS ( SELECT 1 FROM dbo.SysObjects WHERE id=OBJECT_ID('dbo.SystemUser_GetById') AND OBJECTPROPERTY(id,'IsProcedure')=1)
BEGIN
DROP PROCEDURE dbo.SystemUser_GetById
END
GO
CREATE PROCEDURE dbo.SystemUser_GetById
@SystemUserId INT
AS
BEGIN... |
---------------------------------------------------------------
-- table: requestved. indexes
---------------------------------------------------------------
-- index: cix_requestved_offset
-- drop index cix_requestved_offset;
create unique index cix_requestved_offset on requestved using btree ("offset");
alter table... |
SELECT DISTINCT salary FROM `employees`
ORDER BY employee_id; |
<filename>db/dummy_data.sql
SELECT 'INSERTING DUMMY DATA' as 'INFO';
INSERT INTO leagues (leagueName, season, pointScheme) VALUES ('Fredericton Soccer League', 'Fall 2018', 'Standard');
INSERT INTO teams (leagueID, teamName, colour, wins, losses, draws) VALUES (1, 'Blue Birds', '#4b89ed', 4, 3, 1), (1, 'Tigers', '#d6... |
<reponame>valkyrienc/BusinessPlatformApps
SET NOCOUNT ON;
SELECT DISTINCT ds.collectionid,
ds.collectionname,
ds.offerid,
ds.softwarename,
ds.softwarename AS 'Application',
ds.numbersuccess,
ds.numberinprogress,
... |
DELETE FROM roles WHERE created_by = 'none';
INSERT INTO roles (role_key, role_name, created_by, created_at, version) VALUES
('system_admin', 'システム管理者', 'none', NOW(), 1),
('admin', '管理者', 'none', NOW(), 1),
('operator', 'オペレーター', 'none', NOW(), 1),
('user', 'ユーザー', 'none', NOW(), 1);
DELETE FROM permissions WHERE cre... |
/*
URI Online Judge SQL | 2618
Imported Products
<NAME> BR Brasil
Timelimit: 1
Our company's import sector needs a report on the import of products from our Sansul providers.
Your task is to display the name of the products, the name of the supplier and the name of the category, for the products supplied by the suppl... |
<gh_stars>1-10
CREATE TABLE [dbo].[Class_Users]
(
[ClassId] UNIQUEIDENTIFIER NOT NULL,
[UserId] UNIQUEIDENTIFIER NOT NULL,
[Period] INT NOT NULL,
CONSTRAINT [PK_Class_Users] PRIMARY KEY CLUSTERED (ClassId, UserId, [Period]),
CONSTRAINT [FK_Class_Users_ToClasses] FOREIGN KEY (ClassId) REFERENCES ... |
declare
v_count pls_integer;
begin
select count(*)
into v_count
from user_objects
where status = 'INVALID'
and object_name = 'CONSOLE';
if v_count > 0 then
dbms_output.put_line('C O N S O L E H A S E R R O R S');
for i in (
select '- ' || rpad(type, 13, ' ') || ' ' || lpad(line, 4... |
<reponame>manikanth/sql-server-samples<filename>samples/features/ssms-templates/Sql/SQL Azure Database/Function/create scalar-valued function.sql
--=================================================================
-- Create scalar-valued function template for Azure SQL Database
--=======================================... |
-- 2018-12-20T14:03:49.730
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Tab SET IsActive='N',Updated=TO_TIMESTAMP('2018-12-20 14:03:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=540672
;
-- AD_Pinstance_Log
-- 2018-12-20T14:09:40.622
-- I forgot to set the DICTIONARY_ID_CO... |
ALTER TABLE db_version CHANGE COLUMN required_8840_01_mangos_spell_proc_event required_8841_01_mangos_spell_proc_event bit;
ALTER TABLE `spell_proc_event`
CHANGE `entry` `entry` mediumint(8) unsigned NOT NULL default '0';
DELETE FROM `spell_proc_event` WHERE `entry` IN (65661);
INSERT INTO `spell_proc_event` VALUES... |
<gh_stars>0
-- MySQL dump 10.13 Distrib 5.5.53, for Win32 (AMD64)
--
-- Host: localhost Database: cms
-- ------------------------------------------------------
-- Server version 5.5.53
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_R... |
CREATE TABLE IF NOT EXISTS Clientes (
id bigint auto_increment NOT NULL ,
Nombre VARCHAR NOT NULL,
Apellido VARCHAR NOT NULL,
fecha_nacimiento VARCHAR NOT NULL,
Cedula VARCHAR NOT NULL,
Email VARCHAR NOT NULL,
... |
CREATE TABLE [IQ].[Notification]
(
[Id] UNIQUEIDENTIFIER NOT NULL CONSTRAINT [DF_Notification_Id] DEFAULT (NEWSEQUENTIALID()),
[Type] NVARCHAR(256) NOT NULL,
[Message] NVARCHAR(MAX) NULL,
[CorrelationType] NVARCHAR(256) NULL,
[CorrelationId] UNIQUEIDENTIFIER NULL,
[Created] DATETIMEOFFSET NO... |
<gh_stars>0
/*
* Copyright (c) 2016-2017 LabKey Corporation
*
* 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 ... |
INSERT INTO `employees` (`first_name`, `last_name`) VALUES
('Ivan', 'Petrov'),
('Dimitar', 'Georigiev'),
('Stefan', 'Todorov'); |
create or replace package body test_expect_to_be_empty is
procedure cleanup_expectations is
begin
ut3_tester_helper.main_helper.clear_expectations( );
end;
procedure success_be_empty_cursor is
l_cursor sys_refcursor;
begin
--Arrange
open l_cursor for select * from dual where 1 = 2;
--Act
... |
/*
PARAMETERS (
animalId VARCHAR
)
*/
SELECT Id, dateOnly, feces
FROM study."Irregular Obs No Okays" obs
WHERE obs.feces IS NOT NULL
-- AND
-- obs.Id = animalId |
<filename>src/main/resources/dbmigrate/mysql/data_org/V1_3_0_1__job.sql<gh_stars>1-10
UPDATE JOB_GRADE set PRIORITY=1 where id=1;
UPDATE JOB_GRADE set PRIORITY=2 where id=2;
UPDATE JOB_LEVEL set PRIORITY=1 where id=1;
UPDATE JOB_LEVEL set PRIORITY=2 where id=2;
UPDATE JOB_LEVEL set PRIORITY=3 where id=3;
|
-- Name: Checking Duplicate Series
-- Schema: posda_files
-- Columns: ['collection', 'site', 'patient_id', 'dicom_file_type', 'pixel_data_digest', 'sop_instance_uid']
-- Args: ['series_instance_uid']
-- Tags: ['CPTAC Bolus September 2018']
-- Description: Get the list of files by sop, excluding base series
select
d... |
IF NOT EXISTS (SELECT NULL FROM sys.table_types WHERE name = 'RelatedDocumentTableValuedParameter')
CREATE TYPE dbo.RelatedDocumentTableValuedParameter AS TABLE ([DocumentId] NVARCHAR(400), [DocumentTable] NVARCHAR(400), [ReferenceId] NVARCHAR(400), [ReferenceTable] NVARCHAR(400)) |
<gh_stars>0
-- Added grants configuration table to propagate permissions to newly created child partitions. Will also apply those permissions to the parent table and all existing child tables whenever a new partition is created. Permissions are only granted, never revoked. See docs for more info.
CREATE TABLE part_gra... |
<filename>gcdb/sql/gc_cur_team_score/insert.sql
INSERT INTO gc_cur_team_score (qtr, points, _gc_cur_team_id) VALUES (?, ?, ?)
|
-- 4.1 Aggirigate functions
-- max; min; avg;sum;count
-- they operate only on not null values/ null values are not counted or not included
use sql_invoicing;
select max(invoice_total) as highest,
min(invoice_total) as lowest,
avg(invoice_total) as average,
sum(invoice_total) as total,
count(invoice_tot... |
<reponame>dusankuburic/auto_delovi<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.58.3
-- Generation Time: Apr 27, 2019 at 08:07 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.1.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACT... |
<gh_stars>0
CREATE TABLE [dbo].[FactZamowienia] (
[COLUMNSTORE] INT IDENTITY (1, 1) NOT NULL,
[Salon_Zamowienie_Id] INT NULL,
[Serwis_Zamowienie_Id] INT NULL,
[Klient_Id] INT DEFAULT ((-1)) ... |
CREATE DATABASE IF NOT EXISTS database_kabum_2021 CHARACTER SET = 'utf8mb4' COLLATE = 'utf8mb4_general_ci';
CREATE TABLE `tb_pessoas` (
`pess_codigo` int(11) NOT NULL AUTO_INCREMENT,
`pess_tipo` varchar(11) DEFAULT NULL,
`pess_classificacao` char(1) DEFAULT NULL,
`pess_nome` varchar(30) DEFAULT NULL,
`pess_r... |
<gh_stars>1-10
DROP TABLE picklists;
DROP TABLE picks; |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 1192.168.3.11
-- Tiempo de generación: 11-02-2020 a las 14:13:05
-- Versión del servidor: 10.1.36-MariaDB
-- Versión de PHP: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET ti... |
# Write your MySQL query statement below
SELECT DISTINCT Email
FROM Person
WHERE Email in (
SELECT Email
FROM Person
GROUP BY Email
HAVING COUNT(Email)>1
);
|
<filename>Docs/SqlServerCreateTable.sql
CREATE TABLE rooms (
RoomName VARCHAR(128) PRIMARY KEY
);
CREATE TABLE peers (
Id int IDENTITY(1,1) PRIMARY KEY,
PeerId VARCHAR(128) NOT NULL,
RoomName VARCHAR(128) NOT NULL,
FOREIGN KEY (RoomName) REFERENCES rooms(RoomName)
); |
ALTER TABLE [dbo].[FORCE_SYNC_ITEMS]
ADD CONSTRAINT [FORCE_SYNC_ITEMS.FK_MigrationSource.fkey]
FOREIGN KEY (MigrationSourceId)
REFERENCES MIGRATION_SOURCES (Id)
|
<gh_stars>1-10
CREATE TABLE [Application].[Countries](
[CountryID] [int] NOT NULL,
[CountryName] [nvarchar](60) COLLATE Latin1_General_100_CI_AS NOT NULL,
[FormalName] [nvarchar](60) COLLATE Latin1_General_100_CI_AS NOT NULL,
[IsoAlpha3Code] [nvarchar](3) COLLATE Latin1_General_100_CI_AS NULL,
[IsoNumericCode] [i... |
<gh_stars>1-10
CREATE TABLE jedi (
id serial NOT NULL,
name character varying(30) NOT NULL,
lastname character varying(50) NOT NULL,
PRIMARY KEY (id)
);
|
<gh_stars>0
# USE book_data.sql;
# CREATE TABLE books
# (
# book_id INT NOT NULL AUTO_INCREMENT,
# title VARCHAR(100),
# author_fname VARCHAR(100),
# author_lname VARCHAR(100),
# released_year INT,
# stock_quantity INT,
# pages INT,
# PRIMARY KEY(book_id)
# );
# INSERT INTO books (title, author_fna... |
<filename>microservicio/infraestructura/src/main/resources/sql/producto/buscarPorId.sql
select id,nombre,fecha_creacion,precio_compra,stock,fecha_abastecimiento
from producto
where id = :id |
DROP SCHEMA IF EXISTS COMPANY;
CREATE SCHEMA IF NOT EXISTS COMPANY;
USE COMPANY;
CREATE TABLE EMPLOYEE (
FNAME VARCHAR(20) NOT NULL,
SSN CHAR(9) NOT NULL,
BDATE DATE,
ADDRESS VARCHAR(30),
SEX ... |
<filename>src/softuni/mySql/Exam_Prep/Total_salaries_and_players_by_country_LEFT_JOIN-COUNT_SUM_GROUP_BY.sql
SELECT
c.name,
COUNT(p.id) AS total_count_of_players,
SUM(p.salary) AS total_sum_of_salaries
FROM
countries AS c
LEFT JOIN
towns AS t
ON c.id = t.country_id
LEFT JOIN
... |
<gh_stars>1-10
---------------------------------------------------------------------
-- LAB 18
--
-- Exercise 2
---------------------------------------------------------------------
USE TSQL;
GO
---------------------------------------------------------------------
-- Task 1
-------------------------------------------... |
library OMTKLogic version '3.0.0'
/*
This library provides functionality for calculating Morphine Milligram
Equivalents (MME) for opioid medications, as described in the CDC Opioid
Prescribing Guideline.
The functionality in this library was developed based on the Java-based
implementation described [here](http://bui... |
<filename>docs/doc/static/sql/postgres.sql
-- Postgres Data init |
/*************************************************************************/
-- Assigment: Conformance- value
-- Description: this medical dept could not prescribe the procedure
-- Author: <NAME>
-- Date: 11.Jan, 2020
-- Job name: this medical dept could not prescribe the drug
-- Language: MSSQL
-- Target data: ... |
\qecho Execute REUSABLE scripts with AFTER condition.
\qecho Execute /script_reusable_after/dummy_s2_reusable_after_a.sql
\include ./script_reusable_after/dummy_s2_reusable_after_a.sql
\qecho Execute /script_reusable_after/dummy_s2_reusable_after_b.sql
\include ./script_reusable_after/dummy_s2_reusable_after_b.sql
\qec... |
-- +goose Up
CREATE TYPE asset_type AS ENUM (
'fixed_cap',
'variable_cap',
'nft'
);
CREATE TABLE assets (
id SERIAL PRIMARY KEY,
asset_id TEXT NOT NULL,
type asset_type NOT NULL,
name TEXT,
symbol TEXT,
denomination INTEGER
);
CREATE UNIQUE INDEX idx_assets_id ON ... |
<reponame>astaupb/coupons_backend
CREATE DATABASE asta_coupon;
GRANT ALL ON DATABASE asta_coupon TO asta_coupon_user; |
<filename>base_layer/wallet/migrations/2020-08-17-141407_add_resend_count_and_timestamp_add_status_to_pending_txs/down.sql<gh_stars>100-1000
PRAGMA foreign_keys=OFF;
ALTER TABLE completed_transactions
RENAME TO completed_transactions_old;
CREATE TABLE completed_transactions (
tx_id INTEGER PRIM... |
<filename>GetAllCurrunciesToDb/tbl_currency.sql
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jul 05, 2015 at 04:01 PM
-- Server version: 10.0.17-MariaDB-1~trusty-log
-- PHP Version: 5.5.9-1ubuntu4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_... |
<filename>Year2/Sem_1/Databases/Assignment/C14337041.sql
--Databases Assignment
--<NAME> -- C14337041
--Drop tables if they already exist
DROP TABLE GAMES CASCADE CONSTRAINTS PURGE;
DROP TABLE SUPPLIER CASCADE CONSTRAINTS PURGE;
DROP TABLE SALES_REPRESENTATIVE CASCADE CONSTRAINTS PURGE;
DROP TABLE PLATFORM CASC... |
<gh_stars>0
CREATE USER fedora WITH ENCRYPTED PASSWORD '<PASSWORD>';
CREATE DATABASE fcrepo;
GRANT ALL PRIVILEGES ON DATABASE fcrepo TO fedora;
CREATE DATABASE murax;
CREATE USER murax WITH ENCRYPTED PASSWORD '<PASSWORD>';
GRANT ALL PRIVILEGES ON DATABASE murax TO murax;
|
<reponame>aassou/stock-management<filename>db/t_provider.sql
CREATE TABLE IF NOT EXISTS t_provider (
id INT(11) NOT NULL AUTO_INCREMENT,
name VARCHAR(255) DEFAULT NULL,
address TEXT DEFAULT NULL,
phone VARCHAR(50) DEFAULT NULL,
created DATETIME DEFAULT NULL,
createdBy VARCHAR(50) DEFAULT NULL,
updated DATETIME D... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 14, 2021 at 10:50 PM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 7.4.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
CREATE FUNCTION loadosmnodesfromfile(filename character varying) RETURNS void
LANGUAGE plpgsql
AS $$
/*
Import all the nodes from an OSM file
Utility function to read an OSM Overpass API XML files FROM DISK.
The files need to be stored in the Postrgres servers data folder (or sub folder).
This uses the function... |
<gh_stars>1-10
SELECT DISTINCT l_discount
FROM lineitem
WHERE l_returnflag = 'N' AND l_linestatus = 'F' |
<reponame>datarttu/sujuikoDB<gh_stars>1-10
/*
* Build the "contracted" network for nw staging,
* i.e. a network where redundant links on continuous sections
* between intersections are merged together.
*
* NOTE: If you have to fix something in the original network,
* modify stage_osm.combined_lines
* ... |
SELECT H.CODFILIAL,
H.DATA,
H.CODPROD,
H.QTEST,
H.QTESTGER
FROM PCHISTEST H
LEFT JOIN PCPRODUT P ON H.CODPROD = P.CODPROD
LEFT JOIN PCFORNEC F ON P.CODFORNEC = F.CODFORNEC
WHERE H.CODFILIAL = 2
AND H.DATA = TO_DATE ('31/12/2019', 'DD/MM/YYYY')
AND F.CODFORNECPRINC = 2;
/ |
ALTER TABLE "public"."assets" DROP COLUMN "listAssets";
|
-- file:domain.sql ln:404 expect:true
create domain pos_int as int4 check (value > 0) not null
|
SELECT
(PERCENTILE_CONT(0.1) WITHIN GROUP (ORDER BY gas_price)) / 1e9 AS _10_gas_price_gwei
,(PERCENTILE_CONT(0.25) WITHIN GROUP (ORDER BY gas_price)) / 1e9 AS _25_gas_price_gwei
,(PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY gas_price)) / 1e9 AS median_gas_price_gwei
... |
-- MySQL dump 10.13 Distrib 8.0.28, for Win64 (x86_64)
--
-- Host: localhost Database: attique
-- ------------------------------------------------------
-- Server version 8.0.28
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... |
--
-- Upgrade script from 5.0d2 to 5.0d3
--
-- @author <NAME> (<EMAIL>)
--
-- @cvs-id $Id: upgrade-5.0d2-5.0d3.sql,v 1.10.22.1 2017/04/21 15:59:20 gustafn Exp $
--
-- Change delete (reserved word in Oracle) to del
create or replace package acs_object
as
function new (
object_id in acs_objects.object_id%TYPE def... |
<filename>libs/sdc_etl_libs/sql/HFD/CREATE_TABLE_daily_account_dunning_metrics.sql
CREATE TABLE "FINANCE"."HFD"."DAILY_ACCOUNT_DUNNING_METRICS"
(
"HFDID" VARCHAR,
"ACTIVATEDATE" VARCHAR,
"ACTIVATEDYM" VARCHAR,
"SNAPSHOTDATE" VARCHAR,
"PAYMENTSTATUS" VARCHAR,
"FINANCEDAMOUNT" VARCHAR,
"ENDINGPRINCIPALBALANCE" VAR... |
create database requests;
create table roles (
id serial primary key,
name_roles varchar(50)
);
create table rules (
id serial primary key,
name_rules varchar(50)
);
create table rulesForRoles (
roles_id integer references roles(id),
rules_id integer references rules(id)
);
create table users (
id serial primar... |
INSERT INTO d_category(d_category_id, name, value) VALUES (1000, 'Легковые', 1);
INSERT INTO d_category(d_category_id, name, value) VALUES (2000, 'Мото', 2);
INSERT INTO d_mark(d_mark_id, d_category_id, name, value) VALUES (1000, 1000, 'Acura', 98);
INSERT INTO d_mark(d_mark_id, d_category_id, name, value) VALUES (200... |
<filename>sql.sql
-- create terms
insert into terms(description, code, starttime, endtime, current) values('Winter Semester 2018', '201810', '1514782800000', '1527652800000', 'false');
insert into terms(description, code, starttime, endtime, current) values('Fall Semester 2017', '201740', '1504238400000', '15146964000... |
/* ***************************************** */
/* SETTING PART */
/* ***************************************** */
CREATE TABLE `setting` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`constrained` char(1) NOT NULL,
`data_type` varchar(255) NOT NULL,
`type` var... |
CREATE TABLE IF NOT EXISTS validator_group_summary
(
id BIGSERIAL NOT NULL,
time_interval VARCHAR NOT NULL,
time_bucket TIMESTAMP WITH TIME ZONE NOT NULL,
index_version INT NOT NULL,
address ... |
SET search_path = "residence";
DROP FUNCTION IF EXISTS generate_rut(INTEGER, INTEGER);
DROP FUNCTION IF EXISTS generate_last_digit(TEXT);
DROP FUNCTION IF EXISTS generate_rut_arr(INTEGER, INTEGER, INTEGER);
CREATE OR REPLACE FUNCTION generate_rut(l INTEGER, u INTEGER) RETURNS TEXT AS
$func$
DECLARE
rut TEX... |
<reponame>jleiva-gap/Ed-Fi-Analytics-Middle-Tier<gh_stars>1-10
-- 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 ... |
/*
* This file is released under the terms of the Artistic License. Please see
* the file LICENSE, included in this package, for details.
*
* Copyright (C) 2003 <NAME> & Open Source Development Lab, Inc.
*
* Based on TPC-C Standard Specification Revision 5.0 Clause 2.8.2.
*/
CREATE OR REPLACE FUNCTION new_order... |
<gh_stars>1-10
-- [er] create table with self reference foreign key but no pk
create table p2 (b int , a int,FOREIGN KEY (a) REFERENCES p2(a));
select attr_name, is_nullable from db_attribute where class_name = 'p2';
select * from db_index where class_name = 'p2';
select * from p2;
drop p2;
|
-- creating table
CREATE TABLE ACTOR (
ID NUMBER,
FNAME VARCHAR2(30),
LNAME VARCHAR2(30),
GENDER VARCHAR2(1)
);
CREATE TABLE MOVIE (
ID NUMBER,
NAME VARCHAR2(150),
YEAR NUMBER
);
CREATE TABLE DIRECTORS (
ID NUMBER,
FNAME VARCHAR2(30),
LNAME VARCHAR2(30)
);
CREATE TABLE CASTS (... |
<gh_stars>0
-- change statspack SQL collection levels
-- limit to very high usage SQL
-- this is based on the SAP PRD instance
begin
statspack.modify_statspack_parameter(
i_disk_reads_th => 100000
, i_executions_th => 500000
, i_parse_calls_th => 1000 /* default value */
, i_buffer_gets_th => 1000000
)... |
INSERT INTO "users" ("id", "user_name", "first_name", "last_name", "address", "gender", "password", "email", "contact_no", "category", "status", "access_group_id", "created_at", "updated_at", "deleted_at") VALUES
(1, 'admin', 'Firstml,', 'Last', 'Admin Address', 'Male', '$2y$08$xufrecDh9uLyxbMujgax1O5Z2uZpQHbGP3I3BbdvX... |
-- Deploy yabon-prono:view-three_last_bet_incoming to pg
BEGIN;
-- Crée une view qui renvoit les 3 dernier paris quand elle et appeler
CREATE VIEW three_last_bet_incoming AS
SELECT
bet.*,
"match".id AS matchId, "match".host_team, "match".visitor, "match".odds_1,"match".odds_2,"match".odds_draw, "match".score_host, ... |
<reponame>fabianjimenez21/positive
SET SESSION sql_mode="NO_AUTO_CREATE_USER";
ALTER TABLE `phppos_giftcards` ADD `customer_id` INT( 10 ) NULL DEFAULT NULL AFTER `value`;
ALTER TABLE `phppos_giftcards`
ADD CONSTRAINT `phppos_giftcards_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `phppos_customers` (`person_id`);... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.