41 Database Management Systems • SQL Basics SQL में जिन रिकॉर्डों के Email फ़ील्ड में NULL है, उन्हें चुनने के लिए सही शर्त कौन-सी है? Which SQL condition correctly selects records whose Email field contains NULL? सेव करें Save सेव्ड Saved A. Email = NULL Email = NULL B. Email IS NULL Email IS NULL C. Email = 'NULL' Email = 'NULL' D. Email = 0 Email = 0 उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: B Correct Answer: B NULL की जाँच IS NULL से की जाती है। उद्धरण चिह्नों में 'NULL' एक टेक्स्ट मान है, वास्तविक NULL नहीं। IS NULL tests for NULL. The quoted value 'NULL' is text, not an actual NULL value.
42 Database Management Systems • SQL Basics SQL में SELECT Department, COUNT(*) FROM Employee GROUP BY Department; क्या लौटाता है? What does SELECT Department, COUNT(*) FROM Employee GROUP BY Department; return in SQL? सेव करें Save सेव्ड Saved A. केवल सभी विभागों की संयुक्त कर्मचारी संख्या Only the combined employee count across all departments B. केवल सबसे अधिक कर्मचारियों वाला विभाग Only the department with the most employees C. प्रत्येक कर्मचारी का पूरा व्यक्तिगत विवरण The complete personal details of each employee D. प्रत्येक विभाग और उससे संबंधित पंक्तियों की संख्या Each department and the number of rows belonging to it उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: D Correct Answer: D GROUP BY समान Department वाले रिकॉर्डों के समूह बनाता है। COUNT(*) प्रत्येक समूह की पंक्तियाँ गिनता है। GROUP BY forms groups of records with the same Department value. COUNT(*) counts the rows in each group.
43 Database Management Systems • SQL Basics एक SQL टेबल की पाँच पंक्तियों में Marks के मान 10, NULL, 20, NULL और 0 हैं। COUNT(Marks) और COUNT(*) के परिणाम क्रमशः क्या होंगे? A SQL table has five rows with Marks values 10, NULL, 20, NULL and 0. What are the results of COUNT(Marks) and COUNT(*) respectively? सेव करें Save सेव्ड Saved A. 3 और 5 3 and 5 B. 2 और 5 2 and 5 C. 5 और 3 5 and 3 D. 3 और 3 3 and 3 उत्तर और व्याख्या देखें Show answer and explanation सही उत्तर: A Correct Answer: A COUNT(Marks) केवल गैर-NULL मान गिनता है, जिनमें 0 भी शामिल है। COUNT(*) सभी पाँच पंक्तियाँ गिनता है। COUNT(Marks) counts non-NULL values, including zero. COUNT(*) counts all five rows.