0

databases Online Quiz - 32

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

Which are DML statements? (Choose all that apply.)

  1. COMMIT

  2. MERGE

  3. UPDATE

  4. DELETE

  5. CREATE

  6. DROP


Correct Option: B,C,D

Which four are correct guidelines for naming database tables? (Choose four.)

  1. Must begin with either a number or a letter

  2. Must be 1-30 characters long

  3. Should not be an Oracle Server reserved word

  4. Must contain only A-Z, a-z, 0-9, _, *, and #

  5. Must contain only A-Z, a-z, 0-9, _, $, and #

  6. Must begin with a letter


Correct Option: B,C,E,F

Which SQL statement generates the alias Annual Salary for the calculated column SALARY*12?

  1. SELECT ename, salary*12 'Annual Salary' FROM employees;

  2. SELECT ename, salary*12 "Annual Salary" FROM employees;

  3. SELECT ename, salary*12 AS Annual Salary FROM employees;

  4. SELECT ename, salary*12 AS INITCAP("ANNUAL SALARY") FROM employees


Correct Option: B

Which operator can be used with a multiple-row subquery?

  1. =

  2. LIKE

  3. BETWEEN

  4. NOT IN

  5. Is

  6. <>


Correct Option: D
  1. SELECT last_name FROM EMP WHERE last_name LIKE '_A%';

  2. SELECT last_name FROM EMP WHERE last name ='*A%'

  3. SELECT last_name FROM EMP WHERE last name ='_A%';

  4. SELECT last_name FROM EMP WHERE last name LIKE '*A%'


Correct Option: A

Which two are character manipulation functions? (Choose two.)

  1. TRIM

  2. REPLACE

  3. TRUNC

  4. TO_DATE

  5. MOD

  6. CASE


Correct Option: A,B

Which clause should you use to exclude group results?

  1. WHERE

  2. HAVING

  3. RESTRICT

  4. GROUP BY

  5. ORDER BY


Correct Option: B

Which is an /SQL*Plus command?

  1. INSERT

  2. UPDATE

  3. SELECT

  4. DESCRIBE

  5. DELETE

  6. RENAME


Correct Option: D

A subquery can be used to _________.

  1. create groups of data

  2. sort data in a specific order

  3. convert data to a different format

  4. Retrieve data based on an unknown condition


Correct Option: D

What does the TRUNCATE statement do?

  1. Removes the table

  2. Removes all rows from a table

  3. shortens the table to 10 rows

  4. Removes all columns from a table

  5. Removes foreign keys from a table


Correct Option: B

Which substitution variable would you use if you want to reuse the variable value without prompting the user each time?

  1. "&"

  2. ACCEPT

  3. PROMPT

  4. "&&"


Correct Option: D

Which two statements about views are true? (Choose two)

  1. A.A view can be created as read only

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

  3. C.A view cannot have an ORDER BY clause in the SELECT statement

  4. D.A view cannot be created with a GROUP BY clause in the SELECT statement

  5. E.A view must have aliases defined for the column names in the SELECT statement


Correct Option: A,B

Management has asked you to calculate the value 12*salary*commission_pct for all the employees in the EMP table. The EMP table contains these columns: LAST NAME VARCHAR2(35) NOT NULL SALARY NUMBER(9,2) NOT NULL COMMISSION_PCT NUMBER(4,2) Which statement ensures that a value is displayed in the calculated column for all employees?

  1. SELECT last_name, 12*salary*commission_pct FROM emp;

  2. SELECT last_name, 12*salary* (commission_pct,0) FROM emp;

  3. SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp

  4. SELECT last_name, 12*salary*(decode(commission_pct,0)) FROM emp;


Correct Option: C

Examine the description of the STUDENTS table: STD_ID NUMBER(4) COURSE_ID VARCHAR2(10) START_DATE DATE END_DATE DATE Which two aggregate functions are valid on the START_DATE column? (Choose two.)

  1. SUM(start_date)

  2. AVG(start_date)

  3. COUNT(start_date)

  4. AVG(start_date, end_date)

  5. MIN(start_date)

  6. MAXIMUM(start_date)


Correct Option: C,E

Evaluate the SQL statement: SELECT ROUND (TRUNC (MOD (1600, 10),-1), 2) FROM dual; What will be displayed?

  1. 0

  2. 1

  3. 0.00

  4. An error statement


Correct Option: A

Examine the description of the MARKS table: STD_ID NUMBER(4) STUDENT_NAME VARCHAR2(30) SUBJ1 NUMBER(3) SUBJ2 NUMBER(3) SUBJ1 and SUBJ2 indicate the marks obtained by a student in two subjects. Examine this SELECT statement based on the MARKS table: SELECT subj1+subj2 total_marks, std_id FROM marks WHERE subj1 > AVG(subj1) AND subj2 > AVG(subj2) ORDER BY total_marks; What is the result of the SELECT statement?

  1. The statement executes successfully and returns the student ID and sum of all marks for each student who obtained more than the average mark in each subject.

  2. The statement returns an error at the SELECT clause.

  3. The statement returns an error at the WHERE clause.

  4. The statement returns an error at the ORDER BY clause.


Correct Option: C
  1. SELECT TO_CHAR(2000, '$#,###.##') FROM dual;

  2. SELECT TO_CHAR(2000, '$0,000.00') FROM dual;

  3. SELECT TO_CHAR(2000, '$9,999.00') FROM dual;

  4. SELECT TO_CHAR(2000, '$9,999.99') FROM dual;

  5. SELECT TO_CHAR(2000, '$2,000.00') FROM dual;

  6. SELECT TO_CHAR(2000, '$N,NNN.NN') FROM dual;


Correct Option: B,C,D

What is necessary for your query on an existing view to execute successfully?

  1. The underlying tables must have data.

  2. You need SELECT privileges on the view.

  3. The underlying tables must be in the same schema.

  4. You need SELECT privileges only on the underlying tables.


Correct Option: B

You define a multiple-row subquery in the WHERE clause of an SQL query with a comparison operator "=". What happens when the main query is executed?

  1. SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE > 5;

  2. SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE > 5;

  3. SELECT ENAME FROM EMP WHERE (SYSDATE-HIRE_DATE)/365 > 5;

  4. SELECT ENAME FROM EMP WHERE (SYSDATE-HIRE_DATE)* 365 > 5;


Correct Option: C
  1. The two statements produce identical results.

  2. The second statement returns a syntax error.

  3. There is no need to specify DESC because the results are sorted in descending order by default.

  4. The two statements can be made to produce identical results by adding a column alias for the salary column in the second SQL statement.


Correct Option: A
- Hide questions