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:
2 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.
Hrishi said:
6 years ago
What is SQL -92?
Ramesh said:
7 years ago
These two wildcards are imp in SQL.
% called as a Like operator.
% called as a Like operator.
BHAJAN said:
7 years ago
A is the right answer because in SQL-92 * and % both are used as identical wild card.
Pooja said:
8 years ago
Why we called % and _ are wildcard?
Mahesh said:
8 years ago
We use count (*) to count rows where * is the wildcard.
Chandan said:
9 years 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.
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.
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.
Lokesh said:
1 decade ago
Thanks kiran.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers