The SQL Workshop: Learn to create, manipulate and secure data and manage relational databases with SQL by Frank Solomon & Prashanth Jayaram & Awni Al Saqqa
Author:Frank Solomon & Prashanth Jayaram & Awni Al Saqqa [Solomon, Frank]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2019-12-30T00:00:00+00:00
Build a list of all the OrderID values in the Orders table, as follows:USE packt_online_shop;
SELECT O.OrderID
FROM Orders O;
Add a WHERE clause to the query. Use NOT IN to filter the Orders table with the subquery that we built first. Sort the result set by OrderID:USE packt_online_shop;
SELECT O.OrderID
FROM Orders O
WHERE O.OrderID NOT IN (SELECT OrderID FROM ORDERITEMS)
ORDER BY O.OrderID;
The output is as follows:
Figure 7.3: Printing the ID that's not common for the order in the OrderItems table
In this exercise, we filtered out the order ID for the order that does not have a corresponding entry in the OrderItems table.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
NET | C & C++ Windows Programming |
SQL Server | VBA |
Visual Basic |
Deep Learning with Python by François Chollet(12528)
Hello! Python by Anthony Briggs(9873)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9763)
The Mikado Method by Ola Ellnestam Daniel Brolund(9754)
Dependency Injection in .NET by Mark Seemann(9300)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8264)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7748)
Grails in Action by Glen Smith Peter Ledbrook(7673)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7523)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(6770)
Microservices with Go by Alexander Shuiskov(6538)
Practical Design Patterns for Java Developers by Miroslav Wengner(6430)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6407)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6385)
Angular Projects - Third Edition by Aristeidis Bampakos(5797)
The Art of Crafting User Stories by The Art of Crafting User Stories(5323)
NetSuite for Consultants - Second Edition by Peter Ries(5261)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5084)
Kotlin in Action by Dmitry Jemerov(5025)
