Q. Mr. Mittal is using a table with following columns:


         Name, Class, Stream_ld, Stream_name


He needs to display names of students who have not been assigned any stream or have been assigned stream_name that ends with "computers".


He wrote the following command, which did not give the desired result.


SELECT Name, Class FROM Students

WHERE Stream_name = NULL OR Stream_name = "%computers" ;


Help Mr. Mittal to run the query by removing the error and write correct query.


Answer =

SELECT Name, Class FROM Students
WHERE Stream_name is NULL OR Stream_name   like "%computers" ;

4 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. Do we can use Stream_name=`computers´

    ReplyDelete
    Replies
    1. No, beacuse question wants names of student who have stream end with "computer".

      Delete
  2. In the last statement--Stream_name like "%computers" ;
    So can't we put the '%' symbol after the 'computers'?
    I
    i.e. Stream_name like "computers%" ;
    Is this also correct or not???

    ReplyDelete
  3. computers% means computers should be starting of stream_name not ending

    ReplyDelete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post