πŸ“’ Too many exams? Don’t know which one suits you best? Book Your Free Expert πŸ‘‰ call Now!

  • google app store apple app store
  • βœ–

      Question

      What will be the output of the following SQL query?

      SELECT COUNT(*) FROM Transactions WHERE Amount > 10000 AND Status = 'Completed';
      A Returns all transaction records where amount exceeds β‚Ή10,000 Correct Answer Incorrect Answer
      B Returns the total number of completed transactions where the amount exceeds β‚Ή10,000 Correct Answer Incorrect Answer
      C Returns the sum of all transaction amounts greater than β‚Ή10,000 Correct Answer Incorrect Answer
      D Returns an error because COUNT(*) cannot be used with multiple WHERE conditions Correct Answer Incorrect Answer
      E Returns the average transaction amount for completed transactions above β‚Ή10,000 Correct Answer Incorrect Answer

      Solution

      COUNT() counts the total number of rows satisfying all conditions in the WHERE clause. The AND operator requires BOTH conditions to be true simultaneously i.e. Amount > 10000 AND Status = 'Completed'. The result is a single integer value. Commonly used functions: β€’ COUNT() β€” total rows β€’ COUNT(column) β€” non-NULL values only β€’ SUM(column) β€” total of numeric values β€’ AVG(column) β€” arithmetic mean β€’ MAX(column) β€” highest value β€’ MIN(column) β€” lowest value

      Practice Next

      Relevant for Exams:

      ask-question