WorksheetsUnit 4 Diagnostic
Total questions: 10
Worksheet time: 4mins
In an Express application that follows the MVC architecture,
SQL commands are typically stored in which folder?
index.js
src/controllers
src/models
src/routes
Which db config object key is incorrect?
const setting = {
connectionLimit: 3,
host: 'localhost',
user: 'david_tan',
password: 'abDx_5',
database: 'mysql'
...}
What is the SQL Command used to add new records into a Pokemon Database Table?
CREATE TABLE
ADD INTO
Which SQL command(s) is used to retrieve all records in the Pokemon Database Table?
You may choose more than 1 option
GET
FIND
WHERE
SELECT
Which SQL command(s) are used to retrieve records with id = 22 in the Player Database Table?
You may choose more than 1 option
SELECT
FIND
FILTER
WHERE
Which SQL command(s) are used to update a Pokemon with id = 33?
You may choose more than 1 option
WHERE
SELECT
UPDATE
INSERT
Will this code snippet work?
const SQL = "SELECT * FROM Pokemon WHERE id = ?"
pool.query(SQL, [3], ( ) => { })
Yes
No
Don't Know
Will this code snippet work?
const SQL = "SELECT * FROM Pokemon WHERE id = ?"
pool.query(SQL, ["128"], ( ) => { })
Yes
No
Maybe
Will this code snippet work?
const SQL = "SELECT * FROM Pokemon WHERE id = ? AND hp = ?"
pool.query(SQL, [33, 55], ( ) => { })
Yes
No
I don't know
Will this code snippet work?
const SQL= `UPDATE Player SET name = ? WHERE id = ?`;
pool.query(SQL, ["Ash", 23, 88], () => {});
Yes
No
I don't know
