Advanced Database Midterm Exam

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Jhaicee
J
Jhaicee
Community Contributor
Quizzes Created: 4 | Total Attempts: 10,978
| Attempts: 3,314 | Questions: 50
Please wait...
Question 1 / 50
0 %
0/100
Score 0/100
1. This returns TRUE if either component condition is true

Explanation

The correct answer is "OR" because the "OR" operator returns true if either of the two conditions being evaluated is true. In this case, the statement is saying that if either component condition is true, the result will be true.

Submit
Please wait...
About This Quiz
Advanced Database Midterm Exam - Quiz

You are now heading for the midterm exam and one of the topics you covered is advanced databases. How conversant are you with the new technologies involving databases... see moreand their use? Take up the quiz to ensure you do not fail that exam. All the best as you prepare for it.
see less

2. This returns TRUE if the following condition is false

Explanation

The correct answer is "NOT" because the NOT operator returns the opposite boolean value of the given condition. In this case, if the condition is false, the NOT operator will return true.

Submit
3. The rules of precedence determine the order in which expressions are evaluated and calculated

Explanation

The statement is true because the rules of precedence in mathematics dictate the order in which operations are performed in an expression. This ensures that calculations are done correctly and consistently. For example, in the expression 2 + 3 * 4, the multiplication is done first according to the rules of precedence, resulting in 2 + 12, which equals 14. Without these rules, calculations would not have a standardized order, leading to ambiguity and incorrect results.

Submit
4. You can use several conditions in one WHERE clause using the AND and OR operators.

Explanation

The given statement is true. In SQL, the AND and OR operators can be used to combine multiple conditions in a WHERE clause. The AND operator is used to specify that all conditions must be true for a row to be included in the result set, while the OR operator is used to specify that at least one condition must be true for a row to be included. By using these operators, complex conditions can be created to filter the data and retrieve the desired results.

Submit
5. This returns TRUE if both component conditions are true

Explanation

The correct answer is "AND" because the "AND" operator returns true only if both component conditions are true. In other words, if both conditions evaluate to true, the "AND" operator will return true. If either or both conditions are false, the "AND" operator will return false.

Submit
6. Which of the following BEST describes the sql statements:
SELECT last_name, salaryFROM employeesWHERE salary <= 3000 ;

Explanation

The given answer accurately describes the sql statement. It states that the SELECT statement retrieves the last name and salary from the EMPLOYEES table for any employee whose salary is less than or equal to 3,000. This means that the query will return the last name and salary of all employees whose salary is less than or equal to 3,000.

Submit
7. Values that are specified with the BETWEEN condition are inclusive.

Explanation

The BETWEEN condition in SQL is used to specify a range of values. When using the BETWEEN condition, both the starting and ending values are included in the result set. Therefore, the statement "Values that are specified with the BETWEEN condition are inclusive" is true.

Submit
8. A function that converts alpha character values to uppercase

Explanation

The correct answer is UPPER() because it is a common function used in programming languages to convert alpha character values to uppercase. It takes a string as input and returns the same string with all alphabetic characters converted to uppercase. This function is widely supported and recognized, making it a suitable choice for converting characters to uppercase.

Submit
9. Which of the following BEST describes the sql statements:

SELECT employee_id, last_name, salary, manager_idFROM employeesWHERE manager_id IN (100, 101, 201) ;

Explanation

The given SQL statement uses the SELECT keyword to specify the columns to be displayed, which are employee_id, last_name, salary, and manager_id. The FROM keyword is used to specify the table name, which is employees. The WHERE clause is used to filter the results based on the condition that the manager_id should be either 100, 101, or 201. Therefore, the statement will display the employee numbers, last names, salaries, and manager's employee numbers for all the employees whose manager's employee number is 100, 101, or 201.

Submit
10. If you use the ORDER BY clause, it must be the last clause of the SQL statement.

Explanation

The statement is true because the ORDER BY clause is used to sort the result set in ascending or descending order based on one or more columns. It is typically the last clause in a SQL statement because it is applied after all other clauses, such as WHERE and GROUP BY, have been executed. Placing the ORDER BY clause before other clauses may result in incorrect sorting or unexpected results.

