You are tasked to analyze blocking behavior of the following query: 
SET TRANSACTION ISOLATION LEVEL SERIALIZABLE 
WITH Customers AS (          
SELECT *          
FROM    Customer ), 
SalesTotal AS (          
SELECT CustomerId, SUM(OrderTotal) AS AllOrderTotal          
FROM    SalesOrder) 
SELECT CustomerId, AllOrderTotal 
FROM    SalesTotal 
WHERE   AllOrderTotal > 10000.00; 
You need to determine if other queries that are using the Customer table will be blocked by this query. You 
also need to determine if this query will be blocked by other queries that are using the Customer table. 
What behavior should you expect? 
A. The other queries will be blocked by this query. The safer , easier way to help you pass any IT exams. 
48 / 80 
This query will be blocked by the other queries. 
B. The other queries will be blocked by this query. 
This query will not be blocked by the other queries. 
C. The other queries will not be blocked by this query. 
This query will be blocked by the other queries. 
D. The other queries will not be blocked by this query. 
This query will not be blocked by the other queries

解决方案 »

  1.   

    我感觉和CTE没有关系,注意当年的事务级别是
     SERIALIZABLE
      

  2.   


    --You are tasked to analyze blocking behavior of the following query: 
    SET TRANSACTION ISOLATION LEVEL SERIALIZABLE 
    WITH    Customers
              AS ( SELECT   *
                   FROM     Customer
                 ),
            SalesTotal
              AS ( SELECT   CustomerId ,
                            SUM(OrderTotal) AS AllOrderTotal
                   FROM     SalesOrder
                 )
        SELECT  CustomerId ,
                AllOrderTotal
        FROM    SalesTotal
        WHERE   AllOrderTotal > 10000.00 ; --You need to determine 
    --if other queries that are using the Customer table will be blocked by this query. You 
    --also need to determine 
    --if this query will be blocked by other queries that are using the Customer table. /*
    What behavior should you expect? 
    A. The other queries will be blocked by this query. 
    The safer , easier way to help you pass any IT exams. 48 / 80 
    This query will be blocked by the other queries. 
    B. The other queries will be blocked by this query. 
    This query will not be blocked by the other queries. 
    C. The other queries will not be blocked by this query. 
    This query will be blocked by the other queries. 
    D. The other queries will not be blocked by this query. 
    This query will not be blocked by the other queries
    */我也认为应该选择D,这种情况不会发生堵塞。