250+ TOP MCQs on Perl Script Characteristics and Answers

MySQL Database Multiple Choice Questions on “Perl Script Characteristics”.

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

Answer: a
Clarification: 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.

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

Answer: a
Clarification: 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

Answer: c
Clarification: 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.

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

Answer: a
Clarification: 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?

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

Answer: a
Clarification: 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.

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

Answer: d
Clarification: 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

Answer: c
Clarification: 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.

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

Answer: b
Clarification: 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

Answer: d
Clarification: 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

Answer: b
Clarification: 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’.

Leave a Reply

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