0% found this document useful (0 votes)
47 views5 pages

Oracle Answers FirstDay

Oracle is a popular relational database management system provided by Oracle Corporation that is used for online transaction processing, data warehousing, and enterprise grid computing. It follows the relational database model. A database management system (DBMS) manages data stored in a database. A relational DBMS (RDBMS) stores data in tables and allows for normalization, which reduces data redundancy. Normalization divides tables and links them through relationships.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views5 pages

Oracle Answers FirstDay

Oracle is a popular relational database management system provided by Oracle Corporation that is used for online transaction processing, data warehousing, and enterprise grid computing. It follows the relational database model. A database management system (DBMS) manages data stored in a database. A relational DBMS (RDBMS) stores data in tables and allows for normalization, which reduces data redundancy. Normalization divides tables and links them through relationships.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 5

1)What is Oracle?

1)Oracle is one of the popular databases provided by Oracle Corporation,


2)It always follows Relational Datbase Management System(RDBMS).
3)It is used for online transaction processing, data warehousing, and enterprise
grid computing.

2)What is DBMS and RDBMS?

DBMS:
-----
1)DBMS Stands for Datbase Management System.
2)Data stored is in the file format.
3)There is a normalization.
4)Data stored is a small quantity.
RDBMS:
------
1)RDSMS stands for Relational Datbase Management System.
2)Data stored is in the table format.
3)Normalisation is not achievable.
4)Data is stored in a large amount.

3)What is Normalization?

1)Normalization is the process of organizing the data in the database.


2)Normalization divides the larger table into smaller and links them using
relationships.
3)Normalization is used to reduce redundancy from the database table.
There are five types of normalisation.
1)First Normalization
2)Second Normalization
3)Third Normalization
4)Fourth Normalization
5)Fifth Normalization

4)What are the Data types available in Oracle?

->Oracle supplies the following built-in datatypes:


1)character datatypes:
-------------------
CHAR
NCHAR
VARCHAR2 and VARCHAR
NVARCHAR2
CLOB
NCLOB
LONG
2)Binary datatypes:
----------------
BLOB
BFILE
RAW
LONG RAW
3)NUMBER datatype
4)DATE datatype
5)TIMESTAMP datatype

5)What is difference between VARCHAR & VARCHAR2?


VARCHAR:
--------
1)It is a datatype that used to store character and String variables.
2)VARCHAR can store characters up to 2000 bytes
3)VARCHAR will not release the unused space.
VARCHAR2:
---------
1)It is a datatype that used to store character and String variables.
2)VARCHAR2 can store characters up to 4000 bytes
3)VARCHAR2 will release the unused space.

6)What are the sub languages of sql and its commands?

There are five types of Sub languages in structure Query Language.


1)DDL - Data Definition Language
create,drop,alter,truncate,comment,rename.
2)DQL - Data Query Language - Select
3)DML - Data Manipulation Language - Insert,Update,delete
4)DCL - Data Control Language - Grant,revoke
5)TCL - Transaction Control Language - Commit,rollback,SavePoint,Set Transaction.

7)What are the parameters required to connect Database?

There are five parameters required to connect with underlying Database.


1) Hostname
2) Port number
3) Service name
4) Username
5) Password

8)What is difference between Truncate and Delete?

Truncate:
---------
1) It is an DDL Command.
2) we can not rollback the Data once removed.
3) Auto commit option is available.
4) we can not use where condition here.
Delete:
-------
1) It is an DML Command
2) we can rollback the data once removed.
3) There is no Auto commit option.
4) We can use Where condition here.

9)What are the aggregate Functions in SQL?

There are few Aggregate Functions are available in Oracle.


1) Count()
2) Sum()
3) avg()
4) min()
5) max()

10)What are the Integrity Constraints in oracle?

1)Integrity Constraints are used to apply business rules for Database tables.
2)Integrity Constraints are
1)Not null
2)Check
3)Unique
4)Primary Key
5)Foreign Key

11)What is Join and its types?

->Join is a query that is used to combine rows from one or more tables.
->There are few types of joins.
1) Inner Join
2) Outer Join
a)Left out Join
b)Right outer Join
c)Full outer Join
3) Equi Join
4) Self Join
5) Cross Join
6) Anti Join
7) Semi Join

