What is returned?

Consider the table structure shown by this output:
Mysql> desc city:

5 rows in set (0.00 sec)
You execute this statement:
SELECT -,-, city. * FROM city LIMIT 1
What is returned?

Consider the table structure shown by this output:
Mysql> desc city:

5 rows in set (0.00 sec)
You execute this statement:
SELECT -,-, city. * FROM city LIMIT 1
What is returned?

A.
An error message

B.
One row with 5 columns

C.
One row with 10 columns

D.
One row with 15 columns



Leave a Reply 5

Your email address will not be published. Required fields are marked *


Jay

Jay

If the question is correct it’s A.
But I don’t think it written correctly so I want to put my thoughts on this…

These return error messages:
SELECT -,-, city. * FROM city LIMIT 1
SELECT *,*,city.* FROM city LIMIT 1;
SELECT city.*,*,city.* FROM city LIMIT 1;
SELECT *,city.*,* FROM city LIMIT 1;
SELECT *,* FROM city LIMIT 1;
SELECT city.*,* FROM city LIMIT 1;

These returns 15
SELECT city.*,city.*,city.* FROM city LIMIT 1;
SELECT *,city.*,city.* FROM city LIMIT 1;

These Return 10
SELECT city.*,city.* FROM city LIMIT 1;
SELECT *,city.* FROM city LIMIT 1;

These return 5
SELECT city.* FROM city LIMIT 1;
SELECT * FROM city LIMIT 1;

What I am trying to say is, “If two asterisks (*,*) are used together then the statement produces an error, or if an asterisks (*) is used after the table name asterisk(city.*) it also produces an error.

So I believe the question is asking (SELECT *,*, city.* FROM city LIMIT 1) which produces an error.