Sail E0 Webinar

MCQs

Total Questions : 7
Question 1. Select __________ from instructor where dept name= 'Comp. Sci.';Which of the following should be used to find the mean of the salary ?
  1.    Mean(salary)
  2.    Avg(salary)
  3.    Sum(salary)
  4.    Count(salary)
 Discuss Question
Answer: Option B. -> Avg(salary)


Avg(salary)Avg() is used to find the mean of the values.


Question 2. All aggregate functions except _____ ignore null values in their input collection.
  1.    Count(attribute)
  2.    Count(*)
  3.    Avg
  4.    Sum
 Discuss Question
Answer: Option B. -> Count(*)


Count(*)* is used to select all values including null.


Question 3. Aggregate functions are functions that take a ___________ as input and return a single value.
  1.    Collection of values
  2.    Single value
  3.    Aggregate value
  4.    Both a & b
 Discuss Question
Answer: Option A. -> Collection of values


Collection of values


Question 4. Select count (____ ID)from teacheswhere semester = 'Spring' and year = 2010;If we do want to eliminate duplicates, we use the keyword ______in the aggregate expression.
  1.    Distinct
  2.    Count
  3.    Avg
  4.    Primary key
 Discuss Question
Answer: Option A. -> Distinct


DistinctDistinct keyword is used to select only unique items from the relation.


Question 5. A Boolean data type that can take values true, false, and________ .
  1.    1
  2.    0
  3.    Null
  4.    Unknown
 Discuss Question
Answer: Option D. -> Unknown


UnknownUnknown values do not take null value but it is not known.


Question 6. We can test for the nonexistence of tuples in a subquery by using the _____ construct.
  1.    Not exist
  2.    Not exists
  3.    Exists
  4.    Exist
 Discuss Question
Answer: Option B. -> Not exists


Not existsExists is used to check for existence of tuples.


Question 7. The ____ connective tests for set membership, where the set is a collection of values produced by a select clause. The ____ connective tests for the absence of set membership.
  1.    Or, in
  2.    Not in, in
  3.    In, not in
  4.    In, or
 Discuss Question
Answer: Option C. -> In, not in


In, not inIn checks if the query has the value but not in checks if it does not have the value.


Latest Videos

Latest Test Papers