102-400 practice questions, page 4 of 5, with answer review and explanations.
Question 16
Which of the following commands lists all defined variables and functions within Bash?
env
set
env -a
echo $ENV
Question 17
Which of the following SQL queries counts the number of occurrences for each value of the field order_type in the table orders?
SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
COUNT(SELECT order_type FROM orders);
SELECT COUNT(*) FROM orders ORDER BY order_type;
SELECT AUTO_COUNT FROM orders COUNT order_type;
Question 18
What is the purpose of the file /etc/profile?
It contains the welcome message that is displayed after login.
It contains security profiles defining which users are allowed to log in.
It contains environment variables that are set when a user logs in.
It contains default application profiles for users that run an application for the first time.
Question 19
SIMULATION - What command displays all aliases defined in the current shell? (Specify the command without any path information)
Question 20
Which of the following are requirements in order to run a shell script like a regular command from anywhere in the filesystem? (Choose THREE correct answers.)
The user issuing the command must be in the group script.
The script file must be found in the $PATH.
The script file must have the executable permission bit set.
The script must begin with a shebang-line (#!) that points to the correct interpreter.
The file system on which the script resides must be mounted with the option scripts.