Machine-translated by Google. Questions are authored in English.
Top

Managing Databases with Oracle Questions and Answers

21.

To obtain the structure of an Oracle table, the command to use is:

Answer: B

Correct answer: DESCRIBE [ TableName ].

DESCRIBE, or DESC for short, lists the columns of a table or view with their datatypes and whether they accept nulls. It is a SQL*Plus command rather than SQL, so it takes no semicolon, and it works on views and procedures as well as tables.

Please log in or register to report this question.

22.

If there is only one statement and no ambiguity about what is wanted, Oracle will treat the semicolon and slash as the same.

Answer: A

Correct answer: True

With a single unambiguous statement in the buffer, ending it with a semicolon and typing a slash on the next line have the same effect: the statement is executed. The two are not interchangeable in general, however - a PL/SQL block contains semicolons within its own body, so only a slash can submit it.

Please log in or register to report this question.

Answer: C

Correct answer: A semicolon ( ; ) followed by [Enter].

The semicolon terminates the statement and submits it in one action. The forward slash on a line of its own does something slightly different: it executes whatever is currently in the buffer, which is how a statement is re-run or how a PL/SQL block, whose body contains semicolons of its own, is finally submitted.

Please log in or register to report this question.

24.

Oracle commands, column names, table names, view names and all other database elements are case sensitive.

Answer: B

Correct answer: False

They are case insensitive. Commands, table names, column names and view names may be written in any case and are matched the same way, which is why SELECT * FROM Customer and select * from CUSTOMER are identical. Case matters only within quoted strings, and in identifiers deliberately created inside double quotes.

Please log in or register to report this question.

25.

The only time that case matters is inside quotation marks of strings.

Answer: A

Correct answer: True

Case is significant only where the characters are data rather than names: inside a quoted string literal, so that WHERE name = 'Smith' does not match SMITH. Everything else - keywords, table names, column names - is matched without regard to case. Identifiers created inside double quotes are the one further exception.

Please log in or register to report this question.

26.

The default extension for an Oracle SQL*Plus file is:

Answer: D

Correct answer: .sql.

SQL*Plus assumes an extension of .sql, so a script called load.sql can be run as @load or START load with the extension left off. Files with other extensions must be named in full.

Please log in or register to report this question.

Answer: C

Correct answer: To see the errors, enter SHOW ERRORS in SQL*Plus.

SQL*Plus reports only that the procedure was created with compilation errors; the errors themselves must be asked for with SHOW ERRORS. The line numbers it then gives are counted from the start of the CREATE statement, which will not match a text editor’s numbering unless the statement begins on line one of the file.

Please log in or register to report this question.

28.

Oracle will let you define Notepad as your default editor, and whenever you type NOTEPAD, SQL*Plus will invoke Notepad.

Answer: B

Correct answer: False

The first half is right and the second wrong. An editor is defined once, with DEFINE _EDITOR, and is then invoked by typing EDIT - not by typing the editor’s own name, which SQL*Plus would not recognise as a command. The point of the arrangement is that scripts using EDIT work whatever editor has been chosen.

Please log in or register to report this question.

29.

You can check on the status of tables with the DESCRIBE or DESC command.

Answer: A

Correct answer: True

DESCRIBE, abbreviated DESC, lists the columns of a table or view with their datatypes and their nullability. It is the quickest way of confirming what a table actually contains before writing a statement against it, and it works on views and procedures too.

Please log in or register to report this question.

30.

Oracle allows the ORDER BY clause in view definitions.

Answer: A

Correct answer: True

This is the exception to the standard. SQL-92 forbids ORDER BY in a view definition, on the ground that a view is a relation and a relation is unordered; Oracle permits it. Note that the ordering is not guaranteed to survive a query against the view that imposes its own ordering or joins to something else.

Please log in or register to report this question.

Loading…

Other Subjects

Tags: Managing Databases with Oracle Questions and Answers || Managing Databases with Oracle MCQ Questions and Answers || Managing Databases with Oracle GK Questions and Answers || Managing Databases with Oracle GK MCQ Questions || Managing Databases with Oracle Multiple Choice Questions and Answers || Managing Databases with Oracle GK || GK on Managing Databases with Oracle || Database Questions and Answers || Database MCQ Questions and Answers || Database GK Questions and Answers || GK on Database