Submit
11. This function searches a text expression for a character string and, if found, replaces it with a specified replacement string

Explanation

The function "REPLACE()" is the correct answer because it is commonly used to search a text expression for a specific character string and replace it with a specified replacement string. This function allows for efficient and convenient manipulation of text data by replacing specific occurrences of a string with another string. It is a useful tool in various applications such as data cleaning, data transformation, and text processing.

Submit
12. Which of the following BEST describes the sql statements:
SELECT employee_id, last_name, job_id, department_idFROM employeesWHERE department_id = 90

Explanation

The correct answer is the SELECT statement retrieves the employee ID, name, job ID, and department number of all employees who are in department 90. This is because the SELECT statement specifies the columns (employee_id, last_name, job_id, department_id) that should be retrieved from the employees table. The WHERE clause filters the results to only include rows where the department_id is equal to 90. Therefore, the statement retrieves the specified columns for all employees in department 90.

Submit
13. The default date display format is ____________.

Explanation

The default date display format is DD-MON-RR. This format represents the date with the day first, followed by the three-letter abbreviation of the month, and the last two digits of the year. For example, if the date is January 15, 2023, it would be displayed as 15-JAN-23.

Submit
14. The ____________ clause can be used to sort the rows.

Explanation

The "ORDER BY" clause is used to sort the rows in a SQL query. It allows you to specify the column or columns by which you want to sort the result set. The ORDER BY clause can be used in conjunction with the SELECT statement to retrieve data in a specific order, such as ascending or descending order based on the values in one or more columns.

Submit
15. This function enables you to trim heading or trailing characters (or both)from a character string.

Explanation

The TRIM() function is the correct answer because it allows you to remove leading or trailing characters (or both) from a character string. This function is commonly used to remove spaces or other unwanted characters from the beginning or end of a string. The TRACK() and TRACE() functions are not relevant to this purpose, and HTRIM() specifically trims only trailing spaces.

Submit
16. Character strings and date values are enclosed by _____________.

Explanation

Character strings and date values are commonly enclosed by single quotation marks. This is a common practice in programming languages and databases to denote that the enclosed content is a string literal. Double quotation marks are often used to enclose column or table names, while asterisks are used for wildcard searches. The AS keyword is used for aliasing column or table names. However, when it comes to enclosing character strings and date values, single quotation marks are the correct choice.

Submit
17. Which of the following BEST describes the sql statements:
SELECT last_name, job_idFROM employeesWHERE job_idNOT IN ('IT_PROG', 'ST_CLERK', 'SA_REP') ;

Explanation

The given SQL statement uses the NOT IN operator to exclude the job IDs 'IT_PROG', 'ST_CLERK', and 'SA_REP' from the result. Therefore, the statement displays the last name and job ID of all employees whose job ID is not IT_PROG, ST_CLERK, or SA_REP.

Submit
18. The ___________ condition tests for nulls.

Explanation

The correct answer is "IS NULL". This is because the "IS NULL" condition is used to test for null values in a database. It returns true if the value is null and false if it is not. Therefore, "IS NULL" is the appropriate condition to use when testing for nulls.

Submit
19. The _________ function rounds the column, expression, or value to n decimal places.

Explanation

The ROUND() function is used to round a column, expression, or value to a specified number of decimal places. It is commonly used in mathematical calculations or when presenting data with a specific level of precision. The TRUNC() function truncates a number to a specified number of decimal places without rounding, while ROFF() and ROUNDOFF() are not valid functions in this context.

Submit
20. Use the _________ condition to perform wildcard searches of valid search string values.

Explanation

The LIKE condition is used to perform wildcard searches of valid search string values. This means that it allows for pattern matching in the search, where the search string can contain wildcards such as % (percent sign) and _ (underscore). These wildcards represent unknown characters or a single character, respectively. By using the LIKE condition, you can search for values that match a specific pattern, making it a useful tool for searching for data with unknown or variable values.

Submit
21. Restrict the rows that are returned by using the _________ clause

Explanation

The WHERE clause is used to restrict the rows that are returned in a SQL query. It allows you to specify conditions that the rows must meet in order to be included in the result set. By using the WHERE clause, you can filter out unwanted data and retrieve only the rows that meet the specified criteria.

