Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit 4 Diagnostic

Total questions: 10

Worksheet time: 4mins

Name
Class
Date
1.

In an Express application that follows the MVC architecture,
SQL commands are typically stored in which folder?

a)

index.js

b)

src/controllers

c)

src/models

d)

src/routes

2.

Which db config object key is incorrect?
const setting = {
connectionLimit: 3,
host: 'localhost',
user: 'david_tan',
password: 'abDx_5',
database: 'mysql'
...}

a)
database
b)
connectionLimit
c)
host
d)
username
3.

What is the SQL Command used to add new records into a Pokemon Database Table?

a)
INSERT INTO
b)

CREATE TABLE

c)
UPDATE TABLE
d)

ADD INTO

4.

Which SQL command(s) is used to retrieve all records in the Pokemon Database Table?
You may choose more than 1 option

a)

GET

b)

FIND

c)

WHERE

d)

SELECT

5.

Which SQL command(s) are used to retrieve records with id = 22 in the Player Database Table?

You may choose more than 1 option

a)

SELECT

b)

FIND

c)

FILTER

d)

WHERE

6.

Which SQL command(s) are used to update a Pokemon with id = 33?
You may choose more than 1 option

a)

WHERE

b)

SELECT

c)

UPDATE

d)

INSERT

7.

Will this code snippet work?

const SQL = "SELECT * FROM Pokemon WHERE id = ?"

pool.query(SQL, [3], ( ) => { })

a)

Yes

b)

No

c)

Don't Know

8.

Will this code snippet work?

const SQL = "SELECT * FROM Pokemon WHERE id = ?"

pool.query(SQL, ["128"], ( ) => { })

a)

Yes

b)

No

c)

Maybe

9.

Will this code snippet work?

const SQL = "SELECT * FROM Pokemon WHERE id = ? AND hp = ?"

pool.query(SQL, [33, 55], ( ) => { })

a)

Yes

b)

No

c)

I don't know

10.

Will this code snippet work?

const SQL= `UPDATE Player SET name = ? WHERE id = ?`;

pool.query(SQL, ["Ash", 23, 88], () => {});

a)

Yes

b)

No

c)

I don't know