sql stringlengths 6 1.05M |
|---|
<reponame>brayanvmar/dbpractica
CREATE DATABASE IF NOT EXISTS videoclub;
CREATE TABLE IF NOT EXISTS cliente(
id_cliente int NOT NULL;
nombre varchar(20);
apaterno varchar(20);
amaterno varchar(20;
direccion varchar(30);
telefono varchar(13);
PRIMARY KEY(id_cliente)
)Engine = InnoDB... |
<reponame>jakobrodrigueztcc/itse1430
--
-- Updates an existing game.
--
-- PARAMS:
-- name - The name of the game. Must be unique and cannot be empty.
-- owned - Specifies if the game is owned or not.
-- completed - Specifies if the game is completed or not.
-- price - Specifies the price of the game. Mus... |
<reponame>YASHasvi-SHUkla/SQL-HackerRank<gh_stars>1-10
SELECT NAME
FROM STUDENTS
WHERE MARKS > 75
ORDER BY SUBSTRING(NAME,-3,3),ID; -- substring is used for extracting, here it extracts from third last posiyion to 3 more characters
|
USE AtlasTravel_FINAL;
GO
CREATE PROCEDURE [dbo].[uspChangeFlightDetails]
@f_ID int,
@newDep_ID int,
@newAriv_ID int,
@newDep_Date date,
@newAriv_Date date,
@newF_num varchar(255)
AS
BEGIN tran t1
IF @f_ID IS NOT NULL
BEGIN
UPDATE FLIGHT
SET
FlightArrivalCityID = ISNULL(NULLIF(@newAriv_ID, '')... |
SELECT
ha.type,
ha.official_code,
ha.name_finnish,
ha.name_swedish
FROM harvest_area ha
ORDER BY ha.type, ha.official_code;
|
<reponame>DanilBaibak/real-time-ml-prediction<filename>src/sql/migrations/V002__create_predictions_table.sql
CREATE TABLE IF NOT EXISTS predictions
(
id SERIAL PRIMARY KEY,
crim float(8) NOT NULL,
zn float(8) NOT NULL,
indus float(8) NOT NULL,
chas smallint NOT NULL,
nox float(8) NOT NULL,
r... |
-- Update FABS records since they're the only ones that could use face_value_loan_guarantee
UPDATE transaction_normalized AS tx_norm
SET face_value_loan_guarantee = tx_fabs.face_value_loan_guarantee
FROM transaction_fabs AS tx_fabs
WHERE tx_norm.id = tx_fabs.transaction_id AND tx_norm.type IN ('07', '08'); |
select id,placa,cilindraje,fecha_entrada,tarifa,estado
from mantenimiento
where id = :id |
{%- macro is_email(val) -%}
case when {{ val }} like '%_@__%.__%' then true else false end
{%- endmacro -%} |
<filename>postgresql/1-proj_table.sql<gh_stars>1-10
CREATE TABLE bidding (
id SERIAL,
price FLOAT NOT NULL,
bid_time TIMESTAMP NOT NULL,
valid BOOL NOT NULL DEFAULT True,
auction_id BIGINT,
bidder_id INTEGER,
PRIMARY KEY(id,auction_id,bidder_id)
);
CREATE TABLE users (
id SERIAL,
username VARCHAR(512) U... |
<gh_stars>10-100
-- Test instrument in shmem does not break EXPLAIN
-- and EXPLAIN ANALYZE. Also instrumentation slots
-- are correctly recycled.
-- This test can not run in parallel with other tests.
-- default value
SHOW GP_ENABLE_QUERY_METRICS;
SELECT 1;
SHOW GP_INSTRUMENT_SHMEM_SIZE;
SELECT 1;
-- start_ignore
DR... |
<gh_stars>10-100
DELIMITER //
DROP PROCEDURE IF EXISTS createWebsite
//
CREATE PROCEDURE createWebsite(IN siteName VARCHAR(255), IN pass VARCHAR(255), IN email VARCHAR(255))
BEGIN
SET @sql = CONCAT('CREATE DATABASE ', siteName, ';');
PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt;
SET @sql... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 03, 2017 at 10:03 PM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 02, 2021 at 05:09 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 12 Mar 2020 pada 11.19
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
CREATE TABLE [dbo].[USR_UserListAuthorization] (
[ID] INT NOT NULL,
[UserListID] INT NOT NULL,
[UserID] INT NOT NULL,
[AuthorizationTypeID] INT NOT NULL,
CONSTRAINT [PK_USR_UserListAuthorization] PRIMARY KEY CLUSTERED ([ID] ASC),
CONSTRAINT [FK_USR_UserLis... |
<filename>scala/storages/db_postgresql_storage/src/main/resources/com/myodov/unicherrygarden/db/migrations/versioned/functions/V20220107002537__create_function_ucg_get_currencies_for_keys_filter.sql
-- Initial implementation only; for latest up-to-date implementation, see the repeatable migration
CREATE OR REPLACE FUNC... |
<reponame>lovelysystems/apgdiff
SET search_path = x, pg_catalog;
CREATE RULE hello_world_added AS
ON UPDATE TO x.table1
DO
NOTIFY hello_added;
DROP RULE IF EXISTS notify_me ON x.table1;
|
CREATE DATABASE IF NOT EXISTS `jobplusfinale` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `jobplusfinale`;
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: jobplusfinale
-- ------------------------------------------------------
-- Server version 5.6.26
/*!40101 SET @OLD_CHAR... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 14, 2020 at 04:20 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<reponame>rafaelmasselli/Back-Ecomerce
/*
Warnings:
- A unique constraint covering the columns `[nickname]` on the table `User` will be added. If there are existing duplicate values, this will fail.
- Added the required column `updated` to the `User` table without a default value. This is not possible if the tab... |
<gh_stars>1-10
BEGIN;
CREATE TABLE Quota (
ClientId INTEGER REFERENCES Client DEFAULT 0,
GraceTime INTEGER UNSIGNED DEFAULT 0,
QuotaLimit BIGINT UNSIGNED DEFAULT 0,
PRIMARY KEY (ClientId)
);
CREATE TABLE NDMPLevelMap (
ClientId INTEGER REFERENCES Client DEFAULT 0,
FileSetId INTEGER UNSIGNED REFERENC... |
CREATE TABLE DMKR_ASLINE.EMAIL_PARMS
(
ID NUMBER GENERATED by default on null as IDENTITY
, RECIPIENT VARCHAR2(256) NOT NULL
, SUBJECT VARCHAR2(100) NOT NULL
, BODY VARCHAR2(2000) NOT NULL
, CONSTRAINT EMAIL_PARMS_PK PRIMARY KEY
(
ID
)
ENABLE
);
|
-- Table: fp_logger
-- DROP TABLE fp_logger;
CREATE TABLE fp_logger
(
log_id serial PRIMARY KEY ,
log_date character varying(20),
log_day character varying(20),
log_time character varying(20),
user_name character varying(30),
log_type character varying(20),
log_message character varying(512)
)
WITH (
... |
<filename>ClinicManagement/SeedData.sql
INSERT INTO AspNetRoles (id, name)VALUES (1, 'Administrator');
INSERT INTO AspNetRoles (id, name)VALUES (2, 'Doctor');
insert into Specializations
values
('Heart'),
('Diabetes'),
('Dental');
insert into Cities
values
('Mumbai'),
('Pune'),
('Thane'),
('Chennai'); |
<filename>scripts/init.sql
CREATE TABLE IF NOT EXISTS USERS (
ID BIGSERIAL NOT NULL PRIMARY KEY,
NAME VARCHAR(255) NOT NULL,
BALANCE FLOAT DEFAULT 0.0
); |
CREATE OR REPLACE package body PAK_XML_CONVERT is
-- Interactive Prints using the following MIT License:
--
-- The MIT License (MIT)
--
-- Copyright (c) 2021 <NAME>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentati... |
<filename>db_DataHandwerk/repo/Views/SysObject_RepoObject_via_guid.sql<gh_stars>1-10
CREATE View repo.SysObject_RepoObject_via_guid
As
--
Select
so.SysObject_id
, ro.is_repo_managed
, so.SysObject_schema_name
, so.SysObject_name
, SysObject_type = so.type
, SysObject_type_desc ... |
-- # Problem: https://www.hackerrank.com/challenges/symmetric-pairs/problem
-- # Score: 40
SELECT f1.x, f1.y FROM Functions f1
JOIN Functions f2 ON f1.x = f2.y AND f2.x = f1.y
GROUP BY f1.x, f1.y
HAVING COUNT(f1.x) > 1 OR f1.x < f1.y
ORDER BY f1.x;
|
USE [VipunenTK]
GO
/****** Object: View [dbo].[v_f_tab_opettajat_7_19] Script Date: 1.4.2020 15:16:40 ******/
DROP VIEW IF EXISTS [dbo].[v_f_tab_opettajat_7_19]
GO
/****** Object: View [dbo].[v_f_tab_opettajat_7_19] Script Date: 1.4.2020 15:16:40 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
... |
<filename>database/schema/sqlite.sql<gh_stars>1-10
-- cat database/schema/sqlite.sql | sqlite3 database/lightning.db
PRAGMA journal_mode = MEMORY;
PRAGMA synchronous = OFF;
PRAGMA foreign_keys = OFF;
PRAGMA ignore_check_constraints = OFF;
PRAGMA auto_vacuum = NONE;
PRAGMA secure_delete = OFF;
BEGIN TRANSACTION;
CREA... |
-- Addresses Table Schema --
CREATE TABLE IF NOT EXISTS addresses (
id INT AUTO_INCREMENT,
street_address VARCHAR(255) NOT NULL,
city VARCHAR(100) NOT NULL,
postal_code VARCHAR(25),
province VARCHAR(100) NOT NULL,
country VARCHAR(100) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
... |
<filename>sql/basic-join/2.africa-cities.sql
SELECT CITY.NAME
FROM CITY AS CITY INNER JOIN COUNTRY AS COUNTRY
ON CITY.COUNTRYCODE = COUNTRY.CODE
WHERE COUNTRY.CONTINENT = 'Africa'; |
<gh_stars>0
-- CONSULTA 6
delete plan_table;
EXPLAIN PLAN
INTO plan_table
FOR
(select distinct NombreC
from Cliente, Compras, Invierte
where Cliente.DNI = Invierte.DNI and
Invierte.NombreE = 'Empresa 55' and
Compras.DNI =... |
<reponame>rzajac/schemadump
CREATE TABLE `bigtable` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`bt_id` int(10) unsigned NOT NULL,
`chr` char(1) DEFAULT NULL,
`vchr` varchar(2) DEFAULT NULL,
`tint` tinyint(4) DEFAULT NULL,
`sint` smallint(6) DEFAULT NULL,
`mint` mediumint(9) DEFAULT NULL,
`inte` in... |
CREATE OR REPLACE FUNCTION to_query_dsl(zdbquery) RETURNS zdbquery PARALLEL SAFE IMMUTABLE STRICT LANGUAGE c AS 'MODULE_PATHNAME', 'zdb_to_query_dsl';
CREATE OR REPLACE FUNCTION to_queries_dsl(queries zdbquery[]) RETURNS zdbquery[] PARALLEL SAFE IMMUTABLE STRICT LANGUAGE sql AS $$
SELECT array_agg(zdb.to_query_dsl(... |
--
-- Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
--
--
-- BOOLEAN
-- https://github.com/postgres/postgres/blob/REL_12_BETA2/src/test/regress/sql/boolean.sql
--
-- sanity check - if this fails go insane!
--
SELECT 1 AS one;
-- ******************testing built-in type bool********************... |
/****** Object: Table [dbo].[T_LC_Column] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[T_LC_Column](
[SC_Column_Number] [varchar](128) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SC_Packing_Mfg] [varchar](64) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[SC_Packing_Type... |
/****** Object: View [dbo].[V_Dataset_Tracking_Ex] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Dataset_Tracking_Ex]
AS
SELECT DS.Dataset_Num AS Dataset,
DSN.DSS_name AS State,
DS.DS_created AS Created,
E.Experiment_Num AS Experiment,
CCE.Cell_C... |
/****** Object: View [dbo].[V_Material_Locations_Picklist] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Material_Locations_Picklist]
AS
SELECT [Location],
[Comment],
Freezer,
Shelf,
Rack,
[Row],
Col,
Limit,
Cont... |
-- Revert ggircs-portal:computed_columns/application_revision_production_form_data from pg
begin;
drop function ggircs_portal.application_revision_production_form_data;
commit;
|
<reponame>Ed-Fi-Exchange-OSS/Leadership-Profile<filename>src/API/DatabaseMigrations/scripts/up/2021-09-02-1000.DropSubCategoryView.sql
DROP VIEW IF EXISTS edfi.vw_ListAllSubCategories
|
DROP TRIGGER IF EXISTS touch_policy_meta_updated_at ON policy.policy_metas;
ALTER TABLE policy.policy_metas
DROP COLUMN updated_at,
ALTER COLUMN policy_id DROP NOT NULL;
|
SET search_path = 'statistics';
\set ON_ERROR_STOP 1
BEGIN;
CREATE INDEX statistic_name ON statistic (name);
CREATE UNIQUE INDEX statistic_name_date_collected ON statistic (name, date_collected);
COMMIT;
-- vi: set ts=4 sw=4 et :
|
<reponame>ramshresh/dmis
CREATE TABLE "social_media".tweet (
id BIGSERIAL,
tweets TEXT,
geom GEOMETRY ,
status_json TEXT,
date character varying,
hashtags character varying[],
tweet_location character varying,
screen_name character varying,
user_id bigint,
date_utc character var... |
-- phpMyAdmin SQL Dump
-- version 4.0.9
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 23, 2017 at 12:20 PM
-- Server version: 5.6.14
-- PHP Version: 5.5.6
SET FOREIGN_KEY_CHECKS=0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
<gh_stars>10-100
INSERT INTO buttonset (id, name, sort_order) VALUES
(10000, 'RandomBM', 200000);
INSERT INTO button (id, name, recipe, btn_special, tourn_legal, set_id) VALUES
(10001, 'RandomBMVanilla', '', 1, 0, (SELECT id FROM buttonset WHERE name="RandomBM"));
UPDATE button
SET flavor_text='This button gets a dif... |
-- CreateTable
CREATE TABLE "LostPasswordToken" (
"id" SERIAL NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
"expiresAt" TIMESTAMP(3) NOT NULL,
"hashedToken" TEXT NOT NULL,
"userId" INTEGER NOT NULL,
CONSTRAINT "LostPasswordToken_pk... |
<filename>TripPlanner/TripPlanner.Core/Scripts/DestinationTripsWithCity.sql
CREATE PROCEDURE DestinationTripsWithCity
AS
BEGIN
select d.City, d.Country, dt.DestinationID, dt.TripID, dt.[Description]
from Destination d
join DestinationTrip dt on d.DestinationID = dt.DestinationID
END
GO
|
<gh_stars>0
--First Upgrade Script
--This script will only be run on the first upgrade from a non-versioned database.
|
CREATE TABLE [dbo].[User] (
[Id] BIGINT IDENTITY (1, 1) NOT NULL,
[FirstName] VARCHAR (50) NOT NULL,
[LastName] VARCHAR (50) NOT NULL,
[Email] VARCHAR (100) NOT NULL,
[Password] VARCHAR (255) NOT NULL,
[Role] ... |
<filename>site_update_stored_procedure.sql<gh_stars>0
USE `sp`;
DROP procedure IF EXISTS `update_site_table`;
-- DELIMITER $$
CREATE PROCEDURE `update_site_table` ()
BEGIN
-- SET SQL_SAFE_UPDATES = 0;
set @varlist := (select group_concat(distinct variable) from data where region='RR' and site='SS');
update site se... |
create table blog_entries (
id smallint unsigned primary key auto_increment,
url varchar(32) not null comment 'unique portion of the url to this entry',
unique(url),
status enum(
'draft',
'published'
) not null default 'draft',
key (status),
posted int not null comment 'unix timestamp when the entry was publ... |
WITH CTE_Sample (ContinentCode, CurrencyCode, CurrencyUsage)
AS (
SELECT
ContinentCode,
CurrencyCode,
COUNT(CurrencyCode) AS CurrencyUsage
FROM Countries
GROUP BY ContinentCode, CurrencyCode
HAVING COUNT(CountryCode) > 1)
SELECT
ContinentMaximums.ContinentCode,
CodeTaker.CurrencyCode,
ContinentMaximums... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 19, 2018 at 01:29 PM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
<reponame>imajaydwivedi/Problem-Task---SQL-Server-Slowness
use SQLDBATools
GO
/* All errors that are still to Resolve */
select ServerName, Error, Command from [Staging].[CollectionErrors]
where ServerName like '%Skype%' and Cmdlet = 'Get-SQLInstanceInfo'
select * from DBA.[dbo].[Vw_UnauthorizedServerRoleMembers]
... |
<reponame>Shuttl-Tech/antlr_psql
-- file:privileges.sql ln:737 expect:true
REVOKE SELECT ON atest4 FROM regress_user3
|
<reponame>nad2000/roster
CREATE TABLE IF NOT EXISTS players (
id SERIAL PRIMARY KEY,
name TEXT,
number TEXT,
position TEXT,
height TEXT,
weight TEXT,
age TEXT,
experience INTEGER,
college TEXT
)
|
<filename>services/madoc-ts/migrations/2021-07-01T17-27.sites.sql
--sites (up)
-- Migrated tables:
-- - site
-- - site_permission
-- - user
-- - user_invitations
-- - password_creation
create table "user"
(
id serial not null
constraint user_pk
primary key,
email text not null,
name te... |
<gh_stars>1-10
TRUNCATE TABLE public.application CASCADE;
|
-- --------------------------------------------------------
-- 호스트: 127.0.0.1
-- 서버 버전: 10.2.14-MariaDB - mariadb.org binary distribution
-- 서버 OS: Win64
-- HeidiSQL 버전: 9.4.0.5125
-- -------------------------------------------... |
\c be_tmson;
SELECT * FROM users;
SELECT * FROM skill_categories;
SELECT * FROM skills;
SELECT * FROM users_skills;
SELECT * FROM tokens;
SELECT * FROM tasks;
SELECT * FROM token_transactions;
SELECT * FROM ratings;
|
\set ECHO none
set client_min_messages = 'warning';
\i sql/plproxy.sql
set client_min_messages = 'fatal';
create language plpgsql;
set client_min_messages = 'warning';
-- create cluster info functions
create schema plproxy;
create or replace function plproxy.get_cluster_version(cluster_name text)
returns integer a... |
<gh_stars>1000+
-- 2019-10-03T15:14:17.461Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Field SET IsDisplayed='Y', SeqNo=10,Updated=TO_TIMESTAMP('2019-10-03 18:14:17','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=589490
;
-- 2019-10-03T15:14:17.475Z
-- I forgot to set the DIC... |
SELECT subjects.label,
COUNT(DISTINCT posted_books.barcode) AS "# of Items Retained By Faculty"
FROM subjects
LEFT JOIN sections_subjects ON sections_subjects.subject_id = subjects.subject_id
INNER JOIN posted_books ON posted_books.cn_section = sections_subjects.cn_section
LEFT JOIN faculty_books ON faculty_books... |
<filename>CDP-Retail/artifacts/environment-setup/sql/04-create-stored-procedures.sql
IF EXISTS (SELECT * FROM sysobjects WHERE id = OBJECT_ID(N'[dbo].[Reset_ML_Environment]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [dbo].[Reset_ML_Environment]
GO
CREATE PROC [dbo].[Reset_ML_Environment] AS
BEGIN
de... |
<filename>Database/2021_06_30_004 GetUserByID.sql
USE [Rehersal]
GO
/****** Object: StoredProcedure [dbo].[InsertCity] Script Date: 30.06.2021 14:31:33 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>... |
<filename>jeesite_master.sql
/*
Navicat MySQL Data Transfer
Source Server : 192.168.2.107
Source Server Version : 50629
Source Host : localhost:3306
Source Database : jeesite
Target Server Type : MYSQL
Target Server Version : 50629
File Encoding : 65001
Date: 2016-11-06 19:49:14
*/... |
<filename>src/main/resources/resources/cohortresults/sql/drug/byConcept/sqlAgeAtFirstExposure.sql
select c1.concept_id as concept_id,
c2.concept_name as category,
hrd1.min_value as min_value,
hrd1.p10_value as p10_value,
hrd1.p25_value as p25_value,
hrd1.median_value as median_value,
hrd1.p75_value as p75_value,
... |
<filename>db/dicc-values.sql<gh_stars>1-10
create table dicc (
term varchar(256),
def varchar2(4000))
;
insert into dicc values ('abandon','abandonar; aborrecer; desamparar');
insert into dicc values ('abandoned','abandonado');
insert into dicc values ('abandonment','abdicación');
insert into dicc values ('abas... |
<filename>modules/operations/measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/q13-query.cql<gh_stars>1-10
library Retrieve
using FHIR version '4.0.0'
include FHIRHelpers version '4.0.0'
codesystem icd10: 'http://hl7.org/fhir/sid/icd-10'
define InInitialPopulation:
exists([Condition: Code 'Z78.0' ... |
<reponame>davew-msft/synapse
-- A: Create a Database Master Key.
-- Only necessary if one does not already exist.
-- Required to encrypt the credential secret in the next step.
-- For more information on Master Key: https://docs.microsoft.com/sql/t-sql/statements/create-master-key-transact-sql?toc=/azure/synapse-ana... |
CREATE TABLE [dbo].[AcceptedCreditCard] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[OrganizationId] INT NOT NULL,
[CardType] VARCHAR (255) NULL,
[CreatedAt] DATETIME NOT NULL,
[UpdatedAt] DATETIME NOT NULL,
PRIMARY KEY CLUSTERED ([Id] ASC)
);
... |
CREATE KEYSPACE tutorial WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
use tutorial;
CREATE TABLE comments_by_follower (
follower_username text,
comment_date timestamp,
post_ID int,
artist_username text,
comment_content text,
PRIMARY KEY (follower_username, comment_date)... |
<reponame>santiagoagustinnavarro/yii2administracion
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 21-04-2021 a las 22:57:31
-- Versión del servidor: 10.1.38-MariaDB
-- Versión de PHP: 7.3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMI... |
<filename>sql/_23_apricot_qa/_01_sql_extension3/_07_multi_values_clause/cases/02_join.sql
drop table if exists [test];
create table [test] (id int primary key, name string);
insert into [test] values(1,'name1'),(3,'name3'),(5,'name5'),(6,'name6');
select * from [test] order by 1;
select (values(1));
select * from (se... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.4.13.1deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Mar 29, 2016 at 10:44 PM
-- Server version: 10.0.23-MariaDB-0ubuntu0.15.10.1
-- PHP Version: 5.6.11-1ubuntu3.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- ... |
{{ config(materialized='table') }}
with trips_data as (
select * from {{ ref('fact_trips') }}
)
select
-- Reveneue grouping
pickup_zone as revenue_zone,
-- date_trunc('month', pickup_datetime) as revenue_month,
-- Note: For BQ use instead:
date_trunc(pickup_datetime, month) as revenue_m... |
<reponame>dbmdz/digitalcollections-cms
ALTER TABLE identifiables DISABLE TRIGGER ALL;
UPDATE identifiables SET identifiable_objecttype = 'IDENTIFIABLE';
ALTER TABLE identifiables ENABLE TRIGGER ALL;
ALTER TABLE entities DISABLE TRIGGER ALL;
UPDATE entities SET identifiable_objecttype = 'ENTITY';
ALTER TABLE entities E... |
<reponame>jonasrla/desafio_youse<filename>parte_2/Database/policies_declaration.sql
CREATE TABLE
policies
(
id TEXT PRIMARY KEY,
order_id TEXT REFERENCES orders (id),
insurance_type TEXT NOT NULL,
status TEXT NOT NULL,
reason TEXT,
created_at TEXT NOT NULL,
updated_at TEXT
);
|
# Write your MySQL query statement below
SELECT id, movie, description, rating
FROM cinema
WHERE (id LIKE '%1' OR id LIKE '%3' OR id LIKE '%5' OR id LIKE '%7' OR id LIKE '%9') AND description NOT IN ('boring')
ORDER BY rating DESC; |
CREATE MASTER KEY ENCRYPTION BY PASSWORD = '$(DataLakeEncryptionMasterKey)';
GO
CREATE DATABASE SCOPED CREDENTIAL DataLakeScopedCredential
WITH
IDENTITY = '$(DataLakeAccessId)',
-- datalake access key
SECRET = '$(DataLakeAccessKey)';
|
create table if not exists USER
(
ID INT auto_increment
primary key comment 'ID',
USERNAME VARCHAR(45) not null unique comment 'Unique user name',
PASSWORD_MD5 VARCHAR(45) not null comment 'MD5 password',
EMAIL VARCHAR(... |
<reponame>erlinumardani/rayelivr
INSERT INTO `groups`(`id`, `name`) VALUES
(1, 'DIVISI CUSTOMER EXPERIENCE MANAGEMENT'),
(2, 'DIREKTORAT KORPORAT'),
(3, 'DIVISI BUSINESS STRATEGY & INNOVATION'),
(4, 'DIREKTORAT MARKETING & SALES'),
(5, 'DIVISI FINANCE & ACCOUNTING SSO'),
(6, 'DIVISI HUMAN RESOURCES SSO'),
(7, 'DIVISI ... |
<gh_stars>1-10
select
td_client_id
from
YOUR_TABLE
|
<filename>sql/migrate-1.sql
ALTER TABLE "project_run_report" ADD flows TEXT;
|
INSERT INTO groups (group_id, group_code, group_name)
VALUES (NEWID(), 'PECS_BOLTCC', 'PECS Court Bolton Crown Court'),
(NEWID(), 'PECS_BOLTMC', 'PECS Court Bolton Magistrates Court'),
(NEWID(), 'PECS_EXETMC', 'PECS Court Exeter Magistrates Court'),
(NEWID(), 'PECS_EXETCC', 'PECS Court Exeter Crown... |
CREATE PROCEDURE [srv].[MergeDBFileInfo]
AS
BEGIN
/*
обновляет таблицу файлов БД
*/
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
declare @servername nvarchar(255)=cast(SERVERPROPERTY(N'MachineName') as nvarchar(255));
;merge [srv].[DBFile] as f
using [inf].[ServerDBFileInfo] as ff... |
<gh_stars>10-100
-- file:rolenames.sql ln:240 expect:true
ALTER TABLE testtab6 OWNER TO nonexistent
|
<gh_stars>10-100
-- file:join.sql ln:1386 expect:true
explain (costs off)
select d.* from d left join (select distinct * from b) s
on d.a = s.id
|
--Create the detection sproc:
--USE [OperationsManager]
GO
/****** Object: StoredProcedure [dbo].[p_RecursiveMembershipInconsistencySelect] Script Date: 8/30/2017 6:35:07 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[p_RecursiveMembershipInconsistencySelect]
... |
<reponame>JorgeCandeias/Trader
CREATE PROCEDURE [dbo].[GetTrades]
@Symbol NVARCHAR(100)
AS
SET NOCOUNT ON;
SELECT
[S].[Name] AS [Symbol],
[T].[Id],
[T].[OrderId],
[T].[OrderListId],
[T].[Price],
[T].[Quantity],
[T].[QuoteQuantity],
[T].[Commission],
[T].[CommissionAsset],
[T].[T... |
CREATE TABLE config (
id bigserial primary key,
name varchar(255) NOT NULL,
value varchar(255) NOT NULL
);
CREATE TABLE entries (
id bigserial primary key,
title varchar(255) NOT NULL,
url varchar(255) NOT NULL,
is_read boolean DEFAULT false,
is_fav boolean DEFAULT false,
content TE... |
<filename>appng-core/src/main/resources/db/migration/mysql/V1_6__Add_Min_and_MaxConnections.sql<gh_stars>10-100
alter table database_connection add min_connections INTEGER;
alter table database_connection add max_connections INTEGER;
update database_connection set min_connections = 1;
update database_connection set max... |
<reponame>Erdigergeist/ADB
DELETE FROM `smart_scripts` WHERE (`entryorguid`=15467 AND `source_type`=0);
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`,... |
SELECT TOP 10
COUNT(*) AS [Indexes],
DB_NAME() + '.' + Object_Schema_name(t.object_ID) + '.' + t.name AS [Table]
FROM
sys.indexes i
INNER JOIN
sys.objects t
ON i.object_ID = t.object_ID
AND i.is_hypothetical = 0
WHERE
USER_NAME(OBJECTPROPERTY(i.object_id, 'OwnerId')) NOT LIKE 'sys%'
GROUP BY... |
<reponame>liangzhuo/ExcellencePlatform
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50546
Source Host : localhost:3306
Source Database : demo_test
Target Server Type : MYSQL
Target Server Version : 50546
File Encoding : 65001
Date: 2015-12-27 15:... |
<filename>v3.1/Database/dbo/Data/TDerailKind.sql
USE [RailML_3_1]
GO
INSERT [dbo].[TDerailKind] ([TDerailKindId], [Value]) VALUES (1, N'BlockDerail')
GO
INSERT [dbo].[TDerailKind] ([TDerailKindId], [Value]) VALUES (2, N'SingleCatchPoints')
GO
INSERT [dbo].[TDerailKind] ([TDerailKindId], [Value]) VALUES (3, N'DoubleCat... |
<reponame>duartemolha/ensembl-funcgen
-- Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
-- Copyright [2016-2019] EMBL-European Bioinformatics Institute
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compl... |
<gh_stars>0
select * from {{ var('list_membership') }}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.