sql stringlengths 6 1.05M |
|---|
<reponame>DEFRA/prsd-iws
CREATE TABLE [Business].[WasteCodeInfo](
[Id] [uniqueidentifier] NOT NULL,
[WasteCodeId] [uniqueidentifier] NOT NULL,
[WasteTypeId] [uniqueidentifier] NOT NULL,
[RowVersion] [timestamp] NOT NULL,
CONSTRAINT [PK_WasteCodeInfo] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STAT... |
DECLARE @operatorId INT = ??operatorId??;
SELECT id = CAST(sysoperators.id AS VARCHAR(10)),
name = sysoperators.name,
isEnabled = CAST(sysoperators.enabled AS BIT),
eMail = sysoperators.email_address,
categoryId = CAST(syscategories.category_id AS VARCHAR(10)),... |
-- This file and its contents are licensed under the Apache License 2.0.
-- Please see the included NOTICE for copyright information and
-- LICENSE-APACHE for a copy of the license.
CREATE OR REPLACE FUNCTION _timescaledb_internal.partialize_agg(arg ANYELEMENT)
RETURNS BYTEA AS '@MODULE_PATHNAME@', 'ts_partialize_agg'... |
<filename>paraflow-benchmark/src/main/resources/sql/nation.sql
CREATE TABLE nation(n_nationkey int primary key, n_name varchar(25), n_regionkey int references region(r_regionkey), n_comment varchar(152)); |
--
-- Copyright 2021 Red Hat Inc.
-- SPDX-License-Identifier: Apache-2.0
--
DROP FUNCTION IF EXISTS public.trfn_attach_date_range_partition();
CREATE OR REPLACE FUNCTION public.trfn_attach_date_range_partition() RETURNS TRIGGER AS $$
DECLARE
alter_stmt text = '';
msg text = '';
BEGIN
IF NEW.active != OLD.a... |
<filename>migrate/migrations/20180315113303-strict-rotation-state.sql<gh_stars>1000+
-- +migrate Up
ALTER TABLE rotation_state
DROP CONSTRAINT rotation_state_rotation_participant_id_fkey,
ADD CONSTRAINT rotation_state_rotation_participant_id_fkey
FOREIGN KEY (rotation_participant_id)
REFERENCE... |
<filename>sql/_17_sql_extension2/_02_full_test/_05_date_time_function/_08_second/cases/second_007.sql
--pass out-of-range data of time/timestamp/datetime type to the parameter
--1. [error] out-of-range argument: time type
select second(time'24:00:00');
select second(time'25:30:59 pm');
select second(time'4:71:45 a... |
INSERT INTO employees (first_name, last_name, department, email)
VALUES ('demoFN', 'demoLN', 'IT', '<EMAIL>'); |
<filename>SOFTTEK/softtek.scms.net/SOFTTEK.SCMS.DB/Procedures/spSRAGetEmployeeByToken.sql
CREATE PROCEDURE [dbo].[spSRAGetEmployeeByToken]
@token_id nvarchar(50)
AS
SELECT
[TBL_SRA_EMPLOYEE].id,
[TBL_SRA_EMPLOYEE].area,
[TBL_SRA_EMPLOYEE].[role],
[TBL_SRA_PERSON].id as "person_id",
[TBL_SRA_PERSON].ide... |
create table if not exists subscribe_details
(
subscribe_id integer not null
constraint subscribe_details_subscribe_id_fk
references subscribe
on update cascade on delete set null,
id integer not null,
date date,
from_country varchar(3) not null
... |
<reponame>Vladislav-Zolotaryov/L2J_Levelless_Custom<filename>L2J_DataPack/sql/updates/20100528update.sql
ALTER TABLE `custom_teleport` ADD `itemId` decimal(11,0) NOT NULL default '57' AFTER `fornoble`;
UPDATE `custom_teleport` SET itemId = 13722 WHERE fornoble = 1; |
<gh_stars>0
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON... |
INSERT INTO pos_itemtemp VALUES("IATT190000525","193027","191001","192003","43000","1","43000","0","43000","1","1","1","IAT0106191008","NHO2018000007","PAID","","193027"),
("IATT190000525","193044","191001","192008","25000","1","25000","0","25000","1","1","1","IAT0106191008","NHO2018000007","PAID","","193044"),
("IATT1... |
CREATE SEQUENCE IF NOT EXISTS "augur_operations"."worker_oauth_oauth_id_seq"
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 620000
CACHE 1;
COMMENT ON TABLE "augur_operations"."augur_settings" IS 'Augur settings include the schema version, and the Augur API Key as of 10/25/2020. Future augur settings may... |
update eg_wf_matrix set nextstate='Close forwared By Approver' where objecttype ='WaterConnectionDetails' and additionalrule ='CLOSECONNECTION' and currentState = 'Close Connection By AE'; |
CREATE SCHEMA trainig;
ALTER SCHEMA trainig RENAME TO training;
CREATE TABLE new_table (id integer);
ALTER TABLE new_table RENAME TO newer_table;
ALTER TABLE newer_table
ADD COLUMN description TEXT;
ALTER TABLE newer_table
RENAME description TO descr;
ALTER TABLE newer_table
DROP descr;
A... |
USE WideWorldImporters
GO
CREATE TYPE Sales.OrderList
AS TABLE(
OrderID INT NOT NULL,
INDEX IX_OrderList_OrderID (OrderID)
)
WITH (MEMORY_OPTIMIZED = ON);
GO
|
create database PackageDelivery
go
USE PackageDelivery
GO
/****** Object: Table [dbo].[ADDR_TBL] Script Date: 1/16/2018 11:34:47 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[ADDR_TBL](
[ID_CLM] [int] IDENTITY(1,1) NOT NULL,
[STR] [char](300) NULL,
[CT_ST]... |
<gh_stars>10-100
CREATE TABLE room_imports (
id integer NOT NULL,
started_at timestamp without time zone default current_timestamp,
status character varying(50) NOT NULL
);
CREATE SEQUENCE room_imports_id_seq
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER SEQUENCE room_imports_id_seq OWNED BY r... |
create unique index unique_member_id_created on basic(member_id, created);
|
DROP TABLE job_spec; |
SELECT a.*, SUM(b.home) AS home, b.language, l.image, l.sef, l.title_native FROM iuz6l_menu_types AS a LEFT JOIN iuz6l_menu AS b ON b.menutype = a.menutype AND b.home != 0 LEFT JOIN iuz6l_languages AS l ON l.lang_code = language WHERE (b.client_id = 0 OR b.client_id IS NULL) GROUP BY a.id, a.menutype, a.description, a.... |
--
-- packages/acs-content-repository/sql/oracle/upgrade/upgrade-5.2.0b6-5.2.0b7.sql
--
-- @author <EMAIL>
-- @creation-date 2006-03-17
-- @cvs-id $Id: upgrade-5.2.0b6-5.2.0b7.sql,v 1.4 2015/12/04 13:49:58 cvs Exp $
--
-- replace package
create or replace package content_extlink
as
function new (
name i... |
/*
SQLyog Ultimate v11.11 (64 bit)
MySQL - 5.5.53 : Database - wallet
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=... |
<filename>microservicio/infraestructura/src/main/resources/sql/estado_agendamiento_historico/listar.sql
select id, creacion as ultimo_cambio, nombre as estado
from estado_agendamiento_historico
where agendamiento_id = :agendamientoId |
/**
* insert user
* usually you would use "random.uuid()" for uuid inserts, we we need references and therefore we use some uuid strings
*/
INSERT INTO user_entity (user_uuid, name, email, ip) VALUES ('c848cad7c3b2499a96888fb2a261313b', 'nik n', '<EMAIL>', '172.16.31.10');
INSERT INTO user_entity (user_uuid, name, ... |
<gh_stars>1-10
-- Name: CtpImportsByDateRangeUnprocessed
-- Schema: posda_files
-- Columns: ['import_time', 'num_unprocessed_files']
-- Args: ['granularity', 'from', 'to']
-- Tags: ['CTP transfers']
-- Description: Get list of CTP transfers in (i.e. import_event_id = 0
-- by date_range
--
select
date_trunc(?, file_... |
CREATE VIEW view3 AS
SELECT 1 AS c1
FROM table116
UNION
SELECT 1 AS c1
FROM table279
UNION
SELECT 1 AS c1
FROM table100
UNION
SELECT 1 AS c1
FROM view70
UNION
SELECT 1 AS c1
FROM view52
UNION
SELECT 1 AS c1
FROM view86;
GO |
<gh_stars>1000+
CREATE SCHEMA TestSchema;
CREATE TABLE TestSchema.TestTable
(
TextColumn text,
IntColumn integer
);
INSERT INTO TestSchema.TestTable (TextColumn, IntColumn)
VALUES ('Test_1', 42),
('Test_3', 44),
('Test_2', 43),
('Test_4', 45),
('Test_5', 46);
SELECT *
FROM TestSchem... |
/*
Ich brauche eine Tabelle für die Posts
Reihen:
- index (key)
- email-Adresse
- url zum Bild (eventuell nicht nötig, da benennung mit dem Datum, oder besser mit dem Index)
- Erstellungszeit (timestamp sollte ausreichend sein)
- beschreibung
*/
-- Datenbank "portofolio" erstellen
CREATE DATABASE portofolio;
-- ... |
<filename>sql/tables/Setting.sql
IF OBJECT_ID('dbo.Setting') IS NOT NULL
BEGIN
DROP TABLE dbo.Setting
IF OBJECT_ID('dbo.Setting') IS NOT NULL
PRINT '<<< FAILED DROPPING TABLE dbo.Setting >>>'
ELSE
PRINT '<<< DROPPED TABLE dbo.Setting >>>'
END
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER OFF... |
<filename>init.sql
CREATE DATABASE k8s;
\c k8s;
CREATE SCHEMA k8s; |
<filename>db/levels.sql
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3308
-- Waktu pembuatan: 07 Feb 2022 pada 03.49
-- Versi server: 10.4.22-MariaDB
-- Versi PHP: 7.4.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
--------------------------------------------------------------------------------
------------ 2 - FUNKCJA ZWRACA SREDNI WIEK ZAWODNIKOW W KLUBIE ----------------
--------------------------------------------------------------------------------
SET SERVEROUTPUT ON
CREATE OR REPLACE FUNCTION FUN_AVG_WIEKU_ZAW_KLUBU (I... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Сен 12 2020 г., 14:33
-- Версия сервера: 5.7.25
-- Версия PHP: 7.3.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... |
<gh_stars>0
-- 1. Create a query that returns the average cost for all courses. (Round to two
-- places).
SELECT
ROUND(AVG(cost), 2) AS "Average Cost"
FROM
course;
-- 2. Create a query that returns the total number of Students that registered
-- during February 2007. Alias the column as "February_Registration... |
<gh_stars>1-10
create table usuarios(
id int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY,
nome varchar(255),
sobrenome varchar(255),
login varchar(255),
password varchar(255),
email varchar(255),
urlImagem varchar(500),
confirmed int(1) COMMENT 'Indica se o usuario confirmou o registro atraves do email enviado',
... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 12, 2017 at 06:08 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- --------------------------------------------------------
--
-- Создание БД Dorm
--
CREATE DATABASE [dorm]
COLLATE Cyrillic_General_CI_AS
GO
|
CREATE TABLE `t_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`uid` varchar(64) NOT NULL COMMENT '自定义用户唯一标识',
`name` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户名称',
`portrait` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '用户头像',
`mobile` varchar... |
<reponame>chrisoldwood/SS-Unit
/**
* \file
* \brief The GetIntegerValue user-defined function.
* \author <NAME>
*/
if (object_id('dbo.GetIntegerValue') is not null)
drop function dbo.GetIntegerValue;
go
/**
* An example UDF that returns an integer value.
*/
create function dbo.GetIntegerValue()
returns int
... |
INSERT INTO RATE_CLASS (RATE_CLASS_CODE,DESCRIPTION,RATE_CLASS_TYPE,UPDATE_TIMESTAMP,UPDATE_USER,VER_NBR,OBJ_ID)
VALUES('13','MTDC - AWARD','O',sysdate,'admin',1,sys_guid())
/
insert into RATE_TYPE (RATE_CLASS_CODE,RATE_TYPE_CODE,DESCRIPTION,UPDATE_TIMESTAMP,UPDATE_USER,VER_NBR,OBJ_ID) values (13,1,'MTDC',sysdate,'ad... |
<reponame>Ambal/mangos
ALTER TABLE `npc_vendor`
DROP PRIMARY KEY,
DROP KEY `vendor_id` ,
DROP `index_id`,
CHANGE `entry` `entry` int(11) unsigned NOT NULL default '0',
CHANGE `itemguid` `item` int(11) unsigned NOT NULL default '0',
CHANGE `amount` `buycount` int(11) unsigned NOT NULL... |
<reponame>CodeRancher/offcenter_trading
USE jody;
CREATE TABLE ChartTimes (
Name varchar(30) NOT NULL,
HTF varchar(10) NOT NULL,
HTFMinutes int,
ITF varchar(10) NOT NULL,
ITFMinutes int,
STF varchar(10) NOT NULL,
STFMinutes int,
PRIMARY KEY (Name) USING BTREE
)
|
<gh_stars>1-10
-- load generation script 1
-- loops for up to 60 minutes, or until the ##stopload shared temp table is created
DROP TABLE IF EXISTS ##stopload;
USE AdventureWorks;
GO
DECLARE @sql nvarchar(MAX), @delay varchar(20), @split int = @@SPID % 5
SELECT @sql = CASE WHEN @split = 0 THEN N'EXEC dbo.uspGetOrde... |
{% if target.type == 'bigquery' %}
{% if var("marketing_warehouse_deal_sources") %}
{% if 'hubspot_crm' in var("marketing_warehouse_deal_sources") %}
{% if var("stg_hubspot_crm_etl") == 'fivetran' %}
with source as (
select *
from {{ source('fivetran_hubspot_crm','deals') }}
),
hubspot_deal_company as (
select ... |
<gh_stars>1-10
-- Landschaften aufgeräumt und gruppiert
CREATE TABLE [Landschaftsgruppe] (
[LandschaftsgruppeID] nvarchar(1) NOT NULL
, [Name] nvarchar(254) NOT NULL
);
CREATE TABLE [Landschaftsgruppe_Landschaft] (
[LandschaftsgruppeID] nvarchar(1) DEFAULT 'A' NOT NULL
, [LandschaftGUID] uniqueidentifier ... |
<filename>edu.gemini.lch.persistence/database/001_1.3.0.sql
----------------------------------------------------------------------------------------------------------------------
-- Database updates needed to bring 1.2.0 up to 1.3.0
--------------------------------------------------------------------------------------... |
<filename>database/db_menpro.sql
/*
Navicat MariaDB Data Transfer
Source Server : Localhost
Source Server Version : 100124
Source Host : localhost:3306
Source Database : db_menpro
Target Server Type : MariaDB
Target Server Version : 100124
File Encoding : 65001
Date: 2017-12-29 17:... |
<reponame>bahadylbekov/vaccinex_api<filename>migrations/20200621131243_create_ethereum_transactions.down.sql
DROP TABLE IF EXISTS ethereum_transactions;
|
<reponame>k5dru/infovis
select latitude,
longitude,
elevation,
state,
count(*),
count(distinct station_code) as station_count,
avg(data_value)
from ghcn
where element = 'WT03'
and q_flag IS NULL
group by 1,2,3,4
having count(*) > 10
and avg(data_value) > 0.01
order by 2, 1 desc;
|
USE nongte;
INSERT INTO nongte.region_province(`province_code`, `province_name`)
VALUES
('710000', '香港'),
('720000', '澳门'),
('730000', '台湾')
;
|
<filename>SQL/gazguzzler.sql<gh_stars>0
-- MySQL Script generated by MySQL Workbench
-- 03/04/15 20:42:31
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_... |
CREATE TABLE [SEIDR].[Operation] (
[OperationID] INT IDENTITY (1, 1) NOT NULL,
[Operation] VARCHAR (128) NOT NULL,
[OperationSchema] VARCHAR (128) NOT NULL,
[Description] VARCHAR (300) NULL,
[Version] INT NOT NULL,
[ThreadID] TINYINT NULL,
... |
<reponame>TNRIS/api.tnris.org
-- Create resource_management view for API to hit. Aggregates unique list
-- of resources per collection with resource_type joins
-- Main collection api endpoint for LCD non-historical dataset resources/downloads (download map): api/v1/resources
DROP MATERIALIZED VIEW IF EXISTS "resource_m... |
ALTER TABLE public.search_areaoflaw
ADD COLUMN display_external_link CHARACTER VARYING(500);
UPDATE public.search_areaoflaw
SET display_external_link = 'https://www.gov.uk/child-adoption/applying-for-an-adoption-court-order'
WHERE name = 'Adoption';
UPDATE public.search_areaoflaw
SET display_external_link = 'https:/... |
-- Verify seattleflu/schema:roles/consensus-genome-uploader/grants on pg
begin;
select 1/pg_catalog.has_database_privilege('consensus-genome-uploader', :'DBNAME', 'connect')::int;
select 1/pg_catalog.has_schema_privilege('consensus-genome-uploader', 'receiving', 'usage')::int;
select 1/pg_catalog.has_column_privilege... |
<gh_stars>10-100
with source as (
select
td_time_format(time, 'yyyy-MM-dd HH:mm:ss', 'JST') as time
,id
,resource_id as policy_id
,resource_name as policy_name
,new_value
,old_value
from
access
where
td_interval(time, '-1d', 'JST')
and
event_name = 'permission_policy_modify... |
CREATE TABLE IF NOT EXISTS SecurityAssessmentProceduresTestReferences (
SecurityAssessmentProcedureTestReference_ID INTEGER PRIMARY KEY,
SecurityAssessmentProcedure_ID INTEGER NOT NULL,
TestReference_ID INTEGER NOT NULL,
UNIQUE (SecurityAssessmentProcedure_ID, TestReference_ID) ON CONFLICT IGNORE,
F... |
-- file:create_type.sql ln:135 expect:true
SELECT format_type(atttypid,atttypmod) FROM pg_attribute
WHERE attrelid = 'mytab'::regclass AND attnum > 0
|
<filename>mimic-iv/concepts/postgres/treatment/crrt.sql
-- THIS SCRIPT IS AUTOMATICALLY GENERATED. DO NOT EDIT IT DIRECTLY.
DROP TABLE IF EXISTS crrt; CREATE TABLE crrt AS
with crrt_settings as
(
select ce.stay_id, ce.charttime
, CASE WHEN ce.itemid = 227290 THEN ce.value END AS CRRT_mode
, CASE WHEN ce.itemid =... |
<reponame>ogobrecht/sample-data-sets-for-oracle<gh_stars>1-10
prompt - view oehr_emp_details_view
create or replace view oehr_emp_details_view as
select
e.employee_id,
e.job_id,
e.manager_id,
e.department_id,
d.location_id,
l.country_id,
e.first_name,
e.last_name,
e.salary,
e.... |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : 192.168.127.12
Source Server Version : 80018
Source Host : 192.168.127.12:3306
Source Database : cloud_order
Target Server Type : MYSQL
Target Server Version : 80018
File Encoding : 65001
Date: 2020-04-18 18:43:42
*/
SET F... |
<reponame>himalia6/GeekJava000<filename>week06/src/main/resources/03-customer_order.sql<gh_stars>0
create table customer_order
(
id int auto_increment comment '实例ID'
primary key,
uuid varchar(64) not null comment '订单uuid',
customer_uuid varchar(64) not null comment '用户uuid',
item_name varchar(255) not null commen... |
<gh_stars>0
# ---------------------------------------------------------------------- #
# Script generated with: DeZign for Databases V9.1.0 #
# Target DBMS: MySQL 5 #
# Project file: Project1.dez #
# Projec... |
alter table A2_PROPERTY drop column AE1TABLENAME_ASSAY;
alter table A2_PROPERTY drop column AE1TABLENAME_SAMPLE;
alter table A2_PROPERTY drop column ASSAYPROPERTYID;
alter table A2_PROPERTY drop column SAMPLEPROPERTYID;
|
<gh_stars>10-100
CREATE TABLE `SharedChannels` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`buddy_id` bigint(20) DEFAULT NULL,
`channelMapping_id` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FKFD3DCB7568CEBFC9` (`buddy_id`),
KEY `FKFD3DCB752E0740A3` (`channelMapping_id`),
CONSTRAINT `FKFD3DCB752E0740... |
INSERT INTO `guns`.`sys_menu` (`id`, `code`, `pcode`, `pcodes`, `name`, `icon`, `url`, `num`, `levels`, `ismenu`, `tips`, `status`, `isopen`) VALUES ('1256956556533129217', 'eggGeth', '0', '[0],', '区块链管理', '', '/eggGeth', '99', '1', '1', NULL, '1', '0');
INSERT INTO `guns`.`sys_menu` (`id`, `code`, `pcode`, `pcodes`, `... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.5.5-10.1.21-MariaDB)
# Database: wordcamp-praha-2018-workshop
# Generation Time: 2018-02-25 11:23:20 +0000
# ***********... |
SELECT
opsrbtgv.organization_id,
opsrbtgv.person_id,
opsrbtgv.retention_tracking_year,
opsrbtgv.year_id,
opsrbtgv.year_name,
opsrbtgv.is_enrolled_beginn... |
<gh_stars>0
/*
* Establishes the reason and minutes a student is absent
* if the absence is excused in order to remove those
* minutes from the students total time and total points
* possible to earn that day
*/
DECLARE @yeartype as varchar(15)
SET @yeartype = (SELECT [Type] FROM NSSEOPulse.dbo.ZM_TEST_BB_Scho... |
<reponame>vietdanh1899/be-it-network
CREATE OR ALTER TRIGGER trigger_applied
ON [dbo].[applied_job]
FOR INSERT
AS
BEGIN
DECLARE @jobId varchar(256)
DECLARE @userId varchar(256)
DECLARE @rating int
SELECT @userId = INSERTED.userId FROM INSERTED
SELECT @jobId = inserted.jobId FROM INSERTED
BEGIN
BEGIN TRY
BEGIN TRANS... |
-- phpMyAdmin SQL Dump
-- version 4.9.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 03, 2020 at 01:30 PM
-- Server version: 10.3.24-MariaDB-log-cll-lve
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<reponame>donofkarma/wordpress-vagrant-starkers<gh_stars>0
CREATE DATABASE IF NOT EXISTS `wordpress_default`;
|
DROP TABLE IF EXISTS USER;
CREATE TABLE USER (id SERIAL PRIMARY KEY, first_name VARCHAR, last_name VARCHAR, mobile VARCHAR); |
SELECT DISTINCT Country
from Lab0_NorthwindDB.dbo.Suppliers
UNION
SELECT Country
from Lab0_NorthwindDB.dbo.Employees
UNION
SELECT DISTINCT ShipCountry
from Lab0_NorthwindDB.dbo.Orders
SELECT c.CustomerID
FROM Lab0_NorthwindDB.dbo.Customers c
select p.productId, p.productName, p.categoryName
f... |
<reponame>ifqthenp/otus-spring-hw-06-spring-data-jpa
INSERT INTO `authors` VALUES (1, 'Lewis', 'Carrol');
INSERT INTO `authors` VALUES (2, 'Charlotte', 'Bronte');
INSERT INTO `authors` VALUES (3, 'Miguel', 'de Cervantes');
INSERT INTO `authors` VALUES (4, 'Herbert', 'Wells');
INSERT INTO `authors` VALUES (5, 'Leo', 'To... |
CREATE DEFINER=`admin`@`10.150.0.2` PROCEDURE `saveServantInfo`(IN
user_uid VARCHAR(100),
servantName VARCHAR(100),
servantID SMALLINT,
servantType VARCHAR(30),
servantLevel TINYINT,
servantWiki VARCHAR(100),
servantFandom VARCHAR(100))
BEGIN
/*Changelog:
- 02/02/2021: Added isAdmin check.*/
... |
<reponame>travis-ci/junction
-- Deploy junction:appschema to pg
BEGIN;
CREATE SCHEMA junction;
COMMIT;
|
-- --------------------------------------------------------
--
-- Estrutura da tabela `tb_pessoa_fone`
--
CREATE TABLE `tb_pessoa_fone` (
`codigo` int(11) NOT NULL,
`pessoa` int(11) NOT NULL,
`fone` varchar(15) DEFAULT NULL,
`descricao` varchar(45) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
<filename>migrations/2018-02-18-071905_add_default_games_and_modes/up.sql<gh_stars>1-10
insert into game_titles (game_name) values
('Overwatch'),
('Rocket League')
;
with ow_id as (
select game_title_id as id
from game_titles
where game_name = 'Overwatch'
)
insert into game_modes (game_title_id, mode_name... |
<filename>MagicWorks/BCPTablesFrom SQLToFileOLTP.sql
use AdventureWorks;
GO
EXEC master.dbo.sp_configure 'show advanced options', 1
RECONFIGURE
EXEC master.dbo.sp_configure 'xp_cmdshell', 1
RECONFIGURE;
BEGIN TRY
DROP VIEW dbo.config
END TRY
BEGIN CATCH
PRINT 'No Need'
END CATCH;
GO
CREATE VIEW dbo.config AS
SE... |
CREATE TABLE `blog` (
`BlogID` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`UserID` varchar(36) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`Title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL,
`Description` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin N... |
<reponame>zikaeroh/hortbot
-- https://stackoverflow.com/a/10404041
BEGIN;
-- Upgrade all VIP restricted items to moderators before removing them.
UPDATE channels SET mode = 'moderator' WHERE mode = 'vip';
UPDATE channels SET roll_level = 'moderator' WHERE roll_level = 'vip';
UPDATE channels SET filter_exempt_level = ... |
select * from videogame inner join company on videogame.companyId = company.company_id |
--> step 1
select
'observation_emr' as tbnm
,o1.*
, case
when d1.death_dt is not null and (o1.meddate > d1.death_dt
or o1.MEDTIME > d1.death_dt or o1.FRMDT > d1.death_dt ) then 'Y'
else 'N'
end as Death_error
, case
when o1.meddate is not null and o1.meddate < p1.Btdt then 'Y'
when o1.MEDTIME is n... |
CREATE TABLE IF NOT EXISTS `form_psychiatrisch_onderzoek` (
`id` bigint(20) unsigned NOT NULL auto_increment,
`date` datetime default NULL,
`pid` bigint(20) default NULL,
`user` varchar(255) default NULL,
`groupname` varchar(255) default NULL,
`authorized` tinyint(4) default NULL,
`activity` tinyint(4) de... |
# --- !Ups
INSERT INTO role (id, role_name, description) VALUES
(1, 'Admin', NULL),
(2, 'User', 'A regular user who uses this application');
INSERT INTO user (id, email, first_name, last_name,
password, hashed_password, reset_token, role_id) VALUES
(1, '<EMAIL>', 'Paul', 'Tran',
... |
<filename>Projects/EastLondonGenesAndHealthPhase2/Queries/gh2execute11.sql
USE data_extracts;
-- ahui 10/2/2020
DROP PROCEDURE IF EXISTS gh2execute11;
DELIMITER //
CREATE PROCEDURE gh2execute11()
BEGIN
-- Medications (Asthma)
DROP TABLE IF EXISTS gh2_MedAsthmaDataset;
CREATE TABLE gh2_MedAsthmaDataset (
pseu... |
<reponame>hallatech/atg-project-development<filename>Liquibase/install/core/ddl/atg/DCS/contracts_ddl.sql
-- @version $Id: //product/DCS/version/11.3/templates/DCS/sql/contracts_ddl.xml#1 $$Change: 1385662 $
-- Normally, catalog_id and price_list_id would reference the appropriate table it is possible not to use th... |
-- Database: job4j
create database job4j
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Russian_Russia.1251'
LC_CTYPE = 'Russian_Russia.1251'
TABLESPACE = pg_default
CONNECTION LIMIT = -1;
create table if not exists statuses (
id serial not null primary key,
status varchar ... |
UPDATE
OA_TEAM
SET
avatar_ref = :avatarRef,
color_code = :colorCode,
updated_at = :ts
WHERE
id = :id |
--bind parameter in select clause (complex)
create class xoo ( a int);
insert into xoo values(1);
$int, $100, $int , $1
select ?||1 from xoo where ? = a;
$int, $100, $int , $1
select ? + 1 from xoo where ? = a;
$int, $100, $int , $200, $int , $1
select (?) || (?) from xoo where ? = a;
$int, $100, $int ,$1
select co... |
<reponame>Tym17/SymbiozUtils<filename>sql/get_char_items.sql
SELECT ci.UId,
i.Name
FROM charactersitems ci
LEFT JOIN items i
ON ci.Gid = i.Id
WHERE ci.CharacterId = ?
AND i.TypeId in (?); |
<filename>hw4/most_visited_profile_by_hour/most_visited_profile_by_hour.sql<gh_stars>0
ADD JAR /opt/cloudera/parcels/CDH-5.9.0-1.cdh5.9.0.p0.23/lib/hive/lib/hive-contrib.jar;
use asyromyatnikov;
drop table if exists user_hit;
create table user_hit (
hit_hour smallint,
username string,
counter bigint
);
insert o... |
<reponame>rezaiqbal10/projekmagang
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.17.32
-- Generation Time: Mar 09, 2020 at 07:10 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET ti... |
ALTER TABLE maw.user
DROP COLUMN website,
DROP COLUMN date_of_birth,
DROP COLUMN company_name,
DROP COLUMN position,
DROP COLUMN work_email,
DROP COLUMN address_1,
DROP COLUMN address_2,
DROP COLUMN city,
DROP COLUMN state_id,
DROP COLUMN postal_code... |
<reponame>hasanah150999/distribusi_gas-master
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.11-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 11.2.0.6213
-- -... |
SELECT COUNT(*)
FROM
tag as t,
site as s,
question as q,
tag_question as tq
WHERE
t.site_id = s.site_id
AND q.site_id = s.site_id
AND tq.site_id = s.site_id
AND tq.question_id = q.id
AND tq.tag_id = t.id
AND (s.site_name in ('stackoverflow'))
AND (t.name in ('amazon-s3','async-await','clojure','concurrency','configurat... |
<reponame>bryanstyawan/my-cash
/*
Navicat MySQL Data Transfer
Source Server : MySql
Source Server Version : 100411
Source Host : localhost:3306
Source Database : sikerja_future
Target Server Type : MYSQL
Target Server Version : 100411
File Encoding : 65001
Date: 2020-09-01 21:18:54... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.