| Back to Questions Page |
| |
| Question |
How we can copy one table data into another table whose name
same as table but in differ database |
Rank |
Answer Posted By |
|
Question Submitted By :: Shail_1jan |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | create table tablename select * from databasename.tablename
i'm expecting this will work. if anything wrong correct it  |
| Jayanthi Reddy |
| |
| |
| Answer | select * into databasename.<TableName> from (select * from
databasename.<TableName>)  |
| Payal [Interactive-world] |
| |
| |
| Answer | i think it is not possible to execute query at a time for
two database  |
| Nikki [Interactive-world] |
| |
| |
|
|
| |
| Question |
i want to join two queries....and i want to run them as one
after another that is want output of first query then
second , then again output of first query then second and
so on... |
Rank |
Answer Posted By |
|
Question Submitted By :: Mayu |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | declare @i int
set @i=1
while @i < 100
begin
if (@i)%2 =1
begin
select * from TABLE1
end
else
select * from TABLE2
set @i=@i + 1
end
 |
| Ashna Thampi |
| |
| |
| Question |
SYNTAX FOR VIEWS WITH EXAMPLE
HOW TO LINK TWO TABLES |
Rank |
Answer Posted By |
|
Question Submitted By :: Vijaisankar |
| This Interview Question Asked @ Microsoft |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Create View emp_dept_vw with encryption as
select emp.empid,emp.ename,dept.deptid,dept.dname
from emp,dept where emp.deptid=dept.deptid
with check option  |
| Durgaprasad |
| |
| |
| Question |
How can your resolve deadlocks? |
Rank |
Answer Posted By |
|
Question Submitted By :: Laxman |
| This Interview Question Asked @ IBM |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | A deadlock occurs when two or more
processes try to access a resource that another process has
a lock on. Microsoft SQL Server automatically
detects these deadlocks, terminates one of the processes,
and rolls back any changes made by that process.
The process chosen for termination will be the one with the
least amount of active time on the server. In
most cases, you can simply reissue the statements that were
rolled back and should have no problems.  |
| Xavier Rajan, Photon Infotech |
| |
| |
| Answer | Deadlocks occour when two or more processes place a lock on
the same resources and each process waits for the others to
release the lock.
The options to avoid deadlocks are basically the following:
1) always update data in the same order: if process A
updates table t1 and then table t2 and process B updates
table t2 and then table t1 deadlocks can occour. Choose an
order and use it everywhere in your code.
2) issue the commands again when you catch the deadlock
3) always update data before data selection: no other
process will place a lock on the modified records
4) identify the processes that can run with lower deadlock
priority and issue SET DEADLOCK_PRIORITY LOW before these
statements: this will tell SQLServer that the process is a
good candidate for killing in case of deadlock, having
the "important" processes free to run without kills  |
| Ilgian |
| |
| |
| Answer | Hi
1)
First find out which process block the other process from
activity monitor or sp_who2. Then kill that process.
2)
If update locks are more then it will make deadlock. So
reduce that.  |
| Darshan |
| |
| |
| Question |
What is the differecne between equi-join and inner-join and
natural join..Is there any difference or all are same? |
Rank |
Answer Posted By |
|
Question Submitted By :: Prashanthi |
| This Interview Question Asked @ Microsoft |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | All are same.
Eg:
SELECT
*
FROM Emp INNER JOIN Emp1
ON eid=id
SELECT
*
FROM Emp EQUI JOIN Emp1
ON eid=id
SELECT
*
FROM Emp NATURAL JOIN Emp1
ON eid=id  |
| Mobin Sathupally |
| |
| |
| Answer | INNER JOIN and EQUI-JOIN are same. Not sure about Natural
Join. Found answer in Books On Line.  |
| Monal |
| |
| |
| Question |
1. What are the grouping function in SQL ?
2. If base table of a view deleted means, what will happen
while we querying on view ? will give any error ?
3. Difference between DROP, DELETE, TRUNCATE table ?
4. What is constraints and types ?
5. What is max size of nchar & nvarchar ?
6. Define ROLLBACK, COMMIT, SAVE POINT
7. How non-clustered better ? or rank the Clustered,
Non-Clustered and Table scan in performance wise
8. Select 10 rows from a table ?
9. Define DML, DDL, DCL, DTL commands ?
10. What is mean by NULL value ? NULL means "" or 0 or
undefined ?
11. Default constraints ?
12. Can we have more then primary Key in table ?
13. Type of integrity ? Entity, Referential, Domain ?
|
Rank |
Answer Posted By |
|
Question Submitted By :: Ramesh |
| This Interview Question Asked @ Perot-Systems , Perot Systems |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | What is the difference between DROP,DELETE,TRUNCATE table ?
Delete:It's an DML command which is used for deleting
particular table in the database...even though we delete the
data we can regain it by rollback command.
Example:SQL> SELECT COUNT(*) FROM emp;
COUNT(*)
----------
14
SQL> DELESQL> SELECT COUNT(*) FROM emp;
COUNT(*)
----------
14
SQL> DELETE FROM emp WHERE job = 'CLERK';
4 rows deleted.
SQL> COMMIT;
Commit complete.
Truncate:This command is a DDL Command which is used to
delete a table...I Just Conclude it as
Truncate=Delete+Commit...once u applied this on table u
can't get the data back...but the structure will be there..
Example:
SQL> TRUNCATE TABLE emp;
Table truncated.
SQL> SELECT COUNT(*) FROM emp;
COUNT(*)
----------
0
Drop:It is used to destroy entire structure of a
table...once we apply this command on any particular table
we can't get it in anyway...so be cautious while applying
this command.
Example:
SQL> DROP TABLE emp;
Table dropped.
SQL> SELECT * FROM emp;
SELECT * FROM emp
*
ERROR at line 1:
ORA-00942: table or view does not exist  |
| Srivas |
| |
| |
| Answer | Select 10 rows from a table ?
Answer : Use TOP keyword to select 10 rows from a table.  |
| Srivas |
| |
| |
| Answer | Can we have more then primary Key in table ?
Answer : We can't use more than one Primary key in a
table because Primary key is Unique Value.  |
| Srivas |
| |
| |
| Answer | What is mean by NULL value ?NULL means "" or 0 or
undefined ?
Answer : NULL means empty ie. ""  |
| Srivas |
| |
| |
| Answer | What are the grouping function in SQL ?
Grouping functions are:
max()
min()
sum()
avg()
Select 10 rows from a table ?
select * from table_name where count(*) <=10
or
select top 10 from table _name
10. What is mean by NULL value ? NULL means "" or 0 or
undefined ?
Null is not equal to "" or 0. it is un identified value
12. Can we have more then primary Key in table ?
no, we can't.
2. If base table of a view deleted means, what will happen
while we querying on view ? will give any error ?
i dont know exactly. but it likely base table doesnt exists.
4. What is constraints and types ?
types:
primary key
foreign key
not null
unique
defaults
check
rule  |
| Laxman |
| |
| |
| Answer | 10) Null is not equal to "" or 0. it is un identified value
means suppose there is column Phone number.
If we do not any phone number we can insert NULL.
"" means empty String.
Select * from table where roll=""(EMPTY)
select * from table where roll is NULL(UNDEFINED)
2) Correct Answer.
View is made up of base tables. Suppose we select data from
two table table1 & table2 ,these are base tables.
He wants to ask u if we drop a table table2,Will view give
error.
Yes.But if we recreate the table we can query the view
again.
Try it by urself--
First create the view by selecting the data from two tables
then select columns from view
Suppose select * from view1
then drop one of the tables
then select * from view1 gives error.
12) NO.
13) ENTITY INTEGRITY--We cannit insert null in a parimary
key. CZ if two columns have tha value we cannot distinguish
b/w two rows.
REFERENTIAL INTEGRITY---Vales in foregn key table are only
those that match a value in a primary key table.
DOMAIN CONSTRAINT--A unique value for a column.
Exampl--Empid  |
| Sonia |
| |
| |
| Answer | RollBack Mean Transaction is Rolled Back to That State me
undo The Thing That we Have Done
Commit Mean Transaction is Commited to that state me the
the thing we have done is save
SavePoint is Concept of ORacle mean
For A Long Transaction we have Declare save point
intermediate so that the transction before savepoint is
commited .  |
| Dinesh Sharma |
| |
| |
| Question |
what is dba_segment |
Rank |
Answer Posted By |
|
Question Submitted By :: Rin |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | DBA_Segment is Oracle Object which contain information
about other object Created by Users like Tables,Indexes,
Veiws etc.
Its Store the information like initial ,
Extent,Min_Extent,Next_Extent, PCT_Increase,blocks, Owner of
the Object, TableSpace etc.  |
| Girish Bhoot |
| |
| |
| Question |
how to give input dynamically to a insert statement in
sqlserver |
Rank |
Answer Posted By |
|
Question Submitted By :: Y Babu |
| This Interview Question Asked @ HCL |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Declare @sql_tmp varchar(100)
set @sql_tmp="insert into table1(col1,col2..)
select 'val1','val2','') "
sp_executesql @sql_tmp  |
| Senthil Kumar.m |
| |
| |
| Question |
What is The Use Of TIMESTAMP DataType in SQL Server 2005?
|
Rank |
Answer Posted By |
|
Question Submitted By :: Dinesh Sharma |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Timestamp is used typically as a mechanism for version-
stamping table rows.  |
| Deepak Rohilla |
| |
| |
| Answer | time stamp data type is used to automatically generate the
unique number.A database-wide unique number.  |
| Xavier Rajan, Photon Infotech |
| |
| |
| Question |
How to select Distinct columns from the table, table having
20 columns and i want all coulmns |
Rank |
Answer Posted By |
|
Question Submitted By :: Bhaskar |
| This Interview Question Asked @ Wipro , MS |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | select distinct * from table_name  |
| Amit |
| |
| |
| Answer | To select distinct columns you can mention them in the SQL
query and to select all columns you can use select * from
information_schema.columns  |
| Monal |
| |
| |
| Question |
Can anyone give me information about oracle certification |
Rank |
Answer Posted By |
|
Question Submitted By :: Guest |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | You can find here in the following link :
http://oraclebabu.blogspot.com/2008/04/oracle-certification-
to-z_29.html  |
| Guest |
| |
| |
|
| |
|
Back to Questions Page |