ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories >> Software >> Databases >> SQL-PLSQL
 
 


 

Back to Questions Page
 
Question
I have a Employee table with columns 
ename,eid,salary,deptno. How to retrieve sum of salary  for 
each deptno?
Rank Answer Posted By  
 Question Submitted By :: Suma
This Interview Question Asked @   L&T
I also faced this Question!!   © ALL Interview .com
Answer
select deptno,sum(sal)  from employee
group by deptno;
 
0
Kavithanedigunta
 
 
Answer
SELECT COUNT(EID) AS EMPLOYEE,DEPTNON,SUM(SALARY) FROM
EMPLOYEE GROUP BY DEPTNO
 
0
Madhusudan Darshannkar
 
 
Answer
its right first one
 
0
Rs
 
 
 
Answer
Select sum(salary) from Employee group by deptno
 
0
Radheshyam Mali
 
 
Question
why sql is used as interpreter frequently rather than a 
compile?
Rank Answer Posted By  
 Question Submitted By :: Suvarchala
I also faced this Question!!   © ALL Interview .com
Answer
Interprter works line by line but compiler execute its all 
work as a program..like if any sql query has error then sql 
will how that x line has error ..
 
0
Hemant
 
 
Question
What is the default value of CHAR type?
Rank Answer Posted By  
 Question Submitted By :: Raja K
This Interview Question Asked @   Bosch
I also faced this Question!!   © ALL Interview .com
Answer
The default value of char and number is null.
The default size is taken as 1 for char.
 
0
Priyanka
 
 
Question
I have 2 Databases. How can create a table in particular
database? How can i know the list of tables presented each
database?( in oracle 10g)
Rank Answer Posted By  
 Question Submitted By :: Raam
This Interview Question Asked @   Relq
I also faced this Question!!   © ALL Interview .com
Answer
suppose you have two databases: db1 and db2
you have to select one of them
as
sql>use db1;
then use
sql>select * from tab;
it will show you the listing required.!
 
0
Neeraj Sinha
 
 
Answer
Suppose your 2 databases are name as PROD1 and PROD2
1) How can create a table in particular database?
=> First you have to connect to the database where you want 
to create table with given login and password.
and then if you have create permission than you can use 
following sql
CREATE TABLE "table_name"
("column 1" "data_type_for_column_1",
"column 2" "data_type_for_column_2",
... )

2) select * from tab; will show you how many tables,view or 
synonyms are there in your schema.
 
0
Amit
 
 
Answer
you can also use the database links to get the data from 
other database tables. syntax is table_name@db_link.
 
0
Vishnu
 
 
Question
suppose we have a table in which 200 rows. i want to find 
101 row ? what the query....
and how we find 4th and 5th highest salary  and 1 to 10 
highest salary
Rank Answer Posted By  
 Question Submitted By :: Sharad Singh
I also faced this Question!!   © ALL Interview .com
Answer
Let Table name : Employee
Let the columns: Employee_name, Salary

To find 101st row:

select * from (select * from Employee order by
emplayee_name) where rownum = 101

To find 4th highest salary

select * from (select * from Employee order by salary desc)
where rownum = 4


To find 5th highest salary

select * from (select * from Employee order by salary desc)
where rownum = 4


To find 1 to 10 highest salary

select * from (select * from Employee order by salary desc)
where rownum < 11
 
0
Basavaraj Yadwad
 
 
Answer
select * from emp where (rowid,0) in 
(select rowid,mod(rownum,101) from emp)
and rownum=1
 
0
Hemant
 
 
Answer
if you have table temp_test1 

you fire
select * from temp_test1 
now you want 101 rows 
basic thing here is records are sorted by rowid as per 
insertion

for 101 th row 

select * from temp_test1 where rowid in(
 (select max(rowidtochar(rowid)) from temp_test1 where 
rownum<102))
this is asked in tech mahindra
 
0
Vishnu
 
 
Question
What does “select count(1) from tab” result?
Rank Answer Posted By  
 Question Submitted By :: Vinod
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
select count(1) from tab will give the total number of 
tables,views and synonms present in the current schema.
 
