SQL queries allow users to select, filter, and summarize data stored in database tables. The basic form of an SQL query is SELECT attributes FROM tables WHERE condition. More complex queries can join multiple tables, use subqueries, and perform aggregations. Null values in SQL represent unknown or missing data and are treated differently than normal values in comparisons and logic.
This document provides an overview of using Hibernate, an open source Java object-relational mapping tool. It discusses typical problems with JDBC code, how Hibernate addresses these issues, and provides sample code for mapping Java objects to database tables and performing queries and transactions with Hibernate. The document also outlines steps for a basic Hibernate tutorial, including database design, mapping classes, configuration, and data access objects.
The document provides information about handling events in JavaServer Faces (JSF), including comparing action controllers to event listeners, implementing different types of event listeners like action listeners and value change listeners, and using JavaScript to submit forms. It also summarizes the typical flow of control in JSF applications from form submission to result display, and provides an example of how to create a JSF application that uses both action listeners and action controllers.
The document summarizes the AWT event handling in Java. It describes how components generate events, listeners register with sources to receive events, and event objects are passed to listener methods. It provides examples of event classes, listener interfaces, and how to implement basic event handling in an applet using components, containers, and responding to user interactions.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive function. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
This document discusses different strategies for handling mouse and keyboard events in Java programs. It describes registering listener objects to handle events from GUI components and defines the standard AWT listener types. The strategies covered include using separate listener classes, implementing listener interfaces, and defining named and anonymous inner classes. Examples are provided to illustrate drawing on mouse clicks and key presses.
This document discusses Java I/O streams. It defines streams as representing input sources or output destinations that can represent files, devices, programs, sockets or memory arrays. Streams support different data types like bytes, primitive types, characters or objects. The document outlines the stream class hierarchy with abstract classes like InputStream, OutputStream, Reader and Writer. It describes node streams that interact with specific locations and filter streams that process or alter data. Examples of byte streams like FileInputStream and character streams like FileReader are provided.
JavaBeans are reusable software components that can be visually composed using builder tools. They have properties that can be edited visually, support events to communicate between components, and allow introspection to discover their features. JavaBeans use serialization and XML for persistence so their state can be saved and restored. They provide a portable, platform-independent way to create reusable application components.
This document provides an overview of the Abstract Windowing Toolkit (AWT) and Swing GUI frameworks in Java. It discusses the similarities and differences between AWT and Swing, the fundamental AWT components like frames and panels, graphics drawing, additional AWT components, common layout managers, and how to set up top-level containers and examples using Swing components like JFrames and JOptionPanes. The key topics covered include the fundamentals of building graphical user interfaces in Java.
This document provides an overview of using Hibernate, an open source Java object-relational mapping tool. It discusses typical problems with JDBC code, how Hibernate addresses these issues, and provides sample code for mapping Java objects to database tables and performing queries and transactions with Hibernate. The document also outlines steps for a basic Hibernate tutorial, including database design, mapping classes, configuration, and data access objects.
The document provides information about handling events in JavaServer Faces (JSF), including comparing action controllers to event listeners, implementing different types of event listeners like action listeners and value change listeners, and using JavaScript to submit forms. It also summarizes the typical flow of control in JSF applications from form submission to result display, and provides an example of how to create a JSF application that uses both action listeners and action controllers.
The document summarizes the AWT event handling in Java. It describes how components generate events, listeners register with sources to receive events, and event objects are passed to listener methods. It provides examples of event classes, listener interfaces, and how to implement basic event handling in an applet using components, containers, and responding to user interactions.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive function. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
This document discusses different strategies for handling mouse and keyboard events in Java programs. It describes registering listener objects to handle events from GUI components and defines the standard AWT listener types. The strategies covered include using separate listener classes, implementing listener interfaces, and defining named and anonymous inner classes. Examples are provided to illustrate drawing on mouse clicks and key presses.
This document discusses Java I/O streams. It defines streams as representing input sources or output destinations that can represent files, devices, programs, sockets or memory arrays. Streams support different data types like bytes, primitive types, characters or objects. The document outlines the stream class hierarchy with abstract classes like InputStream, OutputStream, Reader and Writer. It describes node streams that interact with specific locations and filter streams that process or alter data. Examples of byte streams like FileInputStream and character streams like FileReader are provided.
JavaBeans are reusable software components that can be visually composed using builder tools. They have properties that can be edited visually, support events to communicate between components, and allow introspection to discover their features. JavaBeans use serialization and XML for persistence so their state can be saved and restored. They provide a portable, platform-independent way to create reusable application components.
This document provides an overview of the Abstract Windowing Toolkit (AWT) and Swing GUI frameworks in Java. It discusses the similarities and differences between AWT and Swing, the fundamental AWT components like frames and panels, graphics drawing, additional AWT components, common layout managers, and how to set up top-level containers and examples using Swing components like JFrames and JOptionPanes. The key topics covered include the fundamentals of building graphical user interfaces in Java.
This document provides an overview and tutorial for ASP.NET, including Classic ASP, ASP.NET, ASP.NET Razor, programming languages used in ASP.NET (VB.NET and C#), ASP.NET server technologies (Web Pages, MVC, and Web Forms), development tools, and file extensions. It then demonstrates ASP.NET Web Pages by walking through creating a website from scratch, adding navigation, and connecting a database. The tutorial covers creating folders, files, stylesheets, layout pages, and database tables. It demonstrates displaying and adding data to the database.
The document provides a tutorial on PHP programming. It discusses what PHP is, how to install PHP, basic PHP syntax like variables and data types, and how to use PHP with HTML. It also covers PHP programming concepts like strings, operators, conditional statements, arrays, and more. The tutorial aims to teach the fundamentals of PHP to help readers get started with learning PHP.
The document discusses Java exception handling. It begins with defining what exceptions are and what happens when exceptions occur. It then covers benefits of Java's exception handling framework such as separating error handling code from regular code, propagating errors up the call stack, and grouping exception types into hierarchies. The document also discusses how to catch exceptions using try-catch blocks and the finally keyword. It covers rules for throwing exceptions and shows Java's built-in exception class hierarchy.
The document discusses the concept of inheritance in object-oriented programming. It defines inheritance as a child class automatically inheriting variables and methods from its parent class. The key benefits of inheritance are reusability of code and properties. The document explains how to create a subclass using the extends keyword, the constructor calling chain, and use of the super keyword. It also covers overriding and hiding methods, hiding fields, type casting, and final classes and methods.
The document discusses Remote Method Invocation (RMI) in Java, including its architectural components like remote interfaces, stubs, and skeletons; how objects are serialized and classes dynamically loaded during remote calls; and how to configure the RMI codebase property to specify locations for downloading classes.
1. Inheritance in Java allows classes to extend other classes and interfaces to implement other interfaces. This allows code reuse and establishes type constraints.
2. Abstract classes can contain both abstract and non-abstract methods while interfaces contain only abstract methods. Interfaces establish contracts that implementing classes must follow.
3. When constructing objects with inheritance, superclass constructors are called before subclass constructors. Abstract classes and interfaces allow incomplete implementations to be extended.
This document discusses packages, classpaths, and how to organize Java source files and classes. It explains that packages group related classes and interfaces, provide access protection and namespace management. It describes how to declare a package, place classes in packages, import packages and classes from other packages. It also covers setting the classpath so the Java runtime can locate class files, and recommended directory structures that match the package hierarchy for source and class files.
Arrays allow storing multiple values of the same type in contiguous memory locations. An array is declared with the data type followed by square brackets and the array name. The array is instantiated using the new keyword and square brackets containing the size. Array elements are accessed using an index from 0 to length-1. The length field returns the array size. Multidimensional arrays are arrays of arrays, declared with multiple bracket pairs after the name.
This document provides a tutorial on summarizing the Spring Framework. It introduces the main packages in Spring Framework including the JDBC package for data access. The JDBC package has two main subpackages - com.interface21.jdbc.core which implements low-level persistence and com.interface21.jdbc.object which presents an object-oriented view. It provides code samples demonstrating how to perform queries, updates and retrieve results using these packages.
The document provides an overview of the Struts 1.1 framework. It introduces Struts and describes its core components - the controller, model, and view. It discusses how Struts implements the MVC pattern and follows the JSP Model 2 architecture. It highlights some of the key features of Struts 1.1, including internationalization support, tag libraries, and configuration. It also provides an example of building a sample application called Beer4All to demonstrate how to use Struts.
This document discusses Java threads and related concepts like thread states, priorities, synchronization, and inter-thread communication. It covers the two main ways to create threads in Java - by extending the Thread class or implementing the Runnable interface. Synchronization techniques like using synchronized methods and blocks are presented to prevent race conditions when multiple threads access shared resources. Finally, inter-thread communication methods like wait() and notify() from the Object class are introduced.
The document introduces the Model-View-Controller (MVC) design pattern and the Struts framework. It describes the key components of MVC - the Model, View, and Controller. It then explains how Struts implements each component and allows developers to build dynamic web applications using MVC. Struts handles common tasks like separating business logic from presentation, internationalization, and connecting user input to application processing. Developers can focus on application logic rather than framework details.
This document provides an overview of key concepts related to Java networking. It discusses IP addresses, protocols, ports, and the client-server paradigm as basic networking concepts. It then describes Java's networking package, including the ServerSocket and Socket classes for creating server and client sockets, and the MulticastSocket and DatagramPacket classes for multicast communication. Example code is provided to illustrate using the ServerSocket and Socket classes to create a simple echo server and client.
This document provides an introduction and overview of programming web applications using servlets. It discusses key concepts like servlets, the servlet API, HTTP requests and responses, servlet contexts, and provides examples of basic servlets that handle requests and responses. The examples demonstrate how to retrieve request parameters, set response headers and content, and maintain shared state across requests using the servlet context.
The document discusses Java AWT event handling. It describes how AWT components generate events that are passed to listener objects. It provides examples of common event classes like ActionEvent and MouseEvent, and the interfaces that listener objects must implement like ActionListener and MouseListener. It also gives a simple example of an applet that registers listeners on different components and handles events in the listener methods.
The document discusses abstract classes and interfaces in Java. It defines an abstract method as a method without an implementation body, and an abstract class as one that contains at least one abstract method. An interface defines a contract that concrete classes implement by providing method bodies. Interfaces allow for multiple inheritance and polymorphism. The document provides examples of defining an abstract class, interface, and implementing an interface in a concrete class.
This document provides an overview and tutorial for ASP.NET, including Classic ASP, ASP.NET, ASP.NET Razor, programming languages used in ASP.NET (VB.NET and C#), ASP.NET server technologies (Web Pages, MVC, and Web Forms), development tools, and file extensions. It then demonstrates ASP.NET Web Pages by walking through creating a website from scratch, adding navigation, and connecting a database. The tutorial covers creating folders, files, stylesheets, layout pages, and database tables. It demonstrates displaying and adding data to the database.
The document provides a tutorial on PHP programming. It discusses what PHP is, how to install PHP, basic PHP syntax like variables and data types, and how to use PHP with HTML. It also covers PHP programming concepts like strings, operators, conditional statements, arrays, and more. The tutorial aims to teach the fundamentals of PHP to help readers get started with learning PHP.
The document discusses Java exception handling. It begins with defining what exceptions are and what happens when exceptions occur. It then covers benefits of Java's exception handling framework such as separating error handling code from regular code, propagating errors up the call stack, and grouping exception types into hierarchies. The document also discusses how to catch exceptions using try-catch blocks and the finally keyword. It covers rules for throwing exceptions and shows Java's built-in exception class hierarchy.
The document discusses the concept of inheritance in object-oriented programming. It defines inheritance as a child class automatically inheriting variables and methods from its parent class. The key benefits of inheritance are reusability of code and properties. The document explains how to create a subclass using the extends keyword, the constructor calling chain, and use of the super keyword. It also covers overriding and hiding methods, hiding fields, type casting, and final classes and methods.
The document discusses Remote Method Invocation (RMI) in Java, including its architectural components like remote interfaces, stubs, and skeletons; how objects are serialized and classes dynamically loaded during remote calls; and how to configure the RMI codebase property to specify locations for downloading classes.
1. Inheritance in Java allows classes to extend other classes and interfaces to implement other interfaces. This allows code reuse and establishes type constraints.
2. Abstract classes can contain both abstract and non-abstract methods while interfaces contain only abstract methods. Interfaces establish contracts that implementing classes must follow.
3. When constructing objects with inheritance, superclass constructors are called before subclass constructors. Abstract classes and interfaces allow incomplete implementations to be extended.
This document discusses packages, classpaths, and how to organize Java source files and classes. It explains that packages group related classes and interfaces, provide access protection and namespace management. It describes how to declare a package, place classes in packages, import packages and classes from other packages. It also covers setting the classpath so the Java runtime can locate class files, and recommended directory structures that match the package hierarchy for source and class files.
Arrays allow storing multiple values of the same type in contiguous memory locations. An array is declared with the data type followed by square brackets and the array name. The array is instantiated using the new keyword and square brackets containing the size. Array elements are accessed using an index from 0 to length-1. The length field returns the array size. Multidimensional arrays are arrays of arrays, declared with multiple bracket pairs after the name.
This document provides a tutorial on summarizing the Spring Framework. It introduces the main packages in Spring Framework including the JDBC package for data access. The JDBC package has two main subpackages - com.interface21.jdbc.core which implements low-level persistence and com.interface21.jdbc.object which presents an object-oriented view. It provides code samples demonstrating how to perform queries, updates and retrieve results using these packages.
The document provides an overview of the Struts 1.1 framework. It introduces Struts and describes its core components - the controller, model, and view. It discusses how Struts implements the MVC pattern and follows the JSP Model 2 architecture. It highlights some of the key features of Struts 1.1, including internationalization support, tag libraries, and configuration. It also provides an example of building a sample application called Beer4All to demonstrate how to use Struts.
This document discusses Java threads and related concepts like thread states, priorities, synchronization, and inter-thread communication. It covers the two main ways to create threads in Java - by extending the Thread class or implementing the Runnable interface. Synchronization techniques like using synchronized methods and blocks are presented to prevent race conditions when multiple threads access shared resources. Finally, inter-thread communication methods like wait() and notify() from the Object class are introduced.
The document introduces the Model-View-Controller (MVC) design pattern and the Struts framework. It describes the key components of MVC - the Model, View, and Controller. It then explains how Struts implements each component and allows developers to build dynamic web applications using MVC. Struts handles common tasks like separating business logic from presentation, internationalization, and connecting user input to application processing. Developers can focus on application logic rather than framework details.
This document provides an overview of key concepts related to Java networking. It discusses IP addresses, protocols, ports, and the client-server paradigm as basic networking concepts. It then describes Java's networking package, including the ServerSocket and Socket classes for creating server and client sockets, and the MulticastSocket and DatagramPacket classes for multicast communication. Example code is provided to illustrate using the ServerSocket and Socket classes to create a simple echo server and client.
This document provides an introduction and overview of programming web applications using servlets. It discusses key concepts like servlets, the servlet API, HTTP requests and responses, servlet contexts, and provides examples of basic servlets that handle requests and responses. The examples demonstrate how to retrieve request parameters, set response headers and content, and maintain shared state across requests using the servlet context.
The document discusses Java AWT event handling. It describes how AWT components generate events that are passed to listener objects. It provides examples of common event classes like ActionEvent and MouseEvent, and the interfaces that listener objects must implement like ActionListener and MouseListener. It also gives a simple example of an applet that registers listeners on different components and handles events in the listener methods.
The document discusses abstract classes and interfaces in Java. It defines an abstract method as a method without an implementation body, and an abstract class as one that contains at least one abstract method. An interface defines a contract that concrete classes implement by providing method bodies. Interfaces allow for multiple inheritance and polymorphism. The document provides examples of defining an abstract class, interface, and implementing an interface in a concrete class.
Company Valuation webinar series - Tuesday, 4 June 2024FelixPerez547899
This session provided an update as to the latest valuation data in the UK and then delved into a discussion on the upcoming election and the impacts on valuation. We finished, as always with a Q&A
Discover timeless style with the 2022 Vintage Roman Numerals Men's Ring. Crafted from premium stainless steel, this 6mm wide ring embodies elegance and durability. Perfect as a gift, it seamlessly blends classic Roman numeral detailing with modern sophistication, making it an ideal accessory for any occasion.
https://rb.gy/usj1a2
Event Report - SAP Sapphire 2024 Orlando - lots of innovation and old challengesHolger Mueller
Holger Mueller of Constellation Research shares his key takeaways from SAP's Sapphire confernece, held in Orlando, June 3rd till 5th 2024, in the Orange Convention Center.
Recruiting in the Digital Age: A Social Media MasterclassLuanWise
In this masterclass, presented at the Global HR Summit on 5th June 2024, Luan Wise explored the essential features of social media platforms that support talent acquisition, including LinkedIn, Facebook, Instagram, X (formerly Twitter) and TikTok.
Anny Serafina Love - Letter of Recommendation by Kellen Harkins, MS.AnnySerafinaLove
This letter, written by Kellen Harkins, Course Director at Full Sail University, commends Anny Love's exemplary performance in the Video Sharing Platforms class. It highlights her dedication, willingness to challenge herself, and exceptional skills in production, editing, and marketing across various video platforms like YouTube, TikTok, and Instagram.
Navigating the world of forex trading can be challenging, especially for beginners. To help you make an informed decision, we have comprehensively compared the best forex brokers in India for 2024. This article, reviewed by Top Forex Brokers Review, will cover featured award winners, the best forex brokers, featured offers, the best copy trading platforms, the best forex brokers for beginners, the best MetaTrader brokers, and recently updated reviews. We will focus on FP Markets, Black Bull, EightCap, IC Markets, and Octa.
Industrial Tech SW: Category Renewal and CreationChristian Dahlen
Every industrial revolution has created a new set of categories and a new set of players.
Multiple new technologies have emerged, but Samsara and C3.ai are only two companies which have gone public so far.
Manufacturing startups constitute the largest pipeline share of unicorns and IPO candidates in the SF Bay Area, and software startups dominate in Germany.
1. SQL Queries
Principal form:
SELECT desired attributes
FROM tuple variables |
range over relations
WHERE condition about t.v.'s;
Running example relation schema:
Beersname, manf
Barsname, addr, license
Drinkersname, addr, phone
Likesdrinker, beer
Sellsbar, beer, price
Frequentsdrinker, bar
1
2. Example
What beers are made by Anheuser-Busch?
Beersname, manf
SELECT name
FROM Beers
WHERE manf = 'Anheuser-Busch';
Note single quotes for strings.
name
Bud
Bud Lite
Michelob
2
3. Formal Semantics of Single-Relation SQL
Query
1. Start with the relation in the FROM clause.
2. Apply bag , using condition in WHERE
clause.
3. Apply extended, bag using terms in
SELECT clause.
Equivalent Operational Semantics
Imagine a tuple variable ranging over all tuples of
the relation. For each tuple:
Check if it satis es the WHERE clause.
Print the values of terms in SELECT, if so.
3
4. Star as List of All Attributes
Beersname, manf
SELECT *
FROM Beers
WHERE manf = 'Anheuser-Busch';
name manf
Bud Anheuser-Busch
Bud Lite Anheuser-Busch
Michelob Anheuser-Busch
4
5. Renaming columns
Beersname, manf
SELECT name AS beer
FROM Beers
WHERE manf = 'Anheuser-Busch';
beer
Bud
Bud Lite
Michelob
5
6. Expressions as Values in Columns
Sellsbar, beer, price
SELECT bar, beer,
price*120 AS priceInYen
FROM Sells;
bar beer priceInYen
Joe's Bud 300
Sue's Miller 360
Note no WHERE clause OK.
6
7. Trick: If you want an answer with a particular
string in each row, use that constant as an
expression.
Likesdrinker, beer
SELECT drinker,
'likes Bud' AS whoLikesBud
FROM Likes
WHERE beer = 'Bud';
drinker whoLikesBud
Sally likes Bud
Fred likes Bud
7
8. Example
Find the price Joe's Bar charges for Bud.
Sellsbar, beer, price
SELECT price
FROM Sells
WHERE bar = 'Joe''s Bar' AND
beer = 'Bud';
Note: two single-quotes in a character string
represent one single quote.
Conditions in WHERE clause can use logical
operators AND, OR, NOT and parentheses in the
usual way.
Remember: SQL is case insensitive. Keywords
like SELECT or AND can be written upper lower
case as you like.
3 Only inside quoted strings does case
matter.
8
9. Patterns
stands for any string.
stands for any one character.
Attribute LIKE pattern is a condition that
is true if the string value of the attribute
matches the pattern.
3 Also NOT LIKE for negation.
Example
Find drinkers whose phone has exchange 555.
Drinkersname, addr, phone
SELECT name
FROM Drinkers
WHERE phone LIKE '555- ';
Note patterns must be quoted, like strings.
9
10. Nulls
In place of a value in a tuple's component.
Interpretation is not exactly missing value.
There could be many reasons why no value is
present, e.g., value inappropriate.
Comparing Nulls to Values
3rd truth value UNKNOWN.
A query only produces tuples if the WHERE-
condition evaluates to TRUE UNKNOWN is not
su cent.
10
11. Example
bar beer price
Joe's bar Bud NULL
SELECT bar
FROM Sells
WHERE price 2.00 OR price = 2.00;
------------ -------------
UNKNOWN UNKNOWN
------------------------
UNKNOWN
Joe's Bar is not produced, even though the
WHERE condition is a tautology.
11
12. 3-Valued Logic
Think of true = 1; false = 0, and unknown = 1 2.
Then:
AND = min.
OR = max.
NOTx = 1 , x.
Some Key Laws Fail to Hold
Example: Law of the excluded middle, i.e.,
p OR NOT p = TRUE
For 3-valued logic: if p = unknown, then left
side = max1 2,1-1 2 = 1 2 6= 1.
Like bag algebra, there is no way known to
make 3-valued logic conform to all the laws we
expect for sets 2-valued logic, respectively.
12
13. Multirelation Queries
List of relations in FROM clause.
Relation-dot-attribute disambiguates
attributes from several relations.
Example
Find the beers that the frequenters of Joe's Bar
like.
Likesdrinker, beer
Frequentsdrinker, bar
SELECT beer
FROM Frequents, Likes
WHERE bar = 'Joe''s Bar' AND
Frequents.drinker = Likes.drinker;
13
14. Formal Semantics of Multirelation Queries
Same as for single relation, but start with the
product of all the relations mentioned in the FROM
clause.
Operational Semantics
Consider a tuple variable for each relation in the
FROM.
Imagine these tuple variables each pointing to
a tuple of their relation, in all combinations
e.g., nested loops.
If the current assignment of tuple-variables to
tuples makes the WHERE true, then output the
terms of the SELECT.
14
15. drinker bar drinker beer
Sally
Sally Joe's l
f
Likes
Frequents
15
16. Explicit Tuple Variables
Sometimes we need to refer to two or more copies
of a relation.
Use tuple variables as aliases of the relations.
Example
Find pairs of beers by the same manufacturer.
Beersname, manf
SELECT b1.name, b2.name
FROM Beers b1, Beers b2
WHERE b1.manf = b2.manf AND
b1.name b2.name;
SQL permits AS between relation and its tuple
variable; Oracle does not.
Note that b1.name b2.name is needed to
avoid producing Bud, Bud and to avoid
producing a pair in both orders.
16
17. Subqueries
Result of a select-from-where query can be used in
the where-clause of another query.
Simplest Case: Subquery Returns a Single,
Unary Tuple
Find bars that serve Miller at the same price Joe
charges for Bud.
Sellsbar, beer, price
SELECT bar
FROM Sells
WHERE beer = 'Miller' AND
price =
SELECT price
FROM Sells
WHERE bar = 'Joe''s Bar' AND
beer = 'Bud'
;
Notice the scoping rule: an attribute refers
to the most closely nested relation with that
attribute.
Parentheses around subquery are essential.
17
18. The IN Operator
Tuple IN relation is true i the tuple is in the
relation.
Example
Find the name and manufacturer of beers that
Fred likes.
Beersname, manf
Likesdrinker, beer
SELECT *
FROM Beers
WHERE name IN
SELECT beer
FROM Likes
WHERE drinker = 'Fred'
;
Also: NOT IN .
18
19. EXISTS
relation is true i the relation is
EXISTS
nonempty.
Example
Find the beers that are the unique beer by their
manufacturer.
Beersname, manf
SELECT name
FROM Beers b1
WHERE NOT EXISTS
SELECT *
FROM Beers
WHERE manf = b1.manf AND
name b1.name
;
Note scoping rule: to refer to outer Beers in
the inner subquery, we need to give the outer
a tuple variable, b1 in this example.
A subquery that refers to values from a
surrounding query is called a correlated
subquery.
19
20. Quanti ers
ANY and ALL behave as existential and universal
quanti ers, respectively.
Beware: in common parlance, any and all
seem to be synonyms, e.g., I am fatter than
any of you vs. I am fatter than all of you.
But in SQL:
Example
Find the beers sold for the highest price.
Sellsbar, beer, price
SELECT beer
FROM Sells
WHERE price = ALL
SELECT price
FROM Sells
;
Class Problem
Find the beers not sold for the lowest price.
20