Sie sind auf Seite 1von 13

Finding Duplicate Values

To find duplicate values in the same field, you need to use an alias with the same table twice.
Perhaps seeing this is easier than explaining it. Notice in the following example that the customer
table is added twice to the "from" clause in the SQL statement. Then in the where clause both c1
and c2 aliases are used to refer to the same table. First we use both aliases to mach up the City
column. Then we use both aliases to exclude the primary key.
Finding Duplicates in a single column:
select c1.*
from "customer.db" c1, "customer.db" c2
where c1."City" = c2."City"
and c1."Customer No" <> c2."Customer No"
Finding Duplicates in Multiple Fields:
select c1.*
from "customer.db" c1, "customer.db" c2
where c1."City" = c2."City"
and c1."State" = c2."State"
and c1."Customer No" <> c2."Customer No"
For multiple column primary key fields, you would add a line similar to the last
line for each column.

SQL Server 7.0 supports three types of join operations:


Nested-Loop joins
Merge joins
Hash joins
In this article I want to tell you about Merge joins and when SQL Server will choose this kind of
join operation.
This is a most effective method to join the tables. The merge join will be used, if both inputs are
sorted on the merge columns. The best way, if the tables have a clustered index on the column
that joins the tables.
If you have two tables (Table1 and Table2), where n1 - the count of rows in the Table1 table, and
n2 - the count of rows in the Table2 table, and there is no index on the column that joins this
tables, then in the worse case (with Nested-Loop join) SQL Server will scan n1xn2 rows to return
a results set (for each row from the outer table the inner table will be completely scanned).
In the best case, if Table1 table has a clustered index on the column that joins the tables, and
Table2 table has a clustered index on the column that joins the tables, and there is one-to-many
relationship between Table1 and Table2, then Merge join will be used, and SQL Server will scan
n1 + n2 rows to return a results set.
This is the example:
if object_id('dbo.Table1') is not null drop table Table1
GO
CREATE TABLE Table1 (Table1_id int primary key CLUSTERED, name char(10))
GO
if object_id('dbo.Table2') is not null drop table Table2
GO
CREATE TABLE Table2 (
Table2_id int primary key NONCLUSTERED,
Table1_id int,
name char(10))
GO
CREATE CLUSTERED INDEX indTable2 ON Table2 (Table1_id)
GO
DECLARE @i int
SELECT @i = 1
WHILE @i < 1000
BEGIN
INSERT INTO Table1 VALUES (@i, LTRIM(str(@i)))
SELECT @i = @i + 1
END
GO

DECLARE @i int
SELECT @i = 1
WHILE @i < 1000
BEGIN
INSERT INTO Table2 VALUES (@i, @i, LTRIM(str(@i)))
SELECT @i = @i + 1
END
GO

SET SHOWPLAN_TEXT ON
GO
SELECT a.Table1_id, b.Table1_id FROM Table1 a INNER JOIN Table2 b
ON a.Table1_id = b.Table1_id
GO
SET SHOWPLAN_TEXT OFF
GO
These are the results:
StmtText
-------------------------------------------------------------------------------------------------------------------
|--Merge Join(Inner Join, MERGE:([a].[Table1_id])=([b].[Table1_id]),
RESIDUAL:([a].[Table1_id]=[b].[Table1_id]))
|--Clustered Index Scan(OBJECT:([Test].[dbo].[Table1].[PK__Table1__1F4E99FE] AS [a]),
ORDERED)
|--Clustered Index Scan(OBJECT:([Test].[dbo].[Table2].[indTable2] AS [b]), ORDERED)
This is a algorithm of the Merge join (description of its work in general case, for many-to-many
relationship):
while (not Table1.eof) and (not Table2.eof) do
begin
while Table2.Table1_id > Table1.Table1_id do Table1.MoveToNextRecord();
value = Table1.Table1_id;
while Table2.Table1_id < value do Table2.MoveToNextRecord();
RID = Table1.RowID();
while Table2.Table1_id = value do
begin
while Table1.Table1_id = value do
begin
< SELECT Table1.Table1_id, Table2.Table1_id >
Table1.MoveToNextRecord();
end
Table1.MoveTo(RID);
Table2.MoveToNextRecord();
end
end
NOTE. If the joined tables are small (contain only one data page for example), and at least one of
the joined tables have index on the column that joins the tables, then SQL Server will use Nested-
Loop join instead of Merge join or Hash join (usually).
Because the query optimizer usually selects the best execution plan for a given select statement, it
is not necessary to change the kind of join, but sometimes it can be useful. You can enforce the
desirable join type with OPTION clause.
This is the example to enforce Merge join:
USE pubs
GO
SET SHOWPLAN_TEXT ON
GO
SELECT a.au_id FROM authors a JOIN titleauthor b
ON a.au_id = b.au_id OPTION (MERGE JOIN)
GO
SET SHOWPLAN_TEXT OFF
GO
These are the results:
StmtText
------------------------------------------------------------------------------------------------
SELECT a.au_id FROM authors a JOIN titleauthor b
ON a.au_id = b.au_id OPTION (MERGE JOIN)

