Q:

From the following tables write a SQL query to select all rows from both participating tables as long as there is a match between pro_com and com_id

0

From the following tables write a SQL query to select all rows from both participating tables as long as there is a match between pro_com and com_id

COM_ID COM_NAME
------ -------------
    11 Samsung
    12 iBall
    13 Epsion
    14 Zebronics
    15 Asus
    16 Frontech
 PRO_ID PRO_NAME                       PRO_PRICE    PRO_COM
------- ------------------------- -------------- ----------
    101 Mother Board                    3200.00         15
    102 Key Board                        450.00         16
    103 ZIP drive                        250.00         14
    104 Speaker                          550.00         16
    105 Monitor                         5000.00         11
    106 DVD drive                        900.00         12
    107 CD drive                         800.00         12
    108 Printer                         2600.00         13
    109 Refill cartridge                 350.00         13
    110 Mouse                            250.00         12

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

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

Output of the Query:

pro_id	pro_name		pro_price	pro_com	com_id	com_name
101	Mother Board		3200.00		15	15	Asus
102	Key Board		450.00		16	16	Frontech
103	ZIP drive		250.00		14	14	Zebronics
104	Speaker			550.00		16	16	Frontech
105	Monitor			5000.00		11	11	Samsung
106	DVD drive		900.00		12	12	iBall
107	CD drive		800.00		12	12	iBall
108	Printer			2600.00		13	13	Epsion
109	Refill cartridge	350.00		13	13	Epsion
110	Mouse			250.00		12	12	iBall

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now