text stringlengths 6 9.38M |
|---|
DROP TABLE CAMPAPI;
CREATE TABLE CAMPAPI(
CONTENTID NUMBER PRIMARY KEY,
CAMPLATITUDE VARCHAR2(1000),
CAMPLONGTITUDE VARCHAR2(1000),
CAMPNAME VARCHAR2(1000) NOT NULL
); |
DROP TABLE IF EXISTS `crypto_transactions`;
CREATE TABLE `crypto_transactions` (
`id` char(36) COMMENT 'id',
`customer_user_id` char(36) DEFAULT NULL COMMENT 'User id',
`amount` decimal(12,6) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Amount',
`source_wallet_address` varchar(128) COMMENT 'Wallet Address',
`tar... |
DROP TABLE IF EXISTS sleep_records;
CREATE TABLE sleep_records
(
sleep_id INT(11) PRIMARY KEY AUTO_INCREMENT,
record_date BIGINT NOT NULL,
start_time int(11) DEFAULT NULL,
end_time int(11) DEFAULT NULL,
duration int(11) DEFAULT NULL
);
DROP TABLE IF EXISTS weight_records;
CREATE TABLE weight_records
... |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 03, 2019 at 02:45 PM
-- Server version: 10.1.37-MariaDB
-- PHP Version: 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
update harmony.tuser set user_type_id = 1 where user_type_id is null;
commit;
|
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 50717
Source Host : 127.0.0.1:3306
Source Schema : database0
Target Server Type : MySQL
Target Server Version : 50717
File Encoding : 65001
Date: 01/07/2019 ... |
--Problem 9.Write a SQL query to find all departments and
--the average salary for each of them.
SELECT d.Name, AVG(Salary) AS [Average Salary]
FROM Employees e JOIN Departments d
ON e.DepartmentID = d.DepartmentID
GROUP BY e.DepartmentID, d.Name
ORDER BY d.Name |
-- Update the 'DescriptionAlternate' attribute to large text
-- Delete 'date_created' from displayProperties
UPDATE "DisplayProperties"
SET "Value" = 'large text'
WHERE "PropertyName" = 'DescriptionAlternate' AND "Attribute" = 'ComponentType';
DELETE FROM "DisplayProperties" WHERE "PropertyName" = 'date_created';
CO... |
create or replace view v_sel_attrvalue as
select s.sel53_em_addr,c.crtserie_em_addr,c.num_crt_serie,c.val_crt_serie,c.lib_crt_serie
from selcrt s, crtserie c
where s.crtserie54_em_addr=c.crtserie_em_addr;
|
# Write your MySQL query statement below
# use self join
select t1.team_name as home_team, t2.team_name as away_team
from Teams t1, Teams t2
where t1.team_name <> t2.team_name
|
-- Thanks to kldxzzhc3 fix making this fixes :)
-- Me for updating them and making them work.
-- Sighfinder for the awsome core :P
-- Fix alot of DB errors in the core.
-- DB Error Fix's for creature --
UPDATE creature SET movementtype = 0 WHERE guid IN (7616,3344,3343,137997,138004,137990,137970,137849,137885,1378... |
DROP TABLE IF EXISTS asignatura; SET FOREIGN_KEY_CHECKS=0;
CREATE TABLE `asignatura` (
`idasignatura` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(45) NOT NULL,
`idestado` int(11) NOT NULL,
PRIMARY KEY (`idasignatura`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
INSERT INTO asignatura VALUES("... |
-- 06/11/2018 - Service fee when shipping
ALTER TABLE `costs` ADD `order_id` INT(11) NULL AFTER `import_id`; |
--特殊的内连接 自连接查询 自连接 左手拉右手 自己连接自己
create table city(
id int UNSIGNED PRIMARY key AUTO_INCREMENT not null,
atitle VARCHAR(30) not null,
pid int UNSIGNED DEFAULT NULL
);
INSERT into city values
(0,'广东省',null),(0,'河南省',null),
(0,'深圳市',1),(0,'广州市',1),
(0,'南山区',3),(0,'宝安区',3);
--查看有多少个省
select count(*) from city... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 9.6.6
-- Dumped by pg_dump version 9.6.6
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min... |
CREATE TABLE public.usuario
(
usuario character varying(15) NOT NULL,
contrasenia character varying(15),
CONSTRAINT "pk_Usuario" PRIMARY KEY (usuario)
);
CREATE TABLE public.prestador
(
nombre character varying(20),
apellidos character varying(20),
correo character varying(25),
calificacion integer,
usu... |
CREATE TYPE MedianGroup AS (
group_nr smallint,
row_count integer,
start_time bigint,
end_time bigint,
median double precision
); |
-- +migrate Up
CREATE TABLE IF NOT EXISTS reminders(
id INTEGER PRIMARY KEY AUTOINCREMENT,
content TEXT,
chat_id INTEGER,
created DATETIME
);
-- +migrate Down
DROP TABLE reminders;
|
DROP TABLE IF EXISTS `XXX_papoo_google_maps_tabelle`; ##b_dump## |
USE `dentists_dsusa_site`;
CREATE OR REPLACE VIEW `user_count_and_city_population` AS
SELECT COUNT(*) AS `user_total`, SUM(`d`.`population`)
FROM `user_company_info` AS `u`
LEFT JOIN`data_locations` AS `d` ON (
`u`.`city` = `d`.`city_name` AND `u`.`state` = `d`.`state_abbr`
) GROUP BY `u`.`state`,`u`.`city`
/* get us... |
CREATE PROC ERP.Usp_Ins_TipoDocumentoEntidad
@IdEntidad INT,
@IdTipoDocumento INT,
@NumeroDocumento VARCHAR(20)
AS
BEGIN
INSERT INTO ERP.EntidadTipoDocumento(IdEntidad,IdTipoDocumento,NumeroDocumento)
VALUES (@IdEntidad , @IdTipoDocumento, @NumeroDocumento);
SELECT CAST(SCOPE_IDENTITY() AS INT);
END |
CREATE DATABASE usuario;
CREATE TABLE usuario(
id SERIAL NOT NULL,
nome VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
senha VARCHAR(255) NOT NULL,
CONSTRAINT USUARIO_ID_PK PRIMARY KEY(id)
);
CREATE TABLE jogadores(
id SERIAL NOT NULL,
nome VARCHAR(255) NOT NULL,
chute INT NOT NULL,
passe INT NOT NULL,
... |
CREATE TABLE IF NOT EXISTS league (
id BIGSERIAL NOT NULL PRIMARY KEY,
name JSONB NOT NULL,
description JSONB NOT NULL,
admins BIGINT[] NOT NULL
);
CREATE TABLE IF NOT EXISTS league_player (
league_id BIGINT NOT NULL,
player_id BIGINT NOT NULL,
PRIMARY KEY(league... |
CREATE TABLE [CoreModel].[PolicyDocuments] (
[PolicyDocumentId] INT IDENTITY (1, 1) NOT NULL,
[PolicyId] INT NOT NULL,
[DocumentId] UNIQUEIDENTIFIER NOT NULL,
CONSTRAINT [PK_PolicyDocuments] PRIMARY KEY CLUSTERED ([PolicyDocumentId] ASC),
CONSTRAINT [FK_Polic... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: myproject
-- ------------------------------------------------------
-- Server version 5.7.19-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS *... |
-- This is the BuildReportCriteria_Releases query. This is different from the
-- BuildReportCrietria for regular catches.
DROP TABLE TempReportCriteria_Release;
SELECT Release.projectDescriptionID,
Release.releaseID,
Site.siteName,
Site.siteID,
Release... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: May 28, 2018 at 09:59 AM
-- Server version: 10.1.24-MariaDB
-- PHP Version: 7.1.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
create database chat;
CREATE TABLE `messages` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` text NOT NULL,
`user` varchar(45) DEFAULT NULL,
`messagedate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=latin1 |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: final
-- ------------------------------------------------------
-- Server version 5.7.19-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
use stu_manage
insert into department_info(dept_id,dept_name, dept_dean, dept_teacher_amount) values
('01','Computer Science','Ni',50),
('02','Electronic Computing Engineering','Zhang',50),
('03','Software Engineering','Yi',50);
select*from department_info; |
CREATE TABLE version_set
(
id INT NOT NULL AUTO_INCREMENT,
md5 CHAR(32) NOT NULL,
json VARCHAR(4096) NOT NULL,
created_on datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
);
CREATE UNIQUE INDEX idx_md5 ON version_set (md5);
|
/* Extracts Braden Score chartevent data, removing unnecessary columns to make the data file smaller */
select
chartevents.subject_id,
chartevents.hadm_id,
chartevents.icustay_id,
chartevents.charttime as charteventsCharttime,
chartevents.cgid as caregiverID,
chartevents.itemid as charteventsItemid,
chartevents.... |
-- phpMyAdmin SQL Dump
-- version 4.6.5.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 10, 2019 at 06:43 PM
-- Server version: 10.1.21-MariaDB
-- PHP Version: 7.1.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET... |
ALTER TABLE `editors_autoapprovalsummary`
MODIFY `has_auto_approval_disabled` tinyint(1) NOT NULL,
MODIFY `is_recommendable` tinyint(1) NOT NULL,
MODIFY `should_be_delayed` tinyint(1) NOT NULL,
DROP FOREIGN KEY `version_id_refs_id_6d27bb3c`, /* (`version_id`) REFERENCES `versions` (`id`) */
ADD CONS... |
-- query3
SELECT count(*)
FROM (SELECT c.weekdate
FROM hw2.sales c
JOIN (SELECT weekdate
FROM hw2.holidays
WHERE isholiday = 'f') d ON c.weekdate = d.weekdate
GROUP BY c.weekdate
HAVING sum(weeklysales) > (SELECT avg(sumsales)
FROM ... |
-- 登录系统
#mysql -h 主机 -P 端口 -u root -p
#mysql -h 主机 -P 端口 -u root -p密码
# 密码与p之间不得有空格,其他项之间可以有
# 常量
SELECT 6;
# 字符常量
SELECT 'a';
SELECT "aaa";
#表达式
SELECT 100*98;
#函数
SELECT VERSION();
SELECT DATABASE()
SELECT USER()
# 别名
SELECT 'A' AS B
SELECT 'A' B
select last_name as 姓, last_name as 名 FROM employees
... |
.ifndef INCLUDED_CYFITTERGNU_INC
.set INCLUDED_CYFITTERGNU_INC, 1
.include "cydevicegnu.inc"
.include "cydevicegnu_trm.inc"
/* LCD_LCDPort */
.set LCD_LCDPort__0__INTTYPE, CYREG_PICU2_INTTYPE0
.set LCD_LCDPort__0__MASK, 0x01
.set LCD_LCDPort__0__PC, CYREG_PRT2_PC0
.set LCD_LCDPort__0__PORT, 2
.set LCD_LCDPort__0__SHIF... |
-- phpMyAdmin SQL Dump
-- version 4.2.11
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 06, 2015 at 12:16 PM
-- Server version: 5.6.21
-- PHP Version: 5.6.3
INSERT INTO `thunder_cloud_databag_item` (`id`, `databag_category`, `item_name`, `item_column`, `default_value`) VALUES
(1, 'db_passwo... |
create or replace package app_logger_sql
/**
* Project: app_util<br/>
* Description: Generate sql to work with logger tables.
* <p>Features:</p>
* <code>
* 1. SQL to reate logger tables <br/>
* 2. SQL to insert into logger tables <br/>
* </code>
* @author Vinhpt
* @headcom
*/
as
/*
* Global attributes
*/
/... |
alter table S_ZhiKa
add
Z_SalesStatus int not null Default ((0)),
Z_SalesType int not null Default ((0)),
Z_TriangleTrade int not null Default ((0)),
Z_OrgAccountNum varChar(20),
Z_XSQYBM varChar(10) ,
DataAreaID varChar(3) not null DEFAULT ('dat'),
D_Blocked int not null default((0)),
... |
.read sql/create_tbl.sql
.read sql/sampleData.sql
.read sql/testUser.sql
|
create PROCEDURE [ERP].[Usp_Sel_TipoDocumento_By_NumeroDocumento]
@NumeroDocumento VARCHAR(250)
AS
BEGIN
SELECT
ET.NumeroDocumento
FROM ERP.EntidadTipoDocumento ET INNER JOIN ERP.Entidad E
ON ET.IdEntidad = E.ID
INNER JOIN [PLE].[T2TipoDocumento] TD
ON TD.ID = ET.IdTipoDocumento
WHERE ET.NumeroDocumento... |
SELECT
race, count(id) AS count
FROM demographics
GROUP BY race
ORDER BY count DESC; |
-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 03-Jun-2019 às 21:06
-- Versão do servidor: 10.1.38-MariaDB
-- versão do PHP: 7.3.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
/*
atnd_alt.sql
pvddl newsdc atnd_alt.sql -server w1
pvddl newsdc atnd_alt.sql -server w2
pvddl newsdc atnd_alt.sql -server w3
pvddl newsdc atnd_alt.sql -server w4
pvddl newsdc atnd_alt.sql -server w6
pvddl newsdc atnd_alt.sql -server w7
pvddl newsdc atnd_alt.sql -server w5
Alter Table Atnd (
add StartTm Time ... |
#DATEDIFF(Date d1,Date d2) : return d1-d2
#DATE_ADD(Date d,interval 1 day) : return d1+1day
#MySQL에서 아래의 두 쿼리는 같은 동작을 하나, INNER JOIN 을 사용하는것이 가독성에는 더 좋다.
#INNER JOIN : intersection, OUTER JOIN : Union
#A LEFT OUTER JOIN B: A의 모든 열 더하기 B에 있는 공통부분
#A RIGHT OUTER JOIN B: B의 모든 열 더하기 A에 있는 공통부분
#A FULL OUTER JOIN B: A와B의 합... |
CREATE TABLE users
(
id BIGINT NOT NULL
PRIMARY KEY,
username VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
first_name VARCHAR(100) NULL,
last_name VARCHAR(100) NULL,
password VARCHAR(255) NOT NULL,
is_active ... |
-- duasrodas.Atividades definition
CREATE TABLE `Atividades` (
`idAtividades` int(11) NOT NULL AUTO_INCREMENT,
`activityId` varchar(60) NOT NULL,
`usuario` varchar(60) NOT NULL,
`cracha` varchar(45) NOT NULL,
`email` varchar(60) NOT NULL,
`data` varchar(30) NOT NULL,
`descricao` varchar(200) DEFAULT 'no ... |
/*
SQLyog Ultimate v12.09 (64 bit)
MySQL - 5.6.20 : Database - gestor_solicitudes
*********************************************************************
*/
/*!40101 SET NAMES utf8 */;
/*!40101 SET SQL_MODE=''*/;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN... |
SELECT Name AS Customers
FROM Customers
WHERE
Id NOT IN (SELECT DISTINCT CustomerId FROM Orders);
|
USE regalonatural; DELETE FROM regalonatural.ps_order_history;
INSERT INTO `ps_order_history` VALUES (109,0,70,2,'2018-03-23 15:33:25');
INSERT INTO `ps_order_history` VALUES (110,2,70,3,'2018-03-23 17:46:47');
INSERT INTO `ps_order_history` VALUES (111,2,70,4,'2018-03-26 10:54:10');
INSERT INTO `ps_order_history` VALU... |
select a.user_id
, a.user_nick
, a.xrwq
, a.exesag
, a.brand
, a.cpu
, a.xagawef
, a.qwgqwer
, b.os
, b.os_version
, b.resolution
, a.count
, a.day_count
, a.last_time
, a.first_time
, ip
from (select user_id
, max(user_nick) user_nic... |
-- MySQL Script generated by MySQL Workbench
-- 09/17/15 14:27:12
-- 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='TRADITION... |
drop schema ims;
CREATE SCHEMA IF NOT EXISTS `ims`;
USE `ims` ;
CREATE TABLE IF NOT EXISTS `ims`.`customers` (
`customer_id` INT(11) NOT NULL AUTO_INCREMENT,
`first_name` VARCHAR(40)NOT NULL,
`surname` VARCHAR(40)NOT NULL,
PRIMARY KEY (`customer_id`)
);
CREATE TABLE IF NOT EXISTS `ims`.`items` (
... |
set serveroutput on;
create or replace procedure proc2(c_id IN int)
is
totalBill int;
finalBill int;
total int;
begin
select pur_amount INTO total from purchase@site_link INNER JOIN customer@site_link ON purchase.pur_cust_id=customer.cust_id where pur_cust_id=c_id;
if total<1000 then
totalBill:=total;
finalBill:=... |
CREATE OR REPLACE FUNCTION zerobyte.ZEROBYTE_TO_TIMESTAMP(a ARRAY< STRUCT< _ STRUCT< INT64 > > >)
AS (
TIMESTAMP_MICROS(zerobyte.ZEROBYTE_TO_INT64(a))
);
|
--乐尚团购CMS,Version:1.0
--Mysql VERSION:5.5.20
--Create time:2014-03-13 21:58:46
DROP TABLE IF EXISTS `cms_admin`;
CREATE TABLE `cms_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`adm_name` varchar(255) NOT NULL,
`adm_password` varchar(255) NOT NULL,
`status` tinyint(1) NOT NULL,
`is_delete` tinyint(1) NOT... |
DROP TABLE IF EXISTS routines_units;
CREATE TABLE routines_units (
id smallserial PRIMARY KEY,
name varchar(16) NOT NULL UNIQUE,
created_on timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_by int NOT NULL,
updated_on timestamp,
updated_by int
);
INSERT INTO routines_units (
name,
created_by
)
VAL... |
use employees;
select *
from employees
where first_name in ('irena','vidya','maya')
order by first_name;
select * from employees
where first_name in ('irena','vidya','maya')
order by first_name asc, last_name asc;
select * from employees
where first_name in ('irena','vidya','maya')
order by last_name asc, fi... |
DROP TABLE IF EXISTS tbCustomers;
CREATE TABLE tbCustomers
(
customer_id INTEGER PRIMARY KEY AUTOINCREMENT,
customer_name TEXT,
address TEXT
);
DROP TABLE IF EXISTS tbOrders;
CREATE TABLE tbOrders
(
order_id INTEGER PRIMARY KEY AUTOINCREMENT,
customer_id INTEGER,
subscription_id INTEGER,
purchase_date ... |
INSERT INTO CREDIT_TYPE VALUES (0, 'F');
INSERT INTO CREDIT_TYPE VALUES (1, 'D');
INSERT INTO CREDIT_TYPE VALUES (2, 'D');
INSERT INTO CREDIT_TYPE VALUES (3, 'C');
INSERT INTO CREDIT_TYPE VALUES (4, 'C');
INSERT INTO CREDIT_TYPE VALUES (5, 'C');
INSERT INTO CREDIT_TYPE VALUES (6, 'D');
INSERT INTO CREDIT_TYPE VALUES (7... |
--------------------------------------------------------
-- File created - Wednesday-September-06-2017
--------------------------------------------------------
--------------------------------------------------------
-- DDL for Sequence USER_INCREMENT
--------------------------------------------------------
CR... |
CREATE VIEW best_strategys AS
SELECT
name AS 'Название',
Profit,
prosadka,
risk_profile,
users.nik,
COUNT(clients_strategy.users_id) AS investors
FROM strategy
LEFT JOIN scores ON scores.id = strategy.score_id
LEFT JOIN users ON users.id = scores.user_id
JOIN clients_strategy ON strategy_id = strategy.id
... |
Hypothetically
The company president is looking to increase revenue. As a prelude to his
decision making, he asks for two numbers: the amount of expected income from
"big ticket" services (those services that cost more than $100) and the maximum
income the company could achieve if it managed to convince all of its cus... |
DROP DATABASE IF EXISTS TestingSystem;
CREATE DATABASE TestingSystem;
USE TestingSystem;
DROP TABLE IF EXISTS Department;
CREATE TABLE Department(
DepartmentID TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
DepartmentNAME VARCHAR(20) NOT NULL UNIQUE KEY
);
DROP TABLE IF EXISTS Position;
CREATE TABLE Position ... |
# --- !Ups
ALTER TABLE Chapitre ADD delai_sa_type varchar(50);
ALTER TABLE Chapitre ADD delai_sa_min integer;
ALTER TABLE Chapitre ADD delai_sa_max integer;
ALTER TABLE Chapitre ADD delai_sa_unite varchar(50);
# --- !Downs
ALTER TABLE Chapitre DROP delai_sa_unite;
ALTER TABLE Chapitre DROP delai_sa_max;
ALTER TABLE ... |
--1
SELECT * FROM QUIZZ WHERE quizz_id='1';
--2
SELECT * FROM QUIZZ;
--3
SELECT category_id, quizz_theme FROM CATEGORIES
INNER JOIN QUIZZ ON CATEGORIES.quizz_id = QUIZZ.quizz_id WHERE ;
--4
SELECT * FROM CATEGORIES;
--5
SELECT * FROM CATEGORIES WHERE quizz_id='1';
--6
SELECT * FROM QUESTIONS;
--7
SELECT * FROM QU... |
create table REPORT_EXECUTION (
ID varchar2(32) not null,
CREATE_TS timestamp,
CREATED_BY varchar2(50 char),
--
REPORT_ID varchar2(32),
REPORT_NAME varchar2(255 char) not null,
REPORT_CODE varchar2(255 char),
USER_ID varchar2(32) not null,
START_TIME timestamp not null,
FINISH_TIME timestamp,
IS_... |
ALTER TABLE shippinglist
ADD CONSTRAINT shippinglist_required CHECK (
sl_jsonb ? 'cl_id'
AND sl_jsonb ? 'zo_id'
AND sl_jsonb ? 'wo_id'
AND sl_jsonb ? 'sl_createdby'
);
ALTER TABLE shippinglist
ADD CONSTRAINT shippinglist_valid_types CHECK (
jsonb_typeof(sl_jsonb->'cl_id')='number'
AND jsonb_typeof(sl_jsonb-... |
-- ConverterTest
create table withBigInt( anumber BIGINT);
create table Person (id bigint, first VARCHAR(100), last VARCHAR(100)) |
DROP TABLE IF EXISTS tblPerson;
CREATE TABLE tblPerson (
intPersonID int(11) NOT NULL AUTO_INCREMENT,
intRealmID int(11) NOT NULL DEFAULT 0,
strExtKey varchar(20) NOT NULL DEFAULT '''',
strPersonNo varchar(15) NOT NULL DEFAULT '',
strNationalNum varchar(30) DEFAULT '',
strFIFAID varchar(30) de... |
create database bamazon;
use bamazon;
create table products (
item_id int not null auto_increment primary key,
product_name varchar(100),
department_name varchar(45),
price decimal(65, 2),
stock_quantity int(10)
);
insert into products (product_name, department_name, price, stock_quantity)
values ("ream of paper", "... |
use juxta_ws;
INSERT INTO `juxta_schema_version` (`major`, `minor`, `micro`)
VALUES
(1, 7, 10);
INSERT INTO `juxta_workspace` (`id`, `name`, `description`)
VALUES
(1, 'public', 'Default public workspace');
INSERT INTO `text_qname` (`id`, `local_name`, `namespace`)
VALUES
(1, 'add', 'http://www.tei-c.org/ns... |
-- phpMyAdmin SQL Dump
-- version 5.0.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Apr 28, 2021 at 01:29 PM
-- Server version: 10.4.14-MariaDB
-- PHP Version: 7.2.34
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
INSERT INTO execution_job (id,
price_token,
`description`,
execution_type,
workerpool,
worker,
deal_id ,
deal_blockchain_identifier... |
CREATE TABLE `turnero` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`fecha_creacion` datetime DEFAULT NULL,
`habilitado` tinyint(1) DEFAULT NULL,
`idusuario` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `turnero_consultorio` (
`id` int(11) NOT NULL AUTO_INCREMENT... |
SELECT
CASE WHEN currents.SCORING_CARD_CODE IS NOT NULL
THEN
--当期.分类名称
currents.SCORING_CARD_GROUP
WHEN previous.SCORING_CARD_CODE IS NOT NULL
THEN
--上期.分类名称
previous.SCORING_CARD_GROUP
WHEN lastPrevious.SCORING_CARD_CODE IS NOT NULL
THEN
--上上期.分类名称
lastPrevious.SCORING_CARD_GROUP
END AS SCOR... |
PARAMETERS [@FechaIniID] Text ( 255 ), [@FechaFinID] Text (255);
SELECT A.NroRegistro,
E.Tipo,
C.Cuenta,
F.PagoMedioNombre,
D.RazonSocial,
cdate(format(A.FechaOperacionID,"####-##-##")) AS FechaOperacion,
cdate(format(A.FechaProcesoID,"####-##-##")) AS FechaProceso,
A.... |
DROP TABLE IF EXISTS test;
CREATE TABLE test (
id INT AUTO_INCREMENT PRIMARY KEY,
username varchar(64),
password varchar(64)
);
INSERT INTO test (username, password) VALUES
('username', 'password'), ('anothername', 'wordpass'); |
CREATE EXTERNAL DATA SOURCE Hadoop
WITH (
TYPE = HADOOP,
LOCATION = 'hdfs://192.168.1.100:8050'
)
CREATE EXTERNAL FILE FORMAT TextFile
WITH (
FORMAT_TYPE = DelimitedText,
FORMAT_OPTIONS (FIELD_TERMINATOR = '|')
);
CREATE EXTERNAL TABLE dbo.FactResellerSalesArchiveExternal (
[ProductKey] [int] NOT ... |
create PROC [ERP].[Usp_Sel_AjusteCuentaPagar_By_ID]
@ID INT
AS
BEGIN
SELECT ACC.ID
,ACC.Documento
,ACC.Fecha
,TC.Nombre NombreTipoComprobante
,C.Serie
,C.Numero
,M.Nombre NombreMoneda
,ACC.Total
,ACC.TipoCambio
,E.Nombre NombreEntidad
,ACC.UsuarioRegistro
,AC... |
--@Autor(es): Hector Espino Rojas, Néstor Martínez Ostoa
--@Fecha creación: 15/06/2020
--@Descripción: Trigger para validar la hora en la que se inserta un pase de abordar.
set serveroutput on;
create or replace trigger trg_pase_abordar
before insert or update of id_vuelo, id_pase_abordar on lista_pasajeros... |
-- Base de donnée de Morix
--
-- Vidange de la base de données.
--
-- @author Matthias Brun
--
-- Utilisation de la base morix
USE morix;
-- Suppression des enregistrements de la table Produit.
delete from Produit;
|
DROP DATABASE IF EXISTS poo_agenda;
CREATE DATABASE poo_agenda;
\c poo_agenda; -- conectar
DROP TABLE IF EXISTS contatos;
CREATE TABLE contatos (
codigo SERIAL PRIMARY KEY,
nome VARCHAR(20) NOT NULL,
sobrenome VARCHAR(20) NULL,
telefone VARCHAR(20) NULL
);
INSERT INTO contatos VALUES ... |
CREATE TABLE IF NOT EXISTS file (
id uuid,
fileNo text,
title text,
tag text,
uploadDate timestamp,
status boolean,
PRIMARY KEY(id)
);
|
CREATE PROCEDURE dbo.Contactos_Insert
@Nombre nchar(50),
@Direccion nchar(100),
@Mail nchar(50)
AS
BEGIN
INSERT INTO Contactos (Nombre,Direccion,Mail)
VALUES(
@Nombre,
@Direccion,
@Mail
);
SELECT CAST(scope_identity() AS int);
END
|
CREATE TABLE polaznici (
kor_ime varchar(10) NOT NULL DEFAULT '',
ime varchar(25) NOT NULL DEFAULT '',
prezime varchar(25) NOT NULL DEFAULT '',
lozinka varchar(20) NOT NULL DEFAULT '',
email_adresa varchar(40) NOT NULL DEFAULT '',
vrsta int NOT NULL DEFAULT 1,
datum_kreiranja timestamp NOT NULL DEFAULT CU... |
INSERT INTO burgers (burger_name, devoured)
VALUES ("Triple Stack Burger", false),
("Veggie Burger", false),
("Sweet & Spicy Burger", false);
|
-- joins: select all the computers from the products table:
-- using the products table and the categories table, return the product name and the category name
-- select p.name, c.name from products as p
-- inner join categories as c on c.categoryID = p.categoryID
-- where c.categoryID = 1
-- joins: find a... |
SELECT
T1.CONTRACT_ID --T1.买卖关联ID
, T1.CURRENCY_ID --T1.币种
, T1.PAYEE_ACCOUNT_NO --T1.卖方收款账号
, T1.ACTUAL_PAYMENT_TOTAL --T1.实际付款总额
, T1.MODIFY_DATE --T1.系统时间
, T5.SELLER_NAME --T2.卖方名称
, T1.PAYMENT_SCHEDULE_DATE --T1.放款付款预定日
, T1.UNPAID_MANAGEMENT_FEE_TOTAL --T1.未收管理费总额
... |
-- pb avec cle client donc renomer PK_eMailUtilisateur => PK_eMailUtilisateur1
DROP TABLE TirageImages;
DROP TABLE Tirage;
DROP TABLE TypePapier;
DROP TABLE FormatPapier;
DROP TABLE TarifFormat;
DROP TABLE Commande;
DROP TABLE TarifDegressif;
DROP TABLE Laboratoire;
DROP TABLE Notation;
DROP TABLE Image;
DROP TABLE ... |
-- AlterTable
ALTER TABLE "users" ADD COLUMN "title" TEXT,
ADD COLUMN "description" TEXT;
|
ALTER TABLE `previews`
DROP INDEX `previews_caption_f5d9791a_fk_translations_id`,
DROP INDEX `previews_addon_id_320f2325_fk_addons_id`;
|
-- phpMyAdmin SQL Dump
-- version 5.1.1
-- https://www.phpmyadmin.net/
--
-- Anamakine: 127.0.0.1
-- Üretim Zamanı: 07 Eyl 2021, 16:54:12
-- Sunucu sürümü: 10.4.19-MariaDB
-- PHP Sürümü: 8.0.7
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=... |
/* Add the model 4444 with code=22, speed=1200 and price=1350 into the PC table.
The absent features should be supplied with the default values for corresponding columns.*/
INSERT INTO PC (code, model, speed, price) VALUES(22, 4444, 1200, 1350)
|
DROP TABLE IF EXISTS `PHONE_NETWORK_HALFHOUR_BK`;
CREATE TABLE `PHONE_NETWORK_HALFHOUR_BK` AS
SELECT
`active_count`,
`software_version`,
`external_model`,
`group_title`,
`summary_date`
FROM
`phone_dashboard`.`PHONE_NETWORK_HALFHOUR`
WHERE `SUMMARY_DATE` IN (
'20160122',
'20160123',
'20160124'
... |
CREATE TABLE "users" (
"id" varchar(255) PRIMARY KEY NOT NULL,
"firstname" varchar(65),
"lastname" varchar(65),
"token" varchar UNIQUE NOT NULL,
"email" varchar UNIQUE NOT NULL,
"card" varchar
);
CREATE TABLE "canteens" (
"id" varchar(255) PRIMARY KEY NOT NULL,
"name" varchar(255) NOT NULL,
"address"... |
-- Schema for local use
DROP DATABASE IF EXISTS pets_db;
CREATE DATABASE pets_db;
USE pets_db;
--for inspecting what's in DB, not necessary for schema to work
SELECT * FROM adopters;
SELECT * FROM pets;
SELECT * FROM interests; |
create table if not exists User
(
id bigint(20) NOT NULL auto_increment,
name varchar(50),
age int(3)
);
create table if not exists Account
(
no bigint(20) NOT NULL auto_increment,
type varchar(255),
rest number
);
INSERT INTO User (name, age)
VALUES ('Aden', 47);
INSERT INTO User (name, ag... |
/*
* This problem is the same as 06.sql,
* but instead of using the NOT IN operator, you are to use a LEFT JOIN.
*/
SELECT DISTINCT
title
FROM film
LEFT JOIN inventory USING (film_id)
WHERE inventory_id is null
;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.