MySQL Questions and Answers – The select Clauses – 1

This set of MySQL Multiple Choice Questions & Answers (MCQs) focuses on “The select Clauses – 1”.

1. What is the meaning of “SELECT” clause in Mysql?
a) Show me all Columns and rows
b) Show me all columns
c) Show me all rows
d) None of the mentioned
View Answer

Answer: a
Explanation: None.

2. Which of the following clause is evaluated in the last by database server?
a) SELECT
b) WHERE
c) FROM
d) None of the mentioned
View Answer

Answer: a
Explanation: “SELECT” clause is used to show all rows or columns therefore it evaluated at last.

3. What will be the output of the following SQL statement?

advertisement
advertisement
SELECT *
 FROM person;

a) Show all rows and columns of table “person”
b) Show all rows of table “person”
c) Show all columns of table “person”
d) None of the mentioned
View Answer

Answer:a
Explanation: “SELECT” clause is used to show all rows or columns.

4. What will be the output of of the following SQL statement?

SELECT person_id, Fname, lname
FROM person;

a) Show only columns (person_id, Fname, lname) and rows related to these columns
b) Show only columns (person_id, Fname, lname)
c) Show all rows
d) Show all columns except (person_id, Fname, lname)
View Answer

Answer: a
Explanation: “SELECT” clause is used to show all rows and columns that are mention with the query.
advertisement

5. Can “SELECT” clause be used without the clause “FROM”?
a) YES
b) NO
c) DEPENDS
d) None of the mentioned
View Answer

Answer: b
Explanation: “SELECT” clause is used to show rows and columns of a particular table and clause “from” is used to denote a table name.
advertisement

6. Find the error in the following SQL statement?

SELECT *;

a) No Error
b) No table mentioned
c) Depends
d) None of the mentioned
View Answer

Answer: b
Explanation: “SELECT” clause cannot be used without clause “FROM”.

7. What will be the output of the following SQL statement?

SELECT  * FROM person
WHERE person_id=1;

a) Show all columns but only those rows which belongs to person_id=1
b) Show all columns and rows
c) Shows only columns person_id
d) None of the mentioned
View Answer

Answer: a
Explanation: Clause “WHERE” is also used, which tells the compiler to show only that rows which belong to person_id=1.

8. What will be the output of the following SQL statement?

SELECT person_id, fname, lname
FROM person
WHERE person_id=1;

a) Show only columns(person_id, fname, lname) but only those rows which belongs to person_id=1
b) Show all columns and rows
c) Shows only columns person_id
d) None of the mentioned
View Answer

Answer: a
Explanation: Clause “WHERE” is also used, which tells the compiler to show only that rows which are belong to person_id=1.

9. Which clause is mandatory with clause “SELECT” in Mysql?
a) FROM
b) WHERE
c) Both FROM and WHERE
d) None of the mentioned
View Answer

Answer: a
Explanation: “SELECT” clause cannot be used without clause “FROM”.

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.