sql stringlengths 6 1.05M |
|---|
insert into city values
(2441289,"Maradi","NE",7.25,14.25),
(2441291,"Maradi","NE",7.10174,13.5),
(2448085,"Agadez","NE",7.99111,16.97333),
(2447513,"Arlit","NE",7.38528,18.73694),
(2317301,"Baraka","CD",18.6,4.35),
(934913,"Nhlangano","SZ",31.200001,-27.116671),
(934966,"Mhlume","SZ",31.85,-26.033331),
(935048,"Lobamb... |
ALTER TABLE `sensors` ADD `measured_class` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `entPhysicalIndex_measured` , ADD `measured_entity` VARCHAR( 32 ) NULL DEFAULT NULL AFTER `measured_class`;
ALTER TABLE `sensors` CHANGE `sensor_class` `sensor_class` VARCHAR( 64 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NUL... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 07, 2020 at 08:01 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
--CREATE TABLE GenericPerson(
-- PersonID int NOT NULL,
-- LastName varchar(100),
-- FirstName varchar(100) NOT NULL,
-- Age int,
-- dCreated datetime NOT NULL,
-- dUpdated datetime NOT NULL,
-- PRIMARY KEY (PersonID)
--);
--CREATE TABLE GenericPhoneNumber(
-- PhoneNumberID varchar(255) NOT NULL PRIMARY KEY ,
-- Area... |
DROP PROCEDURE IF EXISTS `read`;
CREATE PROCEDURE `read`(_stream_id CHAR(42),
_count INT,
_version INT,
_forwards BOOLEAN,
_prefetch BOOLEAN)
BEGIN
DECLARE _stream_id_internal INT;
SELECT streams.id_internal INTO _stream_id_int... |
-- phpMyAdmin SQL Dump
-- version 3.5.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 30, 2018 at 12:06 PM
-- Server version: 5.5.24-log
-- PHP Version: 5.3.13
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
CREATE PROCEDURE [dbo].[DEL_CONVENIO_PR]
@P_CEDULA_JURIDICA int
AS
Begin
SET NOCOUNT ON;
Update TBL_CONVENIO
SET
ESTADO = 'Inactivo'
where CEDULA_JURIDICA = @P_CEDULA_JURIDICA
End
GO
|
/**************************************************************************
* Copyright 2016 Observational Health Data Sciences and Informatics (OHDSI)
*
* 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 Li... |
SET SCAN OFF
SET TIMING ON
PROMPT install packages
@AS_PDF3_MOD.pls
@PK_JRXML2PDF_TYPES.pls
@PK_JRXML2PDF_UTIL.pls
@PK_JRXML2PDF_CHARTS.pls
@PK_JRXML2PDF_LOADER.pls
@PK_JRXML2PDF_REPGEN.pls
PROMPT finished
|
-- purpose : To get hidden param values
-- Source : https://exadatadba.blog/2019/05/10/underscoring-the-magical-world-of-oracle-database-hidden-parameters/
-- example : @pvalid2 optimizer
-- Run FROM : SYS user
-- ------------------------------------------
col hparam format a50;
col hparamval format a50;
... |
select t1.Nom, t2.Plat, t2.Prix
from "database/gens.csv" t1, "database/plats.csv" t2
where t1.Plat = t2.Plat
order by t2.Prix;
|
DROP DATABASE IF EXISTS mvc_dashboard_db;
CREATE DATABASE mvc_dashboard_db;
|
-->-->-- src/Frapid.Web/Areas/MixERP.HRM/db/PostgreSQL/2.x/2.0/db/src/01.types-domains-tables-and-constraints/tables-and-constraints.sql --<--<--
/********************************************************************************
Copyright (C) MixERP Inc. (http://mixof.org).
This file is part of MixERP.
MixERP is f... |
ALTER TYPE action_type ADD VALUE 'REJECT';
|
-- src/listopia/list/sql/list.sql
-- listopia list queries
-- :name create-list! :? :n
-- :doc insert a single list, returning the id, thus the ? in the name rather than ! for execute
insert into list (name, description, user_id)
values (:name, :description, :user-id)
returning id
-- :name delete-list! :! :n
-- :do... |
<filename>sql/index.sql
\set ECHO none
SELECT set_sphere_output_precision(8);
\set ECHO all
-- without idx
SELECT count(*) FROM spheretmp1 WHERE p @ scircle '<(1,1),0.3>';
SELECT count(*) FROM spheretmp1 WHERE p = spoint '(3.09 , 1.25)' ;
SELECT count(*) FROM spheretmp2 WHERE c @ scircle '<(1,1),0.3>';
SELECT coun... |
SELECT t1.name, count(*)
FROM
site as s,
so_user as u1,
question as q1,
answer as a1,
tag as t1,
tag_question as tq1
WHERE
q1.owner_user_id = u1.id
AND a1.question_id = q1.id
AND a1.owner_user_id = u1.id
AND s.site_id = q1.site_id
AND s.site_id = a1.site_id
AND s.site_id = u1.site_id
AND s.site_id = tq1.site_id
AND s.s... |
SELECT pg_terminate_backend(pg_stat_activity.pid)
FROM pg_stat_activity
WHERE pg_stat_activity.datname = 'corona_db' -- ← change this to your DB
AND pid <> pg_backend_pid();
-- SELECT pg_terminate_backend(pid int) |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 1192.168.3.11
-- Generation Time: Jul 25, 2020 at 11:04 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
<gh_stars>0
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 1172.16.17.32
-- Generation Time: Jul 24, 2020 at 11:57 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.2.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
<filename>json/wfs.sql
INSERT INTO media VALUES ("ltr_als1631","letter","1847-09-23","Penon","","MEX","Antonio","Santa Anna",NULL,"","",NULL,"individual",NULL,"President Santa Anna's offer of general quarters to american troops","ltr_als1631.txt","<EMAIL>",NULL,20090802183836,NULL,53,0);
INSERT INTO media VALUES ("ltr_... |
<reponame>PooyaFekri/LinkedIn
create table if not exists user
(
first_name nvarchar not null,
last_name nvarchar not null,
intro nvarchar,
birthday nchar(50) not null,
id INTEGER not null
constraint user_pk
primary key autoincrement,
u... |
SELECT name FROM people
JOIN directors ON directors.person_id = people.id
Join movies ON movies.id = directors.movie_id
JOIN ratings ON ratings.movie_id = movies.id
WHERE ratings.rating >= 9.0; |
<gh_stars>1-10
PROMPT Dropping views
drop view customer_order_products;
drop view product_orders;
drop view product_reviews;
drop view store_orders;
PROMPT Dropping tables
drop table order_items
cascade constraints;
drop table orders
cascade constraints;
drop table products
cascade constraints;
drop table stores... |
<gh_stars>100-1000
-- insert4.test
--
-- execsql {
-- DELETE FROM t1;
-- DELETE FROM t2;
-- INSERT INTO t2 VALUES(9,1);
-- }
DELETE FROM t1;
DELETE FROM t2;
INSERT INTO t2 VALUES(9,1); |
<reponame>clowniii/laravelTest
# Host: localhost (Version: 5.7.26)
# Date: 2020-01-15 09:23:46
# Generator: MySQL-Front 5.3 (Build 4.234)
/*!40101 SET NAMES utf8 */;
#
# Structure for table "configs"
#
DROP TABLE IF EXISTS `configs`;
CREATE TABLE `configs` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`... |
<reponame>junitas/coreflightexec<gh_stars>1-10
PROC $sc_$cpu_print_sb_pipes(stepnum, totalpipes)
;**********************************************************************
; Proc Name: $sc_$cpu_print_sb_pipes
;
; Proc Description
; This procedure will print out the routing inforation for the
; SB Test Pipe... |
<filename>src/diff.uninstall.sql
DROP PROCEDURE IF EXISTS Diff.Uninstall
GO
CREATE PROCEDURE Diff.Uninstall
AS
BEGIN
EXEC tSQLt.DropClass 'Diff';
END |
select d38, COUNT(DISTINCT c_integer) from alltypes_v group by d38 order by d38;
|
<reponame>epam-debrecen-rft-2015/atsy<filename>persistence/src/test/resources/sql/stateflow/stateflow.sql
INSERT INTO states(id,name)
VALUES(80,'test');
INSERT INTO state_flow(from_id, to_id)
VALUES(80, 12);
INSERT INTO state_flow(from_id, to_id)
VALUES(80, 13);
INSERT INTO state_flow(from_id, to_id)
VALUES(80, 14); |
-- Design note
-- Users and clients are separate tables, but a single keys table makes more sense. Unfortunately we can't do
-- foreign key constraints against two tables. Instead we create the effect of 'ON DELETE CASCADE' via a trigger.
-- However that doesn't prohibit orphaned keys in the table, as we can insert ke... |
insert into ZONE_TBL (id,zone_name) values(1,'SHA');
insert into ZONE_TBL (id,zone_name) values(2,'FRA');
insert into DC_TBL (id,zone_id,dc_name,dc_active,dc_description,dc_last_modified_time) values (1,1,'jq',1,'DC:jq','0000000000000000');
insert into DC_TBL (id,zone_id,dc_name,dc_active,dc_description,dc_last_modifi... |
<gh_stars>1-10
-- +migrate Up
ALTER TABLE pokemon ADD COLUMN defense INT, ADD COLUMN defense_speed INT;
-- +migrate Down
ALTER TABLE pokemon DROP COLUMN defense, DROP COLUMN defense_speed;
|
<reponame>lambda-land/VDBMS
-- ##########
-- # v_employee
-- ##########
-- # create a view for p1_employee for product focusing on daily usage. (enhanced email)
-- # SELECT count(eid) -- 30
CREATE OR REPLACE view p1_employee_view AS
SELECT eid, firstname, lastname, email_id, folder, status
FROM employeelist emp
WH... |
CREATE TABLE IF NOT EXISTS table2base (
page_id varchar(50) NULL DEFAULT NULL,
tag_text varchar(5000) NULL DEFAULT NULL,
time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
name varchar(100) NULL
) |
-- AlterTable
ALTER TABLE "Guild" ALTER COLUMN "guildId" SET DATA TYPE TEXT;
-- AlterTable
ALTER TABLE "UserInfo" ALTER COLUMN "guildId" SET DATA TYPE TEXT;
|
<filename>prisma/migrations/20211007143345_address_simulation_id_unique/migration.sql
-- RenameIndex
ALTER INDEX "Address_simulationId_unique" RENAME TO "Address_simulationId_key";
|
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 03-10-2019 a las 23:17:56
-- Versión del servidor: 10.3.15-MariaDB
-- Versión de PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00"... |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Mar 06, 2017 at 03:15 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... |
<gh_stars>0
/*
Warnings:
- You are about to drop the `Profile` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE "Profile";
-- CreateTable
CREATE TABLE "profile" (
"discord_id" TEXT NOT NULL,
"bio" TEXT NOT NULL,
PRIMARY KEY ("discord_id")
);
|
<reponame>pan-narrans/DAW<gh_stars>0
# 1. Lista el nombre de todos los productos que hay en la tabla producto.
SELECT p.nombre FROM producto p;
# 2. Lista los nombres y los precios de todos los productos de la tabla producto.
SELECT p.nombre, p.precio FROM producto p;
# 3. Lista todas las columnas de la tabla produ... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 09, 2020 at 02:37 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
<reponame>flyelmos/Software-University<filename>07. MSSQL Server - Databases Basics/03. Built-in Functions Exercises/Built-in Functions Exercises/04. Find All Employees Except Engineers.sql
SELECT FirstName, LastName FROM Employees
WHERE NOT CHARINDEX('engineer', JobTitle) > 0 |
drop table erasmus;
/
create table erasmus (
numar_matricol varchar2(6 byte),
num varchar2(15 byte),
pren varchar2(30 byte),
tara number(4,0)
);
/
create unique index index_nr ON erasmus(numar_matricol);
/
set serveroutput on;
declare
v_random studenti.id%type;
begin
for i in 1..100 loop
v_random:= TRUNC(dbms_... |
<gh_stars>1-10
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 31, 2020 at 07:01 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.26
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
<filename>datacamp-master/intro-to-sql-for-data-science/01-selecting-columns/11-practice-with-count.sql
/*
Practice with COUNT
As you've seen, COUNT(*) tells you how many rows are in a table. However, if you want to count the number of non-missing values in a particular column, you can call COUNT on just that column.
... |
/* 查询不选1号课程的学生学号与姓名 */
select no, name from student where not exists(
select * from sc where sno = student.name and cno = '1'
);
|
-- MySQL dump 10.13 Distrib 5.7.20, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: smart_core
-- ------------------------------------------------------
-- Server version 5.7.20-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS ... |
<filename>src/main/resources/db/migration/data/R__7_9__QUESTIONNAIRE_ANSWERS.sql
INSERT INTO QUESTIONNAIRE_ANSWERS (QUESTIONNAIRE_ANS_ID, QUESTIONNAIRE_QUE_ID, NEXT_QUESTIONNAIRE_QUE_ID, ANS_SEQ, DESCRIPTION) VALUES (178912, 44127, 44913, 1, 'YES (ENTER DATE)');
INSERT INTO QUESTIONNAIRE_ANSWERS (QUESTIONNAIRE_ANS_ID, ... |
-- UNION
-- Birden fazla select sonucunu tek seferde göstermek için kullanılıt
-- JOIN yan yana, UNION lar alt alta birleştirir
-- JOINLer ilişkili , UNION lar ilişkili değildir
-- UNION kolon isimleri ilk tablonun kolon isimleri olur
-- UNION tabloları kolon sayısı aynı olmalı
-- UNION tablo kolonları benzer veri t... |
<gh_stars>10-100
-- file:rolenames.sql ln:219 expect:true
CREATE TABLE testtab1 (a int)
|
<reponame>SeanSobey/leasot<filename>tests/fixtures/sql.sql
CREATE OR REPLACE FUNCTION "USER"."F_TEST"
/*
Test function
@TODO: Sql multi comment
*/
( aParam VARCHAR2 )
RETURN VARCHAR2 AS
BEGIN
-- TODO Sql single comment
RETURN '1';
END F_TEST;
/ |
<reponame>smith750/kc<gh_stars>0
\. ./../../current_mysql/5.1.1/rice/KR_RICE_01_2.1.5-2.1.6_2013-04-30_B000.sql
commit;
exit
|
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 21, 2017 at 04:51 AM
-- Server version: 10.0.17-MariaDB
-- PHP Version: 5.6.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_... |
<filename>DB NEW/distroit.sql
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 04/01/2018 23:38:48 */
/*==============================================================*/
drop table if exists... |
<reponame>JTOne123/CommonFoundation
CREATE PROCEDURE [dbo].[sp_UpdateSystemConfiguration](
@Key NVARCHAR(64),
@Type NVARCHAR(256),
@MinComponentVersionRequired NVARCHAR(32),
@MaxComponentVersionLimited NVARCHAR(32),
@Value NVARCHAR(MAX)
)
AS
SET NOCOUNT ON;
BEGIN
DECLARE @NowTime AS DATETIME = G... |
<reponame>peoplerelay/peoplerelay<gh_stars>1-10
/* ======================================================================== */
/* PeopleRelay: reglog.sql Version: 0.4.3.6 */
/* */
/* Copyright 2017-2018 <NAME> & ... |
--
-- personality_cluster_info
--
CREATE SEQUENCE pers_clst_info_seq;
CREATE TABLE personality_cluster_info (
id INTEGER,
personality_id INTEGER,
cluster_type VARCHAR(16 CHAR),
creation_date DATE,
CONSTRAINT pers_clst_info_pk PRIMARY KEY (id),
CONSTRAINT pers_clst_info_pers_fk FOREIGN KEY(personality_id) RE... |
<reponame>BrunoMacias/thanks<filename>migrations/20170313150548_use_commit_sha_for_pk/down.sql
ALTER TABLE commits DROP CONSTRAINT commits_pkey;
ALTER TABLE commits ADD COLUMN id SERIAL PRIMARY KEY;
|
/*!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 */;
/*!40101 SET NAMES utf8 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101... |
# Device Renames
into_all all code_regex _T_([0-6]) replaceall_matched begin T_%1 end;
into device label PIC set_label begin IPIC end;
into device label DMAD set_label begin DMAC end;
into device label TMR set_label begin TIMR end;
into device label RTC0 set_label begin RTC end;
into device label COPR set_label begin ... |
create table t1 (id1 int primary key);
insert into t1 values(1);
insert into t1 values(2);
select default(id1) from t1;
drop table t1;
create table t1 (id1 int default 15 primary key );
insert into t1 values(1);
insert into t1 values(2);
select default(id1) from t1;
drop table t1;
create table t1 (id1 int not null... |
-- @testpoint: to_date函数,将文本类型的值转换为指定格式的时间戳,参数多/少输入的函数测试,合理报错
select to_date('2018','yyyy','2018','yyyy');
select to_date('2018-01-15','yyyy-mm','dd'); |
-- examples on alter table
use hron;
-- check the current table status
describe item;
-- add a column
alter table item add column counter decimal(65, 30);
-- drop a column
alter table item drop column counter;
-- add check
alter table item add constraint check(status in ('A', 'B', 'X'));
-- Error Code: 3819. Check... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 14, 2017 at 01:17 AM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 7.1.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
/* Create view to train the model */
CREATE VIEW MaternalRiskTrain AS
SELECT BS, BodyTemp, DiastolicBP, HeartRate, RiskLevel, SystolicBP, age
FROM dc_data_health.MaternalHealthRisk WHERE ID < 801
/* Create de Prediction model - predicting the maternal risk level */
CREATE MODEL MaternalRiskModel PREDICTING (RiskLevel)... |
CREATE FUNCTION foo(int) RETURNS int AS $$
BEGIN
RETURN $1;
END
$$ LANGUAGE 'plpgsql' IMMUTABLE STRICT; |
DROP DATABASE IF EXISTS bankdb;
CREATE DATABASE bankdb;
USE bankdb;
DROP TABLE IF EXISTS account;
DROP TABLE IF EXISTS customer;
DROP TABLE IF EXISTS operation;
CREATE TABLE customer(
id INT UNSIGNED AUTO_INCREMENT NOT NULL,
civilite ENUM('Mr','Mme'),
lastname VARCHAR(250) NOT NULL,
firstname VARC... |
SELECT *
FROM Towns
WHERE [Name] LIKE 'M%'
OR [Name] LIKE 'K%'
OR [Name] LIKE 'B%'
OR [Name] LIKE 'E%'
ORDER BY [Name] |
<reponame>trione31/asdp-info
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 18 Jun 2017 pada 09.50
-- Versi Server: 5.6.21
-- PHP Version: 5.5.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: ahmadah1_shopping-cart
-- ------------------------------------------------------
-- Server version 5.7.14
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_... |
CREATE OR REPLACE PROCEDURE Insert_Zone_Comsumption(json_data JSON)
LANGUAGE plpgsql
AS $$
BEGIN
INSERT INTO Zone_Comsumptions (zone_cod,comsumption_cod)
SELECT zone_cod,comsumption_cod FROM json_populate_record(
NULL::Zone_Comsumptions,
$1
);
END
$$ |
use movies_hive;
CREATE table IF NOT EXISTS good_movies as
select movie_id,count(*) as votes,avg(rating) as avg_rating from
(select * from ratings where rating > 3 ) sub
group by movie_id
having count(*) > 5;
CREATE table IF NOT EXISTS good_ratings as
select r.user_id,r.movie_id from good_movies g join ratings r ... |
<filename>5.2.3/Database/Constraints/AFW_12_LIEN_GROUP_APROB_PK.sql
SET DEFINE OFF;
ALTER TABLE AFW_12_LIEN_GROUP_APROB ADD (
CONSTRAINT AFW_12_LIEN_GROUP_APROB_PK
PRIMARY KEY
(SEQNC)
ENABLE VALIDATE)
/
|
create table WebHook (
Id nvarchar(32) not null,
GatewayName nvarchar(16) not null,
DeviceId nvarchar(64) not null,
constraint PK_WebHook primary key (Id)
)
|
<filename>IS675/HW04/Questions(5,7,8,11,13)/Question_7_Query.sql
-- 7. Summarize the amount of time worked in the TimeSheet table by job and task.
-- Sort the result table by taskID within jobID.
-- The result table should produce43 rows.
SELECT
JobID,
TaskID,
Count(*) 'NumberOfTimeCards',
SUM(HoursWorked) 'Tot... |
<filename>src/test/resources/fts3ab.test_5.sql
-- fts3ab.test
--
-- execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'one'}
SELECT rowid FROM t1 WHERE t1 MATCH 'one' |
alter table ACT_HI_PROCINST
add NAME_ NVARCHAR2(255);
create table ACT_HI_EVT_LOG (
LOG_NR_ NUMBER(19),
TYPE_ NVARCHAR2(64),
PROC_DEF_ID_ NVARCHAR2(64),
PROC_INST_ID_ NVARCHAR2(64),
EXECUTION_ID_ NVARCHAR2(64),
TASK_ID_ NVARCHAR2(64),
TIME_STAMP_ TIMESTAMP(6) not null,
USER_ID_ NVARCH... |
words(word STRING, length INT) input1.txt
|
SELECT
*
FROM [MABanners]
WHERE
[BannerCd] = @BannerCd |
CREATE USER 'newrelic'@'%' IDENTIFIED BY 'newrelic';
GRANT REPLICATION CLIENT ON *.* TO 'newrelic'@'%' WITH MAX_USER_CONNECTIONS 5; |
<gh_stars>10-100
DROP TABLE IF EXISTS json;
CREATE TABLE json (x Enum8('browser' = 1, 'mobile' = 2), y String) ENGINE = Memory;
INSERT INTO json (y) VALUES ('Hello');
SELECT * FROM json ORDER BY y;
INSERT INTO json (y) FORMAT JSONEachRow {"y": "World 1"};
SELECT * FROM json ORDER BY y;
INSERT INTO json (x, y) FORMAT... |
-- Name: GetModuleToTableArgs
-- Schema: posda_queries
-- Columns: ['tag_cannonical_name', 'tag', 'posda_table_name', 'column_name', 'preparation_description']
-- Args: ['table_name']
-- Tags: ['bills_test', 'posda_db_populate']
-- Description: Add a filter to a tab
select *
from
dicom_tag_parm_column_table natural... |
<reponame>holunda-io/polyflow-examples<gh_stars>1-10
CREATE TABLE plf_data_entry (
entry_id VARCHAR(255) NOT NULL,
entry_type VARCHAR(255) NOT NULL,
application_name VARCHAR(255) NOT NULL,
date_created TIMESTAMP NOT NULL,
description OID,
form_key VARCHAR(255),
... |
<reponame>Keendata/impala
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
#... |
-- Revert nz-buildings:buildings_bulk_load/default_values from pg
BEGIN;
TRUNCATE buildings_bulk_load.organisation CASCADE;
TRUNCATE buildings_bulk_load.bulk_load_status CASCADE;
TRUNCATE buildings_bulk_load.qa_status CASCADE;
COMMIT;
|
DROP TABLE sensor_data;
|
create table t1 (a integer auto_increment, i1 integer, s1 varchar(10), d1 double, c1 set(int));
-- expected domain = int
prepare st from 'insert into t1(i1) values (? * ?)'
execute st using 4, 2;
prepare st from 'insert into t1(i1) values (? * ?)'
execute st using 4, '2';
prepare st from 'insert into t1(i1) values (... |
<filename>src/main/resources/db/migration/V1__create_script_table.sql
CREATE TABLE IF NOT EXISTS `groovy_script` (
`id` int NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` varchar(100) NOT NULL,
`body` varchar(300)
)ENGINE=InnoDB DEFAULT CHARSET=UTF8;
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 24 Apr 2020 pada 03.43
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.4.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
select * from CaseTypes
select * from CaseTypeGroups where id in(45,46) |
-- SQL CREATE DATABASE Statement
CREATE DATABASE Ayubo_Travels;
-- The SQL DROP DATABASE Statement
DROP DATABASE Ayubo_Travels;
-- The SQL CREATE TABLE Statement (Login)
CREATE TABLE Login (
ID int PRIMARY KEY IDENTITY(1,1) NOT NULL,
USERNAME varchar(255),
PASSWORD varchar(255),
EMAIL varchar... |
<filename>databases/user.sql<gh_stars>0
/*
Navicat MySQL Data Transfer
Source Server : HomeInter
Source Server Version : 50547
Source Host : 192.168.169.18:3306
Source Database : homeinter
Target Server Type : MYSQL
Target Server Version : 50547
File Encoding : 65001
Da... |
<reponame>iitmsofteng/prework-sql
select * from employees;
-- create another table for joining
create table department(
dept_id int(10),
dept varchar(20),
dept_loc varchar(20)
);
select * from department;
insert into department(dept_id, dept, dept_loc) values(1, 'Content', 'chicago');
insert into department(dept_i... |
CREATE TABLE GOODS
(
ID BIGINT PRIMARY KEY AUTO_INCREMENT,
SHOP_ID BIGINT,
NAME VARCHAR(100),
DESCRIPTION VARCHAR(1024),
DETAILS TEXT,
IMG_URL VARCHAR(1024),
PRICE DECIMAL,
STOCK INT NOT NULL DEFAULT 0,
STATUS VARCHAR(16), -- 'ok' 正常... |
<reponame>AerisG222/mikeandwan.us<gh_stars>0
select concat('insert into photo.photo (
id,
category_id,
is_private,
xs_height,
xs_width,
xs_path,
sm_height,
sm_width,
sm_path,
md_height,
md_width,
md_path,
lg_height,
lg_width,
lg_path,
src_height,
src_... |
<gh_stars>0
CREATE DATABASE ProblemFive
CREATE TABLE Cities(
CityID INT NOT NULL,
[Name] VARCHAR(50) NOT NULL,
CONSTRAINT PK_Cities PRIMARY KEY (CityID)
)
CREATE TABLE Customers(
CustomerID INT NOT NULL,
[Name] VARCHAR(50) NOT NULL,
BirthdaY DATE,
CityID INT NOT NULL,
CONSTRAINT PK_Customers PRIMARY KEY (CustomerID... |
<filename>req1.sql
select p.Contact.Nom_Ens
from Professionnel p
where Nom_P = 'Dupont'
and Prenom_P = 'Jean';
|
<filename>Scripts/CARDINFO.sql
<<<<<<< HEAD
INSERT INTO [CARDINFO] VALUES ('NC00103003', '年卡', 'TS1816'); GO
INSERT INTO [CARDINFO] VALUES ('NC00103004', '年卡', 'TS6666'); GO
INSERT INTO [CARDINFO] VALUES ('YC00204001', '月卡', 'TS1002'); GO
=======
INSERT INTO [CARDINFO] VALUES ('NC00103003', '年卡', 'TS1816'); GO
INSERT I... |
-- Filter a full transcript entry by a partial match of a location in trenton mentioned in the transcript
-- This file is a demonstrative example. Please update to match your database snapshot in order to run this
-- Query created as a group. File created by <NAME>. Reviewed by <NAME> and <NAME>
SELECT * FROM full_tran... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.