text stringlengths 6 9.38M |
|---|
CREATE DATABASE IF NOT EXISTS `portfoliodb` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `portfoliodb`;
-- MySQL dump 10.13 Distrib 8.0.22, for Win64 (x86_64)
--
-- Host: localhost Database: portfoliodb
-- ---------------------------------------------... |
SELECT S.pro_id
FROM "user" as U JOIN "special_user" as S ON U.username = S.username
WHERE U.username = ?; |
--
-- Copyright 2017-2017 Spotify AB
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or ... |
select product_in_branch.product_barcode,
product.name,
concat(b.TOWN,', ', b.ADDRESS) as branch,
M.name as manufaurer_name,
C.country_name,
product_in_branch.amount_in_stock
from product
join product_in_branch on product.barcode = product_in_branch.product_barcode
j... |
create table carts_products (
cart_id bigserial not null,
product_id bigint not null,
quantity int not null,
created_at timestamptz DEFAULT now(),
updated_at timestamptz DEFAULT now()
) with (OIDS = FALSE); |
SELECT name, id, email, cohort_id
FROM students
WHERE email NOT LIKE '%gmail.com'
AND phone IS NULL; |
/* MySQL 8.0.23 adds support for writing host part of account names in
* CIDR notation.
* See https://dev.mysql.com/doc/refman/8.0/en/account-names.html
*/
/* To create a user that could connect from a specific network */
CREATE USER 'test1'@'192.168.100.0/255.255.255.0';
/* Hey, this should also work properly in... |
Create Procedure sp_Delete_RecCustomers(@ID int)
As
Update ReceivedCustomers Set Status=(Status |192)
Where ID=@ID
|
select
distinct repo_group
from
gha_repos
where
repo_group is not null
order by
repo_group asc
;
|
INSERT INTO post(id,title,content) values (1,'Sometimes...','This is a story about...');
INSERT INTO post(id,title,content) values (2,'Beginning','What I am about to release...'); |
SET MODE POSTGRESQL;
CREATE TABLE IF NOT EXISTS Person (
id INT PRIMARY KEY AUTO_INCREMENT, --todo 18.11.2017: UUID from Java
first_name VARCHAR(255) NOT NULL,
last_name VARCHAR(255),
-- professional BOOLEAN DEFAULT FALSE,
dob DATE,
email VARCHAR(255) NOT NULL UNIQUE,
passw... |
-- phpMyAdmin SQL Dump
-- version 4.9.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost:8889
-- Generation Time: Sep 29, 2020 at 04:58 PM
-- Server version: 5.7.26
-- PHP Version: 7.4.2
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... |
Create Procedure MERP_SP_getDistinctFSUID
AS
Begin
-- Since Old version FSU should not requested to portal, we are making the below change
select distinct T.FSUID from tblinstallationdetail T,Setup S, tbl_merp_fileinfo F,Tbl_merp_configabstract Config where IsNull(T.Status, 0) & 4 = 4
and S.Version=F.BuildVers... |
-- Mar 6, 2008 6:40:40 PM CST
-- Change P_String
UPDATE AD_Column SET FieldLength=255,Updated=TO_DATE('2008-03-06 18:40:40','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=2791
;
-- Mar 6, 2008 6:40:40 PM CST
-- Change P_String
UPDATE AD_Field SET Name='Process String', Description='Process Parameter', ... |
SELECT name, kyoka, tokuten
FROM students
RIGHT OUTER JOIN seiseki ON students.student_no = seiseki.student_no
WHERE kyoka is not null; |
/*
执行用时:380 ms, 在所有 MySQL 提交中击败了26.57% 的用户
内存消耗:0 B, 在所有 MySQL 提交中击败了100.00% 的用户
通过测试用例:14 / 14
*/
# Write your MySQL query statement below
select distinct a.* from stadium a, stadium b, stadium c
where a.people >= 100 and b.people >= 100 and c.people >= 100 and
(
(a.id = b.id - 1 and b.id = c.id - 1) or
(b.id... |
CREATE TABLE spots (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
name varchar(50),
tags varchar(50),
address varchar(50),
city varchar(50),
state varchar(50),
lat decimal,
lon decimal
);
CREATE TABLE lists (
id INTEGER PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY,
na... |
/*
How to query the database to find the size of all page drafts per space
Confluence administrators may want to audit draft page usage on their instance.
link: https://confluence.atlassian.com/confkb/how-to-query-the-database-to-find-the-size-of-all-page-drafts-per-space-998664642.html
*/
select
count(... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
TRUNCATE cash_sessions RESTART IDENTITY cascade;
INSERT INTO cash_sessions (cash_session_id, buyin, cashout,
hours_played, date, user_id)
VALUES
(1, 300, 400, 5, now(), 1),
(2, 500, 0, 6.25, now(), 3),
(3, 100, 400, 2.5, now(), 5),
(4, 300, 1400, 2.25, now(), 2),
(5, 600, 800, 4.6, now(), 1),
... |
-- create user 'kalikalatest'@'localhost' identified by 'kalikalatest';
grant all privileges on kalikalatest.* to 'kalikalatest'@'localhost' identified by 'kalikalatest';
flush privileges;
|
DROP DATABASE IF EXISTS bamazon;
CREATE DATABASE bamazon;
USE bamazon;
CREATE TABLE products (
id INT NOT NULL AUTO_INCREMENT,
product_name VARCHAR(45) NULL,
department_name VARCHAR(20) NULL,
price DECIMAL (10,2) NOT NULL,
quantity INT(10),
product_sales DECIMAL (10,2) NULL,
PRIMARY KEY (id)
);
INSERT INTO product... |
insert into burgers (burger_name) values ('Quarter pounder');
insert into burgers (burger_name) values ('Big Mac');
insert into burgers (burger_name) values ('Mcdouble'); |
CREATE OR REPLACE FUNCTION fn_jbset(_ks text[])
RETURNS jsonb
LANGUAGE sql AS
$BODY$
SELECT jsonb_object_agg(t, TRUE)
FROM unnest(_ks) t;
$BODY$
CREATE OR REPLACE FUNCTION fn_jbset_conj(_set jsonb, _ks text[])
RETURNS jsonb
LANGUAGE sql AS
$BODY$
SELECT _set||fn_jbset(_ks);
$BODY$
CREATE OR REPLACE FUNC... |
-- ----------------------------------------------------------------------------------------------------
-- TABLE: favorites
-- ----------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS favorites;
CREATE TABLE public.favorites (
tenantId integer NOT NULL,... |
-- BETWEEN--範囲検索
-- ex.販売単価100~1000の商品を検索する
SELECT
name,
unit_price
FROM
items
WHERE
-- 100 <= unit_price <= 1000
unit_price BETWEEN 100 AND 1000
; |
CREATE DATABASE IF NOT EXISTS docker_database;
CREATE TABLE IF NOT EXISTS `docker_database`.`users` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC) VISIBLE);
|
\encoding UTF8;
SET client_min_messages TO WARNING;
ALTER TABLE app.acc_utente ADD COLUMN foto OID;
|
DROP DATABASE IF EXISTS scoreboard_data;
CREATE DATABASE scoreboard_data;
USE scoreboard_data;
DROP DATABASE IF EXISTS scoreboard;
CREATE TABLE scoreboard
(
id INT AUTO_INCREMENT UNIQUE,
player VARCHAR(20) NOT NULL,
score INT
);
INSERT INTO scoreboard(player, score) VALUES ("red", 0), ("yellow", 0);
|
--初始化 只运行一次
INSERT INTO td_navigation_menu(
action_type,
channel_id,
icon_id,
is_enable,
link_url,
name,
parent_id,
sort_id,
title,
type
) VALUES(
'view',
'0',
NULL,
TRUE,
'/cash/return/note/list',
'channel_cash_return_note_list',
87,
10,
'退款申请列表',
'system'
);
INSERT INTO t... |
# 1.查询同时存在1课程和2课程的情况
#题意不明
# 2.查询同时存在1课程和2课程的情况
#题意不明
# 3.查询平均成绩大于等于60分的同学的学生编号和学生姓名和平均成绩
# 查询每位学生的学生编号和平均成绩
-- select studentId, avg(score) avgScore from student_course
-- group by studentId
select s.id, s.name, sc.avgScore from student s, (select studentId, avg(score) avgScore from student_course
grou... |
SELECT date(time) AS 'Dzień', min(time) AS 'Wschód', max(time) AS 'Zachód'
FROM temp
WHERE measurement IS NOT NULL
GROUP BY day(time)
|
alter TABLE transparencia.acordo_aditamento_itens alter column quantidade type numeric; |
insert into customer (id, name) values (1, 'João da Silva');
insert into customer (id, name) values (2, 'Raimundo José');
insert into product (id, name, value) values (1, 'Celular', 1600.0);
insert into product (id, name, value) values (2, 'Notebook', 2700.0);
insert into product (id, name, value) values (3, 'Carregad... |
CREATE PROCEDURE sp_insert_Bank( @ACCOUNT_NO NVARCHAR(50),
@ACCOUNT_NAME NVARCHAR(50),
@BANK_CODE nvarchar(50),
@BRANCH_CODE nvarchar(50))
AS
INSERT INTO Bank(Account_Number,
Account_Name,
BankCode,
BranchCode,
Active)
Values (@ACCOUNT_NO,
@ACCOUNT_NAME,
@BANK_CODE,
@BRANCH_CODE,
1... |
ALTER TABLE `properties`
ADD COLUMN `state` ENUM('Active','Inactive') NOT NULL DEFAULT 'Active' AFTER `name`;
UPDATE `properties`
SET `state`='Active' WHERE `status_id`='1';
UPDATE `properties`
SET `state`='Inactive' WHERE `status_id`='2';
ALTER TABLE `properties`
DROP COLUMN `status_id`;
ALTER TABLE `prope... |
CREATE DATABASE IF NOT EXISTS testcase
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use testcase;
Create table if not exists user(
id varchar(32) primary key comment "email",
password varchar(32) ,
name varchar(64) ,
nick varchar(64),
ts timestamp default current_timestamp
);
create table i... |
/*
* Datenbank neu aufbauen (Alle Daten gehen verloren)
*
*/
-- Bestehende Tabellen löschen
drop table if exists TEST;
drop table if exists SPIELER;
create table SPIELER (
SPIELER_ID int primary key not null auto_increment,
NAME varchar(50) not null,
VNAME varchar(50) not null,
GEBDAT date not null,
STATUS i... |
CREATE TABLE pessoa (
codigo BIGINT(20) PRIMARY KEY AUTO_INCREMENT,
nome VARCHAR(50) NOT NULL,
ativo VARCHAR(10) NOT NULL,
logradouro VARCHAR(50),
numero VARCHAR(50),
complemento VARCHAR(50),
bairro VARCHAR(50),
cep VARCHAR(50),
cidade VARCHAR(50),
estado VARCHAR(50)
) ENGINE=innoDB... |
/*
SQLyog Community v12.2.4 (64 bit)
MySQL - 5.6.5-m8 : Database - xnode
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHEC... |
drop table if exists houses;
create table if not exists houses (
id serial,
name varchar(250),
address varchar(250),
city varchar(100),
state varchar(50),
zipcode int
);
insert into houses (
name,
address,
city,
state,
zipcode
) values (
'first name',
'first house',... |
-- //1 Find the country that start with Y
SELECT name FROM world
WHERE name LIKE 'Y%'
-- //2 Find the countries that end with y
SELECT name FROM world
WHERE name LIKE '%Y'
-- //3 Find the countries that contain the letter x
SELECT name FROM world
WHERE name LIKE '%x%'
-- //4 Find the countries that end wit... |
/*
Navicat MySQL Data Transfer
Source Server : sy
Source Server Type : MySQL
Source Server Version : 50722
Source Host : localhost:3306
Source Schema : article_spider
Target Server Type : MySQL
Target Server Version : 50722
File Encoding : 65001
Date: 09/07/2018 22:3... |
-- check_events.sql
-- reports on any events that are set
-- demo by setting some events:
-- alter session set events '10015 trace name context forever, level 3';
-- alter session set sql_trace=true;
set serveroutput on size 1000000
declare
event_level number;
begin
for i in 1..10999 loop
sys.dbms_syste... |
-- Nginx
insert into depends_on (id , valueName, services_id)
values ( 1, 'apache', 5 );
-- Kibana
insert into depends_on (id , valueName, services_id)
values ( 2, 'elasticsearch', 9 );
-- Kafka
insert into depends_on (id , valueName, services_id)
values ( 3, 'zookeeper', 12 );
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 19, 2019 at 08:09 AM
-- Server version: 10.1.36-MariaDB
-- PHP Version: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
-- GROUP BY group equal elements
SELECT score, name FROM second_table
WHERE name IS NOT NULL
ORDER BY score DESC;
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Dec 10, 2020 at 12:10 AM
-- Server version: 5.7.31
-- PHP Version: 7.3.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@... |
/**
*
* @author Alexey
* @name sums_4calc
* @manual
* @writable per_sums
*/
Select distinct t1.lc_id, t1.services_id, t1.fs_active
, t4.calc_formula, t4.calc_value_formula
, t.per_sums_id, t.flat_service_id
, t.date_id, t.calc, t.benefit
, t.recalc, t.full_calc, t.rate
, t.calc_value
From Calc_object q1
Inner... |
.mode column
.headers on
SELECT bookId, creatorId FROM bookCreator
WHERE bookId=4; |
-- Таблица users --
-- имена таблиц и полей в бэквотак или без них, ни каких кавычек!
CREATE TABLE `users` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(255) NOT NULL UNIQUE,
`pass` VARCHAR(255) NOT NULL,
PRIMARY KEY(id)
)
CHARACTER SET utf8
COLLATE utf8_general_ci;
INSERT INTO `users` (user... |
CREATE SCHEMA [Patient]
|
create table temp as
select
hospital_ownership,
count(provider_id) as log_count
from hospitals
group by hospital_ownership
order by log_count DESC;
|
UPDATE `article` SET `first_img` = 'http://www.lynnzh.top/src/thumbs/thumb_demo.jpeg';
UPDATE `article` SET `file_url` = 'http://www.lynnzh.top/src/issues/issues_demo.html'; |
SELECT
user_id,
current.rev_id,
CAST(current.rev_len AS INT) -
CAST(IFNULL(parent.rev_len, 0) AS INT) bytes_changed,
ve_tag.ct_rev_id IS NOT NULL AS ve_tagged
FROM staging.ve2_experimental_users
INNER JOIN enwiki.revision current ON user_id = current.rev_user
LEFT JOIN enwiki.revision parent ON parent.rev_i... |
create or replace trigger ins_sum after insert on coach for each row set @total = @total + new.salary;
create or replace trigger dec_sum after delete on coach for each row set @total = @total - old.salary;
|
-- link: https://leetcode.com/problems/exchange-seats/description/
-- Not sure the solution below works
select t1.id as id, coalesce(t2.student, t1.student) as student from seat t1 left join seat t2 on ((t1.id+1)^1)-1 = t2.id order by t1.id asc;
|
/*
** Question:https://leetcode.com/problems/project-employees-ii/
*/
-- method 1, Oracle
SELECT
t2.project_id
FROM
(
SELECT
t1.*,
RANK() OVER (ORDER BY t1.emp_cnt DESC) AS pos
FROM
(
SELECT p.project_id, COUNT(*) AS emp_cnt
FROM Project p
GROUP BY p.project_id
... |
-- Enola-ROUDAUT Florimel-FLOTTE Salomé-REBOURS
-- Le script de peuplement doit être lancé après le script de création des contraintes
-------------------------------------------------------------------------------------------------------------- SOMMAIRE
-----------------------------------------------------------... |
CREATE TABLE IF NOT EXISTS clients (
id INT NOT NULL AUTO_INCREMENT,
phone_number VARCHAR(16) NOT NULL,
first_name VARCHAR(100) NOT NULL,
last_name VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
) |
insert into UserInfo (user_name, password) values
("quinn", "qpwd"),
("christian", "cpwd"),
("story", "spwd"),
("benjamin", "bpwd"),
("graham", "gpwd"),
("justin", "jpwd"); |
-- phpMyAdmin SQL Dump
-- version 4.0.10.18
-- https://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Apr 13, 2017 at 09:44 AM
-- Server version: 10.1.22-MariaDB
-- PHP Version: 5.6.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARAC... |
/*
Navicat MySQL Data Transfer
Source Server : 127.0.0.1_3306
Source Server Version : 50718
Source Host : 127.0.0.1:3306
Source Database : logistics
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding : 65001
Date: 2018-11-20 09:42:00
*/
SET FOREIGN_KEY_CHECKS=0... |
CREATE TABLE `article` (
`articleId` int(11) NOT NULL AUTO_INCREMENT,
`articleName` varchar(50) NOT NULL,
`articleContent` text CHARACTER SET latin1,
`articleDescription` varchar(100) DEFAULT NULL,
`articleSubCategoryId` int(11) NOT NULL,
`articleCreatedDate` date NOT NULL,
`articleLastModifiedDate` date ... |
create database xidianstudents;
ALTER DATABASE xidianstudents CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
DROP TABLE IF EXISTS xidianstudents.student;
CREATE TABLE xidianstudents.student
(
id INT(8) NOT NULL PRIMARY KEY AUTO_INCREMENT,
academy VARCHAR(100),
className VARCHAR(50),
email... |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 14, 2015 at 06:07 AM
-- Server version: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
# __
# .--------.--.--.-----.-----.| |
# | | | |__ --| _ || |
# |__|__|__|___ |_____|__ ||__|
# |_____| |__|
#
# MySQL DML Exercises 10/20 - The IS NULL and IS NOT NULL conditions
# Write a query to select all staff memb... |
set hive.execution.engine=spark;
drop table if exists dws.dws_activity_salesman_month;
CREATE TABLE dws.dws_activity_salesman_month (
`report_month` string COMMENT '年月',
`city` string COMMENT '分公司',
`market_department` string COMMENT '市场部',
`name` string COMMENT '销售人员',
`has_reach_goal` string COMMENT '是否达标',... |
-- 客户表Customer1045,用户购买Product1045所有产品
select customer_id from Customer1045
group by customer_id having count(*) = (select count(*) from Product1045)
create table Customer1045(
customer_id int,
product_key int
);
create table Product1045(
product_key int
);
insert into Customer1045 values (1,5),(2,6),(3,5),(3,6),... |
DROP DATABASE IF EXISTS expend_daily;
CREATE DATABASE expend_daily DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use expend_daily;
#建表
DROP table IF EXISTS `expend_record`;
create table expend_record (
id bigint NOT NULL AUTO_INCREMENT COMMENT 'id',
user_id bigint(20) DEFAULT NULL COMMENT '用户id',... |
# change the default value of the study name column
ALTER TABLE study CHANGE name name varchar(255) DEFAULT NULL;
# patch identifier
INSERT INTO meta (species_id, meta_key, meta_value) VALUES (NULL,'patch', 'patch_62_63_e.sql|change the default value of the study name column');
|
use pharmaview;
drop table if exists pvprods;
create table pvprods select * from pvsuperset group by product_id ;
|
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 25-01-2017 a las 04:41:59
-- Versión del servidor: 10.1.13-MariaDB
-- Versión de PHP: 5.6.21
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT... |
--numCheckins = sum of all check-ins for that business
update business
set numCheckins = temp2.numCheckins
from (select business_id, sum(tempSum) as numCheckins
from (select business_id, (night + evening + afternoon + morning) as tempSum
from checkin) as temp
group by business_id) as temp2
where business.busine... |
DECLARE
e_date EXCEPTION;
PRAGMA EXCEPTION_INIT(e_date, -1858);
v_date DATE;
BEGIN
SELECT TO_DATE( '13-DEC-2004 6:56 PM', 'DD-MON-YYYY HH:MI:SS') INTO v_date FROM dual;
EXCEPTION
WHEN e_date THEN
PRC_LOG_ERROR( 'error', SQLCODE, SQLERRM, 'anonymous block');
... |
create or replace FUNCTION NombreModalidadProfesor(Profesor IN Profesores.OID_P%TYPE)
RETURN VARCHAR2 IS modalidad modalidades.NOMBRE%type;
BEGIN
SELECT NOMBRE INTO modalidad FROM profesores, MODALIDADES
WHERE (Profesores.OID_P=Profesor AND PROFESORES.OID_M=MODALIDADES.OID_M);
RETURN(modalidad);
END; |
with t as
(
select
project,
percentile_cont(array[0.5, 0.9, 0.95, 0.99]) within group (order by cts-ats) as pers
from commitlog
where ats <> cts
group by project
)
select
project,
pers[1] as median,
pers[2] as "90%th",
pers[3] as "95%th",
pers[4] as "99%th"
from t
;
|
-- DELETE DATA t_resume_career TABLE
DELETE RC.* FROM t_resume_career RC
WHERE RC.T_RESUME_ID NOT IN (SELECT R.ID FROM T_RESUME R
LEFT JOIN m_candidate CAN ON R.M_CANDIDATE_ID = CAN.ID
WHERE CAN.`CODE` LIKE 'CSG%');
-- DELETE DATA t_resume_industry TABLE
DELETE RI.* FROM t_resume_industry... |
INSERT INTO core_erp_l_category_apomiosi(myid,title,mykatastima) VALUES
(1,'ΛΗΓΜΕΝΑ','krestena'),
(2,'ΛΑΘΟΣ STOCK (ΦΡΕΣΚΑ)','krestena'),
(3,'ΦΥΡΑ','krestena'),
(4,'ΚΑΤΕΣΤΡΑΜΕΝΑ (ΚΑΤΑ ΤΗ ΠΑΡΑΛΑΒΗ)','krestena'),
(5,'ΚΑΤΕΣΤΡΑΜΕΝΑ ΚΛΕΜΕΝΑ ΑΠΟ ΠΕΛΑΤΕΣ','krestena'),
(6,'ΕΝΤΟΛΗ ΔΙΕΥΘΗΝΣΗΣ ΑΓΟΡΩΝ','krestena'),
(7,'ΒΛΑΒΗ ΨΥΓΕΙ... |
-- 16. Выберите самый широко используемый ингредиент. Ингредиент будем считать самым широко используемым, если его
-- включает большее число блюд. Выбрать нужно только название ингредиента.
SELECT alternative_name FROM (
SELECT ingredients_list.dishes_id, ingredients_list.ingr_id, alternative_name FROM ingredients... |
SPOOL C:\Nur_Suhaira_5841549_A2\solution6Output;
/* ==============================================
Student Name: Nur Suhaira
Student Number: 5841549
Description: Assignment 2 Task 6
Date written: 10th May 2018
================================================
======================Qn 6=====================*/
... |
SELECT CONCEPT_CD, COUNT (*) FROM
(SELECT CONCEPT_CD FROM OBSERVATION_FACT
WHERE (CONCEPT_CD LIKE 'DEM|RACE%' OR CONCEPT_CD LIKE 'DEM|AGE%' OR CONCEPT_CD LIKE 'DEM|RELIGION%' OR CONCEPT_CD LIKE 'DEM|LANGUAGE%' OR CONCEPT_CD LIKE 'DEM|SEX%') AND PATIENT_NUM IN (SELECT DISTINCT(PATIENT_NUM)
FROM OBSERVATION_FACT
... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 25, 2020 at 05:11 AM
-- Server version: 5.7.26
-- PHP Version: 7.2.18
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Sep 28, 2020 at 10:32 AM
-- Server version: 8.0.18
-- PHP Version: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
UPDATE raw_property SET sqft = REPLACE(sqft, ',', '');
UPDATE raw_property SET hlfbath = 0 WHERE hlfbath IS NULL;
DELETE FROM raw_property WHERE lati IS NULL;
DELETE FROM raw_property WHERE longi IS NULL;
DELETE FROM raw_property WHERE bath IS NULL;
DELETE FROM raW_property WHERE sqft = '';
INSERT INTO property... |
--将用户按照创建订单时间降序排序,获取用户最早的下单时间,并且位于2017年10月1日至11月30日之间
use bnb_hive_db;
drop table if exists tmp_zc_uid_createdtime;
create table tmp_zc_uid_createdtime as
select uid,orderid,createdtime from
(select uid,orderid,row_number() over(partition by uid order by createdtime) as createdtime
from ods_htl_bnborderdb.order_hea... |
-- 06-13-2010 05:36:04 PM CST
-- queuing time_explanation
UPDATE AD_Field SET Description='Queue time is the time a ob waits at a work center before begin handled.', Help='Queuing time has no implication on costs, but on Capacity Requirement Planning (CRP) to calculate the total time needed to manufacture a product.'... |
-- Script deletes a database
-- If database doesn't exist, script won't fail
DROP DATABASE IF EXISTS hbtn_0c_0;
|
-- BEF initialize (insert) tables used by jpa in h2 db
INSERT INTO staff(id, first_name, last_name) VALUES(1, 'halit', 'argun'); -- NOTE ilker, using auto_increment that is used by @GeneratedValue
--INSERT INTO staff(id, first_name, last_name) VALUES(2, 'ender', 'argun');
--INSERT INTO staff(id, first_name, last_nam... |
--liquibase formatted sql
--changeset eibldavid:1 splitStatements:true endDelimiter:;
CREATE SEQUENCE hibernate_sequence
START WITH 100
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
create table category
(
id integer NOT NULL PRIMARY KEY,
domain_id UUID NOT NULL,
name varchar(255) NO... |
create database library;
use library;
create table library.book(
id int not null unique,
title varchar(100) not null,
book_description text,
price float not null,
isbn varchar(50) not null unique,
primary key(id)
);
create table library.genre(
id int not null unique,
name varchar(30) not null unique,
primary key(id)
);... |
--1 마당서점의고객이요구하는다음질문에대해SQL 문을작성하시오.
--(5) 박지성이구매한도서의출판사수
select custid from customer where name='박지성';
select count(distinct publisher)
from orders o, book b
where custid = (select custid from customer where name='박지성')
and o.bookid=b.bookid
;
select count(distinct publisher)
from book
where bookid in (select bookid... |
CREATE VIEW [sn].[user]
AS
SELECT
--TOP (1000)
DISTINCT([incidentA].[sys_created_by_value]) AS [user short name]
,[incidentA].[caller_id_value] AS [user sys id]
,[sys_userA].[employee_number_value] AS [employee number]
,[sys_userA].[first_name_value] AS [first name]
,[sys_userA].[last_name_value] AS [last na... |
CREATE TABLE `user_info` (
`user_id` int(11) DEFAULT NULL,
`user_name` varchar(500) DEFAULT NULL,
`user_pwd` varchar(500) DEFAULT NULL,
`user_email` varchar(500) DEFAULT NULL,
`user_phone` int(100) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
INSERT INTO user_info(user_id,user_name, user_pwd, us... |
-- a lo mas habria dos banos en un autobus
ALTER TABLE autobus
ADD CONSTRAINT chk_autobus_wc
CHECK (wc BETWEEN 0 AND 2);
|
DROP TABLE MATCH CASCADE CONSTRAINT;
DROP TABLE SEASON CASCADE CONSTRAINT;
DROP TABLE COACH CASCADE CONSTRAINT;
DROP TABLE CLUB CASCADE CONSTRAINT;
DROP TABLE CATEGORY CASCADE CONSTRAINT;
DROP TABLE TEAM CASCADE CONSTRAINT;
DROP TABLE PLAYER CASCADE CONSTRAINT;
DROP TABLE SECRETARY CASCADE CONSTRAINT;
DROP TABL... |
insert into atdVrCategory (seq, CASE) values (1, '연차');
insert into atdVrCategory (seq, CASE) values (2, '반차');
insert into atdVrCategory (seq, CASE) values (4, '경조휴가');
insert into atdVrCategory (seq, CASE) values (5, '하계휴가');
insert into atdVrCategory (seq, CASE) values (6, '동계휴가'); |
-- table_ddl.sql
@clears
col v_owner new_value v_owner noprint
col v_table_name new_value v_table_name noprint
prompt
prompt Table Owner:
prompt
set feed off term off
select upper('&1') v_owner from dual;
set feed on term on
prompt
prompt Table Name:
prompt
set feed off term off
select upper('&2') v_table_name f... |
CREATE TABLE IF NOT EXISTS assento_sala (
`idAssento` INT NOT NULL,
`sala_idSala` INT UNSIGNED NOT NULL,
PRIMARY KEY (`idAssento`),
INDEX `fk_assento_sala1_idx` (`sala_idSala` ASC),
CONSTRAINT `fk_assento_sala1`
FOREIGN KEY (`sala_idSala`)
REFERENCES `sala` (`idSala`)
ON DELETE NO ACTION
ON UP... |
DROP DATABASE IF EXISTS library_eval;
CREATE DATABASE library;
USE library;
CREATE TABLE IF NOT EXISTS book (
id INT AUTO_INCREMENT PRIMARY KEY,
user_id INT,
tittle VARCHAR(40) NOT NULL,
author VARCHAR(40) NOT NULL,
resume TEXT,
publication_date DATETIME,
category VARCHAR(15) NOT NULL
)
EN... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.