text stringlengths 6 9.38M |
|---|
DROP TABLE IF EXISTS othelloUser;
CREATE TABLE IF NOT EXISTS othelloUser (
id INT AUTO_INCREMENT NOT NULL PRIMARY KEY,
username varchar(255),
mail varchar(255),
ipaddress varchar(16),
port varchar(16),
urlpath varchar(255)
);
INSERT INTO othelloUser(
username ,
mail,
ipaddress,
... |
create table student_location
(
StudentID int,
StudentName varchar(20),
Location varchar(10),
FromDate date,
ToDate date
)
insert into student_location values(1, 'Tom','Paris', '2020-03-01', '2020-03-07')
insert into student_location values(1, 'Tom','Paris', '2020-03-08', '2020-03-09')
in... |
SELECT
*
FROM
tastespuds.place
WHERE
address_id = $1::text
|
-- MySQL dump 10.13 Distrib 5.7.29, for Linux (x86_64)
--
-- Host: localhost Database: enterfacedb
-- ------------------------------------------------------
-- Server version 5.7.29-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTE... |
/*
-- Query: SELECT * FROM guestone.paramsistema
LIMIT 0, 1000
-- Date: 2015-05-06 14:51
*/
INSERT INTO `paramsistema` (`idparam`,`idempresa`,`codreduzido`,`nome`,`endereco`) VALUES (1,1,'modelo','Hotel Modelo','Av. Embaixador Abelardo Bueno, 01 Ala A Sala 305');
|
/* Chapter 11: Special Structures */
/* Joining a table to itself */
/* Confirm that there is a missing category */
SELECT
entries.title
, entries.category
FROM
entries
LEFT OUTER JOIN categories
ON categories.category = entries.category
WHERE
categories.category IS NULL
;
/* Results should l... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: 127.0.0.1 Database: grupo_indemetal
-- ------------------------------------------------------
-- Server version 5.5.5-10.1.32-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC... |
-- phpMyAdmin SQL Dump
-- version 4.8.3
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 04 أكتوبر 2019 الساعة 01:18
-- إصدار الخادم: 10.1.36-MariaDB
-- PHP Version: 7.2.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @O... |
CREATE TABLE todos (
id SERIAL PRIMARY KEY,
text TEXT NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP
);
SELECT diesel_manage_updated_at('todos');
|
-- MySQL dump 10.13 Distrib 5.7.12, for Win64 (x86_64)
--
-- Host: localhost Database: cotic
-- ------------------------------------------------------
-- Server version 5.7.15-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/... |
SELECT idestoque, p.idprodutos, idestoque, idFornecedor, dataa FROM estoque as e
join produtos as p
on p.idprodutos = e.idprod |
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Mar 11, 2018 at 01:50 PM
-- Server version: 10.1.30-MariaDB
-- PHP Version: 7.2.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
SELECT * FROM OPENROWSET('SQLOLEDB'
, 'SQLREMOTE;user;password'
, 'SELECT * FROM Accounting.dbo.Accounts'); |
-- ##############################
-- # HISTORICAL SESSION QUERIES #
-- ##############################
V$ACTIVE_SESSION_HISTORY may have less than 24 hours worth of info
DBA_HIST_ACTIVE_SESS_HISTORY retains info longer
-- ASH size & # of emergency flushes since startup
select total_size,awr_flush_emergency_cou... |
-- User interfaces SAP
ALTER USER uwsi_admin IDENTIFIED BY uwsi_admin;
ALTER USER uwsi_aplic IDENTIFIED BY uwsi_aplic;
-- User interfaces PWNFE
ALTER USER nfeedi IDENTIFIED BY nfeedi;
-- User interfaces VEO
ALTER USER apluwa IDENTIFIED BY apluwa;
ALTER USER apliveo IDENTIFIED BY apliveo;
-- User interface... |
CREATE PROC [ERP].[Usp_Upd_Empresa_Desactivar]
@IdEmpresa INT,
@UsuarioElimino VARCHAR(250)
AS
BEGIN
UPDATE ERP.Empresa SET Flag = 0, UsuarioElimino = @UsuarioElimino , FechaEliminado = DATEADD(HOUR, 3, GETDATE()) WHERE ID = @IdEmpresa
END
|
--deletes a table is entries already exists
drop table if exists entries;
--creates a table called entires
CREATE TABLE entries (
--creates a column called id that is an automatically incrementing int and primary key
id INTEGER PRIMARY KEYS autoincrement,
--creates a column called title that is a string that cannot ... |
DROP DATABASE IF EXISTS edtickets;
CREATE DATABASE IF NOT EXISTS edtickets;
USE edtickets;
DROP TABLE IF EXISTS actividades;
CREATE TABLE IF NOT EXISTS actividades(
actividad_id CHAR(2) PRIMARY KEY,
bloque ENUM('Bloque 1','Bloque 2','Bloque 3') NOT NULL,
disciplina ENUM('YOGA', 'KICKBOXIN', 'PILATES', '... |
/*
Warnings:
- The migration will add a unique constraint covering the columns `[userId]` on the table `Tenant`. If there are existing duplicate values, the migration will fail.
- Added the required column `userId` to the `Tenant` table without a default value. This is not possible if the table is not empty.
*/... |
SELECT *
FROM Employee
WHERE (salary<12000) AND(classification BETWEEN 1 AND 3)
|
CREATE TABLE IF NOT EXISTS users (
userId SERIAL PRIMARY KEY,
username varchar(100) UNIQUE,
email varchar(100) UNIQUE,
telf varchar(100),
city varchar(100),
country varchar(100),
code varchar(100),
password varchar(100),
role VARCHAR(30),
direccion VARCHAR(200),
numImg NUMERIC,
urlIm... |
ALTER TABLE `frozen_addons`
MODIFY `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
MODIFY `addon_id` int(10) unsigned NOT NULL,
DROP KEY `addon_id`,
ADD KEY `frozen_addons_addon_id_ee7af26e_fk_addons_id` (`addon_id`),
ADD CONSTRAINT `frozen_addons_addon_id_ee7af26e_fk_addons_id` FOREIGN KEY (`addon_i... |
create database shop;
create user john@'%' identified by 'john_password';
grant all privileges on shop.* to john@'%'; |
--liquibase formatted sql
--changeset lautaro:insert_iva_categories splitStatements:false
-- inserto las categorías de IVA
INSERT INTO iva_category (description, percentage) VALUES
('IVA Responsable Inscripto', 21),
('IVA Responsable no Inscripto', 21),
('IVA no Responsable', 21),
('IVA Sujeto Exento', 0),
('Cons... |
create database if not exists gestion_stag;
use gestion_stag;
create table filiére(
idFiliere int(4) auto_increment primary key,
nomFiliere VARCHAR(50),
niveau VARCHAR(50)
);
create table stagiaire(
idStagiaire int(4) auto_increment primary key,
nom VARCHAR(50),
prenom VARCHAR(50),
civili... |
/*-- AJOUT DES CLIENTS*/
INSERT INTO `tpformation`.`user` (`TYPE_ENTITE`, `id`, `address`, `dateDeb`, `email`, `login`, `mdp`, `numTel`, `prenom`, `nom`, `matricule`, `nbEnfant`, `situationMaritale`) VALUES ('CL', '1000', 'paris', '2018-02-13 00:00:00', 'client@gmail.com', 'c1', 'c1', '06235689', 'Adan', 'smith', NULL... |
--Exo5: Dans la table languages, afficher les deux premières entrées de JavaScript.
SELECT * FROM `languages` WHERE `language`='JavaScript' id LIMIT 2;
--l'opérateur LIMIT permet de limiter la recherche.
|
CREATE DATABASE IF NOT EXISTS djproject;
CREATE USER 'djuser'@'localhost' IDENTIFIED BY 'djuser123';
GRANT ALL PRIVILEGES ON *.* TO 'djuser'@'localhost'; |
#设置客户端连接服务器端编码
SET NAMES UTF8;
#丢弃数据库,如果存在
DROP DATABASE IF EXISTS xz;
#创建数据库,设置编码
CREATE DATABASE xz CHARSET=UTF8;
#进入创建的数据库
USE xz;
#创建保存笔记本分类数据的表
CREATE TABLE laptop_family(
fid SMALLINT PRIMARY KEY,
fname VARCHAR(8),
laptopCount INT
);
#插入数据
INSERT INTO laptop_family VALUES(10,'联想',2);
INSERT INTO laptop_fami... |
INSERT INTO article (title, content, created_by, created_at, tags) VALUES
('test article 1', 'This is test article. Please ignore this article.',1,'2017-02-26 00:05:00','test,article'),
('test article 2', 'This is also test article. Also need to ignore',2,'2017-02-27 03:00:21','test,ignore'); |
-- phpMyAdmin SQL Dump
-- version 4.8.4
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost
-- Généré le : Dim 31 mars 2019 à 19:02
-- Version du serveur : 10.1.37-MariaDB
-- Version de PHP : 7.3.0
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 ... |
#-- initialistaion de la table groupe
INSERT INTO groupe VALUE(0 , 'Public');
#-- initialisation des contact
INSERT INTO contact VALUE( 0 , 'inconue' , 'inconue' , '' );
#-- initialisation des user
INSERT INTO user(nom, prenom, adressemail, motdepasse) VALUE ('admin', 'admin', 'admin@admin.com', 'admin'); |
SELECT *
FROM user
WHERE username=:username AND password=:password;
|
/*
################################################################################
Create a view table that displays all deleted study events
author: Emma Hastings
date: May 31th 2016
version: 2.1.2.030
################################################################################
*/
----------------------------... |
--
-- movie_schema.sql
-- AL 20161205 Works for oracle and postgres
--
drop table starsin;
drop table movies;
drop table moviestar;
drop table movieexec;
drop table studio;
create table movieexec(
name varchar(50),
address varchar(50),
cert integer,
netWorth integer,
primary key(cert));
insert into movieexec val... |
SELECT c.id contact_id, comp.id company_id, c.full_name, comp.title
FROM b_crm_company comp, b_crm_contact c, b_crm_field_multi f
WHERE c.company_id = comp.id AND c.id = f.element_id AND f.entity_id = 'CONTACT' AND f.type_id = 'EMAIL' AND f.value = 'admin'
ALTER TABLE `altasib_support_ticket` ADD `CONTACT_ID` I... |
/* push_event_to_user: event_id%TYPE, uid%TYPE -> void
This procedure takes a user and event id, returns nothing, and has the side
effect of associating that user with that event */
create or replace procedure push_event_to_user(
desired_event_id Event.event_id%TYPE,
desired_uid Account.user_id%TYPE)... |
-- MySQL Administrator dump 1.4
--
-- ------------------------------------------------------
-- Server version 5.0.89-community-nt
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CO... |
-- Tables
CREATE TABLE compte (
IdCompte NUMBER(5) NOT NULL,
Pseudo VARCHAR(50) NOT NULL,
MotDePasse VARCHAR(25) NOT NULL,
PRIMARY KEY (IdCompte),
UNIQUE (Pseudo)
);
CREATE TABLE role (
IdCompte NUMBER(5) NOT NULL,
Role VARCHAR2(20) NOT NULL,
CHECK( Role IN ('ADMINISTRATEUR','ORGA... |
DROP DATABASE IF EXISTS dropApp;
CREATE DATABASE dropApp;
-- CREATE LOGIN review WITH PASSWORD = '1234'
USE dropApp;
CREATE TABLE IF NOT EXISTS reviews (
review_id INT AUTO_INCREMENT,
user_name TEXT,
product_id INT NOT NULL,
review_date DATE,
header VARCHAR(50),
review_text TEXT,
rating INT,
would_r... |
CREATE TABLE users (
id serial PRIMARY KEY,
email varchar(40) NOT NULL,
password varchar(256) NOT NULL,
firstname varchar(50),
lastname varchar(50),
created_at timestamp DEFAULT CURRENT_TIMESTAMP,
updated_at timestamp DEFAULT CURRENT_TIMESTAMP,
UNIQUE(email),
UNIQUE(password... |
CREATE TABLE ITEM_INTO (
ITEM_ID INT,
ITEM_INTO INT,
PRIMARY KEY (ITEM_ID, ITEM_INTO),
FOREIGN KEY (ITEM_ID) REFERENCES ITEM (ID)
); |
USE codeup_test_db;
SELECT '------------------------------' AS '';
SELECT '------------------------------' AS 'Pink Floyd albums';
SELECT name FROM albums WHERE artist = 'Pink Floyd';
SELECT '------------------------------' AS '';
SELECT '------------------------------' AS 'Release date of Sgt. Pepper''s';
SELECT rel... |
-- MySQL dump 10.13 Distrib 5.7.32, for Linux (x86_64)
--
-- Host: localhost Database: test_database
-- ------------------------------------------------------
-- Server version 5.7.32-0ubuntu0.18.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARAC... |
--
-- Volcado de datos para la tabla `pais`
--
INSERT INTO `pais` (`id`, `nombre`, `codigo`) VALUES
(1, 'Andorra', 'AND'),
(2, 'United Arab Emirates', 'ARE'),
(3, 'Afghanistan', 'AFG'),
(4, 'Antigua and Barbuda', 'ATG'),
(5, 'Anguilla', 'AIA'),
(6, 'Albania', 'ALB'),
(7, 'Armenia', 'ARM'),
(8, 'Angola', 'AGO'),
(9, 'An... |
INSERT INTO SECTOR
(ID,NAME,SECTOR_CHIEF_ID,MASTER_ID,WORKSHOP_ID)
VALUES
(1, 'SECTOR1', 3, 6, 1)
/
INSERT INTO SECTOR
(ID,NAME,SECTOR_CHIEF_ID,MASTER_ID,WORKSHOP_ID)
VALUES
(2, 'SECTOR2', 4, 8, 2)
/
INSERT INTO SECTOR
(ID,NAME,SECTOR_CHIEF_ID,MASTER_ID,WORKSHOP_ID)
VALUES
(3, 'SECTOR3', 5, 9, 2)
/
|
--Exercise 22
/*Provide a query that shows the total sales per country.*/
select Invoice.BillingCountry 'Billing Country', sum(Invoice.Total) 'Sales'
from Invoice
group by Invoice.BillingCountry
|
-- 隐式游标 %found %rowcount 等
declare
total_rows number(2);
begin
update customers
set salary = salary + 500;
if sql%notfound then
dbms_output.put_line('not found customers');
elsif sql%found then
total_rows := sql%rowcount;
dbms_output.put_line('total customers is updated' || total_rows);
end if;
end;
/
decl... |
-- MySQL dump 10.13 Distrib 5.7.17, for Win64 (x86_64)
--
-- Host: localhost Database: BOOKMGR
-- ------------------------------------------------------
-- Server version 5.7.17-log
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESU... |
TRUNCATE TABLE `ks_geography_cities`;
TRUNCATE TABLE `ks_geography_countries`
INSERT INTO `ks_geography_cities` VALUES (1, 1, 'Москва', 'Moscow','');
INSERT INTO `ks_geography_cities` VALUES (2, 1, 'Абрамцево', 'Abramtsevo','');
INSERT INTO `ks_geography_cities` VALUES (3, 1, 'Алабино', 'Alabino','');
INSERT INTO `ks_... |
/****************************************************************
* Find and rank duplicates for whatever your heart desires
*****************************************************************/
WITH tbl_online AS (
SELECT *,RANK () OVER (
PARTITION BY criteriaA, criteriaB, criteriaC, criteriaD ORDER BY DateOrSome... |
create table Escenario (
id_Escenario NUMBER(5) NOT NULL PRIMARY KEY,
Nombre VARCHAR(50) NOT NULL,
Capacidad NUMBER(10) NOT NULL
) |
TRUNCATE
category,
budget_user,
item,
budgets,
RESTART IDENTITY CASCADE; |
CREATE OR REPLACE VIEW wf_ac_perms_v AS
SELECT ac_grs.ac_id, ac_grs.group_id, gu.user_id, ac_grs.role_id, rdas.doctype_id, rdas.docaction_id
FROM wf_ac_group_roles ac_grs
JOIN wf_group_users gu ON ac_grs.group_id = gu.group_id
JOIN wf_role_docactions rdas ON ac_grs.role_id = rdas.role_id;
|
CALL initialize_global_metadata();
SET @mexConsultEnc = encounter_type('aa61d509-6e76-4036-a65d-7813c0c3b752');
SELECT
CONCAT(DATE(e.encounter_datetime), " ", TIME(e.encounter_datetime)) "Fecha",
CONCAT(given_name, " ", family_name) "Nombre",
MAX(cn.name) "Dx",
MAX(crt.code) "ICD-10",
IF(IFNULL(pre... |
SELECT--coalesce(, '') as ,
brn.NAME,
coalesce(brn.phone_number, '') as phone_number,
COALESCE ( brn.caption, '' ) AS caption,
brn.organization_id,
apb.lims_document_id AS application_id,
apb.ID AS application_branch_id,
coalesce(brn.fax_number... |
CREATE TABLE IF NOT EXISTS `[#DB_PREFIX#]weixin_third_party_api` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`account_id` int(10) NOT NULL DEFAULT '0',
`url` varchar(255) NOT NULL,
`token` varchar(255) NOT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '0',
`rank` tinyint(2) UNSIGNED NOT NULL DEFAULT '0',
... |
with
-- делаем таблицу с днями недели и их количеством в нашем диапазоне
bk_days as (
select
extract( dow from book_days.book_days::date )::text as bk_days,
count( book_days )::integer as count
from generate_series( lower(daterange('2018-08-20', '2018-08-26', '[)')), upper(daterange('2018-08-20', '2018-... |
/*
Navicat MySQL Data Transfer
Source Server : scott
Source Server Version : 50624
Source Host : 127.0.0.1:3306
Source Database : mianshi
Target Server Type : MYSQL
Target Server Version : 50624
File Encoding : 65001
Date: 2017-07-26 17:01:17
*/
SET FOREIGN_KEY_CHEC... |
CREATE TABLE events
(
id SERIAL UNIQUE PRIMARY KEY NOT NULL,
name VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
timestamp TIMESTAMPTZ NOT NULL,
timestamp_end TIMESTAMPTZ NOT NULL,
price INTEGER ... |
/*
Warnings:
- You are about to drop the column `viewCount20` on the `Blog` table. All the data in the column will be lost.
- Added the required column `viewCount` to the `Blog` table without a default value. This is not possible if the table is not empty.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TA... |
DROP TABLE primes;
CREATE TABLE primes(
num INTEGER PRIMARY KEY
);
INSERT INTO primes (num) VALUES (2);
INSERT INTO primes (num) VALUES (3);
INSERT INTO primes (num) VALUES (5);
INSERT INTO primes (num) VALUES (7);
INSERT INTO primes (num) VALUES (11);
INSERT INTO primes (num) VALUES (13);
INSERT INTO primes (num) ... |
CREATE TABLE if NOT exists location (id bigint auto_increment,
name varchar(255),
lat double,
lon double,
primary key(id)); |
INSERT INTO ValueSetIncludeFilter VALUES (1,4,7,NULL,1270);
INSERT INTO ValueSetIncludeFilter VALUES (2,4,8,NULL,1380);
INSERT INTO ValueSetIncludeFilter VALUES (3,4,9,NULL,1780);
INSERT INTO ValueSetIncludeFilter VALUES (4,4,10,NULL,1781);
INSERT INTO ValueSetIncludeFilter VALUES (5,4,11,NULL,1793);
INSERT INTO Value... |
DROP DATABASE IF EXISTS tradezdb;
CREATE DATABASE tradezdb;
|
/*Elimina las tablas*/
DROP TABLE IF EXISTS tbl_transacciones;
DROP TABLE IF EXISTS tbl_cuenta_x_personas;
DROP TABLE IF EXISTS tbl_personas;
DROP TABLE IF EXISTS tbl_cuentas;
DROP TABLE IF EXISTS tbl_tipos_identificacion;
DROP TABLE IF EXISTS tbl_generos;
/*tbl_cuentas*/
create table tbl_cuentas
(
secuencia_cuenta in... |
/*
Navicat Premium Data Transfer
Source Server : fwqMysqlroot
Source Server Type : MySQL
Source Server Version : 50721
Source Host : 120.79.222.244
Source Database : BMG
Target Server Type : MySQL
Target Server Version : 50721
File Encoding : utf-8
Date: 03/10/2018 13:... |
# Write your MySQL query statement below
select name
from
SalesPerson sp
left join
(
select sales_id
from
orders ord
join company cmp on ord.com_id = cmp.com_id
and cmp.name = 'RED'
) red on red.sales_id = sp.sales_id
where red.sales_id is null
|
SELECT *
FROM demo.accounts_view_1
|
SELECT
NVL(TOTAL_SKUS, 0) AS TOTAL_ORDER_CNT,
NVL(ASSIGNED_SKU, 0) AS ASSIGNED_ORDER_CNT,
NVL(TOTAL_SKUS - ASSIGNED_SKU, 0) AS REMAIN_ORDER_CNT,
NVL(TOTAL_ORDERS_PCS, 0) AS TOTAL_ORDER_PCS,
NVL(ASSIGNED_PCS, 0) AS ASSIGNED_ORDER_PCS,
... |
/*テスト用データ*/
insert into member (member_id, password, member_name, birthday, address, tel_number, mail_address, admin_flg, create_date)
values('RS999998','$2a$10$wskaPfbn8H7Pe1uUpKbbTeiOBNw0qhYeoPFOxsSI6lguc0roj7Oye','テスト太郎','1111/11/11','東京','123456','aaa@aa.jp','ADMIN','2019/07/26'); |
SELECT
BILL.BILL_ID AS BILL_ID,
BILL.SHIPPING_ID AS SHIPPING_ID,
BILL.ORDER_TITLE_ID AS ORDER_TITLE_ID,
BILL.CUSTOMER_ID AS CUSTOMER_ID
FROM
BILL,
BURI_PATH_DATA
/*BEGIN*/
WHERE
/*IF dto.billId != null*/ BILL_ID = /*dto.billId*/0/*END*/
/*IF dto.billId_not != null*/AND BILL_ID != /*dto.billId_not*/0/... |
select grade, avg(score)
from inspections
where grade != ''
group by grade;
|
# Sauvegarde de monde : ajout de champ
INSERT INTO `champ` (
`label_champ`,
`pluriel_champ`,
`fk_monde`,
`fk_client`
) VALUES (
:label,
:pluriel,
:monde,
:client
)
;
|
/*==============================================================*/
/* 创建临时表空间,数据表空间,索引表空间,创建用户并授权。 */
/*==============================================================*/
/*create temporary tablespace pivas_tablespace_temp tempfile 'D:\oracledata\pivas_temp.dbf' size... |
/*
* Copyright 2013-2016 Uncharted Software Inc.
*
* Property of Uncharted(TM), formerly Oculus Info Inc.
* https://uncharted.software/
*
* 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 Licen... |
# Copyright 2020 Google LLC..
#
# 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
#
# Unless required by applicable law or agreed to in writing,... |
```
SELECT * FROM employees WHERE NOT EXISTS
(SELECT emp_no FROM dept_emp WHERE emp_no = employees.emp_no)
``` |
SELECT StudentName
, Score
, CUME_DIST() OVER (ORDER BY Score) as CumeDist
FROM TestResults
ORDER BY 3 DESC |
DROP TABLE IF EXISTS distributed_query_statistics;
CREATE TABLE distributed_query_statistics (
received_date Date DEFAULT CAST(now(), 'Date'),
user_id UInt64 DEFAULT CAST(0, 'UInt64'),
campaign_id UInt64 DEFAULT CAST(0, 'UInt64'),
advert_id UInt64 DEFAULT CAST(0, 'UInt64'),
match_id UInt64... |
drop view rankings;
create view rankings as SELECT player_rank.rank_id, players.player_id, player_rank.score, players.uname, players.class, players.level,
CASE
WHEN players.health = 0 THEN 0
ELSE 1
END::boolean AS alive, players.days FROM player_rank
JOIN players ON player... |
--minha primeira query em SQL (DDL)
SELECT 'Hello World!';
--minha primeira query util
--city
select * from city;
--country
select * from country;
--countrylanguage
select * from countrylanguage;
--Sera que temos curitiba na base? (Clausula WHERE)
select * from city where name = 'Curitiba';
--Sera que temos Brasil... |
SET FOREIGN_KEY_CHECKS=0;
DROP TABLE IF EXISTS `job_entity`;
CREATE TABLE `job_entity` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL COMMENT 'job名称',
`job_group` varchar(255) DEFAULT NULL COMMENT 'job组名',
`job_cron` varchar(255) DEFAULT NULL COMMENT '执行的cron',
`parameter` varchar(25... |
CREATE TABLE co2emission_reduced (
imo BIGINT PRIMARY KEY,
ship_name VARCHAR(64) NOT NULL,
technical_efficiency_number REAL
);
|
-- 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... |
/*==============================================================*/
/* DBMS name: MySQL 5.0 */
/* Created on: 2015/9/21 15:11:40 */
/*==============================================================*/
drop table if exists book;
drop table if exists b... |
SELECT *
FROM johnny_kelley.product_analytics_events; |
create or replace package body app_meta_data
as
function get_object_name(
pi_object_name varchar2,
pi_prefix varchar2 default null,
pi_suffix varchar2 default null
) return varchar2
is
l_object_name varchar2(64);
begin
l_object_name :=... |
create table post_comments (
id int8 PRIMARY KEY AUTO_INCREMENT,
parent_id int8,
post_id int8 not null,
user_id int8 not null,
time timestamp not null,
text varchar(255) not null
) |
use ps14396_qly_banhang_ontap1;
create table Khach_hang(
maKH varchar(3),
hoTen varchar(50),
dc varchar(50),
primary key(maKH)
);
create table dat_hang(
maKH varchar(3),
soDH varchar(4),
ngay_dat datetime,
primary key(soDH),
foreign key(maKH) references Khach_hang(maKH)
);
create table CT
(
soDH varchar(4),
maSP varch... |
CREATE DATABASE IF NOT EXISTS php_fundation_cms;
USE php_fundation_cms;
CREATE TABLE usuarios (
id INT NOT NULL AUTO_INCREMENT,
nome VARCHAR(255),
email VARCHAR(255),
login VARCHAR(50),
senha VARCHAR(50),
PRIMARY KEY (id)
);
INSERT INTO usuarios (id, nome, email, login, senha) VALUES (NULL, 'A... |
ALTER TABLE batches DROP FOREIGN KEY fk_batches_owner_id;
ALTER TABLE batches DROP FOREIGN KEY fk_batches_recipe_id;
ALTER TABLE flavors DROP FOREIGN KEY fk_flavors_vendor_id;
ALTER TABLE flavor_ratings DROP FOREIGN KEY fk_flavor_ratings_flavor_id;
ALTER TABLE flavor_ratings DROP FOREIGN KEY fk_flavor_ratings_owner_id;... |
create temporary table study_temp as select study_pk_id from study where patient_pk_id=1341096003;
create temporary table series_temp as select general_series_pk_id from general_series where study_pk_id in (select * from study_temp);
create temporary table image_temp as select image_pk_id from general_image wh... |
INSERT INTO departments (name)
VALUES ('Hero'),
('Villain'),
('Support'),
('SAITAMA');
INSERT INTO roles (title, salary, departments_id)
VALUES ('Pirate',99999.99,1),
('Ninja',50000.00,2),
('Mecha',25000.00,3),
('Demon Slayer',60000.00,1),
('Saiyan',... |
use Haze_Vape_DB;
DROP TABLE IF EXISTS roles;
CREATE TABLE IF NOT EXISTS roles (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS users;
CREATE TABLE IF NOT EXISTS users (
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(100) NOT NULL,
e... |
create table studentData(name varchar primary key,rollno int,address varchar(20),mobilnumber varchar(10),pannumber varchar(20));
insert into studentData(pranoti,18135,pune,9823123456,AAL123474R);
insert into studentData(Tripathi,18105,mumbai,9827823456,ABK8793474R);
insert into studentData(sayali,18239,up,8823893456,BH... |
--
-- 数据库: `dede`
--
-- --------------------------------------------------------
--
-- 表的结构 `tp_admin`
--
CREATE TABLE IF NOT EXISTS `tp_admin` (
`id` smallint(6) NOT NULL AUTO_INCREMENT COMMENT '管理id',
`uname` varchar(20) NOT NULL COMMENT '用户名',
`password` char(32) NOT NULL COMMENT '密码',
`create_time` int(1... |
CREATE TABLE [wms].[Productos_UoM] (
[Id] INT IDENTITY (1, 1) NOT NULL,
[Id_Producto] INT NOT NULL,
[Id_UoM] INT NOT NULL,
[Nivel] TINYINT NOT NULL,
[Unidad_Ba... |
-- phpMyAdmin SQL Dump
-- version 4.4.15.1
-- http://www.phpmyadmin.net
--
-- Хост: localhost
-- Время создания: Янв 31 2016 г., 16:46
-- Версия сервера: 10.0.22-MariaDB
-- Версия PHP: 5.6.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... |
INSERT INTO event_type (id, application_id, name, display_name)
SELECT gen_random_uuid(), a.id , 'integration-disabled', 'Integration disabled'
FROM applications a, bundles b
WHERE a.bundle_id = b.id AND a.name = 'notifications' AND b.name = 'console'
ON CONFLICT DO NOTHING;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.