sql
stringlengths
6
1.05M
CREATE PROCEDURE [dbm].[InsertAbpUser] @Id [bigint], @TenantId [int], @FirstName [nvarchar](64), @LastName [nvarchar](64), @PhoneNumber [nvarchar](32), @IsPhoneNumberConfirmed [bit], @IsActive [bit], @IsDeleted [bit] AS BEGIN -- Set value for [DeletionTime] DECLARE @DeletionTime...
-- file:alter_table.sql ln:318 expect:true ALTER TABLE tmp3 ADD CONSTRAINT b_le_20 CHECK (b <= 20) NOT VALID
<filename>samples/features/ssms-templates/Sql/Default/Drop Default.sql -- ======================== -- Drop Default template -- ======================== -- This feature is marked for deprecation DROP DEFAULT <schema_name, sysname, dbo>.<default_name, , today> GO
<reponame>metas-fresh/fresh<filename>backend/de.metas.async/src/main/sql/postgresql/system/80-async-dlm/5624381_sys_gh12591_migrate_c_queue_package_processor_ID.sql update c_queue_workpackage set c_queue_packageprocessor_id = block.c_queue_packageprocessor_id, updatedBy=99, updated=TO_TIMESTAMP('2022-02-04 12:16:30', '...
-- 2018-09-14T13:45:43.871 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceO...
<reponame>aravi5/drill-test-framework SELECT cast(1234.56 as DECIMAL(2, 2));
<gh_stars>0 CREATE TABLE RABBIT_TEST_BIND ( id int auto_increment, old_bind_id int, source_bind_id int, destination_bind_id int, message_device_id int, PRIMARY KEY (id), FOREIGN KEY (old_bind_id) REFERENCES RABBIT_BIND (id), FOREIGN KEY (source_bind_id) REFERENCES RABBIT_BIND (id), ...
<gh_stars>1-10 -- ---------------------------- -- Table structure for pms_product_category_attribute_relation -- ---------------------------- DROP TABLE IF EXISTS `pms_product_category_attribute_relation`;
<filename>business/docs/sql/0.0.1.sql<gh_stars>1-10 DROP TABLE IF EXISTS user; CREATE TABLE user ( `id` BIGINT UNSIGNED NOT NULL COMMENT '主键 ID', `name` VARCHAR(255) NOT NULL COMMENT '姓名', `age` TINYINT UNSIGNED COMMENT '年龄', `email` VARCHAR(255) DEFAULT NULL COMMENT '邮箱', `version` INT UNSIGNED DEF...
SELECT 'drop' FROM pg_drop_replication_slot('regression_slot'); DROP TABLE test_filter; DROP TABLE test_nofilt; DROP FUNCTION test_filter(relid regclass, action "char", nodeid text); DROP FUNCTION test_action_filter(relid regclass, action "char", nodeid text); DROP FUNCTION wrong_signature_fn(relid regclass); DROP E...
<reponame>LuisBonfa/humidity -- Initialize system backend port: insert into configuration(name, value) values('Java backend port', '48080'); -- Initializes the log entity history, with the initial empty log: insert into entity_history(id, entity_name, entity_id, entity_data) values (0, '', uuid_generate_v4(), '{}'::js...
/* Enter your query here. */ select CONCAT(name, '(', LEFT(occupation, 1), ')') as shortname from OCCUPATIONS ORDER BY name; SELECT CONCAT('There are a total of ', COUNT(*), ' ', LOWER(Occupation), 's.') FROM Occupations GROUP BY Occupation ORDER BY COUNT(Occupation) ASC, Occupation;
SELECT touchstone.touchstone_name, touchstone.id AS touchstone, impact_estimate_recipe.id AS impact_estimate_recipe, impact_estimate_recipe.disease, impact_estimate_recipe.vaccine, impact_estimate_recipe.impact_outcome, impact_estimate_recipe.support_type, impact_estimat...
<reponame>full360/sneaql-standard /*-execute-*/ create table test ( a integer );
-- AlterTable ALTER TABLE "users" ADD COLUMN "lastSeenAt" TIMESTAMP(3);
-- phpMyAdmin SQL Dump -- version 5.0.1 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Tempo de geração: 14-Out-2020 às 13:19 -- Versão do servidor: 10.4.11-MariaDB -- versão do PHP: 7.4.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @...
select convert(date, comprobante.FechaEmision) FechaEmisionRetencion, substring(comprobante.NumeroComprobanteRetencion,1,3) Establecimiento, substring(comprobante.NumeroComprobanteRetencion,5,3) PuntoEmision, substring(comprobante.NumeroComprobanteRetencion,9,len(comprobante.NumeroComprobanteRetencion)) Nume...
<filename>scriptDB/CreaDAW2DPLDBDepartamentos.sql --Creacion de base de datos DB205DWESMtoDepartamentosTema4 create database if not exists DB205DWESMtoDepartamentosTema4; --Creacion de la tabla Departamento en la base de datos DB205DWESMtoDepartamentosTema4 create table DB205DWESMtoDepartamentosTema4.Departamento( ...
set lines 80; set pages 999; set heading off; select to_char(snap_time,'yyyy-mm-dd hh24'), substr(sql_text,1,50) from stats$sql_summary a, stats$snapshot sn where a.snap_id = sn.snap_id and to_char(snap_time,'hh24') = 10 or to_char(snap_time,'hh24') = 15 order by rows_processed desc;
<filename>coreDatabase/create_dd_schema.sql<gh_stars>0 -- Create the Dino Date (DD) Schema -- -- Authors: <NAME> -- -- 2018-03-15 SET SERVEROUTPUT ON -- SET ECHO ON WHENEVER SQLERROR EXIT DECLARE lc_username VARCHAR2 (32) := 'DD'; BEGIN BEGIN EXECUTE IMMEDIATE 'REVOKE CREATE SESSION FROM dd'; EXCEPTION ...
<gh_stars>1-10 drop table if exists dbo.tbl_UnitTest; go create table dbo.tbl_UnitTest ( constraint pk_tbl_UnitTest primary key (id) ,id int identity ); go
CREATE SCHEMA jwt; CREATE EXTENSION pgcrypto; CREATE OR REPLACE FUNCTION jwt.url_encode(data BYTEA) RETURNS TEXT LANGUAGE SQL AS $$ SELECT translate(encode(data, 'base64'), E'+/=\n', '-_'); $$; CREATE OR REPLACE FUNCTION jwt.url_decode(data TEXT) RETURNS BYTEA LANGUAGE SQL AS $$ WITH t AS (SELECT translate(data, ...
<filename>leetcode/sql/DeleteDuplicateEmails.sql -- LC196: https://leetcode.com/problems/delete-duplicate-emails/ -- Write a SQL query to delete all duplicate email entries in a table named -- Person, keeping only unique emails based on its smallest Id. -- +----+------------------+ -- | Id | Email | -- +-...
CREATE TABLE `banco`.`configuracoes` ( `idConfig` INT NOT NULL AUTO_INCREMENT , `config` VARCHAR(20) NOT NULL UNIQUE, `valor` VARCHAR(20) NOT NULL , PRIMARY KEY (`idConfig`)) ENGINE = InnoDB; INSERT INTO `configuracoes` (`idConfig`, `config`, `valor`) VALUES (2, 'app_name', 'Map-OS'), (3, 'app_theme', 'white'), (4, 'p...
<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jan 12, 2021 at 05:03 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHAR...
-- file:date.sql ln:308 expect:true SELECT EXTRACT(QUARTER FROM DATE 'infinity')
INSERT INTO `hospital` (`id`, `name`, `level`, `hospital_id`, `start_time`, `phone`, `address`, `create_time`, `update_time`, `notes`) VALUES (1, '北京协和医院', '三级甲等', 1, '08:30:00', '医院总机查号台:69156114', '[东院]北京市东城区帅府园一号 [西院]北京市西城区大木仓胡同41号', '2019-06-28 16:07:55', '2019-06-28 16:07:55', ''), (2, '中国人民解放军总医院(301医院)', '三级甲等...
refresh table metadata dfs.`/drill/testdata/parquet_date/metadata_cache/metadata_cache1.2/ctas_t1`; refresh table metadata dfs.`/drill/testdata/parquet_date/metadata_cache/metadata_cache1.2/ctas_t14`; refresh table metadata dfs.`/drill/testdata/parquet_date/metadata_cache/metadata_cache1.2/date_nulls`; refresh table me...
<gh_stars>1-10 --DROP PROCEDURE GPSQLWEB.procCountEmbargos CREATE PROCEDURE GPSQLWEB.procCountEmbargos ( IN P_EEMPRE varchar(2), IN P_EDELEG varchar(2), IN P_EMOVNI varchar(12), IN P_EMONTO double, IN P_EMONTT double, IN P_EFECHA BIGINT, IN P_EFECHF BIGINT, IN P_EUSUAR varchar(10), IN P_EPANTA varcha...
<reponame>Bewalticus/gocd<filename>server/db/migrate/h2deltas/1909001_update_agents_table.sql -- -- Copyright 2019 ThoughtWorks, Inc. -- -- 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 -- --...
CREATE DATABASE IF NOT EXISTS test; DROP TABLE IF EXISTS test.has_column_in_table; CREATE TABLE test.has_column_in_table (i Int64, s String, nest Nested(x UInt8, y UInt32)) ENGINE = Memory; /* existing column */ SELECT hasColumnInTable('test', 'has_column_in_table', 'i'); SELECT hasColumnInTable('localhost', 'test', '...
/* this is the cryptoac admin. Remember to separate the admin user you use for managing the DB from the cryptoac admin for handling AC policies Remember also to choose and change the password */ DROP USER IF EXISTS 'admin'@'%'; CREATE USER 'admin'@'%' IDENTIFIED BY 'password'; GRANT SELECT,INSERT,UPDATE,DELETE ON *.* T...
-- Licensed to the Apache Software Foundation (ASF) under one or more -- contributor license agreements. See the NOTICE file distributed with -- this work for additional information regarding copyright ownership. -- The ASF licenses this file to You under the Apache License, Version 2.0 -- (the License); you may not u...
<gh_stars>1000+ -- database: presto; groups: tpch; tables: supplier,nation,partsupp,lineitem,part SELECT s_name, s_address FROM supplier, nation WHERE s_suppkey IN ( SELECT ps_suppkey FROM partsupp WHERE ps_partkey IN ( SELECT p_partkey FROM part WHERE ...
-- phpMyAdmin SQL Dump -- version 2.11.8.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Nov 22, 2009 at 09:11 AM -- Server version: 5.0.27 -- PHP Version: 5.1.6 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTE...
<filename>fixtures/doctests/ecpg/139/input.sql EXEC SQL SET CONNECTION TO con2; EXEC SQL SET CONNECTION = con1;
import Stdlib import PdfValue import Jpeg def TopDecl = { id = Token Natural; gen = Token Natural; KW "obj"; @val = Value; obj = TopDeclDef val; Match "endobj"; } def TopDeclDef (val : Value) = Choose1 { stream = Stream val; value = ^ val } def Stream (val : Value) = { header = val is dict; ...
-- Insert regions INSERT INTO regions (id, name) VALUES (1, 'Argentina'); INSERT INTO regions (id, name) VALUES (2, 'Australia'); INSERT INTO regions (id, name) VALUES (3, 'Austria'); INSERT INTO regions (id, name) VALUES (4, 'Brazil'); INSERT INTO regions (id, name) VALUES (5, 'California'); INSERT INTO regions (id, n...
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 03, 2019 at 06:16 PM -- Server version: 10.1.39-MariaDB -- PHP Version: 7.3.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
CREATE TABLE IF NOT EXISTS wrboot_dbinfo (ID SERIAL NOT NULL , dbtype VARCHAR(50), dbname VARCHAR(100), dbdriverclass VARCHAR(100), dburl VARCHAR(100), dbuser VARCHAR(50), dbpassword VARCHAR(50), remark VARCHAR(200), PRIMARY KEY(id) );
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * Author: tesa * Created: 11-Mar-2020 */ DROP TABLE IF EXISTS categories; CREATE TABLE categories( id serial PRIMARY KEY, ...
SELECT `stations`.`id` AS `id` FROM `stations` WHERE `stations`.`id` IN (SELECT DISTINCT `station` FROM `inventory` WHERE `mode` IN ( 'H', 'P' ) AND `end` >= Date(Now())) AND `stations`.`id` NOT IN (SELECT DISTINCT `sta...
create table phonebook ( name varchar(50) not null, phno bigint(50) primary key, address varchar(50) not null, company varchar(50) not null, zipcode int(10) not null ); insert into phonebook values ('Anisha' , 9036403321, 'Bangalore', 'LinkedIn', 560024 ); insert into phonebook values ('Amisha' , 8036403321, ...
SET NOCOUNT ON; PRINT 'Add Covid 19 content entry'; BEGIN TRAN; BEGIN TRY IF OBJECT_ID('dbo.Content') IS NULL BEGIN; THROW 50000, 'The covid content could not be added as the dbo.Content table does not exist', 1; END; IF OBJECT_ID('dbo.ApplicationContent') IS NULL BEGIN; THROW 50000, 'The Covid 19 content...
insert into city(id, name) values(UUID_TO_BIN('22f09c8f-8302-4dce-b80f-95a330eb7cdc'), 'Cabo San Lucas'); insert into city(id, name) values(UUID_TO_BIN('cc4c1f05-2761-4b7d-b8db-a526f1fb3089'), 'Ciudad Constitución'); insert into city...
SELECT * FROM (SELECT [EmployeeID], [FirstName], [LastName], [Salary], DENSE_RANK() OVER ( PARTITION BY [Salary] ORDER BY [EmployeeID]) AS [Rank] FROM [Employees] WHERE [Salary] >= 10000 AND [Salary] <= 50000) s WHERE [Rank] = 2 ORDER BY [Salary] DESC;
<gh_stars>10-100  CREATE view [inf].[vSizeCache] as --Текущий размер всего кэша планов и кэша планов запросов (https://club.directum.ru/post/1125) with tbl as ( select TotalCacheSize = SUM(CAST(size_in_bytes as bigint)) / 1048576, QueriesCacheSize = SUM(CAST((case when objtype in ('Adhoc', 'Prepared...
/* Warnings: - You are about to drop the column `type` on the `activities` table. All the data in the column will be lost. - The migration will add a unique constraint covering the columns `[topic_id,learner_id]` on the table `activities`. If there are existing duplicate values, the migration will fail. - Adde...
<gh_stars>1-10 CREATE OR REPLACE TRIGGER vaccinoScaduto BEFORE INSERT OR UPDATE OF DATA_ORA_EFFETTIVA ON VACCINAZIONE FOR EACH ROW DECLARE check_data LOTTO_VACCINO.SCADENZA%TYPE; BEGIN -- Si estrae la scadenza del lotto di vaccino che si sta utilizzando SELECT SCA...
<reponame>billinkc/SSMSTemplates USE [SSISDB] GO DECLARE @folder_name nvarchar(128) , @project_name nvarchar(128) , @environment_name nvarchar(128); DECLARE Csr CURSOR READ_ONLY FOR SELECT CF.name AS folder_name FROM catalog.folders AS CF --WHERE -- CF.name IN (''); ; OPEN Csr; FETCH NEXT FROM Cs...
ALTER TABLE scan_product_result DROP COLUMN meta_data text ;
-- file:varchar.sql ln:5 expect:true CREATE TABLE VARCHAR_TBL(f1 varchar(1))
DROP TABLE IF EXISTS users; DROP TABLE IF EXISTS files; DROP TABLE IF EXISTS login_attempts; DROP TABLE IF EXISTS sessions; DROP TABLE IF EXISTS session_data; DROP TABLE IF EXISTS products; DROP TABLE IF EXISTS keystore; DROP TABLE IF EXISTS customers; DROP TABLE IF EXISTS orders; DROP TABLE IF EXISTS financials; DROP...
<gh_stars>1-10 DROP TABLE IF EXISTS `character_spell_cooldown`; CREATE TABLE `character_spell_cooldown` ( `guid` int(11) unsigned NOT NULL default '0' COMMENT 'Global Unique Identifier, Low part', `spell` int(11) unsigned NOT NULL default '0' COMMENT 'Spell Identifier', `time` int(11) unsigned NOT NULL default ...
-- -- The Categories Package -- -- @author <NAME> (<EMAIL>) -- @creation-date 2003-04-16 -- begin -- create the privileges acs_privilege.create_privilege('category_tree_write'); acs_privilege.create_privilege('category_tree_read'); acs_privilege.create_privilege('category_tree_grant_permissions'); ...
<reponame>vnetcon/curvy<filename>win64-postgresql/pgAdmin 4/web/pgadmin/browser/server_groups/servers/databases/schemas/foreign_tables/templates/foreign_tables/sql/9.5_plus/update.sql<gh_stars>0 {% import 'macros/schemas/security.macros' as SECLABEL %} {% import 'macros/schemas/privilege.macros' as PRIVILEGE %} {% if d...
<filename>6_Assessment_2.sql /*https://docs.google.com/document/d/1wiuYbTQslmfolQWgeVPB356csjK6yqOUBhgC7fM44o8/edit*/ /*QUESTION-1*/ SELECT * FROM cd.facilities /*QUESTION-2*/ SELECT name,membercost FROM cd.facilities /*QUESTION-3*/ SELECT name,membercost FROM cd.facilities WHERE membercost!=0 /*QUESTION-4*...
with stg_events as ( select * from {{ ref('stg_events') }} ) , dim_users as ( select * from {{ ref('dim_users') }} ) select e.* , u.first_name as user_first_name , u.last_name as user_last_name , u.email as user_email , u.phone_number as user_phone_number , u.created_at as user_created_at ...
DROP TABLE user_passwords; CREATE TABLE user_passwords ( user_id INT NOT NULL, hash BYTEA NOT NULL, salt BYTEA NOT NULL, PRIMARY KEY (user_id) );
-- -------------------------------------------------------- -- 主机: 127.0.0.1 -- 服务器版本: 10.5.5-MariaDB - mariadb.org binary distribution -- 服务器操作系统: Win64 -- HeidiSQL 版本: 11.0.0.5919 -- ------------------------------------------------...
#-- Copyright 2022 Google LLC #-- #-- 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 #-- #-- https://www.apache.org/licenses/LICENSE-2.0 #-- #-- Unless required by applicable law or agre...
CREATE TABLE jivePresence ( username VARCHAR(64) NOT NULL, offlinePresence LONGVARCHAR, offlineDate VARCHAR(15) NOT NULL, CONSTRAINT jivePresence_pk PRIMARY KEY (username) ); UPDATE jiveVersion set version=11 where name = 'openfire';
\set ON_ERROR_ROLLBACK 1 \set ON_ERROR_STOP true SELECT set_config('search_path', 'jobmon, dblink, public', false); SELECT plan(6); SELECT jobmon_test_jobs_normal(); SELECT results_eq('SELECT job_name, status FROM job_log WHERE job_name IN ( ''PG_JOBMON TEST BAD JOB'', ''PG_JOBMON TEST GOOD JOB'', ''PG_...
drop table if exists test; create table test(c1 int, c2 int); insert into test select i, i+1 from generate_series(1,5000)i; analyze test;
-- phpMyAdmin SQL Dump -- version 3.4.10.1 -- http://www.phpmyadmin.net -- -- 主机: localhost -- 生成日期: 2015 年 04 月 23 日 10:03 -- 服务器版本: 5.5.20 -- PHP 版本: 5.3.10 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_...
CREATE OR ALTER FUNCTION ufn_CashInUsersGames(@GameName NVARCHAR(50)) RETURNS DECIMAL AS BEGIN DECLARE @Result DECIMAL(36,2); SET @Result = (SELECT SUM(Cash) FROM (SELECT Cash, ug.Id, g.[Name] AS [TheName], ROW_NUMBER() OVER (ORDER BY Cash DESC) AS Ranking FROM UsersGames ug JOIN Game...
<reponame>ennnbeee/mem-scripts<filename>SCCM/sql-server-maintenance-solution-master/CommandLog.sql SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[CommandLog]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[CommandLog]( [ID] [int] IDENTIT...
<filename>13_MySQL_Handle-data/05_selection.sql CREATE TABLE IF NOT EXISTS paintings ( id INT AUTO_INCREMENT PRIMARY KEY, artists CHAR(32), titles CHAR(64), styles CHAR(16) ); INSERT INTO paintings(artists, titles, styles) VALUES ("<NAME>","Meditative Rose","Surrealist"), ("<NAME>","Blue Hair", "Impressionist"), ...
/* Warnings: - You are about to drop the column `likes` on the `produtos` table. All the data in the column will be lost. */ -- AlterTable ALTER TABLE "produtos" DROP COLUMN "likes";
<gh_stars>0 /* Navicat MySQL Data Transfer Source Server : localhost_3306 Source Server Version : 50547 Source Host : localhost:3306 Source Database : web Target Server Type : MYSQL Target Server Version : 50547 File Encoding : 65001 Date: 2017-03-26 16:52:27 */ SET FOREIGN_KEY_CH...
<reponame>BlackBoxSQL/potosio_office<gh_stars>0 INSERT INTO `upazila` (`id`, `district_id`, `upazila`) VALUES (1, 1, 'Debidwar'), (2, 1, 'Barura'), (3, 1, 'Brahmanpara'), (4, 1, 'Chandina'), (5, 1, 'Chauddagram'), (6, 1, 'Daudkandi'), (7, 1, 'Homna'), (8, 1, 'Laksam'), (9, 1, 'Muradnagar'), (10, 1, 'Nangalkot'), (11, 1...
<filename>Mercury.Database/Mercury.Database.Environment/Schema Objects/Schemas/dbo/Tables/WorkOutcome.table.sql -- DBO.[WORKOUTCOME] (BEGIN) /* IF EXISTS (SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE (TABLE_NAME = 'WorkOutcome') AND (TABLE_SCHEMA = 'dbo')) DROP TABLE dbo.[WorkOutcome] GO */ CREATE T...
<reponame>Patrickleeee/jenkins-docker /* Navicat Premium Data Transfer Source Server : data01 Source Server Type : MySQL Source Server Version : 50720 Source Host : 172.16.58.3 Source Database : risk_db Target Server Type : MySQL Target Server Version : 50720 File Encoding ...
INSERT INTO `visits` (`id`, `client_name`, `complaint`, `price`, `date`, `hour`, `duration`, `client_id`, `created_at`, `updated_at`) VALUES (4, 'الاء محمد', 'قطنيه 4.5', '110', '2020-03-21', '4', '30m', 4, '2020-03-21 15:17:06', '2020-03-21 15:17:06'), (5, 'عايده علي سعيد', 'تقلص في عضلات الرقبه', '85', '2020-03-20', ...
-- Create and use customer_db CREATE DATABASE customer_db; USE customer_db; -- Create Two Tables CREATE TABLE premise ( id INT PRIMARY KEY, premise_name TEXT, county_id INT ); CREATE TABLE county ( id INT PRIMARY KEY, county_name TEXT, license_count INT, county_id INT );
<reponame>msotiroff/Softuni-learning CREATE PROC dbo.usp_GetTownsStartingWith @BeginWith VARCHAR(MAX) AS SELECT t.Name FROM Towns AS t WHERE LEFT(t.Name, LEN(@BeginWith)) LIKE @BeginWith
CREATE TABLE "users" ( "id" serial NOT NULL PRIMARY KEY, "name" character varying(100) NOT NULL, "username" character varying(20) NOT NULL UNIQUE, "email" character varying(120) NOT NULL UNIQUE, "password" character(40) NOT NULL, "salt" character varying(32), "group_id" integer );
#task №1 select author.name, count(BOOK_ID) as AI from author inner join author_book ab on author.ID = ab.AUTHOR_ID group by AUTHOR_ID; #task №2 select a.NAME, s.CITY, sum(QUANTITY) from book_store bs inner join author_book ab on bs.BOOK_ID = ab.BOOK_ID inner join store s on bs.STORE_ID = s.ID ...
-- This returns the category, units and count for each -- It assume NULL units are FALSE (reflects real world case) SELECT category, COALESCE(units,FALSE) AS units, COUNT(*) AS N FROM measurements GROUP BY category, COALESCE(units,FALSE) ; -- This uses the results of the previous to compute...
CREATE TABLE "COUNTERS"."QLIST" ( "QLISTID" NUMBER(18,0) NOT NULL ENABLE, "ID_BD" NUMBER(5,0) NOT NULL ENABLE, "PROCESSED" NUMBER(1,0) DEFAULT 0, "QDATE" DATE, "ID_PTYPE" Number(2), CONSTRAINT "QLIST_PK" PRIMARY KEY ("QLISTID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAG...
<gh_stars>10-100 -- by <EMAIL> -- My2 Collector -- 0.0.1 2013-02-14 First version for MySQL 5.6 -- 0.0.6 2017-04-01 DBCPU as SUM_TIMER_WAIT from events_statements_summary_global_by_event_name -- 0.0.7 2017-11-01 bug fixed (0 as first value for delta), MariaDB 10.2 support, new custom statistics -- 0.0.7a 2018-02-18 ...
ALTER TABLE `game_definition_migrations` ADD INDEX (`game_id`, `migration_time`); ALTER TABLE `game_definition_migrations` ADD INDEX (`migration_type`);
-- RNGSEED: 1 -- EXPLAIN (FORMAT JSON) select i_item_desc ,w_warehouse_name ,d1.d_week_seq ,sum(case when p_promo_sk is null then 1 else 0 end) no_promo ,sum(case when p_promo_sk is not null then 1 else 0 end) promo ,count(*) total_cnt from catalog_sales join inventory on (cs_item_sk = i...
ALTER SYSTEM SET wal_level='logical'; ALTER SYSTEM SET max_wal_senders='10'; ALTER SYSTEM SET max_replication_slots='10'; -- Create a second schema CREATE SCHEMA personal; -- USERS CREATE TYPE public.user_status AS ENUM ('ONLINE', 'OFFLINE'); CREATE TABLE public.users ( username text primary key, inserted_at tim...
-- This script uses sqlcmd scripting variables. They are in the form -- $(MyVariable). For information about how to use scripting variables -- on the command line and in SQL Server Management Studio, see the -- "Executing Replication Scripts" section in the topic -- "Programming Replication Using System Stored Proce...
# Time: O(n) # Space: O(n) WITH cte AS (SELECT wimbledon AS id FROM championships UNION ALL SELECT fr_open AS id FROM championships UNION ALL SELECT us_open AS id FROM championships UNION ALL SELECT au_open AS id FROM...
DROP SCHEMA IF EXISTS `cmsfs` ; CREATE SCHEMA IF NOT EXISTS `cmsfs` DEFAULT CHARACTER SET utf8 ; DROP TABLE IF EXISTS `cmsfs`.`core_format_analyze` ; CREATE TABLE IF NOT EXISTS `cmsfs`.`core_format_analyze` ( `id` INT NOT NULL AUTO_INCREMENT, `path` JSON NOT NULL, `name` VARCHAR(45) NOT NULL, `args` JSON NULL...
create table material_category ( id bigint not null primary key auto_increment, `name` varchar(100) not null, unit varchar(20) not null, gmt_created datetime not null ); insert into material_category (`name`, unit, gmt_created) values ('医用防护服','套',now()), ('N95口罩','个',now()), ('N95口罩-3M','个',now()), ('...
<filename>WNPRC_EHR/resources/queries/study/MHC_SSP_Summary.sql /* * Copyright (c) 2010-2012 LabKey Corporation * * Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0 */ --this query provides an overview of the MHC SSP results SELECT m.SubjectId as Id, m.Instituti...
<filename>src/main/resources/ddl/mysql/locks-mysql.ddl<gh_stars>10-100 -- schemaName is alias. It will be replaced with actual types in runtime CREATE SCHEMA IF NOT EXISTS schemaName; CREATE TABLE IF NOT EXISTS schemaName.locks ( id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY, lock_key VARCHAR(255...
CREATE TABLE [dbo].[Scopes] ( [Id] [int] NOT NULL IDENTITY, [Enabled] [bit] NOT NULL, [Name] [nvarchar](200) NOT NULL, [DisplayName] [nvarchar](200), [Description] [nvarchar](1000), [Required] [bit] NOT NULL, [Emphasize] [bit] NOT NULL, [Type] [int] NOT NULL, [IncludeAllClaimsForUse...
<reponame>fossabot/automate-1<filename>components/automate-workflow-server/schema/verify/convert_to_bb.sql<gh_stars>100-1000 -- Verify delivery:convert_to_bb on pg BEGIN; SELECT has_function_privilege( 'convert_to_bb(bigint, text, text)', 'execute'); ROLLBACK;
-- Check for MPP-19310 and MPP-19857 where mksort produces wrong result -- on OPT build, and fails assertion on debug build if a "LIMIT" query -- spills to disk. CREATE TABLE mksort_limit_test_table(dkey INT, jkey INT, rval REAL, tval TEXT default repeat('abcdefghijklmnopqrstuvwxyz', 300)) DISTRIBUTED BY (dkey); INSE...
/* name: olympiad_runs_unique_vw mv: olympiad_runs_unique_mv app: SAGE PLOT THROUGHPUT Report note: This script performs the following queries to consolidate unique runs across all olympiad assays 1. Create unique run views for aggression, bowl, box, gap, lethality, observation, st...
-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64) -- -- Host: localhost Database: hw3 -- ------------------------------------------------------ -- Server version 5.7.21-0ubuntu0.17.10.1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RE...
<reponame>opengauss-mirror/Yat<filename>openGaussBase/testcase/KEYWORDS/maxsize/Opengauss_Function_Keyword_Maxsize_Case0022.sql -- @testpoint:opengauss关键字maxsize(非保留),作为用户组名 --关键字不带引号-成功 drop group if exists maxsize; create group maxsize with password '<PASSWORD>'; drop group maxsize; --关键字带双引号-成功 drop group if exi...
<reponame>opengauss-mirror/Yat -- @testpoint:设置unique约束是可以推迟,创建成功 drop table if exists test_1; create table test_1 (id int unique deferrable ,name char(20)); drop table test_1; --设置default约束是可以推迟,创建失败
CREATE USER user@localhost; CREATE DATABASE database; GRANT ALL PRIVILEGES ON database.* TO 'user'@'localhost';
-- To determine users to allow approving posts -- User should have -- - Joined more than a year ago -- - Been seen in the last 2 weeks -- - 10 posts in the last 6 months -- - 20 post likes in the last 6 months CREATE OR REPLACE VIEW view_user_post_count AS SELECT u.id id, COUNT(p.id) recent_post_count FROM users u ...
<filename>e2e_samples/parking_sensors_synapse/application_layer/healthcare_infoProtection/sqlServer/loadTables/loadTable_HospitalEmpPIIData.sql USE hpi GO TRUNCATE TABLE hpi.HospitalEmpPIIData GO BULK INSERT hpi.HospitalEmpPIIData FROM 'C:\code\modern-data-warehouse-dataops\e2e_samples\parking_sensors_synapse\applica...