In this blog we have discuss Introduction to SQL, PLSQL, Rules and many more ..... 

Basic concept of SQL

What is SQL?
SQL (Structured Query Language) is a standard programming language used to create, store, retrieve, update, and manage data in a relational database.

Simple Definition
SQL is a language used to communicate with a database to store, retrieve, update, and delete data.
---------------------------------------------------------------------------------------------------------------
What is SQL * Plus?
SQL*Plus is Oracle's command-line interface used to connect to an Oracle database and execute SQL and PL/SQL commands.

Simple Definition
SQL*Plus is a tool provided by Oracle that allows users to write and execute SQL commands.
-----------------------------------------------------------------------------------
Uses of SQL*Plus
Connect to Oracle Database 
Create tables 
Insert records 
Update data 
Delete records 
Retrieve data 
Run SQL scripts 

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



What is Dual table?

Dual table is owned by sys.

Dual is a part of data dictionary.

Dual is a small oracle work table which consist of only one row and one column.

Which contains the value of x in that column.

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


Also, Join my Youtube channel with the below link

Also, Join my Telegram channel with the below link

Also, join my Whatsapp group with the below link
https://chat.whatsapp.com/CCqyfPnot932cVcORhc3Vj