sql stringlengths 6 1.05M |
|---|
<gh_stars>0
# --- Created by Ebean DDL
# To stop Ebean DDL generation, remove this comment and start using Evolutions
# --- !Ups
create table demo_user (
id integer auto_increment not null,
constraint pk_demo_user primary key (id)
);
# --- !Downs
drop table if exists demo_use... |
<filename>open-metadata-resources/open-metadata-deployment/SampleData/CocoPharma/dbdata/db2/EmployeeDatabase-Dept.sql<gh_stars>0
-- SPDX-License-Identifier: Apache-2.0
-- Copyright Contributors to the ODPi Egeria project.
disconnect all$
create database ED$
connect to ED$
drop table Dept$
CREATE TABLE Dept (
DEPCODE... |
DROP TABLE block_signatures_count_view;
DROP TABLE block_signatures_count_mv;
CREATE VIEW IF NOT EXISTS blocks_sig_count AS select blk_lvl, count() sig_count from block_signatures group by blk_lvl; |
/*
Change History
Date ------- Developer --- Description
2021-05-07 - <NAME> - Created Query
2021-05-12 - <NAME> - Patched compatability
Note: Is unneeded unless data is exported from Excel
*/
Use PCTC
Alter Table Addresses Alter Column [Zip Code] Varchar(5)
Alter Table CompanyInformation Alter Column [Com... |
<filename>demo/KerasClassifier_SimpleRNN/BinaryClass_100/pgsql/demo3_keras_KerasClassifier_SimpleRNN_pgsql.sql
-- This SQL code was generated by sklearn2sql (development version).
-- Copyright 2018
-- Model : KerasClassifier_SimpleRNN
-- Dataset : BinaryClass_100
-- Database : pgsql
-- This SQL code can contain one ... |
<filename>sql/_04_operator_function/_04_date_time_op/_003_months_between/cases/1017.sql
--[er]tests months_between function with empty operands
select months_between() from db_root;
select months_between(,) from db_root;
|
<reponame>shaneconwell/content-managment-system<filename>seeds.sql
INSERT INTO department (department_name) VALUES ("Engineering");
INSERT INTO department (department_name) VALUES ("Finance");
INSERT INTO department (department_name) VALUES ("Legal");
INSERT INTO department (department_name) VALUES ("Sales");
INSERT I... |
/*
// Copyright (c). 2020 <NAME>, MCSD (danielanywhere)
// Released for public access under the MIT License.
// http://www.opensource.org/licenses/mit-license.php
*/
UPDATE CatalogItem
SET
StarCount = {1},
RatingCount = {2}
WHERE CatalogItemID = {0};
|
<filename>test/fixtures/dialects/tsql/functions_agg.sql<gh_stars>0
select
string_agg(t.v, '; ') within group (order by v) as column_name1
,PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY t.Rate)
OVER (PARTITION BY Name) AS MedianCont
,PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY t.Rate) ... |
<gh_stars>0
CREATE PROCEDURE [dwh].[create_dim_time]
AS
DROP TABLE IF EXISTS [dwh].[dim_time]
CREATE TABLE [dwh].[dim_time]
(
[id_time] INT NOT NULL IDENTITY(1,1) PRIMARY KEY
,[time] TIME NOT NULL
,[hour] TINYINT NOT NULL
,[minute] TINYINT NOT NULL
,[second] TINYINT NOT NULL
)
|
-- Revert data-pipeline-template:fact_sales from pg
BEGIN;
DROP TRIGGER load_sales ON load_sales;
DROP FUNCTION load_sales;
DROP VIEW load_sales;
DROP TABLE fact_sales;
COMMIT;
|
-- # -- # -- # -- # -- #
-- Constraints
-- # -- # -- # -- # -- #
/* Add a set of constraints to the collection.
* The supplied json document should be in the form {field: constraint_spec},
* for example:
* {"age": {"$required": 1,
* "$notnull": 1,
* "$type": "number"}}
* Valid constraint... |
-- file:xml.sql ln:94 expect:true
SELECT xmlpi(name foo, ' bar')
|
<gh_stars>1-10
-- This is a simple test for failing a test on purpose --
SELECT * FROM [BARRETT_TEST].[dbo].[WASD];
|
<gh_stars>1-10
BEGIN;
ALTER TABLE login_sessions
drop column callback_redirect;
COMMIT;
|
-- Query for: 20. Table Privileges Information
select * from information_schema.table_privileges;
|
<reponame>mr-bwnz/SplendidAppBuilder
if exists (select * from INFORMATION_SCHEMA.VIEWS where TABLE_NAME = 'vwMODULES')
Drop View dbo.vwMODULES;
GO
/**********************************************************************************************************************
* Copyright (C) 2005-2022 SplendidCRM Softw... |
<reponame>drabbytux/zoom-dev<filename>data/test1.sql
create table animals (
name text,
species text,
birthdate date);
create table diet (
species text,
food text);
create table taxonomy (
name text,
species text,
genus text,
family text,
t_orde... |
INSERT INTO IACUC_PROTO_OLR_DT_REC_TYPE (REVIEW_DETERM_RECOM_CD, DESCRIPTION, UPDATE_USER, UPDATE_TIMESTAMP, OBJ_ID, VER_NBR)
VALUES (1, 'Major Revisions Required', 'admin', SYSDATE, SYS_GUID(), 1)
/
INSERT INTO IACUC_PROTO_OLR_DT_REC_TYPE (REVIEW_DETERM_RECOM_CD, DESCRIPTION, UPDATE_USER, UPDATE_TIMESTAMP, OBJ_ID... |
<reponame>nvidela/kimkelen
ALTER TABLE `student_advice` ADD `school_year_id` INTEGER NOT NULL;
ALTER TABLE `student_advice` ADD INDEX `student_advice_FI_5` (`school_year_id`);
ALTER TABLE `student_advice` ADD CONSTRAINT `student_advice_FK_5`
FOREIGN KEY (`school_year_id`)
REFERENCES `s... |
<gh_stars>0
insert into microservice.department (id, name, db_source)
values (1, '测试', DATABASE()); |
/*
Navicat Premium Data Transfer
Source Server : 127.0.0.1
Source Server Type : MySQL
Source Server Version : 50734
Source Host : 127.0.0.1:3306
Source Schema : gva
Target Server Type : MySQL
Target Server Version : 50734
File Encoding : 65001
Date: 26/11/2021 16:44:... |
<gh_stars>0
INSERT INTO HOTEL (ID, NAME, ADDRESS, RATING) VALUES (1, 'Hilton', 'Leof. Vasilissis Sofias 46, Athina 115 28', 4);
INSERT INTO HOTEL (ID, NAME, ADDRESS, RATING) VALUES (2, 'Grande Bretagne', '1 Vasileos Georgiou A, Syntagma Square Str, Athina 105 64', 5);
INSERT INTO HOTEL (ID, NAME, ADDRESS, RATING) VAL... |
CREATE OR REPLACE TRIGGER "TR_ADDR_BU" BEFORE UPDATE ON "MCZBASE"."ADDR"
FOR EACH ROW
DECLARE
ship INTEGER;
corr INTEGER;
new_data VARCHAR2(4000);
old_data VARCHAR2(4000);
BEGIN
SELECT :OLD.addr_id || :OLD.street_addr1 || :OLD.street_addr2 ||
:OLD.city ||:OLD.state || :OLD.zip || :OLD.country_cde ||
... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 17, 2019 at 06:38 PM
-- Server version: 5.6.41
-- PHP Version: 7.0.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
START TRANSACTION;
CREATE TABLE account_role_registry (
id UUID PRIMARY KEY,
account UUID NOT NULL REFERENCES account ON DELETE CASCADE,
role UUID NOT NULL REFERENCES role ON DELETE CASCADE,
subject UUID REFERENCES registry ON DELETE CASCADE,
created_on TIMESTAMP WITH TIME ZONE NOT NULL,
created_by UUID NO... |
--Questão 1--
SELECT COUNT(*)
FROM employee AS E
WHERE E.sex = 'F';
--Questão 2--
SELECT AVG(salary)
FROM employee AS E
WHERE E.sex = 'M' AND E.address LIKE '%TX';
--Questão 3--
SELECT DISTINCT S.ssn AS ssn_supervisor, COUNT(*) AS qtd_supervisionados
FROM employee AS E LEFT OUTER JOIN employee AS S
ON E.superssn = S.ss... |
CREATE DEFINER=`root`@`172.16.31.10` PROCEDURE `get_suggested`(IN t_id VARCHAR(20))
BEGIN
declare n VARCHAR(500);
declare ty_id VARCHAR(50);
declare pop INT;
declare avg_rat FLOAT;
declare avail_on VARCHAR(50);
declare genr VARCHAR(500);
declare n1 VARCHAR(500);
declare ty_id1 V... |
select*
from cursos
order by nome;
select nome, carga, ano
from cursos
order by nome;
select *
from cursos
where ano = '2016'
order by nome;
select nome, descricao, carga
from cursos
where ano <= '2015'
order by nome;
select nome, ano
from cursos
where ano between 2014 and 2016;
select nome, descricao, ano
fro... |
<filename>hr_schema.sql
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 15, 2021 at 12:27 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
<filename>db/surat.sql
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 21, 2021 at 06:50 AM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 5.6.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:... |
DROP DATABASE IF EXISTS burger_db;
CREATE DATABASE burger_db;
USE burger_db;
CREATE TABLE burgers (
id INT NOT NULL AUTO_INCREMENT,
name VARCHAR(100),
isDevoured BOOLEAN DEFAULT 0,
PRIMARY KEY(id)
); |
<reponame>tushartushar/dbSmellsData<filename>data/open-source/extracted_sql/vprokopchuk256_mv-mysql.sql
SELECT MAX(1) FROM `#{message}`);
SELECT MAX(1) FROM `some error message`);
|
ALTER TABLE BANKENTRIES_MIS ADD COLUMN departmentcode varchar(50); |
<filename>src/schema.sql
PRAGMA foreign_keys = ON;
CREATE TABLE IF NOT EXISTS files (
id INTEGER NOT NULL PRIMARY KEY,
path TEXT NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS local_defs (
id INTEGER NOT NULL PRIMARY KEY,
file_id INTEGER NOT NULL REFERENCES files (id) ON DELETE CASCADE,
row UNSIGNED INTEGER ... |
-- file:cluster.sql ln:19 expect:true
INSERT INTO clstr_tst_s (b) VALUES (0)
|
--
-- Copyright 2005-2011 The Kuali Foundation
--
-- Licensed under the Educational Community License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.opensource.org/licenses/ecl2.php
--
-- Unless required by ap... |
# --- !Ups
CREATE TABLE `member` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(100) NOT NULL DEFAULT '',
`age` int(11) DEFAULT NULL,
`created` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
CREATE TABLE `team` (
`id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
`n... |
<reponame>uk-gov-mirror/defra.water-abstraction-service
alter table water.licence_versions
drop constraint uindx_licence_versions_external_id;
alter table water.licence_version_purposes
drop constraint uindx_licence_version_purposes_external_id;
alter table water.licence_version_purposes
drop column "external_i... |
CREATE TABLE User(
username VARCHAR(64) PRIMARY KEY,
first_name VARCHAR(16) NOT NULL,
last_name VARCHAR(16) NOT NULL,
password VARCHAR(32) NOT NULL
);
CREATE TABLE List(
ID INTEGER PRIMARY KEY,
creator_ID VARCHAR(64),
title VARCHAR NOT NULL,
creation_date DATE NOT NULL,
reminder_dat... |
-- Begin Specimen Criteria
select C.person_id, C.specimen_id as event_id, C.specimen_date as start_date, DATEADD(d,1,C.specimen_date) as end_date, C.specimen_concept_id as TARGET_CONCEPT_ID
from
(
select s.*, ROW_NUMBER() over (PARTITION BY s.person_id ORDER BY s.specimen_date, s.specimen_id) as ordinal
FROM @cdm_... |
--
-- PHPOE-1799-2 rollback.sql
--
ALTER TABLE `institution_site_section_students` ADD `student_category_id` INT(11) NOT NULL AFTER `education_grade_id`;
ALTER TABLE `institution_site_section_students` CHANGE `student_id` `security_user_id` INT(11) NOT NULL;
-- Latest
ALTER TABLE `institution_site_class_students` CHA... |
CREATE TABLE dbo.actions (
id bigint NOT NULL IDENTITY(1,1),
context varchar(255) NULL,
[date] datetime2 NULL,
value_date datetime2 NOT NULL,
is_deleted bit NOT NULL,
lynx_activity_id bigint NULL,
[type] int NULL,
viv_amount int NOT NULL,
achiever_id bigint NULL,
creator_id bigint NULL,
payment_id bigint NUL... |
select id, display_name
from oci.oci_apigateway_api
where display_name = '{{ resourceName }}'; |
<gh_stars>1000+
SELECT '< HIVE-78 Authorization model for Hive >';
--
-- Table: ROLES
--
CREATE TABLE "ROLES" (
"ROLE_ID" bigint NOT NULL,
"CREATE_TIME" bigint NOT NULL,
"OWNER_NAME" character varying(128) DEFAULT NULL,
"ROLE_NAME" character varying(128) DEFAULT NULL,
PRIMARY KEY ("ROLE_ID"),
CONSTRAINT "... |
<filename>svtransform/queries/getEdiGaUnionAll.sql
SELECT t3.*
FROM (
(SELECT
'' as media_ua,
'' as media_term,
'' as media_source,
'' as media_rst_type,
'' as media_media,
'' as media_brd,
'' as media_camp1st,
'' as media_camp2nd,
'' as media_camp3rd,
''... |
<reponame>Zhaojia2019/cubrid-testcases
--pass different formats of timestamptz/datetimetz arguments
--2. pass different formats of timestamptz arguments
select day(timestamptz'13:14:55 10/08');
select day(timestamptz'2:22:22 8/12/2010');
select day(timestamptz'09:03:22 PM 1988-08-08');
select day(timestamptz'12/12... |
<gh_stars>0
/*drop database dance;*/
use DanceDB;
create table DanceStyle(
StyleId int identity (1,1) primary key,
StyleName varchar(15) not null unique
);
create table Course(
CourseId int identity (1,1) primary key,
StyleId int,
CourseYear int,
DifficultyRank char(1) check ( (DifficultyRank='A'... |
<reponame>sivanagarajumolabanti/Datawarehouse
insert into bi_backups.d_sfdc_opportunity_line_item_schedule_deleted
select *,now() from bi_prod.d_sfdc_opportunity_line_item_schedule a
where 1=1
and opport_line_item_sched_key>0
and not exists (select 1 from bi_stage.stg_sfdc_opportunity_line_item_schedule b where a.oppor... |
<reponame>warelab/gramene-ensembl
select count(*) from gene; |
-- MySQL Script generated by MySQL Workbench
-- Mon Dec 14 19:11:47 2015
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TR... |
<gh_stars>0
CREATE TABLE tblproduto(
id bigint not null,
id_tipo bigint not null REFERENCES tblprodutotipo(id),
id_cor bigint not null REFERENCES tblprodutocor(id),
id_detalhe bigint not null REFERENCES tblprodutodetalhe(id),
id_complemento bigint not null REFERENCES tblprodutocomplemento(id),
i... |
-- phpMyAdmin SQL Dump
-- version 4.2.7.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 12 Mei 2015 pada 10.06
-- Versi Server: 5.5.39
-- PHP Version: 5.4.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 13.3
-- 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 = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', fal... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: May 12, 2020 at 01:47 PM
-- Server version: 5.7.26
-- PHP Version: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `laravelpizza`
--
-- ---------------------... |
<gh_stars>0
DEF title = 'Extended Statistics (dba_stat_extensions dba_tab_col_statistics)';
DEF filename = 'ExtendedStatistics.html';
DEF nextpage = 'FrequencyHistograms.html';
DEF prevpage = 'Columns.html';
@@00_begin.sql
@@sql/sub/ExtendedStatistics.sql
SET MARK HTML OFF;
PRO <h2>Comments</h2>
PRO <p>The ... |
-- =============================================
-- Author: <NAME>
-- Create date: 2011-04-19
-- Description: Calls usp_LoadFISDatamart with @TruncateTables bit set to false
-- in oder to update the FISDataMart non-manually loaded tables.
-- Modifications:
-- =============================================
CREATE PROCE... |
CREATE TABLE TRADE_FLEET (
ID BIGINT NOT NULL AUTO_INCREMENT,
COUNTRY VARCHAR(255),
R_PROVINCE VARCHAR(255),
LEVEL INTEGER,
ID_GAME BIGINT,
PRIMARY KEY (ID)
);
ALTER TABLE TRADE_FLEET
ADD INDEX FK_TRADE_FLEET_GAME (ID_GAME),
ADD CONSTRAINT FK_TRADE_FLEET_GAME
FOREIGN KEY (ID_GAME)
REFERENC... |
/*
Navicat MySQL Data Transfer
Source Server : DNCRM
Source Server Version : 50632
Source Host : localhost:3306
Source Database : dncrm
Target Server Type : MYSQL
Target Server Version : 50632
File Encoding : 65001
Date: 2018-04-28 11:06:08
*/
SET FOREIGN_KEY_CHECKS=0;
-- -------... |
CREATE OR REPLACE FUNCTION ti.getdatasetsbycontactid(_contactid integer)
RETURNS TABLE(datasetid integer, datasettype character varying, siteid integer, sitename character varying, geopolname1 character varying, geopolname2 character varying, geopolname3 character varying)
LANGUAGE sql
AS $function$
SELECT ndb.datase... |
<reponame>timshadel/subdivision-list<filename>data/sr/postgres/subdivisions_ES.postgres.sql
CREATE TABLE subdivision_ES (id VARCHAR(6) NOT NULL, name VARCHAR(255), level VARCHAR(64) NOT NULL, PRIMARY KEY(id));
INSERT INTO "subdivision_ES" ("id", "name", "level") VALUES (E'ES-C', E'Коруња', E'province');
INSERT INTO "s... |
-- file:foreign_key.sql ln:1026 expect:true
create table pktable2(f1 int primary key)
|
<filename>tests/root/_get_split_query_single_table/07/test.sql
set @query_script_skip_cleanup := true;
set @query := 'insert into test12.some_table values (1)';
call _interpret(@query, false);
call _get_split_query_single_table (
1, 10000, @query_type_supported, @tables_found, @table_schema, @table_name
);
select
... |
delete from course;
delete from teacher;
INSERT INTO teacher (username) VALUES ('username');
INSERT INTO course (uuid, name, description, approval_status, number, rating) VALUES ('123E4567E89B12D3A456426655440001', 'course name', 'description', 'APPROVED', 0, 0);
UPDATE course SET teacher = (SELECT teacher.id FROM tea... |
<filename>CSETWebApi/CSETWeb_Api/Database/dbo.GetComparisonFilePercentage.StoredProcedure.sql
USE [CSETWeb]
GO
/****** Object: StoredProcedure [dbo].[GetComparisonFilePercentage] Script Date: 11/14/2018 3:57:31 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- ==========================================... |
-- 2018-05-14T14:15:19.846
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_TreeNodeMM SET Parent_ID=1000007, SeqNo=0, Updated=now(), UpdatedBy=100 WHERE Node_ID=1000008 AND AD_Tree_ID=10
;
-- 2018-05-14T14:15:19.855
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE A... |
ALTER TABLE `locales_command`
ADD COLUMN `help_text_loc0` LONGTEXT AFTER `id`,
ADD COLUMN `help_text_loc9` LONGTEXT AFTER `help_text_loc8`;
ALTER TABLE `locales_creature`
ADD COLUMN `name_loc0` VARCHAR(100) NOT NULL DEFAULT '' AFTER `entry`,
ADD COLUMN `n... |
<reponame>rafaelmartinsdacosta/docker-compose-java-app
CREATE TABLE IF NOT EXISTS user_permission (
id_user integer NOT NULL,
id_permission integer NOT NULL,
PRIMARY KEY (id_user,id_permission)
);
ALTER TABLE USER_PERMISSION ADD CONSTRAINT fk_user_permission FOREIGN KEY (id_user) REFERENCES users (id);
A... |
create table public.addresses
(
id int8 generated by default as identity,
city varchar(128) not null,
country varchar(128) not null,
create_at timestamp not null,
flat_number varchar(50),
region varchar(128),
status varchar(255),
street varchar(128) not null,
street_number varchar(12... |
create table tab_new
(
id number(15)
);
create index tab_new_ix on tab_new (id) parallel;
|
<reponame>goldmansachs/obevo-kata
CREATE PROCEDURE SP520(OUT MYCOUNT INTEGER) SPECIFIC SP520_32030 LANGUAGE SQL NOT DETERMINISTIC READS SQL DATA NEW SAVEPOINT LEVEL BEGIN ATOMIC DECLARE MYVAR INT;SELECT COUNT(*)INTO MYCOUNT FROM TABLE267;SELECT COUNT(*)INTO MYCOUNT FROM TABLE188;SELECT COUNT(*)INTO MYCOUNT FROM TABLE26... |
<reponame>clouserw/zamboni
DELETE FROM waffle_switch WHERE name="comm-dashboard";
|
-- see the database table Orders
SELECT *
FROM dbo.Orders;
-- 1. Which state(s) is the superstore most succesful in? Least?
--Top 10 results:
SELECT SUM(sales) AS state_sales, State
FROM dbo.Orders
GROUP BY State
ORDER BY state_sales DESC
OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;
--note here LIMIT 10 was not used.It pro... |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: May 08, 2021 at 03:19 AM
-- Server version: 5.7.24
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
DROP PROCEDURE IF EXISTS `add_contractor_activity`;
DROP FUNCTION IF EXISTS `add_contractor_activity`;
DELIMITER $$
CREATE FUNCTION `add_contractor_activity` (`name_val` VARCHAR(255))
RETURNS VARCHAR(10) DETERMINISTIC
BEGIN
DECLARE lines_count INT DEFAULT 0;
SET lines_count = (SELECT count(*) FROM contractor... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 03-Dez-2018 às 00:27
-- Versão do servidor: 10.1.32-MariaDB
-- PHP Version: 5.6.36
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*... |
<reponame>yakubauskaitemarianna/BD
USE master
GO
IF NOT EXISTS (
SELECT name
FROM sys.databases
WHERE name = 'MangaDB'
)
RETURN
GO
USE MangaDB
GO
SELECT AVG(Mark) OVER(PARTITION BY [Date]) AS AVGMark, [Date]
FROM [Views]
|
<reponame>flexsocialbox/una
SET @sName = 'bx_payment';
-- MENUS
UPDATE `sys_menu_items` SET `icon`='credit-card' WHERE `set_name`='sys_account_dashboard_manage_tools' AND `name`='payment-invoices'; |
<reponame>git-hulk/memefish<gh_stars>10-100
alter table foo set on delete no action |
SELECT
CAST(a AS NVARCHAR(20)) AS [a1],
CAST(b AS VARCHAR(10)) AS [b1],
CAST(c AS CHAR(4)) AS [c1],
CAST(d AS TINYTEXT) AS [d1],
CAST(e AS MEDIUMTEXT) AS [e1],
CAST(f AS LONGTEXT) AS [f1],
CAST(g AS CLOB(400)) AS [g1],
CAST(h AS DOUBLE PRECISION) AS [h1],
CAST(i AS DOUBLE) AS [i1],
CAST(j AS FLOAT) ... |
/*
No Matching Group in stagingDistributionGroup (based on ExternalDirectoryObjectID)
and SourceOrganization
Needs to be Deleted From Target Organization
Needs to be Deleted From historyDistributionGroup after processing
Dynamic Replacement of SourceOrganizations value needed
*/
INSERT INTO qSDi... |
<gh_stars>10-100
/*
* The Flyway tool applies this migration to create the database.
*
* Follow this style guide https://about.gitlab.com/handbook/business-ops/data-team/platform/sql-style-guide/
* use VARCHAR(63) for names in organization and schema
*
* Copy a version of this comment into the next migration
*
... |
select * from vitalsfirstday |
<filename>w/maintenance/mssql/archives/patch-content.sql
--
-- The content table represents content objects. It's primary purpose is to provide the necessary
-- meta-data for loading and interpreting a serialized data blob to create a content object.
--
CREATE TABLE /*_*/content (
-- ID of the content object
conte... |
DROP DATABASE restaurant_users;
CREATE DATABASE restaurant_users;
USE restaurant_users;
CREATE TABLE role
(
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
rolename enum ('USER', 'ADMIN')
);
CREATE TABLE address
(
id INT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
street VARCHAR(128... |
DROP TABLE IF EXISTS rating;
DROP TABLE IF EXISTS review;
DROP TABLE IF EXISTS profile;
CREATE TABLE profile (
profileId INT UNSIGNED AUTO_INCREMENT NOT NULL,
profileName VARCHAR(32) NOT NULL,
profileEmail VARCHAR(128) NOT NULL,
profileAvatar VARCHA... |
<gh_stars>0
DROP TABLE IF EXISTS `plugin_country`;
CREATE TABLE IF NOT EXISTS `plugin_country` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`alpha_2` varchar(2) DEFAULT NULL,
`alpha_3` varchar(3) DEFAULT NULL,
`status` enum('T','F') NOT NULL DEFAULT 'T',
PRIMARY KEY (`id`),
UNIQUE KEY `alpha_2` (... |
version https://git-lfs.github.com/spec/v1
oid sha256:88a87143cf025cffa7d56d8a21e3638ee0d7354f74c49850f506c075b8908b47
size 152
|
<filename>db/query/user_question_score.sql
-- name: CreateUserQuestionScore :one
INSERT INTO user_question_score (
user_id,
question_id,
score,
is_most_recent
) VALUES (
$1, $2, $3, $4
) RETURNING *;
-- name: GetLastUserQuestionScore :one
SELECT * from user_question_score
where user_id = $1 and que... |
<gh_stars>1-10
/*
Implements the Vertica TRUNC function in MySQL
Valid formats:
- hour - To the start of the hour
- day - To the start of the day (00:00:00)
- week - To the monday in the week
- month - To the start of the month
- quarter - To the start of the quarter
- year - To the start of the year
Call... |
<filename>src/Frapid.Web/Areas/MixERP.Inventory/db/PostgreSQL/2.x/2.0/src/02.functions-and-logic/inventory.get_write_off_cost_of_goods_sold.sql
DROP FUNCTION IF EXISTS inventory.get_write_off_cost_of_goods_sold(_checkout_id bigint, _item_id integer, _unit_id integer, _quantity integer);
CREATE FUNCTION inventory.ge... |
<filename>src/main/resources/db/migration/V2_20200911__comment_add_images.sql
alter table comment add column images varchar(5000) not null after top; |
<reponame>kevin-at-datical/liquibase-test-harness
-- Firebird 3 has limitation on column name length - 30 chars
create table snapshot_test_table (int_column int, varchar_column varchar(10)) |
<reponame>muntaza/catatan_openaset_balangan
CREATE OR REPLACE VIEW view_buku_inventaris_108_awayan AS
SELECT
*
FROM
view_buku_inventaris_108_kabupaten
WHERE
1 = 1 AND
id_skpd = 34;
GRANT ALL PRIVILEGES ON view_buku_inventaris_108_awayan TO lap_awayan;
REVOKE INSERT, UPDATE, DELETE ON view_buku_inventaris_108_awaya... |
<reponame>PoignantWizard/UsefulSqlQueries
-- Add a column that increments it's value when the value in another column changes
select dense_rank() over (
order by something
) as Increment
,*
from Example; |
-- fetch types
SELECT
nsp.nspname, t.typtype, t.typname, format_type(t.oid, -1) AS type_sqlname,
obj_description(t.oid, 'pg_type') AS comment, t.typdefault,
-- domain attributes
t.typnotnull,
base_type_nsp.nspname AS basetype_nspname, base_... |
CREATE TABLE INTREQPRES (
ID VARCHAR(45),
REQ_ID VARCHAR(45),
STATUS VARCHAR(255),
COMMENT VARCHAR(1000),
CREATED_BY VARCHAR(45),
CREATENAME VARCHAR(100),
CREATED_AT TIMESTAMP,
UPDATED_BY VARCHAR(45),
UPDATENAME VARCHAR(100),
UPDATED_AT TIMESTAMP
)
|
create table cliente (
id bigint not null auto_increment,
nome varchar(60) not null,
email varchar(255) not null,
telefone varchar(20) not null,
primary key(id)
); |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: localhost (MySQL 5.6.38)
# Database: theangkringancms
# Generation Time: 2019-11-10 11:32:02 +0000
# **************************************... |
<reponame>sira27/bubadibako<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 05, 2020 at 06:56 AM
-- Server version: 10.1.40-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET ti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.