Interview Questions
Interview Questions
12 How to find top three salary if have table of emloyee contains salary
13 Aggregate function in sql
14 Type of joins In sql
15 What is equi join
16 If indexes are for fast retrival of data in database then can create index on all columns
17 differece between primary and unique constraint
18 How many primary key can be created on a table?
23 What is hint?
32 correlated subquery
33 cardinality
34 Windowing function
35 user,all,dba
Answer
1.nvl(expr, expr ):converts a null value to an actual value and data type should be same
2.nvl2(expr1,expr2,expr3): if first expr null then return 3rd and if not null then return second
3.coalesce(exp1,expr2,…….) :return first not null value
4.nullif(expr1,expr2): it return null if both value are same and if not then it return first expr
Primary key unique indentifaction in table , it used to identify row uniquely in tables
in SQL Statement and PLSQL
null is nothing and null is not equal another null
FAST : A fast refresh is attempted. If materialized view logs are not present against the source
tables in advance, the creation fails.
COMPLETE : The tableunique
rowid is a permanent segment supporting
identifier the materialized
for that row. However,view
theisrownum
truncated and repopulated
is temporary
completely using the associated
AAABQM is the data object number query.
FORCE
• AAF: A is fast refresh is
the relative attempted.
file number If one is not possible a complete refresh is performed.
A refresh can be triggered
• AAAAA6 is the block number in one of two ways.
• AAA is the row number for the department with ID = 10
ON COMMIT : The refresh is triggered by a committed data change in one of the dependent
tables.
ON DEMAND : The refresh is initiated by a manual request or a scheduled task.
This is a DBA tool that is invaluable where complex calculations are involved. The session-
specific table is used to store temporary data which cannot be shared with other sessions. In
essence, the data in the table is valid only for the session hence the term temporary.
An Oracle hint is an optimizer directive that is embedded into an SQL statement to suggest to
Oracle how the statement should be executed
Oracle explain plan is a tool that can be used to get Oracle to tell you how it plans on executing
a query. Clearly, this makes the explain plan a valuable tool for tuning.
Select * from table(DBMS_XPLAN.DISPLAY())
A materialized view in Oracle is a database object that contains the results of a query.
1.The EXISTS condition evaluates to TRUE if the subquery returns one or more rows.
2.The NOT EXISTS condition evaluates to TRUE if the subquery returns zero rows.
A correlated SQL subquery is just a subquery that is executed many times—once for each
record (row) returned by the outer (main) query.
Number of distict value /total number of rows in table
a window function or analytic function is a function which uses values from one or multiple
rows to return a value for each row. Window functions have an OVER clause; any function
without an OVER clause is not a window function
1.All views that start with USER only sees the information that owned by same user.
2.The ALL views allow you to see all objects that you have access to.(Access,owned object)
3.They are only accessible by DBA's,if user has access to dba role then user will get unrestricted
access to oracle data dictionary.
CREATE GLOBAL
TEMPORARY TABLE
my_temp_table (
CREATE GLOBAL TEMPORARY id NUMBER,
TABLE my_temp_table ( description
id NUMBER, VARCHAR2(20)
description VARCHAR2(20) )
) ON COMMIT preserve
ON COMMIT DELETE ROWS; ROWS;
Sr. No. Questions
1 Types of Trigger
2 What is table of function
Answer
Table functions are functions that produce a collection of rows (either a nested table or a varray) that can be queried like a ph
rray) that can be queried like a physical database table
Sr. No. Questions
If you are searchin error message in log file you got error in log file now you want
to print 10 line before and 10 lines after that error then how you are going to fetch
19 this lines?
23 Display the top 5 process which are consuming high MEM and high CPU
24 Display the last date of every month of year
25 Display the last column threee field in file
26 Find file whose size is more than 100M
27 How to copy the file from one server another server
28 cut command
29 create tar
30 extract tar
31 Show content in tar
32 crontab file location
33 $#
34 $@
35 $*
36 $$
37 $!
38 nohup
39 How to debug shell script
40 what is swap
41 Zombie process
Hard Links
41
42 Soft Links
43 Why we use export
44 What is fuser command
53 := in shell script
54 rsync
Answer
grep -v '^$' small.txt
sed -n '/^$/!p' sample.csvac
/etc/profile and .bash_profile
ls -lhrS
both are secure file copying tool , scp is for linux and winscp for windows
find /home/oracle -type f -mtime +10 -maxdepth 1
find /home/oracle -type f -mtime +10 -maxdepth 1 -exec rm {} \;
find /home/oracle -maxdepth 1 -type f -mmin +240 -mtime -10 -exec rm {} \;
find . -newermt "2021-07-11 13:00:00" ! -newermt "2021-07-11 14:02:00"
sed -n '10,20p' sample.csv
free for memory usage and df disk space usage
check the process running in shell with jobs command and execute fg 2 command with jobs number
CTL+Z and bg 2
"@reboot sh /home/apache/shell_script.sh"
sort -u small.txt
sort small.txt |uniq -d display distinct lines of duplicates
sort small.txt |uniq -D --Display duplicate all duplicate line
sort small.txt |uniq -c
grep 'Error' -B 10 -A 10 sample.csv
top
free and top
nohup (No Hang Up) is a command in Linux systems that runs the process even after logging out
from the shell/terminal
Nohup command prevents the process from receiving this signal upon closing or exiting the
terminal/shell
sh -x script_name.sh
Swap space in Linux is used when the amount of physical memory (RAM) is full. If the system
needs more memory resources and the RAM is full, inactive pages in memory are moved to the
swap space
A zombie process is a process whose execution is completed but it still has an entry in the process table
hard linked file is assigned the same Inode value as the original,therefore they reference the
same physical file location
therefore they reference the same physical file location
If original file is removed then the link will still show the content of the file.
A soft link is similar to the file shortcut feature which is used in Windows Operating systems.
Each soft linked file contains a separate Inode value that points to the original file
if the original file is deleted or moved, the soft linked file will not work correctly
Makes variable public in subshells
utility used to find which process is using a file, a directory or a socket.
If you want to display the stadard output to the terminal and redirect to the files at same time
is used to find out which files are open by which process.
To display a file with line numbers
rpm -qa –last
Who is logged in the linux system and what are they currently doing
Who is logged in the linux system
process id of currently logged in shell instance
default system shell
":=", which sets the variable to the default if it is undefined: echo "Your name is : $
{myname:=John Doe}"
1 What is ITIL?
2 Problem
3 Problem Mangament
4 Incident Management
Answer
The ITIL (Information Technology Infrastructure Library) is a framework designed to standardize the selection, planning, delive
overall lifecycle of IT (information technology) services within a business. The goal is to improve efficiency and achieve predict
The ITIL framework enables IT administrators to be business service partners, rather than just back-end support. ITIL guideline
align IT department actions and expenses to business needs and change them as the business grows or shifts direction.
A problem is the cause or potential cause of multiple incidents. Problems can arise from major incidents affecting many users,
incidents. Further, problems can be identified in infrastructure diagnostic systems before users are affected.
Problem management is a procedural way to minimize incidents, It includes finding root causes and fixes, and also reduce the
incidents through suitable documentation of existing issues and providing workarounds.
In ITIL, we define an incident as unplanned interruption to a service or reduction in the quality of a service. Each incident shou
managed to ensure that it is resolved in a time that meets the expectations of the customer and user
Sr. No. Questions
Answer
Sr. No. Questions
Answer