-- Database schema
| Categories : CategoryID [ INTEGER ] primary_key , CategoryName [ TEXT ] , Description [ TEXT ] | Customers : CustomerID [ INTEGER ] primary_key , CustomerName [ TEXT ] , ContactName [ TEXT ] , Address [ TEXT ] , City [ TEXT ] , PostalCode [ TEXT ] , Country [ TEXT ] | Employees : EmployeeID [ INTEGER ] primary_key , LastName [ TEXT ] , FirstName [ TEXT ] , BirthDate [ DATE ] , Photo [ TEXT ] , Notes [ TEXT ] | Shippers : ShipperID [ INTEGER ] primary_key , ShipperName [ TEXT ] , Phone [ TEXT ] | Suppliers : SupplierID [ INTEGER ] primary_key , SupplierName [ TEXT ] , ContactName [ TEXT ] , Address [ TEXT ] , City [ TEXT ] , PostalCode [ TEXT ] , Country [ TEXT ] , Phone [ TEXT ] | Products : ProductID [ INTEGER ] primary_key , ProductName [ TEXT ] , SupplierID [ INTEGER ] Products.SupplierID = Suppliers.SupplierID , CategoryID [ INTEGER ] Products.CategoryID = Categories.CategoryID , Unit [ TEXT ] , Price [ REAL ] | Orders : OrderID [ INTEGER ] primary_key , CustomerID [ INTEGER ] Orders.CustomerID = Customers.CustomerID , EmployeeID [ INTEGER ] Orders.EmployeeID = Employees.EmployeeID , OrderDate [ DATETIME ] , ShipperID [ INTEGER ] Orders.ShipperID = Shippers.ShipperID | OrderDetails : OrderDetailID [ INTEGER ] primary_key , OrderID [ INTEGER ] OrderDetails.OrderID = Orders.OrderID , ProductID [ INTEGER ] OrderDetails.ProductID = Products.ProductID , Quantity [ INTEGER ] |
-- -- Among the products that are no longer in continuous production, how many of them have their supplier in the USA?

SELECT COUNT(T1.Discontinued) FROM Products AS T1 INNER JOIN Suppliers AS T2 ON T1.SupplierID = T2.SupplierID WHERE T2.Country = 'USA' AND T1.Discontinued = 1;