sql stringlengths 6 1.05M |
|---|
SELECT id, username, user_role, system_id
FROM Users; |
<filename>src/db-from-phile-starter/schema/app_jobs_fn/revert/function/update_timestamps.sql
-- Revert app_jobs_fn:function/update_timestamps from pg
BEGIN;
DROP FUNCTION IF EXISTS app_jobs_fn.update_timestamps();
COMMIT;
|
SELECT s.id as student_id,
s.first_name as first_name,
s.last_name as last_name,
s.deleted_at as deleted_at,
l.id as lesson_id,
round(avg(mark), 2) as average_mark,
count(mark) as grade_count,
(CASE WHEN a.id IS NULL THEN FALSE ELSE TRUE END) as absent
FROM students s
... |
DROP DATABASE IF EXISTS acme_inc;
CREATE DATABASE IF NOT EXISTS acme_inc;
USE acme_inc;
DROP TABLE IF EXISTS employees;
CREATE TABLE employees (
id INT NOT NULL,
birth_date DATE NOT NULL,
first_name VARCHAR(14) NOT NULL,
last_name VARCHAR(16) NOT NULL,
h... |
<filename>sql/semantic/create_citations_semantic.sql
--copy over to clean
create table if not exists semantic.citations (i int);
truncate semantic.citations;
drop table if exists semantic.citations;
create table semantic.citations as table clean.citations;
create table if not exists semantic.recordid_paperid (i int);
... |
-- Revert seattleflu/schema:receiving/longitudinal/indexes/processing-log from pg
begin;
drop index receiving.longitudinal_processing_log_idx;
commit;
|
create or replace function pgq.next_batch(x_queue_name text, x_consumer_name text)
returns bigint as $$
-- ----------------------------------------------------------------------
-- Function: pgq.next_batch(2)
--
-- Makes next block of events active.
--
-- If it returns NULL, there is no events available in qu... |
DROP DATABASE IF EXISTS employee_management_systemDB;
CREATE database employee_management_systemDB;
USE employee_management_systemDB;
CREATE TABLE department (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE role (
id INT NOT NULL AUTO_INCREMENT,
title VARCHAR(30) N... |
-- MySQL dump 10.13 Distrib 8.0.26, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: evo_rec_sys_v2
-- ------------------------------------------------------
-- Server version 8.0.26-0ubuntu0.20.04.3
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARA... |
<gh_stars>0
CREATE TABLE personassociation (
"PersonAssociationID" serial NOT NULL,
"PersonID" bigint,
"AttributeID" smallint,
"AttributeValue" varchar(25),
... |
<gh_stars>0
/* Drop Tables */
IF ObJECt_ID('[hst_role]') IS NOT NULL DROP TABLE [hst_role];
IF ObJECt_ID('[hst_setting]') IS NOT NULL DROP TABLE [hst_setting];
IF ObJECt_ID('[hst_static_content]') IS NOT NULL DROP TABLE [hst_static_content];
IF ObJECt_ID('[hst_user]') IS NOT NULL DROP TABLE [hst_user];
IF ObJECt_ID('... |
ALTER TABLE "public"."zones_graphs" DROP COLUMN "channels_cnt_active";
|
CREATE FUNCTION func345() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE195);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE212);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE385);val:=(SELECT COUNT(*)INTO MYCOU... |
<gh_stars>10-100
ALTER TABLE okr_topic_draft ADD current_status varchar(20) CHECK(current_status IN('draft', 'submitted', 'approved', 'rejected')) NOT NULL default 'submitted';
GO
UPDATE okr_topic_draft SET current_status = 'submitted' where current_status IS NULL; |
library PCSBMIScreenAndFollowUp version '9.3.000'
using QDM version '5.5'
include MATGlobalCommonFunctions version '5.0.000' called Global
codesystem "LOINC": 'urn:oid:2.16.840.1.113883.6.1'
codesystem "ICD10CM": 'urn:oid:2.16.840.1.113883.6.90'
codesystem "SNOMEDCT": 'urn:oid:2.16.840.1.113883.6.96'
valueset "Enco... |
<reponame>lol768/mywarwick<filename>conf/evolutions/default/77.sql
# --- !Ups
INSERT INTO TILE_GROUP (TILE_ID, "GROUP") VALUES ('account', 'wbs');
INSERT INTO TILE_GROUP_LAYOUT (GROUP_ID, TILE_ID, LAYOUT_WIDTH, X, Y, WIDTH, HEIGHT) VALUES ('wbs', 'account', 2, 0, 0, 2, 2);
INSERT INTO TILE_GROUP_LAYOUT (GROUP_ID, TILE_... |
<filename>database/sitpmm.sql
-- MySQL dump 10.17 Distrib 10.3.16-MariaDB, for Win64 (AMD64)
--
-- Host: localhost Database: sitpmm
-- ------------------------------------------------------
-- Server version 10.3.16-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACT... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 04, 2020 at 03:37 AM
-- Server version: 10.4.16-MariaDB
-- PHP Version: 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>script-sql/query-grupo_modulos.sql
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 08-09-2020 a las 02:12:14
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
S... |
<reponame>blin4444/energy-manager
-- Test polyfill for ST_Distance_Sphere
SET @pt1 = ST_GeomFromText('POINT(0 0)');
SET @pt2 = ST_GeomFromText('POINT(180 0)');
SELECT ST_Distance_Sphere_pf(@pt1, @pt2);
-- https://dev.mysql.com/doc/refman/5.7/en/spatial-convenience-functions.html
-- Expected value: 20015042.813723423
|
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 1192.168.127.12
-- Generation Time: Apr 24, 2015 at 04:39 PM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIE... |
prompt --application/shared_components/navigation/lists/application_navigation
begin
-- Manifest
-- LIST: Application Navigation
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2020.10.01'
,p_release=>'20.2.0.00.20'
,p_default_workspace_id=>2601326064169245
,p_default_application_id=>138
... |
<reponame>NHMD/svampeatlas
CREATE VIEW ObservationView AS SELECT
o._id ,
o.createdAt ,
o.updatedAt ,
o.observationDate ,
o.observationDateAccuracy,
o.locality_id,
o.verbatimLocality,
o.primaryuser_id,
o.verbatimLeg ,
o.primarydetermination_id,
o.primaryassociatedorganism_id ,
o.vegetationtype_id,
o.substrate_id ,
o.ec... |
<reponame>larvit/larvitdbmigration-pg
CREATE TABLE bloj (nisse integer); |
<gh_stars>0
--counting the categories
select coalesce(issimple,'*'), '&',
coalesce(howmany,'*'), '&',
count(*), '&',
count(distinct t.line) as numfiles, '\\',
array_agg(distinct sibnum) as lengths,
array_agg(distinct valuelen) as lenArgs,
array_agg(distinct t.line) as lines,
jsonb_... |
<reponame>EoinPAlmer/2ndYearProject
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table basket (
id bigint auto_increment not null,
customer_email varchar(255),
constraint uq_basket_custo... |
/* Find mID of movies that received a rating of 4 or 5 */
select mID from Rating where Rating.stars>=4;
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 02, 2019 at 07:15 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>1-10
CREATE OR REPLACE FUNCTION public.notebook_modification_date()
RETURNS TRIGGER
LANGUAGE PLPGSQL
AS
$$
DECLARE
session_variables json;
professional uuid;
BEGIN
session_variables := current_setting('hasura.user', 't');
IF session_variables IS NOT NULL then
professional := session_variable... |
{% macro athena__create_view_as(relation, sql) -%}
create or replace view
{{ relation }}
as
{{ sql }}
{% endmacro %}
|
<reponame>tuukkalahti/WebAPI<filename>src/test/resources/cohortresults/sql/raw/getCompletedAnalyses-expected.sql<gh_stars>10-100
select analysis_id
FROM public.cohort_analysis_list_xref
WHERE cohort_id = ? and source_id = ?
|
DROP PROCEDURE IF EXISTS `UpdateExpirationDateByCERF`;
CREATE PROCEDURE `UpdateExpirationDateByCERF` (_CERForm NVARCHAR(25), _OrganizationID NVARCHAR(36), _DueDate DATETIME)
#BEGIN#
UPDATE `Ignore`
SET DueDate = _DueDate,
DBUpdatedDate = NOW()
WHERE OrganizationId = _OrganizationId
AND Approval ... |
select transit_gateway_route_table_id, transit_gateway_id
from aws.aws_ec2_transit_gateway_route_table
where transit_gateway_route_table_id = '{{ output.resource_id.value }}'
|
<filename>src/test/tinc/tincrepo/dml/functional/sql/computedcol_dml_decimal.sql
-- @author prabhd
-- @created 2014-04-01 12:00:00
-- @modified 2012-04-01 12:00:00
-- @tags dml MPP-21090 ORCA
-- @product_version gpdb: [4.3-]
-- @optimizer_mode on
-- @description Tests for MPP-21090
\echo --start_ignore
set gp_enable_c... |
CREATE TABLE GISTIC_GENOMIC_REGION_REPORTER
(
ID BIGINT NOT NULL AUTO_INCREMENT,
BROAD_OR_FOCAL varchar(55),
QVALUE DOUBLE,
RESIDUAL_QVALUE DOUBLE,
REGION_BOUNDARIES varchar(155),
WIDE_PEAK_BOUNDARIES varchar(155),
GENE_AMPLIFICATION_TYPE varchar(55),
PRIMARY KEY (ID)
) Engine=... |
-- Add FlashCard
WITH flashcard_inserted AS (
INSERT INTO
flashcard
(userid, recto, tags, verso, updated_at)
VALUES
(CAST($1 AS BIGINT), CAST($2 AS TEXT), CAST($3 AS TEXT[]), CAST($4 AS TEXT), now() - INTERVAL '1 day')
RETURNING
*
)
SELECT
COUNT(*)
FROM
flashcard_inserted
;
|
<gh_stars>1-10
SELECT 1 from db_root where '.01' <> '0.01';
SELECT 1 from db_root where .01 <> '0.01';
SELECT 1 from db_root where NULL <> '0.01';
SELECT 1 from db_root where NULL <> 0.01;
SELECT 1 from db_root where NULL <> 'foo';
SELECT 1 from db_root where 'zapp' <> 'zappp';
SELECT 1 from db_root where 123456... |
<filename>openGaussBase/testcase/KEYWORDS/yes/Opengauss_Function_Keyword_Yes_Case0029.sql<gh_stars>0
-- @testpoint:opengauss关键字yes(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists yes;
CREATE TABLESPACE yes RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace yes;
--关键字带双引号,创建成功
drop tablespa... |
<reponame>strinking/statbot-queries<filename>suspicious-users/join-date.sql<gh_stars>0
-- Looks for people who made their account soon before joining,
-- and do not have the 'Member' role.
-- Uses snowflake_time from id_to_snowflake.sql
SELECT
users.name || '#' || users.discriminator AS username,
joined_at - ... |
<reponame>Debaerdm/L3-MIAGE
--TD2_CINEMA(ci_ref,ci_nom, ci_ville)
--TD2_FILM (fi_ref,fi_titre,fi_annee)
--TD2_SEANCE (se_ref,fi_ref, ci_ref,se_horaire)
--TD2_SPECTATEUR(sp_ref,sp_nom,sp_prenom,sp_mail)
--TD2_ASSISTE(sp_ref,se_ref,as_avis)
create table TD2_CINEMA (
ci_ref varchar2(5) constraint PK_TD2_... |
/*
SQLyog Ultimate v13.1.1 (64 bit)
MySQL - 10.4.10-MariaDB
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
create table `m_asatid` (
`id_asatid` varchar (9),
`nama_asatid` varchar (768),
`nohp` varchar (72),
`niy` int (24),
`kategori` int (1),
`sts` int (1)
... |
<gh_stars>0
CREATE TABLE dim_candidato (
id_candidato_sk BIGINT NOT NULL PRIMARY KEY,
version INT,
date_from DATETIME,
date_to DATETIME,
id_candidato INT,
idade INT,
por_experiencia TINYTEXT,
sexo TINYTEXT,
faixa_etaria TINYTEXT );
CREATE INDEX idx_dim_candidato_lookup ON dim_candidato(id_candidato);... |
<reponame>nitros12/luhack-web-lab
CREATE DATABASE luhack_sqli;
|
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: May 14, 2018 at 10:11 AM
-- Server version: 5.6.38
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
<filename>BancoDados/dbsistemalaravel.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 23-Dez-2020 às 16:02
-- Versão do servidor: 10.1.19-MariaDB
-- PHP Version: 5.6.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4... |
-- MySQL dump 10.13 Distrib 5.7.27, for Win64 (x86_64)
--
-- Host: localhost Database: jsfb_com
-- ------------------------------------------------------
-- Server version 5.7.27
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
-- PROCESSORS
INSERT INTO processors(name, img_url, store, price, description, buy_link) VALUES ('Intel
Core i5-4590', 'http://i.imgur.com/ava6Dvn.jpg', 'Micro Center', '160', 'Same
processor speed as the fastest iMac on the market. Very quick, good for casual/non gamers.', 'http://www.microcenter.com/product/432161/C... |
CREATE TABLE StripeCharges (
UserId BIGINT NOT NULL,
OrderId BIGINT UNIQUE NOT NULL,
-- multiple of lowest face value. for example, usd, it will be number of cents.
Amount BIGINT NOT NULL DEFAULT 0,
Currency VARCHAR(5) NOT NULL DEFAULT 'USD',
StripeChargeToken VARCHAR(50) NOT NULL UNIQUE,
Status INT NOT N... |
--load required module
--define locals
define l_module_name = "&1"
prompt Loading required module [&&l_module_name]
whenever oserror exit rollback
@&&g_sqlsn_modules_path./&&l_module_name./module.sql "&&g_sqlsn_modules_path./&&l_module_name"
whenever oserror continue
--undefine locals
undefine l_module_name |
<gh_stars>1-10
SELECT
affiliate_fct_items.facet_id as affiliate_fct_id,
affiliate_fct.value as affiliate_fct,
count(DISTINCT affiliate_fct_items.facet_id) as affiliate_fct_occurrence,
affiliate_fct.value affiliate_fct,
SUM(CASE WHEN (affiliate_fct_role.value LIKE '%_involved%' AND affiliate_fct.id ... |
<filename>src/server/app/data/mysql_db_schema.sql<gh_stars>1-10
-- MySQL dump 10.13 Distrib 8.0.12, for Win64 (x86_64)
--
-- Host: localhost Database: yojaka
-- ------------------------------------------------------
-- Server version 8.0.12
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... |
/* Definition for the GET_TIMEID_MESSAGE procedure : */
------------------------------------------------------------------------------
-- Create date: 2020-07-26
-- Autor: <NAME>
--
-- Description:
-- Get the number o ticks (100 nanoseconds) of the message.
--
-- Parameters:
-- ID_MESSAGE - The id of message.
--
-- ... |
<filename>sql/Enterprise.sql
IF NOT EXISTS (Select * From {databaseOwner}{objectQualifier}Schedule WHERE TypeFullName = 'DotNetNuke.Modules.ActiveForums.QueueScheduler,Active.Modules.Forums')
INSERT INTO {databaseOwner}{objectQualifier}Schedule (TypeFullName,TimeLapse,TimeLapseMeasurement,RetryTimeLapse,RetryTimeLapse... |
/*
Warnings:
- You are about to drop the column `postalCode` on the `locations` table. All the data in the column will be lost.
- A unique constraint covering the columns `[postal_code]` on the table `locations` will be added. If there are existing duplicate values, this will fail.
- Added the required column ... |
-- +migrate Up
CREATE TABLE screenshots (
id INTEGER PRIMARY KEY AUTOINCREMENT,
path TEXT NOT NULL,
operation_slug TEXT NOT NULL,
description TEXT NOT NULL DEFAULT '',
error TEXT NOT NULL DEFAULT '',
recorded_date TIMESTAMP NOT NULL,
upload_date TIMESTAMP
);
-- +migrate Down
DROP TABLE scre... |
DROP DATABASE IF EXISTS companySQL_db;
CREATE DATABASE companySQL_db;
USE companySQL_db;
CREATE TABLE department(
id INTEGER AUTO_INCREMENT NOT NULL,
name VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE role(
id INTEGER AUTO_INCREMENT NOT NULL,
title VARCHAR(30) NOT NULL,
salary DECIMAL(10, 2) NOT ... |
<filename>SQL/1. Basic Select/08 - Weather Observation Station 3.sql
-- MySQL
SELECT DISTINCT CITY
FROM STATION
WHERE ID % 2 = 0;
-- Oracle
SELECT DISTINCT CITY
FROM STATION
WHERE MOD(ID, 2) = 0; |
CREATE VIEW viewGIAMDOC AS
SELECT DA.mada, DA.tenda, DA.kinhphi, PB.tenphong, CN.tencn, NV.hoten, sum(CT.soTien) as tongchi
FROM dbaDuAn.duan DA, dbaDuAn.nhanvien NV, dbaDuAn.phongban PB, dbaDuAn.chinhanh CN, dbaDuAn.chitieu CT
WHERE DA.phongchutri = PB.maphong
AND PB.chinhanh = CN.macn
AND DA.truongda = NV... |
<filename>skating_elt/ddl/view/s_aspect_v.sql
CREATE OR REPLACE VIEW `your-project.skating.s_aspect_v` AS
select distinct
dense_rank() over (order by aspect_type_nm, aspect_desc) as aspect_id,
upper(substr(aspect_type_nm,1,1)) as aspect_type_cd,
aspect_desc
from
`your-project.skating.s_judged_aspects`
;
... |
--the output of this model is row per month per opportunity that the opportunity
--was active. it also provides the CSM assigned at the beginning of the month
{{
config(
materialized='table',
sort='date_month',
dist='account_id'
)
}}
with opp_history as (
select * from {{ref('sf_opp... |
<reponame>ystros/credhub
ALTER TABLE operation_audit_record
ADD method character varying(255),
ADD status_code int;
ALTER TABLE auth_failure_audit_record
ADD method character varying(255),
ADD status_code int;
|
CREATE USER paymentro PASSWORD '<PASSWORD>';
GRANT usage ON SCHEMA payment to paymentro;
-- ----------------------------
-- Only grant access to previously create tables.
-- ----------------------------
GRANT SELECT ON ALL TABLES IN SCHEMA payment TO paymentro;
|
<filename>orcas_core/sql_util_scripts/load_executed.sql
set serveroutput on
set feedback off
set verify off
begin
dbms_output.put_line('');
dbms_output.put_line('orcas_internal_last_executed=');
for cur_scripts in
(
select scup_script_name
from orcas_updates
where scup_logname = '&1'
... |
<reponame>goldmansachs/obevo-kata
CREATE FUNCTION func306() RETURNS integer
LANGUAGE plpgsql
AS $$ DECLARE val INTEGER; BEGIN val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE219);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE421);val:=(SELECT COUNT(*)INTO MYCOUNT FROM MYLARGESCHEMA.TABLE41... |
/* comment goes here */
SELECT
subjects_base._subject_id,
subjects_base.subject_id,
subjects_base.subject_guid,
subjects_base.project
FROM
a2cpsdev.subjects_base;
|
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint: date类型时间间隔相减
drop table if exists test_date01;
create table test_date01 (col1 date);
insert into test_date01 values ('2020-1-1');
select date '2019-1-6' - col1 from test_date01;
drop table if exists test_date01; |
<reponame>bcbecker/Datta-Dashboard
/*PRAGMA foreign_keys=OFF;*/
BEGIN TRANSACTION;
CREATE TABLE "user" (
id SERIAL NOT NULL PRIMARY KEY,
public_id VARCHAR(50) NOT NULL,
username VARCHAR(50) NOT NULL,
email VARCHAR(75) NOT NULL,
password VARCHAR(60) NOT NULL,
date_joined TIMESTAMP,
UNIQUE (username),
UNIQ... |
-- Database: "DB_BDuser49"
set search_path to "unicorsi";
-- common query
-- SELECT matricola FROM studenti ORDER BY cognome ASC;
-- looking for <NAME>
--SELECT matricola, cognome, nome FROM studenti WHERE cognome='Rossi' AND nome='Mario';
-- searching for non-graduate students
-- SELECT matricola, cognome, n... |
<reponame>Nano-Labs-Developers/SmartMovers
CREATE TABLE Payment(
Pay_ID int PRIMARY KEY NOT NULL IDENTITY(1000,1),
Pay_Type varchar(50),
Pay_Date datetime,
Amount money,
Job_ID int FOREIGN KEY REFERENCES Job(Job_ID),
Customer_ID int FOREIGN KEY REFERENCES Customer(Customer_ID)
);
|
<filename>SourceCode/SADFM/trunk/SADFM.Data/Scripts/1.0/0.057.sql
INSERT INTO ListItem (ParentId, Name, Description, StatusId, LastUpdateTimestamp, LastUpdateAccountId)
values
((SELECT ListItemId FROM ListItem WHERE ParentId IS NULL AND NAME = 'MedicalScheme'),
'Private Patient', 'Private Patient',
(SELECT lisa.ListI... |
<reponame>felipee96/v2monitoria
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-05-2020 a las 20:42:01
-- Versión del servidor: 10.4.11-MariaDB
-- Versión de PHP: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSAC... |
<reponame>MamdouhElshekh/Premier-League-Insights<filename>Attacking_Stats.sql<gh_stars>0
DROP TABLE IF EXISTS Attacking_stats;
CREATE TABLE Attacking_stats
AS
-- Calculating Total Shots
(WITH H_Shots AS (
SELECT Season, HomeTeam AS Team, SUM(HomeShots) AS Shots
FROM epl
GROUP BY HomeTeam, Season
),
A_Shots AS (
SELECT... |
WITH CTE AS (SELECT [TodaysDate],[databaseName],[SchemaName],[TableName],[RecordCount],[Ddifference],ROW_NUMBER() OVER (ORDER BY DatabaseName,SchemaName,TableName,TodaysDate) AS ROW_Num FROM [tableRowCountPredictive_Analytics] t1 WHERE TableName LIKE 'AlertControl' AND SchemaName LIKE 'ABC') UPDATE t SET t.Ddifference ... |
set search_path to mimiciii;
drop materialized view if exists charts_details;
create materialized view charts_details as
select icustay_id, itemid, charttime,value,VALUENUM
from chartevents
where icustay_id in
(216265,
222851,
268972,
232175,
259745,
223451,
260492,
283925,
209994,
209910,
209757,
280600,
288344... |
-- 菜单 SQL
insert into sys_menu (menu_name, menu_name_tw, menu_name_us, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
values('自动报表任务', '自動報表任務', 'Auto Export', '1', '1', '/monitor/exportJob', 'C', '0', 'monitor:exportJob:view', '#', 'admin', sysdate()... |
-- CreateTable
CREATE TABLE "User" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"password" TEXT NOT NULL,
"email" TEXT NOT NULL,
"github" TEXT NOT NULL,
"linkedin" TEXT,
"m_max" INTEGER,
"about" TEXT NOT NULL,
"field" TEXT NOT NULL,
"languages" TEXT[],
"userId" TEXT NOT NULL,
... |
<gh_stars>0
CREATE PROCEDURE [dbo].[app_SurveyQuestion_Reorder] @SID INT
AS
UPDATE SurveyQuestion
SET QNumber = rowNumber
FROM SurveyQuestion
INNER JOIN (
SELECT QID,
QNumber,
row_number() OVER (
ORDER BY QNumber ASC
) AS rowNumber
FROM SurveyQuestion
WHERE SID = @SID
) drRowNumbers ON drRowNumbers.QID ... |
<filename>src/infra/db/postgres-prisma/prisma/migrations/20210412152702_init/migration.sql
-- CreateTable
CREATE TABLE "Owner" (
"id" SERIAL NOT NULL,
"name" TEXT NOT NULL,
"sectorId" INTEGER,
PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE "Owner" ADD FOREIGN KEY ("sectorId") REFERENCES "Sector"("... |
drop view if exists "UserDto";
create view "UserDto"
as
select
"Id" as "UserId"
,"FirstName"
,"LastName"
,"EmailAddress"
,"Password"
from "User"
|
/*
autocomplete source, schema-level
*/
with ns as
(
select oid, nspname
from pg_catalog.pg_namespace
where nspname not like 'pg_toast%' and nspname not like 'pg_temp%'
),
target_ns as
(
select ns.*, cs.ord
from ns
join unnest(current_schemas(true)) with ordinality as cs(n, ord) on ns.nspname = cs.n
where '$sc... |
<reponame>bduggan/gcis
alter table report add column in_library boolean;
|
CREATE TABLE supplyorderdetail (
id CHAVE NOT NULL,
id_supply_order CHAVE NOT NULL,
id_currency CHAVE NOT NULL,
id_product CHAVE NOT NULL,
id_product_attribute ... |
update combo
set nombre = :nombre,
precio = :precio
where id = :id |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
drop database if exists movil;
create database movil;
use movil;
CREATE TABLE `familias` (
`id` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE `moviles` (
`id` int(11) NOT NULL,
`marca... |
SET pagesize 0
SET heading OFF
SET feedback OFF
SET verify OFF
SELECT banner
FROM v$version
WHERE rownum=1;
QUIT;
|
<gh_stars>0
CREATE TABLE [dbo].[EStatistic]
(
--From MergedXSDs XSD
--From 'genericRailML' Namespace
[EStatisticId] SMALLINT NOT NULL,
[Mean] BIGINT NOT NULL,
[Median] BIGINT NOT NULL,
[StandardDeviation] BIGINT NOT NULL,
[StatisticAnalyses] BIGINT NOT NULL,
CONSTRAINT [PK_EStatisticId] PRIMARY KEY ... |
-- Name: RoundInfoLastCompleteRound
-- Schema: posda_backlog
-- Columns: ['round_id', 'collection', 'round_created', 'round_start', 'round_end', 'round_aborted', 'wait_count', 'process_count', 'num_entered', 'num_failed', 'num_dups', 'num_requests', 'priority']
-- Args: []
-- Tags: ['NotInteractive', 'Backlog', 'Backlo... |
<filename>db_template/sql/db_table_dt_services.sql
-- --------------------------------------------------------
--
-- Table structure for table `dt_services`
--
DROP TABLE IF EXISTS `dt_services`;
CREATE TABLE `dt_services` (
`id` int NOT NULL,
`nama` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci ... |
<filename>components/automate-workflow-server/schema/deploy/project_and_pipeline_role_triggers.sql<gh_stars>100-1000
-- Deploy project_and_pipeline_role_triggers
-- requires: ensure_role_membership_prerequisite
BEGIN;
CREATE TRIGGER ensure_membership
BEFORE INSERT OR UPDATE ON project_user_roles
FOR EACH ROW
EXECUT... |
<reponame>rwth-acis/CAE-Model-Persistence-Service<filename>database/Metadata_Extension.sql<gh_stars>1-10
CREATE TABLE IF NOT EXISTS commedit.MetadataDoc (
`versionedModelId` int(11) NOT NULL,
`docType` varchar(45) NOT NULL,
`docString` text,
`docInput` text,
`timeEdited` timestamp NULL DEFAULT CURRENT_TIMESTA... |
<filename>src-extra/chaos/chaos/sql/chaos/server/NewGame.sql
/*
= new game
== wizard starting positions
Wizards start the game in positions set by how many wizards there are in a game:
These figures are only valid iff there are 2-8 wizards and the board is
15 x 10.
*/
select module('Chaos.Server.NewGame');
create t... |
/*Crie um banco de dados para um serviço de uma loja de móveis e decoração, o nome do
banco deverá ter o seguinte: db_nome minha_casa_mais_bonita, onde o sistema trabalhará
com as informações dos produtos desta loja.*/
create database db_nome_casa_mais_bonita;
use db_nome_casa_mais_bonita;
/*Crie uma tabela de categ... |
/*
Deployment script for DatawarehouseSucos
This code was generated by a tool.
Changes to this file may cause incorrect behavior and will be lost if
the code is regenerated.
*/
GO
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
SET NUMERIC_ROUNDABORT OFF;
GO... |
IF OBJECT_ID('zsystem.jobsEx') IS NOT NULL
DROP VIEW zsystem.jobsEx
GO
CREATE VIEW zsystem.jobsEx
AS
SELECT jobID, jobName, [description], [sql], [hour], [minute],
[time] = CASE WHEN part IS NOT NULL THEN NULL
WHEN [week] IS NULL AND [day] IS NULL AND [hour] IS NULL AND [minute] IS ... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Φιλοξενητής: 127.0.0.1
-- Χρόνος δημιουργίας: 06 Απρ 2016 στις 22:29:58
-- Έκδοση διακομιστή: 10.1.10-MariaDB
-- Έκδοση PHP: 5.6.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHA... |
<reponame>stlbucket/postgraphile-de-extension<filename>src/db-from-phile-starter/release/0010/0040-org/deploy/structure/006-facility.sql
-- Deploy org:structure/facility to pg
-- requires: structure/organization
BEGIN;
CREATE TABLE org.facility (
id uuid UNIQUE NOT NULL DEFAULT uuid_generate_v1(),
app_tenan... |
<reponame>kohkimakimoto/go-sqlexec
CREATE TABLE IF NOT EXISTS user (
id int NOT NULL,
name text,
PRIMARY KEY(id)
);
|
--DROP TABLE IF EXISTS core_schema.tbl_brands;
CREATE TABLE core_schema.tbl_brands (
brands_id SERIAL NOT NULL PRIMARY KEY,
name VARCHAR(255),
order_by INTEGER,
is_active BOOLEAN DEFAULT true,
is_deleted BOOLEAN DEFAULT false,
last_modified_date timestamp with time zone
);
|
prompt
prompt
prompt . ********************************* .
prompt . Lob.Over.DBLink uninstaller .
prompt . <NAME> .
prompt . ********************************* .
prompt
prompt Drop package
drop package lob_over_dblink;
prompt
prompt . ********************************* .
prompt . U... |
<filename>src/test/resources/sql/select/3757f4f1.sql
-- file:xmlmap.sql ln:41 expect:true
SELECT schema_to_xmlschema('testxmlschema', true, false, '')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.