(1 row(s) affected)

StmtText
---------------------------------------------------------------------------------------------------
|--Merge Join(Inner Join, MERGE:([a].[au_id])=([b].[au_id]),
RESIDUAL:([a].[au_id]=[b].[au_id]))
|--Clustered Index Scan(OBJECT:([pubs].[dbo].[authors].[UPKCL_auidind] AS [a]),
ORDERED)
|--Index Scan(OBJECT:([pubs].[dbo].[titleauthor].[auidind] AS [b]), ORDERED)

(3 row(s) affected)

JOIN Examples

SELECT Emp.EmployeeID AS "Employee ID",


Emp.lastname + ' ' + Emp.FirstName AS "Employee Name",
Mgr.EmployeeID As "Manager ID" ,
Mgr.lastname + ' ' + Mgr.FirstName AS "Manager Name"
FROM Employees Emp JOIN Employees Mgr
ON Emp.ReportsTo = Mgr.EmployeeID

OUTPUT: (8 rows)
1 Davolio Nancy 2 Fuller Andrew
3 Leverling Janet 2 Fuller Andrew
4 Peacock Margaret 2 Fuller Andrew
5 Buchanan Steven 2 Fuller Andrew
6 Suyama Michael 5 Buchanan Steven
7 King Robert 5 Buchanan Steven
8 Callahan Laura 2 Fuller Andrew
9 Dodsworth Anne 5 Buchanan Steven
SELECT Emp.EmployeeID AS "Employee ID",
Emp.lastname + ' ' + Emp.FirstName AS "Employee Name",
Mgr.EmployeeID As "Manager ID" ,
Mgr.lastname + ' ' + Mgr.FirstName AS "Manager Name"
FROM Employees Emp LEFT JOIN Employees Mgr
ON Emp.ReportsTo = Mgr.EmployeeID

OUTPUT:
1 Davolio Nancy 2 Fuller Andrew
2 Fuller Andrew NULL NULL
3 Leverling Janet 2 Fuller Andrew
4 Peacock Margaret 2 Fuller Andrew
5 Buchanan Steven 2 Fuller Andrew
6 Suyama Michael 5 Buchanan Steven
7 King Robert 5 Buchanan Steven
8 Callahan Laura 2 Fuller Andrew
9 Dodsworth Anne 5 Buchanan Steven

1)whats the difference between Delete and Truncate?Under what conditions Truncate won't
work?
Answer : Delete is logged operation
truncate is non-logged operation. To remove entire data from table, we use this. Not for
partial data delete.

2) How do you update the rows which are divisble by 10,given a set of numbers in column
Ans: Update emp set sal = sal * 5 where (sal%10) = 0

3)what is database logging


ANs: If a operation is writing to a log file, then its called logging operation.

4)If a stored procedure is taking a table data type,how it looks?


Ans: Normally these table data types useful to return table structure data. Like functions and
output of select commands use those data.

5)How m-m relationships are implemented


Ans: Many - to - many r ship is implemented by creating derived table(s).

6)Why stored procedures are used


Ans: A bunch of sysntaxes combined togther and execution plan will be created and stored in
syscomments table and it helps performance and
reduce the network traffic. The most imp thing is the locking architecture works improve better.

7)Correlated subquery with example


ANs: If inner query is depending on outer query and the inner query executes as per the value of
outer query and the value then evaluates the outer query.
Like finding a n - th sal of an employee

to retireve n th sal of employee--

select * from emp a where (n-1) = ( select count(distinct b.sal) from emp b where b.sal> a.sal)

8)How do you know which index a table is using


Ans: by looking into exection plan of query.

9)How will you test the stored procedure taking two parameters namely first name and last name
returning full name?
Ans: Check the syntax by using sp_helptext of sp. It will show the proc defination.

10)How do you find the error,How can u know the number of rows effected by last SQL
statement,
Ans: Select @@error
Select @@rowcount

