Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What is the difference between those 2 select statements? SELECT custname FROM si.prospect WHERE carmake = carmake AND carmodel = carmodel INTERSECT SELECT custname FROM

What is the difference between those 2 select statements?

SELECT custname FROM si.prospect WHERE carmake = carmake AND carmodel = carmodel INTERSECT SELECT custname FROM si.car WHERE carmake = carmake AND carmodel = carmodel;

SELECT custname, carmake, carmodel FROM si.prospect INTERSECT SELECT custname, carmake, carmodel FROM si.car

They are giving different outputs...

First statement gives this:

CUSTNAME

ABDALLA FREIHAT ABDUL BASIT ABHINAV SHARMA ADAM AHMED KHATTAB ALAA ATRI ALEX ALEX HICKS ALEX PARK ALI ALISSA NONATO AMANDEEP ANDREW AUBERTINSS ANDREW GREENIZAN ANDREW SMITH ANDRIY BOVTENKO ANIS ANJU KOHLI ANKUSH BALI ARON KHAN ART KHLAMOV AUGUSTO GONCALEZ AUSTIIN MEDEIROS AUSTIN M AUSTIN PEREIRA AZIZ AYBOUT BERNARDO SIQUEIRA BHAVAY GROVER BORIS BORIS AGUILAR BRIAN VO BRUNO PETLA CALVIN CARL EDWARDS CHEYSER CELESTINO CHRIS BANYARD CHRIS PECKOVER CHRIS SARVGHADI COISH COLIN BINNIE CORY SVENSSON DAMAN DAN ACKLAND DANBI SEO DANIEL DIAS DANNY HANDA DARRELL BYRNE DAVID BERNACKI DEJAN P DEVIN NOBLE DIWASH POKHAREL DOUGLAS PETLA EDWARD KIM EMILY RAMANNA EUGENE LIM FAIZA IFTIKHAR GARNER MCJANNETT GARY HALBIG GE PHOENIX GLADYS CALDERON GUILHERME BIAGE GYEHYUN HABIB G HARMANJEET MUNDAY HARUN INDERPREET SINGH JAMES CUMMING JAMES KEELING JAMES KESHAVARZI JASNOOR JASON JASON VIEIRA JAVERIA AFTAB JEAN-MICHEL CABANA JEREMY SISON JESUS AMIGLEO JIANLIN LUO JIE DONG JIN HWAN OH JINHUA YAN JODY KIRTON JOE JOHN APPLE JOHN DOE JONATHAN LEE JOON AN JOSE ANDRADE JOSE CAMPOS JOSHUA PINKNEY JUAN MENDIOLA JULIA S JUNG HOON CHOI JUNG HYUN RHOE KEVIN BARKER KIM KYLE GABET LAURA ALMEIDA LAURA MARTINEZ LEO CINNAMON LIAM WRIGHT LIZZIE URRUTIA LUCAS NGUYEN LUCY KIM MARK THIBAULT MARY SOUCHIE MATTHEW ROHALY MATTHEW VILJAKAINEN MICHAEL MICHAEL ALAMPI MICHAL BARTOSIK MIKE VIAU2 MITCHELL PECK MOHAMED NAFE MCNAFEE NICK ROSE NIKITA KARTAVYI OLIVER OMAR AL-MITWALLY OMKARNATH DAS PATRICK SIMMONS PATRIK ROSE PAULA HUNTER PETER PETER KANAREK PETER RUSHELEAU PHILIP PEDERSEN QING GE RAFAEL BATTESTI RAJINDER SINGH RICHARD GOMEZ RITA ATTOUI RITCHIE PERERA ROBERT C ROBERT FILOSA ROBERT LICZNER ROBERT SILVEIRA ROBERTFE RODRIGO LIMA RYAN BROWN SAUD SIDD SCOTT TAYLOR SHANNON HAN SHAWN WATSON SHERYLE IPULAN SHUKUR SAHIBDAD SIMRANJIT SINGH SMARTH ARORA SOJIN LEE STANLEY LEE STEFAN SLE STEPAN NADEINE STERLING JETHA STEVEN BAN STEVEN LAM SUNGWOO LEE TANAKA THOMAS NEVERS THOMAS QUINTARD TREVOR LEACH TYLER ABBOTT TYLER MATSUSHITA UPASANA KHARBANDA VALERIYA VICTOR VIKKI WONG VSEVOLOD XIAO LIANG XIAOYU L YOUCHAN KIM ZACH FISCH ZAKEIR SAMSOODIN

Second statement gives this:

CUSTNAME CARMAKE CARMODEL

AMANDEEP LAND ROVER R70 BHAVAY GROVER LAND ROVER RRS MATTHEW VILJAKAINEN LAND ROVER G4 PATRICK SIMMONS LAND ROVER SPORT SMARTH ARORA LAND ROVER EVOQUE VALERIYA LAND ROVER SPORT

None of them seen to do what I want, that is display the list of customers that wants to buy the same car make and model that they already have.

First statement gives me output of people name that doesn't meet the criteria, while the second leaves out people that does meet the criteria.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

2nd Edition

0470624701, 978-0470624708

More Books

Students also viewed these Databases questions

Question

What are the issues of concern for each of the affected parties?

Answered: 1 week ago

Question

What steps should be taken to address any undesirable phenomena?

Answered: 1 week ago