In what way joins are useful and how many types of joins are there?

Submitted 5 months, 3 weeks ago
Ticket #377
Views 89
Language MYSQL
Priority Medium
Status Closed

I am little bit confused about joins in MYSQL?

In what way we can use them?

And how many types are there?

Any help wil be greatly useful........

Submitted on Apr 03, 21
add a comment

1 Answer


Joins are used when you need data from multiple tables at the same time. Please note that there must be a foreign key (FK) defined.
You can use as many tables as you need, but I'll give you a simple example with only 2 tables.

Let's say you have 2 tables: users and user_info.

In the users table you have: id, username and password

In the user_info table you have: id, name, age, email, address, phone, and user_id (FK)

If for a logged in user you want to display his info (let's say an account page), you'll need to use join.

For example:

SELECT, ui.age, 
FROM user_info AS ui
JOIN users as u
ON = ui.user_id

Some references:

1. Validate SQL query:  (
2. SQL Join Types: (

Submitted 5 months, 2 weeks ago

Wanna Post Ad?
Reach a large group of audience by posting an ad about your business here. For more details
Drop us a Message