sql
stringlengths
6
1.05M
<filename>Database Basics MS SQL/07. Database Programmability and Transactions/Exercise/14. Create Table Logs.sql<gh_stars>0 CREATE TABLE Logs ( LogId INT PRIMARY KEY IDENTITY, AccountId INT FOREIGN KEY REFERENCES Accounts(Id), OldSum DECIMAL(15, 2) NOT NULL, NewSum DECIMAL(15, 2) NOT NULL ) CREATE TRIGGER tr_Acco...
CREATE TABLE Responses(id int not null,survey_id int,question_id int,answer_id int,surveytime datetime,user_id int,FOREIGN KEY(survey_id) REFERENCES Survey(`id`),PRIMARY KEY (id),FOREIGN KEY(user_id) REFERENCES Users(`id`))
<reponame>Wavergg/601ProjectBranch -- MySQL dump 10.17 Distrib 10.3.16-MariaDB, for Win64 (AMD64) -- -- Host: localhost Database: marklee -- ------------------------------------------------------ -- Server version 10.3.16-MariaDB /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_C...
CREATE TEMP TABLE mkt_test AS WITH tmp AS ( SELECT 1 AS col_1 , CURRENT_DATE AS date ) SELECT * FROM tmp ; UNLOAD ('SELECT * FROM mkt_test') TO '{destination}' {autorization} HEADER FORMAT AS CSV DELIMITER AS ',' NULL AS '' ALLOWOVERWRITE PARALLEL OFF ;
<filename>04 Basic CRUD Operation Exercises/18. Distinct Job Titles.sql USE soft_uni; SELECT DISTINCT job_title AS 'Job_title' FROM employees;
SET FOREIGN_KEY_CHECKS=0; TRUNCATE TABLE `competitor`; INSERT INTO `competitor`(`alexa`, `count`, `name`, `website`, `value`) VALUES (0,0,'Corbes','corbes.com','corbes'), (0,0,'Datamyne','datamyne.com','datamyne'), (0,0,'Datasur','datasur.com','datasur'), (0,0,'DNB','dnb.com','dnb'), (0,0,'Great Import Exports','great...
---------------Create new designation----------------- INSERT INTO eg_designation(id, name, description, chartofaccounts, version, createddate, lastmodifieddate, createdby, lastmodifiedby, code) VALUES (nextval('seq_eg_designation'), 'Work Inspector/ Technical Mastry', 'Work Inspector/ Technical Mastry', null,0, now(),...
<filename>src/main/resources/db/migration/V38__dittnavoppgaver.sql CREATE TABLE DITTNAVOPPGAVER ( id SERIAL PRIMARY KEY, fnr VARCHAR(11), saksnr VARCHAR(20), opprettet timestamp NOT NULL, referanse_id VARCHAR(50));
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='STRICT_TRANS_TABLES'; DROP FUNCTION IF EXISTS initcap; DELIMITER // CREATE FUNCTION initcap(stringParam VARCHAR(255)) RETURNS VARCHAR(255) DETERMINISTIC NO SQL SQL SECURITY DEFINER COMMENT 'Returns a character string with the first letter of each word converted to uppercase v...
<reponame>netlify/sqlfluff -- Test BigQuery specific date identifiers. SELECT gmv._merchant_key, gmv.order_created_at, EXTRACT(DATE FROM gmv.order_created_at) AS order_dt FROM my_table as gmv WHERE gmv.datetime >= DATE_TRUNC(DATE_SUB(CURRENT_DATE(), INTERVAL 2 YEAR), year) LIMIT 1
<reponame>matteocontrini/expelliarbusbot select trips.trip_id, trips.shape_id, --group_concat(stop_times.departure_time) as times, --count(stop_times.departure_time) as stops_count, max(case when stop_times.stop_id = 150 then stop_times.departure_time end) valoni from trips, stop_times, calendar, calendar_d...
-- collate2.test -- -- execsql { -- SELECT b FROM collate2t1 -- WHERE b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb')); -- } SELECT b FROM collate2t1 WHERE b IN (SELECT a FROM collate2t1 WHERE a IN ('aa', 'bb'));
SET @sName = 'bx_forum'; -- SETTINGS UPDATE `sys_options` SET `caption`='_bx_forum_option_auto_activation_for_categories' WHERE `name`='bx_forum_auto_activation_for_categories';
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL'; DROP DATABASE IF EXISTS `restaurante`; CREATE DATABASE IF NOT EXISTS `restaurante`; CREATE SCHEMA IF NOT EXISTS `restaurante` DEFAULT C...
CREATE OR REPLACE FUNCTION DeleteDnsRecordsBulk( zones varchar[], records varchar[][] ) RETURNS void AS $$ BEGIN FOR i IN array_lower(zones, 1) .. array_upper(zones, 1) LOOP FOR j IN array_lower(records, 1) .. array_upper(records, 1) LOOP DELETE FROM record USING label INNER JOIN zone ON zone.id = zone_id WHE...
<gh_stars>1-10 -- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Client: localhost -- Généré le: Sam 27 Avril 2013 à 15:59 -- Version du serveur: 5.5.24-log -- Version de PHP: 5.3.13 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR...
<gh_stars>1-10 CREATE TABLE IF NOT EXISTS `config` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `value` varchar(255) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `entries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(255) ...
<reponame>dram/metasfresh -- 2019-06-14T15:43:41.075 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Element (AD_Client_ID,AD_Element_ID,AD_Org_ID,ColumnName,Created,CreatedBy,EntityType,IsActive,Name,PrintName,Updated,UpdatedBy) VALUES (0,576840,0,'IsNewUIElementsOnly',TO_TIMESTAMP('20...
<filename>backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5541230_sys_gh5991_C_Campaign_Price_C_UOM_ID.sql -- 2020-01-13T08:45:24.845Z -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator INSERT INTO AD_Column (AD_Client_ID,AD_Column_ID,AD_Element_ID,AD_O...
<reponame>kozyrev13/ReactiveCocktailHelper<filename>conf/evolutions.default/1.sql<gh_stars>0 # --- !Ups CREATE TABLE "cocktails" ("id" SERIAL PRIMARY KEY ,"title" varchar(200) , "description" varchar(200)); INSERT INTO "cocktails" values (1,'Sex Beach', 'asdddd;sakljdkajsdlkasdlkjasdj'); INSERT INTO "cocktails" values ...
<reponame>ZON3DEV/wow-vanilla -- ---------------------------------------------------------------------------------------------------------------- -- WARNING: Running this script will replace the English text in the base World Database with the localised version -- -------------------------------------------------------...
<reponame>mekijah/SQL INSERT INTO credit_card VALUES (3517111172421930, 1), (4761049645711555811, 1), (4866761290278198714, 2), (675911140852, 2), (30078299053512, 3), (4263694062533017, 4), (584226564303, 4), (4276466390111, 5), (4268491956169254, 5), (3581345943543942, 6), ...
DROP TABLE IF EXISTS IP_VISITS; DROP TABLE IF EXISTS ER_VISITS; DROP TABLE IF EXISTS OP_VISITS; DROP TABLE IF EXISTS ALL_VISITS; /* Inpatient visits */ /* Collapse IP claim lines with <=1 day between them into one visit */ CREATE TABLE IP_VISITS AS WITH CTE_END_DATES AS ( SELECT patient, encounterclass, EVENT_DATE-...
select vcSetNumber as vcsetnumber, '${starttime}' as starttime , '${endtime}' as endtime from tblinteractioncatalog where ( '${starttime}' <= convert(char(8), dtMinStartTime, 112) + convert(char(8), dtMinStartTime, 108) and '${endtime}' >=convert(char(8), dtMinStartTime, 112) + convert(char(8), dtMinStartT...
<reponame>TotteKarlsson/atDB /* File name: P:\atDB\db\shotgundb_PG.sql Creation date: 11/10/2017 Created by MySQL to PostgreSQL 3.3 -------------------------------------------------- More conversion tools at http://www.convert-in.com */ /* Table structure for table 'public.block_note' */ DROP TABLE IF EXISTS "public...
INSERT INTO transect_data ( transect_id, utm_e, utm_n, bearing1, bearing2, bearing3, sample_type, notes, map_unit_id) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)
ALTER TABLE ALBUMS ADD COLUMN COVER_PHOTO BIGINT; --//@UNDO ALTER TABLE ALBUMS DROP COLUMN COVER_PHOTO;
-- SPDX-License-Identifier: Apache-2.0 -- Licensed to the Ed-Fi Alliance under one or more agreements. -- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0. -- See the LICENSE and NOTICES files in the project root for more information. CREATE OR REPLACE VIEW analytics.StaffSectionD...
<reponame>patrickfischer1/WebAPI -- Updates sec_permission_id_seq to maximum identity + 1 DECLARE maxid NUMBER(10); last_num NUMBER; inc_by NUMBER; BEGIN SELECT (max(id) + 1) INTO maxid FROM ${ohdsiSchema}.SEC_PERMISSION; SELECT last_number, increment_by INTO last_num, inc_by FROM all_sequences WHERE sequence_o...
SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS=0; ALTER TABLE iast_project ADD vul_validation int(11) DEFAULT 0 NOT NULL COMMENT '漏洞验证 0-跟随全局,1-启用,2-禁用'; ALTER TABLE iast_hook_type ADD CONSTRAINT iast_hook_type_UN UNIQUE KEY (id,`type`,name,value,language_id); ALTER TABLE iast_sensitive_info_rule MODIFY COLUMN pattern var...
-- start_ignore SET gp_create_table_random_default_distribution=off; -- end_ignore DROP TABLE IF EXISTS ao; CREATE TABLE ao (a INT) WITH (appendonly=true, orientation=column); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); insert into ao select generate_series(1,1000); in...
-- This SQL code was generated by sklearn2sql (development version). -- Copyright 2018 -- Model : CaretClassifier_cforest -- Dataset : digits -- Database : oracle -- This SQL code can contain one or more statements, to be executed in the order they appear in this file. -- Model deployment code WITH "DT_node_look...
-- CreateTable CREATE TABLE "Tweet" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, "text" TEXT NOT NULL, "userId" INTEGER NOT NULL, CONSTRAINT "Tweet_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User" ("id") ON DELETE RESTRICT ON UPDATE...
CREATE TABLE Products( id INTEGER NOT NULL PRIMARY KEY, name VARCHAR(50) NOT NULL, price FLOAT NOT NULL );
CREATE OR REPLACE FUNCTION sys_poe.compruebadosimetro(in_dosimetro text) RETURNS bigint AS $BODY$ DECLARE hdosimetro bigint; contador bigint; BEGIN select id from sys_poe.dosimetros where codigobarra=in_dosimetro into hdosimetro; if (hdosimetro is null) then contador=9999999999; else select count(i...
UPDATE QUALIFICATION SET SHORTTITLE = 'sport and exercise sciences' WHERE LARSID = '60160421' UPDATE QUALIFICATION SET SHORTTITLE = 'children''s workforce' WHERE LARSID = '60154366' UPDATE QUALIFICATION SET SHORTTITLE = 'electrical installation' WHERE LARSID = '60154640' UPDATE QUALIFICATION SET SHORTTITLE = 'electrica...
-- joins, groups, orders are most commonly used. spend enough time to experiment and learn each throroughly -- insert into students(first_name,age,roll_number) values ("kirti",24,"1001"); -- insert into student(stu_id,name,pin) values (1,'ram',455118); -- insert into student(stu_id,name,pin) values (2,'molay',455008...
<reponame>nedvelkov/Airline-Booking-System CREATE OR ALTER FUNCTION ufn_CheckNameAirport(@Name CHAR(3)) RETURNS BIT AS BEGIN IF(LEN(@Name)=3 AND @NAME NOT LIKE '%[^A-Z]%' AND dbo.ufn_AllUpperLettersAirlineName(@Name)=1) BEGIN RETURN 1 END RETURN 0 END GO CREATE OR ALTER FUNCTION ufn_CheckNameAirline(@Name VARCH...
--counted who and how much visited last month select p.id, p2.f_name, p2.l_name, count(a.id) as last_month_count from appointment_patient_doctor_relation INNER JOIN appointment a on appointment_patient_doctor_relation.appointment_id = a.id INNER JOIN patient p on appointment_patient_doctor_relation.patient_id = p.id IN...
<gh_stars>0 INSERT INTO `cb_legislation_label` (`id`, `document_id`, `label_id`) VALUES (1, '1', '11'), (2, '1', '22'), (3, '2', '333'), (4, '2', '444'), (5, '3', '555'), (6, '4', '5');
INSERT INTO department (name) VALUES ("Head Office"), ("Development"), ("Marketing"); INSERT INTO role (title, salary, department_id) VALUES ("Executive", 250000, 3), ("Manager", 150000, 2), ("Marketing", 140000, 1), ("Engineer", 130000, 2), ("Developer", 115000, 2); INSERT ...
<filename>db_gopuu.sql -- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 28, 2019 at 11:09 AM -- Server version: 10.1.34-MariaDB -- PHP Version: 7.2.7 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:0...
<reponame>JulienPerrin/audiobook-for-grandma DROP TABLE BOOK; DROP TABLE SUBJECT; DROP TABLE BOOKMARK; DROP TABLE CONTINUE_READING;
<filename>QDMarketPlace.Data.EF/1.sql IF OBJECT_ID(N'[__EFMigrationsHistory]') IS NULL BEGIN CREATE TABLE [__EFMigrationsHistory] ( [MigrationId] nvarchar(150) NOT NULL, [ProductVersion] nvarchar(32) NOT NULL, CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId]) ); END; GO...
SELECT ROUND(long_w, 4) FROM station WHERE lat_n = ( SELECT MIN(lat_n) FROM station WHERE lat_n > 38.7780);
set head off; set feedback off; spool DropDB.lst; select 'DROP '||object_type||' '||object_name||';' from user_objects where object_type in ('CLUSTER','FUNCTION','LIBRARY','DATABASE LINK','MATERIALIZED VIEW', 'PACKAGE','PROCEDURE','SEQUENCE','SYNONYM','TABLE','TRIGGER','TYPE','VIEW') and sys_context( 'useren...
-- phpMyAdmin SQL Dump -- version 4.9.5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Dec 25, 2020 at 09:07 PM -- Server version: 10.3.23-MariaDB-cll-lve -- PHP Version: 7.3.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!4...
create or replace procedure grade_test( v_employee_id employees.employee_id%type) is v_grade_level job_grades.grade_level%type; begin select j.grade_level into v_grade_level from employees e join job_grades j on e.salary between j.lowest_sal and j.highest_sal where employee_id=v_employee_id; dbms_output.put_line(v_gr...
CREATE TABLE Majors ( MajorID INT NOT NULL, [Name] NVARCHAR(20) NOT NULL, CONSTRAINT PK_MajorID PRIMARY KEY (MajorID) ) CREATE TABLE Students ( StudentID INT NOT NULL, StudentNumber INT NOT NULL, StudentName NVARCHAR(20) NOT NULL, MajorID INT NOT NULL, CONSTRAINT PK_StudentID PRIMARY KEY (StudentID), CONSTR...
<gh_stars>1-10 /* INSERT INTO defendant_names (id, given_names, surnames) (SELECT deft_id, firstname, lastname FROM dev_interpreters.deft_names ORDER BY deft_id); */ SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ALLOW_INVALID_DATES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; INSERT INTO defend...
procedure render ( p_item in apex_plugin.t_page_item , p_plugin in apex_plugin.t_plugin , p_param in apex_plugin.t_item_render_param , p_result in out nocopy apex_plugin.t_item_render_result ) as l_escaped_value varchar2(32767) := apex_escape.html(p_param.val...
select city, subdivision_1 as state, country, count(distinct ip) as users, count(distinct cid) as clients, count(distinct cid + date(datetime)) as sessions, count(id) as views from visits where ip != '127.0.0.1' and date(datetime) between date("{{t0}}") and date("{{t1}}") group by city, subdivision_1, cou...
<reponame>jayped007/snomed-database-loader /* create the Full S-CT data tables */ drop table if exists concept_f; create table concept_f( id varchar(18) not null, effectivetime char(8) not null, active char(1) not null, moduleid varchar(18) not null, definitionstatusid varchar(18) not null, key idx_id(id), key idx_ef...
-- file:json.sql ln:30 expect:true SELECT '[1,[2]'::json
<reponame>Shuttl-Tech/antlr_psql<gh_stars>10-100 -- file:lock.sql ln:34 expect:true LOCK TABLE lock_tbl1 IN EXCLUSIVE MODE NOWAIT
<filename>src/test/resources/sql/set/246c38a9.sql<gh_stars>10-100 -- file:tsearch.sql ln:74 expect:true SET enable_indexscan=OFF
-- 2018-09-14T17:43:09.373 -- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator UPDATE AD_Table SET IsEnableRemoteCacheInvalidation='Y',Updated=TO_TIMESTAMP('2018-09-14 17:43:09','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Table_ID=540861 ;
<reponame>mrudulpolus/kc<gh_stars>0 insert into KRNS_PARM_T (appl_nmspc_cd,NMSPC_CD,PARM_DTL_TYP_CD,PARM_NM,PARM_TYP_CD,TXT,PARM_DESC_TXT,CONS_CD,OBJ_ID) values ('KC','KC-PD','Document','TUITION_OTHER_COST_ELEMENTS','CONFG','TUIOTHER','TUITION_OTHER_COST_ELEMENT used in Phs training budget s2s form','A','0920b4d0-958a...
<filename>security.sql -- MySQL dump 10.13 Distrib 5.5.62, for Win64 (AMD64) -- -- Host: localhost Database: security -- ------------------------------------------------------ -- Server version 8.0.21 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC...
<reponame>NewGraphEnvironment/bcfishobs<filename>sql/qa_match_observations.sql WITH matched_pts AS (SELECT match_type, count(*) as n_distinct_events FROM whse_fish.fiss_fish_obsrvtn_events GROUP BY match_type ORDER BY match_type), matched_obs AS (SELECT match_type, count(*) as n_observations FROM (SELECT a.match...
<reponame>tjscreators/endlos create table tblmodule( pkid bigserial not null, txtname varchar(100) not null, primary key (pkid), unique(txtname) ); create table tblfile ( pkid bigserial not null, txtfileid VARCHAR(64) not null, txtname VARCHAR(200) not null, fkmoduleid smallint not null, dateupload...
INSERT INTO person (id, address, first_name, gender, last_name) VALUES (1, "São Paulo", "Vinicius", "M", "Batista"); INSERT INTO person (id, address, first_name, gender, last_name) VALUES (2, "São Paulo", "Ïsabella", "F", "Batista"); INSERT INTO person (id, address, first_name, gender, last_name) VALUES (3, "São Paulo"...
<filename>Src/Entity.Database/EntityCode/Views/VentureAppointment.sql<gh_stars>1-10 Create VIEW [EntityCode].[VentureAppointment] AS Select EA.VentureAppointmentId As [Id], EA.VentureAppointmentKey As [Key], EA.VentureKey, E.VentureName, E.VentureDescription, A.AppointmentK...
update codebase_docker_stream set codebase_branch_id = codebase_branch.id from codebase_branch where codebase_branch.output_codebase_docker_stream_id = codebase_docker_stream.id; update codebase_docker_stream out_cds set codebase_branch_id = cb.id from cd_stage cs left join stage_codebase_docker_stream scds on ...
create database fandom; create schema fandom; DROP TABLE if exists fandom.universes; CREATE TABLE fandom.universes ( id serial NOT NULL, universe character varying(10), created_at timestamp(0) without time zone NOT NULL default now() ); INSERT INTO fandom.universes (universe) values ('DC'), ('MARVEL'); DROP TAB...
<gh_stars>10-100 alter table address add column postal_code varchar(20); alter table address add column town_or_city varchar(255); update address set location_source = 'CALCULATED' where location_source = '0'; update address set location_source = 'LOGGED_APPROX' where location_source = '1'; update address set location...
CREATE TABLE indexword ( index_word_id integer, lemma varchar(255), pos char ); CREATE INDEX i_indexword ON indexword (pos, lemma); CREATE TABLE synset ( synset_id integer, file_offset integer, lex_file_num integer, pos char, is_adj_cluster boolean, ...
<reponame>opengauss-mirror/Yat<filename>openGaussBase/testcase/SQL/DDL/partition/Opengauss_Function_DDL_Partition_List_Case0046.sql -- @testpoint: 分区个数小于64时添加分区 --step1:.创建list分区表;expect:成功 drop table if exists t_partition_list_0046; create table t_partition_list_0046(p_id int,p_name varchar,p_age int) partition by li...
<reponame>masonblier/langis-api -- Your SQL goes here CREATE TABLE users ( id SERIAL PRIMARY KEY, name VARCHAR NOT NULL UNIQUE, passhash VARCHAR(122) NOT NULL, --argon hash created_at TIMESTAMPTZ NOT NULL );
<gh_stars>0 CREATE TABLE 'SuperfundSites' ( 'SiteId' INTEGER NOT NULL, 'RpioCode' TEXT(255), 'RpioName' TEXT(255), 'City' TEXT(255), 'State' TEXT(255), 'SSID' TEXT(255), 'SiteProjectName' TEXT(255), 'EpaSiteId' TEXT(255), PRIMARY KEY('SiteId' AUTOINCREMENT) );
<reponame>Codentia/Codentia.Common.Data USE CECommonData GO CREATE PROCEDURE dbo.TestProc001 AS BEGIN SET NOCOUNT ON END GO CREATE PROCEDURE dbo.TestProc002 @Param1 INT AS BEGIN SET NOCOUNT ON END GO CREATE PROCEDURE dbo.TestProc003 AS BEGIN SET NOCOUNT ON SELECT 1, 2, 3 END GO CREATE PROCEDURE dbo.TestProc0...
-- +migrate Down ALTER TABLE tokens ADD COLUMN hash VARCHAR(64) NOT NULL DEFAULT '', ADD COLUMN hash_salt VARCHAR(64) NOT NULL DEFAULT '', ADD COLUMN hash_iterations INT NOT NULL DEFAULT 0, ADD CONSTRAINT unique_value UNIQUE(hash, hash_salt, hash_iterations); -- +migrate Up ALTER TABLE tokens DROP COLUM...
SELECT ROUND([age], 0) AS age ,ROUND([bp], 0) AS bp ,ROUND([sg],3) AS sg ,ROUND([al], 0) AS al ,ROUND([su], 0) AS su ,[rbc] ,[pc] ,[pcc] ,[ba] ,[bgr] ,[bu] ,[sc] ,ROUND([sod], 0) AS sod ,ROUND([pot], 1) AS pot ,ROUND([hemo...
-- MySQL Script generated by MySQL Workbench -- 10/05/15 19:55:42 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITION...
SELECT * FROM nobel WHERE yr = 1950; SELECT winner FROM nobel WHERE yr = 1962 AND subject = 'Literature'; SELECT yr, subject FROM nobel WHERE winner = '<NAME>'; SELECT winner FROM nobel WHERE yr >= 2000 and subject = 'peace'; SELECT * FROM nobel WHERE subject = 'Literature' AND yr BETWEEN 1980 AND 1989; ...
CREATE TABLE users( id_user int(255) PRIMARY KEY auto_increment NOT NULL, email varchar(255) NOT NULL, id varchar(255) NOT NULL, id_token varchar(255) NOT NULL, imagen varchar(255) NOT NULL, nombre varchar(255) NOT NULL, proveedor ...
<filename>sql/m_blog_sql.sql<gh_stars>0 -- -------------------------------------------------------- -- 主机: 127.0.0.1 -- 服务器版本: 5.7.33-log - MySQL Community Server (GPL) -- 服务器操作系统: Win64 -- HeidiSQL 版本: 11.2.0.6213 -- ---------------...
<filename>database/parrothr.sql -- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Sep 08, 2021 at 12:42 PM -- Server version: 10.4.14-MariaDB -- PHP Version: 7.4.10 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!4...
<reponame>UQdeco2800/singularity-server create table THREADS ( THREADID varchar(64) not null, USERID varchar(64) not null, PRIMARY KEY (THREADID, USERID) );
-- ---------------------------- -- Sequence structure for books_id_seq -- ---------------------------- DROP SEQUENCE IF EXISTS "public"."books_id_seq"; CREATE SEQUENCE "public"."books_id_seq" INCREMENT 1 START 5 MAXVALUE 9223372036854775807 MINVALUE 1 CACHE 1; -- ---------------------------- -- Table structure for b...
<gh_stars>0 -- find duplicate records in a table SELECT EmpName,Salary, COUNT(*) AS CNT FROM tblEmployee GROUP BY EmpName,Salary HAVING COUNT(*)>1 -- delete all the duplicate records in a table WITH cte AS ( SELECT EmpName,Salary, ROW_NUMBER() OVER ( PARTITION BY ...
<filename>db/schema.sql CREATE TABLE `user` ( `id_user` int(10) unsigned NOT NULL AUTO_INCREMENT, `email` varchar(255) NOT NULL, `password` varchar(32) NOT NULL, `roles` SET('ROLE_ADMIN','ROLE_WRITER') NOT NULL DEFAULT 'ROLE_WRITER', `status` enum('active','inactive') DEFAULT 'inactive', PRIMARY KEY (`id_user`) ...
<filename>02. Data Definition and Datatypes - Exercise/DataDefinitionAndDataTypes.sql<gh_stars>1-10 USE master GO --1. Create Database CREATE DATABASE [Minions] ON PRIMARY ( NAME = N'Minions_Data', FILENAME = N'D:\Courses\Data\Minions_Data.mdf' , SIZE = 167872KB , MAXSIZE = UNLIMITED, FILEGROWTH = 16384KB ) LOG ON ...
<gh_stars>1-10 --total select abstractor_abstraction_group_id_old, * from nlp_comparisons nlc where nlc.predicate = 'has_cancer_histology' --raw true positives select abstractor_abstraction_group_id_old, * from nlp_comparisons nlc where nlc.predicate = 'has_cancer_histology' and nlc.abstractor_abstraction_group_id_n...
CREATE TABLE IF NOT EXISTS users ( id int NOT NULL PRIMARY KEY, name VARCHAR(20) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ; ALTER DATABASE hoge CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
create or replace function londiste.provider_remove_seq( i_queue_name text, i_seq_name text) returns integer as $$ declare link text; begin -- check if linked queue link := londiste.link_source(i_queue_name); if link is not null then raise exception 'Linked queue, cannot modify'; end if...
-- Copyright (c) 2013-2015 Snowplow Analytics Ltd. All rights reserved. -- -- This program is licensed to you under the Apache License Version 2.0, -- and you may not use this file except in compliance with the Apache License Version 2.0. -- You may obtain a copy of the Apache License Version 2.0 at http://www.apache.o...
<reponame>olgabot/ensembl-compara -- 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 complian...
{{ config({"tags":["exclude_bigquery", "exclude_bigquery_tests"]}) }} {% if target.type == 'bigquery' %} select 'Bigquery does not support time slices at this time.' as n {% else %} WITH timestamps AS ( SELECT '2019-01-01 14:00:00'::timestamp AS ts UNION ALL SELECT ...
UPDATE ?:pages SET company_id = 1 WHERE page_id IN (7,8); INSERT INTO ?:ult_objects_sharing (`share_company_id`, `share_object_id`, `share_object_type`) SELECT 1 as share_company_id, page_id as share_object_id, 'pages' as share_object_type FROM ?:pages WHERE page_id IN (7,8);
<reponame>TakashiKitamori/it-automation -- ***************************************************************************** -- *** ***** CreateParameterMenu Tables *** -- ***************************************************************************** -- ------------------------- -- パラメータ...
-- Copyright 2022 Cargill Incorporated -- -- 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 applicable law or agre...
---------------------------------------------------------------------------------------------------- -- Vets ---------------------------------------------------------------------------------------------------- insert into PETCLINIC_VET (ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY,...
<reponame>zzcclp/snappydata<filename>dtests/src/resources/scripts/putInto/create_and_load_testLTable.sql -- DROP TABLE IF ALREADY EXISTS -- DROP TABLE IF EXISTS testL; create table testL (id long, data string, data2 decimal(38,10)) using column options (partition_by 'id', key_columns 'id');
{% macro sqlserver__dropif(node) %} {% set ddl %} if object_id ('{{source(node.source_name, node.name)}}') is not null begin drop external table {{source(node.source_name, node.name)}} end {% endset %} {{return(ddl)}} {% endmacro %} {% macro synapse__dropif(node) %}...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE>The Webbot Log Database - Link Types</TITLE> <LINK rel=STYLESHEET href="http://www.w3.org/StyleSheets/Area/Overview.css" type="text/css"> </HEAD> <A HREF="http://www.w3.org/"><IMG ALT="W3C" SRC="http://www.w3.org/Icons/WWW/w3c_home" BORD...
CREATE TABLE m_form ( name_norm NVARCHAR(255) COLLATE database_default, name_orig NVARCHAR(255) COLLATE database_default, oid NVARCHAR(36) COLLATE database_default NOT NULL, PRIMARY KEY (oid) ); ALTER TABLE m_form ADD CONSTRAINT uc_form_name UNIQUE (name_norm); ALTER TABLE m_form ADD CONSTRAINT fk_f...
<filename>Installers/QueryWaits_Test.sql EXECUTE [dbo].[QueryWaits] @DatabaseName = 'QDSToolBox' ,@ReportIndex = NULL ,@ReportTable = NULL ,@StartTime = '2021-03-01' ,@EndTime = '2021-03-08' ,@ObjectName = '[dbo].[QueryWaits]' ,@PlanID = NULL ,@QueryID = NULL ,@IncludeQueryText = 1 EXE...
-- -- PostgreSQL database dump -- SET statement_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = on; SET check_function_bodies = false; SET client_min_messages = warning; SET search_path = public, pg_catalog; -- -- Name: assessment_question_count; Type: VIEW; Schema: public; Owner: hom --...
<reponame>ratnesh2210/E-Agriculture- -- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Apr 23, 2017 at 11:46 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 7.1.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD...