0% found this document useful (0 votes)
1 views

dfv

The document outlines a practical exercise for Class 12 students on creating a customer table and counting customers by country using SQL. It explains the use of COUNT functions to differentiate between counting all rows and counting only non-NULL entries. The conclusion emphasizes the appropriate use of COUNT(column_name) and COUNT(*) based on the counting requirements.

Uploaded by

www.suraj3000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

dfv

The document outlines a practical exercise for Class 12 students on creating a customer table and counting customers by country using SQL. It explains the use of COUNT functions to differentiate between counting all rows and counting only non-NULL entries. The conclusion emphasizes the appropriate use of COUNT(column_name) and COUNT(*) based on the counting requirements.

Uploaded by

www.suraj3000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CS Practical File Session 2024-25 CLASS 12

Create a customer (customer_id, name, country) table and find the number of customer
from each country in the table using group by
Ans:

85 AMAN PAL GSBV BURARI, DELHI


CS Practical File Session 2024-25 CLASS 12

Counting All Rows in a Table: To find the total number of employees in the table, including
those who haven't provided salary information, use:

Combining Both: To compare the total num rows with the number of that have non- NULL
salary values, you can use:

OUTPUT:

Conclusion
Use COUNT (column_name) when you need to count only the meaningful, non-NULL entries
in a specific column.

Use COUNT(*) when you want to count all rows in a table, regardless of the Presence of
NULL values.

90 AMAN PAL GSBV BURARI, DELHI

You might also like