text stringlengths 6 9.38M |
|---|
-- rbs_optimal.sql
-- set the OPTIMAL to the 2x the initial extent
-- size on RBS that do not have optimal already set
--
-- do not set SYSTEM RBS
-- only set ONLINE RBS
@showrbs
declare
cursor c_rbs
is
select d.segment_name
, d.initial_extent
from dba_rollback_segs d, v$rollstat v
where v.usn = d.segment_... |
--Provide a query that shows all the Tracks, but displays no IDs. The result should include the Album name, Media type and Genre.
SELECT a.Title AS "Album Title", mt.Name AS "Media Type", g.Name AS "Genre"
FROM Track t, Album a, MediaType mt, Genre g
WHERE t.AlbumId == a.AlbumId AND t.MediaTypeId == mt.MediaTypeId AN... |
-- MySQL dump 10.13 Distrib 8.0.18, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: arduino
-- ------------------------------------------------------
-- Server version 8.0.18
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!... |
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Хост: 127.0.0.1
-- Время создания: Июл 20 2016 г., 05:44
-- Версия сервера: 5.6.26
-- Версия PHP: 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!4... |
/**
*
* @author Alexey
* @name Calc_object
* @manual
*/
Select distinct t1.lc_flat_id, t.lc_id
From lc_flat t1
Inner Join grp_lc_group t on t.lc_id = t1.lc_flat_id
Where (:groupid = t.group_id or :groupid is null)
and (:lc_id = t1.lc_flat_id or :lc_id is null)
|
SELECT CRH.CO_ID,
CRH.USERNAME,
CRH.ENTRY_DATE,
CRH.DEALER_CODE_ENTRY,
RA.RS_SDES,
NBS.BUSINESS_STATUS
FROM CONTRACT_REASON_HISTORY CRH, REASONSTATUS_ALL RA, NK_BUSINESS_STATUS NBS
WHERE CRH.SEQNO IN (SELECT MAX (CRHI.SEQNO)
... |
-- MySQL dump 10.16 Distrib 10.1.33-MariaDB, for Linux (x86_64)
--
-- Host: localhost Database: library
-- ------------------------------------------------------
-- Server version 10.1.33-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_S... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Tempo de geração: 08-Nov-2020 às 18:57
-- Versão do servidor: 10.4.14-MariaDB
-- versão do PHP: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
update participant set address_id = null where address_id in (select id from address where street = 'PSEUDO');
delete from address where street = 'PSEUDO'; |
-- ts2e-hires.sql
-- Jared Still 2017-05-16
-- jkstill@gmail.com
-- needs work...
prompt Convert a timestamp to a lowres (seconds) epoch value
prompt
prompt Valid timezone values can be offsets or names
prompt Examples Time Zones: 'PST', '-7:00', 'US/Pacific', 'US/Eastern'
prompt
prompt Example: @ts2e-hires '19-D... |
create table proxy_mail (
proxy_address varchar(255) not null,
user_address varchar(255) not null,
creation_time timestamp not null,
lang varchar(255) not null,
expiration_time timestamp not null,
blocked boolean,
active... |
INSERT INTO `job` (`name`, `display_name`, `cron_expression`, `create_time`, `task_priority`, `scheduler_group`) VALUES ('Recalculate Interest For Loans', 'Recalculate Interest For Loans', '0 1 0 1/1 * ? *', now(), 4, 3);
UPDATE `job` SET `scheduler_group`=3 WHERE `name`='Update Non Performing Assets';
UPDATE `job` ... |
/*
Enter your query here.
*/
#https://www.hackerrank.com/challenges/binary-search-tree-1/problem
SELECT N,
case
when N in (SELECT P FROM BST) and P IS NOT NULL then "Inner"
when P IS NULL then "Root"
else "Leaf" end as node_type
FROM BST
ORDER BY N |
DROP TABLE ATIVIDADE;
CREATE TABLE ATIVIDADE
(codigo CHAR(30) NOT NULL,
descricao VARCHAR(32) NOT NULL,
inicio DATE ,
fim DATE ,
responsaveis VAR... |
insert into orden (informacion) values ('{"nombre":"Juan Rojas","telefono":"(123) 3444-5667","email":"juanrojas@test.com","libros":[{"titulo":"Creación de aviones","autor":"Alina Castaño"}]}');
insert into orden (informacion) values ('{"nombre":"Luis Vargas","telefono":"(123) 2345-7540","email":"luisvargas@test.com","l... |
Project Developed by Sanjeev sir's Student
any query regarding project
contact at me phptpoint@gmail.com
mobile: 9015501897 |
ALTER TABLE article DROP created_at;
ALTER TABLE article DROP updated_at;
|
alter table test add ddd int;
alter table test add index test(a);
alter table test drop index test;
alter table test add primary key(a, b);
alter table test drop primary key;
alter table test add constraint test primary key (a, b, c);
alter table test drop primary key test;
desc test; |
-- Запит 1: вивести топ 10 країн з максимальною відвідуваносю
select DESTINATION.DESTINATION,COUNT(*) as cnt
from PRODUCT_DETAILS
join DESTINATION on DESTINATION.DESTINATION=PRODUCT_DETAILS.DESTINATION_CODE
group by DESTINATION.DESTINATION
order by COUNT(*) desc
FETCH FIRST 10 ROWS ONLY;
-- Запит 2: вивести відсоток о... |
-- MySQL dump 10.13 Distrib 5.7.27, for Linux (x86_64)
--
-- Host: localhost Database: sayti.uz
-- ------------------------------------------------------
-- Server version 5.7.27
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*... |
CREATE DATABASE donationpage;
CREATE TABLE users(
id SERIAL PRIMARY KEY,
name VARCHAR(40),
email TEXT
);
INSERT INTO users (name, email) VALUES
('abel', 'abel@gmail.com'),
('jesus', 'jesus@gmail.com'); |
CREATE PROC sp_list_childcategories
AS
SELECT Category_Name, CategoryID FROM ItemCategories
WHERE CategoryID Not In (Select Distinct ParentID FROM ItemCategories WHERE ParentID <> 0)
AND Active = 1
|
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1
-- Час створення: Гру 17 2018 р., 00:47
-- Версія сервера: 10.1.31-MariaDB
-- Версія PHP: 7.2.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
CREATE TABLE house_median_prices(
county_id INT PRIMARY KEY,
county_name TEXT,
median_2015 varchar (30),
median_2016 varchar (30),
median_2017 varchar (30),
median_2018 varchar (30),
median_2019 varchar (30),
median_2020 varchar (30)
);
|
CREATE PROCEDURE sp_SalesHistory_Category
@FromDate Datetime,
@ToDate Datetime,
@FromSalesManID int,
@ToSalesManID int
AS
SELECT a.Category_Name as Company,b.Category_Name as Division,c.Category_Name as Sub_Category,
d.Category_Name as MarketSKU,Items.Product_Code,Items.Productname,sum(InvoiceDetail.Quantity... |
drop table if exists d_utilizador cascade
drop table if exists d_tempo cascade
drop table if exists d_local cascade
drop table if exists d_lingua cascade
create table d_utilizador(
id_utilizador serial not null,
email varchar(20) not null,
tipo varchar(20) not null,
primary key(id_utilizador)
);
create table d_te... |
CREATE PROCEDURE sp_list_Claims(@VENDORID NVARCHAR(15), @FROMDATE DATETIME,
@TODATE DATETIME)
AS
SELECT ClaimID, ClaimDate, ClaimsNote.VendorID, Vendors.Vendor_Name, DocumentID,
Case Balance When 0 Then Status | 128 Else Status End, Balance, ClaimValue
FROM ClaimsNote, Vendors
WHERE ClaimsNote.VendorID LIKE @... |
-- ---------------------------------------------------------------------
-- Creación de la base de datos
-- ---------------------------------------------------------------------
CREATE DATABASE BD_VETERINARIA_HUELLITAS;
-- ---------------------------------------------------------------------
-- Cambiar a la base de da... |
/*
Navicat MySQL Data Transfer
Source Server : suse_mysql
Source Server Version : 50714
Source Host : 4.1.15.49:3306
Source Database : penpen
Target Server Type : MYSQL
Target Server Version : 50714
File Encoding : 65001
Date: 2016-11-23 12:04:11
*/
SET FOREIGN_KEY_CHECKS=0;
-- -... |
--
-- Copyright 2010-2016 the original author or authors.
--
-- 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
--
-- Unles... |
prompt PL/SQL Developer import file
prompt Created on 2016年8月17日 by king
set feedback off
set define off
prompt Creating GAME_GUAN...
create table GAME_GUAN
(
NUM NUMBER not null,
BOSSA VARCHAR2(20) not null,
BOSSB VARCHAR2(20) not null,
BOSSC VARCHAR2(20) not null,
BOSS VARCHAR2(20) not null,
NANDU NUMB... |
INSERT INTO tb_client
(name, cpf, income, birth_Date, children)
VALUES
('James Butt', '92891869095', 995.42, TIMESTAMP WITH TIME ZONE '2000-07-13T00:00:00.00000Z', 1),
('Minna Amigon', '03675664007', 2540.25, TIMESTAMP WITH TIME ZONE '1995-02-20T00:00:00.00000Z', 2),
('Abel Maclead', '36871820027', 1250.60, TIME... |
DROP TABLE IF EXISTS METRICS_RECORD;
CREATE TABLE METRICS_RECORD
(
RECORD_ID VARCHAR(64) NOT NULL,
SERVICE_GROUP VARCHAR(64) NOT NULL,
DOMAIN VARCHAR(32) NOT NULL,
HOST_NAME VARCHAR(32) NOT NULL,
SERVICE VARCHAR(64) NOT NULL,
... |
CREATE DATABASE IF NOT EXISTS base;
use base;
CREATE TABLE IF NOT EXISTS members (
id INT(255) NOT NULL AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NULL,
surname VARCHAR(255) NULL,
country VARCHAR(255) NULL,
email VARCHAR(255) NULL,
password VARCHAR(255) NOT NULL,
online BOOLEAN
);
CRE... |
--if not exists (select Id from ExamUnits where Name = 'Beheer 1')
delete from ExamUnits
DBCC CHECKIDENT ('dbo.ExamUnits', RESEED, 0)
insert into ExamUnits
values ('Beheer 1'),
('Computer organisatie 1'),
('Databases 1'),
('Discrete Wiskunde'),
('Embedded Systems A'),
('Engels Inf'),
('Programmeren 1'),
... |
DROP TABLE IF EXISTS usuariosolucionatest;
DROP TABLE IF EXISTS usuariocreasimulacro;
DROP TABLE IF EXISTS permisomodulo;
DROP TABLE IF EXISTS usuarioperfil;
DROP TABLE IF EXISTS test;
DROP TABLE IF EXISTS respuesta;
DROP TABLE IF EXISTS pregunta;
DROP TABLE IF EXISTS simulacro;
DROP TABLE IF EXISTS asignatura;
DROP T... |
select
-- string_agg(sub3.sig, ',')
sub3.sig
from (
select sub2.sig,
count(distinct sub2.issue_id) as cnt
from (
select case sub.sig
when 'aws' then 'cloud-provider'
when 'azure' then 'cloud-provider'
when 'batchd' then 'cloud-provider'
when 'cloud-provider-aws' then 'clo... |
SELECT
to_char(li.created_at, 'YYYY-MM') AS month,
COUNT(*) AS list_item_count
FROM api_facilitylistitem li
WHERE status = 'ERROR_MATCHING'
AND to_char(created_at, 'YYYY-MM') < to_char(now(), 'YYYY-MM')
GROUP BY to_char(li.created_at, 'YYYY-MM')
ORDER BY to_char(li.created_at, 'YYYY-MM');
|
call Delete_Pessoa(1); /* Informe o Id Que voçê dejesa remover |
UPDATE AD_Column SET IsParent='Y', IsUpdateable='N',Updated=TO_DATE('2008-06-28 22:10:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=13468
;
|
/*
Navicat Premium Data Transfer
Source Server : localhost_3306
Source Server Type : MySQL
Source Server Version : 50626
Source Host : localhost:3306
Source Schema : good_management_system
Target Server Type : MySQL
Target Server Version : 50626
File Encoding : 65001
... |
-- AddForeignKey
ALTER TABLE "Enrollment" ADD FOREIGN KEY ("semesterId") REFERENCES "Semester"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
CREATE TABLE `users` (
`user_id` int(11) NOT NULL AUTO_INCREMENT,
`username` varchar(25) NOT NULL,
`password` varchar(50) NOT NULL,
`role_id` int(11) NOT NULL,
`user_description` varchar(100) DEFAULT NULL,
PRIMARY KEY (`user_id`),
UNIQUE KEY `Users_UN` (`username`),
KEY `Users_roles_FK` (`role_id`),
C... |
# Write your MySQL query statement below
select Name as Employee from Employee a where a.salary>(select b.salary from Employee b where b.Id=a.ManagerId) |
/**
*
* @author Alexey
* @name dsPaymentsInSession
* @writable opl_payments
* @public
*/
Select t1.opl_payments_id, t1.session_id, t1.flat_id, t1.payment_sum, t1.date_id
, t1.payment_date, t1.payment_comment, t1.bank_percent, t1.full_payment, t.lc_regto
, t.lc_flatnumber, t.registered_count, t.lc_num
From opl_pa... |
CREATE procedure sp_Check_RecSTO(@DocSerial as int)
As
If Exists(select StockTransferInAbstract.ReferenceSerial
from StockTransferInAbstract,StockTransferOutAbstractReceived
Where StockTransferInAbstract.ReferenceSerial = StockTransferOutAbstractReceived.OriginalID
and StockTransferInAbstract.DocSerial = @DocSerial)... |
drop table if exists entries;
create table entries (
id INTEGER primary key autoincrement,
hours INTEGER not null,
minutes INTEGER not null,
date DATE not null,
open BOOLEAN not null,
done BOOLEAN DEFAULT 0
);
drop table if exists settings;
create table settings (
id INTEGER primary key autoincrement,
... |
-- Схема
DROP TABLE IF EXISTS phone_numbers, users;
-- Поменял поля (сделал UNSIGNED, для пола - TINYINT)
CREATE TABLE `users`
(
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'поменял на UNSIGNED',
`name` VARCHAR(255) DEFAULT NULL,
`gender` TINYINT UNSIGNED NOT NULL COMMENT '0 -... |
select prodtype.prodid,count(prod_n),prod_type,stock from prodtype left join product
on prodtype.prodid=product.prodid
left join brand
on product.brandid = brand.brandid
left join vendors
on product.vendorid = vendors.vendorid
group by prodid
order by prodid
;
select * from prodtype,brand,product where product.pro... |
INSERT INTO fdviews (name, user, d_cr) VALUES (?, ?, NOW())
|
INSERT INTO `super_rent`.`item` VALUES (10, 10, 'MEMBERSHIP', 'Membership', 1000, 2);
INSERT INTO `super_rent`.`item` VALUES (11, 11, 'MEMBERSHIP', 'Membership', 1000, 1);
INSERT INTO `super_rent`.`item` VALUES (12, 12, 'MEMBERSHIP', 'Membership', 1000, 1);
INSERT INTO `super_rent`.`item` VALUES (13, 13, 'MEMBERSHIP... |
#Joseph Elikishvili Assignment4
DROP DATABASE IF EXISTS corp;
CREATE DATABASE corp;
use corp;
CREATE TABLE employees (
employeeID int,
ename varchar(30),
supervisorID int,
title varchar(30),
primary key(employeeID)
);
INSERT INTO employees (employeeID, ename, supervisorID, title) VALUES
(1,"Steve Jobs",NULL,"CEO"),
(... |
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `biblioteca` DEFAULT CHARACTER SET utf8 ;
USE `biblioteca` ;
-- -------------------------------------------... |
CREATE procedure sp_ser_modifytask(@TaskID nvarchar(50),@Active Int,@WarrantyDays int,@TaxCode Int)
as
Update TaskMaster
Set Active = @Active,
WarrantyDays = @WarrantyDays,
ServiceTax = @TaxCode,
LastModifiedDate = Getdate()
Where TaskID = @TaskID
|
INSERT INTO rating (id, user_id, movie_id, score) VALUES
(1, 1, 1, 5),
(2, 1, 2, 3),
(3, 2, 2, 4),
(4, 2, 3, 2); |
create materialized view log on emp with primary key ;
--drop materialized view log on emp;
create materialized view mv_emp
nologging
cache
build immediate
refresh on demand--fast on commit
as
select *
from emp
where
deptno=30;
select *
from MLOG$_EMP;
|
ALTER TABLE article MODIFY eye_catch_url TEXT; |
-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Sep 13, 2016 at 10:38 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
/**
*
* @procedure
* @author Alexey
* @name counters_values_in_flats
* @writable per_counter_values
*/
Select t2.counter_id, t.per_counter_values_id, t.counter_id
, t.date_id, t.end_val, t.beg_val
, t1.lc_id, t1.services_id
From per_counter_values t
Inner Join cnt_con2flats t2 on t2.counter_id = t.counter_id
... |
-- phpMyAdmin SQL Dump
-- version 4.4.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Feb 07, 2016 at 08:46 PM
-- Server version: 5.6.25
-- PHP Version: 5.6.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
/**
*
* @author Alexey
* @name group_counter_beg_values_4calc
* @manual
*/
Select t3.beg_val AS fm_value, 'BEG_' || t1.cnt_type AS fm_name, t2.group_id
, t2.services_id, t2.grp_services_id
From grp_services t2
Inner Join grp_service_counters t4 on t2.grp_services_id = t4.grp_service_id
inner join cnt_con2flat... |
SELECT * FROM youtube_videos;
|
-- TODO: use innodb/myisam?
create database if not exists bitbot;
use bitbot;
create table orderbooks (
exchanger varchar(50) not null,
pair varchar(10) not null,
ts timestamp(3) not null,
bids json,
asks json,
primary key (exchanger, pair, ts)
);
create table arbitrages (
buy_ex varchar(2... |
CREATE TABLE IF NOT EXISTS ` USER `
(
id BIGINT
(
20
) NOT NULL AUTO_INCREMENT,
name VARCHAR
(
30
) NULL DEFAULT NULL,
age INT
(
11
) NULL DEFAULT NULL,
PRIMARY KEY
(
id
)
);
CREATE TABLE IF NOT EXISTS ` T_ORDER0 `
(
order_id BIGINT
(
20
) NOT NULL AUTO_INCREMENT,
name ... |
-- 创建数据库
-- CREATE DATABASE seckill DEFAULT CHARACTER SET utf8;
DROP TABLE IF EXISTS `secshopping`;
DROP TABLE IF EXISTS `secshopping_order`;
-- 创建秒杀商品表
create table sec_shopping
(
`secshopping_id` bigint not null auto_increment comment '商品id',
`title` varchar(1000) default null comment '商品标题... |
-- START:posts
-- START:save-message!
-- :name save-message! :<! :1
-- :doc creates a new message using the name and message keys
INSERT INTO posts
(author, name, message)
VALUES (:author, :name, :message)
RETURNING *;
-- END:save-message!
-- START:get-messages
-- :name get-messages :? :*
-- :doc selects all availabl... |
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 15, 2017 at 12:49 PM
-- 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 */... |
#HiveQL
INSERT INTO xh_basecount.product_stw_log
SELECT
a1.userid,
a1.username,
a1.schoolid,
a1.schoolname,
a1.classname,
a1.classid,
a1.bookname,
a1.bookid,
a1.hp,
a1.credit,
SUM(a1.newintegral) AS sumscore,
SUM(IF(a1.ishomework = 0,1,0)) AS sumhomework,
SUM(IF(a1.ishomework != 0,1,0)) AS sumselfwork,
COUNT(a1.ishom... |
SELECT CASE
WHEN OH.APP_CODE_ENTRY = 'EMM' THEN '2-PAG AUTOMATED'
ELSE '1- CSR'
END
TRANSACTION_SOURCE,
'Subscription Upgrade' TRANSACTION_TYPE,
'ADJUSTMENT' EVENT_CATEGORY,
'SUBSCRIPTION PACKAGE(Charge)' EVENT_TYPE,
NULL PROFILE,
NULL PAY_TYPE,
... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 06, 2018 at 03:02 PM
-- Server version: 10.1.28-MariaDB
-- PHP Version: 7.1.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
CREATE TABLE parents (
id SERIAL PRIMARY KEY,
name TEXT,
kills INT DEFAULT 0
);
CREATE TABLE children (
id SERIAL PRIMARY KEY,
name TEXT,
title TEXT,
parent_id INT, --for one-to-many (many children to one parent)
FOREIGN KEY (parent_id) REFERENCES parents(id)
);
--adding default information
INSERT INT... |
/*
*
* Get stats of your DB indexes.
* Interesting to understand which indexes is not used on your instance.
* After you can easier review tables via \dt command
* Also, better to make an overview via
* https://wiki.postgresql.org/wiki/Index_Maintenance
*/
SELECT s.schemaname,
s.relname AS t... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 04-07-2019 a las 05:46:18
-- Versión del servidor: 10.1.37-MariaDB
-- Versión de PHP: 7.2.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";... |
-- ★ INDEX : PRIMARY KEY가 아닌 필드를 중심으로 조회를 많이 하는 경우, 조회속도 향상을 위해 생성
SELECT *
FROM USER_INDEXES;
DROP TABLE EMP01;
CREATE TABLE EMP01
AS SELECT *
FROM EMP;
-- 1번 (28개), 2번(56개)
INSERT INTO EMP01
SELECT *
FROM EMP01;
SELECT COUNT(*)
FROM EMP01;
-- 12번 (22만개)
... |
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Nov 08, 2015 at 08:42 PM
-- Server version: 5.5.46-0ubuntu0.14.04.2
-- PHP Version: 5.5.9-1ubuntu4.14
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_C... |
-- MySQL dump 10.13 Distrib 8.0.13, for macos10.14 (x86_64)
--
-- Host: localhost Database: Runners
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... |
-- TITLE1: Capture Extra Attributes
-- TITLE2:Viewing the Extra Attributes Captured by Implicit Capture
-- DESC: You can use the INCLUDE_EXTRA_ATTRIBUTE procedure in the DBMS_CAPTURE_ADM package to instruct a capture process or synchronous capture to capture one or more extra attributes and include the extra attribute... |
/*
Warnings:
- Changed the type of `pointX` on the `Markets` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
- Changed the type of `pointY` on the `Markets` table. No cast exists, the column would be dropped and recreated, whi... |
system echo "List of model information on each car in sales shop"
system echo "---------------------------------------------------"
USE carsales;
SELECT carID,
models.*
FROM shopModels
LEFT JOIN models ON models.modID = shopModels.modID;
|
-- phpMyAdmin SQL Dump
-- version 3.5.8.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Dec 13, 2015 at 01:12 AM
-- Server version: 5.5.42-37.1-log
-- PHP Version: 5.4.23
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CL... |
CREATE TABLE subreddit (
subreddit_id VARCHAR (50) UNIQUE NOT NULL,
subreddit_name VARCHAR UNIQUE NOT NULL,
PRIMARY KEY (subreddit_id)
);
CREATE TABLE reddit_user (
user_id VARCHAR (50) UNIQUE NOT NULL,
sum_comment_karma int DEFAULT 0,
sum_post_karma int DEFAULT 0,
PRIMARY KEY (user_id)
);
CREATE TABLE... |
CREATE TABLE truck_fleet_db.kudu_speeding_driver_alerts
(
alertTimeLong timestamp,
alertTime string,
driverId INT,
driverName STRING,
route STRING,
speed INT,
primary key (alertTimeLong)
)
PARTITION BY HASH PARTITIONS 4
STORED AS KUDU
TBLPROPERTIES ('kudu.num_tablet_replicas' = '1'); |
UPDATE Students SET City = 'Philadelphia';
SET SQL_SAFE_UPDATES = 0;
SELECT * FROM Students; |
CREATE PROCEDURE sp_list_Queryfields (@TABLE_ID INT)
AS
SELECT FieldName, DisplayName, HasLookUp, LookUpTable,
KeyField, DisplayField, Delimiter FROM QueryFields WHERE TableID = @TABLE_ID ORDER BY ID
|
DROP TABLE IF EXISTS users;
CREATE TABLE users (
id INTEGER AUTO_INCREMENT NOT NULL PRIMARY KEY,
name VARCHAR(128) NOT NULL UNIQUE,
password VARCHAR(128) NOT NULL,
role VARCHAR(64) NOT NULL DEFAULT "member",
token VARCHAR(64) NOT NULL UNIQUE,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMEST... |
-- aas-awr-pdb-calc.sql
-- calculate AAS for PDBs from AWR
--
-- Jared Still 2020-11-10
-- jkstill@gmail.com
--
-- Note: Using SAMPLE_TIME/SAMPLE_ID rather than SNAP_ID, as SAMPLE_TIME is more granular
-- I have just been waiting for an opportunity to use 'granular' ;)
--
col sample_time format a30
col lag_time f... |
ALTER TABLE app ALTER COLUMN version TYPE CHARACTER varying(96); |
drop database if exists itest;
drop user 'itest'@'localhost';
|
CREATE USER viper WITH PASSWORD 'viper';
CREATE DATABASE viper;
GRANT ALL PRIVILEGES ON DATABASE viper TO viper;
|
# Uebungsdatenbank R. Zimmermann
#--------------------------------------------------------------------------------------------
drop database if exists winestore;
create database winestore;
use winestore;
CREATE TABLE customer (
cust_id int(5) NOT NULL,
surname varchar(50),
firstname varchar(50),
initial char(1... |
/*
* Use this command to create the opoline user.
*/
CREATE USER opoline LOGIN PASSWORD 'opoline' CREATEDB;
|
#20180131-增加packagename非空判定
BEGIN
delete from user_alive_day where datetime = adddate(date(sysdate()) ,-1);
INSERT INTO user_alive_day(userid,packagename,schoolid,schoolname,gradename,datetime)(
SELECT
st.userId,
st.packagename,
st.schoolId,
st.schoolName,
st.gradename,
st.datetime
FROM
(SELECT
sta1.userId,
st... |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+01:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
CREATE DATABASE IF NOT E... |
--sys나 system 계정으로 로그인해서 사용자 생성, 테이블스페이스 생성하기
--sqlplus "/as sysdba ==>시스템dba접속
--테이블 스페이스 생성
create tablespace eztour
datafile 'D:\myoracle\ezentour.dbf' size 48m
extent management local
uniform size 64k
segment space management auto;
--사용자 계정 생성
create user eztour
identified by ez123
default tablespac... |
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 27-08-2021 a las 03:42:53
-- Versión del servidor: 10.4.20-MariaDB
-- Versión de PHP: 8.0.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
select *
from play_store_apps |
start transaction;
INSERT INTO Location(ZipCode, City, State)
VALUES(11790, 'Stony Brook', 'NY'),
(11794, 'Stony Brook', 'NY'),
(93536, 'Los Angeles', 'CA');
INSERT INTO Person(LastName, FirstName, SSN, Address, Telephone, ZipCode)
VALUES('Yang', 'Shang', 111111111, '123 Success Street', 5166328959, 11790),
('Du'... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 80017
Source Host : localhost:3306
Source Database : java_test
Target Server Type : MYSQL
Target Server Version : 80017
File Encoding : 65001
Date: 2019-08-24 17:49:46
*/
SET FOREIGN_KE... |
-- Don't forget to add your create table SQL
-- It is also helpful to include some test data
-- fs-react-shopping --
-- fs-react-shopping --
DROP TABLE "shopping_list";
CREATE TABLE "shopping_list"
("id" SERIAL PRIMARY KEY,
"name" VARCHAR(80) NOT NULL,
"quantity" FLOAT DEFAULT 1,
"unit" VARCHAR(20) NOT NULL, ... |
/*
Navicat MySQL Data Transfer
Source Server : 本地数据库
Source Server Version : 50640
Source Host : localhost:3306
Source Database : pmp
Target Server Type : MYSQL
Target Server Version : 50640
File Encoding : 65001
Date: 2019-08-06 17:44:34
*/
SET FOREIGN_KEY_CHECKS=0;
-- ---------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.