sql stringlengths 6 1.05M |
|---|
create table transaction(
id serial primary key,
date date not null,
owner bigint not null references `user`(id),
source bigint references account(id),
target bigint references account(id),
amount decimal(13, 4) not null,
exempt decimal(13, 4) not null default 0,
description text
); |
<gh_stars>1-10
INSERT INTO `items` (name, label) VALUES
('gym_membership', 'Carte de membre'),
('powerade', 'Powerade'),
('sportlunch', 'Sportlunch'),
('protein_shake', 'Shake protéiné')
; |
<filename>backend/create_table.sql
DROP TABLE IF EXISTS `posts`;
CREATE TABLE `posts` (
`id` int(11) NOT null AUTO_INCREMENT,
`title` varchar(200) NOT null,
`content` text NOT null,
`category` varchar(100) NOT null,
`created_date` timestamp NOT null DEFAULT NOW(),
`updated_date` timestamp NOT null DEFAULT ... |
USE [VipunenTK_lisatiedot]
GO
/****** Object: Table [dbo].[AL_alueluokitus_kunta_nykytila] Script Date: 10.9.2021 19:47:18 ******/
DROP TABLE IF EXISTS [dbo].[AL_alueluokitus_kunta_nykytila]
GO
DROP TABLE IF EXISTS [dbo].[AL_koulutuksen_jarjestaja_nykytila]
GO
DROP TABLE IF EXISTS [dbo].[AL_koulutusluokitus_nyky... |
USE [MicroWiki]
GO
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_NAME = 'mw_Read_Document')
DROP PROCEDURE [dbo].[mw_Read_Document]
GO
CREATE PROCEDURE [dbo].[mw_Read_Document]
(
@ID nvarchar(64) = NULL,
@Location nvarchar(256) = NULL
)
AS
BEGIN
SET NOCOUNT ON
IF @ID IS NOT NULL... |
<reponame>jdkoren/sqlite-parser
-- shared2.test
--
-- execsql {SELECT count(*) FROM numbers}
SELECT count(*) FROM numbers |
INSERT INTO slot.zero_rate (id, col1, col2, col3, col4, col5) VALUES (0, 10, 0, 0, 0, 10);
INSERT INTO slot.zero_rate (id, col1, col2, col3, col4, col5) VALUES (1, 10, 10, 0, 10, 10);
INSERT INTO slot.zero_rate (id, col1, col2, col3, col4, col5) VALUES (2, 10, 10, 0, 10, 10);
INSERT INTO slot.zero_rate (id, col1, col2,... |
CREATE TABLE cafeteria_order (
id INTEGER PRIMARY KEY AUTO_INCREMENT
);
CREATE TABLE menu_item (
id INTEGER PRIMARY KEY AUTO_INCREMENT,
menu_item_id INTEGER,
id_order INTEGER,
foreign key (id_order) references cafeteria_order(id)
);
|
update reserva
set tipo_reserva = :tipoReserva,
fecha_inicio = :fechaInicio,
fecha_fin = :fechaFin,
hora_inicio = :horaInicio,
hora_fin = :horaFin,
tipo_tarifa = :tipoTarifa,
valor_total_reserva = :valorTotalReserva,
datos_cliente = :datosCliente
where id = :id |
CREATE TABLE IF NOT EXISTS nodes (
id INTEGER NOT NULL PRIMARY KEY,
user TEXT,
timestamp TEXT,
lon REAL NOT NULL,
lat REAL NOT NULL,
marked INTEGER
);
CREATE TABLE IF NOT EXISTS node_tags (
ref INTEGER NOT NULL,
key TEXT,
value TEXT,
marked INTEGER
);
CREATE TABLE IF NOT EXISTS... |
<reponame>odys-z/SQLeo-Pro
SELECT
*
FROM
actor
WHERE
actor_id = 1 |
<reponame>bcgov/EDUC-PEN-SERVICES-API
ALTER TABLE API_PEN_VALIDATION.PEN_SERVICES_SAGA
ADD RETRY_COUNT NUMBER;
|
--drop table dwh_manage.job_instances;
create table dwh_manage.job_instance_status (
job_instance_id bigint not null,
process_instance_id bigint,
process_instance_name varchar(255),
job_name varchar(255) not null,
job_project varchar(128),
job_info varchar(512),
job_display_name varchar(255),
jo... |
SELECT char(0xD0, 0xBF, 0xD1, 0x80, 0xD0, 0xB8, 0xD0, 0xB2, 0xD0, 0xB5, 0xD1, 0x82) AS hello;
SELECT char(-48,-65,-47,-128,-48,-72,-48,-78,-48,-75,-47,-126) AS hello;
SELECT char(-48, 0xB0 + number,-47,-128,-48,-72,-48,-78,-48,-75,-47,-126) AS hello FROM numbers(16);
SELECT char(0xe4, 0xbd, 0xa0, 0xe5, 0xa5, 0xbd) AS h... |
/* Tsql DMLs*/
INSERT INTO sys.syslanguages
VALUES (1,
'ENGLISH',
'ENGLISH (AUSTRALIA)',
NULL,
NULL,
'AUSTRALIA',
'EN-AU',
jsonb_build_object('date_format', 'DMY',
'date_first', 1,
... |
<filename>app/src/SQL/oauth.sql
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2
-- http://www.phpmyadmin.net
--
-- Client : localhost
-- Généré le : Lun 21 Mai 2018 à 15:03
-- Version du serveur : 5.7.22-0ubuntu0.16.04.1
-- Version de PHP : 7.0.28-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET t... |
-- +migrate Up
alter table "workflow" add column retention_policy TEXT;
update workflow set retention_policy = 'return (git_branch_exist == "false" and run_days_before < 2) or run_days_before < 365';
alter table "workflow" alter column retention_policy SET NOT NULL;
alter table "workflow" add column max_runs INT;
upda... |
<filename>app/schema/3-dummy-data.sql<gh_stars>0
-- data dummy |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 01, 2018 at 01:51 PM
-- Server version: 10.1.16-MariaDB
-- PHP Version: 7.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
<gh_stars>0
drop table if exists kanban_tasks;
|
<filename>sql/convert_post.sql
CREATE OR REPLACE VIEW public.data_poly AS
WITH single AS (
SELECT
(ST_Dump(geom)).geom AS geom,
DN AS dn,
ROW_NUMBER () OVER (ORDER BY (ST_Dump(geom)).geom) AS id
FROM data
)
SELECT geom, dn || '.' || id AS dn FROM single
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Mar 29, 2020 at 10:16 PM
-- Server version: 5.7.29-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 ... |
<reponame>tanmaychandane/database_lab
USE sql_store;
SELECT order_id, o.customer_id, first_name, last_name
FROM orders o
JOIN customers c ON o.customer_id = c.customer_id;
SELECT order_id, oi.product_id, quantity, oi.unit_price
FROM order_items oi
JOIN products p ON oi.product_id = p.product_id;
|
SET search_path TO common_oltp;
CREATE unique INDEX IF NOT EXISTS security_user_i2 ON common_oltp.security_user
(
user_id
);
ALTER TABLE common_oltp.security_user ADD CONSTRAINT pk_security_user PRIMARY KEY (login_id);
CREATE UNIQUE INDEX IF NOT EXISTS user_role_xref_i2 ON common_oltp.user_role_xref
... |
-- =============================================
-- Author: (Ceteris AG; <NAME>)
-- Create date: 2015-02-23
-- Description: Gets Updates and New entries for Folders from SSISDB
-- =============================================
CREATE PROCEDURE [etljob].[prc_GetSSISDBFolders]
AS
SET NOCOUNT ON
MERGE INTO [etljob].[F... |
-- Question 1
SELECT matchid, player FROM goal WHERE teamid = 'GER'
-- Question 2
SELECT id,stadium,team1,team2
FROM game
JOIN goal ON game.id = goal.matchid
WHERE goal.matchid = 1012 LIMIT 1
-- Question 3
SELECT player, teamid, stadium, mdate
FROM game JOIN goal ON (id = matchid)
WHERE teamid = 'GER'
-- Question 4
... |
create table characters_of_force (
name varchar2(128) not null primary key,
alignment varchar2(10) not null,
constraint characters_of_force_chk
check (alignment in ('dark','light','neutral'))
);
insert into characters_of_force
values ('<NAME>', 'dark');
insert into characters_of_force
values ('<NAME>', '... |
/*
Warnings:
- You are about to drop the column `accessToken` on the `User` table. All the data in the column will be lost.
- A unique constraint covering the columns `[userId]` on the table `Profile` will be added. If there are existing duplicate values, this will fail.
- A unique constraint covering the colu... |
<reponame>AsTunO/Log-API<gh_stars>1-10
alter table LogClient rename column clientPhone to clientTelphone; |
CREATE DATABASE szf_ad DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
DROP TABLE IF EXISTS szf_ad.promotion_space;
CREATE TABLE szf_ad.promotion_space
(
id BIGINT NOT NULL COMMENT 'ID',
name VARCHAR(100) NOT NULL COMMENT '名称',
space_key VARCHAR(100) NOT NULL C... |
<filename>src/test/resources/sql/select/f09eee2b.sql
-- file:tsearch.sql ln:330 expect:true
SELECT ts_headline('english', '
<html>
<!<body>
Sea view wow <u>foo bar</u> <i>qq</i>
<a href="http://www.google.com/foo.bar.html" target="_blank">YES  
|
<reponame>hemachandarv/short
-- +migrate Up
ALTER TABLE "user_url_relation"
DROP CONSTRAINT "user_url_relation_user_email_fkey";
ALTER TABLE "user_url_relation"
DROP COLUMN user_email;
ALTER TABLE "user"
DROP CONSTRAINT "User_pkey";
ALTER TABLE "user"
ADD CONSTRAINT "User_pkey" PRIMARY KEY (id);
ALTER... |
--Set DB
use telcoedw
go
-- Show the serialized model
select * from cdr_models
------------------------------------------------------------------------------------------
-- rxDForest
------------------------------------------------------------------------------------------
-- Step 1 - Train the customer churn model
-... |
<reponame>tewksbg/kvwmap-en<gh_stars>10-100
INSERT INTO `u_groups` (`Gruppenname`, `Gruppenname_low-german`, `Gruppenname_english`, `Gruppenname_polish`, `Gruppenname_vietnamese`, `obergruppe`, `order`) VALUES
('Anliegerbeiträge', NULL, NULL, NULL, NULL, NULL, 6);
SET @group_id = LAST_INSERT_ID();
SET @connection = 'u... |
<reponame>dram/metasfresh
-- 2017-11-15T11:52:41.725
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
/* DDL */ CREATE TABLE public.ESR_PostFinanceUserNumber (AD_Client_ID NUMERIC(10) NOT NULL, AD_Org_ID NUMERIC(10) NOT NULL, C_BP_BankAccount_ID NUMERIC(10) NOT NULL, Created TIMESTAMP WITH TIME ZONE N... |
<gh_stars>1-10
DROP FUNCTION IF EXISTS conreality.object_location(uuid) RESTRICT;
-- Determines an object's current GPS location.
CREATE OR REPLACE FUNCTION conreality.object_location(object_uuid uuid) RETURNS geography(POINT,4326) AS $$
SELECT m.location
FROM conreality.object_motion m
WHERE m.uuid = object... |
# --- !Ups
create table account (
email varchar(255) not null,
hashed_password varchar(255),
is_admin boolean,
constraint pk_account primary key (email))
;
create table basic_event (
id varchar(255) not null,
name v... |
<reponame>nikosev/OpenConext-oidc
--
-- Additional attributes to store for the UserInfo table
--
CREATE INDEX ui_sub_idx ON user_info(sub);
ALTER TABLE user_info ADD DTYPE varchar(256) DEFAULT NULL;
ALTER TABLE user_info ADD unspecified_name_id varchar(256) DEFAULT NULL;
ALTER TABLE user_info ADD edu_person_unique_id... |
------------------------------------------------------------------------------------------------------------------------------------------
---------------------------FIND GARNISH ID FROM NAME
CREATE FUNCTION FUNCTION_GARNISH_ID(@GARNISH_NAME VARCHAR(MAX))
RETURNS INT
AS
BEGIN
DECLARE @ret INT
SET @ret = (SELECT ID FR... |
<filename>templates/sqoop-parquet-full-load/get-partition.sql<gh_stars>0
use {{ conf.final_database.name }};
show table stats {{ table.destination.clean_name }}; |
<filename>Cheburashka/Tests/TestScripts/EnforceReturnRule/ProcWithoutReturn.sql
CREATE PROCEDURE dbo.ProcWithOutReturn
AS
BEGIN
exec dbo.ProcWithoutReturn; -- Doesn't use Return. This should be flagged as a problem.
END |
<reponame>pdv-ru/ClickHouse<gh_stars>1000+
SELECT CAST([(1, 'Hello'), (2, 'World')] AS Array(Tuple(a UInt64, b String)));
|
INSERT INTO `genders` (`genders_id`, `genders_name`) VALUES
('äãzuÏ7йàÝü', 'FEMALE'),
('ÂíÁЯOxBуWР', 'GENDERFLUID'),
('H4YèÓqТceR', 'THIRD SEX'),
('ÓЯаЬзÞÅХõã', 'INTERSEX'),
('tvæþüОÀêìJ', 'NONBINARY'),
('ÛцЭWrZlèФé', 'CISGENDER MALE'),
('xõãnРÊÓиф5', 'MALE'),
('ÞLЛWnÝЫUËР', 'GENDERQUEER'),
('фХöüJпnQюì', 'CISGENDER FE... |
SELECT OBJECT_TYPE
,OBJECT_SCHEMA
,OBJECT_NAME
FROM (
SELECT 'TABLE' AS OBJECT_TYPE
,TABLE_NAME AS OBJECT_NAME
,TABLE_SCHEMA AS OBJECT_SCHEMA
FROM information_schema.TABLES
UNION
SELECT 'INDEX[Type:Name:Table]' AS OBJECT_TYPE
,CONCAT (
CONSTRAINT_TYPE
,' : '
,CONSTRAINT_NAME
... |
<gh_stars>1-10
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50553
Source Host : localhost:3306
Source Database : chat
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2020-11-08 11:37:21
*/
SET FOREIGN_KEY_CHE... |
<reponame>anasseaharrar/lutece-core<filename>src/sql/upgrade/update_db_lutece_core-2.1.1-2.2.2.sql
ALTER TABLE `core_admin_right` ADD COLUMN `documentation_url` varchar(255) collate utf8_unicode_ci DEFAULT NULL;
ALTER TABLE `core_admin_right` ADD COLUMN `id_order` int(11) DEFAULT NULL;
ALTER TABLE `core_admin_user` C... |
autocommit off;
DELETE FROM base_c1;
ROLLBACK WORK;
|
<gh_stars>0
-- @testpoint:opengauss关键字domain(非保留),作为视图名
--关键字domain作为视图名,不带引号,创建成功
CREATE or replace VIEW domain AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view domain;
--关键字domain作为视图名,加双引号,创建成功
CREATE or replace VIEW "domain" AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
dro... |
<filename>src/main/resources/db/migration/V1__criar_tabela_cliente.sql
CREATE TABLE cliente (
id INT NOT NULL PRIMARY KEY auto_increment,
nome VARCHAR (255) NOT NULL,
cpf VARCHAR (14) NOT NULL,
nascimento DATE NOT NULL ,
telefone VARCHAR(11) NOT NULL,
email VARCHAR (255) NOT NULL
) ENGINE=InnoDB DEFAULT CHA... |
/*
Vjezbe 5 Zadatak 7 AdventureWorks2014
Kreirati upit koji prikazuje cetvrtu najvecu platu u preduzecu (po visini primanja).
Tabela EmployeePayHistory.
*/
USE AdventureWorks2014
SELECT TOP 1 EPH.Rate AS '4 najveca plata'
FROM (select top 4 EPH.Rate
from HumanResources.EmployeePayHistory AS EPH
order by E... |
-- phpMyAdmin SQL Dump
-- version 4.3.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 09 Mei 2017 pada 11.45
-- Versi Server: 5.6.24
-- PHP Version: 5.6.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... |
DROP DATABASE IF EXISTS wordlebot;
DROP DATABASE IF EXISTS wordlebot;
CREATE DATABASE IF NOT EXISTS wordlebot;
USE wordlebot;
DROP TABLE IF EXISTS currentgames;
DROP TABLE IF EXISTS gamesplayed;
DROP TABLE IF EXISTS guesses;
DROP TABLE IF EXISTS stats;
DROP TABLE IF EXISTS rankings;
CREATE TABLE IF NOT EXISTS current... |
<gh_stars>0
CREATE PROCEDURE [dbo].[ResetTickets]
(
@concertId INT
)
AS
UPDATE dbo.Ticket SET
PurchaserId = NULL
,PurchasedOn = NULL
WHERE ConcertId = @concertId
RETURN 0
|
CREATE OR REPLACE FUNCTION insertorupdatemetadatainfo(IN inckanid character varying, IN inid character varying, IN pub character varying, IN cont character varying, IN descr text, IN invers character varying, IN incategory json, IN stime timestamp with time zone, IN ingeobbox character varying, IN ingeotoponym characte... |
-- <Dolibase dictionary table example>
-- Copyright (C) <2018> <AXeL>
INSERT INTO llx_books_dict (rowid, label, active) VALUES (1, 'Science & nature', 1);
INSERT INTO llx_books_dict (rowid, label, active) VALUES (2, 'History', 1);
INSERT INTO llx_books_dict (rowid, label, active) VALUES (3, 'Cooking', 1);
INSERT INTO... |
***********************************
delay and trace-back analysis
***********************************
create new tables: count_retweet_delay、count_retweet_delay_valid、count_reply_delay、count_reply_delay_valid
-- count retweets delay
create table count_retweet_delay
(
user_id varchar(128) not null,
friend_id varchar... |
{{ config(materialized='view') }}
{{ dbt_ml_preprocessing.k_bins_discretizer( ref('data_k_bins_discretizer') ,['col_to_bin_1','col_to_bin_2']) }}
|
<filename>src/CoreBundle/private/web_modules/MTWizardCore/tables.sql<gh_stars>1-10
CREATE TABLE `module_wizard` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY
);
ALTER TABLE `module_wizard`
ADD `cms_tpl_module_instance_id` INT(11) NOT NULL;
ALTER TABLE ... |
DROP FUNCTION solaragg.find_datum_for_time_slot(bigint, text[], timestamp with time zone, interval, interval);
CREATE OR REPLACE FUNCTION solaragg.find_datum_for_time_slot(
IN node bigint,
IN sources text[],
IN start_ts timestamp with time zone,
IN span interval,
IN tolerance interval DEFAULT interval '1 hour... |
<reponame>kiranbhakre/hive-testbench<filename>ddl-tpcds/bin_partitioned/inventory.sql
create database if not exists ${DB};
use ${DB};
drop table if exists inventory;
create table inventory
(
inv_date_sk int,
inv_item_sk int,
inv_warehouse_sk int,
inv_quantity_on_hand int
)
partitione... |
<reponame>PersonalGenomesOrg/bigquery-examples
# Retrieve the SNPs identified by ClinVar as pathenogenic or a risk factor, counting the
# number of family members sharing the SNP
SELECT
contig,
position,
ref,
alt,
clinicalsignificance,
diseasename,
family_id,
num_family_members_with_variant,
FROM (
S... |
<reponame>fossabot/automate-1<filename>components/teams-service/storage/postgres/migration/sql/04_add-projects-field.up.sql
-- Insert the default project for existing teams but then do not allow empty project
-- arrays to be inserted. User must always specify projects to be inserted post-migration.
ALTER TABLE teams AD... |
<filename>src/test/resources/ddl/hsqldb-schema.sql
DROP TABLE if exists n_cube;
CREATE TABLE n_cube (
n_cube_id bigint NOT NULL,
n_cube_nm VARCHAR(250) NOT NULL,
tenant_cd VARCHAR(10) DEFAULT 'NONE',
cube_value_bin varbinary(999999),
create_dt TIMESTAMP NOT NULL,
create_hid VARCHAR(20),
version_no_cd VARC... |
drop table if exists foo ;
create table foo(a int);
insert into foo values(1);
insert into foo values(1);
insert into foo values(1);
insert into foo values(2);
insert into foo values(2);
select a, row_number() over(partition by null order by a) row_num from foo;
drop table if exists foo ;
create table t (i int, j ... |
-- MySQL dump 10.13 Distrib 5.7.22, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: simple-shop
-- ------------------------------------------------------
-- Server version 5.7.22-0ubuntu18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 09, 2022 at 06:05 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 5.6.40
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
<reponame>ivancekic/sql-data-analysis
CREATE OR REPLACE PACKAGE INVEJ.KalkulacijaVPCene IS
Procedure SetParameter( nGod In Number, cBr In VarChar2 ,
cVal In VarChar2 := NULL );
Function Page( nStrana NUMBER ) Return Boolean;
END;
/
CREATE PUBLIC SYNONYM KalkulacijaVPCene
FOR ... |
create table settings (
id serial primary key,
set_group varchar(50) not null,
set_key varchar(50) not null,
set_label varchar(100) not null unique,
content_type varchar(6) not null, -- string, json, bool,
content_value text not null,
is_active boolean default false,
created_date timest... |
<reponame>my-cargonaut/cargonaut
-- +migrate Up
CREATE TABLE user_account (
id uuid NOT NULL DEFAULT uuid_generate_v1mc(),
email character varying(128) NOT NULL,
password_hash character varying(128) NOT NULL,
display_name character varying(128) NOT NULL,
birthday timestamp W... |
/* Example of idempotent Stored Procedure script */
/* Boilerplate SQL to create procedure if it does not exist */
DECLARE @Name VarChar(100)
DECLARE @Type VarChar(20)
SET @Name = 'GetEventsInTimeRange'
SET @Type = 'PROCEDURE'
IF NOT EXISTS(SELECT * FROM dbo.sysobjects WHERE [name] = @Name)
BEGIN
DECLARE ... |
/*
SQLyog Community v12.2.4 (32 bit)
MySQL - 5.7.19 : Database - payroll
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHEC... |
<filename>db_tt_lict_php_batch01_ecommerce.sql
-- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 29, 2016 at 08:54 AM
-- Server version: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
<filename>src/sp__util_connections.sql<gh_stars>0
/* leave this
l:see LICENSE file
g:utility
k:tcp,ip,host,status,client
v:121025\s.zaglio: list active connections and some useful info
t:sp__util_connections #
t:sp__util_connections '%hostname%'
*/
CREATE proc sp__util_connections
@what sy... |
<filename>Miscellaneous/StoredProcedures/Backup_2015 March 24/h3giIsOrderPartOfABatch.sql
-- ==============================================================
-- Author: <NAME>
-- Create date: 22/07/2014
-- Description:
-- ==============================================================
CREATE PROCEDURE [dbo].[h3gi... |
<filename>src/SFA.DAS.EAS.Employer_Financial.Database/Scripts/Manual/GetAccountTransactionTotalsByMonth.sql<gh_stars>1-10
DECLARE @AccountId BIGINT = 1
SELECT
DATEPART(year, DateCreated) AS Year, DATEPART(month, DateCreated) AS Month,
SUM(CASE WHEN TransactionType = 1 THEN Amount ELSE 0 END) AS 'Levy' ,
SUM(CA... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 2017-02-25 07:59:51
-- 服务器版本: 10.1.13-MariaDB
-- PHP Version: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... |
ALTER TABLE FRONT_APPS ADD ARTIFACT_ID varchar(1000) NOT NULL;
ALTER TABLE FRONT_APPS CHANGE NAME GROUP_ID varchar(1000);
ALTER TABLE FRONT_APPS MODIFY LATEST BIGINT |
create table shipments_transactions (
id serial primary key,
shipment_id integer not null references shipments(id) on update restrict on delete restrict,
source jsonb not null,
created_at generic_timestamp_now,
amount integer not null
);
|
<gh_stars>1-10
USE webcompare;
DROP TABLE IF EXISTS `messages`;
DROP TABLE IF EXISTS `nodes`;
DROP TABLE IF EXISTS `master`;
DROP TABLE IF EXISTS `filters`;
CREATE TABLE `filters` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`is_rx` bit(1) NOT NULL,
`name_filter` varchar(100) DEFAULT NULL,
`typename_filter` varcha... |
CREATE TABLE [dbo].[BugNet_ProjectCustomFieldSelections] (
[CustomFieldSelectionId] INT IDENTITY (1, 1) NOT NULL,
[CustomFieldId] INT NOT NULL,
[CustomFieldSelectionValue] NVARCHAR (255) NOT NULL,
[CustomFieldSelectionName] NVARCHAR (255) NOT NU... |
<filename>tienda_master.sql
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 04-05-2022 a las 05:00:16
-- Versión del servidor: 8.0.27
-- Versión de PHP: 7.4.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:... |
<reponame>umutsevdi/graduate-information-system
insert into form ("from", "to") values (89, 3);
insert into form ("from", "to") values (70, 2);
insert into form ("from", "to") values (66, 8);
insert into form ("from", "to") values (66, 2);
insert into form ("from", "to") values (79, 3);
insert into form ("from", "to") ... |
SELECT title FROM books;
SELECT title FROM books LIMIT 5;
#to list author's name for each book along with the title, use a join
SELECT title, name_last FROM books JOIN authors USING (author_id);
SELECT title AS 'Kafka Books' FROM books
JOIN authors USING (author_id)
WHERE name_last = 'Kafka';
|
--文件中的数字代表数据库的版本号,文件中的语句结束以分号结尾.
--文件存放规则 assets/migrations/{DATABASE_NAME}/{versionNumber}.sql
ALTER TABLE USER ADD COLUMN status INTEGER; |
<filename>src/e2e/resources/simple-temple-expected/simple-temple-test-user-db/init.sql
CREATE TABLE simple_temple_test_user (
id UUID NOT NULL PRIMARY KEY,
simple_temple_test_log TEXT NOT NULL,
email VARCHAR(40) CHECK (length(email) >= 5) NOT NULL,
first_name TEXT NOT NULL,
last_name TEXT NOT NULL,
created_... |
DROP TABLE budgets;
DROP TABLE expenses;
DROP TABLE categories; |
<reponame>khuddlefish/gpdb
-- start_ignore
SET gp_create_table_random_default_distribution=off;
-- end_ignore
--
-- SYNC1 Heap Part Table 1
--
CREATE TABLE sync1_heap_alter_part_add_col1 (id int, rank int, year date, gender
char(1)) DISTRIBUTED BY (id, gender, year)
partition by list (gender)
subpartition by range (yea... |
<reponame>pzubar/learn-sql-fundamentals
-- Put your MySQL "up" migration here
CREATE INDEX order_detail_product_order_id ON OrderDetail(productid, orderid)
|
-- Revert schemas/app_jobs/procedures/add_scheduled_job from pg
BEGIN;
DROP FUNCTION app_jobs.add_scheduled_job;
COMMIT;
|
-- Revert stinch-db:appschema from pg
BEGIN;
DROP SCHEMA stinch CASCADE;
COMMIT;
|
<reponame>treebat1/SQL
--View Untrusted ForeignKeys and Constraints
SELECT '[' + s.name + '].[' + o.name + '].[' + i.name + ']' AS keyname
from sys.foreign_keys i
INNER JOIN sys.objects o ON i.parent_object_id = o.object_id
INNER JOIN sys.schemas s ON o.schema_id = s.schema_id
WHERE i.is_not_trusted = 1 AND i.is... |
/*
https://leetcode.com/problems/active-businesses/
https://leetcode.com/submissions/detail/458437400/
Yelp
*/
SELECT
data.business_id
FROM
(
SELECT
e.business_id,
e.event_type,
e.occurences,
av.vv vv
FROM
Events e
JOIN
(
SELECT
e.event_type,
AVG(e.oc... |
CREATE DATABASE "spring-multi-tenancy"; |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 11, 2019 at 08:59 AM
-- Server version: 5.7.24
-- PHP Version: 7.3.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
-- UPDATE: 2018-06-27
-- * ADDS INVOICES TABLE
-- * ADDS BALANCES TABLE
CREATE TABLE IF NOT EXISTS invoices (
id uuid NOT NULL DEFAULT uuid_generate_v4(),
invoice_id VARCHAR(32) UNIQUE NOT NULL,
amount NUMERIC(20, 2) NOT NULL,
code VARCHAR(6) NOT NULL,
creation_time TIMESTAMPTZ NOT NULL DEFAULT C... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Aug 09, 2016 at 11:00 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
<reponame>iamgkstack/biller-app
insert into bills(
id,
"customerID",
"generatedOn",
"dueDate",
recurrence,
"billType",
"billerBillID",
"platformBillID",
"billerCategory",
"billerProductInstanceID",
"amountExactness",
"validationRules",
"billFetchStatus",
"currencyCode",
amount,
"payment... |
<gh_stars>1-10
SELECT e.id, e.name, COUNT(*) as num
FROM employee AS e, record
WHERE e.id = record.employee_id
GROUP BY e.id
HAVING num > 1
ORDER BY num DESC; |
<gh_stars>10-100
select sum(lo_extendedprice * lo_discount) as revenue
from lineorder
where lo_orderdate >= 19940204
and lo_orderdate <= 19940210
and lo_discount>=5
and lo_discount<=7
and lo_quantity>=26
and lo_quantity<=35;
|
create or replace view flow_diagrams_parsed_lov
as
select dgrm.dgrm_id
, dgrm.dgrm_name
, dgrm.dgrm_version
, dgrm.dgrm_status
, dgrm.dgrm_category
from flow_diagrams dgrm
where exists
( select null
from flow_objects objt
where objt.objt_dgrm_id = ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.