Sail E0 Webinar

MCQs

Total Questions : 10
Question 1. Select ID, GPA from student grades order by GPA ____________
Inorder to give only 10 rank on the whole we should use :
  1.    Limit 10
  2.    Upto 10
  3.    Only 10
  4.    Max 10
 Discuss Question
Answer: Option A. -> Limit 10


Limit clause does not support partitioning, so we cannot get the top n within each partition without performing ranking; further, if more than one student gets the same GPA, it is possible that one is included in the top 10, while another is excluded.


Question 2. Windowing function was added in which of the following versions of SQL Server ?
  1.    2003
  2.    2005
  3.    2008
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> 2008


SQL Server has had only a partial implementation up to now, but it has come up in SQL 2012.


Question 3. Which of the following is not the function of client ?
  1.    Compile queries
  2.    Query optimization
  3.    Receive queries
  4.    Result formatting and presentation
 Discuss Question
Answer: Option B. -> Query optimization


Query optimization is used to improve the quality.


Question 4. Which of the the function is not a ranking window function ?
  1.    RANK
  2.    NTILE
  3.    ROW_NUMBER
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> RANK


Since SQL Server 2005 we have had support for some window functions, they are: ROW_NUMBER, RANK, DENSE_RANK and NTILE.


Question 5. Purpose of foreign key constraint in SQL Server is :
  1.    FOREIGN KEY constraints identify and enforce the relationships between tables
  2.    A foreign key in one table points to a candidate key in another table
  3.    You cannot insert a row with a foreign key value, except NULL, if there is no candidate key with that value
  4.    None of the mentioned
 Discuss Question
Answer: Option A. -> FOREIGN KEY constraints identify and enforce the relationships between tables




Question 6. Which of the following constraint does not enforce uniqueness ?
  1.    UNIQUE
  2.    Primary key
  3.    Foreign key
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> Foreign key


FOREIGN KEY constraints identify and enforce the relationships between tables.


Question 7. The command ________________ such tables are available only within the transaction executing the query, and are dropped when the transaction finishes.
  1.    Create table
  2.    Create temporary table
  3.    Create view
  4.    Create label view
 Discuss Question
Answer: Option B. -> Create temporary table


DDL statement is used alter structure of table.


Question 8. Which of the following error message will be displayed if ORDER CLAUSE is not mentioned in ROW NUMBER function ?
  1.    The ranking function ROW_NUMBER" must have an ORDER BY clause."
  2.    The ranking function ROW_NUMBER" must have an OVER BY clause."
  3.    The ranking function ROW_NUMBER" must have an PARTITION BY clause."
  4.    All of the mentioned
 Discuss Question
Answer: Option C. -> The ranking function ROW_NUMBER" must have an PARTITION BY clause."


ORDER BY CLAUSE is not optional clause in ROW NUMBER function.


Question 9. Which of the following is the simplest ranking function ?
  1.    RANK
  2.    NTILE
  3.    ROW_NUMBER
  4.    None of the mentioned
 Discuss Question
Answer: Option C. -> ROW_NUMBER


The ROW_NUMBER ranking function is the simplest of the ranking functions.Its purpose in life is to provide consecutive numbering of the rows in the result set by the order selected in the OVER clause for each partition specified in the OVER clause.


Question 10. Select * from employee where salary>10000 and dept_id=101;
Which of the following fields are displayed as output?
  1.    Salary, dept_id
  2.    Employee
  3.    Salary
  4.    All the field of employee relation
 Discuss Question
Answer: Option D. -> All the field of employee relation


Here * is used to select all the fields of the relation.


Latest Videos

Latest Test Papers