text stringlengths 6 9.38M |
|---|
#sql("getHotStocks")
select a.* from sina_quotations as a, all_stocks as b
where a.stockTableId = b.stockTableId
order by b.checkCount desc
limit #para(hotStockCount)
;
#end
#sql("getTopSeveralFluctuationRate")
select * from sina_quotations
order by fluctuationRate desc
limit #para(topStockCount);
#end
#sql("getBotto... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: localhost (MySQL 5.5.5-10.1.37-MariaDB)
# Database: upload
# Generation Time: 2019-05-01 15:32:52 +0000
# *********************************... |
SELECT properties.id, properties.title, reservations.start_date,
properties.cost_per_night, avg(rating) as average_rating
FROM users
INNER JOIN reservations ON reservations.guest_id = users.id
INNER JOIN properties ON properties.id = reservations.property_id
INNER JOIN property_reviews ON property_reviews.property_... |
-- Series to display target species by run
-- cshannon 10/21/2013
--
-- ***Requires QryBuildReportCriteria be developed first*** (to construct table TempReportCriteria_Trapvisit)
-- ***Requires QrySamplePeriod be developed first*** (to construct table tmpSamplingSummary)
-- ***Requires QryNotFishing be developed first... |
CREATE TABLE IF NOT EXISTS test (
message varchar(255) NOT NULL
) ENGINE=INNODB DEFAULT CHARSET=utf8;
INSERT INTO test(message) VALUES('Welcome to Besent');
INSERT INTO test(message) VALUES('Your trainer Simbu');
INSERT INTO test(message) VALUES('Wish you All the best')
|
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 30, 2020 at 11:07 AM
-- Server version: 10.1.25-MariaDB
-- PHP Version: 5.6.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OL... |
CREATE DATABASE IF EXSIT population_db;
USE population_db;
DROP TABLE 'countries';
DROP TABLE 'population';
CREATE TABLE `countries` (
`code` varchar(2) NOT NULL,
`name` varchar(45) NOT NULL,
PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
CREATE TABLE `population` (
`id` INT NOT NULL AUTO_INCRE... |
-- phpMyAdmin SQL Dump
-- version 4.0.4.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 03, 2019 at 08:54 AM
-- Server version: 5.5.32
-- PHP Version: 5.4.19
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
/* user_check: email%TYPE -> integer
This function queries the database for the email to check if it
is in use */
create or replace function user_check(
d_email Account.email_addr%TYPE)
return integer as
user_count integer;
begin
select count(*)
into user_count
from Account
where email... |
use basic_employment_agency;
drop table if exists login;
create table if not exists login(
id int auto_increment,
/*cpf, matricula, cnpj*/
username varchar(64) not null unique,
password varchar(20) not null,
primary key(id)
) default charset = utf8;
drop table if exists access_level;
create table if ... |
/* Formatted on 21/07/2014 18:46:42 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.VOMCRE0_APP_SCHEDA_ANAG_GE_PC
(
COD_ABI_CARTOLARIZZATO,
COD_NDG,
COD_GRUPPO_ECONOMICO,
COD_SNDG,
VAL_PD_ONLINE,
VAL_RATING_ONLINE,
VAL_PD_MONIT_ONLINE,
VAL_RATING_MONIT_ONLINE,
VAL_IRIS,
V... |
CREATE TABLE `videos_cats` (
`id` int(11) NOT NULL auto_increment,
`name` text NOT NULL,
`img` text NOT NULL,
`cat` int(11) NOT NULL default '0',
`type` text NOT NULL,
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
CREATE TABLE `videos_data` (
`id`... |
CREATE PROCEDURE [ERP].[Usp_Validar_Transformacion_Creada_Por_Boleta]
@IdTransformacion INT
AS
BEGIN
SELECT count( cd.IdComprobante)
FROM ERP.ComprobanteDetalle cd
INNER JOIN ERP.Comprobante c ON cd.IdComprobante = c.ID
LEFT JOIN ERP.Transformacion t ON c.SerieDocumentoComprobante = SUBSTRING(T.Observacio... |
-- This is MOST of the schema and data for quiz 3
-- The actual quiz will have an additional table or two and the data might change.
-- All quizzes should have themes.
-- The theme for this quiz is: "Books that will change your life."
drop database if exists library;
create database library;
use library;
-- Book g... |
-- MySQL dump 10.13 Distrib 8.0.21, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: user_priority
-- ------------------------------------------------------
-- Server version 8.0.21
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
## 变量
-- 系统变量:
-- 全局变量:整个服务器有效
-- 会话变量:一次连接
-- 自定义变量:
-- 用户变量
-- 局部变量
-- 查看所有会话变量
SHOW VARIABLES
-- 所有全局变量
SHOW GLOBAL VARIABLES
-- 查看部分全局变量的值
SHOW GLOBAL VARIABLES LIKE '%char%'
SHOW SESSION VARIABLES
SHOW SESSION VARIABLES LIKE '%auto%'
SHOW GLOBAL VARIABLES LIKE '%auto%'
-- 查看系统变量名
-- SELECT @@va... |
CREATE PROC [ERP].[Usp_Sel_GuiaRemision_By_ID]
@IdGuiaRemision INT
AS
BEGIN
SELECT GR.ID,
GR.IdMoneda,
GR.IdTipoComprobante,
GR.IdEmpresa,
GR.IdEntidad,
GR.IdGuiaRemisionEstado,
GR.IdEstablecimiento,
GR.IdChofer,
GR.IdTransporte,
GR.IdVehiculo,
GR.IdAlmace... |
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 07, 2021 at 08:58 AM
-- Server version: 10.4.19-MariaDB
-- PHP Version: 7.3.28
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- MySQL dump 10.13 Distrib 5.7.16, for Linux (x86_64)
--
-- Host: localhost Database: xihaxueche
-- ------------------------------------------------------
-- Server version 5.7.16-1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */... |
INSERT INTO payements
VALUES ('ahmadsharifrazi@hotmail.com', 2018, 150)
INSERT INTO payements
VALUES ('schellensval@hotmail.com', 2019, 125)
|
USE codeup_test_db;
SELECT 'All albums' AS '';
SELECT * FROM albums;
UPDATE albums SET sales_number = sales_number * 10;
SELECT 'More popular albums' AS '';
SELECT * FROM albums;
SELECT 'All albums for before 1980' AS '';
SELECT * FROM albums WHERE release_date < 1980;
UPDATE albums SET release_date = 1800 WHERE re... |
create database if not exists book_booth_e;
create table users(id int primary key auto_increment, first_name varchar(10), last_name varchar(10), email varchar(30), password varchar(30), CONSTRAINT email_unique UNIQUE (email));
create table followers(email0 varchar(30), email1 varchar(30), FOREIGN KEY (email0) REFEREN... |
-- SQL Zoo Select from Nobel
1.
SELECT
yr, subject, winner
FROM
nobel
WHERE
yr = 1950;
2.
SELECT
winner
FROM
nobel
WHERE
yr = 1962
AND subject = 'Literature';
3.
SELECT
yr, subject
FROM
nobel
WHERE
winner = 'Albert Einstein';
4.
SELECT
winner
FROM
nobel
WHERE
subject = 'Peace'
AND yr >= ... |
CREATE SEQUENCE IF NOT EXISTS seq_estatistica;
CREATE TABLE IF NOT EXISTS estatistica (
id_estatistica BIGINT NOT NULL PRIMARY KEY,
tp_consulta VARCHAR(30) NOT NULL,
st_termo VARCHAR(30) NOT NULL,
dt_consulta DATE
);
|
-- Use this to create the tables needed for LaRat
SET NAMES utf8;
SET foreign_key_checks = 0;
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Table structure for table `clients`
--
CREATE TABLE IF NOT EXISTS `clients` (
`objectId` varchar(10) CHARACTER SET utf8 NOT NULL,
`carrier` varchar(... |
alter table credit_transactions add column level bigint;
alter table credit_transactions add column money_credit_rate decimal(10, 2);
alter table credit_transactions add column bonus_credit_rate decimal(10, 2);
alter table credit_transactions add column player_bonus_id bigint;
alter table credit_transactions add co... |
UPDATE `settings` SET `value` = "0.6" WHERE `key` = "version"; |
update general_image
set visibility = 0
where series_instance_uid = '1.3.6.1.4.1.9328.50.1.3';
update general_series
set visibility = 0
where series_instance_uid = '1.3.6.1.4.1.9328.50.1.3'; |
CREATE OR REPLACE TRIGGER trgEpocasNaoSobrepostas
BEFORE INSERT OR UPDATE ON epoca
FOR EACH ROW
DECLARE
sobreposicao int;
sobreposicaoEXPT EXCEPTION;
pragma AUTONOMOUS_TRANSACTION;
BEGIN
IF INSERTING THEN
SELECT count(e.id) INTO sobreposicao FROM epoca e WHERE ((e.data_ini <= :new.data_ini AND e... |
/* Database: SqlServer. Generation date: 2019-06-30 19:49:44:844 */
/* Entity Genero */
create table genero (
id UNIQUEIDENTIFIER NOT NULL,
nome VARCHAR(255) NOT NULL
);
/* Entity Diretor */
create table diretor (
id UNIQUEIDENTIFIER NOT NULL,
nome VARCHAR(255) NOT NULL
);
/* Entity Ator */
create table ator ... |
/*
Name: Scott Alton
File: clients.sql
Description: Creates the clients table used to keep track of all clients of the organization and their contact information
Date: November 18, 2020
Course: WEBD3201 - Web Development - Intermediate
*/
DROP SEQUENCE IF EXISTS client_id_seq
C... |
ALTER TABLE FIN_ENTITIES_DATA_MATRIX
ADD CONSTRAINT FK1_FIN_ENTITIES_DATA_MATRIX
FOREIGN KEY (DATA_GROUP_ID)
REFERENCES FIN_ENTITIES_DATA_GROUPS (DATA_GROUP_ID)
/
|
DROP TABLE IF EXISTS `XXX_plugin_canonical_config`; ##b_dump## |
# =============================================================================================
# Created by: Laercio Serra (laercio.serra@gmail.com)
# About this Code: script to move data from stage area to data warehouse into Hive
# =====================================================================================... |
select * from ems_adjust
select * from ems_adjustlist b
select g.id as "调拨单号",h.name as "出库仓库",i.name as "入库仓库"
,decode(g.status,'carry','在途','partin','未全入','over','完成','未知状态') "状态"
,decode(g.returnStatus,'neednot','不必归还','nonereturn','未归还','partreturn','部分归还','over','全部归还','未知状态') "归还状态"
,b.name as "小类",c.n... |
Delete from dom_forecast.dwh_demandaproyectada
where codpais||fechaproceso||codsap in
(select distinct b.codpais||fechaproceso||codsap from sbx_temp.tmp_demandaproyectada a inner join fnc_analitico.dwh_dpais b on a.codcentro = b.codcentro);
Insert Into dom_forecast.dwh_demandaproyectada
select b.codpais, ... |
--Partupdate.sql
--SET ENVIROMENTAL VARIABLES
SET FEEDBACK OFF
SET HEADING OFF
SET VERIFY OFF
--PROMPT BEGINS
COLUMN FOLDIT NEWLINE
PROMPT ********** Update Part Information **********
PROMPT
ACCEPT v_part_num NUMBER FORMAT 999 PROMPT 'Enter Part Number to Update (format 999): '
PROMPT
DEFINE v_pa... |
USE topspejder;
/************ Add Foreign Keys to Database ***************/
/*-----------------------------------------------------------
Warning: Versions of MySQL prior to 4.1.2 require indexes on all columns involved in a foreign key. The following indexes may be required:
fk_menuItems_menuItems may require... |
create database BookManagement
select AuthorID, Genre into BookManagement.dbo.AUTHOR_Genre from [MAIN].BookManagement.dbo.AUTHOR
select CustomerID, Address into BookManagement.dbo.CUSTOMERS_Address from [MAIN].BookManagement.dbo.CUSTOMERS
select * from BookManagement.dbo.AUTHOR_Genre
select * from BookManagement.dbo.CU... |
use sakila;
-- Lab | SQL Self and cross join
-- In this lab, you will be using the Sakila database of movie rentals.
-- Instructions
-- 1. Get all pairs of actors that worked together.
select a.actor_id as ActorID, b.actor_id as PartnerID, a.film_id as Film
from sakila.film_actor as a
join sakila.film_actor as b
on... |
insert into user_roles (user_id, role_id)
values
(1, 1);
|
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Oct 07, 2020 at 10:30 AM
-- Server version: 10.4.13-MariaDB
-- PHP Version: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIEN... |
-- phpMyAdmin SQL Dump
-- version 4.9.5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Jan 30, 2021 at 06:06 PM
-- Server version: 10.3.27-MariaDB
-- PHP Version: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... |
```
SELECT e.emp_no, e.first_name, e.last_name, b.btype, s.salary,
(CASE b.btype
WHEN 1 THEN s.salary * 0.1
WHEN 2 THEN s.salary * 0.2
ELSE s.salary * 0.3 END) AS bonus
FROM employees AS e INNER JOIN emp_bonus AS b ON e.emp_no = b.emp_no
INNER JOIN salaries AS s ON e.emp_no = s.emp_no AND s.to_date = '9999-01-01'
... |
SELECT A.docid,B.docid,sum(A.count*B.count)
FROM frequency A, frequency B
WHERE A.term=B.term and A.docid < B.docid and
A.docid='10080_txt_crude' and B.docid='17035_txt_earn'
group by A.docid, B.docid; |
INSERT INTO "strat_litho_wellbore_core" VALUES ('1/3-4',
1.000000,
'SHETLAND GP',
'GROUP',
TO_DATE('1983-05-08','yyyy-mm-dd'),
143,
2,
TO_DATE('2013-05-08','yyyy-mm-dd'));
INSERT INTO "strat_litho_wellbore_core" VALUES
('1/3-4',
1.000000,
'TOR FM',
'FORMATION',
TO_DATE('1983-05-08','yyyy-mm-dd'),
171,
2, ... |
-- :name report_total :one
SELECT upvote_count, downvote_count
FROM posts
where id = :id |
ALTER TABLE t_email_subject MODIFY id INT NOT NULL AUTO_INCREMENT;
|
-- phpMyAdmin SQL Dump
-- version 4.6.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 04, 2017 at 12:41 AM
-- Server version: 5.7.14
-- PHP Version: 5.6.25
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
WITH
CTE AS
(
SELECT database_name
, last_backup_start_date_time
, physical_device_name
, backup_size / (1024 * 1024) AS backup_size_MB
, compressed_backup_size / (1024 *... |
/*
* Database structure for testing
*
* In production these tables come from a remote database
*/
CREATE TYPE path_type AS ENUM ('file', 'directory', 'link');
CREATE SCHEMA rr3;
CREATE TABLE rr3.metadata (
md_hash UUID,
md_ingested TIMESTAMP WITH TIME ZONE,
md_type TEXT,
md_json JSONB,
PRIMAR... |
-- MySQL dump 10.13 Distrib 5.7.24, for osx10.14 (x86_64)
--
-- Host: localhost Database: hackerrank_challenges
-- ------------------------------------------------------
-- Server version 5.7.24
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SE... |
SELECT * FROM exceptions ; |
select *
from Models.ModelVersionsTemporal for system_time as of '2018-10-18 17:50' |
create table if not exists users(
id int auto_increment primary key,
username varchar(60),
password varchar(100),
enabled boolean default 1
);
create table if not exists AUTHORITIES(
id int auto_increment primary key ,
authority varchar(60),
authority_details varchar(200)
);
create table if not exists us... |
CREATE TABLE IF NOT EXISTS canna.farmer (
id SERIAL PRIMARY KEY,
first_name VARCHAR(150) NOT NULL,
last_name VARCHAR(150) NOT NULL,
birth_day DATE NOT NULL,
license VARCHAR(150) NOT NULL
);
CREATE TABLE IF NOT EXISTS canna.crop (
id SERIAL PRIMARY KEY,
name VARCHA... |
use clinicasj;
INSERT INTO `problemas` VALUES (1,'Dolor al calor');
INSERT INTO `problemas` VALUES (2,'Dolor al frio');
INSERT INTO `problemas` VALUES (3,'Dolor al masticar');
INSERT INTO `problemas` VALUES (4,'Sarro');
INSERT INTO `problemas` VALUES (5,'Mal aliento');
INSERT INTO `problemas` VALUES (6,'Sangrado de en... |
--jose a. asked:
--I was wondering if you can help me. I need the average daily attendance
--for the year by Gender and Overall GPA by Gender.
--this does 10-11 attendance. note that in our membership views we use the
--membership value from attendance code to day. no real rhyme or reason for
--this other than that... |
SponzaLevel {
RenderComponent {
Mesh = /Levels/Sponza/sponza.obj;
}
} |
SELECT DATE_TRUNC('year',o.occurred_at) AS year,
COUNT(DISTINCT o.account_id) AS customers,
SUM(o.gloss_qty) AS gloss_units,
SUM(o.poster_qty) AS poster_units,
SUM(o.standard_qty) AS standard_units,
SUM(o.total) AS total_units,
SUM(o.total_amt_usd) A... |
[문제79] 오라클 DB에 유저가 접속해서 작업해야 합니다.
새로운 user를 생성하세요.
유저이름 : insa
default tablespace : users
temporary tablespace : temp
users tablespace 사용량 : unlimited
create user insa
identified by insa
default tablespace users
temporary tablespace temp
quota unlimited on users;
/*
# DML~DDL (~DCL... |
create role okiniarts login password 'okiniarts';
create database okiniarts;
grant all privileges on database okiniarts to okiniarts;
create database okiniarts_test;
grant all privileges on database okiniarts_test to okiniarts;
|
SELECT *
FROM PortfolioProject..CovidDeaths$
ORDER BY 3, 4
--SELECT *
--FROM PortfolioProject..CovidVaccinations$
--ORDER BY 3, 4
SELECT location, date, total_cases, new_cases, total_deaths, population
FROM PortfolioProject..CovidDeaths$
ORDER BY 1, 2
-- Looking at total cases vs total deaths
-- Likelihood of dyi... |
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Client : localhost:3306
-- Généré le : Mar 12 Février 2019 à 16:57
-- Version du serveur : 5.7.25-0ubuntu0.18.04.2
-- Version de PHP : 7.2.10-0ubuntu0.18.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!4010... |
-- Query for PostgreSQL to generate a table with tokens for a 7 digit MRN with leading zeros
-- The tokens have no mathemetical relation with the MRN and are created again everytime this query is run
-- Query will take a fair amount of time as 10^8 rows are created
-- Andre Dekker, 09-08-2016
CREATE EXTENSION IF NOT ... |
-- 다중 if (else ~ if)
-- 점수를 입력받아 점수가 0보다 작은 경우 '0보다 작아서 실패'
-- 100보다 큰 경우 '100보다 커서 실패' / 그렇지 않은 경우 '성공'
set serveroutput on
set verify off
accept score prompt '점수: '
declare
score number := &score;
begin
dbms_output.put(score); --> 출력에 score을 써주기 위해서. 아래 식에서는 출력에 점수값이 안 나옴.
if score < 0 then
... |
/* #오류가 발생하는 항목과 내용 집계하기
*
*
*
*/
/* sample ddl*/
DROP TABLE IF EXISTS form_error_log;
CREATE TABLE form_error_log(
stamp varchar(255)
, session varchar(255)
, form varchar(255)
, field varchar(255)
, error_type varchar(255)
, value varchar(255)
);
... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50720
Source Host : localhost:3306
Source Database : book
Target Server Type : MYSQL
Target Server Version : 50720
File Encoding : 65001
Date: 2020-06-30 18:53:17
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
whenever oserror exit 1;
whenever sqlerror exit sql.sqlcode;
set serveroutput on size 1000000;
set echo on;
set time on;
alter session set "_ORACLE_SCRIPT"=true;
create user adoquery identified by adoquery;
grant connect to adoquery;
grant resource to adoquery;
grant create session to adoquery;
grant create table ... |
-- 두 수를 입력받아 더하기 연산한 결과를 out parameter에
-- 설정하는 procedure을 만들어보기로 할게요!
create or replace procedure proc_plus(num1 number,
num2 in number,
num3 out number)
is
-- parameter 명과 같은 변수는 작성할 수 없다.
-- num1 varchar2(30);
-- 변수명을 선언할 때에는 프로시저명과 다르게 설정한다.
begin
-- in parameter에는 값을 할당할 수 없다... |
ALTER TABLE beer
ADD photo VARCHAR(150) NOT NULL,
ADD content_type VARCHAR(100) NOT NULL;
|
---------------- DATA QUERY LANGUAGE -----------------
-- Let's pretend that we're a manager of a store and it's the first day at the job. We need to get some basic orientation about how the shop operates. Let's dig right in! It's gonna be my SQL practice.
-- 1. Basic operations
-- Q: How many orders have been... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: db.soic.indiana.edu Database: p565f17_prbhat
-- ------------------------------------------------------
-- Server version 5.5.56-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS... |
/* Formatted on 21/07/2014 18:34:24 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_APP_PM_PIANI_ARCH
(
COD_ABI_ISTITUTO,
COD_ABI_CARTOLARIZZATO,
COD_NDG,
COD_SNDG,
COD_FILIALE,
COD_PERCORSO,
VAL_NUMERO_PIANO,
DTA_PIANO,
DTA_SCADENZA,
DTA_VALIDAZIONE,
DTA_PIANO... |
-- 227342 "Secondary diagnosis"
-- 228106 "NonOperative Diagnoses"
-- 228107 "Elective Postoperative Diagnoses"
-- 228108 "Emergency Postoperative Diagnoses"
-- -- select distinct on (itemid) itemid, label from d_items where label ilike '%iagnos%'
-- 917 "Diagnosis/op"
-- 226740 "APACHE II Diagnosistic weight factors... |
create or replace view stk_earning_search_view as
with earning
as(
select a.* from stk_earnings_notice a,
(select code,max(fn_date) fn_date from stk_earnings_notice group by code) b
where a.code=b.code and a.fn_date=b.fn_date order by a.fn_date desc
),
holder
as(
select a.* from stk_holder a,
(select code,max(fn_date... |
DROP TABLE IF EXISTS lottery_welfare;
CREATE TABLE lottery_welfare (
id INT PRIMARY KEY NOT NULL AUTO_INCREMENT,
lottery_date VARCHAR(10) NOT NULL UNIQUE,
period VARCHAR(7) NOT NULL UNIQUE,
blue_first VARCHAR(2) NOT NULL,
blue_second VAR... |
DO $$
DECLARE
success boolean;
BEGIN
RAISE NOTICE 'Aguarde a inicialização do banco de dados...';
SELECT "Acervo"."import_csv"('exemplares-acervo.csv')
INTO success;
IF success THEN
RAISE NOTICE 'Aguarde a atualização do banco de dados...';
CALL "Acervo"."populate_db"();
... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 21, 2021 at 10:26 AM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.4.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: dbparking
-- ------------------------------------------------------
-- Server version 5.7.21-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RE... |
SELECT *
FROM
stations
WHERE
station_id = 84
|
CREATE TABLE [Staging].[Connections]
(
[ConnectionId] INT IDENTITY(1,1) NOT NULL CONSTRAINT PK_Staging_Connections PRIMARY KEY,
ConnectionName VARCHAR(255) NOT NULL CONSTRAINT UQ_Staging_Connections_ConnectionName UNIQUE,
ConnectionString VARCHAR(MAX) NOT NULL
)
|
insert into rentcloud_rent.rent(rentId, currentOdometer, customerId, rentFrom, rentTill, returnLocation, vehicleId)
values(1, 1223223, 1, now(), now(), 'REturnAddress',1); |
-- --------------------------------------------------------
--
-- Table structure for table `tbl_admin`
--
CREATE TABLE `tbl_admin` (
`id` int(11) NOT NULL,
`username` varchar(250) NOT NULL,
`password` varchar(250) NOT NULL,
`status` tinyint(1) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--... |
CREATE TABLE [crm].[destinatarios_remitentes_segmentos] (
[id_segmento] INT NOT NULL,
[id_destinatario_remitente] INT NOT NULL,
CONSTRAINT [PK_destinatarios_remitentes_segmentos] PRIMARY KEY CLUSTERED ([id_segmento] ASC, [id_destinatario_remitente] ASC) WITH (FILLFACTOR = 80),
CONSTRAINT ... |
-- phpMyAdmin SQL Dump
-- version 4.1.12
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jun 26, 2015 at 11:00 AM
-- Server version: 5.6.16
-- PHP Version: 5.5.11
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;... |
CREATE OR REPLACE VIEW "REDLINE"."PNMAC"."VW_TIMESHEETENTRIES" AS
SELECT
CASE WHEN LENGTH(trim(cvi1.value)) >= 3 THEN cvi1.value ELSE cvp.value END as itid
,pr1.id as project_id
,pr1.name as project_name
,pr1.description as project_description
,pr1.... |
create table fanfou(
id int(6) primary key auto_increment , #message id
source int(1) not null, #来源 xml=0 私信=1 微信文字=2 微信图片=3
over bool default 0, #是否发送 未发送=0 发送=1
content varchar(250) #message 长度为250字
)CHARACTER SET 'utf8' COLLATE 'utf8_general_ci';
|
-- MySQL Script generated by MySQL Workbench
-- Mon Nov 19 21:19:14 2018
-- 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... |
/*
INSERT INTO provider(first_name, last_name, address, phone_number,tax_id_number,
balance_owed, type, email) VALUES (
'Jamie',
'Douglas',
'82 Broadway, \n New York, NY 10018',
5552536464,
3948346323,
0.00,
'cardiologist',
'jdouglas@medifirst.com'
);
INSERT INTO provider(first_nam... |
create table dash_availability_check
( id BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1, INCREMENT BY 1) PRIMARY KEY, entity_ref varchar(255) not null,
entity_type_id varchar(255) not null, scheduled_time timestamp(6) not null);
create unique index dash_availability_check_idx on dash_availability_check(enti... |
SELECT id_combo, count(*) FROM states GROUP BY id_combo HAVING count(*) > 1 ORDER BY count(*) |
-- 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... |
ALTER TABLE log_agent_undertaken ADD company_amount DECIMAL(11,2) NOT NULL DEFAULT 0.00 COMMENT '公司承担费用' AFTER amount;
ALTER TABLE log_agent_undertaken ADD `log_agent_settled_id` int(11) UNSIGNED NULL DEFAULT 0 COMMENT '代理佣金结算ID' AFTER agent_id;
ALTER TABLE log_player_rebate_financial_flow_new ADD `settled_type` TINY... |
create table cit_change_info (
change_id int unsigned not null primary key auto_increment,
lecture_id int unsigned not null,
begin_date timestamp not null,
end_date timestamp not null,
room_id int unsigned,
created timestamp not null,
modified timestamp not null
); |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Servidor: 127.0.0.1
-- Tiempo de generación: 13-10-2020 a las 23:24:34
-- Versión del servidor: 10.4.13-MariaDB
-- Versión de PHP: 7.4.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_... |
/*
Programming for Data Science with Python Nanodegree
Udacity's certified program > SQL practice > Lesson 3 : SQL Aggregations
Find the total dollar amount of sales using the 'total_amt_usd' in
the 'orders' table.
*/
SELECT SUM(o.total_amt_usd) total_dollar_amount
FROM orders o;
|
drop table SYS_USER_DEPART;
-- Create table
create table SYS_USER_DEPART
(
USER_ID NUMBER(11),
DEPART_ID NUMBER(11)
);
-- Add comments to the table
comment on table SYS_USER_DEPART
is '用户部门关联表';
-- Add comments to the columns
comment on column SYS_USER_DEPART.USER_ID
is '用户id';
comment on column S... |
-- MySQL dump 10.13 Distrib 8.0.13, for Win64 (x86_64)
--
-- Host: localhost Database: studia
-- ------------------------------------------------------
-- Server version 8.0.13
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
SELECT SubcategoryName
, COUNT(*) as RecordCount
FROM #src |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.