text stringlengths 6 9.38M |
|---|
drop table sess_stats;
create table sess_stats ( name varchar2(64), value number, diff number );
variable sid number
exec :sid := &1
|
-- locked_stats.sql
-- show tables and indexes with locked statistics
@clears
set line 200 trimspool on
set pagesize 60
col v_stats_owner new_value v_stats_owner noprint
col v_stats_table new_value v_stats_table noprint
prompt
prompt Table Owner:
set feed off term off
select upper('&1') v_stats_owner from dual;
se... |
SELECT M.movie_id, T.name
FROM "movie" as M JOIN ("movie_tag" as I JOIN "tag" as T ON I.tag_id = T.tag_id) ON M.movie_id = I.movie_id
WHERE M.movie_id = ?; |
ALTER TABLE [User]
ALTER COLUMN [Password] varchar(70) |
-- MySQL Script generated by MySQL Workbench
-- Fri Oct 9 21:20:33 2020
-- 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='ON... |
CREATE TABLE IF NOT EXISTS TBL_TRAININGS
(
COL_ID
INT
NOT
NULL
PRIMARY
KEY
AUTO_INCREMENT,
COL_TOPIC
VARCHAR
(
255
) NOT NULL,
COL_LOCATION VARCHAR
(
255
) NOT NULL,
COL_INSTRUCTOR_NAME VARCHAR
(
255
) NOT NULL
) ENGINE=INNODB; |
--Automatically detected by hibernate and will be used to seed prototype data. Can be deleted from a live project
insert into ORDERTABLE(id, description, destination) values (1, 'description', 'destination');
insert into ORDERTABLE(id, description, destination) values (2, 'test', 'test_destination');
insert into ORDER... |
declare
v_count number;
begin
select count(*) into v_count from user_tables where table_name = 'BT_WARNING_DICTIONARY';
if v_count > 0 then
update bt_warning_dictionary set rmk = '交易明细摘要' where class_id = '01' and code='11' and code_name = '支出户流入';
end if;
end;
/ |
alter table pasUsers
add AddedDate dateTime, Comments nvarchar(max),
Fk_Addedby uniqueidentifier references pasUsers(Id),
LastAccessDate datetime, AddedBy nvarchar(100)
|
/*
Designer: Liyh
Description: YW-267 update columns for db.sql
Date: 2015-04-28
*/
DELIMITER $$
CREATE
PROCEDURE UPDATE_COLUMN()
BEGIN
IF EXISTS(SELECT * FROM information_schema.columns WHERE table_name = 'estate' AND column_name = 'content')THEN
ALTER TABLE estate MODIFY content VARCHAR(4000);
END IF;
END$$... |
-- phpMyAdmin SQL Dump
-- version 4.0.10.7
-- http://www.phpmyadmin.net
--
-- Host: localhost:3306
-- Generation Time: Apr 29, 2016 at 10:09 PM
-- Server version: 5.5.48-MariaDB
-- PHP Version: 5.4.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER... |
-- phpMyAdmin SQL Dump
-- version 5.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 13, 2020 at 03:14 PM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
SELECT psdb.employees.first_name, psdb.employees.last_name, psdb.salaries.salary,psdb.salaries.from_date,psdb.salaries.to_date
FROM psdb.employees
INNER JOIN psdb.salaries ON psdb.salaries.emp_no = psdb.employees.emp_no
WHERE psdb.employees.emp_no=10006
ORDER by psdb.salaries.from_date;
|
drop table if exists customers;
drop table if exists orders;
create table customers
(
id numeric primary key,
name varchar(50),
street varchar(50),
city varchar(50),
state varchar(2),
credit_limit numeric
);
create table orders
(
id numeric primary key,
orders_date date,
id_customers numeric
);
insert into or... |
-- ***********************
-- Name: Youngeun Hong
-- ID: 159100171
-- Date: 14 May 2019
-- Purpose: Lab 1 DBS301
-- ***********************
-- Question 1 – Which one of these tables appeared to be the widest? or longest?
-- Q1 Solution --
SELECT * FROM EMPLOYEES;
SELECT * FROM DEPARTMENTS;
SELECT * FROM J... |
Create Procedure mERP_Sp_UpdateStatus_AccpDivisionAbstract (@ID int)
As
Begin
Update tbl_mERP_RecdCatAbstract Set status=32 where ID = @ID
End
|
SELECT TOP (100) PERCENT OEORDHDR_SQL.ord_no, OEORDHDR_SQL.cus_no, OEORDHDR_SQL.bill_to_name, OEORDLIN_SQL.qty_ordered,
Z_IMINVLOC.qty_on_hand, OEORDLIN_SQL.item_no, imitmidx_sql.item_desc_1, imitmidx_sql.item_note_1, OEORDHDR_SQL.ord_dt,
OEORDHDR_SQL.shipping_dt
FRO... |
create procedure sp_acc_loadactivegroup(@mode integer,@KeyField nvarchar(30)=N'%')
as
select GroupName,GroupID
from AccountGroup
where isnull([Active],0) =1
and GroupName like @KeyField
|
WITH t1 AS (
SELECT row_number() OVER (PARTITION BY pt.id ORDER BY m.create_date DESC) AS last_3_rank_status,
pt.id,
pt.name AS task_name,
date(pt.create_date) AS task_create_date,
date(m.create_date) AS msg_create_date,
replace(replace(replace(repla... |
CREATE TABLE users (
id INT IDENTITY PRIMARY KEY,
email VARCHAR(512) NOT NULL UNIQUE,
password VARCHAR(32) NOT NULL
);
CREATE INDEX uk_users_email_password
ON users (email, password);
CREATE TABLE accounts (
id INT IDENTITY PRIMARY KEY,
name VARCHAR(255),
currency VARCHAR(3),
user_... |
-- TITLE1: Apply Transactions Msg Spills
-- TITLE2: Transaction currently being applied for which the apply process has spilled messages
-- DESC: If the txn_lcr_spill_threshold apply process parameter is set to a value other than INFINITE, then an apply process can spill messages from memory to hard disk when the numbe... |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 30, 2020 at 06:52 PM
-- Server version: 10.1.39-MariaDB
-- PHP Version: 7.3.5
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE TABLE political_parties (
id INTEGER PRIMARY KEY,
name VARCHAR,
website VARCHAR,
chairman_id INTEGER
);
CREATE TABLE politicians (
id INTEGER PRIMARY KEY,
name VARCHAR,
political_party_id INTEGER REFERENCES political_parties
); |
create table product(
code number(4) constraint product_pk primary key,
name varchar2(10),
company varchar2(10),
price number(8),
qty number(4)
);
create table ibgo(
ibgo_no number(4) constraint ibgo_pk primary key,
code number(4),
ibgo_date varchar2(20),
ibgo_qty number(4),
foreign key(code) references... |
/*
Navicat MySQL Data Transfer
Source Server : 192.168.1.2_3306
Source Server Version : 50621
Source Host : 192.168.1.2:3306
Source Database : gitbucket
Target Server Type : MYSQL
Target Server Version : 50621
File Encoding : 65001
Date: 2015-04-21 11:22:15
*/
SET FOREIGN_KEY_CHEC... |
CREATE TABLE categories
(
id INT AUTO_INCREMENT
PRIMARY KEY,
parent_id INT NULL,
title VARCHAR(125) NOT NULL,
CONSTRAINT category_category_id_fk
FOREIGN KEY (parent_id) REFERENCES categories (id)
);
CREATE INDEX parent_id
ON categories (parent_id);
CREATE INDEX title
ON categorie... |
ALTER TABLE `cliente`
ADD COLUMN `cpf` varchar(11) NOT NULL;
;
|
/*
Navicat Premium Data Transfer
Source Server : 47.106.95.195
Source Server Type : MySQL
Source Server Version : 50726
Source Host : 47.106.95.195:3306
Source Schema : spring
Target Server Type : MySQL
Target Server Version : 50726
File Encoding : 65001
Date: 30/08/... |
CREATE PROCEDURE sp_compute_sovalue(@SONUMBER int)
AS
SELECT SUM(Pending * (SalePrice+(saleprice*isnull(saletax,0)/100)-((SalePrice*isnull(Discount,0))/100))) FROM SODetail WHERE SONumber = @SONUMBER
|
SELECT
e.FirstName,
e.LastName,
e.HireDate,
d.[Name] AS DeptName
FROM Employees e
JOIN Departments d ON d.DepartmentID = e.DepartmentID
WHERE e.HireDate > '01.01.1999' AND d.[Name] IN('Sales', 'Finance')
ORDER BY e.HireDate ASC |
CREATE OR REPLACE TRIGGER investors_cascade
BEFORE DELETE ON INVESTORS
FOR EACH ROW
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN
EXECUTE IMMEDIATE 'ALTER TRIGGER ONE_ENTRY_PRESENT DISABLE ';
DELETE FROM INVESTMENT_DATA WHERE INVESTOR_ID = :OLD.ID;
EXECUTE IMMEDIATE 'ALTER TRIGGER ONE_ENT... |
IF db_id('AwfulInputs') IS NOT NULL
BEGIN
USE [AwfulInputs];
CREATE TABLE [AwfulInput]
(
[ID] INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
[DateAdded] DATETIME DEFAULT GETDATE(),
[ViewName] VARCHAR(MAX),
[Description] VARCHAR(MAX),
)
CREATE TABLE [Comparison]
(
[ID] INT NOT NULL IDENTITY(1,1) PRIMARY KEY,
[DateAdde... |
#SESSION 4 ASSIGNMENT 1
USE STOREFRONT1;
/* 1. Create a function to calculate number of orders in a month. Month and year will be input parameter to function.*/
DROP FUNCTION IF EXISTS numberOfOrder ;
DROP FUNCTION IF EXISTS monthWithMaximumOrder;
DELIMITER $$
CREATE FUNCTION numberOfOrder(month int, year int) RETUR... |
select
s.EmailAddress [Email Address]
from Subscriber_Activity_Summary sas
inner join ent._Subscribers s on s.subscriberid = sas.subscriberid
where 1=1
and sas.sendCount > 3
and s.EmailAddress not like '%degdigital.com'
and not exists (
select top 1 w.*
from Daily_Frequency_Suppression_Whitelist w
where w.... |
2018-10-25 11:25:33,322 [http-nio-80-exec-1] ==> Preparing: select * from sys_user t where t.username = ?
2018-10-25 11:25:33,329 [http-nio-80-exec-1] ==> Parameters: admin(String)
2018-10-25 11:25:33,348 [http-nio-80-exec-1] <== Total: 1
2018-10-25 11:25:33,364 [http-nio-80-exec-1] ==> Preparing: insert into s... |
CREATE PROCEDURE spr_ser_list_cash_credit_customers(@CREDITID int,
@FROMDATE datetime,
@TODATE datetime)
AS
Create Table #CredittempDetail
(Customer nvarchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS,
CustomerID nvarchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS,
CustomerName varchar(150) COLLATE SQL_Lat... |
create or replace view v1_hd_zcxmsz as
select "YSNF" as DE011,"DE022","DWDM" AS JSDE955,"DE062","XMDM" AS JSDE820,bc_hd_zfjs.GetZcxmmcByDm(YSNF,DE022,XMDM) as JSDE821 from HD_ZCXMSZ;
|
------------------------------------
--Author: Jeffrey Yu
--RevisedDate: 2015-10-27
------------------------------------
select dm.Accession,
dm.Metadata.value('(/DocumentMeta/FormType)[1]','nvarchar(max)') as FormType,
dm.Metadata.value('(/DocumentMeta/CIKInfoList/CIKInfo/CIK)[1]','nvarchar(ma... |
--DROP VIEW XXMKT.XXMKT_SEQUENCES#;
/* Formatted on 7/28/2020 1:18:49 PM (QP5 v5.256.13226.35538) */
CREATE OR REPLACE FORCE EDITIONING VIEW XXMKT.XXMKT_SEQUENCES#
(
SEQ_TYPE_ID,
APPLICATION_SHORT_NAME,
SEQ_TYPE,
CURRENT_MONTH,
CURRENT_YEAR,
LAST_VALUE,
ENABLED_FLAG,
DESCRIPTION,
... |
ALTER TABLE "public"."profile" ADD COLUMN "age" integer NULL;
|
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
IF EXISTS (SELECT *
FROM sys.objects
WHERE object_id = OBJECT_ID(N'[dbo].[prc_ClientPortal_GetJob]') AND type in (N'P'))
DROP PROCEDURE [dbo].[prc_ClientPortal_GetJob]
GO
CREATE PROC [dbo].[prc_ClientPortal_GetJob]
@JobID bigint
,@Err... |
-- DROP TABLES
DROP TABLE IF EXISTS meiosis_order_products;
DROP TABLE IF EXISTS meiosis_orders;
DROP TABLE IF EXISTS meiosis_cart_products;
DROP TABLE IF EXISTS meiosis_users;
DROP TABLE IF EXISTS meiosis_products;
-- PRODUCTS
CREATE TABLE meiosis_products (
id SERIAL PRIMARY KEY,
name VARCHAR(40),
... |
/*
看板-销售排名-业务员
*/
delimiter $
drop procedure if exists Proc_Board_SalesRanking_Salesman $
create procedure Proc_Board_SalesRanking_Salesman()
begin
declare sItemName text; -- 保存销售员姓名html信息
declare sItemValue text; -- 保存销售员业绩html信息
declare sUp varchar(4000); -- 增长html标记
declare sDown... |
/*
Name: Baidu Views, Visits and visitors
Data source: 4
Created By: Admin
Last Update At: 2016-02-10T20:36:24.019817+00:00
*/
SELECT string(STRFTIME_UTC_USEC(DATE(date_time), "%m/%d/%Y")) AS date,
COUNT(visit_num) AS Views,
COUNT(DISTINCT post_visid_high + "-" + post_visid_low + "-" + visit_num) Visits,
... |
ALTER TABLE PRODUCTS
ADD description VARCHAR(255);
INSERT INTO PRODUCTS (id, name, current_price, description)
VALUES (5, 'migratedProduct', '4.10', 'migration works!'); |
-- Update for Mar-13, 2015
-- > New column for project_manager table
USE baiken_fwm_1;
--ALTER TABLE `project_manager`
-- ADD COLUMN `project_manager_is_logged` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Specifies if a given user is logged in'
--; |
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
CREATE TABLE `rapports` (
`id` integer NOT NULL,
`agence` varchar(100) NOT NULL,
`respo` varchar(100) NOT NULL,
`date_1` date NOT NULL,
`date_2` date NOT NULL,
`ch_1_n` int NOT NULL... |
CREATE TABLE IF NOT EXISTS conversions (
play_id integer,
type varchar(4),
ball_carrier varchar(7),
passer varchar(7),
pass_target varchar(7),
converted smallint
);
COPY conversions
FROM '/Users/sean.costello/Development/nfl_00-16/CONV.csv' DELIMITER ',' CSV HEADER; |
insert into Endereco (bairro, cep, cidade, complemento, estado, logradouro, ativo) values ('Calafata', '30411580', 'Belo Horizonte', 'apartamento 102', 10, 'rua da paz', true);
insert into Telefone (ddd, ddi, numero, operadora, ativo) values (31, 55, 997749131, 1, true);
insert into Usuario (dataCadastro, email, foto... |
ALTER TABLE detracciones ADD archivo_in varchar(255);
ALTER TABLE detracciones ADD archivo_out varchar(255);
|
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 29, 2018 at 06:52 PM
-- Server version: 10.1.35-MariaDB
-- PHP Version: 7.2.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
-- Shops(shop_name, description, country)
INSERT INTO Shops VALUES('Nubox', 'Singapore''s Apple Premium Reseller', 'Singapore');
INSERT INTO Shops VALUES('iStudio', 'Apple Premium Reseller for all Apple products', 'Singapore');
INSERT INTO Shops VALUES('Singtel', 'Singapore''s largest mobile network operator', 'Singap... |
CREATE DATABASE katrindb2;
CREATE TABLE IF NOT EXISTS public.sensor_data (
"time" timestamp(6) with time zone NOT NULL,
sensor_id integer,
value double precision
);
CREATE INDEX ON sensor_data(time DESC);
CREATE INDEX ON sensor_data(sensor_id, time DESC); --UNIQUE
|
-- ---------------------------------------------------------
-- Team Project for DB1 course, MovinOn Inc DataBase
-- Developed by ZOE Group
-- March 2021
-- ---------------------------------------------------------
USE movinon_zoe;
-- ---------------------------------------------------------
-- Query: 9_JobsPerPositio... |
CREATE TABLE Recipe(
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(250) NOT NULL,
serveCount int NOT NULL,
description VARCHAR(250) DEFAULT NULL,
isVeg boolean,
instructions varchar(250)
); |
select distinct(prefectural) FROM orders;
select count(*), prefectural from orders group by prefectural;
select count(*), age
from users
where age is not null
group by age
order by age;
select
max(age),
min(age),
birthplace,
(case
when gender_id = 0 then '男性'
else '... |
/*
My most used non-Informatica-specific query, though could be used against PC_REPO if needed.
Return keys/constraints present in system.
Crucial in orchestration of ETL, especially in consideration of dropping/adding keys for BULK insert procedures.
*/
SELECT cols.table_name
, cols.column_name
, cols.positio... |
-- 1076. 项目员工II
-- Table: Project
--
-- +-------------+---------+
-- | Column Name | Type |
-- +-------------+---------+
-- | project_id | int |
-- | employee_id | int |
-- +-------------+---------+
-- 主键为 (project_id, employee_id)。
-- employee_id 是员工表 Employee 表的外键。
-- Table: Employee
--
-- +------------... |
CREATE procedure sp_acc_insertaccounts(@accountname nvarchar(255),@groupid integer,
@openingbalance decimal(18,6),@additionalfield1 decimal(18,6) =0,@additionalfield2 decimal(18,6) =0,
@additionalfield3 decimal(18,6) =0,@additionalfield4 datetime =NULL,@additionalfield5 datetime =NULL,
@additionalfield6 nvarchar(30)=N'... |
-- CREATE DATABASE postgres;
-- GRANT ALL PRIVILEGES ON DATABASE postgres TO postgres;
-- CREATE SCHEMA public;
CREATE TABLE public.T_TEST
(
id SERIAL NOT NULL,
C_TEST VARCHAR(60) NOT NULL,
PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
);
|
CREATE PROCEDURE sp_get_grn
AS
SELECT DocumentID FROM DocumentNumbers WHERE DocType = 5
|
CREATE OR REPLACE TRIGGER CHECK_INVEST_AMOUNTS
FOR UPDATE OR INSERT ON INVESTMENT_DATA
COMPOUND TRIGGER
TYPE INVESTMENTS_IDS IS TABLE OF NUMBER INDEX BY PLS_INTEGER;
ids INVESTMENTS_IDS;
BEFORE EACH ROW IS
min_invest_amount NUMBER(6);
max_invest_amount NUMBER(6);
BEGIN
SELECT MIN_INVEST_AMOUNT
... |
CREATE OR REPLACE FUNCTION WXHF_GET_ACC_NBR_BY_SERV_ID(IP_serv_id IN number
,IP_PLATFORM VARCHAR2 DEFAULT NULL
,SAMPLE_LIKE VARCHAR2 DEFAULT NULL) RETURN VARCHAR2 IS
BEGIN
RETURN RMRD.WXHF_GETACC_NBR_BY_SERVID@... |
# included fragments
match (m:V_XDSIP)-[:FRAG*]->(n:F2) where (n.chac > 0 or n.hac >= 5) and apoc.text.indexOf(n.smiles, ".") < 0 with distinct n as d return d.smiles;
# excluded fragments
match (m:V_XDSIP)-[:FRAG*]->(n:F2) where (n.chac = 0 and n.hac < 6) and apoc.text.indexOf(n.smiles, ".") < 0 with distinct n as d... |
create or replace view v1_zb051_zb as
select a.jsde127,
de011,
DE151,
JSDE955,
DE042,
sum(hdde111) / count(*) as hdde111,
to_char(DE001, 'yyyy-mm-dd') as de001,
czde182,
hdde112,
nvl(hdde113, 0) as hdde113,
hdde114,
jsde940,
jsde909,
... |
create or replace package body github_oracle_content
as
function get_object_path (
object_name in varchar2
, object_type in varchar2
, object_owner in varchar2 default user
)
return varchar2
as
suffix varchar2(50) := '.sql';
full_path varchar2(1000);
begin
if object_type ... |
CREATE PROCEDURE sp_get_SRBatchSelect(@PRODUCT_CODE nvarchar(15), @InvoiceId int = 0,@SerialNo int = 0)
AS
Begin
Create Table #TmpInvBatch (Product_Code nVarchar(15) COLLATE SQL_Latin1_General_CP1_CI_AS, Batch_Code int)
IF Exists(Select 'x' From InvoiceAbstract Where InvoiceID = @InvoiceID and isnull(Status,0) & 16 <... |
-- ash masters - Kyle Hailey
/*
OUTPUT looks like:
SQL_ID CT MX MN AV MAX_RUN_TIME LONGEST_SQ 1 2 3 4 5
------------- ------ ---------- ---- -------- ----------------------------------- ---------- ------ ------ ----- ---- ---
2spgk3k0f7quz 251... |
CREATE TABLE unknowncalls
(
calldate datetime not null,
calltime datetime not null,
calltype nvarchar(50) not null,
placedto nvarchar(50) not null,
placedfrom nvarchar(50) not null,
duration float not null,
rate nvarchar(50) not null,
charge nvarchar(50) not null,
acctcode nvarchar(50) not null
); |
CREATE PROCEDURE [display].[pDel_service_offering]
AS
TRUNCATE TABLE [display].[service_offering] |
DROP TABLE Greeting IF EXISTS;
DROP TABLE Account IF EXISTS;
DROP TABLE Role IF EXISTS;
CREATE TABLE Greeting (
id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) NOT NULL,
name VARCHAR(100) NOT NULL,
PRIMARY KEY(id)
);
CREATE TABLE Account(
id BIGINT GENERATED BY DEFAULT AS IDENTITY (ST... |
drop database if exists case_db;
create database case_db;
use case_db;
create table viTri(
idViTri int primary key,
tenViTri varchar(45)
);
create table trinhDo(
idTrinhDo int primary key,
trinhDo varchar(45)
);
create table boPhan(
idBoPhan int primary key,
tenBoPhan varchar(45)
);
create table loai... |
-- creates the database hbtn_0d_usa and the table cities
CREATE DATABASE IF NOT EXISTS hbtn_0d_usa;
CREATE TABLE IF NOT EXISTS hbtn_0d_usa.cities (id INT AUTO_INCREMENT UNIQUE NOT NULL,
state_id INT NOT NULL,
name VARCHAR(256) NOT NULL,
PRIMARY KEY(id),
FOREIGN KEY(state_id) REFERENCES states(id)
);
|
-- sql-version-counts
-- Oracle 12.1+
-- Jared Still - jkstill@gmail.com
-- 2017-01-07
--@clears
set pagesize 60
set linesize 200 trimspool on
select
version_count
, sql_id
, substr(sql_fulltext,1,50) sqltext
from v$sqlstats
order by version_count desc
fetch first 10 rows with ties
/
|
select t.typeName, ISNULL(a.valueFloat, a.valueInt), at.attributeName, g.groupName
from dgmTypeAttributes a, invTypes t, dgmAttributeTypes at,
invGroups g, invCategories c
where a.typeID = t.typeID
and a.attributeID = at.attributeID
and t.groupID = g.groupID
and t.published = 1
and g.categoryID = c.categ... |
-- Looking at the InvoiceLine table, provide a query that COUNTs the number of line items for Invoice ID 37.
SELECT
count(*) as countOfItemsOnInvoiceId37
FROM InvoiceLine
WHERE
InvoiceId = 37 |
CREATE USER IF NOT EXISTS 'catalogue_user' IDENTIFIED BY 'default_password';
GRANT ALL ON socksdb.* TO 'catalogue_user';
CREATE TABLE IF NOT EXISTS sock (
sock_id varchar(40) NOT NULL,
name varchar(20),
description varchar(200),
price float,
count int,
image_url_1 varchar(40),
image_url_2 varchar(40),
... |
SELECT s.store_id, ci.city, co.country
FROM store AS S
JOIN address as a
ON a.address_id = s.address_id
JOIN city AS ci
ON ci.city_id = a.city_id
JOIN country AS co
ON co.country_id = ci.country_id |
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1:3306
-- Tiempo de generación: 01-07-2021 a las 19:59:32
-- Versión del servidor: 10.4.10-MariaDB
-- Versión de PHP: 7.3.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00... |
create table bank1(
bid int primary key,
name varchar(20),
balance int
);
create table bank2(
bid int primary key,
name varchar(20),
balance int
);
insert into bank1 values(1001,'아무무',5000);
insert into bank2 values(2001,'티모',1000);
create table test(
name varchar(20),
email varchar(20)
);... |
create table eve_blueprints(
id bigint not null primary key,
props JSON not null
) |
select * from p_programa where p_programa.codigo=24120
-- consulta bolsa vinculacion @formula hibernate
select id, ano, nombe, creditoInicial from partidas_presupuestarias where id=15
select idPPrograma, left(codigo,2), sum(creditoInicial), sum(totalTramitado), sum(totalFirme)
from partidas_presupuestarias
... |
UPDATE
quest
SET
gol = gol+1
WHERE
id= ? |
SELECT AVG(started_at - created_at) AS average_wait_time
FROM assistance_requests;
-- JOIN cohorts ON cohorts.id = cohort_id
-- JOIN assistance_requests ON students.id = student_id
-- GROUP BY cohorts.name
-- ORDER BY average_assistance_time DESC
-- LIMIT 1; |
drop table if exists dws.dwstmp_report_orders_jzzy;
CREATE TABLE dws.dwstmp_report_orders_jzzy (
date_key bigint comment '日期代理键'
,company_key bigint comment '公司代理键'
,product_key bigint comment '产品代理键'
,partner_insurance_name string comment '合作机构'
,input_info_order_num double comment '录入发生订单量'
,input_info_end_or... |
CREATE DATABASE bank
USE bank
CREATE TABLE akun(
username VARCHAR(50) PRIMARY KEY NOT NULL ,
PASSWORD VARCHAR(50)NOT NULL,
nama VARCHAR(50));
DROP TABLE akun
INSERT INTO akun VALUES( 'winda@gmail.com', '12345', 'Winda Lorenza Sinurat');
SELECT * FROM akun |
-- organizations for sync
drop table if exists sync_orgs;
create table sync_orgs(
name varchar(192) collate utf8mb4_unicode_520_ci not null,
src varchar(32) collate utf8mb4_unicode_520_ci not null,
op char(1) collate utf8mb4_unicode_520_ci not null,
last_modified datetime(6) not null default now(),
primary ke... |
use LGameDB;
drop procedure if exists _LDBI_CreateUserCore;
delimiter $$
/*retCode : 10000 账户名已经被注册*/
create procedure _LDBI_CreateUserCore (username char(20), password char(30),out retcode int)
label_return:begin
set retcode = 0;
if exists(select 1 from T_UserCore where F_UserName = username) then
... |
create table AGENCY(
AGENCY varchar2(10) not null primary key,
AGENCY_TYPE varchar2(15)
);
create table PRODUCT(
AGENCY_CODE varchar2(10) not null references AGENCY(AGENCY),
PRODUCT_NAME varchar2(40) not null ,
CONSTRAINT PK_PRODUCT PRIMARY KEY (AGENCY_CODE,PRODUCT_NAME)
);
create table DESTINATION(
DESTINATION varc... |
select count(distinct cs_order_number) as `order count`
,sum(cs_ext_ship_cost) as `total shipping cost`
,sum(cs_net_profit) as `total net profit`
from catalog_sales cs1
,date_dim
,customer_address
,call_center
where d_date between '2001-4-01' and (cast('2001-4-01' as date) + interval '60' day... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Хост: 127.0.0.1:3306
-- Время создания: Апр 01 2020 г., 00:42
-- Версия сервера: 8.0.15
-- Версия PHP: 7.0.33
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
CREATE TABLE IF NOT EXISTS scd_subscriptions (
id UUID PRIMARY KEY,
owner STRING NOT NULL,
version INT4 NOT NULL DEFAULT 0,
url STRING NOT NULL,
notification_index INT4 DEFAULT 0,
notify_for_operations BOOL DEFAULT false,
notify_for_constraints BOOL DEFAULT false,
implicit BOOL DEFAULT false,
starts_a... |
CREATE TABLE Events
(
seq_num bigserial NOT NULL,
aggregate_id bigint NOT NULL,
data jsonb NOT NULL,
event_type varchar(255) NOT NULL,
meta jsonb NOT NULL,
log_date timestamp NOT NULL DEFAULT now(),
PRIMARY KEY (seq_num)
);
CREATE INDEX idx_events_aggregate_id ON Events (aggregate_id); |
\ir '../intershop/db/update-os-env.sql'
select ¶( 'flowmatic/debugging' ) as is_debugging
\gset
\if :is_debugging
do $$ begin perform log( '44451', 'debugging' ); end; $$;
\set signal :red:reverse' ':reset :red
\else
do $$ begin perform log( '44451', 'production' ); end; $$;
\set signal :green:reverse' ':r... |
ALTER TABLE dbo.ForecastingTreeNode ADD CONSTRAINT
FK_ForecastingTreeNode_ForecastingTree FOREIGN KEY
(
TreeRef
) REFERENCES dbo.ForecastingTree
(
Id
) ON UPDATE NO ACTION
ON DELETE NO ACTION
|
-- MySqlBackup.NET 2.0.12
-- Dump Time: 2018-07-08 18:17:23
-- --------------------------------------
-- Server version 5.5.58 MySQL Community Server (GPL)
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_... |
/* Создание таблицы меню */
CREATE TABLE /*PREFIX*/MENUS
(
MENU_ID VARCHAR(32) NOT NULL,
INTERFACE_ID VARCHAR(32),
PARENT_ID VARCHAR(32),
NAME VARCHAR(100) NOT NULL,
DESCRIPTION VARCHAR(250),
PRIORITY INTEGER NOT NULL,
SHORTCUT INTEGER,
PICTURE LONGBLOB,
LEVEL INTEGER NOT NULL,
PRIMARY KEY (MENU_ID... |
create table categoria (id integer primary key
auto_increment,
descripcion varchar(80));
create table producto (id_producto integer primary key
auto_increment,id_categoria integer,
descripcion varchar(80),
foreign key (id_categoria) references catego... |
select
a.ppe,
a.Tenuregrp,
case when adds.win_nbr is not null and adds.Tenuregrp <> a.tenuregrp then 1 else 0 end as TenureShiftInd,
case when adds.win_nbr is not null and adds.Tenuregrp <> a.tenuregrp then adds.tenuregrp end as TenureShiftFrom,
a.AssocType,
case when adds.win_nbr is not null and adds.assoctype... |
# Q1
# SELECT GUIDE_NUM, LAST_NAME, FIRST_NAME, HIRE_DATE FROM GUIDE;
# Q2
# SELECT TRIP_NAME, TYPE FROM TRIP WHERE ( TYPE = 'Biking');
# Q3
#SELECT LAST_NAME, STATE FROM GUIDE WHERE ( STATE = 'MA');
# Q4
#SELECT LAST_NAME, STATE FROM GUIDE WHERE( STATE != 'MA');
# Q5
# SELECT TRIP_NAME, DISTANCE FROM TRIP WHERE ( ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.