SQL conn
SQL conn
SQL> ls
SP2-0042: unknown command "ls" - rest of line ignored.
SQL> desc
Usage: DESCRIBE [schema.]object[@db_link]
SQL> select * from dual;
D
-
X
UPP
---
RAM
CONCAT('R
---------
ram shyam
CONCAT('R
---------
ram shyam
LENGTH('RAMSHYAM')
------------------
9
LEN
----------
9
*
ERROR at line 2:
ORA-00923: FROM keyword not found where expected
NEW
----------
*ram kumar
NEW
----------
*ram kumar
NEW
----------
ram kumar
TR
--
R1
SUBSTR('C
---------
chjsgzhjj
SQL> select instr('chjsgzhjj','g',1) from dual;
INSTR('CHJSGZHJJ','G',1)
------------------------
5
REVERSE('
---------
jjhzgsjhc
ABS(-3.23) NAME
---------- ----------
3.23 34
CEIL(-3.23) NAME
----------- ----------
-3 34
ROUND(-3.23) NAME
------------ ----------
-3 34
ROUND(-3.5) NAME
----------- ----------
-4 34
ROUND(-3,2) NAME
----------- ----------
-3 34
POWER(-3,3) NAME
----------- ----------
-27 34
LOG(4,2) LOG(3,2)
---------- ----------
.5 .630929754
EXP(2) EXP(10)
---------- ----------
7.3890561 22026.4658
EXP(2) EXP(-2)
---------- ----------
7.3890561 .135335283
TRUNC(5.6789,2)
---------------
5.67
NAME
---------
10-FEB-25
ADD_MONTH
---------
10-APR-25
ADD_MONTH
---------
10-DEC-24
SQL> select next_day(current_day frpom sunday) from dual;
select next_day(current_day frpom sunday) from dual
*
ERROR at line 1:
ORA-00909: invalid number of arguments
NEXT_DAY(
---------
16-FEB-25
MONTHS_BETWEEN(CURRENT_DATE,'12-FEB-2000')
------------------------------------------
299.958735
A
--
23
A
-----
$023
SQL> select to_char(sysdate,'ddth-mon-yy')as a from dual;
A
--------------------
10th-feb-25
A
----------------------------
ten-feb-25
A
------------------------------
tenth-feb-25
A
---------
07-JAN-98
A
--------
fallback
A
--
no
UPPER(NAME
----------
ALICE
BOB
CHARLIE
DAVID
EVE
FRANK
GRACE
HANK
IVY
JAKE
10 rows selected.
LOWER(NAME
----------
alice
bob
charlie
david
eve
frank
grace
hank
ivy
jake
10 rows selected.
SUBSTR(NAME,
------------
Ali
Bob
Cha
Dav
Eve
Fra
Gra
Han
Ivy
Jak
10 rows selected.
*
ERROR at line 1:
ORA-00907: missing right parenthesis
SUBSTR(NAME,(LENGTH(NAME)-3),LENGTH(NAME
----------------------------------------
lice
Bob
rlie
avid
Eve
rank
race
Hank
Ivy
Jake
10 rows selected.
SUBSTR(NAME,(LENGTH(NAME)-2),LENGTH(NAME
----------------------------------------
ice
Bob
lie
vid
Eve
ank
ace
ank
Ivy
ake
10 rows selected.
TRIM(''FRO
----------
Alice
Bob
Charlie
David
Eve
Frank
Grace
Hank
Ivy
Jake
10 rows selected.
REPLACE(JOB_TITLE,'ENGINEER','DEVLOPER')
--------------------------------------------------------------------------------
Software Devloper
Data Scientist
Devlopering Manager
System Analyst
Cybersecurity Analyst
AI Devloper
Cloud Devloper
DevOps Devloper
Network Devloper
Embeded System Devloper
10 rows selected.
CONCAT(NAME,JOB_TITLE)
--------------------------------------------------
AliceSoftware Engineer
BobData Scientist
CharlieEngineering Manager
DavidSystem Analyst
EveCybersecurity Analyst
FrankAI Engineer
GraceCloud Engineer
HankDevOps Engineer
IvyNetwork Engineer
JakeEmbeded System Engineer
10 rows selected.
SUBSTR(NAME,2,4)
----------------
lice
ob
harl
avid
ve
rank
race
ank
vy
ake
10 rows selected.
SQL> select round(salary,1000) from employees;
ROUND(SALARY,1000)
------------------
70000
75000
95000
72000
69000
80000
73000
68000
73000
10 rows selected.
SQL> select abs ((select max(salary) from employees - select min(salary) from
employees)) from employees;
select abs ((select max(salary) from employees - select min(salary) from
employees)) from employees
*
ERROR at line 1:
ORA-00907: missing right parenthesis
SQL> select abs ((select max(salary) from employees) - (select min(salary) from
employees)) from employees;
ABS((SELECTMAX(SALARY)FROMEMPLOYEES)-(SELECTMIN(SALARY)FROMEMPLOYEES))
----------------------------------------------------------------------
27000
27000
27000
27000
27000
27000
27000
27000
27000
27000
10 rows selected.
POWER((SELECTMAX(SALARY)FROMEMPLOYEES),.5)
------------------------------------------
308.2207
308.2207
308.2207
308.2207
308.2207
308.2207
308.2207
308.2207
308.2207
308.2207
10 rows selected.
LOG((SELECTMAX(SALARY)FROMEMPLOYEES),10)
----------------------------------------
.200895043
SYSDATE
---------
10-FEB-25