More DBA job interview questions and answers at
http://dba.fyicenter.com/Interview-Questions/
(Continued from previous question...)
You have installed a US English SQL Server 2000 instance with the default options, collation, and sorting...
You have installed a US English SQL Server 2000 instance with the default options, collation, and sorting. What does this return:
create table MyTable
( Mychar varchar(20))
go
insert Mytable select 'Apple'
insert Mytable select 'ant'
insert Mytable select 'Ball'
go
select * from MyTable where Mychar like '[^a]%'
Answer
Ball
Explanation
This should return "Ball" only since the ^ operator means not matching the next character. In this case, the first character should not be an "A".
(Continued on next question...)