Submit
22. A function that concatenates the first character value to the second character value; equivalent to concatenation operator (||)

Explanation

The correct answer is CONCAT(). This function is used to concatenate two or more strings together. It takes multiple string arguments and combines them into a single string. It is equivalent to using the concatenation operator (||) in some programming languages.

Submit
23. These are used in conditions that compare one expression to another value or expression.

Explanation

The correct answer is "comparison conditions" because these conditions are used to compare one expression to another value or expression. This implies that they are used to check if one value is equal to, greater than, less than, or not equal to another value. Examples of comparison conditions include "==" (equal to), ">" (greater than), "

Submit
24. These functions operate on single rows only and return one result per row.

Explanation

Single-Row Functions are the correct answer because they are the functions that operate on single rows only and return one result per row. These functions are used to perform calculations or manipulate data within a single row of a table. Examples of single-row functions include mathematical functions like ABS and ROUND, string functions like UPPER and LOWER, and date functions like TO_CHAR and TO_DATE. These functions are commonly used in SQL queries to transform or modify data on a row-by-row basis.

Submit
25. Character values are ______________, and datevalues are _____________.

Explanation

Character values are case-sensitive, meaning that uppercase and lowercase letters are considered distinct. For example, "A" and "a" are treated as different values. Date values are format-sensitive, meaning that the format in which a date is entered must match the expected format for it to be recognized as a valid date. For example, if the expected format is "MM/DD/YYYY", entering the date as "DD/MM/YYYY" would not be recognized as a valid date.

Submit
26. This symbol represents any sequence of zero or more characters for wildcard search.

Explanation

The symbol "%" represents any sequence of zero or more characters for wildcard search. This means that when using this symbol in a search query, it will match any combination of characters, including no characters at all.

Submit
27. You can use _____________ to override rules of precedence.

Explanation

Parenthesis can be used to override rules of precedence in mathematical expressions or equations. By enclosing certain parts of an expression within parentheses, you can ensure that those parts are evaluated first, regardless of the usual order of operations. This allows you to clarify the intended grouping of operations and ensure that the desired result is achieved.

Submit
28. Which of the following will be evaluated first based on the rule of precedence?

Explanation

Arithmetic operators will be evaluated first based on the rule of precedence. This is because arithmetic operators have a higher precedence than concatenation operators, comparison conditions, and the BETWEEN operator. This means that any arithmetic operations in an expression will be performed before any concatenation, comparison, or BETWEEN operations.

Submit
29. It make the basic query block more powerful, and they are used to manipulate data values.

Explanation

Functions are used to manipulate data values and make the basic query block more powerful. They are a type of method that can be called to perform specific tasks and return a result. Functions can take input parameters and return a value based on the logic defined within them. They are commonly used in programming and database query languages to perform calculations, transformations, and data manipulations.

Submit
30. All character searches are case-insensitive.

Explanation

The explanation for the given correct answer is that character searches are not case-insensitive. This means that when searching for a character, the search is sensitive to the case of the characters. For example, searching for 'A' will not match 'a'. Therefore, the statement "All character searches are case-insensitive" is false.

Submit
31. A function that returns the number of characters in the expression

Explanation

The LENGTH() function is the correct answer because it is commonly used in programming languages to determine the length or number of characters in a given string or expression. It returns the total number of characters, including spaces and special characters, making it suitable for calculating the length of any expression. The other options, SIZE(), LEN(), and STRLEN(), are not as commonly used or recognized for this purpose.

Submit
32. How many columns are presented after executing this query:
SELECT address1||','||address2||','||address2 "Adress" FROM employee;

Explanation

The given query selects the concatenated values of three columns: address1, address2, and address2 (which seems to be a typo and should be address3). The result of the concatenation is assigned the alias "Address". Therefore, after executing this query, only one column will be presented in the result set.

Submit
33. The ESCAPE option identifies the _______________ as the escape character.

Explanation

The correct answer is "\". The backslash (\) is commonly used as the escape character in programming languages. It is used to indicate that the character following it should be treated differently, such as escaping special characters or representing control characters.

