sql stringlengths 6 1.05M |
|---|
<filename>migrations/100.000-schmaless-data.sql
alter table infect_sample_storage."data" drop column "bacteriumId";
alter table infect_sample_storage."data" drop column "antibioticId";
alter table infect_sample_storage."data" drop column "ageGroupId";
alter table infect_sample_storage."data" drop column "regionId";
al... |
<reponame>hackforla/tdm-calculator
UPDATE CalculationRule SET
description='<ol style="margin-left:1em">
<li> Education, Marketing and Outreach: Offer new employees and residents a
packet of materials and/or provide personal consultation detailing sustainable (non-SOV)
travel options. These materials or consultati... |
<gh_stars>10-100
-- file:updatable_views.sql ln:22 expect:true
CREATE VIEW ro_view12 AS SELECT * FROM generate_series(1, 10) AS g(a)
|
<reponame>Z3r4t05/FPT
create proc cau25
@units int
as
select p.ProductID, ProductName, sum(Quantity) as 'Total Orderd'
from Products p, Orders o, [Order Details] od
where p.ProductID = od.ProductID and od.OrderID = o.OrderID
group by p.ProductID, ProductName
having sum(Quantity) >= @units
exec cau25 1200 |
<gh_stars>0
CREATE TABLE employees (
emp_no int NOT NULL PRIMARY KEY,
birth_date date,
first_name varchar,
last_name varchar,
gender varchar,
hire_date date
);
CREATE TABLE departments (
dept_no varchar PRIMARY KEY,
dept_name varchar
);
CREATE TABLE dept_emp (
emp_no int REFERENCES employees(emp_no),
dept_n... |
ALTER TABLE db_version CHANGE COLUMN required_12269_14_mangos_gossip_menu_option required_12278_01_mangos_creature_template bit;
ALTER TABLE creature_template DROP COLUMN spell1, DROP COLUMN spell2, DROP COLUMN spell3, DROP COLUMN spell4;
|
DROP DATABASE IF EXISTS employeeTrackerdb;
CREATE DATABASE employeeTrackerdb;
USE employeeTrackerdb;
CREATE TABLE departments (
id INT AUTO_INCREMENT,
department_name VARCHAR(30),
PRIMARY KEY (ID)
);
CREATE TABLE roles (
id INT AUTO_INCREMENT,
title VARCHAR (30),
salary DECIMAL(10,2),
de... |
<reponame>jgke/tagger<gh_stars>0
--liquibase formatted sql
--changeset jgke:3
-- Unique tag values means destruction.
DELETE FROM tags_sources;
DELETE FROM tags;
ALTER TABLE types ADD CONSTRAINT types_has_unique_value UNIQUE (value);
--rollback ALTER TABLE types DROP CONSTRAINT types_has_unique_value;
ALTER TABLE ta... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.10-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.3.0.4984
-- ------------------------------------------------... |
select count(*) saves
from c_involvement I inner join c_opportunity O
on (I.exterior -> 'opportunity') @> (O.exterior -> 'uid')
where (I.exterior -> 'mode')::integer = 20 and (O.exterior ->> 'slug') = $1;
|
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.7 (Ubuntu 11.7-0ubuntu0.19.10.1)
-- Dumped by pg_dump version 11.7 (Ubuntu 11.7-0ubuntu0.19.10.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_str... |
-- @required(hanaMinimumVersion,2.0.30)
-- @required(hanaMaximumVersion,2.99.999)
-- ================================================================
-- APL_AREA, CREATE_MODEL_AND_TRAIN, using a binary format for the model
-- This script creates a model, guesses its description and trains it
--
-- Assumption 1: the use... |
--
-- Dump all sysName from DB
--
select ENUM.NAME,MIB.NAME,OBJECT.NAME,ENUM.VALUE from ENUM inner join OBJECT,MIB on ENUM.ID=OBJECT.EKEY and MIB.ID=OBJECT.MIB where OBJECT.NAME='pt1020v2TTmplPerfiOutPQsName';
|
CREATE TABLE public.impediment(
id SERIAL NOT NULL,
name VARCHAR (50),
description VARCHAR (500),
id_sprint INT,
CONSTRAINT impediment_PK PRIMARY KEY (id),
CONSTRAINT impediment_sprint_FK FOREIGN KEY (id_sprint) REFERENCES public.sprint(id)
)WITHOUT OIDS;
|
CREATE DATABASE `EE1420`;
|
<filename>br/tests/lightning_duplicate_detection/data/dup_detect.tg.0.sql
insert into tg values (33, '8b1aa8fc', -1247978202022681942);
insert into tg values (11, '99050bb1', -7690739410741425251);
insert into tg values (4, '8bf31981', 6907987814819587017);
insert into tg values (28, '8db565d5', 3316723411966181279);
i... |
--
-- Test, run Bitmap Heap Scan on AO/AOCS table's sparse bitmap index.
-- Here start two transactions in the same time to insert tuples
-- into different seg file. Then create bitmap index on it.
-- This will lead to very sparse bitmap index.
-- Since the tid in bitmap index for AO is composed of segfile no,
-- and r... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 27, 2016 at 02:56 PM
-- Server version: 5.7.17
-- PHP Version: 5.6.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
SELECT age
FROM test/fixtures/tables/people_camel
WHERE "Hello " ++ True AND 4 = "world"
|
-- @testpoint: opengauss关键字explain(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists explain_test cascade;
create table explain_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor explain for select * from explain_test order by 1;
close explain;
end;
--关键字带双引号-成功
start transaction;
cursor "explain" for sele... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 02, 2018 at 08:27 AM
-- Server version: 5.7.20-0ubuntu0.16.04.1
-- PHP Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4010... |
<reponame>jalh24/qidoBack
-- MySQL dump 10.13 Distrib 8.0.26, for Win64 (x86_64)
--
-- Host: localhost Database: quinoDev
-- ------------------------------------------------------
-- Server version 8.0.25-0ubuntu0.20.10.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER... |
SELECT *
FROM top_movies_collection.movie
WHERE LOWER(title) LIKE 'd%' OR id LIKE 3 order by id;
|
┌─────────┬───────┬──────┐
│ Country │ Goals │ Mins │
├─────────┼───────┼──────┤
│ Spain │ 11 │ 1849 │
│ Spain │ 16 │ 3129 │
│ Spain │ 28 │ 2940 │
│ Spain │ 13 │ 2842 │
│ Spain │ 13 │ 1745 │
│ Spain │ 25 │ 2634 │
│ Spain │ 11 │ 1967 │
│ Spain │ 13 │ 2694 │
│ Spain │ 19 │ 235... |
/*
###########################################################
-- Name: usp_tables.sql
-- Type: Stored Procedure
-- Author: Someone
-- Purpose: Lists tables
###########################################################
*/
if(object_id('usp_tables') is not null)
drop procedure usp_tables
GO
create procedure usp_tables
as... |
<filename>resources/assets/sql/product_logs.sql
-- phpMyAdmin SQL Dump
-- version 4.8.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 27, 2018 at 12:35 PM
-- Server version: 10.1.33-MariaDB
-- PHP Version: 7.1.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTI... |
<gh_stars>0
CREATE TABLE portfolio
(
entid NUMBER(19) NOT NULL,
portfolio_name VARCHAR2(255),
CONSTRAINT pk_portfolio_entid PRIMARY KEY (entid)
);
CREATE UNIQUE INDEX porfolio_p_name_uix ON portfolio(portfolio_name);
CREATE TABLE application
(
entid NUMBER(19) NOT NULL,
artifactid VARCHAR2(255),
groupid VARC... |
<reponame>DrJohnT/devops-your-dwh<filename>SampleDWH/Databases/SqlScripts/UsefulScripts/SourceToTargetWikiText.sql
/*
{| class="wikitable"
!colspan="8"|Source to Target Mapping: Quantum to QuantumDM
|+
!colspan="5" |QuantumDM Data Mart View ||colspan="3" |Quantum Table
|+
!View Name ||Column Name ||Comment ||Data Type... |
<gh_stars>1-10
INSERT INTO LOCALIZACAO (BAIRRO, CIDADE, UF) VALUES
('<NAME>', 'Londrina', 'Paraná'),
('<NAME>', 'Rondonópolis', '<NAME>'),
('Parque Dois Irmãos', 'Fortaleza', 'Ceará'),
('Cafezinho', 'Ji-Paraná', 'Rondônia'),
('Seis de Agosto', 'Rio Branco', 'Acre'),
('Serrinha', 'Fortaleza', 'Ceará'),
('Monte Verde', '... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 21, 2020 at 04:39 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
ALTER TABLE `duel` ADD `du_finished` TIMESTAMP NULL DEFAULT NULL AFTER `du_questionTimerDuration`;
ALTER TABLE `results` ADD `re_last_time` TIMESTAMP NULL DEFAULT NULL AFTER `re_answers`;
CREATE PROCEDURE `removeOldDuels`(IN olderThan TIMESTAMP)
BEGIN
DELETE FROM `duel`
WHERE `du_finished` IS NOT NULL
... |
-- AlterTable
ALTER TABLE "dataset_dimensions" ADD COLUMN "input_transform" INTEGER[];
-- AlterTable
ALTER TABLE "datasets" ADD COLUMN "input_dimensions" TEXT[];
|
<reponame>dddreams/survey-design<filename>sql/surdes_v0.0.1.sql<gh_stars>1-10
/*
navicat premium data transfer
source server : localhost@surdes
source server type : mysql
source server version : 50727
source host : localhost:3306
source schema : surdes
target server type : mysql... |
SELECT DISTINCT
(SELECT COUNT(TargetGroupGUID)
FROM stagingDistributionGroupRole CR
WHERE SR.PrimarySmtpAddress = CR.PrimarySmtpAddress) As RoleCount ,SR.*
FROM
stagingRecipient SR
RIGHT JOIN
stagingDistributionGroupRole R
LEFT JOIN
recipientMap M
ON R.PrimarySmtpAddress = M.TCustomA... |
USE [DBAdata]
GO
/*
USE [DBAdata]
GO
drop table tbl_load_Inventory_CPU_RAM_count
go
CREATE TABLE [dbo].[tbl_load_Inventory_CPU_RAM_count](
servername varchar(200) not null primary key,
[Number_of_Logical_CPU] [int] NOT NULL,
[hyperthread_ratio] [int] NOT NULL,
[Number_of_Physical_CPU] [int] NULL,
[Total_Physica... |
-- =============================================
-- Create table specifying filegroups
-- =============================================
IF EXISTS (SELECT name
FROM sysobjects
WHERE name = N'<table_name, sysname, test_table>'
AND type = 'U')
DROP TABLE <table_name, sysname, test_table>
GO
CREAT... |
<reponame>nazar-pc/CleverStyle-Framework
CREATE TABLE IF NOT EXISTS `[prefix]shop_attributes` (
`id` int(11) NOT NULL,
`type` tinyint(4) NOT NULL,
`title` varchar(1024) NOT NULL,
`title_internal` varchar(1024) NOT NULL,
`value` text NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_unicode_ci;
CREA... |
--
-- make the tab of AD_Scheduler_Log readonly
-- 2018-06-01T13:59:35.736
-- URL zum Konzept
UPDATE AD_Tab SET IsInsertRecord='N', IsReadOnly='Y',Updated=TO_TIMESTAMP('2018-06-01 13:59:35','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=591
;
CREATE INDEX IF NOT EXISTS c_invoice_candidate_dateordered
ON pub... |
BEGIN;
-- Add the blacklist column
ALTER TABLE public.acos ADD COLUMN blacklisted boolean DEFAULT false;
-- Set all blacklisted with termination data = true
UPDATE public.acos
SET blacklisted = true
WHERE termination_details IS NOT NULL;
COMMIT; |
DROP DATABASE IF EXISTS employees_db;
CREATE DATABASE employees_db;
USE employees_db;
CREATE TABLE departments (
id INT PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(30) NOT NULL
);
CREATE TABLE roles (
id INT PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(30) NOT NULL,
salary DECIMAL NOT NULL,
departm... |
insert into PARTTERN_COL values('SEAT','START_DATE','CH_DATE',11,'YYYY-MM-DD');
insert into PARTTERN_COL values('SELL','START_DATE','CH_JUL',4,'YYYY-MM-DD');
insert into PARTTERN_COL values('SELL','STAT_DATE','CH_JUL',4,'YYYY-MM-DD');
insert into PARTTERN_COL values('SELL','ON_TIME','CH_DATE',17,'YYYY-MM-DD HH24:MI');
... |
INSERT INTO simplecourse.admin (id, email, name, password, salt, state, update_time, institute_id) VALUES (1, '<EMAIL>', 'admin', '0000', 'admin', 0, 1544552046, 3);
INSERT INTO simplecourse.admin (id, email, name, password, salt, state, update_time, institute_id) VALUES (2, 'teacher<EMAIL>', 'teacher', '0<PASSWORD>', ... |
/*
*********************
CONCEPT_NUMERIC
*********************
*/
ALTER TABLE concept_numeric
ADD CONSTRAINT fpk_concept_numeric_concept
FOREIGN KEY (concept_id) REFERENCES concept (concept_id);
ALTER TABLE concept_numeric
ADD CONSTRAINT fpk_concept_numeric_unit
FOREIGN KEY (unit_concept_id) REFERENC... |
/*
* Copyright 2019 - 2020 Crunchy Data Solutions, Inc.
* 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 applicable ... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
PRINT N'Dropping [edfi].[Session_DF_CreateDate]...... |
<reponame>nathnael/cats
CREATE PROCEDURE [dbo].[netsqlazman_ItemAttributeInsert]
(
@ItemId int,
@AttributeKey nvarchar(255),
@AttributeValue nvarchar(4000),
@ApplicationId int
)
AS
IF EXISTS(SELECT ItemId FROM dbo.[netsqlazman_Items]() WHERE ItemId = @ItemId) AND dbo.[netsqlazman_CheckApplicationPermissions](@Appl... |
DROP LIBRARY StringsLib cascade;
|
CREATE RULE docman_dlstats_doccreate_rule AS ON INSERT TO doc_data DO INSERT into docman_dlstats_doctotal_agg (downloads, docid) VALUES (0, lastval());
|
<gh_stars>0
Select S.Name
From (
Students S
join Friends F on S.ID = F.ID
join Packages P1 on S.ID = P1.ID
join Packages P2 on F.Friend_ID = P2.ID
)
Where P2.Salary > P1.Salary
Order By P2.Salary;
|
---------------------------------------------------------------
-- view: vw_holds
---------------------------------------------------------------
-- drop view vw_holds;
create or replace view vw_holds as
select
h.key,
u.id as user_id,
h.user_key,
i.id as item_id,
lp.policy_name as placed_library,
... |
<filename>Sql/SqlServer/dbo/Tables/WebsiteSubDomains.sql
CREATE TABLE [dbo].[WebsiteSubDomains] (
[websiteId] INT NOT NULL,
[subdomain] NVARCHAR (25) NOT NULL,
[domain] NVARCHAR (25) NOT NULL,
[datecreated] DATETIME NOT NULL,
CONSTRAINT [PK_WebsiteSubDomains] PRIMARY KEY ([... |
<filename>aula12.sql
use cadastro;
desc usuarios;
select * from usuarios;
select * from usuarios
where nome like 'C%'
order by sexo;
select * from usuarios
where nome like '%a%'
order by nome;
select * from usuarios
where nome like '_a%'
order by nome;
select distinct nacionalidade from usuarios
order by nacionali... |
<filename>Curso/03inserindoDados.sql
use cadastro;
insert into pessoas
(nome, nascimento, sexo, peso, altura, nacionalidade)
values
('maria', '2002-08-23', 'F', '45.0', '1.56', 'Brasil');
insert into pessoas
values
(default, 'tchurusbago', '2002-12-27', 'f', '78.0', '1.80', 'australia');
select * from pessoas;
# de... |
<reponame>uon-crissp/IQTools
if exists(select * from sysobjects where name='pr_Reports_HighVLRegister' and type='p')
drop proc pr_Reports_HighVLRegister
go
create proc pr_Reports_HighVLRegister @fromdate datetime, @todate datetime
as
begin
if exists(select * from sysobjects where name='tempEACForms' and type='u')
d... |
<gh_stars>1-10
SELECT MAX(id) FROM organizations));
SELECT MAX(id) FROM users));
|
CREATE VIEW [SalesLT].[vProductsForSearch]
AS
SELECT
[pm].[name],
[pm].[productModelId],
(CASE WHEN [pm].[name] LIKE '%-W' THEN 'Woman' WHEN [pm].[name] LIKE '%-M' THEN 'Man' ELSE 'Unisex' END) [sex],
[pm].[modifiedDate],
(SELECT cast(max(standardCost) AS float) FROM [SalesLt].[Product] WHERE [productModelId]=[pm]... |
-- bigrow.test
--
-- execsql {DELETE FROM t1 WHERE a='abc2'}
DELETE FROM t1 WHERE a='abc2' |
--==============================================================================
-- GPI - <NAME>
-- Desc: nls settings of the Session and the database
-- Date: September 2012
--
--==============================================================================
set linesize 130 pagesize 300
ttitle left "Ses... |
-- Callbacks
create table apm_package_callbacks (
version_id integer
constraint apm_package_callbacks_vid_fk
references apm_package_versions(version_id)
on delete cascade,
type varchar(40),
proc varcha... |
<filename>db/export.sql
--------------------------------------------------------
-- File created - péntek-április-08-2016
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Table AIRPLANES
----------------------------------------------------... |
<reponame>sammyjava/neptune<filename>jcms/sql/2007102401.sql<gh_stars>0
--
-- add/rename some search td styles
--
UPDATE appinfo SET appinfo_value='2007102401' WHERE appinfo_name='db_version';
UPDATE stylesheet SET class_name='td.search-input',num=4 WHERE class_name='td.search';
INSERT INTO stylesheet VALUES (482, 't... |
<reponame>jrharalson/almanac.httparchive.org
#standardSQL
# Prevalence of values for Server and X-Powered-By headers; count by number of hosts.
SELECT
client,
type,
resp_value,
total,
freq,
pct
FROM
(
SELECT
client,
'server' AS type,
resp_server AS resp_value,
SUM(COUNT(DISTIN... |
<gh_stars>1-10
truncate nw.payout cascade;
alter table nw.payout add column amount bigint;
alter table nw.payout add column fee bigint;
alter table nw.payout add column currency_code character varying;
alter table nw.payout add column wallet_id character varying;
|
<gh_stars>1-10
/*L
Copyright SAIC, Ellumen and RSNA (CTP)
Distributed under the OSI-approved BSD 3-Clause License.
See http://ncip.github.com/national-biomedical-image-archive/LICENSE.txt for details.
L*/
spool c:\temp\acrin_collection_name_change.log
update general_image gi set gi.project='CT Co... |
<gh_stars>0
CREATE TABLE public.spot_tags(
id serial PRIMARY KEY,
user_actions_id integer NOT NULL,
users_id integer NOT NULL,
tags_id integer NOT NULL,
created_at timestamp without time zone NOT NULL,
updated_at timestamp without time zone NOT NULL,
is_active boolean DEFAULT true,
is_de... |
CREATE PROCEDURE [Monitoring].[SP_PopulateCommunication_Message]
@Trigger VARCHAR(100)
,@Activity VARCHAR(100)
,@RunID INT
AS
INSERT INTO [Monitoring].[MonitoringTimestamps]
VALUES (@Activity,@RunID,@Trigger,1,GETDATE(),NULL,NULL)
DECLARE @RowsAffected INT
,@LastRunTimestamp DATETIME
,@ProcessedTo ... |
<filename>script.sql
create table Country (
id int NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
code varchar(5) NOT NULL,
CONSTRAINT country_PK PRIMARY KEY (id)
);
create table CategoryType (
id_category_type int NOT NULL AUTO_INCREMENT,
country_code varchar(5) NOT NULL,
name varc... |
<reponame>JimShady/TubeAir
SELECT tube_pollution_mapping.date_time,
tube_pollution_mapping.concentration,
tube_pollution_mapping.line,
tube_pollution_mapping.previous_tube_stop,
tube_pollution_mapping.next_tube_stop,
previous.platform_depth AS previous_tube_stop_depth,
next.platform_depth AS next_tube_sto... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS reviews (
reviewId INT PRIMARY KEY,
date VARCHAR,
helpful INT,
images VARCHAR,
name VARCHAR,
pageId INT,
profilepicture VARCHAR,
stars DECIMAL,
text VARCHAR,
title VARCHAR,
username VARCHAR,
verified BOOLEAN
);
|
DROP TABLE public.coins;
DROP SCHEMA public; |
<reponame>brockinit/aws-wiki
create index page_idx on notes (page_id); |
<filename>1101-1200/1179. Reformat Department Table.sql
select
id,
sum(case when month = 'Jan' then revenue else null end) as Jan_Revenue,
sum(case when month = 'Feb' then revenue else null end) as Feb_Revenue,
sum(case when month = 'Mar' then revenue else null end) as Mar_Revenue,
sum(case when month = 'Apr' then reve... |
<reponame>isystk/kotlin-springboot-boilerplate<filename>business/src/main/resources/META-INF/com/isystk/sample/domain/dao/TPostDao/findOne.sql
-- 自動生成のため原則修正禁止!!
SELECT
/*%expand*/*
FROM
t_post
WHERE
/*%if criteria.postIdEq != null */
and POST_ID = /* criteria.postIdEq */1
/*%end*/
/*%if criteria.postIdNe != nul... |
CREATE FUNCTION trigger_function() RETURNS trigger AS
$BODY$
BEGIN
IF NEW.id > 1 THEN
INSERT INTO application_users(id, name, user_id) VALUES(NEW.id + 1000, 'Trigger','Trigger');
END IF;
RETURN NEW;
END;
$BODY$
LANGUAGE PLPGSQL;
CREATE TRIGGER trigger_function
BEFORE UPDATE
ON application_users... |
<reponame>code-signal/code-signal-arcade-databases
DROP PROCEDURE IF EXISTS orderAnalytics;
CREATE PROCEDURE orderAnalytics()
BEGIN
DROP TABLE IF EXISTS order_analytics;
CREATE TABLE order_analytics AS
SELECT id,YEAR(order_date) AS year , QUARTER(order_date) AS quarter, type, quantity*price AS total_p... |
<reponame>summertriangle-dev/arposandra<filename>maintenance/border/scripts/mig_border_fixed_data_202009.sql
--
-- Migrate old t10 tracking data to new t20 table.
-- Do not run on a live table, even though it shouldn't cause any issues.
--
INSERT INTO border_fixed_data_v4 (
serverid, event_id,
observation, ... |
<reponame>Shuttl-Tech/antlr_psql
-- file:geometry.sql ln:45 expect:true
SELECT '' AS one, p1.f1
FROM POINT_TBL p1
WHERE p1.f1 ?| point '(5.1,34.5)'
|
<reponame>fomosun/sql-challenge
-- Creating table schema
-- Departments Table
DROP TABLE departments
CREATE TABLE departments (
dept_no VARCHAR(10),
dept_name VARCHAR(30) NOT NULL,
PRIMARY KEY (dept_no)
);
select * from departments
-- Employees Table
-- One to One
DROP TABLE employees
CREATE TABLE employe... |
<reponame>fadlilahafalevi/fineract
-- Author : fanny.raharjo
DELETE FROM `m_permission` WHERE `code`='CREATE_FREQUENTJOURNALENTRY';
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`)
VALUES ('accounting', 'CREATE_FREQUENTJOURNALENTRY', 'FREQUENTJOURNALENTRY', 'CREATE', ... |
<gh_stars>0
-- Create temporary table with all data;
SELECT *
INTO temp_table
FROM public.identities;
-- delete old table;
DROP TABLE public.identities;
-- Create new table;
CREATE TABLE public.identities
(
tx_hash VARCHAR(128) NOT NULL, --Tx Hash of the identity creation
device_key VARCHAR(44) NOT NULL,... |
<filename>modules/core/db/update/postgres/13/131028-removeProcStage.sql
--$Id$
drop table WF_PROC_STAGE_PROC_ROLE;
drop table WF_CARD_STAGE;
drop table WF_PROC_STAGE;
drop table WF_PROC_STAGE_TYPE;
|
<gh_stars>0
create or replace package body pa_orcas_add_fk_idx_extension is
type t_index_map is table of varchar2(1000) index by varchar2(1000);
function run( p_input in ot_orig_model ) return ot_orig_model
is
v_input ot_orig_model := p_input;
v_orig_table ot_orig_table;
v_orig_index ot_orig_index;
... |
<filename>tests/queries/0_stateless/02271_temporary_table_show_rows_bytes.sql
-- NOTE: database = currentDatabase() is not mandatory
CREATE TEMPORARY TABLE 02271_temporary_table_show_rows_bytes (A Int64) Engine=Memory as SELECT * FROM numbers(1000);
SELECT database, name, total_rows, total_bytes FROM system.tables WHE... |
/****** Object: Table [dbo].[T_Biomaterial_Organisms] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_Biomaterial_Organisms](
[Biomaterial_ID] [int] NOT NULL,
[Organism_ID] [int] NOT NULL,
CONSTRAINT [PK_T_Biomaterial_Organisms] PRIMARY KEY CLUSTERED
(
[Organism_ID] ASC,
... |
ALTER TABLE `Organizations` DROP `EnrollmentCode`;
ALTER TABLE `Organizations` DROP `Type`;
alter table Organizations add email varchar(255);
|
int test6() {
1 = x;
}
|
/*
# Fonte: https://leetcode.com/problems/customers-who-never-order/
# Name: <NAME>
# Data: 12/01/2022
Table: Customers
+-------------+---------+
| Column Name | Type |
+-------------+---------+
| id | int |
| name | varchar |
+-------------+---------+
id is the primary key column for this table... |
/**
* ID: 00607
* Title: Sales Person
* Difficulty: Easy
* Description: Table: SalesPerson
*
* +-----------------+---------+ | Column Name | Type | +-----------------+---------+ | sales_id | int | | name | varchar | | salary | int | | commission_rate | int | | hire_date | date | +-----------------+---------+ s... |
<gh_stars>0
CREATE TABLE city (
id int(7) NOT NULL AUTO_INCREMENT,
name varchar(50) NOT NULL,
url_name varchar(50) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE zona (
id int(7) NOT NULL AUTO_INCREMENT,
name varchar(50) NOT NULL,
refCity int(7) NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (refCity) REFERENCE... |
<gh_stars>0
SELECT Weather.id FROM Weather
INNER JOIN Weather as Yesterday ON DateDiff(DAY, Yesterday.recordDate, Weather.recordDate) = 1
WHERE Weather.Temperature > Yesterday.Temperature; |
<gh_stars>0
create function watch.get_watcher (
payload anyelement,
matched_ boolean default true
)
returns setof _watch.watcher
language sql
security definer
stable
as $$
select t
from watch.cached_match_f(payload) w -- updated by watch.reset_cached_fs
join _watch.watcher t
... |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Апр 20 2016 г., 21:26
-- Версия сервера: 5.6.17
-- Версия PHP: 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 */;
/*!4... |
SELECT
IFNULL(
ROUND(
COUNT(DISTINCT session_id) / COUNT(DISTINCT user_id),
2
),
0
) AS average_sessions_per_user
FROM
Activity
WHERE
DATEDIFF('2019-07-27', activity_date) < 30 |
<reponame>flaviaouyang/Sages-Femmes-du-Quebec-Database
-- connect to the database
CONNECT to SF;
INSERT INTO Mother (RAMQNum, mname, email, phone, dob, address, profession, bloodtype)
VALUES ('CONC97582511', '<NAME>', '<EMAIL>', '1-603-267-4782', '08/25/1997',
'974-8333 Sapien. Ave', 'Doctor', 'AB')
, ('M... |
<reponame>sayanchakrabort1/cart<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 28, 2019 at 04:13 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SE... |
alter table t_lc_call_record modify column create_time datetime(0);
alter table t_lc_report_day_process modify column average_effective_call_code_num varchar(20);
ALTER TABLE t_lc_org_speechcraft_conf add start_call_time varchar(20) DEFAULT NULL COMMENT '呼叫开始时间';
ALTER TABLE t_lc_org_speechcraft_conf add end_call_tim... |
<gh_stars>1-10
INSERT INTO system_message(id,content) VALUES (1,'First Level Message');
INSERT INTO system_message(id,content) VALUES (2,'Second Level Message');
INSERT INTO system_message(id,content) VALUES (3,'Third Level Message');
INSERT INTO acl_class (id, class) VALUES
(1, 'org.baeldung.acl.persistence.enti... |
<gh_stars>100-1000
-- Studio page and widget
DELETE FROM `tp`, `tw`, `tpw`
USING `sys_std_pages` AS `tp`, `sys_std_widgets` AS `tw`, `sys_std_pages_widgets` AS `tpw`
WHERE `tp`.`id` = `tw`.`page_id` AND `tw`.`id` = `tpw`.`widget_id` AND `tp`.`name` = 'bx_help_tours';
-- Main Tables
DROP TABLE IF EXISTS `bx_help_tours`... |
-- DATA ENGINEERING
-- Create the tables and import the data
-- Drop the tables if exists
DROP TABLE IF EXISTS departments;
DROP TABLE IF EXISTS dept_emp;
DROP TABLE IF EXISTS dept_manager;
DROP TABLE IF EXISTS employees;
DROP TABLE IF EXISTS salaries;
DROP TABLE IF EXISTS titles;
-- IMPORT DATA TABLE TYPES AND KEYS
... |
<gh_stars>0
create table rekening(
kd_rekening int(11) default null,
nm_rekening char(30) default null,
keterangan char(30) default null,
primary key (kd_rekening))
Engine = innoDB default charset= utf8;
INSERT INTO `rekening` (`kd_rekening`, `nm_rekening`,`keterangan`) VALUES
(100, '<NAME>','default'),
(200, 'AKTIVA ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.