Ask Your Question
1

What is the SQL query for obtaining the Delivery Types of Suppliers when only an exclusion table is available?

asked 2021-08-10 11:00:00 +0000

woof gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-10-31 23:00:00 +0000

bukephalos gravatar image

Without knowing the specific table names and columns, it is not possible to provide an exact SQL query. However, here is a general demonstration of how to obtain the Delivery Types of Suppliers using an exclusion table:

Assuming there are three tables: Suppliers, DeliveryTypes and ExclusionTable.

Suppliers table contains columns: SupplierID, SupplierName, SupplierAddress etc.

DeliveryTypes table contains columns: DeliveryTypeID, TypeDescription etc.

ExclusionTable contains columns: SupplierID, DeliveryTypeID.

The query could look like this:

SELECT DT.TypeDescription FROM DeliveryTypes DT LEFT JOIN ExclusionTable ET ON DT.DeliveryTypeID = ET.DeliveryTypeID LEFT JOIN Suppliers S ON ET.SupplierID = S.SupplierID WHERE S.SupplierID IS NULL

This query will list all the Delivery Types that are not associated with any Supplier through the ExclusionTable.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-08-10 11:00:00 +0000

Seen: 8 times

Last updated: Oct 31 '21