Page 9 - IPP-12-2024
P. 9

Or
                      1.  WHERE Clause:
                         The WHERE clause is used to filter rows from a table based on specified conditions. It is used in the SELECT,
                         UPDATE and DELETE statements to narrow down the result set. The conditions in the WHERE clause
                         are evaluated for each row and only the rows that satisfy the conditions are included in the result.
                         Example:
                         Suppose you have a “Customers” table with columns: CustomerID, CustomerName, City and
                         Total Purchase. You want to retrieve the names of customers who have made a total purchase greater
                         than $1000 and are from the city 'New York'. Here’s how you would use the WHERE clause:

                         SELECT CustomerName
                        FROM Customers
                        WHERE TotalPurchase > 1000 AND City = 'New York';
                         In this example, the WHERE clause filters out rows where the TotalPurchase is greater than 1000 and the
                         City is 'New York', resulting in a list of customer names who meet both criteria.
                      2.  HAVING Clause:
                         The HAVING clause is used in conjunction with the GROUP BY clause to filter the results of aggregate
                         functions applied to the grouped data. It is used to filter aggregated results based on conditions that
                         involve aggregate functions (such as SUM, COUNT, AVG, etc.).
                         Example:
                         Continuing with the "Customers" table, suppose we want to find the average purchase amount for
                         each city and retrieve only those cities where the average purchase amount is greater than $1500.
                         Here’s how you would use the HAVING clause:
                        SELECT City, AVG(TotalPurchase) AS 'AvgPurchase'
                        FROM Customers
                        GROUP BY City
                        HAVING AVG(TotalPurchase) > 1500;
                         In this example, the HAVING clause filters out aggregated results where the average purchase amount is
                         greater than 1500, and only the cities meeting this criterion are included in the result.
                 29.  The school offers a wireless facility (Wi-Fi) to the Computer Science students of Class XI. For communication,
                    the network security staff of the school has a registered URL i.e. schoolwifi.edu. On 17 September 2017, the
                    following email was mass distributed to all the Computer Science students of Class XI. The email claimed
                    that the password of the students was about to expire. Instructions were given to go to the URL to renew
                    their password within 24 hours.                                                           [3]

















                      (i)  Do you find any discrepancy in this email?
                      (ii)  What will happen if the student will click on the given URL?
                      (iii)  Is the email an example of cybercrime? If yes, specify which type of cybercrime it is. Justify your answer.
                Ans.  (i)  The general email format contains sender information on top. This information contains the sender’s
                         name and the sender’s e-mail id. Then the Subject line is missing. And if we look carefully, the URL
                         given in the mail has one extra ‘i’. The original school URL is schoolwifi.edu while the URL given in the
                         mail is schoolwifii.edu/update password.
                      (ii)  After clicking the link, the user will be redirected to some other website where it may ask for any
                         personal details which can be dangerous. It can lead to identity theft. It will redirect the user to change
                         the password. This is not a secure URL, so the information can be open to anyone and can be hacked
                         or stolen from the database.
                      (iii)  Yes, it can be an example of cybercrime as it is a phishing activity.
                                                                                         Appendices          A.31
   4   5   6   7   8   9   10   11   12   13   14