sql stringlengths 6 1.05M |
|---|
<reponame>Crstal/spring-analysis<filename>spring-jdbc/src/test/resources/org/springframework/jdbc/datasource/init/test-data-with-comments-and-leading-tabs.sql<gh_stars>1-10
-- The next comment line starts with a tab.
-- x, y, z...
insert into customer (id, name)
values (1, '<NAME>');
-- This is also a comment w... |
<gh_stars>100-1000
-- Copyright 2018 <NAME>. All rights reserved. More info at http://tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms & conditions.
SELECT
hladdr
-- , blsiz
-- , nxt_hash
-- , prv_hash
-- , nxt_repl
-- , prv_repl
, flag
, rflag
, sflag
, lru... |
create database if not exists test_db;
use test_db;
drop table if exists test_suspend_and_resume_collection;
create table if not exists test_suspend_and_resume_collection(id int primary key auto_increment, name varchar(10), col_a float, col_b int, column1 varchar(256));
insert into test_suspend_and_resume_collection v... |
-- Validate that the mirror replay process forwards fsync requests for
-- append-optimized tables to the checkpointer. This is done using a
-- fault point that is reached only in a checkpointer process. Note
-- that checkpointer process runs on primary as well as mirror. We
-- are concerned with the checkpointer run... |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.1.113_3306
Source Server Version : 50541
Source Host : 192.168.1.113:3306
Source Database : nkrm
Target Server Type : MYSQL
Target Server Version : 50541
File Encoding : 65001
Date: 2015-04-07 14:56:51
*/
SET FO... |
<reponame>Zhaojia2019/cubrid-testcases
--TEST: [Analytic Functions] Analytic function cannot be used in a statement which has a group by clause.
drop table if exists foo;
create table foo(a int, b int);
insert into foo values(1, 10);
insert into foo values(1, 12);
insert into foo values(1, 24);
insert into foo value... |
CREATE TYPE parts_tt AS TABLE(
part_id INT NULL
,is_edited VARCHAR(1) NULL
,part_type_id INT NULL
,part_code CHAR(10) NULL
,part_desc NVARCHAR(100) NULL) |
<reponame>saurabhshukla01/callupon_Laravel
-- Adminer 4.7.3 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `pt_petitions`;
CREATE TABLE `pt_petitions` (
`petition_id` int(11) NOT NULL AUTO_INCREMENT,
`petition_uid` char... |
<reponame>fossabot/cli-4
CREATE TABLE IF NOT EXISTS post (
id SERIAL NOT NULL,
topic_id INTEGER NOT NULL,
author_alias_id INTEGER NOT NULL,
content TEXT NOT NULL,
created TIMESTAMP WITH TIME ZONE NOT NU... |
<reponame>israelvainberg/Zooalist<filename>db.sql
-- MySQL dump 10.13 Distrib 5.7.23, for Win64 (x86_64)
--
-- Host: localhost Database: zooalist
-- ------------------------------------------------------
-- Server version 5.7.23
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CH... |
<reponame>machinelady/save-a-selfie
create database saveaselfie;
create table users
(
name text not null primary key
);
create table photos
(
id serial not null primary key,
-- GPS data
latitude numeric not null,
longitude numeric not null,
image text not null,
thumbnail text not null,
uploadedby text,
co... |
<reponame>empiricaldataman/DB2LS<gh_stars>1-10
USE [msdb]
GO
/****** Object: Job [PRD_ALL_C3_01D_LoadStatistics_OLTP] Script Date: 10/11/2017 1:18:52 PM ******/
BEGIN TRANSACTION
DECLARE @ReturnCode INT
SELECT @ReturnCode = 0
/****** Object: JobCategory [[Uncategorized (Local)]] Script Date: 10/11/2017 1:18:52... |
<filename>DB_stuff/Fill_DB_data.sql
USE dispositivos;
INSERT INTO parametro(id, umbralUp1, umbralDown1) VALUES (1, 1, 1);
INSERT INTO parametro(id, umbralUp1, umbralDown1) VALUES (2, 2, 2);
INSERT INTO parametro(id, umbralUp1, umbralDown1) VALUES (3, 3, 3);
INSERT INTO parametro(id, umbralUp1, umbralDown1) VALUES (4, ... |
/*-----------------------------------------------------------------------------------------------
NAME: StatisticsLastUpdate.sql
MODIFIED BY: <NAME>
EMAIL: <EMAIL>
DESCRIPTION: Displays the date when the statistics were last updated on a table.
----------------------------------------------------------... |
<gh_stars>1-10
SELECT [EmployeeID],
[FirstName],
[LastName],
[Salary],
DENSE_RANK() OVER (
PARTITION BY [Salary]
ORDER BY [EmployeeID]) AS [Rank]
FROM [Employees]
WHERE [Salary] >= 10000 AND [Salary] <= 50000
ORDER BY [Salary] DESC |
-- avtrans.test
--
-- execsql {SELECT md5sum(x,y,z) FROM t2}
SELECT md5sum(x,y,z) FROM t2 |
-- file:plancache.sql ln:110 expect:true
prepare p1 as select f1 from abc
|
-- Last (probably) bunch of fixes for Worgen starting zone.
-- By Nanaki for Arkania.
-- RequestItemsText.
UPDATE `quest_template` SET `RequestItemsText`="It is always good to see you, $Gbrother:sister;." WHERE `entry`=24593;
UPDATE `quest_template` SET `RequestItemsText`="Careful, $N." WHERE `entry`=24592;
UPDATE `qu... |
<reponame>dwiharis/Skripsi_WEBGIS<filename>gis_nyamuk.sql
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 14, 2020 at 11:40 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START ... |
<filename>AuroraAppCode/senior.sql
create database senior
use senior
go
create table cameraInfo (
id int PRIMARY KEY IDENTITY(0,1),
roomNumber varchar(20),
department varchar(255),
ip varchar(20)
);
create table headsInfo(
name varchar(255),
email varchar(255) UNIQUE,
pass varchar(255),
department v... |
<reponame>DevAVIJIT7/minerva
DROP TRIGGER IF EXISTS on_update_resources_trigger ON resources;
CREATE OR REPLACE FUNCTION update_resources() RETURNS TRIGGER AS $$
BEGIN
UPDATE resources SET
tsv_text = to_tsvector('english'::regconfig, COALESCE(NEW.name, ''::character varying)::text) || to_tsvector('english'::regco... |
#standardSQL
# Pages that use Feature-Policy (based on Blink features)
SELECT DISTINCT
client,
feature,
num_urls,
total_urls,
pct_urls AS pct_urls
FROM
`httparchive.blink_features.usage`
WHERE
yyyymmdd = '20210701' AND
feature LIKE '%FeaturePolicy%'
ORDER BY
feature,
client
# relevant Blink featur... |
DELETE FROM fledge.statistics WHERE key IN (
'NORTH_READINGS_TO_PI',
'NORTH_STATISTICS_TO_PI',
'NORTH_READINGS_TO_HTTP',
'North Readings to PI',
'North Statistics to PI',
'North Readings to OCS'
) AND value = 0;
|
<reponame>ecktom/steampipe-mod-aws-compliance
select
-- Required Columns
arn as resource,
case
when encrypted then 'ok'
else 'alarm'
end as status,
case
when encrypted then volume_id || ' encrypted.'
else volume_id || ' not encrypted.'
end as reason,
-- Additional Dimensions
region,
ac... |
CREATE TABLE IF NOT EXISTS people
(
id BIGSERIAL PRIMARY KEY,
person JSONB NOT NULL
);
|
-- @testpoint:opengauss关键字select(保留),作为游标名
--前置条件
drop table if exists select_test cascade;
create table select_test(cid int,fid int);
--关键字不带引号-失败
start transaction;
cursor select for select * from select_test order by 1;
close select;
end;
--关键字带双引号-成功
start transaction;
cursor "select" for select * from select_t... |
SELECT n.original_lead_received_date, n.original_lead_received_month,
n.original_lead_received_day, n.original_lead_received_hour,
n.state, n.is_transactional_optin, n.is_sms_marketing_optin, n.is_originated, n.customer_id,
if(lci.optout_account_email='false' or lci.optout_account_email is NULL,1,0) as is_email_transac... |
<reponame>gossi/trixionary<gh_stars>0
INSERT INTO `kk_trixionary_sport`
(`title`, `slug`, `athlete_label`,
`object_slug`, `object_label`, `object_plural_label`,
`skill_slug`, `skill_label`, `skill_plural_label`, `skill_picture_url`,
`group_slug`, `group_label`, `group_plural_label`,
`transitions_slug`, `transiti... |
CREATE TABLE [CharityData].[aoo_ref]
(
[aootype] [varchar](10) NOT NULL,
[aookey] [int] NOT NULL,
[aooname] [varchar](255) NOT NULL,
[aoosort] [varchar](100) NOT NULL,
[welsh] [varchar](1) NOT NULL,
[master] [int] NULL
)
|
<reponame>ucdavis/AD419
CREATE VIEW [dbo].[AdminClusteredDepartmentsV]
AS
SELECT TOP (100) PERCENT t1.AdminClusterNo, t2.Name AS AdminClusterName, t1.HomeDeptNo, t1.Name, t1.Abbreviation, t1.SchoolCode, t1.MailCode,
t1.HomeOrgUnitCode, t1.LastActionDate
FROM dbo.Departments ... |
<reponame>Bishownath/AirwayBill
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 24, 2021 at 09:03 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY ASC,
username TEXT
);
|
USE hr
GO
-- PODPUNKT 1 --
SELECT emp.employee_id, emp.first_name, emp.last_name, emp.hire_date, jo_hi.start_date,
jo_hi.end_date
FROM employees emp, job_history jo_hi
WHERE emp.employee_id = jo_hi.employee_id
-- PODPUNKT 1.1 --
SELECT emp.employee_id, emp.first_name, emp.last_name, jh.end_date
FROM employees ... |
DELETE FROM Product
INSERT INTO Product (Id ,Name, [Description], Price) VALUES (1, 'Intel i7 3.8Ghz', 'Description for Intel i7 3.8Ghz', 200)
INSERT INTO Product (Id ,Name, [Description], Price) VALUES (2, 'Intel i5 3.2Ghz', 'Description for Intel i5 3.2Ghz', 150)
INSERT INTO Product (Id ,Name, [Description], Price... |
<filename>sql/V2__create_users_and_roles.up.sql
BEGIN;
CREATE TABLE orgs1 (
id SERIAL PRIMARY KEY,
name VARCHAR (200) NOT NULL,
industry VARCHAR (200) NOT NULL,
status VARCHAR (20) NOT NULL,
created_at TIMESTAMP with time zone DEFAULT now() NOT NULL,
updated_at TIMESTAMP with time zone NOT NULL
... |
<reponame>peterrobert/SQL_SQLZOO
SELECT COUNT(name) FROM world WHERE area > 1000000 |
<reponame>davidnarum/bebras-platform<filename>dbv_data/revisions/428/translations.sql
CREATE TABLE `translations` (
`ID` int(11) NOT NULL AUTO_INCREMENT,
`languageID` int(11) NOT NULL,
`category` varchar(50) CHARACTER SET utf8 NOT NULL,
`key` varchar(50) CHARACTER SET utf8 NOT NULL,
`translation` text CHARACT... |
<gh_stars>1-10
DROP USER IF EXISTS 'blogapi'@'localhost';
CREATE USER IF NOT EXISTS 'blogapi'@'localhost'
IDENTIFIED BY 'blogapibytega4321';
GRANT ALL PRIVILEGES ON blogapi.* TO 'blogapi'@'localhost';
FLUSH PRIVILEGES; |
<filename>049-SQLDedicatedPoolPerf/Coach/Solutions/Dataset - Scripts/1_DimDate.sql
RENAME OBJECT [DIMDATE] TO [DIMDATE_OLD]
CREATE TABLE [DBO].[DIMDATE]
(
[DATEKEY] [INT] NOT NULL,
[FULLDATEALTERNATEKEY] [DATE] NOT NULL,
[DAYNUMBEROFWEEK] [TINYINT] NOT NULL,
[ENGLISHDAYNAMEOFWEEK] [NVARCHAR](10) NOT NULL,
[SPAN... |
<reponame>andrewMacmurray/realworld-hasura
CREATE VIEW user_profile AS
SELECT id AS user_id, email, username FROM users;
|
-- 14.04.2016 15:11
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process_Para (AD_Client_ID,AD_Element_ID,AD_Org_ID,AD_Process_ID,AD_Process_Para_ID,AD_Reference_ID,AD_Reference_Value_ID,ColumnName,Created,CreatedBy,EntityType,FieldLength,IsActive,IsAutocomplete,IsCentrallyMaintained... |
CREATE FUNCTION `func_drawdown_update`(fund_code VARCHAR(200),nav_date_ltest Date) RETURNS decimal(8,4)
BEGIN
DECLARE mdd real; # 定义最大回撤
DECLARE high real; # 前期最高点
DECLARE temp_mdd real;
DECLARE nav_curr DOUBLE;
DECLARE date_curr date;
DECLARE existing_mdd real;
-- 定义游标
DECLARE cur CURSOR FOR SELECT nav_acc, nav_date... |
-- SPDX-License-Identifier: Apache-2.0
-- Licensed to the Ed-Fi Alliance under one or more agreements.
-- The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
-- See the LICENSE and NOTICES files in the project root for more information.
PRINT N'Creating primary key [InterventionStaff_PK... |
CREATE TABLE /*TABLE_PREFIX*/t_useronline (
userid VARCHAR(15) NOT NULL,
timestamp TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
PRIMARY KEY (userid)
);
|
CREATE TABLE [dbo].[TStorage]
(
--From MergedXSDs XSD
--From 'genericRailML' Namespace
[TStorageId] SMALLINT NOT NULL,
[MaximumCurrentCharging] DECIMAL(18, 6) NOT NULL,
[MaximumCurrentDischarging] DECIMAL(18, 6) NOT NULL,
[MaximumPowerCharging] DECIMAL(18, 6) NOT NULL,
[MaximumPowerDischarging] DEC... |
<filename>install/spcmf.sql
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- 数据库: `thinkcmfx`
--
-- --------------------------------------------------------
--
-- 表的结构 `sp_ad`
--
CREATE TABLE `sp_ad` (
`ad_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '广告id',
`ad_name` varchar(255) NOT NULL,
`ad_... |
select
services.service,
services.addon,
services.addon_name,
apps.app,
apps.name as app_name,
spaces.name as space_name,
organizations.name as org_name,
services.plan,
services.plan_name,
services.price,
services.foreign_key,
services.created,
services.updated,
services.deleted,
service_a... |
<filename>runner/src/main/resources/quartz/paused_trigger_grps.sql
create table qrtz_paused_trigger_grps (
sched_name varchar(120) not null,
trigger_group varchar(200) not null,
primary key (sched_name,trigger_group)
)
|
<filename>frontend/web/athems/paypal-rest/db_tables.sql
CREATE TABLE IF NOT EXISTS `my_orders` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`transaction_id` varchar(60) NOT NULL,
`transaction_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`transaction_currency` varchar(4) NOT NULL,
`transaction_amount`... |
-- phpMyAdmin SQL Dump
-- version 4.0.8
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 17, 2015 at 11:00 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.6.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT *... |
/**
* @author <NAME> - 02.09.2021
*/
SELECT name FROM employee
ORDER BY name ASC
|
<reponame>JerePallaskorpi/doforu
Query for finding all services with name AND with tag name
1.
User search for "ilmanvaihto"
2.
Save "ilmanvaihto" and timestamp to "search -table"
Save "ilmanvaihto" to "search_tag -table" ( if search.name does not exist, create new, if search exists THEN ++amount )
3.
Query ... |
<filename>database/scripts/04-documentos.sql
/*
* Copyright 2021 (c) <NAME>
*
* Tabla de documentos
* URL: http://localhost/phpmyadmin/
*/
DELIMITER //
DROP TABLE IF EXISTS Documentos //
CREATE TABLE Documentos (
DocumentoID INTEGER AUTO_INCREMENT,
EmpresaID INTEGER NOT NULL,
TipoDocumento TEX... |
<filename>example/migrations/prologue.sql<gh_stars>0
SET search_path to $schema
|
CREATE DATABASE beta_ringit;
\c beta_ringit
CREATE TABLE account (id SERIAL PRIMARY KEY, name VARCHAR(255), email VARCHAR(255), password_hash VARCHAR(255));
CREATE TABLE phone_plan (id SERIAL PRIMARY KEY, company VARCHAR(255), plan VARCHAR(255), cost DECIMAL);
CREATE TABLE reccomendation (id SERIAL PRIMARY KEY, company... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Máy chủ: localhost:3306
-- Thời gian đã tạo: Th8 14, 2017 lúc 04:51 PM
-- Phiên bản máy phục vụ: 5.6.35
-- Phiên bản PHP: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
<reponame>georgeMatrix/nuestroNegocio<filename>sql/tlapalerias2.sql
/*
Navicat MySQL Data Transfer
Source Server : localhost2018
Source Server Version : 100136
Source Host : localhost:3306
Source Database : nuestronegocio
Target Server Type : MYSQL
Target Server Version : 100136
File Encodi... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Jan 01, 2019 at 06:59 AM
-- Server version: 5.7.21
-- PHP Version: 5.6.35
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 08 Apr 2021 pada 17.52
-- Versi server: 10.4.18-MariaDB
-- Versi PHP: 7.4.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
/*!40101 SET FOREIGN_KEY_CHECKS=0 */;
DROP TABLE IF EXISTS `formations`;
CREATE TABLE IF NOT EXISTS `formations` (
`id` integer NOT NULL /*!40101 AUTO_INCREMENT */,
`intitule` varchar(50) NOT NULL,
`created_at` datetime,
`updated_at` datetime,
PRIMARY KEY (`id`)
) /*!40101 AUTO_INCREMENT=1 DEFAULT CHARSET=... |
<filename>src/test/resources/fuzz3.test_1.sql
-- fuzz3.test
--
-- execsql { SELECT md5sum(a, b, c) FROM t1 }
SELECT md5sum(a, b, c) FROM t1 |
<filename>examples/schema-migration/user/2-1.sql
/*** Remove user and user_login_history tables ***/
DROP TABLE "user_login_history";
DROP TABLE "user";
|
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 03 Sie 2015, 10:37
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40... |
--
-- ***** BEGIN LICENSE BLOCK *****
-- Zimbra Collaboration Suite Server
-- Copyright (C) 2009, 2010 Zimbra, Inc.
--
-- The contents of this file are subject to the Zimbra Public License
-- Version 1.3 ("License"); you may not use this file except in
-- compliance with the License. You may obtain a copy of the Lic... |
<reponame>trussworks/mymove
-- update moves that use a bad zip3 (origin/destination) duty stations to use a different duty station
-- Joint Base Pearl Harbor Hickam -> fort bragg
UPDATE service_members SET duty_station_id = 'dca78766-e76b-4c6d-ba82-81b50ca824b9' WHERE duty_station_id = '7f397238-ca68-4417-b17f-61709e0... |
/*
SQLyog 企业版 - MySQL GUI v8.14
MySQL - 5.5.12 : Database - compass
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@... |
<reponame>giuscri/retro
DROP TABLE IF EXISTS `access_token_auth_domain`;
CREATE TABLE `access_token_auth_domain` (
`id` SERIAL NOT NULL,
`ref` TEXT NOT NULL,
`token` varchar(255) NOT NULL,
`expires_at` timestamp NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `token_UNIQUE` (`token`)
) DEFAULT CHARSET=latin1;
DR... |
<gh_stars>1-10
ALTER TABLE manuelloppgave DROP COLUMN tildeltenhetsnr; |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50719
Source Host : localhost:3306
Source Database : blog_v2
Target Server Type : MYSQL
Target Server Version : 50719
File Encoding : 65001
Date: 2019-11-17 20:25:04
*/
SET FOREIGN... |
SELECT premium_users.user_id,
premium_users.purchase_date,
premium_users.cancel_date,
months.months
FROM premium_users
CROSS JOIN months;
|
-- Support for postgresql 9.x
-- @author <NAME> (<EMAIL>)
create or replace function acs_objects_context_id_up_tr () returns trigger as '
declare
pair record;
outer_record record;
inner_record record;
security_context_root integer;
begin
if new.object_id = old.object_id
and ((... |
<reponame>LeNgocHai1/bigshop
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: 127.0.0.1:3306
-- Thời gian đã tạo: Th6 26, 2021 lúc 12:48 AM
-- Phiên bản máy phục vụ: 5.7.31
-- Phiên bản PHP: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";... |
<filename>create_user_table.sql
CREATE DATABASE IF NOT EXISTS `mpc` DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
USE `mpc`;
DROP TABLE IF EXISTS `User`;
CREATE TABLE IF NOT EXISTS `User` (
`Id` int not null auto_increment,
`Name` varchar(200) not null,
`Amt` float null,
primary key(Id)
) ENGINE=InnoDB
... |
--======================================================
--
-- Author: <NAME>
-- Usage: Script creates a procedure join_test. In order to run/test the procedure use the run.sql script that can be found in the same directory of the project.
-- Database system supported/tested: SQL Server 2016
-- URL of the project: http... |
INSERT INTO @LineDefinitions([Index], [Code], [Description], [TitleSingular], [TitlePlural], [AllowSelectiveSigning], [ViewDefaultsToForm]) VALUES
(1000, N'ManualLine', N'Making any accounting adjustment', N'Adjustment', N'Adjustments', 0, 0);
INSERT INTO @LineDefinitionEntries([Index], [HeaderIndex],[Direction], [Par... |
<gh_stars>0
--Test nested insert
create class person2(name varchar(20), age integer , gender char(1));
create class employees(empno integer, deptno integer, attr person2);
insert into employees values(1001, 10, (insert into person2 values ('xxx', 21, 'f')));
insert into employees values(1002, 20, (insert into perso... |
create or replace function v5_dashboard.completion_rate(row_count bigint, error_count bigint)
returns int as $$
declare
completion int;
begin
case
when error_count > row_count then
completion := 0;
when row_count = 0 then
completion := 100;
else
completion := floor(((row_count - error_co... |
/* Alterando a Estrutura da tabela */
/*ALTER TABLE*/
desc gafanhotos;
/* Adicionar */
alter table pessoas
add column profissao varchar(10);
select * from pessoas;
/* Deletar */
alter table pessoas
drop column profissao;
/* Adiciona depois do nome*/
alter table pessoas
add column profissao varchar(10) after nome;... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jul 25, 2018 at 04:53 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
insert into states values ('1','AC','Acre'),('2','AL','Alagoas'),('3','AP','Amapá'),('4','AM','Amazonas'),('5','BA','Bahia'),('6','CE','Ceará'),('7','DF','Distrito Federal'),('8','ES','Espírito Santo'),('9','RR','Roraima'),('10','GO','Goiás'),('11','MA','Maranhão'),('12','MT','Mato Grosso'),('13','MS','Mato Grosso do S... |
<filename>satellite-sql-orbital-characteristic-data.sql
CREATE TABLE `satellite_orbital_characteristic_data`
(
`Satellite` varchar(20) NOT NULL,
`Perihelion` varchar(20) DEFAULT NULL,
`PerihelionUnit` varchar(5) DEFAULT NULL,
`Aphelion` varchar(20) ... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 28, 2022 at 03:17 PM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.3.16
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
<gh_stars>0
CREATE DEFINER=`root`@`localhost` PROCEDURE `usp_Role_Build`(var_mydb varchar(100), var_co varchar(1000), var_dept varchar(1000), var_loc varchar(1000), var_lock int, var_exp_role int, var_exp_user int)
BEGIN
/*This proc was modified on 02-Oct-2011 to rectify the queries that create indexes only if extr... |
drop database if exists `virus_db`;
create database `virus_db`;
use `virus_db`;
create table `md5_virus_table`(
`virus_id` int not null auto_increment,
`virus_tag` varchar(50) not null unique,
`virus_name` varchar(50) not null default 'Trojan',
primary key(virus_id)
);
insert into `md5_virus_table`(`virus_t... |
CREATE TABLE [CharityImport].[extract_charity]
(
[regno] [int] NULL,
[subno] [int] NULL,
[name] [varchar](500) NULL,
[orgtype] [varchar](50) NULL,
[gd] [nvarchar](max) NULL,
[aob] [varchar](max) NULL,
[aob_defined] [int] NULL,
[nhs] [varchar](1) NOT NULL,
[ha_no] [int] NULL,
[corr] [varchar](255) NULL,
[add... |
-- First Solution
SELECT SUM([Result].Diff)
AS [SumDifference]
FROM (
SELECT DepositAmount - (
SELECT DepositAmount
FROM WizzardDeposits
AS w
WHERE w.Id = wd.Id + 1
)
AS Diff
FROM WizzardDeposits
AS wd
)
... |
WITH AggrRecord AS (
SELECT
"Api",
"DISTRICT_NO",
"LEASE_NO",
"WELL_NO",
"FIELD_CLASS"
FROM "ProductionAggr"
WHERE "Api"='42-049-32539-00-00'
), LeaseGasData AS (
SELECT
"OgLeaseCycleData"."DISTRICT_NO",
"OgLeaseCycleData"."LEASE_NO",
"OgLe... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 17-07-2019 a las 07:27:39
-- Versión del servidor: 10.3.15-MariaDB
-- Versión de PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_... |
# --- !Ups
INSERT INTO client
(
client_id,
name,
email,
timestamp_created,
timestamp_edited
)
VALUES
(
'b50dfea4-7910-4e82-9ec0-c835fdbc9f5a',
'Gravity Ltd',
'<EMAIL>',
'2004-10-20 11:30:45',
'2012-11-19 16:27:01'
),
(
'091fe75a-f52b-4bde-9f61-0c46011ea283',
'Relativity G... |
ALTER TABLE `user_roles`
ADD `alumni` BOOLEAN NOT NULL DEFAULT 0 AFTER `id`,
ADD `alumni_game_mode` TINYINT UNSIGNED AFTER `alumni`;
|
<filename>App4 - Course Manager/Setup Script.sql
USE CourseReport;
GO
CREATE PROCEDURE [dbo].[Course_GetList]
AS
SELECT
CourseId,
CourseCode,
[Description]
FROM
[dbo].[Course]
GO
CREATE PROCEDURE [dbo].[Student_GetList]
AS
SELECT
StudentId,
FirstName,
LastName
FROM
[dbo].[Student]
GO
CREAT... |
<gh_stars>1-10
-- AlterTable
ALTER TABLE "Task" ADD COLUMN "title" TEXT NOT NULL DEFAULT E'';
|
SELECT mov.id, mov.name
FROM movies mov
INNER JOIN prices pri ON mov.id_prices = pri.id
WHERE pri.value < 2; |
<filename>src/test/resources/walfault.test_39.sql
-- walfault.test
--
-- db eval {
-- PRAGMA locking_mode = exclusive;
-- PRAGMA journal_mode = WAL;
-- INSERT INTO abc VALUES(randomblob(1500));
-- }
PRAGMA locking_mode = exclusive;
PRAGMA journal_mode = WAL;
INSERT INTO abc VALUES(randomblob(1500)); |
<gh_stars>10-100
/********************************************/
-- データキャッシュ状況の情報取得 (DB 毎に取得)
/********************************************/
SELECT
GETDATE() AS DATE,
DB_NAME(database_id) AS Database_name,
OBJECT_NAME(p.object_id) AS object_name,
bd.page_type,
COUNT_BIG(*) AS [Page Count],
COUNT_... |
CREATE PROC dbo.JobStep_Get(
@InstanceID INT,
@JobID UNIQUEIDENTIFIER,
@StepID INT
)
AS
SELECT J.name,
JS.step_name,
JS.subsystem,
JS.command,
JS.cmdexec_success_code,
JS.on_success_action,
JS.on_success_step_id,
JS.on_fail_action,
JS.on_fail_step_id,
JS.database_name,
JS.database_user_name,
JS.retry_att... |
CREATE TABLE venues (name text);
ALTER TABLE venues RENAME TO arenas;
CREATE TABLE cities (name text);
RENAME TABLE cities TO locations;
|
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50553
Source Host : localhost:3306
Source Database : longfu
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2019-03-16 18:04:45
*/
SET FOREIGN_KEY_CHECKS=0;
-- --... |
/* Only when the update in 27 succeeded, drop the table that was used as its source. */
DROP TABLE ofPrivate;
/* Update version */
UPDATE ofVersion SET version = 28 WHERE name = 'openfire';
|
<reponame>ning/killbill<gh_stars>1-10
/*! SET storage_engine=INNODB */;
DROP TABLE IF EXISTS payments;
CREATE TABLE payments (
record_id int(11) unsigned NOT NULL AUTO_INCREMENT,
id char(36) NOT NULL,
account_id char(36) NOT NULL,
invoice_id char(36) NOT NULL,
payment_method_id char(36) NOT NULL,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.