text stringlengths 6 9.38M |
|---|
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 17, 2019 at 05:04 PM
-- Server version: 5.7.19
-- PHP Version: 7.2.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
INSERT INTO commodity (name, season_price, non_season_price, measure, description) VALUES
('Milk', 12, 22, 'liter', 'Very delicious milk'),
('Bread', 2, 3, 'piece', 'Fresh and healthy'),
('Sand', 1, 1, 'ton', 'Great heap of sand. Pikup only'),
('Rock', 1, 1, 'kg', 'A usual rock. Can be shattered'),
('Coat', ... |
-- --------------------------------------------------------
-- Servidor: 127.0.0.1
-- Versão do servidor: 10.1.26-MariaDB - mariadb.org binary distribution
-- OS do Servidor: Win32
-- HeidiSQL Versão: 9.4.0.5125
-- ------------------------------------------------... |
-- +migrate Up
CREATE TABLE "public"."tg_photo_sizes" (
id serial NOT NULL UNIQUE,
file_id character varying NOT NULL UNIQUE,
width integer NOT NULL,
height integer NOT NULL,
file_size integer,
file_location character varying,
file_suffix character varying,
file_retrieved_at timestamp without time zone,... |
-- phpMyAdmin SQL Dump
-- version 4.5.0.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 29, 2017 at 02:22 AM
-- Server version: 10.0.17-MariaDB
-- PHP Version: 5.5.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_... |
-- Jan 21, 2009 1:25:48 PM COT
-- Product Substitute and Related tabs broken
UPDATE AD_Tab SET AD_Column_ID=1782,Updated=TO_DATE('2009-01-21 13:25:48','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Tab_ID=181
;
UPDATE AD_Tab SET AD_Column_ID=10857,Updated=TO_DATE('2009-01-21 13:25:51','YYYY-MM-DD HH24:MI:SS'),Up... |
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) NOT NULL AUTO_INCREMENT UNIQUE,
`username` varchar(128) NOT NULL UNIQUE,
`password` varchar(128) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
CREATE TABLE IF NOT EXISTS `races` (
`id` int(11) NOT NULL AUTO_INCREMENT UNIQUE,
`name` varchar(128) NOT NULL UNIQUE,
... |
create or replace function max_diff(
a float,
b float,
c float,
d float
)
return float as
f_max float;
f_min float;
begin
IF a is not null and a != 0 THEN
IF f_min is null or f_min > a THEN
f_min := a;
END IF;
IF f_max is null or f_max < a THEN
f_max := a;
END IF;
END IF;
IF b is not null and ... |
--- drop view r_usebuttons cascade
create or replace view r_usebuttons as select
usebutton.id id,
usebutton.id usebutton_id,
screen_ub.pobject_code_scr pobject_code_scr_ub ,
screen_ub.pobject_code_sgrp pobject_code_sgrp_ub ,
screen_ub.pobject_contents_sgrp pobject_contents_sgrp_ub ,
screen_ub.pobject... |
insert into FOODTOBRAND (FOOD_ID, BRAND_ID) values (10, 20);
insert into FOODTOBRAND (FOOD_ID, BRAND_ID) values (2, 14);
insert into FOODTOBRAND (FOOD_ID, BRAND_ID) values (9, 3);
insert into FOODTOBRAND (FOOD_ID, BRAND_ID) values (10, 7);
insert into FOODTOBRAND (FOOD_ID, BRAND_ID) values (10, 12);
insert into FOODTOB... |
INSERT INTO Customers (
cust_id,
cust_name,
cust_address,
cust_city,
cust_state,
cust_zip,
cust_country,
cust_email
)
VALUES (
1000009,
'Eric Ricketts',
'13773 Charismatic Way',
'Gainesville',
'VA',
'20155',
'USA',
'eric_ricketts@icloud.com'
); |
insert into shelf(userid, bookid)
values($1, $2) |
DO $$
DECLARE
-- Parameters
transaction_classification BIGINT = 2;
book_code bigint = 1;
branch_code text = '';
trdate date = '2018-11-16';
-- Currency field
currency record;
-- Query Builders
query text = '';
main_select text = 'SELECT tbl1.*, tbl2.otherCurrenciesInUSD ';
mai... |
Create Clustered Index IX_tblEmployee_Gender_Salary
ON tblEmployee(Gender DESC, Salary ASC) |
CREATE VIEW [display].[cmdb_rel_ci_v]
AS
SELECT
--TOP (100)
--Dates/Users
[display].[cmdb_rel_ci].[sys_created_on_display_value] AS [sys created on display value_text],
TRY_CONVERT(DATETIME, [display].[cmdb_rel_ci].[sys_created_on_display_value]) AS [sys created on display value],
--IDs
[display].[cmdb... |
INSERT INTO students VALUES (11, 'Jacek', 'Niezgoda');
INSERT INTO students VALUES (12, 'Micky', 'Mouse');
INSERT INTO students VALUES (13, 'Donald', 'Duck');
INSERT INTO students VALUES (14, 'Harry', 'Potter');
INSERT INTO students VALUES (15, 'Harmony', 'Granger');
INSERT INTO students VALUES (16, 'Ronald', 'Wesley')... |
SELECT name, @rank := @rank + 1 AS rank
FROM votes v, (SELECT @rank := 0) r
ORDER BY votes; |
DROP TABLE IF EXISTS countries;
CREATE TABLE countries (
country_code varchar(3) PRIMARY KEY,
[name] varchar(50) NOT NULL,
); |
DROP TABLE IF EXISTS `stat_log`;
CREATE TABLE IF NOT EXISTS `stat_log` (
`id` bigint unsigned NOT NULL auto_increment,
`id_session` varchar(32),
`id_user` integer unsigned,
`ip` integer unsigned,
`proxy` integer unsigned,
`ref_domain` varchar(50),
`ref_page` varchar(255),
`ref_pagequery` varchar(255),
`ref_c... |
SELECT FirstName, LastName FROM Employees
WHERE FirstName LIKE 'SA%' |
SELECT DISTINCT bank_name AS "BankName", city AS "City"
FROM accomplices
WHERE robbery_date = (SELECT MIN(robbery_date)
FROM accomplices);
|
INSERT INTO departamento(id_departamento,nombre_departamento) VALUES (001,'Quindio');
INSERT INTO departamento(id_departamento,nombre_departamento) VALUES (002,'Risaralda');
INSERT INTO departamento(id_departamento,nombre_departamento) VALUES (003,'Valle del Cauca');
INSERT INTO departamento(id_departamento,nombre_depa... |
.mode csv
.bail on
.echo on
-- drop/create new tables
.open ./data/processed/DATABASE_NAME.sqlite
.read ./src/dba/vanilla/schema.sql
-- import the data
.changes on
.import ./data/raw/DATAFILE_NAME.csv TABLE_NAME
-- index the data
.read ./src/dba/vanilla/indexes.sql
-- remove the repeated headers
DELETE FROM TABLE_... |
CREATE TABLE aktivitetBilde
(
bildeId INT NOT NULL AUTO_INCREMENT,
bildeNavn varchar (50),
bilde longblob NOT NULL,
PRIMARY KEY (bildeId)
)
ENGINE=InnoDB;
CREATE TABLE aktivitetFarge
(
fargeId INT NOT NULL AUTO_INCREMENT,
fargeNavn varchar (20),
PRIMARY KEY (fargeId)
)
ENGINE=InnoDB;
CREATE TABLE handlingskjede
(
... |
ALTER TABLE `#__md_member` ADD `district_newsletters` INT NOT NULL DEFAULT '0' AFTER `newsletters`;
|
INSERT INTO dc_ui.channel_config (category_mapping_id, channel_id, permitted)
SELECT category_mapping_id, $1, '' FROM dc_ui.category_mapping;
|
-- avg age:
DROP VIEW IF EXISTS avg_age CASCADE;
CREATE VIEW avg_age AS
SELECT round(AVG(age), 5) FROM students;
-- percent male:
DROP VIEW IF EXISTS percent_male CASCADE;
CREATE VIEW percent_male AS
SELECT cast((SELECT count(*) FROM students WHERE gender='m') as float) / (SELECT count(*) FROM students) as percent_ma... |
select * from example
where name like 'A%'
|
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 28, 2020 at 04:31 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.4.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- create tables
CREATE TABLE customers (id INT PRIMARY KEY NOT NULL, name VARCHAR(50), phone VARCHAR(50) UNIQUE);
CREATE TABLE orders (id INT PRIMARY KEY NOT NULL, customer_id INT, order_date DATE, total_price DECIMAL);
CREATE TABLE order_details (order_id INT, item_id INT, quantity INT);
-- insert dummy values
INSER... |
alter table shops add nid int;
-- provest import
alter table photos add nid int;
update photos p set p.nid = (select s.nid from shops s where s.id = p.id);
update photos set shop = nid;
alter table photos drop column nid;
alter table shops drop column id;
alter table shops add column id int;
update shops set id = nid... |
/* Submit a review to the database. */
try{
$tsql = "INSERT INTO Production.ProductReview (ProductID, ReviewerName, ReviewDate, EmailAddress, Rating, Comments)VALUES(?,?,?,?,?,?)";
$params = array(&$_POST['productid'], $_POST['name'], date("Y-m-d"), $_POST['email'], $_POST['rating'], $_POST['comments']);
$in... |
/*
客户报价
*/
/*将结束符;改成$*/
delimiter $
drop trigger if exists Tgr_Quotations_AftereDelete $
create trigger Tgr_Quotations_AftereDelete after delete
on Quotations
for each row
begin
call Proc_Customers_LastQuotation(old.CustomerNo);-- 客户资料-最近报价
end$
/*恢复结束符为;*/
delimiter ; |
create table fucai_append_00.t_lottery_append_task_detail_00
(
detailId bigint not null auto_increment comment '追号详情ID',
appendTaskId varchar(128) not null comment '追号任务ID',
partnerId varchar(64) not null comment '渠道I... |
drop table if exists imgs;
create table imgs(
id integer primary key autoincrement,
path string not null unique
);
drop index if exists index_imgs_path;
create index index_imgs_path on imgs ( path );
drop table if exists renditions;
create table renditions(
img_id integer,
name string,
crop_x i... |
INSERT INTO product_images (product_id, url)
values (${product_id}, ${url}) RETURNING *; |
/*
Navicat MySQL Data Transfer
Source Server : H51812
Source Server Version : 50612
Source Host : localhost:3306
Source Database : h51812
Target Server Type : MYSQL
Target Server Version : 50612
File Encoding : 65001
Date: 2019-03-27 22:24:41
*/
SET FOREIGN_KEY_CHECKS=0;
-- -----... |
create or replace view v1_zbtzszjb as
(
select jsde102 zblymxid,jsde111 tzsmxid ,de181 je From zb008 where jsde117 = 'ZB003');
|
insert into perposts
(likes,dates,pimage,user_id,book_id)
values
($1,$2,$3,$4,$5);
select * from perusers where id = $4 |
select
EMPID
,EMPNAME
,WHID
,LASTLOGONDTM
,COMPANY_ID
from (
select EMP.EMPID,EMP.EMPNAME,EMPWH.WHID, EMP.LASTLOGONDTM, EMP.COMPANY_ID
from EMP
,EMPWH
where (EMP.MAPPED_EMPID = :MAPPED_EMPID or (NOT EXISTS(SELECT EMPID FROM EMP WHERE MAPPED_... |
# add a study_id column in the tables structural_variation and variation_annotation
ALTER TABLE structural_variation ADD COLUMN study_id int(10);
ALTER TABLE structural_variation ADD INDEX study_idx (study_id);
ALTER TABLE variation_annotation ADD COLUMN study_id int(10);
ALTER TABLE variation_annotation ADD INDEX st... |
/*
Crie um banco de dados com o nome de “db_diversos”;
Dentro desse banco de dados devem conter as seguintes tabelas e os seguintes SELECT’s:
1. Uma tabela que represente uma escola, contendo:
• ID do aluno;
• Idade do aluno;
• + 3 informações que você considera importante;
*Importante a tabela precisa ter 15 dados d... |
with dtfrom as (
select '{{to}}'::timestamp - '1 year'::interval as dtfrom
), issues as (
select sub.issue_id,
sub.event_id,
sub.repo_name,
sub.repo_id
from (
select distinct
id as issue_id,
dup_repo_name as repo_name,
dup_repo_id as repo_id,
last_value(event_id) over issue... |
INSERT INTO WINDMILL_DETAILS (id, uid, name, address, latitude, longitude) VALUES
(1,'WINDMILL00000001', 'WINDMILL01', 'Chennai', '14.45666','12.342'),
(2,'WINDMILL00000002', 'WINDMILL02', 'Coimbatore','34.3434','34.454555'),
(3,'WINDMILL00000003', 'WINDMILL03', 'Madurai','23.34555','33.24324');
INSERT IN... |
UPDATE counties
SET "FIP" = lpad(trim("FIP"),5,'0'),
"COMP" = substring("COMP" from '\d+'),
"APNPercent" = substring("APNPercent" from '\d+'),
"SITPercent" = substring("SITPercent" from '\d+'),
"OWNPercent" = substring("OWNPercent" from '\d+'),
"USEPercent" = substring("USEPercent" from '\d+'),
"VALPercent" = substr... |
CREATE TABLE users (
id SERIAL UNIQUE NOT NULL PRIMARY KEY,
username varchar(255) NOT NULL,
email varchar(255) NOT NULL,
pass varchar(255) NOT NULL
);
CREATE TABLE cats (
id SERIAL UNIQUE NOT NULL PRIMARY KEY,
cat_name varchar(255) NOT NULL,
fav_food varchar(255),
fav_pastime varchar(255),
a... |
CREATE DATABASE project
use project
CREATE TABLE Partners (
id_partner int IDENTITY (1, 1) PRIMARY KEY,
name_partner nvarchar(50),
email varchar (100) NOT NULL ,
password_partner nvarchar (100) NOT NULL,
City nvarchar (50),
phone_partner varchar (25),
);
CREATE TABLE Drivers(
id_driver int ... |
create Procedure sp_list_PO_DocLU (@DocIDFrom int, @DocIDTo int)
as
Select Vendors.Vendor_Name, POAbstract.PONumber,
POAbstract.PODate, POAbstract.RequiredDate, status, POAbstract.DocumentID, POAbstract.Value from
POAbstract,Vendors
where Vendors.VendorID=POAbstract.VendorID
and (POAbstract.DocumentID between @Doc... |
create table if not exists hots (
id integer primary key,
title text not null,
description text,
logdate datetime default (datetime('now', 'localtime'))
);
create table if not exists events (
id integer primary key,
title text not null,
status text default '',
content text default '',
logdate datetime default... |
CREATE DATABASE IF NOT EXISTS `bcbs`;
use bcbs;
DROP TABLE IF EXISTS users;
CREATE TABLE users(
id` int(11) NOT NULL AUTO_INCREMENT,
first_name varchar(20) NOT NULL,
last_name varchar(50) NOT NULL,
initials varchar(50) NOT NULL UNIQUE,
password varchar(20) NOT NULL,
balance double,
PRIMARY KEY (id)) AUTO_INCREMENT = ... |
--
-- File : first_relation.sql
-- Auther: Jony Vesterman Cohen
-- Date : 27/06/2013
--
-- Desc : this script updates the r1 column with entity ids of same row number belonging to the next entity type.
--
-- select entity_id,entity_type_id, row_number(),d.entity_id,d.entity_type_id over (PARTITION BY entity_ty... |
drop schema if exists jobfinder;
create schema jobfinder;
use jobfinder;
drop table if exists credential;
drop table if exists hibernate_sequence;
drop table if exists job;
drop table if exists jobapplication;
drop table if exists jobcategory;
drop table if exists recruiter;
drop table if exists userprofile;
create t... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 26 Jul 2020 pada 22.20
-- Versi server: 10.4.11-MariaDB
-- Versi PHP: 7.2.30
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@C... |
with data as (
select GamerTag, GameTimestamp, GameName, Score, insertedTimestamp
from Participation p
join players pl on p.PlayerID = pl.PlayerID
join games g on g.GameUUID = p.GameUUID
)
select * from data
order by GameTimestamp desc |
create database db_generation_game_online;
use db_generation_game_online;
create table tb_classe(
id bigint(5) auto_increment primary key,
Poder_Principal varchar(255) not null,
Poder_Ataque varchar(255) not null,
Poder_Defesa varchar(255) not null
);
insert into tb_classe (Poder_principal, poder_ataque, poder_defes... |
CREATE TABLE `typecho_wx_share` (
`wx_id` int(10) unsigned NOT NULL auto_increment COMMENT 'wx_share表主键',
`cid` int(10) unsigned default 0 COMMENT '页面的id',
`wx_title` varchar(200) default NULL COMMENT '微信分享标题',
`wx_url` varchar(200) default NULL COMMENT '微信分享链接',
`wx_image` varchar(200) default NULL COMM... |
-- table 'orders', similar to another
create table orders
(
orderNumber int(11) not null,
orderDate datetime not null,
requiredDate datetime not null,
shippedDate datetime not null,
status varchar(15) not null,
comments text not null,
customerN... |
CREATE PROCEDURE sp_update_Catalog_fmcg(@ITEMCODE NVARCHAR(15),
@DESC NVARCHAR(255), @PRICE Decimal(18,6), @UOM INT)
AS
UPDATE Items SET Description = @DESC, Purchase_Price = @PRICE,
UOM = @UOM WHERE Product_Code = @ITEMCODE
|
create table timecheck
(num number(1));
select * from timecheck;
select explain from menu;
update menu set explain = '<html><body>부드러운 등심에<br><br>숙주볶음과 소스를 곁들인<br><br>등심스테이크의 최고봉</body></html>' where menunum = 14;
drop table timecheck;
delete from people;
select * from sales; |
prompt PL/SQL Developer import file
prompt Created on 2011年6月29日 by Administrator
set feedback off
set define off
prompt Loading SYS_AUTHORITY...
insert into SYS_AUTHORITY (ID, AUTHNAME, DESCRIPTION)
values (1, 'AUTH_LOGIN', '登录系统');
insert into SYS_AUTHORITY (ID, AUTHNAME, DESCRIPTION)
values (2, 'AUTH_SYS_MANAGE', '系... |
SELECT * FROM `Produit` WHERE 1
SELECT * FROM `Produit` WHERE `nom` LIKE "%T-shirt%"
SELECT * FROM `Produit` WHERE `prix`= 19.99
SELECT * FROM `Produit` WHERE `quantité`='5' |
-- phpMyAdmin SQL Dump
-- version 3.2.0.1
-- http://www.phpmyadmin.net
--
-- Servidor: localhost
-- Tempo de Geração: Jan 09, 2011 as 11:14 PM
-- Versão do Servidor: 5.1.36
-- Versão do PHP: 5.3.0
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
--
-- Banco de Dados: `db_atasistema`
--
-- --------------------------------------... |
-- GENERATE WAHLZETTEL
-- hilfstabelle
with placeholder1(nummer) AS (
SELECT * from generate_series(1, (select max(anzahl) from erststimmenergebnisse))
)
-- erzeuge einzelstimmen für alle erststimmen
INSERT INTO erststimmen(kandidaten_id, wahlkreis_id)
SELECT e.kandidaten_id , e.wahlkreis_id
FROM erstst... |
-- name: insert-fx_rate
insert into fx_rates values ($1, $2, $3)
on conflict (code_cbr, date_time)
do update set value = $3
where fx_rates.code_cbr = $1
and fx_rates.date_time = $2;
-- name: select-last-date
select max(date_time)
from fx_rates
where code_cbr = $1;
-- name: select-currencies
select code_cb... |
-- total screened
SELECT COUNT(*)
FROM `biorxiv`
WHERE parse_status != 0;
-- detections
SELECT COUNT(*)
FROM `biorxiv`
WHERE parse_status > 0;
-- emails sent
SELECT COUNT(*)
FROM `biorxiv`
WHERE email_sent IS NOT NULL;
-- in the last 1 month
-- total screened
SELECT COUNT(*)
... |
INSERT INTO EmployeeSkills (EmployeeNumber, SkillId) VALUES (405,'14');
INSERT INTO EmployeeSkills (EmployeeNumber, SkillId) VALUES (484,'1');
INSERT INTO EmployeeSkills (EmployeeNumber, SkillId) VALUES (190,'10');
INSERT INTO EmployeeSkills (EmployeeNumber, SkillId) VALUES (556,'3');
INSERT INTO EmployeeSkills (Employ... |
CREATE Procedure sp_update_Disclaimer
(@TRANID NVARCHAR (50),
@DISCLAIMERTEXT NVARCHAR (4000))
AS
Update Disclaimer Set DisclaimerText = @DISCLAIMERTEXT where TranID=@TRANID
|
\ir 'tables.sql'
\ir 'Exemplos.sql'
|
-- find tickets with large number of comments
-- https://jira.atlassian.com/browse/JRASERVER-66251
SELECT concat(p.pkey,'-',i.issuenum) as issue, count(i.id)
FROM jiraaction a, jiraissue i, project p
WHERE i.project = p.id and i.id = a.issueid
GROUP BY p.pkey,i.issuenum
HAVING count(i.id) > 100
ORDER BY count (i.id) D... |
create table student(
id varchar(5) not null,
name varchar(10) default null,
age int default null,
sex varchar(10) default null,
primary key(id)
);
create table subject(
id varchar(5) not null,
subject varchar(20) default null,
teacher varchar(20) default null,
description varchar(255) def... |
delete from PERSON_ID where PERSON_ID = 0;
insert into PERSON_ID (PERSON_ID) values (0); |
-- pqr raid calendar database setup
-- author: P E Sartain
-- date: 20/10/2008
-- Changelog:
-- 20081104 security logs & raid access token information
-- 20081020 created
-- ######################
-- # Character tables #
-- ######################
-- Role list
DROP TABLE IF EXISTS pqr_roles;
CREATE TABLE pqr_roles ... |
-- phpMyAdmin SQL Dump
-- version 5.0.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Dec 23, 2021 at 06:03 AM
-- Server version: 10.4.17-MariaDB
-- PHP Version: 7.4.13
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
DROP DATABASE IF EXISTS reminders_db;
CREATE DATABASE reminders_db;
|
BEGIN TRANSACTION;
DROP TABLE IF EXISTS users cascade;
drop table if exists address cascade;
drop table if exists course cascade;
drop table if exists league cascade;
drop table if exists round cascade;
drop table if exists user_round cascade;
drop table if exists user_league cascade;
DROP SEQUENCE IF EXISTS seq_user... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 12-07-2017 a las 23:58:11
-- Versión del servidor: 10.1.24-MariaDB
-- Versión de PHP: 7.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
... |
INSERT INTO grupo (codigo, nome) VALUES (1, 'Administrador');
INSERT INTO grupo (codigo, nome) VALUES (2, 'Vendedor');
-- Hash = admin
-- $2a$10$g.wT4R0Wnfel1jc/k84OXuwZE02BlACSLfWy6TycGPvvEKvIm86SG
INSERT INTO usuario (nome, email, senha, ativo) VALUES ('Admin', 'admin@sinapipro.com', '$2a$10$g.wT4R0Wnfel1jc/k84OXu... |
-- full outer join : 아무 의미 없이 다 붙인것임
select *
from customer,orders;
-- 오라클 일반 inner join
select c.custid , c.name , O.* --ORDERS 테이블의 모든 컬럼 조회
from customer c , orders o
where C.custid = o.custid;
select *
from customer c, orders o
where c.custid = o.custid(+); -- (+) : null을 + 하겠다는 의미
-- select *
-- from custom... |
INSERT INTO _DATA_ENTITY VALUES (0);
INSERT INTO AUTHORITY
(`ID`,
`AUTHORITY`)
VALUES
(
(SELECT LAST_INSERT_ID()),
'ROLE_USER'
);
INSERT INTO _DATA_ENTITY VALUES (0);
INSERT INTO AUTHORITY
(`ID`,
`AUTHORITY`)
VALUES
(
(SELECT LAST_INSERT_ID()),
'ROLE_EDITOR'
);
ALTER TABLE USER DROP FOREIG... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Tempo de geração: 26/09/2019 às 19:32
-- Versão do servidor: 10.4.6-MariaDB
-- Versão do PHP: 7.1.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET ... |
-- wofh-tools
-- @since 09.11.2014 18:52
-- @package
-- @author DelphinPRO delphinpro@yandex.ru
-- @copyright Copyright (C) 2014 DelphinPRO. All rights reserved.
-- @license Licensed under the MIT license
SELECT
acc.accountId,
acc.accountName,
acc.accountSex,
acc.countryId,
acc.role,
a... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- 主机: localhost
-- 生成日期: 2018-11-15 14:11:58
-- 服务器版本: 10.1.36-MariaDB
-- PHP 版本: 7.0.32
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACT... |
use music;
create table albums (
-> code int PRIMARY KEY,
-> artist varchar(250),
-> title varchar(250),
-> price int
-> ); |
CREATE PROCEDURE sp_Get_RecItemProperty(@ItemID int, @PropertyName nvarchar(255))
AS
SELECT ItemPropReceived.PropertyValue
FROM ItemPropReceived
WHERE ItemPropReceived.ItemID = @ItemID And
ItemPropReceived.PropertyName = @PropertyName
|
SELECT SUM(SalesOrderHeader.SubTotal + SalesOrderHeader.TaxAmt + SalesOrderHeader.Freight) AS TotalOrderValue, CountyRegion FROM Address
JOIN SalesOrderHeader ON (Address.AddressID = SalesOrderHeader.ShipToAddressID)
JOIN SalesOrderDetail ON (SalesOrderHeader.SalesOrderID = SalesOrderDetail.SalesOrderID)
GROUP BY Co... |
insert into users(id,birthday,email,name,surname) select next_val, "1997-12-27", "lans20027@gmail.com", "Alex","Vydrin" from hibernate_sequence;
update hibernate_sequence set next_val = 2; |
create or replace view v1_hdxj003_xz as
select a.hdde147,a.hdde998,a.de084,a.jsde802,a.Jsde821,
sum(a.de181)+
nvl((select sum(c.de181) from hdxj001 b,hdxj002 c where b.hdde242 = c.hdde242 and b.de011 = a.de011 and c.hdde147 = a.hdde147),0) as pzje,
case when a.de190 <> 1 then 0
else sum(a.de181) +
nvl((select sum... |
CREATE TABLE `news` (
`id` SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
`auteur` VARCHAR(30) NOT NULL,
`titre` VARCHAR(100) NOT NULL,
`contenu` TEXT NOT NULL,
`date_ajout` DATETIME NOT NULL,
`date_modif` DATETIME NOT NULL
)
ENGINE = MyISAM DEFAULT CHARSET = utf8; |
create database 'mysite';
create database 'my_other_site';
create database 'another different site'; |
drop table if exists contratos;
create table contratos(
num_contrato int(6) primary key,
alquiler_mensual float(5) not null,
modo_pago varchar(30)not null,
deposito_realizado char(2)not null, -- si, no
duracion_contrato varchar(50)not null,
inicio_contrato datetime not null,
fin_contrato datetime not null,
num_cliente ... |
--구매시수량감소
update product set productqty = productqty-1 where productno = 1;
--상품리스트
select * from product;
--상품 삭제 추가
delete from product where productno=3;
--상품 이름 포함 % %로 구현.
select * from product where productname like '%오%';
--상품 가격으로 정렬 리스트
select * from product order by productprice desc;
select * from product o... |
/*
** Question: https://leetcode.com/problems/all-people-report-to-the-given-manager/
*/
-- method 1
SELECT
e.employee_id
FROM Employees e
LEFT OUTER JOIN Employees e1
ON e.manager_id = e1.employee_id
LEFT OUTER JOIN Employees e2
ON e1.manager_id = e2.employee_id
LEFT OUTER JOIN Employe... |
USE burgers_db;
INSERT INTO burgers (burger_name) VALUES ("Cheeseburger"), ("Veggie Burger"), ("Hamburger"), ("Impossible Burger"); |
PRAGMA foreign_keys=OFF;
CREATE TABLE new_restaurants (
id INTEGER PRIMARY KEY NOT NULL,
name TEXT UNIQUE NOT NULL COLLATE NOCASE
);
INSERT INTO new_restaurants SELECT * FROM restaurants;
DROP TABLE restaurants;
ALTER TABLE new_restaurants RENAME TO restaurants;
CREATE TABLE new_menu_items (
id INTEGER ... |
DROP TABLE IF EXISTS public.users;
CREATE TABLE public.users
(
created_at timestamp with time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
modified_at timestamp with time zone DEFAULT timezone('UTC'::text, now()) NOT NULL,
id serial NOT... |
create database if not exists TwitchPronounsBot;
use TwitchPronounsBot;
create table if not exists pronouns (user_id bigint not null primary key, pronouns varchar(255));
create table if not exists channels (channel bigint not null primary key); |
DROP table IF EXISTS gitrepo; |
DROP TABLE vendinhas;
CREATE TABLE vendinhas(
nome VARCHAR (100),
preco DECIMAL(6,2),
quantidade SMALLINT
);
INSERT INTO vendinhas VALUES
('Café', 4, 27.13),
('Leite', 35, 4.15),
('Açúcar', 52, 24.67),
('Biscoito', 3, 1.71),
('Miojo', 9, 45.23),
('Calabresa', 17, 1.72),
('Bancon', 18, 19.52),
(... |
-- Column: ua_device
-- ALTER TABLE ads DROP COLUMN ua_device;
ALTER TABLE ads ADD COLUMN ua_device character varying(32)[];
-- Column: ua_browser
-- ALTER TABLE ads DROP COLUMN ua_browser;
ALTER TABLE ads ADD COLUMN ua_browser character varying(32)[];
-- Column: ua_os
-- ALTER TABLE ads DROP COLUMN ua_os;
ALTE... |
select tag from tags
where value = $1;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.