Preamble
MySQL FROM statement is used to display tables and any associations required for querying in MySQL.
Syntax of FROM statement in MySQL
FROM table1
[ { INNER JOIN
| LEFT [OUTER] JOIN
| RIGHT [OUTER] JOIN } table2
ON table1.column1 = table2.column1 ]
Statement parameters and arguments
- table1 and table2 are tables used in MySQL sentence. These two tables are combined based on table1.column1 = table2.column1.
Note:
- When using the FROM operator in a MySQL sentence, there should be at least one table listed in the FROM operator.
- If there are two or more tables listed in MySQL in the FROM statement, these tables are usually combined using INNER or OUTER connections, unlike the old WHERE syntax.
How to use the MySQL FROM statement
Let’s start by looking at how to use the FROM statement with only one table.
For example:
SELECT *
FROM order_details
WHERE quantity >= 100
ORDER BY DESC;
In this MySQL example, we used the FROM operator to list all columns of a table named order_details. No associations are executed because we use only one table.
Two tables with INNER JOIN
Let’s see how to use the FROM operator with two tables and an INNER JOIN.
For example:
SELECT order_details.order_id, customers.customer_name
FROM customers
INNER JOIN order_details
ON customers.customer_id = order_details.customer_id
ORDER BY order_details.order_id;
In this MySQL example, the FROM statement is used to display two tables, customers, and order_details. And we use the FROM statement to combine INNER JOIN between customers and order_details tables based on the customer_id column in both tables.
Two tables with OUTER JOIN
Let’s look at how to use the FROM operator when we combine two tables together using OUTER JOIN. In this case, we will look at the LEFT OUTER JOIN.
For example:
SELECT products.product_id, inventory.qty_on_hand
FROM products
LEFT OUTER JOIN inventory
ON products.product_id = inventory.product_id
WHERE products.product_name = 'MySQL';
In this MySQL example, the FROM operator is used to list two tables, products, and inventory. And we use the FROM statement to specify the LEFT OUTER JOIN between the product and inventory tables based on the product_id columns in both tables.
Learning MySQL; SELECT Statements
About Enteros
Enteros offers a patented database performance management SaaS platform. It proactively identifies root causes of complex business-impacting database scalability and performance issues across a growing number of clouds, RDBMS, NoSQL, and machine learning database platforms.
The views expressed on this blog are those of the author and do not necessarily reflect the opinions of Enteros Inc. This blog may contain links to the content of third-party sites. By providing such links, Enteros Inc. does not adopt, guarantee, approve, or endorse the information, views, or products available on such sites.
Are you interested in writing for Enteros’ Blog? Please send us a pitch!
RELATED POSTS
How Intelligent Database Analytics Improves Data Infrastructure Performance in Modern Hospital Management Systems
- 20 May 2026
- Database Performance Management
Introduction Healthcare organizations are undergoing rapid digital transformation. Hospitals now rely on advanced technologies such as Electronic Health Records (EHR), telemedicine platforms, AI-driven diagnostics, medical imaging systems, and hospital management systems to deliver faster and more efficient patient care. At the center of these systems lies a powerful data infrastructure supported by complex databases. Modern … Continue reading “How Intelligent Database Analytics Improves Data Infrastructure Performance in Modern Hospital Management Systems”
Enhancing Retail Platform Performance and Customer Experience with Intelligent Database Analytics
- 19 May 2026
- Database Performance Management
Retail has undergone a major transformation over the past decade. With the rapid growth of digital commerce, omnichannel experiences, and real-time customer engagement, modern retail platforms depend heavily on high-performance data infrastructure. From product searches and inventory updates to personalized recommendations and checkout transactions, every step of the customer journey relies on fast, reliable, and … Continue reading “Enhancing Retail Platform Performance and Customer Experience with Intelligent Database Analytics”
How to Optimize Retail Infrastructure Costs with Enteros Database Optimization and Azure Cost Allocation
Introduction The retail industry is rapidly evolving as organizations embrace cloud computing, AI-driven analytics, ecommerce expansion, omnichannel operations, and data-intensive customer engagement platforms. Modern retailers must manage increasingly complex digital infrastructures while delivering seamless customer experiences across online stores, physical retail locations, mobile applications, and supply chain ecosystems. Today’s retail organizations rely heavily on digital … Continue reading “How to Optimize Retail Infrastructure Costs with Enteros Database Optimization and Azure Cost Allocation”
How to Strengthen Ecommerce Scalability with Enteros AIOps Platform and Financial Intelligence
Introduction The ecommerce industry is evolving rapidly as organizations embrace cloud-native infrastructures, AI-powered customer engagement, real-time analytics, and digital commerce platforms to support global growth and customer expectations. Modern ecommerce businesses must manage massive operational complexity while delivering seamless digital experiences across websites, mobile applications, marketplaces, and omnichannel retail systems. Today’s ecommerce organizations rely heavily … Continue reading “How to Strengthen Ecommerce Scalability with Enteros AIOps Platform and Financial Intelligence”