0
Gourvendra Singh
 
 
Answer
It will give the latest row of the table.
 
0
Mahi
 
 
Answer
A column function does not use any column name.
 
0
Ali
 
 
Question
What does “select count(*) from tab” result?
Rank Answer Posted By  
 Question Submitted By :: Vinod
This Interview Question Asked @   IBM
I also faced this Question!!   © ALL Interview .com
Answer
Will display the count of the Tables on the Schema.
 
0
Sudheer
 
 
Answer
display count of all rows from relation
 
0
Amit Kumar Jaswal
 
 
Answer
This results the total count of tables,views,synonyms and
sequences present in a schema.
 
0
Rahul Koshti
 
 
Answer
display all the table which are currently in the schema.
 
0
Kamal Kishore Kashyap
 
 
Answer
This results the total count of tables,views,synonyms 
present in a schema.
 
0
Nisha
 
 
Question
What are the new features in Oracle 10g. Compared to Oracle 
9i?
Rank Answer Posted By  
 Question Submitted By :: Selvaraj V
This Interview Question Asked @   Polaris
I also faced this Question!!   © ALL Interview .com
Answer
# Flashback Enhancements -Flashback Version Query, Flashback
Transaction Query, LOB Handling with Flashback, Setting up
for Flashback, Flashback Table, Flashback Drop Table and
Recycle Bin management.

# Backup and Recovery Enhancements - Flash Recovery Area,
Flashback Database (setup, flashback logs and use), Restore
Points, Simplified Recovery through RESETLOGS, Compressed
Backups, Change Tracking, Incrementally Updated Image
Copies, SWITCH DATABASE, New V$ Views, Encrypted Backups,
DROP DATABASE, CATALOG, Oracle Secure Backup and more.

# Automatic Storage Management - An introduction to Oracle's
new integrated file system and volume manager. Examples
illustrate the basic use of ASM, including creating disk
groups, fail groups, and using ASMCMD.

# Job Scheduler - Use the new DBMS_SCHEDULER package to
schedule jobs, including OS scripts. Examples illustrate
creating and scheduling jobs in both a Linux and a Windows
environment.

# SQL Enhancements - Regular expressions, DML error logging,
case-insensitive sort and search, MERGE enhancements, MODEL
queries, XQUERY and much more.

# PL/SQL Enhancements -The new optimizing compiler, compiler
warning messages, debugging improvements, native compilation
enhancements, UTL_MAIL and more.

# Performance and Tuning Features - Automatic SGA
Management, Automatic Workload Repository (AWR), Advisors
(ADDM, SQL Tuning Advisor, etc), Active Session History
data, new performance statistics (e.g. metrics and database
time), Thresholds and Server-Generated Alerts, CBO
Enhancements and much more.

# Security and Auditing Enhancements - Changes to the
CONNECT Role, FGAC Review, FGAC / VPD Enhancements, FGA
Review, Fine Grained Auditing Enhancements, Encryption
Enhancements, DBMS_CRYPTO Package (R1) and Transparent Data
Encryption (R2).

# Tablespace, Table and Segment Management - SYSAUX
tablespace, BIGFILE and SMALLFILE tablespaces,
database-level default tablespace, database-level default
temp tablespace, temp tablespace groups, multi-platform
transportable tablespace, renaming tablespaces, predicting
object growth, online table redefinition enhancements and
online segment shrink.

# Utilities (Data Pump) - An example-based introduction to
Data Pump, the next generation export / import utility. Also
covered: External Table and Logminer enhancements.

# SQL*Plus Enhancements - New predefined variables, SPOOL
command enhancements, AUTOTRACE enhancements and more.

# Miscellaneous Enhancements - Guaranteed UNDO retention,
ROLLBACK monitoring, Easy Connect (EZCONNECT) connections,
database high watermark recording, database feature usage
tracking and new and deprecated initialization parameters.
 
2
Kebiraj
 
 
 
Back to Questions Page
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com