(ii) SELECT CNAME, SPORTS FROM CLUB WHERE

     DOAPP<"2006-04-30" AND CNAME LIKE "%NA";

Answer

Answer by student

The output of the SQL query is

[Sample Paper Class 12] SELECT CNAME, SPORTS FROM CLUB WHERE DOAPP - CBSE Class 12 Sample Paper for 2024 Boards

Detailed answer by teachoo

  • The given SQL query is a SELECT statement that retrieves data from the table CLUB .
  • The CNAME and SPORTS columns are specified in the SELECT clause, which means that only these two columns will be displayed in the result set.
  • The WHERE clause is used to filter the rows that match certain conditions. In this case, the conditions are:
    • DOAPP<“2006-04-30” , which means that the date of application (DOAPP) should be less than April 30, 2006. This condition will exclude the rows that have a later date of application.
    • CNAME LIKE “%NA” , which means that the club name (CNAME) should end with the letters ‘NA’. The LIKE operator is used to perform pattern matching using wildcards. The % symbol represents any sequence of characters. This condition will exclude the rows that do not have a club name ending with ‘NA’.
  • The AND operator is used to combine the two conditions, which means that both of them should be true for a row to be selected. This operator will narrow down the result set by eliminating the rows that do not satisfy both conditions.
  • The result of the query is a table with two columns ( CNAME and SPORTS ) and one row that matches the conditions. To find this row, we can look at the table and compare each row with the conditions. It is:
    • The row with CID=1256, CNAME=AMINA, AGE=36, GENDER=FEMALE, SPORTS=CHESS, PAY=1100, DOAPP=2003-08-15. This row satisfies both conditions, since DOAPP is less than 2006-04-30 and CNAME ends with ‘NA’. Therefore, this row is selected and its CNAME and SPORTS values are displayed in the result set.
  • The other rows do not satisfy both conditions, so they are not selected and not displayed in the result set.

So, the final output of the query is:

part 2 - Question 27 (ii) - CBSE Class 12 Sample Paper for 2024 Boards - Solutions to CBSE Sample Paper - Computer Science Class 12 - Computer Science - Class 12

Remove Ads
Davneet Singh's photo - Co-founder, Teachoo

Made by

Davneet Singh

Davneet Singh is an IIT Kanpur graduate and has been teaching for 16+ years. At Teachoo, he breaks down Maths, Science and Computer Science into simple steps so students understand concepts deeply and score with confidence.

Many students prefer Teachoo Black for a smooth, ad-free learning experience.