sql stringlengths 6 1.05M |
|---|
<reponame>athom/ClickHouse
create table enum_alter_issue (a Enum8('one' = 1, 'two' = 2)) engine = MergeTree() ORDER BY a;
insert into enum_alter_issue values ('one'), ('two');
alter table enum_alter_issue modify column a Enum8('one' = 1, 'two' = 2, 'three' = 3);
insert into enum_alter_issue values ('one'), ('two');
alt... |
DROP USER MAPPING IF EXISTS FOR bob SERVER foo;
|
-- List all employees with their first name, last name and title.
SELECT FirstName, LastName, Title FROM employees;
-- List all employees from Seattle.
SELECT * FROM employees
WHERE City='Seattle';
-- List all employees from London.
SELECT * FROM employees
WHERE City='London';
-- List all employees that work in the Sal... |
CREATE TABLE [dbo].[Clients] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Enabled] BIT NOT NULL,
[ClientId] NVARCHAR (200) NOT NULL,
[ProtocolType] NVARCHAR (200) NOT NULL,
[Req... |
<filename>sql/_17_sql_extension2/_02_full_test/_05_date_time_function/_12_dayofweek/cases/dayofweek_013.sql
--pass time type data to the parameter
select dayofweek(time'12:12:12');
select dayofweek(time'1:2:3');
select dayofweek(time'15:23:45');
select dayofweek(time'0:0:0');
|
-- insert data into the db
INSERT INTO department (name)
VALUES
("Administration"),
("Operations"),
("Food and Beverage"),
("Resort Services")
;
INSERT INTO role (title, salary, department_id)
VALUES
("Admin Assistant", 60000, 1),
("Operations Director", 110000, 2),
("Ski Patrol Manager... |
EXEC [EST].[Proc_yjbb_Ins] @Code = N'603111',@CutoffDate = N'2017-09-30',@EPS = N'0.24',@EPSDeduct = N'0',@Revenue = N'15.95亿',@RevenueYoy = N'13.51',@RevenueQoq = N'-1.84',@Profit = N'1.76亿',@ProfitYoy = N'1.48',@ProfiltQoq = N'-16.62',@NAVPerUnit = N'1.9622',@ROE = N'12.85',@CashPerUnit = N'-0.3791',@GrossProfitRate ... |
<reponame>idwaker/mynotebooks<filename>sql/dummy_departments.sql
-- https://mockaroo.com/
insert into departments (department, division) values ('Computers', 'Electronics');
insert into departments (department, division) values ('Automotive', 'Hardware');
insert into departments (department, division) values ('Books', ... |
<filename>src/test/resources/sql/select/1e10c7c9.sql
-- file:privileges.sql ln:637 expect:true
select has_table_privilege('pg_authid','truncate')
|
ALTER TABLE `bots` DROP INDEX `filterid_index`;
ALTER TABLE `bots` DROP COLUMN `filterid`
|
alter table topics
add column root boolean not null default false;
|
-- # 插入数据到用户表中
DROP PROCEDURE IF EXISTS users_initData;
DELIMITER $
CREATE PROCEDURE users_initData()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i<=100 DO
set autocommit = 1;
insert into test.users (name, password, phoneNumber, identify_card, money)
VALUES (CONCAT("user", i), "password", CONCA... |
<filename>imessage_extractor/src/staging/views/message_tokens.sql<gh_stars>1-10
drop view if exists {pg_schema}.message_tokens;
create or replace view {pg_schema}.message_tokens as
select message_id,
string_to_array(
trim(
regexp_replace(
replace(
replace(
... |
<gh_stars>0
-- +++
-- parent: 1528395854
-- +++
BEGIN;
ALTER TABLE IF EXISTS cm_trigger_jobs ADD COLUMN IF NOT EXISTS execution_logs JSON[];
ALTER TABLE IF EXISTS cm_action_jobs ADD COLUMN IF NOT EXISTS execution_logs JSON[];
COMMIT;
|
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Oct 11, 2016 at 06:50 PM
-- 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_SE... |
<gh_stars>1000+
DROP TABLE IF EXISTS errors_local;
CREATE TABLE errors_local (level LowCardinality(String)) ENGINE=ReplacingMergeTree ORDER BY level settings min_bytes_for_wide_part = '10000000';
insert into errors_local select toString(number) from numbers(10000);
SELECT toTypeName(level) FROM errors_local FINAL PRE... |
<gh_stars>10-100
INSERT INTO now_application_document_type
(now_application_document_type_code, description, active_ind, create_user, update_user)
VALUES
('SRB', 'Scan of Reclamation Security Document', true, 'system-mds','system-mds'),
('NIA', 'No Interest Acknowledgement Form', true, 'system-mds','system-mds'... |
<reponame>AddressForAll/grid-tests
/**
* System's Public library (commom for WS and others)
* PREFIXES: geojson_
* Extra: PostGIS's Brazilian SRID inserts.
* See also https://github.com/ppKrauss/SizedBigInt/blob/master/src_sql/step2-sizedNaturals.sql
* https://github.com/AddressForAll/WS/blob/master/src/s... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 16, 2018 at 06:19 AM
-- Server version: 10.1.9-MariaDB
-- PHP Version: 5.6.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
CREATE TABLE if not exists 19123Attori
(
Codattore int (5) NOT NULL,
Nome varchar (15),
Annonascita int (4),
Nazionalita varchar(20),
PRIMARY KEY (Codattore)
);
CREATE TABLE if not exists 19123Film
(
Codfilm int (5) NOT NULL,
Titolo varchar (15),
AnnoProduzione int (4),
Regista varchar (20),
Genere... |
<gh_stars>0
create table CMEFrontMatterProviderBinding (
front_matter integer not null references CMEFrontMatter(id) on delete cascade,
provider integer not null references CMEProvider(id) on delete cascade,
primary key(front_matter, provider)
);
|
<reponame>thedyarmstrong/budget-codeigniter
/*
Navicat MySQL Data Transfer
Source Server : tebet
Source Server Version : 50524
Source Host : 192.168.3.11:3306
Source Database : mritransferapi
Target Server Type : MYSQL
Target Server Version : 50524
File Encoding : 65001
... |
CREATE DATABASE wilson_db;
USE wilson_db;
|
CREATE TYPE _meta.locale AS ENUM (
'af-ZA',
'sq-AL',
'ar-DZ',
'ar-BH',
'ar-EG',
'ar-IQ',
'ar-JO',
'ar-KW',
'ar-LB',
'ar-LY',
'ar-MA',
'ar-OM',
'ar-QA',
'ar-SA',
'ar-SY',
'ar-TN',
'ar-AE',
'ar-YE',
'hy-AM',
'Cy-az-AZ',
'Lt-az-AZ',
'eu-ES',
'be-BY',
'bg-BG',
'ca-ES',
'z... |
<gh_stars>1-10
-- Find gift cards in the 90 percentile in terms of YTD gross sales volumes.
-- Verified: OK
-- 1. For a given card type (e.g G-0007) what was the total YTD sale?
-- 2. Calculate percentile
select gc_name, total_sales
from (select gc_type_code, total_sales, ntile(10) over (order by total_sales desc) as ... |
alter table "public"."assets" rename column "privacy_type" to "privacyType";
|
SELECT Bin.id as bin_id, Contig.id as contig_id, Gene.id as gene_id
-- Bin.name AS Bin_name, Contig.name AS Contig_name, Gene.name AS Gene_name, Gene.taxonomy AS Gene_taxonomy
FROM Gene JOIN Sample_Gene ON (Gene.id=Sample_Gene.gene_id)
JOIN Sample ON (Sample_Gene.sample_ID=Sample.id)
JOIN Contig ON (Gene.contig_id=Co... |
-- Table which will be used for showing how CRUD can be done using spring-jdbc
create TABLE CONTESTANTS (
firstname VARCHAR(200)
, lastname VARCHAR(200)
, code VARCHAR(20) NOT NULL
);
|
<reponame>vinodkumar2704/Personal-information-manager-webapp
DROP TABLE if EXISTS notes cascade;
DROP TABLE if EXISTS hashtags cascade;
DROP TABLE if EXISTS links;
CREATE TABLE notes(
id serial PRIMARY KEY,
created_on date,
title text unique not null ,
description text not null
);
CREATE TABLE has... |
<reponame>1249993110/LSTY.Sdtd-5.X
USE [LSTY_Sdtd]
GO
--用户表
CREATE TABLE T_User(
Id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT NEWID(), --GUID
CreatedDate DATETIME NOT NULL DEFAULT GETDATE(), --创建日期
DisplayName NVARCHAR(32) NOT NULL, --显示名称
LastLoginTime DATETIME, --上次登录时间
LastLoginIpAddress VARCHAR(... |
/*
Warnings:
- Changed the type of `type` on the `events` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
*/
-- CreateEnum
CREATE TYPE "EventType" AS ENUM ('DELIVER', 'OPEN', 'CLICK', 'BOUNCE', 'COMPLAINT', 'REJECT');
-- Alter... |
<reponame>motionrp/mrp-dbt-marketing-dwh
{% if var('product_warehouse_event_sources') %}
{% for source in var('product_warehouse_event_sources') %}
{% set relation_source = 'stg_' + source + '_events' %}
select
'{{source}}' as source,
{% if var("enable_event_type_mapping") %}
{{ dbt_utils... |
create view gv_verification_rules as
select id, title, description, test_type
from verification_rules; |
<gh_stars>1-10
IF OBJECT_ID('@cohort_database_schema.@target_ref_table', 'U') IS NOT NULL
DROP TABLE @cohort_database_schema.@target_ref_table;
CREATE TABLE @cohort_database_schema.@target_ref_table (
target_cohort_definition_id INT,
target_name VARCHAR(255)
);
IF OBJECT_ID('@cohort_database_schema.@outcome_ref_... |
<reponame>jihwahn1018/ovirt-engine
SELECT fn_db_delete_config_value_all_versions('SriovHotPlugSupported');
|
-- @testpoint:openGauss保留关键字minus作为 用户名,
--不带引号,合理报错
CREATE USER minus PASSWORD '<PASSWORD>';
--加双引号,创建成功
drop user if exists "minus";
CREATE USER "minus" PASSWORD '<PASSWORD>';
--清理环境
drop user "minus";
--加单引号,合理报错
CREATE USER 'minus' PASSWORD '<PASSWORD>';
--加反引号,合理报错
CREATE USER `minus` PASSWORD ... |
<gh_stars>0
CREATE FUNCTION setwaycosts() RETURNS boolean
LANGUAGE plpgsql
AS $$
/*
Update the road length and transport mode costs
https://wiki.openstreetmap.org/wiki/Key:oneway
List of values
oneway=yes (discouraged alternative: "true", "1")
oneway=no (discouraged alternative: "false", "0")
oneway=-1 (discou... |
-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 15, 2015 at 07:32 AM
-- Server version: 5.6.11
-- PHP Version: 5.5.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Feb 09, 2021 at 01:37 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
/****** Object: User Defined Function dbo.SectorLastPoster Script Date: 5/1/2004 6:12:43 PM ******/
CREATE FUNCTION dbo.SectorLastPoster
(
@ThreadID int
)
RETURNS int
BEGIN
RETURN(SELECT TOP 1 Poster FROM SectorForumsPosts WHERE ThreadID = @ThreadID ORDER BY PostDate DESC)
END
|
<filename>src/Freedom/Stored_Procedures/pr_UpdateSavingsAccountForUser.sql
DELIMITER //
CREATE OR REPLACE PROCEDURE pr_UpdateSavingsAccountForUser(IN $savingsAccountId VARCHAR(36),
IN $userId VARCHAR(36),
... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 11, 2020 at 04:23 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
CREATE TABLE `restaurant_reservations` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`schedule` DATETIME NOT NULL,
`people` INT(2) NOT NULL DEFAULT 1,
`first_name` VARCHAR(15) NOT NULL,
`last_name` VARCHAR(25) NOT NULL,
`phone` VARCHAR(10) NULL DEFAULT NULL,
`email` VARCHAR(50) NULL DEFAULT NULL,
`occasion` E... |
<filename>modules/boonex/antispam/updates/9.0.3_9.0.4/install/sql/enable.sql<gh_stars>100-1000
-- GRIDS
UPDATE `sys_grid_actions` SET `icon`='pencil-alt' WHERE `object`='bx_antispam_grid_ip_table' AND `name`='edit';
|
CREATE FUNCTION udf_UserTotalCommits(@username VARCHAR(30))
RETURNS INT AS
BEGIN
DECLARE @commits INT =
(
SELECT
COUNT(*)
FROM Users u
JOIN Commits c ON u.Id = c.ContributorId
WHERE u.Username = @username
);
RETURN @commits
END; |
-- user
-- get full user data from user and account tables
SELECT
users.first_name, users.last_name, users.email,
accounts.alias, accounts.domain, accounts.currency, accounts.visible,
accounts.email_md5, accounts.memo_type, accounts.memo
FROM
users INNER JOIN accounts
ON users.id = accounts.u... |
-- +migrate Up
DROP TABLE alert_assignments;
-- +migrate Down
CREATE TABLE alert_assignments (
user_id uuid NOT NULL,
alert_id bigint NOT NULL
);
ALTER TABLE ONLY alert_assignments
ADD CONSTRAINT alert_assignments_pkey PRIMARY KEY (user_id, alert_id);
ALTER TABLE ONLY alert_assignments
ADD CONSTRAINT... |
<reponame>AurelienRichez/playframework
# Initial test schema
# --- !Ups
INSERT INTO users(username) VALUES ('PlayerFromThirdEvolution');
WRONG COMMAND TO FAIL THE MIGRATION
# --- !Downs
DELETE FROM users where id = 3;
|
<reponame>opengauss-mirror/Yat
-- @testpoint:opengauss关键字nvl(非保留),作为视图名
--关键字explain作为视图名,不带引号,创建成功
CREATE or replace VIEW nvl AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_default';
drop view nvl;
--关键字explain作为视图名,加双引号,创建成功
CREATE or replace VIEW "nvl" AS
SELECT * FROM pg_tablespace WHERE spcname = 'pg_defa... |
<reponame>Enrique303/Employee_Tracker
INSERT INTO department(department_name) VALUES (“accouting”), (“sales”), (“engineering”), (“legal”);
INSERT INTO role(title, salary, department_id) VALUES (“Accountant”, 95000, 1), (“Account Manager”, 65000, 1), (“Sales Rep”, 75000, 2), (“Sales Lead”, 125000, 2), (“Junior Developer... |
create database if not exists prototype;
create TABLE users(id INT NOT NULL,nom VARCHAR(50),prenom VARCHAR(100),profil VARCHAR(50),actif VARCHAR(50),constraint pku PRIMARY KEY(id));
create table secteur(id INT NOT NULL,nomsecteur VARCHAR(100),constraint pks PRIMARY KEY(id));
create TABLE institutions(id INT NOT NUL... |
<gh_stars>0
USE burgers_db;
INSERT INTO burgers
(burger_name, devoured, createdAt, updatedAt)
VALUES
("Taco Burger", false, now(), now());
INSERT INTO burgers
(burger_name, devoured, createdAt, updatedAt)
VALUES
("Veggie", false, now(), now());
INSERT INTO burgers
(burger_name, devoured, created... |
<reponame>KunalRRathod/CTS_PUNE_ASSESSMENT-Kunal_Rathod
create database ANSI_SQL_BANK ;
use ANSI_SQL_BANK;
# LOAN DETAILS TABLE
create table loan_details (customer_number varchar(6) primary key,
branch_id varchar(6),
loan_amount int(7));
SELECT * FROM LOAN_DETAILS;
#ACCOUNT MASTER TABLE (MAIN TABLE... |
-- CreateTable
CREATE TABLE "Notifications" (
"id" TEXT NOT NULL,
"sender" TEXT NOT NULL DEFAULT E'<EMAIL>',
"recipientEmail" TEXT NOT NULL,
"TextContent" TEXT,
"HTMLContent" TEXT,
"status" "NotificationStatus" NOT NULL DEFAULT E'pending',
PRIMARY KEY ("id")
);
-- AddForeignKey
ALTER TABLE... |
CREATE TABLE [dbo].[TableData]
(
[Id] UNIQUEIDENTIFIER NOT NULL DEFAULT NEWID(),
[TableName] NVARCHAR(255) NOT NULL,
[PartitionKey] NVARCHAR(255) NOT NULL,
[RowKey] NVARCHAR(255) NOT NULL,
[ETag] NVARCHAR(255) NOT NULL,
[Timestamp] DATETIME NOT NULL,
[SynchronizedOn] DATETIME NOT NULL DE... |
<reponame>lycantropos/seek-well
CREATE OR REPLACE VIEW v_last_login AS (
SELECT
f_player_id,
MAX(f_end_stamp)::DATE AS f_date,
MAX(f_end_stamp) AS f_last_login_stamp
FROM
t_sessions_log
GROUP BY
f_player_id
); |
-- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64)
--
-- Host: localhost Database: himanshu
-- ------------------------------------------------------
-- Server version 8.0.17
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS... |
-- some aggregate functions need to be created first, see
-- aggregate_functions.sql
insert into datamining_table (
select gst.gps_segment_id,
gsegs.trip_id as gtfs_trip_id,
gsegs.schedule_error as rms_schedule_error,
gsegs.vehicle_id as vehicle_id,
routes.route_short_name as route_name, ... |
/*
PROFILE
*/
SELECT @@have_profiling;
select @@profiling;
show profiles;
-- show profile [cpu | all] for query 4;
SHOW PROFILE CPU FOR QUERY 4; |
-- CreateTable
CREATE TABLE "Blogpost" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME NOT NULL,
"publishedAt" DATETIME,
"title" TEXT NOT NULL,
"body" TEXT NOT NULL,
"author" TEXT
);
|
{# ======================Fetch extensions names=====================#}
{% import 'systemobjects.macros' as SYSOBJECTS %}
SELECT
a.name, a.installed_version,
array_agg(av.version) as version,
nsp.nspname as schema,
array_agg(av.superuser) as superuser,
array_agg(av.relocatable) as relocatable,
ns... |
<gh_stars>0
SELECT
*
FROM
SumByCountryDateAnalysis
WHERE
Country_Region in ('US', 'Italy', 'Spain', 'UK', 'France')
/*
Commands
sqlite3.exe ../vscode/output.db
sqlite> .headers on
sqlite> .mode csv
sqlite> .output SumByCountryDateAnalysis.csv
sqlite> SELECT * FROM SumByCountryDateAnalysis WHERE Cou... |
<gh_stars>1-10
-- Add migration script here
CREATE TABLE public.mutes
(
guild_id bigint NOT NULL,
user_id bigint NOT NULL,
mute_time bigint NOT NULL,
PRIMARY KEY (guild_id, user_id),
CONSTRAINT "FK_mutes_guild_info_guild_id" FOREIGN KEY (guild_id)
REFERENCES public.guild_info (guild_id) MATC... |
<filename>migrations/2020-10-12-102135_create_db/up.sql
-- Your SQL goes here
CREATE TABLE "address" (
"id" int4 NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"name" varchar(255) COLLATE "pg_catalog"."default" NOT NULL,
"address_line" text CO... |
-- Simplify Staff rules. Leaving Addons:* in for now until bug 1025073 is completed.
UPDATE groups SET rules='Addons:*,Apps:*,FeaturedApps:*,Reviews:Edit,Users:Edit,Stats:View,CollectionStats:View,Collections:Edit,AdminTools:View,AccountLookup:View,AppLookup:View,Lookup:View,Stats:View' WHERE name='Staff' AND id >= 50... |
# ************************************************************
# Sequel Pro SQL dump
# Version 3408
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 192.168.127.123 (MySQL 5.5.42-cll)
# Database: maxtao_school
# Generation Time: 2015-06-25 13:38:29 +0000
# *********************************... |
<reponame>opengauss-mirror/Yat<gh_stars>0
-- @testpoint:opengauss关键字size(非保留),作为用户名
--关键字explain作为用户名不带引号,创建成功
drop user if exists size;
CREATE USER size PASSWORD '<PASSWORD>';
drop user size;
--关键字explain作为用户名加双引号,创建成功
drop user if exists "size";
CREATE USER "size" PASSWORD '<PASSWORD>';
drop user "size";
--关键字ex... |
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 04 Feb 2016 pada 08.32
-- Versi Server: 5.6.26
-- PHP Version: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
<filename>data/data_base_schema.sql
/*
Esta base de datos tiene el proposito de mantener una base de datos con los datos de las elecciones
preciedenciales 2019 esto con el proposito de analizar geograficamente haciendo uso de PostGis
limites politicos geocoding para ver donde estan los centros de votacion.
De estos... |
create database if not exists radio;
use radio;
create table if not exists users
(
name varchar(32) primary key,
password binary(60) not null
);
create table if not exists sessions
(
id binary(16) primary key,
user varchar(32) not null unique,
ipAddr varbinary(16) not null,
... |
CREATE TABLE IF NOT EXISTS crocodile_user (
id VARCHAR(50) PRIMARY KEY NOT NULL ,-- "ID",
name VARCHAR(10) NOT NULL DEFAULT "" ,-- "用户名",
hashpassword VARCHAR(100) NOT NULL DEFAULT "" ,-- "加密后的密码",
... |
<gh_stars>0
--
-- Learning SQL
-- Exercise 3-4
--
SELECT
c.email, r.return_date
FROM
customer AS c
INNER JOIN rental AS r ON c.customer_id = r.customer_id
WHERE
date(r.rental_date) = '2005-06-14'
ORDER BY
-- inspecting the result set we can make 2 observations:
-- 1. email column does not seem to be in osr... |
drop database if exists `inventory_management`;
create database if not exists `inventory_management`;
use `inventory_management`;
drop table if exists `tblBrand`;
create table if not exists `tblBrand`(
brandID bigint primary key auto_increment,
brandName varchar(50) not null unique,
brandDesc varchar(500) not... |
CREATE DATABASE "boundary";
REVOKE ALL PRIVILEGES ON DATABASE "boundary" FROM public;
CREATE USER boundary_admin WITH ENCRYPTED PASSWORD '<PASSWORD>' NOINHERIT NOSUPERUSER NOCREATEROLE NOCREATEDB;
GRANT ALL PRIVILEGES ON DATABASE "boundary" TO boundary_admin;
|
<filename>ADHDatabaseProject/dbo/Stored Procedures/spTestRequests_UpdateResult.sql
-- =============================================
-- Author: dbo
-- Create date: 2020-10-16
-- Description: add results to test
-- =============================================
CREATE PROCEDURE spTestRequests_UpdateResult
@Id nvarchar(... |
<filename>server/config/demo_values.sql
INSERT INTO users VALUES
("root", "root"),
("user1", "user1"),
("user2", "user2");
INSERT INTO devices VALUES
("test_device1"),
("simulate2"),
("simulate1"),
("test"),
("moxa2020");
INSERT INTO viewControl VALUES
("root", "test_device1"),
... |
-- start query 84 in stream 0 using template query84.tpl
SELECT c_customer_id AS customer_id,
c_last_name
|| ', '
|| c_first_name AS customername
FROM customer,
customer_address,
customer_demographics,
household_demographics,
income_b... |
<reponame>mepler-labs/steps
-- Deploy steps:user_checkin_times to pg
-- requires: appschema
BEGIN;
ALTER TABLE "user" ADD COLUMN checkin_times JSON[] DEFAULT '{}'::JSON[];
COMMIT;
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.1.32-MariaDB - mariadb.org binary distribution
-- Server OS: Win32
-- HeidiSQL Version: 9.5.0.5196
-- ------------------------------------------------... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 29, 2021 at 02:49 AM
-- Server version: 5.7.24
-- PHP Version: 7.2.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_... |
SELECT m1.username, m1.message
FROM message m1
LEFT JOIN message m2 ON (
m1.username = m2.username AND m1.id < m2.id
)
WHERE m2.id IS NULL; |
INSERT INTO maoshifu.area (id,area_code,area_name,`level`,parent_code,target) VALUES
('0021cc58e099439e9cfbea5861524de3','421003000000','荆州区',3,'421000000000','10/421003.html')
,('003b4cb25ba24d99b5d9dfc64bf58ad9','530500000000','保山市',2,'530000000000','53/5305.html')
,('004f5da06c5f4d05be77ed0e53e96fbc','330382000000... |
<reponame>Invivoo/blog<gh_stars>1-10
INSERT INTO USER(username, password) VALUES('ADMIN', '<PASSWORD>') |
<filename>SQLServer/Working/SQLTopIOQueries.sql
/* SQL Server: Query to List SQL Queries That Use The Most I/O */
SELECT TOP 10 --Change this to how many top queries you want to return
[Total IO] = (qs.total_logical_reads + qs.total_logical_writes)
, [Average IO] = (qs.total_logical_reads + qs.total_logical_writes) /
... |
IF $(OneTimeLoad) = 1
BEGIN
DECLARE @Section TABLE
(
SectionKey INT NOT NULL PRIMARY KEY,
PartKey INT NOT NULL,
ParentSectionKey INT NULL,
SectionName NVARCHAR(250) NOT NULL,
PageReference NVARCHAR(50) NULL,
DisplayOrder FLOAT NOT NULL,
SectionSlug VARCHAR(50) NULL
);
INSERT INTO @Section
... |
<reponame>Pushpak-Bhosale/Codeigniter_Examples<filename>database/blog.sql
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 05, 2020 at 07:37 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOC... |
/*
--check
Select
Distinct
j2.[Key]
, j2.Type
From
ssas.model_json_20 As T1
Cross Apply OpenJson ( T1.l2_tables_ja ) As j1
Cross Apply OpenJson ( j1.Value ) As j2
order by
j2.[Key]
, j2.Type
Go
*/
CREATE View ssas.model_json_31_tables
As
Select
T1.databasename
... |
<filename>wmss/data/create_graph.cql<gh_stars>1-10
CREATE (score:Score {n:"Score"})-[:has {n:"has [1..n]"}]->(movement:Movement {n:"Move ment"})
CREATE (movement)-[:has {n:"has [1..n]"}]->(p:Part {n:"Instru ment"})-[:has {n:"has [1..n]"}]->(m:Measure {n:"Measure"})-[:has {n:"has [1..1]"}]->(k:Key {n:"Key"})
CREATE (m)... |
-- ============================================================================
-- Copyright (c) 2004-2021 <NAME> (<EMAIL>)
-- ============================================================================
-- Author : <NAME>
-- Create date : 15.02.2021
-- Module : Database Analysis & Performance Monitoring
-- ===... |
create table backup.AD_UI_Section_BKP_Before416 as select * from AD_UI_Section;
update AD_UI_Section set Name='' where Name='main';
update AD_UI_Section_Trl set Name='' where Name='main';
|
INSERT INTO KRIM_ROLE_T (ACTV_IND,DESC_TXT,KIM_TYP_ID,LAST_UPDT_DT,NMSPC_CD,OBJ_ID,ROLE_ID,ROLE_NM,VER_NBR)
VALUES ('Y','IACUC Approver',(SELECT KIM_TYP_ID FROM KRIM_TYP_T WHERE NM='UnitHierarchy'),SYSDATE,'KC-UNT',SYS_GUID(),KRIM_ROLE_ID_BS_S.NEXTVAL,'IACUCApprover',1)
/
|
insert into entity( name, target) values ( 'user', 'User');
insert into entity( name, target) values ( 'group', 'Group');
insert into entity( name, target) values ( 'user_group', 'User Group');
insert into entity( name, target) values ( 'audit', 'Audit');
insert into entity( name, target) values ( 'form', 'Form');
ins... |
<gh_stars>0
CREATE TABLE "Blobs"
(
"ID" BIGINT GENERATED ALWAYS AS IDENTITY CONSTRAINT "PK_Blobs" PRIMARY KEY,
"SensorID" VARCHAR(24) NOT NULL,
"FileName" TEXT NOT NULL,
"Path" TEXT NOT NULL,
"StorageType" INTEGER NOT NULL,
"Timestamp" TIMESTAMP WITH TIME ZONE default '0001-01-01 00:00:00'::TIMESTAMP WITH TIME ZO... |
/*
* Copyright (c) 2015 LabKey Corporation
*
* Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
*/
SELECT edc.id ,
edc.date,
edc.sire,
edc.termDate,
edc.termCode.description,
edc.confirmDate,
edc.lastObscanDate
From study.pregnancyConfirmation edc
wh... |
<filename>revert/swrs/transform/materialized_view/flat.sql<gh_stars>1-10
-- Revert ggircs:materialized_view_flat from pg
begin;
drop materialized view swrs_transform.flat;
commit;
|
<gh_stars>1-10
drop database if exists pcr_common;
create database pcr_common;
use pcr_common;
DROP TABLE IF EXISTS table_id;
DROP TABLE IF EXISTS date_precision;
DROP TABLE IF EXISTS event_log_transaction_type;
create table table_id (
id tinyint,
`table_name` varchar(255),
CONSTRAINT pk_table_id PRIMARY KE... |
<filename>test_and_ground/asist/prc/scx_cpu1_hk_start_apps.prc
proc scx_cpu1_hk_start_apps (step_num)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Purpose: The purpose of this procedure is to startup the CFS Housekeeping
; (HK) and test (TST_HK) applications if they are not al... |
<filename>mybatis-plus-explore/src/main/resources/db-init.sql
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`... |
<gh_stars>100-1000
/*
Copyright 2011 tSQLt
Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0
Unless required by applicable l... |
<reponame>thenexxuz/phpBMS
INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES ('tbld:73adc80f-7f0e-e340-937e-41194c5bda29', 'pushrecords.id', 'id', '4', 'field');
INSERT INTO `tablesearchablefields` (`tabledefid`, `field`, `name`, `displayorder`, `type`) VALUES ('tbld:73a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.