sql stringlengths 6 1.05M |
|---|
<reponame>Wbondar/eurobug-db
DELIMITER ENDROUTINE
CREATE PROCEDURE party_type_create
(
IN arg_party_type_meta ${ARTICLE_META_TYPE}
, OUT arg_party_type_id ${PARTY_TYPE_ID_TYPE}
)
LANGUAGE SQL
NOT DETERMINISTIC
MODIFIES SQL DATA
SQL SECURITY DEFINER
BEGIN
START TRANSACTION
;
CALL nextval ('seq... |
<filename>src/leetcode/database/risingTemperature.sql
-- MySQL
SELECT w1.Id
from Weather w1,
Weather w2
WHERE w1.Temperature > w2.Temperature
AND DATEDIFF(w1.RecordDate, w2.RecordDate) = 1;
|
<reponame>flexsocialbox/una
SET @sName = 'bx_xero';
-- TABLES
DROP TABLE IF EXISTS `bx_xero_contacts`;
-- STUDIO PAGE & 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`.`wi... |
<gh_stars>1-10
create procedure [dbo].[dnn_UpdateBannerClickThrough]
@BannerId int,
@VendorId int
as
update dbo.dnn_Banners
set ClickThroughs = ClickThroughs + 1
where BannerId = @BannerId
and VendorId = @VendorId
|
create table if not exists entry_item
(
entry_number integer,
sha256hex varchar
);
insert into entry_item (entry_number, sha256hex)
select entry_number,
sha256hex
from entry;
|
CREATE FUNCTION udf_GetRating (@productName VARCHAR(MAX))
RETURNS VARCHAR(9)
AS
BEGIN
DECLARE @averageRate DECIMAL(4,2) = (SELECT AVG(f.Rate)
FROM Feedbacks AS f
JOIN Products AS p
ON p.Id = f.ProductId
WHERE p.[Name] = @productName);
DEC... |
--##############################################################################
--
-- SAMPLE SCRIPTS TO ACCOMPANY "SQL SERVER 2017 ADMINISTRATION INSIDE OUT"
--
-- © 2018 <NAME>
--
--##############################################################################
--
-- CHAPTER 12: IMPLEMENTING HIGH AVAILABILITY AND DISA... |
-- e_fkey.test
--
-- execsql {
-- INSERT INTO artist VALUES(3, '<NAME>r.');
-- UPDATE track SET trackartist = 3 WHERE trackname = 'Mr. Bojangles';
-- INSERT INTO track VALUES(15, '<NAME>', 3);
-- }
INSERT INTO artist VALUES(3, '<NAME>r.');
UPDATE track SET trackartist = 3 WHERE trackname = 'Mr. Bojangles';... |
<filename>src/test/resources/sql/create_aggregate/b99d60b9.sql
-- file:polymorphism.sql ln:246 expect:true
CREATE AGGREGATE myaggn05b(BASETYPE = int, SFUNC = tfnp, STYPE = int[],
INITCOND = '{}')
|
<filename>src/test/resources/sql/select/2caf1843.sql<gh_stars>10-100
-- file:object_address.sql ln:120 expect:true
SELECT pg_get_object_address('tablespace', '{one}', '{}')
|
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
DECLARE @xe_filename nvarchar(255) = N'blocked_process_report_name*.xel' --modify here
DECLARE @begin_time datetime
DECLARE @end_time datetime
set @begin_time = '2020/06/23 17:00:00' --modify here
set @end_time = '2020/06/23 18:00:00' --modify here
SELECT
event_typ... |
DROP TABLE GenericFile_metadata IF EXISTS;
DROP TABLE GenericFile_reference IF EXISTS;
DROP TABLE products IF EXISTS;
CREATE TABLE GenericFile_metadata
(
product_id int NOT NULL,
element_id varchar(1000) NOT NULL,
metadata_value varchar(2500) NOT NULL
);
CREATE TABLE GenericFile_reference
(
product_id int NOT... |
--"Sex" assignments are from MEPS, source: https://meps.ahrq.gov/mepsweb/data_stats/download_data_files_codebook.jsp?PUFId=PROJYR15&varName=SEX
SELECT DISTINCT
t1.dupersid,
t2.perwtf AS person_weight,
t1.rxndc,
CASE WHEN t2.sex = 1 THEN 'M'
WHEN t2.sex = 2 THEN 'F'
END AS gender,
t2.agelas... |
DROP TABLE team_configs;
DROP INDEX last_report_idx;
DROP TABLE gerrit_users;
DROP INDEX updated_at_idx;
DROP TABLE inline_comments;
|
<reponame>UltimateSoftware/DOI<gh_stars>1-10
IF OBJECT_ID('[DOI].[spRefreshMetadata_User_IndexPartitions_RowStore_InsertData]') IS NOT NULL
DROP PROCEDURE [DOI].[spRefreshMetadata_User_IndexPartitions_RowStore_InsertData];
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE PROCEDURE [DOI].[spRefreshMetad... |
SET SESSION query_cache_type = OFF;
EXPLAIN EXTENDED SELECT sum(l_extendedprice* (1 - l_discount)) as revenue FROM lineitem, part WHERE (p_partkey = l_partkey and p_brand = 'Brand#12' and p_container in ('SM CASE', 'SM BOX', 'SM PACK', 'SM PKG') and l_quantity >= 1 and l_quantity <= 1 + 10 and p_size between 1 and 5 ... |
CREATE USER user_ro WITH PASSWORD '';
GRANT CONNECT ON DATABASE discover_demo TO user_ro;
GRANT USAGE ON SCHEMA demo TO user_ro;
GRANT SELECT ON ALL TABLES IN SCHEMA demo TO user_ro;
ALTER DEFAULT PRIVILEGES IN SCHEMA demo GRANT SELECT ON TABLES TO user_ro;
CREATE USER user_rw WITH PASSWORD '';
GRANT CONNECT ON DATABA... |
INSERT INTO submissions (poll_id, submitter_name, submitter_email, submission_time)
VALUES
('1','1 fake submitter name','1 fake email','2003-04-12 04:05:00 America/New_York'),
('2','2 fake submitter name','2 fake email','2003-04-12 04:05:01 America/New_York'),
('3','3 fake submitter name','3 fake email','2003-04-12 04... |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : dongda
Source Server Version : 50718
Source Host : localhost:3306
Source Database : dongda
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding : 65001
Date: 2017-07-30 23:18:17
*/
SET FOREIGN_KEY_CHECKS=... |
<reponame>njuro/FarmAssignment
SET standard_conforming_strings = OFF;
BEGIN;
INSERT INTO "public"."country" ("wkb", "iso3", "name")
VALUES ('0106000020E61000000200000001030000000100000004000000DC9AADBCE4D74EC0A4AEEFC3410631405825917D90F14EC0741EA33CF31A314078AB3C81B0E54EC0C474B0FECF293140DC9AADBCE4D74EC0A4AEEFC34106314... |
<filename>gretl/sql/createHoheitsgrenzenSchema.sql
CREATE SCHEMA
agi_hoheitsgrenzen_pub
;
CREATE TABLE
agi_hoheitsgrenzen_pub.hoheitsgrenzen_kantonsgrenze
(
t_id bigserial NOT NULL,
t_ili_tid uuid NULL DEFAULT uuid_generate_v4(),
kantonsname varchar(255) NOT NULL,
kanton... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: matriz_riesgo
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.28-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@C... |
<reponame>renatodaltiba/authenticatednest-with-refreshtoken
-- AlterTable
ALTER TABLE "users" ALTER COLUMN "deletedAt" DROP NOT NULL;
|
<reponame>AagonP/hospital-database-project<filename>Data/care.sql
insert into care (nid, pid) values (51, 1);
insert into care (nid, pid) values (52, 2);
insert into care (nid, pid) values (53, 3);
insert into care (nid, pid) values (54, 4);
insert into care (nid, pid) values (55, 5);
insert into care (nid, pid) values... |
# Host: localhost (Version 5.5.5-10.1.16-MariaDB)
# Date: 2017-02-12 18:01:40
# Generator: MySQL-Front 6.0 (Build 1.21)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "productos"
#
DROP TABLE IF EXISTS `productos`;
CREATE TABLE `productos` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(100) COL... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 23, 2021 at 09:42 AM
-- Server version: 10.4.18-MariaDB
-- PHP Version: 7.4.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 08 نوفمبر 2020 الساعة 13:29
-- إصدار الخادم: 10.1.38-MariaDB
-- PHP Version: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
ALTER TABLE eg_wf_matrix ALTER COLUMN currentstatus TYPE character varying(128); |
<reponame>OpenDRR/opendrr-data-store
SELECT
a.sauid AS "Sauid",
CAST(CAST(ROUND(CAST(c.censuspop AS NUMERIC),6) AS FLOAT) AS NUMERIC) AS "E_CensusPop",
CAST(CAST(ROUND(CAST(c.censusdu AS NUMERIC),6) AS FLOAT) AS NUMERIC) AS "E_CensusDU",
CAST(CAST(ROUND(CAST(AVG(COALESCE(c.censuspop/NULLIF(c.censusdu,0),0)) AS NUMERIC)... |
vacuum;
begin;
--
-- Orphan attributes
--
delete from server_relation_attribute as extra
where not exists (
select 1
from attribute
where attribute.attribute_id = extra.attribute_id and
attribute.type = 'relation'
) or not exists (
select 1
from server
join servertype_attribute using ... |
ALTER TABLE `robots` DROP FOREIGN KEY robots_ibfk_3;
ALTER TABLE `robots` DROP `map_id`;
DROP TABLE maps; |
/*
Weather Observation Station 10
Query the list of CITY names from STATION that do not end with vowels.
Your result cannot contain duplicates.
*/
/* solution one */
/*
SELECT DISTINCT city FROM station
WHERE
right(city,1) NOT IN ('a','e','i','o','u');
*/
/* solution two */
SELECT DISTINCT city FROM... |
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SPC_TRANSLATION_ACT2]') AND type IN (N'P', N'PC'))
DROP PROCEDURE [dbo].[SPC_TRANSLATION_ACT2]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[SPC_TRANSLATION_ACT2]
@P_post_id NVARCHAR(15) = ''
... |
/* interactive-short-4 */
select COALESCE(m_ps_imagefile,'')||COALESCE(m_content,''), m_creationdate
from message
where m_messageid = 1236950581248;
|
-- 09/07/2010 Paul. Not sure why we are dropping this view after creating it, but it does not appear to be used anywhere.
-- 09/10/2010 Paul. This was just an old version of the view. Move to the top.
if exists (select * from INFORMATION_SCHEMA.VIEWS where TABLE_NAME = 'vwDETAILVIEWS_USERS')
Drop View dbo.vwDE... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.5 (Debian 13.5-1.pgdg110+1)
-- Dumped by pg_dump version 14.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_con... |
-- there is probably a better way to write this.
WITH segments_15 AS
(SELECT
watershed_group_code,
downstream_barrier_id_15,
downstream_barrier_id_20,
downstream_barrier_id_30,
downstream_barrier_id_structure,
st_length(ST_Union(geom)) as length_segment
FROM cwf.segmented_streams
WHERE downstream_barrier_id... |
postgres=# -d seismic -c "CREATE EXTENSION postgis;"
postgres-# -d seismic -c "CREATE EXTENSION postgis_topology;"
postgres-# -d seismic -c "CREATE EXTENSION postgis_sfcgal;"
postgres-# -d seismic -c "CREATE EXTENSION fuzzystrmatch"
postgres-# -d seismic -c "CREATE EXTENSION fuzzystrmatch"
postgres-# -d seismic -c "CRE... |
<filename>db/create_db.sql
-- -----------------------------------------------------
CREATE DATABASE Library;
USE Library ;
DROP TABLE IF EXISTS `Library`.`Books` ;
CREATE TABLE IF NOT EXISTS `Library`.`Books` (
`BookId` INT NOT NULL AUTO_INCREMENT,
`Title` VARCHAR(255) NOT NULL,
`Author` UNT NOT NULL,
`ISBN` VARC... |
<filename>db/schema.sql
DROP DATABASE IF EXISTS employees_db;
CREATE DATABASE employees_db;
USE employees_db;
CREATE TABLE department(
id INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR(30),
PRIMARY KEY(id)
);
CREATE TABLE roles(
id INTEGER NOT NULL AUTO_INCREMENT,
title VARCHAR(30),
salary DECIMAL,
department_id INTE... |
-- comando para ver los motores de bases datos que soporta mysql
show engines;
-- comando par ver las bases de datos
show databases;
-- seleciona una base de datos por defecto
use ejemplo;
-- mostar las tablas que tiene un schema o bse de datos
show tables;
-- conetarse a la base de datos desde consola
mysql --h... |
<reponame>fishtown-analytics/outbrain
select
{{ dbt_utils.surrogate_key('fromdate', 'campaignid') }} as id,
to_date(fromdate, 'yyyy-mm-dd') as date_day,
campaignid as campaign_id,
impressions,
clicks,
conversions,
spend
from {{var('performance_table')}}
|
/****** Object: View [dbo].[V_GetPipelineJobPriority] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_GetPipelineJobPriority]
AS
SELECT AJ.AJ_jobID AS Job,
AJ.AJ_priority AS Priority
FROM dbo.T_Analysis_Job AS AJ
WHERE (AJ.AJ_StateID IN (1, 2, 8))
GO
GRANT VIEW DE... |
<gh_stars>100-1000
alter table ProcessInstanceLog add column slaCompliance integer;
alter table ProcessInstanceLog add column sla_due_date timestamp;
ALTER TABLE NodeInstanceLog ADD COLUMN slaCompliance integer;
ALTER TABLE NodeInstanceLog ADD COLUMN sla_due_date timestamp;
|
<filename>backend/api/fixtures/11_user_color.sql
insert into user_color (user_id, index, color)
values
('1f241e1b-b537-493f-a230-075cb16315be', 0, -15134965),
('1f241e1b-b537-493f-a230-075cb16315be', 1, -15134964),
('1f241e1b-b537-493f-a230-075cb16315be', 2, -15134963),
('1f241e1b-b537-493f-a230-075cb16... |
<reponame>dave-c-vt/digital_wra_data_standard
-- These PostgreSQL statements are a relational database representation of the
-- IEA Wind Task 43 Wind Energy Digitalization Standardized Data Model
-- Running these SQL statements in a PostgreSQL database will create the database
-- schema and insert named reference valu... |
<filename>mysql/projects/sage/views/olympiad_line_level_vw.sql
/*
name: olympiad_aggression_vw, olympiad_bowl_vw, olympiad_box_vw, olympiad_climbing_vw, olympiad_gap_vw, olympiad_lethality_vw, olympiad_observation_vw, olympiad_sterility_vw, olympiad_trikinetics_vw
mv: NONE
app: Line Level Reports
... |
use yii2basic;
CREATE TABLE `product_categories` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
`order` int(10) unsigned NOT NULL,
`parent_id` int(10) unsigned DEFAULT NULL,
`image` varch... |
alter table "analytics"."ContentItemStats" rename to "ContentGroupStats";
|
<reponame>bogdanghita/public_bi_benchmark-master_project<gh_stars>0
CREATE TABLE "TrainsUK1_1"(
"Date" date NOT NULL,
"Number of Records" smallint NOT NULL,
"Test" smallint NOT NULL
);
|
CREATE DATABASE babyoga;
USE babyoga;
CREATE TABLE APP_REQUEST(
APP_ID SMALLINT(5) NOT NULL AUTO_INCREMENT,
FNAME CHAR(10) NOT NULL,
SNAME CHAR(14) NOT NULL,
EMAIL VARCHAR(20) NOT NULL,
PHONE_NUM DECIMAL(10) NULL,
PRIMARY KEY(APP_ID)
);
-- Insert into t... |
CALL insert_all_dates('1944-01-01','2000-11-01');
CALL insert_all_genres(',');
CALL insert_all_countries(',');
CALL insert_all_actors(',');
CALL insert_all_directors(',');
-- dim_duration
insert into dim_duration (id_interval_duration,class_duration) values (1,'Duration up to two hours');
insert into dim_duration (id_... |
<reponame>Michal3456/4bti
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Czas generowania: 06 Gru 2021, 22:51
-- Wersja serwera: 10.4.22-MariaDB
-- Wersja PHP: 7.3.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<filename>packages/jobs/deploy/schemas/app_jobs/tables/jobs/triggers/increase_job_queue_count.sql<gh_stars>0
-- Deploy schemas/app_jobs/tables/jobs/triggers/increase_job_queue_count to pg
-- requires: schemas/app_jobs/schema
-- requires: schemas/app_jobs/tables/jobs/table
BEGIN;
CREATE FUNCTION app_jobs.tg_increase_jo... |
<filename>master_kasir.sql
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.31-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 11.2.0.6213
-- --------------------... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Počítač: 127.0.0.1
-- Vytvořeno: Ned 06. čen 2021, 21:54
-- Verze serveru: 10.4.14-MariaDB
-- Verze PHP: 8.0.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... |
UPDATE a
SET count_of_screened_in_reports = b.count_of_screened_in_reports
,screened_in_rate = b.screened_in_rate
FROM annual_report.non_cfsr_safety AS a
LEFT JOIN (SELECT
cd.fiscal_year_date
,reg.old_region_cd AS 'region'
,0 AS 'order'
,COUNT(*) 'count_of_screened_in_reports'
,COUNT(*) * 1.0 / sa... |
/*********************************************************************************************************************
**
** Procedure Name : h3giCreditCheckQueueRemoveOrder
** Author : <NAME>
** Date Created : 11/08/2011
**
*****************************************************... |
insert into
songs
(title)
values
(:title) |
prompt --application/shared_components/files/css_21_2_flows4apex_dark_css
begin
-- Manifest
-- APP STATIC FILES: 100
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.03.31'
,p_release=>'20.1.0.00.13'
,p_default_workspace_id=>2400405578329584
,p_default_application_id=>100
,p_default_i... |
<gh_stars>0
DELIMITER /
INSERT INTO KRNS_PARM_T (APPL_NMSPC_CD, NMSPC_CD, PARM_DTL_TYP_CD, PARM_NM, OBJ_ID, VER_NBR, PARM_TYP_CD, TXT, PARM_DESC_TXT, CONS_CD)
VALUES('KC', 'KC-GEN', 'All', 'EMAIL_NOTIFICATIONS_ENABLED', UUID() , 1, 'CONFG', 'Y', 'Enables email notifications to be sent.', 'A')
/
DELIMITER ;
|
<reponame>nainaiyun/nainai-shop
use nn;
create table if not exists `shop_info` (
`id` varchar(64) not null comment '店铺编号',
`user_id` int(11) not null unique comment '用户编号',
`logo` varchar(255) default '' comment '店铺标识',
`name` varchar(100) not null comment '店铺名称',
`synopsis` varchar(255) not null comment '... |
-- PMTCT LOOKUPS
IF NOT EXISTS(SELECT * FROM LookupItem WHERE Name='pnc-encounter')
BEGIN
INSERT INTO LookupItem (Name,DisplayName,DeleteFlag) VALUES('pnc-encounter','pnc-encounter',0);
END
IF NOT EXISTS(SELECT * FROM LookupItemView WHERE ItemName='pnc-encounter' AND MasterName='EncounterType')
BEGIN
INSERT INTO L... |
SELECT
_TABLE_SUFFIX AS client,
cdn,
COUNT(0) AS requests,
AVG(respSize) / 1024 AS avg_resp_kbytes,
APPROX_QUANTILES(respSize, 1000)[OFFSET(500)] / 1024 AS median_resp_kbytes
FROM
`httparchive.summary_requests.2021_07_01_*`,
UNNEST(SPLIT(_cdn_provider, ', ')) AS cdn
GROUP BY
client,
cdn
ORDER BY
req... |
<reponame>0xffff00/skean
create table IF NOT EXISTS `navy_ship` (
`code` varchar (150),
`name` varchar (150),
`weight` int,
`birth_year` int,
`create_time` datetime,
`update_time` datetime
);
create table IF NOT EXISTS `navy_fleet` (
`country_code` varchar (150),
`code` varchar (150),
`name` varchar ... |
CREATE DATABASE cattle COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8';
CREATE DATABASE cattle_base COLLATE = 'utf8_general_ci' CHARACTER SET = 'utf8';
CREATE USER 'cattle'@'%' IDENTIFIED BY 'cattle';
CREATE USER 'cattle'@'localhost' IDENTIFIED BY 'cattle';
GRANT ALL ON cattle.* TO 'cattle'@'%';
GRANT ALL ON cattle.... |
-- +++
-- parent: 1528395933
-- +++
BEGIN;
ALTER TABLE lsif_uploads ADD COLUMN reference_count int;
COMMENT ON COLUMN lsif_uploads.reference_count IS 'The number of references to this upload data from other upload records (via lsif_references).';
COMMENT ON COLUMN lsif_uploads.num_references IS 'Deprecated in favor o... |
CREATE TABLE causas (
causa nvarchar (25) NOT NULL,
causa_en nvarchar (25) NULL
);
CREATE TABLE diccionario (
orden smallint NOT NULL ,
nombre_campo nvarchar (30) NOT NULL ,
descripcion_campo nvarchar (180) NULL ,
label_campo nvarchar (60) NULL ,
label_campo_en nvarchar (60) NULL ,
pos_x smallint NULL ... |
BEGIN;
ALTER TYPE "device_status" RENAME TO "device_status_";
CREATE TYPE "device_status" AS ENUM ('online', 'offline');
ALTER TABLE "device"
ALTER COLUMN "status" TYPE "device_status" USING 'offline';
ALTER TABLE "device"
ALTER COLUMN "status" SET NOT NULL;
DROP TYPE "device_status_";
COMMIT;
|
-- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
--------------------------------------------------------------------------------
--
-- File name: TPT helper functions (TPT = Tanel Poder's Tuni... |
<filename>src/main/resources/tpcds_2_4/q67.sql
--q67.sql--
select * from
(select i_category, i_class, i_brand, i_product_name, d_year, d_qoy, d_moy, s_store_id,
sumsales, rank() over (partition by i_category order by sumsales desc) rk
from
(select i_category, i_class, i_brand, i_produ... |
<filename>engine.jaxb/src/test/resources/org/opencds/cqf/cql/engine/execution/ElmTests/Regression/qdm2020/VTEICU-4.0.000.cql
library VTEICU version '4.0.000'
using QDM version '5.5'
include MATGlobalCommonFunctions version '5.0.000' called Global
parameter "Measurement Period" Interval<DateTime>
context Patient
de... |
<gh_stars>0
DELIMITER $$
DROP PROCEDURE if exists `enrollClass`;
CREATE PROCEDURE `enrollClass`(IN amount int(11),
IN userId int(11),
IN InstructorId int(11),
IN classId int(11),
OUT resultEnroll varchar(255),
OUT enrollMessage varchar(255))
BEGIN
DECLARE EXIT HANDLER FOR SQLEXCEPTION
BEGIN
ROLLBACK;... |
<filename>sql/f48056_page_12.sql
prompt --application/set_environment
set define off verify off feedback off
whenever sqlerror exit sql.sqlcode rollback
--------------------------------------------------------------------------------
--
-- ORACLE Application Express (APEX) export file
--
-- You should run the script co... |
<reponame>michal-jewczuk/batch-for-science
INSERT INTO invoice(id, client_id, amount, is_paid)
VALUES(1, 101, 2000, true);
INSERT INTO invoice(id, client_id, amount, is_paid)
VALUES(2, 101, 3000, false);
INSERT INTO invoice(id, client_id, amount, is_paid)
VALUES(3, 101, 4000, false);
INSERT INTO invoice(id, client... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 08 Jul 2021 pada 15.40
-- Versi server: 10.4.14-MariaDB
-- Versi PHP: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
USE Bank
GO
CREATE PROC usp_DepositMoney (@AccountId INT, @MoneyAmount DECIMAL(18, 4))
AS
IF (@MoneyAmount > 0)
BEGIN
UPDATE Accounts
SET Balance += @MoneyAmount
WHERE Id = @AccountId
END
GO
EXEC usp_DepositMoney 1, 10
SELECT * FROM Accounts |
<gh_stars>0
-- Revert database-message-store:indexes/messages_category from pg
BEGIN;
DROP INDEX message_store.messages_category;
COMMIT;
|
-- How To Gather/Backup ASM Metadata In A Formatted Manner version 10.1, 10.2, 11.1, 11.2 and 12.1? (Doc ID 470211.1)
-- Author: <NAME>
-- Property: Oracle Corporation
SPOOL ASM1_GENERIC_ASM_METADATA.html
-- ASM VERSIONS 10.1, 10.2, 11.1, 11.2 & 12.1
SET MARKUP HTML ON
SET ECHO ON
SET PAGESIZE 200
ALTER SESSION SE... |
SELECT
requirements.id,
courses.name as course,
requirements.name,
requirements.description,
requirements.degree,
requirements.sdate,
requirements.edate,
CASE WHEN requirements.file IS NOT NULL THEN true ELSE false END AS file,
requirements.activities as tries,
requirements.nu,
requirements.publi... |
<reponame>Daniel-Fonseca-da-Silva/Car_Showroom
CREATE DATABASE mydb;
CREATE TABLE car(id SERIAL PRIMARY KEY,
name VARCHAR(255),
description VARCHAR(255),
url_photo VARCHAR(255),
url_video VARCHAR(255),
latitude VARCHAR(255),
longitude VARCHAR(255),
category VARCHAR(255)
);
|
INSERT INTO BlogPost (Title, Content)
VALUES ('My Awesome Post', 'Write something witty here...')
INSERT INTO BlogPost (Title, Content)
OUTPUT INSERTED.BlogPostId
VALUES ('My Awesome Post', 'Write something witty here...')
INSERT INTO BlogPost (Title, Content)
OUTPUT INSERTED.BlogPostId
VALUES ('My Awesome Post', 'Wr... |
<reponame>SkillsFundingAgency/das-assessor-service<filename>src/SFA.DAS.AssessorService.Database/Tables/CertificateBatchLogs.sql<gh_stars>1-10
CREATE TABLE [dbo].[CertificateBatchLogs]
(
[Id] [uniqueidentifier] NOT NULL DEFAULT NEWID(),
[CertificateReference] NVARCHAR(50) NOT NULL,
[BatchNumber] [int] NOT NULL,
[C... |
select * from dbt_ls_e2e_dataset.test_table1 |
<reponame>Shuttl-Tech/antlr_psql
-- file:tsdicts.sql ln:76 expect:true
CREATE TEXT SEARCH DICTIONARY hunspell_num (
Template=ispell,
DictFile=hunspell_sample_num,
AffFile=hunspell_sample_num
)
|
<gh_stars>0
/*---------------------------------
Task 1 of 3
Brief
- Write a series of queries to answer questions about a database of songs
Distribution code
- songs.db
Key concept:
- SQL queries
-----------------------------------*/
/* Return names of all songs in order of tempo (single column table) */
SELECT na... |
<reponame>SmallkingDev/Capital
-- #!sqlite
-- #{ capital
-- # { init
-- # { sqlite
CREATE TABLE IF NOT EXISTS acc (
id TEXT PRIMARY KEY,
value INTEGER NOT NULL,
touch TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- #&
CREATE INDEX IF NOT EXISTS acc_touch ON acc(touch);
-- #&
CREATE TABLE IF NOT... |
<filename>www/upgrade/56/pgsql.sql
CREATE TABLE %DB_TBL_PREFIX%sessions
(
id varchar(32) NOT NULL primary key,
access int DEFAULT NULL,
data text DEFAULT NULL
);
create index "%DB_TBL_PREFIX%idxAccess" on %DB_TBL_PREFIX%sessions(access);
|
-- Tags: no-ordinary-database, no-fasttest
-- Tag no-ordinary-database: Sometimes cannot lock file most likely due to concurrent or adjacent tests, but we don't care how it works in Ordinary database
-- Tag no-fasttest: In fasttest, ENABLE_LIBRARIES=0, so rocksdb engine is not enabled by default
DROP TABLE IF EXISTS 0... |
-- People
INSERT INTO people (id, handle, name)
VALUES
(1, 'batman', '<NAME>'),
(2, 'user', '<NAME>'),
(3, 'catwoman', '<NAME>'),
(4, 'daredevil', '<NAME>'),
(5, 'alfred', '<NAME>'),
(6, 'dococ', '<NAME>'),
(7, 'zod', 'Dru-Zod'),
(8, 'spiderman', '<NAME>'),
(9, 'ironman', '<NAME>'),
... |
insert into usuario(id, nombre,email,fecha_creacion) values(1,'test','<EMAIL>',now()) |
<filename>examples/showcase/src/test/resources/data/import-data.sql
insert into SS_USER (ID,LOGIN_NAME,NAME,EMAIL,PASSWORD,SALT,STATUS,TEAM_ID) values(1,'admin','Admin','<EMAIL>','691b14d79bf0fa2215f155235df5e670b64394cc','7efbd59d9741d34f','enabled',1);
insert into SS_USER (ID,LOGIN_NAME,NAME,EMAIL,PASSWORD,SALT,STATU... |
CREATE SCHEMA `ak47_cms` DEFAULT CHARACTER SET utf8 ;
SHOW TABLES;
DESC stock_index;
DESC news_artical;
SELECT *
FROM news_artical;
SELECT *
FROM stock_index;
SELECT count(*)
FROM news_artical;
select count(*) from news_artical;
SELECT *
FROM finance_info_calendar;
DELETE from finance_info_calendar;
SELECT co... |
<gh_stars>100-1000
define SimpleMessage: Message(1, true, '100', 'Message', 'Test Message')
define ListMessage: Message({ 1, 2, 3 }, true, '500', 'Error', 'Test Error') |
<gh_stars>100-1000
library ChlamydiaScreeningCDS version '1'
/*
* CDS implementation based on USPSTF recommendation:
* screen for chlamydia (and gonorrhea) in sexually active women age 24 and younger,
* and in older women at increased risk for infection;
* applies to all sexually active adolescents and adults, incl... |
<filename>dsf-fhir/dsf-fhir-server/src/main/resources/db/trigger_functions/on_subscriptions_insert.sql<gh_stars>10-100
CREATE OR REPLACE FUNCTION on_subscriptions_insert() RETURNS TRIGGER AS $$
BEGIN
PERFORM on_resources_insert(NEW.subscription_id, NEW.version, NEW.subscription);
RETURN NEW;
END;
$$ LANGUAGE PLPGSQL |
-- predictability
SET synchronous_commit = on;
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot_p', 'test_decoding');
SELECT 'init' FROM pg_create_logical_replication_slot('regression_slot_t', 'test_decoding', true);
SELECT pg_drop_replication_slot('regression_slot_p');
SELECT 'init' FROM pg_cre... |
CREATE FUNCTION [dbo].[fnGetTwitterProfilesWithFunding]
(
@twitterUserNetwork nvarchar(100)
)
RETURNS TABLE
AS
RETURN
(
SELECT TA.*,
[dbo].fnGetTwitterAccountUrlByUserName(Username) as TwitterProfileUrl
FROM TwitterAccount TA WITH (NOLOCK)
WHERE CONTAINS(TA.ProfileDescription, '"FUNDING" OR "#FUNDING" OR "CAPITA... |
<gh_stars>0
-- AlterTable
ALTER TABLE `User` MODIFY `username` VARCHAR(256) NOT NULL;
|
ALTER TABLE executions ALTER COLUMN spec SET NOT NULL;
-- ALTER TABLE executions ALTER COLUMN result SET DEFAULT {};
ALTER TABLE executions ALTER COLUMN execution_error_output SET DEFAULT '';
ALTER TABLE executions ALTER COLUMN pod_name SET DEFAULT ''; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.