Home
  • Home
  • Database
  • MS SQL Server 2012
  • Querying Microsoft SQL Server 2012 (70-461)
1.
Why is it important to use standard SQL code when possible and know what is standard and what isn’t? (Choose all that apply.)
  • A.
    It is not important to code using standard SQL.
  • B.
    Standard SQL code is more portable between platforms.
  • C.
    Standard SQL code is more efficient.
  • D.
    Knowing what standard SQL code is makes your knowledge more portable.
  • Answer & Explanation
  • Report
Answer : [B, D]
Explanation :
A. Incorrect: It is important to use standard code.
B. Correct: Use of standard code makes it easier to port code between platforms because fewer revisions are required.
C. Incorrect: There’s no assurance that standard code will be more efficient.
D. Correct: When using standard code, you can adapt to a new environment more easily because standard code elements look similar in the different platforms.
Report
Name Email  
2.
Which of the following is not a violation of the relational model?
  • A.
    Using ordinal positions for columns
  • B.
    Returning duplicate rows
  • C.
    Not defining a key in a table
  • D.
    Ensuring that all attributes in the result of a query have names
  • Answer & Explanation
  • Report
Answer : [D]
Explanation :
A. Incorrect: A relation has a header with a set of attributes, and tuples of the relation have the same heading. A set has no order, so ordinal positions do not have meaning and constitute a violation of the relational model. You should refer to attributes by their name.
B. Incorrect: A query is supposed to return a relation. A relation has a body with a set of tuples. A set has no duplicates. Returning duplicate rows is a violation of the relational model.
C. Incorrect: Not defining a key in the table allows duplicate rows in the table, and like the answer to B, that’s a violation of the relational model.
D. Correct: Because attributes are supposed to be identified by name, ensuring that all attributes have names is relational, and hence not a violation of the relational model.
Report
Name Email  
3.
What is the relationship between SQL and T-SQL?
  • A.
    T-SQL is the standard language and SQL is the dialect in Microsoft SQL Server.
  • B.
    SQL is the standard language and T-SQL is the dialect in Microsoft SQL Server.
  • C.
    Both SQL and T-SQL are standard languages.
  • D.
    Both SQL and T-SQL are dialects in Microsoft SQL Server.
  • Answer & Explanation
  • Report
Answer : [C]
Explanation :
A. Incorrect: T-SQL isn’t standard and SQL isn’t a dialect in Microsoft SQL Server. B. Correct: SQL is standard and T-SQL is a dialect in Microsoft SQL Server. C. Incorrect: T-SQL isn’t standard. D. Incorrect: SQL isn’t a dialect in Microsoft SQL Server.
Report
Name Email  
4.
Which of the following correctly represents the logical query processing order of the various query clauses?
  • A.
    SELECT > FROM > WHERE > GROUP BY > HAVING > ORDER BY
  • B.
    FROM > WHERE > GROUP BY > HAVING > SELECT > ORDER BY
  • C.
    FROM > WHERE > GROUP BY > HAVING > ORDER BY > SELECT
  • D.
    SELECT > ORDER BY > FROM > WHERE > GROUP BY > HAVING
  • Answer & Explanation
  • Report
Answer : [B]
Explanation :
A. Incorrect: Logical query processing doesn’t start with the SELECT clause. B. Correct: Logical query processing starts with the FROM clause, and then moves on to WHERE, GROUP BY, HAVING, SELECT, and ORDER BY. C. Incorrect: The ORDER BY clause isn’t evaluated before the SELECT clause. D. Incorrect: Logical query processing doesn’t start with the SELECT clause.
Report
Name Email  
5.
Which of the following is invalid? (Choose all that apply.)
  • A.
    Referring to an attribute that you group by in the WHERE clause
  • B.
    Referring to an expression in the GROUP BY clause; for example, GROUP BY YEAR(orderdate)
  • C.
    In a grouped query, referring in the SELECT list to an attribute that is not part of the GROUP BY list and not within an aggregate function
  • D.
    Referring to an alias defined in the SELECT clause in the HAVING clause
  • Answer & Explanation
  • Report
Answer : [C, D]
Explanation :
A. Incorrect: T-SQL allows you to refer to an attribute that you group by in the WHERE clause. B. Incorrect: T-SQL allows grouping by an expression. C. Correct: If the query is a grouped query, in phases processed after the GROUP BY phase, each attribute that you refer to must appear either in the GROUP BY list or within an aggregate function. D. Correct: Because the HAVING clause is evaluated before the SELECT clause, referring to an alias defined in the SELECT clause within the HAVING clause is invalid.
Report
Name Email