text stringlengths 6 9.38M |
|---|
/*
* sanitizeWord
* Inverted Index Toolkit <http://code.google.com/p/inverted-index/>
* Apache License 2.0, blah blah blah.
*/
DROP FUNCTION IF EXISTS sanitizeWord;
DELIMITER ;;
CREATE FUNCTION `sanitizeWord`(_word VARCHAR(128)) RETURNS VARCHAR(128)
NO SQL
DETERMINISTIC
/*
* Returns a tidied-up word, r... |
SELECT TOP 0
AddressID,
AddressLine1,
AddressLine2,
City,
StateProvinceID,
PostalCode,
ModifiedDate
INTO dbo.Address
FROM AdventureWorks2012.Person.Address
ALTER TABLE dbo.Address
ADD CONSTRAINT PK_StateProvinceId_PostalCode PRIMARY KEY (StateProvinceId, PostalCode);
ALTER TABLE dbo.Address
ADD CONSTRAI... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: inventory_system
-- ------------------------------------------------------
-- Server version 5.5.5-10.3.8-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 06, 2021 at 07:39 PM
-- 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... |
SELECT SUM(SALARY) SOMA, MIN(SALARY) MENOR, MAX(SALARY) MAIOR, TRUNC(AVG(SALARY),2) MEDIA
FROM EMPLOYEES;
SELECT SUM(E.SALARY) SOMA, MIN(E.SALARY) MENOR,
MAX(E.SALARY) MAIOR, TRUNC(AVG(E.SALARY),2) MEDIA
FROM EMPLOYEES E
INNER JOIN DEPARTMENTS D
USING(DEPARTMENT_ID)
WHERE UPPER(D.DEPARTMENT_NAME) = UPPER(... |
create table movies
(
id serial4 primary key,
title varchar(1000),
poster text,
year varchar(4),
released varchar(25),
director varchar(80),
actors varchar(250),
writers varchar(250)
);
|
alter table tbl_user add column secret_key varchar(255);
INSERT IGNORE INTO mst_secu_types(`id`,`type_code`) VALUES(1,'BANK_ACCOUNT_DETAILS');
INSERT IGNORE INTO mst_secu_types(`id`,`type_code`) VALUES(2,'CREDENTIALS'); |
/*
* View: statements_with_errors_or_warnings
*
* List all normalized statements that have raised errors or warnings.
*
* mysql> select * from statements_with_errors_or_warnings limit 5;
* +-------------------------------------------------------------------+-----------+------------+--------+-----------+----------... |
create schema customer_app;
use customer_app;
show tables;
create table customer(
id bigint(10) not null auto_increment,
`first_name` varchar(120) not null,
`last_name` varchar(120) not null,
`phone` varchar(10) not null,
`email` varchar(120) not null,
`address` varchar(120) not null,
created_at datetime not null,
u... |
SELECT 'projects: PID-->ID' AS FD, CASE WHEN COUNT(*)=0 THEN 'Gildir' ELSE 'Gildir ekki' END AS VALIDITY
FROM(
SELECT PID
FROM projects
GROUP BY PID
HAVING COUNT(DISTINCT ID) > 1
) X;
|
SELECT SEASON, AVG(AGE)
FROM PLAYER_TOTAL
WHERE TEAM <> "" AND SEASON BETWEEN 2002 AND 2011
GROUP BY SEASON;
SELECT season, team_id, AVG(experience),
SUM((experience-(SELECT AVG(experience) FROM teamsroster WHERE season between 2002 AND 2011))*
(experience-(SELECT avg(experience) FROM teamsroster WH... |
SELECT FirstName , LastName
FROM Employees
WHERE NOT DepartmentID = 4 |
CREATE TABLE COUNTRY (
Code CHAR(3) DEFAULT '',
Name CHAR(52) DEFAULT '',
Continent CHAR(13) DEFAULT 'Asia',
Region CHAR(26) DEFAULT '',
SurfaceArea NUMBER(10,2) DEFAULT '0.00',
IndepYear NUMBER(6) DEFAULT NULL,
Population NUMBER(11) DEFAULT '0',
LifeExpectancy NUMBER(3,1) DEFAULT NULL,
GNP NUMBER(10,... |
ALTER TABLE Dependent
ADD CONSTRAINT dependent_essn_FK
FOREIGN KEY(essn)
REFERENCES Employee(ssn)
ON DELETE CASCADE;
|
CREATE TABLE sponsors
(
id SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
imagesrc VARCHAR(255) NOT NULL,
width SMALLINT UNSIGNED NOT NULL,
height SMALLINT UNSIGNED NOT NULL,
name VARCHAR(255) NOT NULL,
url VARCHAR(1024) NOT NULL,
enabled BOOL DEFAULT TRUE NOT NUL... |
-- phpMyAdmin SQL Dump
-- version 4.0.4
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 05, 2014 at 08:22 PM
-- Server version: 5.6.12-log
-- PHP Version: 5.4.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT ... |
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Aug 26, 2020 at 02:50 PM
-- Server version: 5.7.28-0ubuntu0.16.04.2
-- PHP Version: 7.2.25-1+ubuntu16.04.1+deb.sury.org+1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!... |
# TEST PRODUIT
INSERT INTO `produit`
(`label_produit`)
VALUES ( :nom );
|
--Select basics
--1
SELECT population FROM world
WHERE name = 'Germany'
--2
SELECT name, population FROM world
WHERE name IN ('Sweden', 'Norway', 'Denmark');
--3
SELECT name, area FROM world
WHERE area BETWEEN 200000 AND 250000
--
--Select names
--1
SELECT name FROM world
WHERE name LIKE 'Y%'... |
SELECT
COUNT(*)
FROM
edges e1,
edges e2,
edges e3,
edges e4,
edges e5,
edges e6
WHERE
e1.sink = e4.source
AND e1.sink = e5.source
AND e1.source = e2.source
AND e1.source = e3.source
AND e2.sink = e4.sink
AND e2.sink = e6.source
AND e2.source = e3.source
AND e3.sink = e5.s... |
/*
Navicat MySQL Data Transfer
Source Server : naive
Source Server Version : 50716
Source Host : localhost:3306
Source Database : shopping
Target Server Type : MYSQL
Target Server Version : 50716
File Encoding : 65001
Date: 2017-05-29 01:40:42
*/
SET FOREIGN_KEY_CHECKS=0;
-- ----... |
DROP TABLE IF EXISTS `t_plan`;
DROP TABLE IF EXISTS `t_team_user`;
DROP TABLE IF EXISTS `t_wish_list`;
DROP TABLE IF EXISTS `t_user`;
DROP TABLE IF EXISTS `t_team`;
CREATE TABLE IF NOT EXISTS `t_user`(
`id` VARCHAR(36) NOT NULL COMMENT '表主键',
`create_time` BIGINT COMMENT '添加时间',
`update_time` BIGINT COMMENT '更新时... |
/*
Navicat Premium Data Transfer
Source Server : Mysql Local
Source Server Type : MySQL
Source Server Version : 50724
Source Host : localhost:3306
Source Schema : andon_polymodel
Target Server Type : MySQL
Target Server Version : 50724
File Encoding : 65001
Date: 01/... |
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
RETURN (
# Write your MySQL query statement below.
select distinct salary as getNthHighestSalary
from Employee E
where N-1=(select count(distinct salary) from Employee E2 where E2.Salary > E.Salary)
);
END
|
-- phpMyAdmin SQL Dump
-- version 4.9.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Oct 19, 2020 at 09:51 AM
-- Server version: 10.4.10-MariaDB
-- PHP Version: 7.4.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET... |
/*
################################################################################
Migration script to trim all RS_IDs of tabs, carriage returns and leading and
trailing white spaces that were previously obscured by other characters
Designed for execution with Flyway database migrations tool; this should be
automati... |
INSERT INTO Musteri (Ad, Soyad, TCKN) VALUES
('Ahmed', 'GÜNEYSU', '11122233344'),
('Tuncay', 'KOZAK', '11122233344'),
('Fırat', 'KÜÇÜKERDEN', '11122233344')
|
DROP DATABASE IF EXISTS week1_workshop;
CREATE DATABASE week1_workshop;
-- connect via psql
\c week1_workshop
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
SET default_tablespace... |
INSERT INTO `HPDBSpring`.`account_state` (`id`, `account_state`) VALUES (1, 'Confirmation email not sent');
INSERT INTO `HPDBSpring`.`account_state` (`id`, `account_state`) VALUES (2, 'Confirmed');
INSERT INTO `HPDBSpring`.`account_state` (`id`, `account_state`)
VALUES (3, 'Deactivated(email confirmation not received o... |
DROP TABLE IF EXISTS CRYSTAL.STG_JMETER_REPORTS;
DROP TABLE IF EXISTS CRYSTAL.STG_JMETER_REPORTS_JSON;
DROP TABLE IF EXISTS CRYSTAL.OPE_JMETER_EXECUTION_PLAN;
DROP TABLE IF EXISTS CRYSTAL.OPE_JMETER_REPORTS;
DROP TABLE IF EXISTS CRYSTAL.DM_DIM_YEARS;
DROP TABLE IF EXISTS CRYSTAL.DM_DIM_MONTHS;
DROP TABLE IF EXISTS CRYS... |
/*删除商城数据库,如果存在*/
drop database if exists shop;
/*创建数据库,并设置编码*/
create database shop default character set utf8;
use shop;
/*删除管理员表*/
drop table if exists account;
/*删除商品类别表*/
drop table if exists category;
/*删除商品信息表*/
drop table if exists product;
/*============================*/
/* Table: 管理员表结构 */
/*===========... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4541
#
# http://www.sequelpro.com/
# https://github.com/sequelpro/sequelpro
#
# Host: 127.0.0.1 (MySQL 5.7.18)
# Database: slim
# Generation Time: 2017-06-26 08:34:24 +0000
# **************************************************... |
INSERT INTO customer(first_name, last_name)
VALUES
(U&'{bcrypt}\00242a\002410\0024lBm1Qy45bR/fNT5i5OUBseNPcONtZs10earjLZ773qq.byhK/yKmS', 'Unicode escape as workaround'); |
-- SOLUCION PREGUNTAS --
--Pregunta N1, Evaluaciones por curso:
select id_curso, sala_clases , count (id_evaluacion) as "Cantidad Evaluaciones"
from curso
left join eval_por_curso using (id_curso)
group by id_curso, sala_clases
order by id_curso;
--Pregunta N2, Cursos sin evaluaciones:
select id_curso, sa... |
USE hr;
DELIMITER $$
DROP PROCEDURE IF EXISTS BuscarMediaPorCategoriaDeTrabalho $$
CREATE PROCEDURE BuscarMediaPorCategoriaDeTrabalho(IN JobID VARCHAR(300))
BEGIN
SELECT
ROUND(AVG(SALARY), 2) AS media
FROM hr.employees
GROUP BY JOB_ID
HAVING JOB_ID = JobID;
END $$
DELIMITER ;
CALL BuscarMediaPorCategor... |
USE demographics
/*
--The following statements can be used to empty tables before loading, if desired.
TRUNCATE TABLE StageStaffDemographics
TRUNCATE TABLE StageStudentDemographics
TRUNCATE TABLE StageSchoolGeography
TRUNCATE TABLE FactStaff
DELETE FROM DimSchoolYear
DELETE FROM DimSchool
ELETE FRO... |
-- MySQL dump 10.13 Distrib 5.7.26, for Linux (x86_64)
--
-- Host: localhost Database: Restaurant
-- ------------------------------------------------------
-- Server version 5.7.26-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER... |
/* (10 points) Find the day of the week with the longest average arrival delay.
Return the name of the day and the average delay.
Name the output columns day_of_week and delay, in that order.
(Hint: consider using LIMIT. Look up what it does!)
[Output relation cardinality: 1 row] */
SELECT
W.day_of_week as day... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jul 07, 2019 at 10:53 AM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
... |
DELIMITER $$
USE `cci_gh_go_qa`$$
DROP PROCEDURE IF EXISTS `SPHostFamilyApplicationContactInformation`$$
CREATE DEFINER=`madhavi`@`%` PROCEDURE `SPHostFamilyApplicationContactInformation`(IN hostfamilyId INT,IN ssId INT,IN deptprgmId INT)
BEGIN
DECLARE hfId,sId,dpId INT;
SET @hfId = hostfamilyId... |
-- 3.7 - Determining whether Two Tables Have the Same Data --
(select "EMPNO", "ENAME", "JOB", "MGR", "HIREDATE", "SAL", "COMM", "DEPTNO", count(*) as cnt
from V2
group by "EMPNO", "ENAME", "JOB", "MGR", "HIREDATE", "SAL", "COMM", "DEPTNO"
EXCEPT
select "EMPNO", "ENAME", "JOB", "MGR", "HIREDATE", "SAL", "COMM", "DEP... |
CREATE TABLE dashboard
(
USER_ID VARCHAR(36),
TYPE TEXT,
X SMALLINT NOT NULL DEFAULT 0,
Y SMALLINT NOT NULL DEFAULT 0,
WIDTH SMALLINT NOT NULL DEFAULT 0,
HEIGHT SMALLINT NOT NULL DEFAULT 0,
SHOW BOOL NOT NULL DEFAULT TRUE,
PRIMARY KEY (USER_ID, TYPE),
FOREI... |
create table Faculty(
id_fac int primary key not null,
name_fac nvarchar(max) not null
)
create table Doctor(
id_doc int primary key not null,
name_doc nvarchar(max) not null,
id_fac int FOREIGN KEY REFERENCES Faculty(id_fac)
)
create table Patient(
id_pat int primary key not null,
name_pat nvarchar(max) not null,
id_d... |
BEGIN TRANSACTION;
CREATE TABLE login(
id serial primary key,
username text unique not null,
hash varchar(100) not null
);
COMMIT; |
-- GET COMPANY FROM USER_TRANSACTION
SELECT b.id_company, b.name_company, b.code_company
FROM user_transaction AS a
LEFT JOIN company AS b ON FIND_IN_SET (b.id_company, a.id_company)
WHERE a.id_user = '1';
-- GET PLANT FROM USER_TRANSACTION
SELECT b.id_plant, b.code_plant, b.name_plant
FROM user_transaction AS a
LEFT ... |
-- Constante para saber se é primeira instalação ou não!
DEFINE PRIMEIRA_INSTALACAO = S
-- Define para sigla do país
DEFINE SIGLA_PAIS = BR
-- Constante do usuário sombra
DEFINE USUARIO_SOMBRA_USER = SSFWV12
DEFINE USUARIO_SOMBRA_PASS = SFWV12
-- Constante do Role Softway
DEFINE ROLE_SOFTWAY = RSFWV12
-- Constantes p... |
SET SERVEROUTPUT ON;
CREATE OR REPLACE PROCEDURE atualizarSalario
(id_empregado employees.employee_id%TYPE,
salario employees.salary%TYPE)
IS
maximo NUMBER;
invalid_salary EXCEPTION;
atual NUMBER;
BEGIN
SELECT MAX(salary) INTO maximo
FROM employees WHERE job_id =
(SELECT job_id F... |
DROP DATABASE IF EXISTS covid19db;
CREATE DATABASE covid19db;
USE covid19db;
CREATE TABLE examples
(
id INT(11)
AUTO_INCREMENT PRIMARY KEY,
text VARCHAR
(255),
description TEXT,
createdAt DATETIME,
updatedAt DATETIME,
name TEXT,
city TEXT,
state TEXT,
price TEXT
)
|
alter table project add column creator_id uuid;
alter table project add foreign key ("creator_id") REFERENCES "user" ("id");
create index on project
("creator_id");
|
select * from theater;
select * from standard_seat;
select * from member;
select * from book;
select * from ON_SCREEN;
/*번호, 예매번호, 예매수, 결제일시, 총가격, 환불가능여부*/
select b.book_number, b.personnel, b.payment_date, to_char(b.movie_start,'yyyy-mm-dd hh24:mm') movie_start, t.screen_price*b.personnel total_price, to_char(sysdat... |
CREATE PROCEDURE [HomeAura].[UserRead]
@userId uniqueidentifier
AS
SELECT UserId, Username, Email
FROM HomeAura.Users
WHERE (UserId = @userId or @userId is null) and IsDeleted = 0;
RETURN 0
|
CREATE TABLE Equipments (
EquipmentsId CHAR(5) NOT NULL,
EquipmentsName VARCHAR(100) NOT NULL,
Stock SMALLINT DEFAULT 0,
EquipmentsPrice INTEGER DEFAULT 0,
PRIMARY KEY(EquipmentsId)
) ENGINE = InnoDb;
CREATE TABLE Customers (
CustomersId CHAR(5) NOT NULL,
CustomersName... |
SELECT m.ModelId,
m.Name,
CAST(AVG(DATEDIFF(day, j.IssueDate, j.FinishDate)) AS VARCHAR)
+' days' AS 'Average Service Time'
FROM Models AS m
FULL JOIN Jobs AS j
ON j.ModelId = m.ModelId
--WHERE j.Status = 'Finished'
GROUP BY m.ModelId, m.Name
ORDER BY AVG(DATEDIFF(day, j.IssueDate, j.FinishDate)) |
CREATE DATABASE MSO
USE MSO
CREATE TABLE TBL_CUSTOMER
(
CUST_ID_CUS INT IDENTITY(100001, 1) PRIMARY KEY,
FNAME_CUS VARCHAR(50) NOT NULL,
LNAME_CUS VARCHAR(50) NOT NULL,
DOB_CUS DATE NOT NULL DEFAULT '01/01/2000',
PHONE_CUS CHAR(12) DEFAULT '000-0000-000',
EMAIL_CUS VARCHAR(70) UNIQUE
)
CREATE TABL... |
insert into employee
values
('John','B','Smith',123456789,'1965-01-09','731 Fondren, Houston TX','M',30000,333445555,5),
('Franklin','T','Wong',333445555,'1965-12-08','638 Voss, Houston TX','M',40000,888665555,5),
('Alicia','J','Zelaya',999887777,'1968-01-19','3321 Castle, Spring TX','F',25000,9... |
--
-- Copyright 2017 The Regents of the University of Colorado
--
-- 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
--
-- ... |
/*
################################################################################
Migration script to update WEEKLY_CURATOR_TOTALS_SUMMARY_VIEW
Designed for execution with Flyway database migrations tool; this should be
automatically run to completely generate the schema that is out-of-the-box
compatibile with the ... |
'
' Post cc5 PB_common.inc
FUNCTION funAppendToFile(strFilePathToAddTo AS STRING, strData AS STRING) AS LONG
' append strData to the file if it exists or create a new one if it doesn't
DIM intFile AS INTEGER
DIM strError AS STRING
'
intFile = FREEFILE
TRY
IF ISTRUE ISFILE(strFilePathToAddTo) THEN
OP... |
CREATE OR REPLACE FORCE VIEW "VND"."VW_ELO_AGENDAMENTO_WEEK_PLAN"
( CD_ELO_AGENDAMENTO_WEEK,CD_ELO_AGENDAMENTO_ITEM,NU_SEMANA,QT_COTA,QT_SEMANA,QT_EMERGENCIAL, IC_AJUSTE ) AS
WITH CTE_ITEM_FU AS (
SELECT ITEM.CD_ELO_AGENDAMENTO_ITEM, IWEEKING.CD_ELO_AGENDAMENTO_WEEK
/*, ITEM.CD_ELO_AGENDAMENTO_SUPERVISOR, ITEM.C... |
use pharmacy
select client.id_client, client.[name]
from client order by [name] desc
select client.id_client, client.[name]
from client order by [name] asc
select medicine_group.medgroup, count(medicine.medicine)
from medicine inner join medicine_group
on medicine.id_group=medicine_group.id_group
group by med... |
-- how many certs used weak keys in both scans?
select count(*) from
(select * from ssl.valid_certs natural join {
select certid as nid
from blacklist
natural join valid_key_hashes
) as x
where `Serial Number` not in (select `Serial Number` from ssl.revoked)) as prev_vuln
join
(select * from ... |
-- phpMyAdmin SQL Dump
-- version 3.5.5
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Mar 22, 2013 at 12:02 PM
-- Server version: 5.1.68-cll
-- PHP Version: 5.3.17
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */... |
CREATE TABLE stats (
id Serial PRIMARY KEY,
Time timestamp with time zone NOT NULL,
customer text NOT NULL,
content text NOT NULL,
cdn bigint NOT NULL,
p2p bigint NOT NULL);
CREATE INDEX customer_index
ON stats (customer);
CREATE INDEX content_index
ON stats (content);
|
-- --------------------------------------------------------
-- Хост: 127.0.0.1
-- Версия сервера: 5.5.41-log - MySQL Community Server (GPL)
-- ОС Сервера: Win32
-- HeidiSQL Версия: 8.3.0.4694
-- --------------------------------------------------------... |
select
id as account_salesforce_id,
name as account_name,
lab_id_c as account_lab_id,
sap_id_c as account_sap_id,
principal_investigator_c as principal_investigator_salesforce_id,
_fivetran_synced as _data_loaded_ts_utc
from {{ target.name }}_ingest.stemcell__salesforce.account |
spool run.log
@create.sql
@reset_prefs
@anal
@update
@flush_dbms_stats
@show_stale
@anal_global
@anal
@set_prefs
@update
@flush_dbms_stats
@show_stale
@anal_global
@anal
spool off
|
# noinspection SqlNoDataSourceInspectionForFile
-- phpMyAdmin SQL Dump
-- version 4.6.6deb5
-- https://www.phpmyadmin.net/
--
-- Host: localhost:3306
-- Generation Time: Nov 07, 2017 at 03:23 PM
-- Server version: 5.7.20-0ubuntu0.17.10.1
-- PHP Version: 7.1.8-1ubuntu1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Servidor: localhost:8889
-- Tiempo de generación: 02-12-2019 a las 10:26:41
-- Versión del servidor: 5.7.26
-- Versión de PHP: 7.3.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
--
-- Base de datos: `box`
--
-- ------... |
SELECT distinct(BillingCountry), count(*)as Invoices FROM Invoice
GROUP BY BillingCountry
ORDER BY Invoices DESC; |
create extension citext;
create extension pgcrypto;
create table auths (
id bigserial primary key not null,
pass text not null,
email citext not null unique,
email_verification_code text not null,
is_email_verified boolean not null
); |
/* create tables */
create table beds
(
id int not null unique auto_increment comment 'id',
room_id int not null comment 'room_id',
created_at datetime not null comment 'created_at',
updated_at datetime not null comment 'updated_at',
name char(30) comment 'name',
primary key (id)
) comment = 'beds';
... |
-- создаем базу данных (с проверкой на существование)
CREATE DATABASE IF NOT EXISTS example;
-- проверяем, что она появилась
SHOW DATABASES;
-- подключаемся к созданной БД
USE example
-- создаем таблицу с 2 столбцами по ТЗ
CREATE TABLE IF NOT EXISTS users (id INT, name VARCHAR(50));
-- проверяем, что таблица появил... |
/*(10 points) Find all airlines that had more than 0.5% (= 0.005) of their flights
out of Seattle canceled. Return the name of the airline
and the percentage of canceled flights out of Seattle.
Percentages should be outputted in percent format (3.5% as 3.5 not 0.035).
Order the results by the percentage of cance... |
CREATE PROC [ERP].[Usp_Sel_Marca]
AS
BEGIN
SELECT MA.ID,
MA.Nombre,
MA.FechaRegistro,
MA.FechaEliminado
FROM [Maestro].[Marca] MA
WHERE MA.Flag = 1 AND MA.FlagBorrador = 0
END |
CREATE USER IF NOT EXISTS "backend";
CREATE USER IF NOT EXISTS "backend-dev";
CREATE USER IF NOT EXISTS "migrate" PASSWORD "MIGRATE_PASS";
CREATE USER IF NOT EXISTS "roach-ui" PASSWORD "ROACH_UI_PASS";
GRANT admin TO "roach-ui";
CREATE DATABASE IF NOT EXISTS app;
GRANT SELECT,INSERT,UPDATE,DELETE ON DATABASE app TO "ba... |
CREATE table terminations
(
termination_id serial primary key,
emp_id integer,
reason varchar(240),
termination_date date
last_name varchar(180),
first_name varchar(180),
position varchar(180),
doe date,
profile_pic text,
phone varchar(80);
);
alter table terminations
ADD COLUMN... |
-- 部门运维人员录入表
CREATE TABLE `department_maintainer` (
`department_id` int(8) NOT NULL COMMENT '部门ID',
`department_name` varchar(50) NOT NULL COMMENT '部门名称',
`ops_user` varchar(300) NOT NULL COMMENT '运维人员',
PRIMARY KEY (`department_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- 血缘分析信号告警表
CREATE TABLE if NOT EXISTS... |
DROP TABLE IF EXISTS emis_local_codes;
CREATE TABLE emis_local_codes (
local_code VARCHAR(20) NOT NULL COLLATE utf8_bin,
local_term VARCHAR(400),
code_type VARCHAR(50),
PRIMARY KEY emis_local_codes_pk (local_code, local_term),
INDEX emis_local_codes_code_idx (local_code)
) ENGINE=InnoDB DEFA... |
CREATE TABLE [ERP].[AsientoDetalle] (
[ID] BIGINT IDENTITY (1, 1) NOT NULL,
[IdAsiento] INT NULL,
[Orden] INT NULL,
[IdPlanCuenta] INT NULL,
[Nombre] VARCHAR (250) NULL,
[IdDebeHaber... |
-- CreateTable
CREATE TABLE "Comment" (
"id" TEXT NOT NULL PRIMARY KEY,
"postId" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"content" TEXT NOT NULL
);
-- CreateTable
CREATE TABLE "Upvote" (
"id" TEXT NOT NULL PRIMARY KEY,
"commentId" TEXT NOT NULL,
"userId" TEXT NOT NULL,
CONSTRAINT "Upvote... |
CREATE TABLE IF NOT EXISTS parts (
productId SERIAL PRIMARY KEY,
prodImage TEXT,
prodName TEXT,
prodDesc TEXT,
price DECIMAL(5,2)
) |
-- ----------------------------
-- Table structure for t_user
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
`FuiId` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`FstrUsername` varchar(128) DEFAULT '' COMMENT '邮箱',
`FstrPassword` varchar(64) DEFAULT '' COMMENT '密码... |
# --- !Ups
CREATE TABLE REVISION_ENTRIES (
id BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
copyRevision BIGINT,
path VARCHAR(512) NOT NULL,
resourceType INT NOT NULL,
revisionID BIGINT NOT NULL,
entryType INT NOT NULL,
copyPath VARCHAR(512),
repoI... |
UPDATE
--延滞情報
DELAYED_INFO
SET
--回収ステータス
WITHDRAW_STATUS =
(CASE WHEN WITHDRAW_RESULT_AMOUNT > 0
THEN
CAST(/*dto.withdrawStatusPart*/'2' AS CHAR(1))
ELSE
CAST(/*dto.withdrawStatusNo*/'0' AS CHAR(1))
END)
,ACCOUNT_FILE_CREAT_FLG = CAST(/*dto.requstFileCreatFlgOff*/'0' AS CHAR(1))
... |
USE codeup_test_db;
DROP TABLE IF EXISTS albums;
CREATE TABLE albums (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
artist varchar(100) NOT NULL,
name varchar(100) NOT NULL,
release_date int NOT NULL,
sales FLOAT,
genre varchar(50) NOT NULL,
PRIMARY KEY (id)
); |
--@Autor: Berdejo Arvizu Oscar || Olmos Cruz Edwin
--@Fecha creación: 25/10/2018
--@Descripción: Creacion De indices
--Usuario Admin: baoc_proy_admin
--Usuario Invitado: baoc_proy_invitado
Prompt Otorgando permisos a baoc_proy_invitado para leer tablas
Prompt de baoc_proy_admin
prompt conectando a usuario baoc_proy_a... |
-- NOTIFICATIONS
-- Firm Conveyancing
INSERT INTO
public."NotificationConstructTemplate"
(
"NotificationConstructTemplateID",
"NotificationConstructTemplateVersionNumber",
"Name",
"Description",
"DefaultNotificationExportFormatID",
"DefaultNotificationDeliveryMethodID",
"NotificationConstructMutator... |
/*
Navicat Premium Data Transfer
Source Server : Dev_MySql
Source Server Type : MySQL
Source Server Version : 80023
Source Host : 172.29.112.172:10087
Source Schema : loonflow
Target Server Type : MySQL
Target Server Version : 80023
File Encoding : 65001
Date: 25/02/... |
-- --------------------------------------------------------
-- 호스트: 127.0.0.1
-- 서버 버전: 10.5.5-MariaDB - mariadb.org binary distribution
-- 서버 OS: Win64
-- HeidiSQL 버전: 11.0.0.5919
-- -------------------------------------------... |
CREATE TABLE dbo.FoodTrucks
(
FoodTruckId INT IDENTITY(1,1) NOT NULL,
TruckName VARCHAR(50) NOT NULL,
Description VARCHAR(512) NOT NULL,
Website VARCHAR(100) NULL,
RowValidFrom DATETIME2(3) GENERATED ALWAYS AS ROW START,
RowValidTo DATETIME2(3) G... |
CREATE DEFINER=`root`@`localhost` FUNCTION `AsignarEntrenador`() RETURNS int(11)
BEGIN
declare id int;
declare min int;
#Encuentra la cantidad minima de usuarios que tiene un entrenador
select min(cantidad_usuarios) as "minimo" from entrenadores into min;
#Selecciona a un solo entrenador que tenga la cantidad ... |
ALTER TABLE `gallery_user` ADD COLUMN `bPrivate` BOOL NOT NULL |
DELIMITER //
DROP PROCEDURE IF EXISTS SP_HEATING_CONSUMPTION;
CREATE PROCEDURE SP_HEATING_CONSUMPTION(startDate DATE, endDate DATE)
BEGIN
DECLARE nightTariff, dayTariff DECIMAL(5,2);
SELECT day INTO dayTariff
FROM tariff
ORDER BY date desc
LIMIT 1;
SELECT night INTO nightTariff
FROM tariff
ORDER BY date de... |
CREATE TABLE `spl_summary` (
`site_id` int(16) NOT NULL default '0',
`booking_id` int(16) NOT NULL default '0',
`play_date` date NOT NULL default '0000-00-00',
`plays` bigint(21) NOT NULL default '0',
PRIMARY KEY (`site_id`,`booking_id`,`play_date`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
set lines 150 pages 200
set serveroutput on
declare
h1 number; -- Data Pump job handle
i number; -- Loop index
v_job_state varchar2(30); -- To keep track of job state
v_sts ku$_Status; -- Status object returned by get_status
v_js ku$_JobStatus; -- Job s... |
select * from localvariables where setting like '%hawaii%' ;
update localvariables set setting = 'https://authn.hawaii.edu/cas/' where attribute = 'LOCALSECURITY';
update localvariables set setting = 'https://login.its.hawaii.edu/cas/' where attribute = 'LOCALSECURITY';
select * from localvariables where attribute l... |
SELECT "r"."title", "r"."text", "r"."reviewDate", "p"."nr", "p"."name", "r"."rating1", "r"."rating2", "r"."rating3", "r"."rating4"
FROM "review" "r", "person" "p"
WHERE "r"."product" < 1000 -- r.product=247
AND "r"."person"="p"."nr"
AND "r"."language"='en'; |
SELECT top 1
TAX_RATE_MST.START_DATE,
TAX_RATE_MST.TAX_ID,
CODE_MASTER.CODE_NAME AS TAX_NAME,
TAX_RATE_MST.TAX_RATE,
TAX_RATE_MST.MODIFY_USER,
TAX_RATE_MST.MODIFY_DATE
FROM TAX_RATE_MST
LEFT JOIN CODE_MASTER
ON CODE_MASTER.CODE_TYPE = CAST(/*fTaxRateKbn*/ AS CHAR(3))
AND CODE_MASTER.CODE_ID = TAX_RATE_MST.TAX... |
SQL assignment 2
1.WAQ to display all the details of the software developer in dept 30.
->select * from employee where job_type ="Software developer" and dept_no =30;
2.WAQ to display the list for all the software developer in dept number 40 and having salary
greater than 5000.
->Select * from employee where job_type ... |
CREATE TABLE abrechnungswochen (
id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
von DATE NULL,
bis DATE NULL,
zahltag DATE NULL,
abr_woche INTEGER UNSIGNED NULL,
abr_monat INTEGER UNSIGNED NULL,
abr_jahr INTEGER UNSIGNED NULL,
PRIMARY KEY(id)
);
CREATE TABLE aktionen (
id INTEGER UNSIGNED NOT NULL AUTO... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.