Submit
34. The _________ function finds the remainder of the first argument divided by the second argument.

Explanation

The MOD() function is used to find the remainder of the first argument divided by the second argument.

Submit
35. The default date format is

Explanation

The default date format is DD-MON-RR. This means that the date will be displayed with the day first, followed by the three-letter abbreviation of the month, and then the last two digits of the year. For example, if the date is January 25, 2022, it will be displayed as 25-JAN-22. This format is commonly used in various applications and systems as it provides a clear and concise representation of the date.

Submit
36. This symbol represents any single character for wildcard search.

Explanation

The correct answer is "_". The underscore symbol is commonly used in databases and search engines as a wildcard character to represent any single character in a search query. It can be used to match any letter, number, or special character in a given position. For example, if you search for "c_t", it will match "cat", "cut", "cot", and any other word with "c" followed by any single character and then "t".

Submit
37. This condition is used to test for values in a specified set of values.

Explanation

The condition "IN" is used to test for values in a specified set of values. It allows us to check if a value matches any of the values specified in the set. It is commonly used in SQL queries to filter data based on multiple possible values.

Submit
38.  A function that returns the numeric position of a named string.

Explanation

INSTR() is the correct answer because it is a function that returns the numeric position of a named string. It is commonly used in SQL to find the position of a substring within a larger string. The INSTR() function takes two arguments: the string to search within and the substring to search for. It returns the position of the substring within the string, or 0 if the substring is not found. Therefore, INSTR() is the appropriate function for finding the position of a named string.

Submit
39. What is the output of the following statement:
RPAD(salary,5,'#')

Explanation

The RPAD function is used to pad a string with a specific character to a specified length. In this case, the string "salary" is being padded with the character "#" to a length of 5. However, since the length of the string "salary" is already 5, no padding is needed. Therefore, the output of the statement RPAD(salary,5,'#') is "salary" itself, which in this case is "40000".

Submit
40. Which of the following operator does NOT represent the NOT EQUAL expression:

Explanation

The operator "*=" represents the multiplication assignment operator, which multiplies the value on the left by the value on the right and assigns the result to the left operand. It does not represent the NOT EQUAL expression. The "!=" operator is used to check if two values are not equal, while the "^=" operator is used for bitwise XOR assignment.

Submit
41. A function that converts alpha character values to lowercase

Explanation

The LOWER() function is used to convert alpha character values to lowercase.

Submit
42. The ____________ function truncates the column, expression, or value to n decimal places.

Explanation

The TRUNC() function is used to truncate or shorten a column, expression, or value to a specified number of decimal places. It removes the digits after the decimal point, effectively rounding down the number. This function is commonly used in mathematical calculations or when displaying numerical data with a specific precision.

Submit
43. A _________condition combines the result of two component conditions to produce a single result based on those conditions, or it inverts the result of a single condition.

Explanation

A logical condition combines the result of two component conditions to produce a single result based on those conditions, or it inverts the result of a single condition. This means that it evaluates whether a certain condition is true or false, and combines or inverts the results accordingly. Relational conditions compare two values to determine if they are equal, greater than, or less than each other. Test conditions are used to check if a certain test or condition is met. Arithmetic conditions involve mathematical operations such as addition, subtraction, multiplication, and division. Therefore, the correct answer is logical as it best fits the given explanation.

Submit
44. These functions can manipulate groups of rows to give one result per group of rows.

Explanation

The given answer, "both a and b," is correct because both multiple-row functions and group functions can manipulate groups of rows to give one result per group of rows. Multiple-row functions perform calculations on a set of rows and return a single result for each row, while group functions perform calculations on a group of rows and return a single result for the entire group. Therefore, both types of functions can be used to manipulate groups of rows and provide a single result per group.

Submit
45. What is the output of the following statement:
LPAD(salary,10,'*')

Explanation

The LPAD function is used to pad a string with a specified character to a certain length. In this case, the string "salary" is being padded with asterisks (*) to a length of 10. The output is "*****24000" because the original string "salary" has a length of 5, so it is padded with 5 asterisks to reach a length of 10. The resulting string is then "*****24000".

