102-400

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?

  1. env
  2. set
  3. env -a
  4. 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?

  1. SELECT order_type,COUNT(*) FROM orders WHERE order_type=order_type;
  2. SELECT order_type,COUNT(*) FROM orders GROUP BY order_type;
  3. COUNT(SELECT order_type FROM orders);
  4. SELECT COUNT(*) FROM orders ORDER BY order_type;
  5. SELECT AUTO_COUNT FROM orders COUNT order_type;

Question 18

What is the purpose of the file /etc/profile?

  1. It contains the welcome message that is displayed after login.
  2. It contains security profiles defining which users are allowed to log in.
  3. It contains environment variables that are set when a user logs in.
  4. 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.)

  1. The user issuing the command must be in the group script.
  2. The script file must be found in the $PATH.
  3. The script file must have the executable permission bit set.
  4. The script must begin with a shebang-line (#!) that points to the correct interpreter.
  5. The file system on which the script resides must be mounted with the option scripts.