sql stringlengths 6 1.05M |
|---|
<reponame>hettie-d/NORM<gh_stars>10-100
drop schema if exists norm cascade;
create schema norm;
set search_path to norm;
--
create table account(
account_id bigserial,
username text,
last_name text,
first_name text,
dob date,
constraint account_pk primary key (account_id)
);
create table phone_type (
phone_type_id i... |
<gh_stars>100-1000
set session role=usertest37;
CREATE SEQUENCE myseq START 1;
|
<filename>indexes/uq_contactroles.sql
CREATE UNIQUE INDEX id_UNIQUE ON contactroles(id ASC);
|
<filename>application/libraries/Phpgrid/examples/SampleDB/postgres_db.sql
-- Table: test1
-- DROP TABLE test1;
CREATE TABLE test1
(
id_s integer NOT NULL DEFAULT nextval('test1_id_seq'::regclass),
b2 character(1),
a1 character(1),
CONSTRAINT test1_pkey PRIMARY KEY (id_s)
)
WITH (OIDS=FALSE);
ALTER... |
DROP TRIGGER TI_Asigna_Transac_ID;
DROP TRIGGER ERPADMIN.TI_Asigna_Transac_ID;
CREATE TRIGGER ERPADMIN.TI_Asigna_Transac_ID ON ERPADMIN.SOLICITUD_SERVICIO
FOR INSERT
AS
BEGIN
DECLARE @id_transaccion varchar(250)
exec sp_getbindtoken @id_transaccion output
UPDATE ERPADMIN.SOLICITUD_SERVICIO
SET ... |
/*
Navicat SQL Server Data Transfer
Source Server : 192.168.10.118
Source Server Version : 110000
Source Host : 192.168.10.118\HIS12:1433
Source Database : common_project
Source Schema : dbo
Target Server Type : SQL Server
Target Server Version : 110000
File Encoding : 65001... |
select
TaxonList = tl.ITEM_NAME
,itn.*
from
TAXON_LIST tl
join
TAXON_LIST_VERSION tlv
on tl.TAXON_LIST_KEY = tlv.TAXON_LIST_KEY
join
TAXON_LIST_ITEM tli
on tlv.TAXON_LIST_VERSION_KEY = tli.TAXON_LIST_VERSION_KEY
join
INDEX_TAXON_NAME itn
on tli.TAXON_LIST_ITEM_KEY = itn.TAXON_LIST_ITEM_K... |
<filename>quizci.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 04, 2018 at 08:38 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone... |
<filename>src/com/company/Database/HolidaymakerDB.sql
--
-- File generated with SQLiteStudio v3.3.3 on ons jan 12 14:55:33 2022
--
-- Text encoding used: System
--
PRAGMA foreign_keys = off;
BEGIN TRANSACTION;
-- Table: Bookings
DROP TABLE IF EXISTS Bookings;
CREATE TABLE Bookings (
BookingID INTEGER PRIM... |
<gh_stars>0
insert into PRODUCT values (1, 'Batedeira Incrível', 'Batedeira que permite que você bata não só qualquer tipo de alimento, mas também diversos tipos de metal, pedras, tecidos e partes de animais.', 2499.99);
insert into PRODUCT values (2, 'Motor de embarcação', 'Motor de alta produtividade similar ao utili... |
<reponame>nizarrk/datamax
-- MySQL dump 10.13 Distrib 5.5.62, for Win64 (AMD64)
--
-- Host: localhost Database: datamax
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.38-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET... |
INSERT INTO users(email, username, password, last_login, added_at) VALUES('<EMAIL>', 'leonardom011', '123456', NOW(), NOW());
INSERT INTO categories(name, slug_name, added_at, created_by) VALUES('Potrepstine', 'potrepstine', NOW(), 1);
INSERT INTO categories(name, slug_name, added_at, created_by) VALUES('Hrana', 'hra... |
CREATE TABLE IF NOT EXISTS gps_records
(db_id INTEGER PRIMARY KEY,
device_id TEXT NOT NULL,
lng DECIMAL(9, 6) NOT NULL,
lat DECIMAL(9, 6) NOT NULL,
saved_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);
CREATE TABLE IF NOT EXISTS phonecall_records
(db_id INTEGER PRIMARY KEY... |
<reponame>tushartushar/dbSmellsData
select name, id from people'</strong>));
|
<reponame>BiproBhowmik/POS-Application-Laravel-Team-Work
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 14, 2021 at 08:25 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time... |
<gh_stars>1-10
insert into people (name,address) values('ndp', 'some where'); |
<filename>db_archive/sql_archive/509__api_create_schema.sql
if not exists (select * from INFORMATION_SCHEMA.SCHEMATA where SCHEMA_NAME='api') begin
EXEC dbo.sp_executesql @statement = N'create schema api';
end
|
<reponame>UWIT-IAM/uw-redcap-client
-- Deploy seattleflu/schema:roles/sample-editor/grants to pg
-- requires: roles/sample-editor/create
-- requires: warehouse/sample
begin;
grant connect on database :"DBNAME" to "sample-editor";
grant usage
on schema warehouse
to "sample-editor";
grant select
on warehouse... |
SELECT staff.name,staff.login_id,authentication_system.password
FROM staff
INNER JOIN authentication_system
ON staff.login_id = authentication_system.login_id;
SELECT staff.name,authentication_system.password
FROM staff
LEFT JOIN authentication_system
ON staff.login_id = authentication_system.login_id;
SELECT b... |
-- randexpr1.test
--
-- db eval {SELECT -11* -t1.b-t1.b+ -case when t1.e-(select max((select abs((cast(avg(t1.f) AS integer)+++ -cast(avg(a | a) AS integer))) from t1))+(( -max( -b))) from t1)<=(abs(11)/abs((select count(distinct t1.e) from t1)-b*case when t1.a<>11 then t1.a when 17 not between d and 13 or t1.f in (b... |
-- file:select_distinct_on.sql ln:19 expect:true
select distinct on (1) floor(random()) as r, f1 from int4_tbl order by 1,2
|
DROP DATABASE IF EXISTS C12-Employee_db;
CREATE DATABASE C12_Employee_db;
USE C12_Employee_db;
CREATE TABLE department(
id INTEGER AUTO_INCREMENT,
dep_name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE role(
id INTEGER AUTO_INCREMENT,
title VARCHAR(30) NOT NULL,
salary DECIMAL,
department_id ... |
<filename>fbwiki/mediawiki/maintenance/sqlite/archives/patch-pagelinks-fix-pk.sql
CREATE TABLE /*_*/pagelinks_tmp (
-- Key to the page_id of the page containing the link.
pl_from int unsigned NOT NULL default 0,
-- Namespace for this page
pl_from_namespace int NOT NULL default 0,
-- Key to page_namespace/pag... |
CREATE TABLE dashboard_board (
board_id bigint(20) NOT NULL AUTO_INCREMENT,
user_id varchar(50) NOT NULL,
category_id bigint(20) DEFAULT NULL,
board_name varchar(100) NOT NULL,
layout_json text,
PRIMARY KEY (board_id)
);
CREATE TABLE dashboard_category (
category_id bigint(20) NOT NULL AUTO_INCREMENT,
... |
--
-- This set of tests will test equijoins, HashAgg and VI splicing on
-- the table with data in parabolic distribution
--
--SET semicolon=OFF
--create tablespace DIST_TS datafile 'dist_ts.dat' size 192000K
create schema dist;
set schema 'dist';
create function dist.diffdiv10(int1 integer, int2 integer)
returns integ... |
/********************************************************************************
PRIOR RELEASE FROM CURRENT RELEASE FULL FILE
Assertion:
The current Description full file contains all previously published data
unchanged.
The current full file is the same as the prior version of the same full
file, except for... |
<filename>Bases de Datos/libreria.sql
USE [Libreria]
GO
/****** Object: Table [dbo].[Libros] Script Date: 11/16/2014 14:33:45 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Libros](
[id_libro] [int] NOT NULL,
[titulo] [varchar](50) NOT NULL,
[num_pag] [int] NO... |
<reponame>StratumORM/stratum-sql<gh_stars>1-10
print '
Generating template dynamic view triggers...'
IF OBJECT_ID('[dbo].[orm_meta_generate_template_view_triggers]', 'P') IS NOT NULL
DROP PROCEDURE [dbo].orm_meta_generate_template_view_triggers
go
create procedure [dbo].[orm_meta_generate_template_view_triggers]
... |
<filename>src/SFA.DAS.DATA.MANAGEMENT/StoredProcedure/CreateEmployerTransferRelationshipView.sql<gh_stars>0
CREATE PROCEDURE [dbo].[CreateEmployerTransferRelationshipView]
(
@RunId int
)
AS
-- ===========================================================================
-- Author: <NAME>
-- Create Date: 03/10/201... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Hôte : 127.0.0.1
-- Généré le : mar. 03 sep. 2019 à 23:14
-- Version du serveur : 10.1.34-MariaDB
-- Version de PHP : 7.2.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... |
CREATE DATABASE IF NOT EXISTS `blog` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `blog`;
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
--
-- Host: localhost Database: blog
-- ------------------------------------------------------
-- Server version 5.7.27-0ubuntu0.19.04.1
/*!40101 SET @OLD_CHARACTER_SET... |
<filename>Single Script/06 - Vistas/02 - EvoData - view_estructura_organizativa.sql
IF EXISTS ( SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'eor.estructura_organizativa_v')
AND type IN ( N'V' ) )
DROP VIEW eor.estructura_organizativa_v
GO
CREATE VIEW [e... |
-- 1. Modify it to show the population of Germany
SELECT population
FROM world
WHERE name = 'Germany'
-- 2. Show the name and the population for 'Sweden', 'Norway' and 'Denmark'.
SELECT name, population
FROM world
WHERE name IN ('Sweden', 'Norway', 'Denmark');
-- 3. Modify it to show the country and... |
<filename>LazyDBA/Source/Table/CachedSPByExecCnt.sql
CREATE TABLE [dbo].[CachedSPByExecCnt](
[CachedSPByExecCntId] INT IDENTITY(1,1) NOT NULL CONSTRAINT pkCachedSPByExecCnt PRIMARY KEY CLUSTERED,
[ReportDate] DATETIME2 NOT NULL,
[SP Name] [sysname] NOT NULL,
[Execution Count] [bigint] NOT NULL,
[Ca... |
select id,
datum::date,
pacient_prvni_zaznam::integer,
kum_pacient_prvni_zaznam::integer,
pocet_hosp::integer,
stav_bez_priznaku::integer,
stav_lehky::integer,
stav_stredni::integer,
stav_tezky::integer,
jip::integer,
kyslik::integer,
hfno::integer,
upv::integer,
ecmo::integer,
tezky_upv_ecmo::integer,
u... |
/*
* createTempTable.sql
* Chapter 10, Oracle10g PL/SQL Programming
* by <NAME>, <NAME> and <NAME>
*
* This script builds the TEMP_TABLE table.
*/
SET ECHO ON
BEGIN
FOR i IN (SELECT null
FROM user_tables
WHERE table_name = 'TEMP_TABLE') LOOP
EXECUTE IMMEDIATE 'DROP TABLE t... |
<gh_stars>0
-- The SQL*Plus script collection_user_9i.sql performs the following:
-- 1. Creates collection_user2
-- 2. Creates the database object and collection types
-- 3. Populates the database tables with example data
-- This script should be run by the system user (or the DBA)
CONNECT system/manager;
-- dr... |
CREATE PROCEDURE [dbo].[UnApplySBCAdjustments]
@EmployeeSBCAdjustmentsIds dbo.guidlisttabletype READONLY
AS
BEGIN TRAN TUnApplySBCAdjustments;
--Un apply salary adjustment of the calculating period
IF EXISTS (SELECT ID FROM @EmployeeSBCAdjustmentsIds)
BEGIN
DECLARE @EmployeeSBCAdjustmentTable AS TABLE(
[ID] [u... |
<filename>0_homeworks/SQL/1/Book by year.sql
use OneMorePubs
select
Book.name as 'Назва',
YEAR(Book.date) as 'Рік виходу',
Book.pub_id as 'Ід видавництва'
from
Book
where
YEAR(Book.date) > '2000' |
<reponame>bart-kosmala/fakers
-- select 1
SELECT id, first_name, pesel
FROM person
WHERE id = 4;
-- select 2
SELECT p.id, p.first_name, p.pesel, c.email, c.phone_number, a.street, a.location
FROM person p
JOIN person_address pa ON p.id = pa.person_id
JOIN address a ON a.id = pa.address_id
JOIN person_contact pc ON p.... |
<filename>database/Ryu/old/mosacc.sql<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 18, 2019 at 12:36 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSA... |
-- file:plpgsql.sql ln:409 expect:true
create trigger tg_chkslotname before insert
on WSlot for each row execute procedure tg_chkslotname('WS')
|
<filename>app/queries/form-ba-acc.sql<gh_stars>1-10
DECLARE @strSql nvarchar(MAX)
SET @strSql = N'
SELECT
@prmMonth AS [Ay],
@prmYear AS [Yıl],
@prmFormType AS [Form Tipi],
@prmCurrency AS [Para Birimi],
'''' AS [Alt Şirket Kodu],
*
FROM (
SELECT
DEFINITION_ AS [Ad],
INCHARG... |
-- Dump for MySQL 5.X
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Schema petdb
-- -----------------... |
-- 1009 Number of condition eras outside valid observation period
select 1009 as analysis_id,
cast(null as varchar(255)) as stratum_1, cast(null as varchar(255)) as stratum_2, cast(null as varchar(255)) as stratum_3, cast(null as varchar(255)) as stratum_4, cast(null as varchar(255)) as stratum_5,
COUNT_BIG(ce1.P... |
<reponame>rares985/referee-management-tool
INSERT INTO county (name)
VALUES ('București'),
('Timiș'),
('Constanța'),
('Cluj'),
('Prahova'),
('Brașov'),
('Iași'),
('Ilfov'),
('Argeș'),
('Dolj'),
('Bihor'),
('Mureș'),
('Sibiu'),
('Arad'),
('Bacău'),
('Suceava'),
('Dâmbo... |
insert into users values ('admin', 'test.11', true);
insert into users values ('user', 'user', true);
insert into authorities values ('admin', 'ROLE_ADMIN');
insert into authorities values ('admin', 'ROLE_USER');
insert into authorities values ('user', 'ROLE_USER'); |
<filename>balance-transfer/foodsafety-master/docs/fuwa/fuwa.sql
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2017/8/22 2:22:16 */
/*=====================================================... |
IF OBJECT_ID('core.get_currency_code_by_office_id') IS NOT NULL
DROP FUNCTION core.get_currency_code_by_office_id;
GO
CREATE FUNCTION core.get_currency_code_by_office_id(@office_id integer)
RETURNS national character varying(50)
AS
BEGIN
RETURN
(
SELECT currency_code
FROM core.offices
WHERE core.offices... |
SELECT part_num, AVG(price) AS avg_price, AVG(quoted_price) AS avg_quoted_price
FROM orders NATURAL JOIN order_line NATURAL JOIN part
GROUP BY part_num; |
<gh_stars>1000+
{% set product = SQLiteRelation(['transformed', 'table']) %}
CREATE TABLE {{product}} AS
SELECT customer_id, SUM(value) AS value_per_customer
FROM {{upstream['filter']}}
GROUP BY customer_id |
-- USE `hotshare`;
DELIMITER //
/* USERS */
-- DROP TRIGGER IF EXISTS `bi_tbl_users`//
-- CREATE DEFINER = CURRENT_USER TRIGGER `bi_tbl_users` BEFORE INSERT ON tbl_users FOR EACH ROW
-- BEGIN
-- /*generate random string*/
-- DECLARE v_strRandCode VARCHAR(32) DEFAULT NULL;
-- SELECT MD5(UUID()) INTO v_strRandCode;
... |
<reponame>zonafets/TSQL-Utils
/* leave this
l:see LICENSE file
g:utility
v:080402\S.Zaglio: read from a registry (of MSSQLServer\MyGlobalVars branch) the value
*/
CREATE function fn__global_get(@variable sysname)
returns nvarchar(4000)
as
begin
declare @value nvarchar(4000)
EXECUTE master..xp_regread 'HK... |
DELETE FROM SuiteCategories
INSERT INTO SuiteCategories
VALUES ('DEV')
INSERT INTO SuiteCategories
VALUES ('TEST')
INSERT INTO SuiteCategories
VALUES ('PROD')
DELETE FROM Suites
INSERT INTO Suites
VALUES ('DEV - Web Services')
INSERT INTO Suites
VALUES ('TEST - Web Services')
INSERT INTO Suites
VALUES ('PROD - Web Ser... |
<filename>benchmark/Food/queries-vectorwise-disabled/13.sql
--SELECT SUM("Food_1"."Calculation_1553038251895332871") AS "TEMP(Calculation_1553038251932139544)(3520192934)(0)", SUM(1) AS "TEMP(Calculation_1553038251932139544)(3759786119)(0)", "Food_1"."vendor" AS "vendor" FROM "Food_1" WHERE (("Food_1"."vendor" NOT ... |
<filename>Schemas/slim.sql
-- MySQL dump 10.16 Distrib 10.1.22-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: rrsoft_cz
-- ------------------------------------------------------
-- Server version 10.1.22-MariaDB-1~xenial
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 11 Bulan Mei 2021 pada 18.33
-- Versi server: 10.4.16-MariaDB
-- Versi PHP: 7.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<filename>prisma/migrations/20210627033055_fifth/migration.sql
/*
Warnings:
- You are about to drop the column `last_name` on the `Being` table. All the data in the column will be lost.
- Added the required column `lastName` to the `Being` table without a default value. This is not possible if the table is not e... |
-- For testing foreign keys
DROP TABLE IF EXISTS public.sibling;
DROP TABLE IF EXISTS public.child;
DROP TABLE IF EXISTS public.adult;
CREATE TABLE IF NOT EXISTS public.adult (
id BIGINT CONSTRAINT adult_id_key PRIMARY KEY,
name TEXT
);
CREATE TABLE IF NOT EXISTS public.child (
id BIGINT CONSTRAINT child_id_key... |
<reponame>zhaiyjgithub/OpenSchedule
#drop table schedule_closed_date;
# use openSchedule;
drop table schedule_closed_date;
create table closed_date_settings
(
id int auto_increment,
npi int(12) not null,
start_date timestamp DEFAULT '2000-01-01 00:00:00',
end_date timestamp DEFAULT '2000-01-01 00:0... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 08-Set-2021 às 21:33
-- Versão do servidor: 10.4.19-MariaDB
-- versão do PHP: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
<filename>loan-service/src/main/resources/data.sql
insert into loan(id, loan_num, loan_type, loan_desc, loan_status, version, lock_id, user_id)
values(1, '1234567890', 'Mortgage Loan','Housing Refinance', 'CREATED', 1, 0, 1);
|
CREATE TABLE empty_table (
);
ALTER TABLE empty_table OWNER TO postgres;
|
<filename>litemall-db/sql/litemall_table.sql
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: litemall
-- ------------------------------------------------------
-- Server version 5.7.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT = @@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_C... |
<gh_stars>0
--
-- ER/Studio 8.0 SQL Code Generation
-- Company : SAne
-- Project : ModeladoBi07.DM1
-- Author : Joel
--
-- Date Created : Wednesday, February 26, 2020 11:28:16
-- Target DBMS : MySQL 5.x
--
--
-- TABLE: Asesor
--
create database solodesarrollos;
use solodesarrollos;
CREATE TABLE Ases... |
-- Arquivo de definição do esquema do banco
-- Automaticamente gerado através do dbdiagram.io (código em docs/diagrama.dbml)
CREATE TABLE "foods" (
"id" serial PRIMARY KEY,
"name" varchar,
"description" varchar,
"category" varchar,
"price" float,
"restaurant_id" integer
);
CREATE TABLE "restaurants" (
"... |
-- Copyright © <NAME> 2019
create function [dbo].[GetResourceName]
(
@InstanceId varchar(512)
)
returns varchar(150)
as
begin
return case when charindex('/', @InstanceId) > 0 then substring(@InstanceId, len(@InstanceId) - charindex('/', reverse(@InstanceId)) + 2, charindex('/', reverse(@InstanceId)) - 1) else @Insta... |
CREATE PROCEDURE tSQLt.Uninstall
AS
BEGIN
DROP TYPE tSQLt.Private;
EXEC tSQLt.DropClass 'tSQLt';
DROP ASSEMBLY tSQLtCLR;
END; |
<gh_stars>1-10
SELECT
a.blastprg AS BLAST_Program,
r.qry_name AS Contig_NAME,
r.hit_acc AS Hit_Accession_Number,
r.hit_desc AS Hit_Description,
r.hit_len AS Hit_Length,
r.evalue AS E_Value,
r.score AS Score,
r.i... |
<reponame>mamonovd/apgdiff
DROP TRIGGER IF EXISTS test_table_trigger ON test_table;
|
-- minmax.test
--
-- execsql {SELECT min(x) FROM t1 WHERE x>=5}
SELECT min(x) FROM t1 WHERE x>=5 |
<gh_stars>10-100
alter table "public"."offer" rename column "const_in_tokens" to "cost_in_tokens";
|
-- 11.02.2016 12:01:36 OEZ
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_Org_ID,AD_Reference_ID,AD_Table_ID,AllowZoomTo,ColumnName,Created,CreatedBy,Description,EntityType,FieldLength,Help,IsActive,IsAdvancedText,IsAllowLogging,IsAlwa... |
DROP TABLE IF EXISTS addresses_roles_types;
CREATE TABLE addresses_roles_types
(
pid TEXT PRIMARY KEY,
label TEXT
);
INSERT INTO addresses_roles_types (pid, label) VALUES ('role:buildingAccessPoint', 'building access point');
INSERT INTO addresses_roles_types (pid, label) VALUES ('role:buildingCentroid', 'b... |
<filename>sql/ace_init.sql
INSERT INTO company ( id, name ) VALUES ( 1, 'default' );
INSERT INTO tags ( id, name ) VALUES ( 1, 'whitelisted' );
INSERT INTO users ( id, username, password_hash, email, omniscience, timezone, display_name )
VALUES ( 1, 'ace', NULL, 'ace@localhost', 0, NULL, 'automation');
|
select
sub.company_contributors as contributors,
(sub.company_contributors * 100.0) / sub.{{type}}_distinct_contributors as percent_contributors,
(sub.known_contributors * 100.0) / sub.all_contributors as data_quality
from (
select count(distinct e.dup_actor_login) filter (where af.{{company_name}} = '{{company... |
DROP SCHEMA IF EXISTS nidx CASCADE;
CREATE SCHEMA nidx;
CREATE TABLE nidx.name_match (LIKE public.name_match INCLUDING DEFAULTS);
CREATE TABLE nidx.names_index (LIKE public.names_index INCLUDING DEFAULTS);
CREATE SEQUENCE nidx.names_index_id_seq START 1;
ALTER TABLE nidx.names_index ALTER COLUMN id SET DEFAULT nextval(... |
--TEST: test with tables with hash partition
create table stddev_pop_p_hash(
col1 date,
col2 time,
col3 timestamp,
col4 datetime,
col5 bigint
)
partition by hash(col3) partitions 5;
insert into stddev_pop_p_hash values('2000-12-12', '11:11:11', '1990-1-1 11:11:11', datetime'2011-11-11 11:11:11.111', 135);
ins... |
<reponame>zidingz/netdisco
BEGIN;
CREATE INDEX node_ip_idx_ip_active ON node_ip (ip, active);
COMMIT;
|
<gh_stars>0
INSERT INTO department
(name)
VALUES
('Sales'),
('Account Management'),
('HR'),
('Marketing');
INSERT INTO role
(title, salary, department_id)
VALUES
('Sales Manager', 110000, 1),
('Lead Salesperson', 96000, 1),
('Account Manager', 86500, 2),
('Junior Account Executi... |
-- awr_bracket_snaps.sql
/*
bracket days for snapshot reports
This example gets the snap_id value for Friday/Monday
between about 8:30 and 23:30 for each for each of these days.
Snapshots are at 30 minute intervals at approx the top and bottom of the hour.
*/
col snaps_to_get format a25
col awr_date format a15... |
<filename>db/sql/02_spend_breakdown_latest_date.sql
CREATE TABLE total_spent_gbp_by_user_latest_rate (
user_id INT,
total_spent_gbp NUMERIC
);
INSERT INTO total_spent_gbp_by_user_latest_rate
WITH numbered_exchange_rates AS (
SELECT
from_currency,
to_currency,
rate,
ROW_NUMBER() OVER (PARTITION BY... |
INSERT INTO `dict_cities` VALUES ('1101', '市辖区');
INSERT INTO `dict_cities` VALUES ('1201', '市辖区');
INSERT INTO `dict_cities` VALUES ('1301', '石家庄市');
INSERT INTO `dict_cities` VALUES ('1302', '唐山市');
INSERT INTO `dict_cities` VALUES ('1303', '秦皇岛市');
INSERT INTO `dict_cities` VALUES ('1304', '邯郸市');
INSERT INTO `dict_... |
/*
Script de implantação para DW_SUCOS
Este código foi gerado por uma ferramenta.
As alterações feitas nesse arquivo poderão causar comportamento incorreto e serão perdidas se
o código for gerado novamente.
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
... |
create database mydb;
-- Query OK, 1 row affected (0.02 sec)
use mydb;
-- Database changed
create table Department(did int primary key, dname varchar(20));
-- Query OK, 0 rows affected (0.05 sec)
create table Employee(empid int primary key auto_increment, ename varchar(20) not null, contactno int unique, salary int, di... |
CREATE TABLE [dbo].[User]
(
[Id] INT NOT NULL PRIMARY KEY,
[UserName] NVARCHAR(50) NOT NULL,
[Password] NVARCHAR(50) NOT NULL,
[FirstName] NVARCHAR(50) NOT NULL,
[LastName] NVARCHAR(50) NOT NULL
)
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 14, 2021 at 03:35 AM
-- Server version: 10.4.20-MariaDB
-- PHP Version: 7.4.22
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARAC... |
-- <Migration ID="f5d180f1-e271-41b6-b6ca-cbead5271c61" />
GO
/**************************************************************************
** CREATED BY: <NAME>
** CREATED DATE: 2017.08.16
** CREATION: Add a Discriminator attribute to the asp net identity roles & users tables.
***********************************... |
BACKUP AS COPY DATAFILE '/home/oracle/app/oracle/oradata/orcl/users01.dbf'; |
<gh_stars>0
INSERT INTO prog_file (pg_nm,prg_file) VALUES('Balance Process','advancerecover_proc');
INSERT INTO prog_file (pg_nm,prg_file) VALUES('Advance Outstanding','advanceoutstanding');
INSERT INTO prog_file (pg_nm,prg_file) VALUES('Advance Deduction','advancededuction');
INSERT INTO prog_file (pg_nm,prg_file) V... |
ALTER TABLE employees
ADD bonus INT NULL
GO |
<filename>SQL/roles.sql
CREATE TABLE roles(
id int NOT NULL,
name varchar(45),
PRIMARY KEY (id)
) |
/* Replace with your SQL commands */
DROP TABLE "USER" , "DEPARTMENT", "MENTOR", "AMBASSADOR"; |
<reponame>mario-martinez-proyecto1/db-ajedrez<filename>scripts/procedure/ok/p_enroque_l.sql
/*
procedimiento que realiza un enroque largo del jugador activo.
*/
SET SERVEROUTPUT ON
create or replace procedure p_enroque_l
is
--declare
mueven varchar2(9);
partida partidas.id_partida%type;
nFichas number(3);
mFichas ... |
<reponame>NeotomaDB/api_nodetest
SELECT
json_build_object( 'siteid', sts.siteid,
'sitename', sts.sitename,
'sitedescription', sts.sitedescription,
'sitenotes', sts.notes,
'geography', ST_AsGeoJSON(... |
/*
Calculate average value by year of student_loan for different combinations
of mental health and sex
Author: Iddibot, 2017-11-27 16:21:56
*/
SELECT
SUM(b.seed) - FLOOR(SUM(b.seed)) AS sum_seed,
SUM(a.student_loan + (ROUND(b.seed, 0) * 0.2 - 0.1) * a.student_loan) AS perturbed_total,
count(1) ... |
CREATE DATABASE IF NOT EXISTS `wonoly`;
|
DROP TABLE IF EXISTS table_company;
CREATE TABLE `table_company` (
`id` varchar(4) NOT NULL,
`name` varchar(10) NOT NULL,
`type` varchar(10) default NULL,
`contact` varchar(10) default NULL,
`phone` varchar(12) default NULL,
`fax` varchar(12) default NULL,
`email` varchar(20) default NULL,
`bank` varcha... |
<reponame>gfenoy/ZOO-Project<gh_stars>1-10
--------------------------------------------------------------------------------
--
-- PostgreSQL definition of tables required byt the ZOO-Kernel version >= 1.8.0
-- if the the rabbitmq option is activated
--
-- Copyright (C) 2020 GeoLabs SARL. All rights reserved.
-- Author:... |
CREATE VIEW "de.metas.handlingunits".CHK_HU_Storage_vs_Aggregated_TrxLines AS
select
hus.M_HU_ID, hus.M_Product_ID, hu.M_Locator_ID
, hu.HUStatus
, hu.IsActive
, (select piv.HU_UnitType from M_HU_PI_Version piv where piv.M_HU_PI_Version_ID=hu.M_HU_PI_Version_ID) as HU_UnitType
--
, hus.Qty, hus.C_UOM_ID
, hus.Updated... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.