oracle
![]() |
![]() |
![]() |
Título del Test:![]() oracle Descripción: Prova para Estudo |




Comentarios |
---|
NO HAY REGISTROS |
Wich three statements are true about Structure Query Language (SQL)? (Choose three.). It requires that data be contained in hierarchical data storage. It best supports relational databases. It provides idependence for logical data structures being manipuled from the underlying physical data storage. It is the only language that can be used for both relational and object-oriented databases. It guarantees atomicity, consistency, isolation, and durability (ACID) features. It is used to define encapsulation and polymorphism for a relational table. Examine the description of the PROMOTIONS table: You want to display the unique promotion costs in each promotion category. Wich two queries can be used? (choose two). SELECT DISTINCT promo_category || ' has ' || promo_cost AS COSTS FROM promotions ORDER BY 1;. SELECT DISTINCT promo_cost || ' in ' || DISTINCT promo_category FROM;promotions ORDER BY 1;. SELECT DISTINCT promo_category, promo_cost FROM promotions ORDER BY 1;. SELECT promo_category, DISTINCT promo_cost, FROM promotions ORDER BY 2;. SELECT promo_cost, promo_category FROM promotions ORDER BY 1;. Which three statements are true about multiple row subqueries? (choose three.). Two or more values are always returned from the subquery. They can contain HAVING caluses. They can contain GROUP BY caluses. They can return multiple columns. They cannot contain a subquery. Examine the description of the PRODUCTS table: TABELA Which three queries use valid expressions? (choose three). SELECT product_id, unit_price, S "Discount", unit_price + surcharge - discount FROM products;. SELECT product_id, (unit_price * 0.15 / (4.75 + 552.25)) FROM products;. SELECT product_id, (expiry_date - delivery_date) * 2 FROM products;. SELECT product_id, unit_price || 5 "Discount", unit_price + surcharge - discount FROM products;. SELECT product_id, expiry_date * 2 FROM products;. SELECT product_id, unit_price, unit_price + surcharge FROM products;. Wich three statements are true about sequences in a single instance Oracle database? (choose three). A sequence's unallocated cached values are lost if the instance shuts down. A sequence number that was allocated can be rolled back if a transaction fails. A sequence can only be dropped by a DBA. A sequence can issue duplicate values. Sequences can always have gaps. Two or more tables cannot have keys generated from the same sequence. Which two statements are true regardings indexes? (choose two.). A non-unique index can be altered to be unique. An update to a table can result in no updates to any of the table's indexes. The RECYCLE BIN never contains indexes. An upadate to a table can result in updates to any or all of table's indexes. A table belonging to one user cannot have an index that belongs to a different user. You execute the following commands: SQL > DEFINE hiredate='01-APR-2011' SQL > SELECT employee_id, first_name, salary FROM employees WHERE hire_date > '&hiredate' AND manager_id > &mgr_id; For which substitution variable are you prompted for the input?. None, because no input required. Both the substitution variables "hiredate" and "mgr_id". Only hiredate. Only 'mgr_id'. Wich three actions you perform on an existing table containing data? (choose three). Increase the width of a numeric column. Add new column an the table's first column. Define a default value that is automatically iserted into a column containing nulls. Change a DATE column containing data to a Number data type. Change the default value of a column. Add a new NOT NULL column with a DEFAULT value. Which task can be performed by unsing a single Data Manipulation Language (DML) statement?. Adding a column constraint while inserting a row into a table. Adding a column with a default value while inserting a row into a table. Removing all data only from a single column on which a unique constraint is defined. Removing all data only from a single column on which a primary key constraint is defined. Which two statements are true about Oracle synonyms? (choose two). Any user can create a public synonym. A synonym has an object number. A synonym can be created on an object in a package. All private synonym names must be unique in the database. A synonym can have a synonym. Which two statements are true about selecting related rows from two tables based on an Entity Relationship Diagram (ERD)? (choos two). Rows from unrelated tables cannot be joined. Relating data from a table with data from the same table is implemented with a self join. Implementing a relationship between two tables might require joining additional tables. Every realtionship between the two tables must be implemented in a join condition. An inner join realtes rows within the same table. Which two are true? (choose two). ADD_MONTHS adds a number of calendar months to a date. CEIL requires an argument which is a numeric data type. CEIL returns the largest interger less than or equal to a specified number. LAST_DAY returns the date of the last day of the current month only. LAST_DAY returns the date of the last day of the month for the date argumented passed to the function. LAST_DAY returns the date of the last day of the previous month only. You issue the following command to drop the PRODUCTS table: SQL > DROP TABLE products;. All data along with the table structure is deleted. A pending transaction in the session is commited. All indexes on the table remain but they are invalidated. All views and synonyms on the table remain but they are invalidated. All data in table is deleted but the table structure remains. In your session NLS_DATE_FORMAT is set to DD-MON-RR. Which two queries display the year as four digits? (choos two). SELECT TO_DATE(SYSDATE, 'RRRR-MM-DD') FROM DUAL;. SELECT TO_CHAR(SYSDATE, 'MM-DD-YYYY') FROM DUAL;. SELECT TO_DATE(ADD_MONTHS(SYSDATE,6), 'dd-non-yyyy') FROM DUAL;. SELECT TO_CHAR(ADD_MONTHS(SYSDATE,6)) FROM DUAL;. SELECT TO_CHAR(ADD_MONTHS(SYSDATE,6), 'dd-mon-yyyy') FROM DUAL;. SELECT TO_DATE(TO_CHAR(SYSDATE, 'MM-DD-YYYY'), 'MM-DD-YYYY') FROM DUAL;. Which three statements about roles are true? (choose three). Roles are asigned to users using the ALTER USER statement. Privileges are assigned to a role using the GRANT statement. A role is a named group of related privilages that can only be assigned to a user. A single user can be assigned multiple roles. Privileges are assigned to a role using the ALTER ROLE statement. Roles are assigned to roles using the ALTER ROLE statement. A single role can be assigned to multiple users. Which three statements are true about Oracle synonyms? (choos three). A synonym cannot be created fora PL/SQL package. A synonym can be available to all users. A SEQUENCE can have a synonym. Any user can drop a PUBLIC synonym. A synonym created by one user can refer to an object belonging to another user. Which two are about savepints? (choose two). A After issuing a savepoint, you can roll back to the savepoint name within the current transaction. They make uncommited updates visible to sessions owned by others users. You can commit updates done between two savepoints without commiting other updates in the current transaction. A ROLLBACK TO SAVEPOINT command issude before the start of a transaction results in an error. They make commited updates visible to other sessions owned by the same user. After issuing a savepoint, you cannot roll back the complete transaction. The INVOICE table has a QTY_SOLD column of data type NUMBER and an INVOICE_DATE column of data type DATE. INVOICE_DATE column of data type DATE NLS_DATE_FORMAT is set do DD-MON-RR Which two are true about data type conversions involving these columns in query expressions? (choose two). invoice_date='15-march-2019' : uses implicit conversion. qty_sold BETWEEN '101' ANA '110' : uses implicit conversion. invoice_date > '01-02-2019' : uses implicit conversion. qty_sold = '0554982' : requires explicit conversion. CONCAT(qty_sold, invoice_date) : requires explicit conversion. Which two are true? (choose two). CONCAT joins two character strings together. CONCAT joins two or more character strings together. FLOOR returns the largest positive interger lass than or equal to a spefified number. INSTR finds the offset within a character string, starting from position 0. INSTR finds the offset within a string of a single character only. FLOOR returns the largest interger less than or equal to a specified number. The ORDERS table has a column ORDER_RATE of data type DATE. The Default display format for a date is DD-MON-RR Which two WHERE conditions demonstrate the correct usage of conversion functions? (choose two). WHERE order_date > TO_DATE('JUL 10 2018', 'MON DD YYYY'). WHERE order_date > TO_DATE(ADD_MONTH(SYSDATE,6), 'MON DD YYYY'). WHERE order_date > IN (TO_DATE('Oct 21 2018', 'Mon DD YYYY'), TO_CHAR('Nov 21 2018', 'Mon DD YYYY')). WHERE order_date > TO_CHAR(ADD_MONTHS(SYSDATE,6), 'MON DD YYYY'). WHERE TO_CHAR(order_date. 'MON MM YYYY') = 'JAN 20 2019'. Which three statements are true about inner and outer joins? (choose three). A full outer join returns matched and unmatched rows. Outer joins can be used when there are multiple join conditions on two tables. A full outer join must use Oracle syntax. Outer joins can only be used between two tables per query. A left or right outer join returns only unmatched rows. An inner join returns matched rows. Examine thes SQL statements which execute succesfully: .CREATE TABLE emp (emp_no NUMBER(2)CONSTRAINT emp_emp_no_pk PRIMARY KEY, ename VARCHAR2(15), salary NUMBER (8,2), mgr_no NUMBER(2)); .ALTER TABLE emp ADD CONSTRAINT emp_mgr_fk FOREIGN KEY (mgr_no) REFERENCES emp(emp_no) ON DELETE SET NULL; .ALTER TABLE emp DISABLE CONSTRAINT emp_emp_no_pk CASCADE; .ALTER TABLE emp DISABLE CONSTRAINT emp_emp_no_pk Which two statements are true after execution? (choose two). The primary key constraint will be enabled and IMMEDIATE. The foreign key constraint will be enabled and DEFERRED. The primary key constraint will be enabled and DEFERRED. The foreign key constraint will be disabled. The foreign key constraint will be enabled and IMMEDIATE. Evaluate the following two queries: SQL > SELECT cust_last_name, cust_city FROM customers WHERE cust_credit_limit IN (1000,2000,3000); SQL > SELECT cust_last_name, cust_city FROM customers WHERE CUST_CREDIT_LIMIT = 1000 OR CUST_CREDIT_LIMIT = 2000 or cust_credit_limit = 3000; Which statement is true regarding the above two queries?. Performance would improve in query 2 only if there are null values in the CUST_CREDIT_LIMIT column. There would be no change in performance. Performance would be no degrade in query 2. Performance would be no improve in query 2. View the Exhibit and examine the description of the tables. You execute this SQL statement: INSERT INTO sales VALUES (23, 2300, SYSDATE, (SELECT channel_id FROM channels WHERE channel_desc = 'Direct Sales'), 12,1,500); Which three statements are true? (choose three). The statement will execute successfully and new row will be inserted into the SALES table. A product can have a different unit price at different times. The statement will fail if a row already exist in the SALES table for product 23. The statement will fail because a subquery may not be contained in a VALUES clause. A customer can exist in many countries. The SALES table has five foreign keys. Examine the description of the EMPLOYEES table: TABELA Which two queries return all rows for employeeswhose salary is greater than the average salary in their department? (choose two). SELECT * FROM employees WHERE salary > AVG (salary) OVER (PARTITION BY department_id);. SELECT * FROM employees e1 WHERE salary > (SELECT AVG (salary) FROM employees e2 WHERE e1.department_id=e2.department_id);. SELECT * FROM employees WHERE salary > (SELECT AVG (salary) FROM employees GROUP BY department_id);. SELECT * FROM employees WHERE salary > ANY (SELECT AVG (salary) FROM employees GROUP BY deparment_id). SELECT * FROM (SELECT e.*, AVG(salary) OVER (PARTITION BT department_id) avg_sal FROM employees e WHERE salary > avg_sal;. Examine this SQL statement: UPDATE orders o SET customer_name - (SELECT cust_last_name FROM customers WHERE customer_id = o.customer_id); Which two are true? (choose two). All existing rows in the ORDERS table are updated. The subquery is executed before the UPDATE statemente is executed. The subquery is not a correlated subquery. The subquery is executed for every update row in the ORDERS table. The UPDATE statement executes successfully even if the subquery selects multiples rows. Which three statements are true about an ORDER BY clause? (choos three). By default an ORDER BY clause sorts rows in descending order. An ORDER BY caluse will always precede a HAVING clause if both are used in the same top-level query. An ORDER BY clause always sorts NULL values last. By default an ORDER BY clause sorts rows in ascending order. An ORDER BY clause can perform a binary sort. An ORDER BY clause can perform a linguistic sort. Which two are true about the NVL, NVL2, and COALESCE functions? (choose two). NVL must have expressions of the same data type. NVL can any number of expressions in the list. NVL2 can have any number of expressions in the list. COALESCE stops evaluating the list os expressions when it finds the first non-null value. The first expression in NVL2 is never returned. COALESCE stops evaluating the list os expressions when it finds the first null value. Which two statements are true about TRUNCATE and DELETE? (choose two). DELETE can use a WHERE caluse to determine which row(s) should be removed. TRUNCATE can use a WHERE caluse to determine which row(s) sould be removed. TRUNCATE leaves any indexes on the table in an UNUSABLE state. The result of a TRUNCATE can be undone by issuing a ROLLBACK. The result of a DELETE can be undone by issuing a ROLLBACK. EXAMINE the description of EMPLOYEES table: TABLE Which three queries return all rows for which SALARY + COMMISSION is greater than 20000? (choose three). SELECT * FROM employees WHERE NVL2 (salary + commission, salary + commission, salary) >= 20000;. SELECT * FROM employees WHERE salary + NVL2 (commission, commission, 0) >= 20000;. SELECT * FROM employees WHERE NVL (salary + commission, 0) >= 20000;. SELECT * FROM employees WHERE salary + NULLIF (commission) >= 20000;. SELECT * FROM employees WHERE COALESCE (salary, commision) >= 20000;. SELECT * FROM employees WHERE salary + NVL (commision, 0 ) >= 20000. Examine this statement: SELECT 1 AS id, 'John' AS first_name, NULL AS commission FROM DUAL INTERSEC SELECT 1, 'John', NULL FROM DUAL ORDER BY 3; Whats is returned upon execution?. an error. 2 rows. 0 rows. 1 row. The STORES table has a column START_DATE of data type DATE, containing the date the row was inserted. You only want to display details of rows where START_DATE is within the last 25 months. Which WHERE clause can be used?. WHERE TO_NUMBER(start_date - SYSDATE) <= 25. WHERE MONTHS_BETWEEN(start_date, SYSDATE) <= 25. WHERE MONTHS_BETWEEN(SYSDATE, start_date) <= 25. WHERE ADD_MONTHS (start_date, 25) <= SYSDATE. Which two statements are true regarding the EXISTS operator used in the correlated subqueries? (choose two). The outer query stops evaluating the result set of the inner query when the first value is found. It is used to test whether the values retrieved by the inner query exist in the result of the outher query. It is used to test whether the values retrieved by the outher query exist in the result set of the inner query. The outer query continues evaluating the result set of the inner query until all the values in the result set are processed. Examine the description of EMPLOYEES table: The session time zone is the same as the database server. Which two statements will list only the employees who have been working with the company for more than five years? (choose two). SELECT employee_name FROM employees WHERE (SYSDATE - hire_date) / 12 > 5;. SELECT employee_name FROM employees WHERE (SYSTIMSSTAMF - hire date) / 12 > INTERVAL '5' YEAR;. SELECT employee_name FROM employees WHERE (CURRENT_DATE - hire_date) / 12 > 5. SELECT employee_name FROM employees WHERE (CURRENT_DATE - hire_date) / 365 >. SELECT employee_name FROM employees WHERE (SYSDATE - hire_date) / 365 > 5;. SELECT employee_name FROM employees WHERE (SYSTIMSSTAMF - hire date) / 365 > INTERVAL '1825' DAY;. Which two statements execute successfully? (choose two). SELECT TO_DATE('2019-DEC-25 15:30', 'YYYY-MON-DD' HH24:MI', 'NLS_DATE_LANGUAGE=AMERICAN') FROM DUAL;. SELECT TO_CHAR(TO_DATE('2019-DEC-25 03:30', 'YYYY-MON-DD HH12:MI')) FROM DUAL;. SELECT TO_DATE(TO_CHAR('2019-DEC-25 15:30', 'YYYY-MON-DD HH24:MI')) FROM DUAL;. SELECT TO_CHAR('2019-DEC-25 15:30', 'YYYY-MON-DD HH24:MI', 'NLS_DATE_LANGUAGE = 'AMERICAN') FROM DUAL;. Which three are true about scalar subquery expressions? (choose three). They can be nested. They cannot be used in the VALUES clause of an INSERT statement. A scalar subquery expression that returns zero rows evaluates to zero. They can be used as default values of columns in a CREATE TABLE statement. A sacalar subquery expression that returns zero rows evaluates to NULL. They cannot be used in GROUP BY clauses. Which two queries return the string HELLO! We're ready? (choose two). SELECT "HELLO! We're ready" FROM DUAL;. SELECT 'HELLO! We're ready' FROM DUAL;. SELECT q'!HELLO! We're ready!' FROM DUAL;. SELECT q'[HELLO! We're ready]' FROM DUAL;. SELECT 'HELLO! We\'re ready' ESCAPE '\' FROM DUAL;. In which three situations does a transaction complete?. When a PL\SQL anonymous block is executed. When a DELETE statement is execute. When a ROLLBACK command is executed. When a data definition language (DDL) statement is executed. When a TRUNCATE statement is executed after the pending transaction. An Oracle Database session has an uncommited transaction in progress which update 5000 rows in a table. In which three situations does the transaction complete thereby commiting the updates? (choose three). When a CREATE TABLE AS SELECT statement is issued in the same session but fails with a syntax error. When a DBA issues a successful SHUTDOWN TRANSACTIONAL statemen and the user then issues a COMMIT. When the session logs out successfully. When a CREATE INDEX statement is executed successfully in the same session. When a DBA issues a successful SHUTDOWN IMMEDIATE statement and the user then issues a COMMIT. When a COMMIT statement is issued by the same user from another session in the same database instace. Examine this query: SELECT employee_id, first_name, salary FROM employees WHERE hire_dete > '&1'; Which two methods should you use to prevent prompting for a hire date value when this query executed? (choose two). Use the DEFINE command before executing the query. Replace '&1' with '&&1' in the query. Use the UNDEFINE command before executing the query. Execute the SET VERIFY OFF command before executing the query. Execute the SET VERIFY ON command before executing the query. Store the query in a script and pass the substitution value to the script when executing it. Which two are true about using constraints? (choose two). NOT NULL can be specified at the column and at the table level. A table can have only one PRIMARY KEY and one FOREIGN KEY constraint. A FOREIGN KEY column in child table and the referenced PRIMARY KEY column in the parent table must have the same names. PRIMARY KEY and FOREIGN KEY constraints can be specified at the column and at the table level. A table can have multiple PRIMARY KEY and multiple FOREIGN KEY constraints. A table can have only one PRIMARY KEY but may have multiple FOREIGN KEY. The BOOKS_TRANSACTIONS table exist in your base. SQL> SELECT * FROM books_transactions ORDER BY 3; Whats is the outcome on execution?. The execution fails unless the numeral 3 in the ORDER BY clause is by a column name. Rows are displayed in the order that they are stored in the table only for the three rows with the lowest values in the sky. Rows are displayed in the order that they are stored in the table only for the first three rows. Rows are displayed sorted in ascending order of the values in the third column in the table. Which three statements are true about the DESCRIBE command? (choose three). It can be used from SQL Developer. It displays the PRIMARY KEY constraint for any column or columns that have that constraint. It displays all constraints that are defined for each column. It displays the NOT NULL constraint for any columns that have that constraint. It can be used only from SQL* Plus. It can be used to display the structure of an existing view. You need to allow user ANDREW to: 1. Modify the TITLE and ADDRESS columns of your CUSTOMERS table 2. GRANT that permission to others users Which statement will do this? (choose one). GRANT UPDATE ON customers.title, customes.address TO andrew;. GRANT UPDATE (title,address) ON customers TO andrew;. GRANT UPDATE (title,address) ON customers TO andrew WITH GRANT OPTION;. GRANT UPDATE ON customers.title, customes.address TO andrew WITH ADMIN OPTION;. GRANT UPDATE ON customers.title, customes.address TO andrew WITH GRANT OPTION;. GRANT UPDATE (title, address) ON customers TO andrew WITH ADMIN OPTION;. Which two statements are true about dropping views? (choose two). The creator of a view to be dropped must have the DROP ANY VIEW privilege. Data selected by view's defining query is deleted from its underlying tables when the view is dropped. Views referencing a dropped view become invalid. Read only views cannot be dropepd. CASCADE CONSTRAINTS must be specified when referential integrity constraints on other objects refer to primary or unique keys in teh view to be dropped. Examine this estatement: CREATE TABLE orders (serial_no NUMBER UNIQUE, order_id NUMBER PRIMARY KEY, order_date DATE NOT NULL status VARCHAR2(10) CHECK (status IN ('CREDIT', 'CASH')), product_id NUMBER REFERENCES products (product_id), order_total NUMBER); On which two columns of the table will an index be created automatically? (choose two). ORDER_ID. ORDER_TOTAL. ORDER_DATE. PRODUCT_ID. STATUS. SERIAL_NO. You own table DEPARTMENTS, reference by views, indexes, and synonyms. Examine this command which executes successfully: DROP TABLE department PURGE; Which three statements are true? (choose three). It will remove that DEPARTMENTS table from the database. It will drop all indexes on the DEPARTMENTS table. It will remove all views that are based on the DEPARTMENTS table. It will remove all synonyms for the DEPARTMENTS table. Neither can it be rolled back nor can the DEPARTMENTS table be recovered. It will delete all rows from the DEPARTMENTS table, but retain the empty table. Examine the description of the PRODUCTS table which contains data: TABELA Which two are true? (choose two). The PROD_NAME column cannot have a DEFAULT clause added to it. The EXPIRY_DATE column cannot be dropped. The EXPIRY_DATE column data type can be changed to TIMESTAMP. The PROD_ID column can be renamed. The PROD_ID column data type can be changed to VARCHAR2(2). Examine the partial query: SELECT ch.channel_type, t.month, co.country_code, SUM(s.amounth_sold) AS SALES FROM sales s JOIN times t ON s.time = t.time_id JOIN cahnnels ch ON s.channel_id = ch.channel_id JOIN countries co ON s.country_id = co.country_id WHERE ch.channel_type IN ('Direct Sales', 'Intranet') AND t.month IN ('2000-09', '2000-10') AND co.country_code IN ('GB', 'US';) Which GROUP BY caluse must be added so the query returns the results shown?. GROUP BY ch.channel_type, ROLLUP (t.month, co.country_code);. GROUP BY ch.channel_type, t.month, ROLLUP (co.country_code);. GROUP BY CUBE (ch.channel_type, t.month, co.country_code);. GROUP BY ch.channel_type, t.month, co.country_code;. Which three statements are true about Structure Query Language (SQL)? (choose three). It requires that data be contained in hierarchical data storage. It best supports relational databases. It provides idependence for logical data structures being manipuled from the underlying physical data storage. It is the only language that can be used for both relational and objected-oriented databases. It guarantees automicity, consistency, isolation, and durability (ACID) features. It is used to define encapsulation and polymorphism for a relational table. Examine this query: SELECT SUBSTR (SYSDATE,1,5) "Result" FROM DUAL; Which statement is true?. It fails unless the expression is modified to SUBSTR(TO_CHAR(SYSDATE),1,5). It fails unless the expression is modified to SUBSTR(TO_CHAR(TRUNC(SYSDATE), 1,5. It fails unless the expression is modified to TO_CHAR(SUSTR(SYSDATE), 1,5)). It executes successfully with an implicit data type conversion. Examine the description of the EMPLOYEES table: TABELA Which statement will execute successfully, returning distinct employees with non-null first names?. SELECT first_name, DISTINCT last_name FROM employees WHERE first_name <> NULL;. SELECT first_name, DISTINCT last_name FROM employees WHERE first_name IS NOT NULL;. SELECT DISTINCT * FROM emplyees WHERE first_name IS NOT FULL;. SELECT DISTINCT * FROM emplyees WHERE first_name <> NULL;. Which two statements are true about Oracle synonyms? (choose two). Any user can create a PUBLIC synonym. A synonym has an object number. All private synonym names must be unique in the database. A synonym can be created on an object in a package. A synonym can have a synonym. You currently have an active transaction in your session and have been granted SELECT access to V$TRANSACTION. Executing: SELECT xid, status FROM v$transaction; in your session returns: In which three situations will re-executing this query still return a row but with a different XID, indicating a new transaction has started? (choose three). after successfully executing a CREATE TABLE statement followed by a CREATE INDEX statement. after successfully executing a TRUNCATE statetement followed by a DML statement. after successfully executing a DML statement following a failed DML statement. after successfully executing a CREATE TABLE AS SELECT statement followed by a SELECT FOR UPDATE statement. after successfully executing a COMMIT or ROLLBACK followed by a DML statement. after successfully executing a COMMIT or ROLLBACK followed by a SELECT statement. Examine these two queries and their output: SELECT emame,job,deptno FROM emp ORDER BY deptno; SELECT deptno, dname FROM dept; Now examine this query: SELECT ename, daname FROM emp CROSS JOIN Dept WHERE job='MANAGER' AND Dept.deptno IN (10,20); How many rows will be displayed?. 64. 6. 3. 12. Which is true about the ROUND, TRUNC and MOD functions?. TRUNC(MOD(25,3),-1) is invalid. ROUND(MOD(25,3),-1) is invalid. ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid and give the same result. ROUND(MOD(25,3),-1) and TRUNC(MOD(25,3),-1) are both valid but give different results. Examine the ORDERS_ITEMS table: TABELA Which two queries return rows where QUANTITY is a multiple of ten? (choose two). SELECT * FROM order_items WHERE quantity / 10 - TRUNC(quantity);. SELECT * FROM order_items WHERE MOD (quantity, 10) - 0;. SELECT * FROM order_items WHERE FLOOR (quantity / 10) = TRUNC(quantity / 10);. SELECT * FROM order_items WHERE quantity = TRUNC(quantity, -1);. SELECT * FROM order_items WHERE quantity = ROUND(quantity, 1);. You want to return the current date and time from the user session, with a data type of TIMESTAMP WITH TIME ZONE. Which function wil do this?. SYSDATE. CURRENT_TIMESTAMP. LOCALTIMESTAMP. CURRENT_DATE. Which two are true about transactions in the Oracle Database? (choose two). DML statements always start new transactions. DDL statements automatically commit only data dictionary updates caused by executing the DDL. A session can see uncommited updates made by the same user in a different session. A DDL Statement issued by a session with an uncommited transaction automatically commits that transaction. An uncommited transaction in automatically commited when the user exits SQL*PLUS. Which two statements are true about indexes and their administration in a Oracle database? (choose two). A new index can be created or an existing one recused when a primary key constraint is created. An INVISIBLE index is maintained by DML operations on the underlying table. If a query filters on an indexed column, the index will always be accessed during execution of the query. A DROP INDEX statement always prevents updates to the table during the drop operation. The same table column cannot be a part of a unique and non-unique index. You have been tasked to create a table for a banking application. One of the columns must meet three requirements: 1) Be stored in a format supporting date arithmetic without using conversion functions 2) Store a loan period of up to 10 years 3) Be used for calculating interest for the number of days the loan remains unpaid Which data type should you use?. INTERVAL YEAR TO MONTH. TIMESTAMP WITH TIMEZONE. INTERVAL DAY TO SECOND. TIMESTAMP WITH LOCAL TIMEZONE. TIMESTAMP. Examine the description of the MEMBERS table: TABELA Examine the partial query: SELECT city, last_name AS 1name FROM members...; You want to display all cities taht contain the string AN. The cities must be returnded in ascending order, with the last names further sorted in descending order. Which two clauses must you add to the query? (choose two). ORDER BY 1,2. ORDER BY 1, lname DESC. WHERE city IN ('%AN%'). WHERE city = '%AN%'. WHERE city LIKE '%AN%'. ORDER BY last_name DESC, city ASC. Which two are true about queries using set operators such as UNION? (choose two). In query containing multiple set operators, INTERSECT always takes precedence over UNION and UNION ALL. An expression in the first SELECT list must have a column alias for the expression. All set operators are valid on clomns of all data types. CHAR columns of different lengths used with a set operator return a VARCHAR2 whose length equals the longest char value. Queries using set operators do not perform implicit conversion across data type groups (e.g character, numeric). Which three statements are true regarding subqueries? (choose three). Multiple columns or expressions can be compared between the main query and subquery. Subqueries can contain ORDER BY but not the GROUP BY clause. Main query and subquery can get data from different tables. Subqueries can contain GROUP BY an ORDER BY clauses. Main query and subquery must get data from the same tables. Only one column or expression can be compared between the main query and subquery. Examine this incomplete query: SELECT DATE '2019-01-01' + FROM DUAL; Which three clauses can replace to add 12 hours to the date? (choose three). INTERVAL '0.5 DAY'. INTERVAL '720' MINUTE. INTERVAL '11:60' HOUR TO MINUTE. INTERVAL '12:00' HOUR TO SECOND. INTERVAL '0 12' DAY TO HOUR. INTERVAL '12' HOUR. Examine this partial command: CREATE TABLE cust(cust_id NUMBER(2), credit_limit NUMER (10)) ORGANIZATION EXTERNAL Which two clauses are required for this command to execute successfully? (choose two). the acess driver TYPE clause. the DAFULT DIRECTORY clause. the REJECT LIMIT clause. the LOCATION clause. the ACCESS PARAMETERS clause. Which two are true the data directory? (choose two). The data dictionary is constantly updated to reflect changes to databases objects, permissions, and data. All user actions are recorded in the data dictionary. All users have permissions to access all information in the data dictionary by default. The SYS user owns all base tables and user-accessible views in the data dictionary. Base tables in the data dictionary have the prefix DBA_. Examine this business rule: Each student can work on multiple projects and each project can have multiple students. You must desgin an Entity Relationship (ER) model for optimal data storage and allow for generating reports in this format: STUDENT_ID FIRST_NAME LAST_NAME PROJECT_ ID PROJECT_NAME PROJECT_TASK Which two statements are true? (choosw two). PROJECT_ID must be the primary key in the PROJECTS entity and foreing key in the STUDENTS entity. STUDENT_ID must be the primary key in the STUDENTS entity and foreign key in the projects entity. An associate table must be created with a composite key of STUDENT_ID and PROJECT_ID, which is the foreign key linked to the students and projects entities. The ER must have a many-to-many relationship between the STUDENTS ane PROJECTS entities that must be resolved into one-to-many relationships. The ER must have a one-to-many relationship between the STUDENTS and PROJECTS entities. Which two are true about unused columns? (choose two). A query can return data from unused columns, but no DML is possible on those columns. Unused columns retain their data until they are dropepd. Once a column has been set to unused, a new column with the same name can be added to the table. The DESCRIBE command displays unused columns. A primary key column cannot be set to unused. A foreign key column cannot be set to unused. Which set of commands will prompt only once for the name of the table to use in the query?. PROMPT Enter table name &x - SELECT employee_id FROM &x WHERE last_name = 'King';. DEFINE x = 'employees' PROMPT Enter table name &x - SELECT employee_id FROM &x WHERE last_name = 'King';. PROMPT Enter table name &x - SELECT employee_id FROM &&x WHERE last_name = 'King';. PROMPT Enter table name &&x - SELECT employee_id FROM &x WHERE last_name = 'King';. Examine the data in the ORDERS table: TABELA 1 | TABELA 2 Examine this query: SELECT order_id, order_date FROM orders INTERSECT SELECT order_id, order_date FROM invoices;. 2. 1. 3. 5 01-MAR-2019. 3 01-JAN-2015. 4 01-FEB-2015. Which two are true about the precedence of operators and conditions? (choose two). || has higer order of precedence than + (addition). + (addition) has higher order of precedence than* (multiplication). Not has a higer order of precedence than AND and OR in a condition. AND and OR have the same order od precedence in a condition. Operators are evalueted before conditions. Examine the description of the PRODUCT_STATUS table: The STATUS calumn contains the values IN STOCK or OUT OF STOCK for each row. Which two queries will execute successfully?. SELECT prod_id || q'''s not avaible" FROM product_status WHERE status = 'OUT OF STOCK';. SELECT prod_id || q'('s not available)' 'CURRENT AVAILABILITY' FROM product_status WHERE status = 'OUT OF STOCK';. SELECT prod_id q's not available" FROM product_status WHERE status = 'OUT OF STOCK';. SELECT prod_id "CURRENT AVAILABILITY" || q' ('s not available)' FROM product_status WHERE status = 'OUT OF STOCK';. SELECT prod_id || q'('s not available)' FROM product_status WHERE status = 'OUT OF STOCK';. SELECT prod_id || q'('s not available)' "CURRENT AVAILABILITY" FROM product status WHRE status = 'OUT OF STOCK';. Which three statements are true about a self join? (choose three). It must be an equijoin. The ON clause must be used. It must be an inner join. It can be an outer join. The ON clause can be used. The query must use two different aliases for the table. In your session, the NLS_DATE_FORMAT is DD-MM-YYY There are 86400 seconds in a day. Examine this result: DATE -------------- 02-JAN-2020 Which statement return this?. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '4' DAY - INTERVAL '120' SECOND, 'DD-MON-YYYY') AS "date"FROM DUAL;. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '3' MONTH + INTERVAL '7' DAY - INTERVAL '360' SECOND, 'DD-MON-YYYY') AS "date" FROM DUAL;. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '5' DAY - INTERVAL '120' SECOND, 'DD-MON-YYYY') AS "date"FROM DUAL;. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '5' DAY - INTERVAL '86410' SECOND, 'DD-MON-YYYY') AS "date"FROM DUAL;. SELECT TO_CHAR(TO_DATE('29-10-2019') + INTERVAL '2' MONTH + INTERVAL '6' DAY - INTERVAL '120' SECOND, 'DD-MON-YYYY') AS "date"FROM DUAL;. Which two statements are true about INTERVAL data types?. INTERVAL YEAR TO MONTH columns only support monthly intervasl within a single year. INTERVAL DAY TO SECOND columns support fractions of seconds. INTERVAL YEAR TO MONTH columns support yearly intervals. The YEAR field in an INTERVAL YEAR TO MONTH column must be a positive value. INTERVAL YEAR TO MONTH columns only support monthly intervals within a range of years. The value in an INTERVAL DAY TO SECOND column can be copied into an INTERVAL YEAR TO MONTH column. Which two statements are true about the WHERE and HAVING clauses in a SELECT statement? (choose two). WHERE and HAVING clauses can be used in the same statement only if applied to different table columns. The WHERE clause can be used to exclude rows after dividing them into groups. The HAVING clause can be used with aggregating functions in subqueries. The WHERE clause can be used to exclude rows before dividing them into groups. Aggregating functions and columns used in HAVING clauses must be specified in the SELECT list of a query. Examine the data in the INVOICES table: Examine the data in the CURRENCIES table: TABELA TABELA Which query returns the currencies in CURRENCIES that are not present in INVOICES?. SELECT * FROM currencies WHERE NNOT EXISTS (SELECT NULL FROM invoices WHERE currency_code = currency_code);. SELECT*FROM currencies MINUS SELECT * FROM invoices;. SELECT currency_code FROM currencies MINUS SELECT currency_code FROME invoices;. SELECT currency_code FROM currencies INTERSECT SELECT currency_code FROM invoices;. Which three statements are true about multiple-row subqueries?. They can contain a subquery within a subquery. They can return multiple columns as well as rows. They cannot contain a subquery within a subquery. They can return only one column but multiple rows. They can contain group functions and GROUP BY and HAVING clauses. They can contain group functions and the GROUP BY clause, but not the HAVING clause. Examine the description of the CUSTOMERS table: TABELA You need to display last names and credit limits of all customers whose last names starts with A or B in lower or upper case, ande whose credit limiti is below 1000. Examine this partial query: SELECT cust_last_name, cust_credit_limit FROM customers Which two WHERE conditions give the required result?. WHERE UPPER (cust_last_name) IN ('AX', 'B%') AND cust_credit_limit < 1000;. WHERE (UPPER(cust_last_name) LIKE 'A%' OR UPPER (cust_last_name) LIKE 'B%') AND ROUND (cust_credit_limit) < 1000;. WHERE UPPER (cust_last_name) BETWEEN UPPER ('A%' AND 'B%') AND ROUND (cust_credit_limit) < 1000;. WHERE (INITCAP(cust_last_name) LIKE 'A%' OR INITCAP (cust_last_name) LIKE 'B%' AND cust_credit_limit < 1000;. WHERE (UPPER(cust_last_name) LIKE INITCAP('A') OR UPPER(cust_last_name) LIKE INITCAP ('B')) AND ROUND (cust_credit_limit) < ROUND (1000);. Which two are true about global temporary tables? (choose two). Indexes can be created on them. Backup and recovery operations are available for these tables. Their data is always stored in the default temporary tablespace of the user who created them. If the ON COMMIT clause is transaction-specific, all rows in the table are deleted after each COMMIT OR ROLLBACK. They can be created only by a user with the DBA role, but can be accessed by all users who can create a session. If the ON COMMIT clause is session-specific, the table is dropped when the session is terminated. The SALES table has columns PROD_ID and QUANTITY_SOLD of data type NUMBER. Which two queries execute successfully? (choose two). SELECT prod_id FROM sales WHERE quantity_sold > 55000 AND COUNT (*) > 10 GROUP BY COUNT (*) > 10;. SELECT prod_id FROM sales WHERE quantity_sold > 55000 GROUP BY prod_id HAVING COUNT (*) > 10;. SELECT COUNT (prod_id) FROM sales GROUP BY prod_id WHERE quantity_sold > 55000;. SELECT prod_id FROM sales WHERE quantity_sold > 55000 AND COUNT (*) > 10 GROUP BY prod_id HAVING COUNT (*) > 10;. SELECT COUNT (prod_id) FROM sales WHERE quantity_sold > 55000 GROUP BY prod_id;. Which two are true about multitable INSERT statements?. The conditional INSERT FIRST statement always inserts a row into a single table. The unconditional INSERT ALL statement must have the same number of columns in both the source ant targets tables. They can transform a row from a source table into multiple rows in a target table. The conditional INSERT ALL statement inserts rows into a single table by aggregating source rows. They always use subqueries. Which three are true about privileges? (choose three). A combination of object and system privileges can be granted to a role. All types of schema objects have associated object privileges. Schema owners can grant object privileges on objects in their schema to any other user role. Only users with the DBA role can create roles. Only users with the GRANT ANY PRIVILEGE privilege can grant an revoke system privilieges from other users. Object privileges granted on a table automatically apply to all synonyms for that table. Which three statements are true about single-row functions? (choose three). They return a single result row per table. They can be nested to any level. They can accept only one argument. The argument can be a column name, variable, literal or an expression. They can be used only in the WHERE caluse of a SELECT statement. The data type returned can be different from the data type of the argument. Which normal form is a table in if it has no multi-valued attributed and no partial dependencies?. Second normal form. First normal form. Third normal form. Fourth normal form. Which statement is true about using function in WHERE and HAVING?. Using aggregate functions in the WHERE clause requires a subquery. Using aggregate functions in the HAVING clause requires a subquery. Using single-row functions in the WHERE clause requires a subquery. Using single-row functions in the HAVING clause requires a subquery. Examine the description of the EMPLOYESS table: Which two statements will insert a row into the EMPLOYEES table? (choose two). INSERT INTO employees VALUES (101, 'John', 'Smith', 12000, SYSDATE);. INSERT INTO employees VALUES (101, 'John', 'Smith', 10, 12000, SYSDATE);. INSERT INTO employees (employee_id, salary, first_name, hiredate, last_name) VALUES (101, 12100, 'John', SYSDATE, 'Smith');. INSERT INTO employees (employee_id, first_name, last_name, salary, hiresate) VALUES ((SELECT 101, 'John', 'Smith', 12000, SYSDATE FROM Dual));. INSERT INTO employees SELECT 101, 'John', 'Smith', 12000, (SELECT SYSDATE FROM dual), 10 FROM dual;. INSERT INTO employees VALUES (101,'John', ' ', 12000, SYSDATE, 10);. Which two statements are true about *_TABLES views? (choose two.). USER_TABLES displays all tables owned by the current user. You must have ANY TABLE system privileges, or be granted object privileges on the table, to view a table in USER_TABLES. All users can query DBA_TABLES successfully.. You must have ANY TABLE system privileges, or be granted object privileges on the table, to view a table in DBA_TABLES. ALL_TABLES displays all tables owned by the current user. You must have ANY TABLE system privileges, or be granted object privileges on the table, on the view a table in ALL_TABLES. You execute these commands: CREATE TABLE customers (customer_id INTERGER, customer_name VARCAHR2 (20)); INSERT INTO customer VALUES (1, 'Custome 1'); SAVEPOINT post_insert; INSERT INTO customers VALUES (2, Customer 2'); <TODO> SELECT COUNT(*) FROM customers; Which two, used idependently, can replace so the query returns 1?. ROLLBACK;. ROLLBACK TO SAVEPOINT post_insert;. ROLLBACK TO post_insert;. COMMIT;. COMMIT TO SAVEPOINT post_insert;. Which three can be performed using SQL functions built into Oracle Database?. Displaying a date in a nondefault format. Finding the number of characters in an expression. Substituing a character string in a text expression with a specified string. Combining more than two columns or expressions into single column in the output. Examine this command: TRUNCATE TABLE test; Table truncate. Which two are true? (choose two). The structure of the TEST table is removed. All the indexes on the TEST table are dropped. All the constraints on the TEST table are dropped. Removed rows can not be recovered using the ROLLBACK command. All the rows in the TEST table are removed. Which two statements are true about conditional INSERT ALL? (choose two). Each row returned by the subquery can be inserted into only a single target table. A single WHEN condition can be used for multiple INTO clauses. Each WHEN condition is tested for each row returned by the subquery. It cannot have an ELSE clause. The total number of rows inserted in always equal to the number of rows returned by the subquery. Examine the description of the EMPLOYEES table: TABELA Which two queries return the highest salary in the table?. SELECT MAX (salary) FROM employees - GROUP BY department_id - HAVING MAX (salary) = MAX(MAX(salary));. SELECT MAX (salary) FROM employees - GROUP BY department_id;. SELECT department_id, MAX(salary) FROM employees - GROUP BY departiment_id;. SELECT MAX (salary) FROM employees;. SELECT MAX(MAX(salary)) FROM employees - GROUP BY department_id;. You issued this command: DROP TABLE hr.employees; Which three statements are true? (choose three). Sequences used to populate columns in the HR.EMPLOYEES table are dropped. Synonyms for HR.EMPLOYEES are dropped. Views referencing HR.EMPLOYEES are dropped. All constraints defined on HR.EMPLOYEES are dropped. The HR.EMPLOYEES table may be moved to the recycle bin. All indexes defined on HR.EMPLOYEES are dropped. Which two statements are true about the COUNT function? (choose two). COUNT(*) returns the number of rows in a table including duplicate rows and rows containing NULLs in any column. It can only be used for NUMBER data types. COUNT(DISTINCT inv_amt) returns the number of rows excluding rows containing duplicates and NULLs in the INV_AMT column. COUNT(inv_amt) returns the number of rows in a table including rows with NULL in the INV_AMT column. A SELECT statement using the COUNT function with a DISTINCT keyword cannot have a WHERE clause. Examine this data in the EMPLOYEES table: TABELA Which statement will execute successfully?. SELECT dept_id, INSTR (last_name, 'A'), SUM (salary) FROM employees GROUP BY dept_id;. SELECT dept_id, STDDEV(last_name), SUM (salary) FROM employees GROUP BY dept_id;. SELECT dept_id, LENGTH(last_name), SUM (salary) FROM employees GROUP BY dept_id;. SELECT dept_id, MAX(last_name), SUM (salary) FROM employees GROUP BY dept_id;. Which statement executes successfully?. SELECT TO_DATE(TO_NUMBER(INTERVAL '800' SECOND)) FROM DUAL;. SELECT TO_NUMBER(INTERVAL'800' SECOND, 'HH24:MM') FROM DUAL;. SELECT TO_DATE(INTERVAL'800' SECOND, 'HH24:MM') FROM DUAL;. SELECT TO_NUMBER(TO_DATE(INTERVAL '800' SECOND)) FROM DUAL;. SELECT TO_CHAR(INTERVAL'800' SECOND, 'HH24:MM') FROM DUAL;. The EMPLOYEES table contains columns EMP_ID of data type NUMBER and HIRE_DATE of data type DATE. You want to display the date of the first Monday after the completion of six months since hiring. The NLS_TERRITORY parameter is set to AMERICA in the session and, therefore, Sunday is the first day of the week. Which query can be used?. SELECT emp_id, ADD_MONTHS(hire_date, 6), NEXT_DAY('MONDAY') FROM employees;. SELECT emp_id, NEXT_DAY(ADD_MONTHS(hire_date, 6), 1) FROM employees;. SELECT emp_id, NEXT_DAY(MONTHS_BETWEEN(hire_date, SYSDATE),6) FROM employees;. SELECT emp_id, NEXT_DAY(ADD_MONTHS(hire_date, 6), 'MONDAY') FROM employees;. Examine the description of the EMPLOYEES table: TABELA NLS_DATE_FORMAT is set to DD-MON-YY. Which query requires explicity data type conversion?. SELECT join_date FROM employees WHERE join_date > '10-02-2018';. SELECT join_date || ' ' || salary FROM emplyees;. SELECT salary + '120.50' FROM employees;. SELECT join_date + '20' FROM employees;. SELECT SUBSTR (join_date, 1,2) -1'. |