sql stringlengths 6 1.05M |
|---|
<reponame>NikolayS/PostgresDBA<filename>sql/b5_tables_no_stats.sql
--Tables and columns without stats (so bloat cannot be estimated)
--Created by PostgreSQL Experts https://github.com/pgexperts/pgx_scripts/blob/master/bloat/no_stats_table_check.sql
SELECT table_schema, table_name,
( pg_class.relpages = 0 ) AS is_... |
DROP TABLE FOREIGNKEYSTABLE%Machine%
DROP VIEW "FROM%Machine%"
DROP TABLE "SELECT%Machine%"
DROP VIEW INTROSPECVIEW%Machine%
DROP TABLE INTROSPECTBL%Machine%
|
-- Complex query. Let's break it down
-- root declarative select after everything is built
select mcm.zone_name, mcm.center_name, mcm.name as item_name,
-- make any non entered values zero
coalesce(m.quantity, 0) as quantity from
(
-- build a cartesian product of all zones, centers and materials
select zone_name, ce... |
<gh_stars>0
CREATE TABLE `plagetri21`.`empresas` (
`id` INT NOT NULL AUTO_INCREMENT,
`nombre` VARCHAR(45) NULL,
`telefono` VARCHAR(45) NULL,
`descripcion` TEXT NULL,
`created_at` VARCHAR(45) NULL,
`updated_at` VARCHAR(45) NULL,
PRIMARY KEY (`id`));
INSERT INTO `plagetri21`.`modulos` (`id`, `modulo`, `ru... |
--
-- Author: <NAME>
-- Date: 2020-08-05 15:33:36 +0100 (Wed, 05 Aug 2020)
--
-- vim:ts=2:sts=2:sw=2:et:filetype=sql
--
-- https://github.com/HariSekhon/SQL-scripts
--
-- License: see accompanying Hari Sekhon LICENSE file
--
-- If you're using my code you're welcome to connect with me on LinkedIn and optionally s... |
create table comment (
id bigint not null auto_increment,
content varchar(32767),
at datetime not null,
post_id bigint not null,
user_id bigint,
primary key (id)
);
create table post (
id bigint not null auto_increment,
body longtext not null,
subject varchar(127) not null,
at datetime not null,
... |
CREATE DEFINER=`root`@`localhost` PROCEDURE `fnGetCountry`()
BEGIN
DROP TEMPORARY TABLE IF EXISTS temptblCountry;
CREATE TEMPORARY TABLE IF NOT EXISTS `temptblCountry` (
`CountryID` INT(11) NOT NULL AUTO_INCREMENT,
`Prefix` VARCHAR(50) NULL DEFAULT NULL,
`Country` VARCHAR(100) NULL DEFAULT NULL,
`ISO2` VARCHAR(5) ... |
<gh_stars>0
/*Select Mostra alocaçoes Mes*/
select
Ca.Carro,
--ca.Ano,
count(Lo.Carro) as 'Total Locacoes',
month(lo.DatAloc) as 'Mes Locacao'
from Locacao Lo inner join Carros Ca on lo.Carro = ca.Id
group by Ca.[Carro], month(lo.DatAloc)
order by 2 desc;
---------------------
/*Select Mostra alocaçoes Ano*/... |
<reponame>DrJohnT/devops-your-dwh
use DWH_QuantumDM;
declare @LoadLogId bigint;
select
@LoadLogId = LoadLogId
from Logging.LoadLog
where LoadLogId = (
select MAX(LoadLogId) from Logging.LoadLog
);
select
*
from Logging.LoadLog
where LoadLogId = @... |
USE [SEDCHome_2020_G7]
GO
-- Delete Data from tables
------------------
delete from [dbo].[GradeDetails] where 1=1;
delete from [dbo].[Grade] where 1=1;
delete from [dbo].[AchievementType] where 1=1;
delete from [dbo].[Course] where 1=1;
delete from [dbo].[Student] where 1=1;
delete from [dbo].[Teacher] where 1=1;
GO
... |
<gh_stars>10-100
CREATE TABLE dialog_message(
uuid VARCHAR(36) NOT NULL,
user1_id BIGINT NOT NULL,
user2_id BIGINT NOT NULL,
sender_id BIGINT NOT NULL,
timestamp BIGINT NOT NULL,
message VARCHAR(1023) NOT NULL,
deleted BOOLE... |
<filename>src/test/resources/sql/select/872e33fd.sql
-- file:rangefuncs.sql ln:213 expect:true
select * from vw_foo
|
<gh_stars>0
DROP DATABASE IF EXISTS employees;
CREATE DATABASE employees;
USE employees;
CREATE TABLE department (
id int auto_increment primary key
,name varchar(30)
);
CREATE TABLE role (
id int auto_increment primary key
,title varchar(30)
,salary DECIMAL
,department_id int
references department(id)
on delete... |
<reponame>Vista-Ridge-Mall-Drive/dining
drop table if exists pooltable;
drop table if exists rental_transaction;
drop table if exists bill_charge;
CREATE TABLE pooltable (
id INTEGER NOT NULL AUTO_INCREMENT,
code VARCHAR(128) NOT NULL,
name VARCHAR(128) NOT NULL,
desc VARCHAR(128) NOT NULL,... |
\connect lightshield;
CREATE TABLE IF NOT EXISTS REGION.match
(
match_id BIGINT,
platform platform,
queue SMALLINT,
timestamp TIMESTAMP,
version SMALLINT,
duration SMALLINT DEFAULT NULL,
win BOOLEAN DEFAULT NULL,
-... |
<filename>db/PE.NominalLedger.Db/Stored Procedures/pe_NL_rpt_Journal_VAT.sql
CREATE PROCEDURE [dbo].[pe_NL_rpt_Journal_VAT]
AS
DECLARE @IntSys varchar(20)
SELECT @IntSys = IntSystem
FROM tblTranNominalControl
IF @IntSys = 'AD'
BEGIN
EXEC pe_NL_rpt_Journal_VAT_AD
END
IF @IntSys = 'GP'
BEGIN
EXEC pe_NL_rpt_Jou... |
-- phpMyAdmin SQL Dump
-- version 2.11.0
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 11, 2015 at 09:30 PM
-- Server version: 5.0.45
-- PHP Version: 5.2.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Database: `contest`
--
-- --------------------------------------------------------
--
-... |
<reponame>lvandeve/almanac.httparchive.org
#standardSQL
# distribution_of_tls_time_by_cdn.sql : Distribution of TLS negotiation time by CDN
SELECT
client,
cdn,
firstHtml,
COUNT(0) AS requests,
APPROX_QUANTILES(tlstime, 1000)[OFFSET(100)] AS p10,
APPROX_QUANTILES(tlstime, 1000)[OFFSET(250)] AS p25,
APPROX_... |
<filename>conf/evolutions/default/1.sql<gh_stars>0
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table task (
id bigint not null,
name varchar(255),
start_date varchar(255),
... |
-- create class using FOREIGN key on nchar data type
create class aoo ( a nchar(10) primary key, b int, c int );
select attr_name, is_nullable from db_attribute where class_name = 'aoo'
order by 1,2;
select * from db_index where class_name = 'aoo' order by 1,2;
select * from aoo order by 1,2;
create class boo (b nc... |
<reponame>cheradmin/DatabaseHomework<filename>SQL Files/views.sql
-- Список сотрудников и их почта
CREATE VIEW devs_emails AS
SELECT
dev_name,
dev_email
FROM
developers;
-- Список продуктов за последний месяц
CREATE OR REPLACE VIEW recent_products AS
SELECT
prod_name
FRO... |
<reponame>hansmodo/hackday_2017
INSERT INTO media VALUES ("ltr_isp1957","letter","1779-07-22","CAMP BUTTER MILK FALLS","NY","US","Israel","Putnam",NULL,"Anthony","Wayne",NULL,"individual",NULL,"The General Officers are now assembled at my Quarters...","ltr_isp1957.txt","<EMAIL>",NULL,20090802183836,NULL,34,0);
INSERT I... |
<reponame>SGershman/simpleimpact<gh_stars>0
CREATE TABLE [ref].[Metrics_UDS](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Metric Name] [nvarchar](255) NOT NULL,
[Question] [nvarchar](255) NULL,
[Short Name] [nvarchar](255) NULL,
[Description] [nvarchar](255) NULL,
[Source] [nvarchar](255) NULL
) ON [PRIMARY]
GO
|
SELECT TOP 25
o.Name as 'Table name',
MAX(s.row_count) AS 'Rows',
SUM(s.reserved_page_count) * 8.0 / 1024 as 'Size [MB]',
(8 * 1024 * sum(s.reserved_page_count)) / (max(s.row_count)) as 'Bytes/Row'
FROM sys.dm_db_partition_stats s, sys.objects o
WHERE o.object_id = s.object_id
GROUP BY o.Name
ORDER BY 'R... |
-- phpMyAdmin SQL Dump
-- version 4.0.4.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 28, 2016 at 04:59 AM
-- Server version: 5.6.13
-- PHP Version: 5.4.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
<reponame>sthokar/LaguardiaFinal
-- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Sep 16, 2015 at 06:49
-- Server version: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
CREATE TABLE files
(
id INT NOT NULL AUTO_INCREMENT,
ownerId INT NOT NULL,
name VARCHAR(255) NOT NULL UNIQUE,
size INT NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY (ownerId) REFERENCES users(id)
) |
INSERT INTO PRODUCTS (ID, NAME, USER_ID) VALUES (1, 'Colher', 1);
INSERT INTO PRODUCTS (ID, NAME, USER_ID) VALUES (2, 'Faca', 1);
INSERT INTO PRODUCTS (ID, NAME, USER_ID) VALUES (3, 'Garfo', 2);
INSERT INTO PRODUCTS (ID, NAME, USER_ID) VALUES (4, 'Lapis', 2);
INSERT INTO PRODUCTS (ID, NAME, USER_ID) VALUES (5, 'Caneta'... |
USE [ANTERO]
GO
/****** Object: StoredProcedure [dw].[p_lataa_f_arvo_yo_uraseuranta_2018] Script Date: 18.9.2019 10:44:24 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dw].[p_lataa_f_arvo_yo_uraseuranta_2018] AS
TRUNCATE TABLE dw.f_arvo_yo_uraseuranta_2018
INSERT INTO dw.f_arvo_... |
<filename>Lesson02/VerifyMigration.sql<gh_stars>10-100
-- Code is reviewed and is in working condition
SELECT TOP (1000) [OrderID]
,[CustomerID]
,[SalespersonPersonID]
,[PickedByPersonID]
,[ContactPersonID]
,[BackorderOrderID]
,[OrderDate]
,[ExpectedDeliveryDate]
,[Custo... |
<reponame>pntone/CORE<gh_stars>1-10
prompt --application/shared_components/security/authorizations/is_active_user
begin
-- Manifest
-- SECURITY SCHEME: IS_ACTIVE_USER
-- Manifest End
wwv_flow_api.component_begin (
p_version_yyyy_mm_dd=>'2021.04.15'
,p_release=>'21.1.7'
,p_default_workspace_id=>9014660246496943... |
<gh_stars>1000+
--
-- with theses constraints, we run into trouble with the normal workflow (e.g. when an inout is reactivated)
-- also, to the material dispo service, there are just random numbers anyways.
-- note that at least for now, we keep "master data" FK cosntraints like C_UOM
--
-- MD_Candidate_Demand_Detail... |
<gh_stars>0
-- Adminer 4.2.3 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `custompages`;
CREATE TABLE `custompages` (
`pageid` int(11) NOT NULL AUTO_INCREMENT,
`shownavlink` int(11) NOT NULL DEFAULT '0',
`safename` ... |
INSERT INTO banners( img_src, width, height, target_url, lang_id )
VALUES ( 'TEST', 0, 0, 'TEST', 'TEST'),
( 'TEST', 2, 3, 'TEST2', 'TEST3');
|
<gh_stars>0
########################################
#Consulta dos pacientes e das pessoas
select a.nra_pront,b.nome,a.pcpf
from paciente a inner join pessoa b on (a.pcpf = b.cpf and b.nome = '<NAME>')
group by a.pcpf;
select a.nra_pront,b.nome,a.pcpf
from paciente a inner join pessoa b on (a.pcpf = b.cpf and b.nome =... |
<gh_stars>0
#apocalypse.sql
drop table if exists Adventures;
CREATE TABLE `Adventures` (
`AdventuresID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Name` varchar(50) DEFAULT NULL,
`Location` varchar(50) DEFAULT NULL,
`Elevation` int(10),
`Mileage` varchar(50) DEFAULT NULL,
`Description` text DEFAU... |
drop table if exists POS_DEVICE cascade;
create table POS_DEVICE (
id bigint ,
location text,
merchant_name text
);
drop table if exists TRANSACTION cascade;
create table TRANSACTION (
id bigint,
device_id bigint,
transaction_value decimal(10,2),
account_id bigint,
ts_millis bigint
);
drop table if exists ZI... |
DROP SEQUENCE IF EXISTS location_images_id_seq;
DROP TABLE IF EXISTS location_images;
CREATE SEQUENCE location_images_id_seq
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO MINVALUE
CACHE 1;
CREATE TABLE location_images (
id integer DEFAULT nextval('location_images_id_seq'::regclass) NOT NULL,
l... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 06, 2022 at 07:59 PM
-- Server version: 10.4.22-MariaDB
-- PHP Version: 8.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
SET planner.width.max_per_node=100;
SET planner.slice_target=1;
SET planner.enable_multiphase_agg=false;
SELECT
max(DECIMAL_18_8),
max(DECIMAL_2_1),
max(DECIMAL_15_5)
FROM dfs.drillTestDir.`decimal/fragments/T_DECIMAL_BIG`;
RESET planner.width.max_per_node;
RESET planner.slice_target;
RESET planner.enable_multiph... |
# Host: localhost (Version: 5.5.53)
# Date: 2018-10-09 20:17:56
# Generator: MySQL-Front 5.3 (Build 4.234)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "bk_admin"
#
DROP TABLE IF EXISTS `bk_admin`;
CREATE TABLE `bk_admin` (
`id` mediumint(6) NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(30) COLL... |
-- SPDX-License-Identifier: Apache-2.0
--
-- returns data needed to create script for downloading all sources which need to be included in the distribution
select distinct
REGEXP_REPLACE(a."applicationName",'\s','') as "applicationName",
NVL(ac."groupId", 'NA') as "groupId",
NVL(ac."artifactId", 'NA') as "artifactId... |
<reponame>anubhavsaxena14/hms
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 25, 2014 at 01:37 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
ALTER TABLE gardener_config ALTER COLUMN disk_type DROP NOT NULL;
ALTER TABLE gardener_config ALTER COLUMN volume_size_gb DROP NOT NULL; |
<filename>src/test/resources/bvt/parser/antlr_grammers_v4_plsql/examples/for_update07.sql<gh_stars>100-1000
select employee_id from (select employee_id+1 as employee_id from employees)
for update of a, b.c, d skip locked
|
DROP SERVER IF EXISTS foo;
|
# --- !Ups
ALTER TABLE task
DROP CONSTRAINT task_request_slug_fkey,
ADD CONSTRAINT task_request_slug_fkey FOREIGN KEY (request_slug) REFERENCES request(slug) ON UPDATE CASCADE;
CREATE TABLE previous_slug (
previous TEXT PRIMARY KEY,
current TEXT REFERENCES request(slug) ON UPDATE CASCADE
);
# --- !Downs
DR... |
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字specifictype(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists specifictype;
CREATE TABLESPACE specifictype RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace specifictype;
--关键字带双引号,创建成功
drop tablespace if exists "specifictype";
CREAT... |
select top(5) FirstName, LastName from Employees
order by Salary desc |
<reponame>xuanrr/drs<gh_stars>0
create table sys_config
(
config_id int auto_increment comment '参数主键'
primary key,
config_name varchar(100) default '' null comment '参数名称',
config_key varchar(100) default '' null comment '参数键名',
config_value varchar(500) default '' null comment '参数键值',
... |
<filename>egov/egov-stms/src/main/resources/db/migration/main/V20161004181402__stms_installment_dml.sql
INSERT INTO eg_installment_master (id, installment_num, installment_year, start_date, end_date, id_module, lastupdatedtimestamp, description, installment_type,financial_year) VALUES
(nextval('SEQ_EG_INSTALLMENT_MAST... |
<reponame>Gellish/advance_inventory<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 08, 2018 at 12:57 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSAC... |
<filename>language-extensions/dotnet-core-CSharp/sample/regex/dotnet-core-CSharp-regex-win.sql
-- Step 1: Create sample data
CREATE DATABASE csharptest
GO
USE csharptest
GO
CREATE TABLE testdata (
[id] int,
[text] varchar(100),
)
GO
INSERT INTO testdata(id, "text") VALUES (4, 'This sentence contains C#')
INS... |
-- file:collate.sql ln:190 expect:true
CREATE INDEX collate_test1_idx2 ON collate_test1 (b COLLATE "POSIX")
|
CREATE OR REPLACE PACKAGE BODY dz_swagger_util
AS
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
FUNCTION get_guid
RETURN VARCHAR2
AS
str_sysguid VARCHAR2(40 Char);
BEGIN
... |
<gh_stars>0
INSERT INTO `sys_page_compose` (`ID` ,`Page` ,`PageWidth` ,`Desc` ,`Caption` ,`Column` ,`Order` ,`Func` ,`Content` ,`DesignBox` ,`ColWidth` ,`Visible` ,`MinWidth`)VALUES (NULL , 'member', '998px', 'all activities summary', '_ibdw_thirdcolumn_modulename', '0', '0', 'PHP', 'require_once(BX_DIRECTORY_PATH_MODU... |
<filename>sql/reset_data.sql
DELETE FROM best_prefixes;
DELETE FROM offloaded_bytes;
DELETE FROM route_statistics; |
<filename>AMB/3-bussiness/utils/AMB_UTIL_PROJECT.body.sql<gh_stars>1-10
create or replace package body AMB_UTIL_PROJECT
as
/**
* genarate project guid as key
*/
function generate_guid return varchar2
as
begin
return AMB_CONSTANT.PREFIX_PROJECT||AMB_UTIL.generate_guid;
end;
end AMB_UTIL_PROJECT; |
with assignee_updates as (
select *
from {{ ref('int_zendesk__updates') }}
where field_name = 'assignee_id'
), calculate_metrics as (
select
ticket_id,
field_name as assignee_id,
value,
ticket_created_date,
valid_starting_at,
lag(valid_starting_at) over ... |
<reponame>Vishal19111999/addons-server<filename>src/olympia/migrations/1169-users_denied_name.sql
ALTER TABLE `users_denied_name`
DROP INDEX `username`,
CHANGE COLUMN `created` `created` DATETIME (6) NOT NULL,
CHANGE COLUMN `modified` `modified` DATETIME (6) NOT NULL;
|
<reponame>opengauss-mirror/Yat
-- @testpoint:创建表未指定主键约束,使用alter语句增加主键约束后使用insert..update语句
--预置条件enable_upsert_to_merge为off
drop table if exists test2;
--创建表未指定主键约束
create table test2 (id int ,name varchar(20) );
--给id列添加主键约束
ALTER TABLE test2 ADD CONSTRAINT id_key primary key (id);
--使用insert常规插入一条数据
insert into test... |
<gh_stars>0
-- @testpoint: opengauss关键字scale(非保留),作为存储过程名,部分测试点合理报错
--关键字不带引号-成功
drop procedure if exists scale;
create procedure scale(
section number(6),
salary_sum out number(8,2),
staffs_count out integer)
is
begin
select sum(salary), count(*) into salary_sum, staffs_count from staffs where section_id = sec... |
CREATE OR REPLACE VIEW view_gys_zj AS
SELECT m.f01_qyqc AS fb1,m.f30_lxrxm AS fb2, m.f32_lxrdh AS fb3,g.cc1,g.puk,g.k01_gysid,g.k02_zjbh,'供应商营业执照' AS k03_zjlb,'1' AS ppp,g.f01_fzdwmc,g.f02_fzrq,g.f03_yxnx,g.f04_yxksrq,g.f05_yxzzrq,g.f06_shzt,g.bbb FROM mga1_yyzz g, mgys0_jbxx m WHERE g.k01_gysid = m.puk AND g.ddd != 1... |
<filename>TimeTrackerDB/dbo/Stored Procedures/spCategory_GetById.sql
CREATE PROCEDURE [dbo].[spCategory_GetById]
@Id int
AS
begin
set nocount on;
select [Id], [Name]
from dbo.Category
where Id = @Id;
end
|
<filename>db/init/04-text-functions.sql
CREATE FUNCTION insert_text(idea_id UUID, user_id UUID, content_type content_type) RETURNS UUID AS $$
DECLARE
text_id UUID;
BEGIN
INSERT INTO text (id_creator) VALUES (user_id) RETURNING id INTO text_id;
INSERT INTO idea_text (id_idea, id_text, content_type) VALUES (idea_id... |
<reponame>howardisaacson/APF-BL-DAP<filename>Anna/Website/APF_website/schema_test.sql
DROP TABLE IF EXISTS test_table;
CREATE TABLE test_table (
id INTEGER PRIMARY KEY AUTOINCREMENT,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
adjective TEXT NOT NULL,
animal TEXT NOT NULL
);
|
<reponame>ciprianprohozescu/georgia-tech-library
BEGIN TRAN create_tables;
CREATE TABLE Address (
id int IDENTITY(1,1) PRIMARY KEY,
city varchar(255),
street varchar(255),
type varchar(255) NOT NULL CHECK (type IN('campus', 'private')),
floor smallint,
apartment smallint,
);
CREATE TABLE Membe... |
<filename>app/SQL/FactorCalculation/StoredProcedures/Factor_Find_Survey_Responses_ISQ.sql
DELIMITER **
DROP PROCEDURE IF EXISTS `Factor_Find_Survey_Responses_ISQ`**
CREATE DEFINER=`synapsemaster`@`%` PROCEDURE `Factor_Find_Survey_Responses_ISQ`(last_update_ISQ DATETIME)
BEGIN
SET @lastupdateISQ = last_update_ISQ;
... |
<filename>sql2rollout/sql-test/prod_bug_1.sql
use rollAut;
delete from rollout_step_type;
delete from rollout_step;
delete from rollout;
delete from rollout_store;
INSERT INTO rollout.rollout
(id, name, `start`)
VALUES(1, 'DemoPackage (Camelride) for sap=m%', STR_TO_DATE('2019-03-21 22:48:00','%Y-%m-%d %H:%i:%s')... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 13, 2018 at 08:05 AM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 11, 2019 at 02:40 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!... |
<gh_stars>0
CREATE TABLE IF NOT EXISTS TODO (
ID BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
TEXT VARCHAR,
FINISH TINYINT,
CREATED TIMESTAMP DEFAULT SYSTIMESTAMP
); |
-- Initialization SQL code for Undertaker tests' table in PostgreSQL storage
CREATE SCHEMA test;
CREATE TABLE IF NOT EXISTS test.__undertaker_test
(
function varchar primary key,
first_seen_at timestamp null
);
CREATE INDEX never_seen_functions ON test.__undertaker_test (first_seen_at) WHERE first_seen_... |
<filename>builds/v3.1.0/fetchq--3.1.0.sql
CREATE SCHEMA IF NOT EXISTS fetchq_data;
CREATE SCHEMA IF NOT EXISTS fetchq;
-- EXTENSION INFO
DROP FUNCTION IF EXISTS fetchq.info();
CREATE OR REPLACE FUNCTION fetchq.info(
OUT version VARCHAR
) AS $$
BEGIN
version='3.1.0';
END; $$
LANGUAGE plpgsql;
-- provides a full ... |
<filename>business-services/collection-services/src/main/resources/db/migration/main/V20201127163033__add_idx_ddl.sql
CREATE INDEX IF NOT EXISTS idx_egcl_payment_paymentstatus ON public.egcl_payment USING btree (paymentstatus);
CREATE INDEX IF NOT EXISTS idx_egcl_payment_tenant_id_paymentstatus ON public.egcl_payment U... |
<filename>apps/chat-service/src/main/resources/sql/schema.sql
CREATE TABLE IF NOT EXISTS messages
(
id VARCHAR(60) DEFAULT RANDOM_UUID() PRIMARY KEY,
content VARCHAR NOT NULL,
content_type VARCHAR(128) NOT NULL,
sent TIMESTAMP NOT NU... |
-- file:numeric.sql ln:428 expect:true
INSERT INTO num_exp_sqrt VALUES (2,'5859.90547836712524903505')
|
-- +----------------------------------------------------------------------------+
-- | <NAME> |
-- | <EMAIL> |
-- | www.idevelopment.info |
-- |-----------------... |
<reponame>tlgs/pgexercises<gh_stars>1-10
SELECT
starttime,
(starttime + (slots * INTERVAL '30 minutes')) AS endtime
FROM
cd.bookings
ORDER BY
endtime DESC,
starttime DESC
LIMIT
10;
|
<filename>src/BuiltIn/Installation/SQL/MySQL/foreign-keys.sql
ALTER TABLE `pc_builtin_content_block`
ADD CONSTRAINT `pc_builtin_content_block_ibfk_1` FOREIGN KEY (`Content`) REFERENCES `pc_core_content` (`ID`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `pc_builtin_content_container`
ADD CONSTRAINT `pc_built... |
<filename>src/main/java/cn/lee/hackerrank/sql/basic/select/SelectAll.sql
/*/*
https://www.hackerrank.com/challenges/revising-the-select-query-2/problem
Query all columns (attributes) for every row in the CITY table.
Input Format
The CITY table is described as follows:
*/
select * from CITY |
use dfs.tpcds_sf1_json_views;
create or replace view customer as select
cast(c_customer_sk as integer) as c_customer_sk,
cast(c_customer_id as varchar(200)) as c_customer_id,
cast(c_current_cdemo_sk as integer) as c_current_cdemo_sk,
cast(c_current_hdemo_sk as integer) as c_current_hdemo_sk,
cast(c_current_addr_sk... |
<reponame>mettlesolutions/coverage_determinations<gh_stars>0
//Tumor Antigen by Immunoassay - CA 125
library TumorAntigenbyImmunoassayCA125
using FHIR
include FHIRHelpers version '1.8' called FHIRHelpers
//include otherLibrary version 'x.x' called otherLibrary
//codesystem codeSystemName : 'OID' version 'x.x'
//value... |
<reponame>codersongs/scene_solution
--创建自增数据库和数据库表
CREATE DATABASE `seqid`;
CREATE TABLE sequence_id ( id BIGINT ( 20 ) UNSIGNED NOT NULL auto_increment, VALUE CHAR ( 10 ) NOT NULL DEFAULT '', PRIMARY KEY ( id ) ) ENGINE = INNODB;
--多数据源数据库
--数据库一
CREATE DATABASE `multiseq1`;
CREATE TABLE sequence_id ( id BIGINT ( 20 )... |
-- Copyright 2020 The Nomulus Authors. All Rights Reserved.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by a... |
<reponame>jason-fox/stellio-context-broker<gh_stars>10-100
ALTER TABLE temporal_entity_attribute ADD COLUMN dataset_id VARCHAR(255);
ALTER TABLE temporal_entity_attribute DROP CONSTRAINT entity_pkey;
ALTER TABLE temporal_entity_attribute
ADD CONSTRAINT temporal_entity_attribute_uniqueness
UNIQUE (entity_id, att... |
<filename>sql/setup/mysql_indexes.sql
alter table breakdown_marks add index(session_id, subject_id);
alter table course add index(course_id);
alter table course_enroll add index(course_id, member_id);
alter table course_portfolio_text add index(subject_id);
alter table course_sco add index(course_id, sco_id);
alter tab... |
select
type || ' ' || name as resource,
case
when (arguments -> 'rotation_rules') is null then 'alarm'
else 'ok'
end as status,
name || case
when (arguments -> 'rotation_rules') is null then ' automatic rotation disabled'
else ' automatic rotation enabled'
end || '.' as reason,
path || ':' |... |
<gh_stars>1000+
/*
Demo: Creating a Classification Model in BigQuery
1. Open BigQuery: https://console.cloud.google.com/bigquery
2. Create a dataset titled ecommerce (if not done already)
3. Review the ML model + the training data we are feeding in
Model objective: Classify a return visitor as whether they will ma... |
<filename>testdrive.sql
/*
Navicat Premium Data Transfer
Source Server : localhost - mysql
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost:3306
Source Schema : testdrive
Target Server Type : MySQL
Target Server Version : 50724
File Encoding ... |
-- [er]retrieve by function of to_timestamp using defult format_argument to suit the string whith not is the format 'HH:MI[:SS] [am|pm] MM/DD/YYYY'
create class func_04 ( a string, b char(22), c varchar(22), d int );
insert into func_04 values (null, null,null,1);
insert into func_04 values ('01:01:01 am 01/01/2000','0... |
<filename>src/main/resources/schema.sql
CREATE SCHEMA IF NOT EXISTS login;
SET SCHEMA login;
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS role;
DROP TABLE IF EXISTS user_role;
CREATE TABLE user(
user_id int(11) NOT NULL AUTO_INCREMENT,
active int(11) DEFAULT NULL,
email varchar(255) NOT NULL,
last_name var... |
create or replace function dept_wise_sal(dept_id int[])
returns table(
department_name varchar,
salary int
)
as
$$
declare
begin
return query
select d.department_name::varchar,sum(e.salary)::int as sal
from employees e
inner join departments d
on e.department_id =d.department_id
where d.dep... |
<reponame>sanishtj/ASP.NET-Core-REST-API-Auth-Microservice<gh_stars>0
DECLARE @var0 sysname;
SELECT @var0 = [d].[name]
FROM [sys].[default_constraints] [d]
INNER JOIN [sys].[columns] [c] ON [d].[parent_column_id] = [c].[column_id] AND [d].[parent_object_id] = [c].[object_id]
WHERE ([d].[parent_object_id] = OBJECT_ID(N... |
/*
Navicat MySQL Data Transfer
Source Server : Server Local
Source Server Version : 50532
Source Host : 127.0.0.1:3306
Source Database : pariwisata
Target Server Type : MYSQL
Target Server Version : 50532
File Encoding : 65001
Date: 2017-10-19 10:18:30
*/
SET FOREIGN_KEY_CHECKS=0;... |
-- TPC-H Query 13
select
c_count,
count(*) as custdist
from
(
select
c.custkey,
count(o.orderkey) c_count
from
customer c left outer join orders o on
c.custkey... |
-- MySQL dump 10.13 Distrib 5.5.46, for debian-linux-gnu (i686)
--
-- Host: localhost Database: inventaris1
-- ------------------------------------------------------
-- Server version 5.5.46-0+deb7u1-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHA... |
<gh_stars>0
-- SetupConfig: { "Requires": "CK.sActorEMailAdd" }
--
-- Validates an email by uptating its ValTime to the current sysutdatetime().
-- Validating a non existing email is silently ignored.
-- If the current primary mail is not validated, this newly validated email becomes
-- the primary one.
--
create pro... |
UPDATE
${schema_name}.punktraster25m_lockergestein_basis AS point
SET geometrie = subquery.pz
FROM
(
SELECT
p_t_id,
ST_SetSRID(ST_MakePoint(ST_X(p), ST_Y(p), ${schema_name}.interpolateZValue(p, p0, p1, p2)), 2056) AS pz
FROM
(
SELECT
ST_PointN(ST_Boundary(triangle.geometrie), 1) AS p0,
... |
-- :name truncate-tf-idf :! :n
TRUNCATE words_tfidf;
-- :name calc-tf-idf :! :n
-- :doc insert new words
INSERT INTO words_tfidf (id, word, url, tfidf)
SELECT
words.id,
words.word,
words.url,
(CAST(count(words.word) AS REAL) / CAST(SUM(total.word_count) AS REAL)) * SUM(idf.idf) AS tfidf
FROM
word... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.