Submit
46. A function that converts alpha character values to uppercase for the first letter of each word; all other letters in lowercase

Explanation

INITCAP() is the correct answer because it is a function that converts alpha character values to uppercase for the first letter of each word, while converting all other letters to lowercase. This function is commonly used in database systems to properly format names or titles, ensuring that the first letter of each word is capitalized and the rest are in lowercase.

Submit
47. It is a dummy table that you can use to view results from functions and calculations.

Explanation

DUAL is the correct answer because it is a dummy table that can be used to view results from functions and calculations. It is often used when a table is required for syntax purposes, but the actual data is not important.

Submit
48. It is a function that returns the date and time

Explanation

SYSDATE is the correct answer because it is a function that returns the current date and time. It is commonly used in SQL to retrieve the system date and time. The other options, SYSDATETIME, SYSTIME, and DATETIME, are not valid functions in SQL and do not provide the same functionality as SYSDATE.

Submit
49. A function that accepts character input and can return both character and number values

Explanation

The correct answer is "Character" because a function that accepts character input and can return both character and number values would most likely have a return type of "Character". This means that the function can take in a character as input and can return either a character or a number as output. This allows for flexibility in the function's functionality and makes it suitable for handling both character and number values.

Submit
50. Which of the following will be evaluated first based on the rule of precedence?

Explanation

The not equal to operator will be evaluated first based on the rule of precedence. This is because the not equal to operator has a higher precedence than the logical operators (NOT, AND, OR). Precedence determines the order in which operators are evaluated in an expression. Therefore, any expression involving the not equal to operator will be evaluated before any expressions involving logical conditions.

Submit
View My Results

Quiz Review Timeline (Updated): Mar 22, 2023 +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 22, 2023
    Quiz Edited by
    ProProfs Editorial Team
  • Feb 08, 2011
    Quiz Created by
    Jhaicee
Cancel
  • All
    All (50)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
This returns TRUE if either component condition is true
This returns TRUE if the following condition is false
The rules of precedence determine the order in which expressions are...
You can use several conditions in one WHERE clause using the AND...
This returns TRUE if both component conditions are true
Which of the following BEST describes the sql statements:SELECT...
Values that are specified with the BETWEEN condition are inclusive.
A function that converts alpha character values to uppercase
Which of the following BEST describes the sql statements:SELECT...
If you use the ORDER BY clause, it must be the last clause of the...
This function searches a text expression for a character string and,...
Which of the following BEST describes the sql statements:SELECT...
The default date display format is ____________.
The ____________ clause can be used to sort the rows.
This function enables you to trim heading or trailing characters (or...
Character strings and date values are enclosed by _____________.
Which of the following BEST describes the sql statements:SELECT...
The ___________ condition tests for nulls.
The _________ function rounds the column, expression, or value to n...
Use the _________ condition to perform wildcard searches of valid...
Restrict the rows that are returned by using the _________ clause
A function that concatenates the first character value to the...
These are used in conditions that compare one expression to another...
These functions ...
Character values are ______________, and datevalues are _____________.
This symbol represents any sequence of zero or more characters for...
You can use _____________ to override rules of precedence.
Which of the following will be evaluated first based on the rule of...
It make the basic query block more powerful, ...
All character searches are case-insensitive.
A function that returns the number of characters in the expression
How many columns are presented after executing this query:SELECT...
The ESCAPE option identifies the _______________ as the escape...
The _________ function finds the remainder of the first argument...
The default date format is
This symbol represents any single character for wildcard search.
This condition is used to test for values in a specified set of...
 A function that returns the numeric position of a named string.
What is the output of the following statement:RPAD(salary,5,'#')
Which of the following operator does NOT represent the NOT EQUAL...
A function that converts alpha character values to lowercase
The ____________ function truncates the column, expression, or value...
A _________condition combines the result of two component conditions...
These functions can ...
What is the output of the following statement:LPAD(salary,10,'*')
A function that converts alpha character values to uppercase for the...
It is a dummy table that you can use to view results from...
It is a function that returns the date and time
A function that accepts ...
Which of the following will be evaluated first based on the rule of...
Alert!

Advertisement