sql stringlengths 6 1.05M |
|---|
<reponame>jensim/sourcegraph
BEGIN;
ALTER TABLE campaigns RENAME COLUMN initial_applier_id TO author_id;
ALTER TABLE campaigns DROP COLUMN IF EXISTS last_applier_id;
ALTER TABLE campaigns DROP COLUMN IF EXISTS last_applied_at;
COMMIT;
|
<filename>src/main/sqlscripts/sina_tables.sql<gh_stars>1-10
create table sina_stock
(
"symbol" char(8) primary key,
"code" char(6),
"name" varchar(20)
);
--
create table sina_zjhhangye
(
"code" varchar(20),
"name" varchar(120)
);
create table sina_zjhhangye_stock
(
"hycode" varchar(20),
"hyname" varchar(120),
"symbol... |
<reponame>henryoforeh-aot/SIMS
-- Remove column pd_date_sent for PD
ALTER TABLE students DROP
COLUMN IF EXISTS pd_date_sent;
-- Remove column pd_date_update for PD
ALTER TABLE students DROP
COLUMN IF EXISTS pd_date_update;
|
--
-- Stored procedures for HTTP(S) Operations
--
-- NOTE: This uses an untrusted language and therefore must be
-- installed as the superuser
-- TODO: It would be nice to use PgCURL
-- (https://github.com/Ormod/pgcurl) or something like it instead of
-- dragging this through Python. This'll do for now.
DROP TYPE I... |
<reponame>TheDecker/liquibase-snowflake
DROP DATABASE IF EXISTS lbcat;
CREATE DATABASE lbcat;
USE DATABASE lbcat;
USE SCHEMA public;
DROP TABLE IF EXISTS authors;
CREATE TABLE authors (
id int AUTOINCREMENT(6,1) NOT NULL,
first_name VARCHAR(50) NOT NULL,
... |
CREATE TABLE venue_information (
id SERIAL,
site_id INTEGER,
slug INTEGER,
title VARCHAR(255),
description TEXT,
lat REAL,
lng REAL,
country_id INTEGER,
is_deleted boolean default '0' NOT NULL,
created_at timestamp without time zone NOT NULL,
PRIMARY KEY(id)
);
ALTER TABLE venue_information ADD CONSTRAINT v... |
<gh_stars>1-10
CREATE EXTENSION IF NOT EXISTS pg_plan_tree_dot;
DROP TABLE IF EXISTS testtable;
CREATE TABLE testtable (a INTEGER, b INTEGER, c INTEGER, d INTEGER);
INSERT INTO testtable SELECT i, i, i, i FROM generate_series(1, 1000) AS i;
CREATE INDEX testindex ON testtable (b, c);
ANALYZE;
SET enable_bitmapscan... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.6.17 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.3.0.4984
-- -------------------------------------------------------... |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 09, 2021 at 11:04 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.3.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
<gh_stars>0
* SQL Social-Network Query Exercises
Q1
-- 1/1 point (graded)
-- Find the names of all students who are friends with someone named Gabriel.
SELECT H1.name
FROM (Highschooler H1 INNER JOIN Friend on H1.ID = Friend.ID1) INNER JOIN Highschooler H2 on H2.ID = Friend.ID2
WHERE H2.name = 'Gabriel';
Q2
-- 1/1 po... |
<filename>HackerRank/SQL/Aggregation/Weather Observation Station/part15.sql<gh_stars>0
SELECT ROUND(STATION.LONG_W, 4)
FROM STATION
WHERE STATION.LAT_N = (SELECT MAX(LAT_N)
FROM STATION
WHERE STATION.LAT_N < 137.2345); |
REM INSERTING into SYS.APPLY$_CDR_INFO
SET DEFINE OFF;
|
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 01, 2021 at 03:38 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<reponame>CatOrmerod/employee-management-system<filename>db/employeeSeeds.sql<gh_stars>0
USE employeeDB;
INSERT INTO department (name)
VALUES ('Sales'), ('Marketing'), ('Finance'), ('Customer Service');
INSERT INTO role (title, salary, department_id)
VALUES
('Sales Manager', 250000, 1),
('Account Manager', 120000, ... |
create or replace package employees_funcs as
/** TODO: add package documentation here
* @created 12.01.2020
* @author Batman
* @version 1.0
*/
/** Procedure: ins_employees
* Purpose: TODO add procedure documentation here
* @author Batman
* @created 12.01.2020
* @version 1.0
* =====================... |
# Products table
CREATE TABLE products (
id integer not null primary key autoincrement,
sku text,
name text,
category_id integer
);
-- Create categories table
CREATE TABLE categories (
id integer not null primary key autoincrement,
parent_id integer,
name text
);
|
DROP TABLE IF EXISTS acs2014_1yr.tmp_seq0001;
DROP TABLE IF EXISTS acs2014_1yr.tmp_seq0001_moe;
DROP TABLE IF EXISTS acs2014_1yr.tmp_seq0002;
DROP TABLE IF EXISTS acs2014_1yr.tmp_seq0002_moe;
DROP TABLE IF EXISTS acs2014_1yr.tmp_seq0003;
DROP TABLE IF EXISTS acs2014_1yr.tmp_seq0003_moe;
DROP TABLE IF EXISTS acs2014_1yr... |
insert into aptoclickv2.catalogo_sepomex (colonia, municipio, estado, cp) values ('Centro','Querétaro','Querétaro','76022');
insert into aptoclickv2.catalogo_sepomex (colonia, municipio, estado, cp) values ('Rincón de San Andrés','Querétaro','Querétaro','76022');
insert into aptoclickv2.catalogo_sepomex (colonia, munic... |
<reponame>Shuttl-Tech/antlr_psql
-- file:plpgsql.sql ln:4648 expect:true
CREATE TRIGGER transition_table_level2_ri_child_upd_trigger
AFTER UPDATE ON transition_table_level2
REFERENCING NEW TABLE AS i
FOR EACH STATEMENT EXECUTE PROCEDURE
transition_table_level2_ri_child_insupd_func()
|
ALTER TABLE persons ADD COLUMN state TEXT NOT NULL DEFAULT "";
UPDATE persons SET state = "New York" WHERE name = "Alice";
UPDATE persons SET state = "New Hampshire" WHERE name = "Bob";
UPDATE persons SET state = "Maryland" WHERE name = "Eve";
|
<reponame>mfooo/wow<filename>addition/724_characters_auctionhousebot.sql<gh_stars>1-10
/*
SQLyog Community Edition- MySQL GUI v6.03
Host - 5.0.51b-community-nt : Database - characters2
*********************************************************************
Server version : 5.0.51b-community-nt
*/
/*!40101 SET NAMES utf8... |
DROP FUNCTION IF EXISTS conreality.player_deregister(uuid) RESTRICT;
CREATE FUNCTION conreality.player_deregister(player_uuid uuid) RETURNS void AS $$
BEGIN
DELETE FROM conreality.player p WHERE p.uuid = player_uuid;
DELETE FROM conreality.object o WHERE o.uuid = player_uuid;
-- Permissions for the "pllua" schem... |
<filename>src/main/resources/data.sql
INSERT INTO `salon_service_detail` (`id`, `description`, `name`, `price`, `picture_location`,`salon_service_category`, `salon_service_category_types`) VALUES
(1, 'Be A Cut Above The Rest With Our Wide Range Of Stylish Haircuts. Trendy And Glam, It’s Time To Show-Stop Everyday.', 'H... |
<filename>Quarkus/movie-store-publisher/src/main/resources/sql/store.sql
CREATE TABLE moviestore_db.store (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`updated` datetime(6) DEFAULT NULL,
`address_fk` bigint(20) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `FK9iciaukn8x9vpvqpfvwfde2f... |
<reponame>OpenTouryoProject/AsynchronousProcessingService<filename>root/files/resource/AsyncProcessingService/Sql/sqlserver/UpdateTaskProgress.sql
-- UpdateTaskProgress
-- 2015/04/13 Sandeep
UPDATE
[AsyncProcessingServiceStatusManagementTable]
SET
[ProgressRate] = @P2
WHERE
[Id] = @P1 |
<gh_stars>1-10
ALTER TABLE authors CHANGE first_name first_name_renameColumn_test VARCHAR(50) NOT NULL |
set max_parallel_workers_per_gather=0;
\timing
\echo create test table tb_test_bitmaps
create temp table tb_test_bitmaps as
select id,rb_build_agg((random()*10000000)::int) bitmap
from generate_series(1,100)id, generate_series(1,100000)b
group by id;
\timing
\echo rb_and_1
explain analyze
with t as(
selec... |
-- @testpoint:opengauss关键字row_count(非保留),作为外部数据源名
--关键字不带引号-成功
drop data source if exists row_count;
create data source row_count;
drop data source row_count;
--关键字带双引号-成功
drop data source if exists "row_count";
create data source "row_count";
drop data source "row_count";
--关键字带单引号-合理报错
drop data source if exists ... |
-- @testpoint:建表时分别指定唯一约束,主键约束,主键和唯一约束都冲突的情况下,使用insert..update语句
--预置条件enable_upsert_to_merge为off
drop table if exists mykey_4a;
--建表指定id为主键约束,name为唯一约束
create table mykey_4a
(
name nvarchar2(20) unique ,
id number primary key ,
address nvarchar2(50)
) ;
--使用insert语句常规插入两条数据,主键列,唯一列均不重复,插入两条数据
insert into my... |
HDF5 "tints4dims.h5" {
DATASET "FourDimInts" {
DATATYPE H5T_STD_U32LE
DATASPACE SIMPLE { ( 4, 6, 8, 10 ) / ( 4, 6, 8, 10 ) }
SUBSET {
START ( 0, 0, 0, 0 );
STRIDE ( 2, 2, 2, 2 );
COUNT ( 2, 2, 2, 2 );
BLOCK ( 1, 1, 1, 1 );
DATA {
(0,0,0,0): 0, 2,
(0,0,2,0): 20, 22
... |
<filename>sql/script1.sql
create table barang
(
BarangID int auto_increment,
BarangCode varchar(30) not null,
Barang varchar(50) not null,
FotoBarang varchar(255) null,
Harga float null,
Description text null,
constraint barang_BarangCode_uindex
unique (BarangCode),
co... |
<filename>nrgdb_withdata_17092018.sql
-- MySQL dump 10.13 Distrib 5.7.21, for Linux (x86_64)
--
-- Host: localhost Database: nrg_db
-- ------------------------------------------------------
-- Server version 5.7.21-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD... |
<filename>src/fn__dir.sql<gh_stars>0
/* leave this
l:see LICENSE file
g:utility
k:sub,folder,directory,list,sub,folder,s,sp__dir,unicode
c:from https://www.simple-talk.com/iwritefor/articlefiles/634-dboDIR.htm
v:131015\s.zaglio: done, but abbandoned because 6-20 times slower than sp
r:131014\s... |
<gh_stars>0
-- parameterized function
create or replace function add_three_numbers
(a NUMBER := 0, b NUMBER := 0, c NUMBER :=0)
RETURN NUMBER is
begin
dbms_output.put_line('a:'||a||' b:'||b||' c:'||c);
return a+b+c;
end;
/
begin
dbms_output.put_line('Sum is -> '|| add_three_numbers(10, 15, 20));
dbms_output.... |
-- script to load data into postgres
-- remember to run a find on 0 and replace with 0 (number)
-- remember to run a find . and replace with nothing!
DROP TABLE IF EXISTS stats_2012_immigration;
CREATE TABLE stats_2012_immigration (
iso_code text primary key,
nationality text,
political_region text,
work ... |
create table ImageFood (
id bigint not null primary key identity(1,1),
url varchar(1024),
fat numeric(10,5),
calories numeric(10,5),
sugar numeric(10,5),
healthScore numeric(10,5),
image_id bigint
);
GO
ALTER TABLE ImageFood
ADD CONSTRAINT FK_image_food FOREIGN KEY (image_id)
REFERENCES CleanFoodImage (... |
<filename>src/main/resources/db/migration/V9__table_create.sql<gh_stars>10-100
CREATE TABLE VOICES (
nick Text,
network Text,
channel Text,
time BigInt
); |
-- 전체 데이터 조회(게시판 리스트)
CREATE PROCEDURE [dbo].[LoginsList]
@PageNumber Int = 1,
@PageSize Int = 10,
@UserName NVarChar(100) -- 사용자 아이디
AS
Select
*
From Logins
Where UserName = @UserName
Order By LoginId Desc
Offset ((@PageNumber - 1) * @PageSize) Rows Fetch Next @PageSize Rows Only;
Go
|
CREATE INDEX CONCURRENTLY north_app_author_idx ON north_app_author(id);
CREATE INDEX CONCURRENTLY north_app_book_idx ON north_app_book(id);
|
create table fp_timeouts(
skey varchar(255) not null primary key,
dt varchar(32) not null
);
|
<reponame>xgarci08/chinoookdb_copy<gh_stars>10-100
CREATE TABLE [dbo].[Invoice] (
[InvoiceId] INT IDENTITY (1, 1) NOT NULL,
[CustomerId] INT NOT NULL,
[InvoiceDate] DATETIME NOT NULL,
[BillingAddress] NVARCHAR (70) NULL,
[BillingCity] N... |
-- AlterTable
ALTER TABLE "House" ALTER COLUMN "shoppingListId" DROP NOT NULL;
|
CREATE TABLE IF NOT EXISTS grest.epoch_info_cache (
epoch_no uinteger PRIMARY KEY NOT NULL,
i_out_sum word128type NOT NULL,
i_fees lovelace NOT NULL,
i_tx_count uinteger NOT NULL,
i_blk_count uinteger NOT NULL,
i_first_block_time timestamp without time zone UNIQUE NOT NULL,
i_last_block_time timestamp wit... |
-- Deploy speakers
-- requires: v1schema
BEGIN;
CREATE TABLE "1".speakers
(
id serial,
name character varying NOT NULL,
twitter character varying,
avatar_url character varying NOT NULL,
bio text,
featured boolean NOT NULL DEFAULT FALSE
)
WITH (
OIDS = FALSE
);
ALTER TABLE "1".speakers
ADD CONSTRAINT ... |
<filename>modules/asset-manager-impl/src/test/resources/mysql-migration-1.sql
# migration-1 contains pre data migration steps
SET FOREIGN_KEY_CHECKS = 0;
####
# mh_archive_episode -> mh_assets_snapshot
##
# drop indices and constraints
DROP INDEX IX_mh_archive_episode_mediapackage ON mh_archive_episode;
DROP INDEX IX... |
--DROP TABLE IF EXISTS site;
--
--CREATE TABLE IF NOT EXISTS site (
-- uid int AUTO_INCREMENT PRIMARY KEY,
-- url VARCHAR(250) NOT NULL,
-- person VARCHAR(250) NOT NULL
--);
--CREATE TABLE IF NOT EXISTS site (
-- uid BINARY NOT NULL,
-- url VARCHAR(250) NOT NULL,
-- person VARCHAR(250) NOT NULL
--);
--DROP TABL... |
ALTER TABLE hook.message ALTER COLUMN invoice_amount DROP NOT NULL;
ALTER TABLE hook.message ALTER COLUMN invoice_currency DROP NOT NULL;
ALTER TABLE hook.message ALTER COLUMN invoice_created_at DROP NOT NULL;
ALTER TABLE hook.message ALTER COLUMN invoice_product DROP NOT NULL;
ALTER TABLE hook.customer_message ALTER C... |
SET max_block_size = 6, join_algorithm = 'partial_merge';
SELECT count() == 4 FROM (SELECT 1 AS s) AS js1 ALL RIGHT JOIN (SELECT arrayJoin([2, 2, 2, 2]) AS s) AS js2 USING (s);
SELECT count() == 5 FROM (SELECT 1 AS s) AS js1 ALL RIGHT JOIN (SELECT arrayJoin([2, 2, 2, 2, 2]) AS s) AS js2 USING (s);
SELECT count() == ... |
<reponame>sam-glendenning/iam
ALTER TABLE client_details ADD (software_statement TEXT, code_challenge_method VARCHAR(256)); |
UPDATE MAIL_PROPERTIES
SET
PROPERTY_VALUE = ?
, INSERT_USER = ?
, INSERT_DATETIME = ?
, UPDATE_USER = ?
, UPDATE_DATETIME = ?
, DELETE_FLAG = ?
WHERE
HOOK_ID = ?
AND PROPERTY_KEY = ?
;
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.7.4-m14 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 8.0.0.4396
-- --------------------------------------------------------
... |
rem ****************************************************************
rem Version 1.0 Dec 7, 2014
rem Script for demonstrating the features of analytical SQL
rem Author <NAME>, Snr Principal Product Manager, Oracle
rem
rem ****************************************************************
rem
rem If you need to reset... |
<reponame>nasrulll21/CI-theDoctor
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 21, 2019 at 08:11 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_z... |
CREATE DATABASE intimations_employee_schema;
USE intimations_employee_schema;
CREATE TABLE `employees` (
`ID` bigint NOT NULL,
`NAME` text NOT NULL,
`GENDER` text NOT NULL,
`DOJ` date NOT NULL,
`DOR` date DEFAULT NULL,
`DESIGNATION` text NOT NULL,
`PFN` varchar(64) NOT NULL,
`PHONE` text NOT NULL,
`... |
<reponame>LSIND/Tuning-SqlServer-Databases<filename>mod01/workload1.sql
-- пример рабочей нагрузки 1
DECLARE @start datetime2 = GETDATE();
WHILE DATEDIFF(second, @start, GETDATE()) < 300 -- 5 минут
BEGIN
SELECT TOP 5 a.name
FROM master.dbo.spt_values AS a
CROSS JOIN master.dbo.spt_values AS b
ORDER BY NEWID()
OPT... |
-- http://www.codingfusion.com/Post/75-Important-queries-in-SQL-Server-every-developer-should-know
--1. Create Table:
--In this SQL Server query we will learn How to create table in SQL Server.
CREATE TABLE TableName
(
Id INT,
Name Nvarchar(500),
Age INT
)
--2. Create table with primary key:
--In this qu... |
<filename>SQL/Utils.sql
CREATE OR REPLACE FUNCTION getReadPriority(user_id VARCHAR, dest_id VARCHAR)
RETURNS INT AS $$
DECLARE
sg_groups VARCHAR[10];
cur_sg VARCHAR;
cur_members VARCHAR[10];
cur_member VARCHAR;
cur_priority INT;
priorities INT[10];
cur_used_cruds INT;
priotoReturn INT=100;
BEGIN
SEL... |
<reponame>chefZau/Database-Images-Resizing<gh_stars>0
-- =============================================
-- Author: <NAME>
-- Create date: Dec 9, 2020
-- Description: Resize the Top 100 oversize(> 300KB) product images.
-- =============================================
USE btprod
PRINT 'Execution Time';
PRINT GETD... |
-- Create custom data type to store salaries in an array --
CREATE OR REPLACE TYPE DECARRAY AS DECIMAL(9,2) ARRAY[INTEGER]@
-- Create stored procedure --
CREATE OR REPLACE PROCEDURE salary_std_dev(OUT SALARYSTDDEV DOUBLE)
LANGUAGE SQL
BEGIN
-- Create variables --
DECLARE i INTEGER;
DEC... |
<filename>aula10/exercicios.sql
-- 1 CRIAR UMA TRIGGER EM empresas, onde ao isnerir telefone, seja limpo de caracter, ou seja:
-- EXemplo: entrada: (41) 99850-0111 , Saida: 41998500111
CREATE TRIGGER `tratofeito`.`empresas_BEFORE_INSERT` BEFORE INSERT ON `empresas` FOR EACH ROW
BEGIN
SET NEW.telefone = REPLACE(
R... |
-- see existing databases for your username
SHOW DATABASES;
-- display all tables in database (probably empty)
SHOW TABLES;
-- create a table in database
CREATE TABLE users (
id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
username VARCHAR (50) NOT NULL UNIQUE,
password VARCHAR (50) NOT NULL,
first_name VARCHAR(50) N... |
<reponame>mtomberger/OnlineHangman
CREATE TABLE Game (
id SERIAL PRIMARY KEY,
username varchar(255),
word varchar(15),
mistakes numeric(8),
timeNeeded numeric(8),
score numeric(8),
... |
<filename>Access Ultramatron 2000/QueryFolder/AdresInsert.sql
Insert into [Adres] ([ilce_no], [mahalle], [cadde], [no], [postakodu]) values (773, 'MAHFESIĞMAZ', '<NAME>', '44/28', 01170);
Insert into [Adres] ([ilce_no], [mahalle], [cadde], [no], [postakodu]) values (641, 'KARAİSALI', '<NAME>', '32/23', 01770);
Insert... |
SELECT SA.StoryId FROM StoryAuthor SA LEFT JOIN Story S ON S.id = SA.StoryId WHERE SA.AuthorId = ? ORDER BY S.Updated DESC LIMIT ? OFFSET ?;
|
<reponame>betagouv/signalement-api
-- !Ups
ALTER TABLE users ADD CONSTRAINT email_unique UNIQUE(email);
-- !Downs
ALTER TABLE users DROP CONSTRAINT email_unique;
|
<reponame>CSCfi/antero
USE [ANTERO]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF NOT EXISTS
(
SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'dw.f_koski_lukio_ainevalinnat_suorittaneet')
)
BEGIN
CREATE TABLE [dw].[f_koski_lukio_ainevalinnat_suorittaneet](
[Tilastovuosi] [int] NULL,
... |
<reponame>datacentricity/log4tsql<gh_stars>1-10
/*************************************************************************************************/
--</MaintenanceHeader>
CREATE PROCEDURE [log4].[PrintString]
(
@InputString nvarchar(max) = NULL
, @MaxPrintLength int = 4000
)
AS
--<CommentHeader>
/***********... |
<gh_stars>10-100
# 2.1.191
UPDATE `AudioContributionEvent` SET `platform` = 'WEBAPP' WHERE `platform` IS NOT NULL;
UPDATE `AudioPeerReviewEvent` SET `platform` = 'WEBAPP' WHERE `platform` IS NOT NULL;
|
-- file:rangetypes.sql ln:119 expect:true
select numrange(1.0, 2.0) * numrange(2.5, 3.0)
|
DROP DATABASE IF EXISTS employeesDB;
USE employeesDB;
INSERT INTO department (name)
VALUES ("Sales");
INSERT INTO department (name)
VALUES ("Engineering");
INSERT INTO department (name)
VALUES ("Finance");
INSERT INTO department (name)
VALUES ("Legal");
INSERT INTO role (title, salary, department_id)
VAL... |
--! Previous: sha1:e37955252cffd605186742cbc19d8799fefef472
--! Hash: sha1:885bfbd23abed5a2a9a0e32dcdbc50a4773d806f
--! split: 1-current.sql
-- Enter migration here
create or replace function app_public.companies_average_rating(c app_public.companies)
returns int
language sql
stable
as
$$
with company_items_avg_... |
USE [charterbiletixDB_green]
GO
/****** Объект: Table [dbo].[Catalog_Product] Дата скрипта: 05.01.2018 8:29:35 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Catalog_Product] (
[Id] BIGINT IDENTITY (1, 1) NOT NULL,
[BrandId] ... |
UPDATE interim2
SET
x = 0
WHERE
x < 0;
|
-- @Description Tests basic index usage behavior after vacuuming
--
VACUUM foo;
SELECT * FROM foo WHERE b = 5;
|
-- @testpoint: 创建触发器,触发器名长度为62个字符
-- @modified at: 2020-12-16
----创建表
CREATE TABLE test_trigger_src_tbl0(id1 int,id2 int, id3 int) PARTITION BY RANGE (id1) (PARTITION P1 VALUES LESS THAN(5000));
----创建触发器函数
CREATE OR REPLACE FUNCTION tri_insert_func01() RETURNS TRIGGER AS
$$
DECLARE
BEGIN
INSERT INTO test_trigger_de... |
/*
Navicat MySQL Data Transfer
Source Server : centos
Source Server Version : 50720
Source Host : 172.16.58.3:3306
Source Database : bootdo
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date: 2017-12-21 12:55:25
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---... |
/*
Navicat Premium Data Transfer
Source Server : 本地
Source Server Type : MySQL
Source Server Version : 80016
Source Host : localhost:3306
Source Schema : mybatis-plus
Target Server Type : MySQL
Target Server Version : 80016
File Encoding : 65001
Date: 26/01/2020 14:1... |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 17, 2012 at 09:12 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
CREATE TABLE RESULT_STATUS (
id TINYINT PRIMARY KEY,
result_status_name VARCHAR(10) NOT NULL
);
INSERT INTO RESULT_STATUS (id, result_status_name) VALUES
(0,'PROCESSING'),
(1,'PROCESSED'),
(2,'PENDING'),
(3,'ERROR');
CREATE TABLE PROCESSING_STATUS (
id TINYINT PRIMARY KEY,
processing_status_name VARCHAR... |
BEGIN;
CREATE EXTENSION IF NOT EXISTS citext;
DROP SCHEMA IF EXISTS app_public CASCADE;
CREATE SCHEMA app_public;
DROP SCHEMA IF EXISTS app_private CASCADE;
CREATE SCHEMA app_private;
GRANT USAGE ON SCHEMA app_private TO public;
GRANT USAGE ON SCHEMA app_public TO public;
CREATE TABLE app_public.goals (
id serial P... |
-- file:numeric_big.sql ln:153 expect:true
INSERT INTO num_exp_sub VALUES (2,9,'-994877526002806872754342203612721.3903805045737461314327824125947894252158228412176503068144850714981372339080078608391664267867623771913467978906668114865804508732365463778761037722654762556608459784470323894208079922155461469668473291395... |
<reponame>flowsforapex/apex-flowsforapex<filename>test/plsql/test_var_exps_in_callActivities.pks
/*
-- Flows for APEX - test_var_exps_in_callActivities.pks
--
-- (c) Copyright Oracle Corporation and / or its affiliates, 2022.
--
-- Created 2022 <NAME>, Oracle
--
*/
create or replace package test_var_exps_in_ca... |
INSERT INTO department (name)
VALUES
("Engineering"),
("Sales"),
("Finance"),
("Legal");
SELECT * FROM department;
INSERT INTO role (title, salary, department_id)
VALUES
("Lead Engineer", 250000, 1),
("Software Engineer", 150000, 1),
("Sales Lead", 200000, 2),
("Salesperson", 750000, 2),
("Accountant", 950000, 3)... |
<gh_stars>1000+
-- 2017-09-22T16:01:10.635
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.contracts.subscription.process.C_SubscriptionProgress_InsertPause', Value='C_SubscriptionProgress_InsertPause',Updated=TO_TIMESTAMP('2017-09-22 16:01:10','YYYY-MM-DD HH2... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.2.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:8869
-- Generation Time: Oct 14, 2015 at 08:24 PM
-- Server version: 5.5.38
-- PHP Version: 5.5.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `serverhouse`
--
-- ------------... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 17, 2019 at 11:28 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:00";
/*!40101 SET @OLD... |
EXEC sp_MSforeachtable "ALTER TABLE ? NOCHECK CONSTRAINT all"
-- delete data in all tables
EXEC sp_MSforeachtable "DELETE FROM ?"
Insert into dbo.REGIONS (REGION_ID,REGION_NAME) values (1,'Europe');
Insert into dbo.REGIONS (REGION_ID,REGION_NAME) values (2,'Americas');
Insert into dbo.REGIONS (REGION_ID,REGIO... |
<gh_stars>1-10
print '
Generating meta view value triggers...'
IF OBJECT_ID('[orm_meta].[view_all_values_listing_delete]', 'tr') IS NOT NULL
drop trigger [orm_meta].[view_all_values_listing_delete]
go
create trigger [orm_meta].[view_all_values_listing_delete]
on [orm_meta].[all_values_listing]
instead of delete
a... |
<filename>fineract-provider/src/main/resources/sql/migrations/core_db/V58__create-holiday-tables_changed.sql
create table `m_holiday`(
`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL,
`from_date` DATETIME NOT NULL,
`to_date` DATETIME NOT NULL,
`description` varchar(100) NULL DEFAULT NULL,
PRIMAR... |
<gh_stars>1-10
/*
Warnings:
- You are about to drop the column `total` on the `invoices` table. All the data in the column will be lost.
- You are about to drop the `_ItemToInvoice` table. If the table is not empty, all the data it contains will be lost.
- Added the required column `invoiceId` to the `items` t... |
<filename>database/create-shared-index-database.sql
-- create role diku_mod_reshare_index password '<PASSWORD>' NOSUPERUSER NOCREATEDB INHERIT LOGIN;
-- grant diku_mod_reshare_index to current_user;
-- create schema diku_mod_reshare_index authorization diku_mod_reshare_index;
CREATE EXTENSION IF NOT EXISTS "uuid-ossp"... |
<filename>sql/_01_object/_10_system_table/_004_db_attribute/cases/1001.sql
--Create class and retrieve attribute type from db_attribue
create class test_class(col1 integer,col2 varchar(10));
insert into test_class values(999,'nhn');
insert into test_class values(888,'nhn');
select attr_name, class_name, attr_type
fro... |
<reponame>121ngocson1995/minh-lar
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: testlaravel3
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.19-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD... |
<reponame>Reittu/fault-information-system
CREATE PROCEDURE dbo.uspAddReport
@pUsername nvarchar(50),
@pLatitude decimal(8, 6),
@pLongitude decimal(9, 6),
@pSubject nvarchar(50),
@pDescription nvarchar(500),
@pCity nvarchar(200),
@pPostcode varchar(15),
@pAddress nvarchar(255),
@responseMessage nvarchar(250) OUTPUT
AS
... |
<gh_stars>0
DROP DATABASE IF EXISTS Employee_DB;
CREATE DATABASE Employee_DB;
USE Employee_DB;
CREATE TABLE department(
id int AUTO_INCREMENT PRIMARY KEY,
name varchar(30)
);
CREATE TABLE role(
id int AUTO_INCREMENT PRIMARY KEY,
title varchar(30),
salary decimal,
department_id int,
FOREI... |
<reponame>ahmadhafidh/laravel8-crudjetstream-livewire<filename>laravel_auth_crud.sql
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 22 Nov 2020 pada 14.07
-- Versi server: 10.4.14-MariaDB
-- Versi PHP: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
STAR... |
<filename>group_by_exercises.sql
# 1. group_by_exercises.sql
USE employees;
# 2. In your script, use DISTINCT to find the unique titles in the titles table. How many unique titles have there ever been? Answer that in a comment in your SQL file.
SELECT DISTINCT title
FROM titles;
/* Senior Engineer
Staff
Enginee... |
<reponame>toulousain79/MySB
-- MySQL dump 10.16 Distrib 10.1.37-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: MySB_db
-- ------------------------------------------------------
-- Server version 10.1.37-MariaDB-0+deb9u1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101... |
-- randexpr1.test
--
-- db eval {SELECT coalesce((select max(17) from t1 where -coalesce((select t1.b+coalesce((select case when case t1.f when c then (e) else a end+t1.c+(f)>17 and e>=f and (13>t1.f) then (select ~(cast(avg(t1.e) AS integer)) | min(t1.a) from t1) when -c>c then 19 else t1.f end from t1 where (17<t1... |
<reponame>jdkoren/sqlite-parser<gh_stars>100-1000
-- intpkey.test
--
-- execsql {
-- INSERT INTO t1 VALUES(0,'zero','entry');
-- }
INSERT INTO t1 VALUES(0,'zero','entry'); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.