By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,911 Members | 1,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,911 IT Pros & Developers. It's quick & easy.

wrong test?

P: n/a
This is a test I made that I believe has a wrong solution, they say the
correct answer is C ?!?

----
You are an asp.net developer and currently you are working on te sql
statement you will use to retrieve data from te customers table. Wat is te
result of the following statement ?

SELECT ID='identity', name='customer'
FROM customers
WHERE ID=1

A) The SQL statement results in te customers table being updated with te
values in te two variables identity and name.

B) The SQL statement results in two columns tat contain te strings
'identity' and 'name' for every row.

C) The SQL statement results in two columns labeled identity and name being
returned.

D) The SQL statement results in a syntax error.
Jun 21 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Yes, C sounds right to me.
You might as well delete everything after the FROM statement because it's
not being used. No columns from the customers table are being referenced,
rather two hard coded values are being returned.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"Spartaco" <bo*@boh.voh> wrote in message
news:uF**************@TK2MSFTNGP03.phx.gbl...
This is a test I made that I believe has a wrong solution, they say the
correct answer is C ?!?

----
You are an asp.net developer and currently you are working on te sql
statement you will use to retrieve data from te customers table. Wat is te
result of the following statement ?

SELECT ID='identity', name='customer'
FROM customers
WHERE ID=1

A) The SQL statement results in te customers table being updated with te
values in te two variables identity and name.

B) The SQL statement results in two columns tat contain te strings
'identity' and 'name' for every row.

C) The SQL statement results in two columns labeled identity and name
being returned.

D) The SQL statement results in a syntax error.

Jun 21 '06 #2

P: n/a
c is correct.

the column names returned are:

id,name

but the number of rows in the result set will depend on the number of
customer whose id is 1. if none, no rows are returned. if 1 or more then
each row will be the strings:

'identity','customer'
-- bruce (sqlwork.com)

"Spartaco" <bo*@boh.voh> wrote in message
news:uF**************@TK2MSFTNGP03.phx.gbl...
This is a test I made that I believe has a wrong solution, they say the
correct answer is C ?!?

----
You are an asp.net developer and currently you are working on te sql
statement you will use to retrieve data from te customers table. Wat is te
result of the following statement ?

SELECT ID='identity', name='customer'
FROM customers
WHERE ID=1

A) The SQL statement results in te customers table being updated with te
values in te two variables identity and name.

B) The SQL statement results in two columns tat contain te strings
'identity' and 'name' for every row.

C) The SQL statement results in two columns labeled identity and name
being returned.

D) The SQL statement results in a syntax error.

Jun 21 '06 #3

P: n/a
The correct answer is "C".

One row will be returned; there will be two columns in it.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Spartaco" <bo*@boh.voh> wrote in message news:uF**************@TK2MSFTNGP03.phx.gbl...
This is a test I made that I believe has a wrong solution, they say the correct answer is C ?!?

----
You are an asp.net developer and currently you are working on te sql statement you will use to
retrieve data from te customers table. Wat is te result of the following statement ?

SELECT ID='identity', name='customer'
FROM customers
WHERE ID=1

A) The SQL statement results in te customers table being updated with te values in te two
variables identity and name.

B) The SQL statement results in two columns tat contain te strings 'identity' and 'name' for every
row.

C) The SQL statement results in two columns labeled identity and name being returned.

D) The SQL statement results in a syntax error.

Jun 21 '06 #4

P: n/a
It also depends if the customers table has an entry in it, with ID of 1.

Use pubs
GO

SELECT ID='identity', name='customer'
FROM titles
WHERE title_id='doesnotexist'

SELECT ID='identity', name='customer'
FROM titles
WHERE title_id='ps3333'

Go


"Spartaco" <bo*@boh.voh> wrote in message
news:uF**************@TK2MSFTNGP03.phx.gbl...
This is a test I made that I believe has a wrong solution, they say the
correct answer is C ?!?

----
You are an asp.net developer and currently you are working on te sql
statement you will use to retrieve data from te customers table. Wat is te
result of the following statement ?

SELECT ID='identity', name='customer'
FROM customers
WHERE ID=1

A) The SQL statement results in te customers table being updated with te
values in te two variables identity and name.

B) The SQL statement results in two columns tat contain te strings
'identity' and 'name' for every row.

C) The SQL statement results in two columns labeled identity and name being returned.

D) The SQL statement results in a syntax error.

Jun 22 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.