এসকিউএল (SQL) — MCQ প্রশ্ন
আইটি ও প্রোগ্রামিং MCQ (ওপেন) · আইটি ও প্রোগ্রামিং। এই অধ্যায়ে মোট 58টি প্রশ্ন আছে। নিচে প্রথম 10টি প্রশ্ন ও অপশন দেওয়া হলো; সঠিক উত্তর সার্ভারে যাচাই হয়।
এই অধ্যায়ে সব প্রশ্নে অনুশীলন করুন
Which SQL clause is used to group rows that have the same values in specified columns into summary rows?
- ORDER BY
- WHERE
- GROUP BY
- HAVING
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Which aggregate function returns the number of rows in a group, including rows with NULL values?
- COUNT(column)
- COUNT(*)
- SUM(1)
- COUNT(DISTINCT column)
উত্তর যাচাই করতে প্র্যাকটিসে যান।
What is the primary difference between the WHERE and HAVING clauses?
- WHERE filters groups, HAVING filters rows
- WHERE filters rows before grouping, HAVING filters groups after grouping
- WHERE works with aggregate functions, HAVING does not
- There is no difference; they are interchangeable
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Which aggregate function calculates the average value of a numeric column?
- MEAN()
- AVERAGE()
- AVG()
- SUM() / COUNT(*)
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Can you use an aggregate function like SUM() directly in a WHERE clause?
- Yes, always
- No, aggregate functions are not allowed in WHERE; use HAVING instead
- Only in MySQL
- Only if you also use GROUP BY
উত্তর যাচাই করতে প্র্যাকটিসে যান।
What does COUNT(DISTINCT department_id) return?
- Total number of rows in the table
- Number of non-NULL department_id values
- Number of unique non-NULL department_id values
- Number of NULL department_id values
উত্তর যাচাই করতে প্র্যাকটিসে যান।
If a SELECT statement includes a column that is not in the GROUP BY clause and not inside an aggregate function, what happens in standard SQL?
- Returns the first value encountered
- Returns NULL for that column
- Throws an error
- Automatically adds the column to GROUP BY
উত্তর যাচাই করতে প্র্যাকটিসে যান।
Which clause is used to filter groups based on a condition involving an aggregate function?
- WHERE
- GROUP BY
- HAVING
- FILTER
উত্তর যাচাই করতে প্র্যাকটিসে যান।
How does the SUM() aggregate function handle NULL values in the column?
- Treats NULL as 0
- Ignores NULL values
- Returns NULL for the entire sum
- Throws an error
উত্তর যাচাই করতে প্র্যাকটিসে যান।
What is the result of the following query? SELECT department_id, AVG(salary) FROM employees GROUP BY department_id HAVING AVG(salary) > 50000;
- All departments with their average salary
- Only departments where the average salary exceeds 50000
- Error: HAVING cannot use AVG
- Only employees with salary > 50000
উত্তর যাচাই করতে প্র্যাকটিসে যান।