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" ;
Do we can use Stream_name=`computers´
ReplyDeleteNo, beacuse question wants names of student who have stream end with "computer".
DeleteIn the last statement--Stream_name like "%computers" ;
ReplyDeleteSo can't we put the '%' symbol after the 'computers'?
I
i.e. Stream_name like "computers%" ;
Is this also correct or not???
computers% means computers should be starting of stream_name not ending
ReplyDeletePost a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )