0

databases Online Quiz - 232

Description: databases Online Quiz - 232
Number of Questions: 20
Created by:
Tags: databases
Attempted 0/20 Correct 0 Score 0

Which type of argument passes a value from a calling environment?

  1. a) VARCHER2.

  2. b) BOOLEAN.

  3. c) OUT.

  4. d) IN.


Correct Option: D
Explanation:

To answer this question, the user needs to have knowledge of different types of arguments in programming.

a) VARCHER2: This is not a type of argument. It is a data type used to store character strings in Oracle database.

b) BOOLEAN: This is not a type of argument that passes a value from a calling environment.

c) OUT: This type of argument passes a value to the calling environment. It is used when a function or procedure needs to return more than one value.

d) IN: This type of argument passes a value from the calling environment to the function or procedure. It is used when a function or procedure needs to receive values from the calling environment.

Therefore, the correct answer is:

The Answer is: D. IN.

All users currently have the INSERT privileges on the PLAYER table. You want only your users to insert into this table using the ADD_PLAYER procedure. Which two actions must you take? (Choose two)

  1. a) GRANT SELECT ON ADD_PLAYER TO PUBLIC;

  2. b) GRANT EXECUTE ON ADD_PLAYER TO PUBLIC;

  3. c) GRANT INSERT ON PLAYER TO PUBLIC;

  4. d) GRANT EXECUTE, INSERT ON ADD_PLAYER TO PUBLIC;

  5. e) REVOKE INSERT ON PLAYER FROM PUBLIC;


Correct Option: B,E

AI Explanation

To ensure that only your users can insert into the PLAYER table using the ADD_PLAYER procedure, you need to take the following two actions:

B) GRANT EXECUTE ON ADD_PLAYER TO PUBLIC: This grants the public role the permission to execute the ADD_PLAYER procedure.

E) REVOKE INSERT ON PLAYER FROM PUBLIC: This revokes the insert privilege on the PLAYER table from the public role, ensuring that only your users can insert into the table.

Let's go through each option to understand why it is correct or incorrect:

A) GRANT SELECT ON ADD_PLAYER TO PUBLIC: This grants the public role the permission to select data from the ADD_PLAYER procedure. However, this does not restrict the insert privilege on the PLAYER table, so it is not necessary for achieving the desired outcome.

B) GRANT EXECUTE ON ADD_PLAYER TO PUBLIC: This option is correct because it grants the public role the permission to execute the ADD_PLAYER procedure. This allows all users to execute the procedure, which is necessary for inserting into the PLAYER table using the procedure.

C) GRANT INSERT ON PLAYER TO PUBLIC: This grants the public role the insert privilege on the PLAYER table. However, this does not ensure that only your users can insert into the table using the ADD_PLAYER procedure, so it is not necessary for achieving the desired outcome.

D) GRANT EXECUTE, INSERT ON ADD_PLAYER TO PUBLIC: This grants the public role the permission to execute the ADD_PLAYER procedure and the insert privilege on the ADD_PLAYER table. However, it does not restrict the insert privilege on the PLAYER table, so it is not necessary for achieving the desired outcome.

E) REVOKE INSERT ON PLAYER FROM PUBLIC: This option is correct because it revokes the insert privilege on the PLAYER table from the public role. This ensures that only your users can insert into the table using the ADD_PLAYER procedure.

Therefore, the correct answer is B) GRANT EXECUTE ON ADD_PLAYER TO PUBLIC and E) REVOKE INSERT ON PLAYER FROM PUBLIC.

SQL is a procedural language?

  1. True

  2. False


Correct Option: B

With optimistic locking a user may have to redo their work when a conflict occurs?

  1. True

  2. False


Correct Option: A
Explanation:

The answer is: A

Explanation:

Optimistic locking is a technique used to prevent data conflicts in a multi-user environment. It involves checking for conflicts only at the time of update, that is, when a user tries to modify a piece of data that may have already been modified by another user. If a conflict is detected, the optimistic locking mechanism rolls back the transaction and the user has to redo their work. Therefore, option A is correct. Option B is incorrect because it contradicts the explanation given above.

The two types of SQL environment are interactive and embedded?

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, you need to understand the types of SQL environments.

Option A) True - This option is correct. SQL environments can be categorized into two types: interactive and embedded.

  • Interactive SQL environments allow users to directly interact with the database management system (DBMS) through a command-line interface or graphical user interface (GUI). Users can enter SQL queries, execute them, and view the results immediately.

  • Embedded SQL environments, on the other hand, involve integrating SQL statements within a programming language like C, Java, or Python. These SQL statements are embedded within the code and executed programmatically.

Option B) False - This option is incorrect because there are indeed two types of SQL environments: interactive and embedded.

Therefore, the correct answer is A) True.

Catch_#22 valid column name?

  1. True

  2. False


Correct Option: A

In a select with a group by clause, a where clause, and a having clause, the where conditions are applied before the having conditions?

  1. True

  2. False


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) True - This option is correct. In a SQL SELECT statement with a GROUP BY clause, the WHERE clause is applied before the HAVING clause. The WHERE clause filters the rows before they are grouped, while the HAVING clause filters the aggregated groups after they have been formed.

