w3resource
SQL exercises

SQL Exercises: Display all the data from the item_mast, including all the data for each item's producer company

SQL JOINS: Exercise-21 with Solution

Write a SQL query to display all the data from the item_mast, including all the data for each item's producer company.

Sample table: company_mast


Sample table: item_mast


Sample Solution:

SELECT *
   FROM item_mast 
   INNER JOIN company_mast
   ON item_mast.pro_com= company_mast.com_id; 

Output:

SQL Join Exercise

Query Visualization:

Duration:

Query visualization of Display all the data from the item_mast, including all the data for each item's producer company - Duration

Rows:

Query visualization of Display all the data from the item_mast, including all the data for each item's producer company - Rows

Cost:

Query visualization of Display all the data from the item_mast, including all the data for each item's producer company - Cost

Practice Online


Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a SQL statement to make a cartesian product between salesman and customer i.e. each salesman will appear for all customer and vice versa for those salesmen who must belong a city which is not the same as his customer and the customers should have an own grade.
Next: Write a SQL query to display the item name, price, and company name of all the products.



New Content: Composer: Dependency manager for PHP, R Programming