MySQL Questions and Answers – Perl Script Characteristics

«
»

This set of MySQL Database Multiple Choice Questions & Answers (MCQs) focuses on “Perl Script Characteristics”.

1. Perl scripts are text files.
a) True
b) False
View Answer

Answer: a
Explanation: The Perl scripts are text files, which can be ceated using any text editor. All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands.
advertisement

2. The shebang line is ______________
a) #!
b) !#
c) #$
d) $#
View Answer

Answer: a
Explanation: The Perl scripts are text files, which can be ceated using any text editor. All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands.

3. The Perl DBI is ______________
a) database inheritance
b) database integrity
c) database interface
d) database isolation
View Answer

Answer: c
Explanation: The Perl DBI is the Perl Database Interface. The work of the interface is to form a link between the application programming interface in C with all the other programming languages.
advertisement
advertisement

4. The default path to perl in Unix is ______________
a) /usr/bin/perl
b) /usr/bin
c) /usr/perl
d) /usr/perl/bin
View Answer

Answer: a
Explanation: All Perl scripts generally begin with a #! (shebang) line. A script is a file containing a sequence of commands. The Perl scripts are text files, which can be ceated using any text editor.

5. Which of these is not optional?

advertisement
SELECT select_list FROM table_list WHERE row_constraint GROUP BY grouping_columns;

a) select_list
b) table_list
c) row_constraint
d) grouping_columns
View Answer

Answer: a
Explanation: Given above was a basic syntax of the SELECT statement. Everything in the syntax is optional except the ‘select_list’ option. All the others are free to be omitted, and will work fine.
advertisement

6. Which is the join in which all the rows from the right table appear in the output irrespective of the content of the other table?
a) CARTESIAN JOIN
b) CROSS JOIN
c) INNER JOIN
d) RIGHT JOIN
View Answer

Answer: d
Explanation: In a ‘RIGHT JOIN’, the output is produced for every row of the right table, even if it does not exist in the other table. This is the reason why it is called a ‘RIGHT JOIN’. ‘RIGHT JOIN’ and ‘LEFT JOIN’ are a kind of OUTER JOIN.

7. What is the facility that allows nesting one select statement into another?
a) nesting
b) binding
c) subquerying
d) encapsulating
View Answer

Answer: c
Explanation: The ‘subquerying’ support provided by MySQL is a capability that allows writing one ‘SELECT’ statement within parentheses and nesting within another. This allows logically selecting content from tables.
advertisement

8. Which of these operators does not perform relative value comparisons?
a) =
b) ==
c) <=
d) >=
View Answer

Answer: b
Explanation: The operators =, <>, >, >=, <, and >= perform relative value comparisons in MySQL. ‘==’ is not a valid comparison operator in MySQL. Such operators are useful in filtering information from a table.

9. To combine multiple retrievals, which keyword is used to write several SELECT statements between them?
a) COMBINE
b) CONCAT
c) JOIN
d) UNION
View Answer

Answer: d
Explanation: The ‘UNION’ operator is used for combining the results of various ‘SELECT’ queries into one. For example, ‘SELECT a FROM table1 UNION SELECT a FROM table2;’ produces the results from tables table1 concatenated with that of table2.

10. Issuing ‘SELECT’ on a MERGE table is like _____________
a) UNION
b) UNION ALL
c) UNION DISTINCT
d) JOIN
View Answer

Answer: b
Explanation: Performing a ‘SELECT’ operation on a ‘MERGE’ table is like performing ‘UNION ALL’. This means that duplicate row results are not removed. ‘SELECT DISTINCT’ is like ‘UNION’ or ‘UNION DISTINCT’.

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.

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!

advertisement
advertisement
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn | Youtube | Instagram | Facebook | Twitter