11)How can you get @@error and @@rowcount at the same time
Ans: Run the following query: Select @@error,@@rowcount.
If above one won't works:

Raiserror('error no is %d and no of rows effected is %d ',@@errror,@@rowcount) with log

Check for answer. (With log writes to eventviewr)

12)Whats the difference between primary and Unique key?


ANs: Primary key won't allow null values and where as unique does.
Only one primary key is possible and n number of uniques can implement on table

13)How many types of Indexes are there?


Ans: Clustered and non-clustered.

14)How many clustered indexe(s) one can create


ANs: Only one clustered index is possible on one table

15)what are subqueries?Give example.In which case suqueries are not feasible
Ans: Inner query executes first and gives the values to outer query to evaluate.
Subquery is not possible if returning multi values and outer query is not using in or or operators
to evaluate.
If subquery hits performnace then that will het query performance.

16)How many types of joins are there?when outer and self joins are used
Ans: Inner join: If condition is true
Outer JOin: even condition is not satisified.
1) left outer, 2) right outer ,3) Full outer (c the BOL for complete info)
Cross join: If no common column exists and requires cartieasan product values as output.
17)Questions on identity

Ans: Can u update identity value? ---- no not possible


How do u insert identity value explictly : check bol --- need to set identiy_insert <table
name>on

18)Which virtual tables does trigger use


ANs: Inserted and deleted tables, Those are cache tables.

19)how do you measure the performance of a stored procedure


ANs: No idea. Get bol. And hint is get cachehitratio about this.

20)Questions reg. Raiseerror


Ans:

21)If there is failure during updation of certain rows,what will be the state
Ans: If the transactions are set to autocommit then few rows will get effected else
all rows will be rolled back.

22)How m-m relations are maintained


Ans: I already answered for this.

23)What is the size of the database you worked


Ans: 10GB

Q1. What is the basic difference between a join and a union?


