text stringlengths 6 9.38M |
|---|
CREATE TABLE [tms].[rutas_manuales]
(
[id_ruta_manual] BIGINT NOT NULL IDENTITY(1,1),
[cliente_identificacion] VARCHAR(20) NOT NULL,
[numero_orden] VARCHAR(20) NOT NULL,
[placa] VARCHAR(20) NOT NULL,
[secuencia] INT NOT NULL,
[fecha_hora_estimada_entrega] DATETIME2(0) NOT NULL,
[cx] DECIM... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1)
-- Dumped by pg_dump version 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1)
-- Started on 2021-05-24 16:52:55 +06
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encodin... |
alter table dbo.tempTable
drop column Currency, MeterName, MeterSubCategory, Unit, SubscriptionName, UsageEnd |
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: 2016-11-28 09:32:16
-- 服务器版本: 5.1.73-log
-- PHP Version: 5.4.45
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 ... |
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
DROP PROCEDURE IF EXISTS `addField`;
delimiter ;;
CREATE PROCEDURE `addField`(
IN tableName char(255),
IN fieldName char(255),
IN fieldType char(255),
IN isNull char(255),
IN defaultValue char(255),
IN comment char(255)
)
BEGIN
DECLARE num int(11);
set @che... |
CREATE USER [SQLUser1];
|
use db_testing;
show tables;
#Delete all tables from your database space
SET FOREIGN_KEY_CHECKS = 0;
SET @tables = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'db_testing'; -- specify DB name here.
SET @tables = CONCAT('DROP TABLE ',... |
CREATE TABLE verVersion (
verOverall varchar(16) DEFAULT '0.0.0' comment 'Overall version of the published schema',
verSchema int(10) DEFAULT 0 NOT NULL comment 'this is the schema version',
verAlteration int(10) DEFAULT 0 NOT NULL comment 'this is the most resent alteration that have been applied to the... |
insert into customers(id,firstname,lastname,email) values (1,'vinodh','mahendra','vinodh.mahendra@simplilearn.com');
insert into customers(id,firstname,lastname,email) values (2,'bhavya','vinodh','bhavya@collins.com');
insert into customers(id,firstname,lastname,email) values (3,'samarth','vishnu','samarth.vishnu@hi... |
ALTER TABLE IACUC_PROTOCOL_RESEARCH_AREAS
ADD CONSTRAINT FK_IACUC_PROTO_RESEARCH_AREA_C
FOREIGN KEY (RESEARCH_AREA_CODE)
REFERENCES RESEARCH_AREAS (RESEARCH_AREA_CODE)
/
ALTER TABLE IACUC_PROTOCOL_RESEARCH_AREAS
ADD CONSTRAINT FK_IACUC_PROT_RESEARCH_AREAS
FOREIGN KEY (PROTOCOL_ID)
REFERENCES IACUC_PROTO... |
/* 01_04 Basics: Sum and Average */
SELECT
*
FROM
store_sales
LIMIT
10;
SELECT
SUM(units_sold)
FROM
store_sales;
SELECT
month_of_year, SUM(employee_shifts)
FROM
store_sales
GROUP BY
month_of_year;
SELECT
month_of_year, SUM(units_sold), avg(units_sold)
FROM
store_sales
GROUP B... |
drop database if exists `sharding1`;
drop database if exists `sharding2`;
create database `sharding1`;
use `sharding1`;
create table t2 (id bigint primary key, name varchar(80), info varchar(100)) DEFAULT CHARSET=utf8mb4;
create table t3 (id bigint primary key, name varchar(80), info varchar(100)) DEFAULT CHARSET=utf8m... |
DROP DATABASE IF EXISTS Facebook;
CREATE DATABASE Facebook;
USE Facebook;
-- câu 1: Tạo table với các ràng buộc và kiểu dữ liệu ------
DROP TABLE IF EXISTS `National`;
CREATE TABLE `National`(
National_id TINYINT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
National_Name VARCHAR(50) NOT NULL UNIQUE KEY,
Language_Ma... |
-- Create document
INSERT INTO document
(iri)
VALUES
('http://DiscoveryDataService/InformationModel/dm/Discovery/1.0.0');
SELECT @doc := LAST_INSERT_ID();
-- Allocate ids for new concepts
INSERT INTO concept
(document, id)
SELECT @doc, CONCAT('DCE_', REPLACE(term, ' ', '_')) as id
FROM encounter_types;
-- Add concep... |
-- Project Name : noname
-- Date/Time : 2015/04/22 13:27:07
-- Author : tonakata
-- RDBMS Type : PostgreSQL
-- Application : A5:SQL Mk-2
-- 得意先
create table t_cstmr (
cstmr_cd integer not null
, cstmr_nm character varying(50) not null
, pms_i_ymd timestamp without time zone default now() not null
... |
--Login_info contains information about the users name, password and role
--I don't think an extra table is neccessary for role (yet)
CREATE TABLE Login_info(
login_pk serial primary key,
username varchar(16),
password varchar(16),
role text,
Active boolean DEFAULT true
);
--facilities contains a name and code.... |
CREATE DATABASE IF NOT EXISTS `merceariajn` /*!40100 DEFAULT CHARACTER SET utf8 */;
USE `merceariajn`;
-- MySQL dump 10.13 Distrib 8.0.17, for Win64 (x86_64)
--
-- Host: localhost Database: merceariajn
-- ------------------------------------------------------
-- Server version 5.7.26
/*!40101 SET @OLD_CHA... |
use gradjevinskaFirma;
insert into zaposleni(idZaposlenog, ime, prezime, korisnickoIme, lozinka, salt)
values
(853, 'Marko', 'Miladinović', 'MarkoMiladinović', 'abc', 'abc'),
(854, 'Ivana', 'Rodić', 'IvanaRodić', 'abc', 'abc'),
(855, 'Tijana', 'Janković', 'TijanaJanković', 'abc', 'abc'),
(856, 'Pera', 'Stojisavljević... |
/* Formatted on 17/06/2014 18:09:00 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCREI_MAX_STIME2
(
COD_ABI,
COD_NDG,
COD_RAPPORTO,
DTA_STIMA,
COD_PROTOCOLLO_DELIBERA
)
AS
SELECT s3.cod_abi,
s3.cod_ndg,
s3.cod_rapporto,
s3.dta_stima,
s3.co... |
USE employees;
SELECT * FROM employees WHERE hire_date=(SELECT MIN(hire_date) FROM employees);
UPDATE salaries SET salary=salary+1 WHERE emp_no IN (SELECT emp_no FROM employees WHERE gender='M');
DELETE d1 from dept_emp d1, (select * from employees where last_name='Acton') e WHERE d1.emp_no = e.emp_no;
DELETE d2 fr... |
select * from invoice i, lineitem l, product p
where i.invoice_id = l.invoice_id
and l.product_id = p.product_id; |
create database if not exists Tienda_Juegos;
drop table if exists detalles_orden cascade;
drop table if exists orden cascade;
drop table if exists pago cascade;
drop table if exists cliente cascade;
drop table if exists genero_juego cascade;
drop table if exists idioma_juego cascade;
drop table if exists mod_juego cas... |
-- Filename : get_partitioned_tables.sql
-- Description : This function finds all the partitioned tables in the database
-- Creation : 07/04/2021 17:41
-- Author : plu9in
-- | | | |
select
ns_pr.nspname partitioned_table_schem... |
BEGIN
add_dept;
add_dept ('TRAINING', 2500);
add_dept ( p_loc => 2400, p_name =>'EDUCATION');
add_dept ( p_loc => 1200) ;
END;
/
SELECT department_id, department_name, location_id
FROM departments;
|
CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT
BEGIN
RETURN (
SELECT DISTINCT E2.Salary
FROM (
SELECT E1.Salary, DENSE_RANK() OVER w AS 'Dense_rank'
FROM Employee AS E1
WINDOW w AS (ORDER BY E1.Salary DESC)
) AS E2
WHERE E2.Dense_rank = N
);
END
# CRE... |
--join customer name date amount ordered by amount in desc--
select c.name as 'Customer Name', sum(o.amount) as 'Total Amount'
from customer c -- alias for customer as c
join [order] o
on [o].customerid = c.id
--where o.Amount < 250 or o.Amount > 600
group by c.name
order by sum(o.amount) desc
|
--* File Name : Error_Stack.sql
--* Author : DR Timothy S Hall
--* Description : Displays contents of the error stack.
--* Call Syntax : @Error_Stack
--* Last Modified: 15/07/2000
SET SERVEROUTPUT ON
DECLARE
v_stack VARCHAR2(2000);
BEGIN
v_stack := Dbms_Utility.Format_Error_Stack;
Dbms_Output.Put_Line... |
UPDATE [ContractSchema] SET SchemaString = '{
"type": "number",
"format": "double",
"example": "1.56e105"
}' WHERE SchemaName = 'Number(Double)'
|
/*
Project Option: Coyote Residence Office
TEAM: King James & The Knights of the Data Table
Comments on Attributes for Lease
COMMENT BY: Enrique Carbajal Jr.
*/
/* CREATE TABLE Lease (
1 Lease_Number VARCHAR2(5)
CONSTRAINT Lease_PK PRIMARY KEY,
2 Duration CHAR(1)
CONSTRAINT Lease_Duration_NN NOT NULL,
3 Rental_Add... |
drop database if exists testAPI;
create database testAPI;
use testAPI;
create table Users (UserId int auto_increment, Name varchar(100), Password varchar(500), Email varchar(50), IsActive int,
primary key (UserId))
ENGINE=InnoDB CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT='users table';
... |
--待审批
select
x4.RecordStatus,Description,x1.Id,x4.DocumentCode,x1.Title,x1.IsPowerMessage,x1.LinkUrl, x1.FromDate as wfDate,x1.FromHumanName,x1.KeyWord,x1.KeyValue,x1.ContentText as HtmlPath,x1.MessageType,x1.EpsProjCode as EpsProjCode,x1.EpsProjName as EpsProjName,x4.UserName as UserName,x3.WeChat
from
PB_Messages x1 ... |
.open baloncesto.db
select
j.nombre||" "||j.apellidos,a.nombre_equipo
from jugador as j
join adscritos as a
on j.nif = a.nif;
select
j.nombre||" "||j.apellidos,p.anyo as "año"
from jugador as j
join participan as p
on j.nif = p.nif
where p.anyo = 2020
order by j.nombre,j.apellidos;
SELECT
e.nombre_equipo, c.nombre
fr... |
USE ibEjgWrSuB;
CREATE DATABASE burgers_db;
DROP TABLE IF EXISTS burgers;
CREATE TABLE burgers(
id INT NOT NULL AUTO_INCREMENT,
burger_name VARCHAR(50) NOT NULL,
food_state BOOLEAN DEFAULT false,
PRIMARY KEY (id)
); |
CREATE TABLE A2A3Fee /*----客车A2、A3修明细表----*/
(
num int not null primary key,
TrainType varchar(50) unique,
A2Fee number(18,2),
A3Fee number(18,2)
)
drop table A2A3Fee |
{{ config(materialized='view') }}
with data as (
{{ dbt_ml_preprocessing.one_hot_encoder( source_table=ref('data_one_hot_encoder'),
source_column='column_to_encode',
categories=['A','B']) }}
)
select * from data
|
-- AlterTable
ALTER TABLE "users" ALTER COLUMN "avatar" DROP NOT NULL;
|
DROP database IF EXISTS zadatak1;
CREATE database zadatak1;
use zadatak1;
CREATE TABLE zupanija(
sifra int NOt NULL PRIMARY key auto_increment,
naziv varchar(50),
zupan int
);
CREATE TABLE opcina(
sifra int NOt NULL PRIMARY key auto_increment,
zupanija int,
naziv varchar(50)
);
CREATE TABLE mjesto(
sifra int NOt NUL... |
/*
Navicat MySQL Data Transfer
Source Server : mysql
Source Server Version : 50614
Source Host : localhost:3306
Source Database : orange
Target Server Type : MYSQL
Target Server Version : 50614
File Encoding : 65001
Date: 2014-02-19 10:32:59
*/
SET FOREIGN_KEY_CHECK... |
select award_type.award_type_code,award_type.description,count(award.award_type_code)
from award_type,
award
where award.award_type_code(+) = award_type.award_type_code
and award_type.award_type_code not in (3,14,1,9,5,15)
group by award_type.award_type_code,award_type.description;
select award_type.award_type_... |
-- DropIndex
DROP INDEX "Prestamo_libroId_unique";
|
-- phpMyAdmin SQL Dump
-- version 4.5.2
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Apr 23, 2016 at 06:38
-- Server version: 10.1.10-MariaDB
-- PHP Version: 7.0.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIEN... |
create database db_cidade_das_carnes;
use db_cidade_das_carnes;
create table tb_categoria(
id bigint auto_increment,
nome varchar(255) not null,
descricao varchar(255),
primary key (id)
);
insert into tb_categoria(nome, descricao) values
("bovino", "pedaços"),
("Frango", "pedaços"),
("suíno", "ped... |
/*Crear base de datos*/
CREATE DATABASE blog;
/* Mostrar bases de datos */
SHOW DATABASES;
/* Borrar base de datos. */
DROP DATABASE blog; |
-- https://www.hackerrank.com/challenges/asian-population
SELECT SUM(A.POPULATION)
FROM CITY A
INNER JOIN COUNTRY B
ON B.CODE = A.COUNTRYCODE
GROUP BY B.CONTINENT
HAVING B.CONTINENT = 'Asia' |
INSERT INTO lte.role_menu (menu_id, role_id) VALUES (1, 1); |
-- List all shows and all genres linked to that show from the DB
SELECT a.title, c.name
FROM tv_shows a
LEFT JOIN tv_show_genres b
ON a.id = b.show_id
LEFT JOIN tv_genres c
ON b.genre_id = c.id
ORDER BY a.title ASC, c.name ASC;
|
# INSERT nametable (Name)VALUE ('Dmitry')
# INSERT usertable (Surname, NameTable) value ('Chueshov',1);
# insert into world.`humans` (name,surname)value ('Dmitry','Chueshov');
# select * from world.`humans`;
# update `humans` set surname='Pety' where id=2;
# delete from `humans` where name='Pety';
# INSERT nametable (N... |
-- phpMyAdmin SQL Dump
-- version 3.4.10.1
-- http://www.phpmyadmin.net
--
-- 主机: localhost
-- 生成日期: 2014 年 05 月 02 日 01:45
-- 服务器版本: 5.5.20
-- PHP 版本: 5.3.10
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_... |
DROP TABLE IF EXISTS addresses;
DROP TABLE IF EXISTS persons;
DROP TABLE IF EXISTS documents;
DROP TABLE IF EXISTS products;
DROP TABLE IF EXISTS custom;
CREATE TABLE persons (
id SERIAL PRIMARY KEY,
firstname VARCHAR,
lastname VARCHAR
);
CREATE TABLE documents (
id SERIAL PRIMARY KEY,
json VARCHAR... |
INSERT INTO bears (name, age, gender, color, temperament, alive)
VALUES ('Mr. Chocolate', 3, 'M', 'Brown', 'Feisty', 1);
INSERT INTO bears (name, age, gender, color, temperament, alive)
VALUES ('Rowdy', 7, 'F', 'Black', 'Rowdy', 1);
INSERT INTO bears (name, age, gender, color, temperament, alive)
VALUES ('Tabitha', 5... |
CREATE OR REPLACE VIEW "RESOURCE_CAPACITY"."PNMAC"."VW_FORECAST_AND_ACTUAL_COMBINED_INFO_V2B" AS
select
EFFORT_ID
,faac.BILLED_DEPARTMENT_ID
,billed_department.name as BILLED_DEPARTMENT_NAME
,ifnull(faac.billed_division_id,billed_division.divisionid) as BILLED_DIVISION_ID
,billed_division.name as BILLED_DIVI... |
create table dim_scores (
gameid varchar(50),
gamedate timestamp,
lastupdated timestamp,
participant1 varchar(50),
participant1score int,
participant2 varchar(50),
participant2score int,
sport varchar(50),
headlineref varchar(50),
primary key (gameid))
diststyle even
|
create table BURI_BRANCH (
BRANCH_ID bigint not null,
PARENT_BRANCH_ID bigint,
PATH_ID bigint,
DATA_ID bigint,
BT_ID bigint,
PROCESS_DATE timestamp,
VERSION_NO bigint not null,
constraint BURI_BRANCH_PK primary key(BRANCH_ID)
);
|
-- phpMyAdmin SQL Dump
-- version 4.0.10deb1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Apr 30, 2016 at 02:48 PM
-- Server version: 5.5.43-0ubuntu0.14.04.1
-- PHP Version: 5.5.9-1ubuntu4.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CL... |
/*
Navicat MySQL Data Transfer
Source Server : localhost
Source Server Version : 50617
Source Host : localhost:3306
Source Database : db_baby_games
Target Server Type : MYSQL
Target Server Version : 50617
File Encoding : 65001
Date: 2015-08-23 13:42:08
*/
SET FOREIG... |
DROP TABLE IF EXISTS customer_profile;
CREATE TABLE customer_profile (
id INT AUTO_INCREMENT PRIMARY KEY,
first_name VARCHAR(50) NOT NULL,
last_name VARCHAR(50) NOT NULL,
user_id VARCHAR(50) NOT NULL,
phone_number VARCHAR(20) NOT NULL,
email_id VARCHAR(50) NOT NULL
);
INSERT INTO customer_pr... |
/* Code fourni, lignes 236 à 247 */
-- on vérifie les Conditions de traitement du groupe
IF IS_prod=0 -- Base de test
OR -- Ou
-- en prod pour les classements formation non sélectives ou les AEFE
(IS_prod=1 AND indic=10 AND l_g_flh_sel=0)
THEN NULL; -- on laisse passer. Dans tous les autre cas, c'est une erreur... |
CREATE TABLE ireporter_users(
id SERIAL PRIMARY KEY,
email VARCHAR(100) not null,
firstname VARCHAR(50) not null,
lastname VARCHAR(50) not null,
othernames VARCHAR(50) not null,
username VARCHAR(50) not null,
registered VARCHAR(50) not null,
phonenumber VARCHAR(50) not null,
password... |
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 13 Nov 2019 pada 17.57
-- Versi server: 10.3.15-MariaDB
-- Versi PHP: 7.3.6
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHA... |
ALTER TABLE IACUC_PROTOCOL_PRSN_ROLE_MPPNG
ADD CONSTRAINT UQ_IACUC_PERSON_MAPPING
UNIQUE (SOURCE_ROLE_ID, TARGET_ROLE_ID)
/
|
/*
Copyright 2021 Snowplow Analytics Ltd. All rights reserved.
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 a... |
CREATE DATABASE IF NOT EXISTS `strack` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
USE `STRACK`;
-- MySQL dump 10.13 Distrib 5.6.13, for osx10.6 (i386)
--
-- Host: localhost Database: STRACK
-- ------------------------------------------------------
-- Server version 5.5.28
/*!40101 SET @OLD_CH... |
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.7
-- Dumped by pg_dump version 10.7
-- Started on 2019-05-24 18:40:57
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalo... |
-- z_replyLike
DROP TABLE z_replyLike;
-- 좋아요 테이블 // 오라클 //
CREATE TABLE z_replyLike (
reply_num NUMBER(10),
login_ip VARCHAR2(100),
bbs_num NUMBER(10),
CONSTRAINTS z_fk FOREIGN KEY(reply_num) REFERENCES Z_BBsReply(reply_num),
CONSTRAINTS Z_fk2 FOREIGN KEY(bbs_num) REFERENCES Z_BBS(bbs... |
/*
################################################################################
Move entrez gene IDs from the current location in the genomic context into
the gene table directly
Designed for execution with Flyway database migrations tool.
author: Tony Burdett
date: February 19rd 2015
version: 1.9.9.028 (pre... |
-- phpMyAdmin SQL Dump
-- version 5.0.2
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 18, 2020 at 06:30 AM
-- Server version: 10.4.11-MariaDB
-- PHP Version: 7.2.31
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIE... |
/*DELETE FROM users;
DELETE FROM registrationauthorities;
DELETE FROM owners;
DELETE FROM carplates;
DELETE FROM carplates_owners;
--DELETE FROM penalties;
--DELETE FROM insurances;*/
INSERT INTO users values
(1, 'Tomasz', 'Tomaszewski', 'a', 'GLOBAL', 'admin'),
(2, 'Łukasz', 'Łukasiewicz', 'a', 'LOCAL', 'user1'),
(3,... |
insert into user_roles (user_roles_id, role) values (1, 'User');
insert into user_roles (user_roles_id, role) values (2, 'Barber');
insert into user_roles (user_roles_id, role) values (3, 'Admin');
insert into appointment_status (status_id, status) values (1, 'Pending');
insert into appointment_status (status_id, stat... |
USE mysql;
UPDATE user SET plugin='mysql_native_password' WHERE User='root';
FLUSH PRIVILEGES;
CREATE DATABASE IF NOT EXISTS social DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE DATABASE IF NOT EXISTS social_message DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
|
Select *
From PortfolioProjects..NashvilleHousing
--Fixing Date Format
Select SaleDateConverted, CONVERT(Date, SaleDate)
From PortfolioProjects..NashvilleHousing
Update NashvilleHousing
SET SaleDate = CONVERT(Date, SaleDate)
ALTER TABLE NashvilleHousing
Add SaleDateConverted Date;
Update NashvilleHou... |
INSERT INTO public.compras (cod_compra, vlr_compra, quantidade, dta_pedido, forma_pagamento, dta_pagamento, status_pagamento, dta_envio, status_envio)
VALUES(1, 90.00, 10, now(), 'CREDITO', (select now() + interval '1 day'), 'PAGO', (select now() + interval '10 day'), 'ENTREGUE');
INSERT INTO public.compras (cod_compra... |
CREATE TABLE IF NOT EXISTS `test`.`test` (id INT, name VARCHAR(255)); |
-- phpMyAdmin SQL Dump
-- version 4.9.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Waktu pembuatan: 06 Jun 2020 pada 11.57
-- Versi server: 10.4.8-MariaDB
-- Versi PHP: 7.3.10
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARA... |
/* Q1 */
/* SET 1 Q1. We want to understand more about the movies that families are watching.
The following categories are considered family movies: Animation, Children, Classics, Comedy, Family and Music.
Create a query that lists each movie, the film category it is classified in, and the number of times it has been r... |
CREATE TABLE "member_login" (
PRIMARY KEY ("member_id", "login_time"),
"member_id" INT4 NOT NULL REFERENCES "member" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
"login_time" TIMESTAMP WITH TIME ZONE NOT NULL,
"geolat" NUMERIC(10,8), -- Latitude
... |
-- Insert a set of records.
INSERT INTO burgers (burger_name) VALUES ('Poutine on the Ritz Burger');
INSERT INTO burgers (burger_name) VALUES ('The Six Scallion Dollar Man Burger');
INSERT INTO burgers (burger_name) VALUES ('Human Polenta-Pede Burger');
INSERT INTO burgers (burger_name) VALUES ('Home for the Challa-Day... |
SELECT
V1.REPAY_TYPE AS srpRepayType, --还款种类
CODE2.CODE_NAME AS srpRepayTypeName, --还款种类名称
V1.COUPON AS srpCoupon, --期数
V1.SCHEDULE_REPAY_DATE AS srpScheduleRepayDate, --还款预定日
V1.SCHEDULE_REPAY_METHOD AS srpResultRepayMethod, --预定冲销方式 ... |
-- phpMyAdmin SQL Dump
-- version 4.7.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Nov 14, 2017 at 05:24 PM
-- Server version: 10.1.26-MariaDB
-- PHP Version: 7.1.8
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD... |
CREATE TABLE IF NOT EXISTS pastes(
id CHAR(6) PRIMARY KEY,
filetype VARCHAR(16) NOT NULL,
body TEXT NOT NULL
);
|
/* Chapter 3: The FROM Clause */
/* Categories INNER JOIN Entries */
CREATE TABLE categories
(
category VARCHAR(9) NOT NULL PRIMARY KEY
, name VARCHAR(37) NOT NULL
);
INSERT INTO categories
VALUES
( 'blog' , 'Log on to My Blog' )
, ( 'humor' , 'Humorous Anecdotes' )
, ( 'angst' , 'Storie... |
# Write your MySQL query statement below
# Get price of products from each store
WITH
s1 AS (SELECT product_id, price AS store1 FROM Products WHERE Store = 'store1'),
s2 AS (SELECT product_id, price AS store2 FROM Products WHERE Store = 'store2'),
s3 AS (SELECT product_id, price AS store3 FROM Products WHERE Store = ... |
/* Create a new table (file) for out put data. */
CREATE TABLE background AS
/* Define what will be selected. ST_Union('polygon geometry') merges the selected tables.
ST_SnapToGrid('polygon geometry', 'snap distance') eliminates
slivers between polygons. */
SELECT ST_Union(ST_SnapToGrid(geom,0.0001))
/* Decla... |
/* Formatted on 17/06/2014 18:17:42 (QP5 v5.227.12220.39754) */
CREATE OR REPLACE FORCE VIEW MCRE_OWN.VTMCRE0_WRK_ALERT_SO_GEST_INT
(
COD_ABI,
COD_NDG,
COD_SNDG,
COD_STATO,
VAL_ALERT,
COD_PROTOCOLLO_DELIBERA,
VAL_ORDINE_COLORE,
VAL_CNT_DELIBERE,
VAL_CNT_RAPPORTI,
COD_UO_PRATICA
)
AS
SEL... |
-- STEP 0. 테이블 생성 후 IMPORT
CREATE TABLE EXAM
(
SEG1 VARCHAR2 (100),
SEG2 VARCHAR2 (100),
SEG3 NUMBER,
TARGETWEEK NUMBER,
YEAR NUMBER,
WEEK NUMBER,
QTY NUMBER,
FCST_W6 NUMBER,
FCST_W5 NUMBER,
FCST_W4 NUM... |
-- lists all genres from hbtn_0d_tvshows and displays the number of shows linked to each.
SELECT tv_genres.name AS genre, count(tv_show_genres.genre_id) AS number_shows
FROM tv_genres
JOIN tv_show_genres ON tv_show_genres.genre_id = tv_genres.id
GROUP BY tv_genres.name, tv_show_genres.genre_id
ORDER BY count(tv_show_g... |
-- Tạo Database
DROP DATABASE IF EXISTS Exam;
CREATE DATABASE IF NOT EXISTS Exam;
USE Exam;
-- Questions
-- 1. Tạo table với các ràng buộc và kiểu dữ liệu
-- Thêm ít nhất 3 bản ghi vào table
-- tạo table coutry
DROP TABLE IF EXISTS country;
CREATE TABLE IF NOT EXISTS country (
country_id TINYINT UNSIGNED PRIMARY K... |
/*
Navicat Premium Data Transfer
Source Server : localhost
Source Server Type : MySQL
Source Server Version : 80011
Source Host : localhost:3306
Source Schema : test
Target Server Type : MySQL
Target Server Version : 80011
File Encoding : 65001
Date: 06/06/2018 11:36... |
-- SQLINES DEMO *** sktop version to convert large SQL scripts,
-- SQLINES DEMO *** ny issues with Online conversion.
-- SQLINES DEMO *** act us at support@sqlines.com
-- SQLINES DEMO *** ------------------------------------
-- Table `usuarios`
-- SQLINES DEMO *** ------------------------------------
DROP TAB... |
# ************************************************************
# Sequel Pro SQL dump
# Version 4096
#
# http://www.sequelpro.com/
# http://code.google.com/p/sequel-pro/
#
# Host: 127.0.0.1 (MySQL 5.6.14)
# Database: ranguru_yelp_development
# Generation Time: 2013-10-05 21:19:42 +0000
# ********************************... |
INSERT INTO `COMPANIES` (`id`, `name`, `estimateEarnings`, `parent_id`) VALUES
(1, 'Google', 1000, NULL),
(2, 'Apple', 900, NULL),
(3, 'Microsoft', 800, NULL),
(4, 'Skype', 700, 3),
(5, 'Android', 600, 1),
(6, 'Angular', 500, 5),
(7, 'Nokia', 400, 3),
(8, 'Facebook', 300, 4);
|
-- --------------------------------------------------------
-- Host: 127.0.0.1
-- Versión del servidor: 5.7.14 - MySQL Community Server (GPL)
-- SO del servidor: Win64
-- HeidiSQL Versión: 9.4.0.5174
-- --------------------------------------------------------
/*... |
-- see SAP note 838725 for info on system stats
begin
dbms_stats.gather_system_stats('START');
end;
/
|
UPDATE device_id
We''ve realized that the last two parts we''re using for device number 2,
"Gyroscope", actually belong to an "Accelerometer". Write an SQL statement that
will associate the last two parts from our parts table with an "Accelerometer"
instead of a "Gyroscope".
UPDATE parts
SET device_id = 1
WHERE p... |
-- ************************************** dw.dim_dates
INSERT INTO dw.dim_dates
WITH dates AS (
SELECT dd::date AS dt
FROM GENERATE_SERIES
('2016-01-01'::timestamp
, '2020-12-31'::timestamp
, '1 day'::interval) dd
)
SELECT TO_CHAR(dt, 'YYYYMMDD')::in... |
-- phpMyAdmin SQL Dump
-- version 4.6.2
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Dec 13, 2016 at 11:06 AM
-- Server version: 5.6.30-1+deb.sury.org~wily+2
-- PHP Version: 5.6.11-1ubuntu3.4
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET... |
--CREATE TABLE Pokemon
--(
-- Id INT PRIMARY KEY NOT NULL IDENTITY(1,1),
-- [Name] NVARCHAR(25),
-- [Url] NVARCHAR(40),
-- UserId NVARCHAR(450) FOREIGN KEY REFERENCES AspNetUsers(Id)
--);
--Go to tools -> options -> Designers -> Table and Database Designers -> Uncheck (Prevent Saving Changes...)
--Then Right ... |
-- Return cleaned aquifer information.
-- Assume that a NULL in to_depth means it is deeper than the bore.
SELECT
dbo_aqifer_details.bore_id,
dbo_aqifer_details.aquifername,
CASE
WHEN dbo_aqifer_details.from_depth IS NULL THEN
0
ELSE
dbo_aqifer_details.from_depth
END AS from_depth,
CASE
WHEN dbo... |
CREATE TEMPORARY TABLE C4_RAIN AS
WITH RAIN AS (
SELECT SID, dFrom, dTo
FROM (
SELECT date_time AS dTo, precip_accum_one_hour_set_1 AS currP1,
lag(date_time, 1) OVER (PARTITION BY station_id ORDER BY date_time) AS dFrom,
lag(precip_accum_one_hour_set_1) OVER (PARTITION BY station_id ORDER BY date_time) AS prevP1,
sta... |
SELECT
{{#if column}}
COUNT({{column}}) as total_entries,
{{else}}
COUNT(*) as total_entries,
{{/if}}
{{per_page}} as per_page,
{{#if page}}
{{page}} as page
{{else}}
1 as page
{{/if}}
|
-- t_alert_log
DROP TABLE IF EXISTS t_alert_log;
CREATE TABLE t_alert_log
(
id bigint NOT NULL AUTO_INCREMENT,
alert_id bigint NOT NULL COMMENT '警情 id',
user_id bigint NOT NULL COMMENT '用户 id',
reference_id bigint default NULL COMMENT '根据 log_type 不同,object id 会有不同的含义。',
log_type tinyint(4) unsigned NOT NULL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.