Real-Life Example
Imagine a college database that stores student
information.
|
Student ID |
Name |
Course |
City |
|
101 |
Rahul |
BCA |
Ahmedabad |
|
102 |
Priya |
B.Sc. IT |
Mehsana |
Using SQL, you can:
- Add
a new student.
- Search
for a student.
- Update
student details.
- Delete
a student record.
Prerequisites
Before starting SQL*Plus, ensure that:
- Oracle
Database is installed.
- Oracle
Client or Oracle XE is installed.
- Oracle
services are running.
- You know your username and password
- (e.g., system or scott).
How to Start SQL*Plus (Step-by-Step)
Method 1: Using Windows Start Menu
Step 1 Click the Start button.
Step 2 Search for: SQL Plus
Step 3 Click: SQL Plus
A login window appears.
Step 4: Enter Username
Example: Username: system
Press Enter.
Step 5: Enter Password
Example: Password: *******
(The password is hidden while typing.)
Press Enter.
Step 6: SQL Prompt Appears
If the login is successful, you will see:
SQL>
Now you can execute SQL commands.
Method 2: Using Command Prompt
Step 1 Press: Windows + R
Type: cmd
Press Enter.
Step 2 Type: sqlplus
Press Enter.
Step 3 Enter: Username: system
Password: *******
Output
Connected to: Oracle Database Express Edition
SQL>
-----------------------------------------------------------------------------------
If Using Oracle XE
You can connect using:
sqlplus system/password@XE
Example: sqlplus system/admin123@XE
Checking Connection
After login, execute:
SELECT * FROM DUAL;
Output
|
DUMMY |
|
X |
This confirms that the database connection is working.
-----------------------------------------------------------------------------------
Below command of Dual,
Desc dual;
Output:
Name null? Type
Dummy varchar2(1)
Select * from dual;
Output: D
--
x
Select 2*2 “multi” from dual;
Output: multi 4
SQL*Plus Workflow
Start SQL*Plus
│
▼
Enter Username
│
▼
Enter Password
│
▼
Connected to Oracle Database
│
▼
SQL> Prompt Appears
│
▼
Write SQL Commands
│
▼
View Output
│
▼
Commit Changes
│
▼
Exit SQL*Plus
--------------------------------------------------------------------------------------------------------------
Conclusion
SQL is the language used to work with databases, while SQL*Plus is Oracle's command-line tool that allows users to connect to the Oracle database and execute SQL and PL/SQL commands.
It is widely used in educational labs and by database administrators
and developers for database management.
Or follow my blog from the below link

0 Comments