A1. A join selects columns from 2 or more tables. A union selects rows.
Q2. What is normalization and what are the five normal forms?
A2. Normalization is a design procedure for representing data in tabular format. The five
normal forms are progressive rules to represent the data with minimal redundancy.
Q3. What are foreign keys?
A3. These are attributes of one table that have matching values in a primary key in another
table, allowing for relationships between tables.
Q4. Describe the elements of the SELECT query syntax.
A4. SELECT element FROM table WHERE conditional statement.
Q5. Explain the use of the WHERE clause.
A5. WHERE is used with a relational statement to isolate the object element or row.
Q6. What techniques are used to retrieve data from more than one table in a single SQL
statement?
A6. Joins, unions and nested selects are used to retrieve data.
Q7. What is a view? Why use it?
A7. A view is a virtual table made up of data from base tables and other views, but not stored
separately.
Q8. Explain an outer join.
A8. An outer join includes rows from tables when there are no matching values in the tables.
Q9. What is a subselect? Is it different from a nested select?
A9. A subselect is a select which works in conjunction with another select. A nested select is a
kind of subselect where the inner select passes to the where criteria for the outer select.
Q10. What is the difference between group by and order by?
A10. Group by controls the presentation of the rows, order by controls the presentation of the
columns for the results of the SELECT statement.
Q11. What keyword does an SQL SELECT statement use for a string search?
A11. The LIKE keyword allows for string searches. The % sign is used as a wildcard.
Q12. What are some sql aggregates and other built-in functions?
A12. The common aggregate, built-in functions are AVG, SUM, MIN, MAX, COUNT and
DISTINCT.
Q13. How is the SUBSTR keyword used in sql?
A13. SUBSTR is used for string manipulation with column name, first position and string length
used as arguments. Eg. SUBSTR (NAME, 1 3) refers to the first three characters in the column
NAME.
Q14. Explain the EXPLAIN statement.
A14. The explain statement provides information about the optimizer's choice of access path of
the sql.
Q15. What is referential integrity?
A15. Referential integrity refers to the consistency that must be maintained between primary
and foreign keys, ie every foreign key value must have a corresponding primary key value.
Q16. What is a NULL value? What are the pros and cons of using NULLS?
A16. A NULL value takes up one byte of storage and indicates that a value is not present as
opposed to a space or zero value.
Q17. What is a synonym? How is it used?
A17. A synonym is used to reference a table or view by another name. The other name can then
be written in the application code pointing to test tables in the development stage and to
production entities when the code is migrated. The synonym is linked to the AUTHID that
created it.
Q18. What is an alias and how does it differ from a synonym?
A18. An alias is an alternative to a synonym, designed for a distributed environment to avoid
having to use the location qualifier of a table or view. The alias is not dropped when the table is
dropped.
Q19. When can an insert of a new primary key value threaten referential integrity?
A19. Never. New primary key values are not a problem. However, the values of foreign key
inserts must have corresponding primary key values in their related tables. And updates of
primary key values may require changes in foreign key values to maintain referential integrity.
Q20. What is the difference between static and dynamic sql?
A20. Static sql is hard-coded in a program when the programmer knows the statements to be
executed. For dynamic sql the program must dynamically allocate memory to receive the query
results.
Q21. Compare a subselect to a join.
A21. Any subselect can be rewritten as a join, but not vice versa. Joins are usually more efficient
as join rows can be returned immediately, subselects require a temporary work area for inner
selects results while processing the outer select.
Q22. What is the difference between IN subselects and EXISTS subselect?
A22. If there is an index on the attributes tested an IN is more efficient since DB2 uses the index
for the IN. (IN for index is the mnemonic).
Q23. What is a Cartesian product?
A23. A Cartesian product results from a faulty query. It is a row in the results for every
combination in the join tables.
Q24. What is a tuple?
A24. A tuple is an instance of data within a relational database.
Q25. What is the difference between static and dynamic sql?
A25. Static sql is compiled and optimized prior to its execution; dynamic is compiled and
optimized during execution.
Q26. Any SQL implementation covers data types in couple of main categories. Which of the
following are those data types ? (Check all that apply) A. NUMERIC B. CHARACTER C.
DATE AND TIME D. BLOBS E. BIT
A26. A,B,C. Not all SQL implementations have a BLOB or a BIT data types.
Q27. We have a table with a CHARACTER data type field. We apply a ">" row comparison
between this field and another CHARACTER field in another table. What will be the results for
records with field value of NULL ? (Check one that applies the best) A. TRUE B. FALSE C.
UNKNOWN D. Error. E. Those records will be ignored
A27. C. NULL in a row when compared will give an UNKNOWN result.
Q28. Any database needs to go through a normalization process to make sure that data is
represented only once. This will eliminate problems with creating or destroying data in the
database. The normalization process is done usually in three steps which results in first, second
and third normal forms. Which best describes the process to obtain the third normal form? (Check
one that applies the best) A. Each table should have related columns. B. Each separate table
should have a primary key. C. We have a table with multi-valued key. All columns that are
dependent on only one or on some of the keys should be moved in a different table. D. If a table
has columns not dependent on the primary keys, they need to be moved in a separate table. E.
Primary key is always UNIQUE and NOT NULL.
A28. D. All columns in a table should be dependent on the primary key. This will eliminate
transitive dependencies in which A depends on B, and B depends on C, but we're not sure how C
depends on A.
Sql server can have 2 billion tables per DB and 1024 columns per table.
Varchar can store up to 8000 bytes.
sp_executesql and Execute statements are used to execute a sql stored Procedure. The execute
statement doesn't support parameter substitution in the executed string.
Truncate method is fast, Non-logged method of deleting all rows in a table, where delete logs
each entry. Truncate immediately frees all the space occupied by table's indexes and data.
@@Rowcount is used to display the number of rows affected by last SQL statement.
@@Error displays the error number for the last SQL statement executed. The value is zero, if
there is no error.
@@identity returns the last inserted identity value.
Default sizes for databases
Master database - Stores system files - 11MB
Model database - Template for all databases - 0.75MB
Temp database - Stores temporary objects - 8MB
Msdb database - Used by SQL server agents for scheduling alerts and jobs and recording
operators- 12MB
The min. value for DB size is 512KB
The default size for DB is 1MB

Implementation of relationships

1-1 Relationship: It is the most uncommon relationship. You might use one-one relationship to
divide a table with many fields, to isolate a part of table for security reasons can be implemented
by referencing a primary key in one table to a primary key in other table.
1-m Relationship: It is the most common type of relationship, a record in Table A can have
multiple matching records in B, and where as record in B should have only one matching record
in A. It can be implemented by Primary-foreign key relationships.

M-m Relationship: Database doesn’t support m-m relationships, the same can be implemented
by introducing a third (Intermediate) table, which connects both, and it is equivalent to having 2
1-m relationships with junction table. The Intermediate table contains a foreign key which is
made up of Primary keys in I & II table. For Example the orders and products table have many-
many relationship as defined, by creating 2 1-m relationships with Order details table.

There are five normal forms


