text
stringlengths
6
9.38M
--County Data with Populations, Deaths and Cases WITH cases AS ( SELECT JHU.FIPS, JHU.PROVINCE_STATE, JHU.COUNTY, JHU.DATE, GEOSQL.COUNTY_POPULATION, SUM(JHU.CASES) AS COUNTY_CASES, DIV0(COUNTY_CASES,GEOSQL.COUNTY_POPULATION) AS CASES_PER_CAPITA_COUNTY, CASES_PER_CAPITA_COUNTY * 100000 AS CASES_PER_100K ...
-- phpMyAdmin SQL Dump -- version 4.7.7 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 27, 2018 at 02:10 PM -- Server version: 10.1.30-MariaDB -- PHP Version: 7.2.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD...
INSERT INTO UserTypes(Name) VALUES ('Client'); INSERT INTO UserTypes(Name) VALUES ('Admin');
select substr('qwertyqwerty', 2,3) ,substr('qwertyqwerty', 3) ,substr('qwertyqwerty', -1) ,substr('qwertyqwerty', -5,3) ,instr('abcdefcd','cd') ,instr('abcdefcd','cd',4) ,replace('qwertyqwqw', 'qw',1) ,replace('qwertyqwqw', 'qw') ,translate('abcdeedcba', 'bcde', '1234') ,reverse('Hello world!') ...
ALTER TABLE `class` DROP `school_id`;
-- -- Table structure for table `address` -- CREATE TABLE address ( id number NOT NULL, city varchar(255) DEFAULT NULL, country varchar(255) DEFAULT NULL, state varchar(255) DEFAULT NULL, street varchar(255) DEFAULT NULL, zip_code varchar(255) DEFAULT NULL, PRIMARY KEY (id) ); -- -- Table structure for t...
/* Formatted on 21/07/2014 18:40:40 (QP5 v5.227.12220.39754) */ CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCREI_APP_QUADRO_SINT_SNDG ( COD_PROTOCOLLO_PACCHETTO, COD_MICROTIPOLOGIA_DELIB, COD_PROTOCOLLO_DELIBERA, COD_FASE_PACCHETTO, COD_FASE_MICROTIPOLOGIA, COD_ABI, COD_NDG, COD_SNDG, DESC_ISTIT...
DROP TABLE IF EXISTS `offices`; DROP TABLE IF EXISTS `employees`; DROP TABLE IF EXISTS `certifications`; DROP TABLE IF EXISTS `project_data`; DROP TABLE IF EXISTS `employee_cert`; DROP TABLE IF EXISTS `works_on`; -- Create a table called offices with the following properties: -- city - varchar with a max of 255 ch...
DROP TABLE IF EXISTS wf_workflow_nodes; -- CREATE TABLE wf_workflow_nodes ( id INT NOT NULL AUTO_INCREMENT, doctype_id INT NOT NULL, docstate_id INT NOT NULL, ac_id INT, workflow_id INT NOT NULL, name VARCHAR(100) NOT NULL, type ENUM('begin', 'end', 'linear', 'branch', 'joinany', 'joinall'...
UPDATE products SET (name, price, img) = ($2, $3, $4) WHERE id = $1;
-- phpMyAdmin SQL Dump -- version 4.6.6deb5 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Apr 07, 2019 at 10:42 PM -- Server version: 5.7.22-0ubuntu0.17.10.1 -- PHP Version: 7.1.17-0ubuntu0.17.10.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHA...
-- IN Statements -- value IN (value1,value2,....), also NOT IN -- SELECT customer_id,rental_id,return_date FROM rental WHERE customer_id IN (1,2,7,10,13) ORDER BY return_date DESC; -- SELECT * FROM payment WHERE amount IN (7.99,8.99);
insert into public.wo (wo_jsonb) values ($1::jsonb - '{wo_updatedby,wo_deliverydate,wo_exportationinvoice,wo_shippinglist,wo_cancellationnotes,wo_originalqty,wo_originalfoliosfrom,wo_split}'::text[]) returning wo_id, wo_jsonb, wo_date, wo_lastupdated;
CREATE TABLE art ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT UNIQUE, user_id TEXT NOT NULL, title TEXT NOT NULL UNIQUE, artist TEXT NOT NULL, buyer TEXT NOT NULL, seller TEXT NOT NULL, created_date INTEGER NOT NULL, sale_date TEXT NOT NULL, price REAL NOT NULL, file_name TEXT NOT NULL UNIQUE, ...
-- indices will greatly slow down insertion. do this only after the table is populated. CREATE INDEX IF NOT EXISTS raw_logs_model on raw_logs (model);
--Se crea la tabla, par aahcer un correlativo se usa IDENTITY(1,1) EMPIEZA EN 1 Y VA DE 1 EN 1 Create table LiquidacionesFranciscoArmijo ( Correlativo int not null identity(1,1) primary key, Rut_trabajador varchar(10) not null, Nombre_trabajador varchar (50) not null, Mes_remuneracion varchar (10) not null, Ano_r...
-- liquibase formatted sql -- changeset mychangeset:1.0.3 ALTER TABLE mydb.department add column dept_desc varchar(20);
insert into `product` (`Name`,`Image`,`Description`,`Visibility`) values /*Cà phê*/ ('Espresso / Americano','.','Classical Coffee','Public'), ('Latte / Cappucino','.','Classical Coffee','Public'), ('Mocha / Caramel Macchiato','.','Classical Coffee','Public'), ('Cà Phê Đen','.','Vietnamese Coffee','Public'), ('Cà Phê Sữ...
INSERT INTO `forum` VALUES (1, 'How to prevent stomachache', '123', 'I feel stomachache these days', 10); INSERT INTO `forum` VALUES (2, 'How to reduce headache', '231', '23', 23); INSERT INTO `forum` VALUES (3, 'HOW', '123', 'HOW ARE YOU', 0); INSERT INTO `forum` VALUES (4, 'm', '123', 'mk', 0);
insert into smoke_test (task_id, test_input, expected_output, author, title) values (1000, E'-5\n5\n', '0', 1, 'Smoke test # 1'); insert into smoke_test (task_id, test_input, expected_output, author, title) values (1000, E'10\n10\n', '20', 1, 'Smoke test # 2'); insert into smoke_test (task_id, test_input, exp...
create table contas ( codigo integer primary key, descricao varchar(100), saldo numeric(15,2) )
DROP DATABASE IF EXISTS bamazon_db; CREATE DATABASE bamazon_db; USE bamazon_db; CREATE TABLE products( item_id INT NOT NULL AUTO_INCREMENT, product_name VARCHAR(100) NOT NULL, department_name VARCHAR(100) NOT NULL, price DECIMAL(20,2), stock_quantity INT, PRIMARY KEY(item_id) ); INSERT INTO products (pr...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 08-10-2020 a las 20:29:05 -- Versión del servidor: 10.4.11-MariaDB -- Versión de PHP: 7.4.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_...
SELECT sess.session_id, sess.host_name, sess.program_name, sess.last_request_start_time, sess.last_request_end_time, sqltext.text FROM sys.dm_exec_sessions AS sess INNER JOIN sys.dm_exec_connections AS conn ON sess.session_id = conn.session_id CROSS APPLY sys.dm_exec_sql_text(conn.most_recent_sql_hand...
--1. What are the standard ingredients for each pizza?-- WITH recipe_cleaned AS (SELECT pizza_id ,CAST(UNNEST(STRING_TO_ARRAY(toppings,', ')) as INT) as topping_id FROM pizza_runner.pizza_recipes) SELECT topping_name,COUNT(*) FROM pizza_runner.pizza_toppings JOIN recipe_cleaned USING (topping_...
PRAGMA foreign_keys = off; BEGIN TRANSACTION; INSERT INTO Currency (id, name, symbol, "left") VALUES ('PLN', 'polski złoty', ' zł', 0); COMMIT TRANSACTION; PRAGMA foreign_keys = on;
SELECT A.WITHDRAW_DATE AS WITHDRAW_DATE, A.ACCOUNT_NO AS ACCOUNT_NO, SUM(ISNULL(A.WITHDRAW_AMOUNT,0)) AS WITHDRAW_AMOUNT FROM ( SELECT CASE WHEN A.WITHDRAW_STATUS = CAST(/*dto.withdrawStatusSearchWithdrawed*/ AS CHAR(1)) THEN --CASE A.回収ステータス = 回収済 A.WITHDRAW_RESULT_DATE --A....
CREATE DATABASE IF NOT EXISTS YeovilHealthcare DEFAULT CHARACTER SET utf8; USE YeovilHealthcare; CREATE TABLE IF NOT EXISTS YeovilHealthcare.Brand ( Brand_ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, Brand_Name CHAR(100) ); CREATE TABLE IF NOT EXISTS YeovilHealthcare.Product ( Product_ID INT NOT NULL AUTO_INC...
-- Lesson 16: Updating and Deleting Data -- how to use the UPDATE and DELETE statements to enable further manipulation of table data -- Updating Data -- Don't omit the WHERE clause -- Three parts: -- table to be updated, -- the column names and their new values, -- the filter condition that det...
SET FOREIGN_KEY_CHECKS = 0; -- ---------------------------------------------------------------------------- -- Table department -- ---------------------------------------------------------------------------- CREATE TABLE IF NOT EXISTS department ( deptno VARCHAR(50) NOT NULL, created_date TIMESTAMP NOT N...
create nonclustered index btime_index on H_Datas(btime); create nonclustered index traff_index on H_Datas(H_traff); create nonclustered index dis_index on Distance(distance); CREATE DATABASE GSM ON PRIMARY ( NAME = GSM1, --主文件 FILENAME = 'c:\program files\microsoft sql server \mssql.1\mssql\data\GSM1.mdf', SIZE = ...
CREATE TABLE smsdss.c_HCRA_Static_Data_2016 ( PK INT NOT NULL IDENTITY(1, 1) PRIMARY KEY , [Reference Number] VARCHAR(15) , [System] VARCHAR(10) , [MRN] VARCHAR(8) , [Admit Date] DATE , [Discharge Date] DATE , [Payor Code] VARCHAR(50) , [Payor Code Description] VARCHAR(50) , [Payor Sub-Code] VARCHAR(2...
SELECT city, count(reservations) AS total_reservations FROM properties JOIN reservations ON properties.id = property_id GROUP BY city ORDER BY total_reservations DESC LIMIT 10; -- LH method -- SELECT properties.city, count(reservations) as total_reservations -- FROM reservations -- JOIN properties ON property_i...
--1.How do you get all users from Chicago? SELECT * FROM "accounts" WHERE "city" = 'chicago'; --2.How do you get all users with usernames that contain the letter a? SELECT * FROM "accounts" WHERE "username" ILIKE '%a%'; --3.The bank is giving a new customer bonus! How do you update all records with an account balanc...
drop database if exists prototype1603; create database prototype1603; use prototype1603; create table user( id int not null primary key auto_increment, name varchar(32), email varchar(255), password varchar(255), uniqueId varchar(50), oauthName varchar(15) ); insert into user values("1","taro","...
-- phpMyAdmin SQL Dump -- version 4.8.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 13-08-2019 a las 02:52:14 -- Versión del servidor: 10.1.34-MariaDB -- Versión de PHP: 5.6.37 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00";...
truncate table "TransferTaskCoordinatorProcessLog"; delete from "TransferInterfaceProcessLogInput"; delete from "TransferInterfaceProcessLog"; -- Step 1 DetermineSearchScopeForSiraBatch SELECT pl."CreatedOn", pl."TransferInterfaceProcessLogID", pl."TransferInterfaceReferenceNumber", tis."Name" as "StepName", ...
-- APPLICATION DETAIL SCHEMA SCRIPT
--@Autor: Berdejo Arvizu Oscar || Olmos Cruz Edwin --@Fecha creación: 25/10/2018 --@Descripción: Creacion De Tablas --Usuario Admin: baoc_proy_admin --Usuario Invitado: baoc_proy_invitado Prompt conectando como usuario baoc_proy_admin connect baoc_proy_admin Prompt creando objetos --1 CREATE TABLE CARRERA( CARRERA_I...
SELECT student_id, MIN(course_id) AS course_id, grade FROM Enrollments WHERE (student_id, grade) IN (SELECT student_id, MAX(grade) FROM Enrollments GROUP BY student_id) GROUP BY student_id ORDER By student_id;
--How many employees --work in each project? (project_name, number) select project.name as nome, count(works.id_pro) as number from employee join works on employee.id = works.id_emp join project on project.id = works.id_pro group by project.id;
--Install Command: source ~/workspace/install.sql CREATE TABLE IF NOT EXISTS customers( custid INT AUTO_INCREMENT PRIMARY KEY, firstname VARCHAR(30) NOT NULL, lastname VARCHAR(30) NOT NULL, email VARCHAR(30) NOT NULL, phone VARCHAR(11), address VARCHAR(50), city VARCHAR(20), state CHAR(2) DEFAULT 'WI', zip VARCHAR(5)...
CREATE DATABASE IF NOT EXISTS `my_library`; CREATE DATABASE IF NOT EXISTS `my_library_test`; GRANT ALL ON `my_library`.* TO 'user'@'%';
-- -- Table structure for table "hourly" -- DROP TABLE IF EXISTS "hourly"; CREATE TABLE "hourly" ( "hr_id" varchar(10) NOT NULL, "emp_id_hr" varchar(45) DEFAULT NULL, "hr_rate" int(10) DEFAULT NULL, "note" varchar(45) DEFAULT NULL, PRIMARY KEY ("hr_id"), -- KEY "emp_id_hr_idx" ("emp_id_hr"), CONSTRAINT...
/*!40101 SET NAMES binary*/; /*!40014 SET FOREIGN_KEY_CHECKS=0*/; /*!40103 SET TIME_ZONE='+00:00' */; INSERT INTO `wp_terms` VALUES (1,"Uncategorized","uncategorized",0), (2,"Blog","blog",0), (3,"Download","download",0), (4,"Offer","offer",0), (5,"What\'s New","whats-new",0), (6,"Download","download",0), (7,"423","423"...
SELECT name, weight, price, (round((price/(weight * 1./1000.)) ::numeric, 2) ::double precision) AS price_per_kg FROM products ORDER BY price_per_kg, name;
/* Copyright (c) 2016-2022 Taras Guliak XDBTIME All rights reserved. Version: 2022.01 SQL script to show available DBIDs. Example: SQL> @xdbawrlistdbid.sql DBID INSTANCE_NUMBER MIN_BEGIN_TIME MAX_END_TIME _____________ __________________ ______...
/* * View: check_lost_instrumentation * * Used to check whether Performance Schema is not able to monitor * all runtime data - only returns variables that have lost instruments * * Versions: 5.5+ */ DROP VIEW IF EXISTS check_lost_instrumentation; CREATE SQL SECURITY INVOKER VIEW check_lost_instrumentation AS ...
INSERT INTO burgers (burger_name) VALUES ('Double Cheese Burger'); INSERT INTO burgers (burger_name) VALUES ('Guacomole Burger'); INSERT INTO burgers (burger_name) VALUES ('Whiskey River Burger');
select * from produto; delete produto; drop sequence id_produto; create sequence id_produto start with 1 increment by 1; select * from produto; select * from ( (select e.*,rownum rn from (select * from produto order by idproduto) e where rownum <= 210) ) where rn >= 1;
/* Source Server : Local Sever Source Server Type : MariaDB Source Server Version : 100017 Source Host : localhost Source Database : yayoi Target Server Type : MariaDB Target Server Version : 100017 File Encoding : utf-8 Date: 05/20/2015 19:19:08 PM */ SET NAMES utf8; S...
ALTER TABLE `#__itpm_urls` CHANGE `id` `id` INT UNSIGNED NOT NULL AUTO_INCREMENT; ALTER TABLE `#__itpm_tags` CHANGE `id` `id` INT UNSIGNED NOT NULL AUTO_INCREMENT;
-- SCRIPT DE CREATION DE L'ENTREPOT DE DONNEES POUR LES SCHEMAS EN ETOILES DES FAITS DE VENTES ET D'ACHATS -- author : Djebien Tarik -- date : 29/10/2011 -- DIMENSION TEMPS create table temps ( id_temps number(20) constraint temps_pkey primary key, semaine number(1) constraint semaine_enum check (semaine in (1,2,3,4))...
-- Catégories badge insert into category_badge(name) values('FAVOURITE'); insert into category_badge(name) values('COMMENT'); insert into category_badge(name) values('SCAN'); insert into category_badge(name) values('ADDITION'); -- Comments insert into badge (id, name, category_name, description, image, image_grey) va...
CREATE PROCEDURE [ERP].[Usp_Sel_TransformacionMermaDetalle_By_IdTransformacion] @IdTransformacion INT AS BEGIN SELECT TMD.ID, TMD.IdTransformacion, TMD.IdProducto, TMD.Lote, TMD.FlagAfecto, TMD.Cantidad, TMD.PrecioUnitario, TMD.SubTotal, TMD.IGV, TMD.Total, UPPER(P.CodigoReferencia) AS CodigoRef...
SELECT A.VentaID, A.LoteID, iif(B.TipoVentaID IN ('02','03'), 'SIN ESTADO', iif(A.TotalCobrado=A.TotalVenta,'CANCELADO','PENDIENTE')) AS ESTADO FROM (SELECT A.VentaID, A.LoteID, MAX(Venta) AS TotalVenta, iif(isnull(SUM(Monto)),0,SUM(Monto)) AS TotalCobrado FROM (SE...
DROP DATABASE IF EXISTS `timeTracker`; CREATE DATABASE IF NOT EXISTS `timeTracker`; GRANT ALL PRIVILEGES ON `timeTracker`.* TO 'username'@'localhost'; USE `timeTracker`;
create table stats ( player_name varchar(40) primary key, games_played int, minutes_played int, field_goals_made int, field_goals_attempted int, points int, rebounds int, assists int, steals int, blocks int, turnovers int ) create table salaries ( player_name varchar(40), salary varchar ) select * from s...
-- database dump from hbtn_0d_tvshows to your MySQL server: download (same as 12-no_genre.sql) SELECT name AS genre, COUNT(*) AS number_of_shows FROM tv_show_genres INNER JOIN tv_genres ON tv_show_genres.genre_id = tv_genres.id GROUP BY tv_genres.name ORDER BY number_of_shows DESC;
/* normally there should be only 2 rows per statid with system stats it is possible to have more than 2 if importing data, and the same data is imported more than one time, leading to partial cartesian joins */ set pagesize 100 set linesize 200 trimspool on col statid format a30 col start_time format a16 col end_time...
/** * SQL for update BY_SHISETSU_MEDICAL_TYPE * @author TuyenVHA * @version $Id: ShisetsuCareMedicalService_updateByShisetsuMedicalType_Upd_01.sql 10482 2014-07-02 13:29:37Z p__toen $ */ UPDATE BY_SHISETSU_MEDICAL_TYPE BSMT SET BSMT.MEDICAL_INFECTION_ABL_KBN = /*medicalInfectionAblKbn*/'1' ,BSMT.MEDICAL_INF...
drop table if EXISTS Appointment; DROP TABLE IF EXISTS User; drop table if EXISTS Customer; drop table if EXISTS Address; drop table if EXISTS City; drop table if EXISTS Country; CREATE TABLE User( userId int auto_increment, userName varchar(50), password varchar(50), active tinyint(1), createdBy varchar(40...
DELETE FROM sqldados.nfdevFile WHERE storeno = :storeno AND pdvno = :pdvno AND xano = :xano AND date = :date AND nome = :nome
/* Formatted on 21/07/2014 18:32:31 (QP5 v5.227.12220.39754) */ CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRE0_APP_ALERT_OD_INFERIORE ( VAL_ALERT, DTA_INS_ALERT, VAL_ORDINE_COLORE, COD_ABI_CARTOLARIZZATO, COD_ABI_ISTITUTO, COD_COMPARTO_POSIZIONE, COD_COMPARTO_UTENTE, COD_GRUPPO_ECONOMICO, COD_...
create table project_broker ( "id" uuid PRIMARY KEY DEFAULT uuid_generate_v1(), "created_at" timestamptz NOT NULL DEFAULT now(), "updated_at" timestamptz NOT NULL DEFAULT now(), "project_id" uuid NOT NULL, "broker_id" uuid NOT NULL, "authorized_by_party_id" uuid NOT NULL, "signer_id" uuid NOT NULL ); ALT...
CREATE TABLE [ERP].[ValeTransferenciaDetalle] ( [ID] BIGINT IDENTITY (1, 1) NOT NULL, [IdProducto] INT NULL, [IdValeTransferencia] INT NULL, [Nombre] VARCHAR (250) NULL, [FlagAfecto] BIT NULL, [Cantid...
DROP TABLE IF EXISTS `url`; CREATE TABLE `url` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT, `base_url` TEXT NOT NULL );
drop table if exists gps; drop table if exists wait; create table gps (id integer primary key autoincrement, name string not null, time datetime default (datetime('now', 'localtime')), latlng string not null, temperature integer, humidity integer); create table wait (id integer primary key autoincrement, time dateti...
SELECT EMPLOYEES.eid, EMPLOYEES.ename, EMPLOYEES.salary, CERTIFIED.eid, CERTIFIED.aid FROM EMPLOYEES,CERTIFIED WHERE CERTIFIED.eid=EMPLOYEES.eid
CREATE TABLE fixedasset ( id INT NOT NULL AUTO_INCREMENT, uniqueNumber VARCHAR(100) NOT NULL, originalWorth DOUBLE NOT NULL, lifetime VARCHAR(50), startDate VARCHAR(50), PRIMARY KEY (id) ); CREATE TABLE depreciation ( id INT NOT NULL AUTO_INCREMENT, accountDay VARCHAR(100) NOT NULL, ...
CREATE TABLE Subreddits ( id varchar(10) PRIMARY KEY, display_name varchar(30) ); CREATE TABLE Submissions ( id VARCHAR(10) PRIMARY KEY, author_name VARCHAR(50), created_utc TIMESTAMP, num_comments INTEGER, score INTEGER, selftext VARCHAR(50000), subreddit_id VARCHAR(10), title VARCHAR(500), upvote_ratio NU...
CREATE PROC [ERP].[Usp_Sel_FechaActual] AS BEGIN SELECT [ERP].[ObtenerFechaActual]() END
alter table devcode_transactions add fee bigint, add fee_currency character varying(3), add psp_amount bigint, add psp_currency character varying(3);
set @instance = "nci100400"; load data local infile '/Users/Jan/Uni/Stanford/ICD/data_nci/nci_category.txt' replace into table icd_category (name, display, sorting_label, definition, display_status, primary_tag, secondary_tag) set instance_name=concat(@instance, name), instance=@instance; load data local infile '/...
select ticker_code, max(date), min(date) from "historical_price" group by ticker_code having max(date) > (CURRENT_DATE + INTERVAL '-1 year') order by min(date) desc;
DROP TABLE IF EXISTS repositories; CREATE TABLE repositories ( id int(11) NOT NULL AUTO_INCREMENT, name VARCHAR(255) DEFAULT NULL, url varchar(255) DEFAULT NULL, metadataPrefix varchar(255) DEFAULT NULL, oai_set varchar(50) DEFAULT NULL, datestamp varchar(50) DEFAULT NULL, schedule int(11) NOT NULL, en...
CREATE TABLE `product_images` ( `image_id` int(11) NOT NULL AUTO_INCREMENT, `product_id` int(11) NOT NULL, `path` varchar(255) NOT NULL, PRIMARY KEY (`image_id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1
-----------trigger dropUser--------------- /* Consideration: 1. If a user delted for the db (profile): 1.1 Table friends -> all the enteries will be delete hence unfiended 1.2 Table pendingGroupmembers -> all the pending will be delted 1.3 Table pendingFriends -> all pending requestis will be deleted 1.4 T...
INSERT INTO usuarios (id, nombre, Apellidos, Edad, Direccion) VALUES (3, 'Jose Antonio', 'Galán', 21, 'C/La mua'); INSERT INTO cursos (codigo_curso, nombre, Descripcion, Horas_duracion) VALUES (5, 'ASIR', 'Curso de Administracion Redes', 150); INSERT INTO aula (nombre, Capacidad, Planta, Descripción) VALUES ...
#进阶3:排序查询 /* 语法: select 查询列表 from 表名 [where 筛选条件] order by 排序的字段或表达式; 特点: 1.asc代表的是升序,可以省略,desc代表的式降序 2.order by子句可以支持单个字段、别名、代表式、函数、多个字段 3.order by字句在查询语句中的最后面,除了limit子句 */ #案例1:查询员工的工资,从高到低排序 SELECT salary AS 工资 FROM employees ORDER BY salary DESC; SELECT salary AS 工资 FROM employees ORDER BY salary; #案例2:查询部门编号...
-- phpMyAdmin SQL Dump -- version 4.9.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Waktu pembuatan: 19 Des 2020 pada 07.55 -- Versi server: 5.7.24 -- Versi PHP: 7.2.19 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTE...
/*https://platform.stratascratch.com/coding-question?id=9905&python=*/ select first_name,target from salesforce_employees where manager_id = 13 and target = (select max(target) from salesforce_employees where manager_id = 13 );
# This is a fix for InnoDB in MySQL >= 4.1.x # It "suspends judgement" for fkey relationships until are tables are set. SET FOREIGN_KEY_CHECKS = 0; -- --------------------------------------------------------------------- -- autor -- --------------------------------------------------------------------- DROP TABLE IF ...
-- MySQL Script generated by MySQL Workbench -- 12/09/15 11:22:04 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering -- author: @bkupfer 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,...
with source_data as ( select shipper_id , company_name , phone /* Stitch extration */ , _sdc_extracted_at as last_elt_extract , _sdc_received_at , _sdc_sequence , _sdc_batched_at , _sdc_table_version from {{ source('northwind_etl','...
ALTER TABLE eth_events ADD COLUMN tx_hash VARCHAR; ALTER TABLE eth_events ADD COLUMN tx_index INTEGER; ALTER TABLE eth_events ADD COLUMN log_index INTEGER;
<<<<<<< HEAD select timestamp,message from v$dataguard_status where dest_id = 2 and timestamp > sysdate - 10/1440; select dest_id,status,error from v$archive_dest where dest_id=2; col value for a25 select name,VALUE,TIME_COMPUTED,DATUM_TIME from v$dataguard_stats where name in ('transport lag','apply lag','apply ...
set echo off newpage 0 space 0 pagesize 32767 feed off head off underline off trimspool on termout off linesize 4000 -------------------------------------------------------- -- DDL for Table CUSTOMER -------------------------------------------------------- CREATE TABLE "BBPORTAL"."CUSTOMER" ( "CUSTOMER_ID" NUMBE...
create schema mpg; use mpg; select * from data; # 10 mobil paling irit select * from data order by mpg desc limit 10; # 10 mobil paling boros select * from data order by mpg asc limit 10; # perbandingan avg mpg, avg horsepower,avg displacement berdasarkan origin select origin,avg(mpg), avg(horsepower), avg(displ...
SELECT DISTINCT S_CLASS_CD, S_CLASS_NM FROM INDUSTRY_MST WHERE 1 = 1 AND M_CLASS_CD = /*mClassCd*/ ORDER BY S_CLASS_CD
CREATE TABLE "lols" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "vanne_id" integer, "membre_id" integer, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL); CREATE TABLE "membres" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "pseudo" varchar(255), "hashed_passwd" varchar(255), "salt" varchar(255...
/* Formatted on 21/07/2014 18:46:59 (QP5 v5.227.12220.39754) */ CREATE OR REPLACE FORCE VIEW MCRE_OWN.X_MCRES_APP_RAPPORTI_CHIUSI ( COD_ABI, COD_NDG, COD_PROTOCOLLO_DELIBERA, COD_RAPPORTO, VAL_ESPOSIZIONE, VAL_STIMA_RETT, DTA_ULTIMA_STIMA_RETT, DESC_CAUSA_PREV_RECUPERO, FLG_PRES_PIANO, DTA...
/* Formatted on 17/06/2014 18:10:23 (QP5 v5.227.12220.39754) */ CREATE OR REPLACE FORCE VIEW MCRE_OWN.V_MCRES_APP_EVIDENZE ( COD_ABI, DESC_ISTITUTO, COD_NDG, COD_SNDG, DESC_NOME_CONTROPARTE, COD_LABEL, DESC_TIPO_EVIDENZA, COD_UO_PRATICA, DESC_UO_PRATICA, COD_MATR_PRATICA, DESC_NOME_GEST...
drop table if exists covid; create table covid ("fips" float8, "Total Cases" int, "Total Deaths" int, "Count" int); copy covid from 'C://temp/us_counties_final_data.csv' csv header; select * from covid; drop table if exists lau; create table lau ( "LAUS Code" varchar, "State FIPS Code" varchar...
spool roles.log set echo on CREATE ROLE RCARTAO; CREATE ROLE DBA_PROD; CREATE ROLE PLUSTRACE; CREATE ROLE RL_ADM_CARTAO; CREATE ROLE RL_SUPORTE_TI; CREATE ROLE RL_SUPORTE_TI_DML; CREATE ROLE RL_SUPORTE_TI_EXEC; spool off
CREATE TABLE admin_table ( adminid character varchar(41) NOT NULL, firstname character varchar(500) NOT NULL, lastname character varchar(500) NOT NULL, password character varchar(500) NOT NULL, email character varchar(500) NOT NULL, lastupdatedon timestamp without time zone NOT NULL, create...
-- phpMyAdmin SQL Dump -- version 4.7.4 -- https://www.phpmyadmin.net/ -- -- Hôte : 127.0.0.1:3306 -- Généré le : ven. 08 fév. 2019 à 10:47 -- Version du serveur : 5.7.19 -- Version de PHP : 5.6.31 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SE...
CREATE OR REPLACE VIEW V_EDIT_MAN_WATERWELL AS SELECT T1.ID_POUS node_id, CASE T1.ID_POUS WHEN 37 THEN 'SANT_JAUME' ELSE CAST(T1.CODI_POU AS VARCHAR2(16)) END code, CASE T1.COTA WHEN 0 THEN NULL ELS...
CREATE TABLE IF NOT EXISTS orders ( id bigint primary key auto_increment not null , fn varchar(255) not null ); truncate orders ;
SELECT 'projects: SN-->MN' AS FD, CASE WHEN COUNT(*)=0 THEN 'Gildir' ELSE 'Gildir ekki' END AS VALIDITY FROM( SELECT SN FROM projects GROUP BY SN HAVING COUNT(DISTINCT MN) > 1 ) X;