sql stringlengths 6 1.05M |
|---|
<reponame>franklintendo/employee-tracker
-- ### Alternative way to insert more than one row
-- INSERT INTO products (flavor, price, quantity)
-- VALUES ("vanilla", 2.50, 100), ("chocolate", 3.10, 120), ("strawberry", 3.25, 75);
INSERT INTO department (name)
VALUES ("IT"), ("Accounting"), ("Sales");
INSERT INTO role (... |
DROP DATABASE IF EXISTS employees_DB;
CREATE DATABASE employees_DB;
USE employees_DB;
CREATE TABLE employee
(
id INT NOT NULL
AUTO_INCREMENT,
first_name VARCHAR
(30) NOT NULL,
last_name VARCHAR
(30) NOT NULL,
role_id INT,
manager_id INT,
PRIMARY KEY
(id)
);
CREATE TABLE role
(
... |
DELETE FROM `spell_learn_spell` WHERE `entry` = 71;
DELETE FROM `spell_learn_spell` WHERE `entry` = 2842;
INSERT INTO `spell_learn_spell` VALUES (2842,8681);
|
<reponame>piraz/intrac
-- Creating default schema
GRANT ALL ON SCHEMA public TO <NUTRAC_USER>;
-- ## SEQUENCES ##
DROP TABLE IF EXISTS profile;
DROP TABLE IF EXISTS nuser;
DROP SEQUENCE IF EXISTS instance_id_seq;
DROP SEQUENCE IF EXISTS nuser_id_seq;
CREATE SEQUENCE instance_id_seq;
GRANT ALL ON SEQUENCE instance_i... |
/****** Object: View [dbo].[V_Active_Connections] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE VIEW [dbo].[V_Active_Connections]
AS
SELECT Rtrim(Cast(hostname AS nvarchar(128))) AS Host,
Rtrim(Cast(program_name AS nvarchar(128))) AS Application,
Rtrim(Cast(loginame AS nvarch... |
CREATE TYPE sims.offering_intensity
AS ENUM ('Part Time', 'Full Time');
|
<gh_stars>10-100
update box.field set params='{"fullWidth": true}',widget=null where widget='fullWidth' and params is null;
update box.field set widget='selectWidget' where widget is null and "lookupEntity" is not null;
update box.field set "type"='static' where widget like 'title_%' or widget='static_text'; |
<reponame>chopeen/dataverse
#!/bin/sh
~/.homebrew/bin/psql dataverse_db -f $HOME/NetBeansProjects/dataverse/scripts/database/reference_data.sql
|
ALTER TABLE experiment_config DROP CONSTRAINT experiment_config_pkey;
ALTER TABLE experiment_run DROP CONSTRAINT experiment_run_pkey;
|
ALTER TABLE ofProperty
ADD iv CHAR(24);
UPDATE ofVersion SET version = 27 WHERE name = 'openfire';
|
<reponame>devatsrs/neon.web<gh_stars>0
CREATE TABLE `tblTempPayment` (
`PaymentID` int(11) NOT NULL AUTO_INCREMENT,
`CompanyID` int(11) NOT NULL,
`ProcessID` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
`AccountID` int(11) NOT NULL,
`InvoiceNo` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL,
`PaymentDate... |
-- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 5.7.22-log - MySQL Community Server (GPL)
-- OS do Servidor: Win64
-- HeidiSQL Versão: 9.5.0.5196
-- --------------------------------------------------------... |
<reponame>RifqiAlthof/tugas-akhir
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 21 Jul 2021 pada 08.33
-- Versi server: 10.4.17-MariaDB
-- Versi PHP: 8.0.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 ... |
/*
* The MIT License
*
* Copyright 2016 <NAME>.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify,... |
--
-- Script was generated by Devart dbForge Studio for MySQL, Version 8.0.40.0
-- Product home page: http://www.devart.com/dbforge/mysql/studio
-- Script date 10/26/2018 3:40:51 PM
-- Server version: 5.6.34-log
-- Client version: 4.1
--
--
-- Disable foreign keys
--
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_K... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 28 Jul 2018 pada 11.19
-- Versi Server: 10.1.19-MariaDB
-- PHP Version: 7.0.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
<filename>egov/egov-wtms/src/main/resources/db/migration/main/V20160816113053__wcms_transations_feature_mappings.sql<gh_stars>1-10
INSERT INTO eg_feature(ID,NAME,DESCRIPTION,MODULE) VALUES (NEXTVAL('seq_eg_feature'),'DataEntry For WaterTax','DataEntry For WaterTax',
(select id from eg_module where name = 'Water Tax M... |
ALTER TABLE `Tags` ADD COLUMN `Color` VARCHAR(7) NOT NULL;
|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 19-05-2018 a las 20:19:16
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<filename>extras/ordnancesurvey/osmm/itn/pgdump/create-indexes.sql
-- Loader. Copyright (c) Astun Technology Ltd. (http://astuntechnology.com).
-- Licensed under [MIT License](https://git.io/fAxH0).
CREATE INDEX "roadlink_wkb_geometry_geom_idx" ON "osmm_itn"."roadlink" USING GIST ("wkb_geometry");
CREATE INDEX "roadno... |
<filename>evo-X-Scriptdev2/sql/Updates/0.0.2/r715_scriptdev2_script_texts.sql
DELETE FROM `script_texts` WHERE `entry`=-1033000;
INSERT INTO `script_texts` (`entry`,`content_default`,`sound`,`type`,`language`,`comment`) VALUES
(-1033000,'Thanks for freeing me, I\'ll open this door for you, then I will get out of here.'... |
/*
Navicat MySQL Data Transfer
Source Server : Localhost
Source Server Version : 50718
Source Host : localhost:3306
Source Database : his_master_db
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding : 65001
Date: 2020-04-01 12:18:58
*/
SET FOREIGN_KEY_CHECKS=0;... |
<filename>db-drop-all.sql
alter table orders drop constraint if exists fk_orders_customer_id;
drop index if exists ix_orders_customer_id;
alter table order_line drop constraint if exists fk_order_line_order_id;
drop index if exists ix_order_line_order_id;
alter table order_line drop constraint if exists fk_order_line... |
<filename>Installer/sql/StudentDataFromODSv250.sql<gh_stars>1-10
DECLARE @tableName as varchar(50) = 'public."StudentInformation"'
Select
'Insert into ' + @tableName + ' (
"StudentUSI", "StudentUniqueId", "StudentStateIdentificationCode", "IdentityElectronicMailAddress", "DeviceId"
,... |
--
-- Host configuration table.
--
CREATE TABLE host (
host_id int NOT NULL auto_increment,
host_template_model_htm_id int default NULL,
command_command_id int default NULL,
command_command_id_arg1 text,
timeperiod_tp_id int default NULL,
timeperiod_tp_id2 int default NULL,
command_command_id2 int defaul... |
<reponame>GeorgeKirev/OpenOLAT
alter table o_as_mode_course modify a_elements text(32000);
alter table o_as_mode_course modify a_ips text(32000);
alter table o_as_mode_course modify a_safeexambrowserkey text(32000);
|
-- phpMyAdmin SQL Dump
-- version 4.0.10.20
-- https://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 04, 2021 at 02:34 PM
-- Server version: 8.0.26
-- PHP Version: 5.3.29
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
<reponame>faizyr15/UAS_Fitur_Skripsi
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 09 Agu 2020 pada 08.38
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!401... |
<reponame>sigitsuryono25/newLKP<filename>admin411/adminlauwba.sql
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 10, 2018 at 02:46 PM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = ... |
USE soft_uni;
#2
SELECT * FROM `departments`;
#3
SELECT `name` FROM `departments`;
#4
SELECT `first_name`, `last_name`, `salary` FROM `employees`;
#5
SELECT `first_name`, `middle_name`, `last_name` FROM `employees`;
#6
SELECT CONCAT(`first_name`,'.', `last_name`,'@soft<EMAIL>') AS `full_email_address` FROM `employe... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 100410
Source Host : localhost:3306
Source Schema : elearning
Target Server Type : MySQL
Target Server Version : 100410
File Encoding : 65001
Date: 12/03/202... |
<reponame>VictorFarfan98/MoneyManagerServiceapp
## Add Team delete functionality ##
USE `${DB_MAIN}`;
DROP procedure IF EXISTS `Team_Delete`;
DELIMITER $$
USE `${DB_MAIN}`$$
CREATE PROCEDURE `Team_Delete`(
pTeamId INT
)
BEGIN
DECLARE varCreatedBy INT;
UPDATE Team SET `Status` = 0 WHERE Id = pTeam... |
CREATE TABLE customers (
account_number LONG AUTO_INCREMENT PRIMARY KEY,
cust_name VARCHAR(100) NOT NULL,
phone_number VARCHAR(12),
accumulated_points INT,
check(accumulated_points >= 0),
check(LENGTH(phone_number) >= 8)
);
CREATE TABLE stores (
store_id LONG AUTO_INCREMENT PRIMARY KEY,
... |
<gh_stars>0
-- +goose Up
-- SQL in this section is executed when the migration is applied.
CREATE TABLE payments (
id TEXT CONSTRAINT ct__payments_id__uuid CHECK (length(id) == 36),
version INTEGER DEFAULT 0
CONSTRAINT ct__payments_version__not_null NOT NULL
CONSTRAINT ct__payments_version__gte_zero CHECK ... |
CREATE DATABASE IF NOT EXISTS CBT;
USE CBT;
-- SET FOREIGN_KEY_CHECKS = 0;
-- DROP TABLE Student;
-- DROP TABLE Administrator;
-- DROP TABLE Examiner;
-- DROP TABLE Course_Examiner;
-- DROP TABLE Course_Student;
-- DROP TABLE Course;
-- DROP TABLE Exam;
-- DROP TABLE Question;
-- DROP TABLE Student_Result;
-- Create... |
<reponame>Yohali20/Conferencia
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 15-07-2021 a las 04:19:14
-- Versión del servidor: 10.4.19-MariaDB
-- Versión de PHP: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone =... |
SELECT PeakName, RiverName,
LOWER(LEFT(PeakName, LEN(PeakName) - 1) + RiverName) AS Mix
FROM Peaks, Rivers
WHERE RIGHT (PeakName, 1) = LEFT (RiverName, 1)
ORDER BY Mix |
<reponame>kamarkiewicz/rusty_ems
DROP TABLE IF EXISTS persons CASCADE;
DROP TABLE IF EXISTS events CASCADE;
DROP TABLE IF EXISTS talks CASCADE;
DROP TABLE IF EXISTS person_knows_person CASCADE;
DROP TABLE IF EXISTS person_registered_for_event CASCADE;
DROP TABLE IF EXISTS person_attended_for_talk CASCADE;
DROP TABLE IF... |
<reponame>AnneEjsing/TrafficDataAnonymisation<gh_stars>1-10
-- Access type
CREATE TYPE rights AS ENUM ('user', 'admin');
-- For uuid's
CREATE EXTENSION IF NOT EXISTS pgcrypto WITH SCHEMA public;
-- Actual tables
CREATE TABLE public.users (
user_id uuid DEFAULT public.gen_random_uuid() NOT NULL PRIMARY KEY,
e... |
CREATE DATABASE IF NOT EXISTS `student` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `student`;
-- MySQL dump 10.13 Distrib 5.7.9, for Win64 (x86_64)
--
-- Host: localhost Database: student
-- ------------------------------------------------------
-- Server version 5.7.10-log
/*!40101 SET @OLD_CHARACTER... |
ALTER TABLE recall
ADD COLUMN last_updated_by_user_id UUID REFERENCES user_details(id);
UPDATE recall SET last_updated_by_user_id = created_by_user_id
WHERE last_updated_by_user_id IS NULL;
ALTER TABLE recall
ALTER COLUMN last_updated_by_user_id SET NOT NULL; |
-- 204. Изтриване на данни
USE colonial_journey_management_system_db;
DELETE FROM colonists
WHERE id NOT IN
(
SELECT colonist_id
FROM travel_cards
); |
-- 2019-03-13T15:20:40.073
-- 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,CopyFromProcess,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstanceOnly,IsRepo... |
create index isearchbuilderitem_ctx on searchbuilderitem (context);
create index isearchbuilderitem_act on searchbuilderitem (searchaction);
create index isearchbuilderitem_sta on searchbuilderitem (searchstate);
|
CREATE PROCEDURE [dbo].[RET_ALL_EMPRESA_PR]
AS
SELECT * from TBL_EMPRESA
WHERE ESTADO != 'Pendiente'
RETURN 0
|
-- Table datavalidation.RuleStatusDescriptor --
CREATE TABLE datavalidation.RuleStatusDescriptor (
RuleStatusDescriptorId INT NOT NULL,
CONSTRAINT RuleStatusDescriptor_PK PRIMARY KEY (RuleStatusDescriptorId)
);
-- Table datavalidation.RunStatusDescriptor --
CREATE TABLE datavalidation.RunStatusDescriptor (
... |
SELECT * FROM SH.products p WHERE p.prod_id = (SELECT s.prod_id FROM SH.sales "
"s WHERE s.cust_id = 100996 AND s.quantity_sold = 1 ) select;
|
DROP VIEW IF EXISTS `view_merchant_details`;
CREATE
VIEW `view_merchant_details`
AS
SELECT
`data_1_merchants`.`uuid`,
`data_1_merchants`.`order`,
`data_1_merchants`.`merchant`,
`data_1_merchants`.`merchant_category_id_for_tx2`,
`list_merchant_categories`.`merchant_category`,
`statuses_merchant`.`m... |
<filename>openresty/data/db.sql<gh_stars>1-10
1、账号表
CREATE TABLE `account` (
`id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '账号ID',
`user_id` BIGINT(20) NULL DEFAULT 0 COMMENT '用户ID',
`open_code` VARCHAR(255) NULL DEFAULT '' COMMENT '登录账号,如手机号',
`category` TINYINT(1) NULL DEFAULT 0 COMMENT '账号类别',
... |
DROP TABLE IF EXISTS `available_url`;
CREATE TABLE `available_url` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`domain` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`url` varchar(255) CHARACTER SET utf8 COLLATE utf8_gener... |
--liquibase formatted sql
--changeset jinghua.zhan:16
--labels: charset
--tag: 1.0.2
ALTER TABLE `cell_info`
MODIFY COLUMN `content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL AFTER `notebook_id`,
MODIFY COLUMN `last_job_id` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NU... |
-- @testpoint: opengauss关键字disconnect(非保留),作为函数名,部分测试点合理报错
--关键字不带引号-成功
drop function if exists disconnect;
create function disconnect(i integer)
returns integer
as $$
begin
return i+1;
end;
$$ language plpgsql;
/
drop function if exists disconnect;
--关键字带双引号-成功
drop function if exists "disconnect";
create functio... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1:3306
-- Thời gian đã tạo: Th12 31, 2019 lúc 02:32 AM
-- Phiên bản máy phục vụ: 5.7.26
-- Phiên bản PHP: 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:... |
<filename>database/backup/basked_db_users_permissions.sql
INSERT INTO basked_db.users_permissions (user_id, permission_id) VALUES (2, 1);
INSERT INTO basked_db.users_permissions (user_id, permission_id) VALUES (1, 2); |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1:3306
-- Thời gian đã tạo: Th8 30, 2020 lúc 11:07 AM
-- Phiên bản máy phục vụ: 10.4.10-MariaDB
-- Phiên bản PHP: 7.4.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<reponame>mbustamanteAseinfo/configManager
/* Script Generado por Evolution - Editor de Formulación de Planillas. 16-01-2017 11:51 AM */
begin transaction
delete from [sal].[fac_factores] where [fac_codigo] = '953b2ed4-e94a-4fce-a966-f9dfb5816314';
insert into [sal].[fac_factores] ([fac_codigo],[fac_id],[fac_descrip... |
CREATE TABLE comments (
id INT NOT NULL AUTO_INCREMENT,
MYUSER VARCHAR(30) NOT NULL,
EMAIL VARCHAR(30),
WEBPAGE VARCHAR(100) NOT NULL,
DATUM DATE NOT NULL,
SUMMARY VARCHAR(40) NOT NULL,
PRIMARY KEY (ID)
); |
<gh_stars>0
-- DROP SEQUENCE public.baby_id_seq;
CREATE SEQUENCE public.baby_id_seq
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1
NO CYCLE;
-- DROP SEQUENCE public.organization_id_seq;
CREATE SEQUENCE public.organization_id_seq
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
START 1
CACHE 1
... |
<gh_stars>0
SELECT StudentID, FirstName, LastName, CEILING(Semester1) as Semester1, CEILING(Semester2) as Semester2, MarkGrowth
FROM students; |
--Question a
SELECT stock_code,stock_description
FROM stock
WHERE unit_price < unitcostprice;
--Question b
SELECT stock_code,stock_description
FROM stock
WHERE stock_level < unitcostprice;
--Question c
SELECT customer_name
FROM customer
WHERE customer_id NOT IN (SELECT customer_id FROM corder);
--Question d
SE... |
use jack_api_hacienda; -- or a different db? dunno
DELIMITER //
-- ---------------------------
-- User Stored Procedure usp_obtenerpersona_registrocivil --
-- ---------------------------
CREATE PROCEDURE usp_obtenerpersona_registrocivil (
p_cedula VARCHAR(9)
)
BEGIN
SELECT `cedula`,
`codelec` AS `ubicacion`,
... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 08, 2019 at 07:21 AM
-- Server version: 5.7.14
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
CREATE TABLE [dbo].[Module] (
[guid] UNIQUEIDENTIFIER NOT NULL,
[name] NVARCHAR (50) NULL,
[permission] INT NULL,
[applyTo] INT NULL,
[categoryName] NVARCHAR (200) NULL,
[moduleSequence] FLOAT (53) NULL,
[isAdminModule] ... |
<reponame>MLX15/nestjs<gh_stars>1-10
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.35 - MySQL Community Server (GPL)
-- Server OS: Linux
-- HeidiSQL Version: 11.3.0.6295
-- ----------------------... |
insert into webradios (id, name, url, is_default)
values (next value for hibernate_sequence, '100p', 'http://stream.100p.nl/100pctnl.mp3', true);
insert into webradios (id, name, url, is_default)
values (next value for hibernate_sequence, '538','http://playerservices.streamtheworld.com/api/livestream-redirect/RADIO538.... |
CREATE TABLE IF NOT EXISTS clientes (
id int PRIMARY KEY AUTO_INCREMENT NOT NULL,
nome char(45) NOT NULL,
email varchar(50) DEFAULT NULL,
data_nasc date DEFAULT NULL,
cpf char(11) NOT NULL
);
INSERT INTO clientes (id, nome, email, data_nasc, cpf) VALUES
(1, '<NAME>', '<EMAIL>', '2013-10-07', '74426302285'),
... |
USE [master]
GO
IF EXISTS(select * from sys.databases where name='{0}')
ALTER DATABASE [{0}] SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
GO
IF EXISTS(select * from sys.databases where name='{0}')
DROP DATABASE [{0}];
GO |
DROP TABLE IF EXISTS vetd.journal_entries;
--;;
CREATE TABLE vetd.journal_entries (id bigint NOT NULL, idstr text, created timestamp with time zone, updated timestamp with time zone, deleted timestamp with time zone, session_id bigint, jtype text, entry jsonb)
--;;
ALTER TABLE vetd.journal_entries OWNER TO vetd
--;;
GR... |
-- file:insert.sql ln:157 expect:true
select tableoid::regclass, * from range_parted
|
<reponame>Shuttl-Tech/antlr_psql
-- file:brin.sql ln:453 expect:true
CREATE TABLE brin_test (a INT, b INT)
|
DROP TABLE IF EXISTS #anchor_comparison_cohort;
SELECT #cohort.linkid
,#cohort.patid
,#RAND_ENC.random_encounterid
INTO #anchor_comparison_cohort
FROM #cohort
LEFT JOIN #RAND_ENC ON #cohort.patid = #RAND_ENC.PERSON_ID
WHERE cast(in_study_cohort as int) = 0;
|
<filename>tis-datax/tis-hive-flat-table-builder-plugin/src/test/resources/com/qlangtech/tis/hive/tmp_pay.sql
SELECT
aa.totalpay_id
, concat_ws(';', collect_list(aa.aakindpay)) kindpay
, sum(aa.fee) fee
, (CASE WHEN (sum(aa.is_enterprise_card_pay_inner) > 0) THEN 1 ELSE 0 END) is_enterprise_card_pay
, concat_ws(',', c... |
<reponame>Viktoryia13/sms2020
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Сен 02 2019 г., 13:28
-- Версия сервера: 5.6.38
-- Версия PHP: 7.0.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00... |
<gh_stars>10-100
def Main = ^ concat [ [1 : int], [2] ]
|
<filename>corehq/form_processor/migrations/sql_templates/migrate_delta_4_switch_columns.sql
-- Switch columns
ALTER TABLE form_processor_ledgertransaction ALTER COLUMN delta DROP NOT NULL;
ALTER TABLE form_processor_ledgertransaction RENAME COLUMN delta TO old_delta;
ALTER TABLE form_processor_ledgertransaction RENAME ... |
USE master;
GO
IF NOT EXISTS(SELECT [name] FROM [sys].[databases] WHERE [name] = N'IndyECM')
BEGIN
CREATE DATABASE [IndyECM];
END
GO |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 05, 2021 at 02:26 PM
-- Server version: 8.0.21
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 12, 2022 at 01:35 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<gh_stars>0
update pg_database SET datistemplate = true where datname = 'meudb'; |
<reponame>thomasrobertz/mooc
/*
* PostgreSQL DML for dropping the role and database for Pluralsight's
* course Apache Camel Introduction to Integration. This should be run
* when the database needs to be re-loaded.
*/
DROP SCHEMA orders;
DROP DATABASE orders;
DROP ROLE orders;
|
SELECT
`department_id`, ROUND(MIN(`salary`), 2) AS 'Min Salary'
FROM
`employees`
GROUP BY `department_id`
HAVING `Min Salary` > 800; |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: mysql20j13.db.hostpoint.internal
-- Erstellungszeit: 07. Okt 2018 um 23:24
-- Server-Version: 10.1.35-MariaDB
-- PHP-Version: 5.6.37
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
<gh_stars>0
CREATE TABLE subscriptions (
user_id INT,
start_date DATE,
end_date DATE
);
INSERT INTO subscriptions (user_id, start_date, end_date) VALUES (1, '2019-01-01', '2019-01-31');
INSERT INTO subscriptions (user_id, start_date, end_date) VALUES (2, '2019-01-15', '2019-01-17');
INSERT INTO subscriptions (us... |
UPDATE Users SET password = <PASSWORD> WHERE id = :userID; |
CREATE DATABASE tmc;
USE tmc;
DROP TABLE posts;
CREATE TABLE `posts` (
`id` INT NOT NULL UNIQUE,
`thread_title` VARCHAR(200),
`username` VARCHAR(90) NOT NULL,
`posted_at` TEXT NOT NULL,
`message` TEXT,
`media` TEXT,
`likes` INT,
`loves` INT,
`helpful` INT,
`sentiment` INT,
PRIMARY KEY (`id`)
);
ALTER TABLE `... |
BEGIN;
-- Drop existing pkey
ALTER TABLE song_requests
DROP CONSTRAINT song_requests_spotify_track_id_fkey;
ALTER TABLE track_metadata
DROP CONSTRAINT track_metadata_spotify_track_id_pkey;
-- Add column track_id and copy data
ALTER TABLE song_requests
ADD COLUMN track_id INTEGER;
UPDATE song_requests sr
S... |
--Report the total extended sales price per item brand of a specific manufacturer for all catalog sales in a specific month
--of the year.
CREATE or replace function salePerBrandCatalog (yr int, mnth int, manufacture int)
returns refcursor
AS $$
declare
c1 refcursor := 'mycursor';
begin
open c1 for
selec... |
-- AlterTable
ALTER TABLE "users" ALTER COLUMN "imageURL" DROP NOT NULL;
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
DROP PROCEDURE IF EXISTS `sp_GetWaypoints`;
DELIMITER //
CREATE ... |
-- DROP/Create DATABASE
DROP DATABASE IF EXISTS techblog_db;
CREATE DATABASE techblog_db;
|
-- Jun 2, 2016 1:44 PM
-- URL zum Konzept
UPDATE AD_Process_Para SET AD_Reference_ID=30,Updated=TO_TIMESTAMP('2016-06-02 13:44:57','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Process_Para_ID=540945
;
|
update business_sections set organizationid = (organizationid - 1) where num > 2; |
\timing
\o /dev/null
select * from palias;
select * from palias;
select * from palias;
select * from p2thread;
select * from p2thread;
select * from p2thread;
select * from s_contents;
select * from s_contents;
select * from s_contents;
|
create table MEMBER
(
MEMBER_ID serial NOT NULL primary key,
MEMBER_NAME VARCHAR(200) NOT NULL,
MEMBER_ACCOUNT VARCHAR(50) NOT NULL,
MEMBER_STATUS_CODE CHAR(3) NOT NULL,
FORMALIZED_DATETIME timestamp(3),
BIRTHDATE DATE,
REGISTER_DATETIME timestamp(3) NOT NULL,
REGISTER_USER VARCHAR(200)... |
DELETE FROM trailers WHERE tmdb_id = $1;
|
/*
Navicat MySQL Data Transfer
Source Server : root
Source Server Version : 50540
Source Host : localhost:3306
Source Database : microclouds
Target Server Type : MYSQL
Target Server Version : 50540
File Encoding : 65001
Date: 2019-01-02 11:06:37
*/
SET FOREIGN_KEY_CHECKS=0;
-- --... |
create table `mae_young_man`(
`id` bigint (20) not null auto_increment COMMENT 'sid,老人的孩子用户id,自增序列',
`young_man_name` varchar(50) not null COMMENT '老人的孩子姓名',
`young_man_age` bigint(4) not null COMMENT '老人的孩子的年龄',
`young_man_address` VARCHAR(200) not null COMMENT '老人的孩子的地址',
`young_man_phone` varchar(11) not null COMMEN... |
drop procedure if exists qtopology_sp_register_worker;
drop procedure if exists qtopology_sp_disable_defunct_leaders;
drop procedure if exists qtopology_sp_disable_defunct_workers;
drop procedure if exists qtopology_sp_unassign_waiting_topologies;
drop procedure if exists qtopology_sp_announce_leader_candidacy;
drop pr... |
<filename>BBDD/Procedimientos/recomendar.sql
BEGIN
SELECT l.titulo,
IF (getPagMax(soc) >= l.numpag * 0.25, "RECOMENDADO", "NO RECOMENDADO")
FROM libro l
WHERE l.libro NOT IN (
SELECT p.libro from prestamo p
where p.socio = soc );
END
BEGIN
DECLARE string VARCHAR(100);
CASE
getPagMax(soc) >= getPagLib... |
CREATE DEFINER = CURRENT_USER TRIGGER `artista`.`user_AFTER_INSERT` AFTER INSERT ON `user` FOR EACH ROW
BEGIN
SET NEW.`regTimestamp` = CURRENT_TIMESTAMP();
END |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.