1st NF: Eliminate the repeating groups in the table.
2nd NF: All Non-key columns should depend on entire primary key, but not on partial key.
3rd NF: Eliminate interdependencies between non-key attributes.

If the table should be in 3rd normal form, the minimum no. of tables should be one.

Q. Why one should not prefix user stored procedures with sp_?
A. If the stored procedure starts with sp_, sql server first searches that sp in master database and
comes to current database. The stored procedures in master database is global, It is available to all
DB’s. It becomes a performance issue.

Query Optimizer: It is a component which analysis the query and determines the most efficient
way to request the data and thus optimizing the sql statement. The process of choosing an
execution plan out of several plans is called optimizing and this is done by query optimizer.
SQL Server Query Optimizer is a cost based optimizer. Each possible execution plan has an
associated cost in terms of computing resources. The query optimizer chooses that plan which has
lowest estimated cost.

Query Execution plan deals with the sequence in which the source tables are accessed, and the
methods used to extract the data from the table.

Optimizer Hints are used to override the Query Optimizer’s choice of execution. The five
categories of hints are Table hints, Join hints, Query hints, View hints, Lock hints.

Sql Server 2000 provides two ways to design the triggers.


1) After Trigger (Default)
2) Instead of trigger

You can specify multiple after triggering actions (Insert, Update, Delete).It can be applied to only
tables.

Instead of Triggers executes instead of triggering action. It can be applied to views and tables.
The primary advantage of this trigger is one can update a view which is made up of multiple
tables.

The two virtual tables that will be used by trigger are Inserted and Deleted tables.

Local variables are user-defined identified by @.The value can change during batch or stored
procedure in which it is used.
and Global variables are system-supplied and predefined identified by @@.

Local Temporary table is used by single user and will be deleted when user disconnects
where as global temporary tables can be used by multiple users and the tables will remain until
all users disconnect.

The order for accessing objects Server.Database.Owner.Table.Field.

A derived table is a select statement that is used as a table; it is always enclosed in parenthesis
and follows from or join. Here is an example of a derived table.

SELECT *FROM Accounts a


INNER JOIN (SELECT CustomerID, CustomerName FROM Customers) c ON a.CustomerID =
c.CustomerID.

The SELECT statement that gets data from the Customers table is the derived table.

A view is a virtual table that is made up of one or more tables. It can be used for security purpose,
hiding complex queries.

An Indexed view is a view that has unique clustered index created on it. This takes physical
storage i.e. it stores data. It will be used in OLAP, decision support where inserts/updates are low.
It can be used in the following scenarios
1) Joins and aggregation of big tables.
2) Repeated joins of the same tables on the same keys.

Replication is a set of technologies for copying and distributing the data and database objects
from one database to other and synchronizing between databases for consistency.
It allows multiple sites to keep the copies of same data .This is useful when multiple sites need to
read the same data, or need multiple servers for reporting applications.
It separates OLTP from OLAP.

Snapshot replication:
It distributes data exactly as it appears at a specific moment in time and doesn’t monitor for
updates. It can be used when data changes are infrequent. It is often used for browsing data such
as price lists, online catalog, or data for decision support where the current data is not required
and data is used as read only.

Transactional replication:
With this an initial snapshot of data is applied, and whenever data modifications are made at the
publisher, the individual transactions are captured and propagated to the subscribers.

Merge Replication:
It is the process of distributing the data between publisher and subscriber, it allows the publisher
and subscriber to update the data while connected or disconnected, and then merging the updates
between the sites when they are connected.

The distributor is the server that is responsible for synchronizing the data between publishers
and subscribers.

The where clause applies to individual rows and having clause applies only to groups.
Q.)Write a query to fetch all the managers names with the employee names in the order of
manager name.
Table: EMP
Columns
EmpId (Primary Key)
EmpName (varchar)
MgrId

A) create table emp(


EmpId char(2) Primary Key,
EmpName varchar(20),
MgrId char(2) references emp(empid))

select empl.EmpName as employee,mgr.EmpName as manager


from emp empl,emp mgr
where empl.mgrid=mgr.empid

Q) Write a query to update all the names that has spaces in front of their names (above table).
A) Update emp set empname='updated' where empname in (select empname from emp where
empname like ' %')

Q) Write a query to delete all the names that starts with J.


A) Delete from emp where empname like 'j%'

Set NoCount stops the message displaying the number of rows affected.

Temporary tables are like permanent table but they are created in tempdb, and they are deleted
automatically when no longer in use.

Collation specifies bit patterns that represent each character, and rules by which characters are
compared and sorted.

Only Bulk-Insert can run in Query Analyzer.

Alternative ways for getting row count

1) Select count (*) from table--- It will do full table scan, performance factor
2) Select rows from sysindexes where id=object_id ('table_name') and indid<2

Use constraints instead of triggers, rules and defaults, because constraints are more efficient and
boost performance.

OSQL utility allows Transact-SQL statement, stored procedures, and script files. This utility uses
ODBC to communicate with the server and ISQL uses DBLibrary to communicate with SQL
server.

BULK INSERT command is better when there is a text file import operation. Bulk Insert can’t
copy bulk data from Sql server to a data file. BCP utility is widely used for export operations
from SQL server to data file.
Two types of BCP – Logged and Non-logged BCP, Logged BCP will log the modifications and
can be used for recovery, whenever there is a failure and it is slow,
Non-logged is fast.

DBCC statements check the physical and logical consistency of the data base. It can fix the
detected problems. Ex DBCC SHOWCONTIG, DBCCREINDEX.

The database can be detached from one server and can be attached to another server/instance or
to the same server leaving the data intact, while drop statement removes the database
permanently.

New Features of SQL server

1) XML support
2) Table data types
3) Instead of Triggers
4) Cascading
5) Indexed views

Extended stored Procedure’s are DLL’s that can be loaded and executed in the address space of
SQL Server.

Distributed Query is the query which accesses the data from multiple heterogeneous data.

The purpose of with no check option in alter table is Check and foreign key constraints are not
checked during table modification.

If a view is made up of one table that view can be modified (Insert/update).

If a view consists of few columns in the table as opposed to all, then view can be modified only
when the left out columns are Nullable.

If a view is created using with check option, the data modification statements are validated
against the view’s select statement.

If a view is made up of one or more tables than view can’t be modified except through indexed
views.

Using constraints is preferred to using triggers, rules, and defaults. The query optimizer also uses
constraint definitions to build high-performance query execution plans.

Testing questions:
1. 1. What is regression testing?
2. 2. What are the SDLC followed?
3. 3. How you go about to test a refrigerator?
4. 4. How will u report your progress to your supervisor?
5. 5. How will u do weekly status report/daily report?
6. 6. How will u validate a test case? What are the documents to be taken care…?
SQL Questions:
1. 1. Inner merge join
2. 2. types of joins
3. 3. self join
4. 4. Difference between inner and outer join.
5. 5. difference between varchar and Nvarchar
6. 6. What are stored procedures?
7. 7. Difference between stored procedures and normal SQL statements?
8. 8. Reasons why we go for stored procedures
9. 9. what is identity
10. 10. how will u find out a dup in a column
11. 11. How will u find out dup in multiple columns? Whether it is possible to find out?
12. 12. The UI of your software is displayed with junk boxes…what will the cause for
these junk boxes? All the connection and system is running properly. Whether this is a
bug?

Following are the extra question I (Pankaj) got.

SQL Server:
1. Use of CASE statement.
2. I have 5 tables, I need to join these 5 tables every time and use this Output with some other
tables. What will you do in this case?
3. How can we get top 10 rows from a table?
6. How do we get, database user name, server name, version and database name.
7. Use of SET statement inside a procedure.
8. What is denormalization and on what circumstances we do that.
9. We have 1 table with a PK and 4 tables having FK referencing the PK of the first table. What
will happen if I try to delete a row from a table among the other 4 table mentioned.
10. How do we get the list of tables in a database?
11. How do we get the list of indexes and the type of the index for a table?
12. Syntax of bcp utility.
13. How do you execute a sql file from command prompt?
14. How do you update a column of a table with value in another column of the same table?
15. How do we import data from an excel sheet.

Testing:
1. You are given 5 modules to test with some deadline. First module itself you took a lot of time.
What shall you do in this situation?
2. You are given 10 modules to test and you are done. At that time your ML is absent. So what
will do in that situation?
3. You have code drop 3 running in your machine. Developer gave you drop 4, to test. Will you
test in the same machine or you will take a fresh machine to test.
4. Developer gave a drop to you to test. You got an error such that you can't proceed. The error
was due to a small mistake and so the developer came to your machine and start changing the
code in your machine. What will you do in this situation?
5. How do you report bugs in your testing.
6. How will you test a computer monitor, give that it has 4 buttons, with 1 for menu, 1 for
browsing up, 1 for browsing down, and 1 for applying the change?

Das könnte Ihnen auch gefallen