text
stringlengths
6
9.38M
-- Populate real tables from meta (IM v1) INSERT IGNORE INTO map_node (node, concept, draft) SELECT DISTINCT m.node, c.dbid, false FROM map_node_meta m JOIN concept c ON c.id = m.concept; -- INSERT IGNORE INTO map_context (provider, `system`, `schema`, `table`, `column`, node, draft) SELECT prv.dbid, sys.db...
-- phpMyAdmin SQL Dump -- version 4.1.12 -- http://www.phpmyadmin.net -- -- Хост: 127.0.0.1 -- Время создания: Дек 26 2015 г., 14:09 -- Версия сервера: 5.6.16 -- Версия PHP: 5.5.11 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!4...
CREATE TEMPORARY TABLE twitter_user ( user_id bigint NOT NULL PRIMARY KEY, user_name varchar(20) NOT NULL, created_on timestamp NOT NULL, ); CREATE TEMPORARY TABLE mentions ( tweet_id bigint NOT NULL PRIMARY KEY, created_on timestamp NOT NULL, text varchar(160) NOT NULL, user_name varchar(20) NOT NULL )...
SET foreign_key_checks = 0; drop table if exists employee; drop table if exists phone_number_employee; drop table if exists receptionist; drop table if exists doctor; drop table if exists nurse; drop table if exists client; drop table if exists phone_number_client; drop table if exists permanent_doctor; drop table if e...
drop table BURI_STATE_USER;
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Jul 14, 2021 at 07:27 PM -- Server version: 10.4.17-MariaDB -- PHP Version: 8.0.1 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
BEGIN TRANSACTION; UPDATE corporate SET eps = 0.2375 WHERE year =1996 AND month = 1 AND day = 31 AND ticker = "BNS"; UPDATE corporate SET eps = 0.2525 WHERE year =1996 AND month = 4 AND day = 30 AND ticker = "BNS"; UPDATE corporate SET eps = 0.26 WHERE year =1996 AND month = 7 AND day = 31 AND ticker = "BNS"; UPD...
DROP DATABASE IF EXISTS `cafe`; # Usunięcie potencjalnie istniejącej bazy danych CREATE DATABASE `cafe`; # Utworzenie nowej bazy danych USE `cafe`; # Wybranie interesującej nas bazy, umożliwi to wykonywanie na niej wszelkich operacji # Tworzenie tabel DROP TABLE IF EXISTS `Employee`; # Usunięcie potencjalnie istniej...
/* Testing drop server with data */ SELECT * FROM profile.drop_server('local'); DROP EXTENSION pg_profile; DROP EXTENSION pg_stat_kcache; DROP EXTENSION pg_stat_statements; DROP EXTENSION dblink; DROP SCHEMA profile; DROP SCHEMA dblink; DROP SCHEMA statements; DROP SCHEMA kcache;
SELECT wd.DepositGroup, wd.IsDepositExpired, AVG(wd.DepositInterest) AS [AverageInterest] FROM WizzardDeposits AS wd WHERE wd.DepositStartDate > '01/01/1985' GROUP BY wd.DepositGroup, wd.IsDepositExpired ORDER BY wd.DepositGroup DESC, wd.IsDepositExpired
/* Navicat MySQL Data Transfer Source Server : 连接1 Source Server Version : 80019 Source Host : localhost:3306 Source Database : demo1_login Target Server Type : MYSQL Target Server Version : 80019 File Encoding : 65001 Date: 2020-02-16 15:01:53 */ SET FOREIGN_KEY_CH...
CREATE DATABASE IF NOT EXISTS `test_db` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; USE `test_db`; DROP TABLE IF EXISTS `role`; CREATE TABLE `role` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '角色id', `rolename` varchar(20) NOT NULL COMMENT '角色名称', `description` varchar(50) DEFAULT NULL COMMENT '备注信息'...
-- Create a table named "users" with the following columns: -- fullname (string) -- username (string) unique, max length = 15 -- email (string) primary key -- password (string) -- created_at (timestamp) default to current timestamp -- -- Write your query below:...
/* Fysiek ontwerp v0.3 Secundaire indexen referentie Implementatiemodel v0.5 */ -- PRODUCT /* Afgezien van de PK is de verwachting dat er veel gezocht zal gaan worden op Product_type_code en/ of Product_name. */ CREATE INDEX idx_Product_type_code ON product (Product_type_code ASC); CREATE INDEX idx_...
create index mc_sha1 on media_content(sha1_checksum(40));
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Nov 07, 2020 at 11:26 PM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.5 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
Create database faculty; use faculty; create user 'admin'@'%' IDENTIFIED BY 'admin123'; create user 'system'@'%' IDENTIFIED BY 'system123'; create user 'john'@'%' IDENTIFIED BY 'passw0rd'; GRANT ALL PRIVILEGES ON faculty. * TO 'admin'@'%'; GRANT ALL PRIVILEGES ON faculty. * TO 'system'@'%'; GRANT ALL PRIVILEGES ON fac...
DELIMITER $$ USE `cci_gh_go_dev`$$ DROP PROCEDURE IF EXISTS `SPFieldStaffWQTypeAggregate`$$ CREATE DEFINER=`madhavi`@`%` PROCEDURE `SPFieldStaffWQTypeAggregate`() BEGIN DECLARE fs_done INT DEFAULT 0; DECLARE goId INT; DECLARE cciId CURSOR FOR SELECT fieldStaffGoId FROM FieldStaff; DECLARE CONTINUE HANDLER FOR NOT F...
CREATE DATABASE IF NOT EXISTS blog_samples; USE blog_samples; -- -- Table structure for table `customers` -- CREATE TABLE IF NOT EXISTS `tblciudades` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, PRIMARY KEY (`id`) ); -- -- Dumping data for table `tblciudades` -- INSERT INTO `tblciu...
create table funcionarios ( id int not null auto_increment primary key, nome varchar(30) NOT NULL, nascimento date, sexo enum ('M','F', 'Outro'), peso decimal(5,2), altura decimal(3,2), dia_cadastro TIMESTAMP DEFAULT CURRENT_TIMESTAMP, nacionalidade varchar(20) DEFAULT 'Brasil' ); #mostra id no fim #C...
SELECT A.ProductoID, A.Descripcion, B.Unidad FROM TB_Producto AS A LEFT JOIN TB_Unidades AS B ON A.UnidadID=B.UnidadID;
DROP DATABASE godrive; DROP DATABASE godrive_test;
CREATE TABLE R ( A int, B int ) FROM FILE 'test/r.dat' USING CSV; CREATE TABLE S ( B int, C int ) FROM FILE 'test/s.dat' USING CSV; CREATE TABLE T ( C int, D int ) FROM FILE 'test/t.dat' USING CSV; SELECT R.A, T.D FROM R, S, T WHERE (R.B = S.B) AND (T.C < S.C);
-- Using input parameters with stored procedures -- Add an input parameter requires the use of an input variable -- We add the input parameter BEFORE the AS keyword... -- We can provide a default value for the input parameter... -- If a parameter is not provided when GetPhone is called, -- the default value is ...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1:3306 -- Generation Time: Nov 13, 2020 at 03:13 AM -- Server version: 5.7.31 -- PHP Version: 7.3.21 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@...
/* イベントテーブルマスタ */ CREATE TABLE IF NOT EXISTS event_tbl ( event_id INTEGER PRIMARY KEY AUTO_INCREMENT, event_name VARCHAR(30) NOT NULL, event_day DATE NOT NULL, event_detail VARCHAR(50) ); /* 参加者テーブルマスタ */ /* 参加イベントについては、イベントテーブルのIDを参照する */ CREATE TABLE IF NOT EXISTS member_tbl ( member_id INTEGER PRIMA...
-----------SQL语句 库之间操作 select 表之间的操作 alter 修改表 alter table studennts add name varchar(20) not null 往表中添加字符---1.数据类型(int bit(0,1) decimal(5,2) varchar, enum()) gender enum('男','女','人妖','保密') 2. not null 3.default 4. primary key auto_increment -----------------------------------------------------------------...
WITH floor_plans_ranked AS (SELECT floor_plans.location, floor_plans.name, floor_plans.beds, floor_plans.baths, floor_plans.sqft, floor_plans.created_at, rank() OVER (PARTITION BY floor_plans.location, floor_plans.name, floor_plans.beds, floor_plans.baths, floor_plan...
/* 11. Visualizar todos los cargos de los vendedores y el número de los vendedores que hay en cada cargo */ SELECT cargo, COUNT(id) FROM vendedores GROUP BY cargo;
SELECT m.dept_no, m.emp_no, d.dept_name FROM dept_manager_dup m RIGHT JOIN departments_dup d ON m.dept_no = d.dept_no ORDER BY dept_no;
CREATE TABLE mobile_operations ( id serial NOT NULL, description text, url text NOT NULL, created_at timestamp without time zone NOT NULL DEFAULT now(), updated_at timestamp without time zone, CONSTRAINT mobile_operations_pkey PRIMARY KEY (id) ) WITH ( OIDS=FALSE ); ALTER TABLE mobile_operations OWNER T...
#1.创建表person CREATE TABLE person (id INT PRIMARY KEY AUTO_INCREMENT ,pname VARCHAR(10),gender CHAR(2),rel VARCHAR(5)); #2.给person表插入数据 INSERT INTO person VALUES (NULL,"周润发","男","三姑父"),(NULL,"蔡依林","女","二姨"),(NULL,"成龙","男","大舅"),(NULL,"特朗普","男","侄子"),(NULL,"默克尔","女","外甥女"); SELECT * FROM person; #3.创建表trade CREATE ...
-- phpMyAdmin SQL Dump -- version 5.0.4 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 21-02-2021 a las 23:40:27 -- Versión del servidor: 10.4.17-MariaDB -- Versión de PHP: 8.0.2 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_...
-- MySQL dump 10.13 Distrib 8.0.15, for Win64 (x86_64) -- -- Host: localhost Database: kalorik -- ------------------------------------------------------ -- Server version 8.0.15 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS ...
drop table Person; drop table Relative; drop table Patient; drop table HealthProfessionals; drop table PatientsRelatives; drop table HealthProfessionals; drop table Department; drop table WorksIn; drop table Reminders; drop table Messages; drop table Notes; drop table Results; drop table Questionnaire; drop table Quest...
CREATE EXTENSION IF NOT EXISTS pgcrypto; -- Table: public.moths -- drop if it exists DROP TABLE IF EXISTS public.moths; CREATE TABLE public.moths ( id uuid NOT NULL DEFAULT gen_random_uuid(), species text, wingspan double precision, weight double precision, last_spotted json, PRIMARY KEY (id)...
CREATE TABLE CUSTOMER ( id bigserial NOT NULL, first_name varchar(50) NOT NULL, last_name varchar(50) NOT NULL, PRIMARY KEY (id) );
select avg(b.count_of_alerts)::int as alert_count, avg(person_not_found_count)::int as person_not_found_count, avg(b.count_of_person_found)::int as person_found_count from ( select --date_trunc('month', a.datetime_opened), COUNT(distinct a.alert) as count_of_alerts, SUM(CASE WHEN a.outcome_internal in ('person not fou...
SELECT id_institucion, COUNT(*) FROM unc_esq_voluntario.voluntario GROUP BY id_institucion;
SELECT A.Tipo, A.CategoriaNombre, A.Fecha, A.FechaVencimiento, A.ComprobanteNombre, A.Documento, A.RazonSocial, iif(A.MonedaID="01",A.Total,null) as Soles, iif(A.MonedaID="02",A.Total,null) as Dolares, A.SituacionVenta, A.Pendiente FROM VF_Compras A
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 5.5.20-log - MySQL Community Server (GPL) -- Server OS: Win64 -- HeidiSQL version: 7.0.0.4053 -- Date/time: 2013-04-14 15:39:02 -- ---...
SET NAMES UTF-8; CREATE DATABASE `!hostname` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin; GRANT ALL PRIVILEGES ON '!hostname'.* TO '!user'@'!db_host' IDENTIFIED BY '!pass';
DROP TABLE IF EXISTS fasting_tracker;
SELECT COUNT(DISTINCT UserID) FROM ml10m_ratings; -- 69878 SELECT MAX(UserID) FROM ml10m_ratings; -- 71567 !!! SELECT COUNT(DISTINCT MovieID) FROM ml10m_ratings; -- 10677 SELECT MAX(MovieID) FROM ml10m_ratings; -- 65133 !!! SELECT COUNT(*) FROM ml10m_ratings; -- 10000054 DROP TABLE ml10m_users; CREATE TABLE ml10m_...
CREATE TABLE difference_requests ( id INTEGER , n INTEGER NOT NULL , created INTEGER NOT NULL , occurrences INTEGER NOT NULL , PRIMARY KEY (id ASC) ); CREATE INDEX idx_n ON difference_requests(n);
INSERT INTO CREDIT_RATE VALUES ('A', 0.75, 'more than ten reservations recently'); INSERT INTO CREDIT_RATE VALUES ('B', 0.50, ' '); INSERT INTO CREDIT_RATE VALUES ('C', 0.25, ' '); INSERT INTO CREDIT_RATE VALUES ('D', 0.10, ' '); INSERT INTO CREDIT_RATE VALUES ('E', 0.05, ' '); INSERT INTO CREDIT_RATE VALUES ...
create extension if not exists postgis; drop schema if exists p cascade; create schema p; create table p.gis_debug ( id serial primary key, geog geography, geog_point geography(point), geog_linestr geography(linestring), geog_poly ...
-- phpMyAdmin SQL Dump -- version 4.0.4.1 -- http://www.phpmyadmin.net -- -- 主机: 127.0.0.1:3307 -- 生成日期: 2016 年 10 月 31 日 07:36 -- 服务器版本: 5.5.32 -- PHP 版本: 5.4.16 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_CHAR...
ALTER TABLE SONGS_ARTISTS ADD COLUMN SONGS bigint references SONGS (id), ADD COLUMN ARTISTS bigint references ARTISTS (id); UPDATE SONGS_ARTISTS set SONGS = SONG; UPDATE SONGS_ARTISTS set ARTISTS = ARTIST; ALTER TABLE SONGS_ARTISTS DROP CONSTRAINT songs_artists_pkey; ALTER TABLE SONGS_ARTISTS ADD CON...
DROP TABLE IF EXISTS `profiles`; CREATE TABLE IF NOT EXISTS `profiles` ( `id` int(11) NOT NULL AUTO_INCREMENT, `fullName` varchar(255) NOT NULL, `instaId` varchar(255) NOT NULL, `twitter` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL, `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP, ...
-- phpMyAdmin SQL Dump -- version 4.8.5 -- https://www.phpmyadmin.net/ -- -- Servidor: localhost -- Tiempo de generación: 09-10-2019 a las 12:29:14 -- Versión del servidor: 5.7.27 -- Versión de PHP: 7.3.10-1+0~20191008.45+debian9~1.gbp365209 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION...
CREATE PROC ERP.Usp_Sel_UltimoVale @IdEmpresa INT, @IdTipoMovimiento INT, @Fecha DATETIME AS BEGIN SELECT ID, Documento, Flag FROM ERP.Vale WHERE IdEmpresa = @IdEmpresa AND MONTH(Fecha) = MONTH(@Fecha) AND YEAR(Fecha) = YEAR(@Fecha) AND IdTipoMovimiento = @IdTipoMovimiento AND Documento = (SELECT MAX(VU.D...
with grid_tbl as ( -- создаем для каждого агента последовательность месяцев -- с первой по крайнюю продажу и запоминаем минимальный и максимальный период продажи select s.fiopro_cleared, s.filial, s.min_date_sale, s.max_date_sale,d.period_sale, s.channel from ( select distinct upper(fiopro_cleared) fiopro_cleared,...
select name from CRONUS.sys.tables where name like '%Book%' select name from CRONUS.sys.tables where name like '%Customer%' select * from "CRONUS International Ltd_$Customer$29d9569b-80c2-4ee6-b502-ee2b7207353e"
CREATE TYPE MedianGroup AS ( group_nr smallint, row_count integer, start_time int, end_time int, start_station int, end_station int, median double precision );
update bonuses set bonus_code = '001Welcome' where id = 100003;
use tntcomputers insert into produse(denumire, categorie_id, pret, moneda_id, oferta) values ('Laptop Asus', 1, 2000, 3, 1); insert into produse(denumire, categorie_id, pret, moneda_id, oferta) values ('Laptop Dell', 1, 2000, 3, 1); insert into produse(denumire, categorie_id, pret, moneda_id, oferta) values ('Aspirato...
select *from registration; insert into registration values(100, "afaf","rger",30); select *from employee; insert into employee values(105,"Rosse","Female",25000,"Office Staff"); update employee set eName="Johndear" where eNo=101; delete from employee where eNo=104; select *from employee where eno=104; ALTER TABLE `...
UPDATE wp_options SET option_value = 'how2' WHERE option_name = 'template'; UPDATE wp_options SET option_value = 'how2' WHERE option_name = 'stylesheet'; UPDATE wp_options SET option_value = 'AKQA How2' WHERE option_name = 'current_theme';
SELECT mes.id as Id, mes.org_unit_id as org_unit_id, mes.message_type as mess_type, coalesce(mes.caption, '') as caption from messages as mes
DROP SCHEMA IF EXISTS mega; CREATE SCHEMA IF NOT EXISTS mega; USE mega; DROP TABLE IF EXISTS map_elements; CREATE TABLE IF NOT EXISTS map_elements ( id INT NOT NULL AUTO_INCREMENT, icon VARCHAR(50) NULL, elmt_name VARCHAR(25) NOT NULL, elmt_desc VARCHAR(100) NULL, PRIMARY KEY (id) ); DROP TABLE IF EXI...
CREATE OR REPLACE VIEW vw_payments AS SELECT a.id as payment_id, a.payment_type, a.amount, a.payment_method, a.payment_bill_number, a.payment_ac_number, a.ip_address, a.status as payment_status, a.created_at, a.updated_at, b.name as addedby_user_name, c.name as modified...
# 查询出订单表里面用户购买的商品数量最多的那个用户的信息资料 use university; # 求出用户购买的商品数量最多的那个用户ID select orderA.USER_ID from `20200612_tb_order` orderA group by orderA.USER_ID order by orderA.USER_ID desc limit 0,1; # 求出用户的信息资料 select * from `20200614_tb_user` user where user.USER_ID = ( select orderA.USER_ID from `20200612_tb_order` ord...
.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...
CREATE DEFINER = CURRENT_USER TRIGGER `cloudware`.`set_relation` AFTER INSERT ON `order` FOR EACH ROW BEGIN DECLARE client_ID INT DEFAULT NEW.orderClientID; DECLARE item_ID INT DEFAULT NEW.orderItemID; DECLARE order_date INT DEFAULT NEW.orderDate; IF NEW.orderType = 1 THEN INSERT INTO client_equip_relation (...
/* Set up the Points table and */ USE SQLMgmtD; IF OBJECT_ID('dbo.points') IS NOT NULL DROP TABLE dbo.Points; CREATE TABLE dbo.Points ( id UNIQUEIDENTIFIER PRIMARY KEY DEFAULT ( NEWID()) , personid INT , dollars MONEY , filler_data CHAR(1000) DEFAULT ( 'X' )...
USE nodeDB; DROP TABLE tbl_products; INSERT INTO tbl_products(p_code, p_name, p_price) VALUES('P0001', '1000원 김밥', 1000), ('P0002', '2000원 김밥', 2000), ('P0003', '돈까스 김밥', 3500), ('P0004', '참치 김밥', 3000), ('P0005', '라면', 2500), ('P0006', '치즈라면', 3000), ('P0007', '떡볶이', 4000), ('P0008', '어묵국', 3000), ('P0009', '쫄면', 4...
INSERT INTO dbo.TblInvoiceline (OrderId, InvoiceId, VatRateId, Currency, Amount, SequenceNumber, Description) SELECT OfferId, NULL, VatRateId, Currency, Amount, SequenceNumber, Description FROM dbo.TblOfferline as [o] WHERE o.IsOrdered = 1 UPDATE dbo.TblInvoiceline SET InvoiceId = fac.FactuurId FROM dbo.TblInvoicelin...
CREATE PROC P4 @MAYOR_VENDEDOR NUMERIC(6) OUTPUT AS BEGIN UPDATE Empleado SET empl_comision = (SELECT SUM(fact_total) FROM Factura f WHERE f.fact_vendedor = empl_codigo AND YEAR(f.fact_fecha) = (SELECT TO...
insert into eyemakeup(brand,itemName,price) values("Anastasia","Modern Renaissance Palette", 42.00); insert into eyemakeup(brand,itemName,price) values("Too Faced","Sweet Peach", 49.00); insert into eyemakeup(brand,itemName,price) values("Urban Decay","Naked3", 54.00); insert into eyemakeup(brand,itemName,price) values...
-- Table definitions for the tournament project. -- -- Put your SQL 'create table' statements in this file; also 'create view' -- statements if you choose to use it. -- -- You can write comments in this file by starting them with two dashes, like -- these lines here. --Create a database named tournament create Databas...
UPDATE SONGS SET HAS_DETAILS = TRUE WHERE STATUS= 'SHOW';
 -- Unable to test. Need DB with column Constraints SELECT t.table_name TableName, USER_NAME(t.creator) SchemaName, c.column_name ColumnName, s.constraint_name ConstraintName, 'CHECK' ConstraintType, NULL ConstraintDef FROM sys.SYSTAB t JOIN sys.SYSCONSTRAINT s ON s.table_object_id = t.object_id JOIN sys....
/**TODO 1: Find the revenue generated till date from the rented out vehicles of type car. The returned table should contain only 1 row and 1 column and the column should be named as “Revenue by Car”**/ SELECT SUM(B.amount) AS "Revenue by Car" FROM booking B WHERE B.vehicle_id IN ( SELECT V.vehicle_id FROM veh...
DROP DATABASE IF EXISTS employee_trackerDB; CREATE DATABASE employee_trackerDB; USE employee_trackerDB; CREATE TABLE employees( id INTEGER(11) AUTO_INCREMENT NOT NULL, first_name VARCHAR(30), last_name VARCHAR(30), role_id INTEGER(11), manager VARCHAR(30), PRIMARY KEY (id) ); CREATE TABLE depa...
CREATE OR REPLACE VIEW VALUE_VERIFIED AS SELECT 'NO_VERIFICAT' AS id, null AS observ FROM DUAL UNION SELECT 'VERIFICAT' AS id, null AS observ FROM DUAL;
CREATE INDEX idx_0 ON "baaArea" ("baaNpdidBsnsArrArea"); CREATE INDEX idx_1 ON "bsns_arr_area_area_poly_hst" ("baaNpdidBsnsArrArea"); CREATE INDEX idx_2 ON "bsns_arr_area_licensee_hst" ("baaNpdidBsnsArrArea"); CREATE INDEX idx_3 ON "bsns_arr_area_licensee_hst" ("cmpNpdidCompany"); CREATE INDEX idx_4 ON "bsns_arr_area_o...
SELECT properties.title, AVG(property_reviews.rating) AS average_rating FROM properties JOIN property_reviews ON property_reviews.property_id = properties.id WHERE properties.city LIKE '_ancouver' GROUP BY properties.id HAVING AVG(property_reviews.rating) >= 4 ORDER BY properties.cost_per_night LIMIT ...
with __dbt__CTE__stg_d_date_model as ( with source_data as ( select * from "postgres"."mint"."d_date" ) select * from source_data ),d as (select * from __dbt__CTE__stg_d_date_model), bd as (select * from "postgres"."mint"."inter_budget_discretionary_model"), t_one as( select d.first_day_of_month ,sum(bd.amount):...
SELECT COUNT(*) AS RECORD_COUNT FROM PAY_INFO P INNER JOIN ACCOUNT_INFO A ON P.PAY_ORIGINIAL_ACCOUNT_NO = A.ACCOUNT_NO WHERE P.CONTRACT_NO = /*contractNo*/ AND A.CUSTOMER_CODE = /*companyCodeEight*/ AND A.PAY_FLG = /*payFlg*/
alter table site add guid varchar(255);
ALTER TABLE Turist_Suvenir DROP FOREIGN KEY FKTurist_Suv514598; ALTER TABLE Turist_Suvenir DROP FOREIGN KEY FKTurist_Suv710020; ALTER TABLE Tara_suvenir DROP FOREIGN KEY FKTara_suven705151; ALTER TABLE Beneficiar_suvenir DROP FOREIGN KEY FKBeneficiar827371; ALTER TABLE Beneficiar_suvenir DROP FOREIGN KEY FKBenefici...
/* Navicat MySQL Data Transfer Source Server : ewe Source Server Version : 50537 Source Host : localhost:3306 Source Database : meet Target Server Type : MYSQL Target Server Version : 50537 File Encoding : 65001 Date: 2017-03-17 16:49:14 */ SET FOREIGN_KEY_CHECKS=0;...
INSERT INTO users (name, email, password, is_staff) VALUES ('zach', 'placeholderemail', 'placeholderpassword', 'true'); INSERT INTO decks (title, author, is_public) VALUES ('Regular Expressions', 1, 'false'), ('Vim Commands', 1, 'false'); INSERT INTO cards (deck_id, placement, front, back) VALUES (1, 1, '\w...
/* Navicat MySQL Data Transfer Source Server : 开放微擎(共赢2) Source Server Version : 50641 Source Host : localhost:3306 Source Database : www_meishanc_co Target Server Type : MYSQL Target Server Version : 50641 File Encoding : 65001 Date: 2020-02-27 12:11:43 */ SET FOREIGN_KEY_CHECKS=...
--################################################################# set nocount on; -- select Type, count(*) from ( -- select Type, SubType, Code, Label, StateCode, Sequence select Type, SubType, StateCode, Code, Label, Sequence, case StateCode when '' then 'N' else 'Y' end DisplayInUI from ( -- ***********...
-- -- SEDESOL : DataLab -- Athena - PUB table definition -- -- Cleaned table CREATE EXTERNAL TABLE IF NOT EXISTS athena_pub.pub_cleaned ( categoriaedad STRING, cdbeneficio STRING, cddependencia STRING, cdestatusben STRING, cdestatushog STRING, cdinstitucion STRING, cdintraprograma STRING, cdmetpago ST...
-- Providing Meaningful Names for Columns AKA Aliases -- USE an AS clause, some DBMS do not require them SELECT "SAL" AS Salary, "COMM" AS Commission from emp;
-- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jan 24, 2017 at 03:54 PM -- Server version: 5.5.8 -- PHP Version: 5.3.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SE...
-- phpMyAdmin SQL Dump -- version 5.0.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Mar 01, 2021 at 10:45 AM -- Server version: 10.4.11-MariaDB -- PHP Version: 7.4.6 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIEN...
UPDATE COVER SET URL='https://via.placeholder.com/200x200' WHERE URL IS NULL; ALTER TABLE COVER ALTER COLUMN URL SET NOT NULL, ALTER COLUMN URL SET DEFAULT 'https://via.placeholder.com/200x200'; UPDATE COVER SET HEIGHT = 200 WHERE HEIGHT IS NULL; ALTER TABLE COVER ALTER COLUMN HEIGHT SET NOT NULL, ALTE...
-- phpMyAdmin SQL Dump -- version 4.5.1 -- http://www.phpmyadmin.net -- -- Host: 127.0.0.1 -- Generation Time: Jul 16, 2017 at 10:19 AM -- Server version: 10.1.16-MariaDB -- PHP Version: 7.0.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLI...
USE `webDevelopment`; DELETE FROM `languages` WHERE `language` LIKE 'HTML'; UPDATE `frameworks` SET `framework`='Symfony2' WHERE `framework`='Symfony'; UPDATE `languages` SET `version`='5.1' WHERE `language`='JavaScript' AND `version`='5';
-- sql script to create database for Hades web project drop table follow; drop table play; drop table playlists; drop table songs; drop table genres; drop table albums; drop table users; -- table declarations create table users( pseudo varchar(25) not null, userName varchar(50), userSurname varch...
prompt prompt ============================== prompt == DELETE STATS prompt ============================== prompt set echo on timing on exec dbms_stats.delete_table_stats(user, tabname=>'STATSTEST', force=>true, cascade_indexes=>true, cascade_parts=>true, cascade_columns=>true) set echo off
SELECT * FROM `projet_hotel_sql`.`hotel`;
-- -------------------------------------------------------- -- Host: 127.0.0.1 -- Server version: 5.5.24-log - MySQL Community Server (GPL) -- Server OS: Win32 -- HeidiSQL Version: 8.0.0.4435 -- --------------------------------------------------------...
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET N...
CREATE TABLE `domain_registry` ( `domain_name` varchar(20) NOT NULL, `next_id` bigint(11) NOT NULL DEFAULT '1', `class_api` varchar(50) NOT NULL, `class_impl` varchar(50) NOT NULL, UNIQUE KEY `domain_name` (`domain_name`) )
-- phpMyAdmin SQL Dump -- version 3.4.5 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Aug 04, 2015 at 01:49 AM -- Server version: 5.5.16 -- PHP Version: 5.3.8 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!...