Which two statement are true?

Consider the structure of the table countryLanguage and the distribution of the column Is
official.
DESCRIBE CountryLanguage;

SELECT Isofficial, COUNT (Isofficial) FROM CountryLanguage GROUP BY Isofficial;

You add an index on the Isofficial column.
Which two statement are true?

Consider the structure of the table countryLanguage and the distribution of the column Is
official.
DESCRIBE CountryLanguage;

SELECT Isofficial, COUNT (Isofficial) FROM CountryLanguage GROUP BY Isofficial;

You add an index on the Isofficial column.
Which two statement are true?

A.
The optimizer will choose the index when Isofficial=’T’ is in the WHERE clause.

B.
The optimizer will choose the index when Isofficial=’F’ is in the WHERE clause.

C.
The optimizer will not choose the index on the Isofficial column.

D.
The speed of INSERT statements to this table will be improved.

E.
The speed of INSERT statements to this table will be reduced.

F.
The speed of INSERT statements to this table will be unchanged.



Leave a Reply 5

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


Ray

Ray

I tried and it seems that A and B are correct.

Jay

Jay

I tried for A and B, it seems to be correct.
I made over 1000 data entries with a True or False (not indexed) and it took my machine 0.16secs to run a query (I used “select * from q89 where Isoffical = ‘T’;” because the one in this question just ran to fast at 0.00secs). Then I made a new database since the database would cache that query that statement so running on the same database would only show me a cached result. Once I created the new database I reinserted everything (with an index this time) and ran the query and got 0.00secs. Then for safe measure I repeated the 1st step and got .16secs again. I don’t know if the optimizer is choosing the F or T but it makes a difference on the time to complete the query.

jhutch

jhutch

C and E are correct since the number of values in each column is nearly the same MySQL will not index them. It also takes more time to insert new records into a table with indexes as MySQL has to apply a new index to each row.

zz

zz

A, B,C all look like correct, depend on the select command:
-> select Isofficial from CountryLanguage where Isofficial=”T”;
-> select Isofficial from CountryLanguage where Isofficial=”F”;
–> using index

-> select Isofficial from CountryLanguage where Isofficial=”T” group by Isofficial;
-> select Isofficial from CountryLanguage where Isofficial=”F”group by Isofficial;
–> using index

-> select * from CountryLanguage where Isofficial=”T”;
-> select * from CountryLanguage where Isofficial=”F”;
–> not using index

E also looks correct.

ww

ww

i think that this question is looking for two statements that are false