Show the output of Bikes that are the Color Black. (database name adventureworks) (two tables which have information "product" "productcategory"
You will need to see which tables in the database contains this information and join these tables together to show the output. If you do not have a join in your response your submission will not be accepted
Here Adventureworks is the name of the database that are having two table having the information of PRODUCT and PRODUCT CATEGORY .
So to join these tables PRODUCT and PRODUCT CATEGORY, join clause is used.
So to fetch output of bike as in given question, it has to be fetch from PRODUCT table in which the PRODUCT is BIKE and then further from its PRODUCT CATEGORY table , its colour should be fetched as Black.
So by using adventurework database, USE keyword as a command is used and the aforementioned tables are used to fetch the data. The respective command is:
Select * from PRODUCT NATURAL JOIN PRODUCT_CATEGORY where PRODUCT.product_name ="Bike" and PRODUCT_CATEGORY.color="Black";
Get Answers For Free
Most questions answered within 1 hours.