Please find the answers at the end of the test.
Q1. What does it mean SQL is NOT case sensitive?
- You can only enter SQL statements in uppercase
- You can enter SQL statements in either lowercase or uppercase
- It allows you to enter SQL in case format
- The SQL is not sensitive to white spaces
Q2. How are white spaces handled in an SQL statement?
- They are only tolerated if you write a query on one line
- If they are uniformly written, SQL executes them without problems
- Extra white spaces in SQL statements are ignored when executing the statements
- They are only handled if SQL is written over several lines
Q3. What is used to terminate an SQL statement?
- :
- @
- !
- ;
Q4. Which of the following can be used to comment out SQL code?
- – – (double hyphen)
- /: :/
- ==
- /* */
Q5. What is a keyword in SQL?
- They cannot be used as table names, column names or values
- They are reserved words that are used to form part of the SQL language
- They are used for naming tables
- They can only be used in SELECT statements
Q6. What keyword is used to produce a table?
- UPDATE
- CREATE
- INSERT
- PRODUCE
Q7. What keyword is used to create rows in a table?
- CREATE
- UPDATE
- INSERT
- INVERT
Q8. What is a SELECT statement?
- It allows the retrieval of data from a table(s)
- It allows tables to be maintained
- It allows a database to be maintained
- It allows data to be updated
Q9. Which of the following queries are correct?
- SELECT ALL FROM account;
- SELECT trans_id FROM account;
- SELECT * FROM account;
- SELECT FROM account;
Q10. What can follow the word SELECT in a SELECT statement?
- A list of columns that are to be retrieved
- The FROM clause
- The tables to be used
- An asterisk (*)
Q11. What does * mean in a SELECT statement?
- It is a wildcard to aid the WHERE clause
- It allows a search to be filtered
- It is a wildcard, where all columns of a table will be retrieved
- It is used to retrieve all rows in a table
Q12. How do you select specific columns in a SELECT statement?
- By specifying which columns are required in the WHERE clause
- By coding the actual column names required after the SELECT keyword
- By coding the columns required in the FROM clause
- By coding the columns required after the wildcard
Q13. What clause is used to sort retrieved data in a SELECT statement?
- SORT BY
- ORGANISE BY
- SORTED BY
- ORDER BY
Q14. What keyword is used to sort data upwards?
- DESC
- ASC
- UP
- DOWN
Q15. What keyword is used to sort data downwards?
- DOWNWARDS
- DESCENDING
- DESC
- TOPDOWN
Q16. What function is used in a SELECT statement to return only unique values in a column?
- DISTINCT
- UNIQUE
- PRIMARY
- NON_DUPLICATE
Q17. What clause is used to filter data in a SELECT statement?
- CREATE
- FROM
- WHERE
- UNION
Q18. Which of the following shows correct WHERE clause operators?
- =, <>, <, >, <=, >=
- TOGETHER, LIKE, GREATER, LESS
- BETWEEN, LIKE, IN
- <>, !=, INBETWEEN, SIMILAR
Q19. Which of the following are correct?
- SELECT * FROM account WHERE payee = The Big Shop;
- SELECT * FROM account WHERE expense > ‘99.99’;
- SELECT * FROM account WHERE income <> 9.99;
- SELECT * FROM account WHERE account_name LIKE %Shop;
Q20. What is a VARCHAR?
- A data type that that holds text of a fixed length
- A variable string operator
- A variable length string data type
- A data type that holds variable date formats
Q21. What does INT stand for?
- Decimal number
- Integer
- Number
- Integrated
Q22. Which operators can the WHERE clause be combined with to filter data?
- ORDER BY
- OR
- AND
- SORT BY
Q23. What is the best and cleaner way of separating AND and OR statements in an SQL query to ensure they execute properly?
- Using a semicolon
- Using parentheses
- Using quotes
- Using comments
Q24. What is a NULL value in a database cell?
- Zero
- Less than zero
- An empty cell
- An error
Q25. What operator do we use to find certain text in a column?
- IN
- LIKE
- BETWEEN
- SIMILAR
Q26. What character do we use for a wildcard search when using LIKE?
- @
- ;
- *
- %
Q27. Which of the following will return a payee that “starts” with “market”?
- WHERE payee LIKE ‘%market‘;
- WHERE payee LIKE ‘market%’;
- WHERE payee LIKE ‘%market%’;
- WHERE payee LIKE ‘mar%ket‘;
ANSWERS:
Q1. What does it mean SQL is NOT case sensitive?
- You can only enter SQL statements in uppercase
- You can enter SQL statements in either lowercase or uppercase
- It allows you to enter SQL in a case format
- The SQL is not sensitive to white spaces
Answer:
2
Q2. How are white spaces handled in an SQL statement?
- They are only tolerated if you write a query on one line
- If they are uniformly written, SQL executes them without problems
- Extra white spaces in SQL statements are ignored when executing the statements
- They are only handled if SQL is written over several lines
Answer:
3
Q3. What is used to terminate an SQL statement?
- :
- @
- !
- ;
Answer:
4
Q4. Which of the following can be used to comment out SQL code?
- – – (double hyphen)
- /: :/
- ==
- /* */
Answer:
1 and 4
Q5. What is a keyword in SQL?
- They cannot be used as table names, column names or values
- They are reserved words that are used to form part of the SQL language
- They are used for naming tables
- They can only be used in SELECT statements
Answer:
1 and 2
Q6. What keyword is used to produce a table?
- UPDATE
- CREATE
- INSERT
- PRODUCE
Answer:
2
Q7. What keyword is used to create rows in a table?
- CREATE
- UPDATE
- INSERT
- INVERT
Answer:
3
Q8. What is a SELECT statement?
- It allows the retrieval of data from a table(s)
- It allows tables to be maintained
- It allows a database to be maintained
- It allows data to be updated
Answer:
1
Q9. Which of the following queries are correct?
- SELECT ALL FROM account;
- SELECT trans_id FROM account;
- SELECT * FROM account;
- SELECT FROM account;
Answer:
2 and 3
Q10. What can follow the word SELECT in a SELECT statement?
- A list of columns that are to be retrieved
- The FROM clause
- The tables to be used
- An asterisk (*)
Answer:
1 and 4
Q11. What does * mean in a SELECT statement?
- It is a wildcard to aid the WHERE clause
- It allows a search to be filtered
- It is a wildcard, where all columns of a table will be retrieved
- It is used to retrieve all rows in a table
Answer:
3
Q12. How do you select specific columns in a SELECT statement?
- By specifying which columns are required in the WHERE clause
- By coding the actual column names required after the SELECT keyword
- By coding the columns required in the FROM clause
- By coding the columns required after the wildcard
Answer:
2
Q13. What clause is used to sort retrieved data in a SELECT statement?
- SORT BY
- ORGANISE BY
- SORTED BY
- ORDER BY
Answer:
4
Q14. What keyword is used to sort data upwards?
- DESC
- ASC
- UP
- DOWN
Answer:
2
Q15. What keyword is used to sort data downwards?
- DOWNWARDS
- DESCENDING
- DESC
- TOPDOWN
Answer:
3
Q16. What function is used in a SELECT statement to return only unique values in a column?
- DISTINCT
- UNIQUE
- PRIMARY
- NON_DUPLICATE
Answer:
1
Q17. What clause is used to filter data in a SELECT statement?
- CREATE
- FROM
- WHERE
- UNION
Answer:
3
Q18. Which of the following shows correct WHERE clause operators?
- =, <>, <, >, <=, >=
- TOGETHER, LIKE, GREATER, LESS
- BETWEEN, LIKE, IN
- <>, !=, INBETWEEN, SIMILAR
Answer:
1 and 3
Q19. Which of the following are correct?
- SELECT * FROM account WHERE payee = The Big Shop;
- SELECT * FROM account WHERE expense > ‘99.99’;
- SELECT * FROM account WHERE income <> 9.99;
- SELECT * FROM account WHERE account_name LIKE %Shop;
Answer:
3
Number 1: The Big Shop should be in quotes
Number 2: expense is likely to be a DECIMAL, therefore, no quotes are required
Number 4: %Shop should be i quotes
Q20. What is a VARCHAR?
- A data type that that holds text of a fixed length
- A variable string operator
- A variable length string data type
- A data type that holds variable date formats
Answer:
3
Q21. What does INT stand for?
- Decimal number
- Integer
- Number
- Integrated
Answer:
2
Q22. Which operators can the WHERE clause be combined with to filter data?
- ORDER BY
- OR
- AND
- SORT BY
Answer:
2 and 4
Number 1: ORDER BY cannot filter data it can only put returned data in a certain order
Number 4: There is no keyword SORT BY
Q23. What is the best and cleaner way of separating AND and OR statements in an SQL query to ensure they execute properly?
- Using a semicolon
- Using parentheses
- Using quotes
- Using comments
Answer:
2
Q24. What is a NULL value in a database cell?
- Zero
- Less than zero
- An empty cell
- An error
Answer:
3
Q25. What operator do we use to find a snippet of text in a column?
- IN
- LIKE
- BETWEEN
- SIMILAR
Answer:
2
Q26. What character do we use for a wildcard search when using LIKE?
- @
- ;
- *
- %
Answer:
4
Q27. Which of the following will return a payee that “starts” with market?
- WHERE payee LIKE ‘%market‘;
- WHERE payee LIKE ‘market%’;
- WHERE payee LIKE ‘%market%’;
- WHERE payee LIKE ‘mar%ket‘;
Answer:
2 and 3
Return To Lesson ⇒ 4. Basic Data Retrieval