MySQL - Skill Assignment Quiz

Q1. When you have a subquery inside of the main query, which query is executed first?

  •  The subquery is never executed. Only the main query is executed.
  •  They are executed at the same time
  •  the main query
  •  the subquery

Q2. You need to export the entire database, including the database objects, in addition to the data. Which command-line tool do you use?

  •  mysqlexport
  •  mysqladmin
  •  mysqldump
  •  mysqld

Q3. You must ensure the accuracy and reliability of the data in your database. You assign some constraints to limit the type of data that can go into a table. What type of constraints are you assigning?

  •  row level
  •  database level
  •  column level
  •  function level

Q4. Which option of most MySQL command-line programs can be used to get a description of the program's different options?

  •  --options
  •  ?
  •  --help
  •  -h

Q5. MySQL uses environment variables in some of the programs and command-line operations. Which variable is used by the shell to find MySQL programs?

  •  DIR
  •  HOME
  •  PATH
  •  MYSQL_HOME

Q6. If you were building a table schema to store student grades as a letter (A, B, C, D, or F) which column type would be the best choice?

  •  ENUM
  •  OTEXT
  •  VARCHAR
  •  LONGTEXT

Q7. Which query would NOT be used to administer a MySQL server?

  •  USE db
  •  SELECT column FROM tbl
  •  SHOW COLUMNS FROM tbl
  •  SHOW TABLES

Q8. MySQL server can operate in different SQL modes, depending on the value of the sql_mode system variable. Which mode changes syntax and behavior to conform more closely to standard SQL?

  •  TRADITIONAL
  •  ANSI
  •  MSSQL
  •  STRICT

Q9. MySQL programs are a set of command-line utilities that are provided with typical MySQL distributions. MySQL is designed to be a database.

  •  database and programming
  •  user and administrator
  •  client and server
  •  syntax and objects

Q8. Which MySQL command shows the structure of a table?

  •  INFO table;
  •  SHOW table;
  •  STRUCTURE table;
  •  DESCRIBE table;

Q9. MySQL uses security based on _ for all connections, queries, and other operations that users can attempt to perform.

  •  administrator schema
  •  encrypted algorithms
  •  user settings
  •  access control lists

Q10. Which MySQL command modifies data records in a table?

  •  UPDATE
  •  MODIFY
  •  CHANGE
  •  ALTER

Q11. What is the best type of query for validating the format of an email address in a MySQL table?

  •  a SQL query using partitions
  •  a SQL query using IS NULL
  •  a SQL query using a regular expression
  •  a SQL query using LTRIM Or RTRIM

Q12. In MySQL, queries are always followed by what character?

  •  line break
  •  colon
  •  semicolon
  •  period

Q13. In MySQL, queries are always followed by what character?

  •  DELETE
  •  DELETE FROM
  •  REMOVE
  •  REMOVE FROM

Q14. Which choice is NOT a statement you would use to filter data?

  •  GROUP BY
  •  WHERE
  •  LIMIT
  •  LIKE

Q15. In SELECT * FROM clients; what does clients represent?

  •  a SQL query
  •  a SQL statement
  •  a database
  •  a table

Q16. How does MySQL differ from SQL?

  •  SQL is a standard language for retrieving and manipulating data from structured databases. MySQL is a nonrelational database management system that is used to manage SQL databases.
  •  SQL is a standard language for retrieving and manipulating data from structured databases. MySQL is a relational database management system that is used to manage SQL databases.
  •  They are not different. MySQL and SQL refer to the same thing.
  •  My SQL is a language, and SQL is a software application.

Q17. If you need to order a table of movies by name, which query will work?

  •  SELECT * FROM movies GROUP BY name
  •  SELECT * FROM movies ORDER BY name
  •  SELECT * FROM movies ORDER TABLE by name
  •  SELECT * FROM movies FILTER BY name

Q18. You are working with very large tables in your database. Which SQL clause do you use to prevent exceedingly large query results?

  •  UNIQUE
  •  LIMIT
  •  DISTINCT
  •  CONSTRAINT

Q19. How can you filter duplicate data while retrieving records from a table?

  •  DISTINCT
  •  WHERE
  •  LIMIT
  •  AS

Q20. What is the difference between DROP and TRUNCATE?

  •  They both refer to the same operation of deleting the table completely.
  •  They both refer to the same operation of clearing the table, but keeping its definition intact.
  •  TRUNCATE deletes table completely, removing its definition as well. DROP clears the table but does not delete the definition.
  •  DROP deletes table completely, removing its definition as well. TRUNCATE clears the table but does not delete the definition.

Q21. How do you select every row in a given table named "inventory"?

  •  SELECT all FROM inventory;
  •  FROM inventory SELECT all;
  •  FROM inventory SELECT *;
  •  SELECT * FROM inventory;

Q22. MySQL option files provide a way to specify commonly used options so that they need not be entered on the command line each time you run a program. What is another name for the option files?

  •  variable settings
  •  configuration files
  •  help files
  •  default settings

Q23. After installing MySQL, it may be necessary to initialize the _ which may be done automatically with some MySQL installation methods.

  •  storage engine
  •  user accounts
  •  grant tables
  •  data directory

