Oracle Answers FirstDay
Oracle Answers FirstDay
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?
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.
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
->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
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?
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.
syntax:
NVL (Value_In, Replace_With);
NVL(null,"Sample");
The quickest way to fetch the data would be to use ROWID in the 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;
->We can find out the duplicate values by using group by and having clauses
->The below example query to fetch the duplicate records.
2)SELECT TO_CHAR( sysdate, 'DL' ) FROM dual; -- Wednesday, August 02, 2017
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