text stringlengths 6 9.38M |
|---|
create table Prototype.tblClaimKeywords (
ClaimId INTEGER NOT NULL,
Keyword VARCHAR(255) NOT NULL
); |
/*Find the difference between the total number of CITY entries in
the table and the number of distinct CITY entries in the table.
The STATION table is described as follows:*/
/* Learnt about using count, this is getting very interesting*/
SELECT COUNT(CITY) - COUNT(DISTINCT CITY) FROM STATION; |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 16, 2020 at 01:45 PM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SE... |
SET default_transaction_isolation =serializable;
SET client_min_messages='debug1';
SHOW client_min_messages;
--SET enable_seqscan = ON;
--SET enable_seqscan = OFF;
DROP VIEW IF EXISTS log;
CREATE OR REPLACE VIEW log AS
SELECT log.id::BIGINT AS log_id
,date_trunc('second' ,log.timemark)::timestamp A... |
ALTER TABLE Employee
ADD CONSTRAINT Employee_dno_FK FOREIGN KEY(dno)
REFERENCES Department(dnumber);
|
update levels
set item_id = 1
where level = 2;
update levels
set item_id = 2
where level = 5;
update levels
set item_id = 3
where level = 8;
update levels
set item_id = 4
where level = 12;
update levels
set item_id = 5
where level = 15;
update levels
set item_id = 6
where level = 18;
update levels
set item_id = 7... |
with
paxes as (
select * from unnest(array[3,5,30]) as pax_age
)
select
cnct.file_id, cnct.hotel_id, to_date(cnct.initial_date, 'YYYYMMDD'),
to_date(cnct.final_date, 'YYYYMMDD'), cnct.room_type, cnct.characteristic,
cnct.is_price_per_pax, cnsr.is_per_pax, cnct.base_board,
cnct.amount,
paxes.pax_age... |
{{ config(materialized='view') }}
with data as (
{{ dbt_ml_preprocessing.standard_scaler( ref('data_standard_scaler') ,['col_to_scale_1','col_to_scale_2']) }}
)
select id_col,
col_to_scale_1,
col_to_scale_2,
round(col_to_scale_1_scaled,10) as col_to_scale_1_scaled,
round(col_to_s... |
select * from pb_widget where id='0172ef6c-e0e9-497a-bab6-1eb81a298f82'
--物资计划
select * from ps_pur_bomfile where id ='40207202-b286-4b07-a7cc-16ca18c1867f'
select * from ps_pur_bom where masterid='40207202-b286-4b07-a7cc-16ca18c1867f'
--请购单
--主表order_guid为物资计划Id
--明细表的BomID为物资计划明细Id
select * from xlx_pur_request wher... |
SELECT MIN(age) AS age_min,
MAX(age) AS age_max
FROM people; |
SELECT ROUND(MAX(QTDELIN) / 50,0) FROM
select 5, * from (
select rownum qtdelin , proposta,nome from (
select proposta,nome from proposta where nome like '%ANA%' order by 2))
where qtdelin >= (50 * 5 - 49) AND qtdelin <= (50 * 5)
where qtdelin >= (total_linhas_paginas_desejada * numero_pagina_selecionad... |
-- MySQL dump 10.13 Distrib 8.0.16, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: locadorafilme
-- ------------------------------------------------------
-- Server version 5.7.26-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESUL... |
/*
Warnings:
- You are about to drop the `ClubAttendants` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `EventAttendants` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Friends` table. If the table is ... |
CREATE TABLE tti."Communicatie"
(
id serial NOT NULL,
datum date NOT NULL,
"klant_id_OID" bigint NOT NULL,
"localTime" time without time zone NOT NULL,
tekst character varying(8192),
titel character varying(255) NOT NULL,
version bigint NOT NULL,
CONSTRAINT "Communicatie_PK" PRIMARY KEY (id),
CONSTRAI... |
CREATE DATABASE IF NOT EXISTS angular4p0;
USE angular4p0;
CREATE TABLE productos(
id int(255) auto_increment not null,
nombre varchar(255),
descripcion text,
precio varchar(255),
imagen varchar(255),
CONSTRAINT pk_productos PRIMARY KEY(id)
)ENGINE=InnoDb;
|
PARAMETERS [@FechaIniID] Text ( 255 ),[@CuentaID] Text (255);
select SUM(Saldo) from
(
SELECT Saldo
FROM TB_Cuenta
WHERE (CuentaID=[@CuentaID] OR [@CuentaID] IS NULL)
UNION ALL
SELECT iif(TipoID="01",Monto,-Monto) as Movimientos
FROM TB_Tesoreria
WHERE (FechaOperacionID < [@FechaIniID])
) AS A |
USE kuenstler_DB;
SET NAMES utf8;
-- Erst einmal doppelte IDs vermeiden; ergo: aufräumen
DELETE FROM eingeordnet WHERE bild_ID BETWEEN 300 AND 399;
DELETE FROM bild WHERE Kuenstler_ID BETWEEN 300 AND 399;
INSERT INTO bild (bild_ID, kunden_ID, kuenstler_ID, Titel, Beschreibung, bild, bild_hoehe, bild_breite, preis,... |
INSERT INTO sol_ratings (user_id, solution_id, liked)
VALUES ($1, $2, $3);
|
CREATE USER "LK_CONSIG" IDENTIFIED BY VALUES 'C20CB686CAB0F2EB'
DEFAULT TABLESPACE "RETAG_DADOS"
TEMPORARY TABLESPACE "TEMPORARY";
|
create table students(
id int(5) primary key,
name varchar(10),
sal double(8,2)
);
|
(SELECT
product,
'en' AS lang,
text AS review_text
FROM review
WHERE language = 'en' AND product < 1000)
UNION ALL
(SELECT
v1.product AS product,
'zh' AS lang,
v1.text AS review_te... |
索引的定义:
建立在表之上,由单列或多列组成,旨在提高查询效率
索引的作用:
1.提高查询的速度
2.确保查询的唯一性
3.可以加速表与表之间的链接,实现表与表之间的参照完整性
4.使用分组和排序子句进行数据检索时,可以显著减少分组与排序的时间
5.全文检索字段进行搜索优化
索引分类:
主键索引(PRIMARY KEY)
唯一索引(UNIQUE)
常规索引(INDEX)
单列索引
多列索引
全文索引(FULLTEXT)
聚集索引
非聚集索引
空间索引
原则:
1.查询频率高的
2.排序、分组、联合查询频率高的
3.索引数目不宜太多
索引会占用物理空间
insert update ... |
CREATE PROC usp_GetHoldersFullName
AS
SELECT ah.FirstName + ' ' + ah.LastName AS [FullName]
FROM AccountHolders AS ah
--EXEC usp_GetHoldersFullName |
DROP DATABASE IF EXISTS `surl`;
CREATE DATABASE IF NOT EXISTS `surl` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `surl`;
DROP TABLE IF EXISTS `tbl_admin`;
CREATE TABLE IF NOT EXISTS `tbl_admin` (
`admin_id` varchar(15) NOT NULL,
`admin_nm` varchar(30) NOT NULL,
`admin_pwd` varchar(100) NOT NULL,
PRIMARY KEY... |
INSERT INTO credentials(username,password,disabled)
VALUES ('admin','password', false);
INSERT INTO credentials(username,password,disabled)
VALUES ('user1','password', false);
INSERT INTO credentials(username,password,disabled)
VALUES ('user2','password', true);
INSERT INTO roles (username, role)
VALUES ('admin', 'USE... |
ALTER TABLE chat
RENAME TO Chats
;
ALTER TABLE city
RENAME TO Cities
;
ALTER TABLE group_1
RENAME TO User_Groups
;
ALTER TABLE group_moderator
RENAME TO Group_Moderators
;
ALTER TABLE journey
RENAME TO Journeys
;
ALTER TABLE message
RENAME TO Messages
;
ALTER TABLE moderator
... |
CREATE DATABASE Passports
USE Passports
CREATE TABLE Passports(
PassportID INT PRIMARY KEY NOT NULL,
PassportNumber NVARCHAR(30) UNIQUE NOT NULL
)
CREATE TABLE Persons(
PersonID INT PRIMARY KEY IDENTITY,
FirstName NVARCHAR(30) NOT NULL,
Salary DECIMAL(10, 2) NOT NULL,
PassportID INT FOREIGN KEY REFERENCES Pass... |
alter table PLACEUR_USER alter column NICKNAME set data type varchar(20) ;
alter table PLACEUR_USER alter column NAME set data type varchar(50) ;
alter table PLACEUR_USER alter column SURNAME set data type varchar(50) ;
|
SELECT
*
FROM
BURI_DATA
WHERE
DATA_TYPE = /*dto.dataType*/'test.jp.starlogic.makotan.buri.dto.DtoName'
/*IF dto.pkeyVal != null*/and PKEY_VAL = /*dto.pkeyVal*/'AAAA'/*END*/
/*IF dto.pkeyNum != null*/and PKEY_NUM = /*dto.pkeyNum*/0/*END*/
; |
DROP TABLE users;
DROP TABLE questions;
DROP TABLE question_follows;
DROP TABLE replies;
DROP TABLE question_likes;
CREATE TABLE users (
id integer primary key,
fname VARCHAR(255) NOT NULL,
lname VARCHAR(255) NOT NULL
);
CREATE TABLE questions (
id integer primary key,
title VARCHAR(255) NOT NULL,
body ... |
--用户
INSERT INTO gateway_route (id, route_id, uri, predicates, filters, orders, description, status, created_time, updated_time, created_by, updated_by)
VALUES
(101,
'authorization-server',
'lb://authorization-server:8000',
'[{"name":"Path","args":{"pattern":"/authorization-server/**"}}]',
'[{"name":"Stri... |
-- Find the makers producing PCs but not laptops.
SELECT DISTINCT maker FROM product
WHERE type = 'PC' AND maker NOT IN
(SELECT maker FROM product WHERE type = 'laptop')
|
INSERT INTO USER(FIRST_NAME, LAST_NAME, PASSWORD,PROFILE_URL, USERNAME) VALUES
('Aliko', 'Dangote', 'password', 'profile_url', 'user1'),
('Bill', 'Gates', 'password', 'profile_url', 'user2'),
('Folrunsho','Pert', 'password', 'profile_url', 'user3');
INSERT INTO COOKBOOK(DESCRIPTION,PIC,TITLE, USER_ID) VALUES
... |
INSERT INTO GenerateCodes VALUES ('VXiOX0oERJylNH79spjJJOms8QozhhqSxabOrXtlSKfQ8fH82yf2qVhtf8loCawBgLLSRtMpNu2QS8gOU2nrP5iAOAAiJhJ0Awfw'); |
SELECT 'Miroshnykov' student FROM DUAL;
|
/*
Copyright 2021 Snowplow Analytics Ltd. All rights reserved.
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 a... |
/* Group Script 3 */
/* Queries for our database */
/* Updated for Final Submission with Nested and Join queries */
use cfb_db;
/* List coaches by most wins descending*/
Select Name, Career_Wins
From coach_t
Order By Career_Wins desc;
/* Alphabetically List All Seniors */
Select Name, Year_In_School
From player_t
... |
SELECT
lic.DOC_ID as Id,
lic.LICCAT_ID, -- Категория лицензии
lic.LICSTAT_ID as LicenseStatusId, -- ИД статуса
doc.REG_NUM as RegNumber, -- № ліцензії
CONVERT(VARCHAR, doc.REG_DATE, 126)
as RegistrationDate, -- Дата початку дії
lic.IS_DISTRIB, -- МПД в декількох ... |
exec PutQuote 'EUSWE11 Curncy','MLP','MLP','2008-07-15', 1, 0.04526;
exec PutQuote 'EUSWE11 Curncy','MLP','MLP','2008-07-16', 1, 0.04542;
exec PutQuote 'EUSWE11 Curncy','MLP','MLP','2008-07-17', 1, 0.0459;
exec PutQuote 'EUSWE11 Curncy','MLP','MLP','2008-07-18', 1, 0.04665;
exec PutQuote 'EUSWE11 Curncy','MLP','MLP','2... |
1. What is cardinality?
An indicator for the number of instances on each side of a relationship
2. What is modality?
It indicates the minimumm number of instances required on each side of a
relationship.
3. If one side of a relationship has a modality of 1, what is the smallest
number of instances that can be... |
-- Tất cả dữ liệu
select *
from organization;
-- Tìm (các) node gốc
select id, name
from organization
where parent_id is null;
-- Tạo các trường path, level
with recursive organization_path as
(
select
id,
name,
-- parent_id
-- 0 as lvl,
-- json_array(id) as x,
--... |
USE regalonatural; DELETE FROM regalonatural.ps_order_detail_tax;
INSERT INTO `ps_order_detail_tax` VALUES (16,1,3.467100,3.470000);
INSERT INTO `ps_order_detail_tax` VALUES (23,1,0.420000,0.420000);
|
-- ---------------------------------------------------------------------------
--
-- gEDA - GPL Electronic Design Automation
-- gparts - gEDA Parts Manager
-- Copyright (C) 2009 Edward C. Hennessy
-- Copyright (C) 2009 gEDA Contributors (see ChangeLog for details)
--
-- This program is free software; you can redistribu... |
select distinct(pt_id)
, [rn] = ROW_NUMBER() over(
partition by pt_id
order by pt_id
)
into #tempa
from smsmir.mir_pay
where (
pay_cd = '09740556'
)
and substring(pt_id, 5, 8) in (
select distinct(pt_id)
from smsmir.hl7_vst as vst
where vst.adm_date >= '2018-01-01'
and vst.adm_date < '2018-09-01'
)... |
CREATE PROCEDURE sum_profit
(IN
frequency VARCHAR(10),
s_code VARCHAR(50),
from_date DATETIME,
to_date DATETIME
)
BEGIN
SELECT value FROM OtherInfo WHERE name = 'default_currency' INTO @default_currency;
DROP TABLE IF EXISTS forCalculate;
CREATE TEMPORARY TABLE forCalculate (
ti... |
ALTER TABLE door MODIFY HARDWARE_GROUP varchar(28);
ALTER TABLE door MODIFY HARDWARE_SET varchar(42); |
/*
################################################################################
Migration script to add and populate GENOMEWIDE_ARRAY column to the STUDY table
Designed for execution with Flyway database migrations tool; this should be
automatically run to completely generate the schema that is out-of-the-box
comp... |
select * from select41;
select * from select42;
select * from select43;
select * from select44; |
DROP ALL OBJECTS;
CREATE TABLE tblApplicationSettings(
fldID BOOLEAN PRIMARY KEY AUTO_INCREMENT,
fldApplicationVersion INTEGER NOT NULL
) ENGINE = INNODB;
CREATE TABLE tblSteamFolder(
fldID INTEGER PRIMARY KEY AUTO_INCREMENT,
fldFolderLocation VARCHAR(255) NOT NULL UNIQUE
) ENGINE = INNOD... |
select to_char(max(capture_time), 'yyyymmdd hh24:mi:ss') from session_info_YYYYMMDD;
|
CREATE PROCEDURE [ERP].[Usp_Sel_Usuario_Export]
@Flag bit
AS
BEGIN
SELECT
U.ID,
EN.Nombre,
U.Correo,
U.FechaRegistro,
U.FechaEliminado,
ETD.NumeroDocumento,
TD.Nombre AS NombreTipoDocumento
FROM Seguridad.Usuario U
INNER JOIN ERP.Entidad EN
ON EN.ID = U.IdEntidad
INNER ... |
DROP TABLE IF EXISTS `legacy_autnums`;
CREATE TABLE `legacy_autnums` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`autnum` varchar(16) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
TRUNCATE version;
INSERT INTO version VALUES ('internals-1.73-1');
|
CREATE TABLE public.SomeUser (
id BIGINT PRIMARY KEY,
first_name VARCHAR(30) NOT NULL,
last_name VARCHAR(30) NULL,
company_id BIGINT
);
CREATE SCHEMA IF NOT EXISTS work;
CREATE TABLE work.Company (
id BIGINT PRIMARY KEY,
name VARCHAR(30) NOT NULL
);
CREATE VIEW public.SimpleUser AS (
SELE... |
select * from dbo.SousRaces |
/* Modificar campos */
UPDATE usuarios SET direccion="Chicago Ohare" where id=1; |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 10.4.10-MariaDB - mariadb.org binary distribution
-- Server OS: Win64
-- HeidiSQL Version: 10.3.0.5771
-- -----------------------------------------------... |
SELECT
T.* ,
--ユーザ名
L_USER.USER_NAME AS MODIFY_USER
FROM
(SELECT
--ファイル名
FILE_NAME,
--帳票名称
FILE_REPORT_NAME,
--ファイル種別
FILE_TYPE,
--ファイルパス
FILE_PATH,
--消込実施日
MAX(NEGATION_DATE) AS NEGATION_DATE,
--成功件数
SUM(SUCCESS_NUMBER) AS SUCCESS_NUMBER,
--成功_消込失敗件数
SUM(SUCCESS_NEG... |
select * from peliculas where cod_pelicula = :id
|
INSERT INTO department (name)
VALUES ("Sales"), ("Marketing"), ("Quality Assurance"), ("Legal"), ("Development");
INSERT INTO role (title, salary, department_id)
VALUES ("Salesperson", 40000, 1), ("Engineer", 100000, 5), ("Director of Propaganda", 150000, 2), ("QA Specialist", 80000, 3), ("Counsel", 200000, 4), ("Sub-... |
#
# Table structure for table 'tx_agproject_domain_model_category'
#
CREATE TABLE tx_agproject_domain_model_category (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
title varchar(255) DEFAULT '' NOT NULL,
description text NOT NULL,
images int(11) unsigned NOT NULL default '0',
sorting ... |
INSERT INTO users VALUES
(1, 'student', 'student@spbstu.ru');
INSERT INTO courses VALUES
(1, 'StudyIntonation', 'Study Intonation', 'This course is for everyday discourse skills mastering. Starting with quite short phrases you will browse through a variety of speaking patterns to feel and train the melody of English s... |
insert into INSURANCE values('1', 'SHIP', 500, 1000);
commit; |
ALTER TABLE todos
ADD completed INT (2) DEFAULT 0 |
/*Personas*/
/*SELECT *
FROM name;*/
/*Información de las personas*/
SELECT *
FROM person_info;
/*Obtiene información de los expectáculos excluyendo la información extra en el caso de que sean episodios de serie*/
/*SELECT id,title,kind_id,production_year,series_years
FROM title;*/
/*Muestra la información extra de... |
SELECT
*
FROM
(
SELECT
MAX(score),
username,
date
FROM
scores
WHERE
difficulty = 0
GROUP BY
username
) AS risultato
ORDER BY
score DESC,
date ASC; |
DROP TABLE IF EXISTS `XXX_papoo_keywords_liste`; ##b_dump##
CREATE TABLE `XXX_papoo_keywords_liste` (
`keywords_liste_id` int(11) NOT NULL AUTO_INCREMENT,
`keywords_liste_wieoft` int(11) DEFAULT NULL,
`keywords_liste_lang_id` int(11) DEFAULT NULL,
`keywords_liste_keyword` text,
PRIMARY KEY (`keywords_liste_id... |
CREATE TABLE IF NOT EXISTS member (
postcode VARCHAR(55) NOT NULL PRIMARY KEY,
KEN VARCHAR(127),
SHI VARCHAR(127),
CHO VARCHAR(127)
);
|
drop sequence BURI_BRANCH_SEQ;
|
delete from STP_PAYMENT_ITEMS;
delete from STP_PRICE;
delete from STP_COMMENTS;
delete from STP_EW_PAYMENT;
delete from STP_EW_PAYMENT_SAVE;
delete from STP_CONTRACT_YEAR;
delete from STP_INC_RATE;
delete from STP_NURSERY_INSPECTION_GRP;
delete from STP_NURSERY_INSPECTION;
delete from STP_EW_PAYMENT_DETAIL;
d... |
/*
** SUM(поле) - выводит сумму всех чисел (1174)
** MIN/MAX(поле) - выводит мин./макс. число (30/999)
** COUNT(поле) - выводит количество записей (5)
** AVG(поле) - выводит среднее арифметическое (234)
*/
SELECT SUM(price) FROM products;
SELECT MAX(price) FROM products;
SELECT fnames_list, lnames_list FROM p... |
select *
from customer
where active = 1
select
f.title,
f.release_year
from film f
where release_year = '2006'
select
f.film_id, f.title, f.rental_duration / f.rental_rate as cost_per_day
from film f
order by cost_per_day desc
select p.payment_id, p.rental_id, p.payment_date, p.amount
from payment p
orde... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Vært: 127.0.0.1
-- Genereringstid: 20. 08 2017 kl. 08:10:07
-- Serverversion: 10.1.25-MariaDB
-- PHP-version: 7.1.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_C... |
SELECT DISTINCT
item.K_ID,
item.K_NAME,
t.V_VAL
FROM
mst_item item
INNER JOIN
tmp_tmp t ON item.V_ID = t.V_ID
WHERE
t.V_ORDER
|
--SQL, aqui fazemos as consultas nas tabelas
USE SpMedicalGroup
--determinamos qual banco de dados usar
--mostrar todos os tipos de usuáios
SELECT * FROM TipoUsuario;
--mostrar todas as clínicas
SELECT * FROM Clinica;
--mostrar todos os tipos de especialidade
SELECT * FROM Especialidade;
--mostrar todos os usuário... |
var cur_dept refcursor;
exec select_all_dept (:cur_dept);
print cur_dept;
-- 부서번호 입력하여 부서별 사원 정보 조회
var cur_emp refcursor;
-- 부서번호 :10, 20, 30
exec select_emp(11,:cur_emp);
print cur_emp;
|
SELECT RANK() OVER (ORDER BY joindate) AS row_number,
firstname, surname
FROM cd.members;
-- or
SELECT ROW_NUMBER() OVER (ORDER BY joindate),
firstname, surname
FROM cd.members;
|
-- phpMyAdmin SQL Dump
-- version 3.5.2
-- http://www.phpmyadmin.net
--
-- Inang: localhost
-- Waktu pembuatan: 08 Okt 2014 pada 05.20
-- Versi Server: 5.5.25a
-- Versi PHP: 5.4.4
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4010... |
CREATE TABLE setting(
settingID BIGSERIAL PRIMARY KEY NOT NULL,
projectID BIGINT NOT NULL REFERENCES "project"(projectID),
sprintDays INT NOT NULL DEFAULT 10,
sprintStartDay INT NOT NULL DEFAULT 1,
sprintEndDay INT NOT NULL DEFAULT 5,
hoursPerPoint INT NOT NULL DEFAULT 4,
dateAdded DATE NOT NULL DEFAULT C... |
SELECT DISTINCT CITY FROM STATION
WHERE NOT CITY REGEXP '[aeiou]$' OR NOT CITY REGEXP '^[aeiou]';
|
CREATE DATABASE IF NOT EXISTS `adsb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `adsb`;
-- MySQL dump 10.13 Distrib 8.0.21, for Linux (x86_64)
--
-- Host: localhost Database: adsb
-- ------------------------------------------------------
-- Server v... |
-- Table definitions for the tournament project.
--
-- Put your SQL 'create table' statements in this file; also 'create view'
-- statements if you choose to use it.
--
-- You can write comments in this file by starting them with two dashes, like
-- these lines here.
-- DROP TABLE IF EXISTS Players;
-- DROP TABLE IF EX... |
-- basic usage of GROUP BY
SELECT vend_id, COUNT(*) AS num_prods
FROM Products
GROUP BY vend_id;
-- use HAVING to filter groups
SELECT cust_id, COUNT(*) AS orders
FROM Orders
GROUP BY cust_id
HAVING COUNT(*) >= 2;
-- WHERE is for filtering rows
-- HAVING is for filtering groups
-- one can use them both at the same ti... |
/* Formatted on 21/07/2014 18:46:22 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.VOMCRE0_APP_RIO_ANOMALIE
(
COD_ABI_CARTOLARIZZATO,
COD_GRUPPO_ECONOMICO,
COD_NDG,
DTA_RILEVAZIONE,
FLG_SINGOLO_CLIENTE,
FLG_TIPO_ANOMALIA,
ID_ANOMALIA,
VAL_ANOMALIA,
COD_MACROSTATO,
COD_ST... |
insert into public."Tag" ("Id", "Name", "ProductId") values (1, 'Outdoors', 94);
insert into public."Tag" ("Id", "Name", "ProductId") values (2, 'Sports', 69);
insert into public."Tag" ("Id", "Name", "ProductId") values (3, 'Clothing', 48);
insert into public."Tag" ("Id", "Name", "ProductId") values (4, 'Sports', 91);
... |
select
p.Name as ProductName,
c.Name as CategoryName
from Product p
left join ProductByCategory pc on p.Id = pc.ProductId
left join Category c on c.Id = pc.CategoryId |
SELECT x_shot, y_shot, goal_distance, big_chance, event_shots.game_id, "startDate" FROM event_shots
LEFT JOIN metadata
ON metadata.game_id = event_shots.game_id
WHERE event_shots.game_id IN (
SELECT game_id FROM metadata
WHERE (home_team_id = '{team_id}' OR away_team_id = '{team_id}')
AND CAST("startDate" AS DATE) <... |
create table BURI_TEST_CHAR (
TEST_ID varchar(255) not null,
VALUE varchar(100) not null,
VERSION_NO bigint not null,
constraint BURI_TEST_CHAR_PK primary key(TEST_ID)
);
|
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Aug 29, 2019 at 10:33 PM
-- 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_zone = "+00:00";
/*!40101 SET @OLD... |
DROP TABLE IF EXISTS `Messages`;
CREATE TABLE `Messages` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`message` longblob NOT NULL,
`topic` text NOT NULL,
`quality_of_service` tinyint(1) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
DROP TABLE editor_assets_tags;
--;;
DROP TABLE editor_assets;
--;;
DROP type editor_asset_type;
--;;
DROP TABLE editor_tags;
--;;
create type editor_asset_type as enum('background', 'surface', 'decoration');
--;;
CREATE TABLE editor_assets
(id SERIAL,
path VARCHAR(1024),
thumbnail_path VARCHAR(1024),
type editor_ass... |
-- phpMyAdmin SQL Dump
-- version 4.4.10
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Apr 10, 2016 at 12:49 PM
-- Server version: 5.5.42
-- PHP Version: 5.4.42
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Database: `test`
--
-- -------------------------------... |
--21. `sales_agent_customer_count.sql`:
--Provide a query that shows the count of customers
--assigned to each sales agent.
SELECT
COUNT(CustomerId) AS 'Number of Customers',
Employee.FirstName + ' ' + Employee.LastName AS 'Sales Rep'
FROM Customer
JOIN Employee
ON Employee.EmployeeId = Customer.SupportR... |
CREATE DATABASE twitter_clone;
CREATE EXTENSION "uuid-ossp";
CREATE TABLE users(
id uuid PRIMARY KEY DEFAULT uuid_generate_v4(),
username VARCHAR(255) NOT NULL UNIQUE,
email VARCHAR(255) NOT NULL UNIQUE,
password VARCHAR(255) NOT NULL,
profilepic VARCHAR(255) DEFAULT '/img/default.jpg',
lik... |
whenever sqlerror exit;
select to_number('Warning:Do not exec this script in the current user')
from (select user name from dual) where upper(name) in
(
'SCOTT',
'ORACLE_OCM',
'XS$NULL',
'MDDATA',
'DIP',
'APEX_PUBLIC_USER',
'SPATIAL_CSW_ADMIN_USR',
'SPATIAL_WFS_ADMIN_USR',
'DBSNMP',
'SYSMAN',
'FLOWS_FILES',
'MDSYS... |
# 一次性插入5条数据
INSERT INTO 20200603_tb_car
VALUES ('11', '奔驰', '2020-06-01', '200', '维修'),
('12', '奥迪', '2020-06-02', '300', '保养'),
('13', '大众', '2020-06-02', '320', '维修'),
('14', '宝马', '2020-06-02', '500', '保养'),
('15', '宝马', '2020-06-02', '400', '维修');
# 一次性插入5条201906数据
INSERT INTO 20200603_... |
SET FOREIGN_KEY_CHECKS = 0;
DROP TABLE IF EXISTS `job_task`;
CREATE TABLE `job_task`
(
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL,
`job_group` varchar(255) DEFAULT NULL,
`cron` varchar(255) DEFAULT NULL,
`parameter` varchar(255) NOT NULL,
`descript... |
insert into TBL_USERS values (
1,
'user',
'pass',
'email@email.com',
'nickname',
'firstname',
'lastname',
'dob',
'street',
'city',
'state',
'country',
1111,
1111,
1,
TRUE
);
|
insert into employee
values(1, 'employee1', 'employeeaddress1', 1000, CURRENT_TIMESTAMP, 'user1', CURRENT_TIMESTAMP, 'user2');
insert into employee
values(2, 'employee2', 'employeeaddress2', 1000, CURRENT_TIMESTAMP, 'user2', CURRENT_TIMESTAMP, 'user2');
|
delete sample_raw;
insert into sample_raw
select *
from ret;
execute dropcpttable();
execute count_topology();
execute reset_parent();
execute compute_probability();
execute reset_pivot();
execute create_dimension();
execute create_cpt();
execute threeway_decisions();
select * from cpt_p;
select * from... |
/* Formatted on 21/07/2014 18:41:00 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCREI_GET_LAST_RDV_PROGR
(
VAL_RDV_QC_PROGRESSIVA,
COD_ABI,
COD_NDG,
COD_PROTOCOLLO_DELIBERA
)
AS
SELECT val_rdv_qc_progressiva,
cod_abi,
cod_ndg,
cod_protocollo_delibera
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.