Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help with the follwing question on MYSQL Create the two separate indexes. instea

ID: 3840570 • Letter: H

Question

Help with the follwing question on MYSQL

Create the two separate indexes. instead of one for the following

a. composite index on the attributes last_name and first_name (in that order!) of the Bird table

Paste your CREATE INDEX statements below.

variety income Peacock bdate Owns first name Bird bname latitude longitude ast locati Cno senti ment Utter Chirp 1 (Original M (Chirper) N (Copy) Parrots About Bird level Listen name N (Listener M interests Topics bsecto date User Topics Listen Watcher Signup date password emai add State country For Bird, Watcher ISA User: picture street Bird AND Watcher COVER User number mailcode

Explanation / Answer

To create index on separate columns i.e first_name and last_name in Bird table, you can use the following

CREATE INDEX FNAME_INDEX
ON BIRD(FIRST_NAME);

CREATE INDEX LNAME_INDEX
ON BIRD(LAST_NAME);

There is another way to do the same -

ALTER TABLE BIRD
ADD INDEX FNAME_INDEX(FIRST_NAME);

ALTER TABLE BIRD
ADD INDEX LNAME_INDEX(LAST_NAME);

Please do rate the answer if it helped. Thanks.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote