sql stringlengths 6 1.05M |
|---|
<reponame>dianasaur323/timescaledb
-- Copyright (c) 2016-2018 Timescale, Inc. All Rights Reserved.
--
-- This file is licensed under the Apache License,
-- see LICENSE-APACHE at the top level directory.
CREATE TABLE upsert_test(time timestamp PRIMARY KEY, temp float, color text);
SELECT create_hypertable('upsert_test... |
<filename>Tellma.Database.Application/bll/Functions/bll.fn_MonthAddEC.sql
CREATE FUNCTION [bll].[fn_MonthAddEC](
@Months Decimal (19,6),
@FromDate DATE
)
-- TODO: The naming convention is not according to standard
-- Check if this code is duplicated int he wiz schema
RETURNS DATE
AS
BEGIN
DECLARE @Result DATE, @ToD... |
<reponame>opencit/dcg_security-mtwilson
DELETE FROM `mw_oem` WHERE `uuid_hex` IS NULL;
DELETE FROM `mw_os` WHERE `uuid_hex` IS NULL;
INSERT INTO `mw_changelog` (`ID`, `APPLIED_AT`, `DESCRIPTION`) VALUES (20141209124000,NOW(),'Removed entries in mw_oem and mw_os that have null uuids');
|
<reponame>thedavidprice/redwood-test<filename>api/db/data/backups/sql/production-07-22-2021.sql
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.2
-- Dumped by pg_dump version 13.3
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = '... |
-- MySQL dump 10.13 Distrib 5.6.35, for osx10.9 (x86_64)
--
-- Host: localhost Database: Quickadclassified
-- ------------------------------------------------------
-- Server version 5.6.35
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RES... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Feb 24, 2017 at 02:59 AM
-- Server version: 10.1.19-MariaDB
-- PHP Version: 7.0.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... |
<reponame>wahidun567/elecomp-3rd-task
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 27 Jan 2021 pada 05.47
-- Versi server: 10.4.17-MariaDB
-- Versi PHP: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
-- 1
-- Stworzyć blok anonimowy, który przy użyciu kursora dla każdego pracownika
-- z tabeli pracownicy wypisuje na ekranie tekst:
-- 'Pracownik NAZWISKO pracuje w dziale NAZWA_DZIALU', gdzie NAZWISKO pochodzi
-- z tabeli pracownicy, natomiast NAZWA_DZIALU pochodzi z tabeli działy
-- 2
-- Stworzyć procedurę, która po... |
INSERT INTO users VALUES (1, '<NAME>', '<EMAIL>');
INSERT INTO users VALUES (2, '<NAME>', '<EMAIL>');
INSERT INTO users VALUES (3, 'Another Demo', '<EMAIL>');
INSERT INTO addresses
VALUES (1, 1, 'Why should I tell you my address?', 'What if you come to my house?', 'Really', '789524');
INSERT INTO addresses
VALUES (2... |
<filename>db/ALL.sql
SET FOREIGN_KEY_CHECKS=0
DROP TABLE IF EXISTS `USER` CASCADE
;
DROP TABLE IF EXISTS `HELP_TYPE` CASCADE
;
DROP TABLE IF EXISTS `USER_HELP_CONF` CASCADE
;
DROP TABLE IF EXISTS `HELP_RESPONSE` CASCADE
;
DROP TABLE IF EXISTS `HELP_REQUEST` CASCADE
;
DROP TABLE IF EXISTS `USER_LOCATION` CASCADE
;... |
ALTER TABLE `zt_userquery` ADD `shortcut` enum('0','1') COLLATE 'utf8_general_ci' NOT NULL DEFAULT '0';
|
<reponame>KarmaScripter/Data
CREATE VIEW "ExecutionLevel8" AS
SELECT
OutlayId,
BudgetLevel,
RpioCode,
BFY,
FundCode,
CASE
WHEN AhCode LIKE '6A%' THEN '6A'
ELSE AhCode
END AhCode,
OrgCode,
AccountCode,
CASE
WHEN RcCode LIKE '6A%' AND
FundCode LIKE 'T%' THEN '06L'
WHEN len(RcCode) = ... |
<gh_stars>0
-- CREATE DATABASE FIRST IN YOUR LOCAL POSTGRES DB
-- YOU DON'T NEET TO DO THIS WITH HEROKU POSTGRES ADDONS
CREATE DATABASE challenges;
-- create table challenge
CREATE TABLE challenge
(
challenge_id TEXT PRIMARY KEY NOT NULL,
title VARCHAR(100) UNIQUE,
hash_tag VARCHAR(50),
goal VARCHAR(10... |
<filename>migrate/0013_filtertemplatesuites.up.sql
CREATE TABLE `filtertemplatesuites` (
`filtertemplatesuiteid` VARCHAR(36) NOT NULL,
`accountid` VARCHAR(36) NOT NULL,
`filtertemplatesuitename` VARCHAR(128) NOT NULL,
`createat` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updateat` DATETIME NOT NULL DEFAULT CURRENT_T... |
CREATE TABLE IF NOT EXISTS employees(
user_id SERIAL PRIMARY KEY NOT NULL,
fname VARCHAR (80) NOT NULL,
lname VARCHAR (80) NOT NULL,
email VARCHAR(80) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
gender VARCHAR (24) ... |
<filename>src/main/resources/db/migration/general/V1_2__local_delivery_unit2.sql<gh_stars>1-10
DROP INDEX IF EXISTS LOCAL_DELIVERY_UNIT2_IDX1;
DROP TABLE IF EXISTS LOCAL_DELIVERY_UNIT2;
CREATE TABLE LOCAL_DELIVERY_UNIT2
(
LOCAL_DELIVERY_UNIT_ID UUID PRIMARY KEY,
PROBATION_AREA_CODE VARCHAR(126) NOT NULL... |
CREATE TABLE transactions_new (
id INTEGER PRIMARY KEY AUTOINCREMENT,
txId INTEGER,
userAdrLabel TEXT,
txHash TEXT,
vout INTEGER NOT NULL DEFAULT -1,
valueBtc INTEGER,
dateAdded DATETIME,
status TEXT,
type TEXT
);
INSERT INTO transactions_new
(id, txId, userAdrLabel, txHash... |
ALTER TABLE [dbo].[MIGRATION_SOURCE_CONFIGS]
ADD CONSTRAINT [UK_MigrationSourceConfigs]
UNIQUE (CreationTime, MigrationSourceId) |
<gh_stars>0
-- tables
CREATE TABLE `[db_prefix]_messages` (
`id` int(11) unsigned NOT NULL auto_increment,
`sender` int(11) unsigned NOT NULL,
`recipient` int(11) unsigned NOT NULL default '0',
`message` VARCHAR(255) NOT NULL,
`when` int(11) NOT NULL default '0',
`room` int(5) unsigned NOT NULL default '0',... |
<reponame>XiaoDaoJiang/spring-boot-example
create table user
(
id bigint not null auto_increment,
name varchar(50) not null,
primary key (id)
) |
<filename>modules/core/db/init/mssql/create-db.sql
-- begin SAMLADDON_SAML_CONNECTION
create table SAMLADDON_SAML_CONNECTION (
ID uniqueidentifier not null,
CREATE_TS datetime,
CREATED_BY varchar(50),
VERSION integer,
UPDATE_TS datetime,
UPDATED_BY varchar(50),
DELETE_TS datetime,
DELET... |
DROP TABLE IF EXISTS `tg_user`;
CREATE TABLE tg_user (
chat_id VARCHAR(100),
active BOOLEAN
);
|
DROP TABLE IF EXISTS glpi_plugin_mydashboard_stocktickets;
CREATE TABLE IF NOT EXISTS glpi_plugin_mydashboard_stocktickets (
id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
date DATE NOT NULL,
nbstocktickets INT UNSIGNED NOT NULL,
entities_id INT UNSIGNED NOT NULL
)
ENGINE = Inno... |
CREATE TABLE IF NOT EXISTS nakadi_partition (
np_consumer_name text NOT NULL,
np_event_name text NOT NULL,
np_partition text NOT NULL,
np_locked_by text,
np_last_modified timestamp without time zone NOT NULL DEFAULT clock_timestamp(),
PRIMARY KEY (np_consumer_name, np_event_name... |
<filename>sql_metadb/migration_tables/circulation_request_preference.sql
DROP TABLE IF EXISTS circulation_request_preference;
CREATE TABLE circulation_request_preference AS
SELECT
id::varchar(36),
jsonb_extract_path_text(jsonb, 'defaultServicePointId')::varchar(36) AS default_service_point_id,
jsonb_extrac... |
<reponame>d-uspenskiy/tpcc
drop table if exists customer cascade;
drop table if exists district cascade;
drop table if exists history cascade;
drop table if exists item cascade;
drop table if exists new_order cascade;
drop table if exists oorder cascade;
drop table if exists order_line cascade;
... |
<reponame>pathologyenigma/card_server
-- Add up migration script here
-- only able to use in with pgsql
-- if you want it to be able to use in other databases
-- you needed to implements it yourself
CREATE SEQUENCE public.users_id_seq
INCREMENT 1
START 1
MINVALUE 1
MAXVALUE 2147483647
CACHE 1;
ALTE... |
<filename>sql/create_blast_results_table.sql
-- blast_results definition
CREATE TABLE "blast_results"(
"qacc" TEXT,
"qcovhsp" REAL,
"qcovs" REAL,
"qstart" INTEGER,
"qend" INTEGER,
"bitscore" REAL,
"score" REAL,
"evalue" REAL,
"length" INTEGER,
"pident" REAL,
"sacc" TEXT,
"sstart" INTEGER,
"se... |
CREATE LUA SCALAR SCRIPT my_average
(a DOUBLE, b DOUBLE ORDER BY 1 desc)
RETURNS DOUBLE AS
function run(ctx)
if ctx.a == nil or ctx.b==nil
then return NULL
end
return (ctx.a+ctx.b)/2
end
/
|
<reponame>devatsrs/neon.web<gh_stars>0
TRUNCATE `tblTempCodeDeck`;
ALTER TABLE `tblTempCodeDeck` CHANGE COLUMN `ProcessId` `ProcessId` BIGINT UNSIGNED NOT NULL;
TRUNCATE `tblTempRateTableRate`;
ALTER TABLE `tblTempRateTableRate` CHANGE COLUMN `ProcessId` `ProcessId` BIGINT UNSIGNED NOT NULL;
INSERT INTO `tblCompanyC... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Erstellungszeit: 30. Dez 2017 um 21:30
-- Server-Version: 5.7.20-0ubuntu0.16.04.1
-- PHP-Version: 7.0.22-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<gh_stars>1-10
-- Data generated by https://mockaroo.com
insert into EMPLOYEE (id, first_name, last_name, email, gender, job_title, avatar) values (1, 'Kare', 'Eldred', '<EMAIL>', 'Female', 'Accountant I', 'https://robohash.org/autofficiaid.png?size=50x50&set=set1');
insert into EMPLOYEE (id, first_name, last_name, em... |
<reponame>abhis5/exportexcel
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 20, 2018 at 08:26 PM
-- 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 = ... |
--
-- Database version 6 Update script
--
-- 2012-05-29
--
-- Add drafting to relations.
-- Update relations to be drafted.
ALTER TABLE relation DROP CONSTRAINT pk_relation_id;
ALTER TABLE relation ADD relation_draft BIT NOT NULL default(1);
ALTER TABLE relation ADD CONSTRAINT pk_relation_id PRIMARY KEY (re... |
<filename>Multi_Page_WebApp/flask_app/climate_simulation_platform/db_schema.sql
DROP TABLE IF EXISTS user;
DROP TABLE IF EXISTS data_file;
CREATE TABLE user (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT UNIQUE NOT NULL,
password TEXT NOT NULL
);
CREATE TABLE data_files (
id INTEGER PRIMARY KEY AUTOINC... |
<reponame>CSCfi/antero
ALTER PROCEDURE [dw].[p_lataa_d_julkaisutyyppi] AS
if not exists (select * from dw.d_julkaisutyyppi where id=-1) begin
set identity_insert dw.d_julkaisutyyppi on;
insert into dw.d_julkaisutyyppi (
id,
julkaisutyyppi_koodi,
julkaisutyyppi_nimi_fi,
julkaisutyyppi_nimi_sv,
ju... |
<reponame>pauldzy/DZ_SWAGGER3
SET DEFINE OFF;
Insert into DZ_SWAGGER3_OPERATION
(OPERATION_ID, OPERATION_TYPE, OPERATION_SUMMARY, OPERATION_DESCRIPTION, OPERATION_EXTERNALDOCS_ID,
VERSIONID)
Values
('Sample.Navigation30.GET', 'get', 'Sample NHDPlus Navigation v3', 'The Sample Navigation service provides sta... |
<reponame>VU-libtech/OLE-INST<filename>ole-app/ole-db/ole-sql/ole-ls-sql/src/main/resources/sql/oracle/OLE_CAT_ACCS_MTHD_T.sql
TRUNCATE TABLE OLE_CAT_ACCS_MTHD_T DROP STORAGE
/
INSERT INTO OLE_CAT_ACCS_MTHD_T (ACCS_MTHD_CD,ACCS_MTHD_ID,ACCS_MTHD_NM,OBJ_ID,ROW_ACT_IND,SRC,SRC_DT,VER_NBR)
VALUES (' ',1,'No information ... |
<filename>CCDB/database/main_db/world/creature_classlevelstats.sql<gh_stars>1-10
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 S... |
/*
* 1.
*/
DELIMITER $$
CREATE PROCEDURE mas2()
READS SQL DATA
BEGIN
/*declaraciones*/
DECLARE vautor,na_count,vautor_max,noti_max INT;
DECLARE fin BOOL;
DECLARE ac CURSOR FOR SELECT id_autor FROM autores;
DECLARE nc CURSOR FOR SELECT autor_id FROM noticias WHERE autor_id=vautor;
DECLARE CONTINUE HA... |
DELETE FROM body
WHERE fileID = :fileID |
CREATE TABLE [EarlyWarning].[NeedAssessmentDetail] (
[NAId] INT IDENTITY (1, 1) NOT NULL,
[NeedAID] INT NULL,
[Woreda] INT NULL,
[ProjectedMale] INT NULL,
[ProjectedFemale] INT ... |
set serveroutput on
set verify off
declare
v_java_src varchar2(200);
TYPE t_cur IS REF CURSOR;
v_cur t_cur;
v_invalid_count number;
v_invalid_count_new number;
begin
loop
select count(1)
into v_invalid_count
from user_objects
where status = 'INVALID';
for cur_sql in
(
... |
<reponame>goldmansachs/obevo-kata
//// CHANGE name=change0
CREATE MEMORY TABLE TABLE405(ID INTEGER NOT NULL PRIMARY KEY,FIELD1 VARCHAR(30),USERTYPE2FIELD USERTYPE2,USERTYPE1FIELD USERTYPE1,USERTYPE6FIELD USERTYPE6)
GO
|
<gh_stars>10-100
SET client_min_messages = WARNING;
CREATE EXTENSION postgres_fdw;
CREATE SERVER ftex_test_foreign_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host '192.0.2.1', port '5432', dbname 'foreign_db');
CREATE FOREIGN TABLE ftex_test_foreign_table (id serial NOT NULL, data text)
SERVER ftex_test_forei... |
<reponame>okaram/aws-database-migration-samples<filename>sqlserver/sampledb/v1/user/create_dms_user.sql
/*
Copyright 2017 Amazon.com
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:... |
<reponame>radekg/kratos
ALTER TABLE "identity_credentials" DROP COLUMN "_nid_tmp"; |
/*
-- Query: SELECT * FROM `lava_demo`.`udsmedicationsdetails2`
-- Date: 2012-01-25 20:56
*/
INSERT INTO `udsmedicationsdetails2` (InstrID,MedDetailID,LineNum,DRUGID,Generic,Brand,NotListed) VALUES (113809,1,0,'d00170','aspirin',NULL,NULL);
INSERT INTO `udsmedicationsdetails2` (InstrID,MedDetailID,LineNum,DRUGID,Generi... |
-- +migrate Up
ALTER TABLE "worker_model" DROP COLUMN IF EXISTS image;
-- +migrate Down
ALTER TABLE "worker_model" ADD COLUMN IF NOT EXISTS image TEXT;
|
<reponame>andey-robins/school<filename>undergrad/dbscratch/learn-db/hw/hw34_5.sql
-- -------------------------------------------------------- -- --------------------------------------------------------
-- This tracks if the user has watched the video and the number of times. It is a log of watches.
--
-- When: on com... |
<reponame>MIET/brainiac<gh_stars>0
DROP SCHEMA IF EXISTS BRAINIAC CASCADE;
CREATE SCHEMA BRAINIAC;
CREATE TABLE USERS(
N_USER_ID SERIAL PRIMARY KEY,
N_VK_ID INT NOT NULL,
VC_FIRST_NAME VARCHAR NOT NULL,
VC_LAST_NAME VARCHAR NOT NULL,
N_MAX_STEP INT DEFAULT '1',
B_ACTIVE BOOL,
N_TOTAL_... |
<gh_stars>0
SELECT u.Username, u.Age
FROM Users AS u
ORDER BY u.Age, u.Username DESC |
DROP TABLE IF EXISTS test_person;
CREATE TABLE test_person (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
attitude TEXT,
height INTEGER NOT NULL,
iq INTEGER
);
CREATE UNIQUE INDEX test_person_id_IDX ON test_person (id);
INSERT INTO test_person (name, attitude, height, iq)
VALUES
('<NAME>', 'bad', ... |
<filename>private/database/tables/keys/user_site_page_structure_row.sql
ALTER TABLE `dlayer`.`user_site_page_structure_row`
ADD CONSTRAINT `user_site_page_structure_row_fk1` FOREIGN KEY (`site_id`) REFERENCES `user_site` (`id`),
ADD CONSTRAINT `user_site_page_structure_row_fk2` FOREIGN KEY (`page_id`) REFERENCES `us... |
<reponame>cburriss/SyncObjX<gh_stars>1-10
CREATE TABLE [dbo].[JobDataSourceHistory] (
[JobId] UNIQUEIDENTIFIER NOT NULL,
[SourceDataSourceId] UNIQUEIDENTIFIER NOT NULL,
[TargetDataSourceId] UNIQUEIDENTIFIER NOT NULL,
[CreatedDate] ... |
CREATE TABLE `default_tables`
(
`id` int(11) NOT NULL,
`title` varchar(255) NOT NULL DEFAULT '0'
) ENGINE=InnoDB;
ALTER TABLE `default_tables`
ADD PRIMARY KEY (`id`);
ALTER TABLE `default_tables`
MODIFY `id` int (11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1;
COMMIT; |
-- from https://github.com/NikolayS/postgres_dba/blob/3636d3df37e1b01790717e2a58e8bbf925bd7f78/sql/s1_pg_stat_statements_top_total.sql
--
--Slowest Queries, by Total Time (requires pg_stat_statements extension)
-- In pg_stat_statements, there is a problem: sometimes (quite often), it registers the same query twice (or... |
<reponame>dram/metasfresh
-- 01.03.2017 16:32
-- URL zum Konzept
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=3,Updated=TO_TIMESTAMP('2017-03-01 16:32:07','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=2110
;
-- 01.03.2017 16:32
-- URL zum Konzept
UPDATE AD_Column SET IsIdentifier='Y', SeqNo=2,Updated=TO_T... |
<filename>lab2/lab5.sql
SELECT employee_id, last_name, first_name, salary, job_id
FROM EMPLOYEES
WHERE last_name --not
--like 'E%' --case sensitive; E i dowolna ilosc znakow po nim
--like '___a%' --3 dowolne znaki i a
like 'Nowak#_%' ESCAPE '#' --traktujemy _ jako znak, a nie jako funkcje; znak po # traktujemy jako zna... |
select
campaign_id, email_id, action, "timestamp" as action_date
from demo_data.mailchimp_email_activity__activity |
SELECT 'Upgrading MetaStore schema from 2.1.1000 to 2.1.2000' AS Status from dual;
-- @044-HIVE-16997.oracle.sql;
ALTER TABLE PART_COL_STATS ADD BIT_VECTOR BLOB NULL;
ALTER TABLE TAB_COL_STATS ADD BIT_VECTOR BLOB NULL;
-- @045-HIVE-16886.oracle.sql;
INSERT INTO NOTIFICATION_SEQUENCE (NNI_ID, NEXT_EVENT_ID) SELECT 1,1... |
<filename>SQL-Scripts/DIDs_without_activity.sql
-- DIDs, Logins and discharges WITH SO FAR LAST ACTIVITY
SELECT ic.Name, ic.LastName, ic.Address, ic.EMail, ic.Phone, ic.MobilePhone, ic.Creation_Date,
ld.did, cs.account_state, lac.name, cd.client_id, cd.client_type, cs.login,
(SELECT MAX(data) FROM payments p W... |
ALTER TABLE `team` ADD `isvisible_on_front` TINYINT(10) NOT NULL AFTER `status`;
UPDATE `koolguru_test`.`team` SET `isvisible_on_front` = '1' WHERE `team`.`id` = 1;
UPDATE `koolguru_test`.`team` SET `isvisible_on_front` = '1' WHERE `team`.`id` = 2;
UPDATE `koolguru_test`.`team` SET `isvisible_on_front` = '1' W... |
--Tipo de UE: [Sede, Anexo, Extensión]
--Jurisdicción:
--Tipo de Gestión: [Estatal o Privada]
Dependencia Funcional:
--CUE:
--Nombre de la UE:
Es Unidad Académica: [Si o No]
Porcentaje de subsidio:
Año de Creación:
Origen de la norma:
Tipo de Norma:
Nro de la Norma:
---
---
Teléfono Institucional:
Interno:
Número de Fa... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1
-- Thời gian đã tạo: Th6 21, 2021 lúc 04:58 PM
-- Phiên bản máy phục vụ: 10.4.14-MariaDB
-- Phiên bản PHP: 7.2.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
<gh_stars>0
CREATE MESSAGE TYPE [oobdev://Schemas/MessageBus/SaveData]
AUTHORIZATION [dbo]
VALIDATION = WELL_FORMED_XML;
|
-- all movies released in 2010 and their ratings,
-- in descending order by rating
-- movies with the same rating, order alphabetically by title
SELECT movies.title,
ratings.rating
FROM movies
INNER JOIN
ratings ON movies.id = ratings.movie_id
WHERE movies.year = 2010
ORDER BY ratings.rating DESC, movies.t... |
<gh_stars>0
/* These mapping tables exist to allow antennae to be moved between ports on a single SMARTbox,
or between SMARTboxes, to allow for redundancy in the case of hardware failures. This connectivity
is reflected in the antenna_portmap table.
Any antenna move like this will need to be accompanied by a... |
REM This query will helpp you see how much undo tablespace you require based on the recent usage and your undo_retention parameter.
SELECT begin_time,
txncount-lag(txncount) over (order by end_time) as txncount,
maxquerylen,
maxconcurrency,
undoblks/((end_time - begin_time)*86400) as bks_per_sec,
(undoblk... |
-- Revert scoutges:triggers/encrypt_users_password from pg
SET client_min_messages TO 'warning';
BEGIN;
DROP TRIGGER IF EXISTS encrypt_users_password ON api.users;
COMMIT;
-- vim: expandtab shiftwidth=2
|
<reponame>adrisaputra/inventory-laravel
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versi server: 10.4.19-MariaDB - mariadb.org binary distribution
-- OS Server: Win64
-- HeidiSQL Versi: 10.3.0.5771
-- -------... |
<reponame>VasilPanovski/Java
-- TASK_2
/*SELECT *
FROM departments;
-- TASK_4
SELECT first_name, last_name, salary
FROM employees;
-- TASK_3
SELECT name
FROM departments;
-- TASK_5
SELECT first_name, middle_name, last_name
FROM employees;
-- TASK_6
SELECT CONCAT(first_name, '.', last_name, '@softun... |
<reponame>Valentina-vr/Data_Warehouse
CREATE DATABASE `data_warehouse`;
CREATE TABLE IF NOT EXISTS `data_warehouse`.`user` (
`id` int NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`rol` varchar(255) ... |
<gh_stars>1-10
CREATE TABLE category (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE role (
id INT NOT NULL AUTO_INCREMENT,
level1 INT,
type VARCHAR(255),
PRIMARY KEY (id)
) ENGINE=InnoDB;
CREATE TABLE product (
id INT NOT NULL AUTO_IN... |
<filename>db/sql/3051__create_tables_opettajapatevyys.sql
USE [ANTERO]
GO
/****** Object: Table [dw].[d_opettajapatevyys] Script Date: 8.5.2020 11:36:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dw].[d_opettajapatevyys]') AND typ... |
<reponame>kblomster/go-structured-query
-- Make an applicant associated with arg_user_id leave his current application
-- If applicant or his application doesn't exist, an exception will be raised
DROP FUNCTION IF EXISTS app.leave_application(INT);
CREATE OR REPLACE FUNCTION app.leave_application (arg_user_id INT)
RETU... |
<reponame>jdkoren/sqlite-parser
-- randexpr1.test
--
-- db eval {SELECT (abs(case when ++e not in (~c-(19)*+case t1.c when t1.d-coalesce((select max(t1.f) from t1 where (select count(*) from t1)>case when exists(select 1 from t1 where not exists(select 1 from t1 where (not not exists(select 1 from t1 where 19<t1.c))))... |
-- file:rowtypes.sql ln:147 expect:true
select ROW() = ROW()
|
<reponame>askotm/skytools-dev<filename>sql/pgq/sql/sqltriga.sql<gh_stars>1-10
-- start testing
create table rtest (
id integer primary key,
dat text
);
create trigger rtest_triga after insert or update or delete on rtest
for each row execute procedure pgq.sqltriga('que');
-- simple test
insert into rtest values (1... |
DROP FUNCTION IF EXISTS de_metas_endcustomer_fresh_reports.docs_sales_invoice_description(IN record_id numeric,
IN ad_language Character Varying(6))
;
CREATE OR REPLACE FUNCTION de_metas_endcustomer_fresh_reports.docs_sales_inv... |
DROP TABLE IF EXISTS Cargo;
CREATE TABLE Cargo
(
idCargo INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
NomeCargo VARCHAR(45),
SalarioBase FLOAT
);
DROP TABLE IF EXISTS Funcionario;
CREATE TABLE Funcionario
(
idFuncionario INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
nome ... |
<reponame>flaviodesousa/bookshelf-so-lab
drop table if exists "Order";
drop table if exists "Item";
drop table if exists "OrderItem";
create table "Order"("id" integer increment primary key);
insert into "Order"("id") values (33);
insert into "Order"("id") values (33);
create table "Item"("id" integer increment primary... |
<filename>sql/schema.sql
/*
* 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: davethemac
* Created: 08-Jun-2017
*/
DROP TABLE IF EXISTS rr_user;
CREATE TABLE rr_user(
... |
CREATE SCHEMA emaya;
|
<filename>plugin-cloud-server/src/main/resources/cloud_server_psql.sql
--"jdbc:postgresql://localhost:5432/HOME_AUTOMATION", "postgres", "Welcome123#"
create sequence user_id_seq start 101;
create sequence master_id_seq start 101;
create sequence slave_id_seq start 101;
create sequence sensor_id_seq start 101;
create ... |
CREATE OR REPLACE FUNCTION "GET_HIGHER_TAXA_LENLIMITED"
(
COLLECTIONOBJECTID IN NUMBER
, MAXLENGTH IN NUMBER
) RETURN VARCHAR2
-- Given a collection object id and a maximum string length obtain a concatenated
-- string of selected higher taxon ranks (most from phylum to family) for the
-- taxonomy record ... |
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, description)
SELECT nextval('${ohdsiSchema}.sec_permission_id_seq'), 'source:priorityVocabulary:get', 'Get source with highest priority vocabulary daimon'
;
INSERT INTO ${ohdsiSchema}.sec_permission (id, value, description)
SELECT nextval('${ohdsiSchema}.sec_permis... |
CREATE TABLE metainfo (
key TEXT,
value TEXT
);
CREATE TABLE formats (
id INTEGER PRIMARY KEY,
name TEXT,
posts_enabled INTEGER,
comments_enabled INTEGER
);
CREATE TABLE posts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
title TEXT,
slug TEXT,
post_raw TEXT,
post_form... |
SELECT passenger_count,
avg(total_amount) as avg_total
FROM nyc_taxi.trips
GROUP BY 1
ORDER BY 1;
|
<reponame>drobinson4y/django-djequis
INSERT INTO func_table(func, txt, def_desc, prim_resp_id, sec_resp_id, bgt_dsply, active_date, inactive_date) VALUES (' ', 'Blank Function ', 'Blank Functi', 0, 0, ' ', null, null);
INSERT INTO func_table(func, txt, def_desc, prim_resp_id, sec_resp_id, bgt_dsply, active_d... |
<reponame>cellularegg/WpfTourPlanner<gh_stars>0
create table "Tour"
(
"Id" serial
constraint tour_pk
primary key,
"Name" text not null,
"Description" text not null,
"Information" text,
"DistanceInKm" double precision not null
);
|
-- migrate up
-- schema
CREATE SCHEMA IF NOT EXISTS "profile";
-- functions
CREATE OR REPLACE FUNCTION "profile".function_updated_at()
RETURNS TRIGGER AS $$
BEGIN
NEW.updated_at = now();
RETURN NEW;
END;
$$ LANGUAGE 'plpgsql';
-- sections
CREATE TABLE "profile"."section" (
id_section TEXT PRIMA... |
<gh_stars>0
#############################################################################################################################
# InfoTrem #
# Estru... |
<reponame>adamestafford/Pencil
--
-- Current Schema CREATE statements go here
--
-- \Stationer\Pencil\models\Article
DROP TABLE IF EXISTS `Article`;
CREATE TABLE IF NOT EXISTS `Article` (
`article_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`created_uts` int(10) unsigned NOT NULL DEFAULT 0,
`updated_dts... |
PRAGMA foreign_keys=ON;
PRAGMA journal_mode=WAL;
PRAGMA user_version=1;
BEGIN TRANSACTION;
CREATE TABLE [trafficSpeedData] (
crossroadName TEXT,
description TEXT,
direction TEXT,
directionText TEXT,
exitName TEXT,
id NUMERIC,
latitude NUMERIC,
longitude NUMERIC,
roadStatus TEXT,
routeName TEXT,
... |
INSERT INTO pos_itemtemp VALUES("IATT190003128","193035","191001","192006","32000","1","32000","16000","16000","1","1","1","IAT1010190917","NHO2018000007","PAID","","PEDAS"),
("IATT190003129","193118","191001","192012","20000","1","20000","0","20000","1","1","1","IAT1010190917","NHO2018000007","PAID","","193118"),
("IA... |
<reponame>Indexical-Metrics-Measure-Advisory/watchmen<filename>packages/watchmen-migration/v15.x-to-v16/meta-scripts/oracle/00015-reports.sql
-- noinspection SqlResolveForFile
ALTER TABLE reports RENAME TO reports_1;
ALTER TABLE reports_1 RENAME TO reports;
ALTER TABLE reports RENAME COLUMN reportid TO report_id;
ALTER... |
-- MySQL
-- New Companies
SELECT c.company_code,
c.founder,
count(distinct e.lead_manager_code),
count(distinct e.senior_manager_code),
count(distinct e.manager_code),
count(distinct e.employee_code)
FROM company c
INNER JOIN employee e ON e.company_code = c.company_code
GROUP BY c.company_code,c.founder
ORDER BY... |
<gh_stars>1-10
SELECT FirstName + ' ' + MiddleName + ' ' + LastName
AS [Full Name]
FROM Employees
WHERE Salary = 25000 OR
Salary = 14000 OR
Salary = 12500 OR
Salary = 23600 |
<reponame>cmoussalli/DynThings
CREATE procedure SetThingProperty
@ThingID bigint,
@ThingExtensionID bigint
as
begin
declare @IsList bit
select @IsList = islist from ThingExtensions where ID = @ThingExtensionID
if (@IsList = 1)
begin
print 1
end
else
begin
print 0
end
end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.