12)what is execution order of sql clauses with in single Query?


select
|
from
|
where
|
group by
|
having
|
order by

13)What are Set operators?

1)Set operators are used to combine the results of two componet queries into a
single result.
2)There are four types of Set operators.
1)Union
2)Union all
3)Intersect
4)Minus
14)What are the Psudo columns?

There are few Psseudo columns in oracle


1)Curval and nextval
2)level
3)rowid
4)rownum

15)What are sub queries and its types?

1) Query within a query is called as Subquery.


2) It contains Outer query and inner Query parts.
3) Outer Query depends on results of inner query.
Sub queries are divided into two types.
1)Singe row Subqueries :
which returns 0 or 1 row to the outer query.
we will use = operator after where clause.
2)Multi row Sub Queries:
which returns one or more rows to the outer query
we will use in/any keywords after where clause.

16)What are the Schema Objects in Oracle?

1) A Schema is nothing but collection of logical structures of data.


2) There are few Schema Objects in Oracle.
1) Tables
2) Table Spaces
3) Sequences
4) Synonyms
5) Indexes
6) Views

17)What is the difference between SUBSTR & INSTR functions?


SUBSTR():
---------
It returns the sub-part identified by numeric values from the provided string.

Example:
[SELECT SUBSTR (‘India is my country’, 1, 4) from dual] --- will return “Indi”.

INSTR():
--------
It returns the position number of the sub-string within the string.

Example:
[SELECT INSTR (‘India is my country’, ‘a’) from dual] --- will return 5.

18)What is an NVL function and How can it be used?


By Using NVL function,We can replace values in the place of Null Values.

syntax:
NVL (Value_In, Replace_With);
NVL(null,"Sample");

19)What is the quickest way to fetch the data from a table?

The quickest way to fetch the data would be to use ROWID in the SQL query.

20)When do we use the GROUP BY clause in SQL Query?

->GROUP BY clause is used to identify and group the data by one or more columns in
the query results.
->This clause is often used with aggregate functions like COUNT, MAX, MIN, SUM,
AVG, etc.

Syntax:
SELECT COLUMN_1, COLUMN_2
FROM TABLENAME
WHERE [condition]
GROUP BY COLUMN_1, COLUMN_2

21) How can we find out the current date and time in Oracle?

We can find the current date & time using SYSDATE command in Oracle.
Syntax:
SELECT SYSDATE from dual;

22)what is difference between TRANSLATE and REPLACE?


->TRANSLATE command translates characters one by one in the provided string.
Example:
TRANSLATE (‘Missisippi’,’is’,’15); --- M155151pp1

->REPLACE command will replace a character or a set of characters with a complete


substitution string.
Example:
REPLACE (‘Missisippi’,’is’,’15); -- M15s15ippi

23)How can we find out the duplicate values in an Oracle table?

->We can find out the duplicate values by using group by and having clauses
->The below example query to fetch the duplicate records.

SELECT EMP_NAME, COUNT (EMP_NAME)


FROM EMP
GROUP BY EMP_NAME
HAVING COUNT (EMP_NAME);

24)Explain about TO_CHAR() function?

1)The Oracle TO_CHAR() function is a built-in Conversion function.


2)It converts Data Value into string value as per specified date format.
Example:
--------
1)SELECT TO_CHAR(sysdate, 'YYYY-MM-DD') FROM dual; --- 2017-08-02

2)SELECT TO_CHAR( sysdate, 'DL' ) FROM dual; -- Wednesday, August 02, 2017

3)SELECT TO_CHAR( sysdate,


'DL' ,
'NLS_DATE_LANGUAGE = FRENCH') FROM dual; --- Mercredi, Août 02,
2017

25)Explain about TO_DATE() function?

1)The Oracle TO_CHAR() function is a built-in Conversion function.


2)It converts the string value to a date value.
2)TO_DATE converts CHAR,VARCHAR2,NCHAR and NVARCHAR2 datatypes to DATE datatype.

Examples:
--------
SELECT TO_DATE('2015/05/15 8:30:25', 'YYYY/MM/DD HH:MI:SS') FROM dual;

SELECT TO_DATE( '5 Jan 2017', 'DD MON YYYY') FROM dual; -- 05-JAN-17

You might also like