text stringlengths 6 9.38M |
|---|
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Erstellungszeit: 15. Sep 2015 um 16:03
-- Server-Version: 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 */;
/*... |
-- Verify what name you are giving this table and ensure that it corrolates to what the app will unerstand
DROP TABLE IF EXISTS pets;
CREATE TABLE pets (
id INTEGER PRIMARY KEY,
name TEXT, type TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TRIG... |
CREATE TABLE USERS(id int, name text, last_name text);
CREATE TABLE CONTACTS(name text, last_name text, telephone, email); |
with prev as (
select distinct user_id
from
gha_pull_requests
where
created_at < '{{from}}'
)
select
'new_contrib;All;contrib,prs' as name,
round(count(distinct user_id) / {{n}}, 2) as contributors,
round(count(distinct id) / {{n}}, 2) as prs
from
gha_pull_requests
where
created_at >= '{{from}}'... |
CREATE TABLE tx_games_domain_model_game (
name varchar(255) DEFAULT '' NOT NULL,
publishing_date date DEFAULT NULL,
price double(11,2) DEFAULT '0.00' NOT NULL,
description text,
link_to_steam varchar(255) DEFAULT '' NOT NULL,
official_website varchar(255) DEFAULT '' NOT NULL,
artwork int(11) unsigned NOT NULL de... |
CREATE procedure sp_acc_update_group ( @GROUPID int,
@ACCOUNTTYPE int,
@PARENTGROUP int,
@ACTIVE INT)
AS
UPDATE AccountGroup SET AccountType = @ACCOUNTTYPE,
ParentGroup = @PARENTGROUP,
Active = @ACTIVE,
LastModifiedDate=getdate()
WHERE GroupID = @GROUPID
|
alter table eleicao.bem drop column DS_BEM_CANDIDATO;
alter table eleicao.bem add column DS_BEM_CANDIDATO character varying (3000); |
set hive.execution.engine=spark;
drop table if exists dws.tmp_fact_work_measure;
create table if not exists dws.tmp_fact_work_measure (
apply_no string comment "订单号"
, apply_time timestamp comment "申请时间"
, product_name string comment "产品名称"
, product_id string comment "产品id"
, branch_id string comment "分公司id"
, p... |
drop table if exists task
drop table if exists tweet
create table task (
taskId binary(20) not null,
taskTitle varchar(255) not null,
taskStartDate datetime null,
taskDueDate datetime null,
taskStatus varchar(... |
CREATE Procedure sp_get_All_STK_REQ_Abstract_nofilter (@STK_REQ_FromDate Datetime,@STK_REQ_ToDate datetime)
as
Select warehouse.WareHouse_Name,
Stock_Request_Abstract.stock_req_number,
Stock_Request_Abstract.Stock_Req_Date,
Stock_Request_Abstract.RequiredDate,
status,
Stock_Request_Abstract.DocumentID,... |
create database db_shiro;
use db_shiro;
create table users(
id int auto_increment primary key,
userName varchar(10),
password varchar(20)
);
select * from users;
insert into users(id,userName,password) values(1,'wby','123'); |
/*
Warnings:
- You are about to drop the column `date` on the `Portfolio` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Investment" ADD COLUMN "date" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP;
-- AlterTable
ALTER TABLE "Portfolio" DROP COLUMN "date";
-- AlterTable
ALTER... |
delete from perbooks where id = $1;
delete from perposts where book_id = $1 |
create or replace view v_cg030_mx as
(
select a."CZDE551",a."DE011",a."DE022",a."DE062",a."DE042",a."JSDE955",a."CZDE386",a."JSDE218",a."JSDE219",a."DE181",a."CZDE901",a."CZDE902",a."CZDE903",a."CZDE904",a."CZDE094",a."JSDE940",nvl(b.syje,0) as syje,(a.de181 - nvl(b.syje,0)) as kyje
from cg030 a,(select czde551,sum(de1... |
-- 2016年7月20日 yaolu 特殊订单退款明细 begin --
@repeat{SELECT COUNT(*) FROM functionreg where ID=260}
insert into functionreg(ID,packagename,name,functionkey,functiondescribe,parameterdescribe,createtime,createby,updatetime,updateby,instruction)
values(260,'QuerySpecialorderinfo.bpl','特殊订单退款明细','{36FB9648-F3AF-47F9-BCCF-40934C... |
/*
Name: Development Views Last 7 Days
Data source: 4
Created By: Admin
Last Update At: 2015-09-11T14:14:23.724971+00:00
*/
SELECT nvl(DATE,P.PreviousWeekDATE) AS DATE,
views,
visits,
visitors,
ViewsPreviousWeek,
VisitsPreviousWeek,
VisitorsPreviousWeek,
DAY(nvl(DATE,P.P... |
SET SCHEMA BOOKMARK_MANAGER;
-- todo: create indincies for queries optimization
-- CREATE UNIQUE INDEX IF NOT EXISTS IX_AUTH_USERNAME ON AUTHORITIES(USERNAME,AUTHORITY); |
-- 1. 부서 테이블과 사원 테이블에서 사번, 사원명, 부서코드, 부서명을 검색하시오. (사원명 오름차순 정렬할 것)
--oracle
select e.empno 사번, e.ename 사원명, e.deptno 부서코드, d.dname 부서명
from emp e, dept d
where e.deptno = d.deptno
order by 사원명;
--ansi
select e.empno 사번, e.ename 사원명, e.deptno 부서코드, d.dname 부서명
from emp e join dept d
on e.deptno=d.deptno
order by 사원명... |
--清除所有表
select 'drop table '||TABLE_NAME ||';' from INFORMATION_SCHEMA.TABLES t where t.TABLE_CATALOG ='TEST' and t.TABLE_SCHEMA = 'PUBLIC';
|
DELIMITER $$
CREATE OR REPLACE PROCEDURE `add_to_cart`(`email` VARCHAR (100) ,`product_id` int(10),`quantity` int(10))
BEGIN
DECLARE id int;
set AUTOCOMMIT = 0;
SELECT customer_id into id from Customer where Customer.email=email;
INSERT INTO `Cart` (`customer_id`,`product_id`,`quantity`) VALUES
(id... |
CREATE TABLE PUBLIC.host_info
(
id SERIAL NOT NULL,
hostname varchar NOT NULL,
cpu_number INT2 NOT NULL,
cpu_architecture VARCHAR NOT NULL,
cpu_model VARCHAR NOT NULL,
cpu_mhz FLOAT8 NOT NULL,
l2_cache INT4 NOT NULL,
"timestamp" TIMESTAMP NOT NULL,
total_mem INT4 NULL,
CONSTRAINT HOST_INFO_PK primary key (id),
CONSTR... |
SELECT
count(c.`uuid`) AS size
FROM `clients` c
WHERE c.`user` = ?; |
CREATE Procedure Spr_Purchase_Batch_Movement (@Manufacturer nvarchar(255),
@Hierarchy nvarchar(255),
@Category nvarchar(255),
@ProductCode nvarchar(255),
... |
-- schema_ddl.sql
@clears
col cuser new_value Username noprint
prompt
prompt User to duplicate? :
prompt
set feed off term off
select upper('&&1') cuser from dual;
set feed on term on
@clear_for_spool
set linesize 1000
set long 10000
col sqlfile new_value sqlfile noprint
col mydb noprint new_value mydb
set term ... |
DROP TABLE EAADMIN.CONFIG_RECORD;
------------------------------------------------
-- DDL Statements for Table "EAADMIN "."CONFIG_RECORD"
------------------------------------------------
CREATE TABLE "EAADMIN "."CONFIG_RECORD" (
"ID" BIGINT NOT NULL GENERATED ALWAYS AS IDENTITY (
START WITH +1
I... |
CREATE OR REPLACE PROCEDURE wxhp_obj_backup AS
v date:=sysdate;
BEGIN
delete from wxh_OBJ_BACKUP where version < v - 100;
INSERT INTO wxh_OBJ_BACKUP
(Owner, NAME, TYPE, Status, Sts, Line, Text, Version, Viewtext)
SELECT u.name AS owner
,o.name
,decode(o.type#, 7, 'PROCEDURE', 8, 'FUNCTI... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 19, 2021 at 06:55 PM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 8.0.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
select
'glacier' as type,
'100m' as distance,
contourlines.elev,
ST_Intersection(contourlines.wkb_geometry, planet_osm_polygon.way) as geom
from contourlines, planet_osm_polygon
where planet_osm_polygon.natural in ('glacier')
and mod(cast(contourlines.elev as integer), 100) = 0
and ST_In... |
-- CREATE OR ALTER FUNCTION uDefFunc.GetProductByYear(
-- @model_year INT
-- )
-- RETURNS TABLE AS
-- RETURN
-- SELECT
-- product_name,
-- list_price
-- FROM
-- production.products
-- WHERE
-- model_year = @model_year
-- ;
-- SELECT *
-- FROM uDefFunc.GetPro... |
CREATE TABLE Product (
ProductId VARCHAR(8) NOT NULL,
ModelId VARCHAR(20),
Price DECIMAL(5,2),
CONSTRAINT pk_product PRIMARY KEY (ProductId,ModelId),
CONSTRAINT fk_product_type FOREIGN KEY (ProductId)
REFERENCES ProductType
);
|
/*!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 utf8mb4 */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FO... |
create table viewings (
id bigint not null auto_increment primary key,
user_id bigint not null,
show_id bigint not null,
episode_id bigint not null,
updated_at DATETIME not null,
timecode int not null,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE,
FOREIGN KEY (show_id) RE... |
CREATE DEFINER=`administrator`@`localhost` FUNCTION `is_active`(DID INT) RETURNS tinyint(1)
BEGIN
-- Check if deal is active, returning 1 if true or 0 if false.
-- Select Deal Type then check if active based on whether deal is recurring or limited.
SELECT bdv.deal_type into @type
FROM business_deals_view bdv
... |
CREATE TABLE configuration (
key STRING UNIQUE NOT NULL,
value STRING NOT NULL);
CREATE TABLE workers (
worker_id INTEGER PRIMARY KEY ASC,
host_port STRING NOT NULL);
CREATE TABLE alive_workers (
worker_id INTEGER PRIMARY KEY ASC REFERENCES workers(worker_id));
CREATE TABLE masters (
master_id I... |
{{
config(
materialized='incremental',
unique_key='c_custkey',
tags=['rpt', 'dim']
)
}}
select
c_custkey,
c_name,
c_address,
c_nationkey,
c_phone,
c_acctbal,
c_mktsegment,
c_comment,
n_name,
r_name
from {{ ref('stg_customers') }} |
--begin addby daijiy 2016-8-12 增加ic卡报班路单打印数据源
@repeat{SELECT count(*) FROM printtemplatetypeitem where id = 337041490}
insert into printtemplatetypeitem (ID, PRINTTEMPLATETYPEID, ITEMNAME, ITEMTYPE, ITEMCODE, ISLIST)
values (337041490, 6, '发车日期', '2', 'departdate', 0);
--end
@repeat{SELECT count(*) FROM Digitaldict... |
DELETE FROM "special_movie" WHERE movie_id = ?; |
-- Adminer 4.2.5 MySQL dump
SET NAMES utf8;
SET time_zone = '+00:00';
SET foreign_key_checks = 0;
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO';
DROP TABLE IF EXISTS `chemin`;
CREATE TABLE `chemin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`id_dest_finale` int(11) NOT NULL,
`id_lieu1` int(11) NOT NULL,
`id_lieu2` int(... |
/*
DESCRIPTION:
1. Fill spatial boundry NULLs in GEO_devdb through spatial join
and create SPATIAL_devdb. Note that SPATIAL_devdb is the
consolidated table for all spatial attributes
_GEO_devdb -> GEO_devdb
GEO_devdb --Spatial Joins--> SPATIAL_devdb
INPUTS:
GEO_devdb
OUTPUTS:
... |
create or replace procedure PROC_Complain_Relation_WO as
/* i_count integer;*/
cursor c_records is
select id,
max(code) code,
max(complain_wo_isover) complain_wo_isover,
max(is_timeout) is_timeout,
max(complain_woatt_isupload) complain_woatt_isupload,
decode(sign(sum(case when ta_... |
USE TSQL2012;
/* ==CROSS JOINS==
Consider an example from the TSQL2012 sample database. This database contains a table
called dbo.Nums that has a column called n with a sequence of integers from 1 on. Your task is
to use the Nums table to generate a result with a row for each weekday (1 through 7) and shift
number (1... |
CREATE OR REPLACE FUNCTION compareTime (
first_c_id VARCHAR,
first_c_id_no NUMBER,
second_c_id VARCHAR,
second_c_id_no NUMBER
)
RETURN NUMBER
IS
overlap NUMBER;
first_day NUMBER;
second_day NUMBER;
first_start_time NUMBER;
first_end_time NUMBER;
second_start_time NUMBER;
second_end_time NUMBER... |
DROP TABLE IF EXISTS corrections_reference;
WITH
applied AS (
SELECT
a.job_number,
a.field,
a.old_value,
a.new_value,
a.reason,
a.edited_date,
a.editor,
b.pre_corr_value,
1 as corr_applied
FROM _manual_corrections a
INNER JOIN correcti... |
DROP TABLE IF EXISTS ClinicalImpressionFinding;
DROP TABLE IF EXISTS ClinicalImpressionFinding_HT;
DROP TABLE IF EXISTS ClinicalImpressionInvestigation;
DROP TABLE IF EXISTS ClinicalImpressionInvestigation_HTItem;
DROP TABLE IF EXISTS ClinicalImpressionInvestigation_HT;
DROP TABLE IF EXISTS ClinicalImpressionNot... |
insert into pais(id,nome,nascionalidade) values(1,'Brasil','Brasileiro'); |
USE psdb;
SELECT * FROM psdb.employees WHERE psdb.employees.first_name="Yinghua" or first_name="Elvis";
|
With test_scores as(
--Explore 2015
Select
e.student_id,
Cast('4/1/2015' as Date) as testdate,
'2014-15' as ayear,
'Explore' as test,
'Composite' as subject,
e."explore_2015_composite_scaleScore" as score
From national_assessments.explore_2015_complocal e
Union
Select
e.student_id,
Cast('4/1/2015' as Dat... |
# Oefening 3 Oplossingen:
# Toon de naam van de landen uit centraal Afrika waar de leeftijdsverwachting > 60
SELECT `Name` FROM `country` WHERE `Region` = "Central Africa" AND `LifeExpectancy` > 60 (1)
# Toon de naam, district en populatie van alle steden uit Nederland waar de populatie >= 200000
SELECT `Name`, `Distr... |
create table hibernate_sequence
(
next_val bigint null
)
engine = MyISAM;
INSERT INTO immo.hibernate_sequence (next_val) VALUES (6);
create table File
(
id bigint auto_increment
primary key,
date datetime null,
path varchar(255) null
)
engine = MyISAM;
create table Address
(
... |
-- phpMyAdmin SQL Dump
-- version 2.6.4-pl3
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 09, 2007 at 01:17 PM
-- Server version: 5.0.15
-- PHP Version: 5.1.6
--
-- Database: `environments`
--
-- --------------------------------------------------------
--
-- Table structure for table ... |
select distinct get_json_object(value,'$.type') from dw_mobdb.factmbtracelog_hybrid where d = '2018-06-06'
--计算uv
count(DISTINCT newvalue.data['env_clientcode']) AS visitNumber
--操作搜索功能的用户
select a.d,count(DISTINCT newvalue.data['env_clientcode']) AS visitNumber
from dw_mobdb.factmbtracelog_hybrid a
where key in ('c_... |
<!DOCTYPE html>
<html lang="en" class=" is-copy-enabled emoji-size-boost is-u2f-enabled">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#">
<meta charset='utf-8'>
<link crossorigin="anonymo... |
DROP TABLE IF EXISTS coffee_tea;
CREATE TABLE coffee_tea (value SMALLINT PRIMARY KEY, property VARCHAR (20) NOT NULL);
INSERT INTO coffee_tea (value, property) VALUES (1, 'Coffee');
INSERT INTO coffee_tea (value, property) VALUES (2, 'Tea'); |
INSERT INTO planets (name, mass, distance, diameter)
VALUES ("Earth" , 1, 149597870, 12756), ("Venus" , 0.9, 108208930, 12104), ("Mars", 0.1, 227936640, 6794), ("Mercurius", 0.1, 57910000, 4880); |
SET search_path TO tempdb;
create table Data (
RecordNumber varchar(5) not null unique,
InternalMemo multiocc null,
Comments text null,
RecNum varchar(7) not null check(left(RecNum, 3) = 'WRN') unique,
Org1 varchar(100) null,
Org2 varchar(70) null,
Org3 varchar(70) null,
Org4 varchar(70) null,
Org5 v... |
-- A list of people with the same name and zip, but different occupations. Many of these are probably matches.
SELECT DISTINCT
source.name,
source.zip,
source.employer,
source.occupation,
target.employer,
target.occupation
FROM fec_contribution AS source
LEFT JOIN fec_contribution AS target
ON (
source.n... |
DROP TABLE userinfo;
CREATE TABLE userinfo (userId varchar2(12) PRIMARY KEY,password varchar2(12) NOT NULL,name varchar2(20) NOT NULL,email varchar2(50));
INSERT INTO userinfo VALUES('guard', 'guard', '김경호', 'guard@naver.com');
|
DROP TABLE DEPLOY_TARGET;
DB NAME :deploy
CREATE TABLE DEPLOY_TARGET
(
SEQ INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT ,
HOST_NAME VARCHAR2(50) NOT NULL,
IP_ADDR VARCHAR2(50) NOT NULL,
LISTEN_PORT INTEGER NOT NULL,
DEPLOY_TYPE VARCHAR2(50) NOT NULL,
USE_YN VARCHAR2(2... |
--Author:Markus Baciu(C18350801)
--Description: Inserts for all tables with weak entries entered as well
describe class;
insert into class values(56747,30);
insert into class values(57890,25);
insert into class(classid) values(57643);
insert into class(classid) values(56378);
describe student;
insert into student v... |
-- USER is a reserved keyword with Postgres
-- You must use double quotes in every query that user is in:
-- ex. SELECT * FROM "user";
-- Otherwise you will have errors!
-- CREATE TABLE "user" (
-- "id" SERIAL PRIMARY KEY,
-- "username" VARCHAR (80) UNIQUE NOT NULL,
-- "password" VARCHAR (1000) NOT NULL
--... |
SELECT
T1.MERCH_KEY, T1.FLAG_ONLINE, T1.hierarchy_cd
FROM
cartaocontinente.dim_merchant_hierarchy T1;
/* Retiramos as colunas:
t1.merch_cd
t1.merch_dsc
t1.payment_service
t1.hierarchy_dsc */ |
UPDATE ips INNER JOIN country
ON ips.iso = country.iso
SET ips.countryid = country.countryid;
-- update
UPDATE `account_transactions` SET `created` = UNIX_TIMESTAMP(`transaction_datetime`) WHERE created IS NULL;
-- convert unix to datetime = FROM_UNIXTIME
|
SET @startDate = '2015-08-01 00:00:00';
SET @endDate = '2015-09-01 00:00:00';
# Clients who ordered in 2014 - 2015
# SELECT
# c.id 'Client No'
# , c.client_name 'Client Name'
# , b.bill_name 'Billing Name'
# , CONCAT_WS(' ', b.bill_address1, b.bill_address2, b.bill_city, b.bill_state, b.bill_zipcode) 'Billing... |
DROP DATABASE IF EXISTS chat;
CREATE DATABASE chat;
USE chat;
CREATE TABLE users (
/* Describe your table here.*/
id int NOT NULL AUTO_INCREMENT,
username varchar(30),
PRIMARY KEY(id)
);
/* Create other tables and define schemas for them here! */
CREATE TABLE rooms (
/* Describe your table here.*/
id i... |
-- phpMyAdmin SQL Dump
-- version 4.7.7
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Ноя 04 2020 г., 16:10
-- Версия сервера: 5.6.38
-- Версия PHP: 5.5.38
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACT... |
with TTIME_T1_ONLY as
( select distinct t.EMPLOYEEID, t.SWIPEDATE, t.WORKAREA,t.WF_STATUS
from TTIMETEMP t
where t.SWIPEDATE between '2013-12-01' and '2013-12-31'
and t.SWIPETYPE = '1'
AND T.WF_STATUS <> '9'
--AND ((select count(workarea) from APPEND_MONEY_WORKAREA) = 0 or t.WORKAREA IN ... |
DELETE from casev2.event where id in ('f71f8908-38b4-4f60-b87b-d3a0ea5cfb70','58e94664-a3ea-4b06-b292-613f99f32630');
DELETE from casev2.uac_qid_link where id in ('ba168af7-ee3b-40f8-8b5e-16c53ce7ee50','39325386-0ea4-4c2a-80ed-59c19fa298d5');
|
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 01-09-2017 a las 00:01:17
-- Versión del servidor: 10.1.21-MariaDB
-- Versión de PHP: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
spool UndoExts.out
ttitle off
set pages 999
set lines 150
set verify off
set termout off
set trimout on
set trimspool on
REM
REM ------------------------------------------------------------------------
REM
REM -----------------------------------------------------------------
REM
REM
REM REPOR... |
-- drop if exists
CREATE DATABASE dt8czq68kv5bxqhk;
USE dt8czq68kv5bxqhk;
CREATE TABLE burgers
(
id int NOT NULL AUTO_INCREMENT,
burger_name varchar(255) NOT NULL,
devoured BOOLEAN DEFAULT false,
createdAt timestamp default current_timestamp NOT NULL,
PRIMARY KEY (id)
);
|
SELECT
piskunova_gruppa.name, COUNT(*)
FROM piskunova_gruppa
INNER JOIN piskunova_graduate ON piskunova_gruppa.gruppa_id=piskunova_graduate.gruppa_id
GROUP BY piskunova_gruppa.gruppa_id |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50635
Source Host : localhost:3306
Source Database : test
Target Server Type : MYSQL
Target Server Version : 50635
File Encoding : 65001
Date: 2019-04-10 17:18:07
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
select rownum id, column_value varchar2_data
from (
table(
sys.odcivarchar2list(
|
/*
Name: Number of actions by entry mod code...
Data source: 4
Created By: Admin
Last Update At: 2016-03-17T19:12:41.828898+00:00
*/
SELECT v.mod_code AS mod_code,
count(*) AS Number_of_leads,
FROM
(SELECT *
FROM
( SELECT LOWER(CASE WHEN post_prop10 = '' THEN 'no mod code' ELSE post_prop10 END) As mod_... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Aug 15, 2018 at 10:57 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.1.17
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @... |
BEGIN TRANSACTION;
CREATE TABLE Employees(ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, FName TEXT NOT NULL, LName TEXT NOT NULL,Age INTEGER NOT NULL, Address TEXT, Salary REAL, HireDate TEXT, 'Image' BLOG DEFAULT NULL);
INSERT INTO "Employees" VALUES(1,'Derek','Banas',41,'121 Main St',50000.0,'2021-09-25',NULL);
DELE... |
WITH all_issues AS (
SELECT * FROM issues
) SELECT * FROM all_issues WHERE repo_id = 2;
|
@@autotask_sql_setup
select window_name
, enabled
, next_start_date at time zone sessiontimezone next_start_date
, active
--, next_start_date
, repeat_interval
, duration
from dba_scheduler_windows
where enabled = 'TRUE'
order by next_start_date
/
|
DROP PROCEDURE IF EXISTS Test_PatientSearch;
DELIMITER @@
CREATE PROCEDURE Test_PatientSearch
(IN province VARCHAR(20), IN city VARCHAR(20), OUT num_matches INT)
BEGIN
/* returns in num_matches the total number of patients in the given province and city */
SELECT count(distinct PatientData.p_alias) INTO num_matche... |
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELECT * FROM hello;
SELEC... |
-- ## json functions:
-- select json_extract(json_text, '$.class.students[0]') as first_student
-- from unnest([
-- '{"class" : {"students" : [{"name" : "Jane"}]}}',
-- '{"class" : {"students" : []}}',
-- '{"class" : {"students" : [{"name" : "John"}, {"name": "Jamie"}]}}'
-... |
insert into management_system.studentcourse (Student_email,course_id) values ('ljiroudek8@sitemeter.com',1);
insert into management_system.studentcourse (Student_email,course_id) values ('tattwool4@biglobe.ne.jp',2);
insert into management_system.studentcourse (Student_email,course_id) values ('htaffley6@columbia.edu',... |
/*
Write SINGLE-ROW and MULTIPLE-ROW SUBQUERIES
============================================
IN
----------
Compares a subject value to a set of values. Returns TRUE if the subject value
equals any of the values in the set.
Returns FALSE if the subquery returns no rows.
ANY, SOME
----------
Used in combination wit... |
alter table MARKET_PRICE_HISTORY alter column PRICE_CHANGE_DATE rename to PRICE_CHANGE_DATE__U35922 ^
alter table MARKET_PRICE_HISTORY add column PRICE_CHANGE_DATE timestamp ;
|
-- 1327. 列出指定时间段内所有的下单产品
-- 表: Products
--
-- +------------------+---------+
-- | Column Name | Type |
-- +------------------+---------+
-- | product_id | int |
-- | product_name | varchar |
-- | product_category | varchar |
-- +------------------+---------+
-- product_id 是该表主键。
-- 该表包含该公司产品的数据。... |
select pls.cd_crt as cartao, count(*) as qtde, sum(opr.vl_opr) as valor, min(opr.dt_opr) as menor_data, max(opr.dt_opr) as maior_data
from sc_opr.tbl_pls pls
inner join sc_opr.tbl_opr opr on pls.cd_pls = opr.cd_pls
where opr.cd_top = 5
and opr.st_opr = 2
group by pls.cd_crt
having count(*) > 50
order by qtde de... |
INSERT INTO cs421g24.receipts( rid, did, "date", totalprice, pid )
VALUES( 1, 2227808233, '2017-07-21', $241.96, 1 );
INSERT INTO cs421g24.receipts( rid, did, "date", totalprice, pid )
VALUES( 2, 8911712167, '2016-12-01', $514.08, 2 );
INSERT INTO cs421g24.receipts( rid, did, "date", totalprice, pid )
VALUES( 3, 8911... |
-- Dec 11, 2009 9:53:05 AM CET
-- FR[2830830] - New tab Used in Process Parameter into "System Element"
-- https://sourceforge.net/tracker/?func=detail&aid=2830830&group_id=176962&atid=883808
INSERT INTO AD_Tab (AD_Client_ID,AD_Column_ID,AD_Org_ID,AD_Tab_ID,AD_Table_ID,AD_Window_ID,Created,CreatedBy,EntityType,HasT... |
// 객실
CREATE TABLE room(
rno NUMBER(3) primary key,
rname VARCHAR2(20 byte) NOT NULL,
rsize NUMBER(2) NOT NULL,
men NUMBER(2) NOT NULL,
addman NUMBER(6) DEFAULT 0,
weekday NUMBER(6) NOT NULL,
weekend NUMBER(6) NOT NULL,
sweekday NUMBER(6) NOT NULL,
sweekend NUMBER(6) NOT NULL,
constraint room_rname_uk unique... |
INSERT INTO ch_provinces (id,province) VALUES (
1,'北京市');
INSERT INTO ch_provinces (id,province) VALUES (
2,'天津市');
INSERT INTO ch_provinces (id,province) VALUES (
3,'河北省');
INSERT INTO ch_provinces (id,province) VALUES (
4,'山西省');
INSERT INTO ch_provinces (id,province) VALUES (
5,'内蒙古自治区');
INSERT INTO ch_provinces (i... |
-------Artist Table-------
----------------PROBLEM 1----------------
INSERT INTO artist (name)
VALUES ('Imagine Dragons'),
('The Weeknd'),
('Ed Sheeran');
----------------PROBLEM 2----------------
SELECT *
FROM artist
ORDER BY name ASC
LIMIT 5;
-------Employee Table-------
----------------PROBLEM 1----------------
SEL... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 30, 2019 at 04:21 PM
-- Server version: 10.1.38-MariaDB
-- PHP Version: 7.1.27
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
Create Procedure spr_list_ReceivedCollection_Compare(@FROMDATE DATETIME, @TODATE DATETIME)
as
Select "DocumentID" = Collections.DocumentID, "Received CollectionId" = CollectionsReceived.FullDocID,
"New CollectionID" = Collections.FullDocID,
"Customer Id" = Customer.CustomerId,
"Customer Name" = Customer.Company_Name,
"... |
with sub_mrr as (
select
c.id as sub_id,
sum(cast(a.mrr as decimal(18,2))) as mrr
from zuora.zuora_rate_plan_charge a
join zuora.zuora_rate_plan b
on a.rateplanid = b.id
join zuora.zuora_subscription c
on b.subscriptionid = c.id
where a.islastsegment = true
group by 1
),
sub_billing_periods as (
select
listagg(... |
select * from hasStock;
#select * from OrderListingsByCustomerName;
#select * from StockListings;
select * from CoustomerStock; |
-- script to run in phpmyadmin
CREATE DATABASE IF NOT EXISTS 'www_authentication';
CREATE TABLE user (
email VARCHAR(255),
password VARCHAR(255),
);
INSERT INTO user (email, password) values ('asdf@asd', 'pass1');
INSERT INTO user (email, password) values ('qwerty@asd', 'pass2');
|
CREATE TABLE [actual].[kb_use]
(
[sys_created_on_display_value] DATETIME NULL,
[article_display_value] NVARCHAR(80) NULL,
[sys_updated_by_display_value] NVARCHAR(255) NULL,
[sys_id_display_value] NVARCHAR(255) NULL,
[user_display_value] NVARCHAR(255) NULL,
[used_display_value] NVARCHAR(80) NULL,
[viewed... |
CREATE table meals (
id INT AUTO_INCREMENT NOT NULL,
image VARCHAR(255),
link VARCHAR(255),
title VARCHAR(255),
calories DECIMAL(5,2),
protein DECIMAL(5,2),
fat DECIMAL(5,2),
carbs DECIMAL (5,2),
createdAt timestamp DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY(id)
)
CREATE table users (
id INT AUTO_INCREMENT NOT NULL,
... |
--
-- Update sql for MailWizz EMA from version 1.3.4.8 to 1.3.4.9
--
--
-- Table structure for table `delivery_server_to_customer_group`
--
CREATE TABLE IF NOT EXISTS `delivery_server_to_customer_group` (
`server_id` int(11) NOT NULL,
`group_id` int(11) NOT NULL,
PRIMARY KEY (`server_id`,`group_id`),
KEY `fk_... |
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jun 30, 2017 at 10:13 AM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.