text stringlengths 6 9.38M |
|---|
insert into CUSTOMERS (CUSTOMER_NAME, PASSWORD, EMAIL) VALUES ('Michael', 'Bo$$', 'mscott@dundermifflin.com');
insert into CUSTOMERS (CUSTOMER_NAME, PASSWORD, EMAIL) VALUES ('Pam', 'P@mP@m', 'pbeesley@dundermifflin.com');
insert into CUSTOMERS (CUSTOMER_NAME, PASSWORD, EMAIL) VALUES ('Jim', 'ILoveP@m', 'jhalpert@dund... |
### Schema
CREATE DATABASE quotes_db;
USE quotes_db;
CREATE TABLE quotes_db
(
id int NOT NULL AUTO_INCREMENT,
author varchar(255) NOT NULL,
quote TEXT NOT NULL,
PRIMARY KEY(id)
) |
INSERT INTO burgers (burger_name)
VALUES ("Galaxy Burger"),
("Texas Ranch Burger"),
("Japaneese Sushi Burger"); |
--begin addby daijiy 2016-7-16
@repeat{SELECT COUNT(*) FROM exceptioninfo where ID=690}
insert into exceptioninfo (ID, CODE, MSG, MODULES)
values (690, '0690', '该班次号在此日期段内已经存在班次计划!', '添加班次信息');
@repeat{SELECT COUNT(*) FROM parameter where ID=160070791}
insert into parameter (ID, TYPE, CODE, VALUE, ISVISIBLE, ISEDIT... |
--修改日期:2012.11.28
--修改人:刘之三
--修改内容:以收定支
--修改原因:以收定支
DECLARE
VN_COUNT NUMBER;
BEGIN
SELECT COUNT(*)
INTO VN_COUNT
FROM bt_param
WHERE CODE= 'isPayCtrl' AND SYS_CODE='fbs';
IF VN_COUNT < 1 THEN
insert into bt_param (CODE, SYS_CODE, NAME, PARAM_VALUE1, PARAM_VALUE2, PARAM_VALUE3, PARAM_TYPE, RMK, R... |
create table if not exists training
(
id bigint generated by default as identity primary key,
name varchar(255) not null,
surname varchar(255) not null,
email varchar(255) not null,
hasAttend boolean,
score int
); |
select log_id, log_date, window_name, operation, status
from dba_scheduler_window_log;
|
CREATE DATABASE spary;
CREATE DATABASE spary_test;
CREATE USER spary_admin IDENTIFIED BY 'spary@YRAPS';
GRANT ALL PRIVILEGES ON spary.* TO 'spary_admin'@'%';
GRANT ALL PRIVILEGES ON spary_test.* TO 'spary_admin'@'%';
FLUSH PRIVILEGES;
|
CREATE Procedure sp_GetDsValue(@Position as Integer, @Active as Integer = 2)
As
Begin
Select Distinct DSTypeID,DSTypeValue From DSType_Master Where DSTypeCtlPos = @Position and Active = ( Case when @Active = 1 then 1 Else Active End ) And
( Case when DSTypeCtlPos = 1 then
(Select flag from tbl_merp... |
-- View: vg_closing_stock_location_serial_stock_history_2
-- DROP VIEW vg_closing_stock_location_serial_stock_history_2;
CREATE OR REPLACE VIEW vg_closing_stock_location_serial_stock_history_2 AS
WITH slh_cum_qty AS (
SELECT slh.id,
slh.move_id,
slh.location_id,
slh.comp... |
SELECT DISTINCT l1.Num AS ConsecutiveNums
FROM Logs l1, Logs l2, Logs l3
WHERE l1.Id+1=l2.Id AND l2.id+1=l3.id AND l1.Num=l2.Num AND l2.Num=l3.Num; |
-- phpMyAdmin SQL Dump
-- version 4.6.6
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost
-- Tiempo de generación: 25-09-2018 a las 11:03:50
-- Versión del servidor: 5.7.17-log
-- 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_CLIENT=@@... |
-- add table prefix if you have one
DELETE FROM core_config_data WHERE path like 'ffuenf_categoryproductsortbackend_setup/%';
DELETE FROM core_config_data WHERE path = 'advanced/modules_disable_output/Ffuenf_CategoryProductSortBackend';
DELETE FROM core_resource WHERE code = 'ffuenf_categoryproductsortbackend_setup'; |
-- ----------------------------
-- Table structure for other_customer
-- ----------------------------
DROP TABLE IF EXISTS `customer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `customer` (
`id` bigint NOT NULL... |
use www;
-- 2011.1.1起有>=2条点评:点评内容有“24小时”(328)
-- 2011.1.1起有=1条点评,且点评标签有“24小时营业”:点评内容有“24小时”(102)
create table if not exists mwt_certain_24H_shop(shopid int, cityid int ,tag string);
insert overwrite table mwt_certain_24H_shop
select shop_id , city_id, "24H"
from bi.dpdim_dp_shop where hp_valid_end_dt = "3000-12-31" a... |
--2. Create a new table: 'PRINTED_ORDERS' (id type number (generated with a sequence), details type clob).
DROP TABLE printed_orders;
CREATE TABLE printed_orders
(
id_printed_order NUMBER PRIMARY KEY,
details CLOB
);
DROP SEQUENCE seq_printed_order_id;
CREATE SEQUENCE seq_printed_order_... |
INSERT INTO `bet365`.`sport` (`idSport`,`name`) VALUES (1, 'Futebol Virtual');
INSERT INTO `bet365`.`sport` (`idSport`,`name`) VALUES (2, 'Futebol');
INSERT INTO `bet365`.`market` (`idMarket`, `name`, `idSport`) VALUES (1, 'Vencedor do Jogo', 1);
INSERT INTO `bet365`.`market` (`idMarket`, `name`, `idSport`) VALUES (2,... |
# 1. Schreiben Sie eine Abfrage, die die Summe des Warenbestandes (UnitsInStock)
# der Produkte mit der Kategorie ID 7 ausgibt.
SELECT SUM(products.UnitsInStock) AS 'Summe'
FROM products
WHERE products.CategoryID = 7;
# 2. Schreiben Sie eine Abfrage, die die Summe des Warenbestandes (UnitsInStock)
# der Produkte für... |
Create Procedure mERP_sp_GetFieldStatus(@ScreenCode nVarchar(100),@Flag Int = -1)
As
Begin
If @Flag = -1
Select ControlName, ControlIndex, isNull(Flag,1) As Flag,AllowConfig, TabIndex, TabLevel
From tbl_mERP_ConfigDetail
Where ScreenCode = @ScreenCode
Else
Select ControlName, ControlIndex, isNull(Flag,1) As ... |
-- 20 Jan 2017
-- Example changeset to create for database changes.
-- Add changeset to system.version table so its possible to determine if hte chagneset has been run.
INSERT INTO system.version SELECT '1701a' WHERE NOT EXISTS (SELECT version_num FROM system.version WHERE version_num = '1701a');
-- Changeset SQL t... |
with ranked as (
select
*,
dense_rank() over (
partition by customer_id
order by order_id
) as order_num
from {{ref('fct_order_items')}}
)
select
customer_id,
{% for order in [1,2,3] %}
sum(
case when order_num = {{order}}
then price
else 0
end
) as order_{{order}}_total
{... |
create table EMP_15(EMPNO number,
ENAME varchar2(10),
JOB char(15),
MGR number,
HIREDATE date,
SAL number,
COMM number,
DEPT_NAME number);
insert into EMP_15 values(&EMPNO,'&ENAME','&JOB',&MGR,'&HIREDATE',&SAL,&COMM,&DEPTNO);
#1
select ENAME from EMP_15 where SAL = (select max(SAL) f... |
insert INTO area(idarea, nombre, descripcion) VALUES (1, 'matematicas', 'area de matematicas');
insert INTO area(idarea, nombre, descripcion) VALUES (2, 'algoritmos', 'area de algoritmos');
insert INTO area(idarea, nombre, descripcion) VALUES (3, 'redes', 'area de redes');
insert INTO asignatura(idasignatura, idarea... |
/*
PSEUDO
PSEUDO COLUMN, 의사 컬럼
- 실제 컬럼은 아닌데 컬럼처럼 행동하는 객체
- 함수처럼 생각해도 된다.
ROWNUM
- 오라클 전용, MS-SQL(top), mySQL(limit)
- 행번호를 반환하는 컬럼
- 서브 쿼리에 많이 의존
- ROWNUM은 주로 FROM절이 호출될때 같이 실행된다.*****************
*/
SELECT *
FROM TBLCOUNTRY;
SELECT C.*,
ROWNUM
FROM TBLCOUNTRY C
-- WHERE CONTINENT='AS'
;
-- 질문의... |
SELECT c.Name, COUNT(*) AS HotelCount FROM Hotels h
JOIN Cities c ON c.Id= h.CityId
GROUP BY c.Name
ORDER BY HotelCount DESC, c.Name
|
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 16, 2018 at 03:15 AM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
/* Создание таблицы констант */
CREATE TABLE /*PREFIX*/CONSTS
(
NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(250),
VALUE LONGBLOB NOT NULL,
PRIMARY KEY (NAME)
)
--
/* Создание просмотра таблицы констант */
CREATE VIEW /*PREFIX*/S_CONSTS
AS
SELECT * FROM /*PREFIX*/CONSTS
--
/* Создание процедуры добавле... |
SELECT
users.user_id, user_first_name, user_last_name, user_birth_date, user_email, user_profile_img, isstreamer
FROM users
INNER JOIN applications ON applications.user_id = users.user_id
WHERE users.user_id = $1 |
CREATE DATABASE IF NOT EXISTS `contable` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `contable`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
--
-- Host: 127.0.0.1 Database: contable
-- ------------------------------------------------------
-- Server version 5.1.73-community
/*!40101 SET @OLD_CHARACTER_SET... |
drop table sondereinheit;
select * from einheit;
drop table unterrichtet;
Drop table einheit;
drop table lehrer;
drop table wiederholen;
drop table termin;
CREATE TABLE einheit (
einheitID bigint primary key GENERATED BY DEFAULT AS IDENTITY,
name VARCHAR(30) UNIQUE NOT NULL,
tag VAR... |
Create Procedure mERP_SP_InsertSchemeItemScope
(
@SchemeID int,
@Category nVarchar(4000)=NULL,
@SubCategory nVarchar(4000)=NULL,
@MSKU nVarchar(4000) =NULL,
@SKU nVarchar(4000)=NULL
)
As
If (IsNull(@Category,'') = '')
Set @Category = 'ALL'
If (IsNull(@SubCategory,'') = '')
Set @SubCategory = 'ALL'
If (IsNull(@MSKU,... |
-- phpMyAdmin SQL Dump
-- version 4.8.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 21, 2018 at 09:45 AM
-- Server version: 10.1.34-MariaDB
-- PHP Version: 7.2.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE DATABASE IF NOT EXISTS `contable` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `contable`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win32 (x86)
--
-- Host: 127.0.0.1 Database: contable
-- ------------------------------------------------------
-- Server version 5.1.73-community
/*!40101 SET @OLD_CHARACTER_SET... |
/*
Navicat MySQL Data Transfer
Source Server : localhost_3306
Source Server Version : 50520
Source Host : localhost:3306
Source Database : shop
Target Server Type : MYSQL
Target Server Version : 50520
File Encoding : 65001
Date: 2019-07-12 20:35:07
*/
SET FOREIGN_KEY_CHECKS=0;
--... |
/*
Navicat MySQL Data Transfer
Source Server : rm-uf6vl7168doce1268do.mysql.rds.aliyuncs.com
Source Server Version : 50718
Source Host : rm-uf6vl7168doce1268do.mysql.rds.aliyuncs.com:3306
Source Database : nterp
Target Server Type : MYSQL
Target Server Version : 50718
File Encoding ... |
/* Formatted on 5/16/2017 8:32:27 PM (QP5 v5.114.809.3010)
Consolidated all separate queries to make a single one. Removed any group by queries ( sum, count etc.).
All groupings will be taken care of at the reporting level.
*/
SELECT TARIFF_INFO_USED_SERVICE_PKEY,
(SELECT DES
FROM MPUSNTAB... |
-- migrate:up
CREATE INDEX operations_id_timestamp_idx ON operations(wallet_id, timestamp);
CREATE INDEX wallets_user_id_idx ON wallets(user_id);
-- migrate:down
DROP INDEX wallets_user_id_idx;
DROP INDEX operations_id_timestamp_idx;
|
2018-10-17 14:00:18
controller: AlarmController action: getAlarmData
select * from `alarms` where `id` > 0 and `is_closed` = '0' order by `sequence` asc
3.490ms
select count(*) as aggregate from `risk_projects` where `id` > 0 and `status` = 0
3.260ms
select `lottery_id` from `issues` where `id` > 0 and `status` = 1 and... |
ALTER TABLE Slots DROP FOREIGN KEY `Slots_ibfk_3`;
ALTER TABLE Slots DROP FOREIGN KEY `Slots_ibfk_2`;
ALTER TABLE Slots DROP FOREIGN KEY `Slots_ibfk_1`;
ALTER TABLE Slots DROP PRIMARY KEY;
ALTER TABLE Slots ADD PRIMARY KEY (timeId, roomId);
ALTER TABLE Slots ADD CONSTRAINT
FOREIGN KEY (sessionId) REFERENCES Session... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 10-Maio-2020 às 22:42
-- Versão do servidor: 10.4.11-MariaDB
-- versão do PHP: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
MERGE INTO Semesters AS Target
USING (VALUES
('FA', 'Fall', 1),
('SP', 'Spring', 2),
('SU', 'Summer', 3)
)
AS Source (SemesterCode, SemesterName, AcademicOrder)
ON Target.SemesterCode = Source.SemesterCode
WHEN MATCHED THEN
UPDATE
SET
SemesterName = Source.SemesterName,
AcademicOrd... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 24, 2017 at 04:07 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
DROP SCHEMA IF EXISTS Superstore;
CREATE SCHEMA Superstore;
USE Superstore;
CREATE TABLE `Superstore`.customer (
customer_id int(11) NOT NULL AUTO_INCREMENT,
first_name varchar(100) NULL,
last_name varchar(100) NULL,
email varchar(100) NULL,
phone int(10) NULL,
address_id varchar(100) NOT NULL AUTO_I... |
SELECT students.name as student, AVG(assignment_submissions.duration) as average_duration_time
FROM students JOIN assignment_submissions ON (students.id = student_id)
WHERE students.end_date IS NULL
GROUP BY students.name
ORDER BY average_duration_time DESC; |
# --- !Ups
CREATE TABLE notification_rule (
id serial,
tag_id INTEGER,
the_type INTEGER NOT NULL,
email text NOT NULL,
organization_id INTEGER NOT NULL,
CONSTRAINT pk_notification_rule PRIMARY KEY(id),
CONSTRAINT fk_notifiaction_rule_tag FOREIGN KEY(tag_id) references tag(id),
CONSTRAINT fk_not... |
INSERT INTO `bdCinema`.`usuario`
(`idUsuario`,
`usuario`,
`senha`,
`cpf`)
VALUES
(<{idUsuario: }>,
<{usuario: }>,
<{senha: }>,
<{cpf: }>);
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jan 10, 2021 at 08:48 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
INSERT INTO InstitutionType( kod, name) VALUES( '300', 'Centri socijalne skrbi');
INSERT INTO InstitutionType( kod, name) VALUES( '469', 'Domovi za starije i nemoćne osobe (domovi čiji je osnivač županija)');
INSERT INTO InstitutionType( kod, name) VALUES( '470', 'Domovi za starije i nemoćne osobe (domovi drugih osniva... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- 主機: 127.0.0.1
-- 產生時間: 2018 年 10 月 21 日 14:40
-- 伺服器版本: 10.1.36-MariaDB
-- PHP 版本: 7.2.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHAR... |
@clears
@columns
col job format 99999
col log_user format a10
col priv_user format a10
col schema_user format a10
col what format a20
col interval format a20
set line 200
set pages 60
break on username skip 1
select
s.username,
jr.sid,
jr.job,
jr.failures,
jr.last_date,
jr.this_date,
dj.next_date
from db... |
CREATE DATABASE IF NOT EXISTS `FRDB` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `FRDB`;
-- MySQL dump 10.13 Distrib 5.6.17, for osx10.6 (i386)
--
-- Host: 127.0.0.1 Database: FRDB
-- ------------------------------------------------------
-- Server version 5.6.20
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
INSERT INTO solution_type(solution_type_id, description, title) VALUES (1, 'Builder', 'Builder');
INSERT INTO solution_type(solution_type_id, description, title) VALUES (2, 'Bricklayer', 'Bricklayer');
INSERT INTO solution_type(solution_type_id, description, title) VALUES (3, 'Carpet Fitter', 'Carpet Fitter');
INSER... |
select v.sql_id,v.child_number,
v.sql_text,
v.elapsed_time,
v.cpu_time,
v.disk_reads,
rank() over(order by v.elapsed_time desc) elapsed_rank
from v$sql v
|
rem CS448 SQL Project 1
rem Said Kayyali
rem skayyali@purdue.edu
/* ######### PART 1: SQL QUERIES ######### */
rem Query1
SELECT EmpName
FROM Employee
WHERE HomeZipCode=47906 OR HomeZipCode=47907;
rem Query2
SELECT p.ProjName
FROM Project p, ProjectManager pm
WHERE p.ProjId=pm.ProjId AND EndDate IS NULL;
rem Quer... |
-- Sequence: seq_pic
-- DROP SEQUENCE seq_pic;
CREATE SEQUENCE seq_pic
INCREMENT 1
MINVALUE 1
MAXVALUE 9223372036854775807
START 1
CACHE 1;
ALTER TABLE seq_pic
OWNER TO oecobt;
-- Table: pic
-- DROP TABLE pic;
CREATE TABLE pic
(
id integer NOT NULL DEFAULT nextval('seq_pic'::regclass),
name charact... |
SET client_encoding = 'UTF8';
CREATE TABLE shop_accounts (
id SERIAL NOT NULL,
email varchar(64) NOT NULL,
pass varchar(20) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT current_timestamp,
updated_at TIMESTAMP NOT NULL DEFAULT current_timestamp,
PRIMARY KEY (id)
);
INSERT INTO shop_accounts (email, pass... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 21-12-2018 a las 19:47:43
-- Versión del servidor: 5.7.19
-- Versión de PHP: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 02, 2019 at 02:12 AM
-- Server version: 5.7.24
-- 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 @OLD_CHARACT... |
ALTER TABLE cadaster ALTER COLUMN floor TYPE VARCHAR(50);
|
USE RecursosHumanos
--DATA
SELECT GETDATE()
SELECT nome, DAY(dataNascto) FROM Funcionario
SELECT nome, MONTH(dataNascto) FROM Funcionario
SELECT nome, YEAR(dataNascto) FROM Funcionario
SELECT dataNascto, DATEADD(DAY, 5, dataNascto) FROM Funcionario
SELECT dataNascto, DATEADD(MONTH, 2, dataNascto) FROM Funcionario... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 29, 2021 at 03:50 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
DROP TABLE IF EXISTS lookup_occ;
CREATE TABLE lookup_occ(
dob_occ text,
occ text
);
\COPY lookup_occ FROM 'data/lookup_occ.csv' DELIMITER ',' CSV HEADER;
DROP TABLE IF EXISTS lookup_ownership;
CREATE TABLE lookup_ownership (
cityowned text,
ownertype text,
nonprofit text,
ownership text
);
\C... |
CREATE TABLE `user_roles`
(
`users_id` int NOT NULL,
`roles_id` int NOT NULL,
PRIMARY KEY (`users_id`, `roles_id`),
KEY `user_id` (`users_id`),
CONSTRAINT `user_role_ibfk_1`
FOREIGN KEY (`roles_id`) REFERENCES `role` (`id`),
CONSTRAINT `user_role_ibfk_2`
FOREIGN KEY (`users_id`) ... |
SELECT
/* Order Information */
orders.id AS "Order ID",
clients_statement.id AS "Statement Number",
DATE_FORMAT (ordereddate,"%m/%d/%Y") as "Order Date",
order_types.`descrip` as "Product",
`propertyaddress` as "Property Address",
`propertyaddress2` as "Property Address 2",
`propertycity` AS "Property City",
... |
--
-- Table structure for table `capability`
--
CREATE TABLE IF NOT EXISTS `av_capability` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`capability` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;
-- --------------------------------------------------------
--
-- Table stru... |
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Anamakine: localhost
-- Üretim Zamanı: 11 Kas 2016, 07:15:05
-- Sunucu sürümü: 10.0.20-MariaDB
-- PHP Sürümü: 5.2.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI... |
select
i.id,
i.event_id,
i.dup_created_at,
i.created_at,
coalesce(i.body, ''),
i.closed_at,
i.comments,
i.locked,
i.number,
i.state,
i.title,
i.updated_at,
i.is_pull_request,
i.dup_type,
i.dup_repo_name,
coalesce(r.org_login, ''),
coalesce(r.repo_group, ''),
coalesce(r.alias, ''),
... |
-- phpMyAdmin SQL Dump
-- version 4.9.7
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Tempo de geração: 31-Out-2021 às 20:07
-- Versão do servidor: 8.0.26
-- versão do PHP: 7.3.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE DATABASE IF NOT EXISTS `pedromazine` /*!40100 DEFAULT CHARACTER SET latin1 */;
USE `pedromazine`;
-- MySQL dump 10.13 Distrib 5.6.17, for Win64 (x86_64)
--
-- Host: mysql.pedromazine.com.br Database: pedromazine
-- ------------------------------------------------------
-- Server version 5.5.43-log
/*!40101... |
select key,
avg(value::float),
max(value::float),
min(value::float)
from results r, surveys s
where s.master_id = %{master_id}
and r.survey_id = s.id
and s.valid_survey = true
and s.complete = true
group by key
|
-- INSERT INTO barangays VALUES ('1', '012801001', 'Adams (Pob.)', '01', '0128', '012801',now(),now());
-- id, users_id, seasons_id, planned_hec, actual_hec, plannumfar, actnumfar, plqty, actqty,season_list_statuses_id
-- season 1 dry
INSERT INTO `season_lists` VALUES(1,'10','1','4.0','3.5','13','12','100','100','2',... |
-- Do not perform any anonymisation steps
SELECT NOW();
|
show databases;
create database springsecuritydb;
CREATE TABLE IF NOT EXISTS `springsecuritydb`.`user` (
`id` INT NOT NULL AUTO_INCREMENT,
`active` TINYINT NULL,
`password` VARCHAR(45) NULL,
`roles` VARCHAR(45) NULL,
`user_name` VARCHAR(45) NULL,
PRIMARY KEY (`id`))
ENGINE = InnoDB
insert into (id,active... |
use SalesDb
select * from customers;
select city,state, sum(sales) 'sum' from customers
group by City, state
having city in ('Cincinnati' , 'Columbus');
select city, sum(sales) from Customers
group by city
having sum(sales) > 600000
select Name 'customer' from customers
where sales < 10000
select Name, Sales, (City ... |
/*
619. Biggest Single Number
https://www.leetfree.com/problems/biggest-single-number.html
Table number contains many numbers in column num including duplicated ones.
Can you write a SQL query to find the biggest number, which only appears once.
+---+
|num|
+---+
| 8 |
| 8 |
| 3 |
| 3 |
| 1 |
| 4 |
| 5 |
| 6 |
For th... |
-- MySQL DB
--
CREATE DATABASE IF NOT EXISTS cmdb DEFAULT CHARSET utf8 COLLATE utf8_general_ci;
USE cmdb;
CREATE TABLE users (
userid int unsigned NOT NULL AUTO_INCREMENT,
name varchar(255) NOT NULL,
age int unsigned DEFAULT NULL,
class varchar(255) DEFAULT NULL,
phone varchar(16) DEFAULT NULL,
address var... |
EXEC ('ALTER TABLE DB_PROFILE_DATA2.dbo.TB_CARGO NOCHECK CONSTRAINT ALL');
EXEC ('ALTER TABLE DB_PROFILE_DATA2.dbo.TB_FUNCIONARIO NOCHECK CONSTRAINT ALL');
--EXEC ('ALTER TABLE DB_PROFILE_DATA2.dbo.TB_PROCESSO NOCHECK CONSTRAINT ALL');
EXEC ('ALTER TABLE DB_PROFILE_DATA2.dbo.TB_CARGO DISABLE TRIGGER ALL');
EXEC ('DELET... |
DROP TABLE IF EXISTS `eportfolio`.`users`;
CREATE TABLE `eportfolio`.`users`
(
`MatNr` INT NOT NULL ,
`name` VARCHAR(255) NOT NULL ,
`email` VARCHAR(255) NOT NULL ,
PRIMARY KEY (`MatNr`)
) ENGINE = InnoDB;
INSERT INTO USERS (MatNr, name, email) VALUES ('55984957', 'XVCAOCXF URBMFD', 'URBMFD.XVCAOCXF@dhbw-karls... |
use msg_training;
insert into users values (1, 0, 'marius_pop@msggroup.com', 'Marius', 'Pop', '+40746532213', '9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08', 'popm', false);
insert into users values (2, 0, 'ioana_dumitrescu@msggroup.com', 'Ioana', 'Dumitrescu', '+40746532325', '9f86d081884c7d659a2... |
/*
37)DECODE 또는 CASE WHEN THEN 함수를 사용하여 다음 데이터에 따라 JOB열의 값을 기준으로
모든 사원의 등급을 표시하시오.
업무 등급
PRESIDENT A
ANALYST B
MANAGER C
SALESMAN D
CLERK E
기타 0
*/
SELECT ENAME, JOB,
CASE JOB
WHEN 'PRESIDENT' THEN 'A'
WHEN 'ANALYST' THEN 'B'
WHEN 'MANAGER' THEN 'C'
... |
DROP TABLE IF EXISTS PURCHASE_GIFT_CARD;
CREATE TABLE PURCHASE_GIFT_CARD
(
GCARD_ID VARCHAR(4),
CUST_ID INT,
PRICE DECIMAL(5,2),
TRANS_ID INT
);
ALTER TABLE PURCHASE_GIFT_CARD ADD CONSTRAINT PK_BUY_GCARD PRIMARY KEY(GCARD_ID);
ALTER TABLE PURCHASE_GIFT_CARD ADD CONSTRAINT FK_PAY_GCARD FOREIGN KEY(TRANS_ID) REFERENCES T... |
drop table results;
create table results
( userno varchar(25),
topicname varchar(20),
score int,
scoreoutof int,
percentage int,
timetaken number(7,2)
); |
CREATE OR REPLACE VIEW vRecesso AS
SELECT c.data_de_submissao, r.abrangencia, r.descricao, r.inicio, r.fim
FROM Calendario AS c, Recesso AS r;
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 24, 2020 at 11:52 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- phpMyAdmin SQL Dump
-- version 4.8.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 06, 2018 at 01:24 PM
-- Server version: 10.1.32-MariaDB
-- PHP Version: 7.2.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
--JOINS
--INNER JOIN
SELECT * FROM nome_tabela_1
INNER JOIN nome_tabela_2
ON nome_tabela_1_ID = nome_tabela_2_ID
--INNER JOIN COM ALIAS
SELECT e.first_name employee, m.first_name manager
FROM employee e
INNER JOIN employee m
ON m.employee_id = e.manager_id
ORDER BY manager;
--RIGHT JOIN
SELECT * FROM nome_tabel... |
INSERT INTO xh_userfile.user_file_product(
userid,
username,
schoolid,
schoolname,
gradename,
scorestatus,
scorechn,
rankchn,
scoremath,
rankmath,
scoreeng,
rankeng,
scoresci,
ranksci,
avgstatus,
topstatus,
topnumber,
finalstatus,
datetime)
select
stable1.userid,
stable1.username,
stable1.schoolid,
stable1.schoolname,
... |
Create Procedure mERP_sp_CategoryHandlerList
As
Select SNo, ParentID, CategoryID, Category_Name, [Level]
From ItemCategories IC, CategoryLevelInfo CLI
Where IC.[Level] = CLI.LevelNo
And IC.Active = 1
Order by IC.[Level], IC.CategoryID, IC.ParentID
|
CREATE KEYSPACE IF NOT EXISTS crossover WITH replication = {'class': 'SimpleStrategy', 'replication_factor': '2'} AND durable_writes = true;
CREATE TABLE IF NOT EXISTS crossover.cr_user (
id uuid,
name text,
email text,
created_ts timestamp,
updated_ts timestamp,
PRIMARY KEY(id, email)
... |
select count(*) as total_connections, count(case when statement_id is not null then 1 else null end ) as active_connections, count(case when statement_id is null then 1 else null end ) as idle_connections,
client_pid, substring(client_hostname,1,instr(client_hostname,':',-1,1)-1) as host_ip, user_name as user_schema
... |
-- 创建表
create table test_collate1(
`char` char(1)
)charset utf8 collate utf8_general_ci;
-- 不区分大小写
insert into test_collate1 values('a'),('B'),('c'),('D');
-- 升序:a ,B , c ,D
create table test_collate2(
`char` char(1)
)charset utf8 collate utf8_bin;
-- 二进制比较(区分大小写)
insert into test_collate2 values('a'),('B'... |
-- MySQL dump 10.13 Distrib 5.7.25, for Linux (x86_64)
--
-- Host: localhost Database: article
-- ------------------------------------------------------
-- Server version 5.7.25-0ubuntu0.18.04.2
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... |
/*
Name: MG Views From Widgets detailing target (stack)
Data source: 4
Created By: Admin
Last Update At: 2015-10-09T17:09:12.241292+00:00
*/
select
date,
page,
count(*) as Amount,
from(
SELECT
date,
mod as widget,
CASE
WHEN page_url contains '/developments/' THEN 'developments'
WHEN page_url c... |
CREATE TABLE IF NOT EXISTS categories (
id SERIAL PRIMARY KEY,
name VARCHAR(255) NOT NULL,
src INTEGER UNIQUE NOT NULL
);
INSERT INTO categories(name, src) VALUES('所有', 0), ('有颜值', 4), ('美腿控', 3), ('黑丝袜', 7), ('小翘臀', 6), ('大胸妹', 2), ('大杂烩', 5) ON CONFLICT (src) DO NOTHING;
CREATE TABLE IF NOT EXISTS cells (... |
-- 13.07.2009 10:10:01 EEST
-- Adding new column in PP_Cost_Collector
UPDATE AD_Column SET IsMandatory='N',Updated=TO_TIMESTAMP('2009-07-13 10:10:00','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=53721
;
-- 13.07.2009 10:10:37 EEST
-- Adding new column in PP_Cost_Collector
insert into t_alter_column v... |
CREATE TABLE region (
id SERIAL NOT NULL PRIMARY KEY,
grid_spacing NUMERIC NOT NULL,
max_latitude NUMERIC NOT NULL,
max_longitude NUMERIC NOT NULL,
min_latitude NUMERIC NOT NULL,
min_longitude NUMERIC NOT NULL,
name VARCHAR(255) NOT NULL
);
CREATE TABLE data (
id SERIAL,
region_id INTEGER NOT NULL R... |
-- pm_history
--
-- PM_histor is where we store the historical results from a single data
-- gathering run for a TID/Interface combination. We keep only the
-- historical records here. All active records are in pm_info.
CREATE TABLE pm_history (
timeentered DATE NOT NULL, -- Timestamp for when this PM inform... |
ALTER TABLE item ADD COLUMN len2 integer;
|
--
-- hospitals table
--
DROP TABLE hospitals;
CREATE EXTERNAL TABLE hospitals (
provider_id INT,
hospital_name STRING,
address STRING,
city STRING,
state STRING,
zip_code STRING,
county_name STRING,
phone_number STRING,
hospital_type STRING,
hospital_ownership STRING,
emergency_services STRING )
ROW FORMA... |
alter table behandling drop column resultat;
CREATE TABLE BEHANDLING_RESULTAT
(
ID BIGINT PRIMARY KEY,
FK_BEHANDLING_ID BIGINT REFERENCES behandling (id) NOT NULL,
AKTIV BOOLEAN DEFAULT TRUE NOT NULL,
VERSJON ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.