-
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" -
Retrieve Odd and Even Rows
How to retrieve odd and even number of rows from a table?
-
-
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...
-
Additional Conditions
How will you add additional conditions in SQL?
-
Oracle : Table Level and Column Level constraints
We have two type of constraints - Table Level and Column Level. Which is better and why..?
-
-
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...
-
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
-
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? -
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". -
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.
-
Date tracking of tables
How to date track 2 tables to a previous month, using SQL code
-
Distinct values
Query to select distinct values without using distinct
-
What is difference between SQL and SQL*PLUS?
SQL*PLUS is a command line tool where as SQL and PL/SQL language interface and reporting tool. Its a command line tool that allows user to type SQL commands to be executed directly against an Oracle database. SQL is a language used to query the relational database(DML,DCL,DDL). SQL*PLUS commands are used to format query result, Set options, Edit SQL commands and PL/SQL.
-
-
Replace Alternate Character in a String
SQL query to replace every alternate character in a string to capital.
Input string:- govardhana
I need output as gOvArDhAnA
And vice versa i.e, GOVARDHANA and required output as GoVaRdHaNa
Provide 2 separate queries for above scenarios
-
Studetnt Result should get Pass (or) Fail
Hi guys try this query
If any student fails in one subject also his result should be Faile r else Pass
condtion is(marks>=40 "PASS" marks -
Performance Tuning
What is mean by Performance Tuning? Explain with example.
-
What is a pseudo column. Give some examples?
It is a column that is not an actual column in the table.eg USER, UID, SYSDATE, ROWNUM, ROWID, NULL, AND LEVEL.
Oracle SQL Interview Questions
Ans