sql stringlengths 6 1.05M |
|---|
<filename>3.1 - Filtered Indexes.sql
USE AdventureWorks2012;
GO
-- NOTE: Turn on actual execution plans before starting
SET STATISTICS IO ON;
SELECT ResponseId, ResponseDate, SurveyId, SalesPersonID, ProductNumber, PurchaseDate, Q1, Q2, Q3, Q4
FROM Sales.SurveyResults
WHERE Q2 IS NULL
ORDER BY ResponseI... |
create table soldiers (
id int not null primary key,
name varchar2(256) not null,
bio_short varchar2(4000),
rank_fk int not null,
constraint soldiers_fk_rank foreign key (rank_fk) references soldier_ranks( id )
); |
ALTER TYPE ketchup.repository_kind ADD VALUE 'docker';
DROP INDEX repository_repository;
CREATE UNIQUE INDEX repository_repository ON ketchup.repository(kind, name, part);
|
UPDATE Employees
SET Salary += 0.1 * Salary;
SELECT Salary
FROM Employees
|
<reponame>parmonov98/doctrine-active-record
-- MySQL dump 10.13 Distrib 5.7.17, for Linux (x86_64)
--
-- Host: localhost Database: doctrine-active-record
-- ------------------------------------------------------
-- Server version 5.7.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET... |
<reponame>Shuttl-Tech/antlr_psql<gh_stars>10-100
-- file:tsearch.sql ln:455 expect:true
SELECT ts_rewrite(to_tsquery('5 & (6 | 5)'), to_tsquery('5'), to_tsquery(''))
|
<filename>src/main/resources/db/migration/V20210827.1500__Initial_script.sql<gh_stars>0
CREATE TABLE JOB (
id uuid primary key,
status integer not null,
executor_class text not null,
data text,
request_id uuid,
created_at... |
<gh_stars>10-100
/*
* POSTGREQM - MARC-HI QUERY MANAGER
* VERSION: 3.0
* AUTHOR: <NAME>
* DATE: DECEMBER 30, 2010
* FILES:
* QM.SQL - SQL CODE TO CREATE TABLES, INDECIES, VIEWS AND SEQUENCES AND FUNCTIONS
* DESCRIPTION:
* THIS FILE CLEANS AND THEN RE-CREATES THE POSTGRESQL QUERY MANAGER TABLES
* DATABASE SC... |
<reponame>UpDownLeftDie/twitch-ws-go<filename>migration/init-postgresql.sql
CREATE TABLE oauth_token (
client_id TEXT NOT NULL,
access_token TEXT NOT NULL,
refresh_token TEXT NOT NULL,
expires_at TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT now(),
updated_at TIMESTAMP NOT NULL DEFAULT now(),
PRI... |
select ST_Length(ST_Linestring(1,1, 1,2, 2,2, 2,1)),
ST_Length(ST_Linestring(1,1, 1,4, 4,4, 4,1)),
ST_Length(ST_Linestring(1,1, 1,7, 7,7, 7,1)) from onerow;
select ST_Area(ST_Polygon(1,1, 1,2, 2,2, 2,1)),
ST_Area(ST_Polygon(1,1, 1,4, 4,4, 4,1)) from onerow;
select ST_Contains(ST_Polygon(1, 1, 1, 4, 4, 4, 4, 1), ST_Poi... |
typedef void (*LogicalDecodeBeginCB) (struct LogicalDecodingContext *ctx,
ReorderBufferTXN *txn);
|
UPDATE button SET tourn_legal = 0
WHERE
name = 'Max' OR
name = '<NAME>' OR
name = 'Huitzilopochtli' OR
name = 'Lisa' OR
name = 'Nethershadow' OR
name = 'Phuong' OR
name = '<NAME>' OR
name = 'Al-Khwarizmi' OR
name = '<NAME>' OR
name = '<NAME>' OR
name = '<NAME>' OR
name = '<NAME>' OR
name = '<N... |
--+ holdcas on;
set names utf8;
create table t( a varchar(2) charset utf8);
insert into t values ('表1');
select * from t order by 1;
drop table t;
set names iso88591;
commit;
--+ holdcas off; |
-- @testpoint: 字符串与字符串拼接,空值与空值拼接,数字与数字拼接
select concat(2,1);
select concat(null,null);
select concat('s','b');
select concat('null','b'); |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.17.32
-- Generation Time: May 01, 2018 at 02:36 AM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`id` bigint NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`token` varchar(255) DEFAULT NULL,
`leader_card_id` int DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `token` (`token`)
);
DROP TABLE IF EXISTS `room`;
CREATE TABLE `room` (
`room_id`... |
CREATE PROCEDURE dotnetnuke_dukes.dnn_EngageEmployment_spGetApplicationsForJob (
@jobId int,
@jobGroupId int,
@applicationStatusId int,
@userStatusId int,
@leadId int,
@dateFrom datetime,
@dateTo datetime,
@index int,
@pageSize int,
@fillDocumentsAndProperties bit
)
AS
... |
<reponame>AlihanE/course-bot-backend
drop table if exists steps; |
/*Mise à jour des langues dans la table f_langue*/
UPDATE f_langue SET libelle = "Anglais" WHERE langue IN (1,11,15,16,19,28,29,30,39,42);
UPDATE f_langue SET libelle = "Français" WHERE langue IN (2,3,4,6,7,13,14,17,18,40,46,49);
UPDATE f_langue SET libelle = "Instru" WHERE langue IN (5,35,41,43,44);
UPDATE f_langue SE... |
INSERT INTO public.user_n_quiz (id, status, complete_date, result, id_usr, id_quiz)
VALUES (20, 'open', null, null, 1, 1);
INSERT INTO public.user_n_quiz (id, status, complete_date, result, id_usr, id_quiz)
VALUES (10, 'complete', '2022-05-02 00:00:00.000000', '18', 1, 2);
INSERT INTO public.user_n_quiz (id, status, co... |
CREATE TABLE word.value (
word nvarchar(MAX) NOT NULL
, sentiment nvarchar(MAX) NOT NULL
, score int NOT NULL
, insert_timestamp datetime NOT NULL
) |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 10.4.17-MariaDB - mariadb.org binary distribution
-- SO del servidor: Win64
-- HeidiSQL Versión: 11.3.0.6373
-- -----------------------------------------------... |
<gh_stars>1-10
SET DEFINE OFF;
create or replace package body afw_10_dba_pkg
as
procedure index_foreign_key (pva_schem in varchar2)
is
vva_sql_comnd varchar2 (32767);
cursor cur_fk_non_index
is
select *
from (select decode (b.table_name, null, '****', null) status
... |
-- +goose Up
-- SQL in section 'Up' is executed when this migration is applied
CREATE TABLE `users` (
`id` INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
`created` DATETIME NOT NULL,
`modified` DATETIME NOT NULL,
`chat_id` INTEGER NOT NULL UNIQUE
);
-- +goose Down
-- SQL section 'Down' is executed when ... |
CREATE TABLE `tbl_dept` (
`dept_id` int(16) NOT NULL AUTO_INCREMENT,
`dept_name` varchar(128) DEFAULT NULL,
PRIMARY KEY (`dept_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
INSERT INTO `tbl_dept`(`dept_id`, `dept_name`) VALUES (1, '开发部');
INSERT INTO `tbl_dept`(`dept_id`, `dept_name`) VALUES (2, '设... |
WITH RECURSIVE c0(src, trg) AS ((SELECT edge.src, edge.src FROM edge UNION SELECT edge.trg, edge.trg FROM edge UNION SELECT s0.src, s3.trg FROM (SELECT trg as src, src as trg, label FROM edge) as s0, (SELECT trg as src, src as trg, label FROM edge) as s1, edge s2, edge s3 WHERE s0.trg = s1.src AND s1.trg = s2.src AND s... |
<gh_stars>10-100
CREATE TABLE `artists` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`alias_id` int(11) DEFAULT NULL,
`group_id` int(11) DEFAULT NULL,
`name` varchar(128) NOT NULL,
`updated_at` datetime NOT NULL,
`updater_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `fk_artists__updater_id` (`updater_id... |
-- file:alter_table.sql ln:547 expect:true
insert into atacc3 (test2) values (3)
|
-- +goose Up
ALTER TABLE nodes
DROP CONSTRAINT nodes_evm_chain_id_fkey;
ALTER TABLE nodes
ADD FOREIGN KEY (evm_chain_id) REFERENCES evm_chains(id) ON DELETE CASCADE;
--+goose Down
ALTER TABLE nodes
DROP CONSTRAINT nodes_evm_chain_id_fkey;
ALTER TABLE nodes
ADD FOREIGN KEY (evm_chain_id) REFERENCES evm_chains(id);
|
<gh_stars>1000+
-- 2018-05-18T17:08:12.923
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Process (AccessLevel,AD_Client_ID,AD_Org_ID,AD_Process_ID,AllowProcessReRun,Classname,Created,CreatedBy,EntityType,IsActive,IsApplySecuritySettings,IsBetaFunctionality,IsDirectPrint,IsOneInstance... |
USE master
GO
CREATE LOGIN [monitoring_ro]
WITH PASSWORD=N'password !',
DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF,
GO
-- to allow the ErrorLogWatcher to read the error log
CREATE USER monitoring_ro FOR login monitoring_ro
GO
GRANT EXEC ON xp_readerrorlog TO moni... |
# --- !Ups
INSERT INTO store VALUES ('s1', 'store numéro 1', 'no picture', 20, 'euro' );
INSERT INTO store VALUES ('s2', 'store numéro 2', 'no picture', 20, 'euro' );
INSERT INTO store VALUES ('s3', 'store numéro 3', 'no picture', 20, 'euro');
INSERT INTO product VALUES ('p1', 'product numéro 1', 'no picture', '11... |
CREATE TABLE REF_DB_PARAMETER
(
GLOBAL_NAME VARCHAR2(100) NOT NULL,
PARAM_NAME VARCHAR2(64) NOT NULL,
PARAM_VALUE VARCHAR2(64) NOT NULL,
ACTIVE_FLAG VARCHAR2(1) DEFAULT 'Y' NOT NULL,
DESCRIPTION VARCHAR2(400) NOT NULL,
EFFECTIVE_START_DATE_TIME DATE,
EFFECTIVE_END_DATE_TIME DATE
)
tablespa... |
/* * * * *
** -- test_001
** -- give a don from a donor to some manga and check it in the don table
** --
* * * * */
\! clear -- to clear the screen --
-- we have already the manga 'one piece'
-- we have already the donor 'hinata'
select give_a_don(
(select id_donor from USER_DONOR where name_donor ... |
<reponame>pologood/baymax<filename>baymax-test/src/main/resources/META-INF/partition/schema.sql<gh_stars>10-100
CREATE SCHEMA IF NOT EXISTS `ds_0`;
CREATE SCHEMA IF NOT EXISTS `ds_1`;
DROP TABLE IF EXISTS `ds_0`.`t_order_0`;
DROP TABLE IF EXISTS `ds_0`.`t_order_1`;
DROP TABLE IF EXISTS `ds_1`.`t_order_2`;
DROP TAB... |
create table text_tabelle
(
col_clob_1 clob not null,
col_clob_2 clob not null,
col_clob_3 clob not null,
col_clob_4 clob not null
);
create index add_clob_ix on text_tabelle (col_clob_1) domain_index "indextype is CTXSYS.CONTEXT PARAMETERS ('')";
create table text_tabelle_inline
(
col_clob_1 clob not nul... |
{% if target.type == 'bigquery' or target.type == 'snowflake' or target.type == 'redshift' %}
{% if var("product_warehouse_event_sources") %}
{% if 'segment_events_page' in var("product_warehouse_event_sources") %}
with source AS (
SELECT * FROM {{ source('segment', 'users') }}
),
renamed AS (
SELECT CONCAT('s... |
create table payment(
payment_uuid uuid not null primary key default uuid_generate_v4(),
invoice_uuid uuid not null,
payment_time timestamptz not null,
from_address text not null,
to_address text not null,
payment_amount numeric(1000, 15) not null,
created_time timestamptz not null,
upda... |
<gh_stars>1-10
create table CONNECTOR
(
id varchar(255) NOT NULL PRIMARY KEY,
processor_id varchar(255) NOT NULL,
name varchar(255) NOT NULL,
submitted_at timestamp NOT NULL,
published_at timestamp,
status varchar(255),
version ... |
<filename>liquibase-core/src/test/java/liquibase/verify/saved_state/compareGeneratedSqlWithExpectedSqlForMinimalChangesets/dropPrimaryKey/mssql.sql
-- Database: mssql
-- Change Parameter: tableName=person
DECLARE @sql [nvarchar](MAX)
SELECT @sql = N'ALTER TABLE person DROP CONSTRAINT ' + QUOTENAME([kc].[name]) FROM [sy... |
<gh_stars>1-10
INSERT INTO spark_city (id, city_name, country_code, latitude, longitude) VALUES
(1,'Monterrey','MX',25.670975,-100.309959),
(2,'Kinshasa','CD',-4.31642,15.29834),
(3,'Guangzhou','CN',23.107389,113.267616),
(4,'Kiev','UA',50.429447,30.546693),
(5,'Zhengzhou','CN',34.762501,113.653023),
(6,'Paris','FR',4... |
<reponame>domdomegg/tabula<filename>common/src/main/resources/db/migration/V40__2019-05-09_record_last_view_on_mitcircssubmission.sql
alter table mitigatingcircumstancessubmission
add column lastViewedByStudent timestamp(6),
add column lastViewedByOfficer timestamp(6);
|
<filename>Dave's Mod/Units.sql
-- Units
-- Author: Dave
-- DateCreated: 10/31/2018 10:32:57 PM
--------------------------------------------------------------
UPDATE Units SET RANGE=2 WHERE UnitType='UNIT_MACHINE_GUN';
UPDATE Units SET RANGE=3, BaseMoves=4 WHERE UnitType='UNIT_ARTILLERY';
UPDATE Units SET RANGE=2 WHERE ... |
<filename>Structured Query Language/SQL DIRF 2018.sql
SQL DIRF 2018
SELECT PCLANC.CODFORNEC, PCFORNEC.FORNECEDOR, SUM (PCLANC.VALOR) AS VLTOTAL FROM PCLANC, PCFORNEC
WHERE PCLANC.CODCONTA = 302010
AND PCLANC.CODFORNEC = PCFORNEC.CODFORNEC
--AND PCLANC.CODFORNEC = 8208
AND PCLANC.DTEMISSAO BETWEEN :DATA1 AND :DATA2
GRO... |
/*
Enter your query here.
Please append a semicolon ";" at the end of the query and enter your query in a single line to avoid error.
*/
select
round(sum(LAT_N), 2),
round(sum(LONG_W), 2)
from STATION; |
-- +migrate Up
ALTER TABLE `items`
DROP COLUMN `qualified_group_id`,
DROP COLUMN `contest_opens_at`,
DROP COLUMN `contest_closes_at`;
-- +migrate Down
ALTER TABLE `items`
ADD COLUMN `qualified_group_id` bigint(20) DEFAULT NULL
COMMENT 'group id in which "qualified" users will belong. contest_en... |
<gh_stars>0
CREATE TABLE [Tribal].[ApprenticeshipLocation](
[ApprenticeshipLocationId] [int] NOT NULL,
[ApprenticeshipId] [int] NOT NULL,
[LocationId] [int] NOT NULL,
[Radius] [int] NULL,
[RecordStatusId] [int] NOT NULL,
[AddedByApplicationId] [int] NOT NULL,
[CreatedByUserId] [nvarchar](128) NOT NULL,
[Create... |
<gh_stars>0
/* Add the channel_id to the structure in order to link them together */
UPDATE
checks.pumpstation as a
SET channel_code = b.id
, wgtype_id = b.channel_type_id
FROM
checks.channel_linemerge as b
WHERE
ST_Intersects(b.bufgeom,a.geom)
AND a.on_channel
AND NOT a.multiple_channels
;
--... |
<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50625
Source Host : localhost
Source Database : z
Target Server Type : MySQL
Target Server Version : 50625
File Encoding : utf-8
Date: 03/31/2016 01:... |
<filename>DropSchema.SqlServer/Scripts/200_DropSchemaFunctions.sql
set nocount on
print 'Dropping functions of schema: ' + '$SchemaName$'
--get the schema id by name
declare @schemaId int
set @schemaId = (select schema_id
from [sys].[schemas]
where name = '$SchemaName$')
--get the ... |
/*
This function calculates the population close to an ementiy class
and the percentage of the total population close to the amenity class
scenario_par:integer identifier of the scenario(1)
result_name:text name of the restulting variable in terms of population(pop_prox_atm)
result_name_pct:text name of the restulti... |
<reponame>dsalunga/mPortal
if exists (select * from dbo.sysobjects where id = object_id(N'[WebSite_GetCount]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
drop procedure [WebSite_GetCount]
GO
|
-- +migrate Up
DROP TABLE events;
CREATE TYPE buffer_event_device AS ENUM('unknown', 'web', 'android');
-- +migrate StatementBegin
CREATE TABLE buffer_event (
"id" SERIAL,
"time" TIMESTAMP NOT NULL DEFAULT now(),
"url" VARCHAR NOT NULL CHECK (url <> ''),
"client" VARCHAR NOT NULL CHECK (client <> ''),
"de... |
<reponame>MisterChangRay/common-mvc<filename>src/main/resources/archives/table_data/role.sql
INSERT INTO common_core.role
(
name,
enabled,
deleted
)
VALUES
(
'管理员',
1,
0
);
INSERT INTO common_core.role
(
name,
enabled,
deleted
)
VALUES
(
'财务部',
1,
0
);
INSERT INTO common_core.role
(
name,
... |
ALTER TABLE user_project_roles DROP CONSTRAINT project_roles_user_id_role_type;
ALTER TABLE user_organization_roles DROP CONSTRAINT organization_roles_user_id_role_type;
|
-- file:alter_table.sql ln:262 expect:true
CREATE TABLE tmp5 (a int, b int)
|
<reponame>Ambal/mangos<filename>sql/updates/0.10/4895_mangos_command.sql
DELETE FROM command WHERE name IN ('tele');
INSERT INTO `command` VALUES
('tele',1,'Syntax: .tele #location\r\n\r\nTeleport player to a given location.');
|
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 14, 2021 at 06:52 PM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
<gh_stars>100-1000
-- Copyright 2019 <NAME>. All rights reserved. More info at https://blog.tanelpoder.com
-- Licensed under the Apache License, Version 2.0. See LICENSE.txt for terms and conditions.
PROMPT Show PGA manager stats from V$PGASTAT
SELECT
name
, CASE WHEN unit = 'bytes' THEN ROUND(value/1048576) EL... |
<reponame>randomnoun/dmx-web
/* Each of these files start with 2 SQL statements.
* The first will succeed if the first SQL statement has been applied
* (and fail if it has not been applied)
* The second will succeed if the final SQL statement has been applied
* (and fail if it has not been applied)
*
* On ap... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 08, 2019 at 01:26 PM
-- Server version: 5.7.20
-- PHP Version: 7.1.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
<filename>server/database/grant.sql
grant all on all tables in schema public to shelter_rota_user;
grant all on all sequences in schema public to shelter_rota_user; |
<reponame>Netsensia/directorzone<filename>db.sql
ALTER TABLE `directorzone_zf2`.`companydirectory` ADD COLUMN `isaccelerator` CHAR(1) DEFAULT 'N' NULL AFTER `canusefeedcache`;
ALTER TABLE `directorzone_zf2`.`companydirectory` CHANGE `isaccelerator` `companytypeid` INT NULL;
ALTER TABLE `directorzone_zf2`.`companydirect... |
<reponame>KirkpatrickPaul/13_eat_da_burger<filename>db/schema.sql
## Schema
DROP DATABASE IF EXISTS burgers_db;
CREATE DATABASE burgers_db;
USE burgers_db;
CREATE TABLE burgers (
id INT AUTO_INCREMENT NOT NULL,
name VARCHAR(127) NOT NULL,
eaten BOOLEAN DEFAULT false,
createdAt TIMESTAMP NOT NULL,
PRIMARY KE... |
<filename>penjualan_trainee.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Mar 07, 2022 at 09:10 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;
S... |
<filename>siswa.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Waktu pembuatan: 21 Nov 2021 pada 11.21
-- Versi server: 5.6.38
-- Versi PHP: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
-- The GIN (General Inverted Index) thinks about columns that contain arrays
-- A GIN needs to know what kind of data will be in the arrays
-- arrays_ops (_text_ops for PostgreSQL 9) means that it is expecting
-- text[] (array of strings) and WHERE clauses will use array operators (like <@)
-- create table
DROP TABLE ... |
<reponame>ilyamore88/design-and-implementation-of-databases<filename>lab6/create_v_SharePrices.sql<gh_stars>0
USE ApressFinancial
GO
CREATE VIEW ShareDetails.v_SharePrices
AS
SELECT TOP(100) PERCENT ShareDetails.SharePrices.ShareId, ShareDetails.SharePrices.PriceDate, ShareDetails.SharePrices.Price, ShareDetails.v_Cur... |
<gh_stars>0
INSERT INTO `workers`
VALUES
( 1, 'root', 'root', 'root', 1, '1994-11-27', '<EMAIL>', '000000000000', 1, 1,
'7cfa3fee422d9687de56812e2f5ad18f', 'htrLUMRFyWFWUSEKZJzq2gSuhcCC5VbO9uo6SizUEey3e51iWk/04NAih8ADcKr2LobnI7jNRaqqgRTr2hqGew==',
'ROLE_SUPER_ADMIN', NULL, NULL, 1, 1 );
INSERT INTO `professions... |
-- Deploy vendproxy:create_db to mysql
BEGIN;
-- XXX Add DDLs here.
COMMIT;
|
<reponame>ViktorAleksandrov/SoftUni--CSharp-DB-Fundamentals
SELECT TOP (5)
e.EmployeeID,
e.JobTitle,
e.AddressID,
a.AddressText
FROM Employees AS e
JOIN Addresses AS a
ON a.AddressID = e.AddressID
ORDER BY a.AddressID |
CREATE DATABASE burgers_db;
use burgers_db;
CREATE TABLE burgers(
id int NOT NULL AUTO_INCREMENT,
burger_name VARCHAR(255) NOT NULL,
devoured BOOLEAN,
dt DATETIME,
PRIMARY KEY (id)
) |
DELETE FROM casesvc.caseevent WHERE category_fk = 'COMMUNAL_ESTABLISHMENT_INSTITUTION';
DELETE FROM casesvc.category WHERE category_pk = 'COMMUNAL_ESTABLISHMENT_INSTITUTION';
DELETE FROM casesvc.caseevent WHERE category_fk = 'DECEASED';
DELETE FROM casesvc.category WHERE category_pk = 'DECEASED';
DELETE FROM casesvc.... |
-- Start of generated script for 10.12.2.193-afa-AFA (afa)
-- Jul-25-2008 at 14:35:10
--#QSCOMMAND
EXPORT TO './RCC_REKBAL.ixf'
OF IXF
SELECT * FROM "AFA"."RCC_REKBAL";
--#SYNC 10;
DROP TABLE "AFA"."RCC_REKBAL";
--#SYNC 20;
CREATE TABLE "AFA"."RCC_REKBAL"
("BJEDTE" VARCHAR(8) NOT NULL,
"BSPSQN" VA... |
DROP DATABASE IF EXISTS musictrivia_db;
CREATE DATABASE musictrivia_db;
USE musictrivia_db; |
-- phpMyAdmin SQL Dump
-- version OVH
-- https://www.phpmyadmin.net/
--
-- Host: vt60918-001.privatesql:35851
-- Generation Time: Dec 14, 2020 at 03:27 PM
-- Server version: 5.6.50-log
-- PHP Version: 7.3.20
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!4... |
<gh_stars>10-100
-- file:type_sanity.sql ln:372 expect:true
SELECT p1.oid, p1.relname
FROM pg_class AS p1
WHERE p1.relnatts != (SELECT count(*) FROM pg_attribute AS p2
WHERE p2.attrelid = p1.oid AND p2.attnum > 0)
|
CREATE SCHEMA sync
AUTHORIZATION isis;
CREATE TABLE sync."StatusEntry"
(
id serial NOT NULL,
"localETag" character varying(255) NOT NULL,
"remoteETag" character varying(255) NOT NULL,
"uniqueId" character varying(255) NOT NULL,
version timestamp with time zone NOT NULL,
CONSTRAINT "StatusEntry_PK" PRIMAR... |
/* * * * * * * *
** -- test_004
** -- we have to close the project (Concerns Date)
* * * * * * * * * * */
\! clear
-- we're gonna change the date of the project
-- id_manga = 1 is for the project 'one piece'
-- we give some dons
select give_a_don(1,1,20,'don1');
select give_a_don(1,1,30... |
ALTER TABLE "admin"."sensor" DROP COLUMN "metadata";
CREATE SEQUENCE "admin"."internal_sensor_id_seq" START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1;
CREATE TABLE "admin"."internal_sensor" (
"id" integer GENERATED BY DEFAULT AS SEQUENCE "admin"."internal_sensor_id_seq" NOT NULL,
"sensor_id" chara... |
DELIMITER $$
CREATE PROCEDURE excuteSeckill(IN fadeSeckillId INT,IN fadeUserPhone VARCHAR (15),IN fadeKillTime TIMESTAMP ,OUT fadeResult INT)
BEGIN
DECLARE insert_count INT DEFAULT 0;
START TRANSACTION ;
INSERT ignore success_kill(seckill_id,user_phone,status,create_time) VALUES(fadeSeckillId,fadeUserPhon... |
alter table object add constraint object_environmentid_foreignid UNIQUE (environment_id, foreign_id);
|
<gh_stars>0
## NMCMS-491
ALTER TABLE v1_inschrijvingen ADD ticket_office_source VARCHAR(255); |
SELECT MAX(MagicWandSize)AS 'LongestMagicWand' FROM WizzardDeposits |
CREATE MEMORY TABLE brands (
id BIGINT NOT NULL,
name VARCHAR(16)
);
CREATE MEMORY TABLE series (
id BIGINT NOT NULL,
brand_id BIGINT NOT NULL,
name VARCHAR(16)
);
CREATE MEMORY TABLE models (
id BIGINT NOT NULL,
series_id BIGINT NOT NULL,
name VARCHAR(16)
);
CREATE MEMORY TABLE spare... |
<reponame>OstentaPao/TrabalhoAgenda<filename>script.sql
Create database BancoTrabalho;
/*drop database bancotrabalho;*/
Use BancoTrabalho;
Create table Agenda (
Codigo int not null primary key AUTO_INCREMENT,
Nome varchar(100) not null,
Endereco varchar(100) not null,
Bairro varchar(100) not null,
Cidade... |
CREATE TABLE IF NOT EXISTS cheevohaus.registeredUsers
(
id INT NOT NULL AUTO_INCREMENT,
username VARCHAR(32) NOT NULL,
password VARCHAR(64) NOT NULL,
joinedOn TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id)
);
|
<gh_stars>0
CREATE database if not EXISTS social_network;
use social_network;
CREATE TABLE IF NOT EXISTS users (
id int(255) AUTO_INCREMENT NOT NULL,
role varchar(255),
email varchar(255),
firstName varchar(255),
lastName varchar(255),
password varchar(255),
nickname varchar(50),
biografy varchar(255)... |
<filename>perpus.sql
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 15, 2022 at 04:09 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
-- phpMyAdmin SQL Dump
-- version 4.0.8
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Сен 22 2015 г., 11:35
-- Версия сервера: 5.6.17
-- Версия PHP: 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... |
SELECT session_id,
SUM(internal_objects_alloc_page_count) AS task_internal_objects_alloc_page_count,
SUM(internal_objects_dealloc_page_count) AS task_internal_objects_dealloc_page_count
FROM sys.dm_db_task_space_usage
GROUP BY session_id
ORDER BY SUM(internal_objects_alloc_page_count) desc
/*
CREA... |
<reponame>yani-valeva/Databases-Basics-MySQL<filename>Exam Preparation II/09.Message Count.sql
SELECT c.`id`, COUNT(m.id) AS 'total_messages'
FROM `chats` AS c
INNER JOIN `messages` AS m
ON c.`id` = m.`chat_id`
WHERE m.`id` < 90
GROUP BY c.`id`
ORDER BY `total_messages` DESC, c.`id`
LIMIT 5; |
<filename>5.2.3/Database/Constraints/AFW_13_CONDT_EXECT_UK1.sql<gh_stars>1-10
SET DEFINE OFF;
ALTER TABLE AFW_13_CONDT_EXECT ADD (
CONSTRAINT AFW_13_CONDT_EXECT_UK1
UNIQUE (CODE)
ENABLE VALIDATE)
/
|
<filename>db/db/4init_param/GL/GL_CCY_ADJUST_TABLE.sql
TRUNCATE TABLE gl_ccy_adjust_table;
INSERT INTO gl_ccy_adjust_table (CCY, ADJUST_CCY, SUBJECT_CODE, RATE_TYPE, TRAN_TIMESTAMP, TRAN_TIME) VALUES ('AUD', 'CNY', '30020304', 'RER', NULL, NULL);
INSERT INTO gl_ccy_adjust_table (CCY, ADJUST_CCY, SUBJECT_CODE, RATE_TYPE... |
<gh_stars>100-1000
-- TABLES
CREATE TABLE IF NOT EXISTS `bx_organizations_favorites_track` (
`object_id` int(11) NOT NULL default '0',
`author_id` int(11) NOT NULL default '0',
`date` int(11) NOT NULL default '0',
KEY `id` (`object_id`,`author_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXIS... |
SELECT imdb_rating AS 'IMDb'
FROM movies; |
<reponame>skarppi/opentx-logbook
DROP VIEW IF EXISTS locations;
DROP VIEW IF EXISTS FLIGHTS_BY_YEAR;
DROP VIEW IF EXISTS FLIGHTS_BY_MONTH;
DROP VIEW IF EXISTS FLIGHTS_BY_DAY;
DROP VIEW IF EXISTS totals;
DROP FUNCTION IF EXISTS delete_battery_cycles_by_battery_id(battery_id integer);
DROP TABLE if EXISTS Battery_Cycles;... |
-- 2018-09-14T17:33:33.798
-- I forgot to set the DICTIONARY_ID_COMMENTS System Configurator
INSERT INTO AD_Menu (Action,AD_Client_ID,AD_Menu_ID,AD_Org_ID,AD_Window_ID,Created,CreatedBy,EntityType,InternalName,IsActive,IsCreateNew,IsReadOnly,IsSOTrx,IsSummary,Name,Updated,UpdatedBy,WEBUI_NameBrowse) VALUES ('W',0,54114... |
<reponame>vubao2303/sql-employee-tracker<gh_stars>0
INSERT INTO department (name)
VALUES ("Sales"),("Engineering"),("Finance");
-- roles
INSERT INTO role (title, salary, department_id)
VALUES ("Fun Associate", 60000.00, 1);
INSERT INTO role (title, salary, department_id)
VALUES ("Manager", 85000.00, 1);
INSERT INTO r... |
<reponame>cjporteo/sql-zoo-solns
SELECT name
FROM world
WHERE capital = CONCAT(name, ' City')
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.