-
Distinct values
Query to select distinct values without using distinct
-
Date tracking of tables
How to date track 2 tables to a previous month, using SQL code
-
What is the purpose of a cluster?
Oracle does not allow a user to specifically locate tables, since that is a part of the function of the RDBMS. However, for the purpose of increasing performance, oracle allows a developer to create a CLUSTER. A CLUSTER provides a means for storing data from different tables together for faster retrieval than if the table placement were left to the RDBMS.
-
SQL Query to find the department (ID) wise counts in the company
Write SQL Query to find the department (ID) wise counts in the company.
Schema "employee" contains "employee_id", "employee_name", "dept_id". -
Truncate and Delete concept
Hi,
Let us take a scenario such that I issue a delete on table emp and truncate on table emp1 which is exact replica (in terms of both structure and data) of emp table.Now , I issue a commit on both sessions.
If I do a select * from emp and select * from emp1 now, which one should execute faster and why? -
What is difference between a formal and an actual parameter?
The variables declared in the procedure and which are passed, as arguments are called actual, the parameters in the procedure declaration. Actual parameters contain the values that are passed to a procedure and receive results. Formal parameters are the placeholders for the values of actual parameters
-
To get second highest age from the student table
I am trying to get second highest age from the student table.Student table:SQL> desc student; Name Null? Type ----------------------------------------- -------- ----------------- ROLLNO NUMBER NAME VARCHAR2(20) AGE NUMBERAnd...
-
-
Oracle : Table Level and Column Level constraints
We have two type of constraints - Table Level and Column Level. Which is better and why..?
-
Additional Conditions
How will you add additional conditions in SQL?
-
Difference between an implicit & an explicit cursor.
PL/SQL declares a cursor implicitly for all SQL data manipulation statements, including quries that return only one row. However,queries that return more than one row you must declare an explicit cursor or use a cursor FOR loop.Explicit cursor is a cursor in which the cursor name is explicitly assigned to a SELECT statement via the CURSOR...IS statement. An implicit cursor is used for all SQL statements...
-
-
Retrieve Odd and Even Rows
How to retrieve odd and even number of rows from a table?
-
The student who got >=40 student is passes and
S_NAME MARKS
ramu 60
ramu 40
ramu 50
karan 30
karan 96
karan 46
out put:
ramu "PASS"
karan "FAIL" -
Avoid Data Duplication
If in a table we dont use primary key or any other unique key then how to avoid duplication of data?
-
Select from table without using column name
How can I select column values from a table without knowing the column name ?Suppose , select employee_id from employees , now I don't know the column name and I want to select the column.Please let me know the answer
-
-
Find manager for employee
ID employee department manager----------------------------------------------1 Suresh c++ NULL 2 Suresh c++ NUll3 Suresh c++ 25 Sarathy testing 26 Rajaraman c# 17 joe Flash 1I have the employee detail table ,In that i want to find the manager for each employee .The employee...
-
-
Write sql query to get the below required output
I have table with col1 values , col2 1st row value should be same col1 1st row, then col 2 row onwards row each should added each row values eg: col1 values 10,20,30. Etc, in col2 values display like 10, 30,60 etc. how we can write sql query ?
Oracle SQL Interview Questions
Ans