The LinkedIn Skill Assessments feature allows you to demonstrate your knowledge of the skills you’ve added on your profile. Job posters on LinkedIn can also add Skill Assessments as part of the job application process. This allows job posters to more efficiently and accurately verify the crucial skills a candidate should have for a role.
The topics in the MySQL assessment include:
- SQL Statement Syntax
- Database Management
- RDBMS Basics
- Stored Procedures
- Triggers
- Regular Expressions
- Data Transfers
- Administration
- MySQL Programs
- Security & Backup
Question Format
Multiple Choice
Language
English
Table of Content
- 1 LinkedIn MySQL Skill Assessment Answers
- 1.1 When you have a subquery inside of the main query, which query is executed first?
- 1.2 You need to export the entire database, including the database objects, in addition to the data. Which command-line tool do you use?
- 1.3 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?
- 1.4 Which option of most MySQL command-line programs can be used to get a description of the program’s different options?
- 1.5 MySQL uses environment variables in some of the programs and command-line operations. Which variable is used by the shell to find MySQL programs?
- 1.6 How can you create a stored procedure in MySQL?
- 1.7 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?
- 1.8 Management has requested that you build an employee database. You start with the employee table. What is the correct syntax?
- 1.9 You are working with the tables as shown in this diagram. You need to generate the list of customers who purchased certain car models. Which SQL clause do you use?
- 1.10 Which query would NOT be used to administer a MySQL server?
- 1.11 What is the product of the database designing phase?
- 1.12 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?
- 1.13 MySQL programs are a set of command-line utilities that are provided with typical MySQL distributions. MySQL is designed to be a database.
- 1.14 Which MySQL command shows the structure of a table?
- 1.15 MySQL uses security based on _ for all connections, queries, and other operations that users can attempt to perform.
- 1.16 Which MySQL command modifies data records in a table?
- 1.17 What is the best type of query for validating the format of an email address in a MySQL table?
- 1.18 In MySQL, queries are always followed by what character?
- 1.19 How can you remove a record using MySQL?
- 1.20 Which choice is NOT a statement you would use to filter data?
- 1.21 What does the following SQL statement return?SELECT * FROM Employees WHERE EmployeeName LIKE ‘a%
- 1.22 In SELECT * FROM clients; what does clients represent?
- 1.23 How does MySQL differ from SQL?
- 1.24 If you need to order a table of movies by name, which query will work?
- 1.25 A trigger is a database object that is associated with a table, and that activates when a particular event occurs for the table. Which three events are these?
- 1.26 You are working with very large tables in your database. Which SQL clause do you use to prevent exceedingly large query results?
- 1.27 What is the default port for MySQL Server?
- 1.28 How can you filter duplicate data while retrieving records from a table?
- 1.29 What is the difference between DROP and TRUNCATE?
- 1.30 How do you select every row in a given table named “inventory”?
- 1.31 In an efficiently designed relational database, what does every table have?
- 1.32 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?
- 1.33 After installing MySQL, it may be necessary to initialize the _ which may be done automatically with some MySQL installation methods.
- 1.34 You need to export the data in the customers table into a CSV file, with columns headers in the first row. Which clause do you add to your MySQL command?
- 1.35 One form of backup, replication, enables you to maintain identical data on multiple servers, as a _ configuration.
- 1.36 What is the requirement for using a subquery in the SELECT clause?
- 1.37 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?
- 1.38 What mysql statement is used to check which accounts have specific privileges?
- 1.39 What table cannot have a trigger associated with it?
- 1.40 later versions of mysql support the native json data type for storing json documents. What is a drawback of json columns?
- 1.41 Which statement is true for the diagram below
- 1.42 Which statement can you use to load data from a file into the table?
- 1.43 See tables in the diagram. Make sure that any record added to the purchase table consists of a customerId, which exists in the customer table and a carId, which exists in the car table. You decide to use a trigger to do the validation. Which one?
- 1.44 Which is the correct syntax of an extended insert statement?
- 1.45 You need to make an exact copy of a table, with all columns and indexes. How can you get all of the information needed to accomplish this?
- 1.46 you need to make your mysql system secure against attackers. What are you not supposed to do?
- 1.47 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?
- 1.48 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?
- 1.49 Which choice is not a processing algorithm for database views?
- 1.50 What is the MySQL perror command-line utility used for?
- 1.51 How can you list all columns for a given table?
- 1.52 How would you list the full set of tables in the currently selected database?
- 1.53 Which choice is not one of the table maintenance statements?
- 1.54 In which table does MySQL store passwords for user accounts?
- 1.55 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?
- 1.56 In recent versions of MySQL (8.0+), what’s the correct syntax to declare a CTE (Common Table Expression)?
- 1.57 What is one reason to introduce data redundancy into a normalized database design?
- 1.58 The code snippet below is used to read data from an XML file into a table. Which XML structure is not supported by the statement?1 LOAD XML LOCAL INFILE ‘cars.xml’2 INTO TABLE cars3 ROWS IDENTIFIED BY `<car>`;
- 1.59 You are loading data into a table. Which command can you use to make sure that all data is inserted and duplicated rows are discarded?
- 1.60 Which statement about the TRUNCATE TABLE statement is true?
- 1.61 You are working with the tables as shown in this diagram. You need to get the number of cars sold per the home state of each customer’s residence. How can you accomplish this?
- 1.62 In data migration, there is often a need to delete duplicate rows as part of data cleanup. Which statement works best?
- 1.63 When working with MySQL cursor, what must you also declare?
- 1.64 Which type of backup includes all the changes made to the data since the last full backup was performed?
- 1.65 You need to restore a MySQL database from a backup file. Which command-line tool do you use for the actual data import, after re-creating the database?
- 1.66 You are importing data as JSON into a new table. You run CREATE TABLE json_data ( city JSON ); and insert rows into this table. What is the correct syntax to see the list of cities?
- 1.67 If you want to use MyISAM instead of InnoDB, which option do you need to specify in the CREATE TABLE statement?
- 1.68 You are working with the table in this diagram. You want to use full-text search to find the customers who live on a street or a drive. What is the command to do that?
- 1.69 Which query lists the databases on the current server?
- 1.70 What is the product of the database designing phase?
- 1.71 Which choice is not a valid model for a stored procedure parameter?
- 1.72 What is the advantage of using a temporary table instead of a heap table?
- 1.73 Which is a valid constructor for a class named User?
- 1.74 What is the maximum number of columns that can be used by a single table index?
- 1.75 Which command will return a list of triggers in the current database?
- 1.76 Which statement is true about TIMESTAMP and DATETIME data types?
- 1.77 What is the equivalent of the mysqladmin reload command?
- 1.78 Explain the security aspect of stored procedures
- 1.79 Management has requested that you build an employee database. You start with the employee table. What is the correct syntax?
- 1.80 In the diagram below, the price field is declared as type DECIMAL. What would be a more efficient declaration for this field?
- 1.81 Which choice is not an available string type for a column?
- 1.82 This diagram shows what type of relationship between customers and cars?
- 1.83 A stored routine is a set of SQL statements stored on the server and takes from as either a procedure or a function. Which statement cannot be used inside stored routines?
- 1.84 When a new student is added to a new database, you want new records to be created in the related tables such as Exam, Score and Attendance. How would you accomplish this?
- 1.85 In the diagram below, the ID fields are declared as type CHAR instead of INT . Which is NOT one of the possible reasons behind that decision?
- 1.86 Why would you use a common table expression (CTE)?
- 1.87 Which option modifier tells a program not to exit with an error if it does not recognize the option, but instead to issue a warning?
- 1.88 You are working with the tables as shown in this diagram. You need to make sure that any record added to the purchases table consists of customerID, which already exists in the customer table, and a carID, which already exists in the cars table. You decide to use a trigger to do the validation. Which one do you use?
- 1.89 What does this SQL statement return?SELECT name FROM students WHERE name REGEXP ‘^to’;
- 1.90 This diagram shows what type of relationship between customer and cars?
- 1.91 You are managing a database with a table called “customers.” You created a temporary table also called “customers” with which you are working for the duration of your session. You need to re-create the temporary table with different specifications. Which command do you need to run first?
- 1.92 Inside a transaction, several operations need to be performed. What would you do if an exception happens during that transaction?
- 1.93 What function finds the current time or date in MySQL?
- 1.94 What is the correct usage of ENUM in MySQL?
- 1.95 The mysqldump command cannot generate output in _.
- 1.96 You are working with the tables as shown in this diagram. You need to generate the list of all cars, whether or not they had been sold, with the purchase date of the cars that were sold. Which statement accomplishes that?
- 1.97 Which code snippet from a stored procedure should be rewritten as a CASE statement?
- 1.98 Why would you use stored functions?
- 1.99 What steps do you need to take to normalize the table from this diagram?Table name: superheroes
- 1.100 What is valid way to create a database view in MySQL?
- 1.101 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?
- 1.102 Which choice is an example of an aggregate function?Which choice is an example of an aggregate function?
- 1.103 You are working on UPDATE trigger on the employee tablein this diagram. How can you access the new value for the address inside the trigger?
- 1.104 You are working with the tables as shown in this diagram. You need to generate the list of customers who purchased certain car models. Which SQL clause do you use?
- 1.105 You are managing a database with a table called “customers”. You created a temporary table also called “customers” with which you are working for the duration of your session. You need to re-create the temporary table with different specifications. Which command do you need to run first?
- 1.106 How would you make a case-insensitive query in MySQL?
- 1.107 “COUNT” keyword belongs to which categories in Mysql?
- 1.108 Which among the following belongs to an “aggregate function”?
- 1.109 What is the meaning of “HAVING” clause in Mysql?
- 1.110 Which clause is similar to “HAVING” clause in Mysql?
- 1.111 What will be the output of the following MySQL command?SELECT emp_id, fname, lnameFROM employeeWHERE title=’HEAD TELLER’ AND start_date>2008-11-23;
- 1.112 Is there any error in the following MySQL statement?
- 1.113 Later versions of MySQL support the native JSON data type for storing JSON documents. What is a drawback of JSON columns?
- 1.114 With MySQL, how do you select all the records from a table named “Persons” where the “LastName” is alphabetically between (and including) “Hansen” and “Pettersen”?
- 1.115 Consider the set of relations given below and the SQL query that follows
- 1.116 How would you retrieve data on all the customers where no phone number is stored?
- 1.117 This diagram shows what type of relationship between customers and cars?
- 1.118 A stored routine is a set of SQL statements stored on the server and takes form as either a procedure or a function. Which statement cannot be used inside stored routines?
- 1.119 Why would you use a common table expression (CTE)?
- 1.120 You are working with the tables as shown in the diagram. You need to generate the list of price totals for each make and model of car, with subtotals for each make, and the grand total of all prices. Which SQL clause do you use?
- 1.121 The left and right joins are also known as _.
- 1.122 What is the valid way to create a database view in MySQL?
- 1.123 How are permissions implemented in MySQL?
LinkedIn MySQL Skill Assessment Answers
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
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
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
Which option of most MySQL command-line programs can be used to get a description of the program’s different options?
- –options
- ?
- –help
- -h
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
How can you create a stored procedure in MySQL?
- A
1 CREATE PROCEDURE P () AS
2 BEGIN
3 END; - B
1 CREATE PROCEDURE P ()
2 BEGIN
3 END - C
1 CREATE PROCP
2 BEGIN
3 END; - D
1 CREATE PROC P AS O
2 BEGIN
3 END;
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
Management has requested that you build an employee database. You start with the employee table. What is the correct syntax?
- A
1 CREATE TABLE employee (
2 employee ID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY ON employeeID
8 ); - B
1 CREATE TABLE employee (
2 employee ID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY employeeID
8 ); - C
1 CREATE TABLE IF EXISTS employee (
2 employee ID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY (employeeID)
8 ); - D
1 CREATE TABLE IF NOT EXISTS employee (
2 employee ID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY (employeeID)
8 );
You are working with the tables as shown in this diagram. You need to generate the list of customers who purchased certain car models. Which SQL clause do you use?
- LIKE
- IN
- BETWEEN
- HAVING
Which query would NOT be used to administer a MySQL server?
- USE db
- SELECT column FROM tbl
- SHOW COLUMNS FROM tbl
- SHOW TABLES
What is the product of the database designing phase?
- system definition
- logical model
- physical model
- normalized database
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
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
Which MySQL command shows the structure of a table?
- INFO table;
- SHOW table;
- STRUCTURE table;
- DESCRIBE table;
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
Which MySQL command modifies data records in a table?
- UPDATE
- MODIFY
- CHANGE
- ALTER
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
In MySQL, queries are always followed by what character?
- line break
- colon
- semicolon
- period
How can you remove a record using MySQL?
- DELETE
- DELETE FROM
- REMOVE
- REMOVE FROM
Which choice is NOT a statement you would use to filter data?
- GROUP_BY
- WHERE
- LIMIT
- LIKE
What does the following SQL statement return?
SELECT * FROM Employees WHERE EmployeeName LIKE ‘a%
- It records in the Employees table where the value in the EmployeeName column doesn’t have an “a”.
- It records in the Employees table where the value in the EmployeeName column starts with “a”.
- It records in the Employees table where the value in the EmployeeName column has an “a”.
- It records in the Employees table where the value in the EmployeeName column ends with “a”.
In SELECT * FROM clients; what does clients represent?
- a SQL query
- a SQL statement
- a database
- a table
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.
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
A trigger is a database object that is associated with a table, and that activates when a particular event occurs for the table. Which three events are these?
- INSERT, UPDATE, DELETE
- CREATE, ALTER, DROP
- OPEN, FETCH, CLOSE
- DECLARE, SET, SELECT
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
What is the default port for MySQL Server?
- 25
- 990
- 0
- 3306
How can you filter duplicate data while retrieving records from a table?
- DISTINCT
- WHERE
- LIMIT
- AS
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.
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;
In an efficiently designed relational database, what does every table have?
- set of triggers
- sequential id field
- minimum of three columns
- primary key
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
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
You need to export the data in the customers table into a CSV file, with columns headers in the first row. Which clause do you add to your MySQL command?
- JOIN
- WITH HEADERS
- UNION
- WITH COLUMNS
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
What is the requirement for using a subquery in the SELECT clause?
- the subquery must use an aggregate function.
- the subquery must refer to the same table as the main query.
- the subquery must return a single value.
- the subquery must return at least one value.
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.
What mysql statement is used to check which accounts have specific privileges?
- show grants (displays the privileges and roles that are assigned to a MySQL user account or role)
- show privileges (shows the list of system privileges that the MySQL server supports)
- show access
- show user permissions
What table cannot have a trigger associated with it?
- temporary
- system
- large
- new
later versions of mysql support the native json data type for storing json documents. What is a drawback of json columns?
- inefficient for storing json documents
- cannot be indexed directly
- documents cannot be validated when stored in json columns
- cannot be normalized
Which statement is true for the diagram below
- carid is the primary key for purchases
- carid is the foreign key for cars.carid
- customerid is the foreign key for customers.id
- customerid is the primary key for purchases
Which statement can you use to load data from a file into the table?
- cat file|mysql
- load data infile (correct if the file is already on the server)
- load data local infile (also correct but only if the file is from the client)
- extended insert statemen
See tables in the diagram. Make sure that any record added to the purchase table consists of a customerId, which exists in the customer table and a carId, which exists in the car table. You decide to use a trigger to do the validation. Which one?
- after insert
- if exists (invalid not a trigger; IF function + EXISTS clause)
- before insert
- cross join (valid for a check but not a trigger)
Which is the correct syntax of an extended insert statement?
- insert into cars (make, model, year) values (‘Ford’, ‘Mustang’, 2002) (‘Mercedes’, ‘C’, 2003)
- insert into cars (make, model, year) values (‘Ford’, ‘Mustang’, 2002) values (‘Mercedes’, ‘C’, 2003)
- insert into cars (make, model, year) extended (‘Ford’, ‘Mustang’, 2002), (‘Mercedes’, ‘C’, 2003)
- insert into cars (make, model, year) values (‘Ford’, ‘Mustang’, 2002),(‘Mercedes’, ‘C’, 2003)
You need to make an exact copy of a table, with all columns and indexes. How can you get all of the information needed to accomplish this?
- create table
- clone table
- insert into
- show create table
you need to make your mysql system secure against attackers. What are you not supposed to do?
- Run MySQL server as a normal user.
- Grant PROCESS or SUPER privilege to other users.
- Run MySQL server as the unix root user.
- Use the compressed protocol.
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;
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
Which choice is not a processing algorithm for database views?
- merge
- updatable
- temptable
- undefined
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
How can you list all columns for a given table?
- SHOW table COLUMNS;
- SHOW COLUMNS FROM table;
- LIST table COLUMNS;
- SELECT COLUMNS FROM table;
How would you list the full set of tables in the currently selected database?
- SELECT * FROM DATABASE;
- SHOW TABLES;
- LIST TABLES;
- SELECT ALL TABLES;
Which choice is not one of the table maintenance statements?
- CHECK TABLE;
- CREATE TABLE;
- ANALYZE TABLE;
- OPTIMIZE TABLE;
In which table does MySQL store passwords for user accounts?
- mysql.accounts;
- mysql.passwords;
- mysql.admin;
- mysql.user;
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;
In recent versions of MySQL (8.0+), what’s the correct syntax to declare a CTE (Common Table Expression)?
- WITH (SELECT id FROM users) as cte, SELECT …
- WITH (SELECT id FROM users) as cte SELECT …
- WITH cte as (SELECT id FROM users), SELECT …
- WITH cte as (SELECT id FROM users) SELECT …
What is one reason to introduce data redundancy into a normalized database design?
- to reduce corruption in data
- to reduce storage space
- to make the system faster
- to prevent data anomalies
The code snippet below is used to read data from an XML file into a table. Which XML structure is not supported by the statement?
1 LOAD XML LOCAL INFILE ‘cars.xml’
2 INTO TABLE cars
3 ROWS IDENTIFIED BY `<car>`;
- A
<car>
<field name=”make”> Lexus </field>
<field name=”model”> IS300 </field>
<field name=”make”> 2016 </field>
</car> - B
<car name=”make”> Dodge </car>
<car name=”model”> Ram </car>
<car name=”year”> 2000 </car> - C
<car make=”Ford” model=”Mustang” year=”2002/> - D
<car year=”2010>
<make>Mercedes</make> <model> C-Class</model>
</car>
You are loading data into a table. Which command can you use to make sure that all data is inserted and duplicated rows are discarded?
- INSERT IGNORE
- INSERT UNIQUE
- INSERT INTO
- INSERT DISTINCT
Which statement about the TRUNCATE TABLE statement is true?
- It will stop and issue an error when it encounters a row that is referenced by a row in a child table.
- It always first drops, then re-creates a new table.
- It deletes rows one by one on tables with foreign key constraints.
- It does not invoke the DELETE triggers associated with the table.
You are working with the tables as shown in this diagram. You need to get the number of cars sold per the home state of each customer’s residence. How can you accomplish this?
- SELECT state, COUNT(*) FROM customers WHERE ID IN (SELECT customerID FROM purchases) GROUP BY state;
- SELECT state, COUNT(*) FROM customers c LEFT JOIN purchases p ON c.ID = p.customerID GROUP BY state;
- SELECT state, COUNT(*) FROM customers c, purchases p WHERE c.ID = p.customerID GROUP BY state;
- SELECT state, COUNT(*) FROM customers GROUP BY state;
In data migration, there is often a need to delete duplicate rows as part of data cleanup. Which statement works best?
- DELETE DUPS
- DELETE DISTINCT
- DELETE JOIN
- DELETE WITH
When working with MySQL cursor, what must you also declare?
- DEFAULT value
- RETURN variable
- SQLEXCEPTION routine
- NOT FOUND handler
Which type of backup includes all the changes made to the data since the last full backup was performed?
- snapshot
- logical
- differential
- incremental
You need to restore a MySQL database from a backup file. Which command-line tool do you use for the actual data import, after re-creating the database?
- mysqld
- mysql
- mysqladmin
- mysqldump
You are importing data as JSON into a new table. You run CREATE TABLE json_data ( city JSON ); and insert rows into this table. What is the correct syntax to see the list of cities?
- SELECT city FROM json_data;
- SELECT city->>’$.name’ city FROM json_data;
- SELECT city.name city FROM json_data;
- SELECT city->’$.name’ city FROM json_data; <= this is valid too but the results will be enclosed with quotation marks
If you want to use MyISAM instead of InnoDB, which option do you need to specify in the CREATE TABLE statement?
- ENGINE
- PARTITION
- STORAGE
- TABLESPACE
You are working with the table in this diagram. You want to use full-text search to find the customers who live on a street or a drive. What is the command to do that?
- A
SELECT *
FROM customers
WHERE address MATCH ‘Street’ OR ‘Drive’; - B
SELECT *
FROM customers
WHERE MATCH(address) IN (‘street, drive’); - C
SELECT *
FROM customers
WHERE address MATCH ‘Street’ OR address MATCH ‘Drive’; - D
SELECT *
FROM customers
WHERE MATCH(address) AGAINST (‘street, drive’);
Which query lists the databases on the current server?
- SHOW DATABASES;
- LIST ALL DATABASES;
- LIST DATABASES;
- SHOW DB;
What is the product of the database designing phase?
- all tables, columns, data types, indexes and their relationships
- a list of entities, their relationship, and constraints
- all tables and their names, which are needed to implement the logical model
- a list of entities, their relationship, constraints, data types, and cardinalities
Which choice is not a valid model for a stored procedure parameter?
- INOUT
- IN
- OUT
- IN OUT
What is the advantage of using a temporary table instead of a heap table?
- The temporary table will be dropped when the database is restarted.
- Temporary tables can be shared among clients, which makes them more usable in group development environments.
- The temporary table will be dropped as soon as your session disconnects.
- Creating a temporary table does not require any special privileges.
Which is a valid constructor for a class named User?
- public construct User() {}
- public User() {}
- public instance User() {}
- public init User() {}
What is the maximum number of columns that can be used by a single table index?
- 2
- 4
- 8
- 16
Which command will return a list of triggers in the current database?
- DISPLAY TRIGGERS;
- SHOW TRIGGERS;
- SELECT ALL TRIGGERS;
- SELECT * FROM information_schema.triggers;
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.
What is the equivalent of the mysqladmin reload command?
- mysqladmin flush-threads
- mysqladmin flush-tables
- mysqladmin flush-privileges
- mysqladmin flush-all
Explain the security aspect of stored procedures
- Stored procedures are not secure, because they can be executed from the command line as the root user
- Stored procedures are secure, because the owner of the stored procedure can decide to whom access is granted
- Stored procedures are secure, because applications can be given access to stored procedures and not any underlying variables
- Stored procedures are not secure, because they can execute statements to drop tables or bulk delete data
Management has requested that you build an employee database. You start with the employee table. What is the correct syntax?
- A
1 CREATE TABLE employee (
2 employeeID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY employeeID
8 ); - B
1 CREATE TABLE IF NOT EXISTS employee (
2 employeeID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY (employeeID)
8 ); - C
1 CREATE TABLE employee (
2 employeeID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50),
7 PRIMARY KEY ON employeeID
8 ); - D
1 CREATE TABLE IF EXISTS employee (
2 employeeID char(10),
3 firstName varchar(50),
4 lastName varchar(50),
5 phone varchar(20),
6 address varchar(50)
7 PRIMARY KEY (employeeID)
’8 );
In the diagram below, the price field is declared as type DECIMAL. What would be a more efficient declaration for this field?
- FLOAT
- DECIMAL(10,2)
- NUMERIC
- DOUBLE
Which choice is not an available string type for a column?
- ENUM
- SET
- BIT
- CHAR
This diagram shows what type of relationship between customers and cars?
- one-to-many
- parent-child
- many-to-many
- many-to-one
A stored routine is a set of SQL statements stored on the server and takes from as either a procedure or a function. Which statement cannot be used inside stored routines?
- SELECT
- USE
- SET
- DECLARE
- trigger
- regular expression
- view
- index
In the diagram below, the ID fields are declared as type CHAR instead of INT . Which is NOT one of the possible reasons behind that decision?
- The ID field needs to include letters and not just numbers.
- You can have a consistent format across all of the tables that require ID fields.
- The ID field needs to have leading 0s, which the INT data type would truncate.
- The CHAR(10) data type is more efficient and space-saving.
Why would you use a common table expression (CTE)?
- To define queries for later reuse for the duration of the current session
- To create temporary tables that can be used to pre-select often-used result sets.
- To calculate a new single value from a result set and return it to the query parser.
- To break down complex queries and allow reuse within a query.
Which option modifier tells a program not to exit with an error if it does not recognize the option, but instead to issue a warning?
- –verbose
- –skip
- –skip-error
- –loose
You are working with the tables as shown in this diagram. You need to make sure that any record added to the purchases table consists of customerID, which already exists in the customer table, and a carID, which already exists in the cars table. You decide to use a trigger to do the validation. Which one do you use?
- IF EXISTS
- BEFORE INSERT
- CROSS JOIN
- AFTER INSERT
What does this SQL statement return?
SELECT name FROM students WHERE name REGEXP ‘^to’;
- all names starting with “to,” such as Tommy or Tony
- all names with “to,” such as Roberto and Tommy
- all names without “to,” such as Samantha or Kathryn
- all names ending with “to,” such as Roberto
This diagram shows what type of relationship between customer and cars?
- parent-child
- many-to-one
- one-to-many
- many-to-many
You are managing a database with a table called “customers.” You created a temporary table also called “customers” with which you are working for the duration of your session. You need to re-create the temporary table with different specifications. Which command do you need to run first?
- DROP TEMPORARY TABLE customers;
- CREATE TEMPORARY TABLE customers;
- DROP TEMP TABLE customers;
- DROP TABLE customers;
Inside a transaction, several operations need to be performed. What would you do if an exception happens during that transaction?
- UNDO
- UNCOMMIT
- ROLLBACK
- REVERSE
What function finds the current time or date in MySQL?
- DATE()
- GETDATE()
- CURDATE()
- CURRENT()
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’));
The mysqldump command cannot generate output in _.
- JSON
- CSV
- XML
- TXT
You are working with the tables as shown in this diagram. You need to generate the list of all cars, whether or not they had been sold, with the purchase date of the cars that were sold. Which statement accomplishes that?
- A
SELECT cars.*, purchases.date
FROM cars RIGHT JOIN purchases
ON cars.ID = purchases.carID; - B
SELECT cars.*, purchases.date
FROM cars INNER JOIN purchases
ON cars.ID = purchases.carID; - C
SELECT cars.*, purchases.date
FROM cars JOIN purchases
ON cars.ID = purchases.carID; - D
SELECT cars.*, purchases.date FROM cars LEFT JOIN purchases ON cars.ID = purchases.carID;
Which code snippet from a stored procedure should be rewritten as a CASE statement?
- A
IF var1 THEN SET varA = var1;
ELSEIF var2 THEN SET varA = var2;
ELSEIF var3 THEN SET varA = var3;
ELSE SET varA = var4;
END IF; - B
IF var1 = var2 THEN SET varA = var1;
ELSEIF var2 = var3 THEN SET varA = var2;
ELSEIF var3 = var4 THEN SET varA = var3;
ELSE SET varA = var4;
END IF; - C
IF var1 = 1 THEN SET varA = var1;
ELSEIF var2 = 2 THEN SET varA = var2;
ELSEIF var3 = 3 THEN SET varA = var3;
ELSE SET varA = var4;
END IF; - D
IF var1 = 1 THEN SET varA = var1;
ELSEIF var1 = 2 THEN SET varA = var2;
ELSEIF var1 = 3 THEN SET varA = var3;
ELSE SET varA = var4;
END IF;
Why would you use stored functions?
- for formulas and business rules that you want to apply to columns in an SQL query
- for formulas and business rules that should be applied on a specific trigger event like on inserts
- to automatically modify the data of a table based on a query
- for reusing recurring queries
What steps do you need to take to normalize the table from this diagram?
Table name: superheroes
- Create another table to serve as a lookup for powers with fields for code and description, as well as a junction table with superhero names and power codes.
- Add a column to this table to serve as a record identifier, and make it the primary key.
- Extend this table to have additional columns “power4,” “power5,” and so on, to allow additional powers for each superhero.
- Convert this table to have column called “power,” and add one record for each superhero-power combination, for a total of 15 records in this example.
What is valid way to create a database view in MySQL?
- 1 CREATE VIEW v1 2 SELECT * FROM t1 3 WHERE col1 > 10;
- 1 CREATE VIEW v1 2 BEGIN 3 SELECT * FROM t1 4 END
- 1 CREATE VIEW v1 AS 2 SELECT * FROM t1;
- 1 CREATE VIEW v1 AS 2 BEGIN 3 SELECT * FROM t1 4 END;
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
Which choice is an example of an aggregate function?Which choice is an example of an aggregate function?
- NOW()
- MID()
- FORMAT()
- COUNT()
You are working on UPDATE trigger on the employee tablein this diagram. How can you access the new value for the address inside the trigger?
- Use NEW.address
- Use INSERTED.address
- Use DELETED.address
- USE OLD.address
You are working with the tables as shown in this diagram. You need to generate the list of customers who purchased certain car models. Which SQL clause do you use?
- UNION ALL
- UNION
- SHOW TOTALS
- WITH ROLLUP
You are managing a database with a table called “customers”. You created a temporary table also called “customers” with which you are working for the duration of your session. You need to re-create the temporary table with different specifications. Which command do you need to run first?
- CREATE TEMPORARY TABLE customers;
- DROP TEMP TABLE customers;
- DROP TEMPORARY TABLE customers;
- DROP TABLE customers;
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’;
“COUNT” keyword belongs to which categories in Mysql?
- Aggregate functions
- Operators
- Clauses
- All of the mentioned`
Which among the following belongs to an “aggregate function”?
- COUNT
- UPPER`
- LOWER
- All of the mentioned
What is the meaning of “HAVING” clause in Mysql?
- To filter out the column values
- To filter out the row values
- To filter out the row and column values
- None of the mentioned
Which clause is similar to “HAVING” clause in Mysql?
- SELECT
- FROM
- WHERE
- None of the mentioned
What will be the output of the following MySQL command?
SELECT emp_id, fname, lname
FROM employee
WHERE title=’HEAD TELLER’ AND start_date>2008-11-23;
- All columns
- Only those columns which are mention with “SELECT” clause
- Columns mention with “SELECT” clause and only those rows which contain ‘HEAD TELLER’ as a “title”
- None of the mentioned
Is there any error in the following MySQL statement?
SELECT e.emp_id, e.fname,e.lname,d.name
FROM employee e INNER JOIN department d
ON e.dept_id=e.dept_id;
- NO
- YES
- DEPEND
- None of the mentioned
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.
With MySQL, how do you select all the records from a table named “Persons” where the “LastName” is alphabetically between (and including) “Hansen” and “Pettersen”?
- SELECT LastName>’Hansen’ AND LastName<‘Pettersen’ FROM Person
- SELECT * FROM Persons WHERE LastName BETWEEN ‘Hansen’ AND ‘Pettersen’
- SELECT * FROM Persons WHERE LastName>’Hansen’ AND LastName<‘Pettersen’
- None of the above.
Consider the set of relations given below and the SQL query that follows
Students : (Roll number, Name, Date of birth)
Courses: (Course number, Course name, instructor)
Grades: (Roll number, Course number, Grade)
SELECT DISTINCT Name
FROM Students, Courses, Grades
WHERE Students.Roll_number = Grades.Roll_number
AND Courses.Instructor =Sriram
AND Courses.Course_number = Grades.Course_number
AND Grades.Grade = A
(Which of the following sets is computed by the above query?)
- Names of Students who have got an A grade in all courses taught by Sriram
- Names of Students who have got an A grade in all courses
- Names of Students who have got an A grade in at least one of the courses taught by Sriram
- None of the above
How would you retrieve data on all the customers where no phone number is stored?
- SELECT * FROM customers WHERE PhoneNumber = NULL;
- SELECT * FROM customers WHERE PhoneNumber IS NOT VALID;
- SELECT * FROM customers WHERE PhoneNumber IS NULL;
- SELECT * FROM customers WHERE PhoneNumber IS UNKNOWN;
This diagram shows what type of relationship between customers and cars?
- one-to-many
- parent-child
- many-to-many
- many-to-one
A stored routine is a set of SQL statements stored on the server and takes form as either a procedure or a function. Which statement cannot be used inside stored routines?
- SELECT
- USE
- SET
- DECLARE
Why would you use a common table expression (CTE)?
- To define queries for later reuse for the duration of the current session
- To create temporary tables that can be used to pre-select often-used result sets.
- To calculate a new single value from a result set and return it to the query parser.
- To break down complex queries and allow reuse within a query.
You are working with the tables as shown in the diagram. You need to generate the list of price totals for each make and model of car, with subtotals for each make, and the grand total of all prices. Which SQL clause do you use?
- UNION
- SHOW TOTALS
- UNION ALL
- WITH ROLLUP
The left and right joins are also known as _.
- Inner Join
- Natural Join
- Outer Join
- Cartesian Join
What is the valid way to create a database view in MySQL?
- CREATE VIEW v1 SELECT * FROM t1 WHERE col1 > 10;
- CREATE VIEW v1 AS BEGIN SELECT * FROM t1 END;
- CREATE VIEW v1 BEGIN SELECT * FROM t1 END;
- CREATE VIEW v1 AS SELECT * FROM t1;
How are permissions implemented in MySQL?
- encrypted algorithms
- access control lists
- user settings
- administrator schema
All Linkedin Skill Assessment Answers
List of Technical Skill Assessment
- LinkedIn .NET Framework Skill Assessment Quiz Answers
- LinkedIn Agile Methodologies Skill Assessment Quiz Answers
- LinkedIn Amazon Web Services (AWS) Skill Quiz Answers
- LinkedIn Android Assessment Quiz Answers
- LinkedIn AngularJS Skill Assessment Quiz Answers
- LinkedIn AWS Lambda Skill Assessment Answers
- LinkedIn Bash Skill Assessment Quiz Answers
- LinkedIn C Skill Assessment Quiz Answers
- LinkedIn C# Skill Assessment Quiz Answers
- LinkedIn C++ Skill Assessment Quiz Answers
- LinkedIn CSS Skill Assessment Quiz Answers
- LinkedIn Cyber Security Skill Assessment Quiz Answers
- LinkedIn Django Skill Assessment Quiz Answers
- LinkedIn Eclipse Skill Assessment Quiz Answers
- LinkedIn Front End Development Skill Assessment Quiz Answers
- LinkedIn Git Skill Assessment Quiz Answers
- LinkedIn Google Analytics Skill Assessment Quiz Answers
- LinkedIn Google Cloud Platform (GCP) Skill Assessment Quiz Answers
- LinkedIn Hadoop Skill Assessment Quiz Answers
- LinkedIn HTML Skill Assessment Quiz Answers
- LinkedIn IT Operation Skill Assessment Quiz Answers
- LinkedIn Java Skill Assessment Quiz Answers
- LinkedIn JavaScript Skill Assessment Quiz Answers
- LinkedIn JQuery Skill Assessment Quiz Answers
- LinkedIn JSON Skill Assessment Quiz Answers
- LinkedIn Windows Server Skill Assessment Quiz Answers
- LinkedIn XML Skill Assessment Answers
- LinkedIn Kotlin Skill Assessment Quiz Answers
- LinkedIn Linux Skill Assessment Quiz Answers
- LinkedIn Machine Learning Skill Assessment Quiz Answers
- LinkedIn Maven Skill Assessment Quiz Answers
- LinkedIn Microsoft Azure Skill Assessment Quiz Answers
- LinkedIn MongoDB Skill Assessment Quiz Answers
- LinkedIn MySQL Skill Assessment Quiz Answers
- LinkedIn Node JS Skill Assessment Quiz Answers
- LinkedIn NoSQL Skill Assessment Quiz Answers
- LinkedIn Objective-C Skill Assessment Quiz Answers
- LinkedIn OOP (Object-Oriented Programming Skill Assessment Quiz Answers
- LinkedIn PHP Skill Assessment Quiz Answers
- LinkedIn Python Skill Assessment Quiz Answers
- LinkedIn React JS Skill Assessment Quiz Answers
- LinkedIn Rest APIs Skill Assessment Quiz Answers
- LinkedIn R (Programming Language) Skill Assessment Quiz Answers
- LinkedIn Ruby on Rails Skill Assessment Quiz Answers
- LinkedIn Scala Skill Assessment Quiz Answers
- LinkedIn Search Engine Optimization (SEO) Skill Assessment Quiz Answers
- LinkedIn Spring Framework Skill Assessment Quiz Answers
- LinkedIn Swift Skill Assessment Quiz Answers
- LinkedIn T-SQL Skill Assessment Quiz Answers
- LinkedIn Unity Skill Assessment Quiz Answers
- LinkedIn Visual Basic for Application (VBA) Skill Assessment Quiz Answers
- LinkedIn WordPress Skill Assessment Quiz Answers
List of Business Skill Assessment
- LinkedIn Accounting Skill Assessment Quiz Answers
- LinkedIn Adobe Acrobat Skill Assessment Quiz Answers
- LinkedIn Google Ads Skill Assessment Quiz Answers
- LinkedIn Microsoft Access Skill Assessment Quiz Answers
- LinkedIn Microsoft Excel Skill Assessment Quiz Answers
- LinkedIn Microsoft Outlook Skill Assessment Quiz Answers
- LinkedIn Microsoft Power BI Skill Assessment Quiz Answers
- LinkedIn Microsoft PowerPoint Skill Assessment Quiz Answers
- LinkedIn Microsoft Project Skill Assessment Quiz Answers
- LinkedIn Microsoft Word Skill Assessment Quiz Answers
- LinkedIn SharePoint Skill Assessment Quiz Answers
- LinkedIn Visio Skill Assessment Quiz Answers
List of Design Skill Assessment