sql stringlengths 6 1.05M |
|---|
CREATE TABLE counties (
Id int(11) NOT NULL,
County varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
<reponame>jmagaru/nodejs-testcase-database
--
-- Table structure for table `customers`
--
DROP TABLE IF EXISTS `customers`;
CREATE TABLE `customers` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL,
`name` varchar(255) NOT NULL,
`active` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id`)
) ENGI... |
SELECT N.hacker_id, H.name
FROM (SELECT M.submission_id, M.hacker_id, M.challenge_id, M.difficulty_level, M.score
FROM (SELECT S.submission_id, S.hacker_id, S.challenge_id, S.score, C.difficulty_level
FROM Submissions S JOIN Challenges C ON S.challenge_id = C.challenge_id) as M
JOIN Difficulty D ON M.difficu... |
DROP VIEW IF EXISTS supportView;
CREATE VIEW supportView AS
select
m.id as moduleId, m.timezone as moduleTz, m.pin, m.displayKey, m.lastMessageReceivedFromModule as lastMessageReceivedFromModule, m.lastMessageSentToModule as lastMessageSentToModule,m.lastCharged,m.lastDischarged,
u.id as userId, u.timezone as userT... |
create database bdmatricula;
use database bdmatricula;
create table alumno(
codalumno serial primary key not null,
codeducando varchar(14),
codmodular varchar(7),
dni varchar(8),
apellidopaterno varchar(40),
apellidomaterno varchar(40),
primernombre varchar (40),
otrosnombres varchar(40),
sexo varchar(40),
fe... |
USE master
GO
CREATE DATABASE TableRelations
COLLATE Cyrillic_General_100_CI_AI
GO
USE TableRelations
GO
DROP TABLE Persons
GO
DROP TABLE Passports
GO
CREATE TABLE Passports (
PassportID INT IDENTITY(101, 1),
PassportNumber VARCHAR(8) NOT NULL,
CONSTRAINT PK_Passports PRIMARY KEY (PassportID)... |
<reponame>MikeNeilson/housedb
drop index housedb.location_names_lower;
create unique index location_names_lower_no_parent on housedb.locations( lower(name) ) where parent_id is null;
create unique index location_names_lower_has_parent on housedb.locations( lower(name), parent_id ) where parent_id is not null; |
<reponame>nerocui/youchatt2.0
DELETE FROM likes
WHERE id=$1
|
SET QUOTED_IDENTIFIER, ANSI_NULLS ON
GO
CREATE PROCEDURE [Link].[sp_LoadLinkFactAgentActs]
@SourceRecordId int = 1,
@LoadDateTime datetime2 = NULL
AS
BEGIN
SET NOCOUNT ON;
IF @LoadDateTime IS NULL SET @LoadDateTime = CURRENT_TIMESTAMP;
INSERT INTO [Link].[FactAgentActs]
([LinkFactAgentActsId]
,... |
DROP FUNCTION IF EXISTS me();
CREATE OR REPLACE FUNCTION me()
RETURNS SETOF user_profile
LANGUAGE 'sql'
COST 100
STABLE STRICT SECURITY DEFINER
ROWS 1000
AS $BODY$
SELECT u.name, json_agg(e.email)
FROM accounts u
INNER JOIN account_emails e
ON u.id = e.account_id
WHERE u.id = curr... |
SELECT n_nationkey, n_name
FROM nation
WHERE n_regionkey = 1
SELECT l_orderkey, l_suppkey, l_partkey
FROM lineitem
WHERE l_orderkey < l_suppkey AND l_orderkey < l_partkey AND l_partkey < l_suppkey
SELECT l_orderkey, l_partkey, l_suppkey
FROM lineitem
WHERE l_returnflag = 'R' AND l_discount < 0.04 AND l_shipmode = '... |
<filename>sql/woorim/group-by/입양-시각-구하기.sql
SELECT HOUR(DATETIME) AS HOUR, COUNT(DATETIME)
FROM ANIMAL_OUTS
WHERE HOUR(DATETIME) >= 9 AND HOUR(DATETIME) <= 19
GROUP BY HOUR(DATETIME)
ORDER BY HOUR(DATETIME);
|
SELECT
SUM(executionTime) AS totalExecutionTime,
COUNT(executionTime) AS totalOccurrences
FROM <%= from_statement %>
|
<filename>Chapter 2/file_fdw_log.sql<gh_stars>10-100
CREATE EXTENSION file_fdw ;
CREATE SERVER fileserver FOREIGN DATA WRAPPER file_fdw;
CREATE FOREIGN TABLE postgres_log
( log_time timestamp(3) with time zone,
user_name text,
database_name text,
process_id integer,
connection_from text,
session_id text,
se... |
CREATE DATABASE IF NOT EXISTS bouffe;
USE bouffe;
CREATE TABLE IF NOT EXISTS `categories` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`key` varchar(255) NOT NULL,
`needsPreparation` tinyint(1) NOT NULL,
`createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` datetime ... |
<gh_stars>10-100
/*
Spatial index
*/
-- Note: Table must have a primary key for the spatial index
CREATE SPATIAL INDEX SI_Flightline_Routes
ON Flightline(Route)
USING GEOGRAPHY_GRID
WITH (
GRIDS = ( MEDIUM, LOW, MEDIUM, HIGH ),
CELLS_PER_OBJECT = 64,
PAD_INDEX = ON
); |
<filename>src/test/resources/sql/truncate/499737bb.sql
-- file:truncate.sql ln:162 expect:true
truncate trunc_trigger_log
|
<gh_stars>10-100
-- file:enum.sql ln:107 expect:true
alter type insenum add value 'i29' before 'L2'
|
<reponame>HaoZhang95/PythonAndMachineLearning
-- 数据的准备
-- 创建一个数据库
CREATE DATABASE python_24_1 charset=utf8;
-- 使用一个数据库
USE python_24_1;
-- 显示使用的当前数据库是哪个?
SELECT DATABASE();
-- 查询当前mysql系统中所有的数据库
show DATABASES;
-- 创建students表
-- 字段有id,name,age,height,gender,cls_id,is_delete
... |
ALTER TABLE "public"."zones_stats" ADD COLUMN "total_active_addresses_weight" numeric NOT NULL DEFAULT 0;
|
ALTER CRYPTOGRAPHIC PROVIDER SecurityProvider
DISABLE;
GO
ALTER CRYPTOGRAPHIC PROVIDER SecurityProvider
FROM FILE = 'c:\SecurityProvider\SecurityProvider_v2.dll';
GO
ALTER CRYPTOGRAPHIC PROVIDER SecurityProvider
ENABLE;
GO
CREATE CRYPTOGRAPHIC PROVIDER SecurityProvider
FROM FILE = 'C:\SecurityProvider\Sec... |
drop table if exists ACT_RU_JOB cascade;
drop table if exists ACT_RU_TIMER_JOB cascade;
drop table if exists ACT_RU_SUSPENDED_JOB cascade;
drop table if exists ACT_RU_DEADLETTER_JOB cascade;
drop table if exists ACT_RU_HISTORY_JOB cascade;
drop table if exists ACT_RU_EXTERNAL_JOB cascade; |
-- @author prabhd
-- @created 2014-04-01 12:00:00
-- @modified 2012-04-01 12:00:00
-- @tags dml MPP-21090 ORCA
-- @optimizer_mode on
-- @description Tests for MPP-21090
\echo --start_ignore
set gp_enable_column_oriented_table=on;
\echo --end_ignore
DROP TABLE IF EXISTS mpp21090_dropcol_splitdfpt_dml_char;
CREATE TABL... |
DO
$$
BEGIN
IF register_patch('AlterUsers.sql', 'fredrikbolmsten', 'Make user fields longer', '2019-11-14') THEN
BEGIN
ALTER TABLE users ALTER COLUMN middlename TYPE varchar(100);
ALTER TABLE users ALTER COLUMN firstname TYPE varchar(100);
ALTER TABLE users ALTER COLUMN lastname TYPE varchar(100);
ALTER... |
<reponame>YoshinoriN/selfouette<gh_stars>0
CREATE TABLE event_types (
name VARCHAR(255) UNIQUE NOT NULL
) DEFAULT CHARSET=utf8mb4;
|
/*
* nestedtable_dml4.sql
* Chapter 6, Oracle10g PL/SQL Programming
* by <NAME>, <NAME> and <NAME>
*
* This script demonstrates the update of an element of a varray
* collection.
*/
SET ECHO ON
SET SERVEROUTPUT ON SIZE 1000000
-- Clean up environment.
BEGIN
FOR i IN (SELECT null
FROM addre... |
<filename>server/src/DAO/create_testdata.sql
INSERT INTO BRUKER (brukerId, brukernavn, passord) VALUES
(1, 'bruker', '<PASSWORD>ord');
INSERT INTO NYHETSSAK (saksId, overskrift, innhold, tidspunkt, bilde, kategori, viktighet, rating, brukerId) VALUES
(1, 'overskrift', 'innhold', NOW(), 'bilder/sak2.jpg', '... |
<reponame>SkillsFundingAgency/das-employerdemand-api
CREATE TABLE [dbo].[ProviderInterest]
(
[Id] UNIQUEIDENTIFIER NOT NULL,
[EmployerDemandId] UNIQUEIDENTIFIER NOT NULL,
[Ukprn] INT NOT NULL,
[Email] VARCHAR(256) NOT NULL,
[Phone] VARCHAR(50) NOT NULL,
[Website] VARCHAR(500) NULL,
[DateCr... |
-- Table: a12_task
-- DROP TABLE `a12_task`;
CREATE TABLE `timesheets`.`a12_task` (
`task_id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`project_idref` INT NOT NULL DEFAULT '0',
`name` VARCHAR( 64 ) NOT NULL DEFAULT 'new task',
`description` VARCHAR( 256 ) NOT NULL DEFAULT 'new task',
`budget` DOUBLE NOT NULL DEFAULT... |
<reponame>drorm/thishood<gh_stars>1-10
--
-- TH-399 Add statistics for groups (most popular, posted, etc)
-- persisting gathered statistics
--
-- SQL authors:
-- <NAME>
--
BEGIN;
CREATE TABLE `application_metric` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`version` bigint(20) NOT NULL,
`date_created` datetim... |
<reponame>lgcarrier/AFW
SET DEFINE OFF;
ALTER TABLE AFW_12_SCENR_NOTFC_ACTIO ADD (
CONSTRAINT AFW_12_SCENR_NOTFC_ACTIO_FK2
FOREIGN KEY (REF_STRUC_APLIC_STAT)
REFERENCES AFW_12_STRUC_APLIC (SEQNC)
ON DELETE CASCADE
ENABLE VALIDATE)
/
|
<gh_stars>1-10
INSERT INTO DARWIN_SQL (id,patchId, statement, statementHash, processTime, finishedOn, exception) VALUES (SQ_DARWIN_SQL.nextval,?,?,?,?,?,?); |
CREATE TYPE ManagerType
AS TABLE
(man_name varchar(40) unique, numClosed int);
GO
CREATE or alter function unemployedManagers (@closedManagers ManagerType readonly)
RETURNS @unemployedMan table (manName varchar(40))
AS
BEGIN
declare @manager varchar(40);
declare c1 cursor for (select man_name fro... |
<reponame>Shuttl-Tech/antlr_psql
-- file:numeric_big.sql ln:409 expect:true
INSERT INTO num_exp_sub VALUES (9,3,'60302029489319384367663884408140620960.579121510463908536949319740718313056012428610913035436094426052455317202572532526837801578314547657284027309816572162834101599684802875042077065176191924681630085444159... |
-- 2020-03-25T09:23:03.911Z
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
UPDATE AD_Process SET Classname='de.metas.banking.process.C_BankStatement_ReconcileWithSinglePayment', Value='C_BankStatement_ReconcileWithSinglePayment',Updated=TO_TIMESTAMP('2020-03-25 11:23:03','YYYY-MM-DD HH24:MI:SS'),Upda... |
<filename>blog-2021-06 indexes/SampleScripts/ActiveFlag/03-index-too-big.sql<gh_stars>1-10
-- Taking out the date-only index, leaving the IsActive+Date index
ALTER INDEX IX_LastLoginDate ON dbo.Customers DISABLE;
GO
-- This time we're not filtering out the invalid records
DECLARE @MaxLoginDate DATETIME2 = DATEADD... |
<filename>Task/FizzBuzz/SQL/fizzbuzz-2.sql
SELECT nvl(decode(MOD(level,3),0,'Fizz')||decode(MOD(level,5),0,'Buzz'),level)
FROM dual
CONNECT BY level<=100;
|
<reponame>jiangnanwoniu/XCLCMS_asp.net<gh_stars>0
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO
CREATE VIEW [dbo].[v_Comments] AS
SELECT
a.*,
b.MerchantName,
c.MerchantAppName
FROM dbo.Comments AS a WITH(NOLOCK)
INNER JOIN dbo.Merchant AS b WITH(NOLOCK) ON a.FK_MerchantID=b.MerchantID
LEFT JOIN dbo.MerchantApp A... |
INSERT INTO `m_permission` (`grouping`, `code`, `entity_name`, `action_name`, `can_maker_checker`) VALUES
('portfolio', 'FORECLOSURE_LOAN', 'LOAN', 'FORECLOSURE', 0),
('portfolio', 'FORECLOSURE_LOAN_CHECKER', 'LOAN', 'FORECLOSURE_CHECKER', 0);
ALTER TABLE `m_loan`
ADD COLUMN `loan_sub_status_id` SMALLINT(5) NULL D... |
INSERT INTO area VALUES ('1', '东城区', '110101', '110100');
INSERT INTO area VALUES ('2', '西城区', '110102', '110100');
INSERT INTO area VALUES ('3', '朝阳区', '110105', '110100');
INSERT INTO area VALUES ('4', '丰台区', '110106', '110100');
INSERT INTO area VALUES ('5', '石景山区', '110107', '110100');
INSERT INTO area VALUES... |
<gh_stars>1-10
-- Deploy ggircs-portal:tables/connect_session to pg
-- requires: schema_ggircs_portal_private
begin;
create table ggircs_portal_private.connect_session (
sid varchar(4093) not null collate "default",
sess json not null,
expire timestamp(6) not null
)
with (oids=false);
alter table ggircs_portal... |
<reponame>con-tools/con-tools-model<filename>src/main/resources/schema-06.sql
ALTER TABLE `timeslot_hosts` ADD COLUMN `name` VARCHAR(255) DEFAULT NULL COMMENT 'alternative name for the host to display on the event if the user name is not appropriate';
UPDATE `system_settings` SET `value` = '6' WHERE `name` = 'data-ver... |
INSERT INTO `permissions` (`id`, `module`, `controller`, `action`, `description`) VALUES
(49, 'Admin\\Controller', 'BannersSlideController', 'index', 'Банери'),
(50, 'Admin\\Controller', 'BannersSlideController', 'create', 'Банери създаване'),
(51, 'Admin\\Controller', 'BannersSlideController', 'edit', 'Банери промяна'... |
<gh_stars>1-10
DROP TABLE employee;
DROP TABLE employee PURGE;
|
<filename>seeds.sql
INSERT INTO Interests(name, createdAt, updatedAt)
VALUES("Arts","2020-01-01 10:10:10", "2020-01-01 10:10:10");
INSERT INTO Interests(name, createdAt, updatedAt)
VALUES("Food", "2020-01-01 10:10:10", "2020-01-01 10:10:10");
INSERT INTO Interests(name, createdAt, updatedAt)
VALUES("Nature", "2020-01-0... |
CREATE OR REPLACE TYPE race FORCE IS OBJECT
(
name VARCHAR2(500),
results driver_list,
driver_names driver_name_map,
CONSTRUCTOR FUNCTION race(SELF IN OUT NOCOPY race, new_name VARCHAR2, new_driver_table driver_table)
RETURN SELF AS RESULT,
MEMBER FUNCTION position(info_driver driver)
RETURN ... |
### Schema
DROP DATABASE IF EXISTS burgers_db;
CREATE DATABASE burgers_db;
USE burgers_db;
CREATE TABLE `burgers`
(
`id` INTEGER NOT NULL AUTO_INCREMENT,
`burger_name` VARCHAR(255) NOT NULL,
`is_ready` BOOLEAN DEFAULT false,
`is_served` BOOLEAN DEFAULT false,
PRIMARY KEY (id)
);
|
INSERT INTO burgers (burger_name) VALUES ('Chicken Burger');
INSERT INTO burgers (burger_name) VALUES ('Chicken Avacado');
INSERT INTO burgers (burger_name, devoured) VALUES ('Cheese Burger', true);
INSERT INTO burgers (burger_name, devoured) VALUES ('Double Beef with Bacon and Cheese', true);
|
<gh_stars>0
/*
* Copyright (c) 2020 <NAME>
* All rights reserved.
*/
CREATE TABLE IF NOT EXISTS `errortexts_games`
(
`error_id` INT(11) NOT NULL,
`game_id` INT(11) NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`modified_at` TIMESTAMP NULL,
PRIMARY KEY (`error_i... |
/*
Warnings:
- You are about to drop the column `updated_at` on the `users` table. All the data in the column will be lost.
*/
-- AlterTable
CREATE SEQUENCE "attribute_name_id_seq";
ALTER TABLE "attribute_name" ALTER COLUMN "id" SET DEFAULT nextval('attribute_name_id_seq');
ALTER SEQUENCE "attribute_name_id_seq" ... |
insert into pluginversion(ID,pluginname,pluginkey,pluginversion,CREATED) values ('10075','Atlassian JIRA - Plugins - Shared Application Access Layer (SAL) Plugin','com.atlassian.jira.ext.rpc','4.4.1','2011-09-16 18:40:51');
insert into pluginversion(ID,pluginname,pluginkey,pluginversion,CREATED) values ('10170','Scr... |
ALTER TABLE "Label" DROP CONSTRAINT "Label_pkey";
ALTER TABLE "Label" ADD PRIMARY KEY (batch, id1, id2, ts);
|
IF object_id('SimpleTest') IS NOT NULL
DROP TABLE SimpleTest;
CREATE TABLE SimpleTest (
Id INT PRIMARY KEY,
StringCol VARCHAR(100),
)
INSERT [SimpleTest]
(
Id,
StringCol
)
SELECT 1,'Frank'
UNION ALL
SELECT 2,'Walker'
UNION ALL
SELECT 3,'National';
ALTER TABLE SimpleTest
ENABLE CHANGE_TRA... |
<filename>migrations/2019-07-28-230442_create_tag_list/down.sql<gh_stars>1-10
drop function tag_list(_type bucket, _in set[], _ex set[], _offset int8, _limit int8) cascade; |
CREATE PROCEDURE sprockit_PrepareNewBatch.[test WHEN run THEN _internal_ManageLogs called with parameter]
AS
-- ARRANGE
DECLARE @processGroup INT = 762353746;
DECLARE @expected INT = @processGroup;
EXEC tSQLt.SpyProcedure 'sprockit._internal_UpdateMetrics'
DECLARE @actual INT = 0;
-- ACT
EXEC sprockit.PrepareNewBa... |
<reponame>trussworks/mymove<filename>migrations/app/schema/20200409151333_change_nullability_in_tariff400ng_service_area.up.sql
-- Change nullability
ALTER TABLE tariff400ng_service_areas
ALTER COLUMN service_area SET NOT NULL,
ALTER COLUMN name SET NOT NULL,
ALTER COLUMN services_schedule SET NOT NULL,
... |
<reponame>davidtme/Facil
CREATE PROCEDURE [dbo].[ProcWithMultipleNullableColumnsAndTvpParams]
@single dbo.SingleColNull READONLY,
@multi dbo.MultiColNull READONLY
AS
SELECT * FROM @multi
|
<reponame>netlify/sqlfluff<filename>test/fixtures/parser/ansi/create_table_table_comment.sql
CREATE TABLE a (
id VARCHAR(100)
)
COMMENT 'Table comment'
|
<filename>backend/de.metas.procurement.base/src/main/sql/postgresql/system/50-de.metas.procurement/5443672_sys_09628_PMM_Balance_Rebuild.sql
drop view if exists de_metas_procurement.PMM_Balance_Events_v;
create or replace view de_metas_procurement.PMM_Balance_Events_v as
--
-- QtyPromised, QtyOrdered
select
c.C_BP... |
SET DEFINE OFF;
ALTER TABLE ACT_FO_FORM_INSTANCE ADD SCOPE_ID_ VARCHAR2(255);
ALTER TABLE ACT_FO_FORM_INSTANCE ADD SCOPE_TYPE_ VARCHAR2(255);
ALTER TABLE ACT_FO_FORM_INSTANCE ADD SCOPE_DEFINITION_ID_ VARCHAR2(255);
INSERT INTO ACT_DMN_DATABASECHANGELOG (ID, AUTHOR, FILENAME, DATEEXECUTED, ORDEREXECUTED, MD5SUM, DE... |
-- @testpoint:opengauss关键字escaping(非保留),作为表空间名
--关键字不带引号,创建成功
drop tablespace if exists escaping;
CREATE TABLESPACE escaping RELATIVE LOCATION 'hdfs_tablespace/hdfs_tablespace_1';
drop tablespace escaping;
--关键字带双引号,创建成功
drop tablespace if exists "escaping";
CREATE TABLESPACE "escaping" RELATIVE LOCATION 'hdfs_tab... |
# Advanced SQL
use "telerikacademy";
# Write a SQL query to find the average salary of employees who have been hired before year 2000 incl. Round it down to the nearest integer.
select floor(avg(Salary))
from employees
where year(HireDate) <= 2000;
# Write a SQL query to find all town names that end with a vowel (a,o... |
<reponame>Shweta-21/California-population-Data-Analytics
SELECT county_name , SUM(population) as total_population, gender from pop_proj where date_year BETWEEN 2020 and 2030
GROUP BY county_name, gender
ORDER BY county_name; |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5ubuntu0.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 27, 2021 at 06:37 PM
-- Server version: 5.7.32-0ubuntu0.18.04.1
-- PHP Version: 7.2.24-0ubuntu0.18.04.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET... |
<reponame>ImMyst/Ynov-Postgresql
-- On REVOKE tous les privileges précedents et on créer un role 'readonly' en lecture seule.
DROP OWNED BY readonly;
REVOKE ALL PRIVILEGES ON SCHEMA public FROM readonly;
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM readonly;
REVOKE CONNECT ON DATABASE shows FROM readonly;
REVOKE... |
-- https://sqitch.org/docs/manual/sqitchtutorial/
-- https://postgrespro.ru/docs/postgresql/9.6/plpgsql-errors-and-messages#plpgsql-statements-assert
select * from public.t_03 limit 1;
DO $$
DECLARE
result varchar;
BEGIN
result := (select 'X');
ASSERT result = 'X';
END $$; |
CREATE PROCEDURE [dbo].[WebMasterPage_Get]
(
@MasterPageId int = -1,
@SiteId int = -1
)
AS
SET NOCOUNT ON
SELECT MasterPageId, SiteId, TemplateId, Name, PublicAccess, OwnerPageId, ManagementAccess,
ThemeId, SkinId
FROM WebMasterPage
WHERE (@MasterPageId = - 1 OR
M... |
<filename>egov/egov-ptis/src/main/resources/db/migration/main/V20160211172611__ptis_mv_for_annualdemandandcoll.sql
drop table if exists egpt_mv_annual_demand_coll;
drop table if exists egpt_mv_esuvidha_annual_coll;
CREATE TABLE egpt_mv_annual_demand_coll(
id_basic_property bigint NOT NULL,
annualTax double precision,
... |
<filename>db/seeds.sql<gh_stars>1-10
USE burger_db;
INSERT INTO burgers (name, devoured) VALUES ("Beef Burger with Cheese", false);
INSERT INTO burgers (name, devoured) VALUES ("Turkey Burger with Avocado", true);
INSERT INTO burgers (name, devoured) VALUES ("Alligator Burger with Garlic Aoli", false);
INSERT INTO bur... |
<filename>src/test/resources/sql/select/61f1e236.sql
-- file:create_view.sql ln:409 expect:true
select pg_get_viewdef('vv2', true)
|
<filename>DBADashDB/dbo/Stored Procedures/Drives_Upd.sql<gh_stars>10-100
CREATE PROC [dbo].[Drives_Upd](@Drives Drives READONLY,@InstanceID INT,@SnapshotDate DATETIME2(2))
AS
DECLARE @Ref VARCHAR(30)='Drives'
INSERT INTO dbo.DriveSnapshot(DriveID,Capacity,FreeSpace, SnapshotDate)
SELECT D.DriveID,T.Capacity,T.FreeSpac... |
CREATE DATABASE IF NOT EXISTS `booking` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `booking`;
-- MySQL dump 10.13 Distrib 8.0.22, for Linux (x86_64)
--
-- Host: 127.0.0.1 Database: booking
-- ------------------------------------------------------
--... |
PRINT 'Creating view `vwCalendar`...';
IF EXISTS(SELECT * FROM sys.views WHERE name = 'vwPaymentDate')
BEGIN
DROP VIEW dbo.vwPaymentDate
END
GO
IF EXISTS(SELECT * FROM sys.views WHERE name = 'vwMonthEndDate')
BEGIN
DROP VIEW dbo.vwMonthEndDate
END
GO
IF EXISTS(SELECT * FROM sys.views WHERE name = 'vwCalendar... |
ALTER TABLE `surveys` CHANGE `wellcometitle` `welcometitle` text CHARACTER SET utf8mb4;
ALTER TABLE `surveys` CHANGE `wellcomedesc` `welcomedesc` text CHARACTER SET utf8mb4;
ALTER TABLE `surveys` CHANGE `wellcomemedia` `welcomemedia` text CHARACTER SET utf8mb4; |
<gh_stars>1-10
ALTER TABLE application RENAME COLUMN id TO resource_id;
ALTER TABLE application RENAME CONSTRAINT application_id_nn TO application_resource_id_nn;
ALTER TABLE domain RENAME COLUMN domain_id TO branch_id;
ALTER TABLE domain RENAME CONSTRAINT domain_domain_id_nn TO domain_branch_id_nn;
ALTER TABLE sandbox... |
CREATE OR REPLACE FUNCTION update_enum_translator(enum_type varchar(40), enum_key smallint, language_code varchar(40), value text) RETURNS void AS $$
BEGIN
DELETE FROM enum_translator
WHERE enum_translator.enum_type = update_enum_translator.enum_type
AND enum_translator.enum_key = update_enum_translat... |
<filename>init/procedures/Scan/CreateScanSummary.sql
DROP PROCEDURE IF EXISTS `CreateScanSummary`;
CREATE PROCEDURE `CreateScanSummary` (_SourceID NVARCHAR(36), _ScannerSourceConfigID VARCHAR(36), _OrgID NVARCHAR(36), _ScanID NVARCHAR(100), _ScanStatus NVARCHAR(30), _ScanClosePayload MEDIUMTEXT, _ParentJobID NVARCHAR(... |
<reponame>yelicoder/spring-integration-getting-started
CREATE TABLE attendees
(
attendee_id integer PRIMARY KEY,
first_name varchar(30) NOT NULL,
last_name varchar(30) NOT NULL,
email varchar(80) NOT NULL UNIQUE,
phone_number varchar(20) NULL,
title varchar(40) NULL,
comp... |
-- start_ignore
create schema functionProperty_501_600;
set search_path to functionProperty_501_600;
CREATE TABLE foo (a int, b int);
INSERT INTO foo select i, i+1 from generate_series(1,10) i;
CREATE TABLE bar (c int, d int);
INSERT INTO bar select i, i+1 from generate_series(1,10) i;
-- func1 IMMUTABLE
CREATE FUN... |
--Test For strposb
set compatible_mode to 'oracle';
set datestyle to ISO,YMD;
SELECT strposb(123456, 345) "pos in str";
SELECT strposb(12345::int2, 345::int2) "pos in str";
SELECT strposb(123456::int, 345::int) "pos in str";
SELECT strposb(12345678::int8, 3456::int8) "pos in str";
SELECT strposb(12345678.910, 678.91) "... |
<filename>tsadm/db/procedures/SiteEnvGetId.sql
DROP PROCEDURE IF EXISTS SiteEnvGetId;
DELIMITER //
CREATE PROCEDURE SiteEnvGetId(
IN site_name varchar(64),
IN site_env varchar(16),
OUT siteenv_id int(10))
BEGIN
SELECT `siteenv`.`id` INTO siteenv_id
FROM `siteenv` LEFT JOIN `site`
ON `s... |
BEGIN;
UPDATE titulos_cohortes_anexos tc_ue
SET cohorte_id =
(SELECT MIN(c.id) FROM titulos_cohorte c
INNER JOIN titulos_carrera_jurisdiccional cj ON c.carrera_jurisdiccional_id = cj.id
WHERE
c.anio = (SELECT anio FROM titulos_cohorte c2 WHERE c2.id = tc_ue.cohorte_id)
AND cj.carrera_id = (SELECT cj2.carre... |
<reponame>opengauss-mirror/Yat
-- @testpoint: opengauss关键字Invoker(非保留),作为游标名,部分测试点合理报错
--前置条件
drop table if exists explain_test cascade;
create table explain_test(cid int,fid int);
--关键字不带引号-成功
start transaction;
cursor Invoker for select * from explain_test order by 1;
close Invoker;
end;
--关键字带双引号-成功
start transac... |
<reponame>lukesimon32/Employee-Management-Tracker
SELECT *
FROM employee;
SELECT department, COUNT(id) AS number_department
FROM course_names
GROUP BY department;
SELECT department, SUM(total_enrolled) AS sum_enrolled
FROM course_names
GROUP BY department;
|
-- This file is created by the IHP Schema Designer.
-- When you generate a new migration, all changes in this file will be copied into your migration.
--
-- Use http://localhost:8001/NewMigration or `new-migration` to generate a new migration.
--
-- Learn more about migrations: https://ihp.digitallyinduced.com/Guide/da... |
select * from CaseTypes
select * from CaseTypeGroups |
<reponame>yadiabdillah/tes_akebono_app
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Jun 12, 2021 at 09:15 AM
-- Server version: 10.3.16-MariaDB
-- PHP Version: 7.1.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Creato il: Feb 13, 2018 alle 00:56
-- Versione del server: 10.1.28-MariaDB
-- Versione PHP: 7.1.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE USER t_sa WITH PASSWORD '<PASSWORD>';
ALTER USER t_sa WITH LOGIN;
CREATE DATABASE t_sa OWNER t_sa;
|
USE [VipunenTK_SA]
GO
Drop table [VipunenTK_DW].[dbo].[sa_4_7_Tutkinnon_suorittaneiden_aiempi_koulutus]
Select top 0 * into [VipunenTK_DW].[dbo].[sa_4_7_Tutkinnon_suorittaneiden_aiempi_koulutus]
FROM VipunenTK_SA.[dbo].[v_sa_4_7_Tutkinnon_suorittaneiden_aiempi_koulutus]
GO |
CREATE PROCEDURE [spuUsuarioSenha]
@Usuario_Id INT,
@Usuario_Senha VARCHAR(50)
AS
BEGIN
SELECT @Usuario_Id AS Usuario_Id,
@Usuario_Senha AS Usuario_Senha
INTO #TabParametros
UPDATE Usuario
SET Usuario_Senha = b.Usuario_Senha
FROM Usuario a
JOIN #TabParametros b ON a... |
<gh_stars>1-10
select * from playermatch where matchid = $this->matchid
SELECT * FROM tmext " . $where . " ORDER BY " . $sort . " " . $order . " limit
select count(playerid) from playermatch where matchid = p.matchid) = 3";
SELECT * FROM player WHERE playerid = $id
select count(playerid) from playermatch where matchid... |
<reponame>daehyeonhong/JSP
show databases;
show tables;
create table member(
id int not null auto_increment,
name varchar(20),
passwd varchar(20),
primary key(id)
)default charset=utf8;
select * from member;
insert into member(name, passwd) values('hong','<PASSWORD>');
insert into member(name, passwd) values('kim','<P... |
<gh_stars>1-10
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE OR ALTER PROCEDURE [dbo].[sp_dba_RemoveUser] @SpecificName VARCHAR(75)
AS
PRINT ''
PRINT '-- *** Remove User/Login Tool ***'
PRINT '-- Verion 1.2'
PRINT '--'
PRINT '-- This code will generate the t-sql code needed to... |
<gh_stars>1-10
CREATE SCHEMA auth;
ALTER TABLE login_profile SET SCHEMA auth;
ALTER TABLE profile SET SCHEMA auth;
ALTER TABLE login SET SCHEMA auth;
CREATE SCHEMA ketchup;
ALTER TABLE "user" SET SCHEMA ketchup;
ALTER TABLE ketchup SET SCHEMA ketchup;
ALTER TABLE repository SET SCHEMA ketchup;
|
-- file:copy2.sql ln:264 expect:true
INSERT INTO vistest VALUES ('z')
|
<reponame>jokiefer/Mapbender2.8
INSERT INTO gui (gui_id, gui_name, gui_description, gui_public) VALUES ('ol','ol','GUI with tab, search modules',1);
INSERT INTO gui_element (fkey_gui_id, e_id, e_pos, e_public, e_comment, e_title, e_element,e_src, e_attributes, e_left, e_top, e_width, e_height, e_z_index, e_more_styles,... |
delete from specimen_material_in_item;
delete from specimen_material_in;
delete from specimen_material_out_item;
delete from specimen_material_out;
delete from specimen_material_register_item;
delete from specimen_material_register;
delete from ENTRUST_EXPERT_OPINION;
delete from entrust_abstracts;
delete from entrust... |
startcode MySql_TimeoutCreateSql
set @tableName = concat(@tablePrefix, 'TimeoutData');
set @createTable = concat('
create table if not exists ', @tableName, '(
Id varchar(38) not null,
Destination varchar(1024),
SagaId varchar(38),
State longblob,
Time datetime,
... |
-- Populate persons table
insert into "person" (login, password, employee_id)
values ('user', 'secret', 1),
('admin', 'qwerty', 1),
('savelev', '123', 2); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.