Q24. One form of backup, replication, enables you to maintain identical data on multiple servers, as a _ configuration.

  •  remote-local
  •  parent-child
  •  master-slave
  •  logical-physical

Q25. Each time MySQL is upgraded, it is best to execute mysql_upgrade, which looks for incompatibilities with the upgraded MySQL server. What does this command do, upon finding a table with a possible incompatibility?

  •  it performs a table check and, if problems are found, attempts a table repair.
  •  it stops and notifies the server administrator that the upgrade cannot complete until the incompatibility issue are resolved.
  •  it provides a full report of the table specifications and the incompatibilities to the server administrator.
  •  it performs a table check and, if problems are found, displays the information for the server administrator to take action.

Q26. What cannot have a trigger associated with it?

  •  temporary table
  •  system table
  •  large table
  •  new table

Q27. You manage a database with a table "customers". You created a temporary table also called "customers" with which you are working for the duration of your session. You need to recreate the temporary table with different specs. Which command do you need to run first?

  •  CREATE TEMPORARY TABLE customers;
  •  DROP TEMP TABLE customers;
  •  DROP TABLE customers;
  •  DROP TEMPORARY TABLE customers;

Q28. You need to run a complex query with recursive subqueries, but without creating a stored procedure or a function. Which command or clause do you use?

  •  COLLATE
  •  UNION
  •  FULL JOIN
  •  WITH

Q29. What is the MySQL perror command-line utility used for?

  •  to display your version of MySQL
  •  to display operating system error codes
  •  to display default settings that are in error
  •  to display storage error codes

Q30. In which table does MySQL store passwords for user accounts?

  •  mysql.accounts;
  •  mysql.passwords;
  •  mysql.admin;
  •  mysql.user;

Q31. Management has requested that you build an employee database. You need to include each employee's current position and salary, as well as all prior positions and salaries with the company. You decide to use a one-to-many structure: an employee table with the main information such as name and address, and an employment table with position and salary history. You can use the employeeID field to connect them. What is employment.employeeID an example of?

  •  primary key;
  •  secondary key;
  •  foreign key;
  •  alternate key;

Q32. Which is a valid constructor for a class named User?

  •  public construct User() {}
  •  public User() {}
  •  public instance User() {}
  •  public init User() {}

Q33. Which statement is true about TIMESTAMP and DATETIME data types?

  •  TIMESTAMP values require more bytes for storage than DATETIME values.
  •  TIMESTAMP is stored without timezone, and DATETIME is stored in UTC values.
  •  TIMESTAMP and DATETIME are both stored without time zone.
  •  TIMESTAMP is stored in UTC values, and DATETIME is stored in without time zone.

Q36. What is the correct usage of ENUM in MySQL?

  •  Create table size (ENUM ('Small','Medium','Large'));
  •  Create table ENUM (name ('Small','Medium','Large'));
  •  Create table size (name: ENUM['Small','Medium','Large']);
  •  Create table size (name ENUM('Small','Medium','Large'));

Q37. A table Item has a Boolean field endOfLife and a field makeYear of type YEAR(4). How can you set the Boolean to true for all Items that have been made before 2019?

  •  UPSERT Item SET endOfLife = true WHERE makeYear < 2019
  •  CHANGE Item SET endOfLife = true WHERE makeYear < 2019
  •  ALTER Item SET endOfLife = true WHERE makeYear < 2019
  •  UPDATE Item SET endOfLife = true WHERE makeYear < 2019

Q38. How would you make a case-insensitive query in MySQL?

  •  SELECT * FROM customers WHERE UPPEERCASE(LastName) = 'POTTER';
  •  SELECT * FROM customers WHERE LOWERCASE(LastName) = 'potter';
  •  SELECT * FROM customers WHERE UPPER(LastName) = 'POTTER';
  •  SELECT * FROM customers WHERE UPPER(LastName) = 'Potter';

Q39. Which among the following belongs to an "aggregate function"?

  •  COUNT
  •  UPPER
  •  LOWER
  •  All of the mentioned

Q40. Later versions of MySQL support the native JSON data type for storing JSON documents. What is a drawback of JSON columns?

  •  JSON columns cannot be normalized.
  •  JSON columns cannot be indexed directly.
  •  JSON columns are inefficient for storing JSON documents.
  •  JSON documents cannot be validated when stored in JSON columns.

Q41. Current versions of MySQL support the full-text search feature on some storage engines, as an alternative to using the LIKE operator and regular expressions. Which statement would you run to enable a full-text index for the column description in the table Car?

  •  ALTER TABLE car ADD FULL TEXT(description);
  •  MERGE TABLE car ADD FULL TEXT(description)
  •  ENABLE FULL TEXT(description) car
  •  SEARCH FULL TEXT(description) car

Q42. You are building a table schema to store student grades as a letter (A, B, C, D, or F). Which column type is the best choice?

  •  VARCHAR
  •  ENUM
  •  LONGTEXT
  •  TEXT

READY TO GET STARTED?

Are you ready

Let’s Make Something Amazing Together

Need help? Contact our experts
Tell us about your project