0

databases Online Quiz - 194

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

In NPS, SPU means Snippet processing Unit

  1. True

  2. False


Correct Option: A

The database administrator of your company created a public synonum called HR for the HUMAN_RESOURCES table of the GENERAL schema, because many users frequently use this table. As a user of the database, you created a table called HR in your schema. What happens when you execute this query?

  1. You obtain the results retrieved from the public synonym HR created by the DBA.

  2. You obtain the results retrieved from the HR table that belongs to you schema.

  3. You get an error message because you cannot retrieve from a table that has the same name as a public synonym.

  4. You obtain the results retrieved from both the publich synonym HR and the HR table that belongs to your schema, as a Cartesian product.


Correct Option: B

Which two statements about views are true?

  1. A view can be created as read only.

  2. A view can be created as a join of two or more tables.

  3. A view can not have an ORDER BY clause in the SELECT statement.

  4. A view can not be created with a GROUP BY clause in the SELECT statement.


Correct Option: A,B

Which three statements about SubQueries are true?

  1. A main query can have mroe than one subquery.

  2. A subquery can have more than one main query.

  3. The sub query and main query must retrieve data from the same table.

  4. The subquery and main query can retrieve data from different tables.

  5. Only one column or expression can be compared between the subquery and main query.


Correct Option: A,D,E

For which action can you use the TO_DATE function?

  1. Convert any date literal to a date.

  2. Convert any numeric literal to a date.

  3. Convert any character literal to a date.

  4. Convert any date literal to a character literal

  5. Format '10-JAN-99' to 'January 10 1999'.


Correct Option: C

What is true about sequences?

  1. The start value of the sequence is always 1.

  2. The sequence always increments by 1.

  3. The minimum value of an ascending sequence defaults to 1.

  4. The maximum value of descending sequence defaults to 1.


Correct Option: C
  1. An error is generated.

  2. A public synonym is created for employees table.

  3. You create an alternative name for the employees table of HR schema in HR schema

  4. You create an alternative name for the employees table of HR schema in SCOTT schema


Correct Option: D

Examine the structure of the EMPLOYEES table: EMPLOYEE_ID NUMBER Primary Key FIRST_NAME VARCHAR2(25) LAST_NAME VARCHAR2(25) Which three statements inserts a row into the table? (Choose three)

  1. INSERT INTO employees VALUES (NULL, 'JOHN','Smith');

  2. . INSERT INTO employees( first_name, last_name) VALUES ('JOHN','Smith');

  3. INSERT INTO employees VALUES ('1000','JOHN','NULL');

  4. INSERT INTO employees(first_name,last_name, employee_id) VALUES ('1000, 'john','Smith');

  5. . INSERT INTO employees (employee_id) VALUES (1000);

  6. INSERT INTO employees (employee_id, first_name, last_name) VALUES ( 1000, 'john',");


Correct Option: C,E,F
  1. GRANT select, insert, update ON student_grades TO manager

  2. GRANT select, insert, update ON student_grades TO ROLE manager

  3. GRANT select, insert, modify ON student_grades TO manager WITH GRANT OPTION;

  4. GRANT select, insert, update ON student_grades TO manager WITH GRANT OPTION;


Correct Option: D
  1. You can use aggregate functions in any caluse of the SELECT statement.

  2. You can user aggregate funcitons only in column list of select clause and where clause of select statement.

  3. You can mix single row functions with aggregate functions in the column list of a SELECT statement by grouping on single row columns.

  4. You can pass column names, expressions, constants, or functions as parameter to an aggregate function.


Correct Option: A,D

Which one is a system privilege?

  1. SELECT

  2. DELETE

  3. EXECUTE

  4. ALTER TABLE

  5. CREATE TABLE


Correct Option: E

The database administrator of your company created a public synonym called HR for the HUMAN_RESOURCES table of the GENERAL schema, because many users frequently use this table. As a user of the database, you created a table called HR in your schema. What happens when you execute this query? SELECT * FROM HR;

  1. You obtain the results retrieved from the public synonym HR created by the database administrator.

  2. You obtain the results retrieved from the HR table that belongs to your schema

  3. You get an error message because you cannot retrieve from a table that has the same name as a public synonym

  4. You obtain the results retrieved from both the public synonym HR and the HR table that belongs to your schema, as a Cartesian product.


Correct Option: B

Evaluate the SQL statement: 1 SELECT a.emp_name, a.sal, a.dept_id, b.maxsal 2 FROM employees a, 3 (SELECT dept_id, MAX(sal) maxsal 4. FROM employees 5 GROUP BY dept_id) b 6 WHERE a.dept_id = b.dept_id 7 AND a. asl < b. maxsal; What is the result of the statement?

  1. The statement produces an error at line 1.

  2. The statement produces an error at line 3

  3. The statement produces an error at line 6.

  4. The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all departments that pay less salary then the maximum salary paid in the company

  5. The statement returns the employee name, salary, department ID, and maximum salary earned in the department of the employee for all employees who earn less than the maximum salary in their department.


Correct Option: E

The EMP table contains these columns: LAST NAME VARCHAR2(25) SALARY NUMBER(6,2) DEPARTMENT_ID NUMBER(6) You need to display the employees who have not been assigned to any department. You write the SELECT statement: SELECT LAST_NAME, SALARY, DEPARTMENT_ID FROM EMP WHERE DEPARMENT_ID = NULL; What is true about this SQL statement?

  1. The SQL statement displays the desired results

  2. The column in the WHERE clause should be changed to display the desired results

  3. The operator in the WHERE clause should be changed to display the desired results

  4. The WHERE clause should be changed to use an outer join to display the desired results


Correct Option: C

For which two constraints does the Oracle Server implicitly create a unique index? (Choose two.)

  1. NOT NULL

  2. PRIMARY KEY

  3. FOREIGN KEY

  4. CHECK

  5. UNIQUE


Correct Option: B,E

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

  1. A single row subquery can retrieve data from only one table

  2. A SQL query statement cannot display data from table B that is referred to in its subquery, unless table B is included in the main query's FROM clause.

  3. A SQL query statement can display data from table B that is referred to in its subquery, without including table B in its own FROM clause.

  4. A single row subquery can retrieve data from more than one table

  5. A single row subquery cannot be used in a condition where the LIKE operator is used for comparison

  6. A multiple-row subquery cannot be used in a condition where the LIKE operator is used for comparison.


Correct Option: B,D

CREATE TABLE dept(deptno NUMBER(2),dname VARCNAR2(14),1oc VARCNAR2 (13));ROLLBACK;DESCRIBE DEPTWhat is true about the set?

  1. The DESCRIBE DEPT statement displays the structure of the DEPT table

  2. The ROLLBACK statement frees the storage space occupies by the DEPT table

  3. The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist

  4. The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is a COMMIT statement introduced before the ROLLBACK statement.


Correct Option: A

You added a PHONE_NUMBER column of NUMBER data type to an existing EMPLOYEES table. The EMPLOYEES table already contains records of 100 employees. Now, you want to enter the phone numbers of each of the 100 employees into the table. Some of the employees may not have a phone number available. Which data manipulation operation do you perform?

  1. MERGE

  2. INSERT

  3. UPDATE

  4. ADD

  5. ENTER


Correct Option: C
  1. Both tables have NULL values

  2. You want all unmatched data from one table

  3. You want all matched data from both tables

  4. You want all unmatched data from both tables

  5. One of the tables has more data than the other

  6. You want all matched and unmatched data from only one table


Correct Option: D

Which type of record is the fastest to access?

  1. Index Sequential

  2. Via Set

  3. Calc

  4. Direct


Correct Option: D
- Hide questions