Study Guide

SQL*Plus MCQs with Answers (Oracle DBA Quiz)

Practice set for DBA Lecture 3. Read the full lesson first: SQL*Plus Explained: The DBA’s Command-Line Tool on eLecturesAI.

Reading a topic and knowing a topic are two different things. The quickest way to find out which one you have is to answer questions without looking at your notes.

This page has 20 MCQs, 5 short questions and a score guide, all based on DBA Lecture 3: what SQL*Plus is, connecting, handy commands, the data dictionary and SPOOL.

How to use this page
  1. Click the option you think is correct. It turns green if you are right and red if you are wrong.
  2. Read the explanation that opens under the question.
  3. If you got it wrong, use the Revise link to go back to that exact part of the lesson.
  4. Check your score at the end and follow the guide.
Score: 0 / 20  |  Answered: 0 / 20

Section 1: About the tool

Q1SQL*Plus is best described as:

Show answer

Answer: B. SQL*Plus is a client tool. You type commands, it sends them to the database and shows the answers in the same text window.

Revise: What is SQL*Plus?

Q2Why can SQL*Plus be used even on a server that has no graphical screen?

Show answer

Answer: C. It needs only a text window, so it works wherever you can get a command prompt, including servers installed without a desktop.

Revise: What is SQL*Plus?

Q3Which of these is NOT a reason DBAs like SQL*Plus?

Show answer

Answer: D. SQL*Plus is a simple text tool. It does not draw charts. Its strengths are that it runs anywhere, it is scriptable and it always comes with Oracle.

Revise: What is SQL*Plus?

Section 2: Connecting to the database

Q4Which is the correct way to start SQL*Plus and connect from the command prompt?

Show answer

Answer: B. The pattern is sqlplus user@service. SQL*Plus then asks for the password.

Revise: Connecting to the database

Q5You are already inside SQL*Plus and want to switch to a different user. Which command do you use?

Show answer

Answer: C. CONNECT username@service switches you to another user. It asks for the password, then prints “Connected.”

Revise: Connecting to the database

Q6Which command tells you which user you are currently connected as?

Show answer

Answer: A. SHOW USER always tells you who you are. The other three are not SQL*Plus commands for this job.

Revise: Connecting to the database

Q7After you run SHOW USER, SQL*Plus prints USER is "SYSTEM". What does this tell you?

Show answer

Answer: D. The text in quotes is the name of the user you are connected as. Here, that is SYSTEM, an administrator account.

Revise: Connecting to the database

Q8Why should you avoid working as an administrator when a normal user is enough?

Show answer

Answer: B. The same typing mistake is much more dangerous with powerful rights. Use the administrator account only for jobs that really need it.

Revise: Connecting to the database

Section 3: Handy SQL*Plus commands

Q9SQL*Plus keeps your last SQL command in memory. This place is called:

Show answer

Answer: C. The buffer holds your last SQL command. The commands L, / and ED all work on it.

Revise: Handy SQL*Plus commands

Q10What does the / command do at the SQL> prompt?

Show answer

Answer: A. / runs the command that is in the buffer again. L shows it, ED edits it and CLEAR SCREEN clears the window.

Revise: Handy SQL*Plus commands

Q11You made a typing mistake in a long SQL command. What is the best way to fix it?

Show answer

Answer: D. ED opens the last command in a text editor. Fix it, save, close, then type / to run it. This is much faster than retyping.

Revise: Handy SQL*Plus commands

Q12What does the L command do?

Show answer

Answer: B. L stands for LIST. It shows the SQL command currently in the buffer.

Revise: Handy SQL*Plus commands

Q13What does SET PAGESIZE 50 control?

Show answer

Answer: C. It sets how many lines SQL*Plus shows on a page before it repeats the column headings. A larger value keeps long reports cleaner.

Revise: Handy SQL*Plus commands

Section 4: The data dictionary

Q14What is the data dictionary in Oracle?

Show answer

Answer: D. The data dictionary holds information about the database: its users, tables and settings. Think of it as the notice board of a building.

Revise: Ask the database about itself

Q15Which statement shows the Oracle version?

Show answer

Answer: A. The banner column of v$version holds the version text. The other statements use the wrong view or the wrong column.

Revise: Ask the database about itself

Q16Which statement lists the tables that you own?

Show answer

Answer: B. USER_ views show what you own, so user_tables lists your tables. If it says “no rows selected”, you simply do not own any tables yet.

Revise: Ask the database about itself

Q17The data dictionary views are read-only windows into the database. What should a DBA do with them?

Show answer

Answer: C. Reading with SELECT is safe. Oracle keeps the dictionary up to date by itself, so you never edit it by hand.

Revise: Ask the database about itself

Section 5: Saving output with SPOOL

Q18What does the SPOOL command do?

Show answer

Answer: A. SPOOL file starts copying the screen output into a file. DBAs use it for reports and to keep a record of what they did.

Revise: Save output with SPOOL

Q19Which command stops spooling and closes the file?

Show answer

Answer: D. Only SPOOL OFF closes the file. Note that SPOOL END or SPOOL STOP would just start a new spool file with that name.

Revise: Save output with SPOOL

Q20Which sequence correctly saves the result of a query into a file?

Show answer

Answer: C. Start the spool first, run the query while it is on, then close it with SPOOL OFF. In the other options the query runs when no file is open.

Revise: Save output with SPOOL

Short questions (write the answers in your own words)

Don’t just read these. Write each answer on paper in 2-3 lines, then compare.

S1. Give three reasons why DBAs like SQL*Plus.

Show model answer

It runs anywhere because it needs only a text window, so it works even on servers with no graphical screen. It is scriptable, so the same commands run the same way every time. And it is always available because it comes installed with Oracle.

S2. Explain what L, / and ED do, and when you would use each.

Show model answer

All three work on the last SQL command, which SQL*Plus keeps in the buffer. L lists it so you can see it. / runs it again. ED opens it in a text editor so you can fix it without retyping. Use L to check, ED after a typing mistake, and / to run it again after fixing it.

S3. What is the data dictionary? Write two queries that read from it.

Show model answer

It is Oracle’s set of built-in tables and views that describe the database itself, such as its users and tables. It is read-only, so a DBA reads it with SELECT. Examples: SELECT username FROM all_users; lists the users, and SELECT table_name FROM user_tables; lists the tables you own.

S4. Write the SQL*Plus lines that save the list of users into the file C:\labs\users_report.txt.

Show model answer

SPOOL C:\labs\users_report.txt, then SELECT username FROM all_users;, then SPOOL OFF. The spool is started before the query and closed after it.

S5. You typed SELECT usrname FROM all_users; and got an error. Describe how to fix and run it without retyping.

Show model answer

Type L to see the command in the buffer, then ED to open it in the editor. Change usrname to username, save the file and close the editor. Back at the prompt, type / to run the corrected command.

Check your score

Count your correct MCQs (out of 20):

ScoreWhat it meansWhat to do next
18 – 20Excellent. The concepts are solid.Move on to the next lecture.
14 – 17Good, with a few gaps.Re-read only the sections linked under the questions you missed.
10 – 13Half-way there.Read the lesson again slowly, then retry this quiz tomorrow.
Below 10The basics are not settled yet.Read the full lesson once more, type the commands yourself in SQL*Plus, then retake the quiz.
Answer all 20 questions to see your result here.

Go back to the full lesson: SQL*Plus Explained →

Exam tip: Two small things cost students marks here. One is forgetting that a SPOOL file stays open until you type SPOOL OFF. The other is mixing up L (show the command), / (run it) and ED (edit it). Say each one in your own words before the exam.

Frequently asked questions

Are these MCQs enough for the exam?

They cover the whole of Lecture 3, but real exams also ask you to write short answers and commands. Practice the five short questions above as well.

What is the best way to use an MCQ quiz?

Answer first, check later. Reading the answer without trying the question gives a false feeling of knowing it.

Where do I learn the topic if I got most answers wrong?

Start with the lesson on eLecturesAI: SQL*Plus Explained: The DBA’s Command-Line Tool. Each question above also links to the exact section to revise.

Written by Engnr.Dr. Muhammad Tahir Dlbar

Leave a Reply

Your email address will not be published. Required fields are marked *