sql stringlengths 6 1.05M |
|---|
<filename>Car Dealership/SQL/database.sql
use master
go
if exists (select * from sysdatabases where name='GuildCars')
drop database GuildCars
go
create database GuildCars
go
|
DELETE FROM foos;
INSERT INTO foos (value)
VALUES
('ITEM1')
,('ITEM2')
,('ITEM3')
;
|
<reponame>yqtaowhu/Spark
-- Q1. testing window functions with order by
create table spark_10747(col1 int, col2 int, col3 int) using parquet;
-- Q2. insert to tables
INSERT INTO spark_10747 VALUES (6, 12, 10), (6, 11, 4), (6, 9, 10), (6, 15, 8),
(6, 15, 8), (6, 7, 4), (6, 7, 8), (6, 13, null), (6, 10, null);
-- Q3. wi... |
<reponame>starrySSS/txl
/*
Navicat MySQL Data Transfer
Source Server : 本地
Source Server Version : 50553
Source Host : localhost:3306
Source Database : tongxun
Target Server Type : MYSQL
Target Server Version : 50553
File Encoding : 65001
Date: 2017-12-14 10:48:23
*/
SET FOREIGN_KE... |
<reponame>Pamelapxaylink/postgresql-course<filename>124/ninja8e2.sql
--Hands-on exercise #2
--Do the following:
--Use the containment operator to check if cake is in the favorite foods people like
--Try it both with accessing desserts and without using the accessing operator
-- SELECT * FROM people LIMIT 10;
-- SELECT... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 19-11-2017 a las 23:50:55
-- Versión del servidor: 10.1.26-MariaDB
-- Versión de PHP: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
<reponame>admfarmer/smart-report-api
/*
Navicat Premium Data Transfer
Source Server : mariadb-3310
Source Server Type : MySQL
Source Server Version : 100315
Source Host : localhost:3310
Source Schema : reportdb
Target Server Type : MySQL
Target Server Version : 100315
File Enc... |
<filename>KInspector.Modules/Scripts/Setup/StagingServerSetupModule.sql<gh_stars>0
-- Staging servers modification
-------------------------------
-- Staging server is disabled by appending its URL with '.disabled'
-- so that it is possible to distinguish servers disabled by the customer and by audit.
-- The Enabled st... |
<reponame>dimkomatov/webappproxy
CREATE USER 'root'@'localhost' IDENTIFIED BY 'root';
CREATE DATABASE squid;
GRANT all privileges ON database.squid TO 'root'@'localhost' IDENTIFIED BY 'root';
use squid;
CREATE TABLE access (
id INT NOT NULL AUTO_INCREMENT,
time DATETIME,
elapse FLOAT,
remotehost VARCHAR(160),
countr... |
<reponame>nicolasTurban/Queen-Back-Office
INSERT INTO public.comment(id, value, reporting_unit_id) VALUES(20, '{}',20);
INSERT INTO public.comment(id, value, reporting_unit_id) VALUES(21, '{}',21);
INSERT INTO public.comment(id, value, reporting_unit_id) VALUES(22, '{}',22); |
<gh_stars>0
select distinct u.id, u.idnumber, u.username, u.firstname, u.lastname, u.email, u.institution, c.shortname, vcs.name as "Course Module", f.filename as "File downloaded"
from
{logstore_standard_log} l
left join {course} c on l.courseid = c.id
left join {user} u on l.userid = u.id
left join {files} f on l.... |
<gh_stars>1-10
CREATE TABLE t_achievements
(
f_id INTEGER PRIMARY KEY NOT NULL,
f_player_id BIGINT DEFAULT 0 NOT NULL,
f_type BIGINT DEFAULT 0 NOT NULL,
f_value BIGINT DEFAULT 0 NOT NULL,
f_stamp TIMESTAMP NOT NULL
);
|
/*
* This program prints the Fibonacci
* Series for 10 lines.
*/
SET SERVEROUTPUT ON;
SET VERIFY OFF;
DECLARE
num number;
first number;
second number;
next number;
BEGIN
num := 10;
first := 0;
second := 1;
dbms_output.put_line(first);
dbms_output.put_line(second);
for i in 3..num loop
... |
<gh_stars>1-10
CREATE PROC usp_CancelFlights
AS
BEGIN
UPDATE Flights
SET DepartureTime = NULL, ArrivalTime = NULL
WHERE DATEDIFF(SECOND, DepartureTime, ArrivalTime) > 0
END
EXEC usp_CancelFlights |
-- file:create_index.sql ln:54 expect:true
CREATE INDEX bt_i4_index ON bt_i4_heap USING btree (seqno int4_ops)
|
-- file:roleattributes.sql ln:64 expect:true
CREATE ROLE regress_test_replication WITH REPLICATION
|
<gh_stars>10-100
CREATE OR REPLACE FUNCTION community_service._serialize_user_basic_data(json)
RETURNS json
LANGUAGE plpgsql
IMMUTABLE
AS $function$
declare
_result json;
begin
select json_build_object(
'current_ip', ($1->>'current_ip')::text,
'... |
<reponame>Max1811/SchoolManagement<filename>database/ShoolManagementDatabase/ShoolManagementDatabase/dbo/Tables/Schools.sql
CREATE TABLE [dbo].[Schools] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[RegionId] INT NULL,
[SchoolNumber] INT NULL,
[CreationDate] DATETIME NULL,
[IsD... |
CREATE VIEW [tSQLt].[Private_SysIndexes] AS SELECT * FROM sys.indexes; |
CREATE PROCEDURE [tSQLt].[RunNew]
AS
BEGIN
EXEC tSQLt.Private_RunMethodHandler @RunMethod = 'tSQLt.Private_RunNew';
END; |
-- Server version 5.7.33
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE... |
CREATE INDEX "IX_BULK_LEP_MAP_COLLOBJID" ON "BULKLOADER_LEPIDOPTERA_MAP" ("COLLECTION_OBJECT_ID")
|
/*
Navicat Premium Data Transfer
Source Server : vm_201_database
Source Server Type : MySQL
Source Server Version : 50729
Source Host : 192.168.47.201:3306
Source Schema : logon
Target Server Type : MySQL
Target Server Version : 50729
File Encoding : 65001
Date: 30/0... |
pai -name easy_rec_ext
-Dconfig=oss://{OSS_BUCKET_NAME}/{EXP_NAME}/configs/taobao_multi_tower_boundary_test.config
-Dcmd=train
-Dboundary_table=odps://{ODPS_PROJ_NAME}/tables/boundary_info_table_{TIME_STAMP}
-Dmodel_dir="oss://{OSS_BUCKET_NAME}/easy_rec_odps_test/{EXP_NAME}/edit_boundary_test/finetune/"
-Dfine_tune_che... |
\c gptest;
-- start_ignore
drop table if exists subtx2_commit_t1;
-- end_ignore
create table subtx2_commit_t1(a1 int,a2 text) distributed randomly;
|
--/*
\connect sduser_db
\set ON_ERROR_STOP on
--*/
/* create or replace function test_fncommonsenseandproposals() returns void
language plpgsql as $$
begin
if (select count(1) from fncommonsenseandproposals(1,1)) <> 1 then
raise exception 'test_fncommonsenseandproposals failure 1'; end if;
if (select count(1) ... |
/*
SQLyog Ultimate v11.11 (32 bit)
MySQL - 5.6.16 : Database - coba
*********************************************************************
*/
/*!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>dani51/onlinetesting<filename>public/assets/css/lara.sql
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 13, 2019 at 09:15 AM
-- Server version: 10.4.8-MariaDB
-- PHP Version: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = ... |
CREATE DATABASE Online_Exam;
CREATE TABLE `online_exam`.`register` ( `id` INT NOT NULL AUTO_INCREMENT , `name` VARCHAR(20) NOT NULL , `username` VARCHAR(20) NOT NULL , `email` VARCHAR(30) NOT NULL , `password` VARCHAR(20) NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE `online_exam`.`admin` ( `id` INT NO... |
/*
@author <NAME> / 01 / XII RPL-1
*/
---- Pratikum create tabel mahasiswa, ambil_mk, matakuliah
CREATE TABLE mahasiswa(
nim int(5) PRIMARY KEY,
nama varchar(10),
jenis_kelamin enum('L', 'P'),
alamat varchar(20)
);
CREATE TABLE ambil_mk(
nim int(5),
kode_mk varchar(10)
);
CREATE TABLE matakuliah(
kode_mk ... |
<reponame>ricardojmendez/memento
-- :name create-user! :! :n
-- :doc Creates a new user record. The password is expected to be <PASSWORD>,
-- with maximum length of 162 characters, so don't use longer salts than
-- hashers' default.
INSERT INTO users (username, password) VALUES (:username, :password);
-- :name get-u... |
drop table if exists MB_ORDER_RECEIPT_INFO;
/*==============================================================*/
/* Table: MB_ORDER_RECEIPT_INFO */
/*==============================================================*/
create table MB_ORDER_RECEIPT_INFO
(
ORDER_NO varchar(50) not... |
<filename>code-master/snippets/activiti-migration/activiti-bpmn-xml-fixes/fix-skipExpression-without-namespace.sql
-- This is an example of how one could fix certain issues regarding a bpmn model in the database.
-- In this case it's a missing activiti namespace
-- start /export/home/oracle/scripts/Camunda/fix-skipExpr... |
MERGE WebProxy.WebProxyConsumer AS dest
USING (
SELECT '14950389-76FB-4429-956E-188A35220019', '', '', '') AS src (
ExternalSystemId,
ShortDescription,
FullDescription,
RouteToCompatabilityWebServiceRegex
)
ON (dest.ExternalSystemId = src.ExternalSystemId)
WHEN MATCHED THEN
UPDATE SET
ExternalSystemId = s... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 01, 2017 at 09:59 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.0.15
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SE... |
WITH source AS (
SELECT jsontext
FROM {{ source('dbt', 'run_results') }}
), flattened AS (
SELECT
d.value as data_by_row
FROM source
INNER JOIN LATERAL FLATTEN(INPUT => PARSE_JSON(jsontext['results']), outer => true) d
), model_parsed_out AS (
SELECT
data_by_row['execution_time... |
SELECT cname from customers;
SELECT cname from customers GROUP BY cname;
SELECT cname, COUNT(*) from customers GROUP BY cname;
SELECT cname, COUNT(*) from customers
JOIN rentals USING(cid)
GROUP BY cname;
SELECT cname, COUNT(rid) from customers
LEFT JOIN rentals USING(cid)
GROUP BY cname; |
USE [perpetuumsa]
GO
-------------------Live Patch 1------------------
------------Loot tweaks to L3-4 syndicates----------
DECLARE @definitionID int;
DECLARE @lootdefinitionID int;
DECLARE @npclootID int;
PRINT N'def_npc_locust_firstmate_rank4 LOOT';
SET @definitionID = (SELECT TOP 1 definition from entitydefaults ... |
--
-- PostgreSQL database cluster dump
--
SET default_transaction_read_only = off;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
--
-- Drop databases (except postgres and template1)
--
-- DROP DATABASE mezzanine;
--
-- Drop roles
--
--DROP ROLE cmsuser;
--
-- R... |
# --- !Ups
alter table ride drop constraint ck_ride_ride_status;
alter table ride add constraint ck_ride_ride_status check (ride_status in ('RideRequested','RideAccepted','RideClosed', 'RideCancelled'));
# --- !Downs
|
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: 2018-08-03 12:30:27
-- 服务器版本: 5.7.14
-- PHP Version: 7.0.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
<filename>packaging/dbscripts/disk_profiles_sp.sql
----------------------------------------------------------------------
-- Disk Profiles
----------------------------------------------------------------------
Create or replace FUNCTION GetDiskProfileByDiskProfileId(v_id UUID)
RETURNS SETOF disk_profiles STABLE
AS... |
USE [Deployments]
GO
INSERT INTO [dbo].[Application]
([ApplicationGUID]
,[ApplicationName]
,[IsTrial])
VALUES
(NEWID()
,'CAT'
,0)
INSERT INTO [dbo].[Location]
([LocationGUID]
,[LocationName]
,[Latitude]
... |
<gh_stars>10-100
CREATE TABLE "railroad_systems"."unit" ("id" varchar NOT NULL DEFAULT railroad_systems.gen_unique_short_id(), "unit_type_id" character varying NOT NULL, "name" varchar NOT NULL, "age" integer, "mileage" integer, "load" jsonb, "laden_weight" integer, "unit_weight" integer, "service_launch" timestamptz, ... |
\!gpconfig -s 'shared_preload_libraries'
create extension diskquota with version '2.0';
\!sleep 5
-- schema quota
create schema s1;
select diskquota.set_schema_quota('s1', '1 MB');
create table s1.a(i int) distributed by (i);
insert into s1.a select generate_series(1, 10000000); -- ok.
-- role quota
create schema sr... |
<reponame>stanfortonski/sosgame<gh_stars>1-10
USE SOSGAME;
CREATE TABLE IF NOT EXISTS ITEMS(
`id` SMALLINT UNSIGNED PRIMARY KEY AUTO_INCREMENT,
`id_typeitem` TINYINT UNSIGNED NOT NULL,
`id_rank` TINYINT UNSIGNED NOT NULL,
`id_stats` INT UNSIGNED NOT NULL,
`lvl_demand` SMALLINT UNSIGNED NOT NULL,
`name` CHAR(63) ... |
-- @testpoint: 数字操作函数,正切函数,与||结合
drop table if exists tan_T1;
create table tan_T1(f1 int,f2 bigint,f3 integer,f4 binary_integer,f5 bigint);
insert into tan_T1(f1,f2,f3,f4,f5) values(0,22,33,44,55);
select cast(tan(1) as number(5,2))||'abc' from sys_dummy;
select cast(tan(1||2+1)as number(5,2)) from sys_dummy;
select c... |
<gh_stars>0
-- @testpoint:opengauss关键字out非保留),作为序列名
--关键字不带引号-成功
drop sequence if exists out;
create sequence out start 100 cache 50;
drop sequence out;
--关键字带双引号-成功
drop sequence if exists "out";
create sequence "out" start 100 cache 50;
drop sequence "out";
--关键字带单引号-合理报错
drop sequence if exists 'out';
create se... |
<gh_stars>0
-- AlterTable
ALTER TABLE `venues` MODIFY `description` TEXT NULL;
|
Area_Code_and_Description,Code,Description,2001_Census_work_and_labour_force_status(2)_for_the_census_usually_resident_population_count_aged_15_years_and_over(1)_Employed_Full-time,2001_Census_work_and_labour_force_status(2)_for_the_census_usually_resident_population_count_aged_15_years_and_over(1)_Employed_Part-time,2... |
SELECT EXTRACT(YEAR
FROM CURRENT_DATE) - EXTRACT(YEAR
FROM dtadmissao) AS anos_de_trabalho
FROM funcionario
WHERE LOWER(nomefuncionario) = LOWER('Daniela');
SELECT CONCAT(UPPER(sobrenmfunc),' ',INITCAP(nomefuncionario)) AS nome
FROM funcionario;
SELECT SUBSTR... |
<reponame>fachrz/arthology
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 02, 2021 at 03:18 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 S... |
<reponame>tghaleb/kilo
SELECT * FROM layouts
GROUP BY score
ORDER BY score DESC, outward, jumps, positional_effort, alternation DESC;
|
<filename>SQL_SCRIPTS_2_WO_TRIGGERS/zestaw2/zestaw2_1.sql<gh_stars>0
DECLARE
artistid INTEGER;
inplaylists INTEGER;
BEGIN
for v_rec in (
SELECT ARTIST.ARTISTID, SUM(DT."InPlaylists") as INPLAYLISTS1
FROM TRACK
INNER JOIN
(SELECT TRACKID, COUNT(*) AS "InPlaylists" FROM PLAYLISTTRACK
GROUP BY TRACKID
... |
<gh_stars>0
ALTER TABLE workflow_version ADD CONSTRAINT workflow_version_name_fkey FOREIGN KEY (name) REFERENCES workflow (name); |
<gh_stars>0
--
-- File generated with SQLiteStudio v3.2.1 on Wed Dec 4 15:10:20 2019
--
-- Text encoding used: UTF-8
--
PRAGMA foreign_keys = off;
BEGIN TRANSACTION;
-- Table: unsur_penilaian
CREATE TABLE unsur_penilaian (ID_UNSUR int (11) NOT NULL, ID_KATEGORI int (11) NOT NULL, KEGIATAN varchar (512) NOT NULL, BATAS... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Máy chủ: db
-- Thời gian đã tạo: Th6 09, 2020 lúc 02:18 PM
-- Phiên bản máy phục vụ: 8.0.20
-- Phiên bản PHP: 7.4.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
<gh_stars>0
#
# Data for table "zt_kevinkendoui"
#
INSERT INTO `zt_kevinkendoui` VALUES (1189183,'Tom','computer09','2015-07-28 08:12:58'),(1189184,'Tom','computer03','2015-07-28 08:58:41'),(1189185,'Tom','computer02','2015-07-28 09:38:35'),(1189186,'Tom','computer02','2015-07-28 09:40:25'),(1189187,'Tom','compute... |
<reponame>kristofarkas/surechembl-data-client<filename>working/test_db/update_test.sql<gh_stars>10-100
-- Example script for insertion into the DB.
-- Used to validate script continuation on INSERT error
insert into TABLE1 values (1,2,3,4);
insert into TABLE1 values (2,2,3,4);
insert into TABLE1 values (1,2,3,4);
inse... |
SELECT
'ALTER TABLE ['+TABLE_SCHEMA+'].['+TABLE_NAME+'] ALTER COLUMN ['+COLUMN_NAME+'] VARCHAR(MAX) '
+CASE IS_NULLABLE WHEN 'YES' THEN 'NULL' ELSE 'NOT NULL' END + ';'
FROM INFORMATION_SCHEMA.COLUMNS
WHERE DATA_TYPE = 'text';
SELECT
'ALTER TABLE ['+TABLE_SCHEMA+'].['+TABLE_NAME+'] REBUILD;'
FROM INFORMATION_SCHE... |
ALTER TABLE `apps` ADD `is_use_diff_text` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0';
UPDATE `versions` SET `version` = '0.5.0' WHERE `type` = '1'; |
<filename>AsyncTest/AgentTests/Tests/Test Agent job step creation fails on syntax check.sql
CREATE PROCEDURE [AgentTests].[Test Agent job step creation fails on syntax check]
AS
BEGIN
-- Align
DECLARE @JobName NVARCHAR(128) = N'Test job';
DECLARE @StepName NVARCHAR(128) = N'Test step';
DECLARE @ExpectedStep NVAR... |
<reponame>terose73/briOS
/*
Warnings:
- You are about to drop the column `siteName` on the `Bookmark` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE `Bookmark` DROP COLUMN `siteName`,
MODIFY `title` VARCHAR(280) NULL,
MODIFY `host` VARCHAR(191) NULL,
MODIFY `description` ... |
<filename>python2.near-by.info/components/com_joomlawatch/sql/joomlawatch-73.sql
INSERT INTO `#__joomlawatch_ip2c` (`start`, `end`, `a2`, `a3`, `country`) VALUES (3577591168, 3577591807, 'DE', 'DEU', 'GERMANY'),
(3577591808, 3577591879, 'GB', 'GBR', 'UNITED KINGDOM'),
(3577591880, 3577591887, 'DE', 'DEU', 'GERMANY'),... |
/* Создать структуру БД турфирмы (можно в экселе, как я показываю на занятиях).
Что должно содержаться: кто куда летит, когда, какая оплата, может лететь группа,
могут быть пересадки на рейсах, какая страна или страны, какие города и отели, звездность отеля,
тип питания и комнат, данные о пассажирах, необходимость ви... |
<gh_stars>0
Insert into CERTIFICATE_TYPE_CODE (CERTIFICATE_TYPE_CODE,LABEL,DESCRIPTION,DISPLAY_ORDER,EFFECTIVE_DATE,EXPIRY_DATE,CREATE_USER,CREATE_DATE,UPDATE_USER,UPDATE_DATE) values ('F','F','diplôme de fin d’études secondaire en Colombie-Britannique - French Immersion',0,to_date('21-07-19','RR-MM-DD'),to_date('99-12... |
CREATE VIEW kname AS
SELECT u.id, u.rank, n.scientific_name, u.is_synonym, u.status, u.origin, kn.scientific_name as kingdom, u.dataset_key
FROM name_usage u
JOIN name n on u.name_fk=n.id
LEFT JOIN name_usage ku on u.kingdom_fk=ku.id
LEFT JOIN name kn on ku.name_fk=kn.id;
CREATE VIEW nub as
SELECT u.id... |
-- 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.
set pause on
define moats_priv_target = &moats_priv_target;
prompt
prompt
prompt **************************************************************... |
# --- Add Created Timestamp definition for applicants
# --- !Ups
alter table applicants add when_created timestamp;
update applicants set when_created = current_timestamp where when_created is null;
# --- !Downs
alter table applicants drop column when_created;
|
--DDL for scheduler reconciliations
CREATE TABLE IF NOT EXISTS scheduler_reconciliations (
"scheduling_id" varchar(255) NOT NULL,
"lock" varchar(255) UNIQUE, --make sure just one cluster can be reconciled at the same time
"cluster" varchar(255) NOT NULL,
"cluster_config" int NOT NULL,
"cluster_confi... |
select `s_store_name`, `i_item_desc`, `sc`.`revenue`, `i_current_price`, `i_wholesale_cost`, `i_brand`
from (select `ss_store_sk`, avg(`revenue`) as `ave`
from (select `ss_store_sk`, `ss_item_sk`, sum(`ss_sales_price`) as `revenue`
from `store_sales`
where `ss_sold_date_sk` = `d_date_sk` and `d_month_seq` between asymm... |
<filename>openGaussBase/testcase/KEYWORDS/trigger_schema/Opengauss_Function_Keyword_Trigger_schema_Case0018.sql
-- @testpoint:opengauss关键字trigger_schema(非保留),作为数据库名
--关键字不带引号-成功
drop database if exists trigger_schema;
create database trigger_schema;
drop database trigger_schema;
--关键字带双引号-成功
drop database if exists ... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 17-Jan-2021 às 18:20
-- Versão do servidor: 10.4.17-MariaDB
-- versão do PHP: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Mar 31, 2016 at 03:58 AM
-- Server version: 10.0.20-MariaDB
-- PHP Version: 5.6.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_... |
-- the password hash is generated by BCrypt Calculator Generator(https://www.dailycred.com/article/bcrypt-calculator)
INSERT INTO users (id, username, password, first_name, last_name, email, phone_number, enabled) VALUES (1, 'user', '$2a$04$Vbug2lwwJGrvUXTj6z7ff.97IzVBkrJ1XfApfGNl.Z695zqcnPYra', 'Fan', 'Jin', '<EMAIL>'... |
<gh_stars>0
DROP FUNCTION get_all_location();
CREATE FUNCTION get_all_location() RETURNS SETOF incidents as 'SELECT id, lat, lng, NULL AS radius
FROM devices UNION SELECT * FROM incidents;' language 'sql'; |
<reponame>buse974/twic-api
INSERT INTO `role` (`id`, `name`) VALUES (7, 'external');
|
-- MariaDB dump 10.19 Distrib 10.6.4-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: teste
-- ------------------------------------------------------
-- Server version 10.6.4-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */
;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET... |
USE myconnector;
DROP TABLE dictionary;
CREATE TABLE dictionary(
word VARCHAR(64) NOT NULL PRIMARY KEY,
def VARCHAR(255)
); |
<gh_stars>1-10
CREATE VIEW [Data_Pub].[DAS_Employer_PayeSchemes]
AS
SELECT
EPS.[Id]
,EPS.[DasAccountId]
,HASHBYTES('SHA2_512',EPS.[Ref]) AS PAYEReference
,EPS.[Name] AS PAYESchemeName
,EPS.[AddedDate]
,EPS.[RemovedDate]
,EPS.[UpdateDateTime]
-- Additional Columns for UpdateDateTime represe... |
<reponame>akoidan/node-db-migration
CREATE TABLE pet (name VARCHAR(20));
insert into pet(name) values ('Rex', 'asd' 123)
|
<gh_stars>1-10
drop table if exists MB_INVOICE_PAYFROM_DETAIL;
/*==============================================================*/
/* Table: MB_INVOICE_PAYFROM_DETAIL */
/*==============================================================*/
create table MB_INVOICE_PAYFROM_DETAIL
(
... |
<reponame>rokon12/mNet
-- MySQL dump 10.13 Distrib 5.6.19, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: mnet
-- ------------------------------------------------------
-- Server version 5.6.19-0ubuntu0.14.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARA... |
////////////////////////////////////////////////////////////////////////
//
// Create a snapshot report
//
// Note: This script will be processed by neo4j-shell utility
// All comments in Java Style: line preceded by //
// Its syntax must be list of cypher queries and neo4j-shell commands
// separated by ';'
//
///////... |
<filename>db/hotspot_5m.sql
drop table if exists hotspot_5m;
create table hotspot_5m (
id int primary key auto_increment,
Symbol varchar(16) NOT NULL,
HotRank int(12) NOT NULL DEFAULT 0,
HighLowRatio DOUBLE(20,8) NOT NULL DEFAULT 0,
VolumeRatio DOUBLE(20,8) NOT NULL DEFAULT 0,
C... |
-- https://aws.amazon.com/blogs/database/managing-postgresql-users-and-roles/
-- Revoke privileges from 'public' role
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON DATABASE "appDevDb" FROM PUBLIC;
CREATE SCHEMA app;
-- Read-only role
CREATE ROLE readonly;
GRANT CONNECT ON DATABASE "appDevDb" TO readonly;
... |
USE [perpetuumsa]
GO
/*
BEGIN TRANSACTION
ROLLBACK TRANSACTION
COMMIT TRANSACTION
*/
-------------Balance fix prototype inconsistent velocities and armors------------
PRINT N'Balance fixes for prototype inconsistencies as of 3/4/2018';
DECLARE @definitionID int;
DECLARE @aggvalueID int;
DECLARE @aggfieldID int;
P... |
ALTER TABLE meal_plan
ADD servings INTEGER DEFAULT 1;
ALTER TABLE recipes
ADD type TEXT DEFAULT 'normal';
CREATE INDEX ix_recipes ON recipes (
name,
type
);
CREATE TRIGGER create_internal_recipe AFTER INSERT ON meal_plan
BEGIN
-- Create a recipe per day
DELETE FROM recipes
WHERE name = NEW.day
AND type = 'mea... |
<gh_stars>1-10
SET DEFINE OFF;
ALTER TABLE LIST ADD PRIORITY VARCHAR2(10);
ALTER TABLE LIST_SEARCH_CANDIDATE ADD PRIORITY VARCHAR2(10);
|
DROP TABLE IF EXISTS uzer CASCADE;
CREATE TABLE uzer (
login CHAR(8) PRIMARY KEY,
password VARCHAR(16) NOT NULL,
name VARCHAR(16) NOT NULL
);
INSERT INTO uzer VALUES ('irkalii', '{noop}irkalii', 'Иркалий');
INSERT INTO uzer VALUES ('seller', '{noop}seller', 'Селлер');
INSERT INTO uzer VALUES ('princess', '... |
-- Database: sybase
-- Change Parameter: columnDataType=int
-- Change Parameter: columnName=id
-- Change Parameter: tableName=person
ALTER TABLE [person] MODIFY [id] INT IDENTITY;
|
CREATE TABLE IF NOT EXISTS `JSON_SCHEMA_VALIDATION_RESULTS` (
`OBJECT_ID` BIGINT NOT NULL,
`OBJECT_TYPE` ENUM ('entity'),
`OBJECT_ETAG` char(36) NOT NULL,
`SCHEMA_ID` VARCHAR(753) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL,
`IS_VALID` BOOLEAN NOT NULL,
`VALIDATED_ON` TIMESTAMP(3) NOT NULL,
`ERR... |
-- Revert delivery:projects_full_scm_module from pg
BEGIN;
CREATE TYPE cd_project_type AS ENUM('local',
'github');
COMMENT ON TYPE cd_project_type IS
$$
When appended to `deliv_scm_` should name an Erlang module in server.
$$;
ALTER TABLE projects RENAME COLUMN scm_module TO type... |
CREATE TABLE `users` (
`id` int,
`full_name` varchar(255),
`email` varchar(255) UNIQUE,
`gender` varchar(255),
`date_of_birth` varchar(255),
`created_at` varchar(255),
`country_code` int,
`active` boolean,
PRIMARY KEY (`id`, `full_name`)
);
CREATE TABLE IF NOT EXISTS `products`
(
`id` int PRIMARY ... |
DROP TABLE IF EXISTS history;
CREATE TABLE history(
id UNSIGNED INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
chat_id VARCHAR(60),
chat_title VARCHAR(60),
user_id VARCHAR(60),
username VARCHAR(60),
avatar_16 VARCHAR(90),
avatar_32 VARCHAR(90),
timestamp UNSIGNED INTEGER NOT NULL DEFAULT ... |
<filename>umkm_revisi.sql<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 30, 2020 at 10:29 AM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time... |
<reponame>rafaelgreca/hackerrank-solutions
SELECT CONCAT(name, '(', LEFT(occupation, 1), ')') as name_occupation
FROM occupations
ORDER BY name_occupation ASC;
SELECT CONCAT('There are a total of ', COUNT(name), ' ', LOWER(occupation), 's.')
FROM occupations
GROUP BY occupation
ORDER BY COUNT(name), occupation; |
<filename>DB_Vico.sql<gh_stars>0
--
-- PostgreSQL database dump
--
-- Dumped from database version 11.4
-- Dumped by pg_dump version 11.4
-- Started on 2019-07-09 09:10:01
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conformi... |
INSERT INTO rooms (name, floor, description) VALUES ( '101', 1, '');
INSERT INTO rooms (name, floor, description) VALUES ( '102', 1, '');
INSERT INTO rooms (name, floor, description) VALUES ( '201', 2, '');
INSERT INTO rooms (name, floor, description) VALUES ( '202', 2, '');
INSERT INTO clients (title, name, last_name... |
<reponame>Miteshmodi003/employee-tracker
USE companyDB;
INSERT into department (name) VALUES ("Sales");
INSERT into department (name) VALUES ("Information Technology");
INSERT into department (name) VALUES ("Human Resource");
INSERT into department (name) VALUES ("Client Care");
INSERT into role (title, salary, depar... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.