MySQL Questions and Answers – Populating & Modifying Tables – 2

This set of MySQL Multiple Choice Questions & Answers (MCQs) focuses on “Populating & Modifying Tables – 2”.

1. Which statement is used to select columns and rows from the table?
a) SELECT
b) ALTER
c) MODIFY
d) FROM
View Answer

Answer: a
Explanation: None.

2. In the following SQL command “person” stands for?

   SELECT person_id, fname, lname, Birth_date
   FROM person;

a) Table name
b) Attribute
c) Multivalued attribute
d) None of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement
advertisement

3. In the following SQL command “*” stands for?

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
   SELECT * FROM person;

a) Retrieve all data from the table
b) Retrieve data of primary key only
c) Retrieve NULL data
d) None of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

4. Which Clause is used to select a particular row from the set of row in an existing table?
a) WHERE
b) FROM
c) ALTER
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

5. In the following SQL command “person_id” can be ____________

advertisement
   SELECT person_id, fname,l name, Birth_data FROM person
   WHERE person_id=1;

a) Only Primary Key
b) Primary Key or any other Attribute
c) Only Attribute but not a primary Key
d) None of the mentioned
View Answer

Answer: b
Explanation: None.

6. Which Clause is used to sort the stored data in alphabetical order?
a) ORDER by CLAUSE
b) MODIFY
c) ALTER
d) UPDATE
View Answer

Answer: a
Explanation: None.

7. Which Clause is used to select a particular table in Mysql?
a) WHERE
b) SELECT
c) FROM
d) ALTER
View Answer

Answer: c
Explanation: None.

8. Which command is used to show all tables that are stored in a database?
a) SHOWS
b) SHOW
c) SHOWES
d) None of the mentioned
View Answer

Answer: d
Explanation: None.

9. Which among the following is the correct syntax for showing all tables in the database?
a) SHOWS TABLES
b) SHOW TABLE
c) SHOW
d) SHOWS TABLES;
View Answer

Answer: d
Explanation: None.

10. If attribute “fruit” stores data as “apple, mango, banana” in table person then what will be the output of the following SQL command?

    SELECT fruit FROM person
    WHERE person_id=1
    ORDER BY fruit;

a) apple, mango, banana
b) apple, banana, mango
c) mango, apple, banana
d) none of the mentioned
View Answer

Answer: a
Explanation: ORDER BY Clause always sort in alphabetical order which also known as lexicographical order.

Sanfoundry Global Education & Learning Series – MySQL Database.

To practice all areas of MySQL Database, here is complete set of 1000+ Multiple Choice Questions and Answers.

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.