Option B) False - This option is incorrect. The WHERE clause is applied before the HAVING clause in a SQL SELECT statement with a GROUP BY clause.

The correct answer is A) True. This option is correct because the WHERE conditions are applied before the HAVING conditions in a SELECT statement with a GROUP BY clause.

Which statement about a table is true?

  1. A table can have up to 10,000 columns.

  2. The size of a table does NOT need to be specified

  3. A table CANNOT be created while users are using the database

  4. The structure of a table CANNOT be modified while the table is online


Correct Option: B

Which two data types can be converted to LOBs using an ALTER TABLE…MODIFY command? (Choose two.)

  1. RAW

  2. LONG

  3. VARCHAR

  4. LONG RAW


Correct Option: B,D

ALTER TABLE inventory ENABLE CONSTRAINT inventory_id_pk; Which statement is true?

  1. The statement will achieve the desired results

  2. The statement will execute, but will NOT enable the PRIMARY KEY constraint.

  3. The statement will execute, but will NOT verify that values in the ID column do NOT violate the constraint.

  4. The statement will return a syntax error.


Correct Option: A

AI Explanation

To determine which statement is true, let's go through each option:

Option A) The statement will achieve the desired results - This option is correct because the statement is using the "ENABLE CONSTRAINT" command to enable the PRIMARY KEY constraint on the "inventory_id_pk" constraint. By executing this statement, the PRIMARY KEY constraint will be enabled and enforced on the "ID" column of the "inventory" table.

Option B) The statement will execute, but will NOT enable the PRIMARY KEY constraint - This option is incorrect. The statement will enable the PRIMARY KEY constraint as specified.

Option C) The statement will execute, but will NOT verify that values in the ID column do NOT violate the constraint - This option is incorrect. When the PRIMARY KEY constraint is enabled, it will verify that values in the "ID" column do not violate the constraint (i.e., there are no duplicate values or NULL values).

Option D) The statement will return a syntax error - This option is incorrect. The syntax of the statement is correct, so it will not return a syntax error.

Therefore, the correct answer is Option A) The statement will achieve the desired results.

Which three functions can be used to manipulate character, number, or date column values? (Choose three.)

  1. CONCAT

  2. ROUND

  3. TRUNC

  4. RPAD

  5. INSTR


Correct Option: A,D,E

AI Explanation

To answer this question, you need to understand the functions used to manipulate character, number, or date column values. Let's go through each option to understand why it is correct or incorrect:

Option A) CONCAT - This option is correct because the CONCAT function is used to concatenate (or combine) two or more strings together. It can be used to manipulate character column values.

Option B) ROUND - This option is incorrect because the ROUND function is used to round a number to a specified number of decimal places. It is not used to manipulate character, number, or date column values.

Option C) TRUNC - This option is incorrect because the TRUNC function is used to truncate a number to a specified number of decimal places. It is not used to manipulate character, number, or date column values.

Option D) RPAD - This option is correct because the RPAD function is used to pad a string with a specified character to a specified length. It can be used to manipulate character column values.

Option E) INSTR - This option is correct because the INSTR function is used to find the position of a substring within a string. It can be used to manipulate character column values.

The correct answer is A, D, and E. These options are correct because the CONCAT, RPAD, and INSTR functions can be used to manipulate character, number, or date column values.

Which two statements are true about constraints? (Choose two.)

  1. The UNIQUE constraint does not permit a null value for the column.

  2. A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints.

  3. The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index

  4. The NOT NULL constraint ensures that null values are not permitted for the column


Correct Option: B,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) The UNIQUE constraint does not permit a null value for the column. This option is incorrect because the UNIQUE constraint does allow null values for the column. However, it enforces uniqueness among the non-null values in the column.

Option B) A UNIQUE index gets created for columns with PRIMARY KEY and UNIQUE constraints. This option is correct. When a column has a PRIMARY KEY or UNIQUE constraint, a UNIQUE index is automatically created for that column. This index ensures that the values in the column are unique.

Option C) The PRIMARY KEY and FOREIGN KEY constraints create a UNIQUE index. This option is incorrect. While the PRIMARY KEY constraint does create a UNIQUE index, the FOREIGN KEY constraint does not create a UNIQUE index. The FOREIGN KEY constraint establishes a relationship between two tables.

Option D) The NOT NULL constraint ensures that null values are not permitted for the column. This option is correct. The NOT NULL constraint is used to ensure that a column does not contain any null values. It requires that every value in the column must be non-null.

The correct answers are B and D. These options are correct because a UNIQUE index is created for columns with PRIMARY KEY and UNIQUE constraints, and the NOT NULL constraint ensures that null values are not permitted for the column.

Which three are true? (Choose three.)

  1. A MERGE statement is used to merge the data of one table with data from another.

  2. A MERGE statement replaces the data of one table with that of another.

  3. A MERGE statement can be used to insert new rows into a table.

  4. A MERGE statement can be used to update existing rows in a table.


Correct Option: A,C,D

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) A MERGE statement is used to merge the data of one table with data from another. - This option is correct. A MERGE statement combines data from two tables based on a specified condition and updates or inserts data into a target table based on the matching condition.

Option B) A MERGE statement replaces the data of one table with that of another. - This option is incorrect. A MERGE statement does not replace the data of one table with another. It merges or updates data based on the specified condition.

Option C) A MERGE statement can be used to insert new rows into a table. - This option is correct. A MERGE statement can insert new rows into a table when a matching condition is not met during the merge operation.

Option D) A MERGE statement can be used to update existing rows in a table. - This option is correct. A MERGE statement can update existing rows in a table based on the specified condition.

Therefore, the correct answers are A, C, and D.

Which statement describes the ROWID data type?

  1. binary data up to 4 gigabytes

  2. character data up to 4 gigabytes

  3. raw binary data of variable length up to 2 gigabytes

  4. binary data stored in an external file, up to 4 gigabytes

  5. a hexadecimal string representing the unique address of a row in its table


Correct Option: E

Which is a valid CREATE TABLE statement?

  1. CREATE TABLE EMP9$# AS (empid number(2));

  2. CREATE TABLE EMP*123 AS (empid number(2));

  3. CREATE TABLE PACKAGE AS (packid number(2));

  4. CREATE TABLE 1EMP_TEST AS (empid number(2));


Correct Option: A

Which three are true regarding the use of outer joins? (Choose three.)

  1. You cannot use IN operator in a condition that involves an outer join

  2. You use (+) on both sides of the WHERE condition to perform an outer join

  3. You use (*) on both sides of the WHERE condition to perform an outer join

  4. You use an outer join to see only the rows that do not meet the join condition

  5. In the WHERE condition, you use (+) following the name of the column in the table without matching rows, to perform an outer join

  6. You cannot link a condition that is involved in an outer join to another condition by using the OR operator.


Correct Option: A,E,F

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) You cannot use IN operator in a condition that involves an outer join - This option is true. When using an outer join, you cannot use the IN operator in the condition that involves the outer join.

Option B) You use (+) on both sides of the WHERE condition to perform an outer join - This option is incorrect. The use of (+) syntax on both sides of the WHERE condition is used in Oracle's old outer join syntax, but it is not the recommended approach. The ANSI SQL standard syntax should be used instead.

Option C) You use () on both sides of the WHERE condition to perform an outer join - This option is incorrect. The use of () syntax on both sides of the WHERE condition is not valid for performing an outer join.

Option D) You use an outer join to see only the rows that do not meet the join condition - This option is incorrect. An outer join is used to include rows from one table that may not have a match in the other table, but it does not limit the result set to only the rows that do not meet the join condition.

Option E) In the WHERE condition, you use (+) following the name of the column in the table without matching rows, to perform an outer join - This option is true. In Oracle's old outer join syntax, you can use (+) following the name of the column in the table without matching rows to perform an outer join.

Option F) You cannot link a condition that is involved in an outer join to another condition by using the OR operator - This option is true. When using an outer join, you cannot link a condition involved in the outer join to another condition using the OR operator.

Therefore, the three true statements regarding the use of outer joins are: A. You cannot use the IN operator in a condition that involves an outer join. E. In the WHERE condition, you use (+) following the name of the column in the table without matching rows, to perform an outer join. F. You cannot link a condition that is involved in an outer join to another condition by using the OR operator.

Which constraint can be defined only at the column level?

  1. UNIQUE

  2. NOT NULL

  3. CHECK

  4. PRIMARY KEY


Correct Option: B

AI Explanation

To answer this question, you need to understand the different constraints that can be defined in a database. Let's go through each option to understand why it is correct or incorrect:

Option A) UNIQUE - This constraint can be defined at both the column level and the table level. It ensures that the values in a column are unique across all rows in the table.

Option B) NOT NULL - This constraint can only be defined at the column level. It ensures that the column cannot contain any null values.

Option C) CHECK - This constraint can be defined at both the column level and the table level. It allows you to specify a condition that must be met for the values in the column or table.

Option D) PRIMARY KEY - This constraint can be defined at both the column level and the table level. It ensures that the values in the column or combination of columns are unique and not null. It also automatically creates a unique index on the column or combination of columns.

The correct answer is B) NOT NULL. This constraint can only be defined at the column level, ensuring that the column cannot contain any null values.

Which best describes an inline view?

  1. a schema object

  2. a subquery that can contain an ORDER BY clause

  3. another name for a view that contains group functions

  4. a subquery that is part of the FROM clause of another query


Correct Option: D

JSON stands for:

  1. JVM Object Noation

  2. Javascript Oreinted Notation

  3. JavaScript Object Notation

  4. Java Object Novation


Correct Option: C

JSON is rival of which technology:

  1. HTML

  2. XML

  3. DHTML

  4. SAOP


Correct Option: B
- Hide questions