Database - Introduction to SQL - Discussion
Discussion Forum : Introduction to SQL - General Questions (Q.No. 18)
18.
The SQL -92 wildcards are ____ and ____ .
Discussion:
12 comments Page 1 of 2.
SHIVAM RAWAT said:
5 years ago
Wildcards are used in SQL to match a string pattern. There are two types of wildcards: % (percent sign) represents zero, one, or more characters (underscore) represents exactly one character.
(2)
Chandan said:
1 decade ago
Actually when we want to match substring then we use % or pair of % as:
'sql%' this will return all results which starts with sql.
'%sql' will result in returning all string ending with sql.
'%sql%' having substring as sql.
Where we use '_' for character as:
'_' will return result which contains only one character in string.
'_ _ _ _' will return strings with exactly 4 characters
'sql_ _ _' will result in string which have exactly 3 characters followed by sql. i.e - 'sqltbl' and so on.
'sql%' this will return all results which starts with sql.
'%sql' will result in returning all string ending with sql.
'%sql%' having substring as sql.
Where we use '_' for character as:
'_' will return result which contains only one character in string.
'_ _ _ _' will return strings with exactly 4 characters
'sql_ _ _' will result in string which have exactly 3 characters followed by sql. i.e - 'sqltbl' and so on.
(1)
BHAJAN said:
10 years ago
A is the right answer because in SQL-92 * and % both are used as identical wild card.
(1)
Siva said:
1 decade ago
Option 'a' is correct bcs * and % are used in sql.
Kiran said:
1 decade ago
In Oracle, % (percentage) and _ (underscore) have a special meaning. These two wild card characters are used with LIKE operator:
% allows matching any string of any length (including zero length)
_ allows matching a single character
so the answer is B
% allows matching any string of any length (including zero length)
_ allows matching a single character
so the answer is B
Lokesh said:
1 decade ago
Thanks kiran.
Madhu said:
1 decade ago
I also agree with the answer of kiran that % is used for more dan one character match and _ is used for single character match.
Manoj Tiwari said:
1 decade ago
In SQL, wildcard characters can be used in "LIKE" expressions; the percent sign (%) matches zero or more characters, and underscore (_) a single character.
Mahesh said:
1 decade ago
We use count (*) to count rows where * is the wildcard.
Pooja said:
1 decade ago
Why we called % and _ are wildcard?
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers