text stringlengths 6 9.38M |
|---|
SELECT DB_NAME(vfs.DbId) DatabaseName,
mf.name,
mf.physical_name,
vfs.BytesRead,
vfs.BytesWritten,
vfs.IoStallMS,
vfs.IoStallReadMS,
vfs.IoStallWriteMS,
vfs.NumberReads,
vfs.NumberWrites,
(Size*8)/1024 Size_MB
FROM ::fn_virtualfilestats(NULL,NULL) vfs
INNER JOIN sys.master_files mf ON mf.database_id = ... |
/***********************************************************
PESSOA
***********************************************************/
CREATE TABLE PESSOA
(
COD_PESSOA INT NOT NULL AUTO_INCREMENT,
NOME VARCHAR(200) NOT NULL,
RAZAO_SOCIAL VARCHAR(200) NULL,
LOGIN VARCHAR(20) NOT NULL... |
insert into
NoteContents
(
NoteId,
ContentKind,
IsLink,
Content,
Address,
Encoding,
DelayTime,
BufferSize,
RefreshTime,
IsEnabledRefresh,
[CreatedTimestamp],
[CreatedAccount],
[CreatedProgramName],
[CreatedProgramVersion],
[UpdatedTimestamp],
[UpdatedAccount],
... |
/*
Managing Tables using DML Statements
- Perform INSERT, UPDATE and DELTE operations
- Performing Multi-Table Inserts
- Performing MERGE statements
- Managing Database Transactions
- Controlling Transactions
*/
-- Types of SQL Statements:
-- Data Manipulation Language (DML):
SELECT
INSERT INTO
... |
SELECT *
FROM VW_UTIL_DEPLOYEDPAGE
<%=Sort("@SORT@","@DIR@")%> |
select top 100
mp.id
, mp.ProductId
, mp.Amount
, pa.ErrorPaymentAmount
, ec.EuroCost
, pa.ErrorPaymentAmount * pa.ErrorPaymentAmount
, mp.ConditionSnapshot
from br8687 br
left join mts.MintosProduct mp on mp.MintosId = br.MintosId
left join mts.MintosMessage mm on mm.ProductId = mp.id
... |
-- phpMyAdmin SQL Dump
-- version 4.7.9
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 25, 2018 at 05:00 PM
-- Server version: 5.7.21
-- PHP Version: 5.6.35
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CH... |
DROP DATABASE IF EXISTS helpYourNeighbour;
CREATE DATABASE helpYourNeighbour;
use helpYourNeighbour;
CREATE TABLE User(
user_id INTEGER AUTO_INCREMENT PRIMARY KEY,
firstname VARCHAR(32) NOT NULL,
lastname VARCHAR(64) NOT NULL,
password TEXT NOT NULL,
email VARCHAR(320) NOT NULL,
backup_email V... |
delete from HtmlLabelIndex where id=24972
/
delete from HtmlLabelInfo where indexid=24972
/
INSERT INTO HtmlLabelIndex values(24972,'我的客服')
/
delete from HtmlLabelIndex where id=24973
/
delete from HtmlLabelInfo where indexid=24973
/
INSERT INTO HtmlLabelIndex values(24973,'联系记录')
/
INSERT INTO HtmlLabelInfo VALU... |
use partstable;
drop table giftMaster;
create table giftMaster
(
id int primary key auto_increment,
giftCategory varchar(10),
giftCode varchar(20),
giftDesc varchar(50) ,
giftPoints int not null,
giftImage varchar(50),
delFlg char ,
constraint giftMaster_g... |
-- phpMyAdmin SQL Dump
-- version 4.4.14
-- http://www.phpmyadmin.net
--
-- Client : 127.0.0.1
-- Généré le : Mer 11 Novembre 2015 à 16:35
-- Version du serveur : 5.6.26
-- Version de PHP : 5.6.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... |
select
distinct(TZ_COLU_ID) TZ_COLU_ID,
TZ_COLU_NAME
from
PS_TZ_SITEI_COLU_T
where
TZ_SITEI_ID=?
and TZ_CONT_TYPE=? |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Час створення: Лис 04 2019 р., 10:55
-- Версія сервера: 5.6.41
-- Версія PHP: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTE... |
-- phpMyAdmin SQL Dump
-- version 3.4.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 26, 2012 at 12:51 PM
-- Server version: 5.5.16
-- PHP Version: 5.3.8
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!... |
ALTER TABLE tb_usuarios
ADD missao_caca INT UNSIGNED DEFAULT NULL NULL;
ALTER TABLE tb_usuarios
ADD missao_caca_progress INT UNSIGNED DEFAULT NULL NULL;
INSERT INTO tb_migrations (cod_migration) VALUE (41); |
with t as(
select activity, dense_rank() over(order by c desc) as rk
from( select activity, count(*) as c from friends group by 1) a
)
select activity from t
where rk != 1 and rk != (select max(rk) from t)
|
INSERT INTO orders VALUES (304403,209743,2);
INSERT INTO orders VALUES (305481,202165,5);
INSERT INTO orders VALUES (302765,214166,9);
INSERT INTO orders VALUES (306895,204501,6);
INSERT INTO orders VALUES (303924,211991,4);
INSERT INTO orders VALUES (306968,207953,10);
INSERT INTO orders VALUES (306238,200142,9... |
SELECT *
FROM `ims_superdesk_jd_vop_order_submit_order`
WHERE jd_vop_result_jdOrderId = '72915601854'
or jd_vop_result_jdOrderId = '72958472952'
or jd_vop_result_jdOrderId = '72952727574'
or jd_vop_result_jdOrderId = '72952549584'
or jd_vop_result_jdOrderId = '72952652319'
or jd_vop_result_j... |
CREATE DATABASE IF NOT EXISTS `DatamartIngresos` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `DatamartIngresos`;
-- MySQL dump 10.13 Distrib 5.6.17, for debian-linux-gnu (i686)
--
-- Host: localhost Database: DatamartIngresos
-- ------------------------------------------------------
-- Serv... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 13, 2020 at 12:17 PM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
select XMLELEMENT("customer",
XMLATTRIBUTES(
xc.account_number,
xc.customer_name),
XMLELEMENT ("phone", xc.phone_number),
XMLELEMENT("email", xc.email))
from xx_customers xc;
select XMLELEMENT("customer",
... |
-- MySQL Workbench Forward Engineering
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='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTI... |
prompt 워크북용 스크립트
set feedback off
set define off
DROP TABLE TB_DEPARTMENT CASCADE CONSTRAINTS;
PROMPT DROPPING TB_CLASS...
DROP TABLE TB_CLASS CASCADE CONSTRAINTS;
PROMPT DROPPING TB_PROFESSOR...
DROP TABLE TB_PROFESSOR CASCADE CONSTRAINTS;
PROMPT DROPPING TB_CLASS_PROFESSOR...
DROP TABLE TB_CLASS_PROFESSO... |
CREATE TABLE shoppingCart (
sessionId varchar(36) NOT NULL,
itemName varchar(100) NOT NULL,
price numeric(6,2) NOT NULL,
quantity integer NOT NULL,
insertedAt timestamp NOT NULL default current_timestamp
);
ALTER TABLE shoppingCart OWNER TO oghaffar;
GRANT ALL ON TABLE shoppingcart TO oghaffar; |
SELECT NAME, COUNT(POST_ID) FROM mydb.user
JOIN mydb.post ON mydb.user.USER_ID = mydb.post.USER_ID
WHERE TIMESTAMPDIFF(DAY, CREATED_AT, CURRENT_TIMESTAMP) = 0
GROUP BY mydb.post.USER_ID; |
CREATE TABLE UserRoles (
ur_id integer primary key,
ur_role varchar2(40)
);
CREATE TABLE ReimbursementStatus (
rs_id integer primary key,
rs_status varchar2(30) not null
);
CREATE TABLE ReimbursementType (
rt_id integer primary key,
rt_type varchar2(30) not null
);
CREATE TABLE Users (
u_id integer primary ke... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 11-08-2017 a las 16:19:52
-- Versión del servidor: 10.1.21-MariaDB
-- 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_CL... |
create table TWEETS (
TWEET_ID Number(20, 0),
CONTENT VARCHAR2(141),
TIME timestamp,
USER_ID number(20, 0)
);
create table USERS (
USER_ID Number(20, 0),
user_name varchar2(100),
JOINED timestamp
);
CREATE SEQUENCE SEQ_TWEET_ID INCREMENT BY 1
MAXVALUE 999999999999999999999999... |
Alter Table student Modify Column cgpi float; |
CREATE TABLE
t_res_user
(
id VARCHAR(32) NOT NULL,
username VARCHAR(32) NOT NULL COMMENT '用户名',
password VARCHAR(32) NOT NULL COMMENT '密码',
real_name VARCHAR(32) COMMENT '真实姓名',
gender INT(1) COMMENT '性别',
mobile_phone VARCHAR(20) COMMENT '手机号',
email VARC... |
delete from `spell_proc_event` where entry = 16164;
insert into `spell_proc_event` values (16164, 0x0000001C, 11, 0x00000000, 0x00000000, 0x00000000, 0x00010000, 0x00000002, 0.000000, 0.000000, 0);
DELETE FROM `spell_proc_event` WHERE `entry` IN (16180,16196,16198);
INSERT INTO `spell_proc_event` VALUES
(16180,0x0... |
-- Create the Reference Forest Type Group table
create table FIA.REF_SPECIES(
SPCD integer,
COMMON_NAME varchar(100),
GENUS varchar(40),
SPECIES varchar(50),
VARIETY varchar(50),
SUBSPECIES varchar(50),
SPECIES_SYMBOL varchar(8),
E_SPGRPCD numeric(2,0),
W_SPGRPCD numeric(2,0),
C_SPGRPCD numeric(2,0),
P_SPGRP... |
delete from HtmlLabelIndex where id=22358
/
delete from HtmlLabelInfo where indexid=22358
/
INSERT INTO HtmlLabelIndex values(22358,'默认文档类型')
/
delete from HtmlLabelIndex where id=22359
/
delete from HtmlLabelInfo where indexid=22359
/
INSERT INTO HtmlLabelIndex values(22359,'WPS文字')
/
INSERT INTO HtmlLabelInfo V... |
create or replace procedure LMConfig_U_ByInfoInsert(menuLevel_1 integer,
parentId_1 integer,
defaultIndex_1 integer) AS
old_updateId integer;
old_resourceId integer;
old_resourceType char(1);
... |
/* Create Comments, Sequences and Triggers for Autonumber Columns */
COMMENT ON TABLE "ADM_TMODI" IS 'TABLA DE USUARIO MODIFICADORES'
;
COMMENT ON COLUMN "ADM_TMODI"."MODI_MODI" IS 'ID DE LA TABLA MODIFICADOES'
;
COMMENT ON COLUMN "ADM_TMODI"."MODI_USUA" IS 'ID DEL USUARIO MODIFICADOR'
;
COMMENT ON COLUMN "ADM... |
DELIMITER $$
CREATE TRIGGER AfterUpdateUserInfo
AFTER UPDATE ON User_Info
FOR EACH ROW
BEGIN
UPDATE Bookmark_StudioInsert set u_email = new.u_email WHERE u_email =old.u_email;
END $$
DELIMITER ;
|
--
-- regproc
--
/* If objects exist, return oids */
-- without schemaname
SELECT regoper('||/');
SELECT regproc('now');
SELECT regclass('pg_class');
SELECT regtype('int4');
SELECT to_regoper('||/');
SELECT to_regproc('now');
SELECT to_regclass('pg_class');
SELECT to_regtype('int4');
-- with schemaname
SELECT reg... |
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,ALLOW_INVALID_DATES';
-- -----------------------------------------------------
-- Table `bdd`.`cards`
-- ---------------------------------... |
select COUNT(*) from sierra_view.patron_view PATVIEW
join sierra_view.patron_record_fullname PATNAME
on PATVIEW.ID = PATNAME.patron_record_id
--where PATVIEW.id = 481037504754
; |
---Se actualzian las secuencias para los inserts desarrollo
ALTER SEQUENCE gluo_ano_fiscal_anof_id_seq RESTART WITH 2;
ALTER SEQUENCE gluo_banco_banc_id_seq RESTART WITH 4;
ALTER SEQUENCE gluo_cheque_usado_chus_id_seq RESTART WITH 9;
ALTER SEQUENCE gluo_chequera_cheq_id_seq RESTART WITH 7;
ALTER SEQUENCE gluo_condici... |
-- Script that updates the score of Bob to 10
-- in 'second_table'
UPDATE second_table
SET
score = "10"
WHERE second_table.name = "Bob";
|
delete from syspoppupremindinfonew
/ |
use employees;
#2a
select concat(first_name,' ',last_name) as full_name from employees
where last_name like 'E%';
#2b
select concat(first_name,' ',last_name) as full_name from employees
where last_name like 'E%'
or last_name like '%e';
#2c
select concat(first_name,' ',last_name) as full_name from employees
where las... |
-- phpMyAdmin SQL Dump
-- version 4.4.9
-- http://www.phpmyadmin.net
--
-- Host: localhost:8889
-- Generation Time: Jul 27, 2015 at 03:25 PM
-- Server version: 5.5.42
-- PHP Version: 5.6.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT... |
CREATE TABLE `t_user` (
`user_id` BIGINT(20) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
`student_id` BIGINT(20) NOT NULL COMMENT '学号',
`student_name` VARCHAR(50) NOT NULL COMMENT '姓名',
`student_passWord` VARCHAR(50) NOT NULL COMMENT '密码',
`student_className` VARCHAR(50) NOT NULL COMMENT '班级名',
PRIMARY KEY (`user_id`... |
\c es_results_db;
SET search_path TO es_db_test,public;
Create table es_db_test.Contributor
(
ParentRUReference varchar (11) not null, /* Enterprise reference? */
RUReference varchar(11) not null,
HouseNameNo varchar(50) not null,
Street ... |
rem Copyright (c) 1994, 1996 Oracle Corporation. All rights reserved.
rem Random number generator compliments of Russ Seligman (April '94)
drop table applet_data;
create table applet_data
( name varchar2(255),
code long,
constraint app_pkey primary key (name)
);
create or replace package applet is
procedure get(in... |
-- Task 7
-- Create database hbtn_0d_usa and the table cities
CREATE DATABASE IF NOT EXISTS hbtn_0d_usa;
USE hbtn_0d_usa;
CREATE TABLE IF NOT EXISTS cities (id INT UNIQUE AUTO_INCREMENT NOT NULL, state_id INT NOT NULL, name VARCHAR(256) NOT NULL, PRIMARY KEY (id), FOREIGN KEY (state_id) REFERENCES states (id));
|
/*
BUG 87 学历维护的权限bug-王金永
*/
delete from SystemRightToGroup where rightid=382
/
insert into SystemRightToGroup (groupid,rightid) values (3,382)
/
update SystemRightRoles set rolelevel='2' where rightid=382
/
delete from SystemRightToGroup where rightid=127
/
insert into SystemRightToGroup (groupid,rightid) values (3... |
CREATE or REPLACE PROCEDURE HrmResource_SelectByManagerID
(id_1 integer,
flag out integer ,
msg out varchar2,
thecursor IN OUT cursor_define.weavercursor)
AS
begin
open thecursor for
select * from HrmResource
where
managerid = id_1
and (status =0 or status = 1 or status =2 or status =3) order by d... |
CREATE TABLE IF NOT EXISTS Data_status(
ID serial primary key,
Dstatus VARCHAR(45) NOT NULL,
DDesc VARCHAR(500) NULL,
date_modify timestamp NOT NULL,
date_create timestamp NOT NULL);
INSERT INTO Data_status(Dstatus, DDesc, date_modify, date_create) VALUES
('Active', NULL, '2020-01-04 14:17:05', '2020-01-0... |
CREATE TABLE categoria
(
cod serial PRIMARY KEY,
nome text
);
CREATE TABLE produto
(
id serial PRIMARY KEY,
descricao text NOT NULL,
cod_cat int not null,
quantestoque integer,
preco numeric(7,2)
);
CREATE TABLE usuarios(
id SERIAL PRIMARY KEY,
nome VARCHAR(50) NOT NULL,
senha VARCHAR(50)NOT... |
-------------------------------------------------------------------
-- Filename: oracle_12c.sql
-- Description: Oracle 12c script
-- Usage:
-- Windows:
-- cmd sqlplus / as sysdba
-- sqlplus
-- SQL> spool C:\retsql.sql
-- SQL> @ C:\oracle_12c.sql
-- SQL> spool off
--
-- Lin... |
DELETE from FUNCTION_CODES;
--07/18/2015
--
-- One use of this table is to associate the fuction name with the function code
-- for use in generating a table of CAN IDs used for function commands for
-- a specific unit.
--
-- FUNCTION_NAME (PRIMARY KEY)
-- Each function must have a unique name.
--
-- FUNCTION_T... |
-- PROG_FUNC table
-- 05/20/2016
--
-- Associates a program (path/name) with function types supported
--
-- PROG_NAME varchar(24),
-- Program names used in PROGRAMS
--
-- FUNCTION_TYPE varchar(24),
-- The table FUNCTIONS.FUNCTION_TYPE assigns a *specific instance* of FUNCTION_TYPE
-- to this program, and this progr... |
set feedback on
set echo on
spool Lab1.lst
-- ***************************************************************
-- * CSc 365 LAB #1 Spring 2007
-- * Author: Daniel Jackson Date: April 6, 2007
-- *
-- * The purpose of this lab is to setup the work environment,
-- * ... |
DROP PROCEDURE IF EXISTS get_ad_types;
DELIMITER ;;
CREATE DEFINER=web@localhost PROCEDURE get_ad_types()
COMMENT 'get ad types'
BEGIN
SELECT id, name FROM ad_types;
END ;;
DELIMITER ;
|
DROP PROCEDURE CPI.COPY_POL_WCARGO;
CREATE OR REPLACE PROCEDURE CPI.copy_pol_wcargo(
p_par_id IN GIPI_PARLIST.par_id%TYPE,
p_policy_id IN GIPI_POLBASIC.policy_id%TYPE
)
IS
/* Revised to have conformity with the objects in the database;
** the columns in the policy table should not ... |
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Server version: 5.7.14 - MySQL Community Server (GPL)
-- Server OS: Win64
-- HeidiSQL Version: 9.4.0.5125
-- --------------------------------------------------------
/*... |
-- phpMyAdmin SQL Dump
-- version 3.5.2.2
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Nov 07, 2015 at 04:46 AM
-- Server version: 5.5.27
-- PHP Version: 5.4.7
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/... |
CREATE TABLE tipos_regimenes (
id SERIAL PRIMARY KEY,
regimen VARCHAR(50) NOT NULL
);
INSERT INTO tipos_regimenes (regimen) VALUES
('Pública'),
('Particular Cofinanciada'),
('Particular Autofinanciada');
|
/*
Name: Basira Shirzad
Date: 01-22-2021
*/
-- Tables for Hospital Database
-- Physician Table
DROP TABLE IF EXISTS physician;
CREATE TABLE physician (
employee_id INTEGER NOT NULL,
name VARCHAR(30) NOT NULL,
position VARCHAR(30) NOT NULL,
ssn INTEGER NOT NULL,
CONSTRAINT pk_physician PRIMARY KEY(employee_id)
);... |
DROP VIEW "vw_kostenmatrix";
DROP VIEW "vw_notinpopular";
DROP VIEW "vw_btw5d_calculus";
DROP VIEW "vw_btw5d";
DROP VIEW "vw_btw5dbedragen";
DROP VIEW "vw_btwjournaal";
DROP VIEW "vw_btw";
DROP VIEW "vw_btwbedragen1";
DROP VIEW "vw_btwbedragen0";
DROP VIEW "vw_btwbase";
DROP VIEW "vw_partbtw_year_jbedragen";
DROP VI... |
delete from core_resource where CLASS = 'ContentResourceImpl';
delete from core_resource where CLASS = 'WebResourceImpl'; |
-- First 100 rows of data
SELECT *
from subscriptions
limit 100;
-- Verify segment count
SELECT count(id), segment
from subscriptions
group by segment;
-- Months in Operation
select min(subscription_start), max(subscription_start)
from subscriptions;
-- Subscription Start Data
select min(... |
--读写分离非分片
CREATE SCHEMA IF NOT EXISTS `tasfe_crud`;
CREATE TABLE IF NOT EXISTS `tasfe_crud`.`t_user` (
id bigint(11) NOT NULL AUTO_INCREMENT,
user_id bigint(11),
dept_id int(5),
order_id int(5),
user_name varchar(16),
password varchar(16),
mobile_phone varchar(16),
office_phone varchar(16),
email varc... |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 23, 2018 at 10:14 AM
-- Server version: 10.1.29-MariaDB
-- PHP Version: 7.2.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertClassData`(IN tID char(30), IN course char(10),
IN cType char(10), IN classDate DATE, IN classTime char(14), IN classRoom char(3)
)
Begin
DECLARE limitNum int; -- 변수선언
DECLARE cInfo char(20);
DECLARE result char(10) default '성공';
DECLARE exist_sa... |
CREATE TABLE players (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
elo DOUBLE PRECISION NOT NULL
)
|
-- ImportEntry e ImportBatch
create table ImportBatch (
id bigint not null auto_increment,
action varchar(255),
csvHeader longtext,
importedAt datetime,
justification varchar(1000),
provisioning boolean default false,
schemaa varchar(255),
status varchar(255),
importedBy_id bigint,
primary key (id)
) ENGINE... |
SELECT COUNT(*) FROM TAGS
WHERE DELETE_FLAG = 0;
|
-- JOIN (중요하다)
-- RDBMS는 중복을 최소화 하는 형태의 데이터베이스
-- 다른 테이블과 결합하여 데이터를 조회
-- JOIN 두 테이블을 연결하는 작업
-- JOIN 문법
-- 1. ANSI 문법
-- 2. ORACLE 문법
-- Natural Join
-- 두 테이블간 컬럼명이 같을 때 해당 컬럼으로 연결(조인)
-- emp, dept 테이블에는 deptno 라는 컬럼이 존재
SELECT *
FROM emp NATURAL JOIN dept;
-- Natural join에 사용된 조언 컬럼(deptno)는 한정자(ex: 테이블명, 테이블 별칭... |
DROP TABLE USER IF EXISTS;
CREATE TABLE EMPLOYEE (
ID VARCHAR(10),
FIRSTNAME VARCHAR(100),
LASTNAME VARCHAR(100),
BIRTHDATE VARCHAR(100),
PHONENO VARCHAR(100)
) ; |
SELECT employee_id, first_name, last_name, salary
from &select_table
WHERE
SALARY BETWEEN &first_amount AND &last_amount
ORDER BY salary; |
1. konsep dasar composite index (index dengan mulitiple column (max16))
2. cara membuat composite index
3. menggunakan query composite index
---------------------------------------
show full tables;
-- menampilkan query create table
show create table employee;
-- menampilkan index dari table
show index from empl... |
ALTER TABLE cohead ALTER COLUMN cohead_creator SET DEFAULT getEffectiveXtUser();
ALTER TABLE coitem ALTER COLUMN coitem_creator SET DEFAULT getEffectiveXtUser();
ALTER TABLE ccard ALTER COLUMN ccard_added_by_username SET DEFAULT getEffectiveXtUser();
ALTER TABLE ccard ALTER COLUMN ccard_last_updated_by_username SET DEF... |
drop database if exists restaurant;
create database restaurant;
use restaurant;
create table restaurant(
id int not null primary key auto_increment,
menu varchar(50) not null,
location varchar(50) not null
);
create table category(
id int not null primary key auto_increment,
restaurant int not ... |
SELECT * FROM GROUPS
INNER JOIN KNOWLEDGE_EDIT_GROUPS ON GROUPS.GROUP_ID = KNOWLEDGE_EDIT_GROUPS.GROUP_ID
WHERE KNOWLEDGE_EDIT_GROUPS.KNOWLEDGE_ID = ?
ORDER BY GROUPS.GROUP_ID
|
alter table DocSecCategory add appointedWorkflowId integer null
/
alter table DocSecCategoryTemplate add appointedWorkflowId integer null
/ |
/*
-- Query:
-- Date: 2019-03-30 17:12
*/
INSERT INTO `gifts` (`name`,`cost`,`sizes_idsizes`) VALUES ('Сборник анекдотов Петросяна','0',1);
INSERT INTO `gifts` (`name`,`cost`,`sizes_idsizes`) VALUES ('Машинка','10',1);
INSERT INTO `gifts` (`name`,`cost`,`sizes_idsizes`) VALUES ('Большая машинка','20',1);
INSERT INTO `... |
/*******************************************
AUTHOR: MARK SHAPIRO
SCRIPT: JOINING FIRE BATTALIONS TO HOUSING DB 19V2
DATE: 01/22/2020
METHODOLOGY:
1. JOIN FIRE BATTALION TO EACH DEVELOPMENT
2. IF A DEVELOPMENT IS INAPPROPRIATELY GEOCODED TO THE WATER, MATCH IT WITH THE CLOSEST FIRE BATTALION within .5 kilometers
*****... |
ALTER TABLE "public"."files" ALTER COLUMN "asset_id" TYPE int4;
alter table "public"."files" rename column "asset_id" to "assetId"; |
-- Your SQL goes here
CREATE TABLE feeds (
id SERIAL PRIMARY KEY,
name VARCHAR NOT NULL,
website VARCHAR NOT NULL,
last_updated TIMESTAMPTZ NOT NULL,
canonical_feed INTEGER REFERENCES canonical_feeds(id) NOT NULL
) |
--Tables and primary keys
-- Table Key
-- inventory inventory_id
-- film_actor actor_id, film_id
-- actor actor_id
-- film film_id
-- language languahe_id
-- film_category film_id, category_id
-- rental rental_id
-- staff staff_id
-- customer customer_id
-- category category... |
CREATE TABLE [xfr].[TelegramStructuresTT] (
[ParentElementCode] NVARCHAR (255) NULL,
[ElementCode] NVARCHAR (255) NULL,
[StructureDescription] NVARCHAR (255) NULL,
[SeqNo] SMALLINT NULL,
[StructureSource] NVARCHAR (255) NULL,
[Prefix] NVARCHAR... |
/*
Navicat MySQL Data Transfer
Source Server : Assign
Source Server Type : MySQL
Source Server Version : 80011
Source Host : localhost:3306
Source Schema : air
Target Server Type : MySQL
Target Server Version : 80011
File Encoding : 65001
Date: 19/06/2018 17:16:57
*/... |
SELECT title, year
FROM movies
WHERE title LIKE "Harry Potter%" -- counting the movie, if its title starts with "Harry Potter" + etc
ORDER BY year ASC; |
Select avg(total_duration) as avg_total_duration
FROM ( Select cohorts.name as cohort, sum(completed_at-started_at) as total_duration
from assistance_requests
join students on assistance_requests.student_id = students.id
join cohorts on students.cohort_id = cohorts.id
group by cohort
order by total_duration) as total_d... |
-- MySQL Script generated by MySQL Workbench
-- Wed Jun 1 21:53:25 2016
-- Model: New Model Version: 1.0
-- MySQL Workbench Forward Engineering
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='TR... |
rem
rem $Header: cat7103.sql,v 1.2 1994/04/08 14:16:32 wmaimone Exp $
rem
Rem Copyright (c) 1992 by Oracle Corporation
Rem NAME
Rem cat7103.sql - upgrade Oracle RDBMS from version 7.1.2 to 7.1.3
Rem DESCRIPTION
Rem
Rem NOTES
Rem Run this as INTERNAL. Run it before installing catalog o... |
CREATE TABLE "System"
( id SERIAL PRIMARY KEY
, label text UNIQUE NOT NULL CHECK (label <> '')
);
GRANT ALL ON "System" TO carma_db_sync;
GRANT ALL ON "System" TO carma_search;
GRANT ALL ON "System_id_seq" TO carma_db_sync;
GRANT ALL ON "System_id_seq" TO carma_search;
|
INSERT INTO HtmlLabelIndex values(18581,'分权设置')
/
INSERT INTO HtmlLabelInfo VALUES(18581,'分权设置',7)
/
INSERT INTO HtmlLabelInfo VALUES(18581,'detachable management Set',8)
/
call MMConfig_U_ByInfoInsert (11,9)
/
call MMInfo_Insert (472,18581,'分权设置','/system/DetachMSetEdit.jsp','mainFrame',11,1,9,0,'',0,'',0,'','',0,... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Client : localhost:8889
-- Généré le : Mar 03 Avril 2018 à 07:45
-- Version du serveur : 5.6.35
-- Version de PHP : 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARA... |
SELECT ID,USERNAME,PASSWORD FROM zume100.USER_TEST; |
ALTER TABLE TB_THEME
MODIFY COLUMN CREATION_DATE DATETIME NOT NULL,
MODIFY COLUMN UPDATE_DATE DATETIME,
ADD COLUMN UPDATED_BY BIGINT(20); |
/* A1 List all patients currently admitted to the hospital. */
SELECT patients.patientID, concat(patients.firstName, ' ', patients.lastName) AS name
FROM patients, admissions
WHERE admissions.dischargeDate IS NULL
AND patients.patientID = admissions.patientID;
/* A2 List all patients who have received outpatient ser... |
CREATE OR REPLACE PROCEDURE CPI.giacs001_check_comm_payts (p_gacc_tran_id IN NUMBER
)
IS
v_exist VARCHAR2 (1) := 'N';
v_sign NUMBER;
v_child_sign NUMBER;
v_child_sign2 NUMBER; --added by gab 09.21.2016 SR 22252
v_parent_sign NUMBER;
v_bill_nos VARCHAR2 (2000); ... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 16 Apr 2020 pada 13.31
-- Versi server: 10.1.38-MariaDB
-- Versi PHP: 7.1.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHAR... |
DROP TABLE IF EXISTS `files`;
CREATE TABLE `files` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime NOT NULL,
`subdir` varchar(50) DEFAULT NULL,
`type` varchar(50) NOT NULL,
`size` int(11) NOT NULL,
`views` int(11) DEFAULT 0,
`... |
--
-- Licensed to the Apache Software Foundation (ASF) under one
-- or more contributor license agreements. See the NOTICE file
-- distributed with this work for additional information
-- regarding copyright ownership. The ASF licenses this file
-- to you under the Apache License, Version 2.0 (the
-- "License"); you ma... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.