đŸ§Ē Lab 1.1: Getting Started with Oracle SQL*Plus – Beginner SQL Lab Tutorial

đŸ§Ē Lab 1.1: Exploring SQL*Plus (Command-Line Interface)

đŸŽ¯ Objective: To help students become comfortable with Oracle SQL*Plus, the command-line interface used to interact with Oracle Databases by executing SQL statements directly.

🧰 Requirements:

  • Oracle Database (XE or full version)
  • SQL*Plus (installed with Oracle)
  • Valid database user (e.g., HR, SCOTT)
  • Basic terminal or command line access

⚙️ Steps to Use SQL*Plus

✅ Step 1: Open SQL*Plus

  • Windows: Open Command Prompt and type: sqlplus
  • Linux/macOS: Open terminal and type: sqlplus

✅ Step 2: Connect to Oracle Database

sqlplus hr/hr@localhost:1521/xe

Replace hr/hr with your actual username/password and xe with your service name.

✅ Step 3: Run Basic SQL Commands

SELECT table_name FROM user_tables;

DESC employees;

SELECT first_name, last_name, salary FROM employees WHERE department_id = 90;

SELECT first_name, salary FROM employees ORDER BY salary DESC;

✅ Step 4: Format Output (Optional)

COLUMN first_name FORMAT A15
COLUMN last_name FORMAT A15

SELECT first_name, last_name, salary FROM employees;

-- Clear screen (Windows):
HOST CLS

🔚 Step 5: Exit SQL*Plus

EXIT;

📝 Lab Tasks

  1. Log in to SQL*Plus using your assigned credentials.
  2. Display all tables in your schema.
  3. View the structure of the EMPLOYEES table.
  4. Write a query to list employees earning more than 10000.
  5. Sort employees by hire date in ascending order.
  6. Exit SQL*Plus after completing all commands.

💡 Tips

  • SQL*Plus is script-friendly and fast for repeated tasks.
  • Use SET PAGESIZE and SET LINESIZE for cleaner output.
  • Great for automation, lightweight environments, and scripting.

✅ Learning Outcomes

  • Execute SQL queries directly via terminal or command prompt.
  • Understand how to retrieve, format, and sort data using SQL.
  • Gain comfort using Oracle's command-line tool for database access.
sqlplus lab tutorial, oracle sqlplus practical, oracle sql lab, sqlplus beginner guide, connect to oracle using sqlplus, sqlplus commands oracle, sqlplus vs sql developer, oracle sql command line tutorial, sqlplus practical lab, oracle sqlplus queries

āĻ•োāύ āĻŽāύ্āϤāĻŦ্āϝ āύেāχ:

āĻāĻ•āϟি āĻŽāύ্āϤāĻŦ্āϝ āĻĒোāϏ্āϟ āĻ•āϰুāύ