Oracle Database 12c SQL Fundamentals

Here you have the best Oracle 1z0-061 practice exam questions

  • You have 86 total questions to study from
  • Each page has 5 questions, making a total of 18 pages
  • You can navigate through the pages using the buttons at the bottom
  • This questions were last updated on November 27, 2024
Question 1 of 86

Evaluate the following SQL statement:

Which statement is true regarding the outcome of the above query?

    Correct Answer: D

    The SQL query will produce an error because the ORDER BY clause should appear only at the end of a compound query, that is, with the last SELECT statement. In a UNION operation, the combined result set can be ordered only once, and the ORDER BY clause should be applied after the final SELECT statement to sort the entire result set.

Question 2 of 86

View the Exhibit and examine the structure of the product, component, and PDT_COMP tables.

In product table, PDTNO is the primary key.

In component table, COMPNO is the primary key.

In PDT_COMP table,

You want to generate a report listing the product names and their corresponding component names, if the component names and product names exist.

Evaluate the following query:

SQL>SELECT pdtno, pdtname, compno, compname

FROM product _____________ pdt_comp

USING (pdtno) ____________ component USING (compno)

WHERE compname IS NOT NULL;

Which combination of joins used in the blanks in the above query gives the correct output?

    Correct Answer: A

    To generate a report listing the product names and their corresponding component names where both names exist, inner joins are suitable. Inner joins ensure that only rows with matching keys in both tables are selected, which aligns with the requirement that both product and component names must exist.

Question 3 of 86

You want to create a table employees in which the values of columns EMPLOYEES_ID and LOGIN_ID must be unique and not null. Which two SQL statements would create the required table?

    Correct Answer: A, E

    To create the required table where both EMPLOYEE_ID and LOGIN_ID are unique and not null, we need to ensure that these columns are explicitly set as UNIQUE and NOT NULL. Option A specifies a PRIMARY KEY on the combination of EMPLOYEE_ID and LOGIN_ID, which inherently means these columns will be unique and cannot be null. Option E declares the EMPLOYEE_ID and LOGIN_ID columns with NOT NULL constraints separately and also creates a UNIQUE constraint on them. These two options ensure the constraints required for the table are properly enforced.

Question 4 of 86

Which three tasks can be performed using SQL functions built into Oracle Database?

    Correct Answer: A, B, C

    SQL functions built into Oracle Database can indeed perform tasks such as displaying a date in a nondefault format, finding the number of characters in an expression, and substituting a character string in a text expression with a specified string. These tasks are handled using various built-in functions like TO_CHAR for date formatting, LENGTH for finding the number of characters, and REPLACE for substituting strings. Combining more than two columns or expressions into a single column in the output is not typically done using a single function, as the CONCAT function in Oracle is limited to two parameters, though it can be achieved using the concatenation operator ||.

Question 5 of 86

Which three SQL statements would display the value 1890.55 as $1, 890.55?

    Correct Answer: A, D

    The SQL TO_CHAR function can be used to format the number 1890.55 as $1,890.55 using specific formatting codes. The correct formats needed here include using '$' for the dollar sign, 'G' for the group separator, 'D' for the decimal separator, and '0' or '9' for digit placeholders. 'A' uses '$0G000D00', which correctly adds separators. 'D' uses '$99G999D00', which also correctly formats the number with group and decimal separators. 'E' uses '$99G999D99', which is another correct way to achieve the desired format. 'B' and 'C' are incorrect due to either the incorrect usage of 'V' or an invalid